Danfo DataFrame: column missing counts and a deliberate zero comparison

HTML for this example

Select the code and use your copy shortcut. Changes in this preview are temporary.

<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Inspection readings: missing is different from zero</title><style>*{box-sizing:border-box}body{margin:0;padding:20px;font:16px/1.6 system-ui;color:#243346;max-width:960px}h1{font-size:26px;line-height:1.2}button{font:inherit;padding:8px;margin:5px}pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#f1f4f8;padding:14px}.charts{display:flex;flex-wrap:wrap;gap:16px}.chart{width:300px;max-width:100%}.dc-chart .row rect{fill:#315c85;cursor:pointer}.dc-chart .row text{fill:white}.dc-chart .selected rect{fill:#bd6200}.dc-chart .deselected rect{fill:#b7c0ca}svg{max-width:100%}</style><h1>Inspection readings: missing is different from zero</h1><p>Fictional exercise. No operational record is submitted or saved.</p><button id="zero">Replace missing reading with supplied zero</button><button id="restore">Restore missing reading</button><pre id="reading" role="status"></pre><script>/*! For license information please see bundle.js.LICENSE.txt */
var dfd;(()=>{var e={15741:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},91315:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},12529:(e,t,r)=>{var n=r(15741);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},96388:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},99640:e=>{function t(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)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},44024:e=>{e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},9917:e=>{function t(){return e.exports=t=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},e.exports.default=e.exports,e.exports.__esModule=!0,t.apply(this,arguments)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},22948:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},97262:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},7698:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw a}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},17350:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},70630:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},16592:(e,t,r)=>{var n=r(91315),a=r(7698),i=r(80922),o=r(17350);e.exports=function(e,t){return n(e)||a(e,t)||i(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},34906:(e,t,r)=>{var n=r(12529),a=r(97262),i=r(80922),o=r(70630);e.exports=function(e){return n(e)||a(e)||i(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},80812:e=>{function t(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},80922:(e,t,r)=>{var n=r(15741);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},28962:(e,t,r)=>{e.exports=r(73005)},26306:(e,t,r)=>{var n=r(17424),a=r(59363),i=r(55766),o=r(79491),s=r(66837),l=r(55016),c=r(6881);c.alea=n,c.xor128=a,c.xorwow=i,c.xorshift7=o,c.xor4096=s,c.tychei=l,e.exports=c},17424:function(e,t,r){var n;!function(e,a,i){function o(e){var t,r=this,n=(t=4022871197,function(e){e=e.toString();for(var r=0;r<e.length;r++){var n=.02519603282416938*(t+=e.charCodeAt(r));n-=t=n>>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var r=new o(e),n=t&&t.state,a=r.next;return a.int32=function(){return 4294967296*r.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.alea=l}(0,e=r.nmd(e),r.amdD)},55016:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,a=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)t.b^=0|r.charCodeAt(n),t.next()}function s(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.tychei=l}(0,e=r.nmd(e),r.amdD)},59363:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor128=l}(0,e=r.nmd(e),r.amdD)},66837:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,r,n=t.w,a=t.X,i=t.i;return t.w=n=n+1640531527|0,r=a[i+34&127],e=a[i=i+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=a[i]=r^e,t.i=i,r+(n^n>>>16)|0},function(e,t){var r,n,a,i,o,s=[],l=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,l=Math.max(l,t.length)),a=0,i=-32;i<l;++i)t&&(n^=t.charCodeAt((i+32)%t.length)),0===i&&(o=n),n^=n<<10,n^=n>>>15,n^=n<<4,n^=n>>>13,i>=0&&(o=o+1640531527|0,a=0==(r=s[127&i]^=n+o)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,i=512;i>0;--i)n=s[a+34&127],r=s[a=a+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[a]=n^r;e.w=o,e.X=s,e.i=a}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.X&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor4096=l}(0,e=r.nmd(e),r.amdD)},79491:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,r,n=t.x,a=t.i;return e=n[a],r=(e^=e>>>7)^e<<24,r^=(e=n[a+1&7])^e>>>10,r^=(e=n[a+3&7])^e>>>3,r^=(e=n[a+4&7])^e<<7,e=n[a+7&7],r^=(e^=e<<13)^e<<9,n[a]=r,t.i=a+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r<t.length;++r)n[7&r]=n[7&r]<<15^t.charCodeAt(r)+n[r+1&7]<<13;for(;n.length<8;)n.push(0);for(r=0;r<8&&0===n[r];++r);for(8==r?n[7]=-1:n[r],e.x=n,e.i=0,r=256;r>0;--r)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.x&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorshift7=l}(0,e=r.nmd(e),r.amdD)},55766:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),n==r.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorwow=l}(0,e=r.nmd(e),r.amdD)},6881:(e,t,r)=>{var n;!function(a,i){var o,s=this,l=256,c=i.pow(l,6),u=i.pow(2,52),f=2*u,p=255;function h(e,t,r){var n=[],p=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,v(a)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(l):(e=new Uint8Array(l),(s.crypto||s.msCrypto).getRandomValues(e)),v(e)}catch(e){var t=s.navigator,r=t&&t.plugins;return[+new Date,s,r,s.screen,v(a)]}}():e,3),n),h=new d(n),b=function(){for(var e=h.g(6),t=c,r=0;e<u;)e=(e+r)*l,t*=l,r=h.g(1);for(;e>=f;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|h.g(4)},b.quick=function(){return h.g(4)/4294967296},b.double=b,y(v(h.S),a),(t.pass||r||function(e,t,r,n){return n&&(n.S&&m(n,h),e.state=function(){return m(h,{})}),r?(i.random=e,t):e})(b,p,"global"in t?t.global:this==i,t.state)}function d(e){var t,r=e.length,n=this,a=0,i=n.i=n.j=0,o=n.S=[];for(r||(e=[r++]);a<l;)o[a]=a++;for(a=0;a<l;a++)o[a]=o[i=p&i+e[a%r]+(t=o[a])],o[i]=t;(n.g=function(e){for(var t,r=0,a=n.i,i=n.j,o=n.S;e--;)t=o[a=p&a+1],r=r*l+o[p&(o[a]=o[i=p&i+t])+(o[i]=t)];return n.i=a,n.j=i,r})(l)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function g(e,t){var r,n=[],a=typeof e;if(t&&"object"==a)for(r in e)try{n.push(g(e[r],t-1))}catch(e){}return n.length?n:"string"==a?e:e+"\0"}function y(e,t){for(var r,n=e+"",a=0;a<n.length;)t[p&a]=p&(r^=19*t[p&a])+n.charCodeAt(a++);return v(t)}function v(e){return String.fromCharCode.apply(0,e)}if(i.seedrandom=h,y(i.random(),a),e.exports){e.exports=h;try{o=r(80864)}catch(e){}}else void 0===(n=function(){return h}.call(t,r,t,e))||(e.exports=n)}([],Math)},19291:(e,t,r)=>{var n=r(72319),a=r(33254),i=r(53533),o=r(33957),s=r(78016),l=r(51971),c=r(10061);c.alea=n,c.xor128=a,c.xorwow=i,c.xorshift7=o,c.xor4096=s,c.tychei=l,e.exports=c},72319:function(e,t,r){var n;!function(e,a,i){function o(e){var t,r=this,n=(t=4022871197,function(e){e=e.toString();for(var r=0;r<e.length;r++){var n=.02519603282416938*(t+=e.charCodeAt(r));n-=t=n>>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var r=new o(e),n=t&&t.state,a=r.next;return a.int32=function(){return 4294967296*r.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.alea=l}(0,e=r.nmd(e),r.amdD)},51971:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,a=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)t.b^=0|r.charCodeAt(n),t.next()}function s(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.tychei=l}(0,e=r.nmd(e),r.amdD)},33254:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor128=l}(0,e=r.nmd(e),r.amdD)},78016:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,r,n=t.w,a=t.X,i=t.i;return t.w=n=n+1640531527|0,r=a[i+34&127],e=a[i=i+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=a[i]=r^e,t.i=i,r+(n^n>>>16)|0},function(e,t){var r,n,a,i,o,s=[],l=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,l=Math.max(l,t.length)),a=0,i=-32;i<l;++i)t&&(n^=t.charCodeAt((i+32)%t.length)),0===i&&(o=n),n^=n<<10,n^=n>>>15,n^=n<<4,n^=n>>>13,i>=0&&(o=o+1640531527|0,a=0==(r=s[127&i]^=n+o)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,i=512;i>0;--i)n=s[a+34&127],r=s[a=a+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[a]=n^r;e.w=o,e.X=s,e.i=a}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.X&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor4096=l}(0,e=r.nmd(e),r.amdD)},33957:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,r,n=t.x,a=t.i;return e=n[a],r=(e^=e>>>7)^e<<24,r^=(e=n[a+1&7])^e>>>10,r^=(e=n[a+3&7])^e>>>3,r^=(e=n[a+4&7])^e<<7,e=n[a+7&7],r^=(e^=e<<13)^e<<9,n[a]=r,t.i=a+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r<t.length;++r)n[7&r]=n[7&r]<<15^t.charCodeAt(r)+n[r+1&7]<<13;for(;n.length<8;)n.push(0);for(r=0;r<8&&0===n[r];++r);for(8==r?n[7]=-1:n[r],e.x=n,e.i=0,r=256;r>0;--r)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.x&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorshift7=l}(0,e=r.nmd(e),r.amdD)},53533:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),n==r.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorwow=l}(0,e=r.nmd(e),r.amdD)},10061:(e,t,r)=>{var n;!function(a,i){var o,s=this,l=256,c=i.pow(l,6),u=i.pow(2,52),f=2*u,p=255;function h(e,t,r){var n=[],p=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,v(a)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(l):(e=new Uint8Array(l),(s.crypto||s.msCrypto).getRandomValues(e)),v(e)}catch(e){var t=s.navigator,r=t&&t.plugins;return[+new Date,s,r,s.screen,v(a)]}}():e,3),n),h=new d(n),b=function(){for(var e=h.g(6),t=c,r=0;e<u;)e=(e+r)*l,t*=l,r=h.g(1);for(;e>=f;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|h.g(4)},b.quick=function(){return h.g(4)/4294967296},b.double=b,y(v(h.S),a),(t.pass||r||function(e,t,r,n){return n&&(n.S&&m(n,h),e.state=function(){return m(h,{})}),r?(i.random=e,t):e})(b,p,"global"in t?t.global:this==i,t.state)}function d(e){var t,r=e.length,n=this,a=0,i=n.i=n.j=0,o=n.S=[];for(r||(e=[r++]);a<l;)o[a]=a++;for(a=0;a<l;a++)o[a]=o[i=p&i+e[a%r]+(t=o[a])],o[i]=t;(n.g=function(e){for(var t,r=0,a=n.i,i=n.j,o=n.S;e--;)t=o[a=p&a+1],r=r*l+o[p&(o[a]=o[i=p&i+t])+(o[i]=t)];return n.i=a,n.j=i,r})(l)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function g(e,t){var r,n=[],a=typeof e;if(t&&"object"==a)for(r in e)try{n.push(g(e[r],t-1))}catch(e){}return n.length?n:"string"==a?e:e+"\0"}function y(e,t){for(var r,n=e+"",a=0;a<n.length;)t[p&a]=p&(r^=19*t[p&a])+n.charCodeAt(a++);return v(t)}function v(e){return String.fromCharCode.apply(0,e)}if(i.seedrandom=h,y(i.random(),a),e.exports){e.exports=h;try{o=r(31435)}catch(e){}}else void 0===(n=function(){return h}.call(t,r,t,e))||(e.exports=n)}([],Math)},58912:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Abs:()=>Ze,Acos:()=>Ke,Acosh:()=>Je,AdadeltaOptimizer:()=>Dl,AdagradOptimizer:()=>Al,AdamOptimizer:()=>El,AdamaxOptimizer:()=>Ol,Add:()=>Qe,AddN:()=>et,All:()=>tt,Any:()=>rt,ArgMax:()=>nt,ArgMin:()=>at,Asin:()=>it,Asinh:()=>ot,Atan:()=>st,Atan2:()=>ct,Atanh:()=>lt,AvgPool:()=>ut,AvgPool3D:()=>pt,AvgPool3DGrad:()=>ht,AvgPoolGrad:()=>ft,BatchMatMul:()=>dt,BatchToSpaceND:()=>mt,Bincount:()=>gt,BroadcastArgs:()=>vt,BroadcastTo:()=>yt,Callback:()=>wk,CallbackList:()=>wv,Cast:()=>bt,Ceil:()=>xt,ClipByValue:()=>_t,Complex:()=>wt,ComplexAbs:()=>kt,Concat:()=>Dt,Conv2D:()=>Tt,Conv2DBackpropFilter:()=>At,Conv2DBackpropInput:()=>St,Conv3D:()=>Mt,Conv3DBackpropFilterV2:()=>Et,Conv3DBackpropInputV2:()=>Ct,Cos:()=>Nt,Cosh:()=>Ot,CropAndResize:()=>Pt,Cumsum:()=>It,CustomCallback:()=>Tv,DataStorage:()=>H,DenseBincount:()=>Rt,DepthToSpace:()=>Lt,DepthwiseConv2dNative:()=>Ft,DepthwiseConv2dNativeBackpropFilter:()=>Bt,DepthwiseConv2dNativeBackpropInput:()=>zt,Diag:()=>jt,Dilation2D:()=>Ut,Dilation2DBackpropFilter:()=>Vt,Dilation2DBackpropInput:()=>$t,ENV:()=>Ge,EarlyStopping:()=>Tk,Einsum:()=>Wt,Elu:()=>Ht,EluGrad:()=>Gt,Environment:()=>Ve,Equal:()=>Yt,Erf:()=>Xt,Exp:()=>Zt,ExpandDims:()=>Kt,Expm1:()=>Jt,FFT:()=>Qt,Fill:()=>er,FlipLeftRight:()=>tr,Floor:()=>rr,FloorDiv:()=>nr,FromPixels:()=>Kn,FusedBatchNorm:()=>ar,FusedConv2D:()=>ea,FusedDepthwiseConv2D:()=>ta,GatherNd:()=>or,GatherV2:()=>ir,GraphModel:()=>UD,Greater:()=>sr,GreaterEqual:()=>lr,History:()=>Dv,IFFT:()=>ur,Identity:()=>cr,Imag:()=>fr,InputSpec:()=>cv,IsFinite:()=>pr,IsInf:()=>hr,IsNan:()=>dr,KernelBackend:()=>G,LRN:()=>Tr,LRNGrad:()=>Ar,LayerVariable:()=>ov,LayersModel:()=>Cb,LeakyRelu:()=>mr,Less:()=>gr,LessEqual:()=>yr,LinSpace:()=>vr,Log:()=>br,Log1p:()=>xr,LogSoftmax:()=>Dr,LogicalAnd:()=>_r,LogicalNot:()=>wr,LogicalOr:()=>kr,Max:()=>Sr,MaxPool:()=>Er,MaxPool3D:()=>Nr,MaxPool3DGrad:()=>Or,MaxPoolGrad:()=>Cr,MaxPoolWithArgmax:()=>Ir,Maximum:()=>Mr,Mean:()=>Pr,Min:()=>Rr,Minimum:()=>Lr,MirrorPad:()=>Fr,Mod:()=>Br,MomentumOptimizer:()=>Pl,Multinomial:()=>zr,Multiply:()=>jr,Neg:()=>Ur,NonMaxSuppressionV3:()=>Vr,NonMaxSuppressionV4:()=>qr,NonMaxSuppressionV5:()=>Wr,NotEqual:()=>$r,OP_SCOPE_SUFFIX:()=>Ti,OneHot:()=>Gr,OnesLike:()=>Hr,Optimizer:()=>kl,OptimizerConstructors:()=>Ll,Pack:()=>Xr,PadV2:()=>Yr,Pool:()=>Zr,Pow:()=>Kr,Prelu:()=>Jr,Prod:()=>Qr,RMSPropOptimizer:()=>Rl,RNN:()=>Lx,Range:()=>en,Rank:()=>Za,Real:()=>tn,RealDiv:()=>qt,Reciprocal:()=>rn,Reduction:()=>lh,Relu:()=>nn,Relu6:()=>un,Reshape:()=>an,ResizeBilinear:()=>ln,ResizeBilinearGrad:()=>cn,ResizeNearestNeighbor:()=>on,ResizeNearestNeighborGrad:()=>sn,Reverse:()=>fn,RotateWithOffset:()=>Jn,Round:()=>pn,Rsqrt:()=>hn,SGDOptimizer:()=>Il,ScatterNd:()=>dn,Select:()=>mn,Selu:()=>gn,Sequential:()=>Ib,Sigmoid:()=>_n,Sign:()=>xn,Sin:()=>vn,Sinh:()=>bn,Slice:()=>yn,Softmax:()=>Sn,Softplus:()=>wn,SpaceToBatchND:()=>Tn,SparseFillEmptyRows:()=>Mn,SparseReshape:()=>En,SparseSegmentMean:()=>Cn,SparseSegmentSum:()=>Nn,SparseToDense:()=>On,SplitV:()=>An,Sqrt:()=>kn,Square:()=>Pn,SquaredDifference:()=>In,Step:()=>Zn,StridedSlice:()=>Rn,StringNGrams:()=>Ln,StringSplit:()=>Fn,StringToHashBucketFast:()=>Bn,Sub:()=>zn,Sum:()=>Dn,SymbolicTensor:()=>uv,Tan:()=>jn,Tanh:()=>Un,Tensor:()=>Ga,TensorBuffer:()=>Va,Tile:()=>$n,TopK:()=>Vn,Transform:()=>qn,Transpose:()=>Wn,Unique:()=>Hn,Unpack:()=>Gn,UnsortedSegmentSum:()=>Xn,Variable:()=>Ya,ZerosLike:()=>Yn,_FusedMatMul:()=>Qn,abs:()=>Cl,acos:()=>Fl,acosh:()=>Bl,add:()=>ll,addN:()=>zl,all:()=>jl,any:()=>Ul,argMax:()=>$l,argMin:()=>Vl,asin:()=>ql,asinh:()=>Wl,atan:()=>Hl,atan2:()=>Gl,atanh:()=>Xl,avgPool:()=>uc,avgPool3d:()=>fc,backend:()=>ol,backend_util:()=>y,basicLSTMCell:()=>gc,batchNorm:()=>vc,batchNorm2d:()=>bc,batchNorm3d:()=>xc,batchNorm4d:()=>_c,batchToSpaceND:()=>yc,bincount:()=>wc,booleanMaskAsync:()=>pp,broadcastArgs:()=>kc,broadcastTo:()=>Dc,broadcast_util:()=>l,browser:()=>c,buffer:()=>To,callbacks:()=>Ak,cast:()=>Ao,ceil:()=>Tc,clipByValue:()=>Ac,clone:()=>So,complex:()=>Si,concat:()=>pc,concat1d:()=>Sc,concat2d:()=>Mc,concat3d:()=>Ec,concat4d:()=>Cc,constraints:()=>b,conv1d:()=>Oc,conv2d:()=>Nc,conv2dTranspose:()=>Pc,conv3d:()=>Rc,conv3dTranspose:()=>Fc,copyRegisteredKernels:()=>ha,cos:()=>Bc,cosh:()=>zc,cosineWindow:()=>_p,cumsum:()=>jc,customGrad:()=>xl,data:()=>q,denseBincount:()=>Uc,deprecationWarn:()=>qs,depthToSpace:()=>$c,depthwiseConv2d:()=>Vc,deregisterOp:()=>Ok,device_util:()=>i,diag:()=>qc,dilation2d:()=>Wc,disableDeprecationWarnings:()=>Vs,dispose:()=>Zs,disposeVariables:()=>Ws,div:()=>ul,divNoNan:()=>Xc,dot:()=>Yc,dropout:()=>bp,einsum:()=>Zc,elu:()=>Kc,enableDebugMode:()=>$s,enableProdMode:()=>Us,enclosingPowerOfTwo:()=>xp,engine:()=>Hs,env:()=>We,equal:()=>Hc,erf:()=>Jc,exp:()=>Qc,expandDims:()=>eu,expm1:()=>tu,eye:()=>nu,fft:()=>$f,fill:()=>Tl,findBackend:()=>nl,findBackendFactory:()=>al,floor:()=>au,floorDiv:()=>cl,fused:()=>m,gather:()=>iu,gatherND:()=>vp,gather_util:()=>u,getBackend:()=>tl,getGradient:()=>sa,getKernel:()=>oa,getKernelsForBackend:()=>la,grad:()=>ml,grads:()=>gl,greater:()=>ou,greaterEqual:()=>su,ifft:()=>Vf,imag:()=>lu,image:()=>Sh,inTopKAsync:()=>wp,initializers:()=>x,input:()=>Fb,io:()=>o,irfft:()=>qf,isFinite:()=>cu,isInf:()=>uu,isNaN:()=>fu,keep:()=>Ks,kernel_impls:()=>v,layers:()=>_,leakyRelu:()=>pu,less:()=>hu,lessEqual:()=>du,linalg:()=>Mh,linspace:()=>mu,loadGraphModel:()=>$D,loadLayersModel:()=>Lb,localResponseNormalization:()=>gu,log:()=>yu,log1p:()=>vu,logSigmoid:()=>_u,logSoftmax:()=>Du,logSumExp:()=>Iu,logicalAnd:()=>Pu,logicalNot:()=>Ru,logicalOr:()=>Lu,logicalXor:()=>Fu,losses:()=>Eh,matMul:()=>Ho,math:()=>s,max:()=>wu,maxPool:()=>Bu,maxPool3d:()=>zu,maxPoolWithArgmax:()=>ju,maximum:()=>Nl,mean:()=>Uu,memory:()=>Gs,meshgrid:()=>qu,metrics:()=>w,min:()=>Wu,minimum:()=>Hu,mirrorPad:()=>Gu,mod:()=>Xu,model:()=>Pb,models:()=>k,moments:()=>Yu,movingAverage:()=>mp,mul:()=>fl,multiRNNCell:()=>Zu,multinomial:()=>Ku,neg:()=>bu,nextFrame:()=>Ph,norm:()=>dp,notEqual:()=>Ju,oneHot:()=>Go,ones:()=>Vu,onesLike:()=>Qu,op:()=>Ai,outerProduct:()=>ef,pad:()=>tf,pad1d:()=>rf,pad2d:()=>nf,pad3d:()=>af,pad4d:()=>of,pool:()=>lf,pow:()=>Sl,prelu:()=>cf,print:()=>Mo,prod:()=>uf,profile:()=>Xs,rand:()=>ff,randomGamma:()=>gf,randomNormal:()=>yf,randomUniform:()=>vf,range:()=>bf,ready:()=>el,real:()=>xf,reciprocal:()=>_f,registerBackend:()=>il,registerCallbackConstructor:()=>Bb,registerGradient:()=>ua,registerKernel:()=>ca,registerOp:()=>Ck,regularizers:()=>D,relu:()=>wf,relu6:()=>kf,removeBackend:()=>rl,reshape:()=>cc,reverse:()=>Df,reverse1d:()=>Tf,reverse2d:()=>Af,reverse3d:()=>Sf,reverse4d:()=>Mf,rfft:()=>Hf,round:()=>Ef,rsqrt:()=>Cf,scalar:()=>wl,scatterND:()=>gp,scatter_util:()=>f,selu:()=>Nf,separableConv2d:()=>Of,sequential:()=>Rb,serialization:()=>h,setBackend:()=>Qs,setPlatform:()=>sl,setdiff1dAsync:()=>If,sigmoid:()=>hc,sign:()=>Pf,signal:()=>Ah,sin:()=>Rf,sinh:()=>Lf,slice:()=>dc,slice1d:()=>Ff,slice2d:()=>Bf,slice3d:()=>zf,slice4d:()=>jf,slice_util:()=>p,softmax:()=>Uf,softplus:()=>xu,spaceToBatchND:()=>sf,sparse:()=>Ch,sparseToDense:()=>yp,spectral:()=>Th,split:()=>Wf,sqrt:()=>pl,square:()=>hl,squaredDifference:()=>Gf,squeeze:()=>Xf,stack:()=>Yf,step:()=>Zf,stridedSlice:()=>Kf,string:()=>Nh,sub:()=>Ml,sum:()=>ku,sumOutType:()=>ni,tan:()=>Jf,tanh:()=>mc,tensor:()=>Ei,tensor1d:()=>Qf,tensor2d:()=>ep,tensor3d:()=>Qo,tensor4d:()=>tp,tensor5d:()=>rp,tensor6d:()=>np,tensor_util:()=>a,test_util:()=>d,tidy:()=>Ys,tile:()=>ru,time:()=>Js,topk:()=>ap,train:()=>Oh,transpose:()=>Xo,truncatedNormal:()=>ip,unique:()=>op,unregisterGradient:()=>pa,unregisterKernel:()=>fa,unsortedSegmentSum:()=>sp,unstack:()=>lp,upcastType:()=>ri,util:()=>n,valueAndGrad:()=>yl,valueAndGrads:()=>vl,variable:()=>cp,variableGrads:()=>bl,version:()=>Xj,version_converter:()=>VD,version_core:()=>js,version_layers:()=>ib,where:()=>Gc,whereAsync:()=>fp,zeros:()=>$u,zerosLike:()=>dl});var n={};r.r(n),r.d(n,{arraysEqual:()=>ce,assert:()=>ne,assertNonNegativeIntegerDimensions:()=>ze,assertNonNull:()=>ie,assertShapesMatch:()=>ae,bytesFromStringArray:()=>Ae,bytesPerElement:()=>Te,checkConversionForErrors:()=>_e,clamp:()=>K,computeStrides:()=>Ie,createScalarValue:()=>Ea,createShuffledIndices:()=>he,decodeString:()=>Pa,distSquared:()=>re,encodeString:()=>Ia,fetch:()=>Oa,fingerPrint64:()=>Ma,flatten:()=>oe,getArrayFromDType:()=>xe,getTypedArrayFromDType:()=>be,hasEncodingLoss:()=>ke,hexToLong:()=>ya,indexToLoc:()=>Ue,inferDtype:()=>Ce,inferFromImplicitShape:()=>ge,isBoolean:()=>Me,isFunction:()=>Ne,isInt:()=>ue,isNumber:()=>Ee,isPromise:()=>$e,isScalarShape:()=>le,isString:()=>Se,isTypedArray:()=>De,isValidDtype:()=>we,locToIndex:()=>je,makeOnesTypedArray:()=>Le,makeZerosNestedTypedArray:()=>Be,makeZerosTypedArray:()=>Fe,nearestDivisor:()=>Oe,nearestLargerEven:()=>J,now:()=>Na,parseAxisParam:()=>ye,randUniform:()=>te,repeatedTry:()=>me,rightPad:()=>de,shuffle:()=>Y,shuffleCombo:()=>Z,sizeFromShape:()=>se,sizeToSquarishShape:()=>pe,squeezeShape:()=>ve,sum:()=>ee,swap:()=>Q,tanh:()=>fe,toNestedArray:()=>Re,toTypedArray:()=>Ca});var a={};r.r(a),r.d(a,{assertTypesMatch:()=>ii,getTensorsInContainer:()=>si,isTensorInList:()=>oi,makeTypesMatch:()=>ai});var i={};r.r(i),r.d(i,{isBrowser:()=>vi,isMobile:()=>yi,mockIsMobile:()=>gi});var o={};r.r(o),r.d(o,{browserFiles:()=>Oo,browserHTTPRequest:()=>Uo,concatenateArrayBuffers:()=>Li,copyModel:()=>_o,decodeWeights:()=>Oi,encodeWeights:()=>Ni,fromMemory:()=>qo,getLoadHandlers:()=>Hi,getModelArtifactsForJSON:()=>zi,getModelArtifactsInfoForJSON:()=>ji,getSaveHandlers:()=>Wi,http:()=>jo,isHTTPScheme:()=>Bo,listModels:()=>bo,loadWeights:()=>Ro,moveModel:()=>wo,registerLoadRouter:()=>qi,registerSaveRouter:()=>Vi,removeModel:()=>xo,weightsLoaderFactory:()=>Lo,withSaveHandler:()=>Wo});var s={};r.r(s),r.d(s,{confusionMatrix:()=>Yo});var l={};r.r(l),r.d(l,{assertAndGetBroadcastShape:()=>Jo,getBroadcastDims:()=>Zo,getReductionAxes:()=>Ko});var c={};r.r(c),r.d(c,{fromPixels:()=>as,fromPixelsAsync:()=>rs,toPixels:()=>ns});var u={};r.r(u),r.d(u,{prepareAndValidate:()=>is});var f={};r.r(f),r.d(f,{calculateShapes:()=>ls,validateInput:()=>ss,validateUpdateShape:()=>os});var p={};r.r(p),r.d(p,{assertParamsValid:()=>cs,computeFlatOffset:()=>ws,computeOutShape:()=>fs,getNormalizedAxes:()=>ms,isSliceContinous:()=>_s,maskToAxes:()=>us,parseSliceParams:()=>ks,sliceInfo:()=>Ds,startForAxis:()=>bs,startIndicesWithElidedDims:()=>gs,stopForAxis:()=>xs,stopIndicesWithElidedDims:()=>ys,stridesForAxis:()=>vs,stridesWithElidedDims:()=>ps});var h={};r.r(h),r.d(h,{Serializable:()=>As,SerializationMap:()=>Ss,registerClass:()=>Ms});var d={};r.r(d),r.d(d,{TEST_EPSILON_FLOAT16:()=>Es,encodeStrings:()=>zs,expectArrayBuffersEqual:()=>Bs,expectArraysClose:()=>Cs,expectArraysEqual:()=>Ps,expectNumbersClose:()=>Rs,expectPromiseToFail:()=>Is,expectValuesInRange:()=>Fs,testEpsilon:()=>Ns});var m={};r.r(m),r.d(m,{conv2d:()=>Mp,depthwiseConv2d:()=>Np,matMul:()=>Op});var g={};r.r(g),r.d(g,{collectGatherOpShapeInfo:()=>Ed,computeOutShape:()=>Md,segOpComputeOptimalWindowSize:()=>Sd});var y={};r.r(y),r.d(y,{ERF_A1:()=>Xh,ERF_A2:()=>Yh,ERF_A3:()=>Zh,ERF_A4:()=>Kh,ERF_A5:()=>Jh,ERF_P:()=>Gh,PARALLELIZE_THRESHOLD:()=>Fh,SELU_SCALE:()=>Hh,SELU_SCALEALPHA:()=>Wh,applyActivation:()=>Ap,assertAndGetBroadcastShape:()=>Jo,assertAxesAreInnerMostDims:()=>Eu,assertParamsConsistent:()=>Rh,assignToTypedArray:()=>ad,axesAreInnerMostDims:()=>Tu,calculateShapes:()=>ls,checkEinsumDimSizes:()=>ud,checkPadOnDimRoundingMode:()=>lc,combineLocations:()=>Au,complexWithEvenIndex:()=>td,complexWithOddIndex:()=>rd,computeConv2DInfo:()=>Jl,computeConv3DInfo:()=>Ql,computeDefaultPad:()=>ec,computeDilation2DInfo:()=>Yl,computeOptimalWindowSize:()=>Bh,computeOutAndReduceShapes:()=>Su,computeOutShape:()=>Lh,computePool2DInfo:()=>Zl,computePool3DInfo:()=>Kl,convertConv2DDataFormat:()=>sc,decodeEinsumEquation:()=>ld,eitherStridesOrDilationsAreOne:()=>oc,expandShapeToKeepDim:()=>Mu,exponent:()=>od,exponents:()=>id,fromStringArrayToUint8:()=>Nd,fromUint8ToStringArray:()=>Cd,getAxesPermutation:()=>Cu,getBroadcastDims:()=>Zo,getComplexWithIndex:()=>nd,getEinsumComputePath:()=>fd,getEinsumPermutation:()=>cd,getFusedBiasGradient:()=>Tp,getFusedDyActivation:()=>Dp,getImageCenter:()=>zh,getInnerMostAxes:()=>Ou,getPermuted:()=>Uh,getReductionAxes:()=>Ko,getReshaped:()=>jh,getReshapedPermuted:()=>$h,getSliceBeginCoords:()=>Vh,getSliceSize:()=>qh,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>md,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>gd,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>yd,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>xd,getSparseReshapeInputOutputMismatchErrorMessage:()=>wd,getSparseReshapeInputOutputMultipleErrorMessage:()=>_d,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>vd,getSparseReshapeNegativeOutputDimErrorMessage:()=>bd,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>Ad,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>kd,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>Dd,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>Td,getUndoAxesPermutation:()=>Nu,isIdentityPermutation:()=>pd,log:()=>na,mergeRealAndImagArrays:()=>Qh,prepareAndValidate:()=>is,prepareSplitSize:()=>dd,segment_util:()=>g,shouldFuse:()=>Sp,slice_util:()=>p,splitRealAndImagArrays:()=>ed,tupleValuesAreOne:()=>ic,upcastType:()=>ri,validateInput:()=>ss,validateUpdateShape:()=>os,warn:()=>ra});var v={};r.r(v),r.d(v,{nonMaxSuppressionV3Impl:()=>Wp,nonMaxSuppressionV4Impl:()=>Hp,nonMaxSuppressionV5Impl:()=>Gp,whereImpl:()=>up});var b={};r.r(b),r.d(b,{maxNorm:()=>Eg,minMaxNorm:()=>Og,nonNeg:()=>Ng,unitNorm:()=>Cg});var x={};r.r(x),r.d(x,{constant:()=>By,glorotNormal:()=>Wy,glorotUniform:()=>qy,heNormal:()=>Hy,heUniform:()=>Gy,identity:()=>$y,leCunNormal:()=>Xy,leCunUniform:()=>Yy,ones:()=>Fy,orthogonal:()=>Zy,randomNormal:()=>jy,randomUniform:()=>zy,truncatedNormal:()=>Uy,varianceScaling:()=>Vy,zeros:()=>Ly});var _={};r.r(_),r.d(_,{Layer:()=>dv,RNN:()=>Lx,RNNCell:()=>Fx,activation:()=>nw,add:()=>pw,alphaDropout:()=>rk,average:()=>hw,averagePooling1d:()=>ww,averagePooling2d:()=>Tw,averagePooling3d:()=>Mw,avgPool1d:()=>kw,avgPool2d:()=>Aw,avgPool3d:()=>Ew,avgPooling1d:()=>Dw,avgPooling2d:()=>Sw,avgPooling3d:()=>Cw,batchNormalization:()=>bw,bidirectional:()=>Xw,concatenate:()=>dw,conv1d:()=>X_,conv2d:()=>Y_,conv2dTranspose:()=>Z_,conv3d:()=>K_,conv3dTranspose:()=>J_,convLstm2d:()=>qw,convLstm2dCell:()=>Ww,cropping2D:()=>ew,dense:()=>aw,depthwiseConv2d:()=>rw,dot:()=>vw,dropout:()=>iw,elu:()=>$_,embedding:()=>fw,flatten:()=>sw,gaussianDropout:()=>tk,gaussianNoise:()=>ek,globalAveragePooling1d:()=>Nw,globalAveragePooling2d:()=>Ow,globalMaxPool1d:()=>Zw,globalMaxPool2d:()=>Kw,globalMaxPooling1d:()=>Iw,globalMaxPooling2d:()=>Pw,gru:()=>Bw,gruCell:()=>zw,input:()=>Fb,inputLayer:()=>U_,layerNormalization:()=>xw,leakyReLU:()=>q_,lstm:()=>jw,lstmCell:()=>Uw,masking:()=>nk,maxPool1d:()=>Jw,maxPool2d:()=>Qw,maxPooling1d:()=>Rw,maxPooling2d:()=>Lw,maxPooling3d:()=>Fw,maximum:()=>mw,minimum:()=>gw,multiply:()=>yw,permute:()=>uw,prelu:()=>W_,reLU:()=>V_,repeatVector:()=>lw,reshape:()=>cw,rnn:()=>Hw,separableConv2d:()=>Q_,simpleRNN:()=>$w,simpleRNNCell:()=>Vw,softmax:()=>H_,spatialDropout1d:()=>ow,stackedRNNCells:()=>Gw,thresholdedReLU:()=>G_,timeDistributed:()=>Yw,upSampling2d:()=>tw,zeroPadding2d:()=>_w});var w={};r.r(w),r.d(w,{MAPE:()=>dk,MSE:()=>yk,binaryAccuracy:()=>ak,binaryCrossentropy:()=>ik,categoricalAccuracy:()=>sk,categoricalCrossentropy:()=>lk,cosineProximity:()=>fk,mape:()=>mk,meanAbsoluteError:()=>pk,meanAbsolutePercentageError:()=>hk,meanSquaredError:()=>gk,mse:()=>vk,precision:()=>ck,recall:()=>uk,sparseCategoricalAccuracy:()=>ok});var k={};r.r(k),r.d(k,{modelFromJSON:()=>Ob});var D={};r.r(D),r.d(D,{l1:()=>xk,l1l2:()=>bk,l2:()=>_k});var T={};r.r(T),r.d(T,{json:()=>jk});var A={};r.r(A),r.d(A,{json:()=>Uk});var S={};r.r(S),r.d(S,{json:()=>$k});var M={};r.r(M),r.d(M,{json:()=>Vk});var E={};r.r(E),r.d(E,{json:()=>qk});var C={};r.r(C),r.d(C,{json:()=>Wk});var N={};r.r(N),r.d(N,{json:()=>Hk});var O={};r.r(O),r.d(O,{json:()=>Gk});var I={};r.r(I),r.d(I,{json:()=>Xk});var P={};r.r(P),r.d(P,{json:()=>Yk});var R={};r.r(R),r.d(R,{json:()=>Zk});var L={};r.r(L),r.d(L,{json:()=>Kk});var F={};r.r(F),r.d(F,{json:()=>Jk});var B={};r.r(B),r.d(B,{json:()=>Qk});var z={};r.r(z),r.d(z,{json:()=>eD});var j={};r.r(j),r.d(j,{json:()=>tD});var U={};r.r(U),r.d(U,{json:()=>rD});var $={};r.r($),r.d($,{json:()=>nD});var V={};r.r(V),r.d(V,{json:()=>aD});var q={};r.r(q),r.d(q,{CSVDataset:()=>OT,Dataset:()=>xT,FileDataSource:()=>qT,TextLineDataset:()=>TT,URLDataSource:()=>WT,array:()=>wT,csv:()=>HT,func:()=>GT,generator:()=>XT,microphone:()=>ZT,version_data:()=>KT,webcam:()=>YT,zip:()=>kT});var W={};r.r(W),r.d(W,{addImpl:()=>NA,bincountImpl:()=>kS,bincountReduceImpl:()=>DS,ceilImpl:()=>SS,concatImpl:()=>IS,equalImpl:()=>mM,expImpl:()=>AM,expm1Impl:()=>NM,floorImpl:()=>XM,gatherNdImpl:()=>rE,gatherV2Impl:()=>aE,greaterEqualImpl:()=>cE,greaterImpl:()=>oE,lessEqualImpl:()=>wE,lessImpl:()=>bE,linSpaceImpl:()=>TE,logImpl:()=>SE,maxImpl:()=>$E,maximumImpl:()=>WE,minimumImpl:()=>tC,multiplyImpl:()=>sM,negImpl:()=>pC,notEqualImpl:()=>xC,prodImpl:()=>IC,rangeImpl:()=>RC,rsqrtImpl:()=>GC,sigmoidImpl:()=>vA,simpleAbsImpl:()=>jA,sliceImpl:()=>bS,sparseFillEmptyRowsImpl:()=>hN,sparseReshapeImpl:()=>mN,sparseSegmentReductionImpl:()=>yN,sqrtImpl:()=>wN,squaredDifferenceImpl:()=>AN,stridedSliceImpl:()=>NN,stringNGramsImpl:()=>PN,stringSplitImpl:()=>FN,stringToHashBucketFastImpl:()=>zN,subImpl:()=>FM,tileImpl:()=>qN,topKImpl:()=>XN,transposeImpl:()=>GA,uniqueImpl:()=>tO});class H{constructor(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,t){this.dataIdsCount++,this.data.set(e,t)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}}class G{refCount(e){return X("refCount")}incRef(e){return X("incRef")}timerAvailable(){return!0}time(e){return X("time")}read(e){return X("read")}readSync(e){return X("readSync")}readToGPU(e,t){return X("readToGPU")}numDataIds(){return X("numDataIds")}disposeData(e,t){return X("disposeData")}write(e,t,r){return X("write")}move(e,t,r,n,a){return X("move")}memory(){return X("memory")}floatPrecision(){return X("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}dispose(){return X("dispose")}}function X(e){throw new Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function Y(e){let t=e.length,r=0;for(;t>0;)r=Math.random()*t|0,t--,Q(e,t,r)}function Z(e,t){if(e.length!==t.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${e.length}Second array length was ${t.length}`);let r=e.length,n=0;for(;r>0;)n=Math.random()*r|0,r--,Q(e,r,n),Q(t,r,n)}function K(e,t,r){return Math.max(e,Math.min(t,r))}function J(e){return e%2==0?e:e+1}function Q(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function ee(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t}function te(e,t){const r=Math.random();return t*r+(1-r)*e}function re(e,t){let r=0;for(let n=0;n<e.length;n++){const a=Number(e[n])-Number(t[n]);r+=a*a}return r}function ne(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function ae(e,t,r=""){ne(ce(e,t),(()=>r+` Shapes ${e} and ${t} must match`))}function ie(e){ne(null!=e,(()=>"The input to the tensor constructor must be a non-null value."))}function oe(e,t=[],r=!1){if(null==t&&(t=[]),Array.isArray(e)||De(e)&&!r)for(let n=0;n<e.length;++n)oe(e[n],t,r);else t.push(e);return t}function se(e){if(0===e.length)return 1;let t=e[0];for(let r=1;r<e.length;r++)t*=e[r];return t}function le(e){return 0===e.length}function ce(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function ue(e){return e%1==0}function fe(e){if(null!=Math.tanh)return Math.tanh(e);if(e===1/0)return 1;if(e===-1/0)return-1;{const t=Math.exp(2*e);return(t-1)/(t+1)}}function pe(e){const t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}function he(e){const t=new Uint32Array(e);for(let r=0;r<e;++r)t[r]=r;return Y(t),t}function de(e,t){return t<=e.length?e:e+" ".repeat(t-e.length)}function me(e,t=(e=>0),r){return new Promise(((n,a)=>{let i=0;const o=()=>{if(e())return void n();i++;const s=t(i);null!=r&&i>=r?a():setTimeout(o,s)};o()}))}function ge(e,t){let r=1,n=-1;for(let t=0;t<e.length;++t)if(e[t]>=0)r*=e[t];else if(-1===e[t]){if(-1!==n)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${n} and dim ${t}`);n=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===n){if(t>0&&t!==r)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(0===r)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%r!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${r}`);const a=e.slice();return a[n]=t/r,a}function ye(e,t){const r=t.length;return ne((e=null==e?t.map(((e,t)=>t)):[].concat(e)).every((e=>e>=-r&&e<r)),(()=>`All values in axis param must be in range [-${r}, ${r}) but got axis ${e}`)),ne(e.every((e=>ue(e))),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?r+e:e))}function ve(e,t){const r=[],n=[],a=null!=t&&Array.isArray(t)&&0===t.length,i=null==t||a?null:ye(t,e).sort();let o=0;for(let t=0;t<e.length;++t){if(null!=i){if(i[o]===t&&1!==e[t])throw new Error(`Can't squeeze axis ${t} since its dim '${e[t]}' is not 1`);(null==i[o]||i[o]>t)&&1===e[t]&&(r.push(e[t]),n.push(t)),i[o]<=t&&o++}1!==e[t]&&(r.push(e[t]),n.push(t))}return{newShape:r,keptDims:n}}function be(e,t){let r=null;if(null==e||"float32"===e)r=new Float32Array(t);else if("int32"===e)r=new Int32Array(t);else{if("bool"!==e)throw new Error(`Unknown data type ${e}`);r=new Uint8Array(t)}return r}function xe(e,t){let r=null;if(null==e||"float32"===e)r=new Float32Array(t);else if("int32"===e)r=new Int32Array(t);else if("bool"===e)r=new Uint8Array(t);else{if("string"!==e)throw new Error(`Unknown data type ${e}`);r=new Array(t)}return r}function _e(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(isNaN(n)||!isFinite(n))throw Error(`A tensor of type ${t} being uploaded contains ${n}.`)}}function we(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}function ke(e,t){return!("complex64"===t||"float32"===t&&"complex64"!==e||"int32"===t&&"float32"!==e&&"complex64"!==e||"bool"===t&&"bool"===e)}function De(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}function Te(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error(`Unknown dtype ${e}`)}function Ae(e){if(null==e)return 0;let t=0;return e.forEach((e=>t+=e.length)),t}function Se(e){return"string"==typeof e||e instanceof String}function Me(e){return"boolean"==typeof e}function Ee(e){return"number"==typeof e}function Ce(e){return Array.isArray(e)?Ce(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray?"int32":Ee(e)?"float32":Se(e)?"string":Me(e)?"bool":"float32"}function Ne(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Oe(e,t){for(let r=t;r<e;++r)if(e%r==0)return r;return e}function Ie(e){const t=e.length;if(t<2)return[];const r=new Array(t-1);r[t-2]=e[t-1];for(let n=t-3;n>=0;--n)r[n]=r[n+1]*e[n+1];return r}function Pe(e,t,r,n=!1){const a=new Array;if(1===t.length){const i=t[0]*(n?2:1);for(let t=0;t<i;t++)a[t]=r[e+t]}else{const i=t[0],o=t.slice(1),s=o.reduce(((e,t)=>e*t))*(n?2:1);for(let t=0;t<i;t++)a[t]=Pe(e+t*s,o,r,n)}return a}function Re(e,t,r=!1){if(0===e.length)return t[0];const n=e.reduce(((e,t)=>e*t))*(r?2:1);if(0===n)return[];if(n!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${r?" for a complex tensor":""}.`);return Pe(0,e,t,r)}function Le(e,t){const r=Fe(e,t);for(let e=0;e<r.length;e++)r[e]=1;return r}function Fe(e,t){if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t)return new Uint8Array(e);throw new Error(`Unknown data type ${t}`)}function Be(e,t){const r=e.reduce(((e,t)=>e*t),1);if(null==t||"float32"===t)return Re(e,new Float32Array(r));if("int32"===t)return Re(e,new Int32Array(r));if("bool"===t)return Re(e,new Uint8Array(r));throw new Error(`Unknown data type ${t}`)}function ze(e){e.forEach((t=>{ne(Number.isInteger(t)&&t>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`))}))}function je(e,t,r){if(0===t)return 0;if(1===t)return e[0];let n=e[e.length-1];for(let t=0;t<e.length-1;++t)n+=r[t]*e[t];return n}function Ue(e,t,r){if(0===t)return[];if(1===t)return[e];const n=new Array(t);for(let t=0;t<n.length-1;++t)n[t]=Math.floor(e/r[t]),e-=n[t]*r[t];return n[n.length-1]=e,n}function $e(e){return e&&e.then&&"function"==typeof e.then}class Ve{constructor(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=qe,this.populateURLFlags()}setPlatform(e,t){null!=this.platform&&(We().getBool("IS_TEST")||We().getBool("PROD")||console.warn(`Platform ${this.platformName} has already been set. Overwriting the platform with ${t}.`)),this.platformName=e,this.platform=t}registerFlag(e,t,r){if(this.flagRegistry[e]={evaluationFn:t,setHook:r},null!=this.urlFlags[e]){const t=this.urlFlags[e];We().getBool("IS_TEST")||We().getBool("PROD")||console.warn(`Setting feature override from URL ${e}: ${t}.`),this.set(e,t)}}async getAsync(e){return e in this.flags||(this.flags[e]=await this.evaluateFlag(e)),this.flags[e]}get(e){if(e in this.flags)return this.flags[e];const t=this.evaluateFlag(e);if($e(t))throw new Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`);return this.flags[e]=t,this.flags[e]}getNumber(e){return this.get(e)}getBool(e){return this.get(e)}getFlags(){return this.flags}get features(){return this.flags}set(e,t){if(null==this.flagRegistry[e])throw new Error(`Cannot set flag ${e} as it has not been registered.`);this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)}evaluateFlag(e){if(null==this.flagRegistry[e])throw new Error(`Cannot evaluate flag '${e}': no evaluation function found.`);return this.flagRegistry[e].evaluationFn()}setFlags(e){this.flags=Object.assign({},e)}reset(){this.flags={},this.urlFlags={},this.populateURLFlags()}populateURLFlags(){if(void 0===this.global||void 0===this.global.location||void 0===this.global.location.search)return;const e=this.getQueryParams(this.global.location.search);"tfjsflags"in e&&e.tfjsflags.split(",").forEach((e=>{const[t,r]=e.split(":");this.urlFlags[t]=function(e,t){if("true"===(t=t.toLowerCase())||"false"===t)return"true"===t;if(""+ +t===t)return+t;throw new Error(`Could not parse value flag value ${t} for flag ${e}.`)}(t,r)}))}}function qe(e){const t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((e,...r)=>(function(e,t,r){e[decodeURIComponent(t)]=decodeURIComponent(r||"")}(t,r[0],r[1]),r.join("=")))),t}function We(){return Ge}let He,Ge=null;function Xe(){if(null==He){let e;if("undefined"!=typeof window)e=window;else if(void 0!==r.g)e=r.g;else if("undefined"!=typeof process)e=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}He=e}return He}function Ye(e,t){const r=function(){const e=Xe();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(r.has(e))return r.get(e);{const n=t();return r.set(e,n),r.get(e)}}const Ze="Abs",Ke="Acos",Je="Acosh",Qe="Add",et="AddN",tt="All",rt="Any",nt="ArgMax",at="ArgMin",it="Asin",ot="Asinh",st="Atan",lt="Atanh",ct="Atan2",ut="AvgPool",ft="AvgPoolGrad",pt="AvgPool3D",ht="AvgPool3DGrad",dt="BatchMatMul",mt="BatchToSpaceND",gt="Bincount",yt="BroadcastTo",vt="BroadcastArgs",bt="Cast",xt="Ceil",_t="ClipByValue",wt="Complex",kt="ComplexAbs",Dt="Concat",Tt="Conv2D",At="Conv2DBackpropFilter",St="Conv2DBackpropInput",Mt="Conv3D",Et="Conv3DBackpropFilterV2",Ct="Conv3DBackpropInputV2",Nt="Cos",Ot="Cosh",It="Cumsum",Pt="CropAndResize",Rt="DenseBincount",Lt="DepthToSpace",Ft="DepthwiseConv2dNative",Bt="DepthwiseConv2dNativeBackpropFilter",zt="DepthwiseConv2dNativeBackpropInput",jt="Diag",Ut="Dilation2D",$t="Dilation2DBackpropInput",Vt="Dilation2DBackpropFilter",qt="RealDiv",Wt="Einsum",Ht="Elu",Gt="EluGrad",Xt="Erf",Yt="Equal",Zt="Exp",Kt="ExpandDims",Jt="Expm1",Qt="FFT",er="Fill",tr="FlipLeftRight",rr="Floor",nr="FloorDiv",ar="FusedBatchNorm",ir="GatherV2",or="GatherNd",sr="Greater",lr="GreaterEqual",cr="Identity",ur="IFFT",fr="Imag",pr="IsFinite",hr="IsInf",dr="IsNan",mr="LeakyRelu",gr="Less",yr="LessEqual",vr="LinSpace",br="Log",xr="Log1p",_r="LogicalAnd",wr="LogicalNot",kr="LogicalOr",Dr="LogSoftmax",Tr="LRN",Ar="LRNGrad",Sr="Max",Mr="Maximum",Er="MaxPool",Cr="MaxPoolGrad",Nr="MaxPool3D",Or="MaxPool3DGrad",Ir="MaxPoolWithArgmax",Pr="Mean",Rr="Min",Lr="Minimum",Fr="MirrorPad",Br="Mod",zr="Multinomial",jr="Multiply",Ur="Neg",$r="NotEqual",Vr="NonMaxSuppressionV3",qr="NonMaxSuppressionV4",Wr="NonMaxSuppressionV5",Hr="OnesLike",Gr="OneHot",Xr="Pack",Yr="PadV2",Zr="Pool",Kr="Pow",Jr="Prelu",Qr="Prod",en="Range",tn="Real",rn="Reciprocal",nn="Relu",an="Reshape",on="ResizeNearestNeighbor",sn="ResizeNearestNeighborGrad",ln="ResizeBilinear",cn="ResizeBilinearGrad",un="Relu6",fn="Reverse",pn="Round",hn="Rsqrt",dn="ScatterNd",mn="Select",gn="Selu",yn="Slice",vn="Sin",bn="Sinh",xn="Sign",_n="Sigmoid",wn="Softplus",kn="Sqrt",Dn="Sum",Tn="SpaceToBatchND",An="SplitV",Sn="Softmax",Mn="SparseFillEmptyRows",En="SparseReshape",Cn="SparseSegmentMean",Nn="SparseSegmentSum",On="SparseToDense",In="SquaredDifference",Pn="Square",Rn="StridedSlice",Ln="StringNGrams",Fn="StringSplit",Bn="StringToHashBucketFast",zn="Sub",jn="Tan",Un="Tanh",$n="Tile",Vn="TopK",qn="Transform",Wn="Transpose",Hn="Unique",Gn="Unpack",Xn="UnsortedSegmentSum",Yn="ZerosLike",Zn="Step",Kn="FromPixels",Jn="RotateWithOffset",Qn="_FusedMatMul",ea="FusedConv2D",ta="FusedDepthwiseConv2D";function ra(...e){We().getBool("IS_TEST")||We().getBool("PROD")||console.warn(...e)}function na(...e){We().getBool("IS_TEST")||We().getBool("PROD")||console.log(...e)}const aa=Ye("kernelRegistry",(()=>new Map)),ia=Ye("gradRegistry",(()=>new Map));function oa(e,t){const r=da(e,t);return aa.get(r)}function sa(e){return ia.get(e)}function la(e){const t=aa.entries(),r=[];for(;;){const{done:n,value:a}=t.next();if(n)break;const[i,o]=a,[s]=i.split("_");s===e&&r.push(o)}return r}function ca(e){const{kernelName:t,backendName:r}=e,n=da(t,r);aa.has(n)&&ra(`The kernel '${t}' for backend '${r}' is already registered`),aa.set(n,e)}function ua(e){const{kernelName:t}=e;ia.has(t)&&We().getBool("DEBUG")&&ra(`Overriding the gradient for '${t}'`),ia.set(t,e)}function fa(e,t){const r=da(e,t);if(!aa.has(r))throw new Error(`The kernel '${e}' for backend '${t}' is not registered`);aa.delete(r)}function pa(e){if(!ia.has(e))throw new Error(`The gradient '${e}' for backend is not registered`);ia.delete(e)}function ha(e,t){la(e).forEach((e=>{ca(Object.assign({},e,{backendName:t}))}))}function da(e,t){return`${t}_${e}`}var ma=r(66307);const ga=r.n(ma)()||ma;function ya(e){return ga.fromString(e,!0,16)}const va=ya("c3a5c85c97cb3127"),ba=ya("b492b66fbe98f273"),xa=ya("9ae16a3b2f90404f");function _a(e){return e.xor(e.shru(47))}function wa(e,t,r){const n=e.slice(t,t+r);return ga.fromBytes(Array.from(n),!0,!0)}function ka(e,t){return wa(e,t,8)}function Da(e,t){return wa(e,t,4)}function Ta(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function Aa(e,t,r=ya("9ddfea08eb382d69")){let n=e.xor(t).mul(r);n=n.xor(n.shru(47));let a=t.xor(n).mul(r);return a=a.xor(a.shru(47)),a=a.mul(r),a}function Sa(e,t,r,n){return function(e,t,r,n,a,i){a=a.add(e),i=Ta(i.add(a).add(n),21);const o=a;return a=(a=a.add(t)).add(r),i=i.add(Ta(a,44)),[a.add(n),i.add(o)]}(ka(e,t),ka(e,t+8),ka(e,t+16),ka(e,t+24),r,n)}function Ma(e,t=e.length){const r=ga.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const r=xa.add(2*t),n=ka(e,0).add(xa),a=ka(e,t-8);return Aa(Ta(a,37).mul(r).add(n),Ta(n,25).add(a).mul(r),r)}if(t>=4){const r=xa.add(2*t);return Aa(Da(e,0).shl(3).add(t),Da(e,t-4),r)}if(t>0){const r=e[0]+(e[t>>1]<<8),n=t+(e[t-1]<<2);return _a(xa.mul(r).xor(va.mul(n))).mul(xa)}return xa}(e,t):function(e,t=e.length){const r=xa.add(2*t),n=ka(e,0).mul(ba),a=ka(e,8),i=ka(e,t-8).mul(r),o=ka(e,t-16).mul(xa);return Aa(Ta(n.add(a),43).add(Ta(i,30)).add(o),n.add(Ta(a.add(xa),18)).add(i),r)}(e,t);if(t<=64)return function(e,t=e.length){const r=xa.add(2*t),n=ka(e,0).mul(xa),a=ka(e,8),i=ka(e,t-8).mul(r),o=ka(e,t-16).mul(xa),s=Ta(n.add(a),43).add(Ta(i,30)).add(o),l=Aa(s,n.add(Ta(a.add(xa),18)).add(i),r),c=ka(e,16).mul(r),u=ka(e,24),f=s.add(ka(e,t-32)).mul(r),p=l.add(ka(e,t-24)).mul(r);return Aa(Ta(c.add(u),43).add(Ta(f,30)).add(p),c.add(Ta(u.add(n),18)).add(f),r)}(e,t);let n=r,a=r.mul(ba).add(113),i=_a(a.mul(xa).add(113)).mul(xa),o=[ga.UZERO,ga.UZERO],s=[ga.UZERO,ga.UZERO];n=n.mul(xa).add(ka(e,0));let l=0;const c=64*(t-1>>6),u=c+(t-1&63)-63;do{n=Ta(n.add(a).add(o[0]).add(ka(e,l+8)),37).mul(ba),a=Ta(a.add(o[1]).add(ka(e,l+48)),42).mul(ba),n=n.xor(s[1]),a=a.add(o[0]).add(ka(e,l+40)),i=Ta(i.add(s[0]),33).mul(ba),o=Sa(e,l,o[1].mul(ba),n.add(s[0])),s=Sa(e,l+32,i.add(s[1]),a.add(ka(e,l+16))),[i,n]=[n,i],l+=64}while(l!==c);const f=ba.add(i.and(255).shl(1));return l=u,s[0]=s[0].add(t-1&63),o[0]=o[0].add(s[0]),s[0]=s[0].add(o[0]),n=Ta(n.add(a).add(o[0]).add(ka(e,l+8)),37).mul(f),a=Ta(a.add(o[1]).add(ka(e,l+48)),42).mul(f),n=n.xor(s[1].mul(9)),a=a.add(o[0].mul(9).add(ka(e,l+40))),i=Ta(i.add(s[0]),33).mul(f),o=Sa(e,l,o[1].mul(f),n.add(s[0])),s=Sa(e,l+32,i.add(s[1]),a.add(ka(e,l+16))),[i,n]=[n,i],Aa(Aa(o[0],s[0],f).add(_a(a).mul(va)).add(i),Aa(o[1],s[1],f).add(n),f)}function Ea(e,t){return"string"===t?Ia(e):Ca([e],t)}function Ca(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=oe(e)),We().getBool("DEBUG")&&_e(e,t),function(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}(e,t))return e;if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t){const t=new Uint8Array(e.length);for(let r=0;r<t.length;++r)0!==Math.round(e[r])&&(t[r]=1);return t}throw new Error(`Unknown data type ${t}`)}function Na(){return We().platform.now()}function Oa(e,t){return We().platform.fetch(e,t)}function Ia(e,t="utf-8"){return t=t||"utf-8",We().platform.encode(e,t)}function Pa(e,t="utf-8"){return t=t||"utf-8",We().platform.decode(e,t)}class Ra{constructor(e,t){this.backendTimer=e,this.logger=t,null==t&&(this.logger=new Fa)}profileKernel(e,t,r){let n;const a=()=>{n=r()};let i;const o=Na();if(this.backendTimer.timerAvailable())i=this.backendTimer.time(a);else{a();for(const e of n)e.dataSync();i=Promise.resolve({kernelMs:Na()-o})}if(We().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t<n.length;t++){const r=n[t];r.data().then((t=>{La(t,r.dtype,e)}))}return{kernelName:e,outputs:n,inputs:t,timeMs:i.then((e=>e.kernelMs)),extraInfo:i.then((e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""))}}logKernelProfile(e){const{kernelName:t,outputs:r,timeMs:n,inputs:a,extraInfo:i}=e;r.forEach((e=>{Promise.all([e.data(),n,i]).then((r=>{this.logger.logKernelProfile(t,e,r[0],r[1],a,r[2])}))}))}}function La(e,t,r){if("float32"!==t)return!1;for(let t=0;t<e.length;t++){const n=e[t];if(isNaN(n)||!isFinite(n))return console.warn(`Found ${n} in the result of '${r}'`),!0}return!1}class Fa{logKernelProfile(e,t,r,n,a,i){const o="number"==typeof n?de(`${n}ms`,9):n.error,s=de(e,25),l=t.rank,c=t.size,u=de(t.shape.toString(),14);let f="";for(const e in a){const r=a[e];if(null!=r){const n=r.shape||t.shape,a=n.length;f+=`${e}: ${a}D ${a>0?n:""} `}}console.log(`%c${s}\t%c${o}\t%c${l}D ${u}\t%c${c}\t%c${f}\t%c${i}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}function Ba(e,t,r,n){const a=Ie(t),i=function(e,t,r,n){const a=se(t),i=n[n.length-1],o=new Array(i).fill(0),s=t.length,l="complex64"===r?$a(e):e;if(s>1)for(let e=0;e<a/i;e++){const t=e*i;for(let e=0;e<i;e++)o[e]=Math.max(o[e],za(l[t+e],0,r).length)}return o}(e,t,r,a),o=t.length,s=Ua(e,t,r,a,i),l=["Tensor"];return n&&(l.push(`  dtype: ${r}`),l.push(`  rank: ${o}`),l.push(`  shape: [${t}]`),l.push("  values:")),l.push(s.map((e=>"    "+e)).join("\n")),l.join("\n")}function za(e,t,r){let n;return n=Array.isArray(e)?`${parseFloat(e[0].toFixed(7))} + ${parseFloat(e[1].toFixed(7))}j`:Se(e)?`'${e}'`:"bool"===r?ja(e):parseFloat(e.toFixed(7)).toString(),de(n,t)}function ja(e){return 0===e?"false":"true"}function Ua(e,t,r,n,a,i=!0){const o="complex64"===r?2:1,s=t[0],l=t.length;if(0===l)return"complex64"===r?[za($a(e)[0],0,r)]:"bool"===r?[ja(e[0])]:[e[0].toString()];if(1===l){if(s>20){const t=3*o;let n=Array.from(e.slice(0,t)),i=Array.from(e.slice((s-3)*o,s*o));return"complex64"===r&&(n=$a(n),i=$a(i)),["["+n.map(((e,t)=>za(e,a[t],r))).join(", ")+", ..., "+i.map(((e,t)=>za(e,a[s-3+t],r))).join(", ")+"]"]}return["["+("complex64"===r?$a(e):Array.from(e)).map(((e,t)=>za(e,a[t],r))).join(", ")+"]"]}const c=t.slice(1),u=n.slice(1),f=n[0]*o,p=[];if(s>20){for(let t=0;t<3;t++){const n=t*f,i=n+f;p.push(...Ua(e.slice(n,i),c,r,u,a,!1))}p.push("...");for(let t=s-3;t<s;t++){const n=t*f,i=n+f;p.push(...Ua(e.slice(n,i),c,r,u,a,t===s-1))}}else for(let t=0;t<s;t++){const n=t*f,i=n+f;p.push(...Ua(e.slice(n,i),c,r,u,a,t===s-1))}const h=2===l?",":"";p[0]="["+p[0]+h;for(let e=1;e<p.length-1;e++)p[e]=" "+p[e]+h;let d=",\n";for(let e=2;e<l;e++)d+="\n";return p[p.length-1]=" "+p[p.length-1]+"]"+(i?"":d),p}function $a(e){const t=[];for(let r=0;r<e.length;r+=2)t.push([e[r],e[r+1]]);return t}class Va{constructor(e,t,r){if(this.dtype=t,this.shape=e.slice(),this.size=se(e),null!=r){const e=r.length;ne(e===this.size,(()=>`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`))}if("complex64"===t)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=r||xe(t,this.size),this.strides=Ie(e)}set(e,...t){0===t.length&&(t=[0]),ne(t.length===this.rank,(()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`));const r=this.locToIndex(t);this.values[r]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(const r of e){if(r<0||r>=this.shape[t]){const t=`Requested out of range element at ${e}.   Buffer shape=${this.shape}`;throw new Error(t)}t++}let r=e[e.length-1];for(let t=0;t<e.length-1;++t)r+=this.strides[t]*e[t];return this.values[r]}locToIndex(e){if(0===this.rank)return 0;if(1===this.rank)return e[0];let t=e[e.length-1];for(let r=0;r<e.length-1;++r)t+=this.strides[r]*e[r];return t}indexToLoc(e){if(0===this.rank)return[];if(1===this.rank)return[e];const t=new Array(this.shape.length);for(let r=0;r<t.length-1;++r)t[r]=Math.floor(e/this.strides[r]),e-=t[r]*this.strides[r];return t[t.length-1]=e,t}get rank(){return this.shape.length}toTensor(){return qa().makeTensor(this.values,this.shape,this.dtype)}}let qa=null,Wa=null,Ha=null;class Ga{constructor(e,t,r,n){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=se(e),this.strides=Ie(e),this.dataId=r,this.id=n,this.rankType=this.rank<5?this.rank.toString():"higher"}get rank(){return this.shape.length}async buffer(){const e=await this.data();return Wa.buffer(this.shape,this.dtype,e)}bufferSync(){return Wa.buffer(this.shape,this.dtype,this.dataSync())}async array(){const e=await this.data();return Re(this.shape,e,"complex64"===this.dtype)}arraySync(){return Re(this.shape,this.dataSync(),"complex64"===this.dtype)}async data(){this.throwIfDisposed();const e=qa().read(this.dataId);if("string"===this.dtype){const t=await e;try{return t.map((e=>Pa(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),qa().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=qa().readSync(this.dataId);if("string"===this.dtype)try{return e.map((e=>Pa(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await qa().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(qa().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return Wa.print(this,e)}clone(){return this.throwIfDisposed(),Wa.clone(this)}toString(e=!1){return Ba(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),Wa.cast(this,e)}variable(e=!0,t,r){return this.throwIfDisposed(),qa().makeVariable(this,e,t,r)}}function Xa(){return Ye("Tensor",(()=>Ga))}Object.defineProperty(Ga,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),Xa();class Ya extends Ga{constructor(e,t,r,n){super(e.shape,e.dtype,e.dataId,n),this.trainable=t,this.name=r}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!ce(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);qa().disposeTensor(this),this.dataId=e.dataId,qa().incRef(this,null)}dispose(){qa().disposeVariable(this),this.isDisposedInternal=!0}}var Za,Ka,Ja,Qa,ei;Object.defineProperty(Ya,Symbol.hasInstance,{value:e=>e instanceof Ga&&null!=e.assign&&e.assign instanceof Function}),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(Za||(Za={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(Ka||(Ka={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(Ja||(Ja={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(Qa||(Qa={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(ei||(ei={}));const ti={float32:Qa,int32:Ka,bool:Ja,complex64:ei};function ri(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return ti[e][t]}function ni(e){return ri(e,"int32")}function ai(e,t){if(e.dtype===t.dtype)return[e,t];const r=ri(e.dtype,t.dtype);return[e.cast(r),t.cast(r)]}function ii(e,t){ne(e.dtype===t.dtype,(()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`))}function oi(e,t){return t.some((t=>t.id===e.id))}function si(e){const t=[];return li(e,t,new Set),t}function li(e,t,r){if(null==e)return;if(e instanceof Ga)return void t.push(e);if(n=e,!Array.isArray(n)&&"object"!=typeof n)return;var n;const a=e;for(const e in a){const n=a[e];r.has(n)||(r.add(n),li(n,t,r))}}function ci(e){return null!=e.kernelName}class ui{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((e=>e.name))))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class fi{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new ui}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const r=e[t];if(await this.initializeBackend(r).success)return void await this.setBackend(r)}throw new Error("Could not initialize any backends, all backend initializations failed.")}get backend(){if(null!=this.pendingBackendInit)throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);if(null==this.backendInstance){const{name:e,asyncInit:t}=this.initializeBackendsAndReturnBest();if(t)throw new Error(`The highest priority backend '${e}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);this.setBackend(e)}return this.backendInstance}backendNames(){return Object.keys(this.registryFactory)}findBackend(e){if(!(e in this.registry)){if(!(e in this.registryFactory))return null;{const{asyncInit:t}=this.initializeBackend(e);if(t)return null}}return this.registry[e]}findBackendFactory(e){return e in this.registryFactory?this.registryFactory[e].factory:null}registerBackend(e,t,r=1){return e in this.registryFactory?(ra(`${e} backend was already registered. Reusing existing backend factory.`),!1):(this.registryFactory[e]={factory:t,priority:r},!0)}async setBackend(e){if(null==this.registryFactory[e])throw new Error(`Backend name '${e}' not found in registry`);if(this.backendName=e,null==this.registry[e]){this.backendInstance=null;const{success:t,asyncInit:r}=this.initializeBackend(e);if(!(r?await t:t))return!1}return this.backendInstance=this.registry[e],this.setupRegisteredKernels(),this.profiler=new Ra(this.backendInstance),!0}setupRegisteredKernels(){la(this.backendName).forEach((e=>{null!=e.setupFunc&&e.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(e){la(e).forEach((t=>{null!=t.disposeFunc&&t.disposeFunc(this.registry[e])}))}initializeBackend(e){const t=this.registryFactory[e];if(null==t)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const r=t.factory();if(!r||r instanceof G||"function"!=typeof r.then)return this.registry[e]=r,{success:!0,asyncInit:!1};{const t=++this.pendingBackendInitId,n=r.then((r=>!(t<this.pendingBackendInitId||(this.registry[e]=r,this.pendingBackendInit=null,0)))).catch((r=>(t<this.pendingBackendInitId||(this.pendingBackendInit=null,ra(`Initialization of backend ${e} failed`),ra(r.stack||r.message)),!1)));return this.pendingBackendInit=n,{success:n,asyncInit:!0}}}catch(t){return ra(`Initialization of backend ${e} failed`),ra(t.stack||t.message),{success:!1,asyncInit:!1}}}removeBackend(e){if(!(e in this.registryFactory))throw new Error(`${e} backend not found in registry`);this.backendName===e&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,e in this.registry&&(this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)}getSortedBackends(){if(0===Object.keys(this.registryFactory).length)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort(((e,t)=>this.registryFactory[t].priority-this.registryFactory[e].priority))}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const r=e[t],{success:n,asyncInit:a}=this.initializeBackend(r);if(a||n)return{name:r,asyncInit:a}}throw new Error("Could not initialize any backends, all backend initializations failed.")}moveData(e,t){const r=this.state.tensorInfo.get(t),n=r.backend,a=this.readSync(t),i=n.refCount(t);n.disposeData(t,!0),r.backend=e,e.move(t,a,r.shape,r.dtype,i),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++}tidy(e,t){let r,n=null;if(null==t){if("function"!=typeof e)throw new Error("Please provide a function to tidy()");t=e}else{if("string"!=typeof e&&!(e instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if("function"!=typeof t)throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");n=e}return this.scopedRun((()=>this.startScope(n)),(()=>this.endScope(r)),(()=>(r=t(),r instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),r)))}scopedRun(e,t,r){e();try{const e=r();return t(),e}catch(e){throw t(),e}}nextTensorId(){return fi.nextTensorId++}nextVariableId(){return fi.nextVariableId++}clone(e){const t=hi.runKernel(cr,{x:e}),r={x:e};return this.addTapeNode(this.state.activeScope.name,r,[t],(e=>({x:()=>{const t={x:e};return hi.runKernel(bt,t,{dtype:"float32"})}})),[],{}),t}runKernel(e,t,r){if(null==this.backendName&&this.backend,null==oa(e,this.backendName))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:r})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,r){const n=this.backend.numDataIds();let a=0;r.forEach((e=>{a+="complex64"===e.dtype?3:1}));const i=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=n-t-a-i;if(o>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${o} data ids) after running '${e}'`)}runKernelFunc(e){let t,r=[];const n=this.isTapeOn(),a=this.state.numBytes,i=this.state.numTensors;let o,s;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=ci(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(ci(e)){const{kernelName:t,inputs:a,attrs:i}=e;null==this.backendName&&this.backend;const l=oa(t,this.backendName);ne(null!=l,(()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`)),o=()=>{const e=this.backend.numDataIds();s=l.kernelFunc({inputs:a,attrs:i,backend:this.backend});const o=Array.isArray(s)?s:[s];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,o);const c=o.map((e=>{if(null!=e.rank)return e;const{dataId:t,shape:r,dtype:n}=e;return this.makeTensorFromDataId(t,r,n)}));if(n){const e=this.getTensorsForGradient(t,a,c);r=this.saveTensorsForBackwardMode(e)}return c}}else{const{forwardFunc:t}=e,a=e=>{n&&(r=e.map((e=>this.keep(this.clone(e)))))};o=()=>{const e=this.backend.numDataIds();s=this.tidy((()=>t(this.backend,a)));const r=Array.isArray(s)?s:[s];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,e,r),r}}const{inputs:c,attrs:u}=e,f=ci(e)?null:e.backwardsFunc;let p;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(p=this.profiler.profileKernel(l,c,(()=>o())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(p),t=p.outputs):t=o()})),n&&this.addTapeNode(l,c,t,f,r,u),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-a,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-i,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(c).map((e=>null!=c[e]?c[e].shape:null)),outputShapes:t.map((e=>e.shape)),kernelTimeMs:p.timeMs,extraInfo:p.extraInfo}),Array.isArray(s)?t:t[0]}saveTensorsForBackwardMode(e){const t=e.map((e=>this.keep(this.clone(e))));return t}getTensorsForGradient(e,t,r){const n=sa(e);if(null!=n){const e=n.inputsToSave||[],a=n.outputsToSave||[];let i;n.saveAllInputs?(ne(Array.isArray(t),(()=>"saveAllInputs is true, expected inputs to be an array.")),i=Object.keys(t).map((e=>t[e]))):i=e.map((e=>t[e]));const o=r.filter(((e,t)=>a[t]));return i.concat(o)}return[]}makeTensor(e,t,r,n){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");r=r||"float32",n=n||this.backend;let a=e;"string"===r&&Se(e[0])&&(a=e.map((e=>Ia(e))));const i=n.write(a,t,r),o=new Ga(t,r,i,this.nextTensorId());if(this.trackTensor(o,n),"string"===r){const e=this.state.tensorInfo.get(i),t=Ae(a);this.state.numBytes+=t-e.bytes,e.bytes=t}return o}makeTensorFromDataId(e,t,r,n){const a=new Ga(t,r=r||"float32",e,this.nextTensorId());return this.trackTensor(a,n),a}makeVariable(e,t=!0,r,n){r=r||this.nextVariableId().toString(),null!=n&&n!==e.dtype&&(e=e.cast(n));const a=new Ya(e,t,r,this.nextTensorId());if(null!=this.state.registeredVariables[a.name])throw new Error(`Variable with name ${a.name} was already registered`);return this.state.registeredVariables[a.name]=a,this.incRef(a,this.backend),a}trackTensor(e,t){this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++;let r=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(r=e.size*Te(e.dtype)),this.state.numBytes+=r,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:r})),e instanceof Ya||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){const t=e.size*Te(e.dtype);this.state.numBytes-=t}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const t=this.state.numBytes,r=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((e=>e.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-r;for(const e of this.state.activeProfile.kernels)e.kernelTimeMs=await e.kernelTimeMs,e.extraInfo=await e.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(e,t,r,n,a,i){const o={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:r,saved:a},s=sa(e);null!=s&&(n=s.gradFunc),null!=n&&(o.gradient=e=>(e=e.map(((e,t)=>{if(null==e){const e=r[t],n=Fe(e.size,e.dtype);return this.makeTensor(n,e.shape,e.dtype)}return e})),n(e.length>1?e:e[0],a,i))),this.state.activeTape.push(o)}keep(e){return e.kept=!0,e}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){const t=si(e),r=new Set(t.map((e=>e.id)));for(let e=0;e<this.state.activeScope.track.length;e++){const t=this.state.activeScope.track[e];t.kept||r.has(t.id)||t.dispose()}const n=this.state.scopeStack.pop();this.state.activeScope=0===this.state.scopeStack.length?null:this.state.scopeStack[this.state.scopeStack.length-1],t.forEach((e=>{e.kept||e.scopeId!==n.id||this.track(e)}))}gradients(e,t,r,n=!1){if(ne(t.length>0,(()=>"gradients() received an empty list of xs.")),null!=r&&"float32"!==r.dtype)throw new Error(`dy must have 'float32' dtype, but has '${r.dtype}'`);const a=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",e)));ne(a instanceof Ga,(()=>"The result y returned by f() must be a tensor."));const i=function(e,t,r){const n={},a={};for(let e=0;e<t.length;e++)n[t[e].id]=!0;for(let r=0;r<e.length;r++){const i=e[r],o=i.inputs;for(const e in o){const r=o[e];let s=!1;for(let e=0;e<t.length;e++)if(n[r.id]){i.outputs.forEach((e=>n[e.id]=!0)),s=!0,a[i.id]=!0;break}if(s)break}}const i={};i[r.id]=!0;const o={};for(let t=e.length-1;t>=0;t--){const r=e[t],n=r.inputs;for(let e=0;e<r.outputs.length;e++)if(i[r.outputs[e].id]){for(const e in n)i[n[e].id]=!0,o[r.id]=!0;break}}const s=[];for(let t=0;t<e.length;t++){const r=e[t];if(a[r.id]&&o[r.id]){const e={};for(const t in r.inputs){const a=r.inputs[t];n[a.id]&&(e[t]=a)}const t=Object.assign({},r);t.inputs=e,t.outputs=r.outputs,s.push(t)}}return s}(this.state.activeTape,t,a);if(!n&&0===i.length&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const e={};e[a.id]=null==r?function(e){const t=Le(se(e),"float32");return hi.makeTensor(t,e,"float32")}(a.shape):r,function(e,t,r,n){for(let a=t.length-1;a>=0;a--){const i=t[a],o=[];if(i.outputs.forEach((t=>{const r=e[t.id];null!=r?o.push(r):o.push(null)})),null==i.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${i.kernelName}.`);const s=i.gradient(o);for(const t in i.inputs){if(!(t in s))throw new Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(s)}.`);const a=r((()=>s[t]()));if("float32"!==a.dtype)throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${a.dtype}'`);const o=i.inputs[t];if(!ce(a.shape,o.shape))throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input '${t}' has shape '${a.shape}', which does not match the shape of the input '${o.shape}'`);if(null==e[o.id])e[o.id]=a;else{const t=e[o.id];e[o.id]=n(t,a),t.dispose()}}}}(e,i,(e=>this.tidy(e)),di);const n=t.map((t=>e[t.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((e=>{for(const t of e.saved)t.dispose()})),this.state.activeTape=null),{value:a,grads:n}}))}customGrad(e){return ne(Ne(e),(()=>"The f passed in customGrad(f) must be a function.")),(...t)=>{let r;ne(t.every((e=>e instanceof Ga)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const n={};return t.forEach(((e,t)=>{n[t]=e})),this.runKernelFunc({forwardFunc:(n,a)=>(r=e(...t,a),ne(r.value instanceof Ga,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),ne(Ne(r.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),r.value),backwardsFunc:(e,n)=>{const a=r.gradFunc(e,n),i=Array.isArray(a)?a:[a];ne(i.length===t.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),ne(i.every((e=>e instanceof Ga)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const o={};return i.forEach(((e,t)=>{o[t]=()=>e})),o},inputs:n})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,t){return this.state.tensorInfo.get(e).backend.readToGPU(e,t)}async time(e){const t=Na(),r=await this.backend.time(e);return r.wallMs=Na()-t,r}track(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new ui;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function pi(){const e=Xe();if(null==e._tfengine){const t=new Ve(e);e._tfengine=new fi(t)}var t;return t=e._tfengine.ENV,Ge=t,qa=()=>e._tfengine,e._tfengine}fi.nextTensorId=0,fi.nextVariableId=0;const hi=pi();function di(e,t){const r={a:e,b:t};return hi.runKernel(Qe,r)}let mi;function gi(e){mi=e}function yi(e){if(void 0!==mi)return mi;if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;const t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){const t=e;return t.userAgentData&&t.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function vi(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}const bi=We();function xi(e,t){let r=e;if(De(e))return"string"===t?[]:[e.length];if(!Array.isArray(e))return[];const n=[];for(;Array.isArray(r)||De(r)&&"string"!==t;)n.push(r.length),r=r[0];return Array.isArray(e)&&We().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&_i(e,n,[]),n}function _i(e,t,r){if(r=r||[],!Array.isArray(e)&&!De(e))return void ne(0===t.length,(()=>`Element arr[${r.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`));ne(t.length>0,(()=>`Element arr[${r.join("][")}] should be a primitive, but is an array of ${e.length} elements`)),ne(e.length===t[0],(()=>`Element arr[${r.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`));const n=t.slice(1);for(let t=0;t<e.length;++t)_i(e[t],n,r.concat(t))}function wi(e,t,r,n){if("string_or_numeric"!==e){if(null==e)throw new Error("Expected dtype cannot be null.");if("numeric"!==e&&e!==t||"numeric"===e&&"string"===t)throw new Error(`Argument '${r}' passed to '${n}' must be ${e} tensor, but got ${t} tensor`)}}function ki(e,t,r,n="numeric"){if(e instanceof Ga)return wi(n,e.dtype,t,r),e;let a=Ce(e);if("string"!==a&&["bool","int32","float32"].indexOf(n)>=0&&(a=n),wi(n,a,t,r),null==e||!De(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){const n=null==e?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${r}' must be a Tensor or TensorLike, but got '${n}'`)}const i=xi(e,a);De(e)||Array.isArray(e)||(e=[e]);const o="string"!==a?Ca(e,a):oe(e,[],!0);return hi.makeTensor(o,i,a)}function Di(e,t,r,n="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${r} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map(((e,a)=>ki(e,`${t}[${a}]`,r,n)))}bi.registerFlag("DEBUG",(()=>!1),(e=>{e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")})),bi.registerFlag("IS_BROWSER",(()=>vi())),bi.registerFlag("IS_NODE",(()=>"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node)),bi.registerFlag("IS_CHROME",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor))),bi.registerFlag("PROD",(()=>!1)),bi.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(()=>bi.getBool("DEBUG"))),bi.registerFlag("DEPRECATION_WARNINGS_ENABLED",(()=>!0)),bi.registerFlag("IS_TEST",(()=>!1)),bi.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",(()=>!0)),bi.registerFlag("WRAP_TO_IMAGEBITMAP",(()=>!1));const Ti="__op";function Ai(e){const t=Object.keys(e);if(1!==t.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let r=t[0];const n=e[r];r.endsWith("_")&&(r=r.substring(0,r.length-1)),r+=Ti;const a=(...e)=>{hi.startScope(r);try{const t=n(...e);return $e(t)&&console.error("Cannot return a Promise inside of tidy."),hi.endScope(t),t}catch(e){throw hi.endScope(null),e}};return Object.defineProperty(a,"name",{value:r,configurable:!0}),a}const Si=Ai({complex_:function(e,t){const r=ki(e,"real","complex"),n=ki(t,"imag","complex");ae(r.shape,n.shape,`real and imag shapes, ${r.shape} and ${n.shape}, must match in call to tf.complex().`);const a={real:r,imag:n};return hi.runKernel(wt,a)}});function Mi(e,t,r,n){if(null==n&&(n=Ce(e)),"complex64"===n)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!De(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=t){ze(t);const e=se(t),n=se(r);ne(e===n,(()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${n}`));for(let e=0;e<r.length;++e){const n=r[e],a=e!==r.length-1||n!==se(t.slice(e));ne(r[e]===t[e]||!a,(()=>`Error creating a new Tensor. Inferred shape (${r}) does not match the provided shape (${t}). `))}}return De(e)||Array.isArray(e)||(e=[e]),t=t||r,e="string"!==n?Ca(e,n):oe(e,[],!0),hi.makeTensor(e,t,n)}function Ei(e,t,r){return Mi(e,t,xi(e,r),r)}const Ci={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};async function Ni(e,t){const r=[],n=[],a=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);for(let i=0;i<a.length;++i){const o=a[i],s=Array.isArray(e)?e[i].tensor:e[o];if("float32"!==s.dtype&&"int32"!==s.dtype&&"bool"!==s.dtype&&"string"!==s.dtype&&"complex64"!==s.dtype)throw new Error(`Unsupported dtype in weight '${o}': ${s.dtype}`);const l={name:o,shape:s.shape,dtype:s.dtype};if("string"===s.dtype){const e=new Promise((async e=>{const t=await s.bytes(),r=t.reduce(((e,t)=>e+t.length),0)+4*t.length,n=new Uint8Array(r);let a=0;for(let e=0;e<t.length;e++){const r=t[e],i=new Uint8Array(new Uint32Array([r.length]).buffer);n.set(i,a),a+=4,n.set(r,a),a+=r.length}e(n)}));n.push(e)}else n.push(s.data());null!=t&&(l.group=t),r.push(l)}return{data:Ii(await Promise.all(n)),specs:r}}function Oi(e,t){const r={};let n,a=0;for(const i of t){const t=i.name,o=i.dtype,s=i.shape,l=se(s);let c;if("quantization"in i){const r=i.quantization;if("uint8"===r.dtype||"uint16"===r.dtype){if(!("min"in r)||!("scale"in r))throw new Error(`Weight ${i.name} with quantization ${r.dtype} doesn't have corresponding metadata min and scale.`)}else{if("float16"!==r.dtype)throw new Error(`Weight ${i.name} has unknown quantization dtype ${r.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`);if("float32"!==o)throw new Error(`Weight ${i.name} is quantized with ${r.dtype} which only supports weights of type float32 not ${o}.`)}const s=Ci[r.dtype],u=e.slice(a,a+l*s),f="uint8"===r.dtype?new Uint8Array(u):new Uint16Array(u);if("float32"===o)if("uint8"===r.dtype||"uint16"===r.dtype){c=new Float32Array(f.length);for(let e=0;e<f.length;e++){const t=f[e];c[e]=t*r.scale+r.min}}else{if("float16"!==r.dtype)throw new Error(`Unsupported quantization type ${r.dtype} for weight type float32.`);void 0===n&&(n=Ui()),c=n(f)}else{if("int32"!==o)throw new Error(`Unsupported dtype in weight '${t}': ${o}`);if("uint8"!==r.dtype&&"uint16"!==r.dtype)throw new Error(`Unsupported quantization type ${r.dtype} for weight type int32.`);c=new Int32Array(f.length);for(let e=0;e<f.length;e++){const t=f[e];c[e]=Math.round(t*r.scale+r.min)}}a+=l*s}else if("string"===o){const t=se(i.shape);c=[];for(let r=0;r<t;r++){const t=new Uint32Array(e.slice(a,a+4))[0];a+=4;const r=new Uint8Array(e.slice(a,a+t));c.push(r),a+=t}}else{const n=Ci[o],i=e.slice(a,a+l*n);if("float32"===o)c=new Float32Array(i);else if("int32"===o)c=new Int32Array(i);else if("bool"===o)c=new Uint8Array(i);else{if("complex64"!==o)throw new Error(`Unsupported dtype in weight '${t}': ${o}`);{c=new Float32Array(i);const e=new Float32Array(c.length/2),n=new Float32Array(c.length/2);for(let t=0;t<e.length;t++)e[t]=c[2*t],n[t]=c[2*t+1];const a=Ei(e,s,"float32"),o=Ei(n,s,"float32");r[t]=Si(a,o),a.dispose(),o.dispose()}}a+=l*n}"complex64"!==o&&(r[t]=Ei(c,s,o))}return r}function Ii(e){if(null===e)throw new Error(`Invalid input value: ${JSON.stringify(e)}`);let t=0;const r=[];e.forEach((e=>{if(t+=e.byteLength,r.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${e.constructor.name}`)}));const n=new Uint8Array(t);let a=0;return r.forEach((e=>{n.set(new Uint8Array(e.buffer),a),a+=e.byteLength})),n.buffer}const Pi="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function Ri(e){return Pi?Buffer.byteLength(e):new Blob([e]).size}function Li(e){if(1===e.length)return e[0];let t=0;e.forEach((e=>{t+=e.byteLength}));const r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(new Uint8Array(e),n),n+=e.byteLength})),r.buffer}function Fi(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);const t=e.split("/");return t[t.length-1]}function Bi(e,t){const r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:t};return null!=e.signature&&(r.signature=e.signature),null!=e.userDefinedMetadata&&(r.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(r.modelInitializer=e.modelInitializer),null!=e.trainingConfig&&(r.trainingConfig=e.trainingConfig),r}async function zi(e,t){const r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};if(null!=e.trainingConfig&&(r.trainingConfig=e.trainingConfig),null!=e.weightsManifest){const[n,a]=await t(e.weightsManifest);r.weightSpecs=n,r.weightData=a}return null!=e.signature&&(r.signature=e.signature),null!=e.userDefinedMetadata&&(r.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(r.modelInitializer=e.modelInitializer),r}function ji(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:Ri(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:Ri(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:e.weightData.byteLength}}function Ui(){const e=function(){const e=e=>{let t=e<<13,r=0;for(;0==(8388608&t);)r-=8388608,t<<=1;return t&=-8388609,r+=947912704,t|r},t=new Uint32Array(2048);t[0]=0;for(let r=1;r<1024;r++)t[r]=e(r);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}(),t=function(){const e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}(),r=function(){const e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return n=>{const a=new ArrayBuffer(4*n.length),i=new Uint32Array(a);for(let a=0;a<n.length;a++){const o=n[a],s=e[r[o>>10]+(1023&o)]+t[o>>10];i[a]=s}return new Float32Array(a)}}class $i{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==$i.instance&&($i.instance=new $i),$i.instance}static registerSaveRouter(e){$i.getInstance().saveRouters.push(e)}static registerLoadRouter(e){$i.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return $i.getHandlers(e,"save")}static getLoadHandlers(e,t){return $i.getHandlers(e,"load",t)}static getHandlers(e,t,r){const n=[];return("load"===t?$i.getInstance().loadRouters:$i.getInstance().saveRouters).forEach((t=>{const a=t(e,r);null!==a&&n.push(a)})),n}}const Vi=e=>$i.registerSaveRouter(e),qi=e=>$i.registerLoadRouter(e),Wi=e=>$i.getSaveHandlers(e),Hi=(e,t)=>$i.getLoadHandlers(e,t),Gi="tensorflowjs",Xi="models_store",Yi="model_info_store";function Zi(){if(!We().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const e="undefined"==typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function Ki(e){const t=e.result;t.createObjectStore(Xi,{keyPath:"modelPath"}),t.createObjectStore(Yi,{keyPath:"modelPath"})}class Ji{constructor(e){if(this.indexedDB=Zi(),null==e||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise(((e,r)=>{const n=this.indexedDB.open(Gi,1);n.onupgradeneeded=()=>Ki(n),n.onsuccess=()=>{const a=n.result;if(null==t){const t=a.transaction(Xi,"readonly"),n=t.objectStore(Xi).get(this.modelPath);n.onsuccess=()=>{if(null==n.result)return a.close(),r(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(n.result.modelArtifacts)},n.onerror=e=>(a.close(),r(n.error)),t.oncomplete=()=>a.close()}else{const n=ji(t),i=a.transaction(Yi,"readwrite");let o=i.objectStore(Yi);const s=o.put({modelPath:this.modelPath,modelArtifactsInfo:n});let l;s.onsuccess=()=>{l=a.transaction(Xi,"readwrite");const s=l.objectStore(Xi).put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:n});s.onsuccess=()=>e({modelArtifactsInfo:n}),s.onerror=e=>{o=i.objectStore(Yi);const t=o.delete(this.modelPath);t.onsuccess=()=>(a.close(),r(s.error)),t.onerror=e=>(a.close(),r(s.error))}},s.onerror=e=>(a.close(),r(s.error)),i.oncomplete=()=>{null==l?a.close():l.oncomplete=()=>a.close()}}},n.onerror=e=>r(n.error)}))}}Ji.URL_SCHEME="indexeddb://";const Qi=e=>{return We().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Ji.URL_SCHEME)?(t=e.slice(Ji.URL_SCHEME.length),new Ji(t)):null;var t};$i.registerSaveRouter(Qi),$i.registerLoadRouter(Qi);class eo{constructor(){this.indexedDB=Zi()}async listModels(){return new Promise(((e,t)=>{const r=this.indexedDB.open(Gi,1);r.onupgradeneeded=()=>Ki(r),r.onsuccess=()=>{const n=r.result,a=n.transaction(Yi,"readonly"),i=a.objectStore(Yi).getAll();i.onsuccess=()=>{const t={};for(const e of i.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},i.onerror=e=>(n.close(),t(i.error)),a.oncomplete=()=>n.close()},r.onerror=e=>t(r.error)}))}async removeModel(e){var t;return e=(t=e).startsWith(Ji.URL_SCHEME)?t.slice(Ji.URL_SCHEME.length):t,new Promise(((t,r)=>{const n=this.indexedDB.open(Gi,1);n.onupgradeneeded=()=>Ki(n),n.onsuccess=()=>{const a=n.result,i=a.transaction(Yi,"readwrite"),o=i.objectStore(Yi),s=o.get(e);let l;s.onsuccess=()=>{if(null==s.result)return a.close(),r(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const n=o.delete(e),i=()=>{l=a.transaction(Xi,"readwrite");const n=l.objectStore(Xi).delete(e);n.onsuccess=()=>t(s.result.modelArtifactsInfo),n.onerror=e=>r(s.error)};n.onsuccess=i,n.onerror=e=>(i(),a.close(),r(s.error))}},s.onerror=e=>(a.close(),r(s.error)),i.oncomplete=()=>{null==l?a.close():l.oncomplete=()=>a.close()}},n.onerror=e=>r(n.error)}))}}const to="/",ro="tensorflowjs_models",no="info",ao="model_topology",io="weight_specs",oo="weight_data",so="model_metadata";function lo(e){return{info:[ro,e,no].join(to),topology:[ro,e,ao].join(to),weightSpecs:[ro,e,io].join(to),weightData:[ro,e,oo].join(to),modelMetadata:[ro,e,so].join(to)}}function co(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function uo(e){const t=e.split(to);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(to)}class fo{constructor(e){if(!We().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=lo(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const t=JSON.stringify(e.modelTopology),r=JSON.stringify(e.weightSpecs),n=ji(e);try{this.LS.setItem(this.keys.info,JSON.stringify(n)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,r),this.LS.setItem(this.keys.weightData,function(e){if(Pi)return Buffer.from(e).toString("base64");const t=new Uint8Array(e);let r="";for(let e=0,n=t.length;e<n;e++)r+=String.fromCharCode(t[e]);return btoa(r)}(e.weightData));const a={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:null!=e.signature?e.signature:void 0,userDefinedMetadata:null!=e.userDefinedMetadata?e.userDefinedMetadata:void 0,modelInitializer:null!=e.modelInitializer?e.modelInitializer:void 0,trainingConfig:null!=e.trainingConfig?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(a)),{modelArtifactsInfo:n}}catch(e){throw co(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${n.modelTopologyBytes}, weightSpecsBytes=${n.weightSpecsBytes}, weightDataBytes=${n.weightDataBytes}.`)}}}async load(){const e=JSON.parse(this.LS.getItem(this.keys.info));if(null==e)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if("JSON"!==e.modelTopologyType)throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");const t={},r=JSON.parse(this.LS.getItem(this.keys.topology));if(null==r)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=r;const n=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(null==n)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=n;const a=this.LS.getItem(this.keys.modelMetadata);if(null!=a){const e=JSON.parse(a);t.format=e.format,t.generatedBy=e.generatedBy,t.convertedBy=e.convertedBy,null!=e.signature&&(t.signature=e.signature),null!=e.userDefinedMetadata&&(t.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(t.modelInitializer=e.modelInitializer),null!=e.trainingConfig&&(t.trainingConfig=e.trainingConfig)}const i=this.LS.getItem(this.keys.weightData);if(null==i)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=function(e){if(Pi){const t=Buffer.from(e,"base64");return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;++e)r.set([t.charCodeAt(e)],e);return r.buffer}(i),t}}fo.URL_SCHEME="localstorage://";const po=e=>{return We().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(fo.URL_SCHEME)?(t=e.slice(fo.URL_SCHEME.length),new fo(t)):null;var t};$i.registerSaveRouter(po),$i.registerLoadRouter(po);class ho{constructor(){ne(We().getBool("IS_BROWSER"),(()=>"Current environment is not a web browser")),ne("undefined"==typeof window||void 0!==window.localStorage,(()=>"Current browser does not appear to support localStorage")),this.LS=window.localStorage}async listModels(){const e={},t=ro+to,r=to+no;for(let n=0;n<this.LS.length;++n){const a=this.LS.key(n);a.startsWith(t)&&a.endsWith(r)&&(e[uo(a)]=JSON.parse(this.LS.getItem(a)))}return e}async removeModel(e){var t;const r=lo(e=(t=e).startsWith(fo.URL_SCHEME)?t.slice(fo.URL_SCHEME.length):t);if(null==this.LS.getItem(r.info))throw new Error(`Cannot find model at path '${e}'`);const n=JSON.parse(this.LS.getItem(r.info));return co(r),n}}const mo="://";class go{constructor(){this.managers={}}static getInstance(){return null==go.instance&&(go.instance=new go),go.instance}static registerManager(e,t){ne(null!=e,(()=>"scheme must not be undefined or null.")),e.endsWith(mo)&&(e=e.slice(0,e.indexOf(mo))),ne(e.length>0,(()=>"scheme must not be an empty string."));const r=go.getInstance();ne(null==r.managers[e],(()=>`A model store manager is already registered for scheme '${e}'.`)),r.managers[e]=t}static getManager(e){const t=this.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(this.getInstance().managers)}}function yo(e){if(-1===e.indexOf(mo))throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${go.getSchemes().join(",")}`);return{scheme:e.split(mo)[0],path:e.split(mo)[1]}}async function vo(e,t,r=!1){ne(e!==t,(()=>`Old path and new path are the same: '${e}'`));const n=$i.getLoadHandlers(e);ne(n.length>0,(()=>`Copying failed because no load handler is found for source URL ${e}.`)),ne(n.length<2,(()=>`Copying failed because more than one (${n.length}) load handlers for source URL ${e}.`));const a=n[0],i=$i.getSaveHandlers(t);ne(i.length>0,(()=>`Copying failed because no save handler is found for destination URL ${t}.`)),ne(i.length<2,(()=>`Copying failed because more than one (${n.length}) save handlers for destination URL ${t}.`));const o=i[0],s=yo(e).scheme,l=yo(e).path,c=s===yo(e).scheme,u=await a.load();r&&c&&await go.getManager(s).removeModel(l);const f=await o.save(u);return r&&!c&&await go.getManager(s).removeModel(l),f.modelArtifactsInfo}async function bo(){const e=go.getSchemes(),t={};for(const r of e){const e=await go.getManager(r).listModels();for(const n in e)t[r+mo+n]=e[n]}return t}async function xo(e){const t=yo(e);return go.getManager(t.scheme).removeModel(t.path)}async function _o(e,t){return vo(e,t,!1)}async function wo(e,t){return vo(e,t,!0)}class ko{fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}}if(We().get("IS_BROWSER")){We().setPlatform("browser",new ko);try{go.registerManager(fo.URL_SCHEME,new ho)}catch(e){}try{go.registerManager(Ji.URL_SCHEME,new eo)}catch(e){}}let Do;function To(e,t="float32",r){return t=t||"float32",ze(e),new Va(e,t,r)}We().get("IS_NODE")&&We().setPlatform("node",new class{constructor(){this.util=r(88478),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=We().global.fetch?We().global.fetch(e,t):(null==Do&&(Do=r(65066)),Do(e,t))}now(){const e=process.hrtime();return 1e3*e[0]+e[1]/1e6}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}});const Ao=Ai({cast_:function(e,t){const r=ki(e,"x","cast");if(!we(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==r.dtype||"string"!==t&&"string"===r.dtype)throw new Error("Only strings can be casted to strings");const n={x:r},a={dtype:t};return hi.runKernel(bt,n,a)}}),So=Ai({clone_:function(e){const t={x:ki(e,"x","clone","string_or_numeric")};return hi.runKernel(cr,t)}});function Mo(e,t=!1){console.log(e.toString(t))}function Eo(e){return new Promise((e=>setTimeout(e))).then(e)}pi(),Wa={buffer:To,cast:Ao,clone:So,print:Mo};class Co{constructor(e){if(!We().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(Co.URL_SCHEME)&&(e=e.slice(Co.URL_SCHEME.length)),null!=e&&0!==e.length||(e="model"),this.modelJsonFileName=e+".json",this.weightDataFileName=e+".weights.bin"}async save(e){if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");const t=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const r=Bi(e,[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}]),n=window.URL.createObjectURL(new Blob([JSON.stringify(r)],{type:"application/json"})),a=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(a.download=this.modelJsonFileName,a.href=n,await Eo((()=>a.dispatchEvent(new MouseEvent("click")))),null!=e.weightData){const e=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;e.download=this.weightDataFileName,e.href=t,await Eo((()=>e.dispatchEvent(new MouseEvent("click"))))}return{modelArtifactsInfo:ji(e)}}}}Co.URL_SCHEME="downloads://";class No{constructor(e){if(null==e||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise(((e,t)=>{const r=new FileReader;r.onload=r=>{const n=JSON.parse(r.target.result),a=n.modelTopology;if(null==a)return void t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));if(null==n.weightsManifest)return void t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));if(0===this.weightsFiles.length)return void e({modelTopology:a});const i=zi(n,(e=>this.loadWeights(e)));e(i)},r.onerror=e=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),r.readAsText(this.jsonFile)}))}loadWeights(e){const t=[],r=[];for(const n of e)t.push(...n.weights),r.push(...n.paths);const n=this.checkManifestAndWeightFiles(e),a=r.map((e=>this.loadWeightsFile(e,n[e])));return Promise.all(a).then((e=>[t,Li(e)]))}loadWeightsFile(e,t){return new Promise(((r,n)=>{const a=new FileReader;a.onload=e=>{const t=e.target.result;r(t)},a.onerror=t=>n(`Failed to weights data from file of path '${e}'.`),a.readAsArrayBuffer(t)}))}checkManifestAndWeightFiles(e){const t=[],r=this.weightsFiles.map((e=>Fi(e.name))),n={};for(const a of e)a.paths.forEach((e=>{const a=Fi(e);if(-1!==t.indexOf(a))throw new Error(`Duplicate file basename found in weights manifest: '${a}'`);if(t.push(a),-1===r.indexOf(a))throw new Error(`Weight file with basename '${a}' is not provided.`);n[e]=this.weightsFiles[r.indexOf(a)]}));if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return n}}function Oo(e){return new No(e)}function Io(e,t,r,n){!function(e){ne(null!=e&&Array.isArray(e)&&e.length>0,(()=>"promises must be a none empty array"))}(e),function(e,t){ne(e>=0&&e<=1,(()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`)),ne(t>=0&&t<=1,(()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`)),ne(t>=e,(()=>`startFraction must be no more than endFraction, but got startFraction ${e} and endFraction ${t}`))}(r=null==r?0:r,n=null==n?1:n);let a=0;return Promise.all(e.map((i=>(i.then((i=>{const o=r+ ++a/e.length*(n-r);return t(o),i})),i))))}async function Po(e,t){null==t&&(t={});const r=null==t.fetchFunc?We().platform.fetch:t.fetchFunc,n=e.map((e=>r(e,t.requestInit,{isBinary:!0}))),a=(null==t.onProgress?await Promise.all(n):await Io(n,t.onProgress,0,.5)).map((e=>e.arrayBuffer()));return null==t.onProgress?await Promise.all(a):await Io(a,t.onProgress,.5,1)}async function Ro(e,t="",r,n){return Lo((e=>Po(e,{requestInit:n})))(e,t,r)}function Lo(e){return async(t,r="",n)=>{const a=t.map((()=>!1)),i={},o=null!=n?n.map((()=>!1)):[],s=[];if(t.forEach(((e,t)=>{let r=0;e.weights.forEach((e=>{const l="quantization"in e?e.quantization.dtype:e.dtype,c=Ci[l]*se(e.shape),u=()=>{a[t]=!0,null==i[t]&&(i[t]=[]),i[t].push({manifestEntry:e,groupOffset:r,sizeBytes:c})};null!=n?n.forEach(((t,r)=>{t===e.name&&(u(),o[r]=!0)})):u(),s.push(e.name),r+=c}))})),!o.every((e=>e))){const e=n.filter(((e,t)=>!o[t]));throw new Error(`Could not find weights in manifest with names: ${e.join(", ")}. \nManifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce(((e,t,r)=>(t&&e.push(r),e)),[]),c=[];l.forEach((e=>{t[e].paths.forEach((e=>{const t=r+(r.endsWith("/")?"":"/")+e;c.push(t)}))}));const u=await e(c),f={};let p=0;return l.forEach((e=>{const r=t[e].paths.length;let n=0;for(let e=0;e<r;e++)n+=u[p+e].byteLength;const a=new ArrayBuffer(n),o=new Uint8Array(a);let s=0;for(let e=0;e<r;e++){const t=new Uint8Array(u[p+e]);o.set(t,s),s+=t.byteLength}i[e].forEach((e=>{const t=Oi(a.slice(e.groupOffset,e.groupOffset+e.sizeBytes),[e.manifestEntry]);for(const e in t)f[e]=t[e]})),p+=r})),f}}$i.registerSaveRouter((e=>We().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Co.URL_SCHEME)?function(e="model"){return new Co(e)}(e.slice(Co.URL_SCHEME.length)):null));class Fo{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?(ne("function"==typeof t.fetchFunc,(()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)")),this.fetch=t.fetchFunc):this.fetch=We().platform.fetch,ne(null!=e&&e.length>0,(()=>"URL path for http must not be null, undefined or empty.")),Array.isArray(e)&&ne(2===e.length,(()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`)),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const r=Bi(e,[{paths:["./model.weights.bin"],weights:e.weightSpecs}]);t.body.append("model.json",new Blob([JSON.stringify(r)],{type:"application/json"}),"model.json"),null!=e.weightData&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:"application/octet-stream"}),"model.weights.bin");const n=await this.fetch(this.path,t);if(n.ok)return{modelArtifactsInfo:ji(e),responses:[n]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${n.status}.`)}async load(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(e){let t=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?t+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":t+=" Please make sure the server is serving valid JSON for this request.",new Error(t)}const r=t.modelTopology,n=t.weightsManifest;if(null==r&&null==n)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return zi(t,(e=>this.loadWeights(e)))}async loadWeights(e){const t=Array.isArray(this.path)?this.path[1]:this.path,[r,n]=function(e){const t=e.lastIndexOf("/"),r=e.lastIndexOf("?");return[e.substring(0,t)+"/",r>t?e.substring(r):""]}(t),a=this.weightPathPrefix||r,i=[];for(const t of e)i.push(...t.weights);const o=[],s=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?s.push(this.weightUrlConverter(e)):o.push(a+e+n);return this.weightUrlConverter&&o.push(...await Promise.all(s)),[i,Li(await Po(o,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress}))]}}function Bo(e){return null!=e.match(Fo.URL_SCHEME_REGEX)}Fo.URL_SCHEME_REGEX=/^https?:\/\//;const zo=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let r=!0;if(r=Array.isArray(e)?e.every((e=>Bo(e))):Bo(e),r)return jo(e,t)}return null};function jo(e,t){return new Fo(e,t)}function Uo(e,t){return jo(e,t)}$i.registerSaveRouter(zo),$i.registerLoadRouter(zo);class $o{constructor(e){this.modelArtifacts=e}async load(){return this.modelArtifacts}}class Vo{constructor(e){this.saveHandler=e}async save(e){return this.saveHandler(e)}}function qo(e,t,r,n){return 1===arguments.length?null!=e.modelTopology||null!=e.weightSpecs?new $o(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new $o({modelTopology:e})):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new $o({modelTopology:e,weightSpecs:t,weightData:r,trainingConfig:n}))}function Wo(e){return new Vo(e)}const Ho=Ai({matMul_:function(e,t,r=!1,n=!1){let a=ki(e,"a","matMul"),i=ki(t,"b","matMul");[a,i]=ai(a,i);const o={a,b:i},s={transposeA:r,transposeB:n};return hi.runKernel(dt,o,s)}}),Go=Ai({oneHot_:function(e,t,r=1,n=0){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const a={indices:ki(e,"indices","oneHot","int32")},i={depth:t,onValue:r,offValue:n};return hi.runKernel(Gr,a,i)}}),Xo=Ai({transpose_:function(e,t){const r=ki(e,"x","transpose");if(null==t&&(t=r.shape.map(((e,t)=>t)).reverse()),ne(r.rank===t.length,(()=>`Error in transpose: rank of input ${r.rank} must match length of perm ${t}.`)),t.forEach((e=>{ne(e>=0&&e<r.rank,(()=>"All entries in 'perm' must be between 0 and "+(r.rank-1)+` but got ${t}`))})),r.rank<=1)return r.clone();const n={x:r},a={perm:t};return hi.runKernel(Wn,n,a)}}),Yo=Ai({confusionMatrix_:function(e,t,r){const n=ki(e,"labels","confusionMatrix"),a=ki(t,"predictions","confusionMatrix");ne(null==r||r>0&&Number.isInteger(r),(()=>`If provided, numClasses must be a positive integer, but got ${r}`)),ne(1===n.rank,(()=>`Expected the rank of labels to be 1, but got ${n.rank}`)),ne(1===a.rank,(()=>`Expected the rank of predictions to be 1, but got ${a.rank}`)),ne(n.shape[0]===a.shape[0],(()=>`Mismatch in the number of examples: ${n.shape[0]} vs. ${a.shape[0]}. Labels and predictions should have the same number of elements.`)),ne(r>0&&Number.isInteger(r),(()=>`numClasses is required to be a positive integer, but got ${r}`));const i=Go(Ao(n,"int32"),r),o=Go(Ao(a,"int32"),r),s=Xo(i),l=Ho(s,o);return Ao(l,"int32")}});function Zo(e,t){const r=e.length,n=[];for(let a=0;a<r;a++){const i=r-1-a,o=e[i]||1;(t[t.length-1-a]||1)>1&&1===o&&n.unshift(i)}return n}function Ko(e,t){const r=[];for(let n=0;n<t.length;n++){const a=e[e.length-n-1],i=t.length-n-1,o=t[i];(null==a||1===a&&o>1)&&r.unshift(i)}return r}function Jo(e,t){const r=[],n=Math.max(e.length,t.length);for(let a=0;a<n;a++){let n=e[e.length-a-1];null==n&&(n=1);let i=t[t.length-a-1];if(null==i&&(i=1),1===n)r.unshift(i);else if(1===i)r.unshift(n);else{if(n!==i)throw Error(`Operands could not be broadcast together with shapes ${e} and ${t}.`);r.unshift(n)}}return r}function Qo(e,t,r){if(ie(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const n=xi(e,r);if(3!==n.length&&1!==n.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===n.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Mi(e,t,n,r)}let es;function ts(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let r=!1,n=!1,a=!1,i=!1,o=!1,s=!1;if(e.data instanceof Uint8Array)r=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)n=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)a=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)i=!0;else if(null!=e.getContext)o=!0;else{if(!("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap))throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);s=!0}if(a){const t=2;if(a&&e.readyState<t)throw new Error("The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.")}if(null!=oa(Kn,hi.backendName)){const r={pixels:e},n={numChannels:t};return hi.runKernel(Kn,r,n)}const[l,c]=a?[e.videoWidth,e.videoHeight]:[e.width,e.height];let u,f;if(o)u=e.getContext("2d").getImageData(0,0,l,c).data;else if(n||r)u=e.data;else if(i||a||s){if(null==es)if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas||"undefined"==typeof OffscreenCanvasRenderingContext2D)throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");es=new OffscreenCanvas(1,1).getContext("2d")}else es=document.createElement("canvas").getContext("2d");es.canvas.width=l,es.canvas.height=c,es.drawImage(e,0,0,l,c),u=es.getImageData(0,0,l,c).data}if(4===t)f=new Int32Array(u);else{const e=l*c;f=new Int32Array(e*t);for(let r=0;r<e;r++)for(let e=0;e<t;++e)f[r*t+e]=u[4*r+e]}return Qo(f,[c,l,t],"int32")}async function rs(e,t=3){let r=null;if(We().getBool("WRAP_TO_IMAGEBITMAP")&&function(e){return"undefined"!=typeof window&&"undefined"!=typeof ImageBitmap&&window.hasOwnProperty("createImageBitmap")&&!(e instanceof ImageBitmap)&&function(e){return null!=e&&0!==e.width&&0!==e.height}(e)&&!function(e){return null!=e&&e.data instanceof Uint8Array}(e)}(e)){let t;try{t=await createImageBitmap(e,{premultiplyAlpha:"none"})}catch(e){t=null}r=null!=t&&t.width===e.width&&t.height===e.height?t:e}else r=e;return ts(r,t)}async function ns(e,t){let r=ki(e,"img","toPixels");if(!(e instanceof Ga)){const e=r;r=Ao(e,"int32"),e.dispose()}if(2!==r.rank&&3!==r.rank)throw new Error(`toPixels only supports rank 2 or 3 tensors, got rank ${r.rank}.`);const[n,a]=r.shape.slice(0,2),i=2===r.rank?1:r.shape[2];if(i>4||2===i)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${i}`);if("float32"!==r.dtype&&"int32"!==r.dtype)throw new Error(`Unsupported type for toPixels: ${r.dtype}. Please use float32 or int32 tensors.`);const o=await r.data(),s="float32"===r.dtype?255:1,l=new Uint8ClampedArray(a*n*4);for(let e=0;e<n*a;++e){const t=[0,0,0,255];for(let n=0;n<i;n++){const a=o[e*i+n];if("float32"===r.dtype){if(a<0||a>1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${a}.`)}else if("int32"===r.dtype&&(a<0||a>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${a}.`);1===i?(t[0]=a*s,t[1]=a*s,t[2]=a*s):t[n]=a*s}const n=4*e;l[n+0]=Math.round(t[0]),l[n+1]=Math.round(t[1]),l[n+2]=Math.round(t[2]),l[n+3]=Math.round(t[3])}if(null!=t){t.width=a,t.height=n;const e=t.getContext("2d"),r=new ImageData(l,a,n);e.putImageData(r,0,0)}return r!==e&&r.dispose(),l}const as=Ai({fromPixels_:ts});function is(e,t){const r=e.shape.length,n=t.shape.length;if(r<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${r}.`);if(n<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${n}.`);if("int32"!==t.dtype)throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[n-1]>r)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[n-1]} vs. ${r}`);if(0===se(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const a=t.shape,i=a[a.length-1];let o=1;for(let e=0;e<a.length-1;++e)o*=a[e];const s=e.shape,l=a.slice();l.pop();let c=1;for(let e=i;e<r;++e)c*=s[e],l.push(s[e]);const u=[...Ie(e.shape).map((e=>e/c)),1].slice(0,i);return[l,o,c,u]}function os(e,t,r){const n=t.rank>1?t.shape[t.rank-1]:1,a=t.rank>1?t.rank-1:1,i=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${r.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${n}, and batchDim: ${a}.`;if(r.rank<a)throw new Error(i+` update.rank < ${a}. `);if(e.length<n+(r.rank-a))throw new Error(i+` Output shape length < ${n+(r.rank-a)}`);if(r.rank!==a+e.length-n)throw new Error(i+" update.rank != "+(a+e.length-n));for(let e=0;e<a;++e)if(r.shape[e]!==t.shape[e])throw new Error(i+` updates.shape[${e}] (${r.shape[e]}) != indices.shape[${e}] (${t.shape[e]}).`);for(let t=0;t<r.rank-a;++t)if(r.shape[t+a]!==e[t+n])throw new Error(i+` updates.shape[${t+a}] (${r.shape[t+a]}) != shape[${t+a}] (${e[t+a]})`)}function ss(e,t,r){if(t.rank<1)throw new Error(`tf.scatterND() expects the indices to be rank 1 or higher, but the rank was ${t.rank}.`);if(e.rank<1)throw new Error(`tf.scatterND() expects the updates to be rank 1 or higher, but the rank was ${e.rank}.`);if("int32"!==t.dtype)throw new Error(`The dtype of 'indices' should be int32, but got dtype: ${t.dtype}`);if(r.length<1)throw new Error(`Output rank must be greater or equal to 1, but got shape: ${r}`);if(0===r.length){if(0===t.size)throw new Error(`Indices specified for empty output. indices shape: ${t.shape}`);if(0===e.size)throw new Error(`Updates specified for empty output. updates shape: ${e.shape}`)}os(r,t,e)}function ls(e,t,r){const n=t.shape.length,a=n>1?t.shape[n-1]:1,i=r.length;let o=1;for(let e=a;e<i;++e)o*=r[e];const s=a<1?1:a;return{sliceRank:a,numUpdates:se(t.shape)/s,sliceSize:o,strides:[...Ie(r.slice(0,a)),1],outputSize:se(r)}}function cs(e,t,r){const n=e.shape.length;ne(n===t.length,(()=>`Error in slice${n}D: Length of begin ${t} must match the rank of the array (${n}).`)),ne(n===r.length,(()=>`Error in slice${n}D: Length of size ${r} must match the rank of the array (${n}).`));for(let a=0;a<n;++a)ne(t[a]+r[a]<=e.shape[a],(()=>`Error in slice${n}D: begin[${a}] + size[${a}] (${t[a]+r[a]}) would overflow input.shape[${a}] (${e.shape[a]})`))}function us(e){const t=[];let r=0;for(;e>0;)1&e&&t.push(r),e/=2,r++;return t}function fs(e,t,r){const n=[];for(let a=0;a<e.length;a++)n[a]=Math.ceil((t[a]-e[a])/r[a]);return n}function ps(e,t,r,n){const a=[...e];for(let e=a.length;e<n.length;e++)a.push(1);for(let e=0;e<r;e++)0===e?a[t]=1:(a.splice(t,0,1),a.pop());return a}function hs(e,t,r){return r<=e?r:r-(t-1)}function ds(e,t){const r=[];for(let n=0;n<e;n++)r.push(t+n);return r}function ms(e,t,r,n,a,i,o,s,l){const c=e.length;let u=new Array(c),f=new Array(c),p=new Array(c);if(t.length&&r>0){const l=t[0],c=r+1;u=gs(o,l,c,n,e),f=ys(s,l,c,a,e),p=ps(i,l,c,e)}else for(let t=0;t<c;t++)u[t]=bs(o,n,i,e,t,l),f[t]=xs(s,a,i,e,t,l),p[t]=vs(i,t,l);return{begin:u,end:f,strides:p}}function gs(e,t,r,n,a){const i=[...a],o=ds(r,t);for(let a=0;a<i.length;a++)if(o.indexOf(a)>-1)i[a]=0;else{const o=hs(t,r,a);let s=n[o];e&1<<o&&(s=0),i[a]=s}return i}function ys(e,t,r,n,a){const i=[...a],o=ds(r,t);for(let a=0;a<i.length;a++)if(o.indexOf(a)>-1)i[a]=Number.MAX_SAFE_INTEGER;else{const o=hs(t,r,a);let s=n[o];e&1<<o&&(s=Number.MAX_SAFE_INTEGER),i[a]=s}for(let e=0;e<i.length;e++){const t=a[e];i[e]<0&&(i[e]+=t),i[e]=K(0,i[e],a[e])}return i}function vs(e,t,r){let n=e[t];return(r&1<<t||null==n)&&(n=1),n}function bs(e,t,r,n,a,i){let o=t[a];const s=r[a]||1;(e&1<<a||i&1<<a||null==o)&&(o=s>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const l=n[a];return o<0&&(o+=l),o=K(0,o,l-1),o}function xs(e,t,r,n,a,i){let o=t[a];const s=r[a]||1;(e&1<<a||i&1<<a||null==o)&&(o=s>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const l=n[a];return o<0&&(o+=l),o=s>0?K(0,o,l):K(-1,o,l-1),o}function _s(e,t,r){let n=r.length;for(let e=0;e<r.length;e++)if(r[e]>1){n=e;break}for(let a=n+1;a<r.length;a++)if(t[a]>0||r[a]!==e[a])return!1;return!0}function ws(e,t){let r=e.length>0?e[e.length-1]:1;for(let n=0;n<e.length-1;n++)r+=e[n]*t[n];return r}function ks(e,t,r){let n;const a=e.shape.length;let i;return n="number"==typeof t?[t,...new Array(a-1).fill(0)]:t.length<a?t.concat(new Array(a-t.length).fill(0)):t.slice(),n.forEach((e=>{ne(-1!==e,(()=>"slice() does not support negative begin indexing."))})),i=null==r?new Array(a).fill(-1):"number"==typeof r?[r,...new Array(a-1).fill(-1)]:r.length<a?r.concat(new Array(a-r.length).fill(-1)):r,i=i.map(((t,r)=>t>=0?t:(ne(-1===t,(()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${r}.`)),e.shape[r]-n[r]))),[n,i]}function Ds(e,t,r,n,a,i,o,s,l){let c;if(null==n?(c=new Array(t.length),c.fill(1)):c=n,null!=o&&0!=(o&o-1))throw new Error("Multiple ellipses in slice is not allowed.");let u=!1;const f={dims:c.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:r.slice(),strides:c.slice(),beginMask:a,endMask:i,ellipsisMask:o,newAxisMask:s,shrinkAxisMask:l};for(let e=0;e<f.dims;e++)u&&0!=(1<<e&s)&&f.numAddAxisAfterEllipsis++,1<<e&o&&(u=!0);u||(f.ellipsisMask|=1<<f.dims,f.dims++);const p={dims:e.length,beginMask:0,endMask:0,beginValid:!1,endValid:!1};!function(e,t){t.beginMask=0,t.endMask=0,t.shrinkAxisMask=0;let r=0;t.beginValid=null!=e.begin,t.endValid=null!=e.end,t.begin=new Array(t.dims),t.end=new Array(t.dims),t.strides=new Array(t.dims),t.finalShapeGatherIndices=[],t.finalShapeGatherIndicesSparse=[],t.inputShapeGatherIndicesSparse=new Array(t.dims);for(let n=0;n<e.dims;n++)if(1<<n&e.ellipsisMask){const a=Math.min(t.dims-(e.dims-n)+1+e.numAddAxisAfterEllipsis,t.dims);for(;r<a;r++)t.begin[r]=0,t.end[r]=0,t.strides[r]=1,t.beginMask|=1<<r,t.endMask|=1<<r,t.finalShapeGatherIndices.push(r),t.finalShapeGatherIndicesSparse.push(-1),t.inputShapeGatherIndicesSparse[r]=n}else if(1<<n&e.newAxisMask)t.finalShapeGatherIndices.push(-2),t.finalShapeGatherIndicesSparse.push(-1);else{if(r===t.begin.length)throw Error(`Index out of range using input dim ${r}; input has only ${t.dims} dims, ${t.begin.length}.`);null!=e.begin&&(t.begin[r]=e.begin[n]),null!=e.end&&(t.end[r]=e.end[n]),t.strides[r]=e.strides[n],e.beginMask&1<<n&&(t.beginMask|=1<<r),e.endMask&1<<n&&(t.endMask|=1<<r),e.shrinkAxisMask&1<<n?(t.finalShapeGatherIndices.push(-1),t.finalShapeGatherIndicesSparse.push(-1),t.shrinkAxisMask|=1<<r):(t.finalShapeGatherIndices.push(r),t.finalShapeGatherIndicesSparse.push(n)),t.inputShapeGatherIndicesSparse[r]=n,r++}}(f,p);let h=!0,d=!0,m=!0;const g=[],y=[];for(let t=0;t<e.length;++t){if(0===p.strides[t])throw Error(`strides[${t}] must be non-zero`);const r=!!(p.shrinkAxisMask&1<<t),n=e[t];if(-1===n){g.push(r?1:-1);continue}const a=[p.beginMask&1<<t,p.endMask&1<<t],i=[p.strides[t]>0?0:-1,p.strides[t]>0?n:n-1];if(r&&p.strides[t]<=0)throw Error("only stride 1 allowed on non-range indexing.");m=m&&1===p.strides[t];const o=!!(p.beginMask&1<<t&&p.endMask&1<<t);if(p.beginValid&&p.endValid){if(r){const e=p.begin[t]<0?n+p.begin[t]:p.begin[t];if(p.begin[t]=e,p.end[t]=p.begin[t]+1,e<0||e>=n)throw Error(`slice index ${p.begin[t]} of dimension ${t} out of bounds.`)}else p.begin[t]=Ts(p.begin[t],0,p.strides[t],n,a,i),p.end[t]=Ts(p.end[t],1,p.strides[t],n,a,i);const e=1===p.strides[t]&&0===p.begin[t]&&p.end[t]===n;h=h&&e,d=d&&(0===t&&1===p.strides[t]||e)}else h=h&&1===p.strides[t]&&o,d=d&&(0===t&&1===p.strides[t]||o);let s,l=!1;if(p.beginValid&&p.endValid?(s=p.end[t]-p.begin[t],l=!0):r?(s=1,l=!0):o&&n>=0&&(s=p.strides[t]<0?-n:n,l=!0),l){let e;e=0===s||s<0!=p.strides[t]<0?0:Math.trunc(s/p.strides[t])+(s%p.strides[t]!=0?1:0),g.push(e)}else g.push(-1)}for(let e=0;e<p.finalShapeGatherIndices.length;++e){const t=p.finalShapeGatherIndices[e];t>=0?y.push(g[t]):-2===t&&y.push(1)}return{finalShapeSparse:y.filter(((e,t)=>-2!==p.finalShapeGatherIndices[t])),finalShape:y,isIdentity:h,sliceDim0:d,isSimpleSlice:m,begin:p.begin,end:p.end,strides:p.strides}}function Ts(e,t,r,n,a,i){if(a[t])return r>0?i[t]:i[t+1&1];{const t=e<0?n+e:e;return t<i[0]?i[0]:t>i[1]?i[1]:t}}class As{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class Ss{constructor(){this.classNameMap={}}static getMap(){return null==Ss.instance&&(Ss.instance=new Ss),Ss.instance}static register(e){Ss.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Ms(e){ne(null!=e.className,(()=>"Class being registered does not have the static className property defined.")),ne("string"==typeof e.className,(()=>"className is required to be a string, but got type "+typeof e.className)),ne(e.className.length>0,(()=>"Class being registered has an empty-string as its className, which is disallowed.")),Ss.register(e)}const Es=.1;function Cs(e,t,r){return null==r&&(r=Ns()),Os(e,t,((e,t)=>Ls(e,t,r)))}function Ns(){return 32===hi.backend.floatPrecision()?.001:Es}function Os(e,t,r){let n=!0;if((De(e)||De(t))&&(n=!1),De(e)&&De(t)&&(n=!0),n){const r=e.constructor.name,n=t.constructor.name;if(r!==n)throw new Error(`Arrays are of different type. Actual: ${r}. Expected: ${n}`)}if(Array.isArray(e)&&Array.isArray(t)){const r=xi(e),n=xi(t);if(!ce(r,n))throw new Error(`Arrays have different shapes. Actual: [${r}]. Expected: [${n}]`)}const a=De(e)?e:oe(e),i=De(t)?t:oe(t);if(a.length!==i.length)throw new Error(`Arrays have different lengths actual: ${a.length} vs expected: ${i.length}.\nActual:   ${a}.\nExpected: ${i}.`);for(let e=0;e<i.length;++e){const t=a[e],n=i[e];if(!r(t,n))throw new Error(`Arrays differ: actual[${e}] = ${t}, expected[${e}] = ${n}.\nActual:   ${a}.\nExpected: ${i}.`)}}function Is(e,t){e().then((()=>t.fail()),(()=>t()))}function Ps(e,t){const r="string"==typeof t||"number"==typeof t||"boolean"==typeof t?[t]:t;return Se(e)||Se(e[0])||Se(t)||Se(t[0])?Os(e,r,((e,t)=>e==t)):Os(e,t,((e,t)=>Ls(e,t,0)))}function Rs(e,t,r){if(null==r&&(r=Ns()),!Ls(e,t,r))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`)}function Ls(e,t,r){return!isFinite(e)&&!isFinite(t)||!(isNaN(e)||isNaN(t)||Math.abs(e-t)>r)}function Fs(e,t,r){for(let n=0;n<e.length;n++)if(e[n]<t||e[n]>r)throw new Error(`Value out of range:${e[n]} low: ${t}, high: ${r}`)}function Bs(e,t){const r=new Float32Array(e),n=new Float32Array(t);if(r.length!==n.length)throw new Error(`Expected ArrayBuffer to be of length ${n.length}, but it was ${r.length}`);for(let e=0;e<n.length;e++)if(r[e]!==n[e])throw new Error(`Expected ArrayBuffer value at ${e} to be ${n[e]} but got ${r[e]} instead`)}function zs(e){for(let t=0;t<e.length;t++){const r=e[t];Array.isArray(r)?zs(r):e[t]=Ia(r)}return e}const js="3.13.0";function Us(){We().set("PROD",!0)}function $s(){We().set("DEBUG",!0)}function Vs(){We().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function qs(e){We().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function Ws(){hi.disposeVariables()}function Hs(){return hi}function Gs(){return hi.memory()}function Xs(e){return hi.profile(e)}function Ys(e,t){return hi.tidy(e,t)}function Zs(e){si(e).forEach((e=>e.dispose()))}function Ks(e){return hi.keep(e)}function Js(e){return hi.time(e)}function Qs(e){return hi.setBackend(e)}function el(){return hi.ready()}function tl(){return hi.backendName}function rl(e){hi.removeBackend(e)}function nl(e){return hi.findBackend(e)}function al(e){return hi.findBackendFactory(e)}function il(e,t,r=1){return hi.registerBackend(e,t,r)}function ol(){return hi.backend}function sl(e,t){We().setPlatform(e,t)}Ha=qs;const ll=Ai({add_:function(e,t){let r=ki(e,"a","add"),n=ki(t,"b","add");[r,n]=ai(r,n);const a={a:r,b:n};return hi.runKernel(Qe,a)}}),cl=Ai({floorDiv_:function(e,t){let r=ki(e,"a","floorDiv"),n=ki(t,"b","floorDiv");[r,n]=ai(r,n);const a={a:r,b:n};return hi.runKernel(nr,a)}}),ul=Ai({div_:function(e,t){let r=ki(e,"a","div"),n=ki(t,"b","div");if([r,n]=ai(r,n),"int32"===r.dtype&&"int32"===n.dtype)return cl(r,n);const a={a:r,b:n};return hi.runKernel(qt,a,{})}}),fl=Ai({mul_:function(e,t){let r=ki(e,"a","mul"),n=ki(t,"b","mul");[r,n]=ai(r,n);const a={a:r,b:n};return hi.runKernel(jr,a)}}),pl=Ai({sqrt_:function(e){const t={x:ki(e,"x","sqrt","float32")};return hi.runKernel(kn,t)}}),hl=Ai({square_:function(e){const t=ki(e,"x","square");return hi.runKernel("Square",{x:t},{})}}),dl=Ai({zerosLike_:function(e){const t={x:ki(e,"x","zerosLike")};return hi.runKernel(Yn,t)}});function ml(e){return ne(Ne(e),(()=>"The f passed in grad(f) must be a function")),(t,r)=>{const n=ki(t,"x","tf.grad","string_or_numeric"),a=null!=r?ki(r,"dy","tf.grad"):null;return hi.tidy((()=>{const{value:t,grads:r}=hi.gradients((()=>e(n)),[n],a);return null!=a&&ae(t.shape,a.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),_l(r),r[0]}))}}function gl(e){return ne(Ne(e),(()=>"The f passed in grads(f) must be a function")),(t,r)=>{ne(Array.isArray(t),(()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s"));const n=Di(t,"args","tf.grads","string_or_numeric"),a=null!=r?ki(r,"dy","tf.grads"):null;return hi.tidy((()=>{const{value:t,grads:r}=hi.gradients((()=>e(...n)),n,a);return null!=a&&ae(t.shape,a.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),_l(r),r}))}}function yl(e){return ne(Ne(e),(()=>"The f passed in valueAndGrad(f) must be a function")),(t,r)=>{ne(t instanceof Ga,(()=>"The x passed in valueAndGrad(f)(x) must be a tensor")),ne(null==r||r instanceof Ga,(()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor"));const{grads:n,value:a}=hi.gradients((()=>e(t)),[t],r);return _l(n),{grad:n[0],value:a}}}function vl(e){return ne(Ne(e),(()=>"The f passed in valueAndGrads(f) must be a function")),(t,r)=>{ne(Array.isArray(t)&&t.every((e=>e instanceof Ga)),(()=>"The args passed in valueAndGrads(f)(args) must be array of tensors")),ne(null==r||r instanceof Ga,(()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor"));const n=hi.gradients((()=>e(...t)),t,r);return null!=r&&ae(n.value.shape,r.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),_l(n.grads),n}}function bl(e,t){ne(Ne(e),(()=>"The f passed in variableGrads(f) must be a function")),ne(null==t||Array.isArray(t)&&t.every((e=>e instanceof Ya)),(()=>"The varList passed in variableGrads(f, varList) must be an array of variables"));const r=null!=t;if(!r){t=[];for(const e in hi.registeredVariables)t.push(hi.registeredVariables[e])}const n=r?t.filter((e=>!e.trainable)):null,a=t.length;t=t.filter((e=>e.trainable)),ne(t.length>0,(()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${a} variables is trainable.`));const{value:i,grads:o}=hi.gradients(e,t,null,!0);ne(o.some((e=>null!=e)),(()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize().")),ne(0===i.rank,(()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`));const s={};return t.forEach(((e,t)=>{null!=o[t]&&(s[e.name]=o[t])})),null!=n&&n.forEach((e=>s[e.name]=null)),{value:i,grads:s}}function xl(e){return hi.customGrad(e)}function _l(e){if(e.filter((e=>null==e)).length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n    the f you passed encloses all operations that lead from x to y.")}function wl(e,t){if((De(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&De(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Mi(e,[],[],t)}class kl extends As{minimize(e,t=!1,r){const{value:n,grads:a}=this.computeGradients(e,r);if(null!=r){const e=r.map((e=>({name:e.name,tensor:a[e.name]})));this.applyGradients(e)}else this.applyGradients(a);return Zs(a),t?n:(n.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return bl(e,t)}dispose(){null!=this.iterations_&&Zs(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:wl(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty(kl,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});class Dl extends kl{constructor(e,t,r=null){super(),this.learningRate=e,this.rho=t,this.epsilon=r,this.accumulatedGrads=[],this.accumulatedUpdates=[],null==r&&(this.epsilon=hi.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,r)=>{const n=hi.registeredVariables[t];null==this.accumulatedGrads[r]&&(this.accumulatedGrads[r]={originalName:`${t}/accum_grad`,variable:Ys((()=>dl(n).variable(!1)))}),null==this.accumulatedUpdates[r]&&(this.accumulatedUpdates[r]={originalName:`${t}/accum_var`,variable:Ys((()=>dl(n).variable(!1)))});const a=Array.isArray(e)?e[r].tensor:e[t];if(null==a)return;const i=this.accumulatedGrads[r].variable,o=this.accumulatedUpdates[r].variable;Ys((()=>{const e=ll(fl(i,this.rho),fl(hl(a),1-this.rho)),t=fl(ul(pl(ll(o,this.epsilon)),pl(ll(i,this.epsilon))),a),r=ll(fl(o,this.rho),fl(hl(t),1-this.rho));i.assign(e),o.assign(r);const s=ll(fl(t,-this.learningRate),n);n.assign(s)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&(Zs(this.accumulatedGrads.map((e=>e.variable))),Zs(this.accumulatedUpdates.map((e=>e.variable))))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){const t=(e=await this.extractIterations(e)).length/2;this.accumulatedGrads=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(!1)}))),this.accumulatedUpdates=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(!1)})))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}function Tl(e,t,r){const n={shape:e,value:t,dtype:r};return hi.runKernel(er,{},n)}Dl.className="Adadelta",Ms(Dl);class Al extends kl{constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,r)=>{const n=hi.registeredVariables[t];if(null==this.accumulatedGrads[r]){const e=!1;this.accumulatedGrads[r]={originalName:`${t}/accumulator`,variable:Ys((()=>Tl(n.shape,this.initialAccumulatorValue).variable(e)))}}const a=Array.isArray(e)?e[r].tensor:e[t];if(null==a)return;const i=this.accumulatedGrads[r].variable;Ys((()=>{const e=ll(i,hl(a));i.assign(e);const t=ll(fl(ul(a,pl(ll(e,hi.backend.epsilon()))),-this.learningRate),n);n.assign(t)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&Zs(this.accumulatedGrads.map((e=>e.variable)))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e),this.accumulatedGrads=e.map((e=>({originalName:e.name,variable:e.tensor.variable(!1)})))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}Al.className="Adagrad",Ms(Al);const Sl=Ai({pow_:function(e,t){let r=ki(e,"base","pow"),n=ki(t,"exp","pow");[r,n]=ai(r,n);const a={a:r,b:n};return hi.runKernel(Kr,a)}}),Ml=Ai({sub_:function(e,t){let r=ki(e,"a","sub"),n=ki(t,"b","sub");[r,n]=ai(r,n);const a={a:r,b:n};return hi.runKernel(zn,a)}});class El extends kl{constructor(e,t,r,n=null){super(),this.learningRate=e,this.beta1=t,this.beta2=r,this.epsilon=n,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Ys((()=>{this.accBeta1=wl(t).variable(),this.accBeta2=wl(r).variable()})),null==n&&(this.epsilon=hi.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);Ys((()=>{const r=Ml(1,this.accBeta1),n=Ml(1,this.accBeta2);t.forEach(((t,a)=>{const i=hi.registeredVariables[t];null==this.accumulatedFirstMoment[a]&&(this.accumulatedFirstMoment[a]={originalName:`${t}/m`,variable:Ys((()=>dl(i).variable(!1)))}),null==this.accumulatedSecondMoment[a]&&(this.accumulatedSecondMoment[a]={originalName:`${t}/v`,variable:Ys((()=>dl(i).variable(!1)))});const o=Array.isArray(e)?e[a].tensor:e[t];if(null==o)return;const s=this.accumulatedFirstMoment[a].variable,l=this.accumulatedSecondMoment[a].variable,c=ll(fl(s,this.beta1),fl(o,1-this.beta1)),u=ll(fl(l,this.beta2),fl(hl(o),1-this.beta2)),f=ul(c,r),p=ul(u,n);s.assign(c),l.assign(u);const h=ll(fl(ul(f,ll(pl(p),this.epsilon)),-this.learningRate),i);i.assign(h)})),this.accBeta1.assign(fl(this.accBeta1,this.beta1)),this.accBeta2.assign(fl(this.accBeta2,this.beta2))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&Zs(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedSecondMoment&&Zs(this.accumulatedSecondMoment.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e),Ys((()=>{this.accBeta1.assign(Sl(this.beta1,this.iterations_+1)),this.accBeta2.assign(Sl(this.beta2,this.iterations_+1))}));const t=e.length/2;this.accumulatedFirstMoment=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(!1)}))),this.accumulatedSecondMoment=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(!1)})))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}}El.className="Adam",Ms(El);const Cl=Ai({abs_:function(e){const t=ki(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return hi.runKernel(kt,e)}{const e={x:t};return hi.runKernel(Ze,e)}}}),Nl=Ai({maximum_:function(e,t){let r=ki(e,"a","maximum"),n=ki(t,"b","maximum");[r,n]=ai(r,n),"bool"===r.dtype&&(r=Ao(r,"int32"),n=Ao(n,"int32")),Jo(r.shape,n.shape);const a={a:r,b:n};return hi.runKernel(Mr,a)}});class Ol extends kl{constructor(e,t,r,n=null,a=0){super(),this.learningRate=e,this.beta1=t,this.beta2=r,this.epsilon=n,this.decay=a,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],Ys((()=>{this.iteration=wl(0).variable(),this.accBeta1=wl(t).variable()})),null==n&&(this.epsilon=hi.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);Ys((()=>{const r=Ml(1,this.accBeta1),n=ul(-this.learningRate,ll(fl(this.iteration,this.decay),1));t.forEach(((t,a)=>{const i=hi.registeredVariables[t];null==this.accumulatedFirstMoment[a]&&(this.accumulatedFirstMoment[a]={originalName:`${t}/m`,variable:dl(i).variable(!1)}),null==this.accumulatedWeightedInfNorm[a]&&(this.accumulatedWeightedInfNorm[a]={originalName:`${t}/v`,variable:dl(i).variable(!1)});const o=Array.isArray(e)?e[a].tensor:e[t];if(null==o)return;const s=this.accumulatedFirstMoment[a].variable,l=this.accumulatedWeightedInfNorm[a].variable,c=ll(fl(s,this.beta1),fl(o,1-this.beta1)),u=fl(l,this.beta2),f=Cl(o),p=Nl(u,f);s.assign(c),l.assign(p);const h=ll(fl(ul(n,r),ul(c,ll(p,this.epsilon))),i);i.assign(h)})),this.iteration.assign(ll(this.iteration,1)),this.accBeta1.assign(fl(this.accBeta1,this.beta1))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&Zs(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedWeightedInfNorm&&Zs(this.accumulatedWeightedInfNorm.map((e=>e.variable)))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}}Ol.className="Adamax",Ms(Ol);class Il extends kl{constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,r)=>{const n=Array.isArray(e)?e[r].tensor:e[t];if(null==n)return;const a=hi.registeredVariables[t];Ys((()=>{const e=ll(fl(this.c,n),a);a.assign(e)}))})),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=Ks(wl(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(0!==(e=await this.extractIterations(e)).length)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}}Il.className="SGD",Ms(Il);class Pl extends Il{constructor(e,t,r=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=r,this.accumulations=[],this.m=wl(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,r)=>{const n=hi.registeredVariables[t];if(null==this.accumulations[r]){const e=!1;this.accumulations[r]={originalName:`${t}/momentum`,variable:Ys((()=>dl(n).variable(e)))}}const a=this.accumulations[r].variable,i=Array.isArray(e)?e[r].tensor:e[t];null!=i&&Ys((()=>{let e;const t=ll(fl(this.m,a),i);e=this.useNesterov?ll(fl(this.c,ll(i,fl(t,this.m))),n):ll(fl(this.c,t),n),a.assign(t),n.assign(e)}))})),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&Zs(this.accumulations.map((e=>e.variable)))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e),this.accumulations=e.map((e=>({originalName:e.name,variable:e.tensor.variable(!1)})))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}Pl.className="Momentum",Ms(Pl);class Rl extends kl{constructor(e,t=.9,r=0,n=null,a=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=r,this.epsilon=n,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=a,null==n&&(this.epsilon=hi.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,r)=>{const n=hi.registeredVariables[t],a=!1;null==this.accumulatedMeanSquares[r]&&(this.accumulatedMeanSquares[r]={originalName:`${t}/rms`,variable:Ys((()=>dl(n).variable(a)))}),null==this.accumulatedMoments[r]&&(this.accumulatedMoments[r]={originalName:`${t}/momentum`,variable:Ys((()=>dl(n).variable(a)))}),null==this.accumulatedMeanGrads[r]&&this.centered&&(this.accumulatedMeanGrads[r]={originalName:`${t}/mg`,variable:Ys((()=>dl(n).variable(a)))});const i=Array.isArray(e)?e[r].tensor:e[t];if(null==i)return;const o=this.accumulatedMeanSquares[r].variable,s=this.accumulatedMoments[r].variable;Ys((()=>{const e=ll(fl(o,this.decay),fl(hl(i),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[r].variable,a=ll(fl(t,this.decay),fl(i,1-this.decay)),l=ul(fl(i,this.learningRate),pl(Ml(e,ll(hl(a),this.epsilon)))),c=ll(fl(s,this.momentum),l);o.assign(e),t.assign(a),s.assign(c);const u=Ml(n,c);n.assign(u)}else{const e=ll(fl(o,this.decay),fl(hl(i),1-this.decay)),t=ll(fl(s,this.momentum),ul(fl(i,this.learningRate),pl(ll(e,this.epsilon))));o.assign(e),s.assign(t);const r=Ml(n,t);n.assign(r)}}))})),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&Zs(this.accumulatedMeanSquares.map((e=>e.variable))),null!=this.accumulatedMeanGrads&&this.centered&&Zs(this.accumulatedMeanGrads.map((e=>e.variable))),null!=this.accumulatedMoments&&Zs(this.accumulatedMoments.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);const t=this.centered?e.length/3:e.length/2,r=!1;this.accumulatedMeanSquares=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(r)}))),this.accumulatedMoments=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(r)}))),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map((e=>({originalName:e.name,variable:e.tensor.variable(r)}))))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}}Rl.className="RMSProp",Ms(Rl);class Ll{static sgd(e){return new Il(e)}static momentum(e,t,r=!1){return new Pl(e,t,r)}static rmsprop(e,t=.9,r=0,n=null,a=!1){return new Rl(e,t,r,n,a)}static adam(e=.001,t=.9,r=.999,n=null){return new El(e,t,r,n)}static adadelta(e=.001,t=.95,r=null){return new Dl(e,t,r)}static adamax(e=.002,t=.9,r=.999,n=null,a=0){return new Ol(e,t,r,n,a)}static adagrad(e,t=.1){return new Al(e,t)}}const Fl=Ai({acos_:function(e){const t={x:ki(e,"x","acos")};return hi.runKernel(Ke,t)}}),Bl=Ai({acosh_:function(e){const t={x:ki(e,"x","acosh")};return hi.runKernel(Je,t)}}),zl=Ai({addN_:function(e){ne(Array.isArray(e),(()=>"The argument passed to tf.addN() must be a list of tensors")),ne(e.length>=1,(()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`));const t=e.map(((e,t)=>ki(e,`tensors${t}`,"addN"))),r=t[0];t.forEach((e=>{if(e.dtype!==r.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")})),t.forEach((e=>{if(!ce(e.shape,r.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));const n=t;return hi.runKernel(et,n)}}),jl=Ai({all_:function(e,t=null,r=!1){const n={x:ki(e,"x","all","bool")},a={axis:t,keepDims:r};return hi.runKernel(tt,n,a)}}),Ul=Ai({any_:function(e,t=null,r=!1){const n={x:ki(e,"x","any","bool")},a={axis:t,keepDims:r};return hi.runKernel(rt,n,a)}}),$l=Ai({argMax_:function(e,t=0){const r={x:ki(e,"x","argMax")},n={axis:t};return hi.runKernel(nt,r,n)}}),Vl=Ai({argMin_:function(e,t=0){const r={x:ki(e,"x","argMin")},n={axis:t};return hi.runKernel(at,r,n)}}),ql=Ai({asin_:function(e){const t={x:ki(e,"x","asin")};return hi.runKernel(it,t)}}),Wl=Ai({asinh_:function(e){const t={x:ki(e,"x","asinh")};return hi.runKernel(ot,t)}}),Hl=Ai({atan_:function(e){const t={x:ki(e,"x","atan")};return hi.runKernel(st,t)}}),Gl=Ai({atan2_:function(e,t){let r=ki(e,"a","atan2"),n=ki(t,"b","atan2");[r,n]=ai(r,n);const a={a:r,b:n};return hi.runKernel(ct,a)}}),Xl=Ai({atanh_:function(e){const t={x:ki(e,"x","atanh")};return hi.runKernel(lt,t)}});function Yl(e,t,r,n,a="NHWC",i){return Jl(e,[...t,e[3]],r,i,n,null,null,sc(a))}function Zl(e,t,r,n,a,i,o="channelsLast"){const[s,l]=tc(t);let c;if("channelsLast"===o)c=[s,l,e[3],e[3]];else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);c=[s,l,e[1],e[1]]}return Jl(e,c,r,n,a,i,!1,o)}function Kl(e,t,r,n,a,i,o="NDHWC"){const[s,l,c]=rc(t);let u,f;if("NDHWC"===o)f="channelsLast",u=[s,l,c,e[4],e[4]];else{if("NCDHW"!==o)throw new Error(`Unknown dataFormat ${o}`);f="channelsFirst",u=[s,l,c,e[1],e[1]]}return Ql(e,u,r,n,a,!1,f,i)}function Jl(e,t,r,n,a,i,o=!1,s="channelsLast"){let[l,c,u,f]=[-1,-1,-1,-1];if("channelsLast"===s)[l,c,u,f]=e;else{if("channelsFirst"!==s)throw new Error(`Unknown dataFormat ${s}`);[l,f,c,u]=e}const[p,h,,d]=t,[m,g]=tc(r),[y,v]=tc(n),b=nc(p,y),x=nc(h,v),{padInfo:_,outHeight:w,outWidth:k}=function(e,t,r,n,a,i,o,s,l){let c,u,f;if("number"==typeof e){c={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const a=function(e,t,r,n,a){null==n&&(n=ec(e,t,r));const i=e[1];return[ac((e[0]-t+2*n)/r+1,a),ac((i-t+2*n)/r+1,a)]}([t,r],i,n,e,s);u=a[0],f=a[1]}else if("same"===e){u=Math.ceil(t/n),f=Math.ceil(r/a);const e=Math.max(0,(u-1)*n+i-t),s=Math.max(0,(f-1)*a+o-r),l=Math.floor(e/2),p=e-l,h=Math.floor(s/2);c={top:l,bottom:p,left:h,right:s-h,type:"SAME"}}else if("valid"===e)c={top:0,bottom:0,left:0,right:0,type:"VALID"},u=Math.ceil((t-i+1)/n),f=Math.ceil((r-o+1)/a);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const p="channelsLast"===l?e[1][0]:e[2][0],h="channelsLast"===l?e[1][1]:e[2][1],d="channelsLast"===l?e[2][0]:e[3][0],m="channelsLast"===l?e[2][1]:e[3][1];c={top:p,bottom:h,left:d,right:m,type:0===p&&0===h&&0===d&&0===m?"VALID":"EXPLICIT"},u=ac((t-i+p+h)/n+1,s),f=ac((r-o+d+m)/a+1,s)}}return{padInfo:c,outHeight:u,outWidth:f}}(a,c,u,m,g,b,x,i,s),D=o?d*f:d;let T;return"channelsFirst"===s?T=[l,D,w,k]:"channelsLast"===s&&(T=[l,w,k,D]),{batchSize:l,dataFormat:s,inHeight:c,inWidth:u,inChannels:f,outHeight:w,outWidth:k,outChannels:D,padInfo:_,strideHeight:m,strideWidth:g,filterHeight:p,filterWidth:h,effectiveFilterHeight:b,effectiveFilterWidth:x,dilationHeight:y,dilationWidth:v,inShape:e,outShape:T,filterShape:t}}function Ql(e,t,r,n,a,i=!1,o="channelsLast",s){let[l,c,u,f,p]=[-1,-1,-1,-1,-1];if("channelsLast"===o)[l,c,u,f,p]=e;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[l,p,c,u,f]=e}const[h,d,m,,g]=t,[y,v,b]=rc(r),[x,_,w]=rc(n),k=nc(h,x),D=nc(d,_),T=nc(m,w),{padInfo:A,outDepth:S,outHeight:M,outWidth:E}=function(e,t,r,n,a,i,o,s,l,c,u){let f,p,h,d;if("number"==typeof e){f={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};const i=function(e,t,r,n,a,i){null==a&&(a=ec(e,t,n));const o=e[1],s=e[2];return[ac((e[0]-t+2*a)/n+1,i),ac((o-t+2*a)/n+1,i),ac((s-t+2*a)/n+1,i),1]}([t,r,n,1],s,0,a,e,u);p=i[0],h=i[1],d=i[2]}else if("same"===e){p=Math.ceil(t/a),h=Math.ceil(r/i),d=Math.ceil(n/o);const e=(p-1)*a+s-t,u=(h-1)*i+l-r,m=(d-1)*o+c-n,g=Math.floor(e/2),y=e-g,v=Math.floor(u/2),b=u-v,x=Math.floor(m/2);f={top:v,bottom:b,left:x,right:m-x,front:g,back:y,type:"SAME"}}else{if("valid"!==e)throw Error(`Unknown padding parameter: ${e}`);f={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},p=Math.ceil((t-s+1)/a),h=Math.ceil((r-l+1)/i),d=Math.ceil((n-c+1)/o)}return{padInfo:f,outDepth:p,outHeight:h,outWidth:d}}(a,c,u,f,y,v,b,k,D,T,s),C=i?g*p:g;let N;return"channelsFirst"===o?N=[l,C,S,M,E]:"channelsLast"===o&&(N=[l,S,M,E,C]),{batchSize:l,dataFormat:o,inDepth:c,inHeight:u,inWidth:f,inChannels:p,outDepth:S,outHeight:M,outWidth:E,outChannels:C,padInfo:A,strideDepth:y,strideHeight:v,strideWidth:b,filterDepth:h,filterHeight:d,filterWidth:m,effectiveFilterDepth:k,effectiveFilterHeight:D,effectiveFilterWidth:T,dilationDepth:x,dilationHeight:_,dilationWidth:w,inShape:e,outShape:N,filterShape:t}}function ec(e,t,r,n=1){const a=nc(t,n);return Math.floor((e[0]*(r-1)-r+a)/2)}function tc(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function rc(e){return"number"==typeof e?[e,e,e]:e}function nc(e,t){return t<=1?e:e+(e-1)*(t-1)}function ac(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function ic(e){const[t,r,n]=tc(e);return 1===t&&1===r&&1===n}function oc(e,t){return ic(e)||ic(t)}function sc(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function lc(e,t,r){if(null!=r){if("string"==typeof t)throw Error(`Error in ${e}: pad must be an integer when using dimRoundingMode ${r} but got pad ${t}.`);if("number"==typeof t)ne(ue(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${r} but got pad ${t}.`));else{if("object"!=typeof t)throw Error(`Error in ${e}: Unknown padding parameter: ${t}`);t.forEach((t=>{t.forEach((t=>{ne(ue(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${r} but got pad ${t}.`))}))}))}}}const cc=Ai({reshape_:function(e,t){const r={x:ki(e,"x","reshape","string_or_numeric")},n={shape:t};return hi.runKernel(an,r,n)}}),uc=Ai({avgPool_:function(e,t,r,n,a){const i=ki(e,"x","avgPool","float32");ne(oc(r,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${r} and dilations '1'`));let o=i,s=!1;3===i.rank&&(s=!0,o=cc(i,[1,i.shape[0],i.shape[1],i.shape[2]])),ne(4===o.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${o.rank}.`)),lc("avgPool",n,a);const l={x:o},c={filterSize:t,strides:r,pad:n,dimRoundingMode:a};let u=hi.runKernel(ut,l,c);return u=Ao(u,i.dtype),s?cc(u,[u.shape[1],u.shape[2],u.shape[3]]):u}}),fc=Ai({avgPool3d_:function(e,t,r,n,a,i="NDHWC"){const o=ki(e,"x","avgPool3d","float32");let s=o,l=!1;4===o.rank&&(l=!0,s=cc(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),ne(5===s.rank,(()=>`Error in avgPool3d: x must be rank 5 but got rank ${s.rank}.`)),ne("NDHWC"===i,(()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`)),lc("avgPool3d",n,a);const c={x:s},u={filterSize:t,strides:r,pad:n,dimRoundingMode:a,dataFormat:i};let f=hi.runKernel(pt,c,u);return f=Ao(f,s.dtype),l?cc(f,[f.shape[1],f.shape[2],f.shape[3],f.shape[4]]):f}}),pc=Ai({concat_:function(e,t=0){ne(e.length>=1,(()=>"Pass at least one tensor to concat"));const r=Di(e,"tensors","concat","string_or_numeric");if("complex64"===r[0].dtype&&r.forEach((e=>{if("complex64"!==e.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n          with dtype ${e.dtype}. `)})),1===r.length)return So(r[0]);const n=r,a={axis:t};return hi.runKernel(Dt,n,a)}}),hc=Ai({sigmoid_:function(e){const t={x:ki(e,"x","sigmoid","float32")};return hi.runKernel(_n,t)}}),dc=Ai({slice_:function(e,t,r){const n=ki(e,"x","slice","string_or_numeric");if(0===n.rank)throw new Error("Slicing scalar is not possible");const a={x:n},i={begin:t,size:r};return hi.runKernel(yn,a,i)}}),mc=Ai({tanh_:function(e){const t={x:ki(e,"x","tanh","float32")};return hi.runKernel(Un,t)}}),gc=Ai({basicLSTMCell_:function(e,t,r,n,a,i){const o=ki(e,"forgetBias","basicLSTMCell"),s=ki(t,"lstmKernel","basicLSTMCell"),l=ki(r,"lstmBias","basicLSTMCell"),c=ki(n,"data","basicLSTMCell"),u=ki(a,"c","basicLSTMCell"),f=ki(i,"h","basicLSTMCell"),p=pc([c,f],1),h=Ho(p,s),d=ll(h,l),m=d.shape[0],g=d.shape[1]/4,y=[m,g],v=dc(d,[0,0],y),b=dc(d,[0,g],y),x=dc(d,[0,2*g],y),_=dc(d,[0,3*g],y),w=ll(fl(hc(v),mc(b)),fl(u,hc(ll(o,x))));return[w,fl(mc(w),hc(_))]}}),yc=Ai({batchToSpaceND_:function(e,t,r){const n=ki(e,"x","batchToSpaceND"),a=t.reduce(((e,t)=>e*t));ne(n.rank>=1+t.length,(()=>`input rank is ${n.rank} but should be > than blockShape.length ${t.length}`)),ne(r.length===t.length,(()=>`crops.length is ${r.length} but should be equal to blockShape.length  ${t.length}`)),ne(n.shape[0]%a==0,(()=>`input tensor batch is ${n.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${a}`));const i={x:n},o={blockShape:t,crops:r};return hi.runKernel(mt,i,o)}}),vc=Ai({batchNorm_:function(e,t,r,n,a,i){null==i&&(i=.001);const o=ki(e,"x","batchNorm"),s=ki(t,"mean","batchNorm"),l=ki(r,"variance","batchNorm");let c,u;null!=a&&(c=ki(a,"scale","batchNorm")),null!=n&&(u=ki(n,"offset","batchNorm")),ne(s.rank===l.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),ne(null==u||s.rank===u.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),ne(null==c||s.rank===c.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const f=function(e){let t;return t=0===e.rank||1===e.rank?cc(e,[1,1,1,e.size]):2===e.rank?cc(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?cc(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(o),p={x:f,scale:c,offset:u,mean:s,variance:l},h={varianceEpsilon:i},d=hi.runKernel(ar,p,h);return cc(d,o.shape)}}),bc=Ai({batchNorm2d_:function(e,t,r,n,a,i){const o=ki(e,"x","batchNorm"),s=ki(t,"mean","batchNorm"),l=ki(r,"variance","batchNorm");let c,u;return null!=a&&(c=ki(a,"scale","batchNorm")),null!=n&&(u=ki(n,"offset","batchNorm")),ne(2===o.rank,(()=>`Error in batchNorm2D: x must be rank 2 but got rank ${o.rank}.`)),ne(2===s.rank||1===s.rank,(()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${s.rank}.`)),ne(2===l.rank||1===l.rank,(()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`)),null!=c&&ne(2===c.rank||1===c.rank,(()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${c.rank}.`)),null!=u&&ne(2===u.rank||1===u.rank,(()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${u.rank}.`)),vc(o,s,l,u,c,i)}}),xc=Ai({batchNorm3d_:function(e,t,r,n,a,i){const o=ki(e,"x","batchNorm"),s=ki(t,"mean","batchNorm"),l=ki(r,"variance","batchNorm");let c,u;return null!=a&&(c=ki(a,"scale","batchNorm")),null!=n&&(u=ki(n,"offset","batchNorm")),ne(3===o.rank,(()=>`Error in batchNorm3D: x must be rank 3 but got rank ${o.rank}.`)),ne(3===s.rank||1===s.rank,(()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${s.rank}.`)),ne(3===l.rank||1===l.rank,(()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`)),null!=c&&ne(3===c.rank||1===c.rank,(()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${c.rank}.`)),null!=u&&ne(3===u.rank||1===u.rank,(()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${u.rank}.`)),vc(o,s,l,u,c,i)}}),_c=Ai({batchNorm4d_:function(e,t,r,n,a,i){const o=ki(e,"x","batchNorm"),s=ki(t,"mean","batchNorm"),l=ki(r,"variance","batchNorm");let c,u;return null!=a&&(c=ki(a,"scale","batchNorm")),null!=n&&(u=ki(n,"offset","batchNorm")),ne(4===o.rank,(()=>`Error in batchNorm4D: x must be rank 4 but got rank ${o.rank}.`)),ne(4===s.rank||1===s.rank,(()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${s.rank}.`)),ne(4===l.rank||1===l.rank,(()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`)),null!=c&&ne(4===c.rank||1===c.rank,(()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${c.rank}.`)),null!=u&&ne(4===u.rank||1===u.rank,(()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${u.rank}.`)),vc(o,s,l,u,c,i)}}),wc=Ai({bincount_:function(e,t,r){const n=ki(e,"x","bincount"),a=ki(t,"weights","bincount");ne("int32"===n.dtype,(()=>`Error in bincount: input dtype must be int32, but got ${n.dtype}`)),ne(r>=0,(()=>`size must be non-negative, but got ${r}.`)),ne(a.size===n.size||0===a.size,(()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${n.shape}, weights shape: ${a.shape}.`));const i={x:n,weights:a},o={size:r};return hi.runKernel(gt,i,o)}}),kc=Ai({broadcastArgs_:function(e,t){const r=ki(e,"s0","broadcastArgs","int32"),n=ki(t,"s1","broadcastArgs","int32");if(1!==r.rank)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${r.rank}`);if(1!==n.rank)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${n.rank}`);const a={s0:r,s1:n};return hi.runKernel(vt,a)}}),Dc=Ai({broadcastTo_:function(e,t){let r=ki(e,"broadcastTo","x");const n=r.shape;if(t.some((e=>!(e>0)||e%1!=0)))throw new Error(`broadcastTo(): Invalid broadcast shape [${t}].`);if(t.length<r.rank)throw new Error(`broadcastTo(): shape.length=${t.length} < input.rank=${r.rank}.`);if(t.length>r.rank){const e=r.shape.slice();for(;e.length<t.length;)e.unshift(1);r=cc(r,e)}const a=r.shape,i=Array.from(t);for(let e=t.length-1;e>=0;e--)if(a[e]===t[e])i[e]=1;else if(1!==r.shape[e])throw new Error(`broadcastTo(): [${n}] cannot be broadcast to [${t}].`);if(0===i.map(((e,t)=>e>1?t:-1)).filter((e=>e>=0)).length)return So(r);const o={x:r},s={reps:i};return hi.runKernel($n,o,s)}}),Tc=Ai({ceil_:function(e){const t={x:ki(e,"x","ceil","float32")};return hi.runKernel(xt,t)}}),Ac=Ai({clipByValue_:function(e,t,r){const n=ki(e,"x","clipByValue");ne(t<=r,(()=>`Error in clip: min (${t}) must be less than or equal to max (${r}).`));const a={x:n},i={clipValueMin:t,clipValueMax:r};return hi.runKernel(_t,a,i)}}),Sc=Ai({concat1d_:function(e){return pc(e,0)}}),Mc=Ai({concat2d_:function(e,t){return pc(e,t)}}),Ec=Ai({concat3d_:function(e,t){return pc(e,t)}}),Cc=Ai({concat4d_:function(e,t){return pc(e,t)}}),Nc=Ai({conv2d_:function(e,t,r,n,a="NHWC",i=[1,1],o){const s=ki(e,"x","conv2d","float32"),l=ki(t,"filter","conv2d","float32");let c=s,u=!1;3===s.rank&&(u=!0,c=cc(s,[1,s.shape[0],s.shape[1],s.shape[2]])),ne(4===c.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${c.rank}.`)),ne(4===l.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`)),lc("conv2d",n,o);const f="NHWC"===a?c.shape[3]:c.shape[1];ne(f===l.shape[2],(()=>`Error in conv2d: depth of input (${f}) must match input depth for filter ${l.shape[2]}.`)),ne(oc(r,i),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${r} and dilations '${i}'`));const p={x:c,filter:l},h={strides:r,pad:n,dataFormat:a,dilations:i,dimRoundingMode:o},d=hi.runKernel(Tt,p,h);return u?cc(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),Oc=Ai({conv1d_:function(e,t,r,n,a="NWC",i=1,o){const s=ki(e,"x","conv1d"),l=ki(t,"filter","conv1d");let c=s,u=!1;2===s.rank&&(u=!0,c=cc(s,[1,s.shape[0],s.shape[1]])),ne(3===c.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${c.rank}.`)),ne(3===l.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`)),lc("conv1d",n,o),ne(c.shape[2]===l.shape[1],(()=>`Error in conv1d: depth of input (${c.shape[2]}) must match input depth for filter ${l.shape[1]}.`)),ne(oc(r,i),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${r} and dilation '${i}'`)),ne("NWC"===a,(()=>`Error in conv1d: got dataFormat of ${a} but only NWC is currently supported.`));const f=cc(l,[1,l.shape[0],l.shape[1],l.shape[2]]),p=cc(c,[c.shape[0],1,c.shape[1],c.shape[2]]),h=Nc(p,f,[1,r],n,"NHWC",[1,i],o);return cc(h,u?[h.shape[2],h.shape[3]]:[h.shape[0],h.shape[2],h.shape[3]])}}),Ic=Ai({conv2DBackpropInput_:function(e,t,r,n,a,i="NHWC",o){ne(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let s=e,l=t,c=!1;3===t.rank&&(c=!0,l=cc(t,[1,t.shape[0],t.shape[1],t.shape[2]]),s=[1,e[0],e[1],e[2]]),ne(4===s.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${s.length}.`)),ne(4===l.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`)),ne(4===r.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${r.rank}`));const u="NHWC"===i?s[3]:s[1],f="NHWC"===i?l.shape[3]:l.shape[1];ne(u===r.shape[2],(()=>`Error in conv2dDerInput: depth of input (${u}) must match input depth for filter ${r.shape[2]}.`)),ne(f===r.shape[3],(()=>`Error in conv2dDerInput: depth of output (${f}) must match output depth for filter ${r.shape[3]}.`)),lc("conv2dDerInput",a,o);const p={dy:l,filter:r},h={strides:n,pad:a,dataFormat:i,dimRoundingMode:o,inputShape:s},d=hi.runKernel(St,p,h);return c?cc(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),Pc=Ai({conv2dTranspose_:function(e,t,r,n,a,i){const o=ki(e,"x","conv2dTranspose"),s=ki(t,"filter","conv2dTranspose");return Ic(r,o,s,n,a,"NHWC",i)}}),Rc=Ai({conv3d_:function(e,t,r,n,a="NDHWC",i=[1,1,1]){const o=ki(e,"x","conv3d"),s=ki(t,"filter","conv3d");let l=o,c=!1;4===o.rank&&(c=!0,l=cc(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),ne(5===l.rank,(()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`)),ne(5===s.rank,(()=>`Error in conv3d: filter must be rank 5, but got rank ${s.rank}.`)),ne(l.shape[4]===s.shape[3],(()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${s.shape[3]}.`)),ne(oc(r,i),(()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${r} and dilations '${i}'`)),ne("NDHWC"===a,(()=>`Error in conv3d: got dataFormat of ${a} but only NDHWC is currently supported.`));const u={x:l,filter:s},f={strides:r,pad:n,dataFormat:a,dilations:i},p=hi.runKernel(Mt,u,f);return c?cc(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}}),Lc=Ai({conv3DBackpropInput_:function(e,t,r,n,a){ne(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let i=e,o=t,s=!1;4===t.rank&&(s=!0,o=cc(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),i=[1,e[0],e[1],e[2],e[3]]);const l=i[4],c=o.shape[4];ne(5===i.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${i.length}.`)),ne(5===o.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${o.rank}`)),ne(5===r.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${r.rank}`)),ne(l===r.shape[3],(()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${r.shape[3]}.`)),ne(c===r.shape[4],(()=>`Error in conv3dDerInput: depth of output (${c}) must match output depth for filter ${r.shape[4]}.`));const u={dy:o,filter:r},f={pad:a,strides:n,inputShape:i},p=hi.runKernel(Ct,u,f);return s?cc(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}}),Fc=Ai({conv3dTranspose_:function(e,t,r,n,a){const i=ki(e,"x","conv3dTranspose"),o=ki(t,"filter","conv3dTranspose");return Lc(r,i,o,n,a)}}),Bc=Ai({cos_:function(e){const t={x:ki(e,"x","cos","float32")};return hi.runKernel(Nt,t)}}),zc=Ai({cosh_:function(e){const t={x:ki(e,"x","cosh","float32")};return hi.runKernel(Ot,t)}}),jc=Ai({cumsum_:function(e,t=0,r=!1,n=!1){const a={x:ki(e,"x","cumsum")},i={axis:t,exclusive:r,reverse:n};return hi.runKernel(It,a,i)}}),Uc=Ai({denseBincount_:function(e,t,r,n=!1){const a=ki(e,"x","denseBincount"),i=ki(t,"weights","denseBincount");ne("int32"===a.dtype,(()=>`Error in denseBincount: input dtype must be int32, but got ${a.dtype}`)),ne(a.rank<=2,(()=>`Error in denseBincount: input must be at most rank 2, but got rank ${a.rank}.`)),ne(r>=0,(()=>`size must be non-negative, but got ${r}.`)),ne(i.size===a.size||0===i.size,(()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${a.shape}, weights shape: ${i.shape}.`));const o={x:a,weights:i},s={size:r,binaryOutput:n};return hi.runKernel(Rt,o,s)}}),$c=Ai({depthToSpace_:function(e,t,r="NHWC"){const n=ki(e,"x","depthToSpace","float32"),a="NHWC"===r?n.shape[1]:n.shape[2],i="NHWC"===r?n.shape[2]:n.shape[3],o="NHWC"===r?n.shape[3]:n.shape[1];ne(t>1,(()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`)),ne(a*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n    ${a} and ${t}  for depthToSpace with input shape\n    ${n.shape}`)),ne(i*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n    ${i} and ${t} for depthToSpace with input shape\n        ${n.shape}`)),ne(o%(t*t)==0,(()=>`Dimension size must be evenly divisible by ${t*t} but is ${o} for depthToSpace with input shape ${n.shape}`));const s={x:n},l={blockSize:t,dataFormat:r};return hi.runKernel(Lt,s,l)}}),Vc=Ai({depthwiseConv2d_:function(e,t,r,n,a="NHWC",i=[1,1],o){const s=ki(e,"x","depthwiseConv2d","float32"),l=ki(t,"filter","depthwiseConv2d","float32");let c=s,u=!1;3===s.rank&&(u=!0,c=cc(s,[1,s.shape[0],s.shape[1],s.shape[2]])),ne(4===c.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${c.rank}.`)),ne(4===l.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`)),ne(c.shape[3]===l.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${c.shape[3]}) must match the inChannels dimension in filter ${l.shape[2]}.`)),lc("depthwiseConv2d",n,o);const f={x:c,filter:l},p={strides:r,pad:n,dataFormat:a,dilations:i,dimRoundingMode:o},h=hi.runKernel(Ft,f,p);return u?cc(h,[h.shape[1],h.shape[2],h.shape[3]]):h}}),qc=Ai({diag_:function(e){const t={x:ki(e,"x","diag")};return hi.runKernel(jt,t)}}),Wc=Ai({dilation2d_:function(e,t,r,n,a=[1,1],i="NHWC"){const o=ki(e,"x","dilation2d"),s=ki(t,"filter","dilation2d");ne(3===o.rank||4===o.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${o.rank}.`)),ne(3===s.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${s.rank}.`)),ne("NHWC"===i,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${i}`));let l=o,c=!1;3===o.rank&&(l=cc(o,[1,o.shape[0],o.shape[1],o.shape[2]]),c=!0);const u={x:l,filter:s},f={strides:r,pad:n,dilations:a},p=hi.runKernel(Ut,u,f);return c?cc(p,[p.shape[1],p.shape[2],p.shape[3]]):p}}),Hc=Ai({equal_:function(e,t){let r=ki(e,"a","equal","string_or_numeric"),n=ki(t,"b","equal","string_or_numeric");[r,n]=ai(r,n),Jo(r.shape,n.shape);const a={a:r,b:n};return hi.runKernel(Yt,a)}}),Gc=Ai({where_:function(e,t,r){const n=ki(t,"a","where"),a=ki(r,"b","where"),i=ki(e,"condition","where","bool"),o=Jo(Jo(i.shape,n.shape),a.shape),s={condition:Dc(i,o),t:Dc(n,o),e:Dc(a,o)};return hi.runKernel(mn,s)}}),Xc=Ai({divNoNan_:function(e,t){let r=ki(e,"a","div"),n=ki(t,"b","div");[r,n]=ai(r,n);const a=ul(r,n),i=dl(a),o=Hc(n,i);return Gc(o,i,a)}}),Yc=Ai({dot_:function(e,t){const r=ki(e,"t1","dot"),n=ki(t,"t2","dot");ne(!(1!==r.rank&&2!==r.rank||1!==n.rank&&2!==n.rank),(()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${r.rank} and ${n.rank}.`));const a=1===r.rank?r.size:r.shape[1],i=1===n.rank?n.size:n.shape[0];if(ne(a===i,(()=>`Error in dot: inner dimensions of inputs must match, but got ${a} and ${i}.`)),1===r.rank&&1===n.rank){const e=cc(r,[1,-1]),t=cc(n,[-1,1]),a=Ho(e,t);return cc(a,[])}if(1===r.rank&&2===n.rank){const e=cc(r,[1,-1]),t=cc(n,[n.shape[0],n.shape[1]]),a=Ho(e,t);return cc(a,[a.size])}if(2===r.rank&&1===n.rank){const e=cc(n,[-1,1]),t=Ho(r,e);return cc(t,[t.size])}{const e=cc(n,[n.shape[0],n.shape[1]]);return Ho(r,e)}}}),Zc=Ai({einsum_:function(e,...t){const r=t.map(((e,t)=>ki(e,`tensors${t}`,"einsum"))),n={equation:e};return hi.runKernel(Wt,r,n)}}),Kc=Ai({elu_:function(e){const t={x:ki(e,"x","elu","float32")};return hi.runKernel(Ht,t)}}),Jc=Ai({erf_:function(e){let t=ki(e,"x","erf");ne("int32"===t.dtype||"float32"===t.dtype,(()=>"Input dtype must be `int32` or `float32`.")),"int32"===t.dtype&&(t=Ao(t,"float32"));const r={x:t};return hi.runKernel(Xt,r)}}),Qc=Ai({exp_:function(e){const t={x:ki(e,"x","exp")};return hi.runKernel(Zt,t)}}),eu=Ai({expandDims_:function(e,t=0){const r=ki(e,"x","expandDims","string_or_numeric");ne(t<=r.rank,(()=>"Axis must be <= rank of the tensor"));const n={input:r},a={dim:t};return hi.runKernel(Kt,n,a)}}),tu=Ai({expm1_:function(e){const t={x:ki(e,"x","expm1")};return hi.runKernel(Jt,t)}}),ru=Ai({tile_:function(e,t){const r=ki(e,"x","tile","string_or_numeric");ne(r.rank===t.length,(()=>`Error in transpose: rank of input ${r.rank} must match length of reps ${t}.`));const n={x:r},a={reps:t};return hi.runKernel($n,n,a)}}),nu=Ai({eye_:function(e,t,r,n="float32"){null==t&&(t=e);const a=To([e,t],n),i=e<=t?e:t;for(let e=0;e<i;++e)a.set(1,e,e);const o=cc(a.toTensor(),[e,t]);if(null==r)return o;if(1===r.length)return ru(eu(o,0),[r[0],1,1]);if(2===r.length)return ru(eu(eu(o,0),0),[r[0],r[1],1,1]);if(3===r.length)return ru(eu(eu(eu(o,0),0),0),[r[0],r[1],r[2],1,1]);throw new Error(`eye() currently supports only 1D and 2D batchShapes, but received ${r.length}D.`)}}),au=Ai({floor_:function(e){const t={x:ki(e,"x","floor","float32")};return hi.runKernel(rr,t)}}),iu=Ai({gather_:function(e,t,r=0,n=0){const a={x:ki(e,"x","gather"),indices:ki(t,"indices","gather","int32")},i={axis:r,batchDims:n};return hi.runKernel(ir,a,i)}}),ou=Ai({greater_:function(e,t){let r=ki(e,"a","greater","string_or_numeric"),n=ki(t,"b","greater","string_or_numeric");[r,n]=ai(r,n),Jo(r.shape,n.shape);const a={a:r,b:n};return hi.runKernel(sr,a)}}),su=Ai({greaterEqual_:function(e,t){let r=ki(e,"a","greaterEqual","string_or_numeric"),n=ki(t,"b","greaterEqual","string_or_numeric");[r,n]=ai(r,n),Jo(r.shape,n.shape);const a={a:r,b:n};return hi.runKernel(lr,a)}}),lu=Ai({imag_:function(e){const t={input:ki(e,"input","imag")};return hi.runKernel(fr,t)}}),cu=Ai({isFinite_:function(e){const t={x:ki(e,"x","isFinite")};return hi.runKernel(pr,t)}}),uu=Ai({isInf_:function(e){const t={x:ki(e,"x","isInf")};return hi.runKernel(hr,t)}}),fu=Ai({isNaN_:function(e){const t={x:ki(e,"x","isNaN")};return hi.runKernel(dr,t)}}),pu=Ai({leakyRelu_:function(e,t=.2){const r={x:ki(e,"x","leakyRelu")},n={alpha:t};return hi.runKernel(mr,r,n)}}),hu=Ai({less_:function(e,t){let r=ki(e,"a","less","string_or_numeric"),n=ki(t,"b","less","string_or_numeric");[r,n]=ai(r,n),Jo(r.shape,n.shape);const a={a:r,b:n};return hi.runKernel(gr,a)}}),du=Ai({lessEqual_:function(e,t){let r=ki(e,"a","lessEqual","string_or_numeric"),n=ki(t,"b","lessEqual","string_or_numeric");[r,n]=ai(r,n),Jo(r.shape,n.shape);const a={a:r,b:n};return hi.runKernel(yr,a)}});function mu(e,t,r){if(r<=0)throw new Error("The number of values should be positive.");const n={start:e,stop:t,num:r};return hi.runKernel(vr,{},n)}const gu=Ai({localResponseNormalization_:function(e,t=5,r=1,n=1,a=.5){const i=ki(e,"x","localResponseNormalization");ne(4===i.rank||3===i.rank,(()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n               rank ${i.rank}.`)),ne(ue(t),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`));let o=i,s=!1;3===i.rank&&(s=!0,o=cc(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const l={x:o},c={depthRadius:t,bias:r,alpha:n,beta:a},u=hi.runKernel(Tr,l,c);return s?cc(u,[u.shape[1],u.shape[2],u.shape[3]]):u}}),yu=Ai({log_:function(e){const t={x:ki(e,"x","log","float32")};return hi.runKernel(br,t)}}),vu=Ai({log1p_:function(e){const t={x:ki(e,"x","log1p")};return hi.runKernel(xr,t)}}),bu=Ai({neg_:function(e){const t={x:ki(e,"x","neg")};return hi.runKernel(Ur,t)}}),xu=Ai({softplus_:function(e){const t={x:ki(e,"x","softplus")};return hi.runKernel(wn,t)}}),_u=Ai({logSigmoid_:function(e){const t=ki(e,"x","logSigmoid"),r=xl((e=>({value:bu(xu(bu(e))),gradFunc:t=>fl(t,hc(bu(e)))})));return r(t)}}),wu=Ai({max_:function(e,t=null,r=!1){const n={x:ki(e,"x","max")},a={reductionIndices:t,keepDims:r};return hi.runKernel(Sr,n,a)}}),ku=Ai({sum_:function(e,t=null,r=!1){let n=ki(e,"x","sum");"bool"===n.dtype&&(n=Ao(n,"int32"));const a={x:n},i={axis:t,keepDims:r};return hi.runKernel(Dn,a,i)}}),Du=Ai({logSoftmax_:function(e,t=-1){const r=ki(e,"logits","logSoftmax");if(-1===t&&(t=r.rank-1),t!==r.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${r.rank} and axis was ${t}`);const n=xl(((e,r)=>{const n=wu(e,t,!0),a=Ml(e,n),i=Ml(Ao(a,"float32"),yu(ku(Qc(a),t,!0)));return r([i]),{value:i,gradFunc:(e,r)=>{const[n]=r,a=Qc(n);return Ml(e,fl(ku(e,t,!0),a))}}}));return n(r)}});function Tu(e,t){for(let r=0;r<e.length;++r)if(e[e.length-r-1]!==t-1-r)return!1;return!0}function Au(e,t,r){const n=e.length+t.length,a=[];let i=0,o=0;for(let s=0;s<n;s++)-1===r.indexOf(s)?a.push(e[i++]):a.push(t[o++]);return a}function Su(e,t){const r=[],n=e.length;for(let a=0;a<n;a++)-1===t.indexOf(a)&&r.push(e[a]);return[r,t.map((t=>e[t]))]}function Mu(e,t){return Au(e,t.map((e=>1)),t)}function Eu(e,t,r){ne(Tu(t,r),(()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${r} input.`))}function Cu(e,t){if(Tu(e,t))return null;const r=[];for(let n=0;n<t;++n)-1===e.indexOf(n)&&r.push(n);return e.forEach((e=>r.push(e))),r}function Nu(e){return e.map(((e,t)=>[t,e])).sort(((e,t)=>e[1]-t[1])).map((e=>e[0]))}function Ou(e,t){const r=[];for(let n=t-e;n<t;++n)r.push(n);return r}const Iu=Ai({logSumExp_:function(e,t=null,r=!1){const n=ki(e,"x","logSumExp"),a=ye(t,n.shape),i=wu(n,a,!0),o=Ml(n,i),s=Qc(o),l=ku(s,a),c=yu(l),u=ll(cc(i,c.shape),c);if(r){const e=Mu(u.shape,a);return cc(u,e)}return u}}),Pu=Ai({logicalAnd_:function(e,t){const r=ki(e,"a","logicalAnd","bool"),n=ki(t,"b","logicalAnd","bool");Jo(r.shape,n.shape);const a={a:r,b:n};return hi.runKernel(_r,a)}}),Ru=Ai({logicalNot_:function(e){const t={x:ki(e,"x","logicalNot","bool")};return hi.runKernel(wr,t)}}),Lu=Ai({logicalOr_:function(e,t){const r=ki(e,"a","logicalOr","bool"),n=ki(t,"b","logicalOr","bool");Jo(r.shape,n.shape);const a={a:r,b:n};return hi.runKernel(kr,a)}}),Fu=Ai({logicalXor_:function(e,t){const r=ki(e,"a","logicalXor","bool"),n=ki(t,"b","logicalXor","bool");return Jo(r.shape,n.shape),Pu(Lu(e,t),Ru(Pu(e,t)))}}),Bu=Ai({maxPool_:function(e,t,r,n,a){const i=ki(e,"x","maxPool");let o=i,s=!1;3===i.rank&&(s=!0,o=cc(i,[1,i.shape[0],i.shape[1],i.shape[2]])),ne(4===o.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`)),ne(oc(r,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${r} and dilations '1'`)),lc("maxPool",n,a);const l={x:o},c={filterSize:t,strides:r,pad:n,dimRoundingMode:a},u=hi.runKernel(Er,l,c);return s?cc(u,[u.shape[1],u.shape[2],u.shape[3]]):u}}),zu=Ai({maxPool3d_:function(e,t=[1,1,1],r,n,a,i="NDHWC"){const o=ki(e,"x","maxPool3d");let s=o,l=!1;4===o.rank&&(l=!0,s=cc(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),ne(5===s.rank,(()=>`Error in maxPool3d: x must be rank 5 but got rank ${s.rank}.`)),ne("NDHWC"===i,(()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`)),lc("maxPool3d",n,a);const c={x:s},u={filterSize:t,strides:r,pad:n,dimRoundingMode:a,dataFormat:i},f=hi.runKernel(Nr,c,u);return l?cc(f,[f.shape[1],f.shape[2],f.shape[3],f.shape[4]]):f}}),ju=Ai({maxPoolWithArgmax_:function(e,t,r,n,a=!1){const i={x:ki(e,"x","maxPoolWithArgmax")},o={filterSize:t,strides:r,pad:n,includeBatchInIndex:a},s=hi.runKernel(Ir,i,o);return{result:s[0],indexes:s[1]}}}),Uu=Ai({mean_:function(e,t=null,r=!1){const n={x:ki(e,"x","mean")},a={axis:t,keepDims:r};return hi.runKernel(Pr,n,a)}});function $u(e,t="float32"){if("complex64"===t){const t=$u(e,"float32"),r=$u(e,"float32");return Si(t,r)}const r=Fe(se(e),t);return hi.makeTensor(r,e,t)}function Vu(e,t="float32"){if("complex64"===t){const t=Vu(e,"float32"),r=$u(e,"float32");return Si(t,r)}const r=Le(se(e),t);return hi.makeTensor(r,e,t)}function qu(e,t,{indexing:r="xy"}={}){if("xy"!==r&&"ij"!==r)throw new TypeError(`${r} is not a valid third argument to meshgrid`);if(void 0===e)return[];let n=ki(e,"x","meshgrid",e instanceof Ga?e.dtype:"float32");if(void 0===t)return[n];let a=ki(t,"y","meshgrid",t instanceof Ga?t.dtype:"float32");const i=se(n.shape),o=se(a.shape);return"xy"===r?(n=cc(n,[1,-1]),a=cc(a,[-1,1]),[Ho(Vu([o,1],n.dtype),n),Ho(a,Vu([1,i],a.dtype))]):(n=cc(n,[-1,1]),a=cc(a,[1,-1]),[Ho(n,Vu([1,o],n.dtype)),Ho(Vu([i,1],a.dtype),a)])}const Wu=Ai({min_:function(e,t=null,r=!1){const n={x:ki(e,"x","min")},a={axis:t,keepDims:r};return hi.runKernel(Rr,n,a)}}),Hu=Ai({minimum_:function(e,t){let r=ki(e,"a","minimum"),n=ki(t,"b","minimum");[r,n]=ai(r,n),"bool"===r.dtype&&(r=Ao(r,"int32"),n=Ao(n,"int32")),Jo(r.shape,n.shape);const a={a:r,b:n};return hi.runKernel(Lr,a)}}),Gu=Ai({mirrorPad_:function(e,t,r){ne("reflect"===r||"symmetric"===r,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${r}.`));const n=ki(e,"x","mirrorPad");if(0===n.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");ne(t.length===n.rank,(()=>`Padding doesn't match input. Must be ${n.rank}. Got ${t.length}.`));const a="reflect"===r?1:0;for(let e=0;e<n.rank;e++)ne(2===t[e].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),ne(t[e][0]>=0&&t[e][0]<=n.shape[e]-a&&t[e][1]>=0&&t[e][1]<=n.shape[e]-a,(()=>`Padding in dimension ${e} cannot be greater than or equal to ${n.shape[e]-a} or less than 0 for input of shape ${n.shape}`));const i={paddings:t,mode:r},o={x:n};return hi.runKernel(Fr,o,i)}}),Xu=Ai({mod_:function(e,t){let r=ki(e,"a","mod"),n=ki(t,"b","mod");[r,n]=ai(r,n);const a={a:r,b:n};return hi.runKernel(Br,a)}}),Yu=Ai({moments_:function(e,t=null,r=!1){const n=ye(t,(e=ki(e,"x","moments")).shape),a=Uu(e,n,r);let i=a.shape;r||(i=Mu(a.shape,n));const o=hl(Ml(Ao(e,"float32"),cc(a,i)));return{mean:a,variance:Uu(o,n,r)}}}),Zu=Ai({multiRNNCell_:function(e,t,r,n){const a=ki(t,"data","multiRNNCell"),i=Di(r,"c","multiRNNCell"),o=Di(n,"h","multiRNNCell");let s=a;const l=[];for(let t=0;t<e.length;t++){const r=e[t](s,i[t],o[t]);l.push(r[0]),l.push(r[1]),s=r[1]}const c=[],u=[];for(let e=0;e<l.length;e+=2)c.push(l[e]),u.push(l[e+1]);return[c,u]}}),Ku=Ai({multinomial_:function(e,t,r,n=!1){const a=ki(e,"logits","multinomial"),i=a.size,o=a.rank;if(i<2)throw new Error(`Error in multinomial: you need at least 2 outcomes, but got ${i}.`);if(o>2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${o}`);r=r||Math.random();const s={logits:1===o?cc(a,[1,-1]):a},l={numSamples:t,seed:r,normalized:n},c=hi.runKernel(zr,s,l);return 1===o?cc(c,[c.size]):c}}),Ju=Ai({notEqual_:function(e,t){let r=ki(e,"a","notEqual","string_or_numeric"),n=ki(t,"b","notEqual","string_or_numeric");[r,n]=ai(r,n),Jo(r.shape,n.shape);const a={a:r,b:n};return hi.runKernel($r,a)}}),Qu=Ai({onesLike_:function(e){const t={x:ki(e,"x","onesLike")};return hi.runKernel(Hr,t)}}),ef=Ai({outerProduct_:function(e,t){const r=ki(e,"v1","outerProduct"),n=ki(t,"v2","outerProduct");ne(1===r.rank&&1===n.rank,(()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${r.rank} and ${n.rank}.`));const a=cc(r,[-1,1]),i=cc(n,[1,-1]);return Ho(a,i)}}),tf=Ai({pad_:function(e,t,r=0){const n=ki(e,"x","pad");if(0===n.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const a={paddings:t,constantValue:r},i={x:n};return hi.runKernel(Yr,i,a)}}),rf=Ai({pad1d_:function(e,t,r=0){return ne(2===t.length,(()=>"Invalid number of paddings. Must be length of 2.")),tf(e,[t],r)}}),nf=Ai({pad2d_:function(e,t,r=0){return ne(2===t.length&&2===t[0].length&&2===t[1].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),tf(e,t,r)}}),af=Ai({pad3d_:function(e,t,r=0){return ne(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),tf(e,t,r)}}),of=Ai({pad4d_:function(e,t,r=0){return ne(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),tf(e,t,r)}}),sf=Ai({spaceToBatchND_:function(e,t,r){const n=ki(e,"x","spaceToBatchND");ne(n.rank>=1+t.length,(()=>`input rank ${n.rank} should be > than [blockShape] ${t.length}`)),ne(r.length===t.length,(()=>`paddings.shape[0] ${r.length} must be equal to [blockShape] ${t.length}`)),ne(n.shape.reduce(((e,n,a)=>a>0&&a<=t.length?e&&(n+r[a-1][0]+r[a-1][1])%t[a-1]==0:e),!0),(()=>`input spatial dimensions ${n.shape.slice(1)} with paddings ${r.toString()} must be divisible by blockShapes ${t.toString()}`));const a={x:n},i={blockShape:t,paddings:r};return hi.runKernel(Tn,a,i)}}),lf=Ai({pool_:function(e,t,r,n,a,i,o){null==a&&(a=[1,1]),null==i&&(i=1),0===n&&(n="valid");const s=ki(e,"x","maxPool");let l=s,c=!1;3===s.rank&&(c=!0,l=cc(s,[1,s.shape[0],s.shape[1],s.shape[2]])),ne(oc(i,a),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${i} and dilations '${a}'`));const u=Zl(l.shape,t,i,a,n),f=[u.dilationHeight,u.dilationWidth];let p;p="same"===n?function(e,t){const r=e.map(((e,r)=>e+(e-1)*(t[r]-1))).map((e=>e-1)),n=r.map((e=>Math.floor(e/2))),a=r.map(((e,t)=>e-n[t]));return r.map(((e,t)=>[n[t],a[t]]))}([u.filterHeight,u.filterWidth],f):[[0,0],[0,0]];const h=1===f[0]&&1===f[1],[d,m]=function(e,t,r){const n=r.map((e=>e[0])),a=r.map((e=>e[1])),i=e.concat(n,a),o=t.map(((e,t)=>(e-i[t]%e)%e)),s=a.map(((e,t)=>e+o[t]));return[t.map(((e,t)=>[n[t],s[t]])),t.map(((e,t)=>[0,o[t]]))]}([u.inHeight,u.inWidth],f,p),g=h?n:"valid",y=h?l:sf(l,f,d),v=("avg"===r?()=>uc(y,t,i,g,o):()=>Bu(y,t,i,g,o))(),b=h?v:yc(v,f,m);return c?cc(b,[b.shape[1],b.shape[2],b.shape[3]]):b}}),cf=Ai({prelu_:function(e,t){const r={x:ki(e,"x","prelu"),alpha:ki(t,"alpha","prelu")};return hi.runKernel(Jr,r)}}),uf=Ai({prod_:function(e,t=null,r=!1){let n=ki(e,"x","prod");"bool"===n.dtype&&(n=Ao(n,"int32"));const a={x:n},i={axis:t,keepDims:r};return hi.runKernel(Qr,a,i)}}),ff=Ai({rand_:function(e,t,r){const n=se(e);let a=null;if(null==r||"float32"===r)a=new Float32Array(n);else if("int32"===r)a=new Int32Array(n);else{if("bool"!==r)throw new Error(`Unknown data type ${r}`);a=new Uint8Array(n)}for(let e=0;e<n;e++)a[e]=t();return hi.makeTensor(a,e,r)}});var pf=r(19291);class hf{constructor(e,t,r,n,a){this.mean=e,this.stdDev=t,this.dtype=r,this.nextVal=NaN,this.truncated=n,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);const i=a||Math.random();this.random=pf.alea(i.toString())}nextValue(){if(!isNaN(this.nextVal)){const e=this.nextVal;return this.nextVal=NaN,e}let e,t,r=!1;for(;!r;){let n,a,i;do{n=2*this.random()-1,a=2*this.random()-1,i=n*n+a*a}while(i>=1||0===i);const o=Math.sqrt(-2*Math.log(i)/i);e=this.mean+this.stdDev*n*o,t=this.mean+this.stdDev*a*o,this.truncated&&!this.isValidTruncated(e)||(r=!0)}return this.truncated&&!this.isValidTruncated(t)||(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class df{constructor(e,t,r,n){this.alpha=e,this.beta=1/t,this.dtype=r;const a=n||Math.random();this.randu=pf.alea(a.toString()),this.randn=new hf(0,1,r,!1,this.randu()),this.d=e<1?e+2/3:e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,r,n,a,i;for(;;){do{n=this.randn.nextValue(),i=1+this.c*n}while(i<=0);if(i*=i*i,e=n*n,t=1-.331*e*e,r=.5*e+this.d*(1-i+Math.log(i)),a=this.randu(),a<t||Math.log(a)<r)break}return i=1/this.beta*this.d*i,this.alpha<1&&(i*=Math.pow(this.randu(),1/this.alpha)),this.convertValue(i)}convertValue(e){return"float32"===this.dtype?e:Math.round(e)}}class mf{constructor(e=0,t=1,r,n){if(this.canReturnFloat=()=>null==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=r,null==n&&(n=Math.random()),"number"==typeof n&&(n=n.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=pf.alea(n)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const gf=Ai({randomGamma_:function(e,t,r=1,n="float32",a){if(null==r&&(r=1),null==n&&(n="float32"),"float32"!==n&&"int32"!==n)throw new Error(`Unsupported data type ${n}`);const i=new df(t,r,n,a),o=To(e,n);for(let e=0;e<o.values.length;e++)o.values[e]=i.nextValue();return o.toTensor()}}),yf=Ai({randomNormal_:function(e,t=0,r=1,n,a){if(null!=n&&"bool"===n)throw new Error(`Unsupported data type ${n}`);const i=new hf(t,r,n,!1,a),o=To(e,n);for(let e=0;e<o.values.length;e++)o.values[e]=i.nextValue();return o.toTensor()}}),vf=Ai({randomUniform_:function(e,t=0,r=1,n="float32",a){const i=To(e,n),o=new mf(t,r,null,a);for(let e=0;e<i.values.length;e++)i.values[e]=o.nextValue();return i.toTensor()}});function bf(e,t,r=1,n="float32"){if(0===r)throw new Error("Cannot have a step of zero");const a={start:e,stop:t,step:r,dtype:n};return hi.runKernel(en,{},a)}const xf=Ai({real_:function(e){const t={input:ki(e,"input","real")};return hi.runKernel(tn,t)}}),_f=Ai({reciprocal_:function(e){const t={x:ki(e,"x","reciprocal")};return hi.runKernel(rn,t)}}),wf=Ai({relu_:function(e){const t={x:ki(e,"x","relu")};return hi.runKernel(nn,t)}}),kf=Ai({relu6_:function(e){const t={x:ki(e,"x","relu6")};return hi.runKernel(un,t)}}),Df=Ai({reverse_:function(e,t){const r={x:ki(e,"x","reverse")},n={dims:t};return hi.runKernel(fn,r,n)}}),Tf=Ai({reverse1d_:function(e){const t=ki(e,"x","reverse");return ne(1===t.rank,(()=>`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`)),Df(t,0)}}),Af=Ai({reverse2d_:function(e,t){const r=ki(e,"x","reverse");return ne(2===r.rank,(()=>`Error in reverse2D: x must be rank 2 but got rank ${r.rank}.`)),Df(r,t)}}),Sf=Ai({reverse3d_:function(e,t){const r=ki(e,"x","reverse");return ne(3===r.rank,(()=>`Error in reverse3D: x must be rank 3 but got rank ${r.rank}.`)),Df(r,t)}}),Mf=Ai({reverse4d_:function(e,t){const r=ki(e,"x","reverse");return ne(4===r.rank,(()=>`Error in reverse4D: x must be rank 4 but got rank ${r.rank}.`)),Df(r,t)}}),Ef=Ai({round_:function(e){const t={x:ki(e,"x","round")};return hi.runKernel(pn,t)}}),Cf=Ai({rsqrt_:function(e){const t={x:ki(e,"x","rsqrt","float32")};return hi.runKernel(hn,t)}}),Nf=Ai({selu_:function(e){const t={x:ki(e,"x","selu")};return hi.runKernel(gn,t)}}),Of=Ai({separableConv2d_:function(e,t,r,n,a,i=[1,1],o="NHWC"){const s=ki(e,"x","separableConv2d"),l=ki(t,"depthwiseFilter","separableConv2d"),c=ki(r,"pointwiseFilter","separableConv2d");let u=s,f=!1;if(3===s.rank&&(f=!0,u=cc(s,[1,s.shape[0],s.shape[1],s.shape[2]])),"NCHW"===o)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");ne(4===u.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${u.rank}.`)),ne(4===l.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`)),ne(4===c.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`)),ne(1===c.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter  must be 1, but got ${c.shape[0]}.`)),ne(1===c.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${c.shape[1]}.`));const p=l.shape[2],h=l.shape[3];ne(c.shape[2]===p*h,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${p*h}, but got ${c.shape[2]}.`));const d=Vc(u,l,n,a,o,i),m=Nc(d,c,1,"valid",o);return f?cc(m,[m.shape[1],m.shape[2],m.shape[3]]):m}}),If=async function(e,t){const r=ki(e,"x","setdiff1d"),n=ki(t,"y","setdiff1d");ne(r.dtype===n.dtype,(()=>`x and y should have the same dtype, but got x (${r.dtype}) and y (${n.dtype}).`)),ne(1===r.rank,(()=>`x should be 1D tensor, but got x (${r.shape}).`)),ne(1===n.rank,(()=>`y should be 1D tensor, but got y (${n.shape}).`));const a=await r.data(),i=await n.data(),o=new Set(i);let s=0;for(let e=0;e<a.length;e++)o.has(a[e])||s++;const l=new Va([s],r.dtype),c=new Va([s],"int32");for(let e=0,t=0;e<a.length;e++)o.has(a[e])||(l.values[t]=a[e],c.values[t]=e,t++);return[l.toTensor(),c.toTensor()]},Pf=Ai({sign_:function(e){const t={x:ki(e,"x","sign")};return hi.runKernel(xn,t)}}),Rf=Ai({sin_:function(e){const t={x:ki(e,"x","sin","float32")};return hi.runKernel(vn,t)}}),Lf=Ai({sinh_:function(e){const t={x:ki(e,"x","sinh")};return hi.runKernel(bn,t)}}),Ff=Ai({slice1d_:function(e,t,r){const n=ki(e,"x","slice1d");return ne(1===n.rank,(()=>`slice1d expects a rank-1 tensor, but got a rank-${n.rank} tensor`)),dc(n,[t],[r])}}),Bf=Ai({slice2d_:function(e,t,r){const n=ki(e,"x","slice2d");return ne(2===n.rank,(()=>`slice2d expects a rank-2 tensor, but got a rank-${n.rank} tensor`)),dc(n,t,r)}}),zf=Ai({slice3d_:function(e,t,r){const n=ki(e,"x","slice3d");return ne(3===n.rank,(()=>`slice3d expects a rank-3 tensor, but got a rank-${n.rank} tensor`)),dc(n,t,r)}}),jf=Ai({slice4d_:function(e,t,r){const n=ki(e,"x","slice4d");return ne(4===n.rank,(()=>`slice4d expects a rank-4 tensor, but got a rank-${n.rank} tensor`)),dc(n,t,r)}}),Uf=Ai({softmax_:function(e,t=-1){const r=ki(e,"logits","softmax","float32");if(-1===t&&(t=r.rank-1),t!==r.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${r.rank} and dim was ${t}`);const n={logits:r},a={dim:t};return hi.runKernel(Sn,n,a)}}),$f=Ai({fft_:function(e){ne("complex64"===e.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`));const t={input:e};return hi.runKernel(Qt,t)}}),Vf=Ai({ifft_:function(e){ne("complex64"===e.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`));const t={input:e};return hi.runKernel(ur,t)}}),qf=Ai({irfft_:function(e){const t=e.shape[e.shape.length-1],r=e.size/t;let n;if(t<=2){const a=cc(e,[r,t]);n=Vf(a)}else{const a=[r,2*(t-1)],i=cc(xf(e),[r,t]),o=cc(lu(e),[r,t]),s=Df(dc(i,[0,1],[r,t-2]),1),l=fl(Df(dc(o,[0,1],[r,t-2]),1),wl(-1)),c=pc([i,s],1),u=pc([o,l],1),f=cc(Si(c,u),[a[0],a[1]]);n=Vf(f)}if(n=xf(n),3===e.rank&&0!==e.shape[0]){const t=n,r=e.shape[0];n=cc(n,[r,n.shape[0]/r,n.shape[1]]),t.dispose()}return n}}),Wf=Ai({split_:function(e,t,r=0){const n={x:ki(e,"x","split")},a={numOrSizeSplits:t,axis:r};return hi.runKernel(An,n,a)}}),Hf=Ai({rfft_:function(e,t){ne("float32"===e.dtype,(()=>`The dtype for rfft() must be real value but got ${e.dtype}`));let r=e.shape[e.shape.length-1];const n=e.size/r;let a;if(null!=t&&t<r){const n=e.shape.map((e=>0)),i=e.shape.map((e=>e));i[e.shape.length-1]=t,a=dc(e,n,i),r=t}else if(null!=t&&t>r){const n=e.shape.map((e=>e));n[e.shape.length-1]=t-r,a=pc([e,$u(n)],e.shape.length-1),r=t}else a=e;const i=dl(a),o=cc(Si(a,i),[n,r]),s=$f(o),l=Math.floor(r/2)+1,c=xf(s),u=lu(s),f=Wf(c,[l,r-l],c.shape.length-1),p=Wf(u,[l,r-l],u.shape.length-1),h=a.shape.slice();return h[a.shape.length-1]=l,cc(Si(f[0],p[0]),h)}}),Gf=Ai({squaredDifference_:function(e,t){let r=ki(e,"a","squaredDifference"),n=ki(t,"b","squaredDifference");[r,n]=ai(r,n),Jo(r.shape,n.shape);const a={a:r,b:n};return hi.runKernel(In,a,{})}}),Xf=Ai({squeeze_:function(e,t){const r=ki(e,"x","squeeze");return cc(r,ve(r.shape,t).newShape)}}),Yf=Ai({stack_:function(e,t=0){const r=Di(e,"tensors","stack","string_or_numeric");ne(r.length>=1,(()=>"Pass at least one tensor to tf.stack")),r.length>0&&ne(t<=r[0].rank,(()=>"Axis must be <= rank of the tensor"));const n=r,a={axis:t};return hi.runKernel(Xr,n,a)}}),Zf=Ai({step_:function(e,t=0){const r={x:ki(e,"x","step")},n={alpha:t};return hi.runKernel(Zn,r,n)}}),Kf=Ai({stridedSlice_:function(e,t,r,n,a=0,i=0,o=0,s=0,l=0){const c={x:ki(e,"x","stridedSlice","string_or_numeric")},u={begin:t,end:r,strides:n,beginMask:a,endMask:i,ellipsisMask:o,newAxisMask:s,shrinkAxisMask:l};return hi.runKernel(Rn,c,u)}}),Jf=Ai({tan_:function(e){const t={x:ki(e,"x","tan","float32")};return hi.runKernel(jn,t)}});function Qf(e,t){ie(e);const r=xi(e,t);if(1!==r.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Mi(e,null,r,t)}function ep(e,t,r){if(ie(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const n=xi(e,r);if(2!==n.length&&1!==n.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===n.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Mi(e,t,n,r)}function tp(e,t,r){if(ie(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");const n=xi(e,r);if(4!==n.length&&1!==n.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===n.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Mi(e,t,n,r)}function rp(e,t,r){if(ie(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");const n=xi(e,r);if(5!==n.length&&1!==n.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===n.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Mi(e,t,n,r)}function np(e,t,r){if(ie(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");const n=xi(e,r);if(6!==n.length&&1!==n.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===n.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return Mi(e,t=t||n,n,r)}const ap=Ai({topk_:function(e,t=1,r=!0){const n=ki(e,"x","topk");if(0===n.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const a=n.shape[n.shape.length-1];if(t<0)throw new Error(`'k' passed to topk() must be >= 0 but got ${t}`);if(t>a)throw new Error(`'k' passed to topk() must be <= the last dimension (${a}) but got ${t}`);const i={x:n},o={k:t,sorted:r},[s,l]=hi.runKernel(Vn,i,o);return{values:s,indices:l}}}),ip=Ai({truncatedNormal_:function(e,t=0,r=1,n,a){if(null!=n&&"bool"===n)throw new Error("Unsupported data type $ { dtype }");const i=new hf(t,r,n,!0,a),o=To(e,n);for(let e=0;e<o.values.length;e++)o.values[e]=i.nextValue();return o.toTensor()}}),op=Ai({unique_:function(e,t=0){const r=ki(e,"x","unique","string_or_numeric");ne(r.rank>0,(()=>"The input tensor must be at least 1D"));const n={x:r},a={axis:t},[i,o]=hi.runKernel(Hn,n,a);return{values:i,indices:o}}}),sp=Ai({unsortedSegmentSum_:function(e,t,r){const n=ki(e,"x","unsortedSegmentSum"),a=ki(t,"segmentIds","unsortedSegmentSum","int32");ne(ue(r),(()=>"numSegments must be of dtype int"));const i={x:n,segmentIds:a},o={numSegments:r};return hi.runKernel(Xn,i,o)}}),lp=Ai({unstack_:function(e,t=0){const r=ki(e,"x","unstack","string_or_numeric");ne(t>=-r.shape.length&&t<r.shape.length,(()=>`Axis = ${t} is not in [-${r.shape.length}, ${r.shape.length})`));const n={value:r},a={axis:t};return hi.runKernel(Gn,n,a)}});function cp(e,t=!0,r,n){return hi.makeVariable(e,t,r,n)}function up(e,t){const r=[];for(let e=0;e<t.length;e++)t[e]&&r.push(e);const n=To(e,"int32"),a=To([r.length,e.length],"int32");for(let t=0;t<r.length;t++){const i=n.indexToLoc(r[t]),o=t*e.length;a.values.set(i,o)}return a.toTensor()}const fp=async function(e){const t=ki(e,"condition","whereAsync","bool"),r=await t.data(),n=up(t.shape,r);return e!==t&&t.dispose(),n},pp=async function(e,t,r){const n=ki(e,"tensor","boolMask"),a=ki(t,"mask","boolMask","bool"),i=null==r?0:r,o=a.rank,s=n.shape;ne(o>0,(()=>"mask cannot be scalar")),ae(s.slice(i,i+o),a.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let e=i;e<i+o;e++)l*=s[e];const c=s.slice(0,i).concat([l],s.slice(i+o)),u=cc(n,c),f=cc(a,[-1]),p=await fp(f),h=Xf(p,[1]),d=iu(u,h,i);return e!==n&&n.dispose(),t!==a&&a.dispose(),h.dispose(),u.dispose(),f.dispose(),p.dispose(),d};function hp(e,t,r=null){if(0===e.rank)return Cl(e);if(1!==e.rank&&null===r)return hp(cc(e,[-1]),t,r);if(1===e.rank||"number"==typeof r||Array.isArray(r)&&1===r.length){if(1===t)return ku(Cl(e),r);if(t===1/0)return wu(Cl(e),r);if(t===-1/0)return Wu(Cl(e),r);if("euclidean"===t||2===t)return pl(ku(Sl(Cl(e),wl(2,"int32")),r));throw new Error(`Error in norm: invalid ord value: ${t}`)}if(Array.isArray(r)&&2===r.length){if(1===t)return wu(ku(Cl(e),r[0]),r[1]-1);if(t===1/0)return wu(ku(Cl(e),r[1]),r[0]);if(t===-1/0)return Wu(ku(Cl(e),r[1]),r[0]);if("fro"===t||"euclidean"===t)return pl(ku(hl(e),r));throw new Error(`Error in norm: invalid ord value: ${t}`)}throw new Error(`Error in norm: invalid axis: ${r}`)}const dp=Ai({norm_:function(e,t="euclidean",r=null,n=!1){const a=hp(e=ki(e,"x","norm"),t,r);let i=a.shape;if(n){const t=ye(r,e.shape);i=Mu(a.shape,t)}return cc(a,i)}}),mp=Ai({movingAverage_:function(e,t,r,n,a=!0){const i=ki(e,"v","movingAverage"),o=ki(t,"x","movingAverage"),s=ki(r,"decay","movingAverage");ii(i,o),ne(ce(i.shape,o.shape),(()=>"Shape mismatch in v and x"));const l=wl(1),c=Ml(l,s);let u=fl(Ml(o,i),c);if(a){ne(null!=n,(()=>"When using zeroDebias: true, step is required."));const e=ki(n,"step","movingAverage");u=ul(u,Ml(l,Sl(s,e)))}return ll(i,u)}}),gp=Ai({scatterND_:function(e,t,r){const n=ki(e,"indices","scatterND","int32"),a=ki(t,"updates","scatterND");ss(a,n,r);const i={indices:n,updates:a},o={shape:r};return hi.runKernel(dn,i,o)}}),yp=Ai({sparseToDense_:function(e,t,r,n=0){const a=ki(e,"sparseIndices","sparseToDense","int32"),i=ki(t,"sparseValues","sparseToDense"),o=ki(n,"defaultValue","sparseToDense",i.dtype);!function(e,t,r,n){if("int32"!==e.dtype)throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);const a=e.rank>0?e.shape[0]:1,i=e.rank>1?e.shape[1]:1;if(r.length!==i)throw new Error(`outputShape has incorrect number of elements:, ${r.length}, should be: ${i}.`);const o=t.size;if(0!==t.rank&&(1!==t.rank||o!==a))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${a}]`);if(t.dtype!==n.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(a,i,r,o);const s={sparseIndices:a,sparseValues:i,defaultValue:o},l={outputShape:r};return hi.runKernel(On,s,l)}}),vp=Ai({gatherND_:function(e,t){const r=ki(t,"indices","gatherND","int32"),n={params:ki(e,"x","gatherND","string_or_numeric"),indices:r};return hi.runKernel(or,n)}}),bp=Ai({dropout_:function(e,t,r,n){const a=ki(e,"x","dropout");if(ne("float32"===a.dtype,(()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${a.dtype} tensor instead.`)),ne(t>=0&&t<1,(()=>`rate must be a float in the range [0, 1), but got ${t}.`)),0===t)return e instanceof Ga?a.clone():a;const i=function(e,t){if(null==t)return e.shape.slice();if(ce(e.shape,t))return t;if(e.shape.length===t.length){const r=[];for(let n=0;n<e.shape.length;n++)null==t[n]&&null!=e.shape[n]?r.push(e.shape[n]):r.push(t[n]);return r}return t}(a,r),o=1-t,s=ul(au(ll(vf(i,0,1,"float32",n),o)),o);return fl(a,s)}});function xp(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function _p(e,t,r){const n=1-e%2,a=new Float32Array(e);for(let i=0;i<e;++i){const o=2*Math.PI*i/(e+n-1);a[i]=t-r*Math.cos(o)}return Qf(a,"float32")}const wp=async function(e,t,r=1){const n=ki(e,"predictions","inTopK"),a=ki(t,"targets","inTopK");ne(n.rank>1,(()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${n.rank}`)),ne(n.rank-1===a.rank,(()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${n.rank} and targets rank ${a.rank}`)),ae(n.shape.slice(0,n.shape.length-1),a.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const i=n.shape[n.shape.length-1];ne(r>0&&r<=i,(()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${i}), but got ${r}`));const o=await n.data(),s=await a.data(),[l,c]=[o.length/i,i],u=be("bool",l);for(let e=0;e<l;e++){const t=e*c,n=o.subarray(t,t+c),a=[];for(let e=0;e<n.length;e++)a.push({value:n[e],index:e});a.sort(((e,t)=>t.value-e.value)),u[e]=0;for(let t=0;t<r;t++)if(a[t].index===s[e]){u[e]=1;break}}return e!==n&&n.dispose(),t!==a&&a.dispose(),Ei(u,a.shape,"bool")},kp=Ai({conv2DBackpropFilter_:function(e,t,r,n,a,i="NHWC",o){let s=e;3===e.rank&&(s=cc(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=cc(t,[1,t.shape[0],t.shape[1],t.shape[2]])),ne(4===s.rank,(()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${s.shape}.`)),ne(4===l.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`)),ne(4===r.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${r}.`));const c="NHWC"===i?s.shape[3]:s.shape[1],u="NHWC"===i?l.shape[3]:l.shape[1];ne(c===r[2],(()=>`Error in conv2dDerFilter: depth of input ${c}) must match input depth in filter (${r[2]}.`)),ne(u===r[3],(()=>`Error in conv2dDerFilter: depth of dy (${u}) must match output depth for filter (${r[3]}).`)),lc("conv2dDerFilter",a,o);const f={x:s,dy:l},p={strides:n,pad:a,dataFormat:i,dimRoundingMode:o,filterShape:r};return hi.runKernel(At,f,p)}});function Dp(e,t,r){if(null==r||"linear"===r)return e;if("relu"===r)return fl(e,Zf(t));throw new Error(`Cannot compute gradient for fused activation ${r}.`)}function Tp(e,t){let r=t;const n=Ko(e.shape,t.shape);return n.length>0&&(r=ku(r,n)),cc(r,e.shape)}function Ap(e,t,r,n){if("linear"===t)return e;if("relu"===t)return wf(e);if("elu"===t)return Kc(e);if("relu6"===t)return kf(e);if("prelu"===t)return cf(e,r);if("leakyrelu"===t)return pu(e,n);if("sigmoid"===t)return hc(e);throw new Error(`Unknown fused activation ${t}.`)}const Sp=(e,t)=>!(e>0)||"linear"===t,Mp=Ai({fusedConv2d_:function({x:e,filter:t,strides:r,pad:n,dataFormat:a="NHWC",dilations:i=[1,1],dimRoundingMode:o,bias:s,activation:l="linear",preluActivationWeights:c,leakyreluAlpha:u}){if(l=l||"linear",!1===Sp(hi.state.gradientDepth,l)){let f=Nc(e,t,r,n,a,i,o);return null!=s&&(f=ll(f,s)),Ap(f,l,c,u)}const f=ki(e,"x","conv2d","float32"),p=ki(t,"filter","conv2d","float32");let h=f,d=!1;3===f.rank&&(d=!0,h=cc(f,[1,f.shape[0],f.shape[1],f.shape[2]])),ne(4===h.rank,(()=>`Error in fused conv2d: input must be rank 4, but got rank ${h.rank}.`)),ne(4===p.rank,(()=>`Error in fused conv2d: filter must be rank 4, but got rank ${p.rank}.`)),lc("fused conv2d",n,o),ne(h.shape[3]===p.shape[2],(()=>`Error in conv2d: depth of input (${h.shape[3]}) must match input depth for filter ${p.shape[2]}.`)),ne(oc(r,i),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${r} and dilations '${i}'`)),ne("NHWC"===a,(()=>`Error in conv2d: got dataFormat of ${a} but only NHWC is currently supported.`));const m=Jl(h.shape,p.shape,r,i,n,o);let g,y;null!=s&&(g=ki(s,"bias","fused conv2d"),[g]=ai(g,f),Jo(m.outShape,g.shape)),null!=c&&(y=ki(c,"prelu weights","fused conv2d"));const v=(e,t)=>{const[a,o,s,c]=t,u=Dp(e,s,l);ne(ic(i),(()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`));const f=[Ic(o.shape,u,a,r,n),kp(o,u,a.shape,r,n)];if(null!=c){const e=Tp(c,u);f.push(e)}return f},b={x:h,filter:p,bias:g,preluActivationWeights:y},x={strides:r,pad:n,dataFormat:a,dilations:i,dimRoundingMode:o,activation:l,leakyreluAlpha:u};if(null==s){const e=xl(((e,t,r)=>{let n=hi.runKernel(ea,b,x);return r([t,e,n]),d&&(n=cc(n,[n.shape[1],n.shape[2],n.shape[3]])),{value:n,gradFunc:v}}));return e(h,p)}{const e=xl(((e,t,r,n)=>{let a=hi.runKernel(ea,b,x);return n([t,e,a,r]),d&&(a=cc(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:v}}));return e(h,p,g)}}}),Ep=Ai({depthwiseConv2dNativeBackpropFilter_:function(e,t,r,n,a,i=[1,1],o){let s=e;3===e.rank&&(s=cc(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=cc(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const c={x:s,dy:l},u={strides:n,pad:a,dimRoundingMode:o,dilations:i,filterShape:r};return hi.runKernel(Bt,c,u)}}),Cp=Ai({depthwiseConv2dNativeBackpropInput_:function(e,t,r,n,a,i=[1,1],o){let s=t,l=!1;3===t.rank&&(l=!0,s=cc(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const c={dy:s,filter:r},u={strides:n,pad:a,dimRoundingMode:o,dilations:i,inputShape:e},f=hi.runKernel(zt,c,u);return l?cc(f,[f.shape[1],f.shape[2],f.shape[3]]):f}}),Np=Ai({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:r,pad:n,dataFormat:a="NHWC",dilations:i=[1,1],dimRoundingMode:o,bias:s,activation:l="linear",preluActivationWeights:c,leakyreluAlpha:u}){if(!1===Sp(hi.state.gradientDepth,l)){let f=Vc(e,t,r,n,a,i,o);return null!=s&&(f=ll(f,s)),Ap(f,l,c,u)}const f=ki(e,"x","depthwiseConv2d","float32"),p=ki(t,"filter","depthwiseConv2d","float32");let h=f,d=!1;3===f.rank&&(d=!0,h=cc(f,[1,f.shape[0],f.shape[1],f.shape[2]])),ne(4===h.rank,(()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${h.rank}.`)),ne(4===p.rank,(()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${p.rank}.`)),ne(h.shape[3]===p.shape[2],(()=>`Error in fused depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${p.shape[2]}.`)),null==i&&(i=[1,1]),ne(oc(r,i),(()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${i}'`)),lc("fused depthwiseConv2d",n,o);const m=Jl(h.shape,p.shape,r,i,n,o,!0);let g,y;null!=s&&(g=ki(s,"bias","fused conv2d"),[g]=ai(g,f),Jo(m.outShape,g.shape)),null!=c&&(y=ki(c,"prelu weights","fused depthwiseConv2d"));const v=(e,t)=>{ne(ic(i),(()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${i}'`));const[a,s,c,u]=t,f=Dp(e,c,l),p=Cp(s.shape,f,a,r,n,i,o),h=Ep(s,f,a.shape,r,n,i,o);return null!=u?[p,h,Tp(g,f)]:[p,h]},b={x:h,filter:p,bias:g,preluActivationWeights:y},x={strides:r,pad:n,dataFormat:a,dilations:i,dimRoundingMode:o,activation:l,leakyreluAlpha:u};if(null==s){const e=xl(((e,t,r)=>{let n=hi.runKernel(ta,b,x);return r([t,e,n]),d&&(n=cc(n,[n.shape[1],n.shape[2],n.shape[3]])),{value:n,gradFunc:v}}));return e(h,p)}{const e=xl(((e,t,r,n)=>{let a=hi.runKernel(ta,b,x);return n([t,e,a,r]),d&&(a=cc(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:v}}));return e(h,p,g)}}}),Op=Ai({fusedMatMul_:function({a:e,b:t,transposeA:r=!1,transposeB:n=!1,bias:a,activation:i="linear",preluActivationWeights:o,leakyreluAlpha:s}){if(!1===Sp(hi.state.gradientDepth,i)){let l=Ho(e,t,r,n);return null!=a&&(l=ll(l,a)),Ap(l,i,o,s)}let l=ki(e,"a","fused matMul"),c=ki(t,"b","fused matMul");[l,c]=ai(l,c);const u=r?l.shape[l.rank-2]:l.shape[l.rank-1],f=n?c.shape[c.rank-1]:c.shape[c.rank-2],p=r?l.shape[l.rank-1]:l.shape[l.rank-2],h=n?c.shape[c.rank-2]:c.shape[c.rank-1],d=l.shape.slice(0,-2),m=c.shape.slice(0,-2),g=se(d),y=se(m);ne(u===f,(()=>`Error in fused matMul: inner shapes (${u}) and (${f}) of Tensors with shapes ${l.shape} and ${c.shape} and transposeA=${r} and transposeB=${n} must match.`));const v=Jo(l.shape.slice(0,-2),c.shape.slice(0,-2)).concat([p,h]),b=cc(l,r?[g,u,p]:[g,p,u]),x=cc(c,n?[y,h,f]:[y,f,h]);let _,w;null!=a&&(_=ki(a,"bias","fused matMul"),[_]=ai(_,l),Jo(v,_.shape)),null!=o&&(w=ki(o,"prelu weights","fused matMul"));const k=(e,t)=>{const[o,s,l,c]=t,u=Dp(cc(e,l.shape),l,i);let f,p;return r||n?!r&&n?(f=Ho(u,s,!1,!1),p=Ho(u,o,!0,!1)):r&&!n?(f=Ho(s,u,!1,!0),p=Ho(o,u,!1,!1)):(f=Ho(s,u,!0,!0),p=Ho(u,o,!0,!0)):(f=Ho(u,s,!1,!0),p=Ho(o,u,!0,!1)),null!=a?[f,p,Tp(c,u)]:[f,p]},D={a:b,b:x,bias:_,preluActivationWeights:w},T={transposeA:r,transposeB:n,activation:i,leakyreluAlpha:s};if(null==a){const e=xl(((e,t,r)=>{const n=hi.runKernel(Qn,D,T);return r([e,t,n]),{value:cc(n,v),gradFunc:k}}));return e(b,x)}{const e=xl(((e,t,r,n)=>{const a=hi.runKernel(Qn,D,T);return n([e,t,a,r]),{value:cc(a,v),gradFunc:k}}));return e(b,x,_)}}}),Ip=Ai({hammingWindow_:function(e){return _p(e,.54,.46)}}),Pp=Ai({hannWindow_:function(e){return _p(e,.5,.5)}}),Rp=Ai({frame_:function(e,t,r,n=!1,a=0){let i=0;const o=[];for(;i+t<=e.size;)o.push(dc(e,i,t)),i+=r;if(n)for(;i<e.size;){const n=i+t-e.size,s=pc([dc(e,i,t-n),Tl([n],a)]);o.push(s),i+=r}return 0===o.length?ep([],[0,t]):cc(pc(o),[o.length,t])}}),Lp=Ai({stft_:function(e,t,r,n,a=Pp){null==n&&(n=xp(t));const i=Rp(e,t,r),o=fl(i,a(t));return Hf(o,n)}}),Fp=Ai({cropAndResize_:function(e,t,r,n,a="bilinear",i=0){const o=ki(e,"image","cropAndResize"),s=ki(t,"boxes","cropAndResize","float32"),l=ki(r,"boxInd","cropAndResize","int32"),c=s.shape[0];ne(4===o.rank,(()=>`Error in cropAndResize: image must be rank 4,but got rank ${o.rank}.`)),ne(2===s.rank&&4===s.shape[1],(()=>`Error in cropAndResize: boxes must be have size [${c},4] but had shape ${s.shape}.`)),ne(1===l.rank&&l.shape[0]===c,(()=>`Error in cropAndResize: boxInd must be have size [${c}] but had shape ${s.shape}.`)),ne(2===n.length,(()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${n.length}.`)),ne(n[0]>=1&&n[1]>=1,(()=>`cropSize must be atleast [1,1], but was ${n}`)),ne("bilinear"===a||"nearest"===a,(()=>`method must be bilinear or nearest, but was ${a}`));const u={image:o,boxes:s,boxInd:l},f={method:a,extrapolationValue:i,cropSize:n};return hi.runKernel(Pt,u,f)}}),Bp=Ai({flipLeftRight_:function(e){const t=ki(e,"image","flipLeftRight","float32");ne(4===t.rank,(()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`));const r={image:t};return hi.runKernel(tr,r,{})}}),zp=Ai({grayscaleToRGB_:function(e){const t=ki(e,"image","grayscaleToRGB"),r=t.rank-1,n=t.shape[r];ne(t.rank>=2,(()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`)),ne(1===n,(()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${n}.`));const a=new Array(t.rank);return a.fill(1,0,r),a[r]=3,ru(t,a)}}),jp=Ai({rotateWithOffset_:function(e,t,r=0,n=.5){const a=ki(e,"image","rotateWithOffset","float32");ne(4===a.rank,(()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${a.rank}.`));const i={image:a},o={radians:t,fillValue:r,center:n};return hi.runKernel(Jn,i,o)}});function Up(e,t,r,n,a,i){null==n&&(n=.5),null==a&&(a=Number.NEGATIVE_INFINITY),null==i&&(i=0);const o=e.shape[0];return r=Math.min(r,o),ne(0<=n&&n<=1,(()=>`iouThreshold must be in [0, 1], but was '${n}'`)),ne(2===e.rank,(()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`)),ne(4===e.shape[1],(()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`)),ne(1===t.rank,(()=>"scores must be a 1D tensor")),ne(t.shape[0]===o,(()=>`scores has incompatible shape with boxes. Expected ${o}, but was ${t.shape[0]}`)),ne(0<=i&&i<=1,(()=>`softNmsSigma must be in [0, 1], but was '${i}'`)),{maxOutputSize:r,iouThreshold:n,scoreThreshold:a,softNmsSigma:i}}const $p=Ai({nonMaxSuppression_:function(e,t,r,n=.5,a=Number.NEGATIVE_INFINITY){const i=ki(e,"boxes","nonMaxSuppression","float32"),o=ki(t,"scores","nonMaxSuppression","float32"),s=Up(i,o,r,n,a),l={maxOutputSize:r=s.maxOutputSize,iouThreshold:n=s.iouThreshold,scoreThreshold:a=s.scoreThreshold};return hi.runKernel(Vr,{boxes:i,scores:o},l)}});function Vp(e,t,r){const n=function(e,t,r){return function(e,t,r){let n=0,a=e.length,i=0,o=!1;for(;n<a;){i=n+(a-n>>>1);const s=r(t,e[i]);s>0?n=i+1:(a=i,o=!s)}return o?n:-n-1}(e,t,r||qp)}(e,t,r),a=n<0?-(n+1):n;e.splice(a,0,t)}function qp(e,t){return e>t?1:e<t?-1:0}function Wp(e,t,r,n,a){return Xp(e,t,r,n,a,0)}function Hp(e,t,r,n,a,i){return Xp(e,t,r,n,a,0,!1,i,!0)}function Gp(e,t,r,n,a,i){return Xp(e,t,r,n,a,i,!0)}function Xp(e,t,r,n,a,i,o=!1,s=!1,l=!1){const c=[];for(let e=0;e<t.length;e++)t[e]>a&&c.push({score:t[e],boxIndex:e,suppressBeginIndex:0});c.sort(Kp);const u=i>0?-.5/i:0,f=[],p=[];for(;f.length<r&&c.length>0;){const t=c.pop(),{score:r,boxIndex:i,suppressBeginIndex:o}=t;if(r<a)break;let s=!1;for(let r=f.length-1;r>=o;--r){const o=Yp(e,i,f[r]);if(o>=n){s=!0;break}if(t.score=t.score*Zp(n,u,o),t.score<=a)break}t.suppressBeginIndex=f.length,s||(t.score===r?(f.push(i),p.push(t.score)):t.score>a&&Vp(c,t,Kp))}const h=f.length,d=r-h;s&&d>0&&(f.push(...new Array(d).fill(0)),p.push(...new Array(d).fill(0)));const m={selectedIndices:f};return o&&(m.selectedScores=p),l&&(m.validOutputs=h),m}function Yp(e,t,r){const n=e.subarray(4*t,4*t+4),a=e.subarray(4*r,4*r+4),i=Math.min(n[0],n[2]),o=Math.min(n[1],n[3]),s=Math.max(n[0],n[2]),l=Math.max(n[1],n[3]),c=Math.min(a[0],a[2]),u=Math.min(a[1],a[3]),f=Math.max(a[0],a[2]),p=Math.max(a[1],a[3]),h=(s-i)*(l-o),d=(f-c)*(p-u);if(h<=0||d<=0)return 0;const m=Math.max(i,c),g=Math.max(o,u),y=Math.min(s,f),v=Math.min(l,p),b=Math.max(y-m,0)*Math.max(v-g,0);return b/(h+d-b)}function Zp(e,t,r){const n=Math.exp(t*r*r);return r<=e?n:0}function Kp(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}const Jp=Ai({nonMaxSuppressionWithScore_:function(e,t,r,n=.5,a=Number.NEGATIVE_INFINITY,i=0){const o=ki(e,"boxes","nonMaxSuppression"),s=ki(t,"scores","nonMaxSuppression"),l=Up(o,s,r,n,a,i),c={boxes:o,scores:s},u={maxOutputSize:r=l.maxOutputSize,iouThreshold:n=l.iouThreshold,scoreThreshold:a=l.scoreThreshold,softNmsSigma:i=l.softNmsSigma},f=hi.runKernel(Wr,c,u);return{selectedIndices:f[0],selectedScores:f[1]}}}),Qp=Ai({nonMaxSuppressionPadded_:function(e,t,r,n=.5,a=Number.NEGATIVE_INFINITY,i=!1){const o=ki(e,"boxes","nonMaxSuppression"),s=ki(t,"scores","nonMaxSuppression"),l=Up(o,s,r,n,a,null),c={boxes:o,scores:s},u={maxOutputSize:l.maxOutputSize,iouThreshold:l.iouThreshold,scoreThreshold:l.scoreThreshold,padToMaxOutputSize:i},f=hi.runKernel(qr,c,u);return{selectedIndices:f[0],validOutputs:f[1]}}}),eh=Ai({resizeBilinear_:function(e,t,r=!1,n=!1){const a=ki(e,"images","resizeBilinear");ne(3===a.rank||4===a.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${a.rank}.`)),ne(2===t.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`)),ne(!1===n||!1===r,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let i=a,o=!1;3===a.rank&&(o=!0,i=cc(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const[]=t,s={images:i},l={alignCorners:r,halfPixelCenters:n,size:t},c=hi.runKernel(ln,s,l);return o?cc(c,[c.shape[1],c.shape[2],c.shape[3]]):c}}),th=Ai({resizeNearestNeighbor_:function(e,t,r=!1,n=!1){const a=ki(e,"images","resizeNearestNeighbor");ne(3===a.rank||4===a.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${a.rank}.`)),ne(2===t.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`)),ne("float32"===a.dtype||"int32"===a.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),ne(!1===n||!1===r,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let i=a,o=!1;3===a.rank&&(o=!0,i=cc(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const[]=t,s={images:i},l={alignCorners:r,halfPixelCenters:n,size:t},c=hi.runKernel(on,s,l);return o?cc(c,[c.shape[1],c.shape[2],c.shape[3]]):c}}),rh=Ai({threshold_:function(e,t="binary",r=!1,n=.5){const a=ki(e,"image","threshold"),i=a.shape[0]*a.shape[1];let o,s,l,c,u=fl(Qf([n]),255);if(ne(3===a.rank,(()=>`Error in threshold: image must be rank 3,but got rank ${a.rank}.`)),ne(3===a.shape[2]||1===a.shape[2],(()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${a.shape[2]}.`)),ne("int32"===a.dtype||"float32"===a.dtype,(()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${a.dtype}.`)),ne("otsu"===t||"binary"===t,(()=>`Method must be binary or otsu, but was ${t}`)),3===a.shape[2]){[o,s,l]=Wf(a,[1,1,1],-1);const e=fl(o,.2989),t=fl(s,.587),r=fl(l,.114);c=ll(ll(e,t),r)}else c=e;"otsu"===t&&(u=function(e,t){let r,n,a,i,o,s,l=Qf([-1]),c=Qf([0]),u=Qf([0]);for(let f=0;f<e.size-1;f++){r=dc(e,0,f+1),n=dc(e,f+1),o=ul(ku(r),t),s=ul(ku(n),t);const p=ku(fl(r,bf(0,r.size)));a=ul(p,ku(r));const h=Tl(n.shape,r.size),d=ll(bf(0,n.size),h),m=fl(n,d);i=ul(ku(m),ku(n));const g=Ml(a,i),y=Ml(a,i),v=fl(o,s);u=fl(fl(v,g),y);const b=ou(u,c);c=Gc(b,u,c),l=Gc(b,Qf([f]),l)}return l}(wc(Ao(Ef(c),"int32"),Ei([]),256),i));const f=r?du(c,u):ou(c,u);return Ao(fl(f,255),"int32")}}),nh=Ai({transform_:function(e,t,r="nearest",n="constant",a=0,i){const o=ki(e,"image","transform","float32"),s=ki(t,"transforms","transform","float32");ne(4===o.rank,(()=>`Error in transform: image must be rank 4,but got rank ${o.rank}.`)),ne(2===s.rank&&(s.shape[0]===o.shape[0]||1===s.shape[0])&&8===s.shape[1],(()=>"Error in transform: Input transform should be batch x 8 or 1 x 8")),ne(null==i||2===i.length,(()=>`Error in transform: outputShape must be [height, width] or null, but got ${i}.`));const l={image:o,transforms:s},c={interpolation:r,fillMode:n,fillValue:a,outputShape:i};return hi.runKernel(qn,l,c)}}),ah=Ai({bandPart_:function(e,t,r){ne(t%1==0,(()=>`bandPart(): numLower must be an integer, got ${t}.`)),ne(r%1==0,(()=>`bandPart(): numUpper must be an integer, got ${r}.`));const n=ki(e,"a","bandPart");ne(n.rank>=2,(()=>`bandPart(): Rank must be at least 2, got ${n.rank}.`));const a=n.shape,[i,o]=n.shape.slice(-2);if(!(t<=i))throw new Error(`bandPart(): numLower (${t}) must not be greater than the number of rows (${i}).`);if(!(r<=o))throw new Error(`bandPart(): numUpper (${r}) must not be greater than the number of columns (${o}).`);t<0&&(t=i),r<0&&(r=o);const s=cc(bf(0,i,1,"int32"),[-1,1]),l=bf(0,o,1,"int32"),c=Ml(s,l),u=Pu(du(c,wl(+t,"int32")),su(c,wl(-r,"int32"))),f=$u([i,o],n.dtype);return cc(Yf(lp(cc(n,[-1,i,o])).map((e=>Gc(u,e,f)))),a)}}),ih=Ai({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,ne(null!=e&&e.length>0,(()=>"Gram-Schmidt process: input must not be null, undefined, or empty"));const r=e[0].shape[0];for(let t=1;t<e.length;++t)ne(e[t].shape[0]===r,(()=>`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${r})`))}else t=!0,e=Wf(e,e.shape[0],0).map((e=>Xf(e,[0])));ne(e.length<=e[0].shape[0],(()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`));const r=[],n=e;for(let t=0;t<e.length;++t)r.push(hi.tidy((()=>{let e=n[t];if(t>0)for(let n=0;n<t;++n){const t=fl(ku(fl(r[n],e)),r[n]);e=Ml(e,t)}return ul(e,dp(e,"euclidean"))})));return t?Yf(r,0):r}});function oh(e,t=!1){return hi.tidy((()=>{ne(2===e.shape.length,(()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`));const r=e.shape[0],n=e.shape[1];let a=nu(r),i=So(e);const o=ep([[1]],[1,1]);let s=So(o);const l=r>=n?n:r;for(let e=0;e<l;++e){const t=i,l=s,c=a;[s,i,a]=hi.tidy((()=>{const t=dc(i,[e,e],[r-e,1]),l=dp(t),c=dc(i,[e,e],[1,1]),u=Gc(ou(c,0),ep([[-1]]),ep([[1]])),f=Ml(c,fl(u,l)),p=ul(t,f);s=1===p.shape[0]?So(o):pc([o,dc(p,[1,0],[p.shape[0]-1,p.shape[1]])],0);const h=bu(ul(Ho(u,f),l)),d=dc(i,[e,0],[r-e,n]),m=fl(h,s),g=Xo(s);if(0===e)i=Ml(d,Ho(m,Ho(g,d)));else{const t=Ml(d,Ho(m,Ho(g,d)));i=pc([dc(i,[0,0],[e,n]),t],0)}const y=Xo(m),v=dc(a,[0,e],[r,a.shape[1]-e]);if(0===e)a=Ml(v,Ho(Ho(v,s),y));else{const t=Ml(v,Ho(Ho(v,s),y));a=pc([dc(a,[0,0],[r,e]),t],1)}return[s,i,a]})),Zs([t,l,c])}return!t&&r>n&&(a=dc(a,[0,0],[r,n]),i=dc(i,[0,0],[n,n])),[a,i]}))}const sh=Ai({qr_:function(e,t=!1){if(ne(e.rank>=2,(()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`)),2===e.rank)return oh(e,t);{const r=e.shape.slice(0,e.shape.length-2).reduce(((e,t)=>e*t)),n=lp(cc(e,[r,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),a=[],i=[];return n.forEach((e=>{const[r,n]=oh(e,t);a.push(r),i.push(n)})),[cc(Yf(a,0),e.shape),cc(Yf(i,0),e.shape)]}}});var lh;!function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(lh||(lh={}));const ch=Ai({computeWeightedLoss_:function(e,t,r=lh.SUM_BY_NONZERO_WEIGHTS){const n=ki(e,"losses","computeWeightedLoss");let a=null;null!=t&&(a=ki(t,"weights","computeWeightedLoss"));const i=null==a?n:fl(n,a);if(r===lh.NONE)return i;if(r===lh.SUM)return ku(i);if(r===lh.MEAN){if(null==a)return Uu(i);{const e=n.size/a.size,t=ul(ku(i),ku(a));return e>1?ul(t,wl(e)):t}}if(r===lh.SUM_BY_NONZERO_WEIGHTS){if(null==a)return ul(ku(i),wl(n.size));{const e=fl(a,Vu(n.shape)),t=Ao(ku(Ju(e,wl(0))),"float32");return ul(ku(i),t)}}throw Error(`Unknown reduction: ${r}`)}}),uh=Ai({absoluteDifference_:function(e,t,r,n=lh.SUM_BY_NONZERO_WEIGHTS){const a=ki(e,"labels","absoluteDifference"),i=ki(t,"predictions","absoluteDifference");let o=null;null!=r&&(o=ki(r,"weights","absoluteDifference")),ae(a.shape,i.shape,"Error in absoluteDifference: ");const s=Cl(Ml(a,i));return ch(s,o,n)}}),fh=Ai({cosineDistance_:function(e,t,r,n,a=lh.SUM_BY_NONZERO_WEIGHTS){const i=ki(e,"labels","cosineDistance"),o=ki(t,"predictions","cosineDistance");let s=null;null!=n&&(s=ki(n,"weights","cosineDistance")),ae(i.shape,o.shape,"Error in cosineDistance: ");const l=wl(1),c=Ml(l,ku(fl(i,o),r,!0));return ch(c,s,a)}}),ph=Ai({hingeLoss_:function(e,t,r,n=lh.SUM_BY_NONZERO_WEIGHTS){let a=ki(e,"labels","hingeLoss");const i=ki(t,"predictions","hingeLoss");let o=null;null!=r&&(o=ki(r,"weights","hingeLoss")),ae(a.shape,i.shape,"Error in hingeLoss: ");const s=wl(1);a=Ml(fl(wl(2),a),s);const l=wf(Ml(s,fl(a,i)));return ch(l,o,n)}}),hh=Ai({huberLoss_:function(e,t,r,n=1,a=lh.SUM_BY_NONZERO_WEIGHTS){const i=ki(e,"labels","huberLoss"),o=ki(t,"predictions","huberLoss");let s=null;null!=r&&(s=ki(r,"weights","huberLoss")),ae(i.shape,o.shape,"Error in huberLoss: ");const l=wl(n),c=Cl(Ml(o,i)),u=Hu(c,l),f=Ml(c,u),p=ll(fl(wl(.5),hl(u)),fl(l,f));return ch(p,s,a)}}),dh=Ai({logLoss_:function(e,t,r,n=1e-7,a=lh.SUM_BY_NONZERO_WEIGHTS){const i=ki(e,"labels","logLoss"),o=ki(t,"predictions","logLoss");let s=null;null!=r&&(s=ki(r,"weights","logLoss")),ae(i.shape,o.shape,"Error in logLoss: ");const l=wl(1),c=wl(n),u=bu(fl(i,yu(ll(o,c)))),f=fl(Ml(l,i),yu(ll(Ml(l,o),c))),p=Ml(u,f);return ch(p,s,a)}}),mh=Ai({meanSquaredError_:function(e,t,r,n=lh.SUM_BY_NONZERO_WEIGHTS){const a=ki(e,"labels","meanSquaredError"),i=ki(t,"predictions","meanSquaredError");let o=null;null!=r&&(o=ki(r,"weights","meanSquaredError")),ae(a.shape,i.shape,"Error in meanSquaredError: ");const s=Gf(a,i);return ch(s,o,n)}}),gh=Ai({sigmoidCrossEntropy_:function(e,t,r,n=0,a=lh.SUM_BY_NONZERO_WEIGHTS){let i=ki(e,"multiClassLabels","sigmoidCrossEntropy");const o=ki(t,"logits","sigmoidCrossEntropy");let s=null;if(null!=r&&(s=ki(r,"weights","sigmoidCrossEntropy")),ae(i.shape,o.shape,"Error in sigmoidCrossEntropy: "),n>0){const e=wl(n),t=wl(1),r=wl(.5);i=ll(fl(i,Ml(t,e)),fl(r,e))}const l=function(e,t){const r=ki(e,"labels","sigmoidCrossEntropyWithLogits"),n=ki(t,"logits","sigmoidCrossEntropyWithLogits");ae(r.shape,n.shape,"Error in sigmoidCrossEntropyWithLogits: ");const a=wf(n),i=fl(n,r),o=vu(Qc(bu(Cl(n))));return ll(Ml(a,i),o)}(i,o);return ch(l,s,a)}}),yh=Ai({softmaxCrossEntropy_:function(e,t,r,n=0,a=lh.SUM_BY_NONZERO_WEIGHTS){let i=ki(e,"onehotLabels","softmaxCrossEntropy");const o=ki(t,"logits","softmaxCrossEntropy");let s=null;if(null!=r&&(s=ki(r,"weights","softmaxCrossEntropy")),ae(i.shape,o.shape,"Error in softmaxCrossEntropy: "),n>0){const e=wl(n),t=wl(1),r=wl(i.shape[1]);i=ll(fl(i,Ml(t,e)),ul(e,r))}const l=function(e,t,r=-1){if(-1===r&&(r=t.rank-1),r!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${r}`);const n=xl(((e,t,n)=>{const a=Iu(t,[r],!0),i=Ml(Ao(t,"float32"),a);n([e,i]);const o=bu(fl(i,e));return{value:ku(o,[r]),gradFunc:(e,t)=>{const[n,a]=t,i=Mu(e.shape,[r]);return[fl(cc(e,i),Ml(Ao(n,"float32"),Qc(a))),fl(cc(e,i),Ml(Qc(a),Ao(n,"float32")))]}}}));return n(e,t)}(i,o);return ch(l,s,a)}}),vh=Ai({sparseFillEmptyRows_:function(e,t,r,n){const a=ki(e,"indices","sparseFillEmptyRows","int32"),i=ki(t,"values","sparseFillEmptyRows"),o=ki(r,"denseShape","sparseFillEmptyRows","int32"),s=ki(n,"defaultValue","sparseFillEmptyRows",i.dtype);if(2!==a.rank)throw new Error(`Indices should be Tensor2D but received shape\n        ${a.shape}`);if(1!==i.rank)throw new Error(`Values should be Tensor1D but received shape ${i.shape}`);if(1!==o.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${o.shape}`);if(0!==s.rank)throw new Error(`Default value should be a scalar but received shape ${s.shape}`);const l={indices:a,values:i,denseShape:o,defaultValue:s},c=hi.runKernel(Mn,l);return{outputIndices:c[0],outputValues:c[1],emptyRowIndicator:c[2],reverseIndexMap:c[3]}}}),bh=Ai({sparseReshape_:function(e,t,r){const n=ki(e,"inputIndices","sparseReshape","int32"),a=ki(t,"inputShape","sparseReshape","int32"),i=ki(r,"newShape","sparseReshape","int32");if(2!==n.rank)throw new Error(`Input indices should be Tensor2D but received shape\n        ${n.shape}`);if(1!==a.rank)throw new Error(`Input shape should be Tensor1D but received shape ${a.shape}`);if(1!==i.rank)throw new Error(`New shape should be Tensor1D but received shape ${i.shape}`);const o={inputIndices:n,inputShape:a,newShape:i},s=hi.runKernel(En,o);return{outputIndices:s[0],outputShape:s[1]}}}),xh=Ai({sparseSegmentMean_:function(e,t,r){const n=ki(e,"data","sparseSegmentMean"),a=ki(t,"indices","sparseSegmentMean","int32"),i=ki(r,"segmentIds","sparseSegmentMean","int32");if(n.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.rank)throw new Error(`Indices should be Tensor1D but received shape\n          ${a.shape}`);if(1!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n          ${i.shape}`);const o={data:n,indices:a,segmentIds:i};return hi.runKernel(Cn,o)}}),_h=Ai({sparseSegmentSum_:function(e,t,r){const n=ki(e,"data","sparseSegmentSum"),a=ki(t,"indices","sparseSegmentSum","int32"),i=ki(r,"segmentIds","sparseSegmentSum","int32");if(n.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.rank)throw new Error(`Indices should be Tensor1D but received shape\n         ${a.shape}`);if(1!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n         ${i.shape}`);const o={data:n,indices:a,segmentIds:i};return hi.runKernel(Nn,o)}}),wh=Ai({stringNGrams_:function(e,t,r,n,a,i,o,s){const l=ki(e,"data","stringNGrams","string");if("string"!==l.dtype)throw new Error("Data must be of datatype string");if(1!==l.shape.length)throw new Error(`Data must be a vector, saw: ${l.shape}`);const c=ki(t,"dataSplits","stringNGrams");if("int32"!==c.dtype)throw new Error("Data splits must be of datatype int32");const u={separator:r,nGramWidths:n,leftPad:a,rightPad:i,padWidth:o,preserveShortSequences:s},f={data:l,dataSplits:c},p=hi.runKernel(Ln,f,u);return{nGrams:p[0],nGramsSplits:p[1]}}}),kh=Ai({stringSplit_:function(e,t,r=!0){const n=ki(e,"input","stringSplit","string"),a=ki(t,"delimiter","stringSplit","string");if(1!==n.rank)throw new Error(`Input should be Tensor1D but received shape ${n.shape}`);if(0!==a.rank)throw new Error(`Delimiter should be a scalar but received shape ${a.shape}`);const i={skipEmpty:r},o={input:n,delimiter:a},s=hi.runKernel(Fn,o,i);return{indices:s[0],values:s[1],shape:s[2]}}}),Dh=Ai({stringToHashBucketFast_:function(e,t){const r=ki(e,"input","stringToHashBucketFast","string"),n={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");const a={input:r};return hi.runKernel(Bn,a,n)}}),Th={fft:$f,ifft:Vf,rfft:Hf,irfft:qf},Ah={hammingWindow:Ip,hannWindow:Pp,frame:Rp,stft:Lp},Sh={flipLeftRight:Bp,grayscaleToRGB:zp,resizeNearestNeighbor:th,resizeBilinear:eh,rotateWithOffset:jp,cropAndResize:Fp,nonMaxSuppression:$p,nonMaxSuppressionAsync:async function(e,t,r,n=.5,a=Number.NEGATIVE_INFINITY){const i=ki(e,"boxes","nonMaxSuppressionAsync"),o=ki(t,"scores","nonMaxSuppressionAsync"),s=Up(i,o,r,n,a);r=s.maxOutputSize,n=s.iouThreshold,a=s.scoreThreshold;const l=await Promise.all([i.data(),o.data()]),c=l[0],u=l[1],{selectedIndices:f}=Wp(c,u,r,n,a);return i!==e&&i.dispose(),o!==t&&o.dispose(),Qf(f,"int32")},nonMaxSuppressionWithScore:Jp,nonMaxSuppressionWithScoreAsync:async function(e,t,r,n=.5,a=Number.NEGATIVE_INFINITY,i=0){const o=ki(e,"boxes","nonMaxSuppressionAsync"),s=ki(t,"scores","nonMaxSuppressionAsync"),l=Up(o,s,r,n,a,i);r=l.maxOutputSize,n=l.iouThreshold,a=l.scoreThreshold,i=l.softNmsSigma;const c=await Promise.all([o.data(),s.data()]),u=c[0],f=c[1],{selectedIndices:p,selectedScores:h}=Gp(u,f,r,n,a,i);return o!==e&&o.dispose(),s!==t&&s.dispose(),{selectedIndices:Qf(p,"int32"),selectedScores:Qf(h)}},nonMaxSuppressionPadded:Qp,nonMaxSuppressionPaddedAsync:async function(e,t,r,n=.5,a=Number.NEGATIVE_INFINITY,i=!1){const o=ki(e,"boxes","nonMaxSuppressionAsync"),s=ki(t,"scores","nonMaxSuppressionAsync"),l=Up(o,s,r,n,a,null),c=l.maxOutputSize,u=l.iouThreshold,f=l.scoreThreshold,[p,h]=await Promise.all([o.data(),s.data()]),{selectedIndices:d,validOutputs:m}=Hp(p,h,c,u,f,i);return o!==e&&o.dispose(),s!==t&&s.dispose(),{selectedIndices:Qf(d,"int32"),validOutputs:wl(m,"int32")}},threshold:rh,transform:nh},Mh={bandPart:ah,gramSchmidt:ih,qr:sh},Eh={absoluteDifference:uh,computeWeightedLoss:ch,cosineDistance:fh,hingeLoss:ph,huberLoss:hh,logLoss:dh,meanSquaredError:mh,sigmoidCrossEntropy:gh,softmaxCrossEntropy:yh},Ch={sparseFillEmptyRows:vh,sparseReshape:bh,sparseSegmentMean:xh,sparseSegmentSum:_h},Nh={stringNGrams:wh,stringSplit:kh,stringToHashBucketFast:Dh},Oh={sgd:Ll.sgd,momentum:Ll.momentum,adadelta:Ll.adadelta,adagrad:Ll.adagrad,rmsprop:Ll.rmsprop,adamax:Ll.adamax,adam:Ll.adam},Ih="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:e=>e();function Ph(){return new Promise((e=>Ih((()=>e()))))}function Rh(e,t){const r=e[0].length;e.forEach(((e,t)=>{ne(e.length===r,(()=>`Error in concat${r}D: rank of tensors[${t}] must be the same as the rank of the rest (${r})`))})),ne(t>=0&&t<r,(()=>`Error in concat${r}D: axis must be between 0 and ${r-1}.`));const n=e[0];e.forEach(((e,a)=>{for(let i=0;i<r;i++)ne(i===t||e[i]===n[i],(()=>`Error in concat${r}D: Shape of tensors[${a}] (${e}) does not match the shape of the rest (${n}) along the non-concatenated axis ${a}.`))}))}function Lh(e,t){const r=e[0].slice();for(let n=1;n<e.length;n++)r[t]+=e[n][t];return r}const Fh=30;function Bh(e){return e<=Fh?e:Oe(e,Math.floor(Math.sqrt(e)))}function zh(e,t,r){return[r*("number"==typeof e?e:e[0]),t*("number"==typeof e?e:e[1])]}function jh(e,t,r,n=!0){let a=[];if(n)a=a.concat(t.slice(0)),a.push(e[0]/r),a=a.concat(e.slice(1));else{a=a.concat(e[0]);const r=t.length;for(let n=0;n<r;++n)a=a.concat([e[n+1]/t[n],t[n]]);a=a.concat(e.slice(r+1))}return a}function Uh(e,t,r=!0){const n=[];if(r){n.push(t);for(let r=t+1;r<e;++r)r<=2*t?(n.push(r),n.push(r-(t+1))):n.push(r)}else{const r=[],a=[];for(let n=1;n<e;++n)n>=2*t+1||n%2==1?a.push(n):r.push(n);n.push(...r),n.push(0),n.push(...a)}return n}function $h(e,t,r,n=!0){const a=[];n?a.push(e[0]/r):a.push(e[0]*r);for(let r=1;r<e.length;++r)r<=t.length?n?a.push(t[r-1]*e[r]):a.push(e[r]/t[r-1]):a.push(e[r]);return a}function Vh(e,t){const r=[0];for(let n=0;n<t;++n)r.push(e[n][0]);return r}function qh(e,t,r){const n=e.slice(0,1);for(let a=0;a<r;++a)n.push(e[a+1]-t[a][0]-t[a][1]);return n}const Wh=1.7580993408473768,Hh=1.0507009873554805,Gh=.3275911,Xh=.254829592,Yh=-.284496736,Zh=1.421413741,Kh=-1.453152027,Jh=1.061405429;function Qh(e,t){if(e.length!==t.length)throw new Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);const r=new Float32Array(2*e.length);for(let n=0;n<r.length;n+=2)r[n]=e[n/2],r[n+1]=t[n/2];return r}function ed(e){const t=new Float32Array(e.length/2),r=new Float32Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=e[n],r[n/2]=e[n+1];return{real:t,imag:r}}function td(e){const t=Math.ceil(e.length/4),r=new Float32Array(t),n=new Float32Array(t);for(let t=0;t<e.length;t+=4)r[Math.floor(t/4)]=e[t],n[Math.floor(t/4)]=e[t+1];return{real:r,imag:n}}function rd(e){const t=Math.floor(e.length/4),r=new Float32Array(t),n=new Float32Array(t);for(let t=2;t<e.length;t+=4)r[Math.floor(t/4)]=e[t],n[Math.floor(t/4)]=e[t+1];return{real:r,imag:n}}function nd(e,t){return{real:e[2*t],imag:e[2*t+1]}}function ad(e,t,r,n){e[2*n]=t,e[2*n+1]=r}function id(e,t){const r=new Float32Array(e/2),n=new Float32Array(e/2);for(let a=0;a<Math.ceil(e/2);a++){const i=(t?2:-2)*Math.PI*(a/e);r[a]=Math.cos(i),n[a]=Math.sin(i)}return{real:r,imag:n}}function od(e,t,r){const n=(r?2:-2)*Math.PI*(e/t);return{real:Math.cos(n),imag:Math.sin(n)}}const sd=/->/g;function ld(e,t){const r=((e=e.replace(/\s/g,"")).length-e.replace(sd,"").length)/"->".length;if(r<1)throw new Error("Equations without an arrow are not supported.");if(r>1)throw new Error('Equation must contain exactly one arrow ("->").');const[n,a]=e.split("->");ne(-1===n.indexOf("..."),(()=>'The ellipsis notation ("...") is not supported yet.'));const i=n.split(","),o=i.length;if(t!==o)throw new Error(`Expected ${o} input tensors, received ${t}`);if(o>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const s=[];for(let e=0;e<a.length;++e){const t=a[e];if(!i.some((e=>-1!==e.indexOf(t))))throw new Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===s.indexOf(t)&&s.push(t)}for(let e=0;e<n.length;++e){const t=n[e];-1===s.indexOf(t)&&","!==t&&s.push(t)}const l=new Array(i.length);for(let e=0;e<o;++e){if(new Set(i[e].split("")).size!==i[e].length)throw new Error(`Found duplicate axes in input component ${i[e]}. Support for duplicate axes in input is not implemented yet.`);l[e]=[];for(let t=0;t<i[e].length;++t)l[e].push(s.indexOf(i[e][t]))}const c=s.length,u=[];for(let e=a.length;e<c;++e)u.push(e);return{allDims:s,summedDims:u,idDims:l}}function cd(e,t){let r=new Array(e);r.fill(-1);for(let e=0;e<t.length;++e)r[t[e]]=e;const n=[];for(let t=0;t<e;++t)-1===r[t]&&n.push(t);return r=r.filter((e=>-1!==e)),{permutationIndices:r,expandDims:n}}function ud(e,t,r){const n=new Array(e);for(let e=0;e<r.length;++e){const a=r[e].shape;for(let r=0;r<t[e].length;++r)void 0===n[t[e][r]]?n[t[e][r]]=a[r]:ne(n[t[e][r]]===a[r],(()=>`Expected dimension ${n[t[e][r]]} at axis ${r} of input shaped ${JSON.stringify(a)}, but got dimension ${a[r]}`))}}function fd(e,t){const r=e,n=[];let a=0;0===e.length&&r.push(-1),a=e.length+1;for(let e=0;e<a;++e)n.push([]);const i=[];for(let e=0;e<r.length;++e){const a=hd(t,r[e]);for(const t of a)-1===i.indexOf(t)&&(n[e].push(t),i.push(t))}return{path:r,steps:n}}function pd(e){return e.every(((e,t)=>e===t))}function hd(e,t){const r=[];for(let n=0;n<e.length;++n)0!==e[n].length&&-1===e[n].indexOf(t)&&-1!==t||r.push(n);return r}function dd(e,t,r=0){let n=[];if("number"==typeof t)ne(e.shape[r]%t==0,(()=>"Number of splits must evenly divide the axis.")),n=new Array(t).fill(e.shape[r]/t);else{const a=t.reduce(((e,t)=>(-1===t&&(e+=1),e)),0);ne(a<=1,(()=>"There should be only one negative value in split array."));const i=t.indexOf(-1);if(-1!==i){const n=t.reduce(((e,t)=>t>0?e+t:e));t[i]=e.shape[r]-n}ne(e.shape[r]===t.reduce(((e,t)=>e+t)),(()=>"The sum of sizes must match the size of the axis dimension.")),n=t}return n}function md(e){return`Received SparseTensor with denseShape[0] = 0 but\n  indices.shape[0] = ${e}`}function gd(e,t){return`indices(${e}, 0) is invalid: ${t} < 0`}function yd(e,t,r){return`indices(${e}, 0) is invalid: ${t} >= ${r}`}function vd(e,t){return`only one output dimension may be -1, not both ${e} and ${t}`}function bd(e,t){return`size ${e} must be non-negative, not ${t}`}function xd(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function _d(e,t){return`Input to reshape is a SparseTensor with ${se(e)}\n  dense values, but the requested shape requires a multiple of ${se(t)}. inputShape=${e} outputShape= ${t}`}function wd(e,t){return`Input to reshape is a tensor with ${se(e)} dense values, but the requested shape has ${se(t)}. inputShape=${e} outputShape=${t}`}function kd(){return"segment ids must be >= 0"}function Dd(){return"segment ids are not increasing"}function Td(e,t){return`Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function Ad(e,t,r){return`Bad: indices[${e}] == ${t} out of range [0, ${r})`}function Sd(e,t){let r,n=!1;for(e<=Fh?(r=e,n=!0):r=Oe(e,Math.floor(Math.sqrt(e)));!n;)r>t||r===e?n=!0:r=Oe(e,r+1);return r}function Md(e,t,r){const n=[],a=e.length;for(let i=0;i<a;i++)i!==t?n.push(e[i]):n.push(r);return n}function Ed(e,t,r,n){const a=t.shape.length,i=e.shape.length;if(0!==n&&(n<-a||n>a))throw new Error(`Expect batchDims in the range of [-${a}, ${a}], but got ${n}`);if(n<0&&(n+=a),n>i)throw new Error(`batchDims (${n}) must be less than rank(x) (\n    ${i}).`);if(r<n)throw new Error(`batchDims (${n}) must be less than or equal to axis (${r}).`);for(let r=0;r<n;++r)if(e.shape[r]!==t.shape[r])throw new Error(`x.shape[${r}]: ${e.shape[r]} should be equal to indices.shape[${r}]: ${t.shape[r]}.`);const o=e.shape[r],s=[];let l=1,c=1,u=1;for(let t=0;t<n;++t)s.push(e.shape[t]),l*=e.shape[t];for(let t=n;t<r;t++)s.push(e.shape[t]),c*=e.shape[t];for(let e=n;e<a;e++)s.push(t.shape[e]);for(let t=r+1;t<i;t++)s.push(e.shape[t]),u*=e.shape[t];return{batchSize:l,sliceSize:u,outerSize:c,dimSize:o,outputShape:s}}function Cd(e){try{return e.map((e=>Pa(e)))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function Nd(e){return e.map((e=>Ia(e)))}const Od={kernelName:Ze,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(e,Zf(Ao(r,"float32"),-1))}}},Id={kernelName:Ke,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>{const t=hl(Ao(r,"float32")),n=pl(Ml(wl(1),t));return bu(ul(e,n))}}}},Pd={kernelName:Je,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>{const t=pl(Ml(hl(Ao(r,"float32")),1));return ul(e,t)}}}},Rd={kernelName:Qe,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[r,n]=t,a=Jo(r.shape,n.shape);return{a:()=>{let t=e;const n=Ko(r.shape,a);return n.length>0&&(t=ku(t,n)),cc(t,r.shape)},b:()=>{let t=e;const r=Ko(n.shape,a);return r.length>0&&(t=ku(t,r)),cc(t,n.shape)}}}},Ld={kernelName:et,saveAllInputs:!0,gradFunc:(e,t)=>{const r={};return t.forEach(((t,n)=>{r[n]=()=>e.clone()})),r}},Fd={kernelName:nt,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>dl(r)}}},Bd={kernelName:at,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>dl(r)}}},zd={kernelName:it,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>ul(e,pl(Ml(wl(1),hl(Ao(r,"float32")))))}}},jd={kernelName:ot,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>{const t=pl(ll(wl(1),hl(Ao(r,"float32"))));return ul(e,t)}}}},Ud={kernelName:ct,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[r,n]=t,a=Jo(r.shape,n.shape);return{a:()=>{const t=ll(hl(r),hl(n));let i=fl(e,ul(n,t));const o=Ko(r.shape,a);return o.length>0&&(i=ku(i,o)),cc(i,r.shape)},b:()=>{const t=ll(hl(r),hl(n));let i=bu(fl(e,ul(r,t)));const o=Ko(n.shape,a);return o.length>0&&(i=ku(i,o)),cc(i,n.shape)}}}},$d={kernelName:st,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>ul(e,ll(hl(Ao(r,"float32")),1))}}},Vd={kernelName:lt,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>ul(e,Ml(wl(1),hl(Ao(r,"float32"))))}}},qd=Ai({avgPool3dGrad_:function(e,t,r,n,a,i){const o=ki(e,"dy","avgPool3dGrad"),s=ki(t,"input","avgPool3dGrad");let l=o,c=s,u=!1;4===s.rank&&(u=!0,l=cc(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),c=cc(s,[1,s.shape[0],s.shape[1],s.shape[2],s.shape[3]])),ne(5===l.rank,(()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`)),ne(5===c.rank,(()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${c.rank}.`)),lc("avgPool3dGrad",a,i);const f={dy:l,input:c},p={filterSize:r,strides:n,pad:a,dimRoundingMode:i},h=hi.runKernel(ht,f,p);return u?cc(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}}),Wd={kernelName:pt,inputsToSave:["x"],gradFunc:(e,t,r)=>{const[n]=t,{filterSize:a,strides:i,pad:o,dimRoundingMode:s}=r;return{x:()=>qd(e,n,a,i,o,s)}}},Hd=Ai({avgPoolGrad_:function(e,t,r,n,a){const i=ki(e,"dy","avgPoolGrad"),o=ki(t,"input","avgPoolGrad");ne(o.rank===i.rank,(()=>`Rank of input (${o.rank}) does not match rank of dy (${i.rank})`));let s=o,l=i,c=!1;3===o.rank&&(c=!0,s=cc(o,[1,o.shape[0],o.shape[1],o.shape[2]]),l=cc(i,[1,i.shape[0],i.shape[1],i.shape[2]])),ne(4===l.rank,(()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),ne(4===s.rank,(()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${s.rank}.`));const u={dy:l,input:s},f={filterSize:r,strides:n,pad:a},p=hi.runKernel(ft,u,f);return c?cc(p,[p.shape[1],p.shape[2],p.shape[3]]):p}}),Gd={kernelName:ut,inputsToSave:["x"],gradFunc:(e,t,r)=>{const[n]=t,{filterSize:a,strides:i,pad:o}=r;return{x:()=>Hd(e,n,a,i,o)}}},Xd={kernelName:dt,inputsToSave:["a","b"],gradFunc:(e,t,r)=>{const[n,a]=t,{transposeA:i,transposeB:o}=r;return i||o?!i&&o?{a:()=>Ho(e,a,!1,!1),b:()=>Ho(e,n,!0,!1)}:i&&!o?{a:()=>Ho(a,e,!1,!0),b:()=>Ho(n,e,!1,!1)}:{a:()=>Ho(a,e,!0,!0),b:()=>Ho(e,n,!0,!0)}:{a:()=>Ho(e,a,!1,!0),b:()=>Ho(n,e,!0,!1)}}},Yd={kernelName:mt,gradFunc:(e,t,r)=>{const{blockShape:n,crops:a}=r;return{x:()=>sf(e,n,a)}}},Zd={kernelName:yt,gradFunc:(e,t,r)=>{const n=r,a=n.inputShape,i=n.shape,o=Array.from(i);for(let e=a.length-1;e>=0;e--)if(a[e]===i[e])o[e]=1;else if(1!==a[e])throw new Error(`broadcastTo(): [${a}] cannot be broadcast to [${i}].`);const s=[];for(let e=0;e<o.length;e++)o[e]>1&&s.push(e);return{x:()=>ku(e,s,!0)}}},Kd={kernelName:bt,gradFunc:e=>({x:()=>e.clone()})},Jd={kernelName:xt,gradFunc:e=>({x:()=>dl(e)})},Qd={kernelName:_t,inputsToSave:["x"],gradFunc:(e,t,r)=>{const[n]=t,{clipValueMin:a,clipValueMax:i}=r;return{x:()=>Gc(Pu(su(n,a),du(n,i)),e,dl(e))}}},em={kernelName:kt,inputsToSave:["x"],gradFunc:Od.gradFunc},tm={kernelName:Dt,saveAllInputs:!0,gradFunc:(e,t,r)=>{const n=t.map((e=>e.shape)),{axis:a}=r,i=ye(a,t[0].shape)[0],o=n.map((e=>e[i]));return Wf(e,o,i).map((e=>()=>e))}},rm={kernelName:Tt,inputsToSave:["x","filter"],gradFunc:(e,t,r)=>{const[n,a]=t,{dilations:i,strides:o,pad:s,dataFormat:l}=r;return ne(ic(i),(()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`)),{x:()=>Ic(n.shape,e,a,o,s,l),filter:()=>kp(n,e,a.shape,o,s,l)}}},nm={kernelName:St,inputsToSave:["dy","filter"],gradFunc:(e,t,r)=>{const[n,a]=t,{strides:i,pad:o,dataFormat:s,dimRoundingMode:l}=r;return{dy:()=>Nc(e,a,i,o,s,1,l),filter:()=>kp(e,n,a.shape,i,o,s,l)}}},am=Ai({conv3DBackpropFilter_:function(e,t,r,n,a){let i=e;4===e.rank&&(i=cc(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let o=t;4===o.rank&&(o=cc(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),ne(5===i.rank,(()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${i.shape}.`)),ne(5===o.rank,(()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${o.shape}.`)),ne(5===r.length,(()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${r}.`)),ne(i.shape[4]===r[3],(()=>`Error in conv3dDerFilter: depth of input ${i.shape[4]}) must match input depth in filter (${r[3]}.`)),ne(o.shape[4]===r[4],(()=>`Error in conv3dDerFilter: depth of dy (${o.shape[4]}) must match output depth for filter (${r[4]}).`));const s={x:i,dy:o},l={strides:n,pad:a,filterShape:r};return hi.runKernel(Et,s,l)}}),im={kernelName:Mt,inputsToSave:["x","filter"],gradFunc:(e,t,r)=>{const{dilations:n,strides:a,pad:i}=r;ne(ic(n),(()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${n}'`));const[o,s]=t;return{x:()=>Lc(o.shape,e,s,a,i),filter:()=>am(o,e,s.shape,a,i)}}},om={kernelName:Nt,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(bu(Rf(Ao(r,"float32"))),e)}}},sm={kernelName:Ot,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(Lf(Ao(r,"float32")),e)}}},lm={kernelName:It,inputsToSave:["x"],gradFunc:(e,t,r)=>{const[n]=t,{axis:a,exclusive:i,reverse:o}=r;return{x:()=>{const t=Cu([a],n.rank);let r=jc(e,a,i,!o);return null!=t&&(r=Xo(r,t)),r}}}},cm={kernelName:Ft,inputsToSave:["x","filter"],gradFunc:(e,t,r)=>{const{dilations:n,strides:a,pad:i,dimRoundingMode:o}=r,s=null==n?[1,1]:n;ne(ic(s),(()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`));const[l,c]=t;return ne(4===l.rank,(()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`)),ne(4===c.rank,(()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${c.rank}.`)),ne(l.shape[3]===c.shape[2],(()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`)),ne(oc(a,s),(()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be  1. Got strides ${a} and dilations '${s}'.`)),lc("depthwiseConv2d",i,o),{x:()=>Cp(l.shape,e,c,a,i,s,o),filter:()=>Ep(l,e,c.shape,a,i,s,o)}}},um={kernelName:Ut,inputsToSave:["x","filter"],gradFunc:(e,t,r)=>{const[n,a]=t,i={x:n,filter:a,dy:e},o={x:n,filter:a,dy:e};return{x:()=>hi.runKernel($t,i,r),filter:()=>hi.runKernel(Vt,o,r)}}},fm={kernelName:Ht,outputsToSave:[!0],gradFunc:(e,t)=>{const[r]=t,n={dy:e,y:r};return{x:()=>hi.runKernel(Gt,n)}}},pm={kernelName:Xt,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t,n=fl(Qc(bu(hl(r))),2/Math.sqrt(Math.PI));return{x:()=>fl(e,n)}}},hm={kernelName:Zt,outputsToSave:[!0],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(e,r)}}},dm={kernelName:Kt,inputsToSave:["input"],gradFunc:(e,t)=>{const[r]=t;return{input:()=>cc(e,r.shape)}}},mm={kernelName:Jt,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(e,Qc(r))}}},gm={kernelName:rr,gradFunc:e=>({x:()=>dl(e)})},ym={kernelName:nr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[r,n]=t,a=Jo(r.shape,n.shape);return{a:()=>{const t=ul(e,Ao(n,"float32")),i=Ko(r.shape,a);return i.length>0?cc(ku(t,i),r.shape):t},b:()=>{let t=fl(e,Ao(r,"float32"));const i=Ko(n.shape,a);i.length>0&&(t=cc(ku(t,i),n.shape));const o=hl(n);return bu(ul(t,Ao(o,"float32")))}}}},vm={kernelName:ar,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,r)=>{const{varianceEpsilon:n}=r,[a,i,o,s]=t,l=null==s?wl(1):s,c=Ko(i.shape,a.shape),u=[];if(1===i.rank){for(let e=0;e<a.shape.length-1;++e)u.push(a.shape[e]);u.push(1)}const f=Ml(a,i),p=fl(e,l),h=Cf(ll(o,wl(n))),d=fl(fl(fl(h,h),h),wl(-.5));return{x:()=>1===i.rank?cc(fl(fl(e,ru(cc(h,[1,1,1,i.shape[0]]),u)),l),a.shape):cc(fl(fl(e,h),l),a.shape),mean:()=>{let e=fl(fl(h,wl(-1)),p);return 1===i.rank&&(e=ku(e,c)),cc(e,i.shape)},variance:()=>{let e=fl(fl(d,f),p);return 1===i.rank&&(e=ku(e,c)),cc(e,i.shape)},scale:()=>{const t=fl(f,h);let r=fl(e,t);return 1===i.rank&&(r=ku(r,c)),cc(r,i.shape)},offset:()=>{let t=e;return 1===i.rank&&(t=ku(t,c)),cc(t,i.shape)}}}},bm={kernelName:ir,inputsToSave:["x","indices"],gradFunc:(e,t,r)=>{const[n,a]=t,{axis:i}=r,o=ye(i,n.shape)[0];return{x:()=>{const t=n.shape,r=a.size,s=t.slice(0,o),l=s.length,c=t.slice(i,t.length).slice(1),u=c.length,f=xm(0,l),p=xm(l+1,l+1+u),h=_m([s,[r],c]),d=cc(e,h),m=cc(a,[r]),g=_m([[l],f,p]),y=Xo(d,g);let v=sp(y,m,n.shape[o]);const b=Nu(g);return v=Xo(v,b),v},indices:()=>a}}};function xm(e,t){const r=[];for(let n=e;n<t;++n)r.push(n);return r}function _m(e){const t=[];for(let r=0;r<e.length;++r)for(let n=0;n<e[r].length;++n)t.push(e[r][n]);return t}const wm={kernelName:lr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[r,n]=t;return{a:()=>dl(r),b:()=>dl(n)}}},km={kernelName:cr,gradFunc:e=>({x:()=>Ao(e,"float32")})},Dm={kernelName:pr,gradFunc:e=>({x:()=>dl(e)})},Tm={kernelName:hr,gradFunc:e=>({x:()=>dl(e)})},Am={kernelName:dr,gradFunc:e=>({x:()=>dl(e)})},Sm={kernelName:mr,inputsToSave:["x"],gradFunc:(e,t,r)=>{const[n]=t,{alpha:a}=r,i=ou(n,0);return{x:()=>Gc(i,e,fl(e,a))}}},Mm={kernelName:xr,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>ul(e,ll(r,1))}}},Em={kernelName:br,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>ul(e,Ao(r,"float32"))}}},Cm={kernelName:Dr,inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,r)=>{const[n]=t,{axis:a}=r;return{logits:()=>{const t=Qc(n);return Ml(e,fl(ku(e,a,!0),t))}}}},Nm=Ai({localResponseNormalizationBackprop_:function(e,t,r,n=5,a=1,i=1,o=.5){const s={x:e,y:t,dy:r},l={depthRadius:n,bias:a,alpha:i,beta:o};return hi.runKernel(Ar,s,l)}}),Om={kernelName:Tr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,r)=>{const[n,a]=t,{depthRadius:i,bias:o,alpha:s,beta:l}=r;return{x:()=>Nm(n,a,e,i,o,s,l)}}};function Im(e,t,r,n){return t.rank<r.rank&&(t=cc(t,Mu(t.shape,n))),e.rank<r.rank&&(e=cc(e,Mu(e.shape,n))),{x:()=>fl(e,Ao(Hc(r,t),e.dtype))}}const Pm={kernelName:Sr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,r)=>{const n=r,{reductionIndices:a}=n,i=t[0],o=Im(e,t[1],i,ye(a,i.shape));return{x:()=>o.x()}}},Rm={kernelName:Mr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[r,n]=t;return{a:()=>fl(e,Ao(su(r,n),"float32")),b:()=>fl(e,Ao(hu(r,n),"float32"))}}},Lm=Ai({maxPool3dGrad_:function(e,t,r,n,a,i,o){const s=ki(e,"dy","maxPool3dGrad"),l=ki(t,"input","maxPool3dGrad"),c=ki(r,"output","maxPool3dGrad");let u=s,f=l,p=c,h=!1;4===l.rank&&(h=!0,u=cc(s,[1,s.shape[0],s.shape[1],s.shape[2],s.shape[3]]),f=cc(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),p=cc(c,[1,c.shape[0],c.shape[1],c.shape[2],c.shape[3]])),ne(5===u.rank,(()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${u.rank}.`)),ne(5===f.rank,(()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${f.rank}.`)),ne(5===p.rank,(()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${p.rank}.`)),lc("maxPool3dGrad",i,o);const d={dy:u,input:f,output:p},m={filterSize:n,strides:a,pad:i,dimRoundingMode:o},g=hi.runKernel(Or,d,m);return h?cc(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),Fm={kernelName:Nr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,r)=>{const[n,a]=t,{filterSize:i,strides:o,pad:s,dimRoundingMode:l}=r;return{x:()=>Lm(e,n,a,i,o,s,l)}}},Bm=Ai({maxPoolGrad_:function(e,t,r,n,a,i,o){const s=ki(e,"dy","maxPoolGrad"),l=ki(t,"input","maxPoolGrad"),c=ki(r,"output","maxPoolGrad");ne(l.rank===s.rank,(()=>`Rank of input (${l.rank}) does not match rank of dy (${s.rank})`)),ne(4===s.rank,(()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${s.rank}.`)),ne(4===l.rank,(()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`)),lc("maxPoolGrad",i,o);const u={dy:s,input:l,output:c},f={filterSize:n,strides:a,pad:i,dimRoundingMode:o};return hi.runKernel(Cr,u,f)}}),zm={kernelName:Er,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,r)=>{const[n,a]=t,{filterSize:i,strides:o,pad:s}=r;return{x:()=>Bm(e,n,a,i,o,s)}}},jm={kernelName:Fr,inputsToSave:["x"],gradFunc:(e,t,r)=>{const n=t[0],{paddings:a}=r,i=a.map((e=>e[0]));return{x:()=>dc(e,i,n.shape)}}},Um={kernelName:Yr,inputsToSave:["x"],gradFunc:(e,t,r)=>{const n=t[0],{paddings:a}=r,i=a.map((e=>e[0]));return{x:()=>dc(e,i,n.shape)}}},$m={kernelName:Kr,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[r,n,a]=t,i=r,o=n,s=Jo(i.shape,o.shape);return{a:()=>{const t=Ao(o,"float32");let r=fl(e,fl(t,Sl(i,Ml(t,wl(1)))));const n=Ko(i.shape,s);return n.length>0&&(r=ku(r,n)),cc(r,i.shape)},b:()=>{const t=ou(i,0),r=Gc(t,yu(i),dl(i));let n=fl(e,fl(a,r));const l=Ko(o.shape,s);return l.length>0&&(n=ku(n,l)),cc(n,o.shape)}}}},Vm={kernelName:gn,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>{const t=ou(r,wl(0)),n=wl(Wh),a=wl(Hh),i=fl(e,a),o=fl(fl(e,n),Qc(Ao(r,"float32")));return Gc(t,i,o)}}}},qm={kernelName:Tn,gradFunc:(e,t,r)=>{const{blockShape:n,paddings:a}=r;return{x:()=>yc(e,n,a)}}},Wm={kernelName:An,gradFunc:(e,t,r)=>{const{axis:n}=r;return{x:()=>pc(e,n)}}},Hm=[Od,Id,Pd,Rd,Ld,Fd,Bd,zd,jd,Ud,$d,Vd,Wd,Gd,Xd,Yd,Zd,Kd,Jd,Qd,em,tm,nm,rm,im,om,sm,lm,cm,um,{kernelName:qt,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[r,n]=t,a=Jo(r.shape,n.shape);return{a:()=>{const t=ul(e,Ao(n,"float32")),i=Ko(r.shape,a);return i.length>0?cc(ku(t,i),r.shape):t},b:()=>{let t=fl(e,Ao(r,"float32"));const i=Ko(n.shape,a);i.length>0&&(t=cc(ku(t,i),n.shape));const o=hl(n);return bu(ul(t,Ao(o,"float32")))}}}},fm,pm,hm,dm,mm,ym,gm,vm,bm,wm,km,Dm,Tm,Am,Sm,Mm,Em,Cm,Om,Pm,Pm,Rm,Fm,zm,{kernelName:Pr,inputsToSave:["x"],gradFunc:(e,t,r)=>{const[n]=t,{axis:a}=r,i=ye(a,n.shape),o=se(Su(n.shape,i)[1]);return{x:()=>{const t=n.shape.slice();i.forEach((e=>{t[e]=1}));const r=cc(e,t);return ul(fl(r,Vu(n.shape,"float32")),o)}}}},{kernelName:Rr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,r)=>{const n=r,{axis:a}=n,[i,o]=t,s=Im(e,o,i,ye(a,i.shape));return{x:()=>s.x()}}},{kernelName:Lr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[r,n]=t;return{a:()=>fl(e,Ao(du(r,n),"float32")),b:()=>fl(e,Ao(ou(r,n),"float32"))}}},jm,{kernelName:Br,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[r,n]=t,a=Jo(r.shape,n.shape);return{a:()=>{const t=Ko(r.shape,a);return t.length>0?cc(ku(e,t),r.shape):e},b:()=>{const t=fl(e,bu(au(ul(r,n)))),i=Ko(n.shape,a);return i.length>0?cc(ku(t,i),n.shape):t}}}},{kernelName:jr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[r,n]=t,a=Jo(r.shape,n.shape);return{a:()=>{const t=fl(e,Ao(n,"float32")),i=Ko(r.shape,a);return i.length>0?cc(ku(t,i),r.shape):t},b:()=>{const t=fl(e,Ao(r,"float32")),i=Ko(n.shape,a);return i.length>0?cc(ku(t,i),n.shape):t}}}},{kernelName:Ur,gradFunc:e=>({x:()=>bu(e)})},{kernelName:Gr,inputsToSave:["indices"],gradFunc:(e,t)=>{const r=t[0];return{indices:()=>$u(r.shape,"float32")}}},{kernelName:Hr,gradFunc:e=>({x:()=>dl(e)})},{kernelName:Xr,saveAllInputs:!0,gradFunc:(e,t,r)=>{const{axis:n}=r;return lp(e,n).map((e=>()=>e))}},Um,Um,$m,{kernelName:Jr,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[r,n]=t,a=ou(r,0);return{x:()=>Gc(a,e,fl(e,n)),alpha:()=>{let t=Gc(a,dl(e),fl(e,r));const i=Ko(n.shape,e.shape);return i.length>0&&(t=ku(t,i)),cc(t,n.shape)}}}},{kernelName:rn,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>ul(e,bu(hl(r)))}}},{kernelName:un,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t,n=fl(du(r,6),Zf(r));return{x:()=>fl(e,Ao(n,"float32"))}}},{kernelName:nn,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(e,Ao(Zf(r),"float32"))}}},{kernelName:an,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>cc(e,r.shape)}}},{kernelName:ln,inputsToSave:["images"],gradFunc:(e,t,r)=>{const[n]=t,a={dy:e,images:n};return{images:()=>hi.runKernel(cn,a,r)}}},{kernelName:on,inputsToSave:["images"],gradFunc:(e,t,r)=>{const[n]=t,a={dy:e,images:n};return{images:()=>hi.runKernel(sn,a,r)}}},{kernelName:fn,gradFunc:(e,t,r)=>{const{dims:n}=r,a=ye(n,e.shape);return{x:()=>Df(e,a)}}},{kernelName:pn,gradFunc:e=>({x:()=>dl(e)})},{kernelName:hn,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>bu(ul(e,fl(Sl(r,1.5),2)))}}},{kernelName:mn,inputsToSave:["condition"],gradFunc:(e,t)=>{const[r]=t;return{condition:()=>Ao(dl(r),"float32"),t:()=>fl(e,Ao(r,e.dtype)),e:()=>fl(e,Ao(Ru(r),e.dtype))}}},Vm,{kernelName:_n,outputsToSave:[!0],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(e,fl(r,Ml(wl(1),r)))}}},{kernelName:xn,gradFunc:e=>({x:()=>dl(e)})},{kernelName:vn,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(Bc(Ao(r,"float32")),e)}}},{kernelName:bn,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(zc(Ao(r,"float32")),e)}}},{kernelName:yn,inputsToSave:["x"],gradFunc:(e,t,r)=>{const[n]=t,{begin:a,size:i}=r,o=n.shape,[s,l]=ks(n,a,i),c=[];for(let t=0;t<e.rank;t++)c.push([s[t],o[t]-s[t]-l[t]]);return{x:()=>tf(e,c)}}},{kernelName:Sn,outputsToSave:[!0],gradFunc:(e,t,r)=>{const[n]=t,{dim:a}=r,i=fl(e,n);return{logits:()=>Ml(i,fl(ku(i,[a],!0),n))}}},{kernelName:wn,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(e,hc(r))}}},qm,qm,Wm,Wm,{kernelName:kn,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>ul(e,fl(pl(Ao(r,"float32")),2))}}},{kernelName:In,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[r,n]=t,a=wl(2);return{a:()=>fl(e,fl(a,Ml(r,n))),b:()=>fl(e,fl(a,Ml(n,r)))}}},{kernelName:Pn,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(e,fl(Ao(r,"float32"),2))}}},{kernelName:Zn,gradFunc:e=>({x:()=>dl(e)})},{kernelName:zn,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[r,n]=t,a=Jo(r.shape,n.shape);return{a:()=>{let t=e;const n=Ko(r.shape,a);return n.length>0&&(t=ku(t,n)),cc(t,r.shape)},b:()=>{let t=e;const r=Ko(n.shape,a);return r.length>0&&(t=ku(t,r)),cc(bu(t),n.shape)}}}},{kernelName:Dn,inputsToSave:["x"],gradFunc:(e,t,r)=>{const[n]=t,a=n.shape.slice(),{axis:i}=r;ye(i,n.shape).forEach((e=>{a[e]=1}));const o=cc(e,a),s=fl(o,Vu(n.shape,"float32"));return{x:()=>s}}},{kernelName:jn,inputsToSave:["x"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>ul(e,hl(Bc(r)))}}},{kernelName:Un,outputsToSave:[!0],gradFunc:(e,t)=>{const[r]=t;return{x:()=>fl(Ml(wl(1),hl(r)),e)}}},{kernelName:$n,inputsToSave:["x"],gradFunc:(e,t,r)=>{const[n]=t,{reps:a}=r;return{x:()=>{let t=dl(n);if(1===n.rank)for(let r=0;r<a[0];++r)t=ll(t,dc(e,[r*n.shape[0]],[n.shape[0]]));else if(2===n.rank)for(let r=0;r<a[0];++r)for(let i=0;i<a[1];++i)t=ll(t,dc(e,[r*n.shape[0],i*n.shape[1]],[n.shape[0],n.shape[1]]));else if(3===n.rank)for(let r=0;r<a[0];++r)for(let i=0;i<a[1];++i)for(let o=0;o<a[2];++o)t=ll(t,dc(e,[r*n.shape[0],i*n.shape[1],o*n.shape[2]],[n.shape[0],n.shape[1],n.shape[2]]));else{if(4!==n.rank)throw new Error(`Gradient for tile operation is not implemented for rank-${n.rank} tensors yet.`);for(let r=0;r<a[0];++r)for(let i=0;i<a[1];++i)for(let o=0;o<a[2];++o)for(let s=0;s<a[3];++s)t=ll(t,dc(e,[r*n.shape[0],i*n.shape[1],o*n.shape[2],s*n.shape[3]],[n.shape[0],n.shape[1],n.shape[2],n.shape[3]]))}return t}}}},{kernelName:Wn,gradFunc:(e,t,r)=>{const n=r,{perm:a}=n,i=Nu(a);return{x:()=>Xo(e,i)}}},{kernelName:Gn,gradFunc:(e,t,r)=>{const n=r,{axis:a}=n;return{value:()=>Yf(e,a)}}},{kernelName:Xn,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{const[r]=t;return{x:()=>function(e,t){const r=Nl(t,dl(t)),n=iu(e,r);let a=su(t,wl(0,"int32"));const i=n.rank-a.rank;for(let e=0;e<i;++e)a=eu(a,e+1);a=Pu(a,Vu(n.shape,"bool"));const o=dl(n);return Gc(a,n,o)}(e,r)}}},{kernelName:Yn,gradFunc:e=>({x:()=>dl(e)})}];for(const e of Hm)ua(e);let Gm;function Xm(){return null==Gm&&(Gm=ol().epsilon()),Gm}Xa().prototype.abs=function(){return this.throwIfDisposed(),Cl(this)},Xa().prototype.acos=function(){return this.throwIfDisposed(),Fl(this)},Xa().prototype.acosh=function(){return this.throwIfDisposed(),Bl(this)},Xa().prototype.add=function(e){return this.throwIfDisposed(),ll(this,e)},Xa().prototype.all=function(e,t){return this.throwIfDisposed(),jl(this,e,t)},Xa().prototype.any=function(e,t){return this.throwIfDisposed(),Ul(this,e,t)},Xa().prototype.argMax=function(e){return this.throwIfDisposed(),$l(this,e)},Xa().prototype.argMin=function(e){return this.throwIfDisposed(),Vl(this,e)},Xa().prototype.asScalar=function(){return this.throwIfDisposed(),ne(1===this.size,(()=>"The array must have only 1 element.")),cc(this,[])},Xa().prototype.asType=function(e){return this.throwIfDisposed(),Ao(this,e)},Xa().prototype.as1D=function(){return this.throwIfDisposed(),cc(this,[this.size])},Xa().prototype.as2D=function(e,t){return this.throwIfDisposed(),cc(this,[e,t])},Xa().prototype.as3D=function(e,t,r){return this.throwIfDisposed(),cc(this,[e,t,r])},Xa().prototype.as4D=function(e,t,r,n){return this.throwIfDisposed(),cc(this,[e,t,r,n])},Xa().prototype.as5D=function(e,t,r,n,a){return this.throwIfDisposed(),cc(this,[e,t,r,n,a])},Xa().prototype.asin=function(){return this.throwIfDisposed(),ql(this)},Xa().prototype.asinh=function(){return this.throwIfDisposed(),Wl(this)},Xa().prototype.atan=function(){return this.throwIfDisposed(),Hl(this)},Xa().prototype.atan2=function(e){return this.throwIfDisposed(),Gl(this,e)},Xa().prototype.atanh=function(){return this.throwIfDisposed(),Xl(this)},Xa().prototype.avgPool=function(e,t,r,n){return this.throwIfDisposed(),uc(this,e,t,r,n)},Xa().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),yc(this,e,t)},Xa().prototype.batchNorm=function(e,t,r,n,a){return this.throwIfDisposed(),vc(this,e,t,r,n,a)},Xa().prototype.broadcastTo=function(e){return this.throwIfDisposed(),Dc(this,e)},Xa().prototype.cast=function(e){return this.throwIfDisposed(),Ao(this,e)},Xa().prototype.ceil=function(){return this.throwIfDisposed(),Tc(this)},Xa().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),Ac(this,e,t)},Xa().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Ga&&(e=[e]),pc([this,...e],t)},Xa().prototype.conv1d=function(e,t,r,n,a,i){return this.throwIfDisposed(),Oc(this,e,t,r,n,a,i)},Xa().prototype.conv2dTranspose=function(e,t,r,n,a){return this.throwIfDisposed(),Pc(this,e,t,r,n,a)},Xa().prototype.conv2d=function(e,t,r,n,a,i){return this.throwIfDisposed(),Nc(this,e,t,r,n,a,i)},Xa().prototype.cos=function(){return this.throwIfDisposed(),Bc(this)},Xa().prototype.cosh=function(){return this.throwIfDisposed(),zc(this)},Xa().prototype.cumsum=function(e,t,r){return this.throwIfDisposed(),jc(this,e,t,r)},Xa().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),$c(this,e,t)},Xa().prototype.depthwiseConv2d=function(e,t,r,n,a,i){return this.throwIfDisposed(),Vc(this,e,t,r,n,a,i)},Xa().prototype.dilation2d=function(e,t,r,n,a){return this.throwIfDisposed(),Wc(this,e,t,r,n,a)},Xa().prototype.divNoNan=function(e){return this.throwIfDisposed(),Xc(this,e)},Xa().prototype.div=function(e){return this.throwIfDisposed(),ul(this,e)},Xa().prototype.dot=function(e){return this.throwIfDisposed(),Yc(this,e)},Xa().prototype.elu=function(){return this.throwIfDisposed(),Kc(this)},Xa().prototype.equal=function(e){return this.throwIfDisposed(),Hc(this,e)},Xa().prototype.erf=function(){return this.throwIfDisposed(),Jc(this)},Xa().prototype.exp=function(){return this.throwIfDisposed(),Qc(this)},Xa().prototype.expandDims=function(e){return this.throwIfDisposed(),eu(this,e)},Xa().prototype.expm1=function(){return this.throwIfDisposed(),tu(this)},Xa().prototype.fft=function(){return this.throwIfDisposed(),$f(this)},Xa().prototype.flatten=function(){return this.throwIfDisposed(),cc(this,[this.size])},Xa().prototype.floor=function(){return this.throwIfDisposed(),au(this)},Xa().prototype.floorDiv=function(e){return this.throwIfDisposed(),cl(this,e)},Xa().prototype.gather=function(e,t){return this.throwIfDisposed(),iu(this,e,t)},Xa().prototype.greaterEqual=function(e){return this.throwIfDisposed(),su(this,e)},Xa().prototype.greater=function(e){return this.throwIfDisposed(),ou(this,e)},Xa().prototype.ifft=function(){return this.throwIfDisposed(),Vf(this)},Xa().prototype.irfft=function(){return this.throwIfDisposed(),qf(this)},Xa().prototype.isFinite=function(){return this.throwIfDisposed(),cu(this)},Xa().prototype.isInf=function(){return this.throwIfDisposed(),uu(this)},Xa().prototype.isNaN=function(){return this.throwIfDisposed(),fu(this)},Xa().prototype.leakyRelu=function(e){return this.throwIfDisposed(),pu(this,e)},Xa().prototype.lessEqual=function(e){return this.throwIfDisposed(),du(this,e)},Xa().prototype.less=function(e){return this.throwIfDisposed(),hu(this,e)},Xa().prototype.localResponseNormalization=function(e,t,r,n){return this.throwIfDisposed(),gu(this,e,t,r,n)},Xa().prototype.logSigmoid=function(){return this.throwIfDisposed(),_u(this)},Xa().prototype.logSoftmax=function(e){return this.throwIfDisposed(),Du(this,e)},Xa().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),Iu(this,e,t)},Xa().prototype.log=function(){return this.throwIfDisposed(),yu(this)},Xa().prototype.log1p=function(){return this.throwIfDisposed(),vu(this)},Xa().prototype.logicalAnd=function(e){return this.throwIfDisposed(),Pu(this,e)},Xa().prototype.logicalNot=function(){return this.throwIfDisposed(),Ru(this)},Xa().prototype.logicalOr=function(e){return this.throwIfDisposed(),Lu(this,e)},Xa().prototype.logicalXor=function(e){return this.throwIfDisposed(),Fu(this,e)},Xa().prototype.matMul=function(e,t,r){return this.throwIfDisposed(),Ho(this,e,t,r)},Xa().prototype.maxPool=function(e,t,r,n){return this.throwIfDisposed(),Bu(this,e,t,r,n)},Xa().prototype.max=function(e,t){return this.throwIfDisposed(),wu(this,e,t)},Xa().prototype.maximum=function(e){return this.throwIfDisposed(),Nl(this,e)},Xa().prototype.mean=function(e,t){return this.throwIfDisposed(),Uu(this,e,t)},Xa().prototype.min=function(e,t){return this.throwIfDisposed(),Wu(this,e,t)},Xa().prototype.minimum=function(e){return this.throwIfDisposed(),Hu(this,e)},Xa().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),Gu(this,e,t)},Xa().prototype.mod=function(e){return this.throwIfDisposed(),Xu(this,e)},Xa().prototype.mul=function(e){return this.throwIfDisposed(),fl(this,e)},Xa().prototype.neg=function(){return this.throwIfDisposed(),bu(this)},Xa().prototype.norm=function(e,t,r){return this.throwIfDisposed(),dp(this,e,t,r)},Xa().prototype.notEqual=function(e){return this.throwIfDisposed(),Ju(this,e)},Xa().prototype.oneHot=function(e,t=1,r=0){return this.throwIfDisposed(),Go(this,e,t,r)},Xa().prototype.onesLike=function(){return this.throwIfDisposed(),Qu(this)},Xa().prototype.pad=function(e,t){return this.throwIfDisposed(),tf(this,e,t)},Xa().prototype.pool=function(e,t,r,n,a,i){return this.throwIfDisposed(),lf(this,e,t,r,n,a,i)},Xa().prototype.pow=function(e){return this.throwIfDisposed(),Sl(this,e)},Xa().prototype.prelu=function(e){return this.throwIfDisposed(),cf(this,e)},Xa().prototype.prod=function(e,t){return this.throwIfDisposed(),uf(this,e,t)},Xa().prototype.reciprocal=function(){return this.throwIfDisposed(),_f(this)},Xa().prototype.relu=function(){return this.throwIfDisposed(),wf(this)},Xa().prototype.relu6=function(){return this.throwIfDisposed(),kf(this)},Xa().prototype.reshapeAs=function(e){return this.throwIfDisposed(),cc(this,e.shape)},Xa().prototype.reshape=function(e){return this.throwIfDisposed(),cc(this,e)},Xa().prototype.resizeBilinear=function(e,t,r){return this.throwIfDisposed(),eh(this,e,t,r)},Xa().prototype.resizeNearestNeighbor=function(e,t,r){return this.throwIfDisposed(),th(this,e,t,r)},Xa().prototype.reverse=function(e){return this.throwIfDisposed(),Df(this,e)},Xa().prototype.rfft=function(){return this.throwIfDisposed(),Hf(this)},Xa().prototype.round=function(){return this.throwIfDisposed(),Ef(this)},Xa().prototype.rsqrt=function(){return this.throwIfDisposed(),Cf(this)},Xa().prototype.selu=function(){return this.throwIfDisposed(),Nf(this)},Xa().prototype.separableConv2d=function(e,t,r,n,a,i){return this.throwIfDisposed(),Of(this,e,t,r,n,a,i)},Xa().prototype.sigmoid=function(){return this.throwIfDisposed(),hc(this)},Xa().prototype.sign=function(){return this.throwIfDisposed(),Pf(this)},Xa().prototype.sin=function(){return this.throwIfDisposed(),Rf(this)},Xa().prototype.sinh=function(){return this.throwIfDisposed(),Lf(this)},Xa().prototype.slice=function(e,t){return this.throwIfDisposed(),dc(this,e,t)},Xa().prototype.softmax=function(e){return this.throwIfDisposed(),Uf(this,e)},Xa().prototype.softplus=function(){return this.throwIfDisposed(),xu(this)},Xa().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),sf(this,e,t)},Xa().prototype.split=function(e,t){return this.throwIfDisposed(),Wf(this,e,t)},Xa().prototype.sqrt=function(){return this.throwIfDisposed(),pl(this)},Xa().prototype.square=function(){return this.throwIfDisposed(),hl(this)},Xa().prototype.squaredDifference=function(e){return this.throwIfDisposed(),Gf(this,e)},Xa().prototype.squeeze=function(e){return this.throwIfDisposed(),Xf(this,e)},Xa().prototype.stack=function(e,t){this.throwIfDisposed();const r=e instanceof Ga?[this,e]:[this,...e];return Yf(r,t)},Xa().prototype.step=function(e){return this.throwIfDisposed(),Zf(this,e)},Xa().prototype.stridedSlice=function(e,t,r,n,a,i,o,s){return this.throwIfDisposed(),Kf(this,e,t,r,n,a,i,o,s)},Xa().prototype.sub=function(e){return this.throwIfDisposed(),Ml(this,e)},Xa().prototype.sum=function(e,t){return this.throwIfDisposed(),ku(this,e,t)},Xa().prototype.tan=function(){return this.throwIfDisposed(),Jf(this)},Xa().prototype.tanh=function(){return this.throwIfDisposed(),mc(this)},Xa().prototype.tile=function(e){return this.throwIfDisposed(),ru(this,e)},Xa().prototype.toBool=function(){return this.throwIfDisposed(),Ao(this,"bool")},Xa().prototype.toFloat=function(){return this.throwIfDisposed(),Ao(this,"float32")},Xa().prototype.toInt=function(){return this.throwIfDisposed(),Ao(this,"int32")},Xa().prototype.topk=function(e,t){return this.throwIfDisposed(),ap(this,e,t)},Xa().prototype.transpose=function(e){return this.throwIfDisposed(),Xo(this,e)},Xa().prototype.unique=function(e){return this.throwIfDisposed(),op(this,e)},Xa().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),sp(this,e,t)},Xa().prototype.unstack=function(e){return this.throwIfDisposed(),lp(this,e)},Xa().prototype.where=function(e,t){return this.throwIfDisposed(),Gc(e,this,t)},Xa().prototype.zerosLike=function(){return this.throwIfDisposed(),dl(this)};class Ym extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Ym.prototype)}}class Zm extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Zm.prototype)}}class Km extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Km.prototype)}}class Jm extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Jm.prototype)}}class Qm extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Qm.prototype)}}function eg(e,t){if(Array.isArray(e)){let r=[];for(let n=0;n<t;n++)r=r.concat(e);return r}{const r=new Array(t);return r.fill(e),r}}function tg(e,t){if(!e)throw new Qm(t)}function rg(e,t){let r=0;for(const n of e)n===t&&r++;return r}function ng(e){return 1===e.length?e[0]:e}function ag(e){return Array.isArray(e)?e:[e]}function ig(e){const t=e.replace(/(.)([A-Z][a-z0-9]+)/g,"$1_$2").replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase();return"_"!==t[0]?t:"private"+t}function og(e){return e.length<=1||-1===e.indexOf("_")?e:e.replace(/[_]+(\w|$)/g,((e,t)=>t.toUpperCase()))}Error;let sg={};function lg(e){if(null==e)return null;const t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function cg(e){if(null!=e&&"object"==typeof e)if(Array.isArray(e))e.forEach((e=>cg(e)));else{const t=Object.keys(e);for(const r of t){const t=e[r];null!=t&&"object"==typeof t&&(Array.isArray(t)||"ndarray"!==t.type||"number"!=typeof t.value?cg(t):e[r]=t.value)}}}function ug(e,t={},r={},n="object",a=!1){if("string"==typeof e){const a=e;let i;if(a in r)i=r[a];else if(a in sg)i=sg[a];else if(i=t[a],null==i)throw new Km(`Unknown ${n}: ${e}. This may be due to one of the following reasons:\n1. The ${n} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${n} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return i}{const i=e;if(null==i.className||null==i.config)throw new Km(`${n}: Improper config format: ${JSON.stringify(i)}.\n'className' and 'config' must set.`);const o=i.className;let s,l;if(o in r?[s,l]=r[o]:o in sg?[s,l]=sg.className:o in t&&([s,l]=t[o]),null==s)throw new Km(`Unknown ${n}: ${o}. This may be due to one of the following reasons:\n1. The ${n} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${n} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(null!=l){const e={};for(const t of Object.keys(sg))e[t]=sg[t];for(const t of Object.keys(r))e[t]=r[t];i.config.customObjects=e;const t=Object.assign({},sg);for(const e of Object.keys(r))sg[e]=r[e];cg(i.config);const n=l(s,i.config,r,a);return sg=Object.assign({},t),n}{const e=Object.assign({},sg);for(const e of Object.keys(r))sg[e]=r[e];const t=new s(i.config);return sg=Object.assign({},e),t}}}function fg(e,t){return-1*function(e,t){return e<t?-1:e>t?1:0}(e,t)}function pg(e){if(null==e)return e;const t=[];for(const r of e)-1===t.indexOf(r)&&t.push(r);return t}function hg(e){if(null==e)throw new Km(`Invalid value in obj: ${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function dg(e,t,r){if(null!=r&&e.indexOf(r)<0)throw new Km(`${r} is not a valid ${t}.  Valid values are ${e} or null/undefined.`)}function mg(e,t,r=0,n=1/0){return tg(r>=0),tg(n>=r),Array.isArray(e)&&e.length>=r&&e.length<=n&&e.every((e=>typeof e===t))}function gg(e,t){Array.isArray(e)?(ne(e.length>0,(()=>`${t} is unexpectedly an empty array.`)),e.forEach(((e,r)=>gg(e,`element ${r+1} of ${t}`)))):ne(Number.isInteger(e)&&e>0,(()=>`Expected ${t} to be a positive integer, but got ${yg(e)}.`))}function yg(e){return null===e?"null":Array.isArray(e)?"["+e.map((e=>yg(e))).join(",")+"]":"string"==typeof e?`"${e}"`:`${e}`}function vg(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null}function bg(e,t){return Ys((()=>pl(ku(fl(e,e),t,!0))))}class xg extends As{getConfig(){return{}}}class _g extends xg{constructor(e){super(),this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Ys((()=>{const t=bg(e,this.axis),r=Ac(t,0,this.maxValue);return fl(e,ul(r,ll(Xm(),t)))}))}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}_g.className="MaxNorm",Ms(_g);class wg extends xg{constructor(e){super(),this.defaultAxis=0,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Ys((()=>ul(e,ll(Xm(),bg(e,this.axis)))))}getConfig(){return{axis:this.axis}}}wg.className="UnitNorm",Ms(wg);class kg extends xg{apply(e){return wf(e)}}kg.className="NonNeg",Ms(kg);class Dg extends xg{constructor(e){super(),this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=null!=e.minValue?e.minValue:this.defaultMinValue,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.rate=null!=e.rate?e.rate:this.defaultRate,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Ys((()=>{const t=bg(e,this.axis),r=ll(fl(this.rate,Ac(t,this.minValue,this.maxValue)),fl(1-this.rate,t));return fl(e,ul(r,ll(Xm(),t)))}))}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}Dg.className="MinMaxNorm",Ms(Dg);const Tg={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Ag(e){return lg(e)}function Sg(e,t={}){return ug(e,Ss.getMap().classNameMap,t,"constraint")}function Mg(e){return null==e?null:"string"==typeof e?Sg({className:e in Tg?Tg[e]:e,config:{}}):e instanceof xg?e:Sg(e)}function Eg(e){return new _g(e)}function Cg(e){return new wg(e)}function Ng(){return new kg}function Og(e){return new Dg(e)}const Ig=["channelsFirst","channelsLast"],Pg=["nearest","bilinear"],Rg=["valid","same","causal"],Lg=["max","avg"],Fg=["sum","mul","concat","ave"],Bg=new Map;function zg(e){dg(Ig,"DataFormat",e)}function jg(e){dg(Rg,"PaddingMode",e)}function Ug(e){dg(Lg,"PoolMode",e)}const $g=[];function Vg(e,t){$g.push(e);try{const e=t();return $g.pop(),e}catch(e){throw $g.pop(),e}}function qg(e){if(!Gg(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===$g.length?"":$g.join("/")+"/")+e}function Wg(e){if(!Gg(e))throw new Error("Not a valid tensor name: '"+e+"'");Bg.has(e)||Bg.set(e,0);const t=Bg.get(e);if(Bg.set(e,Bg.get(e)+1),t>0){const r=`${e}_${t}`;return Bg.set(r,1),r}return e}const Hg=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Gg(e){return!!e.match(Hg)}function Xg(e,t,r){null==t&&(t=0),null==r&&(r=e.length);let n=1;for(let a=t;a<r;++a)n*=e[a];return n}function Yg(e){if(0===e.length)return Number.NaN;let t=Number.POSITIVE_INFINITY;for(let r=0;r<e.length;r++){const n=e[r];n<t&&(t=n)}return t}function Zg(e){if(0===e.length)return Number.NaN;let t=Number.NEGATIVE_INFINITY;for(let r=0;r<e.length;r++){const n=e[r];n>t&&(t=n)}return t}function Kg(e,t){if(t<e)throw new Km(`end (${t}) < begin (${e}) is forbidden.`);const r=[];for(let n=e;n<t;++n)r.push(n);return r}function Jg(e,t){return Ao(e,t)}function Qg(e,t=-1){const r=e.shape.slice();return t<0&&(t=r.length+t+1),r.splice(t,0,1),cc(e,r)}function ey(e,t,r){return Ys((()=>{switch(e.rank){case 1:return Ff(e,t,r);case 2:return Bf(e,[t,0],[r,e.shape[1]]);case 3:return zf(e,[t,0,0],[r,e.shape[1],e.shape[2]]);case 4:return jf(e,[t,0,0,0],[r,e.shape[1],e.shape[2],e.shape[3]]);case 5:return dc(e,[t,0,0,0,0],[r,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return dc(e,[t,0,0,0,0,0],[r,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new Km(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function ty(e,t,r){return Ys((()=>{switch(e.rank){case 1:return Ff(e,t,r);case 2:return Bf(e,[0,t],[e.shape[0],r]);case 3:return zf(e,[0,0,t],[e.shape[0],e.shape[1],r]);case 4:return jf(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],r]);default:throw new Km(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function ry(e,t,r,n){return Ys((()=>{switch(e.rank){case 1:return Ff(e,t,r);case 2:switch(n){case 1:return ey(e,t,r);case 2:return ty(e,t,r);default:throw new Km(`The axis is not within the rank of the tensor ${n}`)}case 3:switch(n){case 1:return ey(e,t,r);case 2:return zf(e,[0,t,0],[e.shape[0],r,e.shape[2]]);case 3:return ty(e,t,r);default:throw new Km(`The axis is not within the rank of the tensor ${n}`)}case 4:switch(n){case 1:return ey(e,t,r);case 2:return jf(e,[0,t,0,0],[e.shape[0],r,e.shape[2],e.shape[3]]);case 3:return jf(e,[0,0,t,0],[e.shape[0],e.shape[1],r,e.shape[3]]);case 4:return ty(e,t,r);default:throw new Km(`The axis is not within the rank of the tensor ${n}`)}default:throw new Km(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function ny(e,t=-1){let r;return t<0&&(r=e[0].rank,t=0!==r?r:0),t===e[0].rank&&(t=-1),pc(e,t)}function ay(e,t){switch(e.rank){case 1:return Sc([e,t]);case 2:return Mc([e,t],0);case 3:return Ec([e,t],0);case 4:return Cc([e,t],0);default:throw new Km(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function iy(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new Km(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return ru(e,t)}function oy(e,t=0,r=1,n,a){return yf(e,t,r,n,a)}function sy(e,t,r,n){if(e.rank<2||t.rank<2)throw new Jm(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3&&e.shape.slice(-1)[0]!==t.shape.slice(-2)[0])throw new Jm(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and  y shape = ${t.shape}`);if(2===e.rank&&2===t.rank)return Op({a:e,b:t,transposeA:!1,transposeB:!1,bias:n?uy(e.rank,n,"channelsLast"):null,activation:r});{const a=e.shape.slice(),i=a.pop();e=cc(e,[-1,i]);const o=t.shape.slice(),s=o.pop(),l=o.pop(),c=[...o,s],u=Array.from({length:t.rank},((e,r)=>0===r?t.rank-2:r<=t.rank-2?r-1:r));t=cc(Xo(t,u),[l,-1]);const f=[...a,...c];return cc(Op({a:e,b:t,transposeA:!1,transposeB:!1,bias:n?uy(e.rank,n,"channelsLast"):null,activation:r}),f)}}function ly(e,t,r){return Ys((()=>(t=Array.isArray(t)?Qf(t,"int32"):Ao(t,"int32"),iu(e,t,r))))}function cy(e){return fl(e,e)}function uy(e,t,r){const n=t.shape;if(1!==t.rank&&t.rank!==e)throw new Km(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(5===e){if("channelsFirst"===r)return 1===n.length?cc(t,[1,n[0],1,1,1]):cc(t,[1,n[3],n[0],n[1],n[2]]);if("channelsLast"===r)return 1===n.length?cc(t,[1,1,1,1,n[0]]):cc(t,[1].concat(n))}else if(4===e){if("channelsFirst"===r)return 1===n.length?cc(t,[1,n[0],1,1]):cc(t,[1,n[2],n[0],n[1]]);if("channelsLast"===r)return 1===n.length?cc(t,[1,1,1,n[0]]):cc(t,[1].concat(n))}else if(3===e){if("channelsFirst"===r)return 1===n.length?cc(t,[1,n[0],1]):cc(t,[1,n[1],n[0]]);if("channelsLast"===r)return 1===n.length?cc(t,[1,1,n[0]]):cc(t,[1].concat(n))}else if(e<3)return t;throw new Km(`Unsupported input rank by biasAdd: ${t.rank}`)}function fy(e,t,r){return Ys((()=>(null==r&&(r="channelsLast"),zg(r),ll(e,uy(e.rank,t,r)))))}function py(e,t,r,n){return Ys((()=>bp(e,t,r,n)))}function hy(e,t,r=!1){return r?e():t()}const dy=["fanIn","fanOut","fanAvg"],my=["normal","uniform","truncatedNormal"];class gy extends As{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class yy extends gy{apply(e,t){return $u(e,t)}}yy.className="Zeros",Ms(yy);class vy extends gy{apply(e,t){return Vu(e,t)}}vy.className="Ones",Ms(vy);class by extends gy{constructor(e){if(super(),"object"!=typeof e)throw new Km(`Expected argument of type ConstantConfig but got ${e}`);if(void 0===e.value)throw new Km(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return Ys((()=>fl(wl(this.value),Vu(e,t))))}getConfig(){return{value:this.value}}}by.className="Constant",Ms(by);class xy extends gy{constructor(e){super(),this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return vf(e,this.minval,this.maxval,t)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}xy.className="RandomUniform",Ms(xy);class _y extends gy{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new Jm(`randomNormal does not support dType ${t}.`);return oy(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}_y.className="RandomNormal",Ms(_y);class wy extends gy{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new Jm(`truncatedNormal does not support dType ${t}.`);return ip(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}wy.className="TruncatedNormal",Ms(wy);class ky extends gy{constructor(e){super(),this.gain=null!=e.gain?e.gain:1}apply(e,t){return Ys((()=>{if(2!==e.length||e[0]!==e[1])throw new Km("Identity matrix initializer can only be used for 2D square matrices.");return fl(this.gain,nu(e[0]))}))}getConfig(){return{gain:this.gain}}}ky.className="Identity",Ms(ky);class Dy extends gy{constructor(e){if(super(),e.scale<0)throw new Km(`scale must be a positive float. Got: ${e.scale}`);var t;this.scale=null==e.scale?1:e.scale,this.mode=null==e.mode?"fanIn":e.mode,t=this.mode,dg(dy,"FanMode",t),this.distribution=null==e.distribution?"normal":e.distribution,function(e){dg(my,"Distribution",e)}(this.distribution),this.seed=e.seed}apply(e,t){const r=function(e,t="channelsLast"){let r,n;if(zg(t),2===e.length)r=e[0],n=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===t){const t=Xg(e,2);r=e[1]*t,n=e[0]*t}else if("channelsLast"===t){const t=Xg(e,0,e.length-2);r=e[e.length-2]*t,n=e[e.length-1]*t}}else{const t=Xg(e);r=Math.sqrt(t),n=Math.sqrt(t)}return[r,n]}(e),n=r[0],a=r[1];let i=this.scale;if("fanIn"===this.mode?i/=Math.max(1,n):"fanOut"===this.mode?i/=Math.max(1,a):i/=Math.max(1,(n+a)/2),"normal"===this.distribution){const r=Math.sqrt(i);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new Jm(`${this.getClassName()} does not support dType ${t}.`);return ip(e,0,r,t,this.seed)}{const r=Math.sqrt(3*i);return vf(e,-r,r,t)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}Dy.className="VarianceScaling",Ms(Dy);class Ty extends Dy{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return Dy.className}}Ty.className="GlorotUniform",Ms(Ty);class Ay extends Dy{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return Dy.className}}Ay.className="GlorotNormal",Ms(Ay);class Sy extends Dy{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return Dy.className}}Sy.className="HeNormal",Ms(Sy);class My extends Dy{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return Dy.className}}My.className="HeUniform",Ms(My);class Ey extends Dy{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return Dy.className}}Ey.className="LeCunNormal",Ms(Ey);class Cy extends Dy{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return Dy.className}}Cy.className="LeCunNormal",Ms(Cy);class Ny extends gy{constructor(e){if(super(),this.DEFAULT_GAIN=1,this.gain=null==e.gain?this.DEFAULT_GAIN:e.gain,this.seed=e.seed,null!=this.seed)throw new Jm("Random seed is not implemented for Orthogonal Initializer yet.")}apply(e,t){return Ys((()=>{if(e.length<2)throw new Jm("Shape must be at least 2D.");e[0]*e[1]>2e3&&console.warn(`Orthogonal initializer is being called on a matrix with more than 2000 (${e[0]*e[1]}) elements: Slowness may result.`);const t=oy(e[0]>e[1]?[e[1],e[0]]:e,0,1,"float32");let r=Mh.gramSchmidt(t);return e[0]>e[1]&&(r=Xo(r)),fl(this.gain,r)}))}getConfig(){return{gain:this.gain,seed:this.seed}}}Ny.className="Orthogonal",Ms(Ny);const Oy={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function Iy(e,t={}){return ug(e,Ss.getMap().classNameMap,t,"initializer")}function Py(e){return lg(e)}function Ry(e){if("string"==typeof e){const t=e in Oy?Oy[e]:e;if("GlorotNormal"===t)return new Ay;if("GlorotUniform"===t)return new Ty;if("HeNormal"===t)return new Sy;if("HeUniform"===t)return new My;if("LeCunNormal"===t)return new Ey;if("LeCunUniform"===t)return new Cy;{const e={};return e.className=t,e.config={},Iy(e)}}return e instanceof gy?e:Iy(e)}function Ly(){return new yy}function Fy(){return new vy}function By(e){return new by(e)}function zy(e){return new xy(e)}function jy(e){return new _y(e)}function Uy(e){return new wy(e)}function $y(e){return new ky(e)}function Vy(e){return new Dy(e)}function qy(e){return new Ty(e)}function Wy(e){return new Ay(e)}function Hy(e){return new Sy(e)}function Gy(e){return new My(e)}function Xy(e){return new Ey(e)}function Yy(e){return new Cy(e)}function Zy(e){return new Ny(e)}let Ky=0;function Jy(){return Ky++}const Qy={};function ev(e=""){return e in Qy||(Qy[e]=0),Qy[e]+=1,e+Qy[e].toString()}function tv(e){return Array.isArray(e)&&Array.isArray(e[0])}function rv(e){return 0===e.length?[]:Array.isArray(e[0])?e:[e]}function nv(e){let t;if(Array.isArray(e)){if(1!==e.length)throw new Km(`Expected Tensor length to be 1; got ${e.length}`);t=e[0]}else t=e;return t}function av(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(1===e.length)return(e=e)[0];throw new Km(`Expected exactly 1 Shape; got ${e.length}`)}return e}function iv(e){let t=0;for(const r of e)0===r.shape.length?t+=1:t+=r.shape.reduce(((e,t)=>e*t));return t}class ov{constructor(e,t="float32",r="Variable",n=!0,a=null){this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=Jy(),r=null==r?"Variable":r,this.originalName=qg(r),this.name=Wg(this.originalName),this.trainable_=n,this.constraint=a,this.val=cp(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),function(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}(this.val,e),this.val.id!==e.id&&(this.val.assign(e),null!=this.constraint&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}}function sv(e){return e.map((e=>e.read()))}function lv(e){e.forEach((e=>{e[0].write(e[1])}))}class cv{constructor(e){this.dtype=e.dtype,this.shape=e.shape,null!=e.shape?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}}class uv{constructor(e,t,r,n,a,i,o){this.dtype=e,this.shape=t,this.sourceLayer=r,this.inputs=n,this.callArgs=a,this.outputTensorIndex=o,this.id=Jy(),null!=i&&(this.originalName=qg(i),this.name=Wg(this.originalName)),this.rank=t.length}}let fv=0;class pv{constructor(e,t){this.callArgs=t,this.id=fv++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(const t of e.inboundLayers)null!=t&&t.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){const e=[];for(const t of this.inboundLayers)null!=t?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}let hv=0;class dv extends As{constructor(e={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=hv++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){const e=this.getClassName();t=ig(e)+"_"+ev(e)}if(this.name=t,this.trainable_=null==e.trainable||e.trainable,null!=e.inputShape||null!=e.batchInputShape){let t;if(null!=e.batchInputShape)t=e.batchInputShape;else if(null!=e.inputShape){let r=null;null!=e.batchSize&&(r=e.batchSize),t=[r].concat(e.inputShape)}this.batchInputShape=t;let r=e.dtype;null==r&&(r=e.inputDType),null==r&&(r="float32"),this.dtype=r}null!=e.weights?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(0===this.inboundNodes.length)throw new Zm(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new Km(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return ng(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return ng(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new Ym(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(0===this.inboundNodes.length)throw new Ym(`Layer ${this.name} is not connected, no input to return.`);return ng(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new Ym(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new Ym(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return ng(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map((e=>e()))}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach((t=>t.trainable=e)),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter((e=>e.trainable)):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter((e=>!e.trainable)).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){if(e=ag(e),null==this.inputSpec||0===this.inputSpec.length)return;const t=ag(this.inputSpec);if(e.length!==t.length)throw new Km(`Layer ${this.name} expects ${t.length} inputs, but it received ${e.length} input tensors. Input received: ${e}`);for(let r=0;r<e.length;r++){const n=e[r],a=t[r];if(null==a)continue;const i=n.rank;if(null!=a.ndim&&i!==a.ndim)throw new Km(`Input ${r} is incompatible with layer ${this.name}: expected ndim=${a.ndim}, found ndim=${i}`);if(null!=a.maxNDim&&i>a.maxNDim)throw new Km(`Input ${r} is incompatible with layer ${this.name}: expected max_ndim=${a.maxNDim}, found ndim=${i}`);if(null!=a.minNDim&&i<a.minNDim)throw new Km(`Input ${r} is incompatible with layer ${this.name}: expected min_ndim=${a.minNDim}, found ndim=${i}.`);if(null!=a.dtype&&n.dtype!==a.dtype)throw new Km(`Input ${r} is incompatible with layer ${this.name} : expected dtype=${a.dtype}, found dtype=${n.dtype}.`);if(a.axes){const e=n.shape;for(const t in a.axes){const n=Number(t),i=a.axes[t],o=n>=0?e[n]:e[e.length+n];if(null!=i&&-1===[i,null].indexOf(o))throw new Km(`Input ${r} is incompatible with layer ${this.name}: expected axis ${n} of input shape to have value ${i} but got shape ${e}.`)}}if(null!=a.shape)for(let e=0;e<a.shape.length;++e){const t=a.shape[e],i=n.shape[e];if(null!=t&&null!=i&&t!==i)throw new Km(`Input ${r} is incompatible with layer ${this.name}: expected shape=${a.shape}, found shape=${n.shape}.`)}}}call(e,t){return e}invokeCallHook(e,t){null!=this._callHook&&this._callHook(e,t)}setCallHook(e){this._callHook=e}clearCallHook(){this._callHook=null}apply(e,t){t=t||{},this.assertNotDisposed();const r=ag(e);let n=!0;for(const e of r)if(!(e instanceof uv)){n=!1;break}let a=!0;for(const e of r)if(e instanceof uv){a=!1;break}if(n===a)throw new Km("Arguments to apply() must be all SymbolicTensors or all Tensors");return Vg(this.name,(()=>{if(!this.built){this.assertInputCompatibility(e);const t=[];for(const r of ag(e))t.push(r.shape);this.build(ng(t)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),null===this._refCount&&a&&(this._refCount=1)}if(this.assertInputCompatibility(e),a){let n=this.call(e,t);const a=ag(n),i=[];for(let e of a)-1!==r.indexOf(e)&&(e=e.clone()),i.push(e);if(n=ng(i),null!=this.activityRegularizer)throw new Jm("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return n}{const r=function(e){e=ag(e);const t=[];for(const r of e)t.push(r.shape);return ng(t)}(e),n=this.computeOutputShape(r);let a;const i="float32";if(this.warnOnIncompatibleInputShape(Array.isArray(e)?r[0]:r),a=null!=n&&n.length>0&&Array.isArray(n[0])?n.map(((r,n)=>new uv(i,r,this,ag(e),t,this.name,n))):new uv(i,n,this,ag(e),t,this.name),this.addInboundNode(e,a,null,null,r,n,t),this._refCount++,null!=this.activityRegularizer)throw new Jm("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return a}}))}warnOnIncompatibleInputShape(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(e)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let t=!1;this.batchInputShape.forEach(((r,n)=>{null!=r&&null!=e[n]&&e[n]!==r&&(t=!0)})),t&&console.warn(`The shape of the input tensor (${JSON.stringify(e)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new Ym(`The layer ${this.name} has never been called and thus has no defined output shape.`);const e=[];for(const t of this.inboundNodes){const r=JSON.stringify(t.outputShapes);-1===e.indexOf(r)&&e.push(r)}if(1===e.length){const e=this.inboundNodes[0].outputShapes;return Array.isArray(e)&&Array.isArray(e[0])&&1===e.length?e[0]:e}throw new Ym(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new Zm(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return iv(this.weights)}build(e){this.built=!0}getWeights(e=!1){return sv(e?this.trainableWeights:this.weights)}setWeights(e){Ys((()=>{const t=this.weights;if(t.length!==e.length)throw new Km(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(0===t.length)return;const r=[],n=sv(t);for(let a=0;a<n.length;++a){const i=n[a],o=t[a],s=e[a];if(!ce(i.shape,s.shape))throw new Km(`Layer weight shape ${i.shape} not compatible with provided weight shape ${s.shape}`);r.push([o,s])}lv(r)}))}addWeight(e,t,r,n,a,i,o,s){if(-1!==this._addedWeightNames.indexOf(e))throw new Km(`Duplicate weight name ${e} for layer ${this.name}`);this._addedWeightNames.push(e),null==r&&(r="float32"),this.fastWeightInitDuringBuild&&(n=null!=s?s():Ry("zeros"));const l=n.apply(t,r),c=new ov(l,r,e,i,o);return l.dispose(),null!=a&&this.addLoss((()=>a.apply(c.read()))),null==i&&(i=!0),i?this._trainableWeights.push(c):this._nonTrainableWeights.push(c),c}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){null==e||Array.isArray(e)&&0===e.length||(e=ag(e),void 0!==this._losses&&null!==this._losses&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(null!=t){if(!Array.isArray(t))throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);t.forEach((e=>{if(null!=e)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)}))}return null}return t}addInboundNode(e,t,r,n,a,i,o=null){const s=ag(e);t=ag(t),r=ag(r),n=ag(n),a=rv(a),i=rv(i);const l=[],c=[],u=[];for(const e of s)l.push(e.sourceLayer),c.push(e.nodeIndex),u.push(e.tensorIndex);new pv({outboundLayer:this,inboundLayers:l,nodeIndices:c,tensorIndices:u,inputTensors:s,outputTensors:t,inputMasks:r,outputMasks:n,inputShapes:a,outputShapes:i},o);for(let e=0;e<t.length;e++)t[e].sourceLayer=this,t[e].nodeIndex=this.inboundNodes.length-1,t[e].tensorIndex=e}getConfig(){const e={name:this.name,trainable:this.trainable};return null!=this.batchInputShape&&(e.batchInputShape=this.batchInputShape),null!=this.dtype&&(e.dtype=this.dtype),e}disposeWeights(){return this.weights.forEach((e=>e.dispose())),this.weights.length}assertNotDisposed(){if(0===this._refCount)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(null===this._refCount)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return 0==--this._refCount&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}}function mv(e,t,r){if((null==t||null!=r&&r>0)&&(t=e.sourceLayer,r=e.nodeIndex),0===t.inboundNodes.length)return[e];{const e=t.inboundNodes[r];if(0===e.inboundLayers.length)return e.inputTensors;{const t=[];for(let r=0;r<e.inboundLayers.length;r++){const n=mv(e.inputTensors[r],e.inboundLayers[r],e.nodeIndices[r]);for(const e of n)-1===t.indexOf(e)&&t.push(e)}return t}}}class gv extends dv{constructor(e){if(super({dtype:e.dtype,name:null!=e.name?e.name:ev("input").toString()}),null==e.batchSize&&(e.batchSize=null),null==e.sparse&&(e.sparse=!1),this.trainable=!1,this.built=!0,this.sparse=e.sparse,null!=e.inputShape&&null!=e.batchInputShape)throw new Km("Only provide the inputShape OR batchInputShape argument to inputLayer, not both at the same time.");let t=e.batchInputShape;if(null==t){if(null==e.inputShape)throw new Km("An InputLayer should be passed either a `batchInputShape` or an `inputShape`.");t=[e.batchSize].concat(e.inputShape)}else if(null!=e.batchSize)throw new Km("Cannot specify batchSize if batchInputShape is specified when creating an InputLayer.");const r=e.dtype||"float32";this.batchInputShape=t,this.dtype=r,this.inputSpec=[{shape:t}];const n=new uv(this.dtype,this.batchInputShape,this,[],{},this.name);n.nodeIndex=0,n.tensorIndex=0,new pv({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:[n],outputTensors:[n],inputMasks:[null],outputMasks:[null],inputShapes:[t],outputShapes:[t]})}apply(e,t){throw new Km(`Cannot pass any input to an InputLayer's apply() method. InputLayer name: ${this.name}`)}dispose(){return{refCountAfterDispose:this._refCount,numDisposedVariables:0}}getConfig(){return{batchInputShape:this.batchInputShape,dtype:this.dtype,sparse:this.sparse,name:this.name}}}function yv(e){if(null==e.batchShape&&null==e.shape)throw new Error("Please provide to Input either a `shape` or a `batchShape` argument. Note that `shape` does not include the batch dimension.");if(null!=e.batchShape&&null!=e.shape)throw new Km("Please provide either a `shape` or `batchShape` argument to Input, but not both.");let t=e.batchShape;null!=e.shape&&null==t&&(t=[null].concat(e.shape));let r=e.dtype;return null==r&&(r="float32"),new gv({batchInputShape:t,name:e.name,dtype:r,sparse:e.sparse}).inboundNodes[0].outputTensors[0]}async function vv(e){if(null==e)return;const t=[],r=[],n=[];for(const a in e){const i=e[a];if("number"!=typeof i){const e=i;t.push(e.data()),r.push(a),n.push(e)}}if(t.length>0){const a=await Promise.all(t);for(let t=0;t<a.length;++t)e[r[t]]=a[t][0];Zs(n)}}function bv(e){if(null!=e)for(const t in e){const r=e[t];"number"!=typeof r&&r.dispose()}}var xv;gv.className="InputLayer",Ms(gv),function(e){e[e.SILENT=0]="SILENT",e[e.VERBOSE=1]="VERBOSE"}(xv||(xv={}));class _v{constructor(){this.validationData=null}setParams(e){this.params=e}async onEpochBegin(e,t){}async onEpochEnd(e,t){}async onBatchBegin(e,t){}async onBatchEnd(e,t){}async onTrainBegin(e){}async onTrainEnd(e){}setModel(e){}}class wv{constructor(e,t=10){null==e&&(e=[]),this.callbacks=e,this.queueLength=t}append(e){this.callbacks.push(e)}setParams(e){for(const t of this.callbacks)t.setParams(e)}setModel(e){for(const t of this.callbacks)t.setModel(e)}async onEpochBegin(e,t){null==t&&(t={});for(const r of this.callbacks)await r.onEpochBegin(e,t)}async onEpochEnd(e,t){null==t&&(t={});for(const r of this.callbacks)await r.onEpochEnd(e,t)}async onBatchBegin(e,t){null==t&&(t={});for(const r of this.callbacks)await r.onBatchBegin(e,t)}async onBatchEnd(e,t){null==t&&(t={});for(const r of this.callbacks)await r.onBatchEnd(e,t)}async onTrainBegin(e){null==e&&(e={});for(const t of this.callbacks)await t.onTrainBegin(e)}async onTrainEnd(e){null==e&&(e={});for(const t of this.callbacks)await t.onTrainEnd(e)}}class kv extends _v{constructor(){super()}async onEpochBegin(e){this.seen=0,this.totals={}}async onBatchEnd(e,t){null==t&&(t={});const r=null==t.size?0:t.size;this.seen+=r;for(const e in t){const n=t[e];if("number"==typeof n)this.totals.hasOwnProperty(e)||(this.totals[e]=0),this.totals[e]=this.totals[e]+n*r;else{let t;e in this.totals?t=this.totals[e]:this.totals[e]=0;const a=Ys((()=>ll(this.totals[e],fl(n,r))));this.totals[e]=a,null!=t&&t.dispose()}}}async onEpochEnd(e,t){if(null!=t)for(const e of this.params.metrics)null!=this.totals[e]&&("number"==typeof this.totals[e]?t[e]=this.totals[e]/this.seen:Ys((()=>{const r=fl(ul(1,this.seen),this.totals[e]);t[e]=r,this.totals[e].dispose(),Ks(t[e])})))}}class Dv extends _v{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){null==t&&(t={}),this.epoch.push(e);for(const e in t)null==this.history[e]&&(this.history[e]=[]),this.history[e].push(t[e])}async syncData(){const e=[],t=[],r=[];for(const n in this.history){const a=this.history[n];for(let i=0;i<a.length;++i)if("number"!=typeof a[i]){const o=a[i];e.push(o.data()),t.push(n),r.push(i)}}const n=await Promise.all(e);for(let e=0;e<n.length;++e)this.history[t[e]][r[e]].dispose(),this.history[t[e]][r[e]]=n[e][0]}}class Tv extends _v{constructor(e,t){if(super(),this.currentEpoch=0,this.nowFunc=e.nowFunc,this.nextFrameFunc=e.nextFrameFunc||Ph,this.yieldEvery=t||"auto","auto"===this.yieldEvery&&(this.yieldEvery=125),"never"===this.yieldEvery&&null!=e.onYield)throw new Error("yieldEvery is `never` but you provided an `onYield` callback. Either change `yieldEvery` or remove the callback");Ee(this.yieldEvery)&&(this.maybeWait=function(e,t,r){let n,a=null!=r?r():Na();return(...i)=>{const o=null!=r?r():Na();return o-a<t||(a=o,n=e(...i)),n}}(this.maybeWait.bind(this),this.yieldEvery,this.nowFunc)),this.trainBegin=e.onTrainBegin,this.trainEnd=e.onTrainEnd,this.epochBegin=e.onEpochBegin,this.epochEnd=e.onEpochEnd,this.batchBegin=e.onBatchBegin,this.batchEnd=e.onBatchEnd,this.yield=e.onYield}async maybeWait(e,t,r){const n=[];null!=this.yield&&(await vv(r),n.push(this.yield(e,t,r))),n.push(this.nextFrameFunc()),await Promise.all(n)}async onEpochBegin(e,t){this.currentEpoch=e,null!=this.epochBegin&&(await vv(t),await this.epochBegin(e,t))}async onEpochEnd(e,t){const r=[];null!=this.epochEnd&&(await vv(t),r.push(this.epochEnd(e,t))),"epoch"===this.yieldEvery&&r.push(this.nextFrameFunc()),await Promise.all(r)}async onBatchBegin(e,t){null!=this.batchBegin&&(await vv(t),await this.batchBegin(e,t))}async onBatchEnd(e,t){const r=[];null!=this.batchEnd&&(await vv(t),r.push(this.batchEnd(e,t))),"batch"===this.yieldEvery?r.push(this.nextFrameFunc()):Ee(this.yieldEvery)&&r.push(this.maybeWait(this.currentEpoch,e,t)),await Promise.all(r)}async onTrainBegin(e){null!=this.trainBegin&&(await vv(e),await this.trainBegin(e))}async onTrainEnd(e){null!=this.trainEnd&&(await vv(e),await this.trainEnd(e))}}function Av(e,t){return null==e&&(e={}),e instanceof _v?[e]:Array.isArray(e)&&e[0]instanceof _v?e:ag(e).map((e=>new Tv(e,t)))}class Sv{constructor(){}static registerCallbackConstructor(e,t){ne(e>=0&&Number.isInteger(e),(()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`)),Sv.checkForDuplicate(t),null==Sv.constructors[e]&&(Sv.constructors[e]=[]),Sv.constructors[e].push(t)}static checkForDuplicate(e){for(const t in Sv.constructors)Sv.constructors[+t].forEach((t=>{if(t===e)throw new Km("Duplicate callback constructor.")}))}static clear(){Sv.constructors={}}static createCallbacks(e){const t=[];for(const r in Sv.constructors){const n=+r;e>=n&&t.push(...Sv.constructors[n])}return t.map((e=>new e))}}function Mv(e,t,r,n,a,i,o,s,l){const c=new Dv,u=[new kv,...Sv.createCallbacks(t)];null!=e&&u.push(...e),u.push(c);const f=new wv(u);return f.setParams({epochs:r,initialEpoch:n,samples:a,steps:i,batchSize:o,verbose:t,doValidation:s,metrics:l}),{callbackList:f,history:c}}function Ev(e,t={},r=!1){return ug(e,Ss.getMap().classNameMap,t,"layer",r)}function Cv(e,t){return Ys((()=>{"float32"!==e.dtype&&(e=Ao(e,"float32"));const r=ku(cy(e),t,!0),n=Tl(r.shape,Xm()),a=pl(Nl(r,n));return ul(e,a)}))}function Nv(e,t){return Ys((()=>Uu(cy(Ml(t,e)),-1)))}function Ov(e,t){return Ys((()=>Uu(Cl(Ml(t,e)),-1)))}function Iv(e,t){return Ys((()=>{const r=Ml(e,t),n=Ac(Cl(e),Xm(),Number.MAX_VALUE),a=Cl(ul(r,n));return fl(100,Uu(a,-1))}))}function Pv(e,t,r=!1){return Ys((()=>{if(r)t=Uf(t);else{const e=ku(t,t.shape.length-1,!0);t=ul(t,e)}return t=Ac(t,Xm(),1-Xm()),bu(ku(fl(Ao(e,"float32"),yu(t)),t.shape.length-1))}))}function Rv(e,t,r=!1){return Ys((()=>{const n=Ao(au(function(e){const t=[Xg(e.shape)];return cc(e,t)}(e)),"int32"),a=(t=Ac(t,Xm(),1-Xm())).shape;return Pv(cc(Go(n,a[a.length-1]),a),t,r)}))}function Lv(e,t){return Ys((()=>{let r;return r=Ac(t,Xm(),1-Xm()),r=yu(ul(r,Ml(1,r))),Uu(function(e,t){if(!ce(e.shape,t.shape))throw new Km(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return Ys((()=>{const r=wf(t),n=bu(Cl(t));return ll(Ml(r,fl(t,e)),vu(Qc(n)))}))}(e,r),-1)}))}function Fv(e,t){return Ys((()=>{const r=Cv(e,-1),n=Cv(t,-1),a=fl(r,n);return bu(ku(a,-1))}))}Sv.constructors={};const Bv={meanSquaredError:Nv,meanAbsoluteError:Ov,meanAbsolutePercentageError:Iv,meanSquaredLogarithmicError:function(e,t){return Ys((()=>{const r=Ac(t,Xm(),Number.MAX_VALUE),n=yu(ll(1,r)),a=Ac(e,Xm(),Number.MAX_VALUE),i=yu(ll(1,a));return Uu(cy(Ml(n,i)),-1)}))},squaredHinge:function(e,t){return Ys((()=>{const r=Nl(0,Ml(1,fl(e,t)));return Uu(cy(r),-1)}))},hinge:function(e,t){return Ys((()=>{const r=Nl(0,Ml(1,fl(e,t)));return Uu(r,-1)}))},categoricalHinge:function(e,t){return Ys((()=>{const r=ku(fl(e,t),-1),n=wu(fl(Ml(1,e),t),-1);return Nl(0,ll(1,Ml(n,r)))}))},logcosh:function(e,t){return Ys((()=>{const r=Math.log(2),n=Ml(t,e),a=Ml(ll(n,xu(fl(-2,n))),r);return Uu(a,-1)}))},categoricalCrossentropy:Pv,sparseCategoricalCrossentropy:Rv,binaryCrossentropy:Lv,kullbackLeiblerDivergence:function(e,t){return Ys((()=>{const r=Ac(e,Xm(),1),n=Ac(t,Xm(),1);return ku(fl(e,yu(ul(r,n))),-1)}))},poisson:function(e,t){return Ys((()=>{const r=yu(ll(Xm(),t));return Uu(Ml(t,fl(e,r)),-1)}))},cosineProximity:Fv};function zv(e){if("string"==typeof e){if(e in Bv)return Bv[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new Km(t)}return e}function jv(e,t){return Ys((()=>{const r=fl(.5,Qu(t)),n=Jg(ou(t,r),e.dtype);return Uu(Hc(e,n),-1)}))}function Uv(e,t){return Ys((()=>Jg(Hc($l(e,-1),$l(t,-1)),"float32")))}function $v(e,t){return Ys((()=>Ao(ku(Pu(Hc(e,1),Hc(t,1))),"float32")))}function Vv(e,t){return Ys((()=>{const r=$v(e,t),n=function(e,t){return Ys((()=>Ao(ku(Pu(Hc(e,0),Hc(t,1))),"float32")))}(e,t),a=ll(r,n);return Ao(Gc(ou(a,0),ul(r,a),0),"float32")}))}function qv(e,t){return Lv(e,t)}function Wv(e,t){return e.rank===t.rank&&(e=Xf(e,[e.rank-1])),(t=$l(t,-1)).dtype!==e.dtype&&(t=Ao(t,e.dtype)),Ao(Hc(e,t),"float32")}const Hv=Pv,Gv=Rv,Xv={binaryAccuracy:jv,categoricalAccuracy:Uv,precision:Vv,categoricalCrossentropy:Hv,sparseCategoricalCrossentropy:Gv,mse:Nv,MSE:Nv,mae:Ov,MAE:Ov,mape:Iv,MAPE:Iv,cosine:Fv};function Yv(e){if("string"==typeof e&&e in Xv)return Xv[e];if("string"!=typeof e&&null!=e)return e;throw new Km(`Unknown metric ${e}`)}function Zv(e){if(tg(null!==e,`Unknown LossOrMetricFn ${e}`),"string"==typeof e)return e;{let t;for(const r of Object.keys(Bv))if(Bv[r]===e){t=r;break}if(void 0!==t)return t;for(const r of Object.keys(Xv))if(Xv[r]===e){t=r;break}return void 0!==t?t:e.name}}function Kv(e,t,r=!1){if(null==e||"object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype||!Jv(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(r){const r=JSON.stringify(e);r.length>1048576&&console.warn(`User-defined metadata of model "${t}" is too large in size (length=${r.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= 1048576.`)}}function Jv(e){if(null===e)return!0;if("object"==typeof e){if(Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);for(const r of t){if("string"!=typeof r)return!1;if(!Jv(e[r]))return!1}return!0}if(Array.isArray(e)){for(const t of e)if(!Jv(t))return!1;return!0}return!1}{const t=typeof e;return"string"===t||"number"===t||"boolean"===t}}function Qv(e,t,r=console.log){let n="";for(let r=0;r<e.length;++r)r>0&&(n=n.slice(0,n.length-1)+" "),n+=e[r],n=n.slice(0,t[r]),n+=" ".repeat(t[r]-n.length);r(n)}function eb(e,t,r){let n;try{n=JSON.stringify(e.outputShape)}catch(e){n="multiple"}Qv([`${e.name} (${e.getClassName()})`,n,e.countParams().toString()],t,r)}function tb(e,t,r,n){let a;try{a=JSON.stringify(e.outputShape)}catch(e){a="multiple"}const i=[];for(const t of e.inboundNodes)if(!(null!=r&&r.length>0&&-1===r.indexOf(t)))for(let e=0;e<t.inboundLayers.length;++e){const r=t.inboundLayers[e].name,n=t.nodeIndices[e],a=t.tensorIndices[e];i.push(`${r}[${n}][${a}]`)}const o=e.name,s=e.getClassName(),l=0===i.length?"":i[0];Qv([`${o} (${s})`,a,e.countParams().toString(),l],t,n);for(let e=1;e<i.length;++e)Qv(["","","",i[e]],t,n)}function rb(e,t,r){return("inboundNodes"===e||"outputLayers"===e||"inputLayers"===e)&&0===t&&"string"==typeof r}function nb(e,t){if(null===e)return null;if("string"==typeof e)return og(e);if("number"==typeof e||"boolean"==typeof e)return e;if(e instanceof Array){const r=[],n=e.length;for(let a=0;a<n;++a){const n=e[a];rb(t,a,n)?r.push(n):r.push(nb(n,t))}return r}{const t={};for(const r of Object.keys(e)){const n=e[r];if("name"===r&&"string"==typeof n)t[r]=n;else{const e=og(r);t[e]=nb(n,e)}}return t}}function ab(e,t){if(null==e)return null;if("string"==typeof e)return ig(e);if("number"==typeof e||"boolean"==typeof e)return e;if(e instanceof Array){const r=[],n=e.length;for(let a=0;a<n;++a){const n=e[a];rb(t,a,n)?r.push(n):r.push(ab(n,t))}return r}{const t={};for(const r of Object.keys(e)){const n=e[r];t[ig(r)]="name"!==r&&"className"!==r||"string"!=typeof n?ab(n,r):n}return t}}const ib="3.13.0";class ob{constructor(e){if(this.id2Value={},this.id2Mask={},this.name2Id={},e instanceof ob)for(const t in e.id2Value)this.id2Value[t]=e.id2Value[t],t in e.id2Mask&&(this.id2Mask[t]=e.id2Mask[t]);else{if(null==e)return;for(const t of e)this.add(t.key,t.value)}}add(e,t,r){if(null!=this.id2Value[e.id])throw new Km(`Duplicate key: name=${e.name}, id=${e.id}`);return this.id2Value[e.id]=function(e,t){if(null==e.dtype||e.dtype===t.dtype)return t;try{return Ao(t,e.dtype)}catch(r){throw new Km(`The dtype of the feed (${t.dtype}) can not be cast to the dtype of the key '${e.name}' (${e.dtype}).`)}}(e,t),this.name2Id[e.name]=e.id,null!=r&&(this.id2Mask[e.id]=r),this}addFeed(e){this.add(e.key,e.value)}hasKey(e){return null!=this.id2Value[e.id]}names(){return Object.keys(this.name2Id)}getValue(e){if(e instanceof uv){if(null==this.id2Value[e.id])throw new Km(`Nonexistent key: ${e.name}`);return this.id2Value[e.id]}{const t=this.name2Id[e];if(null==t)throw new Km(`Feed dict has no SymbolicTensor name: ${e}`);return this.id2Value[t]}}getMask(e){if(e instanceof uv){if(null==this.id2Value[e.id])throw new Km(`Nonexistent key: ${e.name}`);return this.id2Mask[e.id]}{const t=this.name2Id[e];if(null==t)throw new Km(`Feed dict has no SymbolicTensor name: ${e}`);return this.id2Mask[t]}}disposeMasks(){null!=this.id2Mask&&Zs(this.id2Mask)}}const sb={},lb={};function cb(e,t,r,n){const a=null!=r&&r.training,i=Array.isArray(e),o=i?e:[e],s=o.map((e=>e.name)),l=[],c=t.names();for(const e of s)-1!==c.indexOf(e)?l.push(t.getValue(e)):l.push(null);null!=n&&(n.maxNumTensors=-1/0,n.minNumTensors=1/0);const u=s.join(",")+"|"+t.names().join(",");let f,p;if(null==sb[u]){const e=function(e,t){ne(null!=e&&e.length>0,(()=>"Expected at least one fetch, got none"));let r=[],n={};if(1===e.length){const a=fb(e[0],t);r=a.sorted,n=a.recipientMap}else{const a=new Set;for(const i of e){const{sorted:e,recipientMap:o}=fb(i,t);for(const t of e)a.has(t.name)||(r.push(t),a.add(t.name));for(const e in o)null==n[e]&&(n[e]=new Set),o[e].forEach((t=>n[e].add(t)))}}return{sorted:r,recipientCounts:ub(n)}}(o,t);f=e.sorted,p=e.recipientCounts,sb[u]=f,lb[u]=p}f=sb[u],p={},a||Object.assign(p,lb[u]);const h=new ob(t);for(let e=0;e<f.length;++e){if(null!=n){const e=Gs().numTensors;e>n.maxNumTensors&&(n.maxNumTensors=e),e<n.minNumTensors&&(n.minNumTensors=e)}const i=f[e],o=i.sourceLayer;if(o instanceof gv)continue;const c=[],u=[],d=[];let m=!1;for(const e of i.inputs){const r=h.getValue(e),n=h.getMask(e);c.push(r),u.push(n),null!=n&&(m=!0),a||(p[e.name]--,0!==p[e.name]||t.hasKey(e)||-1!==s.indexOf(e.name)||r.isDisposed||!0===e.sourceLayer.stateful||d.push(r))}m&&((r=r||{}).mask=u[0]);const g=ag(o.apply(c,r));let y=null;o.supportsMasking&&(y=o.computeMask(c,u));const v=pb(i),b=Array.isArray(v)?v:[v];for(let e=0;e<b.length;++e){h.hasKey(b[e])||h.add(b[e],g[e],Array.isArray(y)?y[0]:y);const t=s.indexOf(b[e].name);-1!==t&&(l[t]=g[e])}a||Zs(d)}return h.disposeMasks(),i?l:l[0]}function ub(e){const t={};for(const r in e)t[r]=e[r].size;return t}function fb(e,t){const r=new Set,n=[],a={};for(const e of t.names())r.add(e);const i=[],o=[];for(i.push(e);i.length>0;){const e=i[i.length-1];if(r.has(e.name)){i.pop();continue}const t=o[o.length-1]===i.length-1;if(0===e.inputs.length||t)i.pop(),n.push(e),r.add(e.name),t&&o.pop();else{o.push(i.length-1);for(const t of e.inputs)null==a[t.name]&&(a[t.name]=new Set),a[t.name].add(e.name),r.has(t.name)||i.push(t)}}return{sorted:n,recipientMap:a}}function pb(e){let t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{let r=null;for(let t=0;t<e.sourceLayer.inboundNodes.length;++t)for(const n of e.sourceLayer.inboundNodes[t].outputTensors)if(n.id===e.id){r=t;break}t=e.sourceLayer.getOutputAt(r)}return t}class hb extends dv{constructor(e){if(super({}),this.containerNodes=new Set,this.name=e.name,null==this.name){const e=this.getClassName().toLowerCase();this.name=ev(e)}if(this.supportsMasking=!1,this.trainable_=!0,Array.isArray(e.inputs)?this.inputs=e.inputs.slice():this.inputs=[e.inputs],Array.isArray(e.outputs)?this.outputs=e.outputs.slice():this.outputs=[e.outputs],pg(this.inputs).length!==this.inputs.length)throw new Km(`The list of inputs passed to the model is redundant. All inputs should only appear once. Found: ${this.inputs.map((e=>e.name))}`);pg(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map((e=>e.name))}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const e of this.outputs){const t=e.sourceLayer,r=e.nodeIndex,n=e.tensorIndex;this.outputLayers.push(t),this.outputLayersNodeIndices.push(r),this.outputLayersTensorIndices.push(n)}for(const e of this.inputs){const t=e.sourceLayer,r=e.nodeIndex,n=e.tensorIndex;tg(0===r,"input layer has >1 nodes"),tg(0===n,"input layer has >1 tensors"),this.inputLayers.push(t),this.inputLayersNodeIndices.push(r),this.inputLayersTensorIndices.push(n)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let t=0;t<this.inputLayers.length;t++){const r=this.inputLayers[t];if(!(r instanceof gv))throw new TypeError(`Input layers to a LayersModel must be InputLayer objects. Received inputs: ${e.inputs}. Input ${t} (0-based) originates from layer type ${r.getClassName()}.`);this.inputNames.push(r.name),this.feedInputShapes.push(r.batchInputShape),this.feedInputNames.push(r.name)}for(const e of this.outputLayers)this.outputNames.push(e.name);this.internalInputShapes=this.inputs.map((e=>e.shape)),this.internalOutputShapes=this.outputs.map((e=>e.shape));const t={},r={},n={},a={},i={},o=[],s=(e,t,r,n,a,l)=>{null!=n&&null!=a&&null!=l||(n=e.sourceLayer,a=e.nodeIndex,l=e.tensorIndex);const c=n.inboundNodes[a];if(-1!==r.indexOf(c))throw new Zm(`The tensor ${e.name} at layer "${n.name}" is part of a cycle.`);if(-1!==t.indexOf(c))return;this.containerNodes.add(hb.nodeKey(n,a)),n.id in i||(i[n.id]=Object.keys(i).length),-1===r.indexOf(c)&&r.push(c);const u=c.inboundLayers.length;for(let e=0;e<u;e++){const n=c.inputTensors[e],a=c.inboundLayers[e],i=c.nodeIndices[e],o=c.tensorIndices[e];s(n,t,r,a,i,o)}for(t.push(c);r.indexOf(c)>=0;)r.splice(r.indexOf(c),1);o.push(c)},l=[],c=[];for(const e of this.outputs)s(e,l,c);const u=o.slice().reverse();for(const e of u){r[e.id]=e,e.id in t||(t[e.id]=0);let i=t[e.id];const o=null==n[e.outboundLayer.id]?0:n[e.outboundLayer.id];i=Math.max(i,o),n[e.outboundLayer.id]=i,a[e.outboundLayer.id]=e.outboundLayer,t[e.id]=i;for(let n=0;n<e.inboundLayers.length;n++){const a=e.inboundLayers[n],o=e.nodeIndices[n],s=a.inboundNodes[o],l=null==t[s.id]?0:t[s.id];t[s.id]=Math.max(i+1,l),r[s.id]=s}}const f={};for(const e in t){const n=t[e];n in f||(f[n]=[]),f[n].push(r[e])}const p={};for(const e in n){const t=n[e];t in p||(p[t]=[]),p[t].push(a[e])}let h=Object.keys(p).map((e=>parseInt(e,10))).sort(fg);this.layers=[];for(const e of h){const t=p[e];t.sort(((e,t)=>{const r=i[e.id],n=i[t.id];return r<n?-1:r>n?1:0}));for(const e of t)e instanceof hb&&this.internalContainerRefs.push(e),this.layers.push(e)}this.layersByDepth=p,h=Object.keys(f).map((e=>parseInt(e,10))).sort(fg);const d=this.inputs.slice(),m=[];for(const e of h)for(const t of f[e]){const e=t.outboundLayer;if(null!=e){for(const r of t.inputTensors)if(-1===d.indexOf(r))throw new Zm(`Graph disconnected: cannot obtain value for tensor ${r} at layer "${e.name}". The following previous layers were accessed without issue: ${m}`);for(const e of t.outputTensors)d.push(e);m.push(e.name)}}this.nodesByDepth=f;const g=this.layers.map((e=>e.name));for(const e of g){const t=g.filter((t=>t===e)).length;if(1!==t)throw new Zm(`The name "${e}" is used ${t} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(g))}this.outboundNodes=[],this.inboundNodes=[],new pv({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map((e=>null)),outputMasks:this.outputs.map((e=>null)),inputShapes:this.inputs.map((e=>e.shape)),outputShapes:this.outputs.map((e=>e.shape))}),this.built=!0,this._refCount=1}assertNotDisposed(){if(0===this._refCount)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const e={refCountAfterDispose:null,numDisposedVariables:0};if(0==--this._refCount){for(const t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(const t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach((t=>{t._trainableWeights.forEach((t=>t.trainable=e))})),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new Km("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(const t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.layers)t.push(...e.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){const r={};let n=0;for(const e of this.layers)for(const t of e.weights){if(null!=r[t.originalName])throw new Km(`Duplicate weight name: ${t.originalName}`);r[t.originalName]=t,n++}const a=[];for(const n in e){let i=n;if(null==r[n]){const e=n.split("/");i=e.slice(0,-2).concat([e[e.length-1]]).join("/")}if(null!=r[i])a.push([r[i],e[n]]);else if(t)throw new Km(`Provided weight data has no target variable: ${n}`);delete r[i]}if(t){const e=[];for(const t in r)e.push(t);if(e.length>0)throw new Km(`${e.length} of ${n} weights are not set: ${e}`)}lv(a)}updatedConfig(){const e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${ib}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){const r=ab(this.updatedConfig());return t?JSON.stringify(r):r}call(e,t){return Ys((()=>{e=ag(e);const r=new ob;for(let t=0;t<this.inputs.length;++t)r.add(this.inputs[t],e[t]);return cb(this.outputs,r,t)}))}computeMask(e,t){return Ys((()=>{let r;return e=ag(e),r=null==t?eg(null,e.length):ag(t),this.runInternalGraph(e,r)[1]}))}computeOutputShape(e){const t=rv(e);if(t.length!==this.inputLayers.length)throw new Km(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const r={};for(let e=0;e<t.length;e++){const n=this.inputLayers[e],a=t[e];r[n.name+"_0_0"]=a}const n=Object.keys(this.nodesByDepth).map((e=>parseInt(e,10))).sort(fg);if(n.length>1)for(const e of n){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer;if(-1!==this.inputLayers.map((e=>e.id)).indexOf(t.id))continue;const n=[];for(let t=0;t<e.inboundLayers.length;t++){const a=e.inboundLayers[t],i=e.nodeIndices[t],o=e.tensorIndices[t],s=r[`${a.name}_${i}_${o}`];n.push(s)}const a=rv(t.computeOutputShape(ng(n))),i=t.inboundNodes.indexOf(e);for(let e=0;e<a.length;e++)r[`${t.name}_${i}_${e}`]=a[e]}}const a=[],i=[];for(let e=0;e<this.outputLayers.length;e++){const t=this.outputLayers[e],r=this.outputLayersNodeIndices[e],n=this.outputLayersTensorIndices[e],a=`${t.name}_${r}_${n}`;i.push(a)}for(let e=0;e<i.length;e++){const t=i[e];tg(t in r),a.push(r[t])}return ng(a)}runInternalGraph(e,t){null==t&&(t=eg(null,e.length));const r={};for(let n=0;n<this.inputs.length;++n){const a=this.inputs[n],i=e[n],o=t[n];r[a.id]=[i,o]}const n=Object.keys(this.nodesByDepth).map((e=>parseInt(e,10))).sort(fg);for(const e of n){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer,n=e.inputTensors,a=e.outputTensors,i=new Array;for(const e of n)e.id in r&&i.push(r[e.id]);if(i.length===n.length){let n,o,s,l,c={};if(null!=e.callArgs&&(c=e.callArgs),1===i.length){const[e,r]=i[0];null==c.mask&&(c.mask=r),s=ag(t.call(e,c)),l=ag(t.computeMask(e,r)),n=[e],o=[r]}else n=i.map((e=>e[0])),o=i.map((e=>e[1])),null==c.mask&&(c.mask=o),s=ag(t.call(n,c)),l=ag(t.computeMask(n,o));if(t.activityRegularizer)throw new Jm("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let e=0;e<a.length;++e){const t=a[e],n=s[e],i=l[e];r[t.id]=[n,i]}}}}const a=[],i=[],o=[];for(const e of this.outputs){tg(e.id in r,`Could not compute output ${e.name} : ${e.id}`);const[t,n]=r[e.id];o.push(t.shape),a.push(t),i.push(n)}return[a,i,o]}buildNodeConversionMap(e){const t={};let r;for(const e of this.layers){r=e instanceof hb?1:0;for(let n=0;n<e.inboundNodes.length;n++){const a=hb.nodeKey(e,n);this.containerNodes.has(a)&&(t[a]=r,r+=1)}}return t}getLayer(e,t){if(null!=t){if(this.layers.length<=t)throw new Km(`Was asked to retrieve layer at index ${t}, but model only has ${this.layers.length} layer(s).`);return this.layers[t]}if(null==e)throw new Km("Provide either a layer name or layer index");for(const t of this.layers)if(t.name===e)return t;throw new Km(`No such layer: ${e}`)}calculateLosses(){return Ys((()=>{const e=[];for(const t of this.layers)for(let r=0;r<t.inboundNodes.length;++r){const n=hb.nodeKey(t,r);this.containerNodes.has(n)&&e.push(...t.calculateLosses())}return e}))}getConfig(){const e={name:this.name},t=this.buildNodeConversionMap(this.layers),r=[];for(const e of this.layers){const n=e.getClassName(),a=e.getConfig(),i=[];for(let r=0;r<e.inboundNodes.length;r++){const n=e.inboundNodes[r],a=hb.nodeKey(e,r);let o={};if(this.containerNodes.has(a)){if(n.callArgs)try{JSON.stringify(n.callArgs),o=n.callArgs}catch(t){console.warn(`Layer ${e.name} was passed non-serializable keyword arguments: ${n.callArgs}. They will not be included in the serialized model (and thus will be missing at deserialization time).`),o={}}if(n.inboundLayers.length>0){const e=[];for(let r=0;r<n.inboundLayers.length;r++){const a=n.inboundLayers[r],i=n.nodeIndices[r],s=n.tensorIndices[r];let l=t[hb.nodeKey(a,i)];null==l&&(l=0),e.push([a.name,l,s,o])}i.push(e)}}}const o={};o.name=e.name,o.className=n,o.config=a,o.inboundNodes=i,r.push(o)}e.layers=r;const n=[];for(let e=0;e<this.inputLayers.length;e++){const r=this.inputLayers[e],a=this.inputLayersNodeIndices[e],i=hb.nodeKey(r,a);if(!this.containerNodes.has(i))continue;let o=t[i];null==o&&(o=0);const s=this.inputLayersTensorIndices[e];n.push([r.name,o,s])}e.inputLayers=n;const a=[];for(let e=0;e<this.outputLayers.length;e++){const r=this.outputLayers[e],n=this.outputLayersNodeIndices[e],i=hb.nodeKey(r,n);if(!this.containerNodes.has(i))continue;let o=t[i];null==o&&(o=0);const s=this.outputLayersTensorIndices[e];a.push([r.name,o,s])}return e.outputLayers=a,e}static fromConfig(e,t,r={},n=!1){const a={},i={};function o(e,t){e.name in i?i[e.name].push(t):i[e.name]=[t]}function s(e,t){const r=[];let n;for(const i of t){const s=i[0],l=i[1],c=i[2];if(n=null==i[3]?{}:i[3],!(s in a))return void o(e,t);const u=a[s];if(u.inboundNodes.length<=l)return void o(e,t);const f=u.inboundNodes[l];r.push(f.outputTensors[c])}r.length>0&&e.apply(ng(r),n)}function l(e){const r=e.name,i=Ev(e,null!=t.customObjects?t.customObjects:{});i.setFastWeightInitDuringBuild(n),a[r]=i,e.inboundNodes.forEach((e=>{if(!(e instanceof Array))throw new Km(`Corrupted configuration, expected array for nodeData: ${e}`);o(i,e)}))}const c=t.name,u=t.layers;for(const e of u)l(e);for(;!hg(i);)for(const e of u){const t=a[e.name];if(t.name in i){const e=i[t.name];delete i[t.name];for(const r of e)s(t,r)}}const f=[],p=[],h=t.inputLayers;for(const e of h){const t=e[0],r=e[1],n=e[2];tg(t in a);const i=a[t].inboundNodes[r].outputTensors;f.push(i[n])}const d=t.outputLayers;for(const e of d){const t=e[0],r=e[1],n=e[2];tg(t in a);const i=a[t].inboundNodes[r].outputTensors;p.push(i[n])}return new e({inputs:f,outputs:p,name:c})}get stateful(){if(this._stateful)throw new Km("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const e of this.layers)if(e.stateful)return!0;return!1}resetStates(){Ys((()=>{this.layers.forEach((e=>{e.stateful&&e.resetStates()}))}))}}function db(e,t){return function(e,t,r){const n=t.length;if(null==e||Array.isArray(e)&&0===e.length)return t.map((e=>null));if(1===n)return Array.isArray(e)&&1===e.length?e:"object"==typeof e&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==n)throw new Error(`Provided ${r} is an array of ${e.length} element(s), but the model has ${n} outputs. Make sure a set of weights is provided for each model output.`);return e}if("object"==typeof e&&Object.keys(e).length>0&&"object"==typeof e[Object.keys(e)[0]]){const r=[];return t.forEach((t=>{t in e?r.push(e[t]):r.push(null)})),r}throw new Error(`The model has multiple (${n}) outputs, so ${r} must be either an array with ${n} elements or an object with ${t} keys. Provided ${r} not understood: ${JSON.stringify(e)}`)}(e,t,"classWeight")}async function mb(e,t,r,n){if(null!=t||null!=n)throw new Error("Support sampleWeight is not implemented yet");if(null!=r){const t=Ys((()=>{if(1===e.shape.length)return So(e);if(2===e.shape.length){if(e.shape[1]>1)return $l(e,1);if(1===e.shape[1])return cc(e,[e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)})),n=Array.from(await t.data());Zs(t);const a=[];return n.forEach((e=>{if(null==r[e])throw new Error(`classWeight must contain all classes in the training data. The class ${e} exists in the data but not in classWeight`);a.push(r[e])})),Qf(a,"float32")}return null}function gb(e,t){return fl(e,t)}function yb(e,t){let r,n;const a=t;r=a.xs,n=a.ys,ne(null!=r&&null!=n,(()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor.  The provided Dataset instead generates ${t}`));const i=vb("input",e.inputNames,r),o=vb("output",e.outputNames,n),s=i[0].shape[0];ne(i.length===e.inputs.length,(()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${i.length} inputs.  (Expected input keys: ${JSON.stringify(e.inputNames)})`)),ne(o.length===e.outputs.length,(()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${o.length} outputs.  (Expected output keys: ${JSON.stringify(e.outputNames)})`));for(let t=0;t<i.length;t++)ne(i[t].shape[0]===s,(()=>`Batch size mismatch: input ${e.inputNames[t]} has ${i[t].shape[0]}; expected  ${s} based on input ${e.inputNames[0]}.`));for(let t=0;t<o.length;t++)ne(o[t].shape[0]===s,(()=>`Batch size mismatch: output ${e.outputNames[t]} has ${o[t].shape[0]}; expected  ${s} based on input ${e.inputNames[0]}.`));return{xs:i,ys:o}}function vb(e,t,r){if(r instanceof Ga)return[r];if(Array.isArray(r))return ne(r.length===t.length,(()=>`Received an array of ${r.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`)),r;{const n=[];for(const a of t){if(null==r[a])throw new Km(`The feature data generated by the dataset lacks the required ${e} key '${a}'.`);n.push(r[a])}return n}}function bb(e){return"function"==typeof e.iterator}function xb(e){ne(e>0&&Number.isInteger(e),(()=>`batchSize is required to be a positive integer, but got ${e}`))}function _b(e,t,r){return null==e?[null]:Array.isArray(e)?e.map((e=>ey(e,t,r-t))):ey(e,t,r-t)}function wb(e,t){return Ys((()=>null==e?null:Array.isArray(e)?e.map((e=>wb(e,t))):ly(e,"int32"===t.dtype?t:Ao(t,"int32"))))}function kb(e,t){const r=[];let n=0,a=null;for(;n<e;)a=n+t,a>=e&&(a=e),r.push([n,a]),n=a;return r}function Db(e){const t=[];e instanceof Ga&&(e=[e]);for(let r=0;r<e.length;++r){const n=e[r];if(1===n.rank)t.push(Qg(n,1));else{if(0===n.rank)throw new Error("Expected tensor to be at least 1D, but received a 0D tensor (scalar).");t.push(n)}}return t}function Tb(e,t){if(null==e)return;const r=[];if(t instanceof Ga)r.push(t.id);else if(Array.isArray(t))t.forEach((e=>r.push(e.id)));else if(null!=t)for(const e in t){const n=t[e];r.push(n.id)}const n=[];if(e instanceof Ga)-1===r.indexOf(e.id)&&n.push(e);else if(Array.isArray(e))e.forEach((e=>{-1===r.indexOf(e.id)&&n.push(e)}));else if(null!=e)for(const t in e){const a=e[t];-1===r.indexOf(a.id)&&n.push(a)}n.forEach((e=>{e.isDisposed||e.dispose()}))}function Ab(e){return Array.isArray(e)}function Sb(e){return!function(e){return e instanceof Ga}(e)&&!Ab(e)}function Mb(e,t,r,n=!0,a=""){if(null==t||0===t.length){if(null!=e){let t=!1;if(Ab(e)&&e.length>0)t=!0;else if(Sb(e)){for(const r in e)if(e.hasOwnProperty(r)){t=!0;break}}else t=!0;if(t)throw new Km(`Error when checking model ${a} expected no data, but got ${e}`)}return[]}if(null==e)return t.map((e=>null));let i;if(Sb(e)){e=e,i=[];for(const r of t){if(null==e[r])throw new Km(`No data provided for "${r}". Need data for each key in: ${t}`);i.push(e[r])}}else if(Ab(e)){if((e=e).length!==t.length)throw new Km(`Error when checking model ${a}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);i=e}else{if(e=e,t.length>1)throw new Km(`The model ${a} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);i=[e]}if(i=Db(i),null!=r)for(let e=0;e<t.length;++e){if(null==r[e])continue;const o=i[e];if(o.shape.length!==r[e].length)throw new Km(`Error when checking ${a}: expected ${t[e]} to have ${r[e].length} dimension(s). but got array with shape ${o.shape}`);for(let t=0;t<r[e].length;++t){if(0===t&&!n)continue;const i=o.shape[t],s=r[e][t];if(null!=s&&s>=0&&i!==s)throw new Km(`${a} expected a batch of elements where each example has shape [${r[e].slice(1,r[e].length)}] (i.e.,tensor shape [*,${r[e].slice(1,r[e].length)}]) but the ${a} received an input with ${o.shape[0]} examples, each with shape [${o.shape.slice(1,o.shape.length)}] (tensor shape [${o.shape}])`)}}return i}function Eb(e,t,r,n=!0,a=""){let i;if(Array.isArray(e)){if(e.length!==t.length)throw new Km(`Error when checking model ${a}: the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see ${t.length} Tensor(s), but instead got ${e.length} Tensors(s).`);i=e}else{if(t.length>1)throw new Km(`The model expects ${t.length} ${a} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);i=[e]}if(null!=r)for(let e=0;e<t.length;++e){if(null==r[e])continue;const o=i[e];if(o.shape.length!==r[e].length)throw new Km(`Error when checking ${a}: expected ${t[e]} to have ${r[e].length} dimension(s), but got array with shape ${JSON.stringify(o.shape)}`);for(let i=0;i<r[e].length;++i){if(0===i&&!n)continue;const s=o.shape[i],l=r[e][i];if(null!=l&&l!==s)throw new Km(`Error when checking ${a}: expected ${t[e]} to have shape ${JSON.stringify(r[e])} but got array with shape ${JSON.stringify(o.shape)}.`)}}}class Cb extends hb{constructor(e){super(e),this.isTraining=!1}summary(e,t,r=console.log){if(!this.built)throw new Km("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");!function(e,t,r,n=console.log){const a=function(e){let t=!0;const r=[],n=[];for(const t in e.nodesByDepth)r.push(e.nodesByDepth[t]);for(const e of r){if(e.length>1||1===e.length&&e[0].inboundLayers.length>1){t=!1;break}n.push(...e)}if(t)for(const r of e.layers){let e=!1;for(const a of r.inboundNodes)if(-1!==n.indexOf(a)){if(e){t=!1;break}e=!0}if(!t)break}return t}(e),i=["Layer (type)","Output shape","Param #"];let o;if(a?(t=t||65,r=r||[.45,.85,1]):(t=t||98,r=r||[.33,.55,.67,1]),r[r.length-1]<=1&&(r=r.map((e=>Math.floor(t*e)))),!a){i.push("Receives inputs"),o=[];for(const t in e.nodesByDepth)o.push(...e.nodesByDepth[t])}n("_".repeat(t)),Qv(i,r,n),n("=".repeat(t));const s=e.layers;for(let e=0;e<s.length;++e)a?eb(s[e],r,n):tb(s[e],r,o,n),n((e===s.length-1?"=":"_").repeat(t));e.checkTrainableWeightsConsistency();const l=function(e){let t;return t=null!=e.collectedTrainableWeights?iv(e.collectedTrainableWeights):iv(e.trainableWeights),t}(e),c=iv(e.nonTrainableWeights);n(`Total params: ${l+c}`),n(`Trainable params: ${l}`),n(`Non-trainable params: ${c}`),n("_".repeat(t))}(this,e,t,r)}compile(e){if(null==e.loss&&(e.loss=[]),this.loss=e.loss,"string"==typeof e.optimizer)this.optimizer_=function(e){const t={Adagrad:()=>Oh.adagrad(.01),Adadelta:()=>Oh.adadelta(1,.95,Xm()),Adam:()=>Oh.adam(.001,.9,.999,Xm()),Adamax:()=>Oh.adamax(.002,.9,.999,Xm(),0),RMSProp:()=>Oh.rmsprop(.001,.9,0,Xm()),SGD:()=>Oh.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new Km(`Unknown Optimizer ${e}`)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof kl))throw new Km("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(Array.isArray(e.loss)||"string"==typeof e.loss||"function"==typeof e.loss)if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new Km(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);const r=e.loss;t=r.map((e=>zv(e)))}else{const r=zv(e.loss);this.outputs.forEach((e=>{t.push(r)}))}else{e.loss=e.loss;for(const t in e.loss)if(-1===this.outputNames.indexOf(t))throw new Km(`Unknown entry in loss dictionary: "${t}". Only expected the following keys: ${this.outputNames}`);for(const r of this.outputNames)null==e.loss[r]&&console.warn(`Output "${r}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${r} during training`),t.push(zv(e.loss[r]))}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let e=0;e<this.outputs.length;++e){const t=this.internalOutputShapes[e],r=this.outputNames[e];this.feedOutputNames.push(r),this.feedOutputShapes.push(t),this.feedLossFns.push(this.lossFunctions[e])}const r=[];this.metrics=e.metrics,this.metricsNames=["loss"],this.metricsTensors=[],Vg("loss",(()=>{for(let e=0;e<this.outputs.length;++e){if(-1!==r.indexOf(e))continue;const t=this.lossFunctions[e];this.outputs.length>1&&(this.metricsTensors.push([t,e]),this.metricsNames.push(this.outputNames[e]+"_loss"))}}));const n=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map((e=>[]));let r;if("string"==typeof e||"function"==typeof e)r=[e];else{if(!Array.isArray(e)&&"object"!=typeof e)throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);r=e}if(Array.isArray(r))return t.map((e=>r));{const e=[];for(const n of t){let t=r.hasOwnProperty(n)?r[n]:[];Array.isArray(t)||(t=[t]),e.push(t)}return e}}(e.metrics,this.outputNames),a=(e,t,r)=>{this.outputNames.length>1&&(t=this.outputNames[e]+"_"+t),this.metricsNames.push(t),this.metricsTensors.push([r,e])};Vg("metric",(()=>{for(let e=0;e<this.outputs.length;++e)-1===r.indexOf(e)&&(t=>{let r,n,i;for(const o of t){if("string"==typeof o&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(o)){const t=this.internalOutputShapes[e];let a;1===t[t.length-1]||this.lossFunctions[e]===Lv?-1!==["accuracy","acc"].indexOf(o)?n=jv:-1!==["crossentropy","ce"].indexOf(o)&&(n=qv):this.lossFunctions[e]===Rv?-1!==["accuracy","acc"].indexOf(o)?n=Wv:-1!==["crossentropy","ce"].indexOf(o)&&(n=Gv):-1!==["accuracy","acc"].indexOf(o)?n=Uv:-1!==["crossentropy","ce"].indexOf(o)&&(n=Hv),-1!==["accuracy","acc"].indexOf(o)?a="acc":-1!==["crossentropy","ce"].indexOf(o)&&(a="ce"),i=n,r=""+a}else{const e=Yv(o);i=e,r=""+Zv(o)}let t;Vg(r,(()=>{t=i})),a(e,r,t)}})(n[e])})),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){null!=this.collectedTrainableWeights&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,t,r={}){const n=null==r.batchSize?32:r.batchSize;xb(n);const a=this.standardizeUserDataXY(e,t,!0,n);try{const i=a[0].concat(a[1]);this.makeTestFunction();const o=this.testFunction;return ng(this.testLoop(o,i,n,r.verbose,r.steps))}finally{Tb(a[0],e),Tb(a[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),async function(e,t,r){const n=null!=(r=r||{}).batches,a=e.testFunction;let i=[];if(r.verbose>0)throw new Jm("Verbose mode is not implemented yet.");ne(!n||r.batches>0&&Number.isInteger(r.batches),(()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(r.batches)}`));const o="function"==typeof t.next?t:await t.iterator();let s=0,l=0;for(;!n||l<r.batches;){const t=await o.next();if(i=Ys((()=>{if(t.value){const{xs:r,ys:n}=yb(e,t.value),o=r.concat(n),c=Ys((()=>a(o)));if(Zs(o),0===l)for(let e=0;e<c.length;++e)i.push(wl(0));const u=o[0].shape[0];for(let e=0;e<c.length;++e){const t=c[e],r=i[e];i[e]=Ys((()=>ll(i[e],fl(u,t)))),l>0&&Zs(r)}Zs(c),s+=u,++l}return i})),t.done){n&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${r.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let e=0;e<i.length;++e){const t=i[e];i[e]=ul(i[e],s),Zs(t)}return ng(i)}(this,e,t)}checkNumSamples(e,t,r,n="steps"){let a;if(null!=r){if(a=null,null!=t)throw new Km(`If ${n} is set, batchSize must be null or undefined.Got batchSize = ${t}`)}else{if(null==e)throw new Km(`Either the input data should have a defined shape, or ${n} shoud be specified.`);a=Array.isArray(e)?e[0].shape[0]:e.shape[0]}return a}execute(e,t){if(Array.isArray(t)&&0===t.length)throw new Km("`outputs` is an empty Array, which is not allowed.");const r=Array.isArray(t),n=r?t:[t],a=this.retrieveSymbolicTensors(n),i=new ob;if(e instanceof Ga&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new Km(`The number of inputs provided (${e.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let t=0;t<this.inputs.length;++t)i.add(this.inputs[t],e[t])}else for(const t of this.inputs){const r=e[t.name];if(null==r)throw new Km(`No value is provided for the model's input ${t.name}`);i.add(t,r)}const o=cb(a,i);return r?o:o[0]}retrieveSymbolicTensors(e){const t=eg(null,e.length);let r=e.length;for(const n of this.layers){const a=Array.isArray(n.output)?n.output:[n.output],i=a.map((e=>e.name));for(let n=0;n<e.length;++n){const o=i.indexOf(e[n]);if(-1!==o&&(t[n]=a[o],r--),0===r)break}if(0===r)break}if(r>0){const r=[];throw t.forEach(((t,n)=>{null==t&&r.push(e[n])})),new Km(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(r)}`)}return t}predictLoop(e,t=32,r=!1){return Ys((()=>{const n=this.checkNumSamples(e);if(r)throw new Jm("Verbose predictLoop() is not implemented yet.");const a=kb(n,t),i=this.outputs.map((e=>[]));for(let t=0;t<a.length;++t)Ys((()=>{const r=a[t][0],n=a[t][1],i=_b(e,r,n),o=[];if(Array.isArray(i))for(let e=0;e<i.length;++e)o.push({key:this.inputs[e],value:i[e]});else o.push({key:this.inputs[0],value:i});const s=new ob(o);return cb(this.outputs,s)})).forEach(((e,t)=>i[t].push(e)));return ng(i.map((e=>pc(e,0))))}))}predict(e,t={}){const r=Db(e);Eb(r,this.inputNames,this.feedInputShapes,!1);try{const n=null==t.batchSize?32:t.batchSize;return xb(n),this.predictLoop(r,n)}finally{Tb(r,e)}}predictOnBatch(e){Eb(e,this.inputNames,this.feedInputShapes,!0);const t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,r=!0,n){if(null==this.optimizer_)throw new Zm("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const a=[];for(let e=0;e<this.feedOutputShapes.length;++e){const t=this.feedOutputShapes[e];this.feedLossFns[e]===Rv?a.push(t.slice(0,t.length-1).concat([1])):a.push(t)}if(function(e,t,r){const n=pg(e.map((e=>e.shape[0])));n.sort();const a=pg(t.map((e=>e.shape[0])));if(a.sort(),n.length>1)throw new Km(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map((e=>e.shape)))}`);if(a.length>1)throw new Km(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map((e=>e.shape)))}`);if(n.length>0&&a.length>0&&!ce(n,a))throw new Km(`Input Tensors should have the same number of samples as target Tensors. Found ${n[0]} input sample(s) and ${a[0]} target sample(s).`)}(e=Mb(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=Mb(t,this.feedOutputNames,a,!1,"target")),function(e,t,r){const n=[Nv,Lv,Pv];for(let a=0;a<e.length;++a){const i=e[a],o=t[a],s=r[a];if(null!=o){if(o===Pv&&1===i.shape[i.shape.length-1])throw new Km(`You are passing a target array of shape ${i.shape} while using a loss 'categorical_crossentropy'. 'categorical_crossentropy'expects targets to be binary matrices (1s and 0s) of shape [samples, classes].`);if(-1!==n.indexOf(o)){const e=i.shape.slice(1),t=s.slice(1);for(let r=0;r<e.length;++r){const n=e[r],a=t[r];if(null!=a&&n!==a)throw new Km(`A target Tensor with shape ${i.shape} was passed for an output of shape ${s}, while using a loss function that expects targets to have the same shape as the output.`)}}}}}(t,this.feedLossFns,this.feedOutputShapes),this.stateful&&null!=n&&n>0&&e[0].shape[0]%n!=0)throw new Km(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${n}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,r,n,a=!0,i){const[o,s]=this.standardizeUserDataXY(e,t,a,i);if(null!=r)throw new Error("sample weight is not supported yet.");let l=null;if(null!=n){const e=db(n,this.outputNames);l=[];for(let t=0;t<e.length;++t)l.push(await mb(s[t],null,e[t]))}return[o,s,l]}testLoop(e,t,r,n=0,a){return Ys((()=>{const i=this.checkNumSamples(t,r,a,"steps"),o=[];if(n>0)throw new Jm("Verbose mode is not implemented yet.");if(null!=a)throw new Jm("steps mode in testLoop() is not implemented yet");{const n=kb(i,r),a=Qf(Kg(0,i));for(let r=0;r<n.length;++r){const i=n[r][0],s=n[r][1],l=ey(a,i,s-i),c=wb(t,l),u=e(c);if(0===r)for(let e=0;e<u.length;++e)o.push(wl(0));for(let e=0;e<u.length;++e){const t=u[e];o[e]=ll(o[e],fl(s-i,t))}}for(let e=0;e<o.length;++e)o[e]=ul(o[e],i)}return o}))}getDedupedMetricsNames(){const e=this.metricsNames,t=[];for(let r=0;r<e.length;++r){const n=e[r];let a=n;rg(e,n)>1&&(a+=`_${rg(e.slice(0,r),n)}`),t.push(a)}return t}makeTrainFunction(){return e=>{const t=[],r=e.slice(0,this.inputs.length),n=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),a=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+2*this.outputs.length),i=[],o=this.collectedTrainableWeights.map((e=>e.read()));return[this.optimizer_.minimize((()=>{const e=[];for(let t=0;t<this.inputs.length;++t)e.push({key:this.inputs[t],value:r[t]});const o=new ob(e),s=cb(this.outputs,o,{training:!0});let l;for(let e=0;e<this.lossFunctions.length;++e){let r=(0,this.lossFunctions[e])(n[e],s[e]);null!=a[e]&&(r=gb(r,a[e]));const i=Uu(r);t.push(i),l=0===e?r:ll(l,r)}for(let e=0;e<this.metricsTensors.length;++e){let r;if(this.outputs.length>1&&e<this.outputs.length)r=t[e];else{const t=this.metricsTensors[e][0],a=this.metricsTensors[e][1];r=Uu(t(n[a],s[a]))}Ks(r),i.push(r)}return l=Uu(l),this.calculateLosses().forEach((e=>{l=ll(l,e)})),l}),!0,o)].concat(i)}}makeTestFunction(){this.testFunction=e=>Ys((()=>{const t=[];let r;const n=e.slice(0,this.inputs.length),a=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),i=[];for(let e=0;e<this.inputs.length;++e)i.push({key:this.inputs[e],value:n[e]});const o=new ob(i),s=cb(this.outputs,o);for(let e=0;e<this.lossFunctions.length;++e){const n=this.lossFunctions[e],i=Uu(n(a[e],s[e]));r=0===e?i:ll(r,i),t.push(r)}for(let e=0;e<this.metricsTensors.length;++e){const r=this.metricsTensors[e][0],n=this.metricsTensors[e][1],i=Uu(r(a[n],s[n]));t.push(i)}return t}))}async fit(e,t,r={}){return async function(e,t,r,n={}){if(e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");let a,i,o,s,l,c,u,f,p;e.isTraining=!0;try{const h=null==n.batchSize?32:n.batchSize;xb(h);const d=!1,m=await e.standardizeUserData(t,r,n.sampleWeight,n.classWeight,d,h);a=m[0],i=m[1],p=m[2];let g,y=!1;if(null!=n.validationData&&n.validationData.length>0){if(y=!0,2!==n.validationData.length)throw 3===n.validationData.length?new Jm("validationData including sample weights is not supported yet."):new Km(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${n.validationData} is invalid.`);l=n.validationData[0],c=n.validationData[1];const t=!0,r=await e.standardizeUserData(l,c,null,null,t,h);u=r[0],f=r[1],g=u.concat(f)}else if(null!=n.validationSplit&&n.validationSplit>0&&n.validationSplit<1){y=!0;const e=Math.floor(a[0].shape[0]*(1-n.validationSplit)),t=a[0].shape[0];u=_b(a,e,t),o=a,a=_b(a,0,e),f=_b(i,e,t),s=i,i=_b(i,0,e),g=u.concat(f)}else null!=n.validationSteps&&(y=!0);const v=a.concat(i).concat(p);e.checkTrainableWeightsConsistency();const b=e.makeTrainFunction(),x=e.getDedupedMetricsNames();let _,w;y?(e.makeTestFunction(),_=e.testFunction,w=x.slice().concat(x.map((e=>"val_"+e)))):(_=null,g=[],w=x.slice());const k=Av(n.callbacks,n.yieldEvery),D=await async function(e,t,r,n,a,i,o,s,l,c,u,f,p,h,d){null==a&&(a=32),null==i&&(i=1),null==u&&(u=!0),null==p&&(p=0);let m=!1;null!=l&&null!=c&&(m=!0);const g=e.checkNumSamples(r,a,h,"steps_per_epoch");let y;null!=g&&(y=Kg(0,g)),null==o&&(o=1);const{callbackList:v,history:b}=Mv(s,o,i,p,g,h,a,m,f);v.setModel(e),e.history=b,await v.onTrainBegin(),e.stopTraining_=!1;for(let o=p;o<i;++o){await v.onEpochBegin(o);const i={};{if("batch"===u)throw new Jm("batch shuffling is not implemneted yet");u&&Y(y);const o=Qf(y),s=kb(g,a);for(let u=0;u<s.length;++u){const f={};if(await v.onBatchBegin(u,f),Ys((()=>{const p=s[u][0],h=s[u][1],d=ey(o,p,h-p);f.batch=u,f.size=h-p;const g=wb(r,d),y=t(g);for(let e=0;e<n.length;++e){const t=n[e],r=y[e];f[t]=r,Ks(r)}if(u===s.length-1&&m){const t=e.testLoop(l,c,a);for(let e=0;e<n.length;++e){const r=n[e],a=t[e];Ks(a),i["val_"+r]=a}}})),await v.onBatchEnd(u,f),bv(f),e.stopTraining_)break}o.dispose()}if(await v.onEpochEnd(o,i),e.stopTraining_)break}return await v.onTrainEnd(),await e.history.syncData(),e.history}(e,b,v,x,h,n.epochs,n.verbose,k,_,g,n.shuffle,w,n.initialEpoch,null);return D}finally{e.isTraining=!1,Tb(a,t),Tb(i,r),Tb(o,t),Tb(s,r),Tb(u,l),Tb(f,c),null!=p&&Zs(p)}}(this,e,t,r)}async fitDataset(e,t){return async function(e,t,r){const n=null!=r.batchesPerEpoch;if(ne(null!=e.optimizer,(()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig).")),ne(null!=r,(()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call.")),ne(null!=r.epochs&&r.epochs>0&&Number.isInteger(r.epochs),(()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${r.epochs}`)),ne(!n||r.batchesPerEpoch>0&&Number.isInteger(r.batchesPerEpoch),(()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${r.batchesPerEpoch}`)),ne(null==r.validationSplit,(()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead.")),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{const a=null!=r.validationData;let i,o;if(a)if(bb(r.validationData))ne(null==r.validationBatches||r.validationBatches>0&&Number.isInteger(r.validationBatches),(()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${r.validationBatches}`));else{const e=function(e){if(3===e.length)throw new Jm("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(r.validationData);i=e.xs,o=e.ys}const s=e.makeTrainFunction(),l=e.getDedupedMetricsNames();let c;c=a?l.slice().concat(l.map((e=>"val_"+e))):l.slice();const u=Av(r.callbacks,r.yieldEvery),f=null==r.verbose?1:r.verbose,{callbackList:p,history:h}=Mv(u,f,r.epochs,null,null,function(e,t){let r=null;return null!=t.batchesPerEpoch?r=t.batchesPerEpoch:Number.isFinite(e.size)&&(r=e.size),r}(t,r),null,a,c);p.setModel(e),e.history=h,await p.onTrainBegin(),e.stopTraining_=!1;let d=null==r.initialEpoch?0:r.initialEpoch,m=await t.iterator();for(;d<r.epochs;){const c={};await p.onEpochBegin(d);let u=0,f=0;for(n||(m=await t.iterator());!n||u<r.batchesPerEpoch;){const t=await m.next();if(n&&t.done){console.warn(`You provided \`batchesPerEpoch\` as ${r.batchesPerEpoch}, but your dataset iterator ran out of data after ${u} batches; interrupting training. Make sure that your dataset can generate at least \`batchesPerEpoch * epochs\` batches (in this case, `+r.batchesPerEpoch*r.epochs+" batches). You may need to use the repeat() function when building your dataset.");break}if(null!=t.value){const{xs:n,ys:a}=yb(e,t.value),i={};i.batch=f,i.size=n[0].shape[0],await p.onBatchBegin(f,i);const o=[];if(null!=r.classWeight){const t=db(r.classWeight,e.outputNames);for(let e=0;e<t.length;++e)o.push(await mb(a[e],null,t[e]))}const c=n.concat(a).concat(o),h=s(c);Zs(c);for(let e=0;e<l.length;++e){const t=l[e],r=h[e];i[t]=r,Ks(r)}await p.onBatchEnd(f,i),bv(i),f++,u++}if(n?u>=r.batchesPerEpoch:t.done){if(a){let t;t=bb(r.validationData)?ag(await e.evaluateDataset(r.validationData,{batches:r.validationBatches})):ag(e.evaluate(i,o,{batchSize:null==r.validationBatchSize?32:r.validationBatchSize,verbose:0}));for(let r=0;r<e.metricsNames.length;++r)c[`val_${e.metricsNames[r]}`]=t[r]}break}if(e.stopTraining_)break}if(await p.onEpochEnd(d,c),d++,e.stopTraining_)break}return await p.onTrainEnd(),await e.history.syncData(),e.history}finally{e.isTraining=!1}}(this,e,t)}async trainOnBatch(e,t){const r=await this.standardizeUserData(e,t),n=r[0],a=r[1],i=this.makeTrainFunction()(n.concat(a)),o=[];for(const e of i){const t=await e.data();o.push(t[0])}return Zs(i),Tb(r[0],e),Tb(r[1],t),ng(o)}getNamedWeights(e){const t=[],r=null!=e&&e.trainableOnly,n=r?this.trainableWeights:this.weights,a=this.getWeights(r);for(let e=0;e<n.length;++e)r&&!n[e].trainable||t.push({name:n[e].originalName,tensor:a[e]});return t}set stopTraining(e){this.stopTraining_=e}get stopTraining(){return this.stopTraining_}get optimizer(){return this.optimizer_}set optimizer(e){this.optimizer_!==e&&(this.optimizer_=e,this.isOptimizerOwned=!1)}dispose(){const e=super.dispose();if(0===e.refCountAfterDispose&&null!=this.optimizer&&this.isOptimizerOwned){const t=Gs().numTensors;this.optimizer_.dispose(),e.numDisposedVariables+=t-Gs().numTensors}return e}getLossIdentifiers(){let e;if("string"==typeof this.loss)e=ig(this.loss);else if(Array.isArray(this.loss)){for(const e of this.loss)if("string"!=typeof e)throw new Error("Serialization of non-string loss is not supported.");e=this.loss.map((e=>ig(e)))}else{const t=Object.keys(this.loss);e={};const r=this.loss;for(const n of t){if("string"!=typeof r[n])throw new Error("Serialization of non-string loss is not supported.");e[n]=ig(r[n])}}return e}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[ig(Zv(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map((e=>ig(Zv(e))));{const e={};for(const t in this.metrics)e[t]=ig(Zv(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(null!=e.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=e.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=e.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");const t=Ev(nb(e.optimizer_config));let r,n;if("string"==typeof e.loss)r=og(e.loss);else if(Array.isArray(e.loss))r=e.loss.map((e=>og(e)));else if(null!=e.loss){r={};for(const t in e.loss)r[t]=og(e.loss[t])}if(Array.isArray(e.metrics))n=e.metrics.map((e=>og(e)));else if(null!=e.metrics){n={};for(const t in e.metrics)n[t]=og(e.metrics[t])}this.compile({loss:r,metrics:n,optimizer:t})}async save(e,t){if("string"==typeof e){const t=Wi(e);if(0===t.length)throw new Km(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Km(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Km("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const r=await Ni(this.getNamedWeights(t)),n={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:`TensorFlow.js tfjs-layers v${ib}`,convertedBy:null};if(null!=t&&t.includeOptimizer&&null!=this.optimizer){n.trainingConfig=this.getTrainingConfig();const e="optimizer",{data:t,specs:a}=await Ni(await this.optimizer.getWeights(),e);r.specs.push(...a),r.data=Li([r.data,t])}if(null!=this.userDefinedMetadata){const e=!0;Kv(this.userDefinedMetadata,this.name,e),n.userDefinedMetadata=this.userDefinedMetadata}return n.weightData=r.data,n.weightSpecs=r.specs,e.save(n)}setUserDefinedMetadata(e){Kv(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}Cb.className="Model",Ms(Cb);class Nb extends Cb{}async function Ob(e,t){"modelTopology"in e||(e={modelTopology:e});let r=(e=e).modelTopology;null!=r.model_config&&(r=r.model_config);const n=Ev(nb(r),t);if(null!=e.weightsManifest){const t=await Ro(e.weightsManifest,e.pathPrefix,n.weights.map((e=>e.originalName))),r={};for(const e of n.weights)r[e.originalName]=t[e.originalName];n.loadWeights(r),Zs(t)}return n}Nb.className="Functional",Ms(Nb);class Ib extends Cb{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=null!=e.name?e.name:ev("sequential_"),null!=e.layers)for(const t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some((e=>e<0)))throw new Km(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const t=e instanceof Ib||e instanceof Cb;let r;if(t){if(r=e,1!==r.outputs.length)throw new Km("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==r.inputs.length)throw new Km("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===e.inboundNodes.length){if(null==e.batchInputShape)throw new Km("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const t=yv({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(t)}if(t)this.outputs=r.outputs,this.inputs=r.inputs;else{if(1!==e.inboundNodes.length)throw new Km(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(1!==e.inboundNodes[0].outputTensors.length)throw new Km("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=mv(this.outputs[0])}this.inboundNodes=[],new pv({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:eg(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map((e=>e.shape)),outputShapes:this.outputs[0].shape})}else{const t=e.apply(this.outputs[0]);if(Array.isArray(t))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[t],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{const e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return null==this.model&&this.build(),this.model.call(e,t)}build(e){if(av(e),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new Cb({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,r=console.log){this.built||this.build(),super.summary(e,t,r)}setWeights(e){null==this.model&&this.build(),this.model.setWeights(e)}evaluate(e,t,r={}){if(!this.built)throw new Zm("The model needs to be compiled before being used.");return this.model.evaluate(e,t,r)}async evaluateDataset(e,t){if(!this.built)throw new Zm("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return null==this.model&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return null==this.model&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return null==this.model?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,r={}){if(!this.built)throw new Zm("The model needs to be compiled before being used.");return this.model.fit(e,t,r)}async fitDataset(e,t){if(!this.built)throw new Zm("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,r={},n=!1){let a,i={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new Km("Legacy serialization format not supported yet.");a=t}else ne(null!=t.layers,(()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field.")),a=t.layers,delete t.layers,i=t;const o=new e(i);if(!(o instanceof Ib))throw new Jm(`Sequential.fromConfig called on non-Sequential input: ${o}`);for(const e of a){const t=Ev(e,void 0,n);n&&t.setFastWeightInitDuringBuild(!0),o.add(t)}return o}set stopTraining(e){if(null==this.model)throw new Km("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(null==this.model)throw new Km("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){const e=[];for(const t of this.layers){const r={};r.className=t.getClassName(),r.config=t.getConfig(),e.push(r)}return{name:this.name,layers:e}}}function Pb(e){return new Cb(e)}function Rb(e){return new Ib(e)}function Lb(e,t){return null==t&&(t={}),async function(e,t){if(null==t&&(t={}),"string"==typeof e){const r=Hi(e,t);if(0===r.length)r.push(Uo(e,t));else if(r.length>1)throw new Km(`Found more than one (${r.length}) load handlers for URL '${e}'`);e=r[0]}return async function(e,t,r){if(null==r&&(r={}),null==e.load)throw new Km("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const n=await e.load();let a=n.modelTopology;null!=a.model_config&&(a=a.model_config);const i=null==r.strict||r.strict,o=null!=n.weightData&&null!=n.weightSpecs&&i,s=Ev(nb(a),void 0,o),l=n.trainingConfig;if(null!=l&&s.loadTrainingConfig(l),null!=n.userDefinedMetadata&&s.setUserDefinedMetadata(n.userDefinedMetadata),null!=n.weightData){if(null==n.weightSpecs)throw new Km("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");const{modelWeights:e,optimizerWeights:t}=function(e,t){const r=Oi(e,t),n={},a=[];return t.forEach((e=>{"optimizer"===e.group?a.push({name:e.name,tensor:r[e.name]}):n[e.name]=r[e.name]})),{modelWeights:n,optimizerWeights:a}}(n.weightData,n.weightSpecs);s.loadWeights(e,i),null!=s.optimizer&&t.length>0&&await s.optimizer.setWeights(t),Zs(e),Zs(t.map((e=>e.tensor)))}return s}(e,0,t)}(e,t)}function Fb(e){return yv(e)}function Bb(e,t){Sv.registerCallbackConstructor(e,t)}Ib.className="Sequential",Ms(Ib);class zb extends As{getConfig(){return{}}}class jb extends zb{apply(e,t=1){return function(e,t=1){if(1!==t)throw new Jm(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return Kc(e)}(e,t)}}jb.className="elu",Ms(jb);class Ub extends zb{apply(e){return Nf(e)}}Ub.className="selu",Ms(Ub);class $b extends zb{apply(e){return wf(e)}}$b.className="relu",Ms($b);class Vb extends zb{apply(e){return Ys((()=>Hu(6,wf(e))))}}Vb.className="relu6",Ms(Vb);class qb extends zb{apply(e){return e}}qb.className="linear",Ms(qb);class Wb extends zb{apply(e){return hc(e)}}Wb.className="sigmoid",Ms(Wb);class Hb extends zb{apply(e){return function(e){return Ys((()=>{const t=ll(.5,fl(.2,e));return Ac(t,0,1)}))}(e)}}Hb.className="hardSigmoid",Ms(Hb);class Gb extends zb{apply(e){return xu(e)}}Gb.className="softplus",Ms(Gb);class Xb extends zb{apply(e){return function(e){return Ys((()=>ul(e,ll(Cl(e),1))))}(e)}}Xb.className="softsign",Ms(Xb);class Yb extends zb{apply(e){return mc(e)}}Yb.className="tanh",Ms(Yb);class Zb extends zb{apply(e,t=-1){return Uf(e,t)}}Zb.className="softmax",Ms(Zb);class Kb extends zb{apply(e,t=-1){return Du(e,t)}}Kb.className="logSoftmax",Ms(Kb);class Jb extends zb{apply(e,t=1){return Ys((()=>fl(hc(fl(e,t)),e)))}}Jb.className="swish",Ms(Jb);class Qb extends zb{apply(e){return Ys((()=>fl(e,mc(xu(e)))))}}function ex(e){return e.getClassName()}function tx(e,t={}){return ug(e,Ss.getMap().classNameMap,t,"activation")}function rx(e){if(null==e){return tx({className:"linear",config:{}})}if("string"==typeof e){const t={};return t.className=e,t.config={},tx(t)}return e instanceof zb?e:tx(e)}function nx(e){if(null!=e&&"object"!=typeof e)throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}Qb.className="mish",Ms(Qb);class ax extends As{}class ix extends ax{constructor(e){super(),nx(e),this.l1=null==e||null==e.l1?.01:e.l1,this.l2=null==e||null==e.l2?.01:e.l2,this.hasL1=0!==this.l1,this.hasL2=0!==this.l2}apply(e){return Ys((()=>{let t=$u([1]);return this.hasL1&&(t=ll(t,ku(fl(this.l1,Cl(e))))),this.hasL2&&(t=ll(t,ku(fl(this.l2,cy(e))))),cc(t,[])}))}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}}ix.className="L1L2",Ms(ix);const ox={l1l2:"L1L2"};function sx(e){return lg(e)}function lx(e,t={}){return ug(e,Ss.getMap().classNameMap,t,"regularizer")}function cx(e){return null==e?null:"string"==typeof e?lx({className:e in ox?ox[e]:e,config:{}}):e instanceof ax?e:lx(e)}class ux extends dv{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,null!=e&&(this.maxValue=e.maxValue)}call(e,t){e=nv(e);let r=wf(e);return null!=this.maxValue&&(r=Ac(r,0,this.maxValue)),r}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}}ux.className="ReLU",Ms(ux);class fx extends dv{constructor(e){super(null==e?{}:e),this.DEFAULT_ALPHA=.3,null==e&&(e={}),this.alpha=null==e.alpha?this.DEFAULT_ALPHA:e.alpha}call(e,t){const r=nv(e);return pu(r,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}fx.className="LeakyReLU",Ms(fx);class px extends dv{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),this.supportsMasking=!0,this.alphaInitializer=Ry(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=cx(e.alphaRegularizer),this.alphaConstraint=Mg(e.alphaConstraint),null==e.sharedAxes)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else{if("number"!=typeof e.sharedAxes)throw new Km(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`);this.sharedAxes=[e.sharedAxes]}}build(e){const t=(e=av(e)).slice(1);if(null!=this.sharedAxes)for(const e of this.sharedAxes)t[e-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);const r={};if(null!=this.sharedAxes)for(let t=1;t<e.length;++t)r[t]=e[t];this.inputSpec=[new cv({ndim:e.length,axes:r})],this.built=!0}call(e,t){return e=nv(e),cf(e,this.alpha.read())}getConfig(){const e={alphaInitializer:Py(this.alphaInitializer),alphaRegularizer:sx(this.alphaRegularizer),alphaConstraint:Ag(this.alphaConstraint),sharedAxes:this.sharedAxes},t=super.getConfig();return Object.assign(e,t),e}}px.className="PReLU",Ms(px);class hx extends dv{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA=1,null==e&&(e={}),null!=e.alpha&&e.alpha!==this.DEFAULT_ALPHA)throw new Jm(`Non-default alpha value (${e.alpha}) is not supported by the ELU layer yet.`);this.alpha=null==e.alpha?this.DEFAULT_ALPHA:e.alpha}call(e,t){const r=nv(e);return Kc(r)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}hx.className="ELU",Ms(hx);class dx extends dv{constructor(e){super(null==e?{}:e),this.DEFAULT_THETA=1,null==e&&(e={}),this.theta=null==e.theta?this.DEFAULT_THETA:e.theta}call(e,t){const r=nv(e);return fl(r,Ao(ou(r,this.theta),"float32"))}computeOutputShape(e){return e}getConfig(){const e={theta:this.theta},t=super.getConfig();return Object.assign(e,t),e}}dx.className="ThresholdedReLU",Ms(dx);class mx extends dv{constructor(e){super(null==e?{}:e),this.DEFAULT_AXIS=1,null==e&&(e={}),this.softmax=(new Zb).apply,this.axis=null==e.axis?this.DEFAULT_AXIS:e.axis}call(e,t){const r=nv(e);return this.softmax(r,this.axis)}computeOutputShape(e){return e}getConfig(){const e={axis:this.axis},t=super.getConfig();return Object.assign(e,t),e}}function gx(e,t,r){if("number"==typeof e)return eg(e,t);if(e.length!==t)throw new Km(`The ${r} argument must be an integer or tuple of ${t} integers. Received: ${e.length} elements.`);for(let a=0;a<t;++a){const i=e[a];if((n=i)!==parseInt(n.toString(),10))throw new Km(`The ${r} argument must be an integer or tuple of ${t} integers. Received: ${JSON.stringify(e)} including a non-integer number ${i}`)}return e;var n}function yx(e,t,r,n,a=1){if(null==e)return e;let i;return i="same"===r?e:e-(t+(t-1)*(a-1))+1,Math.floor((i+n-1)/n)}function vx(e,t,r,n){if(null==e)return null;if("valid"===n)e=e*t+Zg([r-t,0]);else{if("same"!==n)throw new Km(`Unsupport padding mode: ${n}.`);e*=t}return e}function bx(e,t){return Ys((()=>(zg(t),"channelsFirst"===t?Xo(e,[0,2,3,1]):e)))}function xx(e,t){return Ys((()=>(zg(t),"channelsFirst"===t?Xo(e,[0,2,3,4,1]):e)))}function _x(e,t,r,n=[1,1],a="valid",i,o,s=null){return Ys((()=>{if(null==i&&(i="channelsLast"),zg(i),3!==e.rank&&4!==e.rank)throw new Km(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(3!==t.rank&&4!==t.rank)throw new Km(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=bx(e,i);if("causal"===a)throw new Jm("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=Mp({x:l,filter:t,strides:n,pad:"same"===a?"same":"valid",dilations:o,dataFormat:"NHWC",bias:r,activation:s}),"channelsFirst"===i&&(l=Xo(l,[0,3,1,2])),l}))}mx.className="Softmax",Ms(mx);class wx extends dv{constructor(e,t){if(super(t),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",wx.verifyArgs(t),this.rank=e,gg(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new Jm(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=gx(t.kernelSize,e,"kernelSize"),this.strides=gx(null==t.strides?1:t.strides,e,"strides"),this.padding=null==t.padding?"valid":t.padding,jg(this.padding),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,zg(this.dataFormat),this.activation=rx(t.activation),this.useBias=null==t.useBias||t.useBias,this.biasInitializer=Ry(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=Mg(t.biasConstraint),this.biasRegularizer=cx(t.biasRegularizer),this.activityRegularizer=cx(t.activityRegularizer),this.dilationRate=gx(null==t.dilationRate?1:t.dilationRate,e,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new Km(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(2===this.rank){if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate];else if(2!==this.dilationRate.length)throw new Km(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(3===this.rank)if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(3!==this.dilationRate.length)throw new Km(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(e){if(tg("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!mg(e.kernelSize,"number",1,3))throw new Km(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){const e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:ex(this.activation),useBias:this.useBias,biasInitializer:Py(this.biasInitializer),biasRegularizer:sx(this.biasRegularizer),activityRegularizer:sx(this.activityRegularizer),biasConstraint:Ag(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}class kx extends wx{constructor(e,t){super(e,t),this.kernel=null,kx.verifyArgs(t),this.filters=t.filters,gg(this.filters,"filters"),this.kernelInitializer=Ry(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=Mg(t.kernelConstraint),this.kernelRegularizer=cx(t.kernelRegularizer)}build(e){e=av(e);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new Km(`The channel dimension of the input should be defined. Found ${e[t]}`);const r=e[t],n=this.kernelSize.concat([r,this.filters]);this.kernel=this.addWeight("kernel",n,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:r}}],this.built=!0}call(e,t){return Ys((()=>{let t;e=nv(e);const r=null==this.bias?null:this.bias.read(),n=vg(this.activation.getClassName());if(null!=n&&2===this.rank)t=_x(e,this.kernel.read(),r,this.strides,this.padding,this.dataFormat,this.dilationRate,n);else{if(1===this.rank)t=function(e,t,r,n=1,a="valid",i,o=1){return Ys((()=>{if(null==i&&(i="channelsLast"),zg(i),3!==e.shape.length)throw new Km(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(3!==t.shape.length)throw new Km(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(null!=r&&1!==r.shape.length)throw new Km(`The bias for a conv1dWithBias operation should be 1, but is ${t.shape.length} instead`);if("channelsFirst"===i&&(e=Xo(e,[0,2,1])),"causal"===a)throw new Jm("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let s=Oc(e,t,n,"same"===a?"same":"valid","NWC",o);return null!=r&&(s=fy(s,r)),s}))}(e,this.kernel.read(),r,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)t=_x(e,this.kernel.read(),r,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new Jm("convolutions greater than 3D are not implemented yet.");t=function(e,t,r,n=[1,1,1],a="valid",i,o){return Ys((()=>{if(null==i&&(i="channelsLast"),zg(i),4!==e.rank&&5!==e.rank)throw new Km(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(4!==t.rank&&5!==t.rank)throw new Km(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let s=xx(e,i);if("causal"===a)throw new Jm("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return s=Rc(s,t,n,"same"===a?"same":"valid","NDHWC",o),null!=r&&(s=fy(s,r)),"channelsFirst"===i&&(s=Xo(s,[0,4,1,2,3])),s}))}(e,this.kernel.read(),r,this.strides,this.padding,this.dataFormat,this.dilationRate)}null!=this.activation&&(t=this.activation.apply(t))}return t}))}computeOutputShape(e){e=av(e);const t=[],r="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2);for(let e=0;e<r.length;++e){const n=yx(r[e],this.kernelSize[e],this.padding,this.strides[e],"number"==typeof this.dilationRate?this.dilationRate:this.dilationRate[e]);t.push(n)}let n=[e[0]];return"channelsLast"===this.dataFormat?(n=n.concat(t),n.push(this.filters)):(n.push(this.filters),n=n.concat(t)),n}getConfig(){const e={filters:this.filters,kernelInitializer:Py(this.kernelInitializer),kernelRegularizer:sx(this.kernelRegularizer),kernelConstraint:Ag(this.kernelConstraint)},t=super.getConfig();return Object.assign(e,t),e}static verifyArgs(e){if(!("filters"in e)||"number"!=typeof e.filters||e.filters<1)throw new Km(`Convolution layer expected config.filters to be a 'number' > 0 but got ${JSON.stringify(e.filters)}`)}}class Dx extends kx{constructor(e){super(2,e),Dx.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!mg(e.kernelSize,"number",1,2))throw new Km(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}Dx.className="Conv2D",Ms(Dx);class Tx extends kx{constructor(e){super(3,e),Tx.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&(!Array.isArray(e.kernelSize)||1!==e.kernelSize.length&&3!==e.kernelSize.length))throw new Km(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}Tx.className="Conv3D",Ms(Tx);class Ax extends Dx{constructor(e){if(super(e),this.inputSpec=[new cv({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new Km(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(4!==(e=av(e)).length)throw new Km("Input should have rank 4; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new Km("The channel dimension of the inputs should be defined. Found `None`.");const r=e[t],n=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight("kernel",n,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new cv({ndim:4,axes:{[t]:r}})],this.built=!0}call(e,t){return Ys((()=>{let t=nv(e);if(4!==t.shape.length)throw new Km(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const r=t.shape,n=r[0];let a,i;"channelsFirst"===this.dataFormat?(a=2,i=3):(a=1,i=2);const o=r[a],s=r[i],l=this.kernelSize[0],c=this.kernelSize[1],u=this.strides[0],f=this.strides[1],p=[n,vx(o,u,l,this.padding),vx(s,f,c,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Xo(t,[0,2,3,1]));let h=Pc(t,this.kernel.read(),p,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(h=Xo(h,[0,3,1,2])),null!=this.bias&&(h=fy(h,this.bias.read(),this.dataFormat)),null!=this.activation&&(h=this.activation.apply(h)),h}))}computeOutputShape(e){const t=(e=av(e)).slice();let r,n,a;"channelsFirst"===this.dataFormat?(r=1,n=2,a=3):(r=3,n=1,a=2);const i=this.kernelSize[0],o=this.kernelSize[1],s=this.strides[0],l=this.strides[1];return t[r]=this.filters,t[n]=vx(t[n],s,i,this.padding),t[a]=vx(t[a],l,o,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}Ax.className="Conv2DTranspose",Ms(Ax);class Sx extends Tx{constructor(e){if(super(e),this.inputSpec=[new cv({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new Km(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(5!==(e=av(e)).length)throw new Km("Input should have rank 5; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new Km("The channel dimension of the inputs should be defined. Found `None`.");const r=e[t],n=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight("kernel",n,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new cv({ndim:5,axes:{[t]:r}})],this.built=!0}call(e,t){return Ys((()=>{let t=nv(e);if(5!==t.shape.length)throw new Km(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const r=t.shape,n=r[0];let a,i,o;"channelsFirst"===this.dataFormat?(o=2,a=3,i=4):(o=1,a=2,i=3);const s=r[o],l=r[a],c=r[i],u=this.kernelSize[0],f=this.kernelSize[1],p=this.kernelSize[2],h=this.strides[0],d=this.strides[1],m=this.strides[2],g=[n,vx(s,h,u,this.padding),vx(l,d,f,this.padding),vx(c,m,p,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Xo(t,[0,2,3,4,1]));let y=Fc(t,this.kernel.read(),g,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(y=Xo(y,[0,4,1,2,3])),null!==this.bias&&(y=fy(y,this.bias.read(),this.dataFormat)),null!==this.activation&&(y=this.activation.apply(y)),y}))}computeOutputShape(e){const t=(e=av(e)).slice();let r,n,a,i;"channelsFirst"===this.dataFormat?(r=1,n=2,a=3,i=4):(r=4,n=1,a=2,i=3);const o=this.kernelSize[0],s=this.kernelSize[1],l=this.kernelSize[2],c=this.strides[0],u=this.strides[1],f=this.strides[2];return t[r]=this.filters,t[n]=vx(t[n],c,o,this.padding),t[a]=vx(t[a],u,s,this.padding),t[i]=vx(t[i],f,l,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}Sx.className="Conv3DTranspose",Ms(Sx);class Mx extends kx{constructor(e,t){if(super(e,t),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,null==t.filters)throw new Km("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=t.kernelInitializer||null!=t.kernelRegularizer||null!=t.kernelConstraint)throw new Km("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=t.padding&&"same"!==t.padding&&"valid"!==t.padding)throw new Km(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=null==t.depthMultiplier?1:t.depthMultiplier,this.depthwiseInitializer=Ry(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=cx(t.depthwiseRegularizer),this.depthwiseConstraint=Mg(t.depthwiseConstraint),this.pointwiseInitializer=Ry(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=cx(t.pointwiseRegularizer),this.pointwiseConstraint=Mg(t.pointwiseConstraint)}build(e){if((e=av(e)).length<this.rank+2)throw new Km(`Inputs to SeparableConv${this.rank}D should have rank ${this.rank+2}, but received input shape: ${JSON.stringify(e)}`);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t]||e[t]<0)throw new Km(`The channel dimension of the inputs should be defined, but found ${JSON.stringify(e[t])}`);const r=e[t],n=this.kernelSize.concat([r,this.depthMultiplier]),a=[];for(let e=0;e<this.rank;++e)a.push(1);a.push(r*this.depthMultiplier,this.filters);const i=!0;this.depthwiseKernel=this.addWeight("depthwise_kernel",n,"float32",this.depthwiseInitializer,this.depthwiseRegularizer,i,this.depthwiseConstraint),this.pointwiseKernel=this.addWeight("pointwise_kernel",a,"float32",this.pointwiseInitializer,this.pointwiseRegularizer,i,this.pointwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,i,this.biasConstraint):this.bias=null,this.inputSpec=[new cv({ndim:this.rank+2,axes:{[t]:r}})],this.built=!0}call(e,t){return Ys((()=>{let t;if(e=nv(e),1===this.rank)throw new Jm("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(e=Xo(e,[0,2,3,1])),t=Of(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(t=fy(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),"channelsFirst"===this.dataFormat&&(t=Xo(t,[0,3,1,2])),t}))}getConfig(){const e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=Py(this.depthwiseInitializer),e.pointwiseInitializer=Py(this.pointwiseInitializer),e.depthwiseRegularizer=sx(this.depthwiseRegularizer),e.pointwiseRegularizer=sx(this.pointwiseRegularizer),e.depthwiseConstraint=Ag(this.depthwiseConstraint),e.pointwiseConstraint=Ag(this.pointwiseConstraint),e}}Mx.className="SeparableConv";class Ex extends Mx{constructor(e){super(2,e)}}Ex.className="SeparableConv2D",Ms(Ex);class Cx extends kx{constructor(e){super(1,e),Cx.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){const e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!mg(e.kernelSize,"number",1,1))throw new Km(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}Cx.className="Conv1D",Ms(Cx);class Nx extends dv{constructor(e){super(e),"number"==typeof e.cropping?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:"number"==typeof e.cropping[0]?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=void 0===e.dataFormat?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return"channelsFirst"===this.dataFormat?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return Ys((()=>{if(e=nv(e),"channelsLast"===this.dataFormat){const t=ry(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return ry(t,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const t=ry(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return ry(t,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}}))}getConfig(){const e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}Nx.className="Cropping2D",Ms(Nx);class Ox extends dv{constructor(e){var t;super(e),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=null==e.size?this.DEFAULT_SIZE:e.size,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,zg(this.dataFormat),this.interpolation=null==e.interpolation?"nearest":e.interpolation,t=this.interpolation,dg(Pg,"InterpolationFormat",t)}computeOutputShape(e){if("channelsFirst"===this.dataFormat){const t=null==e[2]?null:this.size[0]*e[2],r=null==e[3]?null:this.size[1]*e[3];return[e[0],e[1],t,r]}{const t=null==e[1]?null:this.size[0]*e[1],r=null==e[2]?null:this.size[1]*e[2];return[e[0],t,r,e[3]]}}call(e,t){return Ys((()=>{let t=nv(e);const r=t.shape;if("channelsFirst"===this.dataFormat){t=Xo(t,[0,2,3,1]);const e=this.size[0]*r[2],n=this.size[1]*r[3],a="nearest"===this.interpolation?Sh.resizeNearestNeighbor(t,[e,n]):Sh.resizeBilinear(t,[e,n]);return Xo(a,[0,3,1,2])}{const e=this.size[0]*r[1],n=this.size[1]*r[2];return"nearest"===this.interpolation?Sh.resizeNearestNeighbor(t,[e,n]):Sh.resizeBilinear(t,[e,n])}}))}getConfig(){const e={size:this.size,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}Ox.className="UpSampling2D",Ms(Ox);class Ix extends wx{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=Ry(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=Mg(e.depthwiseConstraint),this.depthwiseRegularizer=cx(e.depthwiseRegularizer)}build(e){if((e=av(e)).length<4)throw new Km(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);const t="channelsFirst"===this.dataFormat?1:3;if(null==e[t]||e[t]<0)throw new Km(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);const r=e[t],n=[this.kernelSize[0],this.kernelSize[1],r,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",n,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[r*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return Ys((()=>{let t=function(e,t,r=[1,1],n="valid",a,i){return Ys((()=>{null==a&&(a="channelsLast"),zg(a);let o=bx(e,a);if(4!==e.rank)throw new Km(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(4!==t.rank)throw new Km(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return o=Vc(o,t,r,"same"===n?"same":"valid","NHWC",i),"channelsFirst"===a&&(o=Xo(o,[0,3,1,2])),o}))}(e=nv(e),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(t=fy(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),t}))}computeOutputShape(e){e=av(e);const t="channelsFirst"===this.dataFormat?e[2]:e[1],r="channelsFirst"===this.dataFormat?e[3]:e[2],n="channelsFirst"===this.dataFormat?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,a=yx(t,this.kernelSize[0],this.padding,this.strides[0]),i=yx(r,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],n,a,i]:[e[0],a,i,n]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=Py(this.depthwiseInitializer),e.depthwiseRegularizer=sx(this.depthwiseRegularizer),e.depthwiseConstraint=Ag(this.depthwiseRegularizer),e}}function Px(e,t,r,n){if(Array.isArray(e)){if(null!=t||null!=r)throw new Km("When inputs is an array, neither initialState or constants should be provided");null!=n&&(r=e.slice(e.length-n,e.length),e=e.slice(0,e.length-n)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function a(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=a(t),constants:r=a(r)}}function Rx(e,t,r,n=!1,a,i,o=!1,s=!1){return Ys((()=>{const l=t.shape.length;if(l<3)throw new Km(`Input should be at least 3D, but is ${l}D.`);const c=[1,0].concat(Kg(2,l));if(t=Xo(t,c),null!=i)throw new Jm("The rnn() functoin of the deeplearn.js backend does not support constants yet.");o&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),null!=a&&((a=Ao(Ao(a,"bool"),"float32")).rank===l-1&&(a=eu(a,-1)),a=Xo(a,c)),n&&(t=Df(t,0),null!=a&&(a=Df(a,0)));const u=[];let f,p=r;const h=t.shape[0],d=lp(t);let m,g;null!=a&&(m=lp(a));for(let t=0;t<h;++t){const r=d[t],n=Ys((()=>e(r,p)));if(null==a)f=n[0],p=n[1];else{const e=Ys((()=>{const e=m[t],r=Ml(Qu(e),e);return{output:ll(fl(n[0],e),fl(p[0],r)),newStates:p.map(((t,a)=>ll(fl(n[1][a],e),fl(t,r))))}}));f=e.output,p=e.newStates}s&&u.push(f)}return s&&(g=Yf(u,1)),[f,g,p]}))}Ix.className="DepthwiseConv2D",Ms(Ix);class Lx extends dv{constructor(e){let t;if(super(e),null==e.cell)throw new Km("cell property is missing for the constructor of RNN.");if(t=Array.isArray(e.cell)?new qx({cells:e.cell}):e.cell,null==t.stateSize)throw new Km("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=null!=e.returnSequences&&e.returnSequences,this.returnState=null!=e.returnState&&e.returnState,this.goBackwards=null!=e.goBackwards&&e.goBackwards,this._stateful=null!=e.stateful&&e.stateful,this.unroll=null!=e.unroll&&e.unroll,this.supportsMasking=!0,this.inputSpec=[new cv({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){return null==this.states_?Kg(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map((e=>null)):this.states_}setStates(e){this.states_=e}computeOutputShape(e){tv(e)&&(e=e[0]),e=e;let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);const r=t[0];let n;if(n=this.returnSequences?[e[0],e[1],r]:[e[0],r],this.returnState){const r=[];for(const n of t)r.push([e[0],n]);return[n].concat(r)}return n}computeMask(e,t){return Ys((()=>{Array.isArray(t)&&(t=t[0]);const e=this.returnSequences?t:null;if(this.returnState){const t=this.states.map((e=>null));return[e].concat(t)}return e}))}get states(){if(null==this.states_){const e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let r=0;r<e;++r)t.push(null);return t}return this.states_}set states(e){this.states_=e}build(e){if(null!=this.numConstants)throw new Jm("Constants support is not implemented in RNN yet.");tv(e)&&(e=e[0]),e=e;const t=this.stateful?e[0]:null,r=e.slice(2);this.inputSpec[0]=new cv({shape:[t,null,...r]});const n=[e[0]].concat(e.slice(2));let a;if(this.cell.build(n),a=Array.isArray(this.cell.stateSize)?this.cell.stateSize:[this.cell.stateSize],null!=this.stateSpec){if(!ce(this.stateSpec.map((e=>e.shape[e.shape.length-1])),a))throw new Km(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=a.map((e=>new cv({shape:[null,e]})));this.stateful&&this.resetStates()}resetStates(e,t=!1){Ys((()=>{if(!this.stateful)throw new Ym("Cannot call resetStates() on an RNN Layer that is not stateful.");const r=this.inputSpec[0].shape[0];if(null==r)throw new Km("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.states_)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>$u([r,e]))):this.states_=[$u([r,this.cell.stateSize])];else if(null==e)Zs(this.states_),null!=this.keptStates&&(Zs(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>$u([r,e]))):this.states_[0]=$u([r,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new Km(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);!0===t?this.keptStates.push(this.states_.slice()):Zs(this.states_);for(let t=0;t<this.states_.length;++t){const n=e[t],a=Array.isArray(this.cell.stateSize)?this.cell.stateSize[t]:this.cell.stateSize,i=[r,a];if(!ce(n.shape,i))throw new Km(`State ${t} is incompatible with layer ${this.name}: expected shape=${i}, received shape=${n.shape}`);this.states_[t]=n}}this.states_=this.states_.map((e=>Ks(e.clone())))}))}apply(e,t){let r=null==t?null:t.initialState,n=null==t?null:t.constants;null==t&&(t={});const a=Px(e,r,n,this.numConstants);e=a.inputs,r=a.initialState,n=a.constants;let i=[],o=[];if(null!=r){t.initialState=r,i=i.concat(r),this.stateSpec=[];for(const e of r)this.stateSpec.push(new cv({shape:e.shape}));o=o.concat(this.stateSpec)}if(null!=n&&(t.constants=n,i=i.concat(n),this.numConstants=n.length),i[0]instanceof uv){const r=[e].concat(i),n=this.inputSpec.concat(o),a=this.inputSpec;this.inputSpec=n;const s=super.apply(r,t);return this.inputSpec=a,s}return super.apply(e,t)}call(e,t){return Ys((()=>{const r=null==t?null:t.mask,n=null==t?null:t.training;let a=null==t?null:t.initialState;e=nv(e),null==a&&(a=this.stateful?this.states_:this.getInitialState(e));const i=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(a.length!==i)throw new Km(`RNN Layer has ${i} state(s) but was passed ${a.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");const o={training:n},s=Rx(((e,t)=>{const r=this.cell.call([e].concat(t),o);return[r[0],r.slice(1)]}),e,a,this.goBackwards,r,null,this.unroll,this.returnSequences),l=s[0],c=s[1],u=s[2];this.stateful&&this.resetStates(u,n);const f=this.returnSequences?c:l;return this.returnState?[f].concat(u):f}))}getInitialState(e){return Ys((()=>{let t=$u(e.shape);return t=ku(t,[1,2]),t=Qg(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map((e=>e>1?iy(t,[1,e]):t)):this.cell.stateSize>1?[iy(t,[1,this.cell.stateSize])]:[t]}))}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){const e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);const r=this.cell.getConfig();return this.getClassName()===Lx.className&&(t.cell={className:this.cell.getClassName(),config:r}),Object.assign({},r,e,t)}static fromConfig(e,t,r={}){const n=Ev(t.cell,r);return new e(Object.assign(t,{cell:n}))}}Lx.className="RNN",Ms(Lx);class Fx extends dv{}class Bx extends Fx{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,gg(this.units,"units"),this.activation=rx(null==e.activation?this.DEFAULT_ACTIVATION:e.activation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Ry(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Ry(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Ry(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=cx(e.kernelRegularizer),this.recurrentRegularizer=cx(e.recurrentRegularizer),this.biasRegularizer=cx(e.biasRegularizer),this.kernelConstraint=Mg(e.kernelConstraint),this.recurrentConstraint=Mg(e.recurrentConstraint),this.biasConstraint=Mg(e.biasConstraint),this.dropout=Yg([1,Zg([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Yg([1,Zg([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=av(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return Ys((()=>{if(2!==(e=e).length)throw new Km(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let r=e[1];e=e[0];const n=null!=t.training&&t.training;let a;0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=Wx({ones:()=>Qu(e),rate:this.dropout,training:n,dropoutFunc:this.dropoutFunc})),0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=Wx({ones:()=>Qu(r),rate:this.recurrentDropout,training:n,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,o=this.recurrentDropoutMask;a=sy(null!=i?fl(e,i):e,this.kernel.read()),null!=this.bias&&(a=fy(a,this.bias.read())),null!=o&&(r=fl(r,o));let s=ll(a,sy(r,this.recurrentKernel.read()));return null!=this.activation&&(s=this.activation.apply(s)),[s,s]}))}getConfig(){const e=super.getConfig(),t={units:this.units,activation:ex(this.activation),useBias:this.useBias,kernelInitializer:Py(this.kernelInitializer),recurrentInitializer:Py(this.recurrentInitializer),biasInitializer:Py(this.biasInitializer),kernelRegularizer:sx(this.kernelRegularizer),recurrentRegularizer:sx(this.recurrentRegularizer),biasRegularizer:sx(this.biasRegularizer),activityRegularizer:sx(this.activityRegularizer),kernelConstraint:Ag(this.kernelConstraint),recurrentConstraint:Ag(this.recurrentConstraint),biasConstraint:Ag(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},e,t)}}Bx.className="SimpleRNNCell",Ms(Bx);class zx extends Lx{constructor(e){e.cell=new Bx(e),super(e)}call(e,t){return Ys((()=>{null!=this.cell.dropoutMask&&(Zs(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Zs(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const r=null==t?null:t.mask,n=null==t?null:t.training,a=null==t?null:t.initialState;return super.call(e,{mask:r,training:n,initialState:a})}))}static fromConfig(e,t){return new e(t)}}zx.className="SimpleRNN",Ms(zx);class jx extends Fx{constructor(e){if(super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new Km("GRUCell does not support reset_after parameter set to true.");this.units=e.units,gg(this.units,"units"),this.activation=rx(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=rx(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Ry(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Ry(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Ry(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=cx(e.kernelRegularizer),this.recurrentRegularizer=cx(e.recurrentRegularizer),this.biasRegularizer=cx(e.biasRegularizer),this.kernelConstraint=Mg(e.kernelConstraint),this.recurrentConstraint=Mg(e.recurrentConstraint),this.biasConstraint=Mg(e.biasConstraint),this.dropout=Yg([1,Zg([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Yg([1,Zg([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){const t=(e=av(e))[e.length-1];this.kernel=this.addWeight("kernel",[t,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return Ys((()=>{if(2!==(e=e).length)throw new Km(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);const r=null!=t.training&&t.training;let n=e[1];e=e[0],0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=Wx({ones:()=>Qu(e),rate:this.dropout,training:r,count:3,dropoutFunc:this.dropoutFunc})),0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=Wx({ones:()=>Qu(n),rate:this.recurrentDropout,training:r,count:3,dropoutFunc:this.dropoutFunc}));const a=this.dropoutMask,i=this.recurrentDropoutMask;let o,s,l;0<this.dropout&&this.dropout<1&&(e=fl(e,a[0]));let c=sy(e,this.kernel.read());this.useBias&&(c=fy(c,this.bias.read())),0<this.recurrentDropout&&this.recurrentDropout<1&&(n=fl(n,i[0]));const u=this.recurrentKernel.read(),[f,p]=Wf(u,[2*this.units,this.units],u.rank-1),h=sy(n,f),[d,m,g]=Wf(c,3,c.rank-1),[y,v]=Wf(h,2,h.rank-1);o=this.recurrentActivation.apply(ll(d,y)),s=this.recurrentActivation.apply(ll(m,v));const b=sy(fl(s,n),p);l=this.activation.apply(ll(g,b));const x=ll(fl(o,n),fl(ll(1,bu(o)),l));return[x,x]}))}getConfig(){const e=super.getConfig(),t={units:this.units,activation:ex(this.activation),recurrentActivation:ex(this.recurrentActivation),useBias:this.useBias,kernelInitializer:Py(this.kernelInitializer),recurrentInitializer:Py(this.recurrentInitializer),biasInitializer:Py(this.biasInitializer),kernelRegularizer:sx(this.kernelRegularizer),recurrentRegularizer:sx(this.recurrentRegularizer),biasRegularizer:sx(this.biasRegularizer),activityRegularizer:sx(this.activityRegularizer),kernelConstraint:Ag(this.kernelConstraint),recurrentConstraint:Ag(this.recurrentConstraint),biasConstraint:Ag(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation,resetAfter:!1};return Object.assign({},e,t)}}jx.className="GRUCell",Ms(jx);class Ux extends Lx{constructor(e){0===e.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),e.cell=new jx(e),super(e)}call(e,t){return Ys((()=>{null!=this.cell.dropoutMask&&(Zs(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Zs(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const r=null==t?null:t.mask,n=null==t?null:t.training,a=null==t?null:t.initialState;return super.call(e,{mask:r,training:n,initialState:a})}))}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}Ux.className="GRU",Ms(Ux);class $x extends Fx{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,gg(this.units,"units"),this.activation=rx(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=rx(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Ry(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Ry(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Ry(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=cx(e.kernelRegularizer),this.recurrentRegularizer=cx(e.recurrentRegularizer),this.biasRegularizer=cx(e.biasRegularizer),this.kernelConstraint=Mg(e.kernelConstraint),this.recurrentConstraint=Mg(e.recurrentConstraint),this.biasConstraint=Mg(e.biasConstraint),this.dropout=Yg([1,Zg([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Yg([1,Zg([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;const r=(e=av(e))[e.length-1];let n;if(this.kernel=this.addWeight("kernel",[r,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){const e=this.biasInitializer,r=this.units;n=new((t=class extends gy{apply(t,n){const a=e.apply([r]),i=(new vy).apply([r]),o=e.apply([2*r]);return ay(ay(a,i),o)}}).className="CustomInit",t)}else n=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,n,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return Ys((()=>{const r=null!=t.training&&t.training;if(3!==(e=e).length)throw new Km(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let n=e[1];const a=e[2];e=e[0],0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=Wx({ones:()=>Qu(e),rate:this.dropout,training:r,count:4,dropoutFunc:this.dropoutFunc})),0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=Wx({ones:()=>Qu(n),rate:this.recurrentDropout,training:r,count:4,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,o=this.recurrentDropoutMask;let s,l,c,u;0<this.dropout&&this.dropout<1&&(e=fl(e,i[0]));let f=sy(e,this.kernel.read());0<this.recurrentDropout&&this.recurrentDropout<1&&(n=fl(n,o[0])),f=ll(f,sy(n,this.recurrentKernel.read())),this.useBias&&(f=fy(f,this.bias.read()));const[p,h,d,m]=Wf(f,4,f.rank-1);s=this.recurrentActivation.apply(p),l=this.recurrentActivation.apply(h),c=ll(fl(l,a),fl(s,this.activation.apply(d))),u=this.recurrentActivation.apply(m);const g=fl(u,this.activation.apply(c));return[g,g,c]}))}getConfig(){const e=super.getConfig(),t={units:this.units,activation:ex(this.activation),recurrentActivation:ex(this.recurrentActivation),useBias:this.useBias,kernelInitializer:Py(this.kernelInitializer),recurrentInitializer:Py(this.recurrentInitializer),biasInitializer:Py(this.biasInitializer),unitForgetBias:this.unitForgetBias,kernelRegularizer:sx(this.kernelRegularizer),recurrentRegularizer:sx(this.recurrentRegularizer),biasRegularizer:sx(this.biasRegularizer),activityRegularizer:sx(this.activityRegularizer),kernelConstraint:Ag(this.kernelConstraint),recurrentConstraint:Ag(this.recurrentConstraint),biasConstraint:Ag(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation};return Object.assign({},e,t)}}$x.className="LSTMCell",Ms($x);class Vx extends Lx{constructor(e){0===e.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),e.cell=new $x(e),super(e)}call(e,t){return Ys((()=>{null!=this.cell.dropoutMask&&(Zs(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Zs(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const r=null==t?null:t.mask,n=null==t?null:t.training,a=null==t?null:t.initialState;return super.call(e,{mask:r,training:n,initialState:a})}))}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}Vx.className="LSTM",Ms(Vx);class qx extends Fx{constructor(e){super(e),this.cells=e.cells}get stateSize(){const e=[];for(const t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return Ys((()=>{let r=(e=e).slice(1);const n=[];for(const e of this.cells.slice().reverse())Array.isArray(e.stateSize)?n.push(r.splice(0,e.stateSize.length)):n.push(r.splice(0,1));n.reverse();const a=[];let i;for(let o=0;o<this.cells.length;++o){const s=this.cells[o];r=n[o],i=0===o?[e[0]].concat(r):[i[0]].concat(r),i=s.call(i,t),a.push(i.slice(1))}r=[];for(const e of a.slice().reverse())r.push(...e);return[i[0]].concat(r)}))}build(e){let t;tv(e)&&(e=e[0]),e=e,this.cells.forEach(((r,n)=>{Vg(`RNNCell_${n}`,(()=>{r.build(e),t=Array.isArray(r.stateSize)?r.stateSize[0]:r.stateSize,e=[e[0],t]}))})),this.built=!0}getConfig(){const e=super.getConfig(),t={cells:this.cells.map((e=>({className:e.getClassName(),config:e.getConfig()})))};return Object.assign({},e,t)}static fromConfig(e,t,r={}){const n=[];for(const e of t.cells)n.push(Ev(e,r));return new e({cells:n})}get trainableWeights(){if(!this.trainable)return[];const e=[];for(const t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.cells)t.push(...e.trainableWeights);return t.concat(e)}return e}getWeights(){const e=[];for(const t of this.cells)e.push(...t.weights);return sv(e)}setWeights(e){const t=[];for(const r of this.cells){const n=r.weights.length,a=e.splice(n);for(let e=0;e<r.weights.length;++e)t.push([r.weights[e],a[e]])}lv(t)}}function Wx(e){const{ones:t,rate:r,training:n=!1,count:a=1,dropoutFunc:i}=e,o=()=>null!=i?i(t(),r):py(t(),r),s=()=>hy(o,t,n);return!a||a<=1?Ks(s().clone()):Array(a).fill(void 0).map(s).map((e=>Ks(e.clone())))}qx.className="StackedRNNCells",Ms(qx);class Hx extends Lx{constructor(e){if(e.unroll)throw new Jm("Unrolling is not possible with convolutional RNNs.");if(Array.isArray(e.cell))throw new Jm("It is not possible at the moment to stack convolutional cells.");super(e),this.inputSpec=[new cv({ndim:5})]}call(e,t){return Ys((()=>{if(null!=this.cell.dropoutMask&&(Zs(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Zs(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new Km("ConvRNN2D cell does not support constants");const r=null==t?null:t.mask,n=null==t?null:t.training,a=null==t?null:t.initialState;return super.call(e,{mask:r,training:n,initialState:a})}))}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return Ys((()=>{const{stateSize:t}=this.cell,r=e.shape,n=this.computeSingleOutputShape(r),a=$u([n[0],...n.slice(2)]);return Array.isArray(t)?Array(t.length).fill(a):[a]}))}resetStates(e,t=!1){Ys((()=>{if(!this.stateful)throw new Ym("Cannot call resetStates() on an RNN Layer that is not stateful.");const r=this.inputSpec[0].shape,n=this.computeSingleOutputShape(r),a=[n[0],...n.slice(2)];if(null==r[0])throw new Km("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.getStates())Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>$u(a))):this.states_=[$u(a)];else if(null==e)Zs(this.states_),null!=this.keptStates&&(Zs(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>$u(a))):this.states_[0]=$u(a);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new Km(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):Zs(this.states_);for(let t=0;t<this.states_.length;++t){const r=e[t],n=a;if(!ce(r.shape,n))throw new Km(`State ${t} is incompatible with layer ${this.name}: expected shape=${n}, received shape=${r.shape}`);this.states_[t]=r}}this.states_=this.states_.map((e=>Ks(e.clone())))}))}computeSingleOutputShape(e){const{dataFormat:t,filters:r,kernelSize:n,padding:a,strides:i,dilationRate:o}=this.cell,s="channelsFirst"===t,l=e[s?3:2],c=e[s?4:3],u=yx(l,n[0],a,i[0],o[0]),f=yx(c,n[1],a,i[1],o[1]);return[...e.slice(0,2),...s?[r,u,f]:[u,f,r]]}}Hx.className="ConvRNN2D";class Gx extends $x{constructor(e){const{filters:t,kernelSize:r,strides:n,padding:a,dataFormat:i,dilationRate:o}=e;super(Object.assign({},e,{units:t})),this.filters=t,gg(this.filters,"filters"),this.kernelSize=gx(r,2,"kernelSize"),this.kernelSize.forEach((e=>gg(e,"kernelSize"))),this.strides=gx(n||1,2,"strides"),this.strides.forEach((e=>gg(e,"strides"))),this.padding=a||"valid",jg(this.padding),this.dataFormat=i||"channelsLast",zg(this.dataFormat),this.dilationRate=gx(o||1,2,"dilationRate"),this.dilationRate.forEach((e=>gg(e,"dilationRate")))}build(e){var t;e=av(e);const r="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[r])throw new Km(`The channel dimension of the input should be defined. Found ${e[r]}`);const n=e[r],a=this.kernelSize.concat([n,4*this.filters]);this.kernel=this.addWeight("kernel",a,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const i=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let e;if(this.unitForgetBias){const r=this.biasInitializer,n=this.filters;e=new((t=class extends gy{apply(e,t){return ny([r.apply([n]),Vu([n]),r.apply([2*n])])}}).className="CustomInit",t)}else e=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,e,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return Ys((()=>{if(3!==e.length)throw new Km(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const r=t.training||!1,n=e[0],a=e[1],i=e[2];0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=Wx({ones:()=>Qu(n),rate:this.dropout,training:r,count:4,dropoutFunc:this.dropoutFunc}));const o=this.dropoutMask,s=(e,t,r)=>t&&t[r]?fl(t[r],e):e;let l=s(n,o,0),c=s(n,o,1),u=s(n,o,2),f=s(n,o,3);0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=Wx({ones:()=>Qu(a),rate:this.recurrentDropout,training:r,count:4,dropoutFunc:this.dropoutFunc}));const p=this.recurrentDropoutMask;let h=s(a,p,0),d=s(a,p,1),m=s(a,p,2),g=s(a,p,3);const[y,v,b,x]=Wf(this.kernel.read(),4,3),[_,w,k,D]=this.useBias?Wf(this.bias.read(),4):[null,null,null,null];l=this.inputConv(l,y,_,this.padding),c=this.inputConv(c,v,w,this.padding),u=this.inputConv(u,b,k,this.padding),f=this.inputConv(f,x,D,this.padding);const[T,A,S,M]=Wf(this.recurrentKernel.read(),4,3);h=this.recurrentConv(h,T),d=this.recurrentConv(d,A),m=this.recurrentConv(m,S),g=this.recurrentConv(g,M);const E=this.recurrentActivation.apply(ll(l,h)),C=this.recurrentActivation.apply(ll(c,d)),N=ll(fl(C,i),fl(E,this.activation.apply(ll(u,m)))),O=fl(this.recurrentActivation.apply(ll(f,g)),this.activation.apply(N));return[O,O,N]}))}getConfig(){const e=super.getConfig(),{units:t}=e,r=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 a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}(e,["units"]),n={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign({},r,n)}inputConv(e,t,r,n){const a=Nc(e,t,this.strides,n||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return r?fy(a,r,this.dataFormat):a}recurrentConv(e,t){return Nc(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}Gx.className="ConvLSTM2DCell",Ms(Gx);class Xx extends Hx{constructor(e){const t=new Gx(e);super(Object.assign({},e,{cell:t}))}static fromConfig(e,t){return new e(t)}}Xx.className="ConvLSTM2D",Ms(Xx);class Yx extends dv{constructor(e){super(e),this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(null==this.noiseShape)return this.noiseShape;const t=e.shape,r=[];for(let e=0;e<this.noiseShape.length;++e)r.push(null==this.noiseShape[e]?t[e]:this.noiseShape[e]);return r}call(e,t){return Ys((()=>{this.invokeCallHook(e,t);const r=nv(e);if(0<this.rate&&this.rate<1){const e=null!=t.training&&t.training,n=this.getNoiseShape(r);return hy((()=>py(r,this.rate,n,this.seed)),(()=>r),e)}return e}))}getConfig(){const e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}}Yx.className="Dropout",Ms(Yx);class Zx extends Yx{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const t=e.shape;return[t[0],1,t[2]]}}Zx.className="SpatialDropout1D",Ms(Zx);class Kx extends dv{constructor(e){if(super(e),this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",null==e.batchInputShape&&null==e.inputShape&&null!=e.inputDim){let t=null;null!=e.batchSize&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,gg(this.units,"units"),this.activation=rx(e.activation),null!=e.useBias&&(this.useBias=e.useBias),this.kernelInitializer=Ry(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=Ry(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=Mg(e.kernelConstraint),this.biasConstraint=Mg(e.biasConstraint),this.kernelRegularizer=cx(e.kernelRegularizer),this.biasRegularizer=cx(e.biasRegularizer),this.activityRegularizer=cx(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){const t=(e=av(e))[e.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){const t=(e=av(e)).slice();return t[t.length-1]=this.units,t}call(e,t){return Ys((()=>{this.invokeCallHook(e,t);const r=nv(e),n=vg(this.activation.getClassName());let a;return null!=n?a=sy(r,this.kernel.read(),n,this.bias?this.bias.read():null):(a=sy(r,this.kernel.read()),null!=this.bias&&(a=fy(a,this.bias.read())),null!=this.activation&&(a=this.activation.apply(a))),a}))}getConfig(){const e={units:this.units,activation:ex(this.activation),useBias:this.useBias,kernelInitializer:Py(this.kernelInitializer),biasInitializer:Py(this.biasInitializer),kernelRegularizer:sx(this.kernelRegularizer),biasRegularizer:sx(this.biasRegularizer),activityRegularizer:sx(this.activityRegularizer),kernelConstraint:Ag(this.kernelConstraint),biasConstraint:Ag(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}Kx.className="Dense",Ms(Kx);class Jx extends dv{constructor(e){super(e=e||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=av(e);for(const t of e.slice(1))if(null==t)throw new Km(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],Xg(e,1)]}call(e,t){return Ys((()=>{this.invokeCallHook(e,t);let r=nv(e);if("channelsFirst"===this.dataFormat&&r.rank>1){const e=[0];for(let t=2;t<r.rank;++t)e.push(t);e.push(1),r=Xo(r,e)}return function(e){if(e.rank<=1)throw new Km(`batchFlatten requires a minimum rank of 2. Got rank: ${e.rank}.`);const t=[e.shape[0],Xg(e.shape,1)];return cc(e,t)}(r)}))}getConfig(){const e={};null!=this.dataFormat&&(e.dataFormat=this.dataFormat);const t=super.getConfig();return Object.assign(e,t),e}}Jx.className="Flatten",Ms(Jx);class Qx extends dv{constructor(e){super(e),this.supportsMasking=!0,this.activation=rx(e.activation)}call(e,t){return Ys((()=>{this.invokeCallHook(e,t);const r=nv(e);return this.activation.apply(r)}))}getConfig(){const e={activation:ex(this.activation)},t=super.getConfig();return Object.assign(e,t),e}}Qx.className="Activation",Ms(Qx);class e_ extends dv{constructor(e){super(e),this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return Ys((()=>{return e=nv(e),t=e,r=this.n,Ys((()=>{if(2!==t.shape.length)throw new Km(`repeat() expects a rank-2 tensor, but received a rank-${t.shape.length} tensor.`);return iy(Qg(t,1),[1,r,1])}));var t,r}))}getConfig(){const e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}}e_.className="RepeatVector",Ms(e_);class t_ extends dv{constructor(e){super(e),this.targetShape=e.targetShape;for(let e=0;e<this.targetShape.length;++e)this.isUnknown(this.targetShape[e])&&(this.targetShape[e]=null)}isUnknown(e){return e<0||null==e}fixUnknownDimension(e,t){const r="Total size of new array must be unchanged.",n=t.slice();let a=1,i=null;for(let e=0;e<n.length;++e){const t=n[e];if(this.isUnknown(t)){if(null!==i)throw new Km("Can only specifiy one unknown dimension.");i=e}else a*=t}const o=Xg(e);if(null!==i){if(0===a||o%a!=0)throw new Km(r);n[i]=o/a}else if(o!==a)throw new Km(r);return n}computeOutputShape(e){let t=!1;for(let r=0;r<e.length;++r)if(this.isUnknown(e[r])){t=!0;break}return t?e.slice(0,1).concat(this.targetShape):e.slice(0,1).concat(this.fixUnknownDimension(e.slice(1),this.targetShape))}call(e,t){return Ys((()=>{this.invokeCallHook(e,t);const r=nv(e),n=r.shape,a=n.slice(0,1).concat(this.fixUnknownDimension(n.slice(1),this.targetShape));return cc(r,a)}))}getConfig(){const e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}}t_.className="Reshape",Ms(t_);class r_ extends dv{constructor(e){if(super(e),null==e.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);const t=Kg(1,e.dims.length+1);if(!ce(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new cv({ndim:this.dims.length+1})]}computeOutputShape(e){const t=(e=av(e)).slice();return this.dims.forEach(((r,n)=>{t[n+1]=e[r]})),t}call(e,t){return Xo(nv(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}}r_.className="Permute",Ms(r_);class n_ extends dv{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,this.maskValue=null!=e?null==e.maskValue?0:e.maskValue:0}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){const r=nv(e);return Ul(Ju(r,this.maskValue),-1)}call(e,t){return Ys((()=>{this.invokeCallHook(e,t);const r=nv(e),n=Ul(Ju(r,this.maskValue),-1,!0);return fl(r,Ao(n,r.dtype))}))}}n_.className="Masking",Ms(n_);class a_ extends dv{constructor(e){if(super(e),this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==e.batchInputShape&&null==e.inputShape){let t=null;null!=e.batchSize&&(t=e.batchSize),null==e.inputLength?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(ag(e.inputLength))}this.inputDim=e.inputDim,gg(this.inputDim,"inputDim"),this.outputDim=e.outputDim,gg(this.outputDim,"outputDim"),this.embeddingsInitializer=Ry(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=cx(e.embeddingsRegularizer),this.activityRegularizer=cx(e.activityRegularizer),this.embeddingsConstraint=Mg(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return Ys((()=>this.maskZero?(e=nv(e),Ju(e,dl(e))):null))}computeOutputShape(e){if(e=av(e),null==this.inputLength)return[...e,this.outputDim];const t=ag(this.inputLength);if(t.length!==e.length-1)throw new Km(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let r=0;for(let n=0;n<t.length;++n){const a=t[n],i=e[n+1];if(null!=a&&null!=i&&a!==i)throw new Km(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);null==a&&(t[r]=i),r++}}return[e[0],...t,this.outputDim]}call(e,t){return Ys((()=>{this.invokeCallHook(e,t);let r=nv(e);"int32"!==r.dtype&&(r=Jg(r,"int32"));const n=ly(this.embeddings.read(),cc(r,[r.size]));return cc(n,av(this.computeOutputShape(r.shape)))}))}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:Py(this.embeddingsInitializer),embeddingsRegularizer:sx(this.embeddingsRegularizer),activityRegularizer:sx(this.activityRegularizer),embeddingsConstraint:Ag(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}}a_.className="Embedding",Ms(a_);class i_ extends dv{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new Jm}computeElementwiseOpOutputShape(e,t){if(null==e||null==t)return null;if(e.length<t.length)return this.computeElementwiseOpOutputShape(t,e);if(0===t.length)return e;const r=e.slice(0,e.length-t.length);for(let n=0;n<t.length;++n){const a=e[e.length-t.length+n],i=t[n];if(null==a||null==i||a<0||i<0)r.push(null);else if(1===a)r.push(i);else if(1===i)r.push(a);else{if(a!==i)throw new Km("Operands could not be broadcast together with shapes "+JSON.stringify(e)+" "+JSON.stringify(t));r.push(a)}}return r}build(e){if(Array.isArray(e)&&!Array.isArray(e[0])&&(e=[av(e)]),(e=e).length<2)throw new Km(`A merge layer should be called on an Array of at least 2 inputs. Got ${e.length} input(s).`);let t=[];for(const r of e)null!=r&&null!==r[0]&&t.push(r[0]);if(t=pg(t),t.length>1)throw new Km(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let r=null==e[0]?null:e[0].slice(1);for(let t=1;t<e.length;++t){const n=null==e[t]?null:e[t].slice(1);r=this.computeElementwiseOpOutputShape(r,n)}const n=e.map((e=>e.length));-1===e.indexOf(null)&&1===pg(n).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return Ys((()=>{if(e=e,this.reshapeRequired){const t=[],r=e.map((e=>e.rank));if(-1===r.indexOf(null)){const n=Zg(r);for(let r of e){const e=r.rank;for(let t=0;t<n-e;++t)r=Qg(r,1);t.push(r)}return this.mergeFunction(t)}{let r=!1;for(const n of e){const e=n.rank;if(null==e){const e=n.shape,a=e[0],i=e.slice(1).concat([a]);let o=cc(n,[a].concat(Xg(e.slice(1))));o=Xo(o,[1,0]),o=cc(o,i),t.push(o),r=!0}else if(e>1){const a=Kg(1,e).concat([0]);t.push(Xo(n,a)),r=!0}else t.push(n)}let n=this.mergeFunction(t);const a=n.rank;if(r)if(null==a){const e=n.shape,t=e[e.length-1],r=[t].concat(e.slice(0,e.length-1));n=cc(Xo(cc(n,[-1,t]),[1,0]),r)}else if(a>1){const e=[a-1].concat(Kg(0,a-1));n=Xo(n,e)}return n}}return this.mergeFunction(e)}))}computeOutputShape(e){let t;t=null==(e=e)[0]?null:e[0].slice(1);for(let r=1;r<e.length;++r){const n=null==e[r]?null:e[r].slice(1);t=this.computeElementwiseOpOutputShape(t,n)}let r=[];for(const t of e)null!=t&&null!==t[0]&&r.push(t[0]);return r=pg(r),t=1===r.length?r.concat(t):[null].concat(t),t}computeMask(e,t){return Ys((()=>{if(null==t)return null;if(!Array.isArray(t))throw new Km("`mask` should be an Array");if(!Array.isArray(e))throw new Km("`inputs` should be an Array");if(t.length!==e.length)throw new Km(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every((e=>null==e)))return null;let r=(t=t.map((e=>null==e?e:eu(e,0))))[0];for(let e=1;e<t.length-1;++e)r=Pu(r,t[e]);return r}))}}class o_ extends i_{constructor(e){super(e)}mergeFunction(e){return Ys((()=>{let t=e[0].clone();for(let r=1;r<e.length;++r)t=ll(t,e[r]);return t}))}}o_.className="Add",Ms(o_);class s_ extends i_{constructor(e){super(e)}mergeFunction(e){return Ys((()=>{let t=e[0].clone();for(let r=1;r<e.length;++r)t=fl(t,e[r]);return t}))}}s_.className="Multiply",Ms(s_);class l_ extends i_{constructor(e){super(e)}mergeFunction(e){return Ys((()=>{let t=e[0].clone();for(let r=1;r<e.length;++r)t=ll(t,e[r]);return fl(1/e.length,t)}))}}l_.className="Average",Ms(l_);class c_ extends i_{constructor(e){super(e)}mergeFunction(e){return Ys((()=>{let t=e[0];for(let r=1;r<e.length;++r)t=Nl(t,e[r]);return t}))}}c_.className="Maximum",Ms(c_);class u_ extends i_{constructor(e){super(e)}mergeFunction(e){return Ys((()=>{let t=e[0];for(let r=1;r<e.length;++r)t=Hu(t,e[r]);return t}))}}u_.className="Minimum",Ms(u_);class f_ extends i_{constructor(e){super(e),this.DEFAULT_AXIS=-1,null==e&&(e={}),this.axis=null==e.axis?this.DEFAULT_AXIS:e.axis,this.supportsMasking=!0,this.reshapeRequired=!1}build(e){if(!Array.isArray(e)||!Array.isArray(e[0])||1===e.length)throw new Km("A `Concatenate` layer should be called on a list of at least 2 inputs");e=e;let t=!0;for(const r of e)if(null!=r){t=!1;break}if(t)return;const r=[];for(let t=0;t<e.length;++t){const n=e[t].slice();n.splice(this.axis,1);let a=!1;for(const e of r)if(ce(e,n)){a=!0;break}a||r.push(n)}if(r.length>1)throw new Km("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return Ys((()=>ny(e,this.axis)))}computeOutputShape(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new Km("A `Concatenate` layer should be called on a list of inputs.");const t=e,r=t[0].slice(),n=this.axis<0?r.length+this.axis:this.axis;for(const e of t.slice(1)){if(null==r[n]||null==e[n]){r[n]=null;break}r[n]+=e[n]}return r}computeMask(e,t){if(null==t)return null;if(!Array.isArray(t))throw new Km("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new Km("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new Km(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return Ys((()=>{let r=!0;if(t.forEach((e=>{null==e||(r=!1)})),r)return null;const n=[];for(let r=0;r<e.length;++r)null==t[r]?n.push(Ao(Qu(e[r]),"bool")):t[r].rank<e[r].rank?n.push(eu(t[r],-1)):n.push(t[r]);const a=pc(n,this.axis);return jl(a,-1,!1)}))}getConfig(){const e={axis:this.axis},t=super.getConfig();return Object.assign(e,t),e}}function p_(e,t){for(;e<0;)e+=t;return e}f_.className="Concatenate",Ms(f_);class h_ extends i_{constructor(e){super(e),this.axes=e.axes,this.normalize=null!=e.normalize&&e.normalize,this.supportsMasking=!0,this.reshapeRequired=!1}build(e){ne(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&Array.isArray(e[1]),(()=>"A `Dot` layer should be called on a list of exactly 2 inputs."));const t=e[0],r=e[1];if(t.length>3||r.length>3)throw new Jm("Dot layer does not support tensors of 4D or higher rank yet.");const n=this.interpretAxes(t,r);if(t[n[0]]!==r[n[1]])throw new Km(`Dimension incompatibility: ${t[n[0]]} !== ${r[n[1]]}`)}mergeFunction(e){if(2!==e.length)throw new Km(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t,r=e[0],n=e[1];return t=Array.isArray(this.axes)?this.axes.map(((t,r)=>p_(t,e[r].shape.length))):[p_(this.axes,r.shape.length),p_(this.axes,n.shape.length)],this.normalize&&(r=Cv(r,t[0]),n=Cv(n,t[1])),function(e,t,r){if(e.shape.length>3||t.shape.length>3)throw new Jm("batchDot is not implemented for tensors of 4D or higher rank yet");if(ne(e.shape.length>=2,(()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`)),ne(e.shape.length>=2,(()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`)),"number"==typeof r&&(r=[r,r]),"complex64"===e.dtype||"complex64"===t.dtype)throw new Jm("batchDot is not implemented for complex64-type Tensors yet.");const n=e.shape.length,a=t.shape.length;null==r&&(r=[n-1,a-2]);const i=r;return Ys((()=>{let r,o;if(n>a){r=n-a;const e=[];for(let t=0;t<r;++t)e.push(1);t=cc(t,t.shape.concat(e))}else if(a>n){r=a-n;const t=[];for(let e=0;e<r;++e)t.push(1);e=cc(e,e.shape.concat(t))}else r=0;if(2===e.shape.length&&2===t.shape.length)o=i[0]===i[1]?ku(fl(e,t),i[0]):ku(fl(Xo(e,[1,0]),t),i[1]);else{const r=i[0]!==e.shape.length-1,n=i[1]===t.shape.length-1;o=Ho(e,t,r,n)}if(r>0){let e;e=n>a?n+a-3:n-1;const t=[];for(let n=e;n<e+r;++n)t.push(n);o=Xf(o,t)}return 1===o.shape.length&&(o=eu(o,1)),o}))}(r,n,t)}interpretAxes(e,t){let r;return r=Array.isArray(this.axes)?this.axes:[p_(this.axes,e.length),p_(this.axes,t.length)],r}computeOutputShape(e){ne(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&Array.isArray(e[1]),(()=>"A `Dot` layer should be called on a list of exactly 2 inputs."));const t=e[0].slice(),r=e[1].slice();if(t.length>3||r.length>3)throw new Jm("Dot layer does not support tensors of 4D or higher rank yet.");const n=this.interpretAxes(t,r);t.splice(n[0],1),r.splice(n[1],1),r.splice(0,1);const a=t.concat(r);return 1===a.length&&a.push(1),a}computeMask(e,t){return null}getConfig(){const e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}}h_.className="Dot",Ms(h_);class d_ extends dv{constructor(e){super(e),this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return Ys((()=>{this.invokeCallHook(e,t);const r=nv(e);return hy((()=>ll(oy(r.shape,0,this.stddev),r)),(()=>r),t.training||!1)}))}}d_.className="GaussianNoise",Ms(d_);class m_ extends dv{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return Ys((()=>{this.invokeCallHook(e,t);const r=nv(e);return this.rate>0&&this.rate<1?hy((()=>{const e=Math.sqrt(this.rate/(1-this.rate));return fl(r,oy(r.shape,1,e))}),(()=>r),t.training||!1):r}))}}m_.className="GaussianDropout",Ms(m_);class g_ extends dv{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||nv(e).shape}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return Ys((()=>{if(this.rate<1&&this.rate>0){const r=this._getNoiseShape(e),n=()=>{const t=nv(e),n=-1.7580993408473766;let a=su(vf(r),this.rate);a=Jg(a,"float32");const i=((1-this.rate)*(1+this.rate*n**2))**-.5,o=-i*n*this.rate,s=ll(fl(t,a),fl(ll(a,-1),n));return ll(fl(s,i),o)};return hy(n,(()=>nv(e)),t.training||!1)}return e}))}}function y_(e,t,r,n,a,i=.001){let o;if(2===e.rank)o=bc(e,t,r,n,a,i);else if(3===e.rank)o=xc(e,t,r,n,a,i);else{if(4!==e.rank)throw new Jm(`batchNormalization is not implemented for array of rank ${e.rank} yet`);o=_c(e,t,r,n,a,i)}return o}g_.className="AlphaDropout",Ms(g_);class v_ extends dv{constructor(e){null==e&&(e={}),super(e),this.supportsMasking=!0,this.axis=null==e.axis?-1:e.axis,this.momentum=null==e.momentum?.99:e.momentum,this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=Ry(e.betaInitializer||"zeros"),this.gammaInitializer=Ry(e.gammaInitializer||"ones"),this.movingMeanInitializer=Ry(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=Ry(e.movingVarianceInitializer||"ones"),this.betaConstraint=Mg(e.betaConstraint),this.gammaConstraint=Mg(e.gammaConstraint),this.betaRegularizer=cx(e.betaRegularizer),this.gammaRegularizer=cx(e.gammaRegularizer)}build(e){e=av(e);const t=this.axis>=0?this.axis:this.axis+e.length,r=e[t];if(null==r)throw new Km(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new cv({ndim:e.length,axes:{[t]:r}})];const n=[r];this.scale&&(this.gamma=this.addWeight("gamma",n,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",n,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",n,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",n,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return Ys((()=>{const r=null!=t.training&&t.training,n=nv(e),a=n.shape,i=a.length,o=Kg(0,i),s=this.axis>=0?this.axis:this.axis+i;o.splice(s,1);const l=eg(1,i);l[s]=a[s];const c=o.slice();c.sort();const u=!ce(c,Kg(0,i).slice(0,i-1));if(!r)return(()=>{if(u){const e=cc(this.movingMean.read(),l),t=cc(this.movingVariance.read(),l),r=this.center?cc(this.beta.read(),l):null,a=this.scale?cc(this.gamma.read(),l):null;return y_(n,e,t,r,a,this.epsilon)}return y_(n,this.movingMean.read(),this.movingVariance.read(),null==this.beta?null:this.beta.read(),null==this.gamma?null:this.gamma.read(),this.epsilon)})();const[f,p,h]=function(e,t,r,n,a=.001){return ce(n.slice().sort(),Kg(0,e.rank-1))?function(e,t,r,n,a=.001){return Ys((()=>{const i=Yu(e,n),o=i.mean,s=i.variance;return[y_(e,o,s,r,t,a),o,s]}))}(e,t,r,n,a):function(e,t,r,n,a=.001){return Ys((()=>{const i=Yu(e,n),o=i.mean,s=i.variance,l=[];for(const t of Kg(0,e.rank))-1!==n.indexOf(t)?l.push(1):l.push(e.shape[t]);const c=cc(o,l),u=cc(s,l),f=null==t?null:cc(t,l),p=null==r?null:cc(r,l);return[y_(e,c,u,p,f,a),o,s]}))}(e,t,r,n,a)}(n,this.gamma.read(),this.beta.read(),o,this.epsilon),d=(e,t,r)=>{Ys((()=>{const n=1-r,a=e.read(),i=fl(Ml(a,t),n);e.write(Ml(a,i))}))};return(()=>{d(this.movingMean,p,this.momentum),d(this.movingVariance,h,this.momentum)})(),f}))}getConfig(){const e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Py(this.betaInitializer),gammaInitializer:Py(this.gammaInitializer),movingMeanInitializer:Py(this.movingMeanInitializer),movingVarianceInitializer:Py(this.movingVarianceInitializer),betaRegularizer:sx(this.betaRegularizer),gammaRegularizer:sx(this.gammaRegularizer),betaConstraint:Ag(this.betaConstraint),gammaConstraint:Ag(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}}v_.className="BatchNormalization",Ms(v_);class b_ extends dv{constructor(e){if(null==e&&(e={}),super(e),this.axis=null==e.axis?-1:e.axis,"number"==typeof this.axis){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else{if(!Array.isArray(this.axis))throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);for(const e of this.axis)if(!Number.isInteger(e))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=Ry(e.betaInitializer||"zeros"),this.gammaInitializer=Ry(e.gammaInitializer||"ones"),this.betaRegularizer=cx(e.betaRegularizer),this.gammaRegularizer=cx(e.gammaRegularizer),this.supportsMasking=!0}build(e){const t=(e=av(e)).length;"number"==typeof this.axis&&(this.axis=[this.axis]);for(let e=0;e<this.axis.length;++e)this.axis[e]<0&&(this.axis[e]+=t);for(const e of this.axis)if(e<0||e>=t)throw new Error(`Invalid axis: ${e}`);if(this.axis.length!==pg(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const r=this.axis.map((t=>e[t]));this.scale?this.gamma=this.addWeight("gamma",r,"float32",this.gammaInitializer,this.gammaRegularizer,!0):this.gamma=null,this.center?this.beta=this.addWeight("beta",r,"float32",this.betaInitializer,this.betaRegularizer,!0):this.beta=null,this.built=!0}call(e,t){const r=nv(e),n=r.shape,a=n.length;return Ys((()=>{let{mean:e,variance:t}=Yu(r,this.axis,!0);const i=eg(1,a);for(const e of this.axis)i[e]=n[e];const o=e=>null!=e&&e.shape.length!==a?cc(e,i):e;let s=o(this.gamma.read()),l=o(this.beta.read());const c=[],u=[];for(let e=0;e<a;++e)-1!==this.axis.indexOf(e)?(c.push(n[e]),u.push(1)):(c.push(1),u.push(n[e]));return e=ru(e,c),t=ru(t,c),s=ru(s,u),l=ru(l,u),y_(r,e,t,l,s,this.epsilon)}))}getConfig(){const e={axis:this.axis,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Py(this.betaInitializer),gammaInitializer:Py(this.gammaInitializer),betaRegularizer:sx(this.betaRegularizer),gammaRegularizer:sx(this.gammaRegularizer)},t=super.getConfig();return Object.assign(e,t),e}}b_.className="LayerNormalization",Ms(b_);class x_ extends dv{constructor(e){if(null==e&&(e={}),super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,null==e.padding)this.padding=[[1,1],[1,1]];else if("number"==typeof e.padding)this.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,2!==e.padding.length)throw new Km(`ZeroPadding2D expects padding to be a length-2 array, but received a length-${e.padding.length} array.`);let t,r;if("number"==typeof e.padding[0])t=[e.padding[0],e.padding[0]],r=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,2!==e.padding[0].length)throw new Km(`ZeroPadding2D expects height padding to be a length-2 array, but received a length-${e.padding[0].length} array.`);if(t=e.padding[0],2!==e.padding[1].length)throw new Km(`ZeroPadding2D expects width padding to be a length-2 array, but received a length-${e.padding[1].length} array.`);r=e.padding[1]}this.padding=[t,r]}this.inputSpec=[new cv({ndim:4})]}computeOutputShape(e){let t,r;return e=av(e),"channelsFirst"===this.dataFormat?(t=null!=e[2]&&e[2]>=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,r=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,r]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,r=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,r,e[3]])}call(e,t){return Ys((()=>{return t=nv(e),r=this.padding,n=this.dataFormat,Ys((()=>{if(4!==t.rank)throw new Km(`temporalPadding expects input tensor to be 4-D, but received a ${t.rank}-D tensor.`);if(null==r&&(r=[[1,1],[1,1]]),2!==r.length||2!==r[0].length||2!==r[1].length)throw new Km("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==n&&(n="channelsLast"),"channelsLast"!==n&&"channelsFirst"!==n)throw new Km(`Unknown data format: ${n}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let e;return e="channelsFirst"===n?[[0,0],[0,0],r[0],r[1]]:[[0,0],r[0],r[1],[0,0]],tf(t,e)}));var t,r,n}))}getConfig(){const e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}function __(e,t,r,n,a,i){return Ys((()=>{let o;zg(a),Ug(i),jg(n),null==r&&(r=[1,1]),null==n&&(n="valid"),null==a&&(a="channelsLast"),null==i&&(i="max"),e=bx(e,a);const s="same"===n?"same":"valid";return o="max"===i?Bu(e,t,r,s):uc(e,t,r,s),"channelsFirst"===a&&(o=Xo(o,[0,3,1,2])),o}))}function w_(e,t,r,n,a,i){return Ys((()=>{let o;zg(a),Ug(i),jg(n),null==r&&(r=[1,1,1]),null==n&&(n="valid"),null==a&&(a="channelsLast"),null==i&&(i="max"),e=xx(e,a);const s="same"===n?"same":"valid";return o="max"===i?zu(e,t,r,s):fc(e,t,r,s),"channelsFirst"===a&&(o=Xo(o,[0,4,1,2,3])),o}))}x_.className="ZeroPadding2D",Ms(x_);class k_ extends dv{constructor(e){if(null==e.poolSize&&(e.poolSize=2),super(e),"number"==typeof e.poolSize)this.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!=typeof e.poolSize[0])throw new Km(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);this.poolSize=e.poolSize}if(gg(this.poolSize,"poolSize"),null==e.strides)this.strides=this.poolSize;else if("number"==typeof e.strides)this.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!=typeof e.strides[0])throw new Km(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);this.strides=e.strides}gg(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,jg(this.padding),this.inputSpec=[new cv({ndim:3})]}computeOutputShape(e){const t=yx((e=av(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return Ys((()=>{this.invokeCallHook(e,t),e=Qg(nv(e),2);const r=this.poolingFunction(nv(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return Xf(r,[2])}))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}}class D_ extends k_{constructor(e){super(e)}poolingFunction(e,t,r,n,a){return zg(a),jg(n),__(e,t,r,n,a,"max")}}D_.className="MaxPooling1D",Ms(D_);class T_ extends k_{constructor(e){super(e)}poolingFunction(e,t,r,n,a){return zg(a),jg(n),__(e,t,r,n,a,"avg")}}T_.className="AveragePooling1D",Ms(T_);class A_ extends dv{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new Km(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];gg(this.poolSize,"poolSize"),gg(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,zg(this.dataFormat),jg(this.padding),this.inputSpec=[new cv({ndim:4})]}computeOutputShape(e){e=av(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],r="channelsFirst"===this.dataFormat?e[3]:e[2];return t=yx(t,this.poolSize[0],this.padding,this.strides[0]),r=yx(r,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,r]:[e[0],t,r,e[3]]}call(e,t){return Ys((()=>(this.invokeCallHook(e,t),this.poolingFunction(nv(e),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class S_ extends A_{constructor(e){super(e)}poolingFunction(e,t,r,n,a){return zg(a),jg(n),__(e,t,r,n,a,"max")}}S_.className="MaxPooling2D",Ms(S_);class M_ extends A_{constructor(e){super(e)}poolingFunction(e,t,r,n,a){return zg(a),jg(n),__(e,t,r,n,a,"avg")}}M_.className="AveragePooling2D",Ms(M_);class E_ extends dv{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new Km(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];gg(this.poolSize,"poolSize"),gg(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,zg(this.dataFormat),jg(this.padding),this.inputSpec=[new cv({ndim:5})]}computeOutputShape(e){e=av(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],r="channelsFirst"===this.dataFormat?e[3]:e[2],n="channelsFirst"===this.dataFormat?e[4]:e[3];return t=yx(t,this.poolSize[0],this.padding,this.strides[0]),r=yx(r,this.poolSize[1],this.padding,this.strides[1]),n=yx(n,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,r,n]:[e[0],t,r,n,e[4]]}call(e,t){return Ys((()=>(this.invokeCallHook(e,t),this.poolingFunction(nv(e),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class C_ extends E_{constructor(e){super(e)}poolingFunction(e,t,r,n,a){return zg(a),jg(n),w_(e,t,r,n,a,"max")}}C_.className="MaxPooling3D",Ms(C_);class N_ extends E_{constructor(e){super(e)}poolingFunction(e,t,r,n,a){return zg(a),jg(n),w_(e,t,r,n,a,"avg")}}N_.className="AveragePooling3D",Ms(N_);class O_ extends dv{constructor(e){super(e),this.inputSpec=[new cv({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new Jm}}class I_ extends O_{constructor(e){super(e||{})}call(e,t){return Ys((()=>{const t=nv(e);return Uu(t,1)}))}}I_.className="GlobalAveragePooling1D",Ms(I_);class P_ extends O_{constructor(e){super(e||{})}call(e,t){return Ys((()=>{const t=nv(e);return wu(t,1)}))}}P_.className="GlobalMaxPooling1D",Ms(P_);class R_ extends dv{constructor(e){super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,zg(this.dataFormat),this.inputSpec=[new cv({ndim:4})]}computeOutputShape(e){return e=e,"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new Jm}getConfig(){const e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class L_ extends R_{call(e,t){return Ys((()=>{const t=nv(e);return"channelsLast"===this.dataFormat?Uu(t,[1,2]):Uu(t,[2,3])}))}}L_.className="GlobalAveragePooling2D",Ms(L_);class F_ extends R_{call(e,t){return Ys((()=>{const t=nv(e);return"channelsLast"===this.dataFormat?wu(t,[1,2]):wu(t,[2,3])}))}}F_.className="GlobalMaxPooling2D",Ms(F_);class B_ extends dv{constructor(e){super(e),this.layer=e.layer}build(e){this.built=!0}get trainable(){return null!=this.layer&&this.layer.trainable}set trainable(e){null!=this.layer&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){const e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,r={}){const n=Ev(t.layer,r);delete t.layer;const a={layer:n};return Object.assign(a,t),new e(a)}}class z_ extends B_{constructor(e){super(e),this.supportsMasking=!0}build(e){if((e=av(e)).length<3)throw new Km(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];const t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){const t=[(e=av(e))[0]].concat(e.slice(2)),r=this.layer.computeOutputShape(t),n=e[1];return[r[0],n].concat(r.slice(1))}call(e,t){return Ys((()=>Rx(((e,r)=>[nv(this.layer.call(e,t)),[]]),e=nv(e),[],!1,null,null,!1,!0)[1]))}}z_.className="TimeDistributed",Ms(z_);class j_ extends B_{constructor(e){super(e);const t=e.layer.getConfig(),r={};r.className=e.layer.getClassName(),r.config=t,this.forwardLayer=Ev(r),t.goBackwards=!0!==t.goBackwards;const n={};var a;if(n.className=e.layer.getClassName(),n.config=t,this.backwardLayer=Ev(n),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,a=this.mergeMode,dg(Fg,"BidirectionalMergeMode",a),e.weights)throw new Jm("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){const t=e.length,r=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,r)),this.backwardLayer.setWeights(e.slice(r))}computeOutputShape(e){let t,r,n,a=this.forwardLayer.computeOutputShape(e);return Array.isArray(a)&&Array.isArray(a[0])||(a=[a]),a=a,this.returnState?(n=a.slice(1),t=a[0]):t=a[0],t=t,"concat"===this.mergeMode?(t[t.length-1]*=2,r=[t]):r=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?r.concat(n).concat(n.slice()):[t].concat(n).concat(n.slice()):ng(r)}apply(e,t){let r=null==t?null:t.initialState,n=null==t?null:t.constants;null==t&&(t={});const a=Px(e,r,n,this.numConstants);if(e=a.inputs,r=a.initialState,n=a.constants,Array.isArray(e)&&(r=e.slice(1),e=e[0]),(null==r||0===r.length)&&null==n)return super.apply(e,t);const i=[],o=[];if(null!=r){const e=r.length;if(e%2>0)throw new Km("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=r,i.push(...r);const n=r.map((e=>new cv({shape:e.shape})));this.forwardLayer.stateSpec=n.slice(0,e/2),this.backwardLayer.stateSpec=n.slice(e/2),o.push(...n)}if(null!=n)throw new Jm("Support for constants in Bidirectional layers is not implemented yet.");const s=i[0]instanceof uv;for(const e of i)if(e instanceof uv!==s)throw new Km("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(s){const r=[e].concat(i),n=this.inputSpec.concat(o),a=this.inputSpec;this.inputSpec=n;const s=super.apply(r,t);return this.inputSpec=a,s}return super.apply(e,t)}call(e,t){return Ys((()=>{const r=t.initialState;let n,a,i,o;if(null==r)n=this.forwardLayer.call(e,t),a=this.backwardLayer.call(e,t);else{const i=r.slice(0,r.length/2),o=r.slice(r.length/2);n=this.forwardLayer.call(e,Object.assign(t,{initialState:i})),a=this.backwardLayer.call(e,Object.assign(t,{initialState:o}))}return this.returnState&&(Array.isArray(n)&&(i=n.slice(1).concat(a.slice(1))),n=n[0],a=a[0]),this.returnSequences&&(a=Df(a,1)),"concat"===this.mergeMode?o=ny([n,a]):"sum"===this.mergeMode?o=ll(n,a):"ave"===this.mergeMode?o=fl(.5,ll(n,a)):"mul"===this.mergeMode?o=fl(n,a):null==this.mergeMode&&(o=[n,a]),this.returnState?null==this.mergeMode?o.concat(i):[o].concat(i):o}))}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Vg(this.forwardLayer.name,(()=>{this.forwardLayer.build(e)})),Vg(this.backwardLayer.name,(()=>{this.backwardLayer.build(e)})),this.built=!0}computeMask(e,t){let r;if(Array.isArray(t)&&(t=t[0]),r=this.returnSequences?null==this.mergeMode?[t,t]:t:null==this.mergeMode?[null,null]:null,this.returnState){const e=this.forwardLayer.states.map((e=>null));return Array.isArray(r)?r.concat(e).concat(e):[r].concat(e).concat(e)}return r}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(e),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){const e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){const r=Ev(t.layer);if(delete t.layer,null!=t.numConstants)throw new Jm("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const n=t;return n.layer=r,new e(n)}}function U_(e){return new gv(e)}function $_(e){return new hx(e)}function V_(e){return new ux(e)}function q_(e){return new fx(e)}function W_(e){return new px(e)}function H_(e){return new mx(e)}function G_(e){return new dx(e)}function X_(e){return new Cx(e)}function Y_(e){return new Dx(e)}function Z_(e){return new Ax(e)}function K_(e){return new Tx(e)}function J_(e){return new Sx(e)}function Q_(e){return new Ex(e)}function ew(e){return new Nx(e)}function tw(e){return new Ox(e)}function rw(e){return new Ix(e)}function nw(e){return new Qx(e)}function aw(e){return new Kx(e)}function iw(e){return new Yx(e)}function ow(e){return new Zx(e)}function sw(e){return new Jx(e)}function lw(e){return new e_(e)}function cw(e){return new t_(e)}function uw(e){return new r_(e)}function fw(e){return new a_(e)}function pw(e){return new o_(e)}function hw(e){return new l_(e)}function dw(e){return new f_(e)}function mw(e){return new c_(e)}function gw(e){return new u_(e)}function yw(e){return new s_(e)}function vw(e){return new h_(e)}function bw(e){return new v_(e)}function xw(e){return new b_(e)}function _w(e){return new x_(e)}function ww(e){return new T_(e)}function kw(e){return ww(e)}function Dw(e){return ww(e)}function Tw(e){return new M_(e)}function Aw(e){return Tw(e)}function Sw(e){return Tw(e)}function Mw(e){return new N_(e)}function Ew(e){return Mw(e)}function Cw(e){return Mw(e)}function Nw(e){return new I_(e)}function Ow(e){return new L_(e)}function Iw(e){return new P_(e)}function Pw(e){return new F_(e)}function Rw(e){return new D_(e)}function Lw(e){return new S_(e)}function Fw(e){return new C_(e)}function Bw(e){return new Ux(e)}function zw(e){return new jx(e)}function jw(e){return new Vx(e)}function Uw(e){return new $x(e)}function $w(e){return new zx(e)}function Vw(e){return new Bx(e)}function qw(e){return new Xx(e)}function Ww(e){return new Gx(e)}function Hw(e){return new Lx(e)}function Gw(e){return new qx(e)}function Xw(e){return new j_(e)}function Yw(e){return new z_(e)}j_.className="Bidirectional",Ms(j_);const Zw=Iw,Kw=Pw,Jw=Rw,Qw=Lw;function ek(e){return new d_(e)}function tk(e){return new m_(e)}function rk(e){return new g_(e)}function nk(e){return new n_(e)}function ak(e,t){return jv(e,t)}function ik(e,t){return qv(e,t)}function ok(e,t){return Wv(e,t)}function sk(e,t){return Uv(e,t)}function lk(e,t){return Hv(e,t)}function ck(e,t){return Vv(e,t)}function uk(e,t){return function(e,t){return Ys((()=>{const r=$v(e,t),n=function(e,t){return Ys((()=>Ao(ku(Pu(Hc(e,1),Hc(t,0))),"float32")))}(e,t),a=ll(r,n);return Ao(Gc(ou(a,0),ul(r,a),0),"float32")}))}(e,t)}function fk(e,t){return Fv(e,t)}function pk(e,t){return Ov(e,t)}function hk(e,t){return Iv(e,t)}function dk(e,t){return Iv(e,t)}function mk(e,t){return Iv(e,t)}function gk(e,t){return Nv(e,t)}function yk(e,t){return Nv(e,t)}function vk(e,t){return Nv(e,t)}function bk(e){return new ix(e)}function xk(e){return nx(t=e),new ix({l1:null!=t?t.l1:null,l2:0});var t}function _k(e){return nx(t=e),new ix({l2:null!=t?t.l2:null,l1:0});var t}class wk extends _v{constructor(){super(...arguments),this.model=null}setModel(e){if(!(e instanceof Cb))throw new Error("model must be a LayersModel, not some other Container");this.model=e}}function kk(e,t){return e<t}function Dk(e,t){return e>t}class Tk extends wk{constructor(e){if(super(),null==e&&(e={}),e.restoreBestWeights)throw new Jm("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=e.monitor||"val_loss",this.minDelta=Math.abs(e.minDelta||0),this.patience=e.patience||0,this.verbose=e.verbose||0,this.mode=e.mode||"auto",this.baseline=e.baseline,-1===["auto","min","max"].indexOf(this.mode)&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),"min"===this.mode?this.monitorFunc=kk:"max"===this.mode||-1!==this.monitor.indexOf("acc")?this.monitorFunc=Dk:this.monitorFunc=kk,this.monitorFunc===kk&&(this.minDelta*=-1)}async onTrainBegin(e){this.wait=0,this.stoppedEpoch=0,null!=this.baseline?this.best=this.baseline:this.best=this.monitorFunc===kk?1/0:-1/0}async onEpochEnd(e,t){await vv(t);const r=this.getMonitorValue(t);null!=r&&(this.monitorFunc(r-this.minDelta,this.best)?(this.best=r,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=e,this.model.stopTraining=!0)))}async onTrainEnd(e){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(e){null==e&&(e={});const t=e[this.monitor];return null==t&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(e)}`),t}}const Ak={earlyStopping:function(e){return new Tk(e)}};var Sk,Mk;We().registerFlag("KEEP_INTERMEDIATE_TENSORS",(()=>!1),(e=>{e&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")})),function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_QINT16=15]="DT_QINT16",e[e.DT_QUINT16=16]="DT_QUINT16",e[e.DT_UINT16=17]="DT_UINT16",e[e.DT_COMPLEX128=18]="DT_COMPLEX128",e[e.DT_HALF=19]="DT_HALF",e[e.DT_RESOURCE=20]="DT_RESOURCE",e[e.DT_VARIANT=21]="DT_VARIANT",e[e.DT_UINT32=22]="DT_UINT32",e[e.DT_UINT64=23]="DT_UINT64",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",e[e.DT_QINT16_REF=115]="DT_QINT16_REF",e[e.DT_QUINT16_REF=116]="DT_QUINT16_REF",e[e.DT_UINT16_REF=117]="DT_UINT16_REF",e[e.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",e[e.DT_HALF_REF=119]="DT_HALF_REF",e[e.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",e[e.DT_VARIANT_REF=121]="DT_VARIANT_REF",e[e.DT_UINT32_REF=122]="DT_UINT32_REF",e[e.DT_UINT64_REF=123]="DT_UINT64_REF"}(Sk||(Sk={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(Mk||(Mk={}));const Ek={};function Ck(e,t){const r={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};Ek[e]=r}function Nk(e){return Ek[e]}function Ok(e){delete Ek[e]}function Ik(e,t,r,n,a){const i=t.inputParams[e];if(i&&void 0!==i.inputIndexStart){const e=i.inputIndexStart,o=0===i.inputIndexEnd?void 0:void 0===i.inputIndexEnd?e+1:i.inputIndexEnd;if("tensor"===i.type)return Pk(t.inputNames[i.inputIndexStart],r,n,a);if("tensors"===i.type)return t.inputNames.slice(e,o).map((e=>Pk(e,r,n,a)));const s=Pk(t.inputNames.slice(e)[0],r,n,a),l=s.dataSync();return"number"===i.type?l[0]:Re(s.shape,l)}const o=t.attrParams[e];return o&&o.value}function Pk(e,t,r,n){const[a,i]=Fk(e);if(null!=n){const e=n.getHashTableHandleByName(a);if(null!=e)return e}const o=r.currentContextIds.find((e=>!!t[Lk(a,e)]));return void 0!==o?t[Lk(a,o)][i]:void 0}function Rk(e,t){const[r,n,a]=Fk(e);return[Lk(r,t&&t.currentContextId),n,a]}function Lk(e,t){return t?`${e}-${t}`:e}function Fk(e){const t=e.split(":");if(1===t.length)return[e,0,void 0];const r=t[0],n=3===t.length?t[1]:void 0;return[r,Number(t[t.length-1]),n]}function Bk(e,t,r){let n=Ik("pad",e,t,r);if("explicit"===n){n=Ik("explicitPaddings",e,t,r);const a=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)a[e][0]=n[2*e],a[e][1]=n[2*e+1];return a}return n}function zk(e){return e.kept?e:So(e)}const jk=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],Uk=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],$k=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]}],Vk=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number"}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],qk=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],Wk=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],Hk=[{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],Gk=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],Xk=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]}],Yk=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]}],Zk=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],Kk=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]}],Jk=[{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"SparseToDense",category:"normalization",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!0,notSupported:!0}]}],Qk=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],eD=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]}],tD=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],rD=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],nD=[{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],aD=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}];class iD{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[T,A,S,M,E,C,N,O,I,P,R,L,F,B,z,j,U,$,V].map((e=>e.json)));this.opMappers=e.reduce(((e,t)=>(e[t.tfOpName]=t,e)),{})}transformGraph(e,t={}){const r=e.node,n=[],a=[],i=[],o=r.reduce(((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?n.push(e[t.name]):"Const"===t.op?a.push(e[t.name]):null!=t.input&&0!==t.input.length||i.push(e[t.name]),e)),{});let s=[];const l=[];let c={},u={};null!=t&&(c=this.mapSignatureEntries(t.inputs),u=this.mapSignatureEntries(t.outputs));const f=Object.keys(o);f.forEach((e=>{const t=o[e];t.inputNames.forEach(((e,r)=>{const[n,,a]=Rk(e),i=o[n];if(null!=i.outputs){const e=i.outputs.indexOf(a);if(-1!==e){const a=`${n}:${e}`;t.inputNames[r]=a}}t.inputs.push(i),i.children.push(t)}))})),0===Object.keys(u).length?f.forEach((e=>{const t=o[e];0===t.children.length&&l.push(t)})):Object.keys(u).forEach((e=>{const[t]=Rk(e),r=o[t];null!=r&&(r.signatureKey=u[e],l.push(r))})),Object.keys(c).length>0?Object.keys(c).forEach((e=>{const[t]=Rk(e),r=o[t];r&&(r.signatureKey=c[e],s.push(r))})):s=n;let p={};null!=e.library&&null!=e.library.function&&(p=e.library.function.reduce(((e,t)=>(e[t.signature.name]=this.mapFunction(t),e)),{}));const h={nodes:o,inputs:s,outputs:l,weights:a,placeholders:n,signature:t,functions:p};return i.length>0&&(h.initNodes=i),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce(((t,r)=>(t[e[r].name]=r,t)),{})}mapNode(e){const t=Nk(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const r={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map((e=>e.startsWith("^")?e.substr(1):e)),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(r.inputParams=t.inputs.reduce(((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e)),{})),null!=t.attrs&&(r.attrParams=t.attrs.reduce(((t,r)=>{const n=r.type;let a;switch(r.type){case"string":a=sD(e.attr,r.tfName,r.defaultValue),void 0===a&&r.tfDeprecatedName&&(a=sD(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"string[]":a=yD(e.attr,r.tfName,r.defaultValue),void 0===a&&r.tfDeprecatedName&&(a=yD(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number":a=cD(e.attr,r.tfName,r.defaultValue||0),void 0===a&&r.tfDeprecatedName&&(a=cD(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number[]":a=gD(e.attr,r.tfName,r.defaultValue),void 0===a&&r.tfDeprecatedName&&(a=gD(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool":a=lD(e.attr,r.tfName,r.defaultValue),void 0===a&&r.tfDeprecatedName&&(a=lD(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool[]":a=bD(e.attr,r.tfName,r.defaultValue),void 0===a&&r.tfDeprecatedName&&(a=bD(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape":a=mD(e.attr,r.tfName,r.defaultValue),void 0===a&&r.tfDeprecatedName&&(a=mD(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape[]":a=vD(e.attr,r.tfName,r.defaultValue),void 0===a&&r.tfDeprecatedName&&(a=vD(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype":a=pD(e.attr,r.tfName,r.defaultValue),void 0===a&&r.tfDeprecatedName&&(a=pD(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype[]":a=hD(e.attr,r.tfName,r.defaultValue),void 0===a&&r.tfDeprecatedName&&(a=hD(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"func":a=fD(e.attr,r.tfName,r.defaultValue),void 0===a&&r.tfDeprecatedName&&(a=fD(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${r.type} for op: ${e.op}`)}return t[r.name]={value:a,type:n},t}),{})),r}mapFunction(e){const t=e.nodeDef,r=[];let n={};null!=t&&(n=t.reduce(((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&r.push(e[t.name]),e)),{}));const a=[],i=[];e.signature.inputArg.forEach((e=>{const[t]=Rk(e.name),r={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:uD(e.type),type:"dtype"}},children:[]};r.signatureKey=e.name,a.push(r),n[t]=r})),Object.keys(n).forEach((e=>{const t=n[e];t.inputNames.forEach(((e,r)=>{const[a,,i]=Rk(e),o=n[a];if(null!=o.outputs){const e=o.outputs.indexOf(i);if(-1!==e){const n=`${a}:${e}`;t.inputNames[r]=n}}t.inputs.push(o),o.children.push(t)}))}));const o=e.ret;e.signature.outputArg.forEach((e=>{const[t,r]=Rk(o[e.name]),a=n[t];null!=a&&(a.defaultOutput=r,i.push(a))}));const s=this.mapArgsToSignature(e);return{nodes:n,inputs:a,outputs:i,weights:r,placeholders:[],signature:s}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce(((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e)),{}),outputs:e.signature.outputArg.reduce(((t,r)=>(t[r.name]=this.mapArgToTensorInfo(r,e.ret),t)),{})}}mapArgToTensorInfo(e,t){let r=e.name;return null!=t&&(r=t[r]),{name:r,dtype:e.type}}}function oD(e,t){const r=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=We().global;if(void 0!==t.atob)return t.atob(e);if("undefined"!=typeof Buffer)return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return t?r:r.toLowerCase()}function sD(e,t,r,n=!1){const a=e[t];return null!=a?oD(a.s,n):r}function lD(e,t,r){const n=e[t];return n?n.b:r}function cD(e,t,r){const n=e[t]||{},a=null!=n.i?n.i:null!=n.f?n.f:r;return"number"==typeof a?a:parseInt(a,10)}function uD(e){switch("string"==typeof e&&(e=Sk[e]),e){case Sk.DT_FLOAT:case Sk.DT_HALF:return"float32";case Sk.DT_INT32:case Sk.DT_INT64:case Sk.DT_INT8:case Sk.DT_UINT8:return"int32";case Sk.DT_BOOL:return"bool";case Sk.DT_DOUBLE:return"float32";case Sk.DT_STRING:return"string";default:return null}}function fD(e,t,r){const n=e[t];return n&&n.func?n.func.name:r}function pD(e,t,r){const n=e[t];return n&&n.type?uD(n.type):r}function hD(e,t,r){const n=e[t];return n&&n.list&&n.list.type?n.list.type.map((e=>uD(e))):r}function dD(e){if(!e.unknownRank)return null!=e.dim?e.dim.map((e=>"number"==typeof e.size?e.size:parseInt(e.size,10))):[]}function mD(e,t,r){const n=e[t];return n&&n.shape?dD(n.shape):r}function gD(e,t,r){const n=e[t];return n?((n.list.f&&n.list.f.length?n.list.f:n.list.i)||[]).map((e=>"number"==typeof e?e:parseInt(e,10))):r}function yD(e,t,r,n=!1){const a=e[t];return a&&a.list&&a.list.s?a.list.s.map((e=>oD(e,n))):r}function vD(e,t,r){const n=e[t];return n&&n.list&&n.list.shape?n.list.shape.map((e=>dD(e))):r}function bD(e,t,r){const n=e[t];return n&&n.list&&n.list.b?n.list.b:r}class xD{constructor(e,t,r){this.node=e,this.tensorMap=t,this.context=r,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map((e=>this.getInput(e))),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce(((e,t)=>(e[t]=this.getAttr(t),e)),{}))}getInput(e){return Pk(e,this.tensorMap,this.context)}getAttr(e,t){const r=this.node.rawAttrs[e];if(null!=r.tensor)return Pk(e,this.tensorMap,this.context);if(null!=r.i||null!=r.f)return cD(this.node.rawAttrs,e,t);if(null!=r.s)return sD(this.node.rawAttrs,e,t);if(null!=r.b)return lD(this.node.rawAttrs,e,t);if(null!=r.shape)return mD(this.node.rawAttrs,e,t);if(null!=r.type)return pD(this.node.rawAttrs,e,t);if(null!=r.list){if(null!=r.list.i||null!=r.list.f)return gD(this.node.rawAttrs,e,t);if(null!=r.list.s)return yD(this.node.rawAttrs,e,t);if(null!=r.list.shape)return vD(this.node.rawAttrs,e,t);if(null!=r.list.b)return bD(this.node.rawAttrs,e,t);if(null!=r.list.type)return hD(this.node.rawAttrs,e,t)}return t}}function _D(e,t,r=""){if("number"!=typeof e&&"number"!=typeof t){ne(e.length===t.length,(()=>r+` Shapes ${e} and ${t} must match`));for(let n=0;n<e.length;n++){const a=e[n],i=t[n];ne(a<0||i<0||a===i,(()=>r+` Shapes ${e} and ${t} must match`))}}}function wD(e){return"number"!=typeof e&&!e.some((e=>e<0))}function kD(e,t,r){let n=DD(e,r);const a=!wD(n);if(a&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${n}`);if(a&&t.forEach((e=>{n=DD(e.shape,n)})),!wD(n))throw new Error(`Non-fully-defined elementShape: ${n}`);return n}function DD(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const r=[];for(let n=0;n<e.length;++n){const a=e[n],i=t[n];if(a>=0&&i>=0&&a!==i)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);r[n]=a>=0?a:i}return r}class TD{constructor(e,t,r,n,a,i,o){this.name=e,this.dtype=t,this.maxSize=r,this.elementShape=n,this.identicalElementShapes=a,this.dynamicSize=i,this.clearAfterRead=o,this.tensors=[],this.closed_=!1,this.idTensor=wl(0),Ks(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map((e=>this.read(e)))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const r=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n          because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),_D(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),r.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(r.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);r.tensor=t,Ks(t),r.written=!0,this.tensors[e]=r}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach(((e,r)=>this.write(e,t[r])))}gather(e,t){if(t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let t=0;t<this.size();t++)e.push(t)}if(0===e.length)return Ei([],[0].concat(this.elementShape));const r=this.readMany(e);return _D(this.elementShape,r[0].shape,"TensorArray shape mismatch: "),Yf(r,0)}concat(e){if(e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${e}`);if(0===this.size())return Ei([],[0].concat(this.elementShape));const t=[];for(let e=0;e<this.size();e++)t.push(e);const r=this.readMany(t);return _D(this.elementShape,r[0].shape,`TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${r[0].shape})`),pc(r,0)}scatter(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const r=Math.max(...e);if(!this.dynamicSize&&r>=this.maxSize)throw new Error(`Max index must be < array size (${r}  vs. ${this.maxSize})`);this.writeMany(e,lp(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let r=0;const n=e.map((e=>(r+=e,r)));if(r!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n          tensor.shape[0], but sum of lengths is\n        ${r}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const a=0===r?0:t.size/r,i=[];Ys((()=>{t=cc(t,[1,r,a]);for(let r=0;r<e.length;++r){const o=[0,0===r?0:n[r-1],0],s=[1,e[r],a];i[r]=cc(dc(t,o,s),this.elementShape)}return i}));const o=[];for(let t=0;t<e.length;t++)o[t]=t;this.writeMany(o,i)}}class AD{constructor(e,t,r,n=-1){this.tensors=e,this.elementShape=t,this.elementDtype=r,null!=e&&e.forEach((e=>{if(r!==e.dtype)throw new Error(`Invalid data types; op elements ${r}, but list elements ${e.dtype}`);_D(t,e.shape,"TensorList shape mismatch: "),Ks(e)})),this.idTensor=wl(0),this.maxNumElements=n,Ks(this.idTensor)}get id(){return this.idTensor.id}copy(){return new AD([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.id)||t.dispose()})),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,r=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(-1!==r&&this.tensors.length!==r)throw new Error(`Operation expected a list with ${r} elements but got a list with ${this.tensors.length} elements.`);_D(e,this.elementShape,"TensorList shape mismatch: ");const n=kD(this.elementShape,this.tensors,e);return Ys((()=>{const e=this.tensors.map((e=>cc(e,n)));return Yf(e,0)}))}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const r=kD(this.elementShape,this.tensors,e),n=this.tensors.pop();return _D(n.shape,e,"TensorList shape mismatch: "),cc(n,r)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(_D(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Ks(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);this.tensors.length=e}getItem(e,t,r){if(r!==this.elementDtype)throw new Error(`Invalid data types; op elements ${r}, but list elements ${this.elementDtype}`);if(e<0||e>this.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);_D(this.tensors[e].shape,t,"TensorList shape mismatch: ");const n=kD(this.elementShape,this.tensors,t);return cc(this.tensors[e],n)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);_D(this.elementShape,t.shape,"TensorList shape mismatch: "),Ks(t),this.tensors[e]=t}gather(e,t,r){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);_D(this.elementShape,r,"TensorList shape mismatch: "),e=e.slice(0,this.size());const n=kD(this.elementShape,this.tensors,r);return 0===e.length?Ei([],[0].concat(n)):Ys((()=>{const t=e.map((e=>cc(this.tensors[e],n)));return Yf(t,0)}))}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);_D(this.elementShape,t,"TensorList shape mismatch: ");const r=kD(this.elementShape,this.tensors,t);return 0===this.size()?Ei([],[0].concat(r)):Ys((()=>{const e=this.tensors.map((e=>cc(e,r)));return pc(e,0)}))}}function SD(e,t,r){const[n,a]=Ik("fusedOps",e,t,r),i="biasadd"===n,o=!i,s="prelu"===a,l="fusedbatchnorm"===n,c=Ik("numArgs",e,t,r);if(i){if(s&&2!==c)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!s&&i&&1!==c)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(l)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");const u=Ik("strides",e,t,r),f=Bk(e,t,r),p=Ik("dataFormat",e,t,r).toUpperCase(),h=Ik("dilations",e,t,r);let[d,m]=Ik("args",e,t,r);return o&&(m=d,d=void 0),{stride:u,pad:f,dataFormat:p,dilations:h,biasArg:d,preluArg:m,activationFunc:a,leakyreluAlpha:Ik("leakyreluAlpha",e,t,r)}}function MD(e,t,r){return{boxes:Ik("boxes",e,t,r),scores:Ik("scores",e,t,r),maxOutputSize:Ik("maxOutputSize",e,t,r),iouThreshold:Ik("iouThreshold",e,t,r),scoreThreshold:Ik("scoreThreshold",e,t,r),softNmsSigma:Ik("softNmsSigma",e,t,r)}}class ED{constructor(e,t){this.keyDType=e,this.valueDType=t,this.handle=wl(0),this.tensorMap=new Map,Ks(this.handle)}get id(){return this.handle.id}clearAndClose(){this.tensorMap.forEach((e=>e.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return wl(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const r=await e.data();return this.tensorMap.forEach((e=>e.dispose())),this.tensorMap.clear(),Ys((()=>{const e=lp(t),n=r.length,a=e.length;ne(n===a,(()=>`The number of elements doesn't match, keys has ${n} elements, the values has ${a} elements.`));for(let t=0;t<n;t++){const n=r[t],a=e[t];Ks(a),this.tensorMap.set(n,a)}return this.handle}))}async find(e,t){this.checkKeyAndValueTensor(e,t);const r=await e.data();return Ys((()=>{const e=[];for(let n=0;n<r.length;n++){const a=r[n],i=this.findWithDefault(a,t);e.push(i)}return Yf(e)}))}findWithDefault(e,t){const r=this.tensorMap.get(e);return null!=r?r:t}checkKeyAndValueTensor(e,t){if(e.dtype!==this.keyDType)throw new Error(`Expect key dtype ${this.keyDType}, but got ${e.dtype}`);if(t.dtype!==this.valueDType)throw new Error(`Expect value dtype ${this.valueDType}, but got ${t.dtype}`)}}function CD(e,t,r,n){const a=((e,t,r)=>{switch(e.category){case"arithmetic":return Ys((()=>((e,t,r)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[ll(Ik("a",e,t,r),Ik("b",e,t,r))];case"AddN":return[zl(Ik("tensors",e,t,r))];case"FloorMod":case"Mod":return[Xu(Ik("a",e,t,r),Ik("b",e,t,r))];case"Mul":return[fl(Ik("a",e,t,r),Ik("b",e,t,r))];case"RealDiv":case"Div":return[ul(Ik("a",e,t,r),Ik("b",e,t,r))];case"DivNoNan":return[Xc(Ik("a",e,t,r),Ik("b",e,t,r))];case"FloorDiv":return[cl(Ik("a",e,t,r),Ik("b",e,t,r))];case"Sub":return[Ml(Ik("a",e,t,r),Ik("b",e,t,r))];case"Minimum":return[Hu(Ik("a",e,t,r),Ik("b",e,t,r))];case"Maximum":return[Nl(Ik("a",e,t,r),Ik("b",e,t,r))];case"Pow":return[Sl(Ik("a",e,t,r),Ik("b",e,t,r))];case"SquaredDifference":return[Gf(Ik("a",e,t,r),Ik("b",e,t,r))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"basic_math":return Ys((()=>((e,t,r)=>{switch(e.op){case"Abs":case"ComplexAbs":return[Cl(Ik("x",e,t,r))];case"Acos":return[Fl(Ik("x",e,t,r))];case"Acosh":return[Bl(Ik("x",e,t,r))];case"Asin":return[ql(Ik("x",e,t,r))];case"Asinh":return[Wl(Ik("x",e,t,r))];case"Atan":return[Hl(Ik("x",e,t,r))];case"Atan2":return[Gl(Ik("x",e,t,r),Ik("y",e,t,r))];case"Atanh":return[Xl(Ik("x",e,t,r))];case"Ceil":return[Tc(Ik("x",e,t,r))];case"Complex":return[Si(Ik("real",e,t,r),Ik("imag",e,t,r))];case"Cos":return[Bc(Ik("x",e,t,r))];case"Cosh":return[zc(Ik("x",e,t,r))];case"Elu":return[Kc(Ik("x",e,t,r))];case"Erf":return[Jc(Ik("x",e,t,r))];case"Exp":return[Qc(Ik("x",e,t,r))];case"Expm1":return[tu(Ik("x",e,t,r))];case"Floor":return[au(Ik("x",e,t,r))];case"Log":return[yu(Ik("x",e,t,r))];case"Log1p":return[vu(Ik("x",e,t,r))];case"Imag":return[lu(Ik("x",e,t,r))];case"Neg":return[bu(Ik("x",e,t,r))];case"Reciprocal":return[_f(Ik("x",e,t,r))];case"Real":return[xf(Ik("x",e,t,r))];case"Relu":return[wf(Ik("x",e,t,r))];case"Round":return[Ef(Ik("x",e,t,r))];case"Selu":return[Nf(Ik("x",e,t,r))];case"Sigmoid":return[hc(Ik("x",e,t,r))];case"Sin":return[Rf(Ik("x",e,t,r))];case"Sign":return[Pf(Ik("x",e,t,r))];case"Sinh":return[Lf(Ik("x",e,t,r))];case"Softplus":return[xu(Ik("x",e,t,r))];case"Sqrt":return[pl(Ik("x",e,t,r))];case"Square":return[hl(Ik("x",e,t,r))];case"Tanh":return[mc(Ik("x",e,t,r))];case"Tan":return[Jf(Ik("x",e,t,r))];case"ClipByValue":return[Ac(Ik("x",e,t,r),Ik("clipValueMin",e,t,r),Ik("clipValueMax",e,t,r))];case"Relu6":return[kf(Ik("x",e,t,r))];case"Rsqrt":return[Cf(Pk(e.inputNames[0],t,r))];case"Prod":return[uf(Ik("x",e,t,r),Ik("axes",e,t,r))];case"LeakyRelu":return[pu(Ik("x",e,t,r),Ik("alpha",e,t,r))];case"Prelu":return[cf(Ik("x",e,t,r),Ik("alpha",e,t,r))];case"IsNan":return[fu(Pk(e.inputNames[0],t,r))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"control":return(async(e,t,r)=>{switch(e.op){case"If":case"StatelessIf":{const n=Ik("thenBranch",e,t,r),a=Ik("elseBranch",e,t,r),i=Ik("cond",e,t,r),o=Ik("args",e,t,r);return(await i.data())[0]?r.functionMap[n].executeFunctionAsync(o,r.tensorArrayMap,r.tensorListMap):r.functionMap[a].executeFunctionAsync(o,r.tensorArrayMap,r.tensorListMap)}case"While":case"StatelessWhile":{const n=Ik("body",e,t,r),a=Ik("cond",e,t,r),i=Ik("args",e,t,r),o=await r.functionMap[a].executeFunctionAsync(i,r.tensorArrayMap,r.tensorListMap),s=i.map((e=>e.id));let l=await o[0].data();o.forEach((e=>{e.kept||-1!==s.indexOf(e.id)||e.dispose()}));let c=i;for(;l[0];){const e=c;c=await r.functionMap[n].executeFunctionAsync(c,r.tensorArrayMap,r.tensorListMap);const t=c.map((e=>e.id));e.forEach((e=>{e.kept||-1!==s.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}));const i=await r.functionMap[a].executeFunctionAsync(c,r.tensorArrayMap,r.tensorListMap);l=await i[0].data(),i.forEach((e=>{e.kept||-1!==s.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}))}return c}case"LoopCond":return[zk(Ik("pred",e,t,r))];case"Switch":{const n=Ik("pred",e,t,r);let a=Ik("data",e,t,r);return a.kept||(a=zk(a)),(await n.data())[0]?[void 0,a]:[a,void 0]}case"Merge":{const n=e.inputNames.find((e=>void 0!==Pk(e,t,r)));return n?[zk(Pk(n,t,r))]:void 0}case"Enter":{const n=Ik("frameName",e,t,r),a=Ik("tensor",e,t,r);return r.enterFrame(n),[zk(a)]}case"Exit":{const n=Ik("tensor",e,t,r);return r.exitFrame(),[zk(n)]}case"NextIteration":{const n=Ik("tensor",e,t,r);return r.nextIteration(),[zk(n)]}case"TensorArrayV3":{const n=Ik("size",e,t,r),a=Ik("dtype",e,t,r),i=Ik("elementShape",e,t,r),o=Ik("dynamicSize",e,t,r),s=Ik("clearAfterRead",e,t,r),l=Ik("identicalElementShapes",e,t,r),c=Ik("name",e,t,r),u=new TD(c,a,n,i,l,o,s);return r.addTensorArray(u),[u.idTensor,wl(1)]}case"TensorArrayWriteV3":{const n=Ik("tensorArrayId",e,t,r),a=Ik("index",e,t,r),i=Ik("tensor",e,t,r),o=r.getTensorArray(n.id);return o.write(a,i),[o.idTensor]}case"TensorArrayReadV3":{const n=Ik("tensorArrayId",e,t,r),a=Ik("index",e,t,r);return[r.getTensorArray(n.id).read(a)]}case"TensorArrayGatherV3":{const n=Ik("tensorArrayId",e,t,r),a=Ik("indices",e,t,r),i=Ik("dtype",e,t,r);return[r.getTensorArray(n.id).gather(a,i)]}case"TensorArrayScatterV3":{const n=Ik("tensorArrayId",e,t,r),a=Ik("indices",e,t,r),i=Ik("tensor",e,t,r),o=r.getTensorArray(n.id);return o.scatter(a,i),[o.idTensor]}case"TensorArrayConcatV3":{const n=Ik("tensorArrayId",e,t,r),a=r.getTensorArray(n.id),i=Ik("dtype",e,t,r);return[a.concat(i)]}case"TensorArraySplitV3":{const n=Ik("tensorArrayId",e,t,r),a=Ik("tensor",e,t,r),i=Ik("lengths",e,t,r),o=r.getTensorArray(n.id);return o.split(i,a),[o.idTensor]}case"TensorArraySizeV3":{const n=Ik("tensorArrayId",e,t,r);return[wl(r.getTensorArray(n.id).size(),"int32")]}case"TensorArrayCloseV3":{const n=Ik("tensorArrayId",e,t,r),a=r.getTensorArray(n.id);return a.clearAndClose(),[a.idTensor]}case"TensorListSetItem":{const n=Ik("tensorListId",e,t,r),a=Ik("index",e,t,r),i=Ik("tensor",e,t,r),o=r.getTensorList(n.id);return o.setItem(a,i),[o.idTensor]}case"TensorListGetItem":{const n=Ik("tensorListId",e,t,r),a=Ik("index",e,t,r),i=Ik("elementShape",e,t,r),o=Ik("elementDType",e,t,r);return[r.getTensorList(n.id).getItem(a,i,o)]}case"TensorListScatterV2":case"TensorListScatter":{const n=Ik("indices",e,t,r),a=function(e,t,r,n){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const a=Math.max(...t);if(null!=n&&-1!==n&&a>=n)throw new Error(`Max index must be < array size (${a}  vs. ${n})`);const i=new AD([],r,e.dtype,n),o=lp(e,0);return t.forEach(((e,t)=>{i.setItem(e,o[t])})),i}(Ik("tensor",e,t,r),n,Ik("elementShape",e,t,r),Ik("numElements",e,t,r));return r.addTensorList(a),[a.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const n=Ik("elementShape",e,t,r),a=Ik("elementDType",e,t,r);let i;i="TensorListReserve"===e.op?"numElements":"maxNumElements";const o=function(e,t,r){return new AD([],e,t,r)}(n,a,Ik(i,e,t,r));return r.addTensorList(o),[o.idTensor]}case"TensorListGather":{const n=Ik("tensorListId",e,t,r),a=Ik("indices",e,t,r),i=Ik("elementShape",e,t,r),o=Ik("elementDType",e,t,r);return[r.getTensorList(n.id).gather(a,o,i)]}case"TensorListStack":{const n=Ik("tensorListId",e,t,r),a=Ik("elementShape",e,t,r),i=Ik("elementDType",e,t,r),o=Ik("numElements",e,t,r);return[r.getTensorList(n.id).stack(a,i,o)]}case"TensorListFromTensor":{const n=function(e,t,r){const n=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==r)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${r}`);_D(e.shape.slice(1),t,"TensorList shape mismatch: ");const a=lp(e);return new AD(a,t,n)}(Ik("tensor",e,t,r),Ik("elementShape",e,t,r),Ik("elementDType",e,t,r));return r.addTensorList(n),[n.idTensor]}case"TensorListConcat":{const n=Ik("tensorListId",e,t,r),a=r.getTensorList(n.id),i=Ik("dtype",e,t,r),o=Ik("elementShape",e,t,r);return[a.concat(i,o)]}case"TensorListPushBack":{const n=Ik("tensorListId",e,t,r),a=Ik("tensor",e,t,r),i=r.getTensorList(n.id);return i.pushBack(a),[i.idTensor]}case"TensorListPopBack":{const n=Ik("tensorListId",e,t,r),a=Ik("elementShape",e,t,r),i=Ik("elementDType",e,t,r);return[r.getTensorList(n.id).popBack(a,i)]}case"TensorListSplit":{const n=Ik("tensor",e,t,r),a=Ik("elementShape",e,t,r),i=function(e,t,r){let n=0;const a=t.map((e=>(n+=e,n)));if(n!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n          tensor.shape[0], but sum of lengths is\n        ${n}, and tensor's shape is: ${e.shape}`);const i=DD(e.shape.slice(1),r),o=0===n?0:e.size/n,s=Ys((()=>{const r=[];e=cc(e,[1,n,o]);for(let n=0;n<t.length;++n){const s=[0,0===n?0:a[n-1],0],l=[1,t[n],o];r[n]=cc(dc(e,s,l),i)}return e.dispose(),r})),l=new AD([],r,e.dtype,t.length);for(let e=0;e<s.length;e++)l.setItem(e,s[e]);return l}(n,Ik("lengths",e,t,r),a);return r.addTensorList(i),[i.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r);case"convolution":return Ys((()=>((e,t,r)=>{switch(e.op){case"Conv1D":{const n=Ik("stride",e,t,r),a=Ik("pad",e,t,r),i=Ik("dataFormat",e,t,r).toUpperCase(),o=Ik("dilation",e,t,r);return[Oc(Ik("x",e,t,r),Ik("filter",e,t,r),n,a,i,o)]}case"Conv2D":{const n=Ik("strides",e,t,r),a=Bk(e,t,r),i=Ik("dataFormat",e,t,r).toUpperCase(),o=Ik("dilations",e,t,r);return[Nc(Ik("x",e,t,r),Ik("filter",e,t,r),[n[1],n[2]],a,i,[o[1],o[2]])]}case"_FusedConv2D":{const{stride:n,pad:a,dataFormat:i,dilations:o,biasArg:s,preluArg:l,activationFunc:c,leakyreluAlpha:u}=SD(e,t,r);return[Mp({x:Ik("x",e,t,r),filter:Ik("filter",e,t,r),strides:[n[1],n[2]],pad:a,dataFormat:i,dilations:[o[1],o[2]],bias:s,activation:c,preluActivationWeights:l,leakyreluAlpha:u})]}case"FusedDepthwiseConv2dNative":{const{stride:n,pad:a,dataFormat:i,dilations:o,biasArg:s,preluArg:l,activationFunc:c,leakyreluAlpha:u}=SD(e,t,r);return[Np({x:Ik("x",e,t,r),filter:Ik("filter",e,t,r),strides:[n[1],n[2]],pad:a,dataFormat:i,dilations:[o[1],o[2]],bias:s,activation:c,preluActivationWeights:l,leakyreluAlpha:u})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const n=Ik("outputShape",e,t,r),a=Ik("strides",e,t,r),i=Bk(e,t,r);return[Pc(Ik("x",e,t,r),Ik("filter",e,t,r),n,[a[1],a[2]],i)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const n=Ik("strides",e,t,r),a=Bk(e,t,r),i=Ik("dilations",e,t,r),o=Ik("dataFormat",e,t,r).toUpperCase();return[Vc(Ik("input",e,t,r),Ik("filter",e,t,r),[n[1],n[2]],a,o,[i[1],i[2]])]}case"Conv3D":{const n=Ik("strides",e,t,r),a=Ik("pad",e,t,r),i=Ik("dataFormat",e,t,r).toUpperCase(),o=Ik("dilations",e,t,r);return[Rc(Ik("x",e,t,r),Ik("filter",e,t,r),[n[1],n[2],n[3]],a,i,[o[1],o[2],o[3]])]}case"AvgPool":{const n=Ik("strides",e,t,r),a=Ik("pad",e,t,r),i=Ik("kernelSize",e,t,r);return[uc(Ik("x",e,t,r),[i[1],i[2]],[n[1],n[2]],a)]}case"MaxPool":{const n=Ik("strides",e,t,r),a=Ik("pad",e,t,r),i=Ik("kernelSize",e,t,r);return[Bu(Ik("x",e,t,r),[i[1],i[2]],[n[1],n[2]],a)]}case"MaxPoolWithArgmax":{const n=Ik("strides",e,t,r),a=Ik("pad",e,t,r),i=Ik("kernelSize",e,t,r),o=Ik("includeBatchInIndex",e,t,r),{result:s,indexes:l}=ju(Ik("x",e,t,r),[i[1],i[2]],[n[1],n[2]],a,o);return[s,l]}case"AvgPool3D":{const n=Ik("strides",e,t,r),a=Ik("pad",e,t,r),i=Ik("kernelSize",e,t,r);return[fc(Ik("x",e,t,r),[i[1],i[2],i[3]],[n[1],n[2],n[3]],a)]}case"MaxPool3D":{const n=Ik("strides",e,t,r),a=Ik("pad",e,t,r),i=Ik("kernelSize",e,t,r);return[zu(Ik("x",e,t,r),[i[1],i[2],i[3]],[n[1],n[2],n[3]],a)]}case"Dilation2D":{const n=Ik("strides",e,t,r),a=Ik("pad",e,t,r),i=Ik("dilations",e,t,r),o=n[1],s=n[2],l=i[1],c=i[2];return[Wc(Ik("x",e,t,r),Ik("filter",e,t,r),[o,s],a,[l,c],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"creation":return Ys((()=>((e,t,r)=>{switch(e.op){case"Fill":{const n=Ik("shape",e,t,r),a=Ik("dtype",e,t,r);return[Tl(n,Ik("value",e,t,r),a)]}case"LinSpace":return[mu(Ik("start",e,t,r),Ik("stop",e,t,r),Ik("num",e,t,r))];case"Multinomial":{const n=Ik("logits",e,t,r),a=Ik("numSamples",e,t,r),i=Ik("seed",e,t,r);return[Ku(n,a,i)]}case"OneHot":{const n=Ik("indices",e,t,r),a=Ik("depth",e,t,r),i=Ik("onValue",e,t,r),o=Ik("offValue",e,t,r);return[Go(n,a,i,o)]}case"Ones":return[Vu(Ik("shape",e,t,r),Ik("dtype",e,t,r))];case"OnesLike":return[Qu(Ik("x",e,t,r))];case"RandomUniform":return[vf(Ik("shape",e,t,r),Ik("minval",e,t,r),Ik("maxval",e,t,r),Ik("dtype",e,t,r))];case"Range":return[bf(Ik("start",e,t,r),Ik("stop",e,t,r),Ik("step",e,t,r),Ik("dtype",e,t,r))];case"TruncatedNormal":{const n=Ik("shape",e,t,r),a=Ik("mean",e,t,r),i=Ik("stdDev",e,t,r),o=Ik("seed",e,t,r);return[ip(n,a,i,Ik("dtype",e,t,r),o)]}case"Zeros":return[$u(Ik("shape",e,t,r),Ik("dtype",e,t,r))];case"ZerosLike":return[dl(Ik("x",e,t,r))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"dynamic":return(async(e,t,r)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:n,scores:a,maxOutputSize:i,iouThreshold:o,scoreThreshold:s,softNmsSigma:l}=MD(e,t,r),c=await Sh.nonMaxSuppressionWithScoreAsync(n,a,i,o,s,l);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:n,scores:a,maxOutputSize:i,iouThreshold:o,scoreThreshold:s}=MD(e,t,r),l=Ik("padToMaxOutputSize",e,t,r),c=await Sh.nonMaxSuppressionPaddedAsync(n,a,i,o,s,l);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:n,scores:a,maxOutputSize:i,iouThreshold:o,scoreThreshold:s}=MD(e,t,r);return[await Sh.nonMaxSuppressionAsync(n,a,i,o,s)]}case"Where":{const n=Ao(Ik("condition",e,t,r),"bool"),a=[await fp(n)];return n.dispose(),a}case"ListDiff":return If(Ik("x",e,t,r),Ik("y",e,t,r));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r);case"evaluation":return Ys((()=>((e,t,r)=>{switch(e.op){case"TopKV2":{const n=Ik("x",e,t,r),a=Ik("k",e,t,r),i=Ik("sorted",e,t,r),o=ap(n,a,i);return[o.values,o.indices]}case"Unique":{const n=Ik("x",e,t,r),a=op(n);return[a.values,a.indices]}case"UniqueV2":{const n=Ik("x",e,t,r),a=Ik("axis",e,t,r),i=op(n,a);return[i.values,i.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"image":return Ys((()=>((e,t,r)=>{switch(e.op){case"ResizeBilinear":{const n=Ik("images",e,t,r),a=Ik("size",e,t,r),i=Ik("alignCorners",e,t,r),o=Ik("halfPixelCenters",e,t,r);return[Sh.resizeBilinear(n,[a[0],a[1]],i,o)]}case"ResizeNearestNeighbor":{const n=Ik("images",e,t,r),a=Ik("size",e,t,r),i=Ik("alignCorners",e,t,r),o=Ik("halfPixelCenters",e,t,r);return[Sh.resizeNearestNeighbor(n,[a[0],a[1]],i,o)]}case"CropAndResize":{const n=Ik("image",e,t,r),a=Ik("boxes",e,t,r),i=Ik("boxInd",e,t,r),o=Ik("cropSize",e,t,r),s=Ik("method",e,t,r),l=Ik("extrapolationValue",e,t,r);return[Sh.cropAndResize(n,a,i,o,s,l)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"graph":return Ys((()=>((e,t,r)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const n=Ik("default",e,t,r);return[Pk(e.name,t,r)||n];case"Placeholder":return[Pk(e.name,t,r)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[zk(Ik("x",e,t,r))];case"IdentityN":return Ik("x",e,t,r).map((e=>zk(e)));case"Shape":return[Qf(Ik("x",e,t,r).shape,"int32")];case"ShapeN":return Ik("x",e,t,r).map((e=>Qf(e.shape)));case"Size":return[wl(Ik("x",e,t,r).size,"int32")];case"Rank":return[wl(Ik("x",e,t,r).rank,"int32")];case"NoOp":return[wl(1)];case"Print":const a=Ik("x",e,t,r),i=Ik("data",e,t,r),o=Ik("message",e,t,r),s=Ik("summarize",e,t,r);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(o);for(let e=0;e<i.length;e++)console.log(Array.prototype.slice.call(i[e].dataSync()).slice(0,s));return[a];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"logical":return Ys((()=>((e,t,r)=>{switch(e.op){case"Equal":return[Hc(Ik("a",e,t,r),Ik("b",e,t,r))];case"NotEqual":return[Ju(Ik("a",e,t,r),Ik("b",e,t,r))];case"Greater":return[ou(Ik("a",e,t,r),Ik("b",e,t,r))];case"GreaterEqual":return[su(Ik("a",e,t,r),Ik("b",e,t,r))];case"Less":return[hu(Ik("a",e,t,r),Ik("b",e,t,r))];case"LessEqual":return[du(Ik("a",e,t,r),Ik("b",e,t,r))];case"LogicalAnd":return[Pu(Ik("a",e,t,r),Ik("b",e,t,r))];case"LogicalNot":return[Ru(Ik("a",e,t,r))];case"LogicalOr":return[Lu(Ik("a",e,t,r),Ik("b",e,t,r))];case"Select":case"SelectV2":return[Gc(Ik("condition",e,t,r),Ik("a",e,t,r),Ik("b",e,t,r))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"matrices":return Ys((()=>((e,t,r)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[Ho(Ik("a",e,t,r),Ik("b",e,t,r),Ik("transposeA",e,t,r),Ik("transposeB",e,t,r))];case"Einsum":return[Zc(Ik("equation",e,t,r),...Ik("tensors",e,t,r))];case"Transpose":return[Xo(Ik("x",e,t,r),Ik("perm",e,t,r))];case"_FusedMatMul":const[n,a]=Ik("fusedOps",e,t,r),i="biasadd"===n,o="prelu"===a,s=Ik("numArgs",e,t,r),l=Ik("leakyreluAlpha",e,t,r);if(i){if(o&&2!==s)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&1!==s)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[c,u]=Ik("args",e,t,r);return[Op({a:Ik("a",e,t,r),b:Ik("b",e,t,r),transposeA:Ik("transposeA",e,t,r),transposeB:Ik("transposeB",e,t,r),bias:c,activation:a,preluActivationWeights:u,leakyreluAlpha:l})];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"normalization":return Ys((()=>((e,t,r)=>{switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[vc(Ik("x",e,t,r),Ik("mean",e,t,r),Ik("variance",e,t,r),Ik("offset",e,t,r),Ik("scale",e,t,r),Ik("epsilon",e,t,r))];case"LRN":return[gu(Ik("x",e,t,r),Ik("radius",e,t,r),Ik("bias",e,t,r),Ik("alpha",e,t,r),Ik("beta",e,t,r))];case"Softmax":return[Uf(Ik("x",e,t,r))];case"LogSoftmax":return[Du(Ik("x",e,t,r))];case"SparseToDense":return[yp(Ik("sparseIndices",e,t,r),Ik("outputShape",e,t,r),Ik("sparseValues",e,t,r),Ik("defaultValue",e,t,r))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"reduction":return Ys((()=>((e,t,r)=>{switch(e.op){case"Max":{const n=Ik("axis",e,t,r),a=Ik("keepDims",e,t,r);return[wu(Ik("x",e,t,r),n,a)]}case"Mean":{const n=Ik("axis",e,t,r),a=Ik("keepDims",e,t,r);return[Uu(Ik("x",e,t,r),n,a)]}case"Min":{const n=Ik("axis",e,t,r),a=Ik("keepDims",e,t,r);return[Wu(Ik("x",e,t,r),n,a)]}case"Sum":{const n=Ik("axis",e,t,r),a=Ik("keepDims",e,t,r);return[ku(Ik("x",e,t,r),n,a)]}case"All":{const n=Ik("axis",e,t,r),a=Ik("keepDims",e,t,r);return[jl(Ik("x",e,t,r),n,a)]}case"Any":{const n=Ik("axis",e,t,r),a=Ik("keepDims",e,t,r);return[Ul(Ik("x",e,t,r),n,a)]}case"ArgMax":{const n=Ik("axis",e,t,r);return[$l(Ik("x",e,t,r),n)]}case"ArgMin":{const n=Ik("axis",e,t,r);return[Vl(Ik("x",e,t,r),n)]}case"Prod":{const n=Ik("axis",e,t,r),a=Ik("keepDims",e,t,r);return[uf(Ik("x",e,t,r),n,a)]}case"Cumsum":{const n=Ik("axis",e,t,r),a=Ik("exclusive",e,t,r),i=Ik("reverse",e,t,r);return[jc(Ik("x",e,t,r),n,a,i)]}case"Bincount":const n=Ik("x",e,t,r),a=Ik("weights",e,t,r),i=Ik("size",e,t,r);return[wc(n,a,i)];case"DenseBincount":{const n=Ik("x",e,t,r),a=Ik("weights",e,t,r),i=Ik("size",e,t,r),o=Ik("binaryOutput",e,t,r);return[Uc(n,a,i,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"slice_join":return Ys((()=>((e,t,r)=>{switch(e.op){case"ConcatV2":case"Concat":{const n=Ik("n",e,t,r),a=Ik("axis",e,t,r);let i=Ik("tensors",e,t,r);return i=i.slice(0,n),[pc(i,a)]}case"Gather":{const n=Ik("x",e,t,r),a=Ik("indices",e,t,r);return[iu(n,Ao(a,"int32"),0)]}case"GatherV2":{const n=Ik("axis",e,t,r),a=Ik("batchDims",e,t,r),i=Ik("x",e,t,r),o=Ik("indices",e,t,r);return[iu(i,Ao(o,"int32"),n,a)]}case"Reverse":{const n=Ik("dims",e,t,r),a=[];for(let e=0;e<n.length;e++)n[e]&&a.push(e);const i=Ik("x",e,t,r);return[Df(i,a)]}case"ReverseV2":{const n=Ik("axis",e,t,r),a=Ik("x",e,t,r);return[Df(a,n)]}case"Slice":{const n=Ik("begin",e,t,r),a=Ik("size",e,t,r);return[dc(Ik("x",e,t,r),n,a)]}case"StridedSlice":{const n=Ik("begin",e,t,r),a=Ik("end",e,t,r),i=Ik("strides",e,t,r),o=Ik("beginMask",e,t,r),s=Ik("endMask",e,t,r),l=Ik("ellipsisMask",e,t,r),c=Ik("newAxisMask",e,t,r),u=Ik("shrinkAxisMask",e,t,r),f=Ik("x",e,t,r);return[Kf(f,n,a,i,o,s,l,c,u)]}case"Pack":return Ys((()=>{const n=Ik("axis",e,t,r),a=Ik("tensors",e,t,r),i=a[0].shape,o=Xf(a[0]).shape,s=a.map((e=>{const t=ce(e.shape,i);if(!t&&!ce(Xf(e).shape,o))throw new Error("the input tensors shape does not match");return t?e:cc(e,i)}));return[Yf(s,n)]}));case"Unpack":{const n=Ik("axis",e,t,r),a=Ik("tensor",e,t,r);return lp(a,n)}case"Tile":{const n=Ik("reps",e,t,r);return[ru(Ik("x",e,t,r),n)]}case"Split":case"SplitV":{const n=Ik("axis",e,t,r),a=Ik("numOrSizeSplits",e,t,r),i=Ik("x",e,t,r);return Wf(i,a,n)}case"ScatterNd":{const n=Ik("indices",e,t,r),a=Ik("values",e,t,r),i=Ik("shape",e,t,r);return[gp(n,a,i)]}case"GatherNd":{const n=Ik("x",e,t,r),a=Ik("indices",e,t,r);return[vp(n,a)]}case"SparseToDense":{const n=Ik("sparseIndices",e,t,r),a=Ik("outputShape",e,t,r),i=Ik("sparseValues",e,t,r),o=Ik("defaultValue",e,t,r);return[yp(n,i,a,i.dtype===o.dtype?o:Ao(o,i.dtype))]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"sparse":return Ys((()=>((e,t,r)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:n,outputValues:a,emptyRowIndicator:i,reverseIndexMap:o}=Ch.sparseFillEmptyRows(Ik("indices",e,t,r),Ik("values",e,t,r),Ik("denseShape",e,t,r),Ik("defaultValue",e,t,r));return[n,a,i,o]}case"SparseReshape":{const{outputIndices:n,outputShape:a}=Ch.sparseReshape(Ik("inputIndices",e,t,r),Ik("inputShape",e,t,r),Ik("newShape",e,t,r));return[n,a]}case"SparseSegmentMean":return[Ch.sparseSegmentMean(Ik("data",e,t,r),Ik("indices",e,t,r),Ik("segmentIds",e,t,r))];case"SparseSegmentSum":return[Ch.sparseSegmentSum(Ik("data",e,t,r),Ik("indices",e,t,r),Ik("segmentIds",e,t,r))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"spectral":return Ys((()=>((e,t,r)=>{switch(e.op){case"FFT":return[$f(Ik("x",e,t,r))];case"IFFT":return[Vf(Ik("x",e,t,r))];case"RFFT":return[Hf(Ik("x",e,t,r))];case"IRFFT":return[qf(Ik("x",e,t,r))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"string":return Ys((()=>((e,t,r)=>{switch(e.op){case"StringNGrams":{const{nGrams:n,nGramsSplits:a}=Nh.stringNGrams(Ik("data",e,t,r),Ik("dataSplits",e,t,r),Ik("separator",e,t,r),Ik("nGramWidths",e,t,r),Ik("leftPad",e,t,r),Ik("rightPad",e,t,r),Ik("padWidth",e,t,r),Ik("preserveShortSequences",e,t,r));return[n,a]}case"StringSplit":{const{indices:n,values:a,shape:i}=Nh.stringSplit(Ik("input",e,t,r),Ik("delimiter",e,t,r),Ik("skipEmpty",e,t,r));return[n,a,i]}case"StringToHashBucketFast":return[Nh.stringToHashBucketFast(Ik("input",e,t,r),Ik("numBuckets",e,t,r))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"transformation":return Ys((()=>((e,t,r)=>{switch(e.op){case"Cast":return[Ao(Ik("x",e,t,r),Ik("dtype",e,t,r))];case"ExpandDims":{const n=Ik("axis",e,t,r);return[eu(Ik("x",e,t,r),n)]}case"Squeeze":{const n=Ik("axis",e,t,r);return[Xf(Ik("x",e,t,r),n)]}case"Reshape":return[cc(Ik("x",e,t,r),Ik("shape",e,t,r))];case"MirrorPad":return[Gu(Ik("x",e,t,r),Ik("padding",e,t,r),Ik("mode",e,t,r))];case"PadV2":case"Pad":return[tf(Ik("x",e,t,r),Ik("padding",e,t,r),Ik("constantValue",e,t,r))];case"SpaceToBatchND":{const n=Ik("blockShape",e,t,r),a=Ik("paddings",e,t,r);return[sf(Ik("x",e,t,r),n,a)]}case"BatchToSpaceND":{const n=Ik("blockShape",e,t,r),a=Ik("crops",e,t,r);return[yc(Ik("x",e,t,r),n,a)]}case"DepthToSpace":{const n=Ik("blockSize",e,t,r),a=Ik("dataFormat",e,t,r).toUpperCase();return[$c(Ik("x",e,t,r),n,a)]}case"BroadcastTo":return[Dc(Ik("x",e,t,r),Ik("shape",e,t,r))];case"BroadcastArgs":return[kc(Ik("s0",e,t,r),Ik("s1",e,t,r))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r)));case"hash_table":return(async(e,t,r,n)=>{switch(e.op){case"HashTable":case"HashTableV2":{const a=Ik("keyDType",e,t,r),i=Ik("valueDType",e,t,r),o=new ED(a,i);return n.addHashTable(e.name,o),[o.handle]}case"LookupTableImport":case"LookupTableImportV2":{const a=Ik("tableHandle",e,t,r,n),i=Ik("keys",e,t,r),o=Ik("values",e,t,r),s=n.getHashTableById(a.id);return[await s.import(i,o)]}case"LookupTableFind":case"LookupTableFindV2":{const a=Ik("tableHandle",e,t,r,n),i=Ik("keys",e,t,r),o=Ik("defaultValue",e,t,r),s=n.getHashTableById(a.id);return[await s.find(i,o)]}case"LookupTableSize":case"LookupTableSizeV2":{const a=Ik("tableHandle",e,t,r,n);return[n.getHashTableById(a.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,r,n);case"custom":const a=Nk(e.op);if(a&&a.customExecutor)return a.customExecutor(new xD(e,t,r));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,r);return $e(a)?a.then((e=>[].concat(e))):[].concat(a)}class ND{constructor(e={},t={},r={},n={}){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=r,this.functionMap=n,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t<this.contexts.length-1;t++){const r=this.contexts.slice(0,this.contexts.length-t);e.push(this.contextIdforContexts(r))}e.push(""),this._currentContextIds=e}contextIdforContexts(e){return e?e.map((e=>0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.iterationId}`)).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}}function OD(e,t,r,n){const a=new Set,i=[];let o=null,s=null;const l=new Set,c=Object.keys(e).map((e=>Fk(e)[0]));let u=[];null!=n&&(u=n.map((e=>Fk(e.name)[0])));const f=[...t];for(;f.length>0;){const e=f.pop();(LD(e)||FD(e)||BD(e))&&null==o&&(o=e,s=o.children.map((e=>e.name)).filter((e=>a.has(e)))),a.add(e.name),null==r[e.name]&&-1===c.indexOf(e.name)&&-1===u.indexOf(e.name)&&(0!==e.inputs.length?e.inputs.forEach((e=>{l.has(e.name)||(l.add(e.name),f.push(e))})):i.push(e.name))}return{inputs:e,outputs:t,usedNodes:a,missingInputs:i,dynamicNode:o,syncInputs:s}}const ID=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],PD=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],RD=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function LD(e){return ID.indexOf(e.op)>=0}function FD(e){return PD.indexOf(e.op)>=0}function BD(e){return RD.indexOf(e.op)>=0}class zD{constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this.intermediateTensors={},this.keepTensorForDebug=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,null!=e.functions&&Object.keys(e.functions).forEach((t=>{this._functionExecutorMap[t]=new zD(e.functions[t],this)}))}get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const t=Object.keys(e).map((t=>e[t].map((e=>e.id))));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get outputs(){return this._outputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get inputNodes(){return this._inputs.map((e=>e.signatureKey||e.name))}get outputNodes(){return this._outputs.map((e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t}))}get functions(){return Object.keys(this._functions).reduce(((e,t)=>(e[t]=this._functions[t].signature,e)),{})}getCompilationKey(e,t){const r=e.map((e=>e.name)).sort(),n=t.map((e=>e.name)).sort();return r.join(this.SEPERATOR)+"--"+n.join(this.SEPERATOR)}compile(e,t){const r=OD(e,t,this.weightMap,this._initNodes),{missingInputs:n,dynamicNode:a,syncInputs:i}=r;if(null!=a)throw new Error(`This execution contains the node '${a.name}', which has the dynamic op '${a.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${i}]`);if(n.length>0){const r=t.map((e=>e.name)),a=Object.keys(e);throw new Error(`Cannot compute the outputs [${r}] from the provided inputs [${a}]. Missing the following inputs: [${n}]`)}return function(e,t,r){const{usedNodes:n,inputs:a}=r,i=[],o=Object.keys(a).map((e=>Fk(e)[0])).map((t=>e.nodes[t])),s=e.initNodes;o.forEach((e=>{n.has(e.name)&&i.push(e)})),e.weights.forEach((e=>{n.has(e.name)&&i.push(e)})),null!=s&&s.forEach((e=>{n.has(e.name)&&i.push(e)}));const l=new Set,c=[];for(;i.length>0;){const e=i.pop();l.add(e.name),t[e.name]||c.push(e),e.children.forEach((e=>{!l.has(e.name)&&n.has(e.name)&&e.inputs.every((e=>l.has(e.name)))&&i.push(e)}))}return c}(this.graph,this.weightMap,r)}execute(e,t){e=this.mapInputs(e);const r=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const n=r.map((e=>this.graph.nodes[Fk(e)[0]])),a=t.map((e=>Fk(e)[0]));let i=a.map((e=>this.graph.nodes[e]));this.resetIntermediateTensors(),0===i.length&&(i=this._outputs);const o=this.getCompilationKey(n,i);let s=this.compiledMap.get(o);null==s&&(s=this.compile(e,i),this.compiledMap.set(o,s));const l={},c={};return Ys((()=>{const r=new ND(this.weightMap,l,c,this.functionExecutorMap),n=Object.assign({},this.weightMap);Object.keys(e).forEach((t=>{const[r,a]=Fk(t),i=[];i[a]=e[t],n[r]=i}));const i=this.getFrozenTensorIds(n),o={};for(let e=0;e<s.length;e++){const t=s[e];if(!n[t.name]){const e=CD(t,n,r,this._resourceManager);if($e(e))throw new Error(`The execution of the op '${t.op}' returned a promise. Please use model.executeAsync() instead.`);n[t.name]=e,this.checkTensorForDisposal(t.name,t,n,r,i,a,o)}}return null==this.parent&&r.dispose(i),t.map((e=>Pk(e,n,r)))}))}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map((t=>e[t])).map((e=>e.map((e=>e.id)))));return new Set(t)}checkTensorForDisposal(e,t,r,n,a,i,o){"control"!==t.category&&-1===i.indexOf(e)&&(r[e].forEach((e=>{null!=e&&(o[e.id]=(o[e.id]||0)+t.children.length)})),t.inputs.forEach((e=>{if("control"!==e.category){const i=function(e,t,r){return t[Lk(e,r.currentContextId)]}(e.name,r,n);null!=i&&i.forEach((e=>{if(e&&!e.kept&&!a.has(e.id)){const r=o[e.id];if(1===r){if(this.keepTensorForDebug){const[r,a]=Rk(t.name,n);this.intermediateTensors[r]||(this.intermediateTensors[r]=[]),this.intermediateTensors[r][a]=e}else e.dispose();delete o[e.id]}else null!=r&&o[e.id]--}}))}})))}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){this.intermediateTensors&&(Object.keys(this.intermediateTensors).forEach((e=>this.intermediateTensors[e].forEach((e=>e.dispose())))),this.disposeTensorsMap())}disposeTensorsMap(){this.tensorsMap&&Object.keys(this.tensorsMap).forEach((e=>{this.tensorsMap[e].forEach((e=>{!e||e.kept||e.isDisposed||this.keepIds.has(e.id)||e.dispose()}))}))}getIntermediateTensors(){return this.tensorsMap}resetIntermediateTensors(){for(const e in this.intermediateTensors)this.intermediateTensors[e].forEach((e=>e.dispose())),delete this.intermediateTensors[e]}async _executeAsync(e,t,r=!1,n={},a={}){r||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepTensorForDebug=We().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){console.warn(e.message)}this.resetIntermediateTensors();const i=new ND(this.weightMap,n,a,this.functionExecutorMap);this.tensorsMap=await this.executeWithControlFlow(e,i,t,r);const o=t.map((e=>Pk(e,this.tensorsMap,i))),s=o.map((e=>e.id)),l=Object.keys(e).map((t=>e[t].id));return this.keepIds=new Set([...s,...l,...this.weightIds]),this.keepTensorForDebug||this.disposeTensorsMap(),null==this.parent&&i.dispose(this.keepIds),o}async executeFunctionAsync(e,t,r){const n=e.reduce(((e,t,r)=>(e[this.inputs[r].name]=t,e)),{});return this._executeAsync(n,this.outputNodes,!0,t,r)}async executeWithControlFlow(e,t,r,n){const a=Object.keys(e),i=a.map((e=>this.graph.nodes[Fk(e)[0]])),o=r.map((e=>Fk(e)[0]));let s=o.map((e=>this.graph.nodes[e]));0===s.length&&(s=this._outputs);const{usedNodes:l,missingInputs:c,dynamicNode:u,syncInputs:f}=OD(e,s,this.weightMap,this._initNodes),p=[...i,...this.graph.weights,...this._initNodes||[]].map((e=>({node:e,contexts:t.currentContext}))),h=Object.assign({},this.weightMap);Object.keys(e).forEach((t=>{const[r,n]=Fk(t),a=[];a[n]=e[t],h[r]=a}));const d={},m=this.getFrozenTensorIds(h),g={};for(;p.length>0;){const e=this.processStack(i,p,t,h,g,m,o,d,l);await Promise.all(e)}null!=u||n||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const y=s.filter((e=>!LD(e)&&!Pk(e.name,h,t))).map((e=>e.name));if(y.length>0){let e="";throw null!=u&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${f}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${a}]. Consider providing the following inputs: [${c}]. ${e}`)}return h}processStack(e,t,r,n,a,i,o,s,l){const c=[];for(;t.length>0;){const e=t.pop();r.currentContext=e.contexts;let u="";if("Enter"===e.node.op&&Ik("isConstant",e.node,n,r)&&([u]=Rk(e.node.name,r)),null==n[e.node.name]){const f=CD(e.node,n,r,this._resourceManager);u||([u]=Rk(e.node.name,r));const p=r.currentContext;$e(f)?c.push(f.then((c=>(n[u]=c,r.currentContext=p,this.checkTensorForDisposal(u,e.node,n,r,i,o,s),this.processChildNodes(e.node,t,r,n,a,l),c)))):(n[u]=f,this.checkTensorForDisposal(u,e.node,n,r,i,o,s),this.processChildNodes(e.node,t,r,n,a,l))}else this.processChildNodes(e.node,t,r,n,a,l)}return c}processChildNodes(e,t,r,n,a,i){e.children.forEach((e=>{const[o]=Rk(e.name,r);!a[o]&&i.has(e.name)&&("Merge"===e.op?e.inputNames.some((e=>!!Pk(e,n,r)))&&(a[o]=!0,t.push({contexts:r.currentContext,node:e})):e.inputNames.every((e=>!!Pk(e,n,r)))&&(a[o]=!0,t.push({contexts:r.currentContext,node:e})))}))}dispose(){Object.keys(this.weightMap).forEach((e=>this.weightMap[e].forEach((e=>e.dispose()))))}checkInputShapeAndType(e){Object.keys(e).forEach((t=>{const r=e[t],[n]=Fk(t),a=this.graph.nodes[n];if(a.attrParams.shape&&a.attrParams.shape.value){const e=a.attrParams.shape.value;ne(e.length===r.shape.length&&r.shape.every(((t,r)=>-1===e[r]||e[r]===t)),(()=>`The shape of dict['${a.name}'] provided in model.execute(dict) must be [${e}], but was [${r.shape}]`))}a.attrParams.dtype&&a.attrParams.dtype.value&&ne(r.dtype===a.attrParams.dtype.value,(()=>`The dtype of dict['${a.name}'] provided in model.execute(dict) must be ${a.attrParams.dtype.value}, but was ${r.dtype}`))}))}mapInputs(e){const t={};for(const r in e)null!=this._signature&&null!=this._signature.inputs&&null!=this._signature.inputs[r]?t[this._signature.inputs[r].name]=e[r]:t[r]=e[r];return t}checkInputs(e){const t=Object.keys(e).filter((e=>{const[t]=Fk(e);return null==this.graph.nodes[t]}));if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map((e=>null!=this._signature&&null!=this._signature.outputs&&null!=this._signature.outputs[e]?this._signature.outputs[e].name:e),{})}checkOutputs(e){e.forEach((e=>{const[t]=Fk(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)}))}}class jD{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}class UD{constructor(e,t={}){this.modelUrl=e,this.loadOptions=t,this.version="n/a",null==t&&(this.loadOptions={}),this.resourceManager=new jD}get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}findIOHandler(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=Uo(e,this.loadOptions);else{const t=Hi(e,this.loadOptions);if(0===t.length)t.push(Uo(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}async load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=await this.handler.load();return this.loadSync(e)}loadSync(e){this.artifacts=e;const t=this.artifacts.modelTopology;let r;r=null!=this.artifacts.userDefinedMetadata&&null!=this.artifacts.userDefinedMetadata.signature?this.artifacts.userDefinedMetadata.signature:this.artifacts.signature,this.signature=r,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;const n=Oi(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new zD(iD.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(n),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=iD.Instance.transformGraph(e.modelInitializer);this.initializer=new zD(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,t){if("string"==typeof e){const t=Wi(e);if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}predict(e,t){return this.execute(e,this.outputNodes)}normalizeInputs(e){if(!(e instanceof Ga||Array.isArray(e)))return e;if((e=Array.isArray(e)?e:[e]).length!==this.inputNodes.length)throw new Error(`Input tensor count mismatch,the graph model has ${this.inputNodes.length} placeholders, while there are ${e.length} input tensors.`);return this.inputNodes.reduce(((t,r,n)=>(t[r]=e[n],t)),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const r=this.executor.execute(e,t);return r.length>1?r:r[0]}async executeAsync(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const r=await this.executor.executeAsync(e,t);return r.length>1?r:r[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce(((t,r)=>(t[r]=[e[r]],t)),{})}dispose(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}}async function $D(e,t={}){if(null==e)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==t&&(t={}),t.fromTFHub&&null==e.load&&(e.endsWith("/")||(e+="/"),e=`${e}model.json?tfjs-format=file`);const r=new UD(e,t);return await r.load(),r}const VD="3.13.0";var qD,WD=r(70047);function HD(e,t,r=new Map,n=new Set){if(null==e)return null;if("function"==typeof Blob&&e instanceof Blob)return e.slice();if(n.has(e))throw new Error("Circular references are not supported.");if(r.has(e))return r.get(e);const a=t(e);if(a.recurse&&null!==a.value)throw new Error("A deep map function may not return both a value and recurse=true.");if(a.recurse){if(KD(e)){const a=Array.isArray(e)?[]:{};n.add(e);for(const i in e){const o=HD(e[i],t,r,n);a[i]=o}return n.delete(e),e.__proto__&&(a.__proto__=e.__proto__),a}throw new Error(`Can't recurse into non-iterable type: ${e}`)}return r.set(e,a.value),a.value}function GD(e,t=YD){return XD(e,t)}function XD(e,t,r=new Set){const n=e[0];if(r.has(n))throw new Error("Circular references are not supported.");const a=t(e);if(a.recurse&&null!==a.value)throw new Error("A deep zip function may not return both a value and recurse=true.");if(a.recurse){if(KD(n)){const a=Array.isArray(n)?[]:{};r.add(n);for(const i in n){const n=XD(e.map((e=>e[i])),t,r);a[i]=n}return r.delete(n),a}throw new Error(`Can't recurse into non-iterable type: ${n}`)}return a.value}function YD(e){return null===e?null:KD(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}async function ZD(e,t){const r=new Map;HD(e,t,r);for(const e of Array.from(r.keys())){const t=r.get(e);if($e(t)){const n=await t;r.set(e,n)}}return HD(e,t,r)}function KD(e){let t=!1;if(We().get("IS_BROWSER"))t=e instanceof TextDecoder;else{const{StringDecoder:n}=r(6874);t=e instanceof n}return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"==typeof e&&!(e instanceof Ga)&&!(e instanceof Promise)&&!t)}function JD(e){return e instanceof Ga?{value:e.clone(),recurse:!1}:KD(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}class QD{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,null==e)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return 0===this.length()}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(const t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);const e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const t=this.wrap(this.begin+e),r=this.get(t);return this.set(t,this.pop()),r}}class eT extends QD{constructor(){super(eT.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){const e=2*this.capacity,t=new Array(e),r=this.length();for(let e=0;e<r;e++)t[e]=this.get(this.wrap(this.begin+e));this.data=t,this.capacity=e,this.doubledCapacity=2*this.capacity,this.begin=0,this.end=r}}function tT(e){return new aT(e)}function rT(e){return new iT(e)}eT.INITIAL_CAPACITY=32;class nT{async toArray(){const e=[];let t=await this.next();for(;!t.done;)e.push(t.value),t=await this.next();return e}async toArrayForTest(){const e=this.prefetch(100),t=[];let r=await e.next();for(;!r.done;)t.push(r.value),r=await e.next();return t}async resolveFully(){let e=await this.next();for(;!e.done;)e=await this.next()}async resolveWhile(e){let t=await this.next(),r=e(t.value);for(;!t.done&&r;)t=await this.next(),r=e(t.value)}handleErrors(e){return new pT(this,e)}filter(e){return new uT(this,e)}map(e){return new fT(this,e)}mapAsync(e){return new hT(this,e)}serialMapAsync(e){return new hT(this,e).serial()}flatmap(e){return new mT(this,e)}async forEachAsync(e){return this.map(e).resolveFully()}async serialForEach(e){return this.serialMapAsync(e).resolveWhile((e=>!0===e))}rowMajorBatch(e,t=!0){return new cT(this,e,t)}columnMajorBatch(e,t=!0,r=YD){return this.rowMajorBatch(e,t).map((e=>GD(e,r)))}concatenate(e,t){return new gT(tT([this,e]),t)}take(e){return e<0||null==e?this:new lT(this,e)}skip(e){return e<0||null==e?this:new sT(this,e)}prefetch(e){return new vT(this,e)}shuffle(e,t){return new bT(this,e,t)}serial(){return new oT(this)}}class aT extends nT{constructor(e){super(),this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};const e=this.items[this.trav];return this.trav++,{value:(t=e,function(e,t){return HD(e,t)}(t,JD)),done:!1};var t}}class iT extends nT{constructor(e){super(),this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}}class oT extends nT{constructor(e){super(),this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){return this.upstream.next()}}class sT extends nT{constructor(e,t){super(),this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;this.count++<this.maxCount;){const e=await this.upstream.next();if(e.done)return e;Zs(e.value)}return this.upstream.next()}}class lT extends nT{constructor(e,t){super(),this.upstream=e,this.maxCount=t,this.count=0}summary(){return`${this.upstream.summary()} -> Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}}class cT extends nT{constructor(e,t,r=!0){super(),this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=r,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){const e=[];for(;e.length<this.batchSize;){const t=await this.upstream.next();if(t.done)return this.enableSmallLastBatch&&e.length>0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}}class uT extends nT{constructor(e,t){super(),this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;){const e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;Zs(e.value)}}}class fT extends nT{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=si(e.value),r=this.transform(e.value),n=si(r);for(const e of t)oi(e,n)||e.dispose();return{value:r,done:!1}}}class pT extends nT{constructor(e,t){super(),this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}}class hT extends nT{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=si(e.value),r=await this.transform(e.value),n=si(r);for(const e of t)oi(e,n)||e.dispose();return{value:r,done:!1}}}class dT extends nT{constructor(){super(),this.outputQueue=new eT,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;0===this.outputQueue.length();)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}}class mT extends dT{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){const e=await this.upstream.next();if(e.done)return!1;const t=si(e.value),r=this.transform(e.value),n=si(r);this.outputQueue.pushAll(r);for(const e of t)oi(e,n)||e.dispose();return!0}}class gT extends nT{constructor(e,t){super(),this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,null==this.iterator){const e=await this.moreIterators.next();if(e.done)return{value:null,done:!0};this.iterator=e.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}const t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}}!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(qD||(qD={}));class yT extends nT{constructor(e,t=qD.FAIL){super(),this.iterators=e,this.mismatchMode=t,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(e){await e;let t=0,r=0;const n=await ZD(this.iterators,(function(e){return e instanceof nT?{value:e.next().then((e=>(t++,e.done&&r++,e.value))),recurse:!1}:{value:null,recurse:!0}}));if(t===r)return{value:null,done:!0};if(r>0)switch(this.mismatchMode){case qD.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case qD.SHORTEST:return{value:null,done:!0};case qD.LONGEST:}return this.count++,{value:n,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}}class vT extends nT{constructor(e,t){super(),this.upstream=e,this.bufferSize=t,this.buffer=new QD(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){const e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}}class bT extends vT{constructor(e,t,r){super(e,t),this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=WD.alea(r||Na().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){const e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(!t.done)return this.refill(),t;this.upstreamExhausted=!0}return{value:null,done:!0}}}class xT{constructor(){this.size=null}batch(e,t=!0){const r=this;let n;return ne(e>0,(()=>`batchSize needs to be positive, but it is\n      ${e}`)),n=this.size===1/0||null==this.size?this.size:t?Math.ceil(this.size/e):Math.floor(this.size/e),_T((async()=>(await r.iterator()).columnMajorBatch(e,t,DT)),n)}concatenate(e){const t=this;let r;return r=this.size===1/0||e.size===1/0?1/0:null!=this.size&&null!=e.size?this.size+e.size:null,_T((async()=>(await t.iterator()).concatenate(await e.iterator())),r)}filter(e){const t=this;let r;return r=this.size===1/0?1/0:null,_T((async()=>(await t.iterator()).filter((t=>Ys((()=>e(t)))))),r)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return _T((async()=>(await t.iterator()).map((t=>Ys((()=>e(t)))))),this.size)}mapAsync(e){const t=this;return _T((async()=>(await t.iterator()).mapAsync(e)),this.size)}prefetch(e){if(null==e)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");const t=this;return _T((async()=>(await t.iterator()).prefetch(e)),this.size)}repeat(e){const t=this;let r;return r=null!=this.size&&e>0?this.size*e:0===e?0:null!=this.size&&(void 0===e||e<0)?1/0:null,_T((async()=>{return r=rT((async()=>({value:await t.iterator(),done:!1}))).take(e),new gT(r,n);var r,n}),r)}skip(e){const t=this;let r;return r=null!=this.size&&e>=0&&this.size>=e?this.size-e:null!=this.size&&(this.size<e||void 0===e||e<0)?0:null,_T((async()=>(await t.iterator()).skip(e)),r)}shuffle(e,t,r=!0){if(null==e||e<0)throw null==this.size?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified.  If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);const n=this,a=WD.alea(t||Na().toString());return _T((async()=>{let t=a.int32();return r&&(t+=a.int32()),(await n.iterator()).shuffle(e,t.toString())}),this.size)}take(e){const t=this;let r;return r=null!=this.size&&this.size>e?e:null!=this.size&&this.size<=e?this.size:null,_T((async()=>(await t.iterator()).take(e)),r)}async toArray(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}}function _T(e,t=null){return new class extends xT{constructor(){super(...arguments),this.size=t}async iterator(){return e()}}}function wT(e){return _T((async()=>tT(e)),e.length)}function kT(e){if(!KD(e))throw new Error("The argument to zip() must be an object or array.");let t;if(Array.isArray(e))for(let r=0;r<e.length;r++)t=null==t?e[r].size:Math.min(t,e[r].size);else if(e instanceof Object)for(const r in e)t=null==t?e[r].size:Math.min(t,e[r].size);return _T((async()=>function(e,t=qD.FAIL){return new yT(e,t)}(await ZD(e,(e=>{if(e instanceof xT)return{value:e.iterator(),recurse:!1};if(KD(e))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")})),qD.SHORTEST)),t)}function DT(e){if(null===e)return null;return null==(t=e[0])||null===(r=t)||"object"!=typeof r&&"function"!=typeof r||Array.isArray(t)||"object"==typeof t&&t instanceof Ga||De(t)?{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof Ga?Yf(e):Ei(e)}(e),recurse:!1}:{value:null,recurse:!0};var t,r}xT.MAX_BUFFER_SIZE=1e4;class TT extends xT{constructor(e){super(),this.input=e}async iterator(){return(await this.input.iterator()).decodeUTF8().split("\n").map((e=>(e.endsWith("\r")&&(e=e.slice(0,-1)),e)))}}const AT='"',ST=Symbol("out"),MT=Symbol("field"),ET=Symbol("quote"),CT=Symbol("quoteafterquote"),NT=Symbol("quoteinquote");class OT extends xT{constructor(e,t){super(),this.input=e,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new TT(e),t||(t={}),this.hasHeader=!1!==t.hasHeader,this.fullColumnNames=t.columnNames,this.columnConfigs=t.columnConfigs,this.configuredColumnsOnly=t.configuredColumnsOnly,t.delimWhitespace?(ne(null==t.delimiter,(()=>"Delimiter should not be provided when delimWhitespace is true.")),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=t.delimiter?t.delimiter:","}async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){const e=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!e)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&e&&ne(e.length===this.fullColumnNames.length,(()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+").")),this.fullColumnNames||(this.fullColumnNames=e);const t=this.fullColumnNames.reduce(((e,t)=>(e[t]=e[t]+1||1,e)),{}),r=Object.keys(t).filter((e=>t[e]>1));if(ne(0===r.length,(()=>"Duplicate column names found: "+r.toString())),this.columnConfigs)for(const e of Object.keys(this.columnConfigs))if(-1===this.fullColumnNames.indexOf(e))throw new Error('The key "'+e+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").");this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){const e=await this.base.iterator(),t=await e.next();if(t.done)throw new Error("No data was found for CSV parsing.");const r=t.value;return this.parseRow(r,!1)}return null}async iterator(){this.columnNamesValidated||await this.setColumnNames();let e=await this.base.iterator();return this.hasHeader&&(e=e.skip(1)),e.map((e=>this.makeDataElement(e)))}makeDataElement(e){const t=this.parseRow(e),r={},n={};for(let a=0;a<this.fullColumnNames.length;a++){const i=this.fullColumnNames[a],o=this.columnConfigs?this.columnConfigs[i]:null;if(!this.configuredColumnsOnly||o){const s=t[a];let l=null;if(""===s)if(o&&void 0!==o.default)l=o.default;else{if(o&&(o.required||o.isLabel))throw new Error(`Required column ${i} is empty in this line: ${e}`);l=void 0}else{const e=Number(s);if(isNaN(e))l=o&&"bool"===o.dtype?this.getBoolean(s):s;else if(o&&o.dtype)switch(o.dtype){case"float32":default:l=e;break;case"int32":l=Math.floor(e);break;case"bool":l=this.getBoolean(s)}else l=e}o&&o.isLabel?n[i]=l:r[i]=l}}return 0===Object.keys(n).length?r:{xs:r,ys:n}}getBoolean(e){return"1"===e||"true"===e.toLowerCase()?1:0}parseRow(e,t=!0){const r=[];let n=0;const a=e.length;let i=ST;for(let t=0;t<a;t++)switch(i){case ST:switch(e.charAt(t)){case AT:n=t+1,i=ET;break;case this.delimiter:if(n=t+1," "===this.delimiter&&this.delimWhitespace)break;r.push(""),i=ST;break;default:i=MT,n=t}break;case MT:e.charAt(t)===this.delimiter&&(r.push(e.substring(n,t)),i=ST,n=t+1);break;case ET:e.charAt(t)===AT&&(i=CT);break;case CT:switch(e.charAt(t)){case this.delimiter:r.push(e.substring(n,t-1)),i=ST,n=t+1;break;case AT:i=ET;break;default:i=NT}break;case NT:e.charAt(t)===AT&&(i=ET)}if(i===CT?r.push(e.substring(n,a-1)):r.push(e.substring(n)),t&&r.length!==this.fullColumnNames.length)throw new Error(`Invalid row in csv file. Should have ${this.fullColumnNames.length} elements in a row, but got ${r}`);return r}}class IT extends nT{constructor(e){super(),this.microphoneConfig=e,this.isClosed=!1,this.fftSize=e.fftSize||1024;const t=Math.log2(this.fftSize);if(this.fftSize<0||t<4||t>14||!Number.isInteger(t))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=e.numFramesPerSpectrogram||43,this.sampleRateHz=e.sampleRateHz,this.columnTruncateLength=e.columnTruncateLength||this.fftSize,this.audioTrackConstraints=e.audioTrackConstraints,this.smoothingTimeConstant=e.smoothingTimeConstant||0,this.includeSpectrogram=!1!==e.includeSpectrogram,this.includeWaveform=!0===e.includeWaveform,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(e={}){if(We().get("IS_NODE"))throw new Error("microphone API is only supported in browser environment.");const t=new IT(e);return await t.start(),t}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:null==this.audioTrackConstraints||this.audioTrackConstraints,video:!1})}catch(e){throw new Error(`Error thrown while initializing video stream: ${e.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");const e=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new e,this.sampleRateHz){if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`)}else this.sampleRateHz=this.audioContext.sampleRate;const t=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2*this.fftSize,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,t.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let e,t;const r=await this.getAudioData();if(this.includeSpectrogram){const t=this.flattenQueue(r.freqDataQueue);e=this.getTensorFromAudioDataArray(t,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){const e=this.flattenQueue(r.timeDataQueue);t=this.getTensorFromAudioDataArray(e,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:e,waveform:t},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){const e=[],t=[];let r=0;return new Promise((n=>{const a=setInterval((()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-1/0&&n({freqDataQueue:e,timeDataQueue:t}),e.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),t.push(this.timeData.slice())),++r===this.numFrames&&(clearInterval(a),n({freqDataQueue:e,timeDataQueue:t}))}),this.fftSize/this.sampleRateHz*1e3)}))}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),null!=this.stream&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(e){const t=e[0].length,r=new Float32Array(e.length*t);return e.forEach(((e,n)=>r.set(e,n*t))),r}getTensorFromAudioDataArray(e,t){const r=new Float32Array(se(t));return r.set(e,r.length-e.length),Ei(r,t)}}class PT extends nT{constructor(e,t){if(super(),this.webcamVideoElement=e,this.webcamConfig=t,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=Qf([0],"int32"),this.webcamConfig.centerCrop){const e=1*this.webcamConfig.resizeWidth/this.webcamVideoElement.width,t=1*this.webcamConfig.resizeHeight/this.webcamVideoElement.height,r=(1-e)/2,n=(1-t)/2,a=r+e,i=t+n;this.cropBox=ep([n,r,i,a],[1,4])}else this.cropBox=ep([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(e,t={}){if(We().get("IS_NODE"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!e){if(e=document.createElement("video"),!t.resizeWidth||!t.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");e.width=t.resizeWidth,e.height=t.resizeHeight}const r=new PT(e,t);return await r.start(),r}async start(){this.webcamConfig.facingMode&&ne("user"===this.webcamConfig.facingMode||"environment"===this.webcamConfig.facingMode,(()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`));try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(e){throw e.message=`Error thrown while initializing video stream: ${e.message}`,e}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(e){console.log(e),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise((e=>{this.webcamVideoElement.onloadedmetadata=()=>{e()}}))}async next(){if(this.isClosed)return{value:null,done:!0};let e;try{e=as(this.webcamVideoElement)}catch(e){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(e)}`)}if(!this.resize)return{value:e,done:!1};try{return{value:this.cropAndResizeFrame(e),done:!1}}catch(e){throw new Error(`Error thrown cropping the video: ${e.message}`)}finally{e.dispose()}}needToResize(){return!(!this.webcamConfig.resizeWidth||!this.webcamConfig.resizeHeight||this.webcamVideoElement.width===this.webcamConfig.resizeWidth&&this.webcamVideoElement.height===this.webcamConfig.resizeHeight)}cropAndResizeFrame(e){return Ys((()=>{const t=eu(Ao(e,"float32"),0);let r;r=Sh.cropAndResize(t,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");const n=r.shape;return cc(r,n.slice(1))}))}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach((e=>e.stop()));try{this.webcamVideoElement.srcObject=null}catch(e){console.log(e),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}}class RT{}class LT extends nT{split(e){return new FT(this,e)}}class FT extends LT{constructor(e,t){super(),this.upstream=e,this.impl=new BT(e,t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class BT extends dT{constructor(e,t){super(),this.upstream=e,this.separator=t,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){const e=await this.upstream.next();if(e.done)return""!==this.carryover&&(this.outputQueue.push(this.carryover),this.carryover="",!0);const t=e.value.split(this.separator);t[0]=this.carryover+t[0];for(const e of t.slice(0,-1))this.outputQueue.push(e);return this.carryover=t[t.length-1],!0}}class zT extends nT{decodeUTF8(){return new jT(this)}}class jT extends LT{constructor(e){super(),this.upstream=e,this.impl=new UT(e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class UT extends dT{constructor(e){if(super(),this.upstream=e,We().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{const{StringDecoder:e}=r(59930);this.decoder=new e("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){const e=await this.upstream.next();let t,r;return!e.done&&(t=e.value,r=We().get("IS_BROWSER")?this.decoder.decode(t,{stream:!0}):this.decoder.write(Buffer.from(t.buffer)),this.outputQueue.push(r),!0)}}class $T extends zT{constructor(e,t={}){super(),this.file=e,this.options=t,ne(e instanceof Uint8Array||!!We().get("IS_BROWSER")&&(e instanceof File||e instanceof Blob),(()=>"FileChunkIterator only supports File, Blob and Uint8Array right now.")),this.offset=t.offset||0,this.chunkSize=t.chunkSize||1048576}summary(){return`FileChunks ${this.file}`}async next(){if(this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size))return{value:null,done:!0};const e=new Promise(((e,t)=>{const r=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)e(new Uint8Array(this.file.slice(this.offset,r)));else{const n=new FileReader;n.onload=r=>{let a=n.result;if(a instanceof ArrayBuffer&&(a=new Uint8Array(a)),!(a instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(a)},n.onabort=e=>t(new Error("Aborted")),n.onerror=e=>t(new Error(e.type));const a=this.file.slice(this.offset,r);n.readAsArrayBuffer(a)}this.offset=r}));return{value:await e,done:!1}}}function VT(e){return"string"==typeof e&&"file://"===e.substr(0,7)}class qT extends RT{constructor(e,t={}){super(),this.input=e,this.options=t}async iterator(){if(VT(this.input)&&We().get("IS_NODE")){const e=r(84593);this.input=e.readFileSync(this.input.substr(7))}return new $T(this.input,this.options)}}class WT extends RT{constructor(e,t={}){super(),this.url=e,this.fileOptions=t}async iterator(){return VT(this.url)?new qT(this.url,this.fileOptions).iterator():async function(e,t={},r){let n,a;var i;"string"==typeof e?n=e:(n=e.url,a={method:(i=e).method,headers:i.headers,body:i.body,mode:i.mode,credentials:i.credentials,cache:i.cache,redirect:i.redirect,referrer:i.referrer,integrity:i.integrity});const o=await(r||Oa)(n,a);if(o.ok){const e=new Uint8Array(await o.arrayBuffer());return new $T(e,t)}throw new Error(o.statusText)}(this.url,this.fileOptions)}}function HT(e,t={}){return new OT(new WT(e),t)}function GT(e){const t=rT(e);return _T((async()=>t))}function XT(e){return _T((async()=>{const t=await e();return rT((()=>t.next()))}))}async function YT(e,t){return PT.create(e,t)}async function ZT(e){return IT.create(e)}const KT="3.13.0";function JT(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&ne("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the CPU backend.`))}))}const QT=up;class eA extends G{constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new H(this,Hs())}nextDataId(){return eA.nextDataId++}write(e,t,r){this.firstUse&&(this.firstUse=!1,We().get("IS_NODE")&&ra("\n============================\nHi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================"));const n={id:this.nextDataId()};return this.data.set(n,{values:e,dtype:r,refCount:1}),n}makeTensorInfo(e,t,r){let n;if("string"===t&&null!=r&&r.length>0&&Se(r[0])){const a=r.map((e=>Ia(e)));n=this.write(a,e,t)}else n=this.write(r,e,t);return{dataId:n,shape:e,dtype:t}}refCount(e){return this.data.has(e)?this.data.get(e).refCount:0}incRef(e){this.data.get(e).refCount++}decRef(e){this.data.has(e)&&this.data.get(e).refCount--}move(e,t,r,n,a){this.data.set(e,{values:t,dtype:n,refCount:a})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){const{dtype:t,complexTensorInfos:r}=this.data.get(e);return"complex64"===t?Qh(this.readSync(r.real.dataId),this.readSync(r.imag.dataId)):this.data.get(e).values}bufferSync(e){const t=this.readSync(e.dataId);let r=t;if("string"===e.dtype)try{r=t.map((e=>Pa(e)))}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return To(e.shape,e.dtype,r)}makeOutput(e,t,r){const n=this.write(e,t,r);return Hs().makeTensorFromDataId(n,t,r,this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;const{complexTensorInfos:r}=this.data.get(e);null!=r&&(this.disposeData(r.real.dataId,!0),this.disposeData(r.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){const t=Na();return e(),{kernelMs:Na()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){JT([e],"where");const t=this.readSync(e.dataId);return QT(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}function tA(e,t,r){return({inputs:n,attrs:a,backend:i})=>{const{x:o}=n;if(JT(o,e),"string"===o.dtype||"string"===r)throw new Error("unaryKernelFunc does not support string input/output");const s=i,l=s.data.get(o.dataId).values,c=se(o.shape),u=r||o.dtype,f=xe(u,c);for(let e=0;e<c;++e)f[e]=t(l[e],a);return s.makeTensorInfo(o.shape,u,f)}}function rA(e,t,r){return({inputs:n,attrs:a,backend:i})=>{const{x:o}=n;if(JT(o,e),"string"===o.dtype||"string"===r)throw new Error("unaryKernelFunc does not support string input/output");const s=i,l=s.data.get(o.dataId).values,c=r||o.dtype,u=t(l,c,a);return s.makeTensorInfo(o.shape,c,u)}}eA.nextDataId=0,il("cpu",(()=>new eA),1);const nA=tA(Ht,(e=>e>=0?e:Math.exp(e)-1)),aA={kernelName:Ht,backendName:"cpu",kernelFunc:nA};function iA(e){const{inputs:t,backend:r}=e,{x:n}=t;return r.incRef(n.dataId),{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}const oA={kernelName:cr,backendName:"cpu",kernelFunc:iA};function sA(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{alpha:i}=n;JT([a],"leakyRelu");const o=se(a.shape),s=r.data.get(a.dataId).values,l=be("float32",o);for(let e=0;e<s.length;e++)l[e]=s[e]<0?i*s[e]:s[e];return r.makeTensorInfo(a.shape,"float32",l)}const lA={kernelName:mr,backendName:"cpu",kernelFunc:sA};function cA(e){return(t,r,n,a,i)=>{const o=Jo(t,r),s=o.length,l=Ie(o),c=be(i,se(o)),u=t.length,f=r.length,p=Ie(t),h=Ie(r),d=Zo(t,o),m=Zo(r,o);if(d.length+m.length===0)for(let t=0;t<c.length;++t)c[t]=e(n[t%n.length],a[t%a.length]);else for(let t=0;t<c.length;++t){const r=Ue(t,s,l),i=r.slice(-u);d.forEach((e=>i[e]=0));const o=je(i,u,p),g=r.slice(-f);m.forEach((e=>g[e]=0));const y=je(g,f,h);c[t]=e(n[o],a[y])}return[c,o]}}const uA=cA(((e,t)=>e<0?t*e:e));function fA(e){const{inputs:t,backend:r}=e,{x:n,alpha:a}=t;JT([n,a],"prelu");const i=r.data.get(n.dataId).values,o=r.data.get(a.dataId).values,[s,l]=uA(n.shape,a.shape,i,o,"float32");return r.makeTensorInfo(l,"float32",s)}const pA={kernelName:Jr,backendName:"cpu",kernelFunc:fA},hA=tA(nn,(e=>Math.max(0,e))),dA={kernelName:nn,backendName:"cpu",kernelFunc:hA},mA=tA(un,(e=>Math.min(Math.max(0,e),6))),gA={kernelName:un,backendName:"cpu",kernelFunc:mA};function yA(e){return(t,r,n)=>{const a=be(r,t.length);for(let r=0;r<t.length;++r)a[r]=e(t[r],n);return a}}const vA=yA((e=>1/(1+Math.exp(-e)))),bA=tA(_n,(e=>1/(1+Math.exp(-e)))),xA={kernelName:_n,backendName:"cpu",kernelFunc:bA};function _A(e,t,r,n,a){if("linear"===r)return iA({inputs:{x:t},backend:e});if("relu"===r)return hA({inputs:{x:t},backend:e});if("elu"===r)return nA({inputs:{x:t},backend:e});if("relu6"===r)return mA({inputs:{x:t},backend:e});if("prelu"===r)return fA({inputs:{x:t,alpha:n},backend:e});if("leakyrelu"===r)return sA({inputs:{x:t},backend:e,attrs:{alpha:a}});if("sigmoid"===r)return bA({inputs:{x:t},backend:e});throw new Error(`Activation ${r} has not been implemented for the CPU backend.`)}function wA(e){const{inputs:t,backend:r}=e,{real:n,imag:a}=t,i=r.data.get(n.dataId).values,o=r.data.get(a.dataId).values,s=r.makeTensorInfo(n.shape,"complex64");return r.data.get(s.dataId).complexTensorInfos={real:r.makeTensorInfo(n.shape,"float32",i),imag:r.makeTensorInfo(a.shape,"float32",o)},s}const kA={kernelName:wt,backendName:"cpu",kernelFunc:wA};function DA(e,t,r="float32"){if("complex64"===r)return wA({inputs:{real:DA(e,t,"float32"),imag:DA(e,t,"float32")},backend:e});const n=Fe(se(t),r);return e.makeTensorInfo(t,r,n)}function TA(e){const{inputs:t,backend:r}=e,{input:n}=t,a=r.data.get(n.dataId).complexTensorInfos.real,i=r.data.get(a.dataId).values;return r.makeTensorInfo(a.shape,a.dtype,i)}const AA={kernelName:tn,backendName:"cpu",kernelFunc:TA};function SA(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{dtype:i}=n;if("complex64"===i){if("complex64"===a.dtype)return iA({inputs:{x:a},backend:r});const e=DA(r,a.shape,a.dtype),t=SA({inputs:{x:a},backend:r,attrs:{dtype:"float32"}}),n=wA({inputs:{real:t,imag:e},backend:r});return r.disposeIntermediateTensorInfo(e),r.disposeIntermediateTensorInfo(t),n}if("complex64"===a.dtype){const e=TA({inputs:{input:a},backend:r}),t=SA({inputs:{x:e},backend:r,attrs:{dtype:i}});return r.disposeIntermediateTensorInfo(e),t}if(!ke(a.dtype,i)){const e=iA({inputs:{x:a},backend:r});return{dataId:e.dataId,shape:e.shape,dtype:i}}if("int32"===i){const e=r.data.get(a.dataId).values,t=Int32Array.from(e);return r.makeTensorInfo(a.shape,"int32",t)}if("bool"===i){const e=r.data.get(a.dataId).values,t=Ca([0],a.dtype),[n,i]=cA(((e,t)=>e!==t?1:0))(a.shape,[],e,t,"bool");return r.makeTensorInfo(i,"bool",n)}throw new Error(`Error in Cast: failed to cast ${a.dtype} to ${i}`)}const MA={kernelName:bt,backendName:"cpu",kernelFunc:SA};function EA(e,t,r,n){return null==r?({inputs:r,backend:a})=>{const{a:i,b:o}=r,s=a;JT([i,o],e);const l=s.data.get(i.dataId).values,c=s.data.get(o.dataId).values,u="string"===i.dtype?Cd(l):l,f="string"===i.dtype?Cd(c):c,p=n||i.dtype,[h,d]=t(i.shape,o.shape,u,f,p);return s.makeTensorInfo(d,p,h)}:({inputs:e,backend:a})=>{const{a:i,b:o}=e,s=a;if("complex64"===i.dtype||"complex64"===o.dtype){const e=SA({inputs:{x:i},backend:s,attrs:{dtype:"complex64"}}),t=s.data.get(e.dataId),n=t.complexTensorInfos.real,a=t.complexTensorInfos.imag,l=s.data.get(n.dataId).values,c=s.data.get(a.dataId).values,u=SA({inputs:{x:o},backend:s,attrs:{dtype:"complex64"}}),f=s.data.get(u.dataId),p=f.complexTensorInfos.real,h=f.complexTensorInfos.imag,d=s.data.get(p.dataId).values,m=s.data.get(h.dataId).values,[g,y,v]=r(i.shape,o.shape,l,c,d,m),b=s.makeTensorInfo(v,"float32",g),x=s.makeTensorInfo(v,"float32",y),_=wA({inputs:{real:b,imag:x},backend:s});return s.disposeIntermediateTensorInfo(e),s.disposeIntermediateTensorInfo(u),s.disposeIntermediateTensorInfo(b),s.disposeIntermediateTensorInfo(x),_}{const e=s.data.get(i.dataId).values,r=s.data.get(o.dataId).values,a=n||i.dtype,[l,c]=t(i.shape,o.shape,e,r,a);return s.makeTensorInfo(c,a,l)}}}function CA(e){return(t,r,n,a,i,o)=>{const s=Jo(t,r),l=se(s),c=s.length,u=Ie(s),f=be("float32",l),p=be("float32",l),h=Zo(t,s),d=Zo(r,s),m=Qh(n,a),g=Qh(i,o),y=t.length,v=Ie(t),b=r.length,x=Ie(r);if(h.length+d.length===0)for(let t=0;t<f.length;t++){const r=t%m.length,n=t%g.length,a=e(m[2*r],m[2*r+1],g[2*n],g[2*n+1]);f[t]=a.real,p[t]=a.imag}else for(let t=0;t<f.length;t++){const r=Ue(t,c,u),n=r.slice(-y);h.forEach((e=>n[e]=0));const a=je(n,y,v),i=r.slice(-b);d.forEach((e=>i[e]=0));const o=je(i,b,x),s=e(m[2*a],m[2*a+1],g[2*o],g[2*o+1]);f[t]=s.real,p[t]=s.imag}return[f,p,s]}}const NA=cA(((e,t)=>e+t)),OA=CA(((e,t,r,n)=>({real:e+r,imag:t+n}))),IA=EA(Qe,NA,OA),PA={kernelName:Qe,backendName:"cpu",kernelFunc:IA};function RA(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{shape:i}=n,o=se(a.shape),s=ge(i,o),l=se(s);ne(o===l,(()=>`The new shape (${s}) has ${l} elements and the old shape (${a.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`)),r.incRef(a.dataId);const c=r.data.get(a.dataId);if(null!=c.complexTensorInfos){const e=c.complexTensorInfos.real,t=c.complexTensorInfos.imag;e.shape=s,t.shape=s}return{dataId:a.dataId,shape:s,dtype:a.dtype}}const LA={kernelName:an,backendName:"cpu",kernelFunc:RA};function FA(e){const{inputs:t,backend:r,attrs:n}=e,{a,b:i}=t,{transposeA:o,transposeB:s}=n;JT([a,i],"matMul");const l=a.shape.length,c=i.shape.length,u=o?a.shape[l-2]:a.shape[l-1],f=s?i.shape[c-1]:i.shape[c-2],p=o?a.shape[l-1]:a.shape[l-2],h=s?i.shape[c-2]:i.shape[c-1],d=a.shape.slice(0,-2),m=i.shape.slice(0,-2),g=se(d),y=se(m),v=Jo(a.shape.slice(0,-2),i.shape.slice(0,-2)).concat([p,h]);ne(u===f,(()=>`Error in matMul: inner shapes (${u}) and (${f}) of Tensors with shapes ${a.shape} and ${i.shape} and transposeA=${o} and transposeB=${s} must match.`));const b=s?[y,h,f]:[y,f,h],x=RA({inputs:{x:a},backend:r,attrs:{shape:o?[g,u,p]:[g,p,u]}}),_=RA({inputs:{x:i},backend:r,attrs:{shape:b}}),w=o?x.shape[1]:x.shape[2],k=o?x.shape[2]:x.shape[1],D=s?_.shape[1]:_.shape[2],T=Math.max(g,y),A=r.data.get(x.dataId).values,S=r.data.get(_.dataId).values,M=Ie(x.shape),E=Ie(_.shape),[C,N,O]=o?[M[0],1,M[1]]:[M[0],M[1],1],[I,P,R]=s?[1,E[1],E[0]]:[E[1],1,E[0]],L=k*D,F=To([T,k,D],x.dtype),B=F.values,z=r.blockSize;for(let e=0;e<T;e++)for(let t=0;t<k;t+=z)for(let r=0;r<D;r+=z)for(let n=0;n<w;n+=z){const a=Math.min(t+z,k),i=Math.min(r+z,D),o=Math.min(n+z,w);for(let s=t;s<a;s++)for(let t=r;t<i;t++){let r=0;for(let a=n;a<o;a++){const n=Math.min(e,g-1)*C,i=Math.min(e,y-1)*R;r+=A[n+s*N+a*O]*S[a*I+t*P+i]}B[e*L+(s*D+t)]+=r}}return r.disposeIntermediateTensorInfo(x),r.disposeIntermediateTensorInfo(_),r.makeTensorInfo(v,F.dtype,F.values)}const BA={kernelName:dt,backendName:"cpu",kernelFunc:FA},zA={kernelName:Qn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{a,b:i,bias:o,preluActivationWeights:s}=t,{transposeA:l,transposeB:c,activation:u,leakyreluAlpha:f}=n;let p,h,d;const m=[];p=FA({inputs:{a,b:i},attrs:{transposeA:l,transposeB:c},backend:r}),o&&(h=IA({inputs:{a:p,b:o},backend:r}),m.push(p),p=h),u&&(d=_A(r,p,u,s,f),m.push(p),p=d);for(const e of m)r.disposeIntermediateTensorInfo(e);return p}};function jA(e){const t=new Float32Array(e.length);for(let r=0;r<e.length;++r)t[r]=Math.abs(e[r]);return t}const UA={kernelName:Ze,backendName:"cpu",kernelFunc:e=>{const{x:t}=e.inputs,r=e.backend;JT(t,"abs");let n=new Float32Array(se(t.shape));return n=jA(r.data.get(t.dataId).values),r.makeOutput(n,t.shape,t.dtype)}},$A=tA(Ke,(e=>Math.acos(e))),VA={kernelName:Ke,backendName:"cpu",kernelFunc:$A},qA=tA(Je,(e=>Math.acosh(e))),WA={kernelName:Je,backendName:"cpu",kernelFunc:qA},HA={kernelName:et,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,n=t;JT(t,"addN");const a=n.map((e=>r.data.get(e.dataId).values)),i=To(n[0].shape,n[0].dtype),o=i.values;for(let e=0;e<n.length;e++){const t=a[e];for(let e=0;e<o.length;e++)o[e]+=t[e]}return r.makeTensorInfo(i.shape,i.dtype,i.values)}};function GA(e,t,r,n,a){const i=t.length,o=se(t),s=Ie(t),l=Ie(a),c=be(r,se(a));for(let t=0;t<o;++t){const r=Ue(t,i,s),a=new Array(r.length);for(let e=0;e<a.length;e++)a[e]=r[n[e]];c[je(a,i,l)]=e[t]}return c}function XA(e){const{inputs:t,attrs:r,backend:n}=e,{x:a}=t,{perm:i}=r;JT(a,"transpose");const o=a.shape.length,s=new Array(o);for(let e=0;e<s.length;e++)s[e]=a.shape[i[e]];const l=GA(n.data.get(a.dataId).values,a.shape,a.dtype,i,s);return{dataId:n.write(l,s,a.dtype),shape:s,dtype:a.dtype}}const YA={kernelName:Wn,backendName:"cpu",kernelFunc:XA},ZA={kernelName:tt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,keepDims:o}=n;JT(a,"all");const s=ye(i,a.shape);let l=s;const c=Cu(l,a.shape.length);let u=a;null!=c&&(u=XA({inputs:{x:a},backend:r,attrs:{perm:c}}),l=Ou(l.length,a.shape.length)),Eu("all",l,u.shape.length);const[f,p]=Su(u.shape,l),h=se(p),d=Fe(se(f),u.dtype),m=r.data.get(u.dataId).values;for(let e=0;e<d.length;++e){const t=e*h;let r=m[t];for(let e=0;e<h;++e){const n=m[t+e];r=r&&n}d[e]=r}null!=c&&r.disposeIntermediateTensorInfo(u);const g=r.makeTensorInfo(f,u.dtype,d);if(o){const e=RA({inputs:{x:g},backend:r,attrs:{shape:Mu(f,s)}});return r.disposeIntermediateTensorInfo(g),e}return g}},KA={kernelName:rt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,keepDims:o}=n;JT(a,"any");const s=ye(i,a.shape);let l=s;const c=Cu(l,a.shape.length);let u=a;null!=c&&(u=XA({inputs:{x:a},backend:r,attrs:{perm:c}}),l=Ou(l.length,a.shape.length)),Eu("any",l,u.shape.length);const[f,p]=Su(u.shape,l),h=se(p),d=Fe(se(f),u.dtype),m=r.data.get(u.dataId).values;for(let e=0;e<d.length;++e){const t=e*h;let r=m[t];for(let e=0;e<h;++e){const n=m[t+e];r=r||n}d[e]=r}null!=c&&r.disposeIntermediateTensorInfo(u);const g=r.makeTensorInfo(f,u.dtype,d);if(o){const e=RA({inputs:{x:g},backend:r,attrs:{shape:Mu(f,s)}});return r.disposeIntermediateTensorInfo(g),e}return g}},JA={kernelName:nt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i}=n;JT(a,"argMax");let o=ye(i,a.shape);const s=Cu(o,a.shape.length);let l=a;const c=[];null!=s&&(l=XA({inputs:{x:a},backend:r,attrs:{perm:s}}),c.push(l),o=Ou(o.length,l.shape.length)),o=[o[0]],Eu("argMax",o,l.shape.length);const[u,f]=Su(l.shape,o),p=Fe(se(u),"int32"),h=se(f),d=r.data.get(l.dataId).values;for(let e=0;e<p.length;++e){const t=e*h;let r=d[t],n=0;for(let e=0;e<h;++e){const a=d[t+e];a>r&&(r=a,n=e)}p[e]=n}return c.forEach((e=>r.disposeIntermediateTensorInfo(e))),r.makeTensorInfo(u,"int32",p)}},QA={kernelName:at,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i}=n;JT(a,"argMin");let o=ye(i,a.shape);const s=Cu(o,a.shape.length);let l=a;const c=[];null!=s&&(l=XA({inputs:{x:a},backend:r,attrs:{perm:s}}),c.push(l),o=Ou(o.length,l.shape.length)),o=[o[0]],Eu("argMin",o,l.shape.length);const[u,f]=Su(l.shape,o),p=Fe(se(u),"int32"),h=se(f),d=r.data.get(l.dataId).values;for(let e=0;e<p.length;++e){const t=e*h;let r=d[t],n=0;for(let e=0;e<h;++e){const a=d[t+e];a<r&&(r=a,n=e)}p[e]=n}return c.forEach((e=>r.disposeIntermediateTensorInfo(e))),r.makeTensorInfo(u,"int32",p)}},eS=tA(it,(e=>Math.asin(e))),tS={kernelName:it,backendName:"cpu",kernelFunc:eS},rS=tA(ot,(e=>Math.asinh(e))),nS={kernelName:ot,backendName:"cpu",kernelFunc:rS},aS=tA(st,(e=>Math.atan(e))),iS={kernelName:st,backendName:"cpu",kernelFunc:aS},oS=cA(((e,t)=>Math.atan2(e,t))),sS=EA(ct,oS),lS={kernelName:ct,backendName:"cpu",kernelFunc:sS},cS=tA(lt,(e=>Math.atanh(e))),uS={kernelName:lt,backendName:"cpu",kernelFunc:cS};function fS(e,t,r,n,a,i){const o=a.strideHeight,s=a.strideWidth,l=a.dilationHeight,c=a.dilationWidth,u=a.effectiveFilterHeight,f=a.effectiveFilterWidth,p=a.padInfo.top,h=a.padInfo.left,d="max"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=To(a.outShape,r),g=m.values,y=a.outShape[1]*a.outShape[2]*a.outShape[3],v=a.outShape[2]*a.outShape[3],b=a.outShape[3];for(let t=0;t<a.batchSize;++t){const r=t*y,m=t*n[0];for(let t=0;t<a.inChannels;++t)for(let y=0;y<a.outHeight;++y){const x=y*o-p,_=Math.max(0,x),w=Math.min(a.inHeight,u+x),k=r+y*v;for(let r=0;r<a.outWidth;++r){const o=r*s-h,u=Math.max(0,o),p=Math.min(a.inWidth,f+o);let y=d,v=0,x=0;for(let r=_;r<w;r+=l){const a=m+r*n[1];for(let r=u;r<p;r+=c){const o=e[a+r*n[2]+t];"max"===i&&o>y?y=o:"avg"===i&&(v+=o,x++)}if(isNaN(y))break}g[k+r*b+t]="avg"===i?v/x:y}}}return m}function pS(e,t,r,n,a=!1,i=!1){const o=To(n.outShape,"int32"),s=n.strideHeight,l=n.strideWidth,c=n.dilationHeight,u=n.dilationWidth,f=n.effectiveFilterHeight,p=n.effectiveFilterWidth,h=n.padInfo.top,d=n.padInfo.left,m=To(t,r,e);for(let e=0;e<n.batchSize;++e)for(let t=0;t<n.inChannels;++t)for(let r=0;r<n.outHeight;++r){const g=r*s-h;let y=g;for(;y<0;)y+=c;const v=Math.min(n.inHeight,f+g);for(let s=0;s<n.outWidth;++s){const f=s*l-d;let h=f;for(;h<0;)h+=u;const b=Math.min(n.inWidth,p+f);let x=Number.NEGATIVE_INFINITY,_=-1;for(let r=y;r<v;r+=c){const o=r-g;for(let s=h;s<b;s+=u){const l=s-f,c=m.get(e,r,s,t);c>x&&(x=c,_=a?i?((e*n.inHeight+r)*n.inWidth+s)*n.inChannels+t:(r*n.inWidth+s)*n.inChannels+t:o*p+l)}}o.set(_,e,r,s,t)}}return o}function hS(e,t,r,n,a,i){const o=a.strideDepth,s=a.strideHeight,l=a.strideWidth,c=a.dilationDepth,u=a.dilationHeight,f=a.dilationWidth,p=a.effectiveFilterDepth,h=a.effectiveFilterHeight,d=a.effectiveFilterWidth,m=a.padInfo.front,g=a.padInfo.top,y=a.padInfo.left,v="max"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,b=To(a.outShape,r),x=b.values,_=a.outShape[1]*a.outShape[2]*a.outShape[3]*a.outShape[4],w=a.outShape[2]*a.outShape[3]*a.outShape[4],k=a.outShape[3]*a.outShape[4],D=a.outShape[4];for(let t=0;t<a.batchSize;++t){const r=t*_,b=t*n[0];for(let t=0;t<a.inChannels;++t)for(let _=0;_<a.outDepth;++_){const T=_*o-m;let A=T;for(;A<0;)A+=c;const S=Math.min(a.inDepth,p+T),M=r+_*w;for(let r=0;r<a.outHeight;++r){const o=r*s-g;let p=o;for(;p<0;)p+=u;const m=Math.min(a.inHeight,h+o),_=M+r*k;for(let r=0;r<a.outWidth;++r){const o=r*l-y;let s=o;for(;s<0;)s+=f;const h=Math.min(a.inWidth,d+o),g=_+r*D;let w=v,k=0,T=0;for(let r=A;r<S;r+=c){const a=b+r*n[1];for(let r=p;r<m;r+=u){const o=a+r*n[2];for(let r=s;r<h;r+=f){const a=e[o+r*n[3]+t];if("max"===i&&a>w?w=a:"avg"===i&&(k+=a,T++),isNaN(w))break}if(isNaN(w))break}if(isNaN(w))break}x[g+t]="avg"===i?k/T:w}}}}return b}const dS={kernelName:ut,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t;JT(a,"avgPool");const{filterSize:i,strides:o,pad:s,dimRoundingMode:l}=n;ne(oc(o,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`));const c=Zl(a.shape,i,o,1,s,l);let u;if(1===c.filterWidth&&1===c.filterHeight&&ce(c.inShape,c.outShape))u=iA({inputs:{x:a},backend:r});else{const e=r.data.get(a.dataId).values,t=Ie(a.shape),n=fS(e,a.shape,a.dtype,t,c,"avg");u=r.makeTensorInfo(c.outShape,a.dtype,n.values)}return u}},mS={kernelName:pt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{filterSize:i,strides:o,pad:s,dimRoundingMode:l,dataFormat:c}=n;JT(a,"avgPool3d");const u=Kl(a.shape,i,o,1,s,l,c),f=hS(r.data.get(a.dataId).values,a.shape,a.dtype,Ie(a.shape),u,"avg");return r.makeTensorInfo(f.shape,"float32",f.values)}},gS={kernelName:ht,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,input:i}=t,{filterSize:o,strides:s,pad:l,dimRoundingMode:c}=n;JT([a,i],"avgPool3DGrad");const u=Kl(i.shape,o,s,1,l,c),f=u.strideDepth,p=u.strideHeight,h=u.strideWidth,d=u.filterDepth,m=u.filterHeight,g=u.filterWidth,y=u.dilationDepth,v=u.dilationHeight,b=u.dilationWidth,x=u.effectiveFilterDepth,_=u.effectiveFilterHeight,w=u.effectiveFilterWidth,k=x-1-u.padInfo.front,D=w-1-u.padInfo.left,T=_-1-u.padInfo.top,A=To(i.shape,"float32"),S=1/(d*m*g),M=r.bufferSync(a);for(let e=0;e<u.batchSize;++e)for(let t=0;t<u.inChannels;++t)for(let r=0;r<u.inDepth;++r)for(let n=0;n<u.inHeight;++n)for(let a=0;a<u.inWidth;++a){const i=r-k,o=n-T,s=a-D;let l=0;for(let r=0;r<x;r+=y){const n=(i+r)/f;if(!(n<0||n>=u.outDepth||Math.floor(n)!==n))for(let r=0;r<_;r+=v){const a=(o+r)/p;if(!(a<0||a>=u.outHeight||Math.floor(a)!==a))for(let r=0;r<w;r+=b){const i=(s+r)/h;i<0||i>=u.outWidth||Math.floor(i)!==i||(l+=M.get(e,n,a,i,t))}}}A.set(l*S,e,r,n,a,t)}return r.makeTensorInfo(A.shape,A.dtype,A.values)}},yS={kernelName:ft,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,input:i}=t,o=i;JT([a,i],"avgPoolGrad");const{filterSize:s,strides:l,pad:c}=n,u=Zl(o.shape,s,l,1,c),f=u.strideHeight,p=u.strideWidth,h=u.filterHeight,d=u.filterWidth,m=u.dilationHeight,g=u.dilationWidth,y=u.effectiveFilterHeight,v=u.effectiveFilterWidth,b=v-1-u.padInfo.left,x=y-1-u.padInfo.top,_=To(o.shape,"float32"),w=1/(h*d),k=r.data.get(a.dataId).values,D=To(a.shape,"float32",k);for(let e=0;e<u.batchSize;++e)for(let t=0;t<u.inChannels;++t)for(let r=0;r<u.inHeight;++r)for(let n=0;n<u.inWidth;++n){const a=r-x,i=n-b;let o=0;for(let r=0;r<y;r+=m){const n=(a+r)/f;if(!(n<0||n>=u.outHeight||Math.floor(n)!==n))for(let r=0;r<v;r+=g){const a=(i+r)/p;a<0||a>=u.outWidth||Math.floor(a)!==a||(o+=D.get(e,n,a,t))}}_.set(o*w,e,r,n,t)}return r.makeTensorInfo(_.shape,_.dtype,_.values)}},vS={kernelName:ar,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,scale:i,offset:o,mean:s,variance:l}=t;ne(s.shape.length===l.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),ne(null==o||s.shape.length===o.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),ne(null==i||s.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks.")),JT([a,s,l,i,o],"batchNorm");let{varianceEpsilon:c}=n;null==c&&(c=.001);const u=r.data.get(a.dataId).values,f=r.data.get(s.dataId).values,p=r.data.get(l.dataId).values,h=i?r.data.get(i.dataId).values:new Float32Array([1]),d=o?r.data.get(o.dataId).values:new Float32Array([0]),m=new Float32Array(u.length),g=d.length,y=h.length,v=p.length,b=f.length;let x=0,_=0,w=0,k=0;for(let e=0;e<u.length;++e)m[e]=d[x++]+(u[e]-f[_++])*h[w++]/Math.sqrt(p[k++]+c),x>=g&&(x=0),_>=b&&(_=0),w>=y&&(w=0),k>=v&&(k=0);return r.makeTensorInfo(a.shape,a.dtype,m)}};function bS(e,t,r,n,a){const i=_s(n,t,r),o=se(r),s=Ie(n);if(i){const r=ws(t,s);return"string"===a?e.slice(r,r+o):e.subarray(r,r+o)}const l=To(n,a,"string"===a?Cd(e):e),c=To(r,a);for(let e=0;e<c.size;++e){const r=c.indexToLoc(e),n=r.map(((e,r)=>e+t[r]));c.set(l.get(...n),...r)}return"string"===a?Nd(c.values):c.values}function xS(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{begin:i,size:o}=n;JT(a,"slice");const[s,l]=ks(a,i,o);cs(a,s,l);const c=bS(r.data.get(a.dataId).values,s,l,a.shape,a.dtype);return r.makeTensorInfo(l,a.dtype,c)}const _S={kernelName:yn,backendName:"cpu",kernelFunc:xS},wS={kernelName:mt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{blockShape:i,crops:o}=n;JT([a],"batchToSpaceND");const s=i.reduce(((e,t)=>e*t)),l=jh(a.shape,i,s),c=Uh(l.length,i.length),u=$h(a.shape,i,s),f=Vh(o,i.length),p=qh(u,o,i.length),h=RA({inputs:{x:a},backend:r,attrs:{shape:l}}),d=XA({inputs:{x:h},backend:r,attrs:{perm:c}}),m=RA({inputs:{x:d},backend:r,attrs:{shape:u}}),g=xS({inputs:{x:m},backend:r,attrs:{begin:f,size:p}});return r.disposeIntermediateTensorInfo(h),r.disposeIntermediateTensorInfo(d),r.disposeIntermediateTensorInfo(m),g}};function kS(e,t,r,n,a){const i=se(n),o=Fe(a,r);for(let r=0;r<e.length;r++){const n=e[r];if(n<0)throw new Error("Input x must be non-negative!");n>=a||(o[n]+=i>0?t[r]:1)}return o}function DS(e,t,r,n=!1){const a=e.shape[0],i=e.shape[1],o=To([a,r],t.dtype);for(let s=0;s<a;s++)for(let a=0;a<i;a++){const i=e.get(s,a);if(i<0)throw new Error("Input x must be non-negative!");i>=r||(n?o.set(1,s,i):t.size>0?o.set(o.get(s,i)+t.get(s,a),s,i):o.set(o.get(s,i)+1,s,i))}return o}const TS={kernelName:gt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,weights:i}=t,{size:o}=n,s=kS(r.data.get(a.dataId).values,r.data.get(i.dataId).values,i.dtype,i.shape,o);return r.makeTensorInfo([o],i.dtype,s)}},AS={kernelName:vt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{s0:n,s1:a}=t,i=r.data.get(n.dataId).values,o=r.data.get(a.dataId).values,s=Jo(Array.from(i),Array.from(o));return r.makeTensorInfo([s.length],"int32",Int32Array.from(s))}},SS=yA((e=>Math.ceil(e))),MS=rA(xt,SS),ES={kernelName:xt,backendName:"cpu",kernelFunc:MS},CS=tA(_t,((e,t)=>{const r=t;return e>r.clipValueMax?r.clipValueMax:e<r.clipValueMin?r.clipValueMin:e})),NS={kernelName:_t,backendName:"cpu",kernelFunc:CS},OS={kernelName:kt,backendName:"cpu",kernelFunc:e=>{const{x:t}=e.inputs,r=e.backend,n=new Float32Array(se(t.shape)),a=r.data.get(t.dataId),i=a.complexTensorInfos.real,o=a.complexTensorInfos.imag,s=r.data.get(i.dataId).values,l=r.data.get(o.dataId).values;for(let e=0;e<s.length;e++){const t=s[e],r=l[e];n[e]=Math.hypot(t,r)}return r.makeOutput(n,t.shape,"float32")}};function IS(e,t,r,n){const a=xe(r,se(t));if(n&&"string"!==r){let t=0;e.forEach((e=>{const r=se(e.shape);a.set(e.vals,t),t+=r}))}else{let n=0;e.forEach((e=>{const i="string"===r?Cd(e.vals):e.vals;let o=0;for(let r=0;r<e.shape[0];++r){const s=r*t[1]+n;for(let t=0;t<e.shape[1];++t)a[s+t]=i[o++]}n+=e.shape[1]}))}return a}function PS(e){const{inputs:t,backend:r}=e,{input:n}=t,a=r.data.get(n.dataId).complexTensorInfos.imag,i=r.data.get(a.dataId).values;return r.makeTensorInfo(a.shape,a.dtype,i)}const RS={kernelName:fr,backendName:"cpu",kernelFunc:PS};function LS(e){const{inputs:t,backend:r,attrs:n}=e,{axis:a}=n,i=ye(a,t[0].shape)[0];let o=Lh(t.map((e=>e.shape)),i);if(0===se(o))return r.makeTensorInfo(o,t[0].dtype,[]);const s=t.filter((e=>se(e.shape)>0));if(1===s.length)return iA({inputs:{x:s[0]},backend:r});if(Rh(s.map((e=>e.shape)),i),"complex64"===s[0].dtype){const e=s.map((e=>TA({inputs:{input:e},backend:r}))),t=s.map((e=>PS({inputs:{input:e},backend:r}))),n=LS({inputs:e,backend:r,attrs:{axis:i}}),a=LS({inputs:t,backend:r,attrs:{axis:i}}),o=wA({inputs:{real:n,imag:a},backend:r});return e.forEach((e=>r.disposeIntermediateTensorInfo(e))),t.forEach((e=>r.disposeIntermediateTensorInfo(e))),r.disposeIntermediateTensorInfo(n),r.disposeIntermediateTensorInfo(a),o}const l=s.map((e=>{const t=se(e.shape.slice(i));return RA({inputs:{x:e},backend:r,attrs:{shape:[-1,t]}})})),c=l.map((e=>({vals:r.data.get(e.dataId).values,shape:e.shape})));o=Lh(l.map((e=>e.shape)),1);const u=1===l[0].shape[0],f=IS(c,o,t[0].dtype,u),p=Lh(s.map((e=>e.shape)),i),h=r.makeTensorInfo(p,t[0].dtype,f);return l.forEach((e=>r.disposeIntermediateTensorInfo(e))),h}const FS={kernelName:Dt,backendName:"cpu",kernelFunc:LS};function BS(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,filter:i}=t,{strides:o,pad:s,dataFormat:l,dilations:c,dimRoundingMode:u}=n;JT([a,i],"conv2d");const f=sc(l),p=Jl(a.shape,i.shape,o,c,s,u,!1,f),h=p.filterHeight,d=p.filterWidth,m=p.dilationHeight,g=p.dilationWidth,y=p.padInfo.left,v=p.padInfo.top,b="channelsLast"===p.dataFormat,x=new Va(p.outShape,a.dtype),_=Ie(a.shape),w=Ie(i.shape),k=_[0],D=b?_[1]:_[2],T=b?_[2]:1,A=b?1:_[1],S=x.strides[0],M=b?x.strides[1]:x.strides[2],E=b?x.strides[2]:1,C=b?1:x.strides[1],N=r.data.get(a.dataId).values,O=r.data.get(i.dataId).values,I=x.values;for(let e=0;e<p.batchSize;++e){const t=e*k,r=e*S;for(let e=0;e<p.outHeight;++e){const n=r+e*M,a=e*p.strideHeight-v;for(let e=0;e<h;++e){const r=a+e*m;if(r<0||r>=p.inHeight)continue;const i=e*w[0],o=t+r*D;for(let e=0;e<p.outWidth;++e){const t=n+e*E,r=e*p.strideWidth-y;for(let e=0;e<d;++e){const n=r+e*g;if(n<0||n>=p.inWidth)continue;const a=o+n*T;let s=i+e*w[1];for(let e=0;e<p.inChannels;++e){const r=N[a+e*A];for(let e=0;e<p.outChannels;++e)I[t+e*C]+=r*O[s+e];s+=p.outChannels}}}}}}return r.makeTensorInfo(x.shape,x.dtype,I)}const zS={kernelName:Tt,backendName:"cpu",kernelFunc:BS},jS={kernelName:At,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,dy:i}=t,{strides:o,pad:s,dataFormat:l,dimRoundingMode:c,filterShape:u}=n;JT([a,i],"conv2dBackpropFilter");const f=sc(l),p=Jl(a.shape,u,o,1,s,c,!1,f),{strideHeight:h,strideWidth:d,filterHeight:m,filterWidth:g}=p,y="channelsLast"===p.dataFormat,v=new Va(p.filterShape,"float32"),b=p.padInfo.left,x=p.padInfo.top,_=r.data.get(a.dataId).values,w=r.data.get(i.dataId).values,k=new Va(a.shape,a.dtype,_),D=new Va(i.shape,i.dtype,w);for(let e=0;e<m;++e){const t=Math.max(0,Math.ceil((x-e)/h)),r=Math.min(p.outHeight,(p.inHeight+x-e)/h);for(let n=0;n<g;++n){const a=Math.max(0,Math.ceil((b-n)/d)),i=Math.min(p.outWidth,(p.inWidth+b-n)/d);for(let o=0;o<p.inChannels;++o)for(let s=0;s<p.outChannels;++s){let l=0;for(let c=0;c<p.batchSize;++c)for(let u=t;u<r;++u){const t=e+u*h-x;for(let e=a;e<i;++e){const r=n+e*d-b;l+=y?k.get(c,t,r,o)*D.get(c,u,e,s):k.get(c,o,t,r)*D.get(c,s,u,e)}}v.set(l,e,n,o,s)}}}return r.makeTensorInfo(v.shape,v.dtype,v.values)}},US={kernelName:St,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,filter:i}=t,{inputShape:o,strides:s,pad:l,dataFormat:c,dimRoundingMode:u}=n;JT([a,i],"conv2dBackpropInput");const f=Ie(i.shape),p=Ie(a.shape);let h=sc(c);const d=Jl(o,i.shape,s,1,l,u,!1,h),m=new Va(d.inShape,"float32"),g=m.values,y=r.data.get(a.dataId).values,v=r.data.get(i.dataId).values,[b,x,_]=f,{batchSize:w,filterHeight:k,filterWidth:D,inChannels:T,inHeight:A,inWidth:S,outChannels:M,outHeight:E,outWidth:C,strideHeight:N,strideWidth:O}=d;h=d.dataFormat;const I=k-1-d.padInfo.top,P=D-1-d.padInfo.left,R="channelsLast"===h,L=m.strides[0],F=R?m.strides[1]:m.strides[2],B=R?m.strides[2]:1,z=R?1:m.strides[1],j=p[0],U=R?p[1]:p[2],$=R?p[2]:1,V=R?1:p[1];for(let e=0;e<w;++e)for(let t=0;t<T;++t)for(let r=0;r<A;++r){const n=r-I,a=Math.max(0,Math.ceil(n/N)),i=Math.min(E,(k+n)/N);for(let o=0;o<S;++o){const s=o-P,l=Math.max(0,Math.ceil(s/O)),c=Math.min(C,(D+s)/O);let u=0;for(let r=a;r<i;++r){const a=r*N-n;for(let n=l;n<c;++n){const i=j*e+U*r+$*n,o=b*(k-1-a)+x*(D-1-(n*O-s))+_*t;for(let e=0;e<M;++e)u+=y[i+V*e]*v[o+e]}}g[L*e+F*r+B*o+z*t]=u}}return r.makeTensorInfo(m.shape,m.dtype,m.values)}},$S={kernelName:Mt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,filter:i}=t,{strides:o,pad:s,dilations:l}=n;JT([a,i],"conv3d");const c=Ql(a.shape,i.shape,o,l,s),{filterDepth:u,filterHeight:f,filterWidth:p,dilationDepth:h,dilationHeight:d,dilationWidth:m,padInfo:g}=c,y=g.front,v=g.left,b=g.top,x=new Va(c.outShape,a.dtype),_=r.data.get(a.dataId).values,w=r.data.get(i.dataId).values,k=x.values,D=Ie(a.shape),T=Ie(i.shape);for(let e=0;e<c.batchSize;++e){const t=e*D[0],r=e*x.strides[0];for(let e=0;e<c.outDepth;++e){const n=r+e*x.strides[1],a=e*c.strideDepth-y;for(let e=0;e<u;++e){const r=a+e*h;if(r<0||r>=c.inDepth)continue;const i=e*T[0],o=t+r*D[1];for(let e=0;e<c.outHeight;++e){const t=n+e*x.strides[2],r=e*c.strideHeight-b;for(let e=0;e<f;++e){const n=r+e*d;if(n<0||n>=c.inHeight)continue;const a=i+e*T[1],s=o+n*D[2];for(let e=0;e<c.outWidth;++e){const r=t+e*c.outChannels,n=e*c.strideWidth-v;for(let e=0;e<p;++e){const t=n+e*m;if(t<0||t>=c.inWidth)continue;const i=a+e*T[2],o=s+t*c.inChannels;let l=i;for(let e=0;e<c.inChannels;++e){const t=_[o+e];for(let e=0;e<c.outChannels;++e)k[r+e]+=t*w[l+e];l+=c.outChannels}}}}}}}}return r.makeTensorInfo(x.shape,x.dtype,x.values)}},VS={kernelName:Et,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,dy:i}=t,{strides:o,pad:s,filterShape:l}=n;JT([a,i],"conv3dBackpropFilterV2");const c=Ie(a.shape),u=Ie(i.shape),f=Ql(a.shape,l,o,1,s),p=f.strideDepth,h=f.strideHeight,d=f.strideWidth,m=f.filterDepth,g=f.filterHeight,y=f.filterWidth,v=new Va(f.filterShape,"float32"),b=v.values,[x,_,w,k]=v.strides,D=r.data.get(i.dataId).values,[T,A,S,M]=u,E=r.data.get(a.dataId).values,[C,N,O,I]=c,P=f.padInfo.front,R=f.padInfo.left,L=f.padInfo.top;for(let e=0;e<m;++e){const t=Math.max(0,Math.ceil((P-e)/p)),r=Math.min(f.outDepth,(f.inDepth+P-e)/p),n=e*x;for(let a=0;a<g;++a){const i=Math.max(0,Math.ceil((L-a)/h)),o=Math.min(f.outHeight,(f.inHeight+L-a)/h),s=a*_+n;for(let n=0;n<y;++n){const l=Math.max(0,Math.ceil((R-n)/d)),c=Math.min(f.outWidth,(f.inWidth+R-n)/d),u=n*w+s;for(let s=0;s<f.inChannels;++s){const m=s*k+u;for(let u=0;u<f.outChannels;++u){let g=0;for(let m=0;m<f.batchSize;++m){const f=m*C,y=m*T;for(let m=t;m<r;++m){const t=(e+m*p-P)*N+f,r=m*A+y;for(let e=i;e<o;++e){const i=(a+e*h-L)*O+t,o=e*S+r;for(let e=l;e<c;++e){const t=e*M+o;g+=E[(n+e*d-R)*I+i+s]*D[t+u]}}}}b[m+u]=g}}}}}return r.makeTensorInfo(v.shape,v.dtype,v.values)}},qS={kernelName:Ct,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,filter:i}=t,{pad:o,strides:s,inputShape:l}=n;JT([a],"conv3dBackpropInputV2");const c=Ie(a.shape),u=Ie(i.shape),f=Ql(l,i.shape,s,1,o),p=new Va(f.inShape,"float32"),h=p.values,[d,m,g,y]=p.strides,v=r.data.get(a.dataId).values,[b,x,_,w]=c,k=r.data.get(i.dataId).values,[D,T,A,S]=u,{batchSize:M,filterDepth:E,filterHeight:C,filterWidth:N,inChannels:O,inDepth:I,inHeight:P,inWidth:R,outChannels:L,outDepth:F,outHeight:B,outWidth:z,strideDepth:j,strideHeight:U,strideWidth:$}=f,V=E-1-f.padInfo.front,q=C-1-f.padInfo.top,W=N-1-f.padInfo.left;for(let e=0;e<M;++e)for(let t=0;t<O;++t)for(let r=0;r<I;++r){const n=r-V,a=Math.max(0,Math.ceil(n/j)),i=Math.min(F,(E+n)/j);for(let o=0;o<P;++o){const s=o-q,l=Math.max(0,Math.ceil(s/U)),c=Math.min(B,(C+s)/U);for(let u=0;u<R;++u){const f=u-W,p=Math.max(0,Math.ceil(f/$)),M=Math.min(z,(N+f)/$);let O=0;for(let r=a;r<i;++r){const a=r*j-n;for(let n=l;n<c;++n){const i=n*U-s;for(let o=p;o<M;++o){const s=b*e+x*r+_*n+w*o,l=D*(E-1-a)+T*(C-1-i)+A*(N-1-(o*$-f))+S*t;for(let e=0;e<L;++e)O+=v[s+e]*k[l+e]}}}h[d*e+m*r+g*o+y*u+t]=O}}}return r.makeTensorInfo(p.shape,p.dtype,p.values)}},WS=tA(Nt,(e=>Math.cos(e))),HS={kernelName:Nt,backendName:"cpu",kernelFunc:WS},GS=tA(Ot,(e=>Math.cosh(e))),XS={kernelName:Ot,backendName:"cpu",kernelFunc:GS},YS={kernelName:Pt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{image:a,boxes:i,boxInd:o}=t,{cropSize:s,method:l,extrapolationValue:c}=n,[u,f,p,h]=a.shape,d=i.shape[0],[m,g]=s,y=To([d,m,g,h],"float32"),v=r.data.get(i.dataId).values,b=r.data.get(o.dataId).values,x=r.data.get(a.dataId).values,_=Ie(a.shape),w=Ie(y.shape);for(let e=0;e<d;e++){const t=4*e,r=v[t],n=v[t+1],a=v[t+2],i=v[t+3],o=b[e];if(o>=u)continue;const s=m>1?(a-r)*(f-1)/(m-1):0,d=g>1?(i-n)*(p-1)/(g-1):0;for(let t=0;t<m;t++){const u=m>1?r*(f-1)+t*s:.5*(r+a)*(f-1);if(u<0||u>f-1)for(let r=0;r<g;r++)for(let n=0;n<h;n++){const a=n+r*w[2]+t*w[1]+e*w[0];y.values[a]=c}else if("bilinear"===l){const r=Math.floor(u),a=Math.ceil(u),s=u-r;for(let l=0;l<g;l++){const u=g>1?n*(p-1)+l*d:.5*(n+i)*(p-1);if(u<0||u>p-1){for(let r=0;r<h;r++){const n=r+l*w[2]+t*w[1]+e*w[0];y.values[n]=c}continue}const f=Math.floor(u),m=Math.ceil(u),v=u-f;for(let n=0;n<h;n++){let i=n+f*_[2]+r*_[1]+o*_[0];const c=x[i];i=n+m*_[2]+r*_[1]+o*_[0];const u=x[i];i=n+f*_[2]+a*_[1]+o*_[0];const p=x[i];i=n+m*_[2]+a*_[1]+o*_[0];const h=c+(u-c)*v,d=p+(x[i]-p)*v;i=n+l*w[2]+t*w[1]+e*w[0],y.values[i]=h+(d-h)*s}}}else for(let r=0;r<g;++r){const a=g>1?n*(p-1)+r*d:.5*(n+i)*(p-1);if(a<0||a>p-1){for(let n=0;n<h;n++){const a=n+r*w[2]+t*w[1]+e*w[0];y.values[a]=c}continue}const s=Math.round(a),l=Math.round(u);for(let n=0;n<h;n++){const a=n+s*_[2]+l*_[1]+o*_[0],i=n+r*w[2]+t*w[1]+e*w[0];y.values[i]=x[a]}}}}return r.makeTensorInfo(y.shape,y.dtype,y.values)}},ZS={kernelName:It,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,exclusive:o,reverse:s}=n;JT(a,"cumsum");const l=Cu([i],a.shape.length);let c=a;null!=l&&(c=XA({inputs:{x:a},backend:r,attrs:{perm:l}}));const u=Ou(1,a.shape.length)[0];if(u!==c.shape.length-1)throw new Error(`backend.cumsum in CPU expects an inner-most axis=${c.shape.length-1} but got axis=${u}`);const f=ri(c.dtype,"int32"),p=Fe(se(c.shape),f),h=r.data.get(c.dataId).values,d=c.shape[c.shape.length-1],m=s?(e,t)=>e+d-t-1:(e,t)=>e+t;for(let e=0;e<h.length;e+=d)for(let t=0;t<d;t++){const r=m(e,t);if(0===t)p[r]=o?0:h[r];else{const n=m(e,t-1);p[r]=o?h[n]+p[n]:h[r]+p[n]}}const g=r.makeTensorInfo(c.shape,f,p);if(null!=l){const e=XA({inputs:{x:g},backend:r,attrs:{perm:Nu(l)}});return r.disposeIntermediateTensorInfo(g),r.disposeIntermediateTensorInfo(c),e}return g}},KS={kernelName:Rt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,weights:i}=t,{size:o,binaryOutput:s}=n;if(1===a.shape.length){const e=kS(r.data.get(a.dataId).values,r.data.get(i.dataId).values,i.dtype,i.shape,o);return r.makeTensorInfo([o],i.dtype,e)}if(2===a.shape.length){const e=DS(r.bufferSync(a),r.bufferSync(i),o,s);return r.makeTensorInfo(e.shape,i.dtype,e.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${a.shape.length}.`)}},JS={kernelName:Lt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{blockSize:i,dataFormat:o}=n;ne("NHWC"===o,(()=>`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${o}`));const s=a.shape[0],l=a.shape[1],c=a.shape[2],u=a.shape[3],f=l*i,p=c*i,h=u/(i*i),d=r.data.get(a.dataId).values,m=new Float32Array(s*f*p*h);let g=0;for(let e=0;e<s;++e)for(let t=0;t<f;++t){const r=Math.floor(t/i),n=t%i;for(let t=0;t<p;++t){const a=Math.floor(t/i),o=(n*i+t%i)*h;for(let t=0;t<h;++t){const n=t+o+u*(a+c*(r+l*e));m[g++]=d[n]}}}return r.makeTensorInfo([s,f,p,h],a.dtype,m)}};function QS(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,filter:i}=t,{strides:o,pad:s,dilations:l,dimRoundingMode:c}=n;JT([a,i],"depthwiseConv2DNative");const u=Ie(a.shape),f=Ie(i.shape);let p=l;null==p&&(p=[1,1]),ne(oc(o,p),(()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${o} and dilations '${p}'`));const h=Jl(a.shape,i.shape,o,p,s,c,!0),{filterHeight:d,filterWidth:m,dilationHeight:g,dilationWidth:y,padInfo:v}=h,b=v.left,x=v.top,_=h.outChannels/h.inChannels,w=new Va(h.outShape,a.dtype),k=r.data.get(a.dataId).values,D=r.data.get(i.dataId).values,T=w.values;for(let e=0;e<h.batchSize;++e){const t=e*u[0],r=e*w.strides[0];for(let e=0;e<h.outHeight;++e){const n=r+e*w.strides[1],a=e*h.strideHeight-x;for(let e=0;e<d;++e){const r=a+e*g;if(r<0||r>=h.inHeight)continue;const i=e*f[0],o=t+r*u[1];for(let e=0;e<h.outWidth;++e){const t=n+e*w.strides[2],r=e*h.strideWidth-b;for(let e=0;e<m;++e){const n=r+e*y;if(n<0||n>=h.inWidth)continue;const a=i+e*f[1],s=o+n*h.inChannels;let l=t,c=a;for(let e=0;e<h.inChannels;++e){const t=k[s+e];for(let e=0;e<_;++e)T[l+e]+=t*D[c+e];l+=_,c+=_}}}}}}return r.makeTensorInfo(w.shape,w.dtype,w.values)}const eM={kernelName:Ft,backendName:"cpu",kernelFunc:QS},tM={kernelName:Bt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,dy:i}=t,{strides:o,dilations:s,pad:l,dimRoundingMode:c,filterShape:u}=n;JT([a,i],"depthwiseConv2dNativeBackpropFilter");const f=Jl(a.shape,u,o,s,l,c,!0),{strideHeight:p,strideWidth:h,filterHeight:d,filterWidth:m}=f,g=new Va(f.filterShape,"float32"),y=f.padInfo.left,v=f.padInfo.top,b=f.outChannels/f.inChannels,x=r.data.get(a.dataId).values,_=new Va(a.shape,a.dtype,x),w=r.data.get(i.dataId).values,k=new Va(i.shape,i.dtype,w);for(let e=0;e<d;++e){const t=Math.max(0,Math.ceil((v-e)/p)),r=Math.min(f.outHeight,(f.inHeight+v-e)/p);for(let n=0;n<m;++n){const a=Math.max(0,Math.ceil((y-n)/h)),i=Math.min(f.outWidth,(f.inWidth+y-n)/h);for(let o=0;o<f.outChannels;++o){const s=Math.trunc(o/b),l=o%b;let c=0;for(let l=0;l<f.batchSize;++l)for(let u=t;u<r;++u){const t=e+u*p-v;for(let e=a;e<i;++e){const r=n+e*h-y;c+=_.get(l,t,r,s)*k.get(l,u,e,o)}}g.set(c,e,n,s,l)}}}return r.makeTensorInfo(g.shape,g.dtype,g.values)}},rM={kernelName:zt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,filter:i}=t,{strides:o,dilations:s,pad:l,dimRoundingMode:c,inputShape:u}=n;JT([a,i],"depthwiseConv2DNativeBackpropInput");const f=Ie(a.shape),p=Ie(i.shape),h=Jl(u,i.shape,o,s,l,c,!0),d=new Va(h.inShape,"float32"),m=d.values,[g,y,v]=d.strides,b=r.data.get(a.dataId).values,[x,_,w]=f,k=r.data.get(i.dataId).values,[D,T,A]=p,{batchSize:S,filterHeight:M,filterWidth:E,inChannels:C,inHeight:N,inWidth:O,outChannels:I,outHeight:P,outWidth:R,strideHeight:L,strideWidth:F}=h,B=M-1-h.padInfo.top,z=E-1-h.padInfo.left,j=I/C;for(let e=0;e<S;++e)for(let t=0;t<C;++t)for(let r=0;r<N;++r){const n=r-B,a=Math.max(0,Math.ceil(n/L)),i=Math.min(P,(M+n)/L);for(let o=0;o<O;++o){const s=o-z,l=Math.max(0,Math.ceil(s/F)),c=Math.min(R,(E+s)/F);let u=0;for(let r=a;r<i;++r){const a=r*L-n;for(let n=l;n<c;++n){const i=x*e+_*r+w*n,o=D*(M-1-a)+T*(E-1-(n*F-s))+A*t;for(let e=0;e<j;++e)u+=b[i+(t*j+e)]*k[o+e]}}m[g*e+y*r+v*o+t]=u}}return r.makeTensorInfo(d.shape,d.dtype,d.values)}},nM={kernelName:jt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{x:n}=t,a=se(n.shape),i=r.data.get(n.dataId).values,o=To([a,a],n.dtype),s=o.values;for(let e=0;e<i.length;e++)s[e*a+e]=i[e];const l=[...n.shape,...n.shape];return r.makeTensorInfo(l,o.dtype,o.values)}},aM={kernelName:Ut,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:r})=>{const{x:n,filter:a}=e,{strides:i,pad:o,dilations:s}=r,l=t,c=l.data.get(n.dataId).values,u=n.shape.length,f=l.data.get(a.dataId).values,p=a.shape.length,{batchSize:h,inHeight:d,inWidth:m,inChannels:g,outHeight:y,outWidth:v,padInfo:b,strideHeight:x,strideWidth:_,filterHeight:w,filterWidth:k,dilationHeight:D,dilationWidth:T,outShape:A}=Yl(n.shape,a.shape,i,o,"NHWC",s),S=se(A),M=A.length,E=xe(n.dtype,S);for(let e=0;e<h;++e)for(let t=0;t<y;++t){const r=t*x-b.top;for(let i=0;i<v;++i){const o=i*_-b.left;for(let s=0;s<g;++s){let l=Number.MIN_SAFE_INTEGER;for(let t=0;t<w;++t){const i=r+t*D;if(i>=0&&i<d)for(let r=0;r<k;++r){const h=o+r*T;if(h>=0&&h<m){const o=je([e,i,h,s],u,Ie(n.shape)),d=je([t,r,s],p,Ie(a.shape)),m=c[o]+f[d];m>l&&(l=m)}}}E[je([e,t,i,s],M,Ie(A))]=l}}}return{dataId:l.write(Ca(E,n.dtype),A,n.dtype),shape:A,dtype:n.dtype}}},iM={kernelName:Vt,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:r})=>{const{x:n,filter:a,dy:i}=e,{strides:o,pad:s,dilations:l}=r,c=t,u=Re(n.shape,c.data.get(n.dataId).values),f=Re(a.shape,c.data.get(a.dataId).values),{batchSize:p,inHeight:h,inWidth:d,inChannels:m,outHeight:g,outWidth:y,padInfo:v,strideHeight:b,strideWidth:x,filterHeight:_,filterWidth:w,dilationHeight:k,dilationWidth:D,outShape:T}=Yl(n.shape,a.shape,o,s,"NHWC",l);ne(i.rank===T.length,(()=>`Error in ${Vt}, dy must have the same rank as output ${T.length}, but got ${i.rank}`));const A=Re(T,c.data.get(i.dataId).values),S=Be(a.shape,a.dtype);for(let e=0;e<p;++e)for(let t=0;t<g;++t){const r=t*b-v.top;for(let n=0;n<y;++n){const a=n*x-v.left;for(let i=0;i<m;++i){let o=Number.MIN_SAFE_INTEGER,s=0,l=0;for(let t=0;t<_;++t){const n=r+t*k;if(n>=0&&n<h)for(let r=0;r<w;++r){const c=a+r*D;if(c>=0&&c<d){const a=u[e][n][c][i]+f[t][r][i];a>o&&(o=a,s=t,l=r)}}}S[s][l][i]+=A[e][t][n][i]}}}return{dataId:c.write(Ca(S,n.dtype),a.shape,a.dtype),shape:a.shape,dtype:a.dtype}}},oM={kernelName:$t,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:r})=>{const{x:n,filter:a,dy:i}=e,{strides:o,pad:s,dilations:l}=r,c=t,u=Re(n.shape,c.data.get(n.dataId).values),f=Re(a.shape,c.data.get(a.dataId).values),{batchSize:p,inHeight:h,inWidth:d,inChannels:m,outHeight:g,outWidth:y,padInfo:v,strideHeight:b,strideWidth:x,filterHeight:_,filterWidth:w,dilationHeight:k,dilationWidth:D,outShape:T}=Yl(n.shape,a.shape,o,s,"NHWC",l);ne(i.rank===T.length,(()=>`Error in ${$t}, dy must have the same rank as output ${T.length}, but got ${i.rank}`));const A=Re(T,c.data.get(i.dataId).values),S=Be(n.shape,n.dtype);for(let e=0;e<p;++e)for(let t=0;t<g;++t){const r=t*b-v.top;for(let n=0;n<y;++n){const a=n*x-v.left;for(let i=0;i<m;++i){let o=Number.MIN_SAFE_INTEGER,s=r<0?0:r,l=a<0?0:a;for(let t=0;t<_;++t){const n=r+t*k;if(n>=0&&n<h)for(let r=0;r<w;++r){const c=a+r*D;if(c>=0&&c<d){const a=u[e][n][c][i]+f[t][r][i];a>o&&(o=a,s=n,l=c)}}}S[e][s][l][i]+=A[e][t][n][i]}}}return{dataId:c.write(Ca(S,n.dtype),n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}},sM=cA(((e,t)=>e*t)),lM=CA(((e,t,r,n)=>({real:e*r-t*n,imag:e*n+t*r}))),cM=EA(jr,sM,lM),uM={kernelName:jr,backendName:"cpu",kernelFunc:cM};function fM(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,keepDims:o}=n;let s;JT(a,"sum"),s="bool"===a.dtype?SA({inputs:{x:a},backend:r,attrs:{dtype:"int32"}}):iA({inputs:{x:a},backend:r});const l=s.shape.length,c=ye(i,s.shape),u=Cu(c,l);let f=c,p=s;null!=u&&(p=XA({inputs:{x:s},backend:r,attrs:{perm:u}}),f=Ou(f.length,l)),Eu("sum",f,p.shape.length);const[h,d]=Su(p.shape,f);let m=DA(r,h,ri(p.dtype,"int32"));const g=se(d),y=r.data.get(m.dataId).values,v=r.data.get(p.dataId).values;for(let e=0;e<y.length;++e){const t=e*g;let r=0;for(let e=0;e<g;++e)r+=v[t+e];y[e]=r}if(o){const e=m;m=RA({inputs:{x:m},backend:r,attrs:{shape:Mu(m.shape,c)}}),r.disposeIntermediateTensorInfo(e)}return r.disposeIntermediateTensorInfo(s),null!=u&&r.disposeIntermediateTensorInfo(p),m}const pM={kernelName:Dn,backendName:"cpu",kernelFunc:fM},hM={kernelName:Wt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{equation:a}=n,i=t,{allDims:o,summedDims:s,idDims:l}=ld(a,i.length);ud(o.length,l,i);const{path:c,steps:u}=fd(s,l),f=u.length;let p=null,h=o.length;const d=[];for(let e=0;e<f;++e){for(const t of u[e]){const{permutationIndices:e,expandDims:n}=cd(h,l[t]);let a;pd(e)?a=i[t]:(a=XA({inputs:{x:i[t]},backend:r,attrs:{perm:e}}),d.push(a));const o=a.shape.slice();for(let e=0;e<n.length;++e)o.splice(n[e],0,1);ce(a.shape,o)||(a=RA({inputs:{x:a},backend:r,attrs:{shape:o}}),d.push(a)),null===p?p=a:(p=cM({inputs:{a,b:p},backend:r}),d.push(p))}e<f-1&&(c[e]>=0&&(p=fM({inputs:{x:p},backend:r,attrs:{axis:c[e]-(o.length-h),keepDims:!1}}),d.push(p)),h--)}for(const e of d)e!==p&&r.disposeIntermediateTensorInfo(e);return p}},dM={kernelName:Gt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{dy:n,y:a}=t;JT([n,a],"eluGrad");const i=new Float32Array(se(a.shape)),o=r.data.get(a.dataId).values,s=r.data.get(n.dataId).values;for(let e=0;e<o.length;++e){const t=o[e];i[e]=t>=1?s[e]:s[e]*(t+1)}return r.makeTensorInfo(a.shape,"float32",i)}},mM=cA(((e,t)=>e===t?1:0)),gM=EA(Yt,mM,null,"bool"),yM={kernelName:Yt,backendName:"cpu",kernelFunc:gM},vM=Gh,bM=Xh,xM=Yh,_M=Zh,wM=Kh,kM=Jh,DM=tA(Xt,(e=>{const t=Math.sign(e),r=Math.abs(e),n=1/(1+vM*r);return t*(1-((((kM*n+wM)*n+_M)*n+xM)*n+bM)*n*Math.exp(-r*r))})),TM={kernelName:Xt,backendName:"cpu",kernelFunc:DM},AM=yA((e=>Math.exp(e))),SM=rA(Zt,AM,"float32"),MM={kernelName:Zt,backendName:"cpu",kernelFunc:SM};function EM(e){const{inputs:t,backend:r,attrs:n}=e,{input:a}=t,{dim:i}=n,o=a.shape.length,s=a.shape.slice();let l=i;return i<0&&(ne(-(o+1)<=i,(()=>`Axis must be in the interval [${-(o+1)}, ${o}]`)),l=o+i+1),s.splice(l,0,1),RA({inputs:{x:a},backend:r,attrs:{shape:s}})}const CM={kernelName:Kt,backendName:"cpu",kernelFunc:EM},NM=yA((e=>Math.expm1(e))),OM=rA(Jt,NM),IM={kernelName:Jt,backendName:"cpu",kernelFunc:OM},PM=cA(((e,t)=>e/t)),RM=EA(qt,PM),LM={kernelName:qt,backendName:"cpu",kernelFunc:RM},FM=cA(((e,t)=>e-t)),BM=CA(((e,t,r,n)=>({real:e-r,imag:t-n}))),zM=EA(zn,FM,BM),jM={kernelName:zn,backendName:"cpu",kernelFunc:zM};function UM(e,t,r){const n=e.shape,a=n[0],i=n[1],o=r.data.get(e.dataId),s=o.complexTensorInfos.real,l=o.complexTensorInfos.imag,c=[a,i],u=se(c),f=be("float32",u),p=be("float32",u);for(let e=0;e<a;e++){const n=xS({inputs:{x:s},backend:r,attrs:{begin:[e,0],size:[1,i]}}),a=xS({inputs:{x:l},backend:r,attrs:{begin:[e,0],size:[1,i]}}),o=wA({inputs:{real:n,imag:a},backend:r}),{real:c,imag:u}=$M(o,t,r),h=Qh(c,u);for(let t=0;t<i;t++){const r=nd(h,t);f[e*i+t]=r.real,p[e*i+t]=r.imag}r.disposeIntermediateTensorInfo(n),r.disposeIntermediateTensorInfo(a),r.disposeIntermediateTensorInfo(o)}const h=r.makeTensorInfo(c,"float32",f),d=r.makeTensorInfo(c,"float32",p),m=wA({inputs:{real:h,imag:d},backend:r});return r.disposeIntermediateTensorInfo(h),r.disposeIntermediateTensorInfo(d),m}function $M(e,t,r){const n=se(e.shape),a=r.data.get(e.dataId),i=r.data.get(a.complexTensorInfos.real.dataId).values,o=r.data.get(a.complexTensorInfos.imag.dataId).values;if(0==((s=n)&s-1)){const a=VM(i,o,n,t,r),s=[e.shape[0],e.shape[1]];if(t){const e=r.makeTensorInfo(s,"float32",a.real),t=r.makeTensorInfo(s,"float32",a.imag),i=r.makeTensorInfo([],"float32",Ea(n,"float32")),o=iA({inputs:{x:i},backend:r}),l=LM.kernelFunc({inputs:{a:e,b:i},backend:r}),c=LM.kernelFunc({inputs:{a:t,b:o},backend:r}),u=r.data.get(l.dataId).values,f=r.data.get(c.dataId).values;return r.disposeIntermediateTensorInfo(e),r.disposeIntermediateTensorInfo(t),r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(l),r.disposeIntermediateTensorInfo(c),{real:u,imag:f}}return a}{const e=function(e,t,r){const n=new Float32Array(2*t);for(let a=0;a<t;a++){let i=0,o=0;for(let n=0;n<t;n++){const s=od(a*n,t,r),l=nd(e,n);i+=l.real*s.real-l.imag*s.imag,o+=l.real*s.imag+l.imag*s.real}r&&(i/=t,o/=t),ad(n,i,o,a)}return n}(Qh(i,o),n,t);return ed(e)}var s}function VM(e,t,r,n,a){if(1===r)return{real:e,imag:t};const i=Qh(e,t),o=r/2,s=td(i),l=s.real,c=s.imag,u=[l.length],f=a.makeTensorInfo(u,"float32",l),p=a.makeTensorInfo(u,"float32",c),h=wA({inputs:{real:f,imag:p},backend:a}),d=rd(i),m=d.real,g=d.imag,y=[m.length],v=a.makeTensorInfo(y,"float32",m),b=a.makeTensorInfo(y,"float32",g),x=wA({inputs:{real:v,imag:b},backend:a}),_=VM(l,c,o,n,a),w=_.real,k=_.imag,D=[w.length],T=a.makeTensorInfo(D,"float32",w),A=a.makeTensorInfo(D,"float32",k),S=wA({inputs:{real:T,imag:A},backend:a}),M=VM(m,g,o,n,a),E=M.real,C=M.imag,N=[E.length],O=a.makeTensorInfo(N,"float32",E),I=a.makeTensorInfo(N,"float32",C),P=wA({inputs:{real:O,imag:I},backend:a}),R=id(r,n),L=[R.real.length],F=a.makeTensorInfo(L,"float32",R.real),B=a.makeTensorInfo(L,"float32",R.imag),z=wA({inputs:{real:F,imag:B},backend:a}),j=cM({inputs:{a:z,b:P},backend:a}),U=IA({inputs:{a:S,b:j},backend:a}),$=zM({inputs:{a:S,b:j},backend:a}),V=TA({inputs:{input:U},backend:a}),q=TA({inputs:{input:$},backend:a}),W=PS({inputs:{input:U},backend:a}),H=PS({inputs:{input:$},backend:a}),G=LS({inputs:[V,q],backend:a,attrs:{axis:0}}),X=LS({inputs:[W,H],backend:a,attrs:{axis:0}}),Y=a.data.get(G.dataId).values,Z=a.data.get(X.dataId).values;return a.disposeIntermediateTensorInfo(f),a.disposeIntermediateTensorInfo(p),a.disposeIntermediateTensorInfo(h),a.disposeIntermediateTensorInfo(v),a.disposeIntermediateTensorInfo(b),a.disposeIntermediateTensorInfo(x),a.disposeIntermediateTensorInfo(T),a.disposeIntermediateTensorInfo(A),a.disposeIntermediateTensorInfo(S),a.disposeIntermediateTensorInfo(O),a.disposeIntermediateTensorInfo(I),a.disposeIntermediateTensorInfo(P),a.disposeIntermediateTensorInfo(F),a.disposeIntermediateTensorInfo(B),a.disposeIntermediateTensorInfo(z),a.disposeIntermediateTensorInfo(j),a.disposeIntermediateTensorInfo(U),a.disposeIntermediateTensorInfo($),a.disposeIntermediateTensorInfo(V),a.disposeIntermediateTensorInfo(W),a.disposeIntermediateTensorInfo(q),a.disposeIntermediateTensorInfo(H),a.disposeIntermediateTensorInfo(G),a.disposeIntermediateTensorInfo(X),{real:Y,imag:Z}}const qM={kernelName:Qt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{input:n}=t,a=se(n.shape),i=n.shape[n.shape.length-1],o=RA({inputs:{x:n},backend:r,attrs:{shape:[a/i,i]}}),s=UM(o,!1,r),l=RA({inputs:{x:s},backend:r,attrs:{shape:n.shape}});return r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(s),l}};function WM(e){const{backend:t,attrs:r}=e,{shape:n,value:a,dtype:i}=r,o=i||Ce(a),s=xe(o,se(n));return function(e,t,r){e.fill(t)}(s,a),t.makeTensorInfo(n,o,s)}const HM={kernelName:er,backendName:"cpu",kernelFunc:WM},GM={kernelName:tr,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:r})=>{const{image:n}=e,a=r,i=be(n.dtype,se(n.shape)),[o,s,l,c]=n.shape,u=a.data.get(n.dataId).values;for(let e=0;e<o;e++){const t=e*l*s*c;for(let e=0;e<s;e++){const r=e*(l*c);for(let e=0;e<l;e++){const n=e*c;for(let a=0;a<c;a++){const o=Math.round(l-e-1),s=t+r+n+a;let f=u[s];o>=0&&o<l&&(f=u[t+r+o*c+a]),i[s]=f}}}}return{dataId:a.write(i,n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}},XM=yA((e=>Math.floor(e))),YM=rA(rr,XM),ZM={kernelName:rr,backendName:"cpu",kernelFunc:YM},KM=cA(((e,t)=>Math.floor(e/t))),JM=EA(nr,KM,null,"int32"),QM={kernelName:nr,backendName:"cpu",kernelFunc:JM},eE={kernelName:ea,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,filter:i,bias:o,preluActivationWeights:s}=t,{strides:l,pad:c,dataFormat:u,dilations:f,dimRoundingMode:p,activation:h,leakyreluAlpha:d}=n;let m=BS({inputs:{x:a,filter:i},backend:r,attrs:{strides:l,pad:c,dataFormat:u,dilations:f,dimRoundingMode:p}});if(o){const e=m;m=IA({inputs:{a:m,b:o},backend:r}),r.disposeIntermediateTensorInfo(e)}if(h){const e=m;m=_A(r,m,h,s,d),r.disposeIntermediateTensorInfo(e)}return m}},tE={kernelName:ta,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,filter:i,bias:o,preluActivationWeights:s}=t,{strides:l,pad:c,dataFormat:u,dilations:f,dimRoundingMode:p,activation:h,leakyreluAlpha:d}=n;let m=QS({inputs:{x:a,filter:i},backend:r,attrs:{strides:l,pad:c,dataFormat:u,dilations:f,dimRoundingMode:p}});if(o){const e=m;m=IA({inputs:{a:m,b:o},backend:r}),r.disposeIntermediateTensorInfo(e)}if(h){const e=m;m=_A(r,m,h,s,d),r.disposeIntermediateTensorInfo(e)}return m}};function rE(e,t,r,n,a,i,o,s,l){const c=To([n,i],r);for(let r=0;r<n;r++){const n=[];let u=0;for(let t=0;t<a;t++){const i=e[r*a+t];u+=i*o[t],n.push(i)}if(u<0||u>=l/i)throw new Error(`Invalid indices: ${n} does not index into ${s}`);for(let e=0;e<i;e++)c.values[r*i+e]=t.get(...t.indexToLoc(u*i+e))}return c}const nE={kernelName:or,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{params:n,indices:a}=t,i=se(n.shape),o=a.shape,s=o[o.length-1],[l,c,u,f]=is(n,a);if(0===c)return r.makeTensorInfo(l,n.dtype,[]);const p=rE(r.data.get(a.dataId).values,r.bufferSync(n),n.dtype,c,s,u,f,n.shape,i);return r.makeTensorInfo(l,n.dtype,p.values)}};function aE(e,t,r){const n=To(r,e.dtype);for(let r=0;r<n.size;++r){const a=n.indexToLoc(r).slice(),i=a[0],o=a[2],s=t.locToIndex([i,o]);a[2]=t.values[s];const l=e.locToIndex(a);0<=l&&l<e.values.length&&(n.values[r]=e.values[l])}return n}const iE={kernelName:ir,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,indices:i}=t,{axis:o,batchDims:s}=n;JT([a,i],"gatherV2");const l=ye(o,a.shape)[0],c=r.data.get(i.dataId).values,u=a.shape[l];for(let e=0;e<c.length;++e){const t=c[e];ne(t<=u-1&&t>=0,(()=>`GatherV2: the index value ${t} is not in [0, ${u-1}]`))}let f=s;null==s&&(f=0);const p=se(i.shape),h=Ed(a,i,l,f),d=RA({inputs:{x:a},backend:r,attrs:{shape:[h.batchSize,h.outerSize,h.dimSize,h.sliceSize]}}),m=RA({inputs:{x:i},backend:r,attrs:{shape:[h.batchSize,p/h.batchSize]}}),g=[h.batchSize,h.outerSize,p/h.batchSize,h.sliceSize],y=r.bufferSync(m),v=aE(r.bufferSync(d),y,g);return r.disposeIntermediateTensorInfo(d),r.disposeIntermediateTensorInfo(m),r.makeTensorInfo(h.outputShape,v.dtype,v.values)}},oE=cA(((e,t)=>e>t?1:0)),sE=EA(sr,oE,null,"bool"),lE={kernelName:sr,backendName:"cpu",kernelFunc:sE},cE=cA(((e,t)=>e>=t?1:0)),uE=EA(lr,cE,null,"bool"),fE={kernelName:lr,backendName:"cpu",kernelFunc:uE},pE={kernelName:ur,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{input:n}=t,a=se(n.shape),i=n.shape[n.shape.length-1],o=RA({inputs:{x:n},backend:r,attrs:{shape:[a/i,i]}}),s=UM(o,!0,r),l=RA({inputs:{x:s},backend:r,attrs:{shape:n.shape}});return r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(s),l}},hE=tA(pr,(e=>Number.isFinite(e)?1:0),"bool"),dE={kernelName:pr,backendName:"cpu",kernelFunc:hE},mE=tA(hr,(e=>Math.abs(e)===1/0?1:0),"bool"),gE={kernelName:hr,backendName:"cpu",kernelFunc:mE},yE=tA(dr,(e=>Number.isNaN(e)?1:0),"bool"),vE={kernelName:dr,backendName:"cpu",kernelFunc:yE},bE=cA(((e,t)=>e<t?1:0)),xE=EA(gr,bE,null,"bool"),_E={kernelName:gr,backendName:"cpu",kernelFunc:xE},wE=cA(((e,t)=>e<=t?1:0)),kE=EA(yr,wE,null,"bool"),DE={kernelName:yr,backendName:"cpu",kernelFunc:kE};function TE(e,t,r){const n=(t-e)/(r-1),a=Fe(r,"float32");a[0]=e;for(let e=1;e<a.length;e++)a[e]=a[e-1]+n;return a}const AE={kernelName:vr,backendName:"cpu",kernelFunc:function(e){const{backend:t,attrs:r}=e,{start:n,stop:a,num:i}=r,o=TE(n,a,i);return t.makeTensorInfo([o.length],"float32",o)}},SE=yA((e=>Math.log(e))),ME=rA(br,SE),EE={kernelName:br,backendName:"cpu",kernelFunc:ME},CE=tA(xr,(e=>Math.log1p(e))),NE={kernelName:xr,backendName:"cpu",kernelFunc:CE},OE=cA(((e,t)=>e&&t)),IE=EA(_r,OE,null,"bool"),PE={kernelName:_r,backendName:"cpu",kernelFunc:IE},RE=tA(wr,(e=>e?0:1),"bool"),LE={kernelName:wr,backendName:"cpu",kernelFunc:RE},FE=cA(((e,t)=>e||t)),BE=EA(kr,FE,null,"bool"),zE={kernelName:kr,backendName:"cpu",kernelFunc:BE},jE={kernelName:Tr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{depthRadius:i,bias:o,alpha:s,beta:l}=n;JT(a,"LRN");const c=a.shape[3],u=c-1,f=r.data.get(a.dataId).values,p=se(a.shape),h=new Float32Array(p);function d(e){const t=e%c;let r=e-t+Math.max(0,t-i);const n=e-t+Math.min(t+i,u);let a=0;for(;r<=n;r++){const e=f[r];a+=e*e}return a}for(let e=0;e<p;e++){const t=d(e),r=f[e]*Math.pow(o+s*t,-l);h[e]=r}return r.makeTensorInfo(a.shape,a.dtype,h)}},UE={kernelName:Ar,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,y:i,dy:o}=t,{depthRadius:s,bias:l,alpha:c,beta:u}=n;JT(o,"LRNGrad");const f=se(o.shape),p=o.shape[3],h=r.data.get(o.dataId).values,d=r.data.get(a.dataId).values,m=r.data.get(i.dataId).values,g=new Float32Array(f),y=f;for(let e=0;e<y;e++){const t=e%p,r=e-t+Math.max(0,t-s),n=e-t+Math.min(p,t+s+1);let a=0;for(let e=r;e<n;e++)a+=Math.pow(d[e],2);a=c*a+l;for(let t=r;t<n;t++){let r=-2*c*u*d[t]*m[e]/a;e===t&&(r+=Math.pow(a,-u)),r*=h[e],g[t]+=r}}return r.makeTensorInfo(o.shape,a.dtype,g)}};function $E(e,t,r,n){const a=be(n,se(r));for(let r=0;r<a.length;++r){const n=r*t;let i=e[n];for(let r=0;r<t;++r){const t=e[n+r];(Number.isNaN(t)||t>i)&&(i=t)}a[r]=i}return a}function VE(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{reductionIndices:i,keepDims:o}=n,s=r;let l=a.shape;const c=l.length,u=ye(i,l);let f=u;const p=Cu(f,c);let h=s.data.get(a.dataId).values;if(null!=p){const e=new Array(c);for(let t=0;t<e.length;t++)e[t]=l[p[t]];h=GA(h,l,a.dtype,p,e),f=Ou(f.length,c),l=e}JT(a,"max"),Eu("max",f,c);const[d,m]=Su(l,f),g=$E(h,se(m),d,a.dtype),y=s.write(g,d,a.dtype);let v=d;return o&&(v=Mu(d,u)),{dataId:y,shape:v,dtype:a.dtype}}const qE={kernelName:Sr,backendName:"cpu",kernelFunc:VE},WE=cA(((e,t)=>Math.max(e,t))),HE=EA(Mr,WE),GE={kernelName:Mr,backendName:"cpu",kernelFunc:HE},XE={kernelName:Er,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t;JT(a,"maxPool");const{filterSize:i,strides:o,pad:s,dimRoundingMode:l}=n;ne(oc(o,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`));const c=Zl(a.shape,i,o,1,s,l);let u;if(1===c.filterWidth&&1===c.filterHeight&&ce(c.inShape,c.outShape))u=iA({inputs:{x:a},backend:r});else{const e=r.data.get(a.dataId).values,t=Ie(a.shape),n=fS(e,a.shape,a.dtype,t,c,"max");u=r.makeTensorInfo(c.outShape,a.dtype,n.values)}return u}},YE={kernelName:Nr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{filterSize:i,strides:o,pad:s,dimRoundingMode:l,dataFormat:c}=n;JT(a,"maxPool3d");const u=Kl(a.shape,i,o,1,s,l,c),f=hS(r.data.get(a.dataId).values,a.shape,a.dtype,Ie(a.shape),u,"max");return r.makeTensorInfo(f.shape,"float32",f.values)}},ZE={kernelName:Or,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,input:i}=t,{filterSize:o,strides:s,pad:l,dimRoundingMode:c}=n;JT([a,i],"maxPool3DGrad");const u=Kl(i.shape,o,s,1,l,c),f=function(e,t){const r=To(t.outShape,"int32"),n=t.strideDepth,a=t.strideHeight,i=t.strideWidth,o=t.dilationDepth,s=t.dilationHeight,l=t.dilationWidth,c=t.effectiveFilterDepth,u=t.effectiveFilterHeight,f=t.effectiveFilterWidth,p=t.padInfo.front,h=t.padInfo.top,d=t.padInfo.left;for(let m=0;m<t.batchSize;++m)for(let g=0;g<t.inChannels;++g)for(let y=0;y<t.outDepth;++y){const v=y*n-p;let b=v;for(;b<0;)b+=o;const x=Math.min(t.inDepth,c+v);for(let n=0;n<t.outHeight;++n){const c=n*a-h;let p=c;for(;p<0;)p+=s;const _=Math.min(t.inHeight,u+c);for(let a=0;a<t.outWidth;++a){const h=a*i-d;let w=h;for(;w<0;)w+=l;const k=Math.min(t.inWidth,f+h);let D=Number.NEGATIVE_INFINITY,T=-1;for(let t=b;t<x;t+=o){const r=t-v;for(let n=p;n<_;n+=s){const a=n-c;for(let i=w;i<k;i+=l){const o=i-h,s=e.get(m,t,n,i,g);s>=D&&(D=s,T=r*u*f+a*u+o)}}}r.set(T,m,y,n,a,g)}}}return r}(r.bufferSync(i),u),p=u.strideDepth,h=u.strideHeight,d=u.strideWidth,m=u.dilationDepth,g=u.dilationHeight,y=u.dilationWidth,v=u.effectiveFilterDepth,b=u.effectiveFilterHeight,x=u.effectiveFilterWidth,_=v-1-u.padInfo.front,w=x-1-u.padInfo.left,k=b-1-u.padInfo.top,D=To(i.shape,"float32"),T=r.bufferSync(a);for(let e=0;e<u.batchSize;++e)for(let t=0;t<u.inChannels;++t)for(let r=0;r<u.inDepth;++r)for(let n=0;n<u.inHeight;++n)for(let a=0;a<u.inWidth;++a){const i=r-_,o=n-k,s=a-w;let l=0;for(let r=0;r<v;r+=m){const n=(i+r)/p;if(!(n<0||n>=u.outDepth||Math.floor(n)!==n))for(let a=0;a<b;a+=g){const i=(o+a)/h;if(!(i<0||i>=u.outHeight||Math.floor(i)!==i))for(let o=0;o<x;o+=y){const c=(s+o)/d;if(c<0||c>=u.outWidth||Math.floor(c)!==c)continue;const p=v*b*x-1-f.get(e,n,i,c,t)===r*b*x+a*x+o?1:0;0!==p&&(l+=T.get(e,n,i,c,t)*p)}}}D.set(l,e,r,n,a,t)}return r.makeTensorInfo(D.shape,D.dtype,D.values)}},KE={kernelName:Cr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,input:i,output:o}=t,s=i;JT([i,o],"maxPoolGrad");const{filterSize:l,strides:c,pad:u,dimRoundingMode:f}=n,p=Zl(s.shape,l,c,1,u,f),h=r.data.get(s.dataId).values,d=To(p.outShape,s.dtype,pS(h,s.shape,s.dtype,p).values),m=p.strideHeight,g=p.strideWidth,y=p.dilationHeight,v=p.dilationWidth,b=p.effectiveFilterHeight,x=p.effectiveFilterWidth,_=x-1-p.padInfo.left,w=b-1-p.padInfo.top,k=To(s.shape,"float32"),D=r.data.get(a.dataId).values,T=To(a.shape,"float32",D);for(let e=0;e<p.batchSize;++e)for(let t=0;t<p.inChannels;++t)for(let r=0;r<p.inHeight;++r)for(let n=0;n<p.inWidth;++n){const a=r-w,i=n-_;let o=0;for(let r=0;r<b;r+=y){const n=(a+r)/m;if(!(n<0||n>=p.outHeight||Math.floor(n)!==n))for(let a=0;a<x;a+=v){const s=(i+a)/g;if(s<0||s>=p.outWidth||Math.floor(s)!==s)continue;const l=b*x-1-d.get(e,n,s,t)===r*x+a?1:0;0!==l&&(o+=T.get(e,n,s,t)*l)}}k.set(o,e,r,n,t)}return r.makeTensorInfo(k.shape,k.dtype,k.values)}},JE={kernelName:Ir,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:r})=>{const{x:n}=e,{filterSize:a,strides:i,pad:o,includeBatchInIndex:s}=t,l=r;JT(n,"MaxPoolWithArgmax");const c=l.data.get(n.dataId).values,u=Zl(n.shape,a,i,[1,1],o),[f,p]=function(e,t,r,n,a){const i=fS(e,0,r,Ie(t),a,"max"),o=pS(e,t,r,a,!0,n);return[i.values,o.values]}(c,n.shape,n.dtype,s,u),h=l.write(f,u.outShape,n.dtype),d=l.write(p,u.outShape,n.dtype);return[{dataId:h,shape:u.outShape,dtype:n.dtype},{dataId:d,shape:u.outShape,dtype:"int32"}]}},QE={kernelName:Pr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,keepDims:o}=n,s=ye(i,a.shape),l=se(Su(a.shape,s)[1]),c=[],u=r.makeTensorInfo([],"float32",new Float32Array([l]));c.push(u);const f=SA({inputs:{x:a},backend:r,attrs:{dtype:"float32"}});c.push(f);const p=RM({inputs:{a:f,b:u},backend:r});c.push(p);const h=fM({inputs:{x:p},backend:r,attrs:{axis:i,keepDims:o}});return c.forEach((e=>r.disposeIntermediateTensorInfo(e))),h}},eC={kernelName:Rr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,keepDims:o}=n;JT(a,"min");const s=ye(i,a.shape);let l=s;const c=Cu(l,a.shape.length);let u=a;null!=c&&(u=XA({inputs:{x:a},backend:r,attrs:{perm:c}}),l=Ou(l.length,a.shape.length)),Eu("min",l,u.shape.length);const[f,p]=Su(u.shape,l),h=se(p),d=Fe(se(f),u.dtype),m=r.data.get(u.dataId).values;for(let e=0;e<d.length;++e){const t=e*h;let r=m[t];for(let e=0;e<h;++e){const n=m[t+e];(Number.isNaN(n)||n<r)&&(r=n)}d[e]=r}null!=c&&r.disposeIntermediateTensorInfo(u);const g=r.makeTensorInfo(f,u.dtype,d);if(o){const e=RA({inputs:{x:g},backend:r,attrs:{shape:Mu(f,s)}});return r.disposeIntermediateTensorInfo(g),e}return g}},tC=cA(((e,t)=>Math.min(e,t))),rC=EA(Lr,tC),nC={kernelName:Lr,backendName:"cpu",kernelFunc:rC},aC={kernelName:Fr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{paddings:i,mode:o}=n;JT(a,"mirrorPad");const s=i.map(((e,t)=>e[0]+a.shape[t]+e[1])),l=i.map((e=>e[0])),c=i.map(((e,t)=>e[0]+a.shape[t])),u="reflect"===o?0:1,f=r.data.get(a.dataId).values,p=a.shape.length,h=Ie(a.shape),d=se(s),m=s.length,g=Ie(s),y=be(a.dtype,d);for(let e=0;e<d;e++){let t=Ue(e,m,g);for(let e=0;e<m;e++)t[e]<l[e]?t[e]=2*l[e]-t[e]-u:t[e]>=c[e]&&(t[e]=2*(c[e]-1)-t[e]+u);t=t.map(((e,t)=>e-l[t]));const r=je(t,p,h);y[e]=f[r]}return{dataId:r.write(y,s,a.dtype),shape:s,dtype:a.dtype}}},iC=cA(((e,t)=>{const r=e%t;return e<0&&t<0||e>=0&&t>=0?r:(r+t)%t})),oC=EA(Br,iC),sC={kernelName:Br,backendName:"cpu",kernelFunc:oC};var lC=r(26306);function cC(e){const{inputs:t,backend:r,attrs:n}=e,{logits:a}=t,{dim:i}=n,o=a.shape.length;let s=i;if(-1===s&&(s=o-1),s!==o-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${o} and dim was ${s}`);const l=ye([s],a.shape),c=VE({inputs:{x:a},backend:r,attrs:{reductionIndices:l,keepDims:!1}}),u=Mu(c.shape,l),f=RA({inputs:{x:c},backend:r,attrs:{shape:u}}),p=zM({inputs:{a,b:f},backend:r}),h=SM({inputs:{x:p},backend:r}),d=fM({inputs:{x:h},backend:r,attrs:{axis:l,keepDims:!1}}),m=RA({inputs:{x:d},backend:r,attrs:{shape:u}}),g=RM({inputs:{a:h,b:m},backend:r});return r.disposeIntermediateTensorInfo(c),r.disposeIntermediateTensorInfo(f),r.disposeIntermediateTensorInfo(p),r.disposeIntermediateTensorInfo(h),r.disposeIntermediateTensorInfo(d),r.disposeIntermediateTensorInfo(m),g}const uC={kernelName:Sn,backendName:"cpu",kernelFunc:cC},fC={kernelName:zr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{logits:a}=t,{numSamples:i,seed:o,normalized:s}=n;JT(a,"multinomial");const l=s?a:cC({inputs:{logits:a},backend:r,attrs:{dim:-1}}),c=l.shape[0],u=l.shape[1],f=r.data.get(l.dataId).values,p=[c,i],h=Fe(se(p),"int32");for(let e=0;e<c;++e){const t=e*u,r=new Float32Array(u-1);r[0]=f[t];for(let e=1;e<r.length;++e)r[e]=r[e-1]+f[t+e];const n=lC.alea(o.toString()),a=e*i;for(let e=0;e<i;++e){const t=n();h[a+e]=r.length;for(let n=0;n<r.length;n++)if(t<r[n]){h[a+e]=n;break}}}return s||r.disposeIntermediateTensorInfo(l),r.makeTensorInfo(p,"int32",h)}};function pC(e,t,r){const n=Ea(-1,r);return sM([],t,n,e,r)}const hC={kernelName:Ur,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{x:n}=t;JT(n,"neg");const a=r.data.get(n.dataId).values,[i,o]=pC(a,n.shape,n.dtype);return r.makeTensorInfo(o,n.dtype,i)}},dC=Wp,mC={kernelName:Vr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{boxes:a,scores:i}=t,{maxOutputSize:o,iouThreshold:s,scoreThreshold:l}=n;JT(a,"NonMaxSuppression");const c=r.data.get(a.dataId).values,u=r.data.get(i.dataId).values,{selectedIndices:f}=dC(c,u,o,s,l);return r.makeTensorInfo([f.length],"int32",new Int32Array(f))}},gC=Hp,yC={kernelName:qr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{boxes:a,scores:i}=t,{maxOutputSize:o,iouThreshold:s,scoreThreshold:l,padToMaxOutputSize:c}=n;JT(a,"NonMaxSuppressionPadded");const u=r.data.get(a.dataId).values,f=r.data.get(i.dataId).values,{selectedIndices:p,validOutputs:h}=gC(u,f,o,s,l,c);return[r.makeTensorInfo([p.length],"int32",new Int32Array(p)),r.makeTensorInfo([],"int32",new Int32Array([h]))]}},vC=Gp,bC={kernelName:Wr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{boxes:a,scores:i}=t,{maxOutputSize:o,iouThreshold:s,scoreThreshold:l,softNmsSigma:c}=n;JT(a,"NonMaxSuppressionWithScore");const u=r.data.get(a.dataId).values,f=r.data.get(i.dataId).values,p=o,h=s,d=l,m=c,{selectedIndices:g,selectedScores:y}=vC(u,f,p,h,d,m);return[r.makeTensorInfo([g.length],"int32",new Int32Array(g)),r.makeTensorInfo([y.length],"float32",new Float32Array(y))]}},xC=cA(((e,t)=>e!==t?1:0)),_C=EA($r,xC,null,"bool"),wC={kernelName:$r,backendName:"cpu",kernelFunc:_C},kC={kernelName:Gr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{indices:a}=t,{depth:i,onValue:o,offValue:s}=n;JT(a,"oneHot");const l=se(a.shape),c=new Float32Array(l*i);c.fill(s);const u=r.data.get(a.dataId).values;for(let e=0;e<l;++e)u[e]>=0&&u[e]<i&&(c[e*i+u[e]]=o);return r.makeTensorInfo([...a.shape,i],"int32",c)}};function DC(e){const{inputs:t,backend:r}=e,{x:n}=t;if("string"===n.dtype)throw new Error("zerosLike is not supported for string tensors");if("complex64"===n.dtype){const e=TA({inputs:{input:n},backend:r}),t=DC({inputs:{x:e},backend:r}),a=PS({inputs:{input:n},backend:r}),i=DC({inputs:{x:a},backend:r}),o=wA({inputs:{real:t,imag:i},backend:r});return r.disposeIntermediateTensorInfo(e),r.disposeIntermediateTensorInfo(t),r.disposeIntermediateTensorInfo(a),r.disposeIntermediateTensorInfo(i),o}return WM({backend:r,attrs:{shape:n.shape,value:0,dtype:n.dtype}})}const TC={kernelName:Yn,backendName:"cpu",kernelFunc:DC},AC={kernelName:Hr,backendName:"cpu",kernelFunc:function e(t){const{inputs:r,backend:n}=t,{x:a}=r;if("string"===a.dtype)throw new Error("onesLike is not supported for string tensors");if("complex64"===a.dtype){const t=TA({inputs:{input:a},backend:n}),r=e({inputs:{x:t},backend:n}),i=PS({inputs:{input:a},backend:n}),o=DC({inputs:{x:i},backend:n}),s=wA({inputs:{real:r,imag:o},backend:n});return n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),s}return WM({backend:n,attrs:{shape:a.shape,value:1,dtype:a.dtype}})}};function SC(e){const{inputs:t,backend:r,attrs:n}=e,{axis:a}=n;if(1===t.length)return EM({inputs:{input:t[0]},backend:r,attrs:{dim:a}});const i=t[0].shape,o=t[0].dtype;t.forEach((e=>{ae(i,e.shape,"All tensors passed to stack must have matching shapes"),ne(o===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const s=[],l=LS({inputs:t.map((e=>{const t=EM({inputs:{input:e},backend:r,attrs:{dim:a}});return s.push(t),t})),backend:r,attrs:{axis:a}});return s.forEach((e=>r.disposeIntermediateTensorInfo(e))),l}const MC={kernelName:Xr,backendName:"cpu",kernelFunc:SC},EC={kernelName:Yr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{paddings:i,constantValue:o}=n;JT(a,"pad");const s=i.map(((e,t)=>e[0]+a.shape[t]+e[1])),l=i.map((e=>e[0])),c=r.data.get(a.dataId).values,u=se(a.shape),f=a.shape.length,p=Ie(a.shape),h=se(s),d=s.length,m=Ie(s),g=be(a.dtype,h);0!==o&&g.fill(o);for(let e=0;e<u;e++)g[je(Ue(e,f,p).map(((e,t)=>e+l[t])),d,m)]=c[e];return{dataId:r.write(g,s,a.dtype),shape:s,dtype:a.dtype}}},CC=cA(((e,t)=>Math.pow(e,t))),NC=EA(Kr,CC),OC={kernelName:Kr,backendName:"cpu",kernelFunc:NC};function IC(e,t,r,n){const[a,i]=Su(e,n),o=ri(t,"int32"),s=Fe(se(a),o),l=se(i);for(let e=0;e<s.length;++e){const t=e*l;let n=1;for(let e=0;e<l;++e)n*=r[t+e];s[e]=n}return{outVals:s,outShape:a,outDtype:o}}const PC={kernelName:Qr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,keepDims:o}=n;JT(a,"prod");const s=a.shape.length,l=ye(i,a.shape),c=Cu(l,s);let u=l,f=a;const p=[];null!=c&&(f=XA({inputs:{x:a},backend:r,attrs:{perm:c}}),p.push(f),u=Ou(u.length,s));const h=r.data.get(f.dataId).values,{outVals:d,outShape:m,outDtype:g}=IC(f.shape,f.dtype,h,u);let y=m;return o&&(y=Mu(m,l)),p.forEach((e=>r.disposeIntermediateTensorInfo(e))),r.makeTensorInfo(y,g,d)}};function RC(e,t,r,n){if(e===t||e<t&&r<0||t<e&&r>1)return Fe(0,n);const a=Fe(Math.abs(Math.ceil((t-e)/r)),n);t<e&&1===r&&(r=-1),a[0]=e;for(let e=1;e<a.length;e++)a[e]=a[e-1]+r;return a}const LC={kernelName:en,backendName:"cpu",kernelFunc:function(e){const{backend:t,attrs:r}=e,{start:n,stop:a,dtype:i,step:o}=r,s=RC(n,a,o,i);return t.makeTensorInfo([s.length],i,s)}},FC=tA(rn,(e=>1/e)),BC={kernelName:rn,backendName:"cpu",kernelFunc:FC},zC={kernelName:ln,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{images:a}=t,{alignCorners:i,halfPixelCenters:o,size:s}=n;JT(a,"resizeBilinear");const l=Ie(a.shape),[c,u]=s,[f,p,h,d]=a.shape,m=r.data.get(a.dataId).values,g=new Float32Array(se([f,c,u,d])),y=[i&&c>1?p-1:p,i&&u>1?h-1:h],v=[i&&c>1?c-1:c,i&&u>1?u-1:u];let b=0;const x=y[0]/v[0],_=y[1]/v[1];for(let e=0;e<f;e++)for(let t=0;t<c;t++){let r;r=o?x*(t+.5)-.5:x*t;const n=Math.max(0,Math.floor(r)),a=r-n,i=Math.min(p-1,Math.ceil(r)),s=e*l[0]+n*l[1],c=e*l[0]+i*l[1];for(let e=0;e<u;e++){let t;t=o?_*(e+.5)-.5:_*e;const r=Math.max(0,Math.floor(t)),n=t-r,i=Math.min(h-1,Math.ceil(t)),u=s+r*l[2],f=c+r*l[2],p=s+i*l[2],y=c+i*l[2];for(let e=0;e<d;e++){const t=m[u+e],r=m[f+e],i=t+(m[p+e]-t)*n,o=i+(r+(m[y+e]-r)*n-i)*a;g[b++]=o}}}return r.makeTensorInfo([f,c,u,d],"float32",g)}},jC={kernelName:cn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{images:a,dy:i}=t,{alignCorners:o}=n;JT([i,a],"resizeBilinearGrad");const s=Ie(a.shape),[l,c,u,f]=a.shape,[,p,h]=i.shape,d=new Float32Array(l*c*u*f),m=[o&&p>1?c-1:c,o&&h>1?u-1:u],g=[o&&p>1?p-1:p,o&&h>1?h-1:h],y=m[0]/g[0],v=m[1]/g[1],b=r.data.get(i.dataId).values;let x=0;for(let e=0;e<l;e++){const t=e*s[0];for(let e=0;e<p;e++){const r=e*y,n=Math.floor(r),a=Math.min(Math.ceil(r),c-1),i=t+n*s[1],o=t+a*s[1],l=r-n,p=1-l;for(let e=0;e<h;e++){const t=e*v,r=Math.floor(t),n=Math.min(Math.ceil(t),u-1),a=t-r,c=1-a,h=i+r*s[2],m=i+n*s[2],g=o+r*s[2],y=o+n*s[2],_=p*c,w=p*a,k=l*c,D=l*a;for(let e=0;e<f;e++){const t=b[x++];d[h+e]+=t*_,d[m+e]+=t*w,d[g+e]+=t*k,d[y+e]+=t*D}}}}return r.makeTensorInfo([l,u,c,f],"float32",d)}},UC={kernelName:on,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{images:a}=t,{alignCorners:i,halfPixelCenters:o,size:s}=n;JT(a,"resizeNearestNeighbor");const l=Ie(a.shape),[c,u]=s,[f,p,h,d]=a.shape,m=r.data.get(a.dataId).values,g=new Float32Array(f*c*u*d),y=[i&&c>1?p-1:p,i&&u>1?h-1:h],v=[i&&c>1?c-1:c,i&&u>1?u-1:u],b=y[0]/v[0],x=y[1]/v[1];let _=0;for(let e=0;e<f;e++){const t=e*l[0];for(let e=0;e<c;e++){const r=o?b*(e+.5):b*e;let n=Math.min(p-1,i?Math.round(r):Math.floor(r));o&&(n=Math.max(0,n));const a=t+n*l[1];for(let e=0;e<u;e++){const t=o?x*(e+.5):x*e;let r=Math.min(h-1,i?Math.round(t):Math.floor(t));o&&(r=Math.max(0,r));const n=a+r*l[2];for(let e=0;e<d;e++){const t=m[n+e];g[_++]=t}}}}return r.makeTensorInfo([f,c,u,d],a.dtype,g)}},$C={kernelName:sn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{images:a,dy:i}=t,{alignCorners:o}=n;JT([i,a],"resizeNearestNeighborGrad");const s=Ie(a.shape),l=Ie(i.shape),[c,u,f,p]=a.shape,[,h,d]=i.shape,m=new Float32Array(c*u*f*p),g=r.data.get(i.dataId).values,y=[o&&h>1?u-1:u,o&&d>1?f-1:f],v=[o&&h>1?h-1:h,o&&d>1?d-1:d],b=y[0]/v[0],x=y[1]/v[1],_=1/b,w=1/x,k=2*Math.ceil(_)+2,D=2*Math.ceil(w)+2;for(let e=0;e<c;e++){const t=e*s[0];for(let e=0;e<u;e++){const r=t+e*s[1],n=Math.floor(e*_),a=Math.floor(n-k/2);for(let n=0;n<f;n++){const i=r+n*s[2],c=Math.floor(n*w),y=Math.floor(c-D/2);for(let r=0;r<p;r++){let s=0;for(let i=0;i<k;i++){const c=i+a;if(c<0||c>=h)continue;const p=t+c*l[1],m=c*b;if(e===Math.min(u-1,o?Math.round(m):Math.floor(m)))for(let e=0;e<D;e++){const t=e+y;if(t<0||t>=d)continue;const a=p+t*l[2],i=t*x;n===Math.min(f-1,o?Math.round(i):Math.floor(i))&&(s+=g[a+r])}}m[i+r]=s}}}}return r.makeTensorInfo(a.shape,a.dtype,m)}},VC={kernelName:fn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{dims:i}=n;JT(a,"reverse");const o=a.shape.length,s=ye(i,a.shape);if(0===o)return iA({inputs:{x:a},backend:r});const l=new Va(a.shape,a.dtype),c=r.bufferSync(a);for(let e=0;e<l.size;e++){const t=l.indexToLoc(e),r=t.slice();s.forEach((e=>r[e]=a.shape[e]-1-r[e])),l.set(c.get(...r),...t)}return r.makeTensorInfo(l.shape,l.dtype,l.values)}},qC={kernelName:Jn,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:r})=>{const{image:n}=e,{radians:a,fillValue:i,center:o}=t,s=r,l=be(n.dtype,se(n.shape)),[c,u,f,p]=n.shape,[h,d]=zh(o,u,f),m=Math.sin(a),g=Math.cos(a),y=s.data.get(n.dataId).values;for(let e=0;e<c;e++){const t=e*f*u*p;for(let e=0;e<u;e++){const r=e*(f*p);for(let n=0;n<f;n++){const a=n*p;for(let o=0;o<p;o++){const s=[c,e,n,o],v=s[2],b=s[1];let x=(v-h)*g-(b-d)*m,_=(v-h)*m+(b-d)*g;x=Math.round(x+h),_=Math.round(_+d);let w=i;"number"!=typeof i&&(w=3===o?255:i[o]),x>=0&&x<f&&_>=0&&_<u&&(w=y[t+_*(f*p)+x*p+o]),l[t+r+a+o]=w}}}}return{dataId:s.write(l,n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}},WC=tA(pn,(e=>{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1})),HC={kernelName:pn,backendName:"cpu",kernelFunc:WC},GC=yA((e=>1/Math.sqrt(e))),XC=rA(hn,GC),YC={kernelName:hn,backendName:"cpu",kernelFunc:XC};function ZC(e,t,r,n,a,i,o,s,l,c){const u=[n/a,a],f=e.values,p=t.values;if(0===n)return To(r,t.dtype);const h=To(u,t.dtype);h.values.fill(l);for(let e=0;e<i;e++){const i=[];let l=0;for(let t=0;t<o;t++){const r=f[e*o+t];i.push(r),l+=r*s[t]}if(l<0||l>=n/a)throw new Error(`Invalid indices: ${i} does not index into ${r}`);for(let r=0;r<a;r++)c?h.values[l*a+r]+=p[e*a+r]:h.values[l*a+r]=0===t.rank?p[0]:p[e*a+r]}return h}const KC={kernelName:dn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{indices:a,updates:i}=t,{shape:o}=n,{sliceRank:s,numUpdates:l,sliceSize:c,strides:u,outputSize:f}=ls(0,a,o),p=ZC(r.bufferSync(a),r.bufferSync(i),o,f,c,l,s,u,0,!0);return r.makeTensorInfo(o,p.dtype,p.values)}},JC={kernelName:mn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{condition:n,t:a,e:i}=t;JT([n,a,i],"select");const o=n.shape.length,s=r.data.get(n.dataId).values,l=r.data.get(a.dataId).values,c=r.data.get(i.dataId).values,u=ri(a.dtype,i.dtype),f=Fe(se(a.shape),u);let p=0;const h=0===o||o>1||1===a.shape.length?1:se(a.shape.slice(1));for(let e=0;e<s.length;e++)for(let t=0;t<h;t++)1===s[e]?f[p++]=l[e]:f[p++]=c[e];return r.makeTensorInfo(a.shape,u,f)}},QC=Wh,eN=Hh,tN=tA(gn,(e=>e>=0?eN*e:QC*(Math.exp(e)-1))),rN={kernelName:gn,backendName:"cpu",kernelFunc:tN},nN=tA(xn,(e=>e<0?-1:e>0?1:0)),aN={kernelName:xn,backendName:"cpu",kernelFunc:nN},iN=tA(vn,(e=>Math.sin(e))),oN={kernelName:vn,backendName:"cpu",kernelFunc:iN},sN=tA(bn,(e=>Math.sinh(e))),lN={kernelName:bn,backendName:"cpu",kernelFunc:sN},cN=Math.log(1.1920928955078125e-7)+2,uN=tA(wn,(e=>{const t=e>-cN,r=e<cN,n=Math.exp(e);let a;return a=r?n:t?e:Math.log(1+n),a})),fN={kernelName:wn,backendName:"cpu",kernelFunc:uN},pN={kernelName:Tn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{blockShape:i,paddings:o}=n;JT([a],"spaceToBatchND");const s=se(i),l=[[0,0]];l.push(...o);for(let e=1+i.length;e<a.shape.length;++e)l.push([0,0]);const c=EC.kernelFunc({inputs:{x:a},backend:r,attrs:{paddings:l,constantValue:0}}),u=jh(c.shape,i,s,!1),f=Uh(u.length,i.length,!1),p=$h(c.shape,i,s,!1),h=RA({inputs:{x:c},backend:r,attrs:{shape:u}}),d=XA({inputs:{x:h},backend:r,attrs:{perm:f}}),m=RA({inputs:{x:d},backend:r,attrs:{shape:p}});return r.disposeIntermediateTensorInfo(c),r.disposeIntermediateTensorInfo(h),r.disposeIntermediateTensorInfo(d),m}};function hN(e,t,r,n,a,i,o){const s=t[0],l=i[0],c=new Array(l),u=new Array(s),f=t[1];if(0===l){if(0!==s)throw new Error(md(s));return[xe(r,0),[0,f],xe(a,0),c,u]}let p=!0,h=0;const d=new Array(l).fill(0);for(let t=0;t<s;++t){const r=e[t*f];if(r<0)throw new Error(gd(t,r));if(r>=l)throw new Error(yd(t,r,l));++d[r],p=p&&r>=h,h=r}let m=!0;for(let e=0;e<l;++e){const t=0===d[e];c[e]=t,m=m&&!t,d[e]=Math.max(d[e],1),e>0&&(d[e]+=d[e-1])}if(m&&p){const t=e,r=n;for(let e=0;e<s;++e)u[e]=e;return[t,[s,f],r,c,u]}{const t=d[l-1],i=xe(r,t*f),p=xe(a,t),h=new Array(l).fill(0);for(let t=0;t<s;++t){const r=e[t*f],a=h[r],o=(0===r?0:d[r-1])+a;h[r]++;for(let r=0;r<f;++r)i[o*f+r]=e[t*f+r];p[o]=n[t],u[t]=o}for(let e=0;e<l;++e)if(0===h[e]){const t=0===e?0:d[e-1];i[t*f+0]=e;for(let e=1;e<f;++e)i[t*f+e]=0;p[t]=o}return[i,[t,f],p,c,u]}}const dN={kernelName:Mn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{indices:n,values:a,denseShape:i,defaultValue:o}=t;if(1!==i.shape.length)throw new Error(`Dense shape must be a vector, saw:\n        ${i.shape}`);if(2!==n.shape.length)throw new Error(`Indices must be a matrix, saw:\n        ${n.shape}`);if(1!==a.shape.length)throw new Error(`Values must be a vector, saw:\n        ${a.shape}`);if(0!==o.shape.length)throw new Error(`Default value must be a scalar, saw:\n        ${o.shape}`);const s=r.data.get(n.dataId).values,l=r.data.get(a.dataId).values,c=r.data.get(i.dataId).values,u=r.data.get(o.dataId).values[0],[f,p,h,d,m]=hN(s,n.shape,n.dtype,l,a.dtype,c,u);return[r.makeTensorInfo(p,n.dtype,f),r.makeTensorInfo([p[0]],a.dtype,h),r.makeTensorInfo([d.length],"bool",new Uint8Array(d.map((e=>Number(e))))),r.makeTensorInfo([m.length],n.dtype,new Int32Array(m))]}};function mN(e,t,r,n,a){const i=se(n),o=t[0],s=a.length,l=[];let c=1,u=-1;for(let e=0;e<s;++e){const t=a[e];if(-1===t){if(-1!==u)throw new Error(vd(u,e));u=e,l.push(1)}else{if(t<0)throw new Error(bd(e,t));c*=t,l.push(t)}}if(-1!==u){if(c<=0)throw new Error("reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero");const e=Math.trunc(i/c);if(c*e!==i)throw new Error(_d(n,l));l[u]=e}if(se(l)!==i)throw new Error(wd(n,l));const f=n.length,p=[];if(f>0){p[f-1]=1;for(let e=f-2;e>=0;--e)p[e]=p[e+1]*n[e+1]}const h=[];if(s>0){h[s-1]=1;for(let e=s-2;e>=0;--e)h[e]=h[e+1]*l[e+1]}const d=xe(r,o*s);for(let t=0;t<o;++t){let r=0;for(let n=0;n<f;++n)r+=e[t*f+n]*p[n];for(let e=0;e<s;++e)d[t*s+e]=Math.trunc(r/h[e]),r%=h[e]}return[d,[o,s],l]}const gN={kernelName:En,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{inputIndices:n,inputShape:a,newShape:i}=t;if(2!==n.shape.length)throw new Error(`Input indices should be a matrix but received shape\n        ${n.shape}`);if(1!==a.shape.length)throw new Error(`Input shape should be a vector but received shape\n        ${a.shape}`);if(1!==i.shape.length)throw new Error(`Target shape should be a vector but received shape ${i.shape}`);const o=Array.from(r.data.get(a.dataId).values),s=r.data.get(n.dataId).values,l=Array.from(r.data.get(i.dataId).values),[c,u,f]=mN(s,n.shape,n.dtype,o,l);return[r.makeTensorInfo(u,n.dtype,c),r.makeTensorInfo([f.length],i.dtype,new Int32Array(f))]}};function yN(e,t,r,n,a,i=!1,o=0){const s=n.length,l=[t[0],e.length/t[0]],c=l[1],u=s>0?a[s-1]+1:0;if(u<0)throw new Error("segment ids must be >= 0");const f=t.slice();f[0]=u;const p=xe(r,f.reduce(((e,t)=>e*t),1));if(0===s)return u>0&&p.fill(o),[p,f];if(u<=0)throw new Error("segment ids must be >= 0");let h=0,d=1,m=0,g=a[h];for(;;){let t=0;if(d<s){if(t=a[d],g===t){++d;continue}if(g>=t)throw new Error("segment ids are not increasing")}if(g<0||g>=u)throw new Error(Td(g,u));g>m&&p.fill(o,m*c,g*c);for(let t=h;t<d;++t){const r=n[t];if(r<0||r>=l[0])throw new Error(Ad(t,n[t],l[0]));for(let t=0;t<c;t++)p[g*c+t]+=e[r*c+t]}if(i)for(let e=0;e<c;e++)p[g*c+e]/=d-h;if(h=d,++d,m=g+1,g=t,d>s)break}return m<u&&p.fill(o,m*c,u*c),[p,f]}const vN={kernelName:Cn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{data:n,indices:a,segmentIds:i}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.shape.length)throw new Error(`Indices should be a vector but received shape\n          ${a.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n          ${i.shape}`);if(a.shape[0]!==i.shape[0])throw new Error("segmentIds and indices should have same size.");const o=r.data.get(n.dataId).values,s=r.data.get(a.dataId).values,l=r.data.get(i.dataId).values,[c,u]=yN(o,n.shape,n.dtype,s,l,!0);return r.makeTensorInfo(u,n.dtype,c)}},bN={kernelName:Nn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r}=e,{data:n,indices:a,segmentIds:i}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.shape.length)throw new Error(`Indices should be a vector but received shape\n         ${a.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n         ${i.shape}`);if(a.shape[0]!==i.shape[0])throw new Error("segmentIds and indices should have same size.");const o=r.data.get(n.dataId).values,s=r.data.get(a.dataId).values,l=r.data.get(i.dataId).values,[c,u]=yN(o,n.shape,n.dtype,s,l);return r.makeTensorInfo(u,n.dtype,c)}},xN={kernelName:On,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{sparseIndices:a,sparseValues:i,defaultValue:o}=t,{outputShape:s}=n,{sliceRank:l,numUpdates:c,sliceSize:u,strides:f,outputSize:p}=ls(0,a,s),h=ZC(r.bufferSync(a),r.bufferSync(i),s,p,u,c,l,f,r.data.get(o.dataId).values[0],!1);return r.makeTensorInfo(s,h.dtype,h.values)}},_N={kernelName:An,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{numOrSizeSplits:i,axis:o}=n,s=ye(o,a.shape)[0],l=dd(a,i,s),c=new Array(a.shape.length).fill(0),u=a.shape.slice();return l.map((e=>{const t=[...u];t[s]=e;const n=xS({inputs:{x:a},backend:r,attrs:{begin:c,size:t}});return c[s]+=e,n}))}},wN=yA((e=>Math.sqrt(e))),kN=tA(kn,(e=>Math.sqrt(e))),DN={kernelName:kn,backendName:"cpu",kernelFunc:kN},TN={kernelName:Pn,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:r}=e,n=t;JT(r,"square");const a=n.data.get(r.dataId).values,i=new Float32Array(a.length);for(let e=0;e<a.length;++e){const t=a[e];i[e]=t*t}return{dataId:n.write(i,r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},AN=cA(((e,t)=>{const r=e-t;return r*r})),SN=EA(In,AN),MN={kernelName:In,backendName:"cpu",kernelFunc:SN},EN=tA(Zn,((e,t)=>{const r=t;return isNaN(e)?NaN:e>0?1:r.alpha})),CN={kernelName:Zn,backendName:"cpu",kernelFunc:EN};function NN(e,t,r,n){const a=To(e,t.dtype);for(let e=0;e<a.size;e++){const i=a.indexToLoc(e),o=new Array(i.length);for(let e=0;e<o.length;e++)o[e]=i[e]*r[e]+n[e];a.set(t.get(...o),...i)}return a}const ON={kernelName:Rn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{begin:i,end:o,strides:s,beginMask:l,endMask:c,ellipsisMask:u,newAxisMask:f,shrinkAxisMask:p}=n;JT(a,"stridedSlice");const{finalShapeSparse:h,finalShape:d,isIdentity:m,sliceDim0:g,isSimpleSlice:y,begin:v,end:b,strides:x}=Ds(a.shape,i,o,s,l,c,u,f,p);let _;if(m)_=RA({inputs:{x:a},backend:r,attrs:{shape:d}});else if(g||y){ne(a.shape.length>=1,(()=>`Input must have rank at least 1, got: ${a.shape.length}`));const e=fs(v,b,x),t=xS({inputs:{x:a},backend:r,attrs:{begin:v,size:e}});_=RA({inputs:{x:t},backend:r,attrs:{shape:d}}),r.disposeIntermediateTensorInfo(t)}else{const e=NN(h,r.bufferSync(a),x,v);_=r.makeTensorInfo(d,e.dtype,e.values)}return _}};class IN{constructor(e,t,r,n,a,i){this.separator=Ia(e),this.nGramWidths=t,this.leftPad=Ia(r),this.rightPad=Ia(n),this.padWidth=a,this.preserveShort=i}getPadWidth(e){return Math.min(this.padWidth<0?e-1:this.padWidth,e-1)}getNumNGrams(e,t){const r=this.getPadWidth(t);return Math.max(0,e+2*r-t+1)}createNGrams(e,t,r,n,a,i){for(let o=0;o<a;++o){const s=this.getPadWidth(i),l=Math.max(0,s-o),c=Math.max(0,s-(a-(o+1))),u=i-(l+c),f=t+(l>0?0:o-s);let p=0;p+=l*this.leftPad.length;for(let t=0;t<u;++t)p+=e[f+t].length;p+=c*this.rightPad.length,p+=(l+c+u-1)*this.separator.length,r[n+o]=new Uint8Array(p);const h=r[n+o];let d=0;const m=e=>e.forEach((e=>h[d++]=e));for(let e=0;e<l;++e)m(this.leftPad),m(this.separator);for(let t=0;t<u-1;++t)m(e[f+t]),m(this.separator);if(u>0){m(e[f+u-1]);for(let e=0;e<c;++e)m(this.separator),m(this.rightPad)}else{for(let e=0;e<c-1;++e)m(this.rightPad),m(this.separator);m(this.rightPad)}}}compute(e,t){const r=e.length,n=t.length;if(n>0){let e=t[0];if(0!==e)throw new Error(`First split value must be 0, got ${e}`);for(let a=1;a<n;++a){let n=t[a]>=e;if(n=n&&t[a]<=r,!n)throw new Error(`Invalid split value ${t[a]}, must be in [${e}, ${r}]`);e=t[a]}if(e!==r)throw new Error(`Last split value must be data size. Expected ${r}, got ${e}`)}const a=n-1,i=xe("int32",n);if(0===r||0===n){const e=new Array(r);for(let e=0;e<=a;++e)i[e]=0;return[e,i]}i[0]=0;for(let e=1;e<=a;++e){const r=t[e]-t[e-1];let n=0;this.nGramWidths.forEach((e=>{n+=this.getNumNGrams(r,e)})),this.preserveShort&&r>0&&0===n&&(n=1),i[e]=i[e-1]+n}const o=new Array(i[a]);for(let r=0;r<a;++r){const n=t[r];let a=i[r];if(this.nGramWidths.forEach((i=>{const s=t[r+1]-t[r],l=this.getNumNGrams(s,i);this.createNGrams(e,n,o,a,l,i),a+=l})),this.preserveShort&&a===i[r]){const i=t[r+1]-t[r];if(0===i)continue;const s=i+2*this.padWidth,l=1;this.createNGrams(e,n,o,a,l,s)}}return[o,i]}}function PN(e,t,r,n,a,i,o,s){return new IN(r,n,a,i,o,s).compute(e,t)}const RN={kernelName:Ln,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{separator:a,nGramWidths:i,leftPad:o,rightPad:s,padWidth:l,preserveShortSequences:c}=n,{data:u,dataSplits:f}=t,p=r.data.get(u.dataId).values,h=r.data.get(f.dataId).values,[d,m]=PN(p,h,a,i,o,s,l,c);return[r.makeTensorInfo([d.length],"string",d),r.makeTensorInfo(f.shape,"int32",m)]}};function LN(e,t,r,n){if(!e.length)return;if(0===t.length){for(let t=0;t<e.length;++t)n.push(e.subarray(t,t+1));return}if(1===t.length){const a=t[0];let i=e.indexOf(a);for(;-1!==i;){const t=e.subarray(0,i);r&&0===t.length||n.push(t),i=(e=e.subarray(i+1)).indexOf(a)}return void(r&&0===e.length||n.push(e))}let a=0;for(let i=0;i<e.length+1;i++)if(i===e.length||-1!==t.indexOf(e[i])){const t=e.subarray(a,i);r&&0===t.length||n.push(t),a=i+1}}function FN(e,t,r){const n=e.length,a=[];let i=0,o=0;const s=new Array(n);for(let l=0;l<n;++l){const n=a.length;LN(e[l],t,r,a);const c=a.length-n;s[l]=c,i+=c,o=Math.max(o,c)}const l=xe("int32",2*i),c=new Array(i),u=[n,o];let f=0;for(let e=0;e<n;++e)for(let t=0;t<s[e];++t)l[2*f]=e,l[2*f+1]=t,c[f]=a[f],++f;return[l,c,u]}const BN={kernelName:Fn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{skipEmpty:a}=n,{input:i,delimiter:o}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(1!==i.shape.length)throw new Error(`Input must be a vector, got shape: ${i.shape}`);if(0!==o.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${o.shape}`);const s=r.data.get(i.dataId).values,l=r.data.get(o.dataId).values[0],[c,u,f]=FN(s,l,a),p=u.length;return[r.makeTensorInfo([p,2],"int32",c),r.makeTensorInfo([p],"string",u),r.makeTensorInfo([2],"int32",new Int32Array(f))]}};function zN(e,t){const r=xe("int32",e.length);for(let n=0;n<e.length;++n)r[n]=Ma(e[n]).modulo(t).getLowBitsUnsigned();return r}const jN={kernelName:Bn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{numBuckets:a}=n,{input:i}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(a<=0)throw new Error("Number of buckets must be at least 1");const o=zN(r.data.get(i.dataId).values,a);return r.makeTensorInfo(i.shape,"int32",o)}},UN=tA(jn,(e=>Math.tan(e))),$N={kernelName:jn,backendName:"cpu",kernelFunc:UN},VN=tA(Un,(e=>Math.tanh(e)));function qN(e,t){const r=new Array(e.rank);for(let n=0;n<r.length;n++)r[n]=e.shape[n]*t[n];const n=To(r,e.dtype);for(let t=0;t<n.values.length;++t){const r=n.indexToLoc(t),a=new Array(e.rank);for(let t=0;t<a.length;t++)a[t]=r[t]%e.shape[t];const i=e.locToIndex(a);n.values[t]=e.values[i]}return n}const WN={kernelName:$n,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{reps:i}=n;JT(a,"tile");const o=qN(r.bufferSync(a),i);return r.makeTensorInfo(o.shape,o.dtype,o.values)}},HN=(e,t)=>{const r=t.value-e.value;return 0===r?e.index-t.index:r};function GN(e,t,r=0,n=e.length-1){for(;n>r;){if(n-r>600){const a=n-r+1,i=t-r+1,o=Math.log(a),s=.5*Math.exp(2*o/3),l=.5*Math.sqrt(o*s*(a-s)/a)*Math.sign(i-a/2);GN(e,t,Math.max(r,Math.floor(t-i*s/a+l)),Math.min(n,Math.floor(t+(a-i)*s/a+l)))}const a=e[t];let i=r,o=n;for(Q(e,r,t),HN(e[n],a)>0&&Q(e,r,n);i<o;){for(Q(e,i,o),i++,o--;HN(e[i],a)<0;)i+=1;for(;HN(e[o],a)>0;)o-=1}0===HN(e[r],a)?Q(e,r,o):(o+=1,Q(e,o,n)),o<=t&&(r=o+1),t<=o&&(n=o-1)}}function XN(e,t,r,n,a){const i=t[t.length-1],[o,s]=[e.length/i,i],l=be(r,o*n),c=be("int32",o*n);for(let t=0;t<o;t++){const r=t*s,i=e.subarray(r,r+s);let o=new Array(i.length);i.forEach(((e,t)=>o[t]={value:e,index:t})),n<o.length&&(GN(o,n),o=o.slice(0,n)),a&&o.sort(HN);const u=t*n,f=l.subarray(u,u+n),p=c.subarray(u,u+n);for(let e=0;e<n;e++)f[e]=o[e].value,p[e]=o[e].index}const u=t.slice();return u[u.length-1]=n,[To(u,r,l),To(u,"int32",c)]}const YN={kernelName:Vn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{k:i,sorted:o}=n;JT(a,"topk");const s=r.data.get(a.dataId).values,[l,c]=XN(s,a.shape,a.dtype,i,o);return[r.makeTensorInfo(l.shape,l.dtype,l.values),r.makeTensorInfo(c.shape,c.dtype,c.values)]}},ZN={kernelName:qn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,attrs:r,backend:n}=e,{image:a,transforms:i}=t,{interpolation:o,fillMode:s,fillValue:l,outputShape:c}=r,[u,f,p,h]=a.shape,[d,m]=null!=c?c:[f,p],g=[u,d,m,h],y=Ie(a.shape),v=y[0],b=y[1],x=y[2],_=be(a.dtype,se(g));_.fill(l);const w=n.data.get(a.dataId).values,k=n.data.get(i.dataId).values;for(let e=0;e<u;++e){const t=1===i.shape[0]?k:k.subarray(8*e,8*e+8);for(let r=0;r<d;++r)for(let n=0;n<m;++n)for(let a=0;a<h;++a){let i;const c=t[6]*n+t[7]*r+1;if(0===c)continue;const u=(t[0]*n+t[1]*r+t[2])/c,h=(t[3]*n+t[4]*r+t[5])/c,d=KN(u,p,s),m=KN(h,f,s);switch(o){case"nearest":i=QN(w,f,p,v,b,x,e,m,d,a,l);break;case"bilinear":i=eO(w,f,p,v,b,x,e,m,d,a,l);break;default:throw new Error(`Error in Transform: Expect 'nearest' or 'bilinear', but got ${o}`)}_[e*v+r*b+n*x+a]=i}return n.makeTensorInfo(g,a.dtype,_)}return{dataId:n.write(_,g,a.dtype),shape:a.shape,dtype:a.dtype}}};function KN(e,t,r){switch(r){case"reflect":return function(e,t){let r=e;if(r<0)if(t<=1)r=0;else{const e=2*t;r<e&&(r=e*Math.trunc(-r/e)+r),r=r<-t?r+e:-r-1}else if(r>t-1)if(t<=1)r=0;else{const e=2*t;r-=e*Math.trunc(r/e),r>=t&&(r=e-r-1)}return K(0,r,t-1)}(e,t);case"wrap":return function(e,t){let r=e;if(r<0)if(t<=1)r=0;else{const e=t-1;r+=t*(Math.trunc(-r/e)+1)}else if(r>t-1)if(t<=1)r=0;else{const e=t-1;r-=t*Math.trunc(r/e)}return K(0,r,t-1)}(e,t);case"nearest":return function(e,t){return K(0,e,t-1)}(e,t);default:return function(e,t){return e}(e)}}function JN(e,t,r,n,a,i,o,s,l,c,u){return 0<=s&&s<t&&0<=l&&l<r?e[o*n+s*a+l*i+c]:u}function QN(e,t,r,n,a,i,o,s,l,c,u){return JN(e,t,r,n,a,i,o,Math.round(s),Math.round(l),c,u)}function eO(e,t,r,n,a,i,o,s,l,c,u){const f=Math.floor(s),p=Math.floor(l),h=f+1,d=p+1;return(h-s)*((d-l)*JN(e,t,r,n,a,i,o,f,p,c,u)+(l-p)*JN(e,t,r,n,a,i,o,f,d,c,u))+(s-f)*((d-l)*JN(e,t,r,n,a,i,o,h,p,c,u)+(l-p)*JN(e,t,r,n,a,i,o,h,d,c,u))}function tO(e,t,r,n){const a=ye(t,r)[0],i=[1,r[0],1];for(let e=0;e<a;e++)i[0]*=r[e];i[1]=r[a];for(let e=a+1;e<r.length;e++)i[2]*=r[e];const o={},s=new Int32Array(r[a]),l=new Va(i,n,e),c=[],u=1===i[0]&&1===i[2];for(let t=0;t<r[a];t++){let r;if(u)r=e[t].toString();else{const e=[];for(let r=0;r<i[0];r++)for(let n=0;n<i[2];n++)e.push(l.get(r,t,n));r=e.join(",")}if(void 0!==o[r])s[t]=o[r];else{const e=Object.keys(o).length;o[r]=e,s[t]=e,c.push(t)}}const f=i.slice();f[1]=Object.keys(o).length;const p=new Va(f,n);c.forEach(((e,t)=>{for(let r=0;r<i[0];r++)for(let n=0;n<i[2];n++)p.set(l.get(r,e,n),r,t,n)}));const h=r.slice();return h[a]=f[1],{outputValues:p.values,outputShape:h,indices:s}}const rO={kernelName:Hn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,attrs:r,backend:n}=e,{axis:a}=r,{x:i}=t;JT(i,"unique");const o=n.data.get(i.dataId).values,{outputValues:s,outputShape:l,indices:c}=tO(o,a,i.shape,i.dtype);return[n.makeTensorInfo(l,i.dtype,s),n.makeTensorInfo([c.length],"int32",c)]}},nO={kernelName:Gn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{value:a}=t;let{axis:i}=n;i<0&&(i+=a.shape.length);const o=a.shape.length,s=a.shape[i],l=new Array(o-1);let c=0;for(let e=0;e<o;e++)e!==i&&(l[c++]=a.shape[e]);const u=new Array(o).fill(0),f=a.shape.slice();f[i]=1;const p=new Array(s);for(let e=0;e<p.length;e++){u[i]=e;const t=xS({inputs:{x:a},backend:r,attrs:{begin:u,size:f}});p[e]=RA({inputs:{x:t},backend:r,attrs:{shape:l}}),r.disposeIntermediateTensorInfo(t)}return p}},aO={kernelName:Xn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,segmentIds:i}=t,{numSegments:o}=n;JT(a,"unsortedSegmentSum");const s=[],l=[],c=a.shape.length-i.shape.length;let u=i;for(let e=0;e<c;++e){const t=EM({inputs:{input:u},backend:r,attrs:{dim:e+1}});u=t,l.push(t)}for(let e=0;e<o;++e){const t=Ea(e,"int32"),n=r.makeTensorInfo([],"int32",t),i=gM({inputs:{a:n,b:u},backend:r}),o=SA({inputs:{x:i},backend:r,attrs:{dtype:"float32"}}),c=cM({inputs:{a:o,b:a},backend:r}),f=fM({inputs:{x:c},backend:r,attrs:{axis:0,keepDims:!1}});s.push(f),l.push(n),l.push(i),l.push(o),l.push(c),l.push(f)}const f=SC({inputs:s,backend:r,attrs:{axis:0}});return l.forEach((e=>r.disposeIntermediateTensorInfo(e))),f}},iO=[zA,UA,VA,WA,PA,HA,ZA,KA,JA,QA,tS,nS,iS,lS,uS,dS,mS,gS,yS,BA,vS,wS,TS,AS,MA,ES,NS,kA,OS,FS,zS,jS,US,$S,VS,qS,HS,XS,YS,ZS,KS,JS,eM,tM,rM,nM,aM,iM,oM,hM,aA,dM,yM,TM,MM,CM,IM,qM,HM,GM,ZM,QM,eE,tE,nE,iE,lE,fE,oA,pE,RS,dE,gE,vE,lA,_E,DE,AE,EE,NE,PE,LE,zE,jE,UE,qE,GE,XE,YE,ZE,KE,JE,QE,eC,nC,aC,sC,fC,uM,hC,mC,yC,bC,wC,kC,AC,MC,EC,OC,pA,PC,LC,AA,LM,BC,dA,gA,LA,zC,jC,UC,$C,VC,qC,HC,YC,KC,JC,rN,xA,aN,oN,lN,_S,uC,fN,pN,dN,gN,vN,bN,xN,_N,DN,TN,MN,CN,ON,RN,BN,jN,jM,pM,$N,{kernelName:Un,backendName:"cpu",kernelFunc:VN},WN,YN,ZN,YA,rO,nO,aO,TC];for(const e of iO)ca(e);const oO={},sO={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function lO(e,t){if(!(e in oO)){const r=function(e,t){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");const r=null==t?function(e){if("undefined"!=typeof OffscreenCanvas&&2===e)return new OffscreenCanvas(300,150);if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}(e):t;return r.addEventListener("webglcontextlost",(t=>{t.preventDefault(),delete oO[e]}),!1),1===e?r.getContext("webgl",sO)||r.getContext("experimental-webgl",sO):r.getContext("webgl2",sO)}(e,t);if(null===r)return console.log("Could not get context for WebGL version",e),null;oO[e]=r}const r=oO[e];return null==r||r.isContextLost()?(delete oO[e],lO(e)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),oO[e])}var cO,uO,fO;function pO(e,t){return[t,e]}function hO(e){const t=se(e);return pe(Math.ceil(t/4))}function dO(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function mO(e,t){const r=e;let n,a,i,o,s,l,c,u,f,p;return 2===We().getNumber("WEBGL_VERSION")?(n=r.R32F,a=r.R16F,i=r.RGBA16F,o=r.RGBA32F,s=r.RED,c=4,u=1,f=r.HALF_FLOAT,p=r.FLOAT,l=r.RGBA8):(n=e.RGBA,a=e.RGBA,i=e.RGBA,o=r.RGBA,s=e.RGBA,c=4,u=4,f=null!=t?t.HALF_FLOAT_OES:null,p=e.FLOAT,l=e.RGBA),{internalFormatFloat:n,internalFormatHalfFloat:a,internalFormatPackedHalfFloat:i,internalFormatPackedFloat:o,textureFormatFloat:s,downloadTextureFormat:l,downloadUnpackNumChannels:c,defaultNumChannels:u,textureTypeHalfFloat:f,textureTypeFloat:p}}function gO(e,t){const r=t();return We().getBool("DEBUG")&&function(e){const t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+function(e,t){switch(t){case e.NO_ERROR:return"NO_ERROR";case e.INVALID_ENUM:return"INVALID_ENUM";case e.INVALID_VALUE:return"INVALID_VALUE";case e.INVALID_OPERATION:return"INVALID_OPERATION";case e.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case e.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case e.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return`Unknown error code ${t}`}}(e,t))}(e),r}function yO(e){return!!(We().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||5.96e-8<Math.abs(e)&&Math.abs(e)<65504)}function vO(e,t){return AO(e,(()=>e.getExtension(t)),'Extension "'+t+'" not supported on this browser.')}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(cO||(cO={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(uO||(uO={})),function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(fO||(fO={}));const bO=/ERROR: [0-9]+:([0-9]+):/g;function xO(e,t){if(gO(e,(()=>e.validateProgram(t))),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function _O(e,t,r,n,a,i,o){const s=e.getAttribLocation(t,r);return-1!==s&&(gO(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),gO(e,(()=>e.vertexAttribPointer(s,a,e.FLOAT,!1,i,o))),gO(e,(()=>e.enableVertexAttribArray(s))),!0)}function wO(e,t,r,n){gO(e,(()=>function(e,t,r){(function(e,t){const r=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,n=t+e.TEXTURE0;if(n<e.TEXTURE0||n>r)throw new Error(`textureUnit must be in [gl.TEXTURE0, gl.TEXTURE${r}].`)})(e,r),gO(e,(()=>e.activeTexture(e.TEXTURE0+r))),gO(e,(()=>e.bindTexture(e.TEXTURE_2D,t)))}(e,t,n))),gO(e,(()=>e.uniform1i(r,n)))}function kO(e,t,r){gO(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,r))),gO(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)))}function DO(e,t){gO(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,t))),gO(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)))}function TO(e){const t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+function(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}(e,t))}function AO(e,t,r){const n=gO(e,(()=>t()));if(null==n)throw new Error(r);return n}function SO(e,t=2){return se(e.slice(0,e.length-t))}function MO(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function EO(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[SO(e),...MO(e)]),t}function CO(e){return e%2==0}function NO(e,t){if(ce(e=e.slice(-2),t=t.slice(-2)))return!0;if(!e.length||!t.length)return!0;if(0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){const r=e.slice(-1)[0],n=t.slice(-1)[0];if(r===n)return!0;if(CO(r)&&CO(n)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&CO(e[0])&&CO(t[0])}let OO,IO;function PO(e,t){return null!=e.getExtension(t)}function RO(e){try{if(null!=lO(e))return!0}catch(e){return console.log("Error when getting WebGL context: ",e),!1}return!1}function LO(e){const t=mO(e),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);const n=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);const a=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(r),e.deleteFramebuffer(n),a}function FO(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&ne("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the WebGL backend.`))}))}const BO=We();function zO(){let e,t,r,n,a,i,o,s,l,c;return 2===We().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",r="out",n="in",a="texture",i="outputColor",o="out vec4 outputColor;",s="\n      bool isnan_custom(float val) {\n        return (val > 0.0 || val < 0.0) ? false : val != 0.0;\n      }\n\n      bvec4 isnan_custom(vec4 val) {\n        return bvec4(isnan_custom(val.x),\n          isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n      }\n\n      #define isnan(value) isnan_custom(value)\n    ",l="",c="\n      #define round(value) newRound(value)\n      int newRound(float value) {\n        return int(floor(value + 0.5));\n      }\n\n      ivec4 newRound(vec4 value) {\n        return ivec4(floor(value + vec4(0.5)));\n      }\n    "):(e="",t="attribute",r="varying",n="varying",a="texture2D",i="gl_FragColor",o="",s="\n      #define isnan(value) isnan_custom(value)\n      bool isnan_custom(float val) {\n        return (val > 0. || val < 1. || val == 0.) ? false : true;\n      }\n      bvec4 isnan_custom(vec4 val) {\n        return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n      }\n    ",l="\n      uniform float INFINITY;\n\n      bool isinf(float val) {\n        return abs(val) == INFINITY;\n      }\n      bvec4 isinf(vec4 val) {\n        return equal(abs(val), vec4(INFINITY));\n      }\n    ",c="\n      int round(float value) {\n        return int(floor(value + 0.5));\n      }\n\n      ivec4 round(vec4 value) {\n        return ivec4(floor(value + vec4(0.5)));\n      }\n    "),{version:e,attribute:t,varyingVs:r,varyingFs:n,texture2D:a,output:i,defineOutput:o,defineSpecialNaN:s,defineSpecialInf:l,defineRound:c}}function jO(e,t,r="index"){const n=Ie(t);return n.map(((t,a)=>`int ${e[a]} = ${r} / ${t}; ${a===n.length-1?`int ${e[a+1]} = ${r} - ${e[a]} * ${t}`:`index -= ${e[a]} * ${t}`};`)).join("")}function UO(e,t,r="index"){const n=Ie(t);return n.map(((t,a)=>`int ${e[a]} = ${r} / outShapeStrides[${a}]; ${a===n.length-1?`int ${e[a+1]} = ${r} - ${e[a]} * outShapeStrides[${a}]`:`index -= ${e[a]} * outShapeStrides[${a}]`};`)).join("")}function $O(e){const t=Ie(e).map((e=>e.toString()));return`\n  int getFlatIndex(ivec3 coords) {\n    return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z;\n  }\n`}BO.registerFlag("HAS_WEBGL",(()=>BO.getNumber("WEBGL_VERSION")>0)),BO.registerFlag("WEBGL_VERSION",(()=>RO(2)?2:RO(1)?1:0)),BO.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",(()=>!1)),BO.registerFlag("WEBGL_BUFFER_SUPPORTED",(()=>2===BO.get("WEBGL_VERSION"))),BO.registerFlag("WEBGL_CPU_FORWARD",(()=>!0)),BO.registerFlag("WEBGL_FORCE_F16_TEXTURES",(()=>!1)),BO.registerFlag("WEBGL_PACK",(()=>BO.getBool("HAS_WEBGL"))),BO.registerFlag("WEBGL_PACK_NORMALIZATION",(()=>BO.getBool("WEBGL_PACK"))),BO.registerFlag("WEBGL_PACK_CLIP",(()=>BO.getBool("WEBGL_PACK"))),BO.registerFlag("WEBGL_PACK_DEPTHWISECONV",(()=>BO.getBool("WEBGL_PACK"))),BO.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",(()=>BO.getBool("WEBGL_PACK"))),BO.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",(()=>BO.getBool("WEBGL_PACK"))),BO.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",(()=>BO.getBool("WEBGL_PACK"))),BO.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",(()=>BO.getBool("WEBGL_PACK"))),BO.registerFlag("WEBGL_PACK_REDUCE",(()=>BO.getBool("WEBGL_PACK"))),BO.registerFlag("WEBGL_LAZILY_UNPACK",(()=>BO.getBool("WEBGL_PACK"))),BO.registerFlag("WEBGL_CONV_IM2COL",(()=>BO.getBool("WEBGL_PACK"))),BO.registerFlag("WEBGL_MAX_TEXTURE_SIZE",(()=>function(e){if(null==OO){const t=lO(e);OO=t.getParameter(t.MAX_TEXTURE_SIZE)}return OO}(BO.getNumber("WEBGL_VERSION")))),BO.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",(()=>function(e){if(null==IO){const t=lO(e);IO=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,IO)}(BO.getNumber("WEBGL_VERSION")))),BO.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",(()=>{const e=BO.getNumber("WEBGL_VERSION");return 0===e?0:function(e){if(0===e)return 0;let t;const r=lO(e);return t=PO(r,"EXT_disjoint_timer_query_webgl2")&&2===e?2:PO(r,"EXT_disjoint_timer_query")?1:0,t}(e)})),BO.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",(()=>BO.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!yi())),BO.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",(()=>function(e){if(0===e)return!1;const t=lO(e);if(1===e){if(!PO(t,"OES_texture_float"))return!1}else if(!PO(t,"EXT_color_buffer_float"))return!1;return LO(t)}(BO.getNumber("WEBGL_VERSION")))),BO.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",(()=>!BO.getBool("WEBGL_FORCE_F16_TEXTURES")&&BO.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))),BO.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",(()=>function(e){if(0===e)return!1;const t=lO(e);if(1!==e){if(PO(t,"EXT_color_buffer_float"))return LO(t);const e="EXT_color_buffer_half_float";if(PO(t,e)){const r=t.getExtension(e);return function(e,t){const r=mO(e,t),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,r.internalFormatHalfFloat,1,1,0,r.textureFormatFloat,r.textureTypeHalfFloat,null);const a=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,a),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);const i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(a),i}(t,r)}return!1}return!!PO(t,"OES_texture_float")&&!!PO(t,"WEBGL_color_buffer_float")&&LO(t)}(BO.getNumber("WEBGL_VERSION")))),BO.registerFlag("WEBGL_FENCE_API_ENABLED",(()=>{return 2===(e=BO.getNumber("WEBGL_VERSION"))&&null!=lO(e).fenceSync;var e})),BO.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",(()=>BO.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0)),BO.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",(()=>-1),(e=>{if(e<0&&-1!==e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)})),BO.registerFlag("WEBGL_FLUSH_THRESHOLD",(()=>yi()?1:-1),(e=>{if(e<0&&-1!==e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)})),BO.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",(()=>128)),BO.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",(()=>!1)),BO.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",(()=>1e5)),BO.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",(()=>128));const VO="\n  const float FLOAT_MAX = 1.70141184e38;\n  const float FLOAT_MIN = 1.17549435e-38;\n\n  lowp vec4 encode_float(highp float v) {\n    if (isnan(v)) {\n      return vec4(255, 255, 255, 255);\n    }\n\n    highp float av = abs(v);\n\n    if(av < FLOAT_MIN) {\n      return vec4(0.0, 0.0, 0.0, 0.0);\n    } else if(v > FLOAT_MAX) {\n      return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n    } else if(v < -FLOAT_MAX) {\n      return vec4(0.0, 0.0,  128.0, 255.0) / 255.0;\n    }\n\n    highp vec4 c = vec4(0,0,0,0);\n\n    highp float e = floor(log2(av));\n    highp float m = exp2(fract(log2(av))) - 1.0;\n\n    c[2] = floor(128.0 * m);\n    m -= c[2] / 128.0;\n    c[1] = floor(32768.0 * m);\n    m -= c[1] / 32768.0;\n    c[0] = floor(8388608.0 * m);\n\n    highp float ebias = e + 127.0;\n    c[3] = floor(ebias / 2.0);\n    ebias -= c[3] * 2.0;\n    c[2] += floor(ebias) * 128.0;\n\n    c[3] += 128.0 * step(0.0, -v);\n\n    return c / 255.0;\n  }\n",{getBroadcastDims:qO}=y;function WO(e,t,r){const n=[];if(e.forEach((e=>{const t=se(e.shapeInfo.logicalShape);if(e.shapeInfo.isUniform?n.push(`uniform float ${e.name}${t>1?`[${t}]`:""};`):(n.push(`uniform sampler2D ${e.name};`),n.push(`uniform int offset${e.name};`)),r.enableShapeUniforms){const{uniformShape:t}=tI(r.packedInputs,e.shapeInfo.logicalShape,e.shapeInfo.texShape);switch(t.length){case 1:n.push(`uniform int ${e.name}Shape;`);break;case 2:n.push(`uniform ivec2 ${e.name}Shape;`);break;case 3:n.push(`uniform ivec3 ${e.name}Shape;`);break;case 4:n.push(`uniform ivec4 ${e.name}Shape;`)}n.push(`uniform ivec2 ${e.name}TexShape;`)}})),r.enableShapeUniforms){switch(t.logicalShape.length){case 1:n.push("uniform int outShape;");break;case 2:n.push("uniform ivec2 outShape;"),n.push("uniform int outShapeStrides;");break;case 3:n.push("uniform ivec3 outShape;"),n.push("uniform ivec2 outShapeStrides;");break;case 4:n.push("uniform ivec4 outShape;"),n.push("uniform ivec3 outShapeStrides;")}n.push("uniform ivec2 outTexShape;")}r.customUniforms&&r.customUniforms.forEach((e=>{n.push(`uniform ${e.type} ${e.name}${e.arrayIndex?`[${e.arrayIndex}]`:""};`)}));const a=n.join("\n"),i=e.map((e=>function(e,t,r=!1,n){let a="";a+=r?GO(e,n):HO(e,n);const i=e.shapeInfo.logicalShape,o=t.logicalShape;return i.length<=o.length&&(a+=r?function(e,t){const r=e.name,n=r.charAt(0).toUpperCase()+r.slice(1),a="get"+n+"AtOutCoords",i=e.shapeInfo.logicalShape.length,o=t.logicalShape.length,s=qO(e.shapeInfo.logicalShape,t.logicalShape),l=eI(o),c=o-i;let u;const f=["x","y","z","w","u","v"];u=0===i?"":o<2&&s.length>=1?"coords = 0;":s.map((e=>`coords.${f[e+c]} = 0;`)).join("\n");let p="";p=o<2&&i>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${f[t+c]}`)).join(", ");let h="return outputValue;";const d=1===se(e.shapeInfo.logicalShape),m=1===se(t.logicalShape);if(1!==i||d||m){if(d&&!m)h=1===o?"\n        return vec4(outputValue.x, outputValue.x, 0., 0.);\n      ":"\n        return vec4(outputValue.x);\n      ";else if(s.length){const e=i-2,t=i-1;s.indexOf(e)>-1&&s.indexOf(t)>-1?h="return vec4(outputValue.x);":s.indexOf(e)>-1?h="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":s.indexOf(t)>-1&&(h="return vec4(outputValue.xx, outputValue.zz);")}}else h="\n      return vec4(outputValue.xy, outputValue.xy);\n    ";return`\n    vec4 ${a}() {\n      ${l} coords = getOutputCoords();\n      ${u}\n      vec4 outputValue = get${n}(${p});\n      ${h}\n    }\n  `}(e,t):function(e,t){const r=e.name,n=r.charAt(0).toUpperCase()+r.slice(1),a="get"+n+"AtOutCoords",i=t.texShape,o=e.shapeInfo.texShape,s=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&s===l&&null==e.shapeInfo.flatOffset&&ce(o,i))return`\n      float ${a}() {\n        return sampleTexture(${r}, resultUV);\n      }\n    `;const c=eI(l),u=qO(e.shapeInfo.logicalShape,t.logicalShape),f=l-s;let p;const h=["x","y","z","w","u","v"];p=0===s?"":l<2&&u.length>=1?"coords = 0;":u.map((e=>`coords.${h[e+f]} = 0;`)).join("\n");let d="";return d=l<2&&s>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${h[t+f]}`)).join(", "),`\n    float ${a}() {\n      ${c} coords = getOutputCoords();\n      ${p}\n      return get${n}(${d});\n    }\n  `}(e,t)),a}(e,t,r.packedInputs,r.enableShapeUniforms))).join("\n"),o=t.texShape,s=zO(),l=function(e){return`\n    float sampleTexture(sampler2D textureSampler, vec2 uv) {\n      return ${e.texture2D}(textureSampler, uv).r;\n    }\n  `}(s);let c,u,f=function(e){return`${e.version}\n    precision highp float;\n    precision highp int;\n    precision highp sampler2D;\n    ${e.varyingFs} vec2 resultUV;\n    ${e.defineOutput}\n    const vec2 halfCR = vec2(0.5, 0.5);\n\n    struct ivec5\n    {\n      int x;\n      int y;\n      int z;\n      int w;\n      int u;\n    };\n\n    struct ivec6\n    {\n      int x;\n      int y;\n      int z;\n      int w;\n      int u;\n      int v;\n    };\n\n    uniform float NAN;\n    ${e.defineSpecialNaN}\n    ${e.defineSpecialInf}\n    ${e.defineRound}\n\n    int imod(int x, int y) {\n      return x - y * (x / y);\n    }\n\n    int idiv(int a, int b, float sign) {\n      int res = a / b;\n      int mod = imod(a, b);\n      if (sign < 0. && mod != 0) {\n        res -= 1;\n      }\n      return res;\n    }\n\n    //Based on the work of Dave Hoskins\n    //https://www.shadertoy.com/view/4djSRW\n    #define HASHSCALE1 443.8975\n    float random(float seed){\n      vec2 p = resultUV * seed;\n      vec3 p3  = fract(vec3(p.xyx) * HASHSCALE1);\n      p3 += dot(p3, p3.yzx + 19.19);\n      return fract((p3.x + p3.y) * p3.z);\n    }\n\n    ${XO}\n    ${YO}\n    ${ZO}\n  `}(s);return t.isPacked?(c=function(e,t,r){switch(e.length){case 0:return"\n    int getOutputCoords() {\n      return 0;\n    }\n  ";case 1:return function(e,t,r){const n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return 1===n[0]?r?"\n      int getOutputCoords() {\n        return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n      }\n    ":`\n      int getOutputCoords() {\n        return 2 * int(resultUV.x * ${n[1]}.0);\n      }\n    `:1===n[1]?r?"\n      int getOutputCoords() {\n        return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n      }\n    ":`\n      int getOutputCoords() {\n        return 2 * int(resultUV.y * ${n[0]}.0);\n      }\n    `:r?"\n    int getOutputCoords() {\n      ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(packedTexShape[0], packedTexShape[1]));\n      return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n    }\n  ":`\n    int getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${n[0]}, ${n[1]}));\n      return 2 * (resTexRC.x * ${n[1]} + resTexRC.y);\n    }\n  `}(0,t,r);case 2:return function(e,t,r){const n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(ce(e,t))return r?"\n      ivec2 getOutputCoords() {\n        ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n        return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1]));\n      }\n    ":`\n      ivec2 getOutputCoords() {\n        return 2 * ivec2(resultUV.yx * vec2(${n[0]}, ${n[1]}));\n      }\n    `;const a=Math.ceil(e[1]/2);return r?"\n    ivec2 getOutputCoords() {\n      ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n      int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0));\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(packedTexShape[0], packedTexShape[1]));\n\n      int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n      int r = 2 * (index / texelsInLogicalRow);\n      int c = imod(index, texelsInLogicalRow) * 2;\n\n      return ivec2(r, c);\n    }\n  ":`\n    ivec2 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${n[0]}, ${n[1]}));\n\n      int index = resTexRC.x * ${n[1]} + resTexRC.y;\n      int r = 2 * (index / ${a});\n      int c = imod(index, ${a}) * 2;\n\n      return ivec2(r, c);\n    }\n  `}(e,t,r);case 3:return function(e,t,r){if(r)return"\n    ivec3 getOutputCoords() {\n      ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n      int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n      int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(packedTexShape[0], packedTexShape[1]));\n      int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n      int b = index / texelsInBatch;\n      index -= b * texelsInBatch;\n\n      int r = 2 * (index / texelsInLogicalRow);\n      int c = imod(index, texelsInLogicalRow) * 2;\n\n      return ivec3(b, r, c);\n    }\n  ";const n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],a=Math.ceil(e[2]/2),i=a*Math.ceil(e[1]/2);return`\n    ivec3 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${n[0]}, ${n[1]}));\n      int index = resTexRC.x * ${n[1]} + resTexRC.y;\n\n      int b = index / ${i};\n      index -= b * ${i};\n\n      int r = 2 * (index / ${a});\n      int c = imod(index, ${a}) * 2;\n\n      return ivec3(b, r, c);\n    }\n  `}(e,t,r);default:return function(e,t,r){if(r)return"\n    ivec4 getOutputCoords() {\n      ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(packedTexShape[0], packedTexShape[1]));\n      int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n      int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n      int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n      int texelsInBatchN = texelsInBatch * outShape[1];\n\n      int b2 = index / texelsInBatchN;\n      index -= b2 * texelsInBatchN;\n\n      int b = index / texelsInBatch;\n      index -= b * texelsInBatch;\n\n      int r = 2 * (index / texelsInLogicalRow);\n      int c = imod(index, texelsInLogicalRow) * 2;\n\n      return ivec4(b2, b, r, c);\n    }\n  ";const n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],a=Math.ceil(e[e.length-1]/2),i=a*Math.ceil(e[e.length-2]/2);let o=i,s="",l="b, r, c";for(let t=2;t<e.length-1;t++)o*=e[e.length-t-1],s=`\n      int b${t} = index / ${o};\n      index -= b${t} * ${o};\n    `+s,l=`b${t}, `+l;return`\n    ivec${e.length} getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${n[0]}, ${n[1]}));\n      int index = resTexRC.x * ${n[1]} + resTexRC.y;\n\n      ${s}\n\n      int b = index / ${i};\n      index -= b * ${i};\n\n      int r = 2 * (index / ${a});\n      int c = imod(index, ${a}) * 2;\n\n      return ivec${e.length}(${l});\n    }\n  `}(e,t,r)}}(t.logicalShape,o,r.enableShapeUniforms),u=function(e){return`\n    void setOutput(vec4 val) {\n      ${e.output} = val;\n    }\n  `}(s)):(c=function(e,t,r){switch(e.length){case 0:return"\n    int getOutputCoords() {\n      return 0;\n    }\n  ";case 1:return function(e,t,r){return 1===t[0]?r?"\n      int getOutputCoords() {\n        return int(resultUV.x * float(outTexShape[1]));\n      }\n    ":`\n      int getOutputCoords() {\n        return int(resultUV.x * ${t[1]}.0);\n      }\n    `:1===t[1]?r?"\n      int getOutputCoords() {\n        return int(resultUV.y * float(outTexShape[0]));\n      }\n    ":`\n      int getOutputCoords() {\n        return int(resultUV.y * ${t[0]}.0);\n      }\n    `:r?"\n    int getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(outTexShape[0], outTexShape[1]));\n      return resTexRC.x * outTexShape[1] + resTexRC.y;\n    }\n  ":`\n    int getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${t[0]}, ${t[1]}));\n      return resTexRC.x * ${t[1]} + resTexRC.y;\n    }\n  `}(0,t,r);case 2:return function(e,t,r){return ce(e,t)?r?"\n      ivec2 getOutputCoords() {\n        return ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1]));\n      }\n    ":`\n      ivec2 getOutputCoords() {\n        return ivec2(resultUV.yx * vec2(${t[0]}, ${t[1]}));\n      }\n    `:1===e[1]?r?"\n      ivec2 getOutputCoords() {\n        ivec2 resTexRC = ivec2(resultUV.yx *\n                               vec2(outTexShape[0], outTexShape[1]));\n        int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n        return ivec2(index, 0);\n      }\n    ":`\n      ivec2 getOutputCoords() {\n        ivec2 resTexRC = ivec2(resultUV.yx *\n                               vec2(${t[0]}, ${t[1]}));\n        int index = resTexRC.x * ${t[1]} + resTexRC.y;\n        return ivec2(index, 0);\n      }\n    `:1===e[0]?r?"\n      ivec2 getOutputCoords() {\n        ivec2 resTexRC = ivec2(resultUV.yx *\n                               vec2(outTexShape[0], outTexShape[1]));\n        int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n        return ivec2(0, index);\n      }\n    ":`\n      ivec2 getOutputCoords() {\n        ivec2 resTexRC = ivec2(resultUV.yx *\n                               vec2(${t[0]}, ${t[1]}));\n        int index = resTexRC.x * ${t[1]} + resTexRC.y;\n        return ivec2(0, index);\n      }\n    `:r?"\n    ivec2 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(outTexShape[0], outTexShape[1]));\n      int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n      int r = index / outShape[1];\n      int c = index - r * outShape[1];\n      return ivec2(r, c);\n    }\n  ":`\n    ivec2 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${t[0]}, ${t[1]}));\n      int index = resTexRC.x * ${t[1]} + resTexRC.y;\n      int r = index / ${e[1]};\n      int c = index - r * ${e[1]};\n      return ivec2(r, c);\n    }\n  `}(e,t,r);case 3:return function(e,t,r){if(r)return`\n  ivec3 getOutputCoords() {\n    ivec2 resTexRC = ivec2(resultUV.yx *\n                           vec2(outTexShape[0], outTexShape[1]));\n    int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n    ${UO(["r","c","d"],e)}\n    return ivec3(r, c, d);\n  }\n`;const n=jO(["r","c","d"],e);return`\n    ivec3 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n                             vec2(${t[0]}, ${t[1]}));\n      int index = resTexRC.x * ${t[1]} + resTexRC.y;\n      ${n}\n      return ivec3(r, c, d);\n    }\n  `}(e,t,r);case 4:return function(e,t,r){if(r)return`\n    ivec4 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n        vec2(outTexShape[0], outTexShape[1]));\n      int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n      ${UO(["r","c","d","d2"],e)}\n      return ivec4(r, c, d, d2);\n    }\n  `;const n=jO(["r","c","d","d2"],e);return`\n    ivec4 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n        vec2(${t[0]}, ${t[1]}));\n      int index = resTexRC.x * ${t[1]} + resTexRC.y;\n      ${n}\n      return ivec4(r, c, d, d2);\n    }\n  `}(e,t,r);case 5:return function(e,t){const r=jO(["r","c","d","d2","d3"],e);return`\n    ivec5 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx * vec2(${t[0]},\n                             ${t[1]}));\n\n      int index = resTexRC.x * ${t[1]} + resTexRC.y;\n\n      ${r}\n\n      ivec5 outShape = ivec5(r, c, d, d2, d3);\n      return outShape;\n    }\n  `}(e,t);case 6:return function(e,t){const r=jO(["r","c","d","d2","d3","d4"],e);return`\n    ivec6 getOutputCoords() {\n      ivec2 resTexRC = ivec2(resultUV.yx *\n        vec2(${t[0]}, ${t[1]}));\n      int index = resTexRC.x * ${t[1]} + resTexRC.y;\n\n      ${r}\n\n      ivec6 result = ivec6(r, c, d, d2, d3, d4);\n      return result;\n    }\n  `}(e,t);default:throw new Error(`${e.length}-D output sampling is not yet supported`)}}(t.logicalShape,o,r.enableShapeUniforms),u=function(e){return`\n    void setOutput(float val) {\n      ${e.output} = vec4(val, 0, 0, 0);\n    }\n  `}(s)),r.packedInputs&&(f+=KO),[f,l,u,a,c,i,r.userCode].join("\n")}function HO(e,t=!1){const r=e.shapeInfo.logicalShape;switch(r.length){case 0:return function(e,t){const r=e.name,n="get"+r.charAt(0).toUpperCase()+r.slice(1);if(e.shapeInfo.isUniform)return`float ${n}() {return ${r};}`;const[a,i]=e.shapeInfo.texShape;if(1===a&&1===i)return`\n      float ${n}() {\n        return sampleTexture(${r}, halfCR);\n      }\n    `;const o=JO(r);if(t)return`\n    float ${n}() {\n      vec2 uv = uvFromFlat(${r}TexShape[0], ${r}TexShape[1], ${o});\n      return sampleTexture(${r}, uv);\n    }\n  `;const[s,l]=e.shapeInfo.texShape;return`\n    float ${n}() {\n      vec2 uv = uvFromFlat(${s}, ${l}, ${o});\n      return sampleTexture(${r}, uv);\n    }\n  `}(e,t);case 1:return function(e,t){const r=e.name,n="get"+r.charAt(0).toUpperCase()+r.slice(1);if(e.shapeInfo.isUniform)return`\n      float ${n}(int index) {\n        ${QO(e)}\n      }\n    `;const a=e.shapeInfo.texShape,i=a[0],o=a[1];if(1===o&&1===i)return`\n      float ${n}(int index) {\n        return sampleTexture(${r}, halfCR);\n      }\n    `;const s=JO(r);return 1===o?t?`\n      float ${n}(int index) {\n        vec2 uv = vec2(0.5, (float(index + ${s}) + 0.5) / float(${r}TexShape[0]));\n        return sampleTexture(${r}, uv);\n      }\n    `:`\n      float ${n}(int index) {\n        vec2 uv = vec2(0.5, (float(index + ${s}) + 0.5) / ${i}.0);\n        return sampleTexture(${r}, uv);\n      }\n    `:1===i?t?`\n      float ${n}(int index) {\n        vec2 uv = vec2((float(index + ${s}) + 0.5) / float(${r}TexShape[1]), 0.5);\n        return sampleTexture(${r}, uv);\n      }\n    `:`\n      float ${n}(int index) {\n        vec2 uv = vec2((float(index + ${s}) + 0.5) / ${o}.0, 0.5);\n        return sampleTexture(${r}, uv);\n      }\n    `:t?`\n    float ${n}(int index) {\n      vec2 uv = uvFromFlat(${r}TexShape[0], ${r}TexShape[1], index + ${s});\n      return sampleTexture(${r}, uv);\n    }\n  `:`\n    float ${n}(int index) {\n      vec2 uv = uvFromFlat(${i}, ${o}, index + ${s});\n      return sampleTexture(${r}, uv);\n    }\n  `}(e,t);case 2:return function(e,t){const r=e.shapeInfo.logicalShape,n=e.name,a="get"+n.charAt(0).toUpperCase()+n.slice(1),i=e.shapeInfo.texShape;if(null!=i&&ce(r,i)){if(t)return`\n      float ${a}(int row, int col) {\n        vec2 uv = (vec2(col, row) + halfCR) / vec2(${n}TexShape[1], ${n}TexShape[0]);\n        return sampleTexture(${n}, uv);\n      }\n    `;const e=i[0];return`\n    float ${a}(int row, int col) {\n      vec2 uv = (vec2(col, row) + halfCR) / vec2(${i[1]}.0, ${e}.0);\n      return sampleTexture(${n}, uv);\n    }\n  `}const{newShape:o,keptDims:s}=ve(r),l=o;if(l.length<r.length){const r=["row","col"];return`\n      ${HO(rI(e,l),t)}\n      float ${a}(int row, int col) {\n        return ${a}(${nI(r,s)});\n      }\n    `}if(e.shapeInfo.isUniform)return`\n      float ${a}(int row, int col) {\n        int index = round(dot(vec2(row, col), vec2(${r[1]}, 1)));\n        ${QO(e)}\n      }\n    `;const c=i[0],u=i[1],f=JO(n);return 1===u?t?`\n      float ${a}(int row, int col) {\n        float index = dot(vec3(row, col, ${f}), vec3(${n}Shape[1], 1, 1));\n        vec2 uv = vec2(0.5, (index + 0.5) / float(${n}TexShape[0]));\n        return sampleTexture(${n}, uv);\n      }\n    `:`\n    float ${a}(int row, int col) {\n      float index = dot(vec3(row, col, ${f}), vec3(${r[1]}, 1, 1));\n      vec2 uv = vec2(0.5, (index + 0.5) / ${c}.0);\n      return sampleTexture(${n}, uv);\n    }\n  `:1===c?t?`\n      float ${a}(int row, int col) {\n        float index = dot(vec3(row, col, ${f}), vec3(${n}Shape[1], 1, 1));\n        vec2 uv = vec2((index + 0.5) / float(${n}TexShape[1]), 0.5);\n        return sampleTexture(${n}, uv);\n      }\n    `:`\n    float ${a}(int row, int col) {\n      float index = dot(vec3(row, col, ${f}), vec3(${r[1]}, 1, 1));\n      vec2 uv = vec2((index + 0.5) / ${u}.0, 0.5);\n      return sampleTexture(${n}, uv);\n    }\n  `:t?`\n      float ${a}(int row, int col) {\n        // Explicitly use integer operations as dot() only works on floats.\n        int index = row * ${n}Shape[1] + col + ${f};\n        vec2 uv = uvFromFlat(${n}TexShape[0], ${n}TexShape[1], index);\n        return sampleTexture(${n}, uv);\n      }\n    `:`\n  float ${a}(int row, int col) {\n    // Explicitly use integer operations as dot() only works on floats.\n    int index = row * ${r[1]} + col + ${f};\n    vec2 uv = uvFromFlat(${c}, ${u}, index);\n    return sampleTexture(${n}, uv);\n  }\n`}(e,t);case 3:return function(e,t){const r=e.shapeInfo.logicalShape,n=e.name,a="get"+n.charAt(0).toUpperCase()+n.slice(1),i=r[1]*r[2],o=r[2],{newShape:s,keptDims:l}=ve(r),c=s;if(c.length<r.length){const r=["row","col","depth"];return`\n        ${HO(rI(e,c),t)}\n        float ${a}(int row, int col, int depth) {\n          return ${a}(${nI(r,l)});\n        }\n      `}if(e.shapeInfo.isUniform)return`\n      float ${a}(int row, int col, int depth) {\n        int index = round(dot(vec3(row, col, depth),\n                          vec3(${i}, ${o}, 1)));\n        ${QO(e)}\n      }\n    `;const u=e.shapeInfo.texShape,f=u[0],p=u[1],h=e.shapeInfo.flatOffset;if(p===i&&null==h)return t?`\n      float ${a}(int row, int col, int depth) {\n        int stride1 = ${n}Shape[2];\n        float texR = float(row);\n        float texC = dot(vec2(col, depth), vec2(stride1, 1));\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                   vec2(${n}TexShape[1], ${n}TexShape[0]);\n        return sampleTexture(${n}, uv);\n      }\n    `:`\n        float ${a}(int row, int col, int depth) {\n          float texR = float(row);\n          float texC = dot(vec2(col, depth), vec2(${o}, 1));\n          vec2 uv = (vec2(texC, texR) + halfCR) /\n                     vec2(${p}.0, ${f}.0);\n          return sampleTexture(${n}, uv);\n        }\n      `;if(p===o&&null==h)return t?`\n      float ${a}(int row, int col, int depth) {\n        float texR = dot(vec2(row, col), vec2(${n}Shape[1], 1));\n        float texC = float(depth);\n        vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${n}TexShape[1], ${n}TexShape[0]);\n        return sampleTexture(${n}, uv);\n      }\n    `:`\n    float ${a}(int row, int col, int depth) {\n      float texR = dot(vec2(row, col), vec2(${r[1]}, 1));\n      float texC = float(depth);\n      vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${p}.0, ${f}.0);\n      return sampleTexture(${n}, uv);\n    }\n  `;const d=JO(n);return t?`\n    float ${a}(int row, int col, int depth) {\n      // Explicitly use integer operations as dot() only works on floats.\n      int stride0 = ${n}Shape[1] * ${n}Shape[2];\n      int stride1 = ${n}Shape[2];\n      int index = row * ${i} + col * ${o} + depth + ${d};\n      vec2 uv = uvFromFlat(${n}TexShape[0], ${n}TexShape[1], index);\n      return sampleTexture(${n}, uv);\n    }\n    `:`\n      float ${a}(int row, int col, int depth) {\n        // Explicitly use integer operations as dot() only works on floats.\n        int index = row * ${i} + col * ${o} + depth + ${d};\n        vec2 uv = uvFromFlat(${f}, ${p}, index);\n        return sampleTexture(${n}, uv);\n      }\n  `}(e,t);case 4:return function(e,t){const r=e.shapeInfo.logicalShape,n=e.name,a="get"+n.charAt(0).toUpperCase()+n.slice(1),i=r[3],o=r[2]*i,s=r[1]*o,{newShape:l,keptDims:c}=ve(r);if(l.length<r.length){const r=["row","col","depth","depth2"];return`\n      ${HO(rI(e,l),t)}\n      float ${a}(int row, int col, int depth, int depth2) {\n        return ${a}(${nI(r,c)});\n      }\n    `}if(e.shapeInfo.isUniform)return`\n      float ${a}(int row, int col, int depth, int depth2) {\n        int index = round(dot(vec4(row, col, depth, depth2),\n                          vec4(${s}, ${o}, ${i}, 1)));\n        ${QO(e)}\n      }\n    `;const u=e.shapeInfo.flatOffset,f=e.shapeInfo.texShape,p=f[0],h=f[1],d=`int stride2 = ${n}Shape[3];`,m=`int stride1 = ${n}Shape[2] * stride2;`,g=`int stride0 = ${n}Shape[1] * stride1;`;if(h===s&&null==u)return t?`\n      float ${a}(int row, int col, int depth, int depth2) {\n        ${d}\n        ${m}\n        float texR = float(row);\n        float texC =\n            dot(vec3(col, depth, depth2),\n                vec3(stride1, stride2, 1));\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                   vec2(${n}TexShape[1], ${n}TexShape[0]);\n        return sampleTexture(${n}, uv);\n      }\n    `:`\n      float ${a}(int row, int col, int depth, int depth2) {\n        float texR = float(row);\n        float texC =\n            dot(vec3(col, depth, depth2),\n                vec3(${o}, ${i}, 1));\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                   vec2(${h}.0, ${p}.0);\n        return sampleTexture(${n}, uv);\n      }\n    `;if(h===i&&null==u)return t?`\n      float ${a}(int row, int col, int depth, int depth2) {\n        float texR = dot(vec3(row, col, depth),\n                         vec3(${n}Shape[1] * ${n}Shape[2], ${n}Shape[2], 1));\n        float texC = float(depth2);\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                  vec2(${n}TexShape[1], ${n}TexShape[0]);\n        return sampleTexture(${n}, uv);\n      }\n    `:`\n      float ${a}(int row, int col, int depth, int depth2) {\n        float texR = dot(vec3(row, col, depth),\n                         vec3(${r[1]*r[2]}, ${r[2]}, 1));\n        float texC = float(depth2);\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                  vec2(${h}.0, ${p}.0);\n        return sampleTexture(${n}, uv);\n      }\n    `;const y=JO(n);return t?`\n    float ${a}(int row, int col, int depth, int depth2) {\n      // Explicitly use integer operations as dot() only works on floats.\n      ${d}\n      ${m}\n      ${g}\n      int index = row * stride0 + col * stride1 +\n          depth * stride2 + depth2;\n      vec2 uv = uvFromFlat(${n}TexShape[0], ${n}TexShape[1], index + ${y});\n      return sampleTexture(${n}, uv);\n    }\n  `:`\n    float ${a}(int row, int col, int depth, int depth2) {\n      // Explicitly use integer operations as dot() only works on floats.\n      int index = row * ${s} + col * ${o} +\n          depth * ${i} + depth2;\n      vec2 uv = uvFromFlat(${p}, ${h}, index + ${y});\n      return sampleTexture(${n}, uv);\n    }\n  `}(e,t);case 5:return function(e){const t=e.shapeInfo.logicalShape,r=e.name,n="get"+r.charAt(0).toUpperCase()+r.slice(1),a=t[4],i=t[3]*a,o=t[2]*i,s=t[1]*o,{newShape:l,keptDims:c}=ve(t);if(l.length<t.length){const t=["row","col","depth","depth2","depth3"];return`\n      ${HO(rI(e,l))}\n      float ${n}(int row, int col, int depth, int depth2, int depth3) {\n        return ${n}(${nI(t,c)});\n      }\n    `}if(e.shapeInfo.isUniform)return`\n      float ${n}(int row, int col, int depth, int depth2, int depth3) {\n        float index = dot(\n          vec4(row, col, depth, depth2),\n          vec4(${s}, ${o}, ${i}, ${a})) +\n          depth3;\n        ${QO(e)}\n      }\n    `;const u=e.shapeInfo.flatOffset,f=e.shapeInfo.texShape,p=f[0],h=f[1];if(h===s&&null==u)return`\n      float ${n}(int row, int col, int depth, int depth2, int depth3) {\n        int texR = row;\n        float texC = dot(vec4(col, depth, depth2, depth3),\n                         vec4(${o}, ${i}, ${a}, 1));\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                   vec2(${h}.0, ${p}.0);\n        return sampleTexture(${r}, uv);\n      }\n    `;if(h===a&&null==u)return`\n      float ${n}(int row, int col, int depth, int depth2, int depth3) {\n        float texR = dot(\n          vec4(row, col, depth, depth2),\n          vec4(${t[1]*t[2]*t[3]},\n               ${t[2]*t[3]}, ${t[3]}, 1));\n        int texC = depth3;\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                  vec2(${h}.0, ${p}.0);\n        return sampleTexture(${r}, uv);\n      }\n    `;return`\n    float ${n}(int row, int col, int depth, int depth2, int depth3) {\n      // Explicitly use integer operations as dot() only works on floats.\n      int index = row * ${s} + col * ${o} + depth * ${i} +\n          depth2 * ${a} + depth3 + ${JO(r)};\n      vec2 uv = uvFromFlat(${p}, ${h}, index);\n      return sampleTexture(${r}, uv);\n    }\n  `}(e);case 6:return function(e){const t=e.shapeInfo.logicalShape,r=e.name,n="get"+r.charAt(0).toUpperCase()+r.slice(1),{newShape:a,keptDims:i}=ve(t);if(a.length<t.length){const t=["row","col","depth","depth2","depth3","depth4"];return`\n      ${HO(rI(e,a))}\n      float ${n}(int row, int col, int depth,\n                    int depth2, int depth3, int depth4) {\n        return ${n}(${nI(t,i)});\n      }\n    `}const o=t[5],s=t[4]*o,l=t[3]*s,c=t[2]*l,u=t[1]*c;if(e.shapeInfo.isUniform)return`\n      float ${n}(int row, int col, int depth,\n                  int depth2, int depth3, int depth4) {\n        int index = round(dot(\n          vec4(row, col, depth, depth2),\n          vec4(${u}, ${c}, ${l}, ${s})) +\n          dot(\n            vec2(depth3, depth4),\n            vec2(${o}, 1)));\n        ${QO(e)}\n      }\n    `;const f=e.shapeInfo.flatOffset,p=e.shapeInfo.texShape,h=p[0],d=p[1];if(d===u&&null==f)return`\n      float ${n}(int row, int col, int depth,\n                    int depth2, int depth3, int depth4) {\n        int texR = row;\n        float texC = dot(vec4(col, depth, depth2, depth3),\n          vec4(${c}, ${l}, ${s}, ${o})) +\n               float(depth4);\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                   vec2(${d}.0, ${h}.0);\n        return sampleTexture(${r}, uv);\n      }\n    `;if(d===o&&null==f)return`\n      float ${n}(int row, int col, int depth,\n                    int depth2, int depth3, int depth4) {\n        float texR = dot(vec4(row, col, depth, depth2),\n          vec4(${t[1]*t[2]*t[3]*t[4]},\n               ${t[2]*t[3]*t[4]},\n               ${t[3]*t[4]},\n               ${t[4]})) + float(depth3);\n        int texC = depth4;\n        vec2 uv = (vec2(texC, texR) + halfCR) /\n                  vec2(${d}.0, ${h}.0);\n        return sampleTexture(${r}, uv);\n      }\n    `;return`\n    float ${n}(int row, int col, int depth,\n                  int depth2, int depth3, int depth4) {\n      // Explicitly use integer operations as dot() only works on floats.\n      int index = row * ${u} + col * ${c} + depth * ${l} +\n          depth2 * ${s} + depth3 * ${o} + depth4 + ${JO(r)};\n      vec2 uv = uvFromFlat(${h}, ${d}, index);\n      return sampleTexture(${r}, uv);\n    }\n  `}(e);default:throw new Error(`${r.length}-D input sampling is not yet supported`)}}function GO(e,t){switch(e.shapeInfo.logicalShape.length){case 0:return function(e){const t=e.name;return`\n    vec4 ${"get"+t.charAt(0).toUpperCase()+t.slice(1)}() {\n      return ${zO().texture2D}(${t}, halfCR);\n    }\n  `}(e);case 1:return function(e,t){const r=e.name,n="get"+r.charAt(0).toUpperCase()+r.slice(1),a=e.shapeInfo.texShape,i=zO();if(t)return`\n    vec4 ${n}(int index) {\n      ivec2 packedTexShape = ivec2(ceil(float(${r}TexShape[0]) / 2.0), ceil(float(${r}TexShape[1]) / 2.0));\n      vec2 uv = packedUVfrom1D(\n        packedTexShape[0], packedTexShape[1], index);\n      return ${i.texture2D}(${r}, uv);\n    }\n  `;const o=[Math.ceil(a[0]/2),Math.ceil(a[1]/2)];return`\n    vec4 ${n}(int index) {\n      vec2 uv = packedUVfrom1D(\n        ${o[0]}, ${o[1]}, index);\n      return ${i.texture2D}(${r}, uv);\n    }\n  `}(e,t);case 2:return function(e,t){const r=e.shapeInfo.logicalShape,n=e.name,a="get"+n.charAt(0).toUpperCase()+n.slice(1),i=e.shapeInfo.texShape,o=i[0],s=i[1],l=zO();if(null!=i&&ce(r,i))return t?`\n      vec4 ${a}(int row, int col) {\n        vec2 uv = (vec2(col, row) + halfCR) / vec2(${n}TexShape[1], ${n}TexShape[0]);\n\n        return ${l.texture2D}(${n}, uv);\n      }\n    `:`\n      vec4 ${a}(int row, int col) {\n        vec2 uv = (vec2(col, row) + halfCR) / vec2(${s}.0, ${o}.0);\n\n        return ${l.texture2D}(${n}, uv);\n      }\n    `;if(t)return`\n    vec4 ${a}(int row, int col) {\n      ivec2 packedTexShape = ivec2(ceil(float(${n}TexShape[0]) / 2.0), ceil(float(${n}TexShape[1]) / 2.0));\n      int valuesPerRow = int(ceil(float(${n}Shape[1]) / 2.0));\n      vec2 uv = packedUVfrom2D(valuesPerRow, packedTexShape[0], packedTexShape[1], row, col);\n      return ${l.texture2D}(${n}, uv);\n    }\n  `;const c=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];return`\n    vec4 ${a}(int row, int col) {\n      vec2 uv = packedUVfrom2D(${Math.ceil(r[1]/2)}, ${c[0]}, ${c[1]}, row, col);\n      return ${l.texture2D}(${n}, uv);\n    }\n  `}(e,t);case 3:return function(e,t){const r=e.shapeInfo.logicalShape,n=e.name,a="get"+n.charAt(0).toUpperCase()+n.slice(1),i=e.shapeInfo.texShape,o=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];if(1===r[0]){const n=[1,2],i=["b","row","col"];return`\n        ${GO(rI(e,r.slice(1)),t)}\n        vec4 ${a}(int b, int row, int col) {\n          return ${a}(${nI(i,n)});\n        }\n      `}const s=zO();if(t)return`\n    vec4 ${a}(int b, int row, int col) {\n      ivec2 packedTexShape = ivec2(ceil(float(${n}TexShape[0]) / 2.0), ceil(float(${n}TexShape[1]) / 2.0));\n      int valuesPerRow = int(ceil(float(${n}Shape[2]) / 2.0));\n      int texelsInBatch = valuesPerRow * int(ceil(float(${n}Shape[1]) / 2.0));\n      vec2 uv = packedUVfrom3D(\n        packedTexShape[0], packedTexShape[1], texelsInBatch, valuesPerRow, b, row, col);\n      return ${s.texture2D}(${n}, uv);\n    }\n  `;const l=o[0],c=o[1],u=Math.ceil(r[2]/2);return`\n    vec4 ${a}(int b, int row, int col) {\n      vec2 uv = packedUVfrom3D(\n        ${l}, ${c}, ${u*Math.ceil(r[1]/2)}, ${u}, b, row, col);\n      return ${s.texture2D}(${n}, uv);\n    }\n  `}(e,t);default:return function(e,t){const r=e.name,n="get"+r.charAt(0).toUpperCase()+r.slice(1),a=zO();if(t)return`\n    vec4 ${n}(int b2, int b, int row, int col) {\n      int valuesPerRow = int(ceil(float(${r}Shape[3]) / 2.0));\n      int texelsInBatch = valuesPerRow * int(ceil(float(${r}Shape[2]) / 2.0));\n      int index = b * texelsInBatch + (row / 2) * valuesPerRow + (col / 2);\n      texelsInBatch *= ${r}Shape[1];\n      index = b2 * texelsInBatch + index;\n      ivec2 packedTexShape = ivec2(ceil(float(${r}TexShape[0]) / 2.0), ceil(float(${r}TexShape[1]) / 2.0));\n      int texR = index / packedTexShape[1];\n      int texC = index - texR * packedTexShape[1];\n      vec2 uv = (vec2(texC, texR) + halfCR) / vec2(packedTexShape[1], packedTexShape[0]); return ${a.texture2D}(${r}, uv);\n    }\n  `;const i=e.shapeInfo.logicalShape,o=i.length,s=e.shapeInfo.texShape,l=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)],c=l[0],u=l[1],f=Math.ceil(i[o-1]/2);let p=f*Math.ceil(i[o-2]/2),h="int b, int row, int col",d=`b * ${p} + (row / 2) * ${f} + (col / 2)`;for(let e=2;e<o-1;e++)h=`int b${e}, `+h,p*=i[o-e-1],d=`b${e} * ${p} + `+d;return`\n    vec4 ${n}(${h}) {\n      int index = ${d};\n      int texR = index / ${u};\n      int texC = index - texR * ${u};\n      vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${u}, ${c});\n      return ${a.texture2D}(${r}, uv);\n    }\n  `}(e,t)}}const XO="\nvec2 uvFromFlat(int texNumR, int texNumC, int index) {\n  int texR = index / texNumC;\n  int texC = index - texR * texNumC;\n  return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\nvec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n  int texelIndex = index / 2;\n  int texR = texelIndex / texNumC;\n  int texC = texelIndex - texR * texNumC;\n  return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",YO="\nvec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR,\n  int texNumC, int row, int col) {\n  int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n  int texR = texelIndex / texNumC;\n  int texC = texelIndex - texR * texNumC;\n  return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",ZO="\nvec2 packedUVfrom3D(int texNumR, int texNumC,\n    int texelsInBatch, int texelsInLogicalRow, int b,\n    int row, int col) {\n  int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n  int texR = index / texNumC;\n  int texC = index - texR * texNumC;\n  return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",KO="\n  float getChannel(vec4 frag, vec2 innerDims) {\n    vec2 modCoord = mod(innerDims, 2.);\n    return modCoord.x == 0. ?\n      (modCoord.y == 0. ? frag.r : frag.g) :\n      (modCoord.y == 0. ? frag.b : frag.a);\n  }\n  float getChannel(vec4 frag, int dim) {\n    float modCoord = mod(float(dim), 2.);\n    return modCoord == 0. ? frag.r : frag.g;\n  }\n";function JO(e){return`offset${e}`}function QO(e){const t=e.name,r=se(e.shapeInfo.logicalShape);return r<2?`return ${t};`:`\n    for (int i = 0; i < ${r}; i++) {\n      if (i == index) {\n        return ${t}[i];\n      }\n    }\n  `}function eI(e){if(e<=1)return"int";if(2===e)return"ivec2";if(3===e)return"ivec3";if(4===e)return"ivec4";if(5===e)return"ivec5";if(6===e)return"ivec6";throw Error(`GPU for rank ${e} is not yet supported`)}function tI(e,t,r){const{newShape:n,keptDims:a}=ve(t),i=t.length,o=e&&3===i&&1===t[0],s=o?t.slice(1):n,l=!e&&i>1&&!ce(t,r)&&n.length<i||o;return{useSqueezeShape:l,uniformShape:l?s:t,keptDims:a}}function rI(e,t){const r=JSON.parse(JSON.stringify(e));return r.shapeInfo.logicalShape=t,r}function nI(e,t){return t.map((t=>e[t])).join(", ")}function aI(e,t){if(e.length!==t.length)throw Error(`Binary was compiled with ${e.length} inputs, but was executed with ${t.length} inputs`);e.forEach(((e,r)=>{const n=e.logicalShape,a=t[r],i=a.shape;if(!ce(n,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${n} and ${i} must match`);if(e.isUniform&&a.isUniform)return;const o=e.texShape,s=a.isUniform?null:a.texData.texShape;if(!ce(o,s))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${s} must match`)}))}function iI(e){return We().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}class oI{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=cO.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=zO();this.outputShape=e,this.enableShapeUniforms=iI(this.outputShape.length),this.userCode=`\n      ivec3 outCoordsFromFlatIndex(int index) {\n        ${this.enableShapeUniforms?UO(["r","c","d"],e):jO(["r","c","d"],e)}\n        return ivec3(r, c, d);\n      }\n\n      void main() {\n        ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n        int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n        vec4 result = vec4(0.);\n\n        for (int i=0; i<4; i++) {\n          int flatIndex = index + i;\n          ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n          result[i] = getA(rc.x, rc.y, rc.z);\n        }\n\n        ${t.output} = result;\n      }\n    `}}class sI{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=cO.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=zO();this.outputShape=e,this.enableShapeUniforms=iI(this.outputShape.length),this.userCode=`\n      ivec3 outCoordsFromFlatIndex(int index) {\n        ${this.enableShapeUniforms?UO(["r","c","d"],e):jO(["r","c","d"],e)}\n        return ivec3(r, c, d);\n      }\n\n      void main() {\n        ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n        int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n        vec4 result = vec4(0.);\n\n        for (int i=0; i<4; i++) {\n          int flatIndex = index + i;\n          ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n          result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n        }\n\n        ${t.output} = result;\n      }\n    `}}class lI{constructor(e){this.variableNames=["A"],this.outTexUsage=uO.DOWNLOAD;const t=zO();this.outputShape=e,this.userCode=`\n      ${VO}\n\n      void main() {\n        float x = getAAtOutCoords();\n        ${t.output} = encode_float(x);\n      }\n    `}}class cI{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=uO.DOWNLOAD;const t=zO();this.outputShape=e,this.userCode=`\n      ${VO}\n\n      void main() {\n        ivec3 coords = getOutputCoords();\n        float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n        ${t.output} = encode_float(x);\n      }\n    `}}class uI{constructor(e,t=!1){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const r=zO();this.outputShape=e,this.enableShapeUniforms=iI(this.outputShape.length);let n="result";t&&(n="floor(result * 255. + 0.5)"),this.userCode=`\n      ${this.enableShapeUniforms?"\n  int getFlatIndex(ivec3 coords) {\n    return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n  }\n":$O(e)}\n\n      void main() {\n        ivec3 coords = getOutputCoords();\n\n        int flatIndex = getFlatIndex(coords);\n        int offset = imod(flatIndex, 4);\n\n        flatIndex = idiv(flatIndex, 4, 1.);\n\n        int r = flatIndex / texShape[1];\n        int c = imod(flatIndex, texShape[1]);\n        vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]);\n        vec4 values = ${r.texture2D}(A, uv);\n\n        float result;\n\n        if(offset == 0) {\n          result = values[0];\n        } else if(offset == 1) {\n          result = values[1];\n        } else if(offset == 2) {\n          result = values[2];\n        } else {\n          result = values[3];\n        }\n\n        ${r.output} = vec4(${n}, 0., 0., 0.);\n      }\n    `}}class fI{constructor(e,t=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.customUniforms=[{name:"texShape",type:"ivec2"}];const r=zO();this.outputShape=e,this.enableShapeUniforms=iI(this.outputShape.length);let n="",a="result";t&&(a="floor(result * 255. + 0.5)");for(let t=0;t<=1;t++)for(let a=0;a<=1;a++){const i=2*t+a;n+=`\n          localCoords = coords;\n          if(localCoords[2] + ${a} < ${this.enableShapeUniforms?"outShape[2]":`${e[2]}`}) {\n          localCoords[2] += ${a};\n          if (localCoords[1] + ${t} < ${this.enableShapeUniforms?"outShape[1]":`${e[1]}`}) {\n            localCoords[1] += ${t};\n\n            flatIndex = getFlatIndex(localCoords);\n            offset = imod(flatIndex, 4);\n\n            flatIndex = idiv(flatIndex, 4, 1.);\n\n            int r = flatIndex / texShape[1];\n            int c = imod(flatIndex, texShape[1]);\n            vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]);\n            values = ${r.texture2D}(A, uv);\n\n            if (offset == 0) {\n              result[${i}] = values[0];\n            } else if (offset == 1) {\n              result[${i}] = values[1];\n            } else if (offset == 2) {\n              result[${i}] = values[2];\n            } else {\n              result[${i}] = values[3];\n            }\n          }\n        }\n        `}this.userCode=`\n        ${this.enableShapeUniforms?"\n  int getFlatIndex(ivec3 coords) {\n    return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n  }\n":$O(e)}\n\n        void main() {\n          ivec3 coords = getOutputCoords();\n\n          vec4 result = vec4(0.);\n          int flatIndex, r, c, offset;\n          ivec3 localCoords;\n          vec2 uv;\n          vec4 values;\n\n          ${n}\n\n          ${r.output} = ${a};\n        }\n    `}}function pI(e,t,r,n,a,i){!function(e,t){const r=We().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0)throw new Error(`Requested texture size [${e}x${t}] is invalid.`);if(e>r||t>r)throw new Error(`Requested texture size [${e}x${t}] greater than WebGL maximum on this browser / GPU [${r}x${r}].`)}(t,r);const o=function(e){return AO(e,(()=>e.createTexture()),"Unable to create WebGLTexture.")}(e),s=e.TEXTURE_2D;return gO(e,(()=>e.bindTexture(s,o))),gO(e,(()=>e.texParameteri(s,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE))),gO(e,(()=>e.texParameteri(s,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE))),gO(e,(()=>e.texParameteri(s,e.TEXTURE_MIN_FILTER,e.NEAREST))),gO(e,(()=>e.texParameteri(s,e.TEXTURE_MAG_FILTER,e.NEAREST))),1===We().getNumber("WEBGL_VERSION")?gO(e,(()=>e.texImage2D(s,0,n,t,r,0,a,i,null))):gO(e,(()=>e.texStorage2D(s,1,n,t,r))),gO(e,(()=>e.bindTexture(e.TEXTURE_2D,null))),{texture:o,texShape:[r,t]}}function hI(e){return e.internalFormatFloat}function dI(e){return e.internalFormatHalfFloat}function mI(e){return e.downloadTextureFormat}function gI(e){return e.internalFormatPackedFloat}function yI(e){return e.internalFormatPackedHalfFloat}class vI{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];const t=We().getNumber("WEBGL_VERSION");null!=e?(this.gl=e,function(e,t){oO[e]=t}(t,e)):this.gl=lO(t);let r="WEBGL_color_buffer_float";const n="EXT_color_buffer_half_float";if(1===We().getNumber("WEBGL_VERSION")){const e="OES_texture_float",t="OES_texture_half_float";if(this.textureFloatExtension=vO(this.gl,e),PO(this.gl,t))this.textureHalfFloatExtension=vO(this.gl,t);else if(We().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(r),PO(this.gl,n))this.colorBufferHalfFloatExtension=vO(this.gl,n);else if(We().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(r="EXT_color_buffer_float",PO(this.gl,r))this.colorBufferFloatExtension=this.gl.getExtension(r);else{if(!PO(this.gl,n))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(n)}this.vertexBuffer=function(e){return function(e,t){const r=AO(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return gO(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,r))),gO(e,(()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW))),r}(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}(this.gl),this.indexBuffer=function(e){return function(e,t){const r=AO(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return gO(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r))),gO(e,(()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW))),r}(e,new Uint16Array([0,1,2,2,1,3]))}(this.gl),this.framebuffer=function(e){return AO(e,(()=>e.createFramebuffer()),"Unable to create WebGLFramebuffer.")}(this.gl),this.textureConfig=mO(this.gl,this.textureHalfFloatExtension)}get debug(){return We().getBool("DEBUG")}dispose(){if(this.disposed)return;null!=this.program&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture.  This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");const e=this.gl;gO(e,(()=>e.finish())),gO(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,null))),gO(e,(()=>e.deleteFramebuffer(this.framebuffer))),gO(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,null))),gO(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null))),gO(e,(()=>e.deleteBuffer(this.indexBuffer))),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,r,n){const[a,i]=pO(t,r);return pI(e,a,i,hI(n),n.textureFormatFloat,e.FLOAT)}(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,r,n){const[a,i]=pO(t,r);return pI(e,a,i,dI(n),n.textureFormatFloat,n.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,r,n){const[a,i]=pO(t,r);return pI(e,a,i,mI(n),e.RGBA,e.UNSIGNED_BYTE)}(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),function(e,t,r){gO(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),r.data instanceof Uint8Array?2===We().getNumber("WEBGL_VERSION")?gO(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,e.RGBA,e.UNSIGNED_BYTE,r.data))):gO(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r.width,r.height,0,e.RGBA,e.UNSIGNED_BYTE,r.data))):2===We().getNumber("WEBGL_VERSION")?gO(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,r))):gO(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r))),gO(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,r,n){this.throwIfDisposed(),function(e,t,r,n,a,i){let o,s,l;gO(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),a instanceof Uint8Array?(o=new Uint8Array(r*n*4),s=e.UNSIGNED_BYTE,l=e.RGBA):(o=new Float32Array(r*n*4),s=e.FLOAT,l=i.internalFormatPackedFloat),o.set(a),2===We().getNumber("WEBGL_VERSION")?gO(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,r,n,e.RGBA,s,o))):gO(e,(()=>e.texImage2D(e.TEXTURE_2D,0,l,r,n,0,e.RGBA,s,o))),gO(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t,r,n,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,r,n){const[a,i]=dO(t,r);return pI(e,a,i,yI(n),e.RGBA,n.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,r,n){const[a,i]=dO(t,r);return pI(e,a,i,gI(n),e.RGBA,e.FLOAT)}(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(DO(this.gl,this.framebuffer),this.outputTexture=null),gO(this.gl,(()=>this.gl.deleteTexture(e)))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,r){return this.downloadMatrixDriver(e,(()=>function(e,t,r,n){const[a,i]=pO(t,r),o=new Uint8Array(t*r*4);return gO(e,(()=>e.readPixels(0,0,a,i,n.downloadTextureFormat,e.UNSIGNED_BYTE,o))),new Float32Array(o.buffer)}(this.gl,t,r,this.textureConfig)))}downloadPackedMatrixFromBuffer(e,t,r,n,a,i){return function(e,t,r,n,a,i,o,s){const l=e,c=new Float32Array(function(e,t){const[r,n]=dO(e,t);return r*n*4}(i,o));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,c),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),c}(this.gl,e,0,0,0,a,i,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return function(e,t,r){const n=e,a=new Float32Array(r);return n.bindBuffer(n.PIXEL_PACK_BUFFER,t),n.getBufferSubData(n.PIXEL_PACK_BUFFER,0,a),n.bindBuffer(n.PIXEL_PACK_BUFFER,null),a}(this.gl,e,t)}createBufferFromTexture(e,t,r){this.bindTextureToFrameBuffer(e);const n=function(e,t,r,n){const a=e.createBuffer();gO(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,a)));const i=16*t*r;return gO(e,(()=>e.bufferData(e.PIXEL_PACK_BUFFER,i,e.STREAM_READ))),gO(e,(()=>e.readPixels(0,0,r,t,e.RGBA,e.FLOAT,0))),gO(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null))),a}(this.gl,t,r,this.textureConfig);return this.unbindTextureToFrameBuffer(),n}createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,r;if(We().getBool("WEBGL_FENCE_API_ENABLED")){const n=e,a=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),r=()=>{const e=n.clientWaitSync(a,0,0);return e===n.ALREADY_SIGNALED||e===n.CONDITION_SATISFIED},t=a}else We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),r=()=>this.isQueryAvailable(t,We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):r=()=>!0;return{query:t,isFencePassed:r}}downloadMatrixFromPackedTexture(e,t,r){return this.downloadMatrixDriver(e,(()=>function(e,t,r){const n=new Float32Array(t*r*4);return gO(e,(()=>e.readPixels(0,0,r,t,e.RGBA,e.FLOAT,n))),n}(this.gl,t,r)))}createProgram(e){this.throwIfDisposed();const t=this.gl;null==this.vertexShader&&(this.vertexShader=function(e){const t=zO();return function(e,t){const r=AO(e,(()=>e.createShader(e.VERTEX_SHADER)),"Unable to create vertex WebGLShader.");if(gO(e,(()=>e.shaderSource(r,t))),gO(e,(()=>e.compileShader(r))),!1===e.getShaderParameter(r,e.COMPILE_STATUS))throw console.log(e.getShaderInfoLog(r)),new Error("Failed to compile vertex shader.");return r}(e,`${t.version}\n    precision highp float;\n    ${t.attribute} vec3 clipSpacePos;\n    ${t.attribute} vec2 uv;\n    ${t.varyingVs} vec2 resultUV;\n\n    void main() {\n      gl_Position = vec4(clipSpacePos, 1);\n      resultUV = uv;\n    }`)}(t));const r=function(e){return AO(e,(()=>e.createProgram()),"Unable to create WebGLProgram.")}(t);return gO(t,(()=>t.attachShader(r,this.vertexShader))),gO(t,(()=>t.attachShader(r,e))),function(e,t){if(gO(e,(()=>e.linkProgram(t))),!1===e.getProgramParameter(t,e.LINK_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}(t,r),this.debug&&xO(t,r),this.vertexAttrsAreBound||(this.setProgram(r),this.vertexAttrsAreBound=function(e,t,r){return gO(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,r))),_O(e,t,"clipSpacePos",r,3,20,0)&&_O(e,t,"uv",r,2,20,12)}(t,this.program,this.vertexBuffer)),r}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&gO(this.gl,(()=>this.gl.deleteProgram(e)))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&xO(this.gl,this.program),gO(this.gl,(()=>this.gl.useProgram(e)))}getUniformLocation(e,t,r=!0){return this.throwIfDisposed(),r?function(e,t,r){return AO(e,(()=>e.getUniformLocation(t,r)),'uniform "'+r+'" not present in program.')}(this.gl,e,t):function(e,t,r){return e.getUniformLocation(t,r)}(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),gO(this.gl,(()=>this.gl.getAttribLocation(e,t)))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,r){this.throwIfDisposed(),this.throwIfNoProgram(),wO(this.gl,e,t,r)}setOutputMatrixTexture(e,t,r){this.setOutputMatrixTextureDriver(e,r,t)}setOutputPackedMatrixTexture(e,t,r){this.throwIfDisposed();const[n,a]=dO(t,r);this.setOutputMatrixTextureDriver(e,n,a)}setOutputMatrixWriteRegion(e,t,r,n){this.setOutputMatrixWriteRegionDriver(r,e,n,t)}setOutputPackedMatrixWriteRegion(e,t,r,n){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){null!=this.program&&xO(this.gl,this.program),TO(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;this.debug&&this.debugValidate(),gO(e,(()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),gO(this.gl,(()=>this.gl.finish()))}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=vO(this.gl,2===We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(2===We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2(),r=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,r),r}const e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(2===We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2();return void e.endQuery(t.TIME_ELAPSED_EXT)}const e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await me((()=>this.disposed||this.isQueryAvailable(e,We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")))),this.getQueryTime(e,We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(0===t)return null;if(2===t){const t=this.gl;return t.getQueryParameter(e,t.QUERY_RESULT)/1e6}{const t=this.getQueryTimerExtensionWebGL1();return t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(0===t)return!0;if(2===t){const t=this.gl,r=this.getQueryTimerExtensionWebGL2(),n=t.getQueryParameter(e,t.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),n&&!this.disjoint}{const t=this.getQueryTimerExtensionWebGL1(),r=t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(t.GPU_DISJOINT_EXT)),r&&!this.disjoint}}pollFence(e){return new Promise((t=>{this.addItemToPoll((()=>e.isFencePassed()),(()=>t()))}))}pollItems(){const e=function(e){let t=0;for(;t<e.length&&e[t]();++t);return t-1}(this.itemsToPoll.map((e=>e.isDoneFn)));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||me((()=>(this.pollItems(),0===this.itemsToPoll.length)))}bindTextureToFrameBuffer(e){this.throwIfDisposed(),kO(this.gl,e,this.framebuffer),this.debug&&TO(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(kO(this.gl,this.outputTexture,this.framebuffer),this.debug&&TO(this.gl)):DO(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);const r=t();return this.unbindTextureToFrameBuffer(),r}setOutputMatrixTextureDriver(e,t,r){this.throwIfDisposed();const n=this.gl;kO(n,e,this.framebuffer),this.debug&&TO(n),this.outputTexture=e,gO(n,(()=>n.viewport(0,0,t,r))),gO(n,(()=>n.scissor(0,0,t,r)))}setOutputMatrixWriteRegionDriver(e,t,r,n){this.throwIfDisposed(),gO(this.gl,(()=>this.gl.scissor(e,t,r,n)))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(null==this.program)throw new Error("No GPU program is currently set.")}}const{addImpl:bI,bincountImpl:xI,bincountReduceImpl:_I,ceilImpl:wI,concatImpl:kI,equalImpl:DI,expImpl:TI,expm1Impl:AI,floorImpl:SI,gatherNdImpl:MI,gatherV2Impl:EI,greaterImpl:CI,greaterEqualImpl:NI,lessImpl:OI,lessEqualImpl:II,linSpaceImpl:PI,logImpl:RI,maxImpl:LI,maximumImpl:FI,minimumImpl:BI,multiplyImpl:zI,negImpl:jI,notEqualImpl:UI,prodImpl:$I,rangeImpl:VI,rsqrtImpl:qI,sigmoidImpl:WI,simpleAbsImpl:HI,sliceImpl:GI,sparseFillEmptyRowsImpl:XI,sparseReshapeImpl:YI,sparseSegmentReductionImpl:ZI,sqrtImpl:KI,stridedSliceImpl:JI,stringNGramsImpl:QI,stringSplitImpl:eP,stringToHashBucketFastImpl:tP,subImpl:rP,tileImpl:nP,topKImpl:aP,transposeImpl:iP,uniqueImpl:oP}=W;function sP(e,t){return["x","y","z","w","u","v"].slice(0,t).map((t=>`${e}.${t}`))}function lP(e,t){return 1===t?[e]:sP(e,t)}class cP{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=iI(this.outputShape.length),0===this.rank)this.userCode="\n        void main() {\n          setOutput(vec4(getA(), 0., 0., 0.));\n        }\n      ";else{const e=lP("rc",this.rank),t=eI(this.rank),r=this.getOutOfBoundsCondition(e),n=this.getSetup(e),a=this.getOutput(e);this.userCode=`\n        void main() {\n          ${t} rc = getOutputCoords();\n\n          if(${r}) {\n            setOutput(vec4(0));\n          } else {\n            ${n}\n\n            setOutput(vec4(${a}));\n          }\n        }\n      `}}getSourceCoordsArr(e){const t=[];for(let r=0;r<=1;r++)for(let n=0;n<=1;n++){let a=`${0===r?"r":"rp1"}, ${0===n?"c":"cp1"}`;for(let t=2;t<this.rank;t++)a=`${e[e.length-1-t]},`+a;t.push(a)}return t}getOutOfBoundsCondition(e){if(1===this.rank)return`rc > ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let t="";for(let r=this.rank-2;r<this.rank;r++)t+=`${e[r]} >= ${this.enableShapeUniforms?`outShape[${r}]`:this.outputShape[r]}`,r<this.rank-1&&(t+="||");return t}getSetup(e){if(1===this.rank)return"";const t=e.slice(-2),r=this.enableShapeUniforms?`outShape[${this.rank} - 1]`:this.outputShape[this.rank-1],n=this.enableShapeUniforms?`outShape[${this.rank} - 2]`:this.outputShape[this.rank-2];return`\n      int r = ${t[0]};\n      int c = ${t[1]};\n      int rp1 = r + 1;\n      int cp1 = c + 1;\n\n      bool cEdge = cp1 >= ${r};\n      bool rEdge = rp1 >= ${n};\n    `}getOutput(e){const t=this.getSourceCoordsArr(e);return 1===this.rank?`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`:`getA(${t[0]}),\n            cEdge ? 0. : getA(${t[1]}),\n            rEdge ? 0. : getA(${t[2]}),\n            rEdge || cEdge ? 0. : getA(${t[3]})`}}class uP{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=iI(this.outputShape.length);let r="";for(let e=0;e<4;e++){let t="thisRC = rc;";e%2==1&&(t+="thisRC.z += 1;"),e>1&&(t+="thisRC.y += 1;"),r+=`\n        ${t}\n        ${e>0?"if(thisRC.y < rows && thisRC.z < cols){":""}\n          int flatIndex = getFlatIndex(thisRC);\n\n          ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n          vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n          result[${e}] =\n            getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n        ${e>0?"}":""}\n      `}var n,a;this.userCode=`\n      ${n=t,a=this.enableShapeUniforms,`\n    ivec3 inputCoordsFromReshapedOutCoords(int index) {\n      ${a?function(e,t,r="index"){const n=function(e,t){const r=e.length,n=e.map((e=>`${t}[${e}]`)),a=new Array(r-1);a[r-2]=n[r-1];for(let e=r-3;e>=0;--e)a[e]=`(${a[e+1]} * ${n[e+1]})`;return a}(e.map(((e,t)=>t)),t);return n.map(((t,a)=>`int ${e[a]} = ${r} / ${n[a]}; ${a===n.length-1?`int ${e[a+1]} = ${r} - ${e[a]} * ${n[a]}`:`index -= ${e[a]} * ${n[a]}`};`)).join("")}(["r","c","d"],"inputShape"):jO(["r","c","d"],n)}\n      return ivec3(r, c, d);\n    }\n  `}\n      ${this.enableShapeUniforms?"\n  int getFlatIndex(ivec3 coords) {\n    return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n  }\n":$O(e)}\n\n      void main() {\n        ivec3 rc = getOutputCoords();\n\n        vec4 result = vec4(0.);\n\n        ivec3 thisRC;\n        int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]};\n        int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]};\n\n        ${r}\n\n        setOutput(result);\n      }\n    `}}class fP{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}acquireTexture(e,t,r){const n=hP(t,r),a=dP(e,n,r);a in this.freeTextures||(this.freeTextures[a]=[]),a in this.usedTextures||(this.usedTextures[a]=[]);const i=pP(e,n,this.gpgpu.gl,this.gpgpu.textureConfig,r);if(this.freeTextures[a].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=i,this.log();const e=this.freeTextures[a].shift();return this.usedTextures[a].push(e),e}let o;return n===fO.PACKED_2X2_FLOAT32?o=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):n===fO.PACKED_2X2_FLOAT16?o=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):n===fO.UNPACKED_FLOAT32?o=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):n===fO.UNPACKED_FLOAT16?o=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):n===fO.PACKED_4X1_UNSIGNED_BYTE&&(o=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[a].push(o),this.numUsedTextures++,this._numBytesAllocated+=i,this.log(),o}releaseTexture(e,t,r,n){if(null==this.freeTextures)return;const a=hP(r,n),i=dP(t,a,n);i in this.freeTextures||(this.freeTextures[i]=[]);const o=pP(t,a,this.gpgpu.gl,this.gpgpu.textureConfig,n),s=We().get("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==s&&this._numBytesAllocated>s?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=o):(this.freeTextures[i].push(e),this.numFreeTextures++,this._numBytesFree+=o),this.numUsedTextures--;const l=this.usedTextures[i],c=l.indexOf(e);if(c<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l.splice(c,1),this.log()}log(){if(!this.logEnabled)return;const e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);const t=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*t)}%)`)}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(null!=this.freeTextures){for(const e in this.freeTextures)this.freeTextures[e].forEach((e=>{this.gpgpu.deleteMatrixTexture(e.texture)}));for(const e in this.usedTextures)this.usedTextures[e].forEach((e=>{this.gpgpu.deleteMatrixTexture(e.texture)}));this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}function pP(e,t,r,n,a){const i=function(e,t){switch(e){case fO.PACKED_2X2_FLOAT32:return gI(t);case fO.PACKED_2X2_FLOAT16:return yI(t);case fO.UNPACKED_FLOAT32:return hI(t);case fO.UNPACKED_FLOAT16:return dI(t);case fO.PACKED_4X1_UNSIGNED_BYTE:return mI(t);default:throw new Error(`Unknown physical texture type ${e}`)}}(t,n);let o;if(a){const[t,r]=dO(e[0],e[1]);o=t*r}else{const[t,r]=pO(e[0],e[1]);o=t*r}const s=function(e,t){const r=e;if(t===r.R32F)return 4;if(t===r.R16F)return 2;if(t===r.RGBA32F)return 16;if(t===e.RGBA)return 16;if(t===r.RGBA16F)return 8;if(t===r.RGBA8)return 4;throw new Error(`Unknown internal format ${t}`)}(r,i);return o*s}function hP(e,t){if(e===uO.UPLOAD)return fO.PACKED_2X2_FLOAT32;if(e===uO.RENDER||null==e)return function(e){return We().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?fO.PACKED_2X2_FLOAT32:fO.UNPACKED_FLOAT32:e?fO.PACKED_2X2_FLOAT16:fO.UNPACKED_FLOAT16}(t);if(e===uO.DOWNLOAD||e===uO.PIXELS)return fO.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function dP(e,t,r){return`${e[0]}_${e[1]}_${t}_${r}`}class mP{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=iI(this.outputShape.length),this.userCode=`\n      float unaryOperation(float x) {\n        ${t}\n      }\n\n      void main() {\n        float x = getAAtOutCoords();\n        float y = unaryOperation(x);\n\n        setOutput(y);\n      }\n    `}}const gP="return abs(x);",yP="return x;";class vP{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=iI(this.outputShape.length),this.userCode=`\n      vec4 unaryOperation(vec4 x) {\n        ${t}\n      }\n\n      void main() {\n        vec4 x = getAAtOutCoords();\n        vec4 y = unaryOperation(x);\n\n        setOutput(y);\n      }\n    `}}class bP{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=iI(this.outputShape.length);const t=e.length,r=lP("rc",t),n=eI(t),a=function(e,t){if(1===e)return"rc";let r="";for(let n=0;n<e;n++)r+=t[n],n<e-1&&(r+=",");return r}(t,r),i=r.slice(-2),o=t<=1?"rc":`vec2(${i.join(",")})`;this.userCode=`\n      void main() {\n        ${n} rc = getOutputCoords();\n        vec4 packedInput = getA(${a});\n\n        setOutput(getChannel(packedInput, ${o}));\n      }\n    `}}const xP=up,_P={},wP=We().getNumber("CPU_HANDOFF_SIZE_THRESHOLD");class kP extends G{constructor(e){if(super(),this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!We().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");let t;if(null!=e){if(e instanceof vI)t=e;else{const r=lO(We().getNumber("WEBGL_VERSION"),e);t=new vI(r)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{const e=lO(We().getNumber("WEBGL_VERSION"));t=new vI(e),this.binaryCache=((r=We().getNumber("WEBGL_VERSION"))in _P||(_P[r]={}),_P[r]),this.gpgpuCreatedLocally=!0}var r;this.gpgpu=t,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new fP(this.gpgpu),this.numMBBeforeWarning=null==We().global.screen?1024:We().global.screen.height*We().global.screen.width*window.devicePixelRatio*600/1024/1024,this.texData=new H(this,Hs())}nextDataId(){return kP.nextDataId++}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}write(e,t,r){if((We().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||We().getBool("DEBUG"))&&this.checkNumericalProblems(e),"complex64"===r&&null!=e)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");const n={id:this.nextDataId()};return this.texData.set(n,{shape:t,dtype:r,values:e,usage:uO.UPLOAD,refCount:1}),n}refCount(e){return this.texData.has(e)?this.texData.get(e).refCount:0}incRef(e){this.texData.get(e).refCount++}decRef(e){this.texData.has(e)&&this.texData.get(e).refCount--}move(e,t,r,n,a){if(We().getBool("DEBUG")&&this.checkNumericalProblems(t),"complex64"===n)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:r,dtype:n,values:t,usage:uO.UPLOAD,refCount:a})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){const t=this.texData.get(e),{values:r,dtype:n,complexTensorInfos:a,slice:i,shape:o,isPacked:s}=t;if(null!=i){let t;t=s?new vP(o,yP):new mP(o,yP);const r=this.runWebGLProgram(t,[{dataId:e,shape:o,dtype:n}],n),a=this.readSync(r.dataId);return this.disposeIntermediateTensorInfo(r),a}if(null!=r)return this.convertAndCacheOnCPU(e);if("string"===n)return r;const l=null!=this.activeTimers;let c,u;return l&&(c=Na()),u="complex64"===n?Qh(this.readSync(a.real.dataId),this.readSync(a.imag.dataId)):this.getValuesFromTexture(e),l&&(this.downloadWaitMs+=Na()-c),this.convertAndCacheOnCPU(e,u)}async read(e){if(this.pendingRead.has(e)){const t=this.pendingRead.get(e);return new Promise((e=>t.push(e)))}const t=this.texData.get(e),{values:r,shape:n,slice:a,dtype:i,complexTensorInfos:o,isPacked:s}=t;if(null!=a){let t;t=s?new vP(n,yP):new mP(n,yP);const r=this.runWebGLProgram(t,[{dataId:e,shape:n,dtype:i}],i),a=this.read(r.dataId);return this.disposeIntermediateTensorInfo(r),a}if(null!=r)return this.convertAndCacheOnCPU(e);if(We().getBool("DEBUG")&&!We().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===We().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l,c,u=null;if("complex64"!==i&&We().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);const t=this.texData.get(l.dataId);u=this.gpgpu.createBufferFromTexture(t.texture.texture,...hO(n))}if(this.pendingRead.set(e,[]),"complex64"!==i&&await this.gpgpu.createAndWaitForFence(),"complex64"===i){const e=await Promise.all([this.read(o.real.dataId),this.read(o.imag.dataId)]);c=Qh(e[0],e[1])}else if(null==u)c=this.getValuesFromTexture(e);else{const e=se(n);c=this.gpgpu.downloadFloat32MatrixFromBuffer(u,e)}if(null!=l&&this.disposeIntermediateTensorInfo(l),null!=u){const e=this.gpgpu.gl;gO(e,(()=>e.deleteBuffer(u)))}const f=this.convertAndCacheOnCPU(e,c),p=this.pendingRead.get(e);return this.pendingRead.delete(e),p.forEach((e=>e(f))),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&Hs().removeDataId(e,this),this.pendingDeletes--),f}readToGPU(e,t={}){const r=this.texData.get(e),{values:n,shape:a,slice:i,dtype:o,isPacked:s,texture:l}=r;if("complex64"===o)throw new Error("Does not support reading texture for complex64 dtype.");if(null!=i){let r;r=s?new vP(a,yP):new mP(a,yP);const n=this.runWebGLProgram(r,[{dataId:e,shape:a,dtype:o}],o),i=this.readToGPU(n,t);return this.disposeIntermediateTensorInfo(n),i}if(null==l)throw null!=n?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");const c=this.decode(e,t.customTexShape),u=Hs().makeTensorFromDataId(c.dataId,c.shape,c.dtype),f=this.texData.get(c.dataId);return Object.assign({tensorRef:u},f.texture)}bufferSync(e){const t=this.readSync(e.dataId);let r=t;if("string"===e.dtype)try{r=t.map((e=>Pa(e)))}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return To(e.shape,e.dtype,r)}checkNumericalProblems(e){if(null!=e)for(let t=0;t<e.length;t++){const r=e[t];if(!yO(r)){if(We().getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))throw Error(`The value ${r} cannot be represented with your current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'`);throw Error(`The value ${r} cannot be represented on this device.`)}}}getValuesFromTexture(e){const{shape:t,dtype:r,isPacked:n}=this.texData.get(e),a=se(t);if(We().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")){const r=this.decode(e),n=this.texData.get(r.dataId),i=this.gpgpu.downloadMatrixFromPackedTexture(n.texture.texture,...hO(t)).subarray(0,a);return this.disposeIntermediateTensorInfo(r),i}const i=We().getBool("WEBGL_PACK")&&!0===n,o=i?EO(t):t,s=i?new cI(o):new lI(o),l=this.runWebGLProgram(s,[{shape:o,dtype:r,dataId:e}],"float32"),c=this.texData.get(l.dataId),u=this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(c.texture.texture,c.texShape[0],c.texShape[1]).subarray(0,a);return this.disposeIntermediateTensorInfo(l),u}timerAvailable(){return We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0}time(e){const t=this.activeTimers,r=[];let n=!1;null==this.programTimersStack?(this.programTimersStack=r,n=!0):this.activeTimers.push(r),this.activeTimers=r,e();const a=oe(this.activeTimers.map((e=>e.query))).filter((e=>null!=e)),i=oe(this.activeTimers.map((e=>e.name))).filter((e=>null!=e));this.activeTimers=t,n&&(this.programTimersStack=null);const o={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const e=await Promise.all(a);o.kernelMs=ee(e),o.getExtraProfileInfo=()=>e.map(((e,t)=>({name:i[t],ms:e}))).map((e=>`${e.name}: ${e.ms}`)).join(", ")}else o.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,o})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:Na(),endMs:null}}endTimer(e){return We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=Na(),e)}async getQueryTime(e){if(We().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);const t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);const{complexTensorInfos:r}=this.texData.get(e);return null!=r&&(this.disposeData(r.real.dataId,t),this.disposeData(r.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){const{texture:t,dtype:r,texShape:n,usage:a,isPacked:i,slice:o}=this.texData.get(e),s=o&&o.origDataId||e,l=this.dataRefCount.get(s);l>1?this.dataRefCount.set(s,l-1):(this.dataRefCount.delete(s),null!=t&&(this.numBytesInGPU-=this.computeBytes(n,r),this.textureManager.releaseTexture(t,n,a,i)));const c=this.texData.get(e);c.texture=null,c.texShape=null,c.isPacked=!1,c.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=wP){return We().getBool("WEBGL_CPU_FORWARD")&&e.every((e=>null==this.texData.get(e.dataId).texture&&se(e.shape)<t))}getGPGPUContext(){return this.gpgpu}where(e){ra("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");const t=e.dataSync();return xP(e.shape,t)}packedUnaryOp(e,t,r){const n=new vP(e.shape,t),a=this.compileAndRun(n,[e],r);return Hs().makeTensorFromDataId(a.dataId,a.shape,a.dtype)}abs(e){if(this.shouldExecuteOnCPU([e])&&"complex64"!==e.dtype){const t=HI(this.texData.get(e.dataId).values);return this.makeOutput(e.shape,e.dtype,t)}if(We().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,gP,e.dtype);const t=new mP(e.shape,gP),r=this.compileAndRun(t,[e]);return Hs().makeTensorFromDataId(r.dataId,r.shape,r.dtype)}makeTensorInfo(e,t,r){let n;if("string"===t&&null!=r&&r.length>0&&Se(r[0])){const a=r.map((e=>Ia(e)));n=this.write(a,e,t)}else n=this.write(r,e,t);return this.texData.get(n).usage=null,{dataId:n,shape:e,dtype:t}}makeOutput(e,t,r){const{dataId:n}=this.makeTensorInfo(e,t,r);return Hs().makeTensorFromDataId(n,e,t,this)}unpackTensor(e){const t=new bP(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new cP(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){const r=[SO(e.shape),...MO(e.shape)],n={dtype:e.dtype,shape:r,dataId:e.dataId},a=[SO(t),...MO(t)],i=new uP(a,r),o=[r],s=this.runWebGLProgram(i,[n],e.dtype,o,!0);return{dataId:s.dataId,shape:t,dtype:s.dtype}}decode(e,t){const r=this.texData.get(e),{isPacked:n,shape:a,dtype:i}=r;null!=t&&ne(se(a)<=t[0]*t[1]*4,(()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data."));const o=EO(a);let s;s=n?new sI(o):new oI(o);const l=[null!=t?t:hO(o)];return{dtype:i,shape:a,dataId:this.runWebGLProgram(s,[{shape:o,dtype:i,dataId:e}],i,l,!0,t).dataId}}runWebGLProgram(e,t,r,n,a=!1,i){const o=this.makeTensorInfo(e.outputShape,r),s=this.texData.get(o.dataId);if(e.packedOutput&&(s.isPacked=!0),e.outPackingScheme===cO.DENSE){const t=null!=i?i:hO(e.outputShape);s.texShape=t.map((e=>2*e))}if(null!=e.outTexUsage&&(s.usage=e.outTexUsage),0===se(o.shape))return s.values=be(o.dtype,0),o;const l=[],c=t.map((t=>{if("complex64"===t.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let r=this.texData.get(t.dataId);if(null==r.texture){if(!e.packedInputs&&se(t.shape)<=We().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:r.values};e.packedInputs&&(r.isPacked=!0,r.shape=t.shape)}if(this.uploadToGPU(t.dataId),!!r.isPacked!=!!e.packedInputs)t=r.isPacked?this.unpackTensor(t):this.packTensor(t),l.push(t),r=this.texData.get(t.dataId);else if(r.isPacked&&!NO(r.shape,t.shape)){const e=t,n=t.shape;t.shape=r.shape,t=this.packedReshape(t,n),l.push(t),r=this.texData.get(t.dataId),e.shape=n}return{shape:t.shape,texData:r,isUniform:!1}}));this.uploadToGPU(o.dataId);const u={shape:o.shape,texData:s,isUniform:!1},f=function(e,t,r){let n="";t.concat(r).forEach((t=>{const a=null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!t.isUniform){const i=t.texData.texShape,{useSqueezeShape:o,uniformShape:s,keptDims:l}=tI(e.packedInputs,t.shape,i);let c="",u="",f="";if(1===s.length&&e.packedInputs){const e=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];c=`${e[0]>1}_${e[1]>1}`}else if(2!==s.length||e.packedInputs){if(s.length>2&&!e.packedInputs){const e=Ie(s);f=`${e[0]===i[1]}_${e[e.length-1]===i[1]}`}}else u=`${s[0]>1}_${s[1]>1}`;const p=t.shape.length,h=2===s.length&&ce(t.shape,i),d=1===se(t.shape),m=Zo(t.shape,r.shape),g=!e.packedInputs&&p===r.shape.length&&ce(i,r.texData.texShape),y=e.packedInputs||s.length>2?"":`${i[0]>1}_${i[1]>1}`;n+=`${p}_${g}_${o?l:""}_${s.length}_${d}_${m}_${h}_${c}_${u}_${f}_${y}_${a}`}else{const e=t.isUniform?"uniform":t.texData.texShape;n+=`${t.shape}_${e}_${a}`}}));const a=e.userCode;let i=e.constructor.name;return i+="_"+n+"_"+a+`${We().getNumber("WEBGL_VERSION")}`,i}(e,c,u),p=this.getAndSaveBinary(f,(()=>function(e,t,r,n){const a=r.map(((e,r)=>{const n={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(n.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[r],shapeInfo:n}})),i=a.map((e=>e.shapeInfo)),o={logicalShape:n.shape,texShape:n.texData.texShape,isUniform:!1,isPacked:n.texData.isPacked,flatOffset:null},s=WO(a,o,t),l=function(e,t){const r=AO(e,(()=>e.createShader(e.FRAGMENT_SHADER)),"Unable to create fragment WebGLShader.");if(gO(e,(()=>e.shaderSource(r,t))),gO(e,(()=>e.compileShader(r))),!1===e.getShaderParameter(r,e.COMPILE_STATUS))throw function(e,t){const r=bO.exec(t);if(null==r)return console.log(`Couldn't parse line number in error: ${t}`),void console.log(e);const n=+r[1],a=e.split("\n"),i=a.length.toString().length+2,o=a.map(((e,t)=>de((t+1).toString(),i)+e));let s=0;for(let e=0;e<o.length;e++)s=Math.max(o[e].length,s);const l=o.slice(0,n-1),c=o.slice(n-1,n),u=o.slice(n);console.log(l.join("\n")),console.log(t.split("\n")[0]),console.log(`%c ${de(c[0],s)}`,"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(u.join("\n"))}(t,e.getShaderInfoLog(r)),new Error("Failed to compile fragment shader.");return r}(e.gl,s),c=e.createProgram(l);let u=null;const f=e.getUniformLocation(c,"NAN",!1);1===We().getNumber("WEBGL_VERSION")&&(u=e.getUniformLocation(c,"INFINITY",!1));const p=!1,h={},d={},m={};for(let r=0;r<t.variableNames.length;r++){const n=t.variableNames[r];h[n]=e.getUniformLocation(c,n,p),h[`offset${n}`]=e.getUniformLocation(c,`offset${n}`,p),t.enableShapeUniforms&&(d[`${n}Shape`]=e.getUniformLocation(c,`${n}Shape`,p),m[`${n}TexShape`]=e.getUniformLocation(c,`${n}TexShape`,p))}let g,y,v;t.enableShapeUniforms&&(g=e.getUniformLocation(c,"outShape",p),v=e.getUniformLocation(c,"outShapeStrides",p),y=e.getUniformLocation(c,"outTexShape",p));const b=[];return t.customUniforms&&t.customUniforms.forEach(((t,r)=>{b[r]=e.getUniformLocation(c,t.name,p)})),{program:t,fragmentShader:l,source:s,webGLProgram:c,uniformLocations:h,customUniformLocations:b,inShapeInfos:i,outShapeInfo:o,infLoc:u,nanLoc:f,inShapesLocations:d,inTexShapesLocations:m,outShapeLocation:g,outShapeStridesLocation:v,outTexShapeLocation:y}}(this.gpgpu,e,c,u))),h=null!=this.activeTimers;let d;h&&(d=this.startTimer()),function(e,t,r,n,a){t.program.enableShapeUniforms||(aI(t.inShapeInfos,r),aI([t.outShapeInfo],[n]));const i=n.texData.texture,o=n.texData.texShape;n.texData.isPacked?e.setOutputPackedMatrixTexture(i.texture,o[0],o[1]):e.setOutputMatrixTexture(i.texture,o[0],o[1]),e.setProgram(t.webGLProgram),1===We().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN),r.forEach(((r,n)=>{const a=t.program.variableNames[n],i=t.uniformLocations[a],o=t.uniformLocations[`offset${a}`],s=t.inShapesLocations[`${a}Shape`],l=t.inTexShapesLocations[`${a}TexShape`];if(s){const{uniformShape:n}=tI(t.program.packedInputs,r.shape,r.texData.texShape);switch(n.length){case 1:e.gl.uniform1iv(s,new Int32Array(n));break;case 2:e.gl.uniform2iv(s,new Int32Array(n));break;case 3:e.gl.uniform3iv(s,new Int32Array(n));break;case 4:e.gl.uniform4iv(s,new Int32Array(n))}}if(l&&e.gl.uniform2i(l,r.texData.texShape[0],r.texData.texShape[1]),null!=i)if(r.isUniform)if(se(r.shape)<2)e.gl.uniform1f(i,r.uniformValues[0]);else{let t=r.uniformValues;t instanceof Float32Array||(t=new Float32Array(t)),e.gl.uniform1fv(i,t)}else null!=r.texData.slice&&null!=o&&e.gl.uniform1i(o,r.texData.slice.flatOffset),e.setInputMatrixTexture(r.texData.texture.texture,i,n)}));const s=t.outShapeLocation;if(s)switch(n.shape.length){case 1:e.gl.uniform1iv(s,new Int32Array(n.shape));break;case 2:e.gl.uniform2iv(s,new Int32Array(n.shape));break;case 3:e.gl.uniform3iv(s,new Int32Array(n.shape));break;case 4:e.gl.uniform4iv(s,new Int32Array(n.shape))}if(t.outShapeStridesLocation){const r=Ie(n.shape);switch(n.shape.length){case 2:e.gl.uniform1iv(t.outShapeStridesLocation,new Int32Array(r));break;case 3:e.gl.uniform2iv(t.outShapeStridesLocation,new Int32Array(r));break;case 4:e.gl.uniform3iv(t.outShapeStridesLocation,new Int32Array(r))}}t.outTexShapeLocation&&e.gl.uniform2i(t.outTexShapeLocation,n.texData.texShape[0],n.texData.texShape[1]),t.program.customUniforms&&a&&t.program.customUniforms.forEach(((r,n)=>{const i=t.customUniformLocations[n],o=a[n];if("float"===r.type)e.gl.uniform1fv(i,o);else if("vec2"===r.type)e.gl.uniform2fv(i,o);else if("vec3"===r.type)e.gl.uniform3fv(i,o);else if("vec4"===r.type)e.gl.uniform4fv(i,o);else if("int"===r.type)e.gl.uniform1iv(i,o);else if("ivec2"===r.type)e.gl.uniform2iv(i,o);else if("ivec3"===r.type)e.gl.uniform3iv(i,o);else{if("ivec4"!==r.type)throw Error(`uniform type ${r.type} is not supported yet.`);e.gl.uniform4iv(i,o)}})),e.executeProgram()}(this.gpgpu,p,c,u,n),l.forEach((e=>this.disposeIntermediateTensorInfo(e))),h&&(d=this.endTimer(d),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(d)}));const m=We().get("WEBGL_FLUSH_THRESHOLD");if(m>0){const e=Na();e-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!We().getBool("WEBGL_LAZILY_UNPACK")&&s.isPacked&&!1===a){const e=this.unpackTensor(o);return this.disposeIntermediateTensorInfo(o),e}return o}compileAndRun(e,t,r,n,a=!1){return r=r||t[0].dtype,this.runWebGLProgram(e,t,r,n,a)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(We().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach((e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]})),this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)}floatPrecision(){return null==this.floatPrecisionValue&&(this.floatPrecisionValue=Ys((()=>{if(!We().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=We().getBool("DEBUG");We().set("DEBUG",!1);const t=this.abs(wl(1e-8)).dataSync()[0];if(We().set("DEBUG",e),t>0)return 32}return 16}))),this.floatPrecisionValue}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}uploadToGPU(e){const t=this.texData.get(e),{shape:r,dtype:n,values:a,texture:i,usage:o,isPacked:s}=t;if(null!=i)return;const l=null!=this.activeTimers;let c;l&&(c=Na());let u=t.texShape;if(null==u&&(u=function(e,t=!1){let r=We().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(t&&(r*=2,1===(e=e.map(((t,r)=>r>=e.length-2?J(e[r]):e[r]))).length&&(e=[2,e[0]])),2!==e.length){const t=ve(e);e=t.newShape}let n=se(e);if(e.length<=1&&n<=r)return[1,n];if(2===e.length&&e[0]<=r&&e[1]<=r)return e;if(3===e.length&&e[0]*e[1]<=r&&e[2]<=r)return[e[0]*e[1],e[2]];if(3===e.length&&e[0]<=r&&e[1]*e[2]<=r)return[e[0],e[1]*e[2]];if(4===e.length&&e[0]*e[1]*e[2]<=r&&e[3]<=r)return[e[0]*e[1]*e[2],e[3]];if(4===e.length&&e[0]<=r&&e[1]*e[2]*e[3]<=r)return[e[0],e[1]*e[2]*e[3]];if(t){const t=SO(e);let r=2,a=2;return e.length&&([r,a]=MO(e)),n=t*(r/2)*(a/2),pe(n).map((e=>2*e))}return pe(n)}(r,s),t.texShape=u),null!=a){const e=EO(r);let i,o=u[1],f=u[0];const p=a instanceof Uint8Array||a instanceof Uint8ClampedArray;!s&&p||([o,f]=dO(u[0],u[1])),i=s?new fI(e,p):new uI(e,p);const h=p?[f,o]:u,d=this.makeTensorInfo(h,n),m=this.texData.get(d.dataId);m.usage=p?uO.PIXELS:uO.UPLOAD,m.texShape=h,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(d.dataId),o,f,a);const g=[[f,o]],y=!0,v=this.runWebGLProgram(i,[d],n,g,y),b=this.texData.get(v.dataId);t.texture=b.texture,t.texShape=b.texShape,t.isPacked=b.isPacked,t.usage=b.usage,this.disposeIntermediateTensorInfo(d),this.texData.delete(v.dataId),t.values=null,l&&(this.uploadWaitMs+=Na()-c)}else{const e=this.acquireTexture(u,o,n,s);t.texture=e}}convertAndCacheOnCPU(e,t){const r=this.texData.get(e),{dtype:n}=r;return this.releaseGPUData(e),null!=t&&(r.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){const r="int32"===t?new Int32Array(e.length):new Uint8Array(e.length);for(let t=0;t<r.length;++t)r[t]=Math.round(e[t]);return r}throw new Error(`Unknown dtype ${t}`)}(t,n)),r.values}acquireTexture(e,t,r,n){if(this.numBytesInGPU+=this.computeBytes(e,r),!this.warnedAboutMemory&&this.numBytesInGPU>1024*this.numMBBeforeWarning*1024){const e=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${e} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,n)}computeBytes(e,t){return e[0]*e[1]*Te(t)}}kP.nextDataId=0,vi()&&il("webgl",(()=>new kP),2);class DP{constructor(e,t,r){this.variableNames=["A","B"],this.outputShape=Jo(t,r),this.enableShapeUniforms=iI(this.outputShape.length),this.userCode=`\n      float binaryOperation(float a, float b) {\n        ${e}\n      }\n\n      void main() {\n        float a = getAAtOutCoords();\n        float b = getBAtOutCoords();\n        setOutput(binaryOperation(a, b));\n      }\n    `}}class TP{constructor(e,t,r,n=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=Jo(t,r);const a=this.outputShape.length;this.enableShapeUniforms=iI(a);let i="";if(n)if(0===a||1===se(this.outputShape))i="\n          result.y = 0.;\n          result.z = 0.;\n          result.w = 0.;\n        ";else if(i=`\n          ${eI(a)} coords = getOutputCoords();\n        `,1===a)this.enableShapeUniforms?i+="\n            result.y = (coords + 1) >= outShape ? 0. : result.y;\n            result.z = 0.;\n            result.w = 0.;\n          ":i+=`\n            result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n            result.z = 0.;\n            result.w = 0.;\n          `;else{const e=lP("coords",a);this.enableShapeUniforms?i+=`\n            bool nextRowOutOfBounds =\n              (${e[a-2]} + 1) >= outShape[${a} - 2];\n            bool nextColOutOfBounds =\n              (${e[a-1]} + 1) >= outShape[${a} - 1];\n            result.y = nextColOutOfBounds ? 0. : result.y;\n            result.z = nextRowOutOfBounds ? 0. : result.z;\n            result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n          `:i+=`\n            bool nextRowOutOfBounds =\n              (${e[a-2]} + 1) >= ${this.outputShape[a-2]};\n            bool nextColOutOfBounds =\n              (${e[a-1]} + 1) >= ${this.outputShape[a-1]};\n            result.y = nextColOutOfBounds ? 0. : result.y;\n            result.z = nextRowOutOfBounds ? 0. : result.z;\n            result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n          `}this.userCode=`\n      vec4 binaryOperation(vec4 a, vec4 b) {\n        ${e}\n      }\n\n      void main() {\n        vec4 a = getAAtOutCoords();\n        vec4 b = getBAtOutCoords();\n\n        vec4 result = binaryOperation(a, b);\n        ${i}\n\n        setOutput(result);\n      }\n    `}}function AP(e){const{inputs:t,backend:r}=e,{x:n}=t;return r.incRef(n.dataId),{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}const SP={kernelName:cr,backendName:"webgl",kernelFunc:AP};function MP(e){const{inputs:t,backend:r}=e,{real:n,imag:a}=t,i=r.makeTensorInfo(n.shape,"complex64"),o=r.texData.get(i.dataId),s=AP({inputs:{x:n},backend:r}),l=AP({inputs:{x:a},backend:r});return o.complexTensorInfos={real:s,imag:l},i}const EP={kernelName:wt,backendName:"webgl",kernelFunc:MP},CP="return (a < 0.) ? b * a : a;",NP="\n  vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n  return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n",OP={kernelName:mr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{alpha:i}=n,o=r.makeTensorInfo([],"float32",Ea(i,"float32")),s=We().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new TP(NP,a.shape,o.shape):new DP(CP,a.shape,o.shape),l=r.runWebGLProgram(s,[a,o],"float32");return r.disposeIntermediateTensorInfo(o),l}},IP="return (a < 0.) ? b * a : a;",PP="\n  vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n  return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n",RP={kernelName:Jr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{x:n,alpha:a}=t,i=We().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new TP(PP,n.shape,a.shape):new DP(IP,n.shape,a.shape);return r.runWebGLProgram(i,[n,a],"float32")}};function LP({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:r,dtype:n}){return({inputs:a,backend:i})=>{const{x:o}=a,s=i,l=n||o.dtype;if(s.shouldExecuteOnCPU([o])&&null!=r){const e=s.texData.get(o.dataId),t=r(e.values,l);return s.makeTensorInfo(o.shape,l,t)}let c;return c=We().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new vP(o.shape,t):new mP(o.shape,e),s.runWebGLProgram(c,[o],l)}}function FP({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:r=!1,supportsComplex:n=!1,cpuKernelImpl:a,dtype:i}){return({inputs:o,backend:s})=>{const{a:l,b:c}=o,u=s;if(n&&"complex64"===l.dtype){const t=u.texData.get(l.dataId),r=u.texData.get(c.dataId),[n,a]=[[t.complexTensorInfos.real,r.complexTensorInfos.real],[t.complexTensorInfos.imag,r.complexTensorInfos.imag]].map((t=>{const[r,n]=t,a={dataId:r.dataId,dtype:r.dtype,shape:l.shape},i={dataId:n.dataId,dtype:n.dtype,shape:c.shape},o=new DP(e,l.shape,c.shape);return u.runWebGLProgram(o,[a,i],ri(r.dtype,n.dtype))})),i=MP({inputs:{real:n,imag:a},backend:u});return u.disposeIntermediateTensorInfo(n),u.disposeIntermediateTensorInfo(a),i}const f=i||ri(l.dtype,c.dtype);if(("string"===l.dtype||"string"===c.dtype||u.shouldExecuteOnCPU([l,c]))&&null!=a){const e=u.texData.get(l.dataId).values,t=u.texData.get(c.dataId).values,r="string"===l.dtype?Cd(e):e,n="string"===l.dtype?Cd(t):t,[i,o]=a(l.shape,c.shape,r,n,f),s=u.makeTensorInfo(o,f);return u.texData.get(s.dataId).values=i,s}let p;return p=We().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new TP(t,l.shape,c.shape,r):new DP(e,l.shape,c.shape),u.runWebGLProgram(p,[l,c],f)}}function BP(e,t=!1){if("linear"===e)return"return x;";if("relu"===e)return t?"\n  vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n  bvec4 isNaN = isnan(x);\n\n  result.r = isNaN.r ? x.r : result.r;\n  result.g = isNaN.g ? x.g : result.g;\n  result.b = isNaN.b ? x.b : result.b;\n  result.a = isNaN.a ? x.a : result.a;\n\n  return result;\n":"if (isnan(x)) return x;\n  return (x < 0.0) ? 0.0 : x;\n";if("elu"===e)return t?"\n  vec4 result;\n\n  result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n  result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n  result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n  result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n  return result;\n":"return (x >= 0.0) ? x : (exp(x) - 1.0);";if("relu6"===e)return t?"\n  vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n  bvec4 isNaN = isnan(x);\n\n  result.r = isNaN.r ? x.r : result.r;\n  result.g = isNaN.g ? x.g : result.g;\n  result.b = isNaN.b ? x.b : result.b;\n  result.a = isNaN.a ? x.a : result.a;\n\n  return result;\n":"if (isnan(x)) return x;\n  return (x < 0.0) ? 0.0 : min(6.0, x);\n";if("prelu"===e)return t?PP:IP;if("leakyrelu"===e)return t?NP:CP;if("sigmoid"===e)return"return 1.0 / (1.0 + exp(-1.0 * x));";throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}class zP{constructor(e,t,r,n=!1,a=!1,i=!1,o=null,s=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=r,this.enableShapeUniforms=iI(this.outputShape.length);const c=n?e[1]:e[2],u=Math.ceil(c/2),f=n?"i * 2, rc.y":"rc.y, i * 2",p=a?"rc.z, i * 2":"i * 2, rc.z",h=n?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],d=a?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let m="",g="";o&&(m=s?`vec4 activation(vec4 a) {\n          vec4 b = getPreluActivationWeightsAtOutCoords();\n          ${o}\n        }`:l?`vec4 activation(vec4 a) {\n          vec4 b = getLeakyreluAlphaAtOutCoords();\n          ${o}\n        }`:`vec4 activation(vec4 x) {\n          ${o}\n        }`,g="result = activation(result);");const y=i?"result += getBiasAtOutCoords();":"";i&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),l&&this.variableNames.push("leakyreluAlpha");let v="rc.x",b="rc.x";e[0]<t[0]?v=`int(min(float(rc.x), ${e[0]-1}.))`:t[0]<e[0]&&(b=`int(min(float(rc.x), ${t[0]-1}.))`),this.userCode=`\n      ${m}\n      // Don't use uniform for sharedDimensionPacked for performance.\n      const float sharedDimension = ${u}.0;\n\n      vec4 dot2x2ARowBCol(ivec3 rc) {\n        vec4 result = vec4(0);\n        for (int i = 0; i < ${u}; i++) {\n          int batchA = ${v};\n          int batchB = ${b};\n          vec4 a = getMatrixA(batchA, ${f});\n          vec4 b = getMatrixB(batchB, ${p});\n\n          // These swizzled products need to be separately added.\n          // See: https://github.com/tensorflow/tfjs/issues/1735\n          result += (${h[0]} * ${d[0]});\n          result += (${h[1]} * ${d[1]});\n        }\n        return result;\n      }\n\n      void main() {\n        ivec3 rc = getOutputCoords();\n        vec4 result = dot2x2ARowBCol(rc);\n\n        ${y}\n\n        ${g}\n\n        setOutput(result);\n      }\n    `}}class jP{constructor(e,t,r){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=Jo(t,r),this.userCode=`\n      float binaryOpComplex(\n          float areal, float aimag, float breal, float bimag) {\n        ${e}\n      }\n\n      void main() {\n        float areal = getARealAtOutCoords();\n        float aimag = getAImagAtOutCoords();\n        float breal = getBRealAtOutCoords();\n        float bimag = getBImagAtOutCoords();\n        setOutput(binaryOpComplex(areal, aimag, breal, bimag));\n      }\n    `}}const UP="return a * b;";function $P(e){const{inputs:t,backend:r}=e,{a:n,b:a}=t,i=ri(n.dtype,a.dtype);if("complex64"===n.dtype){const e=r.texData.get(n.dataId),t=r.texData.get(a.dataId),i=new jP("return areal * breal - aimag * bimag;",n.shape,a.shape),o=new jP("return areal * bimag + aimag * breal;",n.shape,a.shape),s=[{dataId:e.complexTensorInfos.real.dataId,dtype:e.complexTensorInfos.real.dtype,shape:n.shape},{dataId:e.complexTensorInfos.imag.dataId,dtype:e.complexTensorInfos.imag.dtype,shape:n.shape},{dataId:t.complexTensorInfos.real.dataId,dtype:t.complexTensorInfos.real.dtype,shape:a.shape},{dataId:t.complexTensorInfos.imag.dataId,dtype:t.complexTensorInfos.imag.dtype,shape:a.shape}],l=r.runWebGLProgram(i,s,"float32"),c=r.runWebGLProgram(o,s,"float32"),u=MP({inputs:{real:l,imag:c},backend:r});return r.disposeIntermediateTensorInfo(l),r.disposeIntermediateTensorInfo(c),u}if(r.shouldExecuteOnCPU([n,a])){const e=r.texData.get(n.dataId),t=r.texData.get(a.dataId),[o,s]=zI(n.shape,a.shape,e.values,t.values,i),l=r.makeTensorInfo(s,i);return r.texData.get(l.dataId).values=o,l}let o;return o=We().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new TP(UP,n.shape,a.shape):new DP(UP,n.shape,a.shape),r.runWebGLProgram(o,[n,a],i)}const VP={kernelName:jr,backendName:"webgl",kernelFunc:$P};function qP(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{shape:i}=n,o=r,s=se(a.shape),l=ge(i,s),c=se(l);ne(s===c,(()=>`The new shape (${l}) has ${c} elements and the old shape (${a.shape}) has ${s} elements. The new shape and old shape must have the same number of elements.`));const u=o.texData.get(a.dataId);return!u.isPacked||NO(a.shape,l)||null!==u.texture&&NO(u.shape,l)?(o.incRef(a.dataId),{dataId:a.dataId,shape:l,dtype:a.dtype}):function(e,t,r){const n=[SO(e.shape),...MO(e.shape)],a={dtype:e.dtype,shape:n,dataId:e.dataId},i=[SO(t),...MO(t)],o=new uP(i,n),s=[n],l=r.runWebGLProgram(o,[a],e.dtype,s,!0);return{dataId:l.dataId,shape:t,dtype:l.dtype}}(a,l,o)}const WP={kernelName:an,backendName:"webgl",kernelFunc:qP};class HP{constructor(e,t){this.variableNames=["x"];const{windowSize:r,batchSize:n,inSize:a,outSize:i}=e;this.outputShape=[n,i];const o=4*Math.floor(r/4),s=r%4;let l="sumValue += dot(values, ones);";if(null!=t){const e=1/t;l=`sumValue += dot(values * ${ue(e)?e.toPrecision(2):e}, ones);`}let c="";a%r>0&&(c=`\n        if (inIdx < 0 || inIdx >= ${a}) {\n          return 0.0;\n        }\n      `),this.userCode=`\n      const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n      float getValue(int batch, int inIdx) {\n        ${c}\n        return getX(batch, inIdx);\n      }\n\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int batch = coords[0];\n        int outIdx = coords[1];\n        int inOffset = outIdx * ${r};\n\n        float sumValue = 0.0;\n\n        for (int i = 0; i < ${o}; i += 4) {\n          int inIdx = inOffset + i;\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2),\n            getValue(batch, inIdx + 3)\n          );\n\n          ${l}\n        }\n\n        int inIdx = inOffset + ${o};\n        if (${1===s}) {\n          vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n          ${l}\n        } else if (${2===s}) {\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1), 0.0, 0.0);\n\n          ${l}\n        } else if (${3===s}) {\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2), 0.0);\n\n          ${l}\n        }\n        setOutput(sumValue);\n      }\n    `}}class GP{constructor(e,t){this.variableNames=["x"];const{windowSize:r,batchSize:n,inSize:a,outSize:i}=e;this.outputShape=[n,i];let o="0.0",s="";"prod"===t?o="1.0":"min"===t?(o="1.0 / 1e-20",s="min"):"max"===t&&(o="-1.0 / 1e-20",s="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"sum"===t?l="sumValue":"prod"===t?l="prodValue":"all"===t?l="allValue":"any"===t&&(l="anyValue");const c=4*Math.floor(r/4),u=r%4;let f=`\n      if (${"sum"===t}) {\n        sumValue += dot(values, ones);\n      } else if (${"prod"===t}) {\n        vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n        prodValue *= tmp[0] * tmp[1];\n      } else {\n        minMaxValue = ${s}(values, minMaxValue);\n        if (${"min"===t} || ${"max"===t}) {\n          minMaxValue = ${s}(values, minMaxValue);\n          bvec4 isNaN = isnan(values);\n          if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n            minMaxValue = vec4(NAN);\n          }\n        }\n      }\n    `,p="vec4";"all"===t?(o="1.0",f="\n        bool reducedAllValue = all(values);\n        float floatedReducedAllValue = float(reducedAllValue);\n        allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n      ",p="bvec4"):"any"===t&&(o="0.0",f="\n        bool reducedAnyValue = any(values);\n        float floatedReducedAnyValue = float(reducedAnyValue);\n        anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n      ",p="bvec4");let h="";a%r>0&&(h=`\n        if (inIdx < 0 || inIdx >= ${a}) {\n          return initializationValue;\n        }\n      `),this.userCode=`\n      const float initializationValue = ${o};\n      const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n      float getValue(int batch, int inIdx) {\n        ${h}\n        return getX(batch, inIdx);\n      }\n\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int batch = coords[0];\n        int outIdx = coords[1];\n        int inOffset = outIdx * ${r};\n\n        vec4 minMaxValue = vec4(${o});\n        float prodValue = 1.0;\n        float sumValue = 0.0;\n        float allValue = 1.0;\n        float anyValue = 0.0;\n\n        for (int i = 0; i < ${c}; i += 4) {\n          int inIdx = inOffset + i;\n          ${p} values = ${p}(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2),\n            getValue(batch, inIdx + 3)\n          );\n\n          ${f}\n        }\n\n        int inIdx = inOffset + ${c};\n        if (${1===u}) {\n          ${p} values = ${p}(\n            getValue(batch, inIdx),\n            initializationValue,\n            initializationValue,\n            initializationValue\n          );\n\n          ${f}\n        } else if (${2===u}) {\n          ${p} values = ${p}(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            initializationValue,\n            initializationValue\n          );\n\n          ${f}\n        } else if (${3===u}) {\n          ${p} values = ${p}(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2),\n            initializationValue\n          );\n\n          ${f}\n        }\n        setOutput(${l});\n      }\n    `}}function XP(e,t,r,n){const a=function(e){const t=[];for(;0===t.length||1!==t[t.length-1].outSize;){const r=t.length?t[t.length-1].outSize:e[1],n=Bh(r);t.push({inSize:r,windowSize:n,outSize:Math.ceil(r/n)})}return t}(e.shape);let i=e;for(let o=0;o<a.length;o++){const{inSize:s,windowSize:l,outSize:c}=a[o];let u,f;u="mean"===r?0===o?new HP({windowSize:l,inSize:s,batchSize:e.shape[0],outSize:c},s):new HP({windowSize:l,inSize:s,batchSize:e.shape[0],outSize:c}):new GP({windowSize:l,inSize:s,batchSize:e.shape[0],outSize:c},r),f=i,i=n.runWebGLProgram(u,[i],t),f.dataId!==e.dataId&&n.disposeIntermediateTensorInfo(f)}return i}class YP{constructor(e,t){this.variableNames=["A"];const r=new Array(e.length);for(let n=0;n<r.length;n++)r[n]=e[t[n]];this.outputShape=r,this.rank=r.length;const n=eI(this.rank),a=function(e){const t=e.length;if(t>6)throw Error(`Transpose for rank ${t} is not yet supported`);const r=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],n=new Array(t);for(let t=0;t<e.length;t++)n[e[t]]=r[t];return n.join()}(t);this.userCode=`\n    void main() {\n      ${n} resRC = getOutputCoords();\n      setOutput(getA(${a}));\n    }\n    `}}class ZP{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0;const r=new Array(e.length);for(let n=0;n<r.length;n++)r[n]=e[t[n]];if(this.outputShape=r,this.rank=r.length,this.rank>6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const n=eI(this.rank),a=sP("rc",this.rank),i=new Array(this.rank);for(let e=0;e<t.length;e++)i[t[e]]=a[e];const o=`vec2(${i.slice(-2).join()})`,s=`++${a[this.rank-1]} < ${r[this.rank-1]}`,l=`getChannel(getA(${i.join()}), ${o})`;this.userCode=`\n    void main() {\n      ${n} rc = getOutputCoords();\n      vec4 result = vec4(0.);\n      result[0] = ${l};\n      if(${s}) {\n        result[1] = ${l};\n      }\n      --${a[this.rank-1]};\n      if(++${a[this.rank-2]} < ${r[this.rank-2]}) {\n        result[2] = ${l};\n        if(${s}) {\n          result[3] = ${l};\n        }\n      }\n      setOutput(result);\n    }\n    `}}function KP(e,t,r){const n=We().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new ZP(e.shape,t):new YP(e.shape,t);return r.runWebGLProgram(n,[e],e.dtype)}function JP(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,keepDims:o}=n;return function(e,t,r,n){const a=t,i=e.shape.length,o=ye(a,e.shape);let s=o;const l=Cu(s,i),c=null!=l;let u=e;c&&(u=KP(e,l,n),s=Ou(s.length,i)),Eu("sum",s,i);const[f,p]=Su(u.shape,s);let h=f;r&&(h=Mu(f,o));const d=se(p),m=qP({inputs:{x:u},attrs:{shape:[se(e.shape)/d,d]},backend:n}),g=XP(m,ni(e.dtype),"sum",n),y=qP({inputs:{x:g},attrs:{shape:h},backend:n});return n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(g),c&&n.disposeIntermediateTensorInfo(u),y}(a,i,o,r)}const QP={kernelName:Dn,backendName:"webgl",kernelFunc:JP};function eR(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{perm:i}=n,o=r,s=a.shape.length,l=new Array(s);for(let e=0;e<l.length;e++)l[e]=a.shape[i[e]];let c;if(o.shouldExecuteOnCPU([a])){const e=o.texData.get(a.dataId).values,t=iP(e,a.shape,a.dtype,i,l);c=o.makeTensorInfo(l,a.dtype),o.texData.get(c.dataId).values=t}else c=KP(a,i,o);return c}const tR={kernelName:Wn,backendName:"webgl",kernelFunc:eR};function rR({a:e,b:t,transposeA:r,transposeB:n,backend:a,bias:i=null,preluActivationWeights:o=null,leakyreluAlpha:s=0,activation:l=null}){const c=e.shape.length,u=t.shape.length,f=r?e.shape[c-2]:e.shape[c-1],p=n?t.shape[u-1]:t.shape[u-2],h=r?e.shape[c-1]:e.shape[c-2],d=n?t.shape[u-2]:t.shape[u-1],m=e.shape.slice(0,-2),g=t.shape.slice(0,-2),y=se(m),v=se(g),b=Jo(e.shape.slice(0,-2),t.shape.slice(0,-2)).concat([h,d]);ne(f===p,(()=>`Error in matMul: inner shapes (${f}) and (${p}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${r} and transposeB=${n} must match.`));const x=r?[y,f,h]:[y,h,f],_=n?[v,d,p]:[v,p,d],w=qP({inputs:{x:e},backend:a,attrs:{shape:x}}),k=qP({inputs:{x:t},backend:a,attrs:{shape:_}}),D=[w,k],T=Math.max(y,v),A=r?w.shape[1]:w.shape[2],S=null!=i,M=null!=o,E="leakyrelu"===l,C=null!=l?BP(l,!0):null;let N;if((1===h||1===d)&&A>1e3&&!1===(S||M||E||null!=C)){let e=w,t=k;r&&(e=eR({inputs:{x:w},backend:a,attrs:{perm:[0,2,1]}}),D.push(e)),n&&(t=eR({inputs:{x:k},backend:a,attrs:{perm:[0,2,1]}}),D.push(t));const i=1===d;let o=e;1!==d&&(o=qP({inputs:{x:e},backend:a,attrs:{shape:[T,A,1]}}),D.push(o));const s=1===d?2:1;let l=t;i&&(l=qP({inputs:{x:t},backend:a,attrs:{shape:[T,1,A]}}),D.push(l));const c=$P({inputs:{a:o,b:l},backend:a});N=JP({inputs:{x:c},backend:a,attrs:{axis:s,keepDims:!0}}),D.push(c)}else{const l=ri(e.dtype,t.dtype),c=new zP(x,_,[T,h,d],r,n,S,C,M,E),u=[w,k];if(null!=i&&u.push(i),M&&u.push(o),E){const e=a.makeTensorInfo([],"float32",Ea(s,"float32"));u.push(e),D.push(e)}N=a.runWebGLProgram(c,u,l)}const O=qP({inputs:{x:N},backend:a,attrs:{shape:b}});D.push(N);for(const e of D)a.disposeIntermediateTensorInfo(e);return O}const nR={kernelName:Qn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{a,b:i,bias:o,preluActivationWeights:s}=t,{transposeA:l,transposeB:c,activation:u,leakyreluAlpha:f}=n;return rR({a,b:i,transposeA:l,transposeB:c,backend:r,bias:o,preluActivationWeights:s,leakyreluAlpha:f,activation:u})}},aR="return abs(x);",iR={kernelName:Ze,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{x:n}=t;if(r.shouldExecuteOnCPU([n])&&"complex64"!==n.dtype){const e=r.texData.get(n.dataId),t=HI(e.values);return r.makeTensorInfo(n.shape,n.dtype,t)}let a;return a=We().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new vP(n.shape,aR):new mP(n.shape,aR),r.runWebGLProgram(a,[n],n.dtype)}},oR=LP({opSnippet:"if (isnan(x)) return x;\n  if (abs(x) > 1.) {\n    return NAN;\n  }\n  return acos(x);\n"}),sR={kernelName:Ke,backendName:"webgl",kernelFunc:oR},lR=LP({opSnippet:"if (isnan(x)) return x;\n  if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),cR={kernelName:Je,backendName:"webgl",kernelFunc:lR},uR="return a + b;",fR=FP({opSnippet:uR,packedOpSnippet:uR,supportsComplex:!0,cpuKernelImpl:bI}),pR={kernelName:Qe,backendName:"webgl",kernelFunc:fR};class hR{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map(((e,t)=>`T${t}`));const r=[];this.variableNames.forEach((e=>{r.push(`float v${e} = get${e}AtOutCoords();`)}));const n=this.variableNames.map((e=>`v${e}`)).join(" + ");this.userCode=`\n      void main() {\n        ${r.join("\n        ")}\n\n        float result = ${n};\n        setOutput(result);\n      }\n    `}}class dR{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map(((e,t)=>`T${t}`));const r=[];this.variableNames.forEach((e=>{r.push(`vec4 v${e} = get${e}AtOutCoords();`)}));const n=this.variableNames.map((e=>`v${e}`)).join(" + ");this.userCode=`\n      void main() {\n        ${r.join("\n        ")}\n\n        vec4 result = ${n};\n        setOutput(result);\n      }\n    `}}const mR={kernelName:et,backendName:"webgl",kernelFunc:function e(t){const{inputs:r,backend:n}=t,a=r;if(1===a.length)return AP({inputs:{x:a[0]},backend:n});if(a.length>We().get("WEBGL_MAX_TEXTURES_IN_SHADER")){const t=Math.floor(a.length/2),r=e({inputs:a.slice(0,t),backend:n}),i=e({inputs:a.slice(t),backend:n});return e({inputs:[r,i],backend:n})}const i=a.map((e=>e.dtype)).reduce(((e,t)=>ri(e,t))),o=a.map((e=>e.shape)),s=We().getBool("WEBGL_PACK")?new dR(a[0].shape,o):new hR(a[0].shape,o);return n.runWebGLProgram(s,a,i)}},gR={kernelName:tt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,keepDims:o}=n,s=a.shape.length,l=ye(i,a.shape);let c=l;const u=Cu(c,s);let f=a;null!=u&&(f=eR({inputs:{x:a},backend:r,attrs:{perm:u}}),c=Ou(c.length,s)),Eu("all",c,s);const[p,h]=Su(f.shape,c),d=qP({inputs:{x:f},backend:r,attrs:{shape:[-1,se(h)]}}),m=XP(d,d.dtype,"all",r);let g;return g=qP(o?{inputs:{x:m},backend:r,attrs:{shape:Mu(p,l)}}:{inputs:{x:m},backend:r,attrs:{shape:p}}),r.disposeIntermediateTensorInfo(d),r.disposeIntermediateTensorInfo(m),null!=u&&r.disposeIntermediateTensorInfo(f),g}},yR={kernelName:rt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,keepDims:o}=n,s=a.shape.length,l=ye(i,a.shape);let c=l;const u=Cu(c,s);let f=a;null!=u&&(f=eR({inputs:{x:a},backend:r,attrs:{perm:u}}),c=Ou(c.length,s)),Eu("any",c,s);const[p,h]=Su(f.shape,c),d=qP({inputs:{x:f},backend:r,attrs:{shape:[-1,se(h)]}}),m=XP(d,d.dtype,"any",r);let g;return g=qP(o?{inputs:{x:m},backend:r,attrs:{shape:Mu(p,l)}}:{inputs:{x:m},backend:r,attrs:{shape:p}}),r.disposeIntermediateTensorInfo(d),r.disposeIntermediateTensorInfo(m),null!=u&&r.disposeIntermediateTensorInfo(f),g}};class vR{constructor(e,t,r){this.variableNames=["A"];const{windowSize:n,batchSize:a,outSize:i}=e;r||this.variableNames.push("bestIndicesA"),this.outputShape=[a,i];const o="max"===t?">":"<",s=r?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=`\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int batch = coords[0];\n        int outIdx = coords[1];\n        int inOffset = outIdx * ${n};\n\n        int bestIndex = inOffset;\n        float bestValue = getA(batch, bestIndex);\n\n        for (int i = 0; i < ${n}; i++) {\n          int inIdx = ${s};\n          float candidate = getA(batch, inIdx);\n          if (candidate ${o} bestValue) {\n            bestValue = candidate;\n            bestIndex = inIdx;\n          }\n        }\n        setOutput(float(bestIndex));\n      }\n    `}}class bR{constructor(e,t,r,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,ne(e.length>2,(()=>`Packed arg${r.charAt(0).toUpperCase()+r.slice(1)} supports only inputs with rank above 2.`));const a=e[e.length-1],i=Math.ceil(a/t);this.outputShape=e.slice(0,-1),i>1&&this.outputShape.push(i),n||this.variableNames.push("bestIndicesA");const o=this.outputShape,s=o.length,l=eI(s),c=lP("coords",s);let u,f;if(1===i){f=s+1;const e=eI(f);u=`\n        ${e} sourceLocR = ${e}(${c.join()}, 0);\n        ++${c[s-1]};\n        ${e} sourceLocG = ${e}(${c.join()}, 0);\n        ++${c[s-2]};\n        ${e} sourceLocA = ${e}(${c.join()}, 0);\n        --${c[s-1]};\n        ${e} sourceLocB = ${e}(${c.join()}, 0);\n        --${c[s-2]};`}else f=s,u=`\n        ${l} sourceLocR = coords;\n        ++${c[s-1]};\n        ${l} sourceLocG = coords;\n        ++${c[s-2]};\n        ${l} sourceLocA = coords;\n        --${c[s-1]};\n        ${l} sourceLocB = coords;\n        --${c[s-2]};`;const p=["x","y","z","w","u","v"].slice(0,f),h="."+p[f-1],d=p.map((e=>"int "+e)),m=lP("sourceLocR",f-1).concat("inIdx.r"),g=lP("sourceLocG",f-1).concat("inIdx.g"),y=lP("sourceLocB",f-1).concat("inIdx.b"),v=lP("sourceLocA",f-1).concat("inIdx.a"),b="max"===r?"greaterThan":"lessThan",x=n?"":`\n          inIdx = round(vec4(getBestIndicesAChannel(${m.join()}),\n                             getBestIndicesAChannel(${g.join()}),\n                             getBestIndicesAChannel(${y.join()}),\n                             getBestIndicesAChannel(${v.join()})));`,_=`vec4(\n            getAChannel(${m.join()}),\n            hasNextCol ? getAChannel(${g.join()}) : 0.,\n            hasNextRow ? getAChannel(${y.join()}) : 0.,\n            hasNextRow && hasNextCol ? getAChannel(${v.join()}) : 0.)`,w=n?"":`\n      float getBestIndicesAChannel(${d.join()}) {\n        return getChannel(getBestIndicesA(${p.join()}),\n                                          vec2(${p.slice(-2).join()}));\n      }`;this.userCode=`\n      float getAChannel(${d.join()}) {\n        return getChannel(getA(${p.join()}),\n                               vec2(${p.slice(-2).join()}));\n      }\n      ${w}\n      void main() {\n        ${l} coords = getOutputCoords();\n        bool hasNextCol = ${c[s-1]} < ${o[s-1]-1};\n        bool hasNextRow = ${c[s-2]} < ${o[s-2]-1};\n        ${u}\n        ivec4 srcIdx = ivec4(sourceLocR${h}, sourceLocG${h},\n          sourceLocB${h}, sourceLocA${h}) * ${t};\n        ivec4 inIdx = srcIdx;\n        vec4 bestIndex = vec4(inIdx);\n        vec4 bestValue = ${_};\n\n        for (int i = 0; i < ${t}; i++) {\n          inIdx = srcIdx;\n          ${x}\n          vec4 candidate = ${_};\n          bvec4 nan = isnan(candidate);\n          bvec4 replace = bvec4(\n            vec4(${b}(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n          bestValue = vec4(replace.x  ? candidate.x : bestValue.x,\n                           replace.y  ? candidate.y : bestValue.y,\n                           replace.z  ? candidate.z : bestValue.z,\n                           replace.w  ? candidate.w : bestValue.w);\n          bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n          srcIdx++;\n        }\n        setOutput(bestIndex);\n      }\n    `}}function xR(e,t,r,n=null){let a=t.shape[0],i=t.shape[1];null!=n&&(a=n.shape[0],i=n.shape[1]);const o=Bh(i),s={windowSize:o,inSize:i,batchSize:a,outSize:Math.ceil(i/o)},l=new vR(s,r,null==n),c=[t];null!=n&&c.push(n);const u=e.runWebGLProgram(l,c,"int32");if(1===u.shape[1])return u;const f=xR(e,t,r,u);return e.disposeIntermediateTensorInfo(u),f}function _R(e,t,r,n=null){const a=null!=n?n.shape:t.shape,i=Bh(a[a.length-1]),o=new bR(a,i,r,null==n),s=null==n?[t]:[t,n],l=e.runWebGLProgram(o,s,"int32");if(l.shape.length===t.shape.length){const n=_R(e,t,r,l);return e.disposeIntermediateTensorInfo(l),n}return l}function wR(e,t,r,n){const a=[r];if(Eu("arg"+n.charAt(0).toUpperCase()+n.slice(1),a,t.shape.length),!We().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){const r=[],i=e.texData.get(t.dataId);let o=t;null!==i&&i.isPacked&&(o=e.unpackTensor(t),r.push(o));const[s,l]=Su(o.shape,a),c=se(l),u=qP({inputs:{x:o},backend:e,attrs:{shape:[-1,c]}});r.push(u);const f=xR(e,u,n);r.push(f);const p=qP({inputs:{x:f},backend:e,attrs:{shape:s}});return r.forEach((t=>e.disposeIntermediateTensorInfo(t))),p}return _R(e,t,n)}const kR={kernelName:nt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i}=n;let o=ye(i,a.shape);const s=Cu(o,a.shape.length);let l=a;const c=[];null!=s&&(l=eR({inputs:{x:a},backend:r,attrs:{perm:s}}),c.push(l),o=Ou(o.length,l.shape.length)),Eu("argMax",[o[0]],l.shape.length);const u=wR(r,l,o[0],"max");return c.forEach((e=>r.disposeIntermediateTensorInfo(e))),u}},DR={kernelName:at,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i}=n;let o=ye(i,a.shape);const s=Cu(o,a.shape.length);let l=a;const c=[];null!=s&&(l=eR({inputs:{x:a},backend:r,attrs:{perm:s}}),c.push(l),o=Ou(o.length,l.shape.length)),Eu("argMin",[o[0]],l.shape.length);const u=wR(r,l,o[0],"min");return c.forEach((e=>r.disposeIntermediateTensorInfo(e))),u}},TR=LP({opSnippet:"if (isnan(x)) return x;\n  if (abs(x) > 1.) {\n    return NAN;\n  }\n  return asin(x);\n"}),AR={kernelName:it,backendName:"webgl",kernelFunc:TR},SR=LP({opSnippet:"if (isnan(x)) return x;return log(x + sqrt(x * x + 1.0));"}),MR={kernelName:ot,backendName:"webgl",kernelFunc:SR},ER=LP({opSnippet:"if (isnan(x)) return x;\n  return atan(x);\n"}),CR={kernelName:st,backendName:"webgl",kernelFunc:ER},NR=FP({opSnippet:"\n  if (isnan(a)) return a;\n  if (isnan(b)) return b;\n\n  return atan(a, b);\n",packedOpSnippet:"\n  vec4 result = atan(a, b);\n  vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n  \n  result.r = isNaN.r > 0. ? NAN : result.r;\n  result.g = isNaN.g > 0. ? NAN : result.g;\n  result.b = isNaN.b > 0. ? NAN : result.b;\n  result.a = isNaN.a > 0. ? NAN : result.a;\n\n  return result;\n"}),OR={kernelName:ct,backendName:"webgl",kernelFunc:NR},IR=LP({opSnippet:"if (isnan(x)) return x;\n  if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),PR={kernelName:lt,backendName:"webgl",kernelFunc:IR};class RR{constructor(e,t,r,n=!1,a=!1){if(this.variableNames=["x"],"avg"===t&&r)throw new Error("Cannot compute positions for average pool.");const i=e.filterWidth,o=e.strideHeight,s=e.strideWidth,l=e.dilationHeight,c=e.dilationWidth,u=e.effectiveFilterHeight,f=e.effectiveFilterWidth,p=e.padInfo.top,h=e.padInfo.left;this.outputShape=e.outShape;const d="avg"===t,m=`((batch  * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`;let y="0.0";if(d||(y="-1.0 / 1e-20"),r){const t=">=";return void(this.userCode=`\n        const ivec2 strides = ivec2(${o}, ${s});\n        const ivec2 pads = ivec2(${p}, ${h});\n\n        void main() {\n          ivec4 coords = getOutputCoords();\n          int batch = coords[0];\n          int d = coords[3];\n\n          ivec2 xRCCorner = coords.yz * strides - pads;\n          int xRCorner = xRCCorner.x;\n          int xCCorner = xRCCorner.y;\n\n          // max/min x(?, ?, d) to get y(yR, yC, d).\n          // ? = to be determined\n          float minMaxValue = 0.0;\n          float minMaxValueFound = 0.0;\n          int minMaxPosition = 0;\n          float avgValue = 0.0;\n\n          for (int wR = 0; wR < ${u};\n              wR += ${l}) {\n            int xR = xRCorner + wR;\n\n            if (xR < 0 || xR >= ${e.inHeight}) {\n              continue;\n            }\n\n            for (int wC = 0; wC < ${f};\n                wC += ${c}) {\n              int xC = xCCorner + wC;\n\n              if (xC < 0 || xC >= ${e.inWidth}) {\n                continue;\n              }\n\n              float value = getX(batch, xR, xC, d);\n\n              // If a min / max value has already been found, use it. If not,\n              // use the current value.\n              float currMinMaxValue = mix(\n                  value, minMaxValue, minMaxValueFound);\n              if (value ${t} currMinMaxValue) {\n                minMaxValue = value;\n                minMaxValueFound = 1.0;\n                minMaxPosition = ${n?a?m:g:`wR * ${f} + wC`};\n              }\n            }\n          }\n          setOutput(float(minMaxPosition));\n        }\n      `)}let v=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(v="avgValue / count");const b=4*Math.floor(i/4),x=i%4,_=`\n      if (${d}) {\n        avgValue += dot(values, ones);\n      } else {\n        minMaxValue = max(values, minMaxValue);\n      }\n    `;this.userCode=`\n      const ivec2 strides = ivec2(${o}, ${s});\n      const ivec2 pads = ivec2(${p}, ${h});\n      const float initializationValue = ${y};\n      const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n      float count = 0.0;\n\n      float getValue(int batch, int xR, int xC, int d) {\n        if (xC < 0 || xC >= ${e.inWidth}) {\n          return initializationValue;\n        }\n        count += 1.0;\n        return getX(batch, xR, xC, d);\n      }\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords[0];\n        int d = coords[3];\n\n        ivec2 xRCCorner = coords.yz * strides - pads;\n        int xRCorner = xRCCorner.x;\n        int xCCorner = xRCCorner.y;\n\n        // max/min x(?, ?, d) to get y(yR, yC, d).\n        // ? = to be determined\n        vec4 minMaxValue = vec4(${y});\n        float avgValue = 0.0;\n        count = 0.0;\n\n        for (int wR = 0; wR < ${u};\n            wR += ${l}) {\n          int xR = xRCorner + wR;\n\n          if (xR < 0 || xR >= ${e.inHeight}) {\n            continue;\n          }\n\n          for (int wC = 0; wC < ${b}; wC += 4) {\n            int xC = xCCorner + wC * ${c};\n\n            vec4 values = vec4(\n              getValue(batch, xR, xC, d),\n              getValue(batch, xR, xC + ${c}, d),\n              getValue(batch, xR, xC + 2 * ${c}, d),\n              getValue(batch, xR, xC + 3 * ${c}, d)\n            );\n\n            ${_}\n          }\n\n          int xC = xCCorner + ${b};\n          if (${1===x}) {\n            vec4 values = vec4(\n              getValue(batch, xR, xC, d),\n              initializationValue,\n              initializationValue,\n              initializationValue\n            );\n\n            ${_}\n          } else if (${2===x}) {\n            vec4 values = vec4(\n              getValue(batch, xR, xC, d),\n              getValue(batch, xR, xC + ${c}, d),\n              initializationValue,\n              initializationValue\n            );\n\n            ${_}\n          } else if (${3===x}) {\n            vec4 values = vec4(\n              getValue(batch, xR, xC, d),\n              getValue(batch, xR, xC + ${c}, d),\n              getValue(batch, xR, xC + 2 * ${c}, d),\n              initializationValue\n            );\n\n            ${_}\n          }\n        }\n        setOutput(${v});\n      }\n    `}}class LR{constructor(e,t,r,n=!1,a=!1){if(this.variableNames=["x"],"avg"===t&&r)throw new Error("Cannot compute positions for average pool.");const i=e.filterWidth,o=e.strideDepth,s=e.strideHeight,l=e.strideWidth,c=e.dilationDepth,u=e.dilationHeight,f=e.dilationWidth,p=e.effectiveFilterDepth,h=e.effectiveFilterHeight,d=e.effectiveFilterWidth,m=e.padInfo.front,g=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;const v="avg"===t;let b="0.0";if(v||(b="-1.0 / 1e-20"),r){const t=">=";return void(this.userCode=`\n        const ivec3 strides =\n            ivec3(${o}, ${s}, ${l});\n        const ivec3 pads = ivec3(${m}, ${g}, ${y});\n\n        void main() {\n          ivec5 coords = getOutputCoords();\n          int batch = coords.x;\n          int ch = coords.u;\n\n          ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n          int xDCorner = xCorner.x;\n          int xRCorner = xCorner.y;\n          int xCCorner = xCorner.z;\n\n          // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n          // ? = to be determined\n          float minMaxValue = 0.0;\n          float minMaxValueFound = 0.0;\n          int minMaxPosition = 0;\n\n          for (int wD = 0; wD < ${p};\n              wD += ${c}) {\n            int xD = xDCorner + wD;\n\n            if (xD < 0 || xD >= ${e.inDepth}) {\n              continue;\n            }\n\n            for (int wR = 0; wR < ${h};\n                wR += ${u}) {\n              int xR = xRCorner + wR;\n\n              if (xR < 0 || xR >= ${e.inHeight}) {\n                continue;\n              }\n\n              for (int wC = 0; wC < ${d};\n                  wC += ${f}) {\n                int xC = xCCorner + wC;\n\n                if (xC < 0 || xC >= ${e.inWidth}) {\n                  continue;\n                }\n\n                float value = getX(batch, xD, xR, xC, ch);\n\n                // If a min / max value has already been found, use it. If not,\n                // use the current value.\n                float currMinMaxValue = mix(\n                    value, minMaxValue, minMaxValueFound);\n                if (value ${t} currMinMaxValue) {\n                  minMaxValue = value;\n                  minMaxValueFound = 1.0;\n                  minMaxPosition = ${n?a?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${h} * ${d} +\n                      wR * ${d} + wC`};\n                }\n              }\n            }\n          }\n          setOutput(float(minMaxPosition));\n        }\n      `)}let x=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(x="avgValue / count");const _=4*Math.floor(i/4),w=i%4,k=`\n      if (${v}) {\n        avgValue += dot(values, ones);\n      } else {\n        minMaxValue = max(values, minMaxValue);\n      }\n    `;this.userCode=`\n      const ivec3 strides =\n        ivec3(${o}, ${s}, ${l});\n      const ivec3 pads = ivec3(${m}, ${g}, ${y});\n      const float initializationValue = ${b};\n      const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n      float count = 0.0;\n\n      float getValue(int batch, int xD, int xR, int xC, int ch) {\n        if (xC < 0 || xC >= ${e.inWidth}) {\n          return initializationValue;\n        }\n        count += 1.0;\n        return getX(batch, xD, xR, xC, ch);\n      }\n\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int batch = coords.x;\n        int ch = coords.u;\n\n        ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n        int xDCorner = xCorner.x;\n        int xRCorner = xCorner.y;\n        int xCCorner = xCorner.z;\n\n        // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n        // ? = to be determined\n        vec4 minMaxValue = vec4(${b});\n        float avgValue = 0.0;\n        count = 0.0;\n\n        for (int wD = 0; wD < ${p};\n            wD += ${c}) {\n          int xD = xDCorner + wD;\n\n          if (xD < 0 || xD >= ${e.inDepth}) {\n            continue;\n          }\n\n          for (int wR = 0; wR < ${h};\n            wR += ${u}) {\n            int xR = xRCorner + wR;\n\n            if (xR < 0 || xR >= ${e.inHeight}) {\n              continue;\n            }\n\n            for (int wC = 0; wC < ${_}; wC += 4) {\n              int xC = xCCorner + wC * ${f};\n\n              vec4 values = vec4(\n                getValue(batch, xD, xR, xC, ch),\n                getValue(batch, xD, xR, xC + ${f}, ch),\n                getValue(batch, xD, xR, xC + 2 * ${f}, ch),\n                getValue(batch, xD, xR, xC + 3 * ${f}, ch)\n              );\n\n              ${k}\n            }\n\n            int xC = xCCorner + ${_};\n            if (${1===w}) {\n              vec4 values = vec4(\n                getValue(batch, xD, xR, xC, ch),\n                initializationValue,\n                initializationValue,\n                initializationValue\n              );\n\n              ${k}\n            } else if (${2===w}) {\n              vec4 values = vec4(\n                getValue(batch, xD, xR, xC, ch),\n                getValue(batch, xD, xR, xC + ${f}, ch),\n                initializationValue,\n                initializationValue\n              );\n\n              ${k}\n            } else if (${3===w}) {\n              vec4 values = vec4(\n                getValue(batch, xD, xR, xC, ch),\n                getValue(batch, xD, xR, xC + ${f}, ch),\n                getValue(batch, xD, xR, xC + 2 * ${f}, ch),\n                initializationValue\n              );\n\n              ${k}\n            }\n          }\n          setOutput(${x});\n        }\n      }\n    `}}const FR={kernelName:ut,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t;FO(a,"avgPool");const{filterSize:i,strides:o,pad:s,dimRoundingMode:l}=n;ne(oc(o,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`));const c=Zl(a.shape,i,o,1,s,l);if(1===c.filterWidth&&1===c.filterHeight&&ce(c.inShape,c.outShape))return AP({inputs:{x:a},backend:r});const u=new RR(c,"avg",!1);return r.runWebGLProgram(u,[a],"float32")}},BR={kernelName:pt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{filterSize:i,strides:o,pad:s,dimRoundingMode:l,dataFormat:c}=n,u=Kl(a.shape,i,o,[1,1,1],s,l,c),f=new LR(u,"avg",!1);return r.runWebGLProgram(f,[a],"float32")}};class zR{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,r=e.filterWidth,n=e.strideHeight,a=e.strideWidth,i=e.dilationHeight,o=e.dilationWidth,s=e.effectiveFilterHeight,l=e.effectiveFilterWidth,c=s-1-e.padInfo.top,u=l-1-e.padInfo.left,f=1/(t*r);this.userCode=`\n      const ivec2 pads = ivec2(${c}, ${u});\n      const float avgMultiplier = float(${f});\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n\n        ivec2 dyRCCorner = coords.yz - pads;\n        int dyRCorner = dyRCCorner.x;\n        int dyCCorner = dyRCCorner.y;\n\n        // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n        for (int wR = 0; wR < ${s};\n            wR += ${i}) {\n          float dyR = float(dyRCorner + wR) / ${n}.0;\n\n          if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n            continue;\n          }\n          int idyR = int(dyR);\n\n          for (int wC = 0; wC < ${l};\n            wC+= ${o}) {\n            float dyC = float(dyCCorner + wC) / ${a}.0;\n\n            if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                fract(dyC) > 0.0) {\n              continue;\n            }\n            int idyC = int(dyC);\n\n            float dyValue = getDy(b, idyR, idyC, d);\n\n            dotProd += dyValue * avgMultiplier;\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class jR{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,r=e.filterHeight,n=e.filterWidth,a=e.strideDepth,i=e.strideHeight,o=e.strideWidth,s=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=e.effectiveFilterDepth,f=e.effectiveFilterHeight,p=e.effectiveFilterWidth,h=u-1-e.padInfo.front,d=f-1-e.padInfo.top,m=p-1-e.padInfo.left,g=1/(t*r*n);this.userCode=`\n      const ivec3 pads = ivec3(${h}, ${d}, ${m});\n      const float avgMultiplier = float(${g});\n\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int batch = coords.x;\n        int ch = coords.u;\n\n        ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n        int dyDCorner = dyCorner.x;\n        int dyRCorner = dyCorner.y;\n        int dyCCorner = dyCorner.z;\n\n        // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n        // dx(xD, xR, xC, ch).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n\n        for (int wD = 0; wD < ${u};\n            wD += ${s}) {\n          float dyD = float(dyDCorner + wD) / ${a}.0;\n\n          if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n            continue;\n          }\n          int idyD = int(dyD);\n\n          for (int wR = 0; wR < ${f};\n              wR += ${l}) {\n            float dyR = float(dyRCorner + wR) / ${i}.0;\n\n            if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n                fract(dyR) > 0.0) {\n              continue;\n            }\n            int idyR = int(dyR);\n\n            for (int wC = 0; wC < ${p};\n                wC += ${c}) {\n              float dyC = float(dyCCorner + wC) / ${o}.0;\n\n              if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                  fract(dyC) > 0.0) {\n                continue;\n              }\n              int idyC = int(dyC);\n\n              float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n              dotProd += dyValue * avgMultiplier;\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}const UR={kernelName:ht,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,input:i}=t,o=i,{filterSize:s,strides:l,pad:c,dimRoundingMode:u}=n,f=Kl(o.shape,s,l,[1,1,1],c,u),p=new jR(f);return r.runWebGLProgram(p,[a],o.dtype)}},$R={kernelName:ft,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,input:i}=t,o=i;FO([a,i],"avgPoolGrad");const{filterSize:s,strides:l,pad:c}=n,u=Zl(o.shape,s,l,1,c),f=new zR(u);return r.runWebGLProgram(f,[a],o.dtype)}},VR={kernelName:dt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{a,b:i}=t,{transposeA:o,transposeB:s}=n;return rR({a,b:i,transposeA:o,transposeB:s,backend:r})}};class qR{constructor(e,t,r,n,a,i){this.outputShape=[],this.variableNames=["x","mean","variance"],Jo(e,t),Jo(e,r);let o="0.0";null!=n&&(Jo(e,n),this.variableNames.push("offset"),o="getOffsetAtOutCoords()");let s="1.0";null!=a&&(Jo(e,a),this.variableNames.push("scale"),s="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n      void main() {\n        float x = getXAtOutCoords();\n        float mean = getMeanAtOutCoords();\n        float variance = getVarianceAtOutCoords();\n        float offset = ${o};\n        float scale = ${s};\n        float inv = scale * inversesqrt(variance + float(${i}));\n        setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n      }\n    `}}class WR{constructor(e,t,r,n,a,i){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],Jo(e,t),Jo(e,r);let o="vec4(0.0)";null!=n&&(Jo(e,n),this.variableNames.push("offset"),o="getOffsetAtOutCoords()");let s="vec4(1.0)";null!=a&&(Jo(e,a),this.variableNames.push("scale"),s="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n      void main() {\n        vec4 offset = ${o};\n        vec4 scale = ${s};\n\n        vec4 x = getXAtOutCoords();\n        vec4 mean = getMeanAtOutCoords();\n        vec4 variance = getVarianceAtOutCoords();\n\n        vec4 inv = scale * inversesqrt(variance + vec4(${i}));\n\n        setOutput((x - mean) * inv + offset);\n      }\n    `}}const HR={kernelName:ar,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:r})=>{const{x:n,mean:a,variance:i,offset:o,scale:s}=e;ne(a.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),ne(null==o||a.shape.length===o.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),ne(null==s||a.shape.length===s.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));let{varianceEpsilon:l}=r;null==l&&(l=.001);const c=[n,a,i];let u=null;null!=o&&(u=o.shape,c.push(o));let f=null;null!=s&&(f=s.shape,c.push(s));const p=We().getBool("WEBGL_PACK_NORMALIZATION")?new WR(n.shape,a.shape,i.shape,u,f,l):new qR(n.shape,a.shape,i.shape,u,f,l);return t.runWebGLProgram(p,c,c[0].dtype)}};class GR{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=eI(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const r=function(e){if(1===e)return"sourceLoc";if(e<=6)return XR.slice(0,e).map((e=>"sourceLoc."+e)).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}(this.rank);let n;n=`\n        ${t} sourceLoc;\n        ${t} coords = getOutputCoords();\n        ${e.map(((e,t)=>`sourceLoc.${XR[t]} = start[${t}] + coords.${XR[t]};`)).join("\n")}\n      `,this.userCode=`\n      void main() {\n        ${n}\n        setOutput(getSource(${r}));\n      }\n    `}}const XR=["x","y","z","w","u","v"];class YR{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const t=eI(this.rank),r=lP("coords",this.rank),n=lP("sourceLoc",this.rank),a=1===this.rank?"sourceLoc":`vec2(${n.slice(-2).join()})`,i=`getChannel(getSource(${n.join()}), ${a})`,o=`\n      result.x = ${i};\n      if (++${r[this.rank-1]} < ${e[this.rank-1]}) {\n        ++${n[this.rank-1]};\n        result.y = ${i};\n        --${n[this.rank-1]};\n      }\n    `,s=1===this.rank?"":`\n      --${r[this.rank-1]};\n      if (++${r[this.rank-2]} < ${e[this.rank-2]}) {\n        ++${n[this.rank-2]};\n        result.z = ${i};\n        if (++${r[this.rank-1]} < ${e[this.rank-1]}) {\n          ++${n[this.rank-1]};\n          result.w = ${i};\n        }\n      }\n    `,l=this.rank<=4?`sourceLoc = coords +\n            ${t}(${e.map(((e,t)=>`start[${t}]`)).join()});`:e.map(((e,t)=>`${n[t]} = ${r[t]} + start[${t}];`)).join("\n");this.userCode=`\n      void main() {\n        ${t} coords = getOutputCoords();\n        ${t} sourceLoc;\n        ${l}\n        vec4 result = vec4(0.);\n        ${o}\n        ${s}\n        setOutput(result);\n      }\n    `}}function ZR(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{begin:i,size:o}=n,[s,l]=ks(a,i,o);if(cs(a,s,l),0===se(l))return r.makeTensorInfo(l,a.dtype,[]);if(r.shouldExecuteOnCPU([a])||"string"===a.dtype){const e=r.texData.get(a.dataId),t=GI(e.values,s,l,a.shape,a.dtype);return r.makeTensorInfo(l,a.dtype,t)}const{isPacked:c}=r.texData.get(a.dataId),u=_s(a.shape,s,l);if(c||!u){const e=We().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new YR(l):new GR(l),t=[s];return r.runWebGLProgram(e,[a],a.dtype,t)}return r.uploadToGPU(a.dataId),function(e,t,r,n){const a=n.texData.get(e.dataId),i=n.makeTensorInfo(r,e.dtype),o=n.texData.get(i.dataId);Object.assign(o,a),o.refCount=1,o.shape=r,o.dtype=e.dtype;let s=ws(t,Ie(e.shape));a.slice&&(s+=a.slice.flatOffset),o.slice={flatOffset:s,origDataId:a.slice&&a.slice.origDataId||e.dataId};const l=n.dataRefCount.get(o.slice.origDataId)||1;return n.dataRefCount.set(o.slice.origDataId,l+1),i}(a,s,l,r)}const KR={kernelName:yn,backendName:"webgl",kernelFunc:ZR},JR={kernelName:mt,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{blockShape:i,crops:o}=n;ne(a.shape.length<=4,(()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"));const s=i.reduce(((e,t)=>e*t)),l=jh(a.shape,i,s),c=Uh(l.length,i.length),u=$h(a.shape,i,s),f=Vh(o,i.length),p=qh(u,o,i.length),h=[],d=qP({inputs:{x:a},backend:r,attrs:{shape:l}}),m=eR({inputs:{x:d},backend:r,attrs:{perm:c}}),g=qP({inputs:{x:m},backend:r,attrs:{shape:u}}),y=ZR({inputs:{x:g},backend:r,attrs:{begin:f,size:p}});return h.push(d),h.push(m),h.push(g),h.forEach((e=>r.disposeIntermediateTensorInfo(e))),y}},QR={kernelName:gt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,weights:i}=t,{size:o}=n,s=r.readSync(a.dataId),l=r.readSync(i.dataId),c=xI(s,l,i.dtype,i.shape,o);return r.makeTensorInfo([o],i.dtype,c)}},eL={kernelName:vt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{s0:n,s1:a}=t,i=r.readSync(n.dataId),o=r.readSync(a.dataId),s=Jo(Array.from(i),Array.from(o));return r.makeTensorInfo([s.length],"int32",Int32Array.from(s))}},tL=FP({opSnippet:"return float(a != b);",cpuKernelImpl:UI,dtype:"bool"}),rL={kernelName:$r,backendName:"webgl",kernelFunc:tL};function nL(e){const{inputs:t,backend:r}=e,{input:n}=t;return AP({inputs:{x:r.texData.get(n.dataId).complexTensorInfos.real},backend:r})}const aL={kernelName:tn,backendName:"webgl",kernelFunc:nL},iL={kernelName:bt,backendName:"webgl",kernelFunc:function e(t){const{inputs:r,backend:n,attrs:a}=t,{x:i}=r,{dtype:o}=a;if("complex64"===o){if("complex64"===i.dtype)return AP({inputs:{x:i},backend:n});const t=$u(i.shape),r=e({inputs:{x:i},backend:n,attrs:{dtype:"float32"}}),a=MP({inputs:{real:r,imag:t},backend:n});return t.dispose(),n.disposeIntermediateTensorInfo(r),a}if("complex64"===i.dtype){const t=nL({inputs:{input:i},backend:n}),r=e({inputs:{x:t},backend:n,attrs:{dtype:o}});return n.disposeIntermediateTensorInfo(t),r}if(!ke(i.dtype,o)){const e=AP({inputs:{x:i},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:o}}if("int32"===o)return function(e,t){const r=new mP(e.shape,"return float(int(x));"),n=t.runWebGLProgram(r,[e],"int32");return{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}(i,n);if("bool"===o){const e=n.makeTensorInfo([],"bool",be("bool",1)),t=tL({inputs:{a:i,b:e},backend:n});return n.disposeIntermediateTensorInfo(e),t}throw new Error(`Error in Cast: failed to cast ${i.dtype} to ${o}`)}},oL="return ceil(x);",sL=LP({opSnippet:oL,packedOpSnippet:oL,cpuKernelImpl:wI}),lL={kernelName:xt,backendName:"webgl",kernelFunc:sL};class cL{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n\n      void main() {\n        float value = getAAtOutCoords();\n        if (isnan(value)) {\n          setOutput(value);\n          return;\n        }\n\n        setOutput(clamp(value, minVal, maxVal));\n      }\n    "}}class uL{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n      void main() {\n        vec4 value = getAAtOutCoords();\n\n        if (any(isnan(value))) {\n          setOutput(value);\n          return;\n        }\n\n        setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n      }\n    "}}const fL={kernelName:_t,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{clipValueMin:i,clipValueMax:o}=n;let s;s=We().getBool("WEBGL_PACK_CLIP")?new uL(a.shape):new cL(a.shape);const l=[[i],[o]];return r.runWebGLProgram(s,[a],a.dtype,l)}};class pL{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode="\n      void main() {\n        float re = abs(getRealAtOutCoords());\n        float im = abs(getImagAtOutCoords());\n        float mx = max(re, im);\n\n        // sadly the length function in glsl is not underflow-safe\n        // (at least not on Intel GPUs). So the safe solution is\n        // to ensure underflow-safety in all cases.\n        setOutput(\n          mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n        );\n      }\n    "}}function hL(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const dL={kernelName:kt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{x:n}=t,a=r.texData.get(n.dataId),i=new pL(n.shape),o=[hL(n,a.complexTensorInfos.real),hL(n,a.complexTensorInfos.imag)];return r.runWebGLProgram(i,o,o[0].dtype)}};class mL{constructor(e){this.outputShape=[],this.outputShape=Lh(e,1),this.variableNames=e.map(((e,t)=>`T${t}`));const t=new Array(e.length-1);t[0]=e[0][1];for(let r=1;r<t.length;r++)t[r]=t[r-1]+e[r][1];const r=[`if (yC < ${t[0]}) setOutput(getT0(yR, yC));`];for(let e=1;e<t.length;e++){const n=t[e-1];r.push(`else if (yC < ${t[e]}) setOutput(getT${e}(yR, yC-${n}));`)}const n=t.length,a=t[t.length-1];r.push(`else setOutput(getT${n}(yR, yC-${a}));`),this.userCode=`\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int yR = coords.x;\n        int yC = coords.y;\n\n        ${r.join("\n        ")}\n      }\n    `}}class gL{constructor(e,t){this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=Lh(e,t);const r=this.outputShape,n=r.length,a=eI(n),i=lP("coords",n),o=["x","y","z","w","u","v"].slice(0,n);this.variableNames=e.map(((e,t)=>`T${t}`));const s=new Array(e.length-1);s[0]=e[0][t];for(let r=1;r<s.length;r++)s[r]=s[r-1]+e[r][t];const l=o[t],c=o.slice(-2),u=o.join();let f=`if (${l} < ${s[0]}) {\n        return getChannel(\n            getT0(${u}), vec2(${c.join()}));\n        }`;for(let e=1;e<s.length;e++){const t=s[e-1];f+=`\n        if (${l} < ${s[e]}  && ${l} >= ${s[e-1]}) {\n          return getChannel(\n            getT${e}(${yL(o,l,t)}),\n            vec2(${yL(c,l,t)}));\n        }`}const p=s.length,h=s[s.length-1];f+=`\n        return getChannel(\n          getT${p}(${yL(o,l,h)}),\n          vec2(${yL(c,l,h)}));`,this.userCode=`\n      float getValue(${o.map((e=>"int "+e))}) {\n        ${f}\n      }\n\n      void main() {\n        ${a} coords = getOutputCoords();\n        vec4 result = vec4(getValue(${i}), 0., 0., 0.);\n\n        ${i[n-1]} = ${i[n-1]} + 1;\n        if (${i[n-1]} < ${r[n-1]}) {\n          result.g = getValue(${i});\n        }\n\n        ${i[n-2]} = ${i[n-2]} + 1;\n        if (${i[n-2]} < ${r[n-2]}) {\n          result.a = getValue(${i});\n        }\n\n        ${i[n-1]} = ${i[n-1]} - 1;\n        if (${i[n-2]} < ${r[n-2]} &&\n            ${i[n-1]} < ${r[n-1]}) {\n          result.b = getValue(${i});\n        }\n        setOutput(result);\n      }\n    `}}function yL(e,t,r){const n=e.indexOf(t);return e.map(((e,t)=>t===n?`${e} - ${r}`:e)).join()}function vL(e){const{inputs:t,backend:r}=e,{input:n}=t;return AP({inputs:{x:r.texData.get(n.dataId).complexTensorInfos.imag},backend:r})}const bL={kernelName:fr,backendName:"webgl",kernelFunc:vL};function xL(e,t,r){const n=e[0].dtype;if("complex64"===n){const n=e.map((e=>nL({inputs:{input:e},backend:r}))),a=e.map((e=>vL({inputs:{input:e},backend:r}))),i=xL(n,t,r),o=xL(a,t,r),s=MP({inputs:{real:i,imag:o},backend:r});return n.forEach((e=>r.disposeIntermediateTensorInfo(e))),a.forEach((e=>r.disposeIntermediateTensorInfo(e))),r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(o),s}let a=r.shouldExecuteOnCPU(e);if("string"===n&&(a=!0),a){const a=e.map((e=>{const n=se(e.shape.slice(t));return qP({inputs:{x:e},backend:r,attrs:{shape:[-1,n]}})})),i=a.map((e=>({vals:r.readSync(e.dataId),shape:e.shape}))),o=Lh(a.map((e=>e.shape)),1),s=1===a[0].shape[0],l=kI(i,o,n,s),c=Lh(e.map((e=>e.shape)),t),u=r.makeTensorInfo(c,n,l);return a.forEach((e=>r.disposeIntermediateTensorInfo(e))),u}if(e.length>We().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const n=Math.floor(e.length/2),a=xL(e.slice(0,n),t,r),i=xL(e.slice(n),t,r),o=xL([a,i],t,r);return r.disposeIntermediateTensorInfo(a),r.disposeIntermediateTensorInfo(i),o}if(We().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].shape.length>1){const a=new gL(e.map((e=>e.shape)),t);return r.runWebGLProgram(a,e,n)}const{tensors2D:i,outShape:o}=function(e,t,r){const n=Lh(e.map((e=>e.shape)),t);return{tensors2D:e.map((e=>qP({inputs:{x:e},attrs:{shape:[-1,se(e.shape.slice(t))]},backend:r}))),outShape:n}}(e,t,r),s=new mL(i.map((e=>e.shape))),l=r.runWebGLProgram(s,i,n);i.forEach((e=>r.disposeIntermediateTensorInfo(e)));const c=qP({inputs:{x:l},attrs:{shape:o},backend:r});return r.disposeIntermediateTensorInfo(l),c}function _L(e){const{inputs:t,backend:r,attrs:n}=e,{axis:a}=n,i=ye(a,t[0].shape)[0],o=Lh(t.map((e=>e.shape)),i);if(0===se(o))return r.makeTensorInfo(o,t[0].dtype,[]);const s=t.filter((e=>se(e.shape)>0));return 1===s.length?AP({inputs:{x:s[0]},backend:r}):(Rh(s.map((e=>e.shape)),i),xL(s,i,r))}const wL={kernelName:Dt,backendName:"webgl",kernelFunc:_L};class kL{constructor(e,t=!1,r=null,n=!1,a=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const i=e.padInfo.top,o=e.padInfo.left,s=e.strideHeight,l=e.strideWidth,c=e.dilationHeight,u=e.dilationWidth,f=e.filterHeight,p=e.filterWidth,h=4*Math.floor(e.inChannels/4),d=e.inChannels%4,m="channelsLast"===e.dataFormat,g=m?1:2,y=m?2:3,v=m?3:1;let b="",x="";r&&(b=n?`float activation(float a) {\n          float b = getPreluActivationWeightsAtOutCoords();\n          ${r}\n        }`:a?`float activation(float a) {\n          float b = getLeakyreluAlphaAtOutCoords();\n          ${r}\n        }`:`\n          float activation(float x) {\n            ${r}\n          }\n        `,x="result = activation(result);");const _=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),a&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n      ${b}\n\n      const ivec2 strides = ivec2(${s}, ${l});\n      const ivec2 pads = ivec2(${i}, ${o});\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords[0];\n        int d2 = coords[${v}];\n\n        ivec2 xRCCorner =\n            ivec2(coords[${g}], coords[${y}]) * strides - pads;\n        int xRCorner = xRCCorner.x;\n        int xCCorner = xRCCorner.y;\n\n        // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n        for (int wR = 0; wR < ${f}; wR++) {\n          int xR = xRCorner + wR * ${c};\n\n          if (xR < 0 || xR >= ${e.inHeight}) {\n            continue;\n          }\n\n          for (int wC = 0; wC < ${p}; wC++) {\n            int xC = xCCorner + wC * ${u};\n\n            if (xC < 0 || xC >= ${e.inWidth}) {\n              continue;\n            }\n\n            for (int d1 = 0; d1 < ${h}; d1 += 4) {\n              vec4 wValues = vec4(\n                getW(wR, wC, d1, d2),\n                getW(wR, wC, d1 + 1, d2),\n                getW(wR, wC, d1 + 2, d2),\n                getW(wR, wC, d1 + 3, d2)\n              );\n\n              if (${m}) {\n                vec4 xValues = vec4(\n                  getX(batch, xR, xC, d1),\n                  getX(batch, xR, xC, d1 + 1),\n                  getX(batch, xR, xC, d1 + 2),\n                  getX(batch, xR, xC, d1 + 3)\n                );\n                dotProd += dot(xValues, wValues);\n              } else {\n                vec4 xValues = vec4(\n                  getX(batch, d1, xR, xC),\n                  getX(batch, d1 + 1, xR, xC),\n                  getX(batch, d1 + 2, xR, xC),\n                  getX(batch, d1 + 3, xR, xC)\n                );\n                dotProd += dot(xValues, wValues);\n              }\n            }\n\n            if (${1===d}) {\n\n              if (${m}) {\n                dotProd +=\n                    getX(batch, xR, xC, ${h}) *\n                    getW(wR, wC, ${h}, d2);\n              } else {\n                dotProd +=\n                    getX(batch, ${h}, xR, xC) *\n                    getW(wR, wC, ${h}, d2);\n              }\n\n            } else if (${2===d}) {\n              vec2 wValues = vec2(\n                getW(wR, wC, ${h}, d2),\n                getW(wR, wC, ${h} + 1, d2)\n              );\n\n              if (${m}) {\n                vec2 xValues = vec2(\n                  getX(batch, xR, xC, ${h}),\n                  getX(batch, xR, xC, ${h} + 1)\n                );\n                dotProd += dot(xValues, wValues);\n              } else {\n                vec2 xValues = vec2(\n                  getX(batch, ${h}, xR, xC),\n                  getX(batch, ${h} + 1, xR, xC)\n                );\n                dotProd += dot(xValues, wValues);\n              }\n\n            } else if (${3===d}) {\n              vec3 wValues = vec3(\n                getW(wR, wC, ${h}, d2),\n                getW(wR, wC, ${h} + 1, d2),\n                getW(wR, wC, ${h} + 2, d2)\n              );\n\n              if (${m}) {\n                vec3 xValues = vec3(\n                  getX(batch, xR, xC, ${h}),\n                  getX(batch, xR, xC, ${h} + 1),\n                  getX(batch, xR, xC, ${h} + 2)\n                );\n                dotProd += dot(xValues, wValues);\n              } else {\n                vec3 xValues = vec3(\n                  getX(batch, ${h}, xR, xC),\n                  getX(batch, ${h} + 1, xR, xC),\n                  getX(batch, ${h} + 2, xR, xC)\n                );\n                dotProd += dot(xValues, wValues);\n              }\n\n            }\n          }\n        }\n\n        float result = dotProd;\n        ${_}\n        ${x}\n        setOutput(result);\n      }\n    `}}class DL{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const t=e.padInfo.front,r=e.padInfo.top,n=e.padInfo.left,a=e.strideDepth,i=e.strideHeight,o=e.strideWidth,s=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=e.filterDepth,f=e.filterHeight,p=e.filterWidth,h=4*Math.floor(e.inChannels/4),d=e.inChannels%4;this.userCode=`\n      const ivec3 strides = ivec3(${a}, ${i}, ${o});\n      const ivec3 pads = ivec3(${t}, ${r}, ${n});\n\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int batch = coords.x;\n        int d2 = coords.u;\n\n        ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n        int xFCorner = xFRCCorner.x;\n        int xRCorner = xFRCCorner.y;\n        int xCCorner = xFRCCorner.z;\n\n        // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n        // y(yF, yR, yC, d2). ? = to be determined. : = across all\n        // values in that axis.\n        float dotProd = 0.0;\n        for (int wF = 0; wF < ${u}; wF++) {\n          int xF = xFCorner + wF * ${s};\n\n          if (xF < 0 || xF >= ${e.inDepth}) {\n            continue;\n          }\n\n          for (int wR = 0; wR < ${f}; wR++) {\n            int xR = xRCorner + wR * ${l};\n\n            if (xR < 0 || xR >= ${e.inHeight}) {\n              continue;\n            }\n\n            for (int wC = 0; wC < ${p}; wC++) {\n              int xC = xCCorner + wC * ${c};\n\n              if (xC < 0 || xC >= ${e.inWidth}) {\n                continue;\n              }\n\n              for (int d1 = 0; d1 < ${h}; d1 += 4) {\n                vec4 xValues = vec4(\n                  getX(batch, xF, xR, xC, d1),\n                  getX(batch, xF, xR, xC, d1 + 1),\n                  getX(batch, xF, xR, xC, d1 + 2),\n                  getX(batch, xF, xR, xC, d1 + 3)\n                );\n                vec4 wValues = vec4(\n                  getW(wF, wR, wC, d1, d2),\n                  getW(wF, wR, wC, d1 + 1, d2),\n                  getW(wF, wR, wC, d1 + 2, d2),\n                  getW(wF, wR, wC, d1 + 3, d2)\n                );\n\n                dotProd += dot(xValues, wValues);\n              }\n\n              if (${1===d}) {\n                dotProd +=\n                  getX(batch, xF, xR, xC, ${h}) *\n                  getW(wF, wR, wC, ${h}, d2);\n              } else if (${2===d}) {\n                vec2 xValues = vec2(\n                  getX(batch, xF, xR, xC, ${h}),\n                  getX(batch, xF, xR, xC, ${h} + 1)\n                );\n                vec2 wValues = vec2(\n                  getW(wF, wR, wC, ${h}, d2),\n                  getW(wF, wR, wC, ${h} + 1, d2)\n                );\n                dotProd += dot(xValues, wValues);\n              } else if (${3===d}) {\n                vec3 xValues = vec3(\n                  getX(batch, xF, xR, xC, ${h}),\n                  getX(batch, xF, xR, xC, ${h} + 1),\n                  getX(batch, xF, xR, xC, ${h} + 2)\n                );\n                vec3 wValues = vec3(\n                  getW(wF, wR, wC, ${h}, d2),\n                  getW(wF, wR, wC, ${h} + 1, d2),\n                  getW(wF, wR, wC, ${h} + 2, d2)\n                );\n                dotProd += dot(xValues, wValues);\n              }\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class TL{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"},{name:"pad",type:"ivec2"},{name:"stride",type:"ivec2"},{name:"dilation",type:"ivec2"},{name:"inChannels",type:"int"},{name:"itemsPerBlockRow",type:"int"},{name:"outWidth",type:"int"}],this.outputShape=e,this.enableShapeUniforms=iI(this.outputShape.length);const{dataFormat:r}=t,n=zO(),a="channelsLast"===r,i=a?0:1,o=a?1:2,s=this.enableShapeUniforms?"if(blockIndex < outShape[1] && pos < outShape[0]) {":`if(blockIndex < ${e[1]} && pos < ${e[0]}) {`;let l="";for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)l+=`\n          blockIndex = rc.y + ${t};\n          pos = rc.x + ${e};\n\n          ${s}\n            offsetY = int(blockIndex / outWidth) * stride[0] - pad[0];\n            d0 = offsetY + dilation[0] * (pos / itemsPerBlockRow);\n\n            if(d0 < inputShape[${i}] && d0 >= 0) {\n              // Use custom imod instead mod. On Intel GPU, mod may generate\n              // unexpected value.\n              // https://github.com/tensorflow/tfjs/issues/5447\n              offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1];\n              d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) /\n                  inChannels);\n\n              if(d1 < inputShape[${o}] && d1 >= 0) {\n\n                ch = imod(pos, inChannels);\n\n                if (${a}) {\n                  innerDims = vec2(d1, ch);\n                  result[${2*e+t}] = getChannel(\n                    getA(d0, int(innerDims.x),\n                    int(innerDims.y)), innerDims);\n                } else {\n                  innerDims = vec2(d0, d1);\n                  result[${2*e+t}] = getChannel(\n                    getA(ch, int(innerDims.x),\n                    int(innerDims.y)), innerDims);\n                }\n              }\n            }\n          }\n        `;this.userCode=`\n      void main() {\n        ivec2 rc = getOutputCoords();\n\n        vec4 result = vec4(0);\n\n        int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n        vec2 innerDims;\n\n        ${l}\n\n        ${n.output} = result;\n      }\n    `}}function AL({x:e,filter:t,convInfo:r,backend:n,bias:a=null,preluActivationWeights:i=null,leakyreluAlpha:o=0,activation:s=null}){const l=e.shape,c=n.texData.get(e.dataId),u=r.inChannels,f=l[0]*l[1]*l[2],p=r.outChannels,h="channelsLast"===r.dataFormat;let d;const m=[];if((1!==f&&1!==p||!(u>1e3))&&c.isPacked&&h&&null!=c.texture&&l[2]%2!=0&&ce(c.shape.slice(-3),l.slice(-3))){const u=l[0]*l[1]*(l[2]+1),f={dataId:e.dataId,shape:[1,u,r.inChannels],dtype:e.dtype},p=c.shape;c.shape=c.shape.slice(),c.shape[c.shape.length-2]++,ne(NO(c.shape,f.shape),(()=>`packed reshape ${c.shape} to ${f.shape} isn't free`));const h=qP({inputs:{x:t},backend:n,attrs:{shape:[1,r.inChannels,r.outChannels]}});m.push(h);const g=rR({a:f,b:h,backend:n,transposeA:!1,transposeB:!1,bias:a,activation:s,preluActivationWeights:i,leakyreluAlpha:o}),y=n.texData.get(g.dataId);ne(y.isPacked,(()=>"batchMatMul result is expected to be packed")),c.shape=p,y.shape=r.outShape,d=AP({inputs:{x:g},backend:n}),d.shape=r.outShape,m.push(g)}else{const c=qP({inputs:{x:e},backend:n,attrs:{shape:[1,h?l[0]*l[1]*l[2]:l[0]*l[2]*l[3],r.inChannels]}}),u=qP({inputs:{x:t},backend:n,attrs:{shape:[1,r.inChannels,r.outChannels]}}),f=rR({a:c,b:u,transposeA:!1,transposeB:!1,backend:n,bias:a,activation:s,preluActivationWeights:i,leakyreluAlpha:o});d=qP({inputs:{x:f},backend:n,attrs:{shape:r.outShape}}),m.push(c),m.push(u),m.push(f)}for(const e of m)n.disposeIntermediateTensorInfo(e);return d}function SL({x:e,filter:t,convInfo:r,backend:n,bias:a=null,preluActivationWeights:i=null,leakyreluAlpha:o=0,activation:s=null}){const{filterWidth:l,filterHeight:c,inChannels:u,outWidth:f,outHeight:p,dataFormat:h}=r,d="channelsLast"===h,m=l*c*u,g=p*f,y=[m,g],v=[],b=qP({inputs:{x:e},backend:n,attrs:{shape:e.shape.slice(1)}}),x=qP({inputs:{x:t},backend:n,attrs:{shape:[1,m,se(t.shape)/m]}});v.push(b),v.push(x);const _=new TL(y,r),w=[b.shape,[r.padInfo.top,r.padInfo.left],[r.strideHeight,r.strideWidth],[r.dilationHeight,r.dilationWidth],[r.inChannels],[r.filterWidth*r.inChannels],[r.outWidth]],k=n.runWebGLProgram(_,[b],"float32",w),D=qP({inputs:{x:k},backend:n,attrs:{shape:[1,y[0],y[1]]}});v.push(k),v.push(D);const T=null!=a,A=null!=i,S="leakyrelu"===s,M=s?BP(s,!0):null,E=new zP(D.shape,x.shape,[1,g,r.outChannels],!0,!1,T,M,A,S),C=[D,x];if(a&&C.push(a),A&&C.push(i),S){const e=n.makeTensorInfo([],"float32",Ea(o,"float32"));C.push(e),v.push(e)}const N=n.runWebGLProgram(E,C,"float32"),O=qP({inputs:{x:N},backend:n,attrs:{shape:d?[1,p,f,r.outChannels]:[1,r.outChannels,p,f]}});v.push(N);for(const e of v)n.disposeIntermediateTensorInfo(e);return O}const ML={kernelName:Tt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,filter:i}=t,{strides:o,pad:s,dataFormat:l,dilations:c,dimRoundingMode:u}=n,f=sc(l),p=Jl(a.shape,i.shape,o,c,s,u,!1,f);let h;if(1!==p.filterHeight||1!==p.filterWidth||1!==p.dilationHeight||1!==p.dilationWidth||1!==p.strideHeight||1!==p.strideWidth||"SAME"!==p.padInfo.type&&"VALID"!==p.padInfo.type)if(We().getBool("WEBGL_CONV_IM2COL")&&1===a.shape[0])h=SL({x:a,filter:i,convInfo:p,backend:r});else{const e=new kL(p);h=r.runWebGLProgram(e,[a,i],"float32")}else h=AL({x:a,filter:i,convInfo:p,backend:r});const d=qP({inputs:{x:h},backend:r,attrs:{shape:p.outShape}});return r.disposeIntermediateTensorInfo(h),d}};class EL{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,r=e.strideWidth,n=e.padInfo.top,a=e.padInfo.left,i="channelsLast"===e.dataFormat;this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int wR = coords.x;\n        int wC = coords.y;\n        int d1 = coords.z;\n        int d2 = coords.w;\n\n        // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n\n        for (int b = 0; b < ${e.batchSize}; b++) {\n          for (int yR = 0; yR < ${e.outHeight}; yR++) {\n            int xR = wR + yR * ${t} - ${n};\n\n            if (xR < 0 || xR >= ${e.inHeight}) {\n              continue;\n            }\n\n            for (int yC = 0; yC < ${e.outWidth}; yC++) {\n              int xC = wC + yC * ${r} - ${a};\n\n              if (xC < 0 || xC >= ${e.inWidth}) {\n                continue;\n              }\n\n              if (${i}) {\n                float dyValue = getDy(b, yR, yC, d2);\n                float xValue = getX(b, xR, xC, d1);\n                dotProd += (xValue * dyValue);\n              } else {\n                float dyValue = getDy(b, d2, yR, yC);\n                float xValue = getX(b, d1, xR, xC);\n                dotProd += (xValue * dyValue);\n              }\n\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class CL{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,r=e.filterWidth,n=e.strideHeight,a=e.strideWidth,i="channelsLast"===e.dataFormat,o=t-1-e.padInfo.top,s=r-1-e.padInfo.left,l=i?1:2,c=i?2:3,u=i?3:1;this.userCode=`\n      const ivec2 pads = ivec2(${o}, ${s});\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords[0];\n        int d1 = coords[${u}];\n\n        ivec2 dyCorner = ivec2(coords[${l}], coords[${c}]) - pads;\n        int dyRCorner = dyCorner.x;\n        int dyCCorner = dyCorner.y;\n\n        // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n        for (int wR = 0; wR < ${t}; wR++) {\n          float dyR = float(dyRCorner + wR) / ${n}.0;\n\n          if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n            continue;\n          }\n          int idyR = int(dyR);\n\n          int wRPerm = ${t} - 1 - wR;\n\n          for (int wC = 0; wC < ${r}; wC++) {\n            float dyC = float(dyCCorner + wC) / ${a}.0;\n\n            if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                fract(dyC) > 0.0) {\n              continue;\n            }\n            int idyC = int(dyC);\n\n            int wCPerm = ${r} - 1 - wC;\n\n            for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n\n              if (${i}) {\n                float xValue = getDy(batch, idyR, idyC, d2);\n                float wValue = getW(wRPerm, wCPerm, d1, d2);\n                dotProd += xValue * wValue;\n              } else {\n                float xValue = getDy(batch, d2, idyR, idyC);\n                float wValue = getW(wRPerm, wCPerm, d1, d2);\n                dotProd += xValue * wValue;\n              }\n\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class NL{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,r=e.strideHeight,n=e.strideWidth,a=e.padInfo.front,i=e.padInfo.top,o=e.padInfo.left;this.userCode=`\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int wF = coords.x;\n        int wR = coords.y;\n        int wC = coords.z;\n        int d1 = coords.w;\n        int d2 = coords.u;\n\n        float dotProd = 0.0;\n\n        for (int b = 0; b < ${e.batchSize}; b++) {\n          for (int yF = 0; yF < ${e.outDepth}; yF++) {\n            int xF = wF + yF * ${t} - ${a};\n\n            if (xF < 0 || xF >= ${e.inDepth}) {\n              continue;\n            }\n\n            for (int yR = 0; yR < ${e.outHeight}; yR++) {\n              int xR = wR + yR * ${r} - ${i};\n\n              if (xR < 0 || xR >= ${e.inHeight}) {\n                continue;\n              }\n\n              for (int yC = 0; yC < ${e.outWidth}; yC++) {\n                int xC = wC + yC * ${n} - ${o};\n\n                if (xC < 0 || xC >= ${e.inWidth}) {\n                  continue;\n                }\n\n                float dyValue = getDy(b, yF, yR, yC, d2);\n                float xValue = getX(b, xF, xR, xC, d1);\n                dotProd += (xValue * dyValue);\n              }\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class OL{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,r=e.filterHeight,n=e.filterWidth,a=e.strideDepth,i=e.strideHeight,o=e.strideWidth,s=t-1-e.padInfo.front,l=r-1-e.padInfo.top,c=n-1-e.padInfo.left;this.userCode=`\n      const ivec3 pads = ivec3(${s}, ${l}, ${c});\n\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int batch = coords.x;\n        int d1 = coords.u;\n\n\n        ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n        int dyFCorner = dyCorner.x;\n        int dyRCorner = dyCorner.y;\n        int dyCCorner = dyCorner.z;\n\n        float dotProd = 0.0;\n        for (int wF = 0; wF < ${t}; wF++) {\n          float dyF = float(dyFCorner + wF) / ${a}.0;\n\n          if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) {\n            continue;\n          }\n          int idyF = int(dyF);\n\n          int wFPerm = ${t} - 1 - wF;\n\n          for (int wR = 0; wR < ${r}; wR++) {\n            float dyR = float(dyRCorner + wR) / ${i}.0;\n\n            if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n              fract(dyR) > 0.0) {\n              continue;\n            }\n            int idyR = int(dyR);\n\n            int wRPerm = ${r} - 1 - wR;\n\n            for (int wC = 0; wC < ${n}; wC++) {\n              float dyC = float(dyCCorner + wC) / ${o}.0;\n\n              if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                  fract(dyC) > 0.0) {\n                continue;\n              }\n              int idyC = int(dyC);\n\n              int wCPerm = ${n} - 1 - wC;\n\n              for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n                float xValue = getDy(batch, idyF, idyR, idyC, d2);\n                float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n                dotProd += xValue * wValue;\n              }\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}const IL={kernelName:At,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,dy:i}=t,{strides:o,pad:s,dataFormat:l,dimRoundingMode:c,filterShape:u}=n,f=sc(l),p=Jl(a.shape,u,o,1,s,c,!1,f),h=new EL(p);return r.runWebGLProgram(h,[a,i],"float32")}},PL={kernelName:St,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,filter:i}=t,{inputShape:o,strides:s,pad:l,dataFormat:c,dimRoundingMode:u}=n,f=sc(c),p=Jl(o,i.shape,s,1,l,u,!1,f),h=new CL(p);return r.runWebGLProgram(h,[a,i],"float32")}},RL={kernelName:Mt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,filter:i}=t,{strides:o,pad:s,dilations:l}=n,c=Ql(a.shape,i.shape,o,l,s),u=new DL(c);return r.runWebGLProgram(u,[a,i],"float32")}},LL={kernelName:Et,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,dy:i}=t,{strides:o,pad:s,filterShape:l}=n,c=Ql(a.shape,l,o,1,s),u=new NL(c);return r.runWebGLProgram(u,[a,i],"float32")}},FL={kernelName:Ct,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,filter:i}=t,{pad:o,strides:s,inputShape:l}=n,c=Ql(l,i.shape,s,1,o),u=new OL(c);return r.runWebGLProgram(u,[a,i],"float32")}},BL=LP({opSnippet:"if (isnan(x)) return x;\n  return cos(x);\n"}),zL={kernelName:Nt,backendName:"webgl",kernelFunc:BL},jL=LP({opSnippet:"\n  float e2x = exp(-x);\n  return (e2x + 1.0 / e2x) / 2.0;\n"}),UL={kernelName:Ot,backendName:"webgl",kernelFunc:jL};class $L{constructor(e,t,r,n,a){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[i,o,s,l]=e,[c]=t,[u,f]=r;this.outputShape=[c,u,f,l];const p="bilinear"===n?1:0,[h,d]=[o-1+".0",s-1+".0"],[m,g,y]=u>1?[""+(o-1)/(u-1),"(y2-y1) * height_ratio",`y1*${h} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${h}`],[v,b,x]=f>1?[""+(s-1)/(f-1),"(x2-x1) * width_ratio",`x1*${d} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${d}`];this.userCode=`\n      const float height_ratio = float(${m});\n      const float width_ratio = float(${v});\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int y = coords[1];\n        int x = coords[2];\n        int d = coords[3];\n\n        // get box vals\n        float y1 = getBoxes(b,0);\n        float x1 = getBoxes(b,1);\n        float y2 = getBoxes(b,2);\n        float x2 = getBoxes(b,3);\n\n        // get image in batch index\n        int bInd = round(getBoxInd(b));\n        if(bInd < 0 || bInd >= ${i}) {\n          return;\n        }\n\n        float height_scale = ${g};\n        float width_scale = ${b};\n\n        float in_y = ${y};\n        if( in_y < 0.0 || in_y > ${h} ) {\n          setOutput(float(${a}));\n          return;\n        }\n        float in_x = ${x};\n        if( in_x < 0.0 || in_x > ${d} ) {\n          setOutput(float(${a}));\n          return;\n        }\n\n        vec2 sourceFracIndexCR = vec2(in_x,in_y);\n        if(${p} == 1) {\n          // Compute the four integer indices.\n          ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n          ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n          float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n          float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n          float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n          float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n          vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n          float top = topLeft + (topRight - topLeft) * fracCR.x;\n          float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n          float newValue = top + (bottom - top) * fracCR.y;\n          setOutput(newValue);\n        } else {\n          // Compute the coordinators of nearest neighbor point.\n          ivec2 sourceNearestCR = ivec2(floor(\n            sourceFracIndexCR + vec2(0.5,0.5)));\n          float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n          setOutput(newValue);\n        }\n      }\n    `}}const VL={kernelName:Pt,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:r,attrs:n}=e,{image:a,boxes:i,boxInd:o}=t,{cropSize:s,method:l,extrapolationValue:c}=n,u=new $L(a.shape,i.shape,s,l,c);return r.runWebGLProgram(u,[a,i,o],"float32")}};class qL{constructor(e,t,r){this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}],this.outputShape=e;const n=e.length,a=t?"0.0":`getX(${WL(n,"coords")})`,i=e[e.length-1];let o="",s="";t?(o=r?"end != "+(i-1):"end != 0",s=r?"end + 1":"end - 1"):(o=r?`end + pow2 < ${i}`:"end >= pow2",s=r?"end + pow2":"end - pow2"),this.userCode=`\n      void main() {\n        ${eI(n)} coords = getOutputCoords();\n        int end = ${HL(n,"coords")};\n        float val = ${a};\n        int pow2 = int(pow(2.0, index));\n        if (${o}) {\n          int idx = ${s};\n          ${HL(n,"coords")} = idx;\n          val += getX(${WL(n,"coords")});\n        }\n        setOutput(val);\n      }\n    `}}function WL(e,t){if(1===e)return`${t}`;if(2===e)return`${t}.x, ${t}.y`;if(3===e)return`${t}.x, ${t}.y, ${t}.z`;if(4===e)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function HL(e,t){if(1===e)return`${t}`;if(2===e)return`${t}.y`;if(3===e)return`${t}.z`;if(4===e)return`${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}const GL={kernelName:It,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,exclusive:o,reverse:s}=n,l=a.shape.length,c=Cu([i],l);let u=a;null!=c&&(u=eR({inputs:{x:a},backend:r,attrs:{perm:c}}));const f=Ou(1,l)[0];if(f!==l-1)throw new Error(`WebGL cumsum shader expects an inner-most axis=${a.shape.length-1} but got axis=${i}`);const p=u.shape[f];let h=AP({inputs:{x:u},backend:r});for(let e=0;e<=Math.ceil(Math.log2(p))-1;e++){const t=new qL(u.shape,!1,s),n=[[e]],a=h;h=r.runWebGLProgram(t,[h],h.dtype,n),r.disposeIntermediateTensorInfo(a)}if(o){const e=new qL(u.shape,o,s),t=h;h=r.runWebGLProgram(e,[h],h.dtype),r.disposeIntermediateTensorInfo(t)}if(null!=c){const e=eR({inputs:{x:h},backend:r,attrs:{perm:Nu(c)}});return r.disposeIntermediateTensorInfo(h),r.disposeIntermediateTensorInfo(u),e}return h}},XL={kernelName:Rt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,weights:i}=t,{size:o,binaryOutput:s}=n;if(1===a.shape.length){const e=r.readSync(a.dataId),t=r.readSync(i.dataId),n=xI(e,t,i.dtype,i.shape,o);return r.makeTensorInfo([o],i.dtype,n)}if(2===a.shape.length){const e=r.bufferSync(a),t=r.bufferSync(i),n=_I(e,t,o,s);return r.makeTensorInfo(n.shape,i.dtype,n.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${a.shape.length}.`)}};class YL{constructor(e,t,r){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=r,this.userCode=`\n    void main() {\n      ivec4 coords = getOutputCoords();\n      int b = coords[0];\n      int h = ${this.getHeightCoordString()};\n      int w = ${this.getWidthCoordString()};\n      int d = ${this.getDepthCoordString()};\n\n      int in_h = h / ${t};\n      int offset_h = imod(h, ${t});\n      int in_w = w / ${t};\n      int offset_w = imod(w, ${t});\n      int offset_d = (offset_h * ${t} + offset_w) *\n        ${this.getOutputDepthSize()};\n      int in_d = d + offset_d;\n\n      float result = ${this.getInputSamplingString()};\n      setOutput(result);\n    }\n  `}getHeightCoordString(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}getWidthCoordString(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}getDepthCoordString(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}getOutputDepthSize(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}const ZL={kernelName:Lt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{blockSize:i,dataFormat:o}=n,s=a.shape[0],l=("NHWC"===o?a.shape[1]:a.shape[2])*i,c=("NHWC"===o?a.shape[2]:a.shape[3])*i,u=("NHWC"===o?a.shape[3]:a.shape[1])/(i*i),f=new YL("NHWC"===o?[s,l,c,u]:[s,u,l,c],i,o);return r.runWebGLProgram(f,[a],a.dtype)}};class KL{constructor(e,t=!1,r=null,n=!1,a=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=iI(this.outputShape.length);const i=e.filterHeight,o=e.filterWidth,s=e.outChannels/e.inChannels;let l="",c="";r&&(l=n?`float activation(float a) {\n          float b = getPreluActivationWeightsAtOutCoords();\n          ${r}\n        }`:a?`float activation(float a) {\n          float b = getLeakyreluAlphaAtOutCoords();\n          ${r}\n        }`:`\n          float activation(float x) {\n            ${r}\n          }\n        `,c="result = activation(result);");const u=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),a&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n      ${l}\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords.x;\n        ivec2 xRCCorner = coords.yz * strides - pads;\n        int d2 = coords.w;\n        int d1 = d2 / ${s};\n        int q = d2 - d1 * ${s};\n\n        int xRCorner = xRCCorner.x;\n        int xCCorner = xRCCorner.y;\n\n        // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n        // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n        for (int wR = 0; wR < ${i}; wR++) {\n          int xR = xRCorner + wR * dilations[0];\n\n          if (xR < 0 || xR >= inDims[0]) {\n            continue;\n          }\n\n          for (int wC = 0; wC < ${o}; wC++) {\n            int xC = xCCorner + wC * dilations[1];\n\n            if (xC < 0 || xC >= inDims[1]) {\n              continue;\n            }\n\n            float xVal = getX(batch, xR, xC, d1);\n            float wVal = getW(wR, wC, d1, q);\n            dotProd += xVal * wVal;\n          }\n        }\n\n        float result = dotProd;\n        ${u}\n        ${c}\n        setOutput(result);\n      }\n    `}}class JL{constructor(e,t=!1,r=null,n=!1,a=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=iI(this.outputShape.length);const i=e.outChannels/e.inChannels,o=e.padInfo.left,s=e.strideWidth,l=e.dilationWidth,c=e.filterHeight,u=e.filterWidth,f=u;let p="\n      int xR; int xC; int xCOffset;\n      vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e<u;e++)p+=`\n          vec4 xTexelC${2*e};\n          int xTexelC${2*e}Ready;\n          vec4 xTexelC${2*e+1};\n          int xTexelC${2*e+1}Ready;\n          vec4 xC${e};`;p+=`\n    for (int r = 0; r < ${c}; r++) {\n      `;for(let e=0;e<u;e++)p+=`\n          xTexelC${2*e} = vec4(0.0);\n          xTexelC${2*e}Ready = 0;\n          xTexelC${2*e+1} = vec4(0.0);\n          xTexelC${2*e+1}Ready = 0;\n          xC${e} = vec4(0.0);`;p+="\n        xR = xRCorner + r * dilations[0];\n        if (xR >=0 && xR < inDims[0]) {\n      ";for(let e=0;e<(f+1)/2;e++){const t=2*e;if(p+=`\n          xC = xCCorner + ${t*l};\n          `,1===s){if(t<u&&(o%2==1?(p+=`\n                xCOffset = xC + 1;\n                if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n                  xTexelC${t} = getX(batch, xR, xCOffset, d1);\n\n                  // Need to manually clear unused channels in case\n                  // we're reading from recycled texture.\n                  if (xCOffset + 1 >= inDims[1]) {\n                    xTexelC${t}.zw = vec2(0.0);\n                  }\n                  xTexelC${t}Ready = 1;\n                }\n              `,p+=1===l&&t>0?`\n                xC${t} = vec4(xTexelC${t-2}.zw, xTexelC${t}.xy);\n                `:`\n                  xCOffset = xC + 1 - 2;\n\n                  if (xCOffset >= 0 && xCOffset < inDims[1]) {\n                    previous = getX(batch, xR, xCOffset, d1);\n\n                    // Need to manually clear unused channels in case\n                    // we're reading from recycled texture.\n                    if (xCOffset + 1 >= inDims[1]) {\n                      previous.zw = vec2(0.0);\n                    }\n\n                    xC${t} = vec4(previous.zw, xTexelC${t}.xy);\n                  } else {\n                    xC${t} = vec4(0.0, 0.0, xTexelC${t}.xy);\n                  }\n                  `):p+=`\n                if (xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n                  xTexelC${t} = getX(batch, xR, xC, d1);\n                  if (xC + 1 >= inDims[1]) {\n                    xTexelC${t}.zw = vec2(0.0);\n                  }\n                  xTexelC${t}Ready = 1;\n                }\n\n                xC${t} = xTexelC${t};\n                `,t+1<u)){const e=o%2==0?J(l):l;l%2==0&&o%2==1||l%2!=0&&o%2!=1?(p+=`\n                  xCOffset = xC + imod(pads[1], 2) + ${e};\n\n                  if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n                    xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n\n                    // Need to manually clear unused channels in case\n                    // we're reading from recycled texture.\n                    if (xCOffset + 1 >= inDims[1]) {\n                      xTexelC${t+1}.zw = vec2(0.0);\n                    }\n                    xTexelC${t+1}Ready = 1;\n                  }\n                  `,l>1&&(p+=`\n                    xCOffset -= 2;\n                    if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n                      xTexelC${t} = getX(batch, xR, xCOffset, d1);\n                      xTexelC${t}Ready = 1;\n                    }\n                    `),p+=`\n                  xC${t+1} = vec4(xTexelC${t}.zw, xTexelC${t+1}.xy);\n                  `):p+=1===e?`\n                    xC${t+1} = xTexelC${t};\n                    `:`\n                    xCOffset = xC + ${e};\n\n                    if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n                      xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n                      if (xCOffset + 1 >= inDims[1]) {\n                        xTexelC${t+1}.zw = vec2(0.0);\n                      }\n                      xTexelC${t+1}Ready = 1;\n                    }\n\n                    xC${t+1} = xTexelC${t+1};\n                    `}}else t<u&&(o%2==1?(p+=`\n                xCOffset = xC + 1 - strides[1];\n                if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n                  xTexelC${t} = getX(batch, xR, xCOffset, d1);\n                  // Need to manually clear unused channels in case\n                  // we're reading from recycled texture.\n                  if (xCOffset + 1 >= inDims[1]) {\n                    xTexelC${t}.zw = vec2(0.0);\n                  }\n                  xTexelC${t}Ready = 1;\n                }\n\n                if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${t+1}Ready == 0) {\n                  xTexelC${t+1} = getX(batch, xR, xC + 1, d1);\n                  // Need to manually clear unused channels in case\n                  // we're reading from recycled texture.\n                  if (xC + 2 >= inDims[1]) {\n                    xTexelC${t+1}.zw = vec2(0.0);\n                  }\n                  xTexelC${t+1}Ready = 1;\n                }\n\n                xC${t} = vec4(xTexelC${t}.zw, xTexelC${t+1}.zw);\n              `,t+1<u&&(p+=`\n                  final = vec4(0.0);\n                  xCOffset = xC + 1 + strides[1];\n                  if(xCOffset >= 0 && xCOffset < inDims[1]) {\n                    final = getX(batch, xR, xCOffset, d1);\n                  }\n                  xC${t+1} = vec4(xTexelC${t+1}.xy, final.xy);\n                `)):(p+=`\n                if(xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n                  xTexelC${t} = getX(batch, xR, xC, d1);\n                  if (xC + 1 >= inDims[1]) {\n                    xTexelC${t}.zw = vec2(0.0);\n                  }\n                  xTexelC${t}Ready = 1;\n                }\n\n                xCOffset = xC + strides[1];\n                if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n                  xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n                  if (xCOffset + 1 >= inDims[1]) {\n                    xTexelC${t+1}.zw = vec2(0.);\n                  }\n                  xTexelC${t+1}Ready = 1;\n                }\n\n                xC${t} = vec4(\n                  xTexelC${t}.xy, xTexelC${t+1}.xy);\n              `,t+1<u&&(p+=`\n                  xC${t+1} = vec4(xTexelC${t}.zw, xTexelC${t+1}.zw);\n                `)));t<u&&(p+=`\n            wTexel = getW(r, ${t}, d1, q);\n            dotProd += xC${t} * vec4(wTexel.xz, wTexel.xz);\n          `,t+1<u&&(p+=`\n              wTexel = getW(r, ${t+1}, d1, q);\n              dotProd += xC${t+1} * vec4(wTexel.xz, wTexel.xz);\n            `))}p+="\n    }\n  ",p+="\n      }\n    ";let h="",d="";r&&(h=n?`vec4 activation(vec4 a) {\n          vec4 b = getPreluActivationWeightsAtOutCoords();\n          ${r}\n        }`:a?`vec4 activation(vec4 a) {\n          vec4 b = getLeakyreluAlphaAtOutCoords();\n          ${r}\n        }`:`vec4 activation(vec4 x) {\n          ${r}\n        }`,d="result = activation(result);");const m=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),a&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n      ${h}\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords.x;\n        ivec2 xRCCorner = coords.yz * strides - pads;\n        int d2 = coords.w;\n        int d1 = d2 / ${i};\n        int q = d2 - d1 * ${i};\n        int xRCorner = xRCCorner.x;\n        int xCCorner = xRCCorner.y;\n\n        //intialize dotProd with a small epsilon seems to reduce GPU accuracy loss.\n        vec4 dotProd = vec4(0.000000000000001);\n\n        ${p}\n\n        vec4 result = dotProd - vec4(0.000000000000001);\n        ${m}\n        ${d}\n        setOutput(result);\n      }\n    `}}const QL={kernelName:Ft,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,filter:i}=t,{strides:o,pad:s,dilations:l,dimRoundingMode:c}=n;let u=l;null==u&&(u=[1,1]),ne(oc(o,u),(()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${o} and dilations '${u}'`));const f=Jl(a.shape,i.shape,o,u,s,c,!0);let p;p=We().getBool("WEBGL_PACK_DEPTHWISECONV")&&f.strideWidth<=2&&f.outChannels/f.inChannels==1?new JL(f):new KL(f);const h=[[f.padInfo.top,f.padInfo.left],[f.strideHeight,f.strideWidth],[f.dilationHeight,f.dilationWidth],[f.inHeight,f.inWidth]];return r.runWebGLProgram(p,[a,i],"float32",h)}};class eF{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,r=e.strideWidth,n=e.padInfo.top,a=e.padInfo.left,i=e.outChannels/e.inChannels;this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int wR = coords.x;\n        int wC = coords.y;\n        int d1 = coords.z;\n        int dm = coords.w;\n        int d2 = d1 * ${i} + dm;\n\n        float dotProd = 0.0;\n\n        // TO DO: Vec4 over the batch size\n        for (int b = 0; b < ${e.batchSize}; b++) {\n          for (int yR = 0; yR < ${e.outHeight}; yR++) {\n            int xR = wR + yR * ${t} - ${n};\n\n            if (xR < 0 || xR >= ${e.inHeight}) {\n              continue;\n            }\n\n            for (int yC = 0; yC < ${e.outWidth}; yC++) {\n              int xC = wC + yC * ${r} - ${a};\n\n              if (xC < 0 || xC >= ${e.inWidth}) {\n                continue;\n              }\n\n              float dyValue = getDy(b, yR, yC, d2);\n              float xValue = getX(b, xR, xC, d1);\n              dotProd += (xValue * dyValue);\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class tF{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,r=e.filterWidth,n=e.strideHeight,a=e.strideWidth,i=t-1-e.padInfo.top,o=r-1-e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=`\n      const ivec2 pads = ivec2(${i}, ${o});\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords[0];\n        int d1 = coords[3];\n        ivec2 dyCorner = coords.yz - pads;\n        int dyRCorner = dyCorner.x;\n        int dyCCorner = dyCorner.y;\n\n        float dotProd = 0.0;\n\n        for (int wR = 0; wR < ${t}; wR++) {\n          float dyR = float(dyRCorner + wR) / ${n}.0;\n\n          if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n            continue;\n          }\n          int idyR = int(dyR);\n\n          int wRPerm = ${t} - 1 - wR;\n\n          for (int wC = 0; wC < ${r}; wC++) {\n            float dyC = float(dyCCorner + wC) / ${a}.0;\n\n            if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                fract(dyC) > 0.0) {\n              continue;\n            }\n            int idyC = int(dyC);\n\n            int wCPerm = ${r} - 1 - wC;\n\n            // TO DO: Vec4 over the channelMul\n            for (int dm = 0; dm < ${s}; dm++) {\n              int d2 = d1 * ${s} + dm;\n              float xValue = getDy(batch, idyR, idyC, d2);\n              float wValue = getW(wRPerm, wCPerm, d1, dm);\n              dotProd += xValue * wValue;\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}const rF={kernelName:Bt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,dy:i}=t,{strides:o,dilations:s,pad:l,dimRoundingMode:c,filterShape:u}=n,f=Jl(a.shape,u,o,s,l,c,!0),p=new eF(f);return r.runWebGLProgram(p,[a,i],"float32")}},nF={kernelName:zt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,filter:i}=t,{strides:o,dilations:s,pad:l,dimRoundingMode:c,inputShape:u}=n,f=Jl(u,i.shape,o,s,l,c,!0),p=new tF(f);return r.runWebGLProgram(p,[a,i],"float32")}};class aF{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode="\n      void main() {\n          ivec2 coords = getOutputCoords();\n          float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n          setOutput(val);\n      }\n    "}}const iF={kernelName:jt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{x:n}=t,a=[...n.shape,...n.shape],i=se(n.shape),o=qP({inputs:{x:n},backend:r,attrs:{shape:[i]}}),s=new aF(i),l=r.runWebGLProgram(s,[o],o.dtype),c=qP({inputs:{x:l},backend:r,attrs:{shape:a}});return r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(l),c}};class oF{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:r,padInfo:n,strideHeight:a,strideWidth:i,filterHeight:o,filterWidth:s,dilationHeight:l,dilationWidth:c}=e,{top:u,left:f}=n;this.userCode=`\n      const ivec2 strides = ivec2(${a}, ${i});\n      const ivec2 pads = ivec2(${u}, ${f});\n      const float neg_infinity = -3.4e38;\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int batch = coords.x;\n        int d1 = coords.w;\n        ivec2 outTopLeftCorner =\n            coords.yz * strides - pads;\n        int hBeg = outTopLeftCorner.x;\n        int wBeg = outTopLeftCorner.y;\n\n        float curVal = neg_infinity;\n        for (int h = 0; h < ${o}; h++) {\n          int hIn = hBeg + h * ${l};\n\n          if (hIn >= 0 && hIn < ${t}) {\n            for (int w = 0; w < ${s}; w++) {\n              int wIn = wBeg + w * ${c};\n\n              if (wIn >= 0 && wIn < ${r}) {\n                float xVal = getX(batch, hIn, wIn, d1);\n                float wVal = getW(h, w, d1);\n\n                float val = xVal + wVal;\n                if (val > curVal) {\n                  curVal = val;\n                }\n              }\n            }\n          }\n        }\n\n        float result = curVal;\n        setOutput(result);\n      }\n    `}}const sF={kernelName:Ut,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,filter:i}=t,{strides:o,pad:s,dilations:l}=n,c=Yl(a.shape,i.shape,o,s,"NHWC",l);let u;const f=new oF(c);u=r.runWebGLProgram(f,[a,i],"float32");const p=qP({inputs:{x:u},backend:r,attrs:{shape:c.outShape}});return r.disposeIntermediateTensorInfo(u),p}},lF={kernelName:Wt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{equation:a}=n,i=t,{allDims:o,summedDims:s,idDims:l}=ld(a,i.length);ud(o.length,l,i);const{path:c,steps:u}=fd(s,l),f=u.length;let p=null,h=o.length;const d=[];for(let e=0;e<f;++e){for(const t of u[e]){const{permutationIndices:e,expandDims:n}=cd(h,l[t]);let a;pd(e)?a=i[t]:(a=eR({inputs:{x:i[t]},backend:r,attrs:{perm:e}}),d.push(a));const o=a.shape.slice();for(let e=0;e<n.length;++e)o.splice(n[e],0,1);ce(a.shape,o)||(a=qP({inputs:{x:a},backend:r,attrs:{shape:o}}),d.push(a)),null===p?p=a:(p=$P({inputs:{a,b:p},backend:r}),d.push(p))}e<f-1&&(c[e]>=0&&(p=JP({inputs:{x:p},backend:r,attrs:{axis:c[e]-(o.length-h),keepDims:!1}}),d.push(p)),h--)}for(const e of d)e!==p&&r.disposeIntermediateTensorInfo(e);return p}},cF=LP({opSnippet:"return (x >= 0.0) ? x : (exp(x) - 1.0);",packedOpSnippet:"\n  vec4 result;\n\n  result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n  result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n  result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n  result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n  return result;\n"}),uF={kernelName:Ht,backendName:"webgl",kernelFunc:cF},fF={kernelName:Gt,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:r}=e,{dy:n,y:a}=t,i=We().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new TP("\n  vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n  return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",n.shape,a.shape):new DP("return (b >= 1.0) ? a : a * (b + 1.0);",n.shape,a.shape);return r.runWebGLProgram(i,[n,a],n.dtype)}},pF=FP({opSnippet:"return float(a == b);",packedOpSnippet:"\n  return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:DI}),hF={kernelName:Yt,backendName:"webgl",kernelFunc:pF},dF=LP({opSnippet:`\n  // Error function is calculated approximately with elementary function.\n  // See "Handbook of Mathematical Functions with Formulas,\n  // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n  float p = ${Gh};\n  float a1 = ${Xh};\n  float a2 = ${Yh};\n  float a3 = ${Zh};\n  float a4 = ${Kh};\n  float a5 = ${Jh};\n\n  float sign = sign(x);\n  x = abs(x);\n  float t = 1.0 / (1.0 + p * x);\n  return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n`}),mF={kernelName:Xt,backendName:"webgl",kernelFunc:dF},gF=LP({opSnippet:"if (isnan(x)) return x;\n  return exp(x);\n",packedOpSnippet:"\n  vec4 result = exp(x);\n  bvec4 isNaN = isnan(x);\n  result.r = isNaN.r ? x.r : result.r;\n  result.g = isNaN.g ? x.g : result.g;\n  result.b = isNaN.b ? x.b : result.b;\n  result.a = isNaN.a ? x.a : result.a;\n\n  return result;\n",cpuKernelImpl:TI,dtype:"float32"}),yF={kernelName:Zt,backendName:"webgl",kernelFunc:gF};function vF(e){const{inputs:t,attrs:r,backend:n}=e,{dim:a}=r,{input:i}=t,o=i.shape.length,s=i.shape.slice();let l=a;return a<0&&(ne(-(o+1)<=a,(()=>`Axis must be in the interval [${-(o+1)}, ${o}]`)),l=o+a+1),s.splice(l,0,1),qP({inputs:{x:i},backend:n,attrs:{shape:s}})}const bF={kernelName:Kt,backendName:"webgl",kernelFunc:vF},xF="return exp(x) - 1.0;",_F=LP({opSnippet:xF,packedOpSnippet:xF,cpuKernelImpl:AI}),wF={kernelName:Jt,backendName:"webgl",kernelFunc:_F};class kF{constructor(e,t,r){this.variableNames=["real","imag"];const n=t[1];this.outputShape=t;const a=r?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,i=r?`${n}.0`:"1.0";let o;if("real"===e)o="return real * expR - imag * expI;";else{if("imag"!==e)throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);o="return real * expI + imag * expR;"}this.userCode=`\n      const float exponentMultiplier = ${a};\n\n      float unaryOpComplex(float real, float expR, float imag, float expI) {\n        ${o}\n      }\n\n      float mulMatDFT(int batch, int index) {\n        float indexRatio = float(index) / float(${n});\n        float exponentMultiplierTimesIndexRatio =\n            exponentMultiplier * indexRatio;\n\n        float result = 0.0;\n\n        for (int i = 0; i < ${n}; i++) {\n          // x = (-2|2 * PI / N) * index * i;\n          float x = exponentMultiplierTimesIndexRatio * float(i);\n          float expR = cos(x);\n          float expI = sin(x);\n          float real = getReal(batch, i);\n          float imag = getImag(batch, i);\n\n          result +=\n              unaryOpComplex(real, expR, imag, expI) / ${i};\n        }\n\n        return result;\n      }\n\n      void main() {\n        ivec2 coords = getOutputCoords();\n        setOutput(mulMatDFT(coords[0], coords[1]));\n      }\n    `}}function DF(e,t,r){const n=r.texData.get(e.dataId),a=se(e.shape),i=e.shape[e.shape.length-1],o=qP({inputs:{x:e},backend:r,attrs:{shape:[a/i,i]}}),s=o.shape,l=new kF("real",s,t),c=new kF("imag",s,t),u=[{dataId:n.complexTensorInfos.real.dataId,dtype:n.complexTensorInfos.real.dtype,shape:s},{dataId:n.complexTensorInfos.imag.dataId,dtype:n.complexTensorInfos.imag.dtype,shape:s}],f=r.runWebGLProgram(l,u,"float32"),p=r.runWebGLProgram(c,u,"float32"),h=MP({inputs:{real:f,imag:p},backend:r});r.disposeIntermediateTensorInfo(f),r.disposeIntermediateTensorInfo(p);const d=qP({inputs:{x:h},backend:r,attrs:{shape:e.shape}});return r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(h),d}const TF={kernelName:Qt,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{input:n}=t;return DF(n,!1,r)}};class AF{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode="\n      void main() {\n        // Input can be obtained from uniform value.\n        setOutput(value);\n      }\n    "}}function SF(e){const{backend:t,attrs:r}=e,{shape:n,value:a}=r;let{dtype:i}=r;if(i=i||Ce(a),"string"===i){const e=xe(i,se(n));return e.fill(a),t.makeTensorInfo(n,i,e)}{const e=new AF(n,a),r=[[a]];return t.runWebGLProgram(e,[],i,r)}}const MF={kernelName:er,backendName:"webgl",kernelFunc:SF};class EF{constructor(e){this.variableNames=["Image"],this.outputShape=[];const t=e[2];this.outputShape=e,this.userCode=`\n        void main() {\n          ivec4 coords = getOutputCoords();\n          int x = coords[2];\n\n          int coordX = ${t} - x - 1;\n          float outputValue;\n          if(coordX >= 0 && coordX < ${t}) {\n            outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n          } else {\n            outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n          }\n          setOutput(outputValue);\n        }\n    `}}const CF={kernelName:tr,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{const{image:r}=e,n=t,a=new EF(r.shape);return n.runWebGLProgram(a,[r],r.dtype)}},NF="return floor(x);",OF=LP({opSnippet:NF,packedOpSnippet:NF,cpuKernelImpl:SI}),IF={kernelName:rr,backendName:"webgl",kernelFunc:OF},PF=FP({opSnippet:"\n  float s = sign(a) * sign(b);\n  int ia = round(a);\n  int ib = round(b);\n  if (ib != 0) {\n    // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n    return float(idiv(ia, ib, s));\n  } else {\n    return NAN;\n  }\n",packedOpSnippet:"\n  ivec4 ia = round(a);\n  ivec4 ib = round(b);\n  bvec4 cond = notEqual(ib, ivec4(0));\n  ivec4 result = ivec4(0);\n  vec4 s = sign(a) * sign(b);\n\n  // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n  if (cond[0]) {\n    result[0] = idiv(ia[0], ib[0], s[0]);\n  }\n  if (cond[1]) {\n    result[1] = idiv(ia[1], ib[1], s[1]);\n  }\n  if (cond[2]) {\n    result[2] = idiv(ia[2], ib[2], s[2]);\n  }\n  if (cond[3]) {\n    result[3] = idiv(ia[3], ib[3], s[3]);\n  }\n  return vec4(result);\n",dtype:"int32"}),RF={kernelName:nr,backendName:"webgl",kernelFunc:PF};class LF{constructor(e){this.variableNames=["A"];const t=zO(),[r,n]=e;this.outputShape=e,this.userCode=`\n      void main() {\n        ivec3 coords = getOutputCoords();\n        int texR = coords[0];\n        int texC = coords[1];\n        int depth = coords[2];\n        vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${n}.0, ${r}.0);\n\n        vec4 values = ${t.texture2D}(A, uv);\n        float value;\n        if (depth == 0) {\n          value = values.r;\n        } else if (depth == 1) {\n          value = values.g;\n        } else if (depth == 2) {\n          value = values.b;\n        } else if (depth == 3) {\n          value = values.a;\n        }\n\n        setOutput(floor(value * 255.0 + 0.5));\n      }\n    `}}class FF{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=zO(),[r,n]=e;this.outputShape=e,this.userCode=`\n      void main() {\n        ivec3 coords = getOutputCoords();\n        int texR = coords[0];\n        int texC = coords[1];\n        int depth = coords[2];\n\n        vec4 result = vec4(0.);\n\n        for(int row=0; row<=1; row++) {\n          for(int col=0; col<=1; col++) {\n            texC = coords[1] + row;\n            depth = coords[2] + col;\n\n            vec2 uv = (vec2(texC, texR) + halfCR) /\n                       vec2(${n}.0, ${r}.0);\n            vec4 values = ${t.texture2D}(A, uv);\n            float value;\n            if (depth == 0) {\n              value = values.r;\n            } else if (depth == 1) {\n              value = values.g;\n            } else if (depth == 2) {\n              value = values.b;\n            } else if (depth == 3) {\n              value = values.a;\n            }\n\n            result[row * 2 + col] = floor(value * 255.0 + 0.5);\n          }\n        }\n\n        ${t.output} = result;\n      }\n    `}}const BF={kernelName:Kn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e;let{pixels:a}=t;const{numChannels:i}=n,o="undefined"!=typeof HTMLVideoElement&&a instanceof HTMLVideoElement,s="undefined"!=typeof HTMLImageElement&&a instanceof HTMLImageElement,[l,c]=o?[a.videoWidth,a.videoHeight]:[a.width,a.height],u=[c,l],f=[c,l,i];(s||o)&&(null==zF&&(zF=document.createElement("canvas").getContext("2d")),zF.canvas.width=l,zF.canvas.height=c,zF.drawImage(a,0,0,l,c),a=zF.canvas);const p=r.makeTensorInfo(u,"int32");r.texData.get(p.dataId).usage=uO.PIXELS,r.gpgpu.uploadPixelDataToTexture(r.getTexture(p.dataId),a);const h=We().getBool("WEBGL_PACK")?new FF(f):new LF(f),d=r.runWebGLProgram(h,[p],"int32");return r.disposeData(p.dataId),d}};let zF;const jF={kernelName:ea,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,filter:i,bias:o,preluActivationWeights:s}=t,{strides:l,pad:c,dataFormat:u,dilations:f,dimRoundingMode:p,activation:h,leakyreluAlpha:d}=n,m=sc(u),g=Jl(a.shape,i.shape,l,f,c,p,!1,m);let y;const v=[];if(1!==g.filterHeight||1!==g.filterWidth||1!==g.dilationHeight||1!==g.dilationWidth||1!==g.strideHeight||1!==g.strideWidth||"SAME"!==g.padInfo.type&&"VALID"!==g.padInfo.type)if(We().getBool("WEBGL_CONV_IM2COL")&&1===a.shape[0])y=SL({x:a,filter:i,convInfo:g,backend:r,bias:o,activation:h,preluActivationWeights:s,leakyreluAlpha:d});else{const e=null!=o,t=null!=s,n="leakyrelu"===h,l=h?BP(h,!1):null,c=new kL(g,e,l,t,n),u=[a,i];if(o&&u.push(o),s&&u.push(s),n){const e=r.makeTensorInfo([],"float32",Ea(d,"float32"));u.push(e),v.push(e)}y=r.runWebGLProgram(c,u,"float32")}else y=AL({x:a,filter:i,convInfo:g,backend:r,bias:o,activation:h,preluActivationWeights:s,leakyreluAlpha:d});const b=qP({inputs:{x:y},backend:r,attrs:{shape:g.outShape}});return v.push(y),v.forEach((e=>r.disposeIntermediateTensorInfo(e))),b}},UF={kernelName:ta,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,filter:i,bias:o,preluActivationWeights:s}=t,{strides:l,pad:c,dilations:u,dimRoundingMode:f,activation:p,leakyreluAlpha:h}=n,d=[];let m=u;null==m&&(m=[1,1]),ne(oc(l,m),(()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`));const g=Jl(a.shape,i.shape,l,m,c,f,!0),y=We().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels==1,v=p?BP(p,y):null,b=[a,i],x=null!=o,_=null!=s,w="leakyrelu"===p;if(x&&b.push(o),_&&b.push(s),w){const e=r.makeTensorInfo([],"float32",Ea(h,"float32"));b.push(e),d.push(e)}let k;k=y?new JL(g,x,v,_,w):new KL(g,x,v,_,w);const D=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],T=r.runWebGLProgram(k,b,"float32",D);return d.forEach((e=>r.disposeIntermediateTensorInfo(e))),T}};class $F{constructor(e,t,r){this.sliceDim=e,this.strides=t,this.variableNames=["x","indices"],this.outputShape=r;const n=eI(t.length),a=eI(r.length),i=this.sliceDim>1?"strides[j]":"strides";this.userCode=`\n        ${n} strides = ${n}(${this.strides});\n         void main() {\n          ${a} coords = getOutputCoords();\n          int flattenIndex = 0;\n          for (int j = 0; j < ${this.sliceDim}; j++) {\n            int index = round(getIndices(coords[0], j));\n            flattenIndex += index * ${i};\n          }\n          setOutput(getX(flattenIndex, coords[1]));\n        }\n      `}}const VF={kernelName:or,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{params:n,indices:a}=t,i=a.shape,o=i[i.length-1],s=se(n.shape),[l,c,u,f]=is(n,a),p=qP({inputs:{x:a},backend:r,attrs:{shape:[c,o]}}),h=qP({inputs:{x:n},backend:r,attrs:{shape:[se(n.shape)/u,u]}});if(r.shouldExecuteOnCPU([n,a])||"string"===n.dtype){const e=r.readSync(a.dataId),t=r.bufferSync(n),i=MI(e,t,n.dtype,c,o,u,f,n.shape,s);return r.makeTensorInfo(l,n.dtype,i.values)}const d=new $F(o,f,[c,u]),m=r.runWebGLProgram(d,[h,p],h.dtype),g=qP({inputs:{x:m},backend:r,attrs:{shape:l}});return r.disposeIntermediateTensorInfo(p),r.disposeIntermediateTensorInfo(h),r.disposeIntermediateTensorInfo(m),g}};class qF{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const r=eI(this.rank),n=function(e,t){const r=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[];for(let t=0;t<e.length;t++)2===t?n.push("index"):n.push(`${r[t]}`);return n.join()}(e);this.userCode=`\n      void main() {\n        ${r} resRC = getOutputCoords();\n        int index = int(getIndices(resRC.x, resRC.z));\n        float inBounds = (index >= 0) && (index < ${e[2]}) ? 1.0 : 0.0;\n        setOutput(inBounds * getA(${n}));\n      }\n    `}}function WF(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,indices:i}=t,{axis:o,batchDims:s}=n,l=ye(o,a.shape)[0];if(We().get("DEBUG")){const e=r.readSync(i.dataId),t=a.shape[l];for(let r=0;r<e.length;++r){const n=e[r];ne(n<=t-1&&n>=0,(()=>`GatherV2: the index value ${n} is not in [0, ${t-1}]`))}}const c=Ed(a,i,l,s),u=se(i.shape),f=[],p=qP({inputs:{x:a},backend:r,attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]}}),h=qP({inputs:{x:i},backend:r,attrs:{shape:[c.batchSize,u/c.batchSize]}});f.push(p),f.push(h);const d=[c.batchSize,c.outerSize,u/c.batchSize,c.sliceSize];if(r.shouldExecuteOnCPU([a,i])||"string"===a.dtype){const e=r.bufferSync(h),t=r.bufferSync(p),n=EI(t,e,d);return f.forEach((e=>r.disposeIntermediateTensorInfo(e))),r.makeTensorInfo(c.outputShape,n.dtype,n.values)}const m=new qF(p.shape,d),g=r.runWebGLProgram(m,[p,h],p.dtype);f.push(g);const y=qP({inputs:{x:g},backend:r,attrs:{shape:c.outputShape}});return f.forEach((e=>r.disposeIntermediateTensorInfo(e))),y}const HF={kernelName:ir,backendName:"webgl",kernelFunc:WF},GF=FP({opSnippet:"return float(a > b);",packedOpSnippet:"\n  return vec4(greaterThan(a, b));\n",cpuKernelImpl:CI,dtype:"bool"}),XF={kernelName:sr,backendName:"webgl",kernelFunc:GF},YF=FP({opSnippet:"return float(a >= b);",packedOpSnippet:"\n  return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:NI}),ZF={kernelName:lr,backendName:"webgl",kernelFunc:YF},KF={kernelName:ur,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{input:n}=t;return DF(n,!0,r)}},JF=LP({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),QF={kernelName:pr,backendName:"webgl",kernelFunc:JF},eB=LP({opSnippet:"return float(isinf(x));",dtype:"bool"}),tB={kernelName:hr,backendName:"webgl",kernelFunc:eB},rB=LP({opSnippet:"return float(isnan(x));",dtype:"bool"}),nB={kernelName:dr,backendName:"webgl",kernelFunc:rB},aB=FP({opSnippet:"return float(a < b);",packedOpSnippet:"\n  return vec4(lessThan(a, b));\n",cpuKernelImpl:OI,dtype:"bool"}),iB={kernelName:gr,backendName:"webgl",kernelFunc:aB},oB=FP({opSnippet:"return float(a <= b);",packedOpSnippet:"\n  return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:II,dtype:"bool"}),sB={kernelName:yr,backendName:"webgl",kernelFunc:oB},lB={kernelName:vr,backendName:"webgl",kernelFunc:function(e){const{backend:t,attrs:r}=e,{start:n,stop:a,num:i}=r,o=PI(n,a,i);return t.makeTensorInfo([o.length],"float32",o)}},cB=LP({opSnippet:"if (isnan(x)) return x;\n  return x < 0.0 ? 0./0. : log(x);\n",packedOpSnippet:"\n  vec4 result = log(x);\n  bvec4 isNaN = isnan(x);\n  result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r);\n  result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g);\n  result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b);\n  result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a);\n  return result;\n",cpuKernelImpl:RI}),uB={kernelName:br,backendName:"webgl",kernelFunc:cB},fB=LP({opSnippet:"if (isnan(x)) return x;\n  return log(1.0 + x);\n"}),pB={kernelName:xr,backendName:"webgl",kernelFunc:fB},hB=FP({opSnippet:"return float(a >= 1.0 && b >= 1.0);",packedOpSnippet:"\n  return vec4(\n    vec4(greaterThanEqual(a, vec4(1.0))) *\n    vec4(greaterThanEqual(b, vec4(1.0))));\n",dtype:"bool"}),dB={kernelName:_r,backendName:"webgl",kernelFunc:hB},mB=LP({opSnippet:"return float(!(x >= 1.0));"}),gB={kernelName:wr,backendName:"webgl",kernelFunc:mB},yB=FP({opSnippet:"return float(a >= 1.0 || b >= 1.0);",packedOpSnippet:"\n  return min(\n    vec4(greaterThanEqual(a, vec4(1.0))) +\n    vec4(greaterThanEqual(b, vec4(1.0))),\n    vec4(1.0));\n",dtype:"bool"}),vB={kernelName:kr,backendName:"webgl",kernelFunc:yB};class bB{constructor(e,t,r,n,a){this.variableNames=["x"],this.outputShape=[];const i=t,o=e[3]-1;let s;this.outputShape=e;const l=`float(${r}) + float(${n}) * sum`;s=.5===a?`inversesqrt(${l})`:1===a?`1.0/(${l})`:`exp(log(${l}) * float(-${a}));`,this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int r = coords[1];\n        int c = coords[2];\n        int d = coords[3];\n        float x = getX(b, r, c, d);\n        float sum = 0.0;\n        for (int j = -${i}; j <= ${i}; j++) {\n          int idx = d + j;\n          if (idx >= 0 && idx <=  ${o}) {\n            float z = getX(b, r, c, idx);\n            sum += z * z;\n          }\n        }\n        float val = x * ${s};\n        setOutput(val);\n      }\n    `}}class xB{constructor(e,t,r,n,a){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const i=t,o=e[3]-1;let s;this.outputShape=e;const l=`float(${r}) + float(${n}) * sum`;s=.5===a?`inversesqrt(${l})`:1===a?`1.0/(${l})`:`exp(log(${l}) * float(-${a}));`,this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords.x;\n        int r = coords.y;\n        int c = coords.z;\n        int d = coords.w;\n\n        bool hasNextCol = d < ${this.outputShape[3]};\n        bool hasNextRow = c < ${this.outputShape[2]};\n\n        vec4 sum = vec4(0.);\n        vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n        vec4 xAtOutputCoords = vec4(\n          getChannel(xFragAtOutputCoords, vec2(c, d)),\n          hasNextCol ?\n            getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n          hasNextRow ?\n            getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n        );\n\n        int firstChannel = d - ${i};\n        vec2 cache = vec2(0.);\n        if(firstChannel >= 0){\n          vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n          cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n            if(hasNextRow){\n              cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n            }\n        }\n\n        ivec2 depth = ivec2(d, d + 1);\n        for (int j = - ${i}; j <= ${i}; j++) {\n          ivec2 idx = depth + j;\n          bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n          bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${o}));\n\n          bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n          bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n          if(depthInRange || depthPlusOneInRange){\n            vec4 z = vec4(0.);\n            vec4 xFragAtCurrentDepth;\n            z.xz = cache.xy;\n            if(depthPlusOneInRange && hasNextCol){\n              xFragAtCurrentDepth = idx.y != d ?\n                getX(b, r, c, idx.y) : xFragAtOutputCoords;\n              z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n              if(hasNextRow){\n                z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n              }\n            }\n            cache.xy = z.yw;\n            sum += z * z;\n          }\n        }\n        vec4 result = xAtOutputCoords * ${s};\n        setOutput(result);\n      }\n    `}}const _B={kernelName:Tr,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{depthRadius:i,bias:o,alpha:s,beta:l}=n,c=We().getBool("WEBGL_PACK_NORMALIZATION")?new xB(a.shape,i,o,s,l):new bB(a.shape,i,o,s,l);return r.runWebGLProgram(c,[a],a.dtype)}};class wB{constructor(e,t,r,n,a){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=r,this.alpha=n,this.beta=a,this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int r = coords[1];\n        int c = coords[2];\n\n        float result = 0.0;\n        for (int d = 0; d < ${this.depth}; ++d) {\n          int depthBegin = int(max(0.0, float(d - ${t})));\n          int depthEnd = int(min(float(${this.depth}),\n              float(d + ${t} + 1)));\n\n          const int MIN_DEPTH_BEGIN = 0;\n          const int MAX_DEPTH_END = ${this.depth};\n\n          float norm = 0.0;\n          for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n            if (k < depthBegin){\n              continue;\n            }\n            else if (k >= depthBegin && k < depthEnd) {\n              norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n            }\n            else {\n              break;\n            }\n          }\n\n          norm = float(${n}) * norm + float(${r});\n\n          for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n            if (k < depthBegin){\n              continue;\n            }\n            else if (k >= depthBegin && k < depthEnd){\n              float dyi = -2.0 * float(${n})\n                * float(${a})\n                * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n                / norm;\n              if (k == d) {\n                dyi += pow(norm, -1.0 * ${a});\n              }\n              if (k == coords[3]) {\n                dyi *= getDy(b, r, c, d);\n                result += dyi;\n              }\n            }\n            else {\n              break;\n            }\n          }\n      }\n      setOutput(result);\n      }\n    `}}const kB={kernelName:Ar,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:r,attrs:n}=e,{x:a,y:i,dy:o}=t,{depthRadius:s,bias:l,alpha:c,beta:u}=n,f=new wB(a.shape,s,l,c,u);return r.runWebGLProgram(f,[a,i,o],a.dtype)}};function DB(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{reductionIndices:i,keepDims:o}=n,s=a.shape.length,l=ye(i,a.shape);let c=l;const u=Cu(c,s),f=null!=u,p=r.shouldExecuteOnCPU([a]);let h=a;if(f){if(p){const e=r.texData.get(h.dataId).values,t=new Array(s);for(let e=0;e<t.length;e++)t[e]=a.shape[u[e]];const n=iP(e,a.shape,a.dtype,u,t);h=r.makeTensorInfo(t,a.dtype),r.texData.get(h.dataId).values=n}else h=KP(a,u,r);c=Ou(c.length,s)}Eu("max",c,s);const[d,m]=Su(h.shape,c);let g,y=d;if(o&&(y=Mu(d,l)),p){const e=r.texData.get(h.dataId).values,t=LI(e,se(m),y,a.dtype);g=r.makeTensorInfo(y,a.dtype),r.texData.get(g.dataId).values=t}else g=function(e,t,r,n){const a=se(t),i=qP({inputs:{x:e},attrs:{shape:[se(e.shape)/a,a]},backend:n}),o=XP(i,e.dtype,"max",n),s=qP({inputs:{x:o},attrs:{shape:r},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),s}(h,m,y,r);return f&&r.disposeIntermediateTensorInfo(h),g}const TB={kernelName:Sr,backendName:"webgl",kernelFunc:DB},AB=FP({opSnippet:"\n  if (isnan(a)) return a;\n  if (isnan(b)) return b;\n\n  return max(a, b);\n",packedOpSnippet:"\n  vec4 result = vec4(max(a, b));\n  vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n  \n  result.r = isNaN.r > 0. ? NAN : result.r;\n  result.g = isNaN.g > 0. ? NAN : result.g;\n  result.b = isNaN.b > 0. ? NAN : result.b;\n  result.a = isNaN.a > 0. ? NAN : result.a;\n\n  return result;\n",cpuKernelImpl:FI}),SB={kernelName:Mr,backendName:"webgl",kernelFunc:AB},MB={kernelName:Er,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t;FO(a,"maxPool");const{filterSize:i,strides:o,pad:s,dimRoundingMode:l}=n;ne(oc(o,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`));const c=Zl(a.shape,i,o,1,s,l);if(1===c.filterWidth&&1===c.filterHeight&&ce(c.inShape,c.outShape))return AP({inputs:{x:a},backend:r});const u=new RR(c,"max",!1);return r.runWebGLProgram(u,[a],a.dtype)}},EB={kernelName:Nr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{filterSize:i,strides:o,pad:s,dataFormat:l,dimRoundingMode:c}=n,u=Kl(a.shape,i,o,[1,1,1],s,c,l),f=new LR(u,"max",!1);return r.runWebGLProgram(f,[a],a.dtype)}};class CB{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,r=e.strideWidth,n=e.dilationHeight,a=e.effectiveFilterHeight,i=e.effectiveFilterWidth,o=a-1-e.padInfo.top,s=i-1-e.padInfo.left,l=a*i-1;this.userCode=`\n      const ivec2 pads = ivec2(${o}, ${s});\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n\n        ivec2 dyRCCorner = coords.yz - pads;\n        int dyRCorner = dyRCCorner.x;\n        int dyCCorner = dyRCCorner.y;\n\n        // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n        for (int wR = 0; wR < ${a};\n          wR += ${n}) {\n          float dyR = float(dyRCorner + wR) / ${t}.0;\n\n          if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n            continue;\n          }\n          int idyR = int(dyR);\n\n          for (int wC = 0; wC < ${i}; wC++) {\n            float dyC = float(dyCCorner + wC) / ${r}.0;\n\n            if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                fract(dyC) > 0.0) {\n              continue;\n            }\n            int idyC = int(dyC);\n\n            float dyValue = getDy(b, idyR, idyC, d);\n            int maxPosValue = ${l} - int(getMaxPos(b, idyR, idyC, d));\n\n            // Get the current value, check it against the value from the\n            // position matrix.\n            int curPosValue = wR * ${i} + wC;\n            float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n            dotProd += dyValue * mask;\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}class NB{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,r=e.strideHeight,n=e.strideWidth,a=e.dilationDepth,i=e.dilationHeight,o=e.dilationWidth,s=e.effectiveFilterDepth,l=e.effectiveFilterHeight,c=e.effectiveFilterWidth,u=s-1-e.padInfo.front,f=l-1-e.padInfo.top,p=c-1-e.padInfo.left,h=s*l*c-1;this.userCode=`\n      const ivec3 pads = ivec3(${u}, ${f}, ${p});\n\n      void main() {\n        ivec5 coords = getOutputCoords();\n        int batch = coords.x;\n        int ch = coords.u;\n\n        ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n        int dyDCorner = dyCorner.x;\n        int dyRCorner = dyCorner.y;\n        int dyCCorner = dyCorner.z;\n\n        // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n        // dx(xD, xR, xC, ch).\n        // ? = to be determined. : = across all values in that axis.\n        float dotProd = 0.0;\n\n        for (int wD = 0; wD < ${s};\n           wD += ${a}) {\n          float dyD = float(dyDCorner + wD) / ${t}.0;\n\n          if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n            continue;\n          }\n          int idyD = int(dyD);\n\n          for (int wR = 0; wR < ${l};\n              wR += ${i}) {\n            float dyR = float(dyRCorner + wR) / ${r}.0;\n\n            if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n                fract(dyR) > 0.0) {\n              continue;\n            }\n            int idyR = int(dyR);\n\n            for (int wC = 0; wC < ${c};\n                wC += ${o}) {\n              float dyC = float(dyCCorner + wC) / ${n}.0;\n\n              if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n                  fract(dyC) > 0.0) {\n                continue;\n              }\n              int idyC = int(dyC);\n\n              float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n              int maxPosValue = ${h} -\n                  int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n              // Get the current value, check it against the value from the\n              // position matrix.\n              int curPosValue =\n                  wD * ${l} * ${c} +\n                  wR * ${c} + wC;\n              float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n              dotProd += dyValue * mask;\n            }\n          }\n        }\n        setOutput(dotProd);\n      }\n    `}}const OB={kernelName:Or,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,input:i}=t,o=i,{filterSize:s,strides:l,pad:c,dimRoundingMode:u}=n,f=Kl(o.shape,s,l,[1,1,1],c,u),p=new LR(f,"max",!0),h=r.runWebGLProgram(p,[o],o.dtype),d=new NB(f),m=r.runWebGLProgram(d,[a,h],o.dtype);return r.disposeIntermediateTensorInfo(h),m}},IB={kernelName:Cr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{dy:a,input:i,output:o}=t,s=i;FO([i,o],"maxPoolGrad");const{filterSize:l,strides:c,pad:u,dimRoundingMode:f}=n,p=Zl(s.shape,l,c,1,u,f),h=new RR(p,"max",!0),d=r.runWebGLProgram(h,[s],s.dtype),m=new CB(p),g=r.runWebGLProgram(m,[a,d],s.dtype);return r.disposeIntermediateTensorInfo(d),g}},PB={kernelName:Ir,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:r})=>{const{x:n}=e,{filterSize:a,strides:i,pad:o,includeBatchInIndex:s}=t,l=r;ne(4===n.shape.length,(()=>`Error in maxPool: input must be rank 4 but got rank ${n.shape.length}.`));const c=[1,1];ne(oc(i,c),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`));const u=Zl(n.shape,a,i,c,o),[f,p]=function(e,t,r,n){let a=new RR(r,"max",!1);const i=n.runWebGLProgram(a,[e],"float32");return a=new RR(r,"max",!0,!0,t),[i,n.runWebGLProgram(a,[e],"float32")]}(n,s,u,l);return[f,p]}},RB={kernelName:Pr,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:r})=>{const{x:n}=e,{keepDims:a,axis:i}=t,o=r,s=n.shape.length,l=ye(i,n.shape);let c=l;const u=Cu(c,s),f=null!=u,p=o.shouldExecuteOnCPU([n]),h=[];let d=n;if(f){if(p){const e=o.texData.get(d.dataId).values,t=new Array(s);for(let e=0;e<t.length;e++)t[e]=n.shape[u[e]];const r=iP(e,n.shape,n.dtype,u,t);d=o.makeTensorInfo(t,n.dtype),o.texData.get(d.dataId).values=r}else d=KP(n,u,o);h.push(d),c=Ou(c.length,s)}Eu("sum",c,s);const[m,g]=Su(d.shape,c);let y=m;a&&(y=Mu(m,l));const v=function(e,t,r,n){const a=se(t),i=qP({inputs:{x:e},attrs:{shape:[se(e.shape)/a,a]},backend:n}),o=XP(i,"float32","mean",n),s=qP({inputs:{x:o},attrs:{shape:r},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),s}(d,g,y,o);for(const e of h)o.disposeIntermediateTensorInfo(e);return v}},LB={kernelName:Rr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,keepDims:o}=n,s=a.shape.length,l=ye(i,a.shape);let c=l;const u=Cu(c,s);let f=a;null!=u&&(f=eR({inputs:{x:a},backend:r,attrs:{perm:u}}),c=Ou(c.length,a.shape.length)),Eu("min",c,s);const[p,h]=Su(f.shape,c),d=qP({inputs:{x:f},backend:r,attrs:{shape:[-1,se(h)]}}),m=XP(d,d.dtype,"min",r);let g;return g=qP(o?{inputs:{x:m},backend:r,attrs:{shape:Mu(p,l)}}:{inputs:{x:m},backend:r,attrs:{shape:p}}),r.disposeIntermediateTensorInfo(d),r.disposeIntermediateTensorInfo(m),null!=u&&r.disposeIntermediateTensorInfo(f),g}},FB=FP({opSnippet:"\n  if (isnan(a)) return a;\n  if (isnan(b)) return b;\n\n  return min(a, b);\n",packedOpSnippet:"\n  vec4 result = vec4(min(a, b));\n  vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n  \n  result.r = isNaN.r > 0. ? NAN : result.r;\n  result.g = isNaN.g > 0. ? NAN : result.g;\n  result.b = isNaN.b > 0. ? NAN : result.b;\n  result.a = isNaN.a > 0. ? NAN : result.a;\n\n  return result;\n",cpuKernelImpl:BI}),BB={kernelName:Lr,backendName:"webgl",kernelFunc:FB};class zB{constructor(e,t,r){this.variableNames=["x"],this.outputShape=t.map(((t,r)=>t[0]+e[r]+t[1]));const n=e.length,a=eI(n),i=t.map((e=>e[0])).join(","),o=t.map(((t,r)=>t[0]+e[r])).join(","),s=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n),l="reflect"===r?0:1;this.userCode=1!==n?`\n      ${a} start = ${a}(${i});\n      ${a} end = ${a}(${o});\n\n      void main() {\n        ${a} outC = getOutputCoords();\n        for (int i = 0; i < ${n}; i++) {\n          if (outC[i] < start[i]) {\n            outC[i] = start[i] * 2 - outC[i] - ${l};\n          } else if(outC[i] >= end[i]) {\n            outC[i] = (end[i] - 1) * 2 - outC[i] + ${l};\n          }\n        }\n        ${a} coords = outC - start;\n        setOutput(getX(${s}));\n      }\n    `:`\n        int start = ${i};\n        int end = ${o};\n\n        void main() {\n          int outC = getOutputCoords();\n          if (outC < start) {\n            outC = start * 2 - outC - ${l};\n          } else if(outC >= end) {\n            outC = (end - 1) * 2 - outC + ${l};\n          }\n          setOutput(getX(outC - start));\n        }\n      `}}class jB{constructor(e,t,r){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map(((t,r)=>t[0]+e[r]+t[1]));const n=e.length,a=eI(n),i=t.map((e=>e[0])).join(","),o=t.map(((t,r)=>t[0]+e[r])).join(","),s=lP("rc",n),l=lP("source",n),c=`${s[n-1]} < ${this.outputShape[n-1]}`,u=1===n?"source":`vec2(${l.slice(-2).join()})`,f="reflect"===r?0:1;let p="";if(1===n){const e=`\n        ${a} source = rc;\n        if (source < start) {\n          source = start * 2 - source - ${f};\n        } else if (source >= end) {\n          source = (end - 1) * 2 - source + ${f};\n        }\n        source -= start;\n      `;p=`\n        ${a} rc = outputLoc;\n        ${e}\n        result[0] = getChannel(getX(${l.join()}), ${u});\n        ${s[n-1]} += 1;\n        if(${c}) {\n          ${e}\n          result[1] = getChannel(getX(${l.join()}), ${u});\n        }\n      `}else{const e=`\n        ${a} source = rc;\n        ${a} lt = ${a}(lessThan(source, start));\n        ${a} gte = ${a}(greaterThanEqual(source, end));\n        ${a} orig = 1 - (lt + gte);\n        source = orig * source +\n                lt * (start * 2 - source - ${f}) +\n                gte * ((end - 1) * 2 - source + ${f});\n        source -= start;\n      `;p=`\n        ${a} rc = outputLoc;\n        ${e}\n        result[0] = getChannel(getX(${l.join()}), ${u});\n        ${s[n-1]} += 1;\n        if(${c}) {\n          ${e}\n          result[1] = getChannel(getX(${l.join()}), ${u});\n        }\n        rc = outputLoc;\n        ${s[n-2]} += 1;\n        if(${s[n-2]} < ${this.outputShape[n-2]}) {\n          ${e}\n          result[2] = getChannel(getX(${l.join()}), ${u});\n          ${s[n-1]} += 1;\n          if(${c}) {\n            ${e}\n            result[3] = getChannel(getX(${l.join()}), ${u});\n          }\n        }\n      `}this.userCode=`\n      const ${a} start = ${a}(${i});\n      const ${a} end = ${a}(${o});\n\n      void main() {\n        ${a} outputLoc = getOutputCoords();\n        vec4 result = vec4(0.);\n        ${p}\n        setOutput(result);\n      }\n    `}}const UB={kernelName:Fr,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:r})=>{const{x:n}=e,{paddings:a,mode:i}=r,o=We().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new jB(n.shape,a,i):new zB(n.shape,a,i);return t.runWebGLProgram(o,[n],n.dtype)}},$B=FP({opSnippet:"if (b == 0.0) return NAN;\n  return mod(a, b);",packedOpSnippet:"\n  vec4 result = mod(a, b);\n  vec4 isNaN = vec4(equal(b, vec4(0.0)));\n  \n  result.r = isNaN.r > 0. ? NAN : result.r;\n  result.g = isNaN.g > 0. ? NAN : result.g;\n  result.b = isNaN.b > 0. ? NAN : result.b;\n  result.a = isNaN.a > 0. ? NAN : result.a;\n\n  return result;\n"}),VB={kernelName:Br,backendName:"webgl",kernelFunc:$B};class qB{constructor(e,t,r){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,r],this.userCode=`\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int batch = coords[0];\n\n        float r = random(seed);\n        float cdf = 0.0;\n\n        for (int i = 0; i < ${t-1}; i++) {\n          cdf += getProbs(batch, i);\n\n          if (r < cdf) {\n            setOutput(float(i));\n            return;\n          }\n        }\n\n        // If no other event happened, last event happened.\n        setOutput(float(${t-1}));\n      }\n    `}}const WB=FP({opSnippet:"\nif (a == b) {\n  return 1.0;\n};\nreturn a / b;",packedOpSnippet:"\n  // vec4 one = vec4(equal(a, b));\n  // return one + (vec4(1.0) - one) * a / b;\n  vec4 result = a / b;\n  if(a.x == b.x) {\n    result.x = 1.;\n  }\n  if(a.y == b.y) {\n    result.y = 1.;\n  }\n  if(a.z == b.z) {\n    result.z = 1.;\n  }\n  if(a.w == b.w) {\n    result.w = 1.;\n  }\n\n  return result;\n",checkOutOfBounds:!0}),HB={kernelName:qt,backendName:"webgl",kernelFunc:WB},GB="return a - b;",XB=FP({opSnippet:GB,packedOpSnippet:GB,supportsComplex:!0,cpuKernelImpl:rP}),YB={kernelName:zn,backendName:"webgl",kernelFunc:XB};function ZB(e){const{inputs:t,backend:r,attrs:n}=e,{logits:a}=t,{dim:i}=n,o=ye([i],a.shape),s=DB({inputs:{x:a},backend:r,attrs:{reductionIndices:o,keepDims:!1}}),l=Mu(s.shape,o),c=qP({inputs:{x:s},backend:r,attrs:{shape:l}}),u=XB({inputs:{a,b:c},backend:r}),f=gF({inputs:{x:u},backend:r}),p=JP({inputs:{x:f},backend:r,attrs:{axis:o,keepDims:!1}}),h=qP({inputs:{x:p},backend:r,attrs:{shape:l}}),d=WB({inputs:{a:f,b:h},backend:r});return r.disposeIntermediateTensorInfo(s),r.disposeIntermediateTensorInfo(c),r.disposeIntermediateTensorInfo(u),r.disposeIntermediateTensorInfo(f),r.disposeIntermediateTensorInfo(p),r.disposeIntermediateTensorInfo(h),d}const KB={kernelName:Sn,backendName:"webgl",kernelFunc:ZB},JB={kernelName:zr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{logits:a}=t,{numSamples:i,seed:o,normalized:s}=n,l=s?a:ZB({inputs:{logits:a},backend:r,attrs:{dim:a.shape.length-1}}),c=l.shape[0],u=l.shape[1],f=new qB(c,u,i),p=[[o]],h=r.runWebGLProgram(f,[l],"int32",p);return s||r.disposeIntermediateTensorInfo(l),h}},QB={kernelName:Ur,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{x:n}=t;if(r.shouldExecuteOnCPU([n])){const e=r.texData.get(n.dataId),[t,a]=jI(e.values,n.shape,n.dtype);return r.makeTensorInfo(a,n.dtype,t)}let a;return a=We().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new vP(n.shape,"\n  vec4 result = -x;\n  bvec4 isNaN = isnan(x);\n\n  result.r = isNaN.r ? x.r : result.r;\n  result.g = isNaN.g ? x.g : result.g;\n  result.b = isNaN.b ? x.b : result.b;\n  result.a = isNaN.a ? x.a : result.a;\n\n  return result;\n"):new mP(n.shape,"if (isnan(x)) return x;\n  return -x;\n"),r.runWebGLProgram(a,[n],n.dtype)}},ez=Wp,tz={kernelName:Vr,backendName:"webgl",kernelFunc:function(e){ra("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:r,attrs:n}=e,{boxes:a,scores:i}=t,{maxOutputSize:o,iouThreshold:s,scoreThreshold:l}=n,c=r.readSync(a.dataId),u=r.readSync(i.dataId),{selectedIndices:f}=ez(c,u,o,s,l);return r.makeTensorInfo([f.length],"int32",new Int32Array(f))}},rz=Hp,nz={kernelName:qr,backendName:"webgl",kernelFunc:function(e){ra("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:r,attrs:n}=e,{boxes:a,scores:i}=t,{maxOutputSize:o,iouThreshold:s,scoreThreshold:l,padToMaxOutputSize:c}=n,u=r.readSync(a.dataId),f=r.readSync(i.dataId),{selectedIndices:p,validOutputs:h}=rz(u,f,o,s,l,c);return[r.makeTensorInfo([p.length],"int32",new Int32Array(p)),r.makeTensorInfo([],"int32",new Int32Array([h]))]}},az=Gp,iz={kernelName:Wr,backendName:"webgl",kernelFunc:function(e){ra("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:r,attrs:n}=e,{boxes:a,scores:i}=t,{maxOutputSize:o,iouThreshold:s,scoreThreshold:l,softNmsSigma:c}=n,u=r.readSync(a.dataId),f=r.readSync(i.dataId),p=o,h=s,d=l,m=c,{selectedIndices:g,selectedScores:y}=az(u,f,p,h,d,m);return[r.makeTensorInfo([g.length],"int32",new Int32Array(g)),r.makeTensorInfo([y.length],"float32",new Float32Array(y))]}};class oz{constructor(e,t,r,n){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=`\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int index = round(getIndices(coords.x));\n        setOutput(mix(float(${n}), float(${r}),\n                      float(index == coords.y)));\n      }\n    `}}const sz={kernelName:Gr,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:r,attrs:n}=e,{indices:a}=t,{depth:i,onValue:o,offValue:s}=n,l=se(a.shape),c=new oz(l,i,o,s),u=qP({inputs:{x:a},backend:r,attrs:{shape:[l]}}),f=r.runWebGLProgram(c,[u],a.dtype);r.disposeIntermediateTensorInfo(u);const p=qP({inputs:{x:f},backend:r,attrs:{shape:[...a.shape,i]}});return r.disposeIntermediateTensorInfo(f),p}};function lz(e){const{inputs:t,backend:r}=e,{x:n}=t;if("complex64"===n.dtype){const e=nL({inputs:{input:n},backend:r}),t=lz({inputs:{x:e},backend:r}),a=vL({inputs:{input:n},backend:r}),i=lz({inputs:{x:a},backend:r}),o=MP({inputs:{real:t,imag:i},backend:r});return r.disposeIntermediateTensorInfo(e),r.disposeIntermediateTensorInfo(t),r.disposeIntermediateTensorInfo(a),r.disposeIntermediateTensorInfo(i),o}return SF({attrs:{shape:n.shape,dtype:n.dtype,value:"string"===n.dtype?"":0},backend:r})}const cz={kernelName:Yn,backendName:"webgl",kernelFunc:lz},uz={kernelName:Hr,backendName:"webgl",kernelFunc:function e(t){const{inputs:r,backend:n}=t,{x:a}=r;if("string"===a.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===a.dtype){const t=nL({inputs:{input:a},backend:n}),r=e({inputs:{x:t},backend:n}),i=vL({inputs:{input:a},backend:n}),o=lz({inputs:{x:i},backend:n}),s=MP({inputs:{real:r,imag:o},backend:n});return n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),s}return SF({attrs:{shape:a.shape,dtype:a.dtype,value:1},backend:n})}},fz={kernelName:Xr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{axis:a}=n;if(1===t.length)return vF({inputs:{input:t[0]},backend:r,attrs:{dim:a}});const i=t[0].shape,o=t[0].dtype;t.forEach((e=>{ae(i,e.shape,"All tensors passed to stack must have matching shapes"),ne(o===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const s=[],l=_L({inputs:t.map((e=>{const t=vF({inputs:{input:e},backend:r,attrs:{dim:a}});return s.push(t),t})),backend:r,attrs:{axis:a}});return s.forEach((e=>r.disposeIntermediateTensorInfo(e))),l}};class pz{constructor(e,t,r){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map(((t,r)=>t[0]+e[r]+t[1]));const n=e.length,a=eI(n),i=t.map((e=>e[0])).join(","),o=t.map(((t,r)=>t[0]+e[r])).join(","),s=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n);this.userCode=1!==n?`\n      ${a} start = ${a}(${i});\n      ${a} end = ${a}(${o});\n\n      void main() {\n        ${a} outC = getOutputCoords();\n        if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n          setOutput(value);\n        } else {\n          ${a} coords = outC - start;\n          setOutput(getX(${s}));\n        }\n      }\n    `:`\n        int start = ${i};\n        int end = ${o};\n\n        void main() {\n          int outC = getOutputCoords();\n          if (outC < start || outC >= end) {\n            setOutput(value);\n          } else {\n            setOutput(getX(outC - start));\n          }\n        }\n      `}}class hz{constructor(e,t,r){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map(((t,r)=>t[0]+e[r]+t[1]));const n=e.length,a=eI(n),i=t.map((e=>e[0])).join(","),o=t.map(((t,r)=>t[0]+e[r])).join(","),s=lP("rc",n),l=lP("source",n),c=`${s[n-1]} < ${this.outputShape[n-1]}`,u=1===n?"source":`vec2(${l.slice(-2).join()})`,f=[`${a} rc = outputLoc;`,`${s[n-1]} += 1;\n       if(${c}) {\n      `,1===n?"":`}\n       rc = outputLoc;\n       ${s[n-2]} += 1;\n       if(${s[n-2]} < ${this.outputShape[n-2]}) {`,1===n?"":`  ${s[n-1]} += 1;\n         if(${c}) {`],p=1===n?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let h="";for(let e=0,t=1===n?2:4;e<t;e++)h+=`\n        ${f[e]}\n        if (${p}) {\n          result[${e}] = float(value);\n        } else {\n          ${a} source = rc - start;\n          result[${e}] = getChannel(getX(${l.join()}), ${u});\n        }\n      `;h+=1===n?"} ":"}}",this.userCode=`\n      const ${a} start = ${a}(${i});\n      const ${a} end = ${a}(${o});\n\n      void main() {\n        ${a} outputLoc = getOutputCoords();\n        vec4 result = vec4(0.);\n        ${h}\n        setOutput(result);\n      }\n    `}}const dz=e=>{const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{paddings:i,constantValue:o}=n;if(0===se(a.shape)){const e=i.map(((e,t)=>e[0]+a.shape[t]+e[1]));return SF({backend:r,attrs:{shape:e,value:o,dtype:a.dtype}})}const s=We().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new hz(a.shape,i,o):new pz(a.shape,i,o),l=[[o]];return r.runWebGLProgram(s,[a],a.dtype,l)},mz={kernelName:Yr,backendName:"webgl",kernelFunc:dz},gz=FP({opSnippet:"\n  if(a < 0.0 && floor(b) < b){\n    return NAN;\n  }\n  if (b == 0.0) {\n    return 1.0;\n  }\n  return (round(mod(b, 2.0)) != 1) ?\n      pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",packedOpSnippet:"\n  // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n  vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n  vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n  vec4 result = multiplier * pow(abs(a), b);\n\n  // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n  bvec4 isExpZero = equal(b, vec4(0.0));\n  result.r = isExpZero.r ? 1.0 : result.r;\n  result.g = isExpZero.g ? 1.0 : result.g;\n  result.b = isExpZero.b ? 1.0 : result.b;\n  result.a = isExpZero.a ? 1.0 : result.a;\n\n  vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b));\n  \n  result.r = isNaN.r > 0. ? NAN : result.r;\n  result.g = isNaN.g > 0. ? NAN : result.g;\n  result.b = isNaN.b > 0. ? NAN : result.b;\n  result.a = isNaN.a > 0. ? NAN : result.a;\n\n  return result;\n"}),yz={kernelName:Kr,backendName:"webgl",kernelFunc:gz},vz={kernelName:Qr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{axis:i,keepDims:o}=n,s=a.shape.length,l=[],c=ye(i,a.shape);let u=c;const f=Cu(u,s);let p,h=a;if(null!=f&&(h=eR({inputs:{x:a},backend:r,attrs:{perm:f}}),u=Ou(u.length,s),l.push(h)),Eu("prod",u,s),r.shouldExecuteOnCPU([h])){const e=r.texData.get(h.dataId).values,{outVals:t,outShape:n,outDtype:a}=$I(h.shape,h.dtype,e,u);p=r.makeTensorInfo(n,a,t)}else{const[e,t]=Su(h.shape,u),n=se(t),i=qP({inputs:{x:h},backend:r,attrs:{shape:[-1,n]}}),o=XP(i,ni(a.dtype),"prod",r);p=qP({inputs:{x:o},backend:r,attrs:{shape:e}}),l.push(i),l.push(o)}if(o){l.push(p);const e=Mu(p.shape,c);p=qP({inputs:{x:p},backend:r,attrs:{shape:e}})}return l.forEach((e=>r.disposeIntermediateTensorInfo(e))),p}},bz=e=>{const{backend:t,attrs:r}=e,{start:n,stop:a,step:i,dtype:o}=r,s=VI(n,a,i,o);return t.makeTensorInfo([s.length],o,s)},xz={kernelName:en,backendName:"webgl",kernelFunc:bz},_z=LP({opSnippet:"return 1.0 / x;"}),wz={kernelName:rn,backendName:"webgl",kernelFunc:_z},kz=LP({opSnippet:"if (isnan(x)) return x;\n  return (x < 0.0) ? 0.0 : x;\n",packedOpSnippet:"\n  vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n  bvec4 isNaN = isnan(x);\n\n  result.r = isNaN.r ? x.r : result.r;\n  result.g = isNaN.g ? x.g : result.g;\n  result.b = isNaN.b ? x.b : result.b;\n  result.a = isNaN.a ? x.a : result.a;\n\n  return result;\n"}),Dz={kernelName:nn,backendName:"webgl",kernelFunc:kz},Tz=LP({opSnippet:"if (isnan(x)) return x;\n  return (x < 0.0) ? 0.0 : min(6.0, x);\n",packedOpSnippet:"\n  vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n  bvec4 isNaN = isnan(x);\n\n  result.r = isNaN.r ? x.r : result.r;\n  result.g = isNaN.g ? x.g : result.g;\n  result.b = isNaN.b ? x.b : result.b;\n  result.a = isNaN.a ? x.a : result.a;\n\n  return result;\n"}),Az={kernelName:un,backendName:"webgl",kernelFunc:Tz};class Sz{constructor(e,t,r,n,a){this.variableNames=["A"],this.outputShape=[];const[i,o,s,l]=e;this.outputShape=[i,t,r,l];const c=[n&&t>1?o-1:o,n&&r>1?s-1:s],u=[n&&t>1?t-1:t,n&&r>1?r-1:r];let f;f=a?"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n      const vec2 effectiveInputOverOutputRatioRC = vec2(\n          ${c[0]/u[0]},\n          ${c[1]/u[1]});\n      const vec2 inputShapeRC = vec2(${o}.0, ${s}.0);\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        ivec2 yRC = coords.yz;\n\n        // Fractional source index.\n        vec2 sourceFracIndexRC = ${f};\n\n        // Compute the four integer indices.\n        ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\n        ivec2 sourceCeilRC = ivec2(\n          min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n        float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n        float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n        float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n        float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n        vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n        float top = topLeft + (topRight - topLeft) * fracRC.y;\n        float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n        float newValue = top + (bottom - top) * fracRC.x;\n\n        setOutput(newValue);\n      }\n    `}}class Mz{constructor(e,t,r,n,a){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,o,s,l]=e;this.outputShape=[i,t,r,l];const c=[n&&t>1?o-1:o,n&&r>1?s-1:s],u=[n&&t>1?t-1:t,n&&r>1?r-1:r];let f;f=a?"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n      const vec3 effectiveInputOverOutputRatioRC = vec3(\n          ${c[0]/u[0]},\n          ${c[1]/u[1]},\n          ${c[1]/u[1]});\n      const vec3 inputShapeRC = vec3(${o}.0, ${s}.0,\n                                     ${s}.0);\n\n      float getAValue(int b, int r, int c, int d) {\n        return getChannel(getA(b, r, c, d), vec2(c, d));\n      }\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        // Calculate values for next column in yRC.z.\n        ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n        // Fractional source index.\n        vec3 sourceFracIndexRC = ${f};\n\n        // Compute the four integer indices.\n        ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\n        ivec3 sourceCeilRC = ivec3(\n          min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n        // Should we calculate next column and row elements in 2x2 packed cell.\n        bool hasNextCol = d < ${l-1};\n        bool hasNextRow = coords.z < ${r-1};\n\n        // In parallel, construct four corners for all four components in\n        // packed 2x2 cell.\n        vec4 topLeft = vec4(\n          getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n          hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n                     : 0.0,\n          hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n                     : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n        vec4 bottomLeft = vec4(\n          getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n          hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n                     : 0.0,\n          hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n                     : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n        vec4 topRight = vec4(\n          getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n          hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n                     : 0.0,\n          hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n                     : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n        vec4 bottomRight = vec4(\n          getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n          hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n                     : 0.0,\n          hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n                     : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n        vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n        vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n        vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n        vec4 newValue = mix(top, bottom, fracRC.x);\n\n        setOutput(newValue);\n      }\n    `}}const Ez={kernelName:ln,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{images:a}=t,{alignCorners:i,halfPixelCenters:o,size:s}=n,[l,c]=s,u=We().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new Mz(a.shape,l,c,i,o):new Sz(a.shape,l,c,i,o);return r.runWebGLProgram(u,[a],"float32")}};class Cz{constructor(e,t,r){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,n,a]=t,[,i,o]=e,s=[r&&i>1?n-1:n,r&&o>1?a-1:a],l=[r&&i>1?i-1:i,r&&o>1?o-1:o],c=s[0]/l[0],u=s[1]/l[1],f=1/c,p=1/u,h=2*Math.ceil(f)+2,d=2*Math.ceil(p)+2;this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        int r = coords[1];\n        int c = coords[2];\n\n        float accumulator = 0.0;\n\n        const float heightScale = float(${c});\n        const float widthScale = float(${u});\n\n        const float invHeightScale = float(${f});\n        const float invWidthScale = float(${p});\n\n        const int winHeight = int(${h});\n        const int winWidth = int(${d});\n\n        // Compute bounds for where in dy we will look\n        float startRLerp = floor(float(r) * invHeightScale);\n        int startDyR = int(startRLerp - float(winHeight / 2));\n\n        float startCLerp = floor(float(c) * invWidthScale);\n        int startDyC = int(startCLerp - float(winWidth / 2));\n\n        // Loop over dy\n        for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n          int dyR = dyROffset + startDyR;\n\n          // Guard against the window exceeding the bounds of dy\n          if (dyR < 0 || dyR >= ${i}) {\n            continue;\n          }\n\n          for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n            int dyC = dyCOffset + startDyC;\n\n            // Guard against the window exceeding the bounds of dy\n            if (dyC < 0 || dyC >= ${o}) {\n              continue;\n            }\n\n            float dxR = float(dyR) * heightScale;\n            int topDxRIndex = int(floor(dxR));\n            int bottomDxRIndex = int(min(ceil(dxR), ${n-1}.0));\n            float dxRLerp = dxR - float(topDxRIndex);\n            float inverseDxRLerp = 1.0 - dxRLerp;\n\n            float dxC = float(dyC) * widthScale;\n            int leftDxCIndex = int(floor(dxC));\n            int rightDxCIndex = int(min(ceil(dxC), ${a-1}.0));\n            float dxCLerp = dxC - float(leftDxCIndex);\n            float inverseDxCLerp = 1.0 - dxCLerp;\n\n            if (r == topDxRIndex && c == leftDxCIndex) {\n              // topLeft\n              accumulator +=\n                getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n            }\n\n            if (r == topDxRIndex && c == rightDxCIndex) {\n              // topRight\n              accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n            }\n\n            if (r == bottomDxRIndex && c == leftDxCIndex) {\n              // bottomLeft\n              accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n            }\n\n            if (r == bottomDxRIndex && c == rightDxCIndex) {\n              // bottomRight\n              accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n            }\n          }\n        }\n        // End loop over dy\n\n        setOutput(accumulator);\n      }\n    `}}const Nz={kernelName:cn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{images:a,dy:i}=t,{alignCorners:o}=n,s=new Cz(i.shape,a.shape,o);return r.runWebGLProgram(s,[i],i.dtype)}};class Oz{constructor(e,t,r,n,a){this.variableNames=["A"],this.outputShape=[];const[i,o,s,l]=e;this.outputShape=[i,t,r,l];const c=[n&&t>1?o-1:o,n&&r>1?s-1:s],u=[n&&t>1?t-1:t,n&&r>1?r-1:r],f=n?"0.5":"0.0";let p;p=a?"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n      const vec2 effectiveInputOverOutputRatioRC = vec2(\n          ${c[0]/u[0]},\n          ${c[1]/u[1]});\n      const vec2 inputShapeRC = vec2(${o}.0, ${s}.0);\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        ivec2 yRC = coords.yz;\n\n        // Fractional source index.\n        vec2 sourceFracIndexRC = ${p};\n\n        // Compute the coordinators of nearest neighbor point.\n        ivec2 sourceNearestRC = ivec2(\n          min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${f})));\n        float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n        setOutput(newValue);\n      }\n    `}}class Iz{constructor(e,t,r,n,a){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,o,s,l]=e;this.outputShape=[i,t,r,l];const c=[n&&t>1?o-1:o,n&&r>1?s-1:s],u=[n&&t>1?t-1:t,n&&r>1?r-1:r],f=n?"0.5":"0.0";let p;p=a?"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n      const vec3 effectiveInputOverOutputRatioRC = vec3(\n          ${c[0]/u[0]},\n          ${c[1]/u[1]},\n          ${c[1]/u[1]});\n      const vec3 inputShapeRC = vec3(${o}.0, ${s}.0,\n                                     ${s}.0);\n\n      float getAValue(int b, int r, int c, int d) {\n        return getChannel(getA(b, r, c, d), vec2(c, d));\n      }\n\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        // Calculate values for next column in yRC.z.\n        ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n        // Fractional source index.\n        vec3 sourceFracIndexRC = ${p};\n\n        // Compute the coordinators of nearest neighbor point.\n        ivec3 sourceNearestRC = ivec3(\n          min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${f})));\n\n        // Should we calculate next column and row elements in 2x2 packed cell.\n        bool hasNextCol = d < ${l-1};\n        bool hasNextRow = coords.z < ${r-1};\n\n        vec4 newValue = vec4(\n          getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n          hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n                     : 0.0,\n          hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n                     : 0.0,\n          (hasNextRow && hasNextCol) ?\n            getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n        setOutput(newValue);\n      }\n    `}}const Pz={kernelName:on,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{images:a}=t,{alignCorners:i,halfPixelCenters:o,size:s}=n,[l,c]=s,u=We().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new Iz(a.shape,l,c,i,o):new Oz(a.shape,l,c,i,o);return r.runWebGLProgram(u,[a],a.dtype)}};class Rz{constructor(e,t,r){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,n,a]=t,[,i,o]=e,s=[r&&i>1?n-1:n,r&&o>1?a-1:a],l=[r&&i>1?i-1:i,r&&o>1?o-1:o],c=s[0]/l[0],u=s[1]/l[1],f=1/c,p=1/u,h=2*Math.ceil(f)+2,d=2*Math.ceil(p)+2;this.userCode=`\n      void main() {\n        ivec4 coords = getOutputCoords();\n        int b = coords[0];\n        int d = coords[3];\n        int r = coords[1];\n        int c = coords[2];\n\n        float accumulator = 0.0;\n\n        const float heightScale = float(${c});\n        const float widthScale = float(${u});\n\n        const float invHeightScale = float(${f});\n        const float invWidthScale = float(${p});\n\n        const int winHeight = int(${h});\n        const int winWidth = int(${d});\n\n        // Compute bounds for where in dy we will look\n        float startRLerp = floor(float(r) * invHeightScale);\n        int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n        float startCLerp = floor(float(c) * invWidthScale);\n        int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n        // Loop over dy\n        for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n          int dyR = dyROffset + startDyR;\n\n          // Guard against the window exceeding the bounds of dy\n          if (dyR < 0 || dyR >= ${i}) {\n            continue;\n          }\n\n          for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n            int dyC = dyCOffset + startDyC;\n\n            // Guard against the window exceeding the bounds of dy\n            if (dyC < 0 || dyC >= ${o}) {\n              continue;\n            }\n\n            float sourceFracRow =\n              float(${s[0]}) *\n                (float(dyR) / float(${l[0]}));\n\n            float sourceFracCol =\n                float(${s[1]}) *\n                  (float(dyC) / float(${l[1]}));\n\n            int sourceNearestRow = int(min(\n                float(int(${n}) - 1),\n                ${r} ? float(round(sourceFracRow)) :\n                                  float(floor(sourceFracRow))));\n\n            int sourceNearestCol = int(min(\n                float(int(${a}) - 1),\n                ${r} ? float(round(sourceFracCol)) :\n                                  float(floor(sourceFracCol))));\n\n            if (r == sourceNearestRow && c == sourceNearestCol) {\n              accumulator += getDy(b, dyR, dyC, d);\n            }\n          }\n        }\n        // End loop over dy\n\n        setOutput(accumulator);\n      }\n    `}}const Lz={kernelName:sn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{images:a,dy:i}=t,{alignCorners:o}=n,s=new Rz(i.shape,a.shape,o);return r.runWebGLProgram(s,[i],i.dtype)}};class Fz{constructor(e,t){this.variableNames=["x"];const r=e.length;if(r>4)throw new Error(`WebGL backend: Reverse of rank-${r} tensor is not yet supported`);if(this.outputShape=e,1===r)return void(this.userCode=`\n        void main() {\n          int coord = getOutputCoords();\n          setOutput(getX(${e[0]} - coord - 1));\n        }\n      `);const n=e.map(((r,n)=>(r=>-1!==t.indexOf(r)&&1!==e[r]?`${e[r]} - coords[${r}] - 1`:`coords[${r}]`)(n))).join(","),a=eI(r);this.userCode=`\n      void main() {\n        ${a} coords = getOutputCoords();\n        setOutput(getX(${n}));\n      }\n    `}}class Bz{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;const r=e.length;if(r>4)throw new Error(`WebGL backend: Reverse of rank-${r} tensor is not yet supported`);this.outputShape=e;const n=lP("rc",r),a=`${n[r-1]} + 1 < ${this.outputShape[r-1]}`,i=`${n[r-2]} + 1 < ${this.outputShape[r-2]}`,o=eI(r);function s(r){const n=e.map(((n,a)=>function(r,n){return-1!==t.indexOf(r)&&1!==e[r]?`${e[r]} - ${n[r]} - 1`:`${n[r]}`}(a,r)));return`getChannel(getX(${n.join(",")}), vec2(${n.slice(-2).join(",")}))`}this.userCode=1===r?`\n        void main(){\n          int rc = getOutputCoords();\n          vec4 result = vec4(0.);\n          result.r = getChannel(getX(${e[0]} - rc - 1),\n            ${e[0]} - rc - 1);\n          if(${a}){\n              result.g = getChannel(getX(${e[0]} - (rc  + 1) - 1),\n                ${e[0]} - (rc  + 1) - 1);\n          }\n          setOutput(result);\n        }\n      `:`\n        void main() {\n          ${o} rc = getOutputCoords();\n          vec4 result = vec4(0.);\n          result.r = ${function(e){return s(e)}(n.slice())};\n          if(${a}){\n            result.g = ${function(e){return e[r-1]="("+e[r-1]+" + 1)",s(e)}(n.slice())};\n          }\n          if(${i}) {\n            result.b = ${function(e){return e[r-2]="("+e[r-2]+" + 1)",s(e)}(n.slice())};\n            if(${a}) {\n              result.a = ${function(e){return e[r-1]="("+e[r-1]+" + 1)",e[r-2]="("+e[r-2]+" + 1)",s(e)}(n.slice())};\n            }\n          }\n          setOutput(result);\n        }\n    `}}const zz={kernelName:fn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{dims:i}=n,o=a.shape.length,s=ye(i,a.shape);if(0===o)return AP({inputs:{x:a},backend:r});const l=We().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Bz(a.shape,s):new Fz(a.shape,s);return r.runWebGLProgram(l,[a],a.dtype)}};class jz{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const r=e[1],n=e[2];this.outputShape=e;let a="";a="number"==typeof t?`float outputValue = ${t.toFixed(2)};`:`\n        vec3 fill = vec3(${t.join(",")});\n        float outputValue = fill[coords[3]];`,this.userCode=`\n        void main() {\n          ivec4 coords = getOutputCoords();\n          int x = coords[2];\n          int y = coords[1];\n          float coordXFloat = (float(x) - params[0]) * params[3] -\n            (float(y) - params[1]) * params[2];\n          float coordYFloat = (float(x) - params[0]) * params[2] +\n            (float(y) - params[1]) * params[3];\n          int coordX = int(round(coordXFloat + params[0]));\n          int coordY = int(round(coordYFloat + params[1]));\n          ${a}\n          if(coordX >= 0 && coordX < ${n} && coordY >= 0 && coordY < ${r}) {\n            outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n          }\n          setOutput(outputValue);\n        }\n    `}}const Uz={kernelName:Jn,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:r})=>{const{image:n}=e,{radians:a,fillValue:i,center:o}=t,s=r,l=new jz(n.shape,i),[c,u]=zh(o,n.shape[1],n.shape[2]),f=[[c,u,Math.sin(a),Math.cos(a)]];return s.runWebGLProgram(l,[n],n.dtype,f)}},$z=LP({opSnippet:"\n  // OpenGL ES does not support round function.\n  // The algorithm is based on banker's rounding.\n  float base = floor(x);\n  if ((x - base) < 0.5) {\n    return floor(x);\n  } else if ((x - base) > 0.5) {\n    return ceil(x);\n  } else {\n    if (mod(base, 2.0) == 0.0) {\n      return base;\n    } else {\n      return base + 1.0;\n    }\n  }\n"}),Vz={kernelName:pn,backendName:"webgl",kernelFunc:$z},qz=LP({opSnippet:"return inversesqrt(x);",cpuKernelImpl:qI}),Wz={kernelName:hn,backendName:"webgl",kernelFunc:qz};class Hz{constructor(e,t,r,n,a,i,o=!0){this.variableNames=["updates","indices","defaultValue"],this.outputShape=i;const s=eI(a.length),l=eI(i.length);let c="";1===r?c="i":2===r&&(c="i, j");const u=`getIndices(${c})`;let f="";1===n?f="i":2===n&&(f="i, coords[1]");const p=`getUpdates(${f})`,h=t>1?"strides[j]":"strides";this.userCode=`\n        ${s} strides = ${s}(${a});\n\n        void main() {\n          ${l} coords = getOutputCoords();\n          float sum = 0.0;\n          bool found = false;\n          for (int i = 0; i < ${e}; i++) {\n            int flattenedIndex = 0;\n            for (int j = 0; j < ${t}; j++) {\n              int index = round(${u});\n              flattenedIndex += index * ${h};\n            }\n            if (flattenedIndex == coords[0]) {\n              sum += ${p};\n              found = true;\n            }\n          }\n          setOutput(mix(getDefaultValue(), sum, float(found)));\n        }\n      `}}const Gz={kernelName:dn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{indices:a,updates:i}=t,{shape:o}=n,{sliceRank:s,numUpdates:l,sliceSize:c,strides:u,outputSize:f}=ls(0,a,o),p=[f/c,c];if(0===f)return r.makeTensorInfo(o,a.dtype);const h=qP({inputs:{x:a},backend:r,attrs:{shape:[l,s]}}),d=qP({inputs:{x:i},backend:r,attrs:{shape:[l,c]}}),m=r.makeTensorInfo([],"float32",new Float32Array([0])),g=new Hz(l,s,h.shape.length,d.shape.length,u,p),y=r.runWebGLProgram(g,[d,h,m],d.dtype),v=qP({inputs:{x:y},backend:r,attrs:{shape:o}});return r.disposeIntermediateTensorInfo(h),r.disposeIntermediateTensorInfo(d),r.disposeIntermediateTensorInfo(y),r.disposeIntermediateTensorInfo(m),v}};class Xz{constructor(e,t,r){let n,a;if(this.variableNames=["c","a","b"],this.outputShape=t,r>4)throw Error(`Where for rank ${r} is not yet supported`);if(1===r)a="resRC",n="resRC";else{const r=["resRC.x","resRC.y","resRC.z","resRC.w"],i=[],o=[];for(let n=0;n<t.length;n++)o.push(`${r[n]}`),n<e&&i.push(`${r[n]}`);n=i.join(),a=o.join()}const i=eI(r);this.userCode=`\n      void main() {\n        ${i} resRC = getOutputCoords();\n        float cVal = getC(${n});\n        if (cVal >= 1.0) {\n          setOutput(getA(${a}));\n        } else {\n          setOutput(getB(${a}));\n        }\n      }\n    `}}const Yz={kernelName:mn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{condition:n,t:a,e:i}=t,o=new Xz(n.shape.length,a.shape,a.shape.length);return r.runWebGLProgram(o,[n,a,i],ri(a.dtype,i.dtype))}},Zz=LP({opSnippet:`\n  // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n  // see: https://arxiv.org/abs/1706.02515\n  float scaleAlpha = ${Wh};\n  float scale = ${Hh};\n  return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),Kz={kernelName:gn,backendName:"webgl",kernelFunc:Zz},Jz=LP({opSnippet:"if (isnan(x)) return x;\n  return 1.0 / (1.0 + exp(-1.0 * x));\n",packedOpSnippet:"\n  vec4 result = 1.0 / (1.0 + exp(-1.0 * x));\n  bvec4 isNaN = isnan(x);\n\n  result.r = isNaN.r ? x.r : result.r;\n  result.g = isNaN.g ? x.g : result.g;\n  result.b = isNaN.b ? x.b : result.b;\n  result.a = isNaN.a ? x.a : result.a;\n\n  return result;\n",cpuKernelImpl:WI}),Qz={kernelName:_n,backendName:"webgl",kernelFunc:Jz},ej=LP({opSnippet:"\n  if (isnan(x)) { return 0.0; }\n  return sign(x);\n"}),tj={kernelName:xn,backendName:"webgl",kernelFunc:ej},rj=LP({opSnippet:"if (isnan(x)) return x;\n  return sin(x);\n"}),nj={kernelName:vn,backendName:"webgl",kernelFunc:rj},aj=LP({opSnippet:"\n  float e2x = exp(x);\n  return (e2x - 1.0 / e2x) / 2.0;\n"}),ij={kernelName:bn,backendName:"webgl",kernelFunc:aj},oj=LP({opSnippet:"\n  float epsilon = 1.1920928955078125e-7;\n  float threshold = log(epsilon) + 2.0;\n\n  bool too_large = x > -threshold;\n  bool too_small = x < threshold;\n\n  float result;\n  float exp_x = exp(x);\n\n  if (too_large){\n    result = x;\n  }\n  else if (too_small){\n    result = exp_x;\n  }\n  else{\n    result = log(exp_x + 1.0);\n  }\n  return result;\n"}),sj={kernelName:wn,backendName:"webgl",kernelFunc:oj},lj={kernelName:Tn,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{blockShape:i,paddings:o}=n;ne(a.shape.length<=4,(()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"));const s=i.reduce(((e,t)=>e*t)),l=[[0,0]];l.push(...o);for(let e=1+i.length;e<a.shape.length;++e)l.push([0,0]);const c=[],u=dz({inputs:{x:a},backend:r,attrs:{paddings:l,constantValue:0}}),f=jh(u.shape,i,s,!1),p=Uh(f.length,i.length,!1),h=$h(u.shape,i,s,!1),d=qP({inputs:{x:u},backend:r,attrs:{shape:f}}),m=eR({inputs:{x:d},backend:r,attrs:{perm:p}}),g=qP({inputs:{x:m},backend:r,attrs:{shape:h}});return c.push(u),c.push(d),c.push(m),c.forEach((e=>r.disposeIntermediateTensorInfo(e))),g}},cj={kernelName:Mn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{indices:n,values:a,denseShape:i,defaultValue:o}=t;if(1!==i.shape.length)throw new Error(`Dense shape must be a vector, saw:\n         ${i.shape}`);if(2!==n.shape.length)throw new Error(`Indices must be a matrix, saw:\n         ${n.shape}`);if(1!==a.shape.length)throw new Error(`Values must be a vector, saw:\n         ${a.shape}`);if(0!==o.shape.length)throw new Error(`Default value must be a scalar, saw:\n        ${o.shape}`);const s=r.readSync(n.dataId),l=r.readSync(a.dataId),c=r.readSync(i.dataId),u=r.readSync(o.dataId)[0],[f,p,h,d,m]=XI(s,n.shape,n.dtype,l,a.dtype,c,u);return[r.makeTensorInfo(p,n.dtype,f),r.makeTensorInfo([p[0]],a.dtype,h),r.makeTensorInfo([d.length],"bool",new Uint8Array(d.map((e=>Number(e))))),r.makeTensorInfo([m.length],n.dtype,new Int32Array(m))]}},uj={kernelName:En,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{inputIndices:n,inputShape:a,newShape:i}=t;if(2!==n.shape.length)throw new Error(`Input indices should be a matrix but received shape ${n.shape}`);if(1!==a.shape.length)throw new Error(`Input shape should be a vector but received shape ${a.shape}`);if(1!==i.shape.length)throw new Error(`Target shape should be a vector but received shape ${i.shape}`);const o=Array.from(r.readSync(a.dataId)),s=r.readSync(n.dataId),l=Array.from(r.readSync(i.dataId)),[c,u,f]=YI(s,n.shape,n.dtype,o,l);return[r.makeTensorInfo(u,n.dtype,c),r.makeTensorInfo([f.length],i.dtype,new Int32Array(f))]}},fj={kernelName:Cn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{data:n,indices:a,segmentIds:i}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.shape.length)throw new Error(`Indices should be a vector but received shape\n              ${a.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n              ${i.shape}`);const o=r.readSync(n.dataId),s=r.readSync(a.dataId),l=r.readSync(i.dataId),[c,u]=ZI(o,n.shape,n.dtype,s,l,!0);return r.makeTensorInfo(u,n.dtype,c)}},pj={kernelName:Nn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r}=e,{data:n,indices:a,segmentIds:i}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.shape.length)throw new Error(`Indices should be a vector but received shape\n             ${a.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n             ${i.shape}`);const o=r.readSync(n.dataId),s=r.readSync(a.dataId),l=r.readSync(i.dataId),[c,u]=ZI(o,n.shape,n.dtype,s,l);return r.makeTensorInfo(u,n.dtype,c)}},hj={kernelName:On,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{sparseIndices:a,sparseValues:i,defaultValue:o}=t,{outputShape:s}=n,{sliceRank:l,numUpdates:c,strides:u,outputSize:f}=ls(0,a,s),p=new Hz(c,l,a.shape.length,i.shape.length,u,[f,1],!1),h=r.runWebGLProgram(p,[i,a,o],i.dtype),d=qP({inputs:{x:h},backend:r,attrs:{shape:s}});return r.disposeIntermediateTensorInfo(h),d}},dj={kernelName:An,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{numOrSizeSplits:i,axis:o}=n,s=ye(o,a.shape)[0],l=dd(a,i,s),c=a.shape.length,u=new Array(c).fill(0),f=a.shape.slice();return l.map((e=>{const t=[...f];t[s]=e;const n=ZR({inputs:{x:a},backend:r,attrs:{begin:u,size:t}});return u[s]+=e,n}))}},mj="return sqrt(x);",gj=LP({opSnippet:mj,packedOpSnippet:mj,cpuKernelImpl:KI}),yj={kernelName:kn,backendName:"webgl",kernelFunc:gj},vj=LP({opSnippet:"return x * x;"}),bj={kernelName:Pn,backendName:"webgl",kernelFunc:vj},xj="return (a - b) * (a - b);",_j=FP({opSnippet:xj,packedOpSnippet:xj}),wj={kernelName:In,backendName:"webgl",kernelFunc:_j},kj={kernelName:Zn,backendName:"webgl",kernelFunc:function({inputs:e,attrs:t,backend:r}){const{x:n}=e,a=`if (isnan(x)) return x;\n    return x > 0.0 ? 1.0 : float(${t.alpha});\n  `,i=new mP(n.shape,a);return r.runWebGLProgram(i,[n],n.dtype)}};class Dj{constructor(e,t,r){this.variableNames=["x"],this.outputShape=r;const n=r.length,a=eI(r.length),i=eI(r.length);let o="";if(1===n)o="coords * strides + begin";else{let e=0;o=r.map(((t,n)=>(e++,1===r.length?`coords * strides[${n}] + begin[${n}]`:`coords[${e-1}] * strides[${n}] + begin[${n}]`))).join(",")}this.userCode=`\n      ${a} begin = ${a}(${e});\n      ${a} strides = ${a}(${t});\n\n      void main() {\n        ${i} coords = getOutputCoords();\n        setOutput(getX(${o}));\n      }\n    `}}const Tj={kernelName:Rn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{begin:i,end:o,strides:s,beginMask:l,endMask:c,ellipsisMask:u,newAxisMask:f,shrinkAxisMask:p}=n,{finalShapeSparse:h,finalShape:d,isIdentity:m,sliceDim0:g,isSimpleSlice:y,begin:v,end:b,strides:x}=Ds(a.shape,i,o,s,l,c,u,f,p);let _;if(m)_=qP({inputs:{x:a},backend:r,attrs:{shape:d}});else if(g||y){ne(a.shape.length>=1,(()=>`Input must have rank at least 1, got: ${a.shape.length}`));const e=fs(v,b,x),t=ZR({inputs:{x:a},backend:r,attrs:{begin:v,size:e}});_=qP({inputs:{x:t},backend:r,attrs:{shape:d}}),r.disposeIntermediateTensorInfo(t)}else if(r.shouldExecuteOnCPU([a])){const e=r.readSync(a.dataId),t=To(a.shape,a.dtype,e),n=JI(h,t,x,v);_=r.makeTensorInfo(d,a.dtype,n.values)}else{const e=new Dj(v,x,h);_=r.runWebGLProgram(e,[a],a.dtype)}const w=qP({inputs:{x:_},backend:r,attrs:{shape:d}});return r.disposeIntermediateTensorInfo(_),w}},Aj={kernelName:Ln,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{separator:a,nGramWidths:i,leftPad:o,rightPad:s,padWidth:l,preserveShortSequences:c}=n,{data:u,dataSplits:f}=t,p=r.readSync(u.dataId),h=r.readSync(f.dataId),[d,m]=QI(p,h,a,i,o,s,l,c);return[r.makeTensorInfo([d.length],"string",d),r.makeTensorInfo(f.shape,"int32",m)]}},Sj={kernelName:Fn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{skipEmpty:a}=n,{input:i,delimiter:o}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(1!==i.shape.length)throw new Error(`Input must be a vector, got shape: ${i.shape}`);if(0!==o.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${o.shape}`);const s=r.readSync(i.dataId),l=r.readSync(o.dataId)[0],[c,u,f]=eP(s,l,a),p=u.length;return[r.makeTensorInfo([p,2],"int32",c),r.makeTensorInfo([p],"string",u),r.makeTensorInfo([2],"int32",new Int32Array(f))]}},Mj={kernelName:Bn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{numBuckets:a}=n,{input:i}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(a<=0)throw new Error("Number of buckets must be at least 1");const o=r.readSync(i.dataId),s=tP(o,a);return r.makeTensorInfo(i.shape,"int32",s)}},Ej=LP({opSnippet:"return tan(x);"}),Cj={kernelName:jn,backendName:"webgl",kernelFunc:Ej},Nj=LP({opSnippet:"\n  float e2x = exp(-2.0 * abs(x));\n  return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),Oj={kernelName:Un,backendName:"webgl",kernelFunc:Nj};class Ij{constructor(e,t){this.variableNames=["A"];const r=new Array(e.length);for(let n=0;n<r.length;n++)r[n]=e[n]*t[n];this.outputShape=r,this.rank=r.length;const n=eI(this.rank),a=function(e){const t=e.length;if(t>5)throw Error(`Tile for rank ${t} is not yet supported`);if(1===t)return`imod(resRC, ${e[0]})`;const r=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],n=[];for(let t=0;t<e.length;t++)n.push(`imod(${r[t]}, ${e[t]})`);return n.join()}(e);this.userCode=`\n      void main() {\n        ${n} resRC = getOutputCoords();\n        setOutput(getA(${a}));\n      }\n    `}}function Pj(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{reps:i}=n;if("string"===a.dtype||a.shape.length>5){const e=r.readSync(a.dataId),t="string"===a.dtype?e.map((e=>Pa(e))):e,n=To(a.shape,a.dtype,t),o=nP(n,i);return r.makeTensorInfo(o.shape,o.dtype,o.values)}const o=new Ij(a.shape,i);return r.runWebGLProgram(o,[a],a.dtype)}const Rj={kernelName:$n,backendName:"webgl",kernelFunc:Pj};class Lj{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode="\n       void main() {\n         ivec2 coords = getOutputCoords();\n         int batch = coords[0];\n         int elemIdx = coords[1];\n\n         // We compare elements pair-wise within a group of size 2 * inc.\n         // The comparing rule for each group alternates between ascending\n         // and descending. Within each group, we compare each pair at\n         // positions i and i+inc. To decide whether an element at position i\n         // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n         // inc, it is in the first half of the group, we denote it as x0,\n         // otherwise we denote it as x1.\n         // For example, as shown in the Bitonic top K paper referenced above,\n         // Figure5(a) shows that element[1] is in the\n         // second half of the group when group size is 2, but it is in the\n         // first half of the group when group size is 4.\n\n         bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n         int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n         int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n         int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n         float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n         float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n         // Denotes which direction indices are in (ascending or descending).\n         bool reverse = imod(elemIdx, 2 * dir) >= dir;\n         bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n         if (reverse == isGreater) { // Elements in opposite order of direction\n           int iTemp = i0;\n           i0 = i1;\n           i1 = iTemp;\n         }\n         if (isFirstInPair) {\n            setOutput(float(i0));\n         } else {\n            setOutput(float(i1));\n         }\n       }\n     "}}class Fj{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode="\n    void main() {\n         // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n         ivec2 coords = getOutputCoords();\n         int batch = coords[0];\n         int elemIdx = coords[1];\n\n         // The output size is half of the previous size.\n         // If the previous sequence is | | | | _ _ _ _  | | | |  _ _ _ _ (k=4),\n         // we only need to output the indices at positions |, the indices at\n         // positions _ can be thrown away, see Figure5(b) After Phase 2\n         // (Merge phase) in the Bitonic Top K paper referenced above.\n         // For example, the paper shows we only need to output the orange bars.\n         // The output sequence should look like this | | | | | | | |.\n         // Because the sequence is halved, to map the output index back\n         // to the previous sequence to find the corresponding value,\n         // we need to double the index. When we double the index,\n         // we basically interpolate a position, so 2i looks like\n         // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n         // of each 2k positions by - elemIdx % k. E.g. for output at\n         // index 4,5,6,7, we want to get the corresponding element at\n         // original index 8,9,10,11, for output at index 8,9,10,11,\n         // we want to get the corresponding element at original index\n         // 16,17,18,19, so on and so forth.\n\n         int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n         int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n         int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n         float x0 = getX(batch, i0);\n         float x1 = i1 < n ? getX(batch, i1) : x0;\n\n         setOutput(x0 >= x1 ? float(i0) : float(i1));\n       }\n     "}}function Bj(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function zj(e){let t=1;for(;t<e;)t*=2;return t}const jj={kernelName:Vn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{k:i,sorted:o}=n,s=We().getNumber("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD"),l=We().getNumber("TOPK_K_CPU_HANDOFF_THRESHOLD"),c=a.shape,u=c[c.length-1];if(r.shouldExecuteOnCPU([a])||u<s||i>l){const e=r.readSync(a.dataId),[t,n]=aP(e,c,a.dtype,i,o);return[r.makeTensorInfo(t.shape,t.dtype,t.values),r.makeTensorInfo(n.shape,n.dtype,n.values)]}if(0===i)return c[c.length-1]=0,[r.makeTensorInfo(c,a.dtype,[]),r.makeTensorInfo(c,"int32",[])];if(1===u)return[a,SF({attrs:{shape:c,dtype:"int32",value:0},backend:r})];const f=r.texData.get(a.dataId),p=null!==f&&f.isPacked,h=p?r.unpackTensor(a):a,d=se(c)/u,m=qP({inputs:{x:h},attrs:{shape:[d,u]},backend:r});p&&Bj(r,h);const g=zj(i),y=zj(u);let v=null;const b=()=>null===v?[m,m]:[m,v],x=(e,t,n)=>{const a=b(),i=new Lj(n),o=[[u],[null===v?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],s=v;v=r.runWebGLProgram(i,a,"int32",o),Bj(r,s)};for(let e=1;e<g;e*=2){const t=2*e;for(let r=e;r>=1;r/=2)x(t,r,[d,y])}for(let e=y;e>g;e/=2){const t=b(),n=new Fj([d,e/2]),a=[[u],[null===v?1:0],[g]],i=v;v=r.runWebGLProgram(n,t,"int32",a),Bj(r,i);const o=g/2,s=2*o;for(let e=o;e>=1;e/=2)x(s,e,v.shape)}let _=v;v=ZR({inputs:{x:v},backend:r,attrs:{begin:0,size:[d,i]}}),Bj(r,_);let w=WF({inputs:{x:m,indices:v},backend:r,attrs:{axis:1,batchDims:1}});Bj(r,m);const k=c.slice(0,-1);k.push(i),_=v,v=qP({inputs:{x:v},attrs:{shape:k},backend:r}),Bj(r,_);const D=w;return w=qP({inputs:{x:w},attrs:{shape:k},backend:r}),Bj(r,D),[w,v]}};class Uj{constructor(e,t,r,n,a,i){this.variableNames=["Image","Transforms"],this.outputShape=i;const o="nearest"===r?1:2;let s;switch(n){case"constant":default:s=1;break;case"reflect":s=2;break;case"wrap":s=3;break;case"nearest":s=4}this.userCode=`\n            float mapCoord(float outCoord, float len) {\n              float inCoord = outCoord;\n              if(${s} == 2) {\n                if (inCoord < 0.0) {\n                  if (len <= 1.0) {\n                    inCoord = 0.0;\n                  } else {\n                    float sz2 = 2.0 * len;\n                    if (inCoord < sz2) {\n                      inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n                      inCoord;\n                    }\n                    inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n                  }\n                } else if (inCoord > len - 1.0) {\n                  if (len <= 1.0) {\n                    inCoord = 0.0;\n                  } else {\n                    float sz2 = 2.0 * len;\n                    inCoord -= sz2 * float(int(float(inCoord / sz2)));\n                    if (inCoord >= len) {\n                      inCoord = sz2 - inCoord - 1.0;\n                    }\n                  }\n                }\n                return clamp(inCoord, 0.0, len - 1.0);\n              } else if (${s} == 3) {\n                if (inCoord < 0.0) {\n                  if (len <= 1.0) {\n                    inCoord = 0.0;\n                  } else {\n                    float sz = len - 1.0;\n                    inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n                  }\n                } else if (inCoord > len - 1.0) {\n                  if (len <= 1.0) {\n                    inCoord = 0.0;\n                  } else {\n                    float sz = len - 1.0;\n                    inCoord -= len * float(int(float(inCoord / sz)));\n                  }\n                }\n                return clamp(inCoord, 0.0, len - 1.0);\n              } else if (${s} == 4) {\n                return clamp(outCoord, 0.0, len - 1.0);\n              } else {\n                return outCoord;\n              }\n            }\n\n            float readWithFillValue(int batch, int coordY, int coordX,\n              int channel) {\n              float outputValue;\n              if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) {\n                  outputValue = getImage(batch, coordY, coordX, channel);\n              } else {\n                outputValue = float(${a});\n              }\n              return outputValue;\n            }\n\n            void main() {\n              ivec4 coords = getOutputCoords();\n              float outputValue;\n              int batch = coords[0];\n              int x = coords[2];\n              int y = coords[1];\n              int channel = coords[3];\n              float xf = float(x);\n              float yf = float(y);\n              float a1 = getTransforms(batch, 0);\n              float a2 = getTransforms(batch, 1);\n              float a3 = getTransforms(batch, 2);\n              float b1 = getTransforms(batch, 3);\n              float b2 = getTransforms(batch, 4);\n              float b3 = getTransforms(batch, 5);\n              float c1 = getTransforms(batch, 6);\n              float c2 = getTransforms(batch, 7);\n              float projection = c1 * xf + c2 * yf + 1.0;\n              if (projection == 0.0) {\n                outputValue = float(${a});\n              } else {\n                float inX = (a1 * xf + a2 * yf + a3) / projection;\n                float inY = (b1 * xf + b2 * yf + b3) / projection;\n                float mapX = mapCoord(inX, float(${t}));\n                float mapY = mapCoord(inY, float(${e}));\n\n                if (${o} == 1) {\n                  int coordY = int(round(mapY));\n                  int coordX = int(round(mapX));\n                  outputValue = readWithFillValue(batch, coordY, coordX,\n                    channel);\n                } else {\n                  float yFloor = floor(mapY);\n                  float xFloor = floor(mapX);\n                  float yCeil = yFloor + 1.0;\n                  float xCeil = xFloor + 1.0;\n                  float valueYFloor = (xCeil - mapX) *\n                  readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n                  (mapX - xFloor) *\n                  readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n                  float valueYCeil = (xCeil - mapX) *\n                  readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n                  (mapX - xFloor) *\n                  readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n                  outputValue = (yCeil - mapY) * valueYFloor +\n                  (mapY - yFloor) * valueYCeil;\n                }\n              }\n              setOutput(outputValue);\n            }\n        `}}const $j={kernelName:qn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{image:a,transforms:i}=t,{interpolation:o,fillMode:s,fillValue:l,outputShape:c}=n,[u,f,p,h]=a.shape,[d,m]=null!=c?c:[f,p],g=new Uj(f,p,o,s,l,[u,d,m,h]);return r.runWebGLProgram(g,[a,i],"float32")}},Vj={kernelName:Hn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,attrs:r,backend:n}=e,{axis:a}=r,{x:i}=t;FO(i,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");const o=n.readSync(i.dataId),{outputValues:s,outputShape:l,indices:c}=oP(o,a,i.shape,i.dtype);return[n.makeTensorInfo(l,i.dtype,s),n.makeTensorInfo([c.length],"int32",c)]}},qj={kernelName:Gn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{value:a}=t;let{axis:i}=n;i<0&&(i+=a.shape.length);const o=a,s=o.shape.length,l=a.shape[i],c=new Array(s-1);let u=0;for(let e=0;e<s;e++)e!==i&&(c[u++]=o.shape[e]);const f=[],p=new Array(s).fill(0),h=o.shape.slice();h[i]=1;const d=new Array(l);for(let e=0;e<d.length;e++){p[i]=e;const t=ZR({inputs:{x:o},backend:r,attrs:{begin:p,size:h}}),n=qP({inputs:{x:t},backend:r,attrs:{shape:c}});d[e]=n,f.push(t)}return f.forEach((e=>r.disposeIntermediateTensorInfo(e))),d}};class Wj{constructor(e,t){this.variableNames=["x","segmentIds"];const r=e.windowSize,n=e.batchSize,a=e.inSize,i=e.numSegments,o=i*Math.ceil(a/r);this.outputShape=[n,o];const s=4*Math.floor(r/4),l=r%4,c="\n        sumValue += dot(values, segFilter);\n    ";let u="";a%r>0&&(u=`\n        if (inIdx < 0 || inIdx >= ${a}) {\n          return initializationValue;\n        }\n      `);let f="";a%r>0&&(f=`\n        if (inIdx < 0 || inIdx >= ${a}) {\n          return -1.0;\n        }\n      `),this.userCode=`\n      const float initializationValue = 0.0;\n\n      float getValue(int batch, int inIdx) {\n        ${u}\n        return getX(batch, inIdx);\n      }\n\n      float getSegmentIdAtIndex(int inIdx) {\n        ${f}\n        return getSegmentIds(inIdx);\n      }\n\n      void main() {\n        ivec2 coords = getOutputCoords();\n        int batch = coords[0];\n        int outIdx = coords[1];\n        int inOffset = int(floor(float(outIdx) / float(\n          ${i})) * float(${r}));\n        int currentSeg = int(mod(float(outIdx), float(${i})));\n\n        float sumValue = 0.0;\n\n        for (int i = 0; i < ${s}; i += 4) {\n          int inIdx = inOffset + i;\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2),\n            getValue(batch, inIdx + 3)\n          );\n\n          vec4 segFilter = vec4(\n            int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n          );\n\n          ${c}\n        }\n\n        int inIdx = inOffset + ${s};\n        if (${1===l}) {\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            initializationValue,\n            initializationValue,\n            initializationValue\n          );\n\n          int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n          vec4 segFilter = vec4(\n            int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n            0,\n            0,\n            0\n          );\n\n          ${c}\n        } else if (${2===l}) {\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            initializationValue,\n            initializationValue\n          );\n\n          vec4 segFilter = vec4(\n            int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n              0,\n              0\n          );\n\n          ${c}\n        } else if (${3===l}) {\n          vec4 values = vec4(\n            getValue(batch, inIdx),\n            getValue(batch, inIdx + 1),\n            getValue(batch, inIdx + 2),\n            initializationValue\n          );\n\n          vec4 segFilter = vec4(\n            int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n            int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n            0\n          );\n\n          ${c}\n        }\n        setOutput(sumValue);\n      }\n    `}}const Hj={kernelName:Xn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:r,attrs:n}=e,{x:a,segmentIds:i}=t,{numSegments:o}=n,s=a.shape.length,l=[];let c=0;const u=Cu([c],s);let f=a;null!=u&&(f=eR({inputs:{x:a},backend:r,attrs:{perm:u}}),l.push(f),c=Ou(1,s)[0]);const p=Md(f.shape,c,o),h=se([f.shape[c]]),d=qP({inputs:{x:f},backend:r,attrs:{shape:[-1,h]}});l.push(d);const m=ni(a.dtype),g=(e,t,n,a,i)=>{const o=e.shape[0],s=e.shape[1],c=Sd(s,i),u=new Wj({windowSize:c,inSize:s,batchSize:o,numSegments:i},t),f=r.compileAndRun(u,[e,n],a);if(l.push(f),f.shape[1]===i)return f;const p=bz({backend:r,attrs:{start:0,stop:i,step:1,dtype:"float32"}}),h=Pj({inputs:{x:p},backend:r,attrs:{reps:[s/c]}});return l.push(p),l.push(h),g(f,t,h,a,i)},y=qP({inputs:{x:g(d,"unsortedSegmentSum",i,m,o)},backend:r,attrs:{shape:p}});let v=y;if(null!=u){l.push(y);const e=Nu(u);v=eR({inputs:{x:v},backend:r,attrs:{perm:e}})}return l.forEach((e=>r.disposeIntermediateTensorInfo(e))),v}},Gj=[nR,iR,sR,cR,pR,mR,gR,yR,kR,DR,AR,MR,CR,OR,PR,FR,BR,UR,$R,VR,HR,JR,QR,eL,iL,lL,fL,EP,dL,wL,ML,IL,PL,RL,LL,FL,zL,UL,VL,GL,XL,ZL,QL,rF,nF,iF,sF,lF,uF,fF,hF,mF,yF,bF,wF,TF,MF,CF,IF,RF,BF,jF,UF,VF,HF,XF,ZF,SP,KF,bL,QF,tB,nB,OP,iB,sB,lB,uB,pB,dB,gB,vB,_B,kB,TB,SB,MB,EB,OB,IB,PB,RB,LB,BB,UB,VB,JB,VP,QB,tz,nz,iz,rL,sz,uz,fz,mz,yz,RP,vz,xz,aL,HB,wz,Dz,Az,WP,Ez,Nz,Pz,Lz,zz,Uz,Vz,Wz,Gz,Yz,Kz,Qz,tj,nj,ij,KR,KB,sj,lj,cj,uj,fj,pj,hj,dj,yj,bj,wj,kj,Tj,Aj,Sj,Mj,YB,QP,Cj,Oj,Rj,jj,$j,tR,Vj,qj,Hj,cz];for(const e of Gj)ca(e);const Xj={"tfjs-core":js,"tfjs-backend-cpu":"3.13.0","tfjs-backend-webgl":"3.13.0","tfjs-data":KT,"tfjs-layers":ib,"tfjs-converter":VD,tfjs:"3.13.0"}},76673:e=>{"use strict";e.exports=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}},72436:(e,t,r)=>{"use strict";e=r.nmd(e);const n=(e,t)=>(...r)=>`[${e(...r)+t}m`,a=(e,t)=>(...r)=>{const n=e(...r);return`[${38+t};5;${n}m`},i=(e,t)=>(...r)=>{const n=e(...r);return`[${38+t};2;${n[0]};${n[1]};${n[2]}m`},o=e=>e,s=(e,t,r)=>[e,t,r],l=(e,t,r)=>{Object.defineProperty(e,t,{get:()=>{const n=r();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})};let c;const u=(e,t,n,a)=>{void 0===c&&(c=r(19470));const i=a?10:0,o={};for(const[r,a]of Object.entries(c)){const s="ansi16"===r?"ansi":r;r===t?o[s]=e(n,i):"object"==typeof a&&(o[s]=e(a[t],i))}return o};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(const[r,n]of Object.entries(t)){for(const[r,a]of Object.entries(n))t[r]={open:`[${a[0]}m`,close:`[${a[1]}m`},n[r]=t[r],e.set(a[0],a[1]);Object.defineProperty(t,r,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="",t.bgColor.close="",l(t.color,"ansi",(()=>u(n,"ansi16",o,!1))),l(t.color,"ansi256",(()=>u(a,"ansi256",o,!1))),l(t.color,"ansi16m",(()=>u(i,"rgb",s,!1))),l(t.bgColor,"ansi",(()=>u(n,"ansi16",o,!0))),l(t.bgColor,"ansi256",(()=>u(a,"ansi256",o,!0))),l(t.bgColor,"ansi16m",(()=>u(i,"rgb",s,!0))),t}})},42389:e=>{"use strict";const t="[\ud800-\udbff][\udc00-\udfff]";e.exports=e=>e&&e.exact?new RegExp(`^${t}$`):new RegExp(t,"g")},6751:(e,t,r)=>{const n=r(69806),a={};for(const e of Object.keys(n))a[n[e]]=e;const i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=i;for(const e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:r}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:r})}i.rgb.hsl=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=i-a;let s,l;i===a?s=0:t===i?s=(r-n)/o:r===i?s=2+(n-t)/o:n===i&&(s=4+(t-r)/o),s=Math.min(60*s,360),s<0&&(s+=360);const c=(a+i)/2;return l=i===a?0:c<=.5?o/(i+a):o/(2-i-a),[s,100*l,100*c]},i.rgb.hsv=function(e){let t,r,n,a,i;const o=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(o,s,l),u=c-Math.min(o,s,l),f=function(e){return(c-e)/6/u+.5};return 0===u?(a=0,i=0):(i=u/c,t=f(o),r=f(s),n=f(l),o===c?a=n-r:s===c?a=1/3+t-n:l===c&&(a=2/3+r-t),a<0?a+=1:a>1&&(a-=1)),[360*a,100*i,100*c]},i.rgb.hwb=function(e){const t=e[0],r=e[1];let n=e[2];const a=i.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[a,100*o,100*n]},i.rgb.cmyk=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.min(1-t,1-r,1-n);return[100*((1-t-a)/(1-a)||0),100*((1-r-a)/(1-a)||0),100*((1-n-a)/(1-a)||0),100*a]},i.rgb.keyword=function(e){const t=a[e];if(t)return t;let r,i=1/0;for(const t of Object.keys(n)){const a=(s=n[t],((o=e)[0]-s[0])**2+(o[1]-s[1])**2+(o[2]-s[2])**2);a<i&&(i=a,r=t)}var o,s;return r},i.keyword.rgb=function(e){return n[e]},i.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;return t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,[100*(.4124*t+.3576*r+.1805*n),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},i.rgb.lab=function(e){const t=i.rgb.xyz(e);let r=t[0],n=t[1],a=t[2];return r/=95.047,n/=100,a/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,[116*n-16,500*(r-n),200*(n-a)]},i.hsl.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;let a,i,o;if(0===r)return o=255*n,[o,o,o];a=n<.5?n*(1+r):n+r-n*r;const s=2*n-a,l=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,o=6*i<1?s+6*(a-s)*i:2*i<1?a:3*i<2?s+(a-s)*(2/3-i)*6:s,l[e]=255*o;return l},i.hsl.hsv=function(e){const t=e[0];let r=e[1]/100,n=e[2]/100,a=r;const i=Math.max(n,.01);return n*=2,r*=n<=1?n:2-n,a*=i<=1?i:2-i,[t,100*(0===n?2*a/(i+a):2*r/(n+r)),(n+r)/2*100]},i.hsv.rgb=function(e){const t=e[0]/60,r=e[1]/100;let n=e[2]/100;const a=Math.floor(t)%6,i=t-Math.floor(t),o=255*n*(1-r),s=255*n*(1-r*i),l=255*n*(1-r*(1-i));switch(n*=255,a){case 0:return[n,l,o];case 1:return[s,n,o];case 2:return[o,n,l];case 3:return[o,s,n];case 4:return[l,o,n];case 5:return[n,o,s]}},i.hsv.hsl=function(e){const t=e[0],r=e[1]/100,n=e[2]/100,a=Math.max(n,.01);let i,o;o=(2-r)*n;const s=(2-r)*a;return i=r*a,i/=s<=1?s:2-s,i=i||0,o/=2,[t,100*i,100*o]},i.hwb.rgb=function(e){const t=e[0]/360;let r=e[1]/100,n=e[2]/100;const a=r+n;let i;a>1&&(r/=a,n/=a);const o=Math.floor(6*t),s=1-n;i=6*t-o,0!=(1&o)&&(i=1-i);const l=r+i*(s-r);let c,u,f;switch(o){default:case 6:case 0:c=s,u=l,f=r;break;case 1:c=l,u=s,f=r;break;case 2:c=r,u=s,f=l;break;case 3:c=r,u=l,f=s;break;case 4:c=l,u=r,f=s;break;case 5:c=s,u=r,f=l}return[255*c,255*u,255*f]},i.cmyk.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,a=e[3]/100;return[255*(1-Math.min(1,t*(1-a)+a)),255*(1-Math.min(1,r*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a))]},i.xyz.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100;let a,i,o;return a=3.2406*t+-1.5372*r+-.4986*n,i=-.9689*t+1.8758*r+.0415*n,o=.0557*t+-.204*r+1.057*n,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,a=Math.min(Math.max(0,a),1),i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),[255*a,255*i,255*o]},i.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];return t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,[116*r-16,500*(t-r),200*(r-n)]},i.lab.xyz=function(e){let t,r,n;r=(e[0]+16)/116,t=e[1]/500+r,n=r-e[2]/200;const a=r**3,i=t**3,o=n**3;return r=a>.008856?a:(r-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,t*=95.047,r*=100,n*=108.883,[t,r,n]},i.lab.lch=function(e){const t=e[0],r=e[1],n=e[2];let a;return a=360*Math.atan2(n,r)/2/Math.PI,a<0&&(a+=360),[t,Math.sqrt(r*r+n*n),a]},i.lch.lab=function(e){const t=e[0],r=e[1],n=e[2]/360*2*Math.PI;return[t,r*Math.cos(n),r*Math.sin(n)]},i.rgb.ansi16=function(e,t=null){const[r,n,a]=e;let o=null===t?i.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let s=30+(Math.round(a/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return 2===o&&(s+=60),s},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){const t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},i.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},i.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},i.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=r.split("").map((e=>e+e)).join(""));const n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},i.rgb.hcg=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.max(Math.max(t,r),n),i=Math.min(Math.min(t,r),n),o=a-i;let s,l;return s=o<1?i/(1-o):0,l=o<=0?0:a===t?(r-n)/o%6:a===r?2+(n-t)/o:4+(t-r)/o,l/=6,l%=1,[360*l,100*o,100*s]},i.hsl.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r);let a=0;return n<1&&(a=(r-.5*n)/(1-n)),[e[0],100*n,100*a]},i.hsv.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=t*r;let a=0;return n<1&&(a=(r-n)/(1-n)),[e[0],100*n,100*a]},i.hcg.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];const a=[0,0,0],i=t%1*6,o=i%1,s=1-o;let l=0;switch(Math.floor(i)){case 0:a[0]=1,a[1]=o,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=o;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=o,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return l=(1-r)*n,[255*(r*a[0]+l),255*(r*a[1]+l),255*(r*a[2]+l)]},i.hcg.hsv=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);let n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},i.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},i.hcg.hwb=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},i.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,n=r-t;let a=0;return n<1&&(a=(r-n)/(1-n)),[e[0],100*n,100*a]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},19470:(e,t,r)=>{const n=r(6751),a=r(56901),i={};Object.keys(n).forEach((e=>{i[e]={},Object.defineProperty(i[e],"channels",{value:n[e].channels}),Object.defineProperty(i[e],"labels",{value:n[e].labels});const t=a(e);Object.keys(t).forEach((r=>{const n=t[r];i[e][r]=function(e){const t=function(...t){const r=t[0];if(null==r)return r;r.length>1&&(t=r);const n=e(t);if("object"==typeof n)for(let e=n.length,t=0;t<e;t++)n[t]=Math.round(n[t]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}(n),i[e][r].raw=function(e){const t=function(...t){const r=t[0];return null==r?r:(r.length>1&&(t=r),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))})),e.exports=i},56901:(e,t,r)=>{const n=r(6751);function a(e,t){return function(r){return t(e(r))}}function i(e,t){const r=[t[e].parent,e];let i=n[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),i=a(n[t[o].parent][o],i),o=t[o].parent;return i.conversion=r,i}e.exports=function(e){const t=function(e){const t=function(){const e={},t=Object.keys(n);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;){const e=r.pop(),a=Object.keys(n[e]);for(let n=a.length,i=0;i<n;i++){const n=a[i],o=t[n];-1===o.distance&&(o.distance=t[e].distance+1,o.parent=e,r.unshift(n))}}return t}(e),r={},a=Object.keys(t);for(let e=a.length,n=0;n<e;n++){const e=a[n];null!==t[e].parent&&(r[e]=i(e,t))}return r}},69806:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},90914:function(e,t){var r;!function(n){"use strict";var a=function(e){return.5*(Math.exp(e)+Math.exp(-e))},i=function(e){return.5*(Math.exp(e)-Math.exp(-e))},o=function(){throw SyntaxError("Invalid Param")};function s(e,t){var r=Math.abs(e),n=Math.abs(t);return 0===e?Math.log(n):0===t?Math.log(r):r<3e3&&n<3e3?.5*Math.log(e*e+t*t):Math.log(e/Math.cos(Math.atan2(t,e)))}function l(e,t){if(!(this instanceof l))return new l(e,t);var r=function(e,t){var r={re:0,im:0};if(null==e)r.re=r.im=0;else if(void 0!==t)r.re=e,r.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)r.re=e.re,r.im=e.im;else if("abs"in e&&"arg"in e){if(!Number.isFinite(e.abs)&&Number.isFinite(e.arg))return l.INFINITY;r.re=e.abs*Math.cos(e.arg),r.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!Number.isFinite(e.r)&&Number.isFinite(e.phi))return l.INFINITY;r.re=e.r*Math.cos(e.phi),r.im=e.r*Math.sin(e.phi)}else 2===e.length?(r.re=e[0],r.im=e[1]):o();break;case"string":r.im=r.re=0;var n=e.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),a=1,i=0;null===n&&o();for(var s=0;s<n.length;s++){var c=n[s];" "===c||"\t"===c||"\n"===c||("+"===c?a++:"-"===c?i++:"i"===c||"I"===c?(a+i===0&&o()," "===n[s+1]||isNaN(n[s+1])?r.im+=parseFloat((i%2?"-":"")+"1"):(r.im+=parseFloat((i%2?"-":"")+n[s+1]),s++),a=i=0):((a+i===0||isNaN(c))&&o(),"i"===n[s+1]||"I"===n[s+1]?(r.im+=parseFloat((i%2?"-":"")+c),s++):r.re+=parseFloat((i%2?"-":"")+c),a=i=0))}a+i>0&&o();break;case"number":r.im=0,r.re=e;break;default:o()}return isNaN(r.re)||isNaN(r.im),r}(e,t);this.re=r.re,this.im=r.im}l.prototype={re:0,im:0,sign:function(){var e=this.abs();return new l(this.re/e,this.im/e)},add:function(e,t){var r=new l(e,t);return this.isInfinite()&&r.isInfinite()?l.NAN:this.isInfinite()||r.isInfinite()?l.INFINITY:new l(this.re+r.re,this.im+r.im)},sub:function(e,t){var r=new l(e,t);return this.isInfinite()&&r.isInfinite()?l.NAN:this.isInfinite()||r.isInfinite()?l.INFINITY:new l(this.re-r.re,this.im-r.im)},mul:function(e,t){var r=new l(e,t);return this.isInfinite()&&r.isZero()||this.isZero()&&r.isInfinite()?l.NAN:this.isInfinite()||r.isInfinite()?l.INFINITY:0===r.im&&0===this.im?new l(this.re*r.re,0):new l(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(e,t){var r=new l(e,t);if(this.isZero()&&r.isZero()||this.isInfinite()&&r.isInfinite())return l.NAN;if(this.isInfinite()||r.isZero())return l.INFINITY;if(this.isZero()||r.isInfinite())return l.ZERO;e=this.re,t=this.im;var n,a,i=r.re,o=r.im;return 0===o?new l(e/i,t/i):Math.abs(i)<Math.abs(o)?new l((e*(a=i/o)+t)/(n=i*a+o),(t*a-e)/n):new l((e+t*(a=o/i))/(n=o*a+i),(t-e*a)/n)},pow:function(e,t){var r=new l(e,t);if(e=this.re,t=this.im,r.isZero())return l.ONE;if(0===r.im){if(0===t&&e>0)return new l(Math.pow(e,r.re),0);if(0===e)switch((r.re%4+4)%4){case 0:return new l(Math.pow(t,r.re),0);case 1:return new l(0,Math.pow(t,r.re));case 2:return new l(-Math.pow(t,r.re),0);case 3:return new l(0,-Math.pow(t,r.re))}}if(0===e&&0===t&&r.re>0&&r.im>=0)return l.ZERO;var n=Math.atan2(t,e),a=s(e,t);return e=Math.exp(r.re*a-r.im*n),t=r.im*a+r.re*n,new l(e*Math.cos(t),e*Math.sin(t))},sqrt:function(){var e,t,r=this.re,n=this.im,a=this.abs();if(r>=0){if(0===n)return new l(Math.sqrt(r),0);e=.5*Math.sqrt(2*(a+r))}else e=Math.abs(n)/Math.sqrt(2*(a-r));return t=r<=0?.5*Math.sqrt(2*(a-r)):Math.abs(n)/Math.sqrt(2*(a+r)),new l(e,n<0?-t:t)},exp:function(){var e=Math.exp(this.re);return this.im,new l(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new l(Math.expm1(e)*Math.cos(t)+function(e){var t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;var r=e*e;return r*(r*(r*(r*(r*(r*(r*(r/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return new l(s(e,t),Math.atan2(t,e))},abs:function(){return e=this.re,t=this.im,r=Math.abs(e),n=Math.abs(t),r<3e3&&n<3e3?Math.sqrt(r*r+n*n):(r<n?(r=n,n=e/t):n=t/e,r*Math.sqrt(1+n*n));var e,t,r,n},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var e=this.re,t=this.im;return new l(Math.sin(e)*a(t),Math.cos(e)*i(t))},cos:function(){var e=this.re,t=this.im;return new l(Math.cos(e)*a(t),-Math.sin(e)*i(t))},tan:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)+a(t);return new l(Math.sin(e)/r,i(t)/r)},cot:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)-a(t);return new l(-Math.sin(e)/r,i(t)/r)},sec:function(){var e=this.re,t=this.im,r=.5*a(2*t)+.5*Math.cos(2*e);return new l(Math.cos(e)*a(t)/r,Math.sin(e)*i(t)/r)},csc:function(){var e=this.re,t=this.im,r=.5*a(2*t)-.5*Math.cos(2*e);return new l(Math.sin(e)*a(t)/r,-Math.cos(e)*i(t)/r)},asin:function(){var e=this.re,t=this.im,r=new l(t*t-e*e+1,-2*e*t).sqrt(),n=new l(r.re-t,r.im+e).log();return new l(n.im,-n.re)},acos:function(){var e=this.re,t=this.im,r=new l(t*t-e*e+1,-2*e*t).sqrt(),n=new l(r.re-t,r.im+e).log();return new l(Math.PI/2-n.im,n.re)},atan:function(){var e=this.re,t=this.im;if(0===e){if(1===t)return new l(0,1/0);if(-1===t)return new l(0,-1/0)}var r=e*e+(1-t)*(1-t),n=new l((1-t*t-e*e)/r,-2*e/r).log();return new l(-.5*n.im,.5*n.re)},acot:function(){var e=this.re,t=this.im;if(0===t)return new l(Math.atan2(1,e),0);var r=e*e+t*t;return 0!==r?new l(e/r,-t/r).atan():new l(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new l(0,1/0);var r=e*e+t*t;return 0!==r?new l(e/r,-t/r).acos():new l(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new l(Math.PI/2,1/0);var r=e*e+t*t;return 0!==r?new l(e/r,-t/r).asin():new l(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){var e=this.re,t=this.im;return new l(i(e)*Math.cos(t),a(e)*Math.sin(t))},cosh:function(){var e=this.re,t=this.im;return new l(a(e)*Math.cos(t),i(e)*Math.sin(t))},tanh:function(){var e=2*this.re,t=2*this.im,r=a(e)+Math.cos(t);return new l(i(e)/r,Math.sin(t)/r)},coth:function(){var e=2*this.re,t=2*this.im,r=a(e)-Math.cos(t);return new l(i(e)/r,-Math.sin(t)/r)},csch:function(){var e=this.re,t=this.im,r=Math.cos(2*t)-a(2*e);return new l(-2*i(e)*Math.cos(t)/r,2*a(e)*Math.sin(t)/r)},sech:function(){var e=this.re,t=this.im,r=Math.cos(2*t)+a(2*e);return new l(2*a(e)*Math.cos(t)/r,-2*i(e)*Math.sin(t)/r)},asinh:function(){var e=this.im;this.im=-this.re,this.re=e;var t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){var e=this.acos();if(e.im<=0){var t=e.re;e.re=-e.im,e.im=t}else t=e.im,e.im=-e.re,e.re=t;return e},atanh:function(){var e=this.re,t=this.im,r=e>1&&0===t,n=1-e,a=1+e,i=n*n+t*t,o=0!==i?new l((a*n-t*t)/i,(t*n+a*t)/i):new l(-1!==e?e/0:0,0!==t?t/0:0),c=o.re;return o.re=s(o.re,o.im)/2,o.im=Math.atan2(o.im,c)/2,r&&(o.im=-o.im),o},acoth:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new l(0,Math.PI/2);var r=e*e+t*t;return 0!==r?new l(e/r,-t/r).atanh():new l(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){var e=this.re,t=this.im;if(0===t)return new l(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var r=e*e+t*t;return 0!==r?new l(e/r,-t/r).asinh():new l(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return l.INFINITY;var r=e*e+t*t;return 0!==r?new l(e/r,-t/r).acosh():new l(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return l.INFINITY;if(this.isInfinite())return l.ZERO;var e=this.re,t=this.im,r=e*e+t*t;return new l(e/r,-t/r)},conjugate:function(){return new l(this.re,-this.im)},neg:function(){return new l(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new l(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new l(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new l(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){var r=new l(e,t);return Math.abs(r.re-this.re)<=l.EPSILON&&Math.abs(r.im-this.im)<=l.EPSILON},clone:function(){return new l(this.re,this.im)},toString:function(){var e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<l.EPSILON&&(e=0),Math.abs(t)<l.EPSILON&&(t=0),0===t?r+e:(0!==e?(r+=e,r+=" ",t<0?(t=-t,r+="-"):r+="+",r+=" "):t<0&&(t=-t,r+="-"),1!==t&&(r+=t),r+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},l.ZERO=new l(0,0),l.ONE=new l(1,0),l.I=new l(0,1),l.PI=new l(Math.PI,0),l.E=new l(Math.E,0),l.INFINITY=new l(1/0,1/0),l.NAN=new l(NaN,NaN),l.EPSILON=1e-15,void 0===(r=function(){return l}.apply(t,[]))||(e.exports=r)}()},46962:function(e,t,r){var n;!function(a){"use strict";var i,o,s,l=9e15,c=1e9,u="0123456789abcdef",f="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",p="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",h={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-l,maxE:l,crypto:!1},d=!0,m="[DecimalError] ",g=m+"Invalid argument: ",y=m+"Precision limit exceeded",v=m+"crypto unavailable",b="[object Decimal]",x=Math.floor,_=Math.pow,w=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,k=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,D=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,T=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,A=1e7,S=f.length-1,M=p.length-1,E={toStringTag:b};function C(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)(r=7-(n=e[t]+"").length)&&(i+=U(r)),i+=n;(r=7-(n=(o=e[t])+"").length)&&(i+=U(r))}else if(0===o)return"0";for(;o%10==0;)o/=10;return i+o}function N(e,t,r){if(e!==~~e||e<t||e>r)throw Error(g+e)}function O(e,t,r,n){var a,i,o,s;for(i=e[0];i>=10;i/=10)--t;return--t<0?(t+=7,a=0):(a=Math.ceil((t+1)/7),t%=7),i=_(10,7-t),s=e[a]%i|0,null==n?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),o=r<4&&99999==s||r>3&&49999==s||5e4==s||0==s):o=(r<4&&s+1==i||r>3&&s+1==i/2)&&(e[a+1]/i/100|0)==_(10,t-2)-1||(s==i/2||0==s)&&0==(e[a+1]/i/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),o=(n||r<4)&&9999==s||!n&&r>3&&4999==s):o=((n||r<4)&&s+1==i||!n&&r>3&&s+1==i/2)&&(e[a+1]/i/1e3|0)==_(10,t-3)-1,o}function I(e,t,r){for(var n,a,i=[0],o=0,s=e.length;o<s;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=u.indexOf(e.charAt(o++)),n=0;n<i.length;n++)i[n]>r-1&&(void 0===i[n+1]&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}E.absoluteValue=E.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),R(e)},E.ceil=function(){return R(new this.constructor(this),this.e+1,2)},E.clampedTo=E.clamp=function(e,t){var r=this,n=r.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(g+t);return r.cmp(e)<0?e:r.cmp(t)>0?t:new n(r)},E.comparedTo=E.cmp=function(e){var t,r,n,a,i=this,o=i.d,s=(e=new i.constructor(e)).d,l=i.s,c=e.s;if(!o||!s)return l&&c?l!==c?l:o===s?0:!o^l<0?1:-1:NaN;if(!o[0]||!s[0])return o[0]?l:s[0]?-c:0;if(l!==c)return l;if(i.e!==e.e)return i.e>e.e^l<0?1:-1;for(t=0,r=(n=o.length)<(a=s.length)?n:a;t<r;++t)if(o[t]!==s[t])return o[t]>s[t]^l<0?1:-1;return n===a?0:n>a^l<0?1:-1},E.cosine=E.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n,a;if(t.isZero())return t;(n=t.d.length)<32?a=(1/K(4,r=Math.ceil(n/3))).toString():(r=16,a="2.3283064365386962890625e-10"),e.precision+=r,t=Z(e,1,t.times(a),new e(1));for(var i=r;i--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}(n,J(n,r)),n.precision=e,n.rounding=t,R(2==s||3==s?r.neg():r,e,t,!0)):new n(1):new n(NaN)},E.cubeRoot=E.cbrt=function(){var e,t,r,n,a,i,o,s,l,c,u=this,f=u.constructor;if(!u.isFinite()||u.isZero())return new f(u);for(d=!1,(i=u.s*_(u.s*u,1/3))&&Math.abs(i)!=1/0?n=new f(i.toString()):(r=C(u.d),(i=((e=u.e)-r.length+1)%3)&&(r+=1==i||-2==i?"0":"00"),i=_(r,1/3),e=x((e+1)/3)-(e%3==(e<0?-1:2)),(n=new f(r=i==1/0?"5e"+e:(r=i.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=u.s),o=(e=f.precision)+3;;)if(c=(l=(s=n).times(s).times(s)).plus(u),n=P(c.plus(u).times(s),c.plus(l),o+2,1),C(s.d).slice(0,o)===(r=C(n.d)).slice(0,o)){if("9999"!=(r=r.slice(o-3,o+1))&&(a||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(R(n,e+1,1),t=!n.times(n).times(n).eq(u));break}if(!a&&(R(s,e+1,0),s.times(s).times(s).eq(u))){n=s;break}o+=4,a=1}return d=!0,R(n,e,f.rounding,t)},E.decimalPlaces=E.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=7*((e=t.length-1)-x(this.e/7)),e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},E.dividedBy=E.div=function(e){return P(this,new this.constructor(e))},E.dividedToIntegerBy=E.divToInt=function(e){var t=this.constructor;return R(P(this,new t(e),0,1,1),t.precision,t.rounding)},E.equals=E.eq=function(e){return 0===this.cmp(e)},E.floor=function(){return R(new this.constructor(this),this.e+1,3)},E.greaterThan=E.gt=function(e){return this.cmp(e)>0},E.greaterThanOrEqualTo=E.gte=function(e){var t=this.cmp(e);return 1==t||0===t},E.hyperbolicCosine=E.cosh=function(){var e,t,r,n,a,i=this,o=i.constructor,s=new o(1);if(!i.isFinite())return new o(i.s?1/0:NaN);if(i.isZero())return s;r=o.precision,n=o.rounding,o.precision=r+Math.max(i.e,i.sd())+4,o.rounding=1,(a=i.d.length)<32?t=(1/K(4,e=Math.ceil(a/3))).toString():(e=16,t="2.3283064365386962890625e-10"),i=Z(o,1,i.times(t),new o(1),!0);for(var l,c=e,u=new o(8);c--;)l=i.times(i),i=s.minus(l.times(u.minus(l.times(u))));return R(i,o.precision=r,o.rounding=n,!0)},E.hyperbolicSine=E.sinh=function(){var e,t,r,n,a=this,i=a.constructor;if(!a.isFinite()||a.isZero())return new i(a);if(t=i.precision,r=i.rounding,i.precision=t+Math.max(a.e,a.sd())+4,i.rounding=1,(n=a.d.length)<3)a=Z(i,2,a,a,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,a=Z(i,2,a=a.times(1/K(5,e)),a,!0);for(var o,s=new i(5),l=new i(16),c=new i(20);e--;)o=a.times(a),a=a.times(s.plus(o.times(l.times(o).plus(c))))}return i.precision=t,i.rounding=r,R(a,t,r,!0)},E.hyperbolicTangent=E.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,P(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},E.inverseCosine=E.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),a=r.precision,i=r.rounding;return-1!==n?0===n?t.isNeg()?z(r,a,i):new r(0):new r(NaN):t.isZero()?z(r,a+4,i).times(.5):(r.precision=a+6,r.rounding=1,t=t.asin(),e=z(r,a+4,i).times(.5),r.precision=a,r.rounding=i,e.minus(t))},E.inverseHyperbolicCosine=E.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,d=!1,r=r.times(r).minus(1).sqrt().plus(r),d=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},E.inverseHyperbolicSine=E.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,d=!1,r=r.times(r).plus(1).sqrt().plus(r),d=!0,n.precision=e,n.rounding=t,r.ln())},E.inverseHyperbolicTangent=E.atanh=function(){var e,t,r,n,a=this,i=a.constructor;return a.isFinite()?a.e>=0?new i(a.abs().eq(1)?a.s/0:a.isZero()?a:NaN):(e=i.precision,t=i.rounding,n=a.sd(),Math.max(n,e)<2*-a.e-1?R(new i(a),e,t,!0):(i.precision=r=n-a.e,a=P(a.plus(1),new i(1).minus(a),r+e,1),i.precision=e+4,i.rounding=1,a=a.ln(),i.precision=e,i.rounding=t,a.times(.5))):new i(NaN)},E.inverseSine=E.asin=function(){var e,t,r,n,a=this,i=a.constructor;return a.isZero()?new i(a):(t=a.abs().cmp(1),r=i.precision,n=i.rounding,-1!==t?0===t?((e=z(i,r+4,n).times(.5)).s=a.s,e):new i(NaN):(i.precision=r+6,i.rounding=1,a=a.div(new i(1).minus(a.times(a)).sqrt().plus(1)).atan(),i.precision=r,i.rounding=n,a.times(2)))},E.inverseTangent=E.atan=function(){var e,t,r,n,a,i,o,s,l,c=this,u=c.constructor,f=u.precision,p=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&f+4<=M)return(o=z(u,f+4,p).times(.25)).s=c.s,o}else{if(!c.s)return new u(NaN);if(f+4<=M)return(o=z(u,f+4,p).times(.5)).s=c.s,o}for(u.precision=s=f+10,u.rounding=1,e=r=Math.min(28,s/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(d=!1,t=Math.ceil(s/7),n=1,l=c.times(c),o=new u(c),a=c;-1!==e;)if(a=a.times(l),i=o.minus(a.div(n+=2)),a=a.times(l),void 0!==(o=i.plus(a.div(n+=2))).d[t])for(e=t;o.d[e]===i.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),d=!0,R(o,u.precision=f,u.rounding=p,!0)},E.isFinite=function(){return!!this.d},E.isInteger=E.isInt=function(){return!!this.d&&x(this.e/7)>this.d.length-2},E.isNaN=function(){return!this.s},E.isNegative=E.isNeg=function(){return this.s<0},E.isPositive=E.isPos=function(){return this.s>0},E.isZero=function(){return!!this.d&&0===this.d[0]},E.lessThan=E.lt=function(e){return this.cmp(e)<0},E.lessThanOrEqualTo=E.lte=function(e){return this.cmp(e)<1},E.logarithm=E.log=function(e){var t,r,n,a,i,o,s,l,c=this,u=c.constructor,f=u.precision,p=u.rounding;if(null==e)e=new u(10),t=!0;else{if(r=(e=new u(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new u(r&&!r[0]?-1/0:1!=c.s?NaN:r?0:1/0);if(t)if(r.length>1)i=!0;else{for(a=r[0];a%10==0;)a/=10;i=1!==a}if(d=!1,o=H(c,s=f+5),n=t?B(u,s+10):H(e,s),O((l=P(o,n,s,1)).d,a=f,p))do{if(o=H(c,s+=10),n=t?B(u,s+10):H(e,s),l=P(o,n,s,1),!i){+C(l.d).slice(a+1,a+15)+1==1e14&&(l=R(l,f+1,0));break}}while(O(l.d,a+=10,p));return d=!0,R(l,f,p)},E.minus=E.sub=function(e){var t,r,n,a,i,o,s,l,c,u,f,p,h=this,m=h.constructor;if(e=new m(e),!h.d||!e.d)return h.s&&e.s?h.d?e.s=-e.s:e=new m(e.d||h.s!==e.s?h:NaN):e=new m(NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(c=h.d,p=e.d,s=m.precision,l=m.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new m(3===l?-0:0);e=new m(h)}return d?R(e,s,l):e}if(r=x(e.e/7),u=x(h.e/7),c=c.slice(),i=u-r){for((f=i<0)?(t=c,i=-i,o=p.length):(t=p,r=u,o=c.length),i>(n=Math.max(Math.ceil(s/7),o)+2)&&(i=n,t.length=1),t.reverse(),n=i;n--;)t.push(0);t.reverse()}else{for((f=(n=c.length)<(o=p.length))&&(o=n),n=0;n<o;n++)if(c[n]!=p[n]){f=c[n]<p[n];break}i=0}for(f&&(t=c,c=p,p=t,e.s=-e.s),o=c.length,n=p.length-o;n>0;--n)c[o++]=0;for(n=p.length;n>i;){if(c[--n]<p[n]){for(a=n;a&&0===c[--a];)c[a]=A-1;--c[a],c[n]+=A}c[n]-=p[n]}for(;0===c[--o];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(e.d=c,e.e=F(c,r),d?R(e,s,l):e):new m(3===l?-0:0)},E.modulo=E.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?R(new n(r),n.precision,n.rounding):(d=!1,9==n.modulo?(t=P(r,e.abs(),0,3,1)).s*=e.s:t=P(r,e,0,n.modulo,1),t=t.times(e),d=!0,r.minus(t))},E.naturalExponential=E.exp=function(){return W(this)},E.naturalLogarithm=E.ln=function(){return H(this)},E.negated=E.neg=function(){var e=new this.constructor(this);return e.s=-e.s,R(e)},E.plus=E.add=function(e){var t,r,n,a,i,o,s,l,c,u,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return f.s&&e.s?f.d||(e=new p(e.d||f.s===e.s?f:NaN)):e=new p(NaN),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(c=f.d,u=e.d,s=p.precision,l=p.rounding,!c[0]||!u[0])return u[0]||(e=new p(f)),d?R(e,s,l):e;if(i=x(f.e/7),n=x(e.e/7),c=c.slice(),a=i-n){for(a<0?(r=c,a=-a,o=u.length):(r=u,n=i,o=c.length),a>(o=(i=Math.ceil(s/7))>o?i+1:o+1)&&(a=o,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for((o=c.length)-(a=u.length)<0&&(a=o,r=u,u=c,c=r),t=0;a;)t=(c[--a]=c[a]+u[a]+t)/A|0,c[a]%=A;for(t&&(c.unshift(t),++n),o=c.length;0==c[--o];)c.pop();return e.d=c,e.e=F(c,n),d?R(e,s,l):e},E.precision=E.sd=function(e){var t,r=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(g+e);return r.d?(t=j(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},E.round=function(){var e=this,t=e.constructor;return R(new t(e),e.e+1,t.rounding)},E.sine=E.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Z(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=Z(e,2,t=t.times(1/K(5,r)),t);for(var a,i=new e(5),o=new e(16),s=new e(20);r--;)a=t.times(t),t=t.times(i.plus(a.times(o.times(a).minus(s))));return t}(n,J(n,r)),n.precision=e,n.rounding=t,R(s>2?r.neg():r,e,t,!0)):new n(NaN)},E.squareRoot=E.sqrt=function(){var e,t,r,n,a,i,o=this,s=o.d,l=o.e,c=o.s,u=o.constructor;if(1!==c||!s||!s[0])return new u(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);for(d=!1,0==(c=Math.sqrt(+o))||c==1/0?(((t=C(s)).length+l)%2==0&&(t+="0"),c=Math.sqrt(t),l=x((l+1)/2)-(l<0||l%2),n=new u(t=c==1/0?"5e"+l:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+l)):n=new u(c.toString()),r=(l=u.precision)+3;;)if(n=(i=n).plus(P(o,i,r+2,1)).times(.5),C(i.d).slice(0,r)===(t=C(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(a||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(R(n,l+1,1),e=!n.times(n).eq(o));break}if(!a&&(R(i,l+1,0),i.times(i).eq(o))){n=i;break}r+=4,a=1}return d=!0,R(n,l,u.rounding,e)},E.tangent=E.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=P(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,R(2==s||4==s?r.neg():r,e,t,!0)):new n(NaN)},E.times=E.mul=function(e){var t,r,n,a,i,o,s,l,c,u=this,f=u.constructor,p=u.d,h=(e=new f(e)).d;if(e.s*=u.s,!(p&&p[0]&&h&&h[0]))return new f(!e.s||p&&!p[0]&&!h||h&&!h[0]&&!p?NaN:p&&h?0*e.s:e.s/0);for(r=x(u.e/7)+x(e.e/7),(l=p.length)<(c=h.length)&&(i=p,p=h,h=i,o=l,l=c,c=o),i=[],n=o=l+c;n--;)i.push(0);for(n=c;--n>=0;){for(t=0,a=l+n;a>n;)s=i[a]+h[n]*p[a-n-1]+t,i[a--]=s%A|0,t=s/A|0;i[a]=(i[a]+t)%A|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=F(i,r),d?R(e,f.precision,f.rounding):e},E.toBinary=function(e,t){return Q(this,2,e,t)},E.toDecimalPlaces=E.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(N(e,0,c),void 0===t?t=n.rounding:N(t,0,8),R(r,e+r.e+1,t))},E.toExponential=function(e,t){var r,n=this,a=n.constructor;return void 0===e?r=L(n,!0):(N(e,0,c),void 0===t?t=a.rounding:N(t,0,8),r=L(n=R(new a(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},E.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return void 0===e?r=L(a):(N(e,0,c),void 0===t?t=i.rounding:N(t,0,8),r=L(n=R(new i(a),e+a.e+1,t),!1,e+n.e+1)),a.isNeg()&&!a.isZero()?"-"+r:r},E.toFraction=function(e){var t,r,n,a,i,o,s,l,c,u,f,p,h=this,m=h.d,y=h.constructor;if(!m)return new y(h);if(c=r=new y(1),n=l=new y(0),o=(i=(t=new y(n)).e=j(m)-h.e-1)%7,t.d[0]=_(10,o<0?7+o:o),null==e)e=i>0?t:c;else{if(!(s=new y(e)).isInt()||s.lt(c))throw Error(g+s);e=s.gt(t)?i>0?t:c:s}for(d=!1,s=new y(C(m)),u=y.precision,y.precision=i=7*m.length*2;f=P(s,t,0,1,1),1!=(a=r.plus(f.times(n))).cmp(e);)r=n,n=a,a=c,c=l.plus(f.times(a)),l=a,a=t,t=s.minus(f.times(a)),s=a;return a=P(e.minus(r),n,0,1,1),l=l.plus(a.times(c)),r=r.plus(a.times(n)),l.s=c.s=h.s,p=P(c,n,i,1).minus(h).abs().cmp(P(l,r,i,1).minus(h).abs())<1?[c,n]:[l,r],y.precision=u,d=!0,p},E.toHexadecimal=E.toHex=function(e,t){return Q(this,16,e,t)},E.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:N(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(d=!1,r=P(r,e,0,t,1).times(e),d=!0,R(r)):(e.s=r.s,r=e),r},E.toNumber=function(){return+this},E.toOctal=function(e,t){return Q(this,8,e,t)},E.toPower=E.pow=function(e){var t,r,n,a,i,o,s=this,l=s.constructor,c=+(e=new l(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new l(_(+s,c));if((s=new l(s)).eq(1))return s;if(n=l.precision,i=l.rounding,e.eq(1))return R(s,n,i);if((t=x(e.e/7))>=e.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return a=$(l,s,r,n),e.s<0?new l(1).div(a):R(a,n,i);if((o=s.s)<0){if(t<e.d.length-1)return new l(NaN);if(0==(1&e.d[t])&&(o=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=o,s}return(t=0!=(r=_(+s,c))&&isFinite(r)?new l(r+"").e:x(c*(Math.log("0."+C(s.d))/Math.LN10+s.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?o/0:0):(d=!1,l.rounding=s.s=1,r=Math.min(12,(t+"").length),(a=W(e.times(H(s,n+r)),n)).d&&O((a=R(a,n+5,1)).d,n,i)&&(t=n+10,+C((a=R(W(e.times(H(s,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(a=R(a,n+1,0))),a.s=o,d=!0,l.rounding=i,R(a,n,i))},E.toPrecision=function(e,t){var r,n=this,a=n.constructor;return void 0===e?r=L(n,n.e<=a.toExpNeg||n.e>=a.toExpPos):(N(e,1,c),void 0===t?t=a.rounding:N(t,0,8),r=L(n=R(new a(n),e,t),e<=n.e||n.e<=a.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},E.toSignificantDigits=E.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(N(e,1,c),void 0===t?t=r.rounding:N(t,0,8)),R(new r(this),e,t)},E.toString=function(){var e=this,t=e.constructor,r=L(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},E.truncated=E.trunc=function(){return R(new this.constructor(this),this.e+1,1)},E.valueOf=E.toJSON=function(){var e=this,t=e.constructor,r=L(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};var P=function(){function e(e,t,r){var n,a=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+a,e[i]=n%r|0,a=n/r|0;return a&&e.unshift(a),e}function t(e,t,r,n){var a,i;if(r!=n)i=r>n?1:-1;else for(a=i=0;a<r;a++)if(e[a]!=t[a]){i=e[a]>t[a]?1:-1;break}return i}function r(e,t,r,n){for(var a=0;r--;)e[r]-=a,a=e[r]<t[r]?1:0,e[r]=a*n+e[r]-t[r];for(;!e[0]&&e.length>1;)e.shift()}return function(n,a,i,s,l,c){var u,f,p,h,d,m,g,y,v,b,_,w,k,D,T,S,M,E,C,N,O=n.constructor,I=n.s==a.s?1:-1,P=n.d,L=a.d;if(!(P&&P[0]&&L&&L[0]))return new O(n.s&&a.s&&(P?!L||P[0]!=L[0]:L)?P&&0==P[0]||!L?0*I:I/0:NaN);for(c?(d=1,f=n.e-a.e):(c=A,d=7,f=x(n.e/d)-x(a.e/d)),C=L.length,M=P.length,b=(v=new O(I)).d=[],p=0;L[p]==(P[p]||0);p++);if(L[p]>(P[p]||0)&&f--,null==i?(D=i=O.precision,s=O.rounding):D=l?i+(n.e-a.e)+1:i,D<0)b.push(1),m=!0;else{if(D=D/d+2|0,p=0,1==C){for(h=0,L=L[0],D++;(p<M||h)&&D--;p++)T=h*c+(P[p]||0),b[p]=T/L|0,h=T%L|0;m=h||p<M}else{for((h=c/(L[0]+1)|0)>1&&(L=e(L,h,c),P=e(P,h,c),C=L.length,M=P.length),S=C,w=(_=P.slice(0,C)).length;w<C;)_[w++]=0;(N=L.slice()).unshift(0),E=L[0],L[1]>=c/2&&++E;do{h=0,(u=t(L,_,C,w))<0?(k=_[0],C!=w&&(k=k*c+(_[1]||0)),(h=k/E|0)>1?(h>=c&&(h=c-1),1==(u=t(g=e(L,h,c),_,y=g.length,w=_.length))&&(h--,r(g,C<y?N:L,y,c))):(0==h&&(u=h=1),g=L.slice()),(y=g.length)<w&&g.unshift(0),r(_,g,w,c),-1==u&&(u=t(L,_,C,w=_.length))<1&&(h++,r(_,C<w?N:L,w,c)),w=_.length):0===u&&(h++,_=[0]),b[p++]=h,u&&_[0]?_[w++]=P[S]||0:(_=[P[S]],w=1)}while((S++<M||void 0!==_[0])&&D--);m=void 0!==_[0]}b[0]||b.shift()}if(1==d)v.e=f,o=m;else{for(p=1,h=b[0];h>=10;h/=10)p++;v.e=p+f*d-1,R(v,l?i+v.e+1:i,s,m)}return v}}();function R(e,t,r,n){var a,i,o,s,l,c,u,f,p,h=e.constructor;e:if(null!=t){if(!(f=e.d))return e;for(a=1,s=f[0];s>=10;s/=10)a++;if((i=t-a)<0)i+=7,o=t,l=(u=f[p=0])/_(10,a-o-1)%10|0;else if((p=Math.ceil((i+1)/7))>=(s=f.length)){if(!n)break e;for(;s++<=p;)f.push(0);u=l=0,a=1,o=(i%=7)-7+1}else{for(u=s=f[p],a=1;s>=10;s/=10)a++;l=(o=(i%=7)-7+a)<0?0:u/_(10,a-o-1)%10|0}if(n=n||t<0||void 0!==f[p+1]||(o<0?u:u%_(10,a-o-1)),c=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(i>0?o>0?u/_(10,a-o):0:f[p-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=_(10,(7-t%7)%7),e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=p,s=1,p--):(f.length=p+1,s=_(10,7-i),f[p]=o>0?(u/_(10,a-o)%_(10,o)|0)*s:0),c)for(;;){if(0==p){for(i=1,o=f[0];o>=10;o/=10)i++;for(o=f[0]+=s,s=1;o>=10;o/=10)s++;i!=s&&(e.e++,f[0]==A&&(f[0]=1));break}if(f[p]+=s,f[p]!=A)break;f[p--]=0,s=1}for(i=f.length;0===f[--i];)f.pop()}return d&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function L(e,t,r){if(!e.isFinite())return G(e);var n,a=e.e,i=C(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+U(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):a<0?(i="0."+U(-a-1)+i,r&&(n=r-o)>0&&(i+=U(n))):a>=o?(i+=U(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+U(n))):((n=a+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(a+1===o&&(i+="."),i+=U(n))),i}function F(e,t){var r=e[0];for(t*=7;r>=10;r/=10)t++;return t}function B(e,t,r){if(t>S)throw d=!0,r&&(e.precision=r),Error(y);return R(new e(f),t,1,!0)}function z(e,t,r){if(t>M)throw Error(y);return R(new e(p),t,r,!0)}function j(e){var t=e.length-1,r=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function U(e){for(var t="";e--;)t+="0";return t}function $(e,t,r,n){var a,i=new e(1),o=Math.ceil(n/7+4);for(d=!1;;){if(r%2&&ee((i=i.times(t)).d,o)&&(a=!0),0===(r=x(r/2))){r=i.d.length-1,a&&0===i.d[r]&&++i.d[r];break}ee((t=t.times(t)).d,o)}return d=!0,i}function V(e){return 1&e.d[e.d.length-1]}function q(e,t,r){for(var n,a=new e(t[0]),i=0;++i<t.length;){if(!(n=new e(t[i])).s){a=n;break}a[r](n)&&(a=n)}return a}function W(e,t){var r,n,a,i,o,s,l,c=0,u=0,f=0,p=e.constructor,h=p.rounding,m=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(d=!1,l=m):l=t,s=new p(.03125);e.e>-2;)e=e.times(s),f+=5;for(l+=n=Math.log(_(2,f))/Math.LN10*2+5|0,r=i=o=new p(1),p.precision=l;;){if(i=R(i.times(e),l,1),r=r.times(++u),C((s=o.plus(P(i,r,l,1))).d).slice(0,l)===C(o.d).slice(0,l)){for(a=f;a--;)o=R(o.times(o),l,1);if(null!=t)return p.precision=m,o;if(!(c<3&&O(o.d,l-n,h,c)))return R(o,p.precision=m,h,d=!0);p.precision=l+=10,r=i=s=new p(1),u=0,c++}o=s}}function H(e,t){var r,n,a,i,o,s,l,c,u,f,p,h=1,m=e,g=m.d,y=m.constructor,v=y.rounding,b=y.precision;if(m.s<0||!g||!g[0]||!m.e&&1==g[0]&&1==g.length)return new y(g&&!g[0]?-1/0:1!=m.s?NaN:g?0:m);if(null==t?(d=!1,u=b):u=t,y.precision=u+=10,n=(r=C(g)).charAt(0),!(Math.abs(i=m.e)<15e14))return c=B(y,u+2,b).times(i+""),m=H(new y(n+"."+r.slice(1)),u-10).plus(c),y.precision=b,null==t?R(m,b,v,d=!0):m;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=C((m=m.times(e)).d)).charAt(0),h++;for(i=m.e,n>1?(m=new y("0."+r),i++):m=new y(n+"."+r.slice(1)),f=m,l=o=m=P(m.minus(1),m.plus(1),u,1),p=R(m.times(m),u,1),a=3;;){if(o=R(o.times(p),u,1),C((c=l.plus(P(o,new y(a),u,1))).d).slice(0,u)===C(l.d).slice(0,u)){if(l=l.times(2),0!==i&&(l=l.plus(B(y,u+2,b).times(i+""))),l=P(l,new y(h),u,1),null!=t)return y.precision=b,l;if(!O(l.d,u-10,v,s))return R(l,y.precision=b,v,d=!0);y.precision=u+=10,c=o=m=P(f.minus(1),f.plus(1),u,1),p=R(m.times(m),u,1),a=s=1}l=c,a+=2}}function G(e){return String(e.s*e.s/0)}function X(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(a=t.length;48===t.charCodeAt(a-1);--a);if(t=t.slice(n,a)){if(a-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%7,r<0&&(n+=7),n<a){for(n&&e.d.push(+t.slice(0,n)),a-=7;n<a;)e.d.push(+t.slice(n,n+=7));n=7-(t=t.slice(n)).length}else n-=a;for(;n--;)t+="0";e.d.push(+t),d&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Y(e,t){var r,n,a,o,s,l,c,u,f;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),T.test(t))return X(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(k.test(t))r=16,t=t.toLowerCase();else if(w.test(t))r=2;else{if(!D.test(t))throw Error(g+t);r=8}for((o=t.search(/p/i))>0?(c=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),s=(o=t.indexOf("."))>=0,n=e.constructor,s&&(o=(l=(t=t.replace(".","")).length)-o,a=$(n,new n(r),o,2*o)),o=f=(u=I(t,r,A)).length-1;0===u[o];--o)u.pop();return o<0?new n(0*e.s):(e.e=F(u,f),e.d=u,d=!1,s&&(e=P(e,a,4*l)),c&&(e=e.times(Math.abs(c)<54?_(2,c):i.pow(2,c))),d=!0,e)}function Z(e,t,r,n,a){var i,o,s,l,c=e.precision,u=Math.ceil(c/7);for(d=!1,l=r.times(r),s=new e(n);;){if(o=P(s.times(l),new e(t++*t++),c,1),s=a?n.plus(o):n.minus(o),n=P(o.times(l),new e(t++*t++),c,1),void 0!==(o=s.plus(n)).d[u]){for(i=u;o.d[i]===s.d[i]&&i--;);if(-1==i)break}i=s,s=n,n=o,o=i}return d=!0,o.d.length=u+1,o}function K(e,t){for(var r=e;--t;)r*=e;return r}function J(e,t){var r,n=t.s<0,a=z(e,e.precision,1),i=a.times(.5);if((t=t.abs()).lte(i))return s=n?4:1,t;if((r=t.divToInt(a)).isZero())s=n?3:2;else{if((t=t.minus(r.times(a))).lte(i))return s=V(r)?n?2:3:n?4:1,t;s=V(r)?n?1:4:n?3:2}return t.minus(a).abs()}function Q(e,t,r,n){var a,i,s,l,f,p,h,d,m,g=e.constructor,y=void 0!==r;if(y?(N(r,1,c),void 0===n?n=g.rounding:N(n,0,8)):(r=g.precision,n=g.rounding),e.isFinite()){for(y?(a=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):a=t,(s=(h=L(e)).indexOf("."))>=0&&(h=h.replace(".",""),(m=new g(1)).e=h.length-s,m.d=I(L(m),10,a),m.e=m.d.length),i=f=(d=I(h,10,a)).length;0==d[--f];)d.pop();if(d[0]){if(s<0?i--:((e=new g(e)).d=d,e.e=i,d=(e=P(e,m,r,n,0,a)).d,i=e.e,p=o),s=d[r],l=a/2,p=p||void 0!==d[r+1],p=n<4?(void 0!==s||p)&&(0===n||n===(e.s<0?3:2)):s>l||s===l&&(4===n||p||6===n&&1&d[r-1]||n===(e.s<0?8:7)),d.length=r,p)for(;++d[--r]>a-1;)d[r]=0,r||(++i,d.unshift(1));for(f=d.length;!d[f-1];--f);for(s=0,h="";s<f;s++)h+=u.charAt(d[s]);if(y){if(f>1)if(16==t||8==t){for(s=16==t?4:3,--f;f%s;f++)h+="0";for(f=(d=I(h,a,t)).length;!d[f-1];--f);for(s=1,h="1.";s<f;s++)h+=u.charAt(d[s])}else h=h.charAt(0)+"."+h.slice(1);h=h+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)h="0"+h;h="0."+h}else if(++i>f)for(i-=f;i--;)h+="0";else i<f&&(h=h.slice(0,i)+"."+h.slice(i))}else h=y?"0p+0":"0";h=(16==t?"0x":2==t?"0b":8==t?"0o":"")+h}else h=G(e);return e.s<0?"-"+h:h}function ee(e,t){if(e.length>t)return e.length=t,!0}function te(e){return new this(e).abs()}function re(e){return new this(e).acos()}function ne(e){return new this(e).acosh()}function ae(e,t){return new this(e).plus(t)}function ie(e){return new this(e).asin()}function oe(e){return new this(e).asinh()}function se(e){return new this(e).atan()}function le(e){return new this(e).atanh()}function ce(e,t){e=new this(e),t=new this(t);var r,n=this.precision,a=this.rounding,i=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?z(this,n,a):new this(0)).s=e.s:!e.d||t.isZero()?(r=z(this,i,1).times(.5)).s=e.s:t.s<0?(this.precision=i,this.rounding=1,r=this.atan(P(e,t,i,1)),t=z(this,i,1),this.precision=n,this.rounding=a,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(P(e,t,i,1)):(r=z(this,i,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function ue(e){return new this(e).cbrt()}function fe(e){return R(e=new this(e),e.e+1,2)}function pe(e,t,r){return new this(e).clamp(t,r)}function he(e){if(!e||"object"!=typeof e)throw Error(m+"Object expected");var t,r,n,a=!0===e.defaults,i=["precision",1,c,"rounding",0,8,"toExpNeg",-l,0,"toExpPos",0,l,"maxE",0,l,"minE",-l,0,"modulo",0,9];for(t=0;t<i.length;t+=3)if(r=i[t],a&&(this[r]=h[r]),void 0!==(n=e[r])){if(!(x(n)===n&&n>=i[t+1]&&n<=i[t+2]))throw Error(g+r+": "+n);this[r]=n}if(r="crypto",a&&(this[r]=h[r]),void 0!==(n=e[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(g+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(v);this[r]=!0}else this[r]=!1}return this}function de(e){return new this(e).cos()}function me(e){return new this(e).cosh()}function ge(e,t){return new this(e).div(t)}function ye(e){return new this(e).exp()}function ve(e){return R(e=new this(e),e.e+1,3)}function be(){var e,t,r=new this(0);for(d=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return d=!0,new this(1/0);r=t}return d=!0,r.sqrt()}function xe(e){return e instanceof i||e&&e.toStringTag===b||!1}function _e(e){return new this(e).ln()}function we(e,t){return new this(e).log(t)}function ke(e){return new this(e).log(2)}function De(e){return new this(e).log(10)}function Te(){return q(this,arguments,"lt")}function Ae(){return q(this,arguments,"gt")}function Se(e,t){return new this(e).mod(t)}function Me(e,t){return new this(e).mul(t)}function Ee(e,t){return new this(e).pow(t)}function Ce(e){var t,r,n,a,i=0,o=new this(1),s=[];if(void 0===e?e=this.precision:N(e,1,c),n=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));i<n;)(a=t[i])>=429e7?t[i]=crypto.getRandomValues(new Uint32Array(1))[0]:s[i++]=a%1e7;else{if(!crypto.randomBytes)throw Error(v);for(t=crypto.randomBytes(n*=4);i<n;)(a=t[i]+(t[i+1]<<8)+(t[i+2]<<16)+((127&t[i+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,i):(s.push(a%1e7),i+=4);i=n/4}else for(;i<n;)s[i++]=1e7*Math.random()|0;for(e%=7,(n=s[--i])&&e&&(a=_(10,7-e),s[i]=(n/a|0)*a);0===s[i];i--)s.pop();if(i<0)r=0,s=[0];else{for(r=-1;0===s[0];r-=7)s.shift();for(n=1,a=s[0];a>=10;a/=10)n++;n<7&&(r-=7-n)}return o.e=r,o.d=s,o}function Ne(e){return R(e=new this(e),e.e+1,this.rounding)}function Oe(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function Ie(e){return new this(e).sin()}function Pe(e){return new this(e).sinh()}function Re(e){return new this(e).sqrt()}function Le(e,t){return new this(e).sub(t)}function Fe(){var e=0,t=arguments,r=new this(t[e]);for(d=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return d=!0,R(r,this.precision,this.rounding)}function Be(e){return new this(e).tan()}function ze(e){return new this(e).tanh()}function je(e){return R(e=new this(e),e.e+1,1)}(i=function e(t){var r,n,a;function i(e){var t,r,n,a=this;if(!(a instanceof i))return new i(e);if(a.constructor=i,xe(e))return a.s=e.s,void(d?!e.d||e.e>i.maxE?(a.e=NaN,a.d=null):e.e<i.minE?(a.e=0,a.d=[0]):(a.e=e.e,a.d=e.d.slice()):(a.e=e.e,a.d=e.d?e.d.slice():e.d));if("number"==(n=typeof e)){if(0===e)return a.s=1/e<0?-1:1,a.e=0,void(a.d=[0]);if(e<0?(e=-e,a.s=-1):a.s=1,e===~~e&&e<1e7){for(t=0,r=e;r>=10;r/=10)t++;return void(d?t>i.maxE?(a.e=NaN,a.d=null):t<i.minE?(a.e=0,a.d=[0]):(a.e=t,a.d=[e]):(a.e=t,a.d=[e]))}return 0*e!=0?(e||(a.s=NaN),a.e=NaN,void(a.d=null)):X(a,e.toString())}if("string"!==n)throw Error(g+e);return 45===(r=e.charCodeAt(0))?(e=e.slice(1),a.s=-1):(43===r&&(e=e.slice(1)),a.s=1),T.test(e)?X(a,e):Y(a,e)}if(i.prototype=E,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=he,i.clone=e,i.isDecimal=xe,i.abs=te,i.acos=re,i.acosh=ne,i.add=ae,i.asin=ie,i.asinh=oe,i.atan=se,i.atanh=le,i.atan2=ce,i.cbrt=ue,i.ceil=fe,i.clamp=pe,i.cos=de,i.cosh=me,i.div=ge,i.exp=ye,i.floor=ve,i.hypot=be,i.ln=_e,i.log=we,i.log10=De,i.log2=ke,i.max=Te,i.min=Ae,i.mod=Se,i.mul=Me,i.pow=Ee,i.random=Ce,i.round=Ne,i.sign=Oe,i.sin=Ie,i.sinh=Pe,i.sqrt=Re,i.sub=Le,i.sum=Fe,i.tan=Be,i.tanh=ze,i.trunc=je,void 0===t&&(t={}),t&&!0!==t.defaults)for(a=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<a.length;)t.hasOwnProperty(n=a[r++])||(t[n]=this[n]);return i.config(t),i}(h)).prototype.constructor=i,i.default=i.Decimal=i,f=new i(f),p=new i(p),void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},2382:e=>{"use strict";e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}},49217:e=>{"use strict";var t=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},r={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},n={"–":"\\--","—":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},a=function(e,r){return t({},e,r)};e.exports=function(e){for(var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.preserveFormatting,s=void 0!==o&&o,l=i.escapeMapFn,c=void 0===l?a:l,u=String(e),f="",p=c(t({},r),s?t({},n):{}),h=Object.keys(p),d=function(){var e=!1;h.forEach((function(t,r){e||u.length>=t.length&&u.slice(0,t.length)===t&&(f+=p[h[r]],u=u.slice(t.length,u.length),e=!0)})),e||(f+=u.slice(0,1),u=u.slice(1,u.length))};u;)d();return f}},78011:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,a,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(a=n;0!=a--;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=n;0!=a--;){var o=i[a];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}},91621:function(e,t){var r;!function(n){"use strict";var a={s:1,n:0,d:1};function i(e){function t(){var t=Error.apply(this,arguments);t.name=this.name=e,this.stack=t.stack,this.message=t.message}function r(){}return r.prototype=Error.prototype,t.prototype=new r,t}var o=h.DivisionByZero=i("DivisionByZero"),s=h.InvalidParameter=i("InvalidParameter");function l(e,t){return isNaN(e=parseInt(e,10))&&c(),e*t}function c(){throw new s}function u(e){for(var t={},r=e,n=2,a=4;a<=r;){for(;r%n==0;)r/=n,t[n]=(t[n]||0)+1;a+=1+2*n++}return r!==e?r>1&&(t[r]=(t[r]||0)+1):t[e]=(t[e]||0)+1,t}var f=function(e,t){var r,n=0,i=1,s=1,u=0,f=0,p=0,h=1,d=1,m=0,g=1,y=1,v=1,b=1e7;if(null==e);else if(void 0!==t)s=(n=e)*(i=t);else switch(typeof e){case"object":"d"in e&&"n"in e?(n=e.n,i=e.d,"s"in e&&(n*=e.s)):0 in e?(n=e[0],1 in e&&(i=e[1])):c(),s=n*i;break;case"number":if(e<0&&(s=e,e=-e),e%1==0)n=e;else if(e>0){for(e>=1&&(e/=d=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));g<=b&&v<=b;){if(e===(r=(m+y)/(g+v))){g+v<=b?(n=m+y,i=g+v):v>g?(n=y,i=v):(n=m,i=g);break}e>r?(m+=y,g+=v):(y+=m,v+=g),g>b?(n=y,i=v):(n=m,i=g)}n*=d}else(isNaN(e)||isNaN(t))&&(i=n=NaN);break;case"string":if(null===(g=e.match(/\d+|./g))&&c(),"-"===g[m]?(s=-1,m++):"+"===g[m]&&m++,g.length===m+1?f=l(g[m++],s):"."===g[m+1]||"."===g[m]?("."!==g[m]&&(u=l(g[m++],s)),(1+ ++m===g.length||"("===g[m+1]&&")"===g[m+3]||"'"===g[m+1]&&"'"===g[m+3])&&(f=l(g[m],s),h=Math.pow(10,g[m].length),m++),("("===g[m]&&")"===g[m+2]||"'"===g[m]&&"'"===g[m+2])&&(p=l(g[m+1],s),d=Math.pow(10,g[m+1].length)-1,m+=3)):"/"===g[m+1]||":"===g[m+1]?(f=l(g[m],s),h=l(g[m+2],1),m+=3):"/"===g[m+3]&&" "===g[m+1]&&(u=l(g[m],s),f=l(g[m+2],s),h=l(g[m+4],1),m+=5),g.length<=m){s=n=p+(i=h*d)*u+d*f;break}default:c()}if(0===i)throw new o;a.s=s<0?-1:1,a.n=Math.abs(n),a.d=Math.abs(i)};function p(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function h(e,t){if(!(this instanceof h))return new h(e,t);f(e,t),e=p(a.d,a.n),this.s=a.s,this.n=a.n/e,this.d=a.d/e}h.prototype={s:1,n:0,d:1,abs:function(){return new h(this.n,this.d)},neg:function(){return new h(-this.s*this.n,this.d)},add:function(e,t){return f(e,t),new h(this.s*this.n*a.d+a.s*this.d*a.n,this.d*a.d)},sub:function(e,t){return f(e,t),new h(this.s*this.n*a.d-a.s*this.d*a.n,this.d*a.d)},mul:function(e,t){return f(e,t),new h(this.s*a.s*this.n*a.n,this.d*a.d)},div:function(e,t){return f(e,t),new h(this.s*a.s*this.n*a.d,this.d*a.n)},clone:function(){return new h(this)},mod:function(e,t){return isNaN(this.n)||isNaN(this.d)?new h(NaN):void 0===e?new h(this.s*this.n%this.d,1):(f(e,t),0===a.n&&0===this.d&&h(0,0),new h(this.s*(a.d*this.n)%(a.n*this.d),a.d*this.d))},gcd:function(e,t){return f(e,t),new h(p(a.n,this.n)*p(a.d,this.d),a.d*this.d)},lcm:function(e,t){return f(e,t),0===a.n&&0===this.n?new h:new h(a.n*this.n,p(a.n,this.n)*p(a.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):new h(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):new h(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):new h(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return new h(this.s*this.d,this.n)},pow:function(e,t){if(f(e,t),1===a.d)return a.s<0?new h(Math.pow(this.s*this.d,a.n),Math.pow(this.n,a.n)):new h(Math.pow(this.s*this.n,a.n),Math.pow(this.d,a.n));if(this.s<0)return null;var r=u(this.n),n=u(this.d),i=1,o=1;for(var s in r)if("1"!==s){if("0"===s){i=0;break}if(r[s]*=a.n,r[s]%a.d!=0)return null;r[s]/=a.d,i*=Math.pow(s,r[s])}for(var s in n)if("1"!==s){if(n[s]*=a.n,n[s]%a.d!=0)return null;n[s]/=a.d,o*=Math.pow(s,n[s])}return a.s<0?new h(o,i):new h(i,o)},equals:function(e,t){return f(e,t),this.s*this.n*a.d==a.s*a.n*this.d},compare:function(e,t){f(e,t);var r=this.s*this.n*a.d-a.s*a.n*this.d;return(0<r)-(r<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;var t=this.abs().toContinued();function r(e){return 1===e.length?new h(e[0]):r(e.slice(1)).inverse().add(e[0])}e=e||.001;for(var n=0;n<t.length;n++){var a=r(t.slice(0,n+1));if(a.sub(this.abs()).abs().valueOf()<e)return a.mul(this.s)}return this},divisible:function(e,t){return f(e,t),!(!(a.n*this.d)||this.n*a.d%(a.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,r="",n=this.n,a=this.d;return this.s<0&&(r+="-"),1===a?r+=n:(e&&(t=Math.floor(n/a))>0&&(r+=t,r+=" ",n%=a),r+=n,r+="/",r+=a),r},toLatex:function(e){var t,r="",n=this.n,a=this.d;return this.s<0&&(r+="-"),1===a?r+=n:(e&&(t=Math.floor(n/a))>0&&(r+=t,n%=a),r+="\\frac{",r+=n,r+="}{",r+=a,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(t)||isNaN(r))return n;do{n.push(Math.floor(t/r)),e=t%r,t=r,r=e}while(1!==t);return n},toString:function(e){var t=this.n,r=this.d;if(isNaN(t)||isNaN(r))return"NaN";e=e||15;var n=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var r=10%t,n=1;1!==r;n++)if(r=10*r%t,n>2e3)return 0;return n}(0,r),a=function(e,t,r){for(var n=1,a=function(e,t,r){for(var n=1;t>0;e=e*e%r,t>>=1)1&t&&(n=n*e%r);return n}(10,r,t),i=0;i<300;i++){if(n===a)return i;n=10*n%t,a=10*a%t}return 0}(0,r,n),i=-1===this.s?"-":"";if(i+=t/r|0,t%=r,(t*=10)&&(i+="."),n){for(var o=a;o--;)i+=t/r|0,t%=r,t*=10;for(i+="(",o=n;o--;)i+=t/r|0,t%=r,t*=10;i+=")"}else for(o=e;t&&o--;)i+=t/r|0,t%=r,t*=10;return i}},void 0===(r=function(){return h}.apply(t,[]))||(e.exports=r)}()},32633:e=>{"use strict";const t=e=>!Number.isNaN(e)&&e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);e.exports=t,e.exports.default=t},7215:e=>{e.exports=function e(t,r){"use strict";var n,a,i=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,o=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,u=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},f=u(t).replace(o,"")||"",p=u(r).replace(o,"")||"",h=f.replace(i,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=p.replace(i,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(f.match(l),16)||1!==h.length&&f.match(s)&&Date.parse(f),g=parseInt(p.match(l),16)||m&&p.match(s)&&Date.parse(p)||null;if(g){if(m<g)return-1;if(m>g)return 1}for(var y=0,v=Math.max(h.length,d.length);y<v;y++){if(n=!(h[y]||"").match(c)&&parseFloat(h[y])||h[y]||0,a=!(d[y]||"").match(c)&&parseFloat(d[y])||d[y]||0,isNaN(n)!==isNaN(a))return isNaN(n)?1:-1;if(typeof n!=typeof a&&(n+="",a+=""),n<a)return-1;if(n>a)return 1}return 0}},76267:(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",a=9007199254740991,i="[object Arguments]",o="[object Boolean]",s="[object Date]",l="[object Function]",c="[object GeneratorFunction]",u="[object Map]",f="[object Number]",p="[object Object]",h="[object Promise]",d="[object RegExp]",m="[object Set]",g="[object String]",y="[object Symbol]",v="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",_="[object Float32Array]",w="[object Float64Array]",k="[object Int8Array]",D="[object Int16Array]",T="[object Int32Array]",A="[object Uint8Array]",S="[object Uint8ClampedArray]",M="[object Uint16Array]",E="[object Uint32Array]",C=/\w*$/,N=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,I={};I[i]=I["[object Array]"]=I[b]=I[x]=I[o]=I[s]=I[_]=I[w]=I[k]=I[D]=I[T]=I[u]=I[f]=I[p]=I[d]=I[m]=I[g]=I[y]=I[A]=I[S]=I[M]=I[E]=!0,I["[object Error]"]=I[l]=I[v]=!1;var P="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,R="object"==typeof self&&self&&self.Object===Object&&self,L=P||R||Function("return this")(),F=t&&!t.nodeType&&t,B=F&&e&&!e.nodeType&&e,z=B&&B.exports===F;function j(e,t){return e.set(t[0],t[1]),e}function U(e,t){return e.add(t),e}function $(e,t,r,n){var a=-1,i=e?e.length:0;for(n&&i&&(r=e[++a]);++a<i;)r=t(r,e[a],a,e);return r}function V(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function q(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function W(e,t){return function(r){return e(t(r))}}function H(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var G,X=Array.prototype,Y=Function.prototype,Z=Object.prototype,K=L["__core-js_shared__"],J=(G=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"",Q=Y.toString,ee=Z.hasOwnProperty,te=Z.toString,re=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=z?L.Buffer:void 0,ae=L.Symbol,ie=L.Uint8Array,oe=W(Object.getPrototypeOf,Object),se=Object.create,le=Z.propertyIsEnumerable,ce=X.splice,ue=Object.getOwnPropertySymbols,fe=ne?ne.isBuffer:void 0,pe=W(Object.keys,Object),he=Le(L,"DataView"),de=Le(L,"Map"),me=Le(L,"Promise"),ge=Le(L,"Set"),ye=Le(L,"WeakMap"),ve=Le(Object,"create"),be=Ue(he),xe=Ue(de),_e=Ue(me),we=Ue(ge),ke=Ue(ye),De=ae?ae.prototype:void 0,Te=De?De.valueOf:void 0;function Ae(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Se(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Me(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ee(e){this.__data__=new Se(e)}function Ce(e,t,r){var n=e[t];ee.call(e,t)&&$e(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function Ne(e,t){for(var r=e.length;r--;)if($e(e[r][0],t))return r;return-1}function Oe(e,t,r,n,a,h,v){var N;if(n&&(N=h?n(e,a,h,v):n(e)),void 0!==N)return N;if(!Ge(e))return e;var O=Ve(e);if(O){if(N=function(e){var t=e.length,r=e.constructor(t);return t&&"string"==typeof e[0]&&ee.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!t)return function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}(e,N)}else{var P=Be(e),R=P==l||P==c;if(We(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(P==p||P==i||R&&!h){if(V(e))return h?e:{};if(N=function(e){return"function"!=typeof e.constructor||je(e)?{}:Ge(t=oe(e))?se(t):{};var t}(R?{}:e),!t)return function(e,t){return Pe(e,Fe(e),t)}(e,function(e,t){return e&&Pe(t,Xe(t),e)}(N,e))}else{if(!I[P])return h?e:{};N=function(e,t,r,n){var a,i=e.constructor;switch(t){case b:return Ie(e);case o:case s:return new i(+e);case x:return function(e,t){var r=t?Ie(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,n);case _:case w:case k:case D:case T:case A:case S:case M:case E:return function(e,t){var r=t?Ie(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,n);case u:return function(e,t,r){return $(t?r(q(e),!0):q(e),j,new e.constructor)}(e,n,r);case f:case g:return new i(e);case d:return function(e){var t=new e.constructor(e.source,C.exec(e));return t.lastIndex=e.lastIndex,t}(e);case m:return function(e,t,r){return $(t?r(H(e),!0):H(e),U,new e.constructor)}(e,n,r);case y:return a=e,Te?Object(Te.call(a)):{}}}(e,P,Oe,t)}}v||(v=new Ee);var L=v.get(e);if(L)return L;if(v.set(e,N),!O)var F=r?function(e){return function(e,t,r){var n=t(e);return Ve(e)?n:function(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}(n,r(e))}(e,Xe,Fe)}(e):Xe(e);return function(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r););}(F||e,(function(a,i){F&&(a=e[i=a]),Ce(N,i,Oe(a,t,r,n,i,e,v))})),N}function Ie(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Pe(e,t,r,n){r||(r={});for(var a=-1,i=t.length;++a<i;){var o=t[a],s=n?n(r[o],e[o],o,r,e):void 0;Ce(r,o,void 0===s?e[o]:s)}return r}function Re(e,t){var r,n,a=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?a["string"==typeof t?"string":"hash"]:a.map}function Le(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ge(e)||(t=e,J&&J in t))&&(He(e)||V(e)?re:N).test(Ue(e));var t}(r)?r:void 0}Ae.prototype.clear=function(){this.__data__=ve?ve(null):{}},Ae.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ae.prototype.get=function(e){var t=this.__data__;if(ve){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},Ae.prototype.has=function(e){var t=this.__data__;return ve?void 0!==t[e]:ee.call(t,e)},Ae.prototype.set=function(e,t){return this.__data__[e]=ve&&void 0===t?n:t,this},Se.prototype.clear=function(){this.__data__=[]},Se.prototype.delete=function(e){var t=this.__data__,r=Ne(t,e);return!(r<0||(r==t.length-1?t.pop():ce.call(t,r,1),0))},Se.prototype.get=function(e){var t=this.__data__,r=Ne(t,e);return r<0?void 0:t[r][1]},Se.prototype.has=function(e){return Ne(this.__data__,e)>-1},Se.prototype.set=function(e,t){var r=this.__data__,n=Ne(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Me.prototype.clear=function(){this.__data__={hash:new Ae,map:new(de||Se),string:new Ae}},Me.prototype.delete=function(e){return Re(this,e).delete(e)},Me.prototype.get=function(e){return Re(this,e).get(e)},Me.prototype.has=function(e){return Re(this,e).has(e)},Me.prototype.set=function(e,t){return Re(this,e).set(e,t),this},Ee.prototype.clear=function(){this.__data__=new Se},Ee.prototype.delete=function(e){return this.__data__.delete(e)},Ee.prototype.get=function(e){return this.__data__.get(e)},Ee.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Se){var n=r.__data__;if(!de||n.length<199)return n.push([e,t]),this;r=this.__data__=new Me(n)}return r.set(e,t),this};var Fe=ue?W(ue,Object):function(){return[]},Be=function(e){return te.call(e)};function ze(e,t){return!!(t=null==t?a:t)&&("number"==typeof e||O.test(e))&&e>-1&&e%1==0&&e<t}function je(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Z)}function Ue(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function $e(e,t){return e===t||e!=e&&t!=t}(he&&Be(new he(new ArrayBuffer(1)))!=x||de&&Be(new de)!=u||me&&Be(me.resolve())!=h||ge&&Be(new ge)!=m||ye&&Be(new ye)!=v)&&(Be=function(e){var t=te.call(e),r=t==p?e.constructor:void 0,n=r?Ue(r):void 0;if(n)switch(n){case be:return x;case xe:return u;case _e:return h;case we:return m;case ke:return v}return t});var Ve=Array.isArray;function qe(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}(e.length)&&!He(e)}var We=fe||function(){return!1};function He(e){var t=Ge(e)?te.call(e):"";return t==l||t==c}function Ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Xe(e){return qe(e)?function(e,t){var r=Ve(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&qe(e)}(e)&&ee.call(e,"callee")&&(!le.call(e,"callee")||te.call(e)==i)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,a=!!n;for(var o in e)!t&&!ee.call(e,o)||a&&("length"==o||ze(o,n))||r.push(o);return r}(e):function(e){if(!je(e))return pe(e);var t=[];for(var r in Object(e))ee.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return Oe(e,!0,!0)}},5232:(e,t,r)=>{e=r.nmd(e);var n=/^\s+|\s+$/g,a=/\w*$/,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",c="\\ud83c[\\udffb-\\udfff]",u="[^\\ud800-\\udfff]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",h="(?:"+l+"|"+c+")?",d="[\\ufe0e\\ufe0f]?",m=d+h+"(?:\\u200d(?:"+[u,f,p].join("|")+")"+d+h+")*",g="(?:"+[u+l+"?",l,f,p,"[\\ud800-\\udfff]"].join("|")+")",y=RegExp(c+"(?="+c+")|"+g+m,"g"),v=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),b=parseInt,x="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,_="object"==typeof self&&self&&self.Object===Object&&self,w=x||_||Function("return this")(),k=t&&!t.nodeType&&t,D=k&&e&&!e.nodeType&&e,T=D&&D.exports===k&&x.process,A=function(){try{return T&&T.binding("util")}catch(e){}}(),S=A&&A.isRegExp,M=("length",function(e){return null==e?void 0:e.length});function E(e){return v.test(e)}var C=Object.prototype.toString,N=w.Symbol,O=N?N.prototype:void 0,I=O?O.toString:void 0;function P(e){if("string"==typeof e)return e;if(B(e))return I?I.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function R(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var L,F=S?(L=S,function(e){return L(e)}):function(e){return R(e)&&"[object RegExp]"==C.call(e)};function B(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==C.call(e)}function z(e){return null==e?"":P(e)}e.exports=function(e,t){var r=30,l="...";if(R(t)){var c="separator"in t?t.separator:c;r="length"in t?function(e){var t=function(e){return e?1/0===(e=function(e){if("number"==typeof e)return e;if(B(e))return NaN;if(R(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=R(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var r=o.test(e);return r||s.test(e)?b(e.slice(2),r?2:8):i.test(e)?NaN:+e}(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),r=t%1;return t==t?r?t-r:t:0}(t.length):r,l="omission"in t?P(t.omission):l}var u=(e=z(e)).length;if(E(e)){var f=function(e){return E(e)?function(e){return e.match(y)||[]}(e):function(e){return e.split("")}(e)}(e);u=f.length}if(r>=u)return e;var p=r-function(e){return E(e)?function(e){for(var t=y.lastIndex=0;y.test(e);)t++;return t}(e):M(e)}(l);if(p<1)return l;var h=f?function(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e:function(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n<a;)i[n]=e[n+t];return i}(e,t,r)}(f,0,p).join(""):e.slice(0,p);if(void 0===c)return h+l;if(f&&(p+=h.length-p),F(c)){if(e.slice(p).search(c)){var d,m=h;for(c.global||(c=RegExp(c.source,z(a.exec(c))+"g")),c.lastIndex=0;d=c.exec(m);)var g=d.index;h=h.slice(0,void 0===g?p:g)}}else if(e.indexOf(P(c),p)!=p){var v=h.lastIndexOf(c);v>-1&&(h=h.slice(0,v))}return h+l}},66307:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var a={},i={};function o(e,t){var r,n,o;return t?(o=0<=(e>>>=0)&&e<256)&&(n=i[e])?n:(r=l(e,(0|e)<0?-1:0,!0),o&&(i[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(n=a[e])?n:(r=l(e,e<0?-1:0,!1),o&&(a[e]=r),r)}function s(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=h)return w}else{if(e<=-d)return k;if(e+1>=d)return _}return e<0?s(-e,t).neg():l(e%p|0,e/p|0,t)}function l(e,t,n){return new r(e,t,n)}r.fromInt=o,r.fromNumber=s,r.fromBits=l;var c=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(e.substring(1),t,r).neg();for(var a=s(c(r,8)),i=g,o=0;o<e.length;o+=8){var l=Math.min(8,e.length-o),f=parseInt(e.substring(o,o+l),r);if(l<8){var p=s(c(r,l));i=i.mul(p).add(s(f))}else i=(i=i.mul(a)).add(s(f))}return i.unsigned=t,i}function f(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?u(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=u,r.fromValue=f;var p=4294967296,h=p*p,d=h/2,m=o(1<<24),g=o(0);r.ZERO=g;var y=o(0,!0);r.UZERO=y;var v=o(1);r.ONE=v;var b=o(1,!0);r.UONE=b;var x=o(-1);r.NEG_ONE=x;var _=l(-1,2147483647,!1);r.MAX_VALUE=_;var w=l(-1,-1,!0);r.MAX_UNSIGNED_VALUE=w;var k=l(0,-2147483648,!1);r.MIN_VALUE=k;var D=r.prototype;D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},D.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(k)){var t=s(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var a=s(c(e,6),this.unsigned),i=this,o="";;){var l=i.div(a),u=(i.sub(l.mul(a)).toInt()>>>0).toString(e);if((i=l).isZero())return u+o;for(;u.length<6;)u="0"+u;o=""+u+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(k)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},D.isZero=function(){return 0===this.high&&0===this.low},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||this.high>=0},D.isOdd=function(){return 1==(1&this.low)},D.isEven=function(){return 0==(1&this.low)},D.equals=function(e){return n(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return this.comp(e)>0},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return this.comp(e)>=0},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(n(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(k)?k:this.not().add(v)},D.neg=D.negate,D.add=function(e){n(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,a=this.low>>>16,i=65535&this.low,o=e.high>>>16,s=65535&e.high,c=e.low>>>16,u=0,p=0,h=0,d=0;return h+=(d+=i+(65535&e.low))>>>16,p+=(h+=a+c)>>>16,u+=(p+=r+s)>>>16,u+=t+o,l((h&=65535)<<16|(d&=65535),(u&=65535)<<16|(p&=65535),this.unsigned)},D.subtract=function(e){return n(e)||(e=f(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return g;if(n(e)||(e=f(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(k))return e.isOdd()?k:g;if(e.eq(k))return this.isOdd()?k:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,a=65535&this.high,i=this.low>>>16,o=65535&this.low,c=e.high>>>16,u=65535&e.high,p=e.low>>>16,h=65535&e.low,d=0,y=0,v=0,b=0;return v+=(b+=o*h)>>>16,y+=(v+=i*h)>>>16,v&=65535,y+=(v+=o*p)>>>16,d+=(y+=a*h)>>>16,y&=65535,d+=(y+=i*p)>>>16,y&=65535,d+=(y+=o*u)>>>16,d+=r*h+a*p+i*u+o*c,l((v&=65535)<<16|(b&=65535),(d&=65535)<<16|(y&=65535),this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(n(e)||(e=f(e)),e.isZero())throw Error("division by zero");var r,a,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return b;i=y}else{if(this.eq(k))return e.eq(v)||e.eq(x)?k:e.eq(k)?v:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?v:x:(a=this.sub(e.mul(r)),i=r.add(a.div(e)));if(e.eq(k))return this.unsigned?y:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=g}for(a=this;a.gte(e);){r=Math.max(1,Math.floor(a.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),u=o<=48?1:c(2,o-48),p=s(r),h=p.mul(e);h.isNegative()||h.gt(a);)h=(p=s(r-=u,this.unsigned)).mul(e);p.isZero()&&(p=v),i=i.add(p),a=a.sub(h)}return i},D.div=D.divide,D.modulo=function(e){return n(e)||(e=f(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return l(~this.low,~this.high,this.unsigned)},D.and=function(e){return n(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return n(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return n(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},51506:(e,t,r)=>{var n=r(93440),a=r(11042),i=r(32002),o=r(44498),s=r(8302),l=r(49472),c=r(86791);c.alea=n,c.xor128=a,c.xorwow=i,c.xorshift7=o,c.xor4096=s,c.tychei=l,e.exports=c},93440:function(e,t,r){var n;!function(e,a,i){function o(e){var t,r=this,n=(t=4022871197,function(e){e=String(e);for(var r=0;r<e.length;r++){var n=.02519603282416938*(t+=e.charCodeAt(r));n-=t=n>>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var r=new o(e),n=t&&t.state,a=r.next;return a.int32=function(){return 4294967296*r.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.alea=l}(0,e=r.nmd(e),r.amdD)},49472:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,a=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)t.b^=0|r.charCodeAt(n),t.next()}function s(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.tychei=l}(0,e=r.nmd(e),r.amdD)},11042:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor128=l}(0,e=r.nmd(e),r.amdD)},8302:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,r,n=t.w,a=t.X,i=t.i;return t.w=n=n+1640531527|0,r=a[i+34&127],e=a[i=i+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=a[i]=r^e,t.i=i,r+(n^n>>>16)|0},function(e,t){var r,n,a,i,o,s=[],l=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,l=Math.max(l,t.length)),a=0,i=-32;i<l;++i)t&&(n^=t.charCodeAt((i+32)%t.length)),0===i&&(o=n),n^=n<<10,n^=n>>>15,n^=n<<4,n^=n>>>13,i>=0&&(o=o+1640531527|0,a=0==(r=s[127&i]^=n+o)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,i=512;i>0;--i)n=s[a+34&127],r=s[a=a+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[a]=n^r;e.w=o,e.X=s,e.i=a}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.X&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor4096=l}(0,e=r.nmd(e),r.amdD)},44498:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,r,n=t.x,a=t.i;return e=n[a],r=(e^=e>>>7)^e<<24,r^=(e=n[a+1&7])^e>>>10,r^=(e=n[a+3&7])^e>>>3,r^=(e=n[a+4&7])^e<<7,e=n[a+7&7],r^=(e^=e<<13)^e<<9,n[a]=r,t.i=a+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r<t.length;++r)n[7&r]=n[7&r]<<15^t.charCodeAt(r)+n[r+1&7]<<13;for(;n.length<8;)n.push(0);for(r=0;r<8&&0===n[r];++r);for(8==r?n[7]=-1:n[r],e.x=n,e.i=0,r=256;r>0;--r)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.x&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorshift7=l}(0,e=r.nmd(e),r.amdD)},32002:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),n==r.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorwow=l}(0,e=r.nmd(e),r.amdD)},86791:function(e,t,r){var n;!function(a,i,o){var s,l=256,c=o.pow(l,6),u=o.pow(2,52),f=2*u,p=255;function h(e,t,r){var n=[],p=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,v(i)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(l):(e=new Uint8Array(l),(a.crypto||a.msCrypto).getRandomValues(e)),v(e)}catch(e){var t=a.navigator,r=t&&t.plugins;return[+new Date,a,r,a.screen,v(i)]}}():e,3),n),h=new d(n),b=function(){for(var e=h.g(6),t=c,r=0;e<u;)e=(e+r)*l,t*=l,r=h.g(1);for(;e>=f;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|h.g(4)},b.quick=function(){return h.g(4)/4294967296},b.double=b,y(v(h.S),i),(t.pass||r||function(e,t,r,n){return n&&(n.S&&m(n,h),e.state=function(){return m(h,{})}),r?(o.random=e,t):e})(b,p,"global"in t?t.global:this==o,t.state)}function d(e){var t,r=e.length,n=this,a=0,i=n.i=n.j=0,o=n.S=[];for(r||(e=[r++]);a<l;)o[a]=a++;for(a=0;a<l;a++)o[a]=o[i=p&i+e[a%r]+(t=o[a])],o[i]=t;(n.g=function(e){for(var t,r=0,a=n.i,i=n.j,o=n.S;e--;)t=o[a=p&a+1],r=r*l+o[p&(o[a]=o[i=p&i+t])+(o[i]=t)];return n.i=a,n.j=i,r})(l)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function g(e,t){var r,n=[],a=typeof e;if(t&&"object"==a)for(r in e)try{n.push(g(e[r],t-1))}catch(e){}return n.length?n:"string"==a?e:e+"\0"}function y(e,t){for(var r,n=e+"",a=0;a<n.length;)t[p&a]=p&(r^=19*t[p&a])+n.charCodeAt(a++);return v(t)}function v(e){return String.fromCharCode.apply(0,e)}if(y(o.random(),i),e.exports){e.exports=h;try{s=r(22006)}catch(e){}}else void 0===(n=function(){return h}.call(t,r,t,e))||(e.exports=n)}("undefined"!=typeof self?self:this,[],Math)},64409:function(e,t){var r,n;r=function e(){"use strict";var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{},r=!t.document&&!!t.postMessage,n=r&&/blob:/i.test((t.location||{}).protocol),a={},i=0,o={parse:function(r,n){var s=(n=n||{}).dynamicTyping||!1;if(_(s)&&(n.dynamicTypingFunction=s,s={}),n.dynamicTyping=s,n.transform=!!_(n.transform)&&n.transform,n.worker&&o.WORKERS_SUPPORTED){var l=function(){if(!o.WORKERS_SUPPORTED)return!1;var r,n,s=(r=t.URL||t.webkitURL||null,n=e.toString(),o.BLOB_URL||(o.BLOB_URL=r.createObjectURL(new Blob(["(",n,")();"],{type:"text/javascript"})))),l=new t.Worker(s);return l.onmessage=g,l.id=i++,a[l.id]=l}();return l.userStep=n.step,l.userChunk=n.chunk,l.userComplete=n.complete,l.userError=n.error,n.step=_(n.step),n.chunk=_(n.chunk),n.complete=_(n.complete),n.error=_(n.error),delete n.worker,void l.postMessage({input:r,config:n,workerId:l.id})}var h=null;return o.NODE_STREAM_INPUT,"string"==typeof r?h=n.download?new c(n):new f(n):!0===r.readable&&_(r.read)&&_(r.on)?h=new p(n):(t.File&&r instanceof File||r instanceof Object)&&(h=new u(n)),h.stream(r)},unparse:function(e,t){var r=!1,n=!0,a=",",i="\r\n",s='"',l=s+s,c=!1,u=null,f=!1;!function(){if("object"==typeof t){if("string"!=typeof t.delimiter||o.BAD_DELIMITERS.filter((function(e){return-1!==t.delimiter.indexOf(e)})).length||(a=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(r=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(i=t.newline),"string"==typeof t.quoteChar&&(s=t.quoteChar),"boolean"==typeof t.header&&(n=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");u=t.columns}void 0!==t.escapeChar&&(l=t.escapeChar+s),"boolean"==typeof t.escapeFormulae&&(f=t.escapeFormulae)}}();var p=new RegExp(d(s),"g");if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return h(null,e,c);if("object"==typeof e[0])return h(u||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),h(e.fields||[],e.data||[],c);throw new Error("Unable to serialize unrecognized input");function h(e,t,r){var o="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var s=Array.isArray(e)&&0<e.length,l=!Array.isArray(t[0]);if(s&&n){for(var c=0;c<e.length;c++)0<c&&(o+=a),o+=m(e[c],c);0<t.length&&(o+=i)}for(var u=0;u<t.length;u++){var f=s?e.length:t[u].length,p=!1,h=s?0===Object.keys(t[u]).length:0===t[u].length;if(r&&!s&&(p="greedy"===r?""===t[u].join("").trim():1===t[u].length&&0===t[u][0].length),"greedy"===r&&s){for(var d=[],g=0;g<f;g++){var y=l?e[g]:g;d.push(t[u][y])}p=""===d.join("").trim()}if(!p){for(var v=0;v<f;v++){0<v&&!h&&(o+=a);var b=s&&l?e[v]:v;o+=m(t[u][b],v)}u<t.length-1&&(!r||0<f&&!h)&&(o+=i)}}return o}function m(e,t){if(null==e)return"";if(e.constructor===Date)return JSON.stringify(e).slice(1,25);!0===f&&"string"==typeof e&&null!==e.match(/^[=+\-@].*$/)&&(e="'"+e);var n=e.toString().replace(p,l),i="boolean"==typeof r&&r||"function"==typeof r&&r(e,t)||Array.isArray(r)&&r[t]||function(e,t){for(var r=0;r<t.length;r++)if(-1<e.indexOf(t[r]))return!0;return!1}(n,o.BAD_DELIMITERS)||-1<n.indexOf(a)||" "===n.charAt(0)||" "===n.charAt(n.length-1);return i?s+n+s:n}}};if(o.RECORD_SEP=String.fromCharCode(30),o.UNIT_SEP=String.fromCharCode(31),o.BYTE_ORDER_MARK="\ufeff",o.BAD_DELIMITERS=["\r","\n",'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!r&&!!t.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=m,o.ParserHandle=h,o.NetworkStreamer=c,o.FileStreamer=u,o.StringStreamer=f,o.ReadableStreamStreamer=p,t.jQuery){var s=t.jQuery;s.fn.parse=function(e){var r=e.config||{},n=[];return this.each((function(e){if("INPUT"!==s(this).prop("tagName").toUpperCase()||"file"!==s(this).attr("type").toLowerCase()||!t.FileReader||!this.files||0===this.files.length)return!0;for(var a=0;a<this.files.length;a++)n.push({file:this.files[a],inputElem:this,instanceConfig:s.extend({},r)})})),a(),this;function a(){if(0!==n.length){var t,r,a,l=n[0];if(_(e.before)){var c=e.before(l.file,l.inputElem);if("object"==typeof c){if("abort"===c.action)return"AbortError",t=l.file,r=l.inputElem,a=c.reason,void(_(e.error)&&e.error({name:"AbortError"},t,r,a));if("skip"===c.action)return void i();"object"==typeof c.config&&(l.instanceConfig=s.extend(l.instanceConfig,c.config))}else if("skip"===c)return void i()}var u=l.instanceConfig.complete;l.instanceConfig.complete=function(e){_(u)&&u(e,l.file,l.inputElem),i()},o.parse(l.file,l.instanceConfig)}else _(e.complete)&&e.complete()}function i(){n.splice(0,1),a()}}}function l(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new h(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e,r){if(this.isFirstChunk&&_(this._config.beforeFirstChunk)){var a=this._config.beforeFirstChunk(e);void 0!==a&&(e=a)}this.isFirstChunk=!1,this._halted=!1;var i=this._partialLine+e;this._partialLine="";var s=this._handle.parse(i,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var l=s.meta.cursor;this._finished||(this._partialLine=i.substring(l-this._baseIndex),this._baseIndex=l),s&&s.data&&(this._rowCount+=s.data.length);var c=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(n)t.postMessage({results:s,workerId:o.WORKER_ID,finished:c});else if(_(this._config.chunk)&&!r){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);s=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),this._completed||!c||!_(this._config.complete)||s&&s.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||s&&s.meta.paused||this._nextChunk(),s}this._halted=!0},this._sendError=function(e){_(this._config.error)?this._config.error(e):n&&this._config.error&&t.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),l.call(this,e),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),r||(t.onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var n in e)t.setRequestHeader(n,e[n])}if(this._config.chunkSize){var a=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+a)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}r&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var r=t.statusText||e;this._sendError(new Error(r))}}function u(e){var t,r;(e=e||{}).chunkSize||(e.chunkSize=o.LocalChunkSize),l.call(this,e);var n="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,n?((t=new FileReader).onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input;if(this._config.chunkSize){var a=Math.min(this._start+this._config.chunkSize,this._input.size);e=r.call(e,this._start,a)}var i=t.readAsText(e,this._config.encoding);n||this._chunkLoaded({target:{result:i}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function f(e){var t;l.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,r=this._config.chunkSize;return r?(e=t.substring(0,r),t=t.substring(r)):(e=t,t=""),this._finished=!t,this.parseChunk(e)}}}function p(e){l.call(this,e=e||{});var t=[],r=!0,n=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r=!0},this._streamData=x((function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}}),this),this._streamError=x((function(e){this._streamCleanUp(),this._sendError(e)}),this),this._streamEnd=x((function(){this._streamCleanUp(),n=!0,this._streamData("")}),this),this._streamCleanUp=x((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function h(e){var t,r,n,a=Math.pow(2,53),i=-a,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,l=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/,c=this,u=0,f=0,p=!1,h=!1,g=[],y={data:[],errors:[],meta:{}};if(_(e.step)){var v=e.step;e.step=function(t){if(y=t,k())w();else{if(w(),0===y.data.length)return;u+=t.data.length,e.preview&&u>e.preview?r.abort():(y.data=y.data[0],v(y,c))}}}function x(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function w(){if(y&&n&&(T("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),n=!1),e.skipEmptyLines)for(var t=0;t<y.data.length;t++)x(y.data[t])&&y.data.splice(t--,1);return k()&&function(){if(y)if(Array.isArray(y.data[0])){for(var t=0;k()&&t<y.data.length;t++)y.data[t].forEach(r);y.data.splice(0,1)}else y.data.forEach(r);function r(t,r){_(e.transformHeader)&&(t=e.transformHeader(t,r)),g.push(t)}}(),function(){if(!y||!e.header&&!e.dynamicTyping&&!e.transform)return y;function t(t,r){var n,a=e.header?{}:[];for(n=0;n<t.length;n++){var i=n,o=t[n];e.header&&(i=n>=g.length?"__parsed_extra":g[n]),e.transform&&(o=e.transform(o,i)),o=D(i,o),"__parsed_extra"===i?(a[i]=a[i]||[],a[i].push(o)):a[i]=o}return e.header&&(n>g.length?T("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+n,f+r):n<g.length&&T("FieldMismatch","TooFewFields","Too few fields: expected "+g.length+" fields but parsed "+n,f+r)),a}var r=1;return!y.data.length||Array.isArray(y.data[0])?(y.data=y.data.map(t),r=y.data.length):y.data=t(y.data,0),e.header&&y.meta&&(y.meta.fields=g),f+=r,y}()}function k(){return e.header&&0===g.length}function D(t,r){return n=t,e.dynamicTypingFunction&&void 0===e.dynamicTyping[n]&&(e.dynamicTyping[n]=e.dynamicTypingFunction(n)),!0===(e.dynamicTyping[n]||e.dynamicTyping)?"true"===r||"TRUE"===r||"false"!==r&&"FALSE"!==r&&(function(e){if(s.test(e)){var t=parseFloat(e);if(i<t&&t<a)return!0}return!1}(r)?parseFloat(r):l.test(r)?new Date(r):""===r?null:r):r;var n}function T(e,t,r,n){var a={type:e,code:t,message:r};void 0!==n&&(a.row=n),y.errors.push(a)}this.parse=function(a,i,s){var l=e.quoteChar||'"';if(e.newline||(e.newline=function(e,t){e=e.substring(0,1048576);var r=new RegExp(d(t)+"([^]*?)"+d(t),"gm"),n=(e=e.replace(r,"")).split("\r"),a=e.split("\n"),i=1<a.length&&a[0].length<n[0].length;if(1===n.length||i)return"\n";for(var o=0,s=0;s<n.length;s++)"\n"===n[s][0]&&o++;return o>=n.length/2?"\r\n":"\r"}(a,l)),n=!1,e.delimiter)_(e.delimiter)&&(e.delimiter=e.delimiter(a),y.meta.delimiter=e.delimiter);else{var c=function(t,r,n,a,i){var s,l,c,u;i=i||[",","\t","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var f=0;f<i.length;f++){var p=i[f],h=0,d=0,g=0;c=void 0;for(var y=new m({comments:a,delimiter:p,newline:r,preview:10}).parse(t),v=0;v<y.data.length;v++)if(n&&x(y.data[v]))g++;else{var b=y.data[v].length;d+=b,void 0!==c?0<b&&(h+=Math.abs(b-c),c=b):c=b}0<y.data.length&&(d/=y.data.length-g),(void 0===l||h<=l)&&(void 0===u||u<d)&&1.99<d&&(l=h,s=p,u=d)}return{successful:!!(e.delimiter=s),bestDelimiter:s}}(a,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess);c.successful?e.delimiter=c.bestDelimiter:(n=!0,e.delimiter=o.DefaultDelimiter),y.meta.delimiter=e.delimiter}var u=b(e);return e.preview&&e.header&&u.preview++,t=a,r=new m(u),y=r.parse(t,i,s),w(),p?{meta:{paused:!0}}:y||{meta:{paused:!1}}},this.paused=function(){return p},this.pause=function(){p=!0,r.abort(),t=_(e.chunk)?"":t.substring(r.getCharIndex())},this.resume=function(){c.streamer._halted?(p=!1,c.streamer.parseChunk(t,!0)):setTimeout(c.resume,3)},this.aborted=function(){return h},this.abort=function(){h=!0,r.abort(),y.meta.aborted=!0,_(e.complete)&&e.complete(y),t=""}}function d(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){var t,r=(e=e||{}).delimiter,n=e.newline,a=e.comments,i=e.step,s=e.preview,l=e.fastMode,c=t=void 0===e.quoteChar?'"':e.quoteChar;if(void 0!==e.escapeChar&&(c=e.escapeChar),("string"!=typeof r||-1<o.BAD_DELIMITERS.indexOf(r))&&(r=","),a===r)throw new Error("Comment character same as delimiter");!0===a?a="#":("string"!=typeof a||-1<o.BAD_DELIMITERS.indexOf(a))&&(a=!1),"\n"!==n&&"\r"!==n&&"\r\n"!==n&&(n="\n");var u=0,f=!1;this.parse=function(e,o,p){if("string"!=typeof e)throw new Error("Input must be a string");var h=e.length,m=r.length,g=n.length,y=a.length,v=_(i),b=[],x=[],w=[],k=u=0;if(!e)return L();if(l||!1!==l&&-1===e.indexOf(t)){for(var D=e.split(n),T=0;T<D.length;T++){if(w=D[T],u+=w.length,T!==D.length-1)u+=n.length;else if(p)return L();if(!a||w.substring(0,y)!==a){if(v){if(b=[],O(w.split(r)),F(),f)return L()}else O(w.split(r));if(s&&s<=T)return b=b.slice(0,s),L(!0)}}return L()}for(var A=e.indexOf(r,u),S=e.indexOf(n,u),M=new RegExp(d(c)+d(t),"g"),E=e.indexOf(t,u);;)if(e[u]!==t)if(a&&0===w.length&&e.substring(u,u+y)===a){if(-1===S)return L();u=S+g,S=e.indexOf(n,u),A=e.indexOf(r,u)}else if(-1!==A&&(A<S||-1===S))w.push(e.substring(u,A)),u=A+m,A=e.indexOf(r,u);else{if(-1===S)break;if(w.push(e.substring(u,S)),R(S+g),v&&(F(),f))return L();if(s&&b.length>=s)return L(!0)}else for(E=u,u++;;){if(-1===(E=e.indexOf(t,E+1)))return p||x.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:b.length,index:u}),P();if(E===h-1)return P(e.substring(u,E).replace(M,t));if(t!==c||e[E+1]!==c){if(t===c||0===E||e[E-1]!==c){-1!==A&&A<E+1&&(A=e.indexOf(r,E+1)),-1!==S&&S<E+1&&(S=e.indexOf(n,E+1));var C=I(-1===S?A:Math.min(A,S));if(e[E+1+C]===r){w.push(e.substring(u,E).replace(M,t)),e[u=E+1+C+m]!==t&&(E=e.indexOf(t,u)),A=e.indexOf(r,u),S=e.indexOf(n,u);break}var N=I(S);if(e.substring(E+1+N,E+1+N+g)===n){if(w.push(e.substring(u,E).replace(M,t)),R(E+1+N+g),A=e.indexOf(r,u),E=e.indexOf(t,u),v&&(F(),f))return L();if(s&&b.length>=s)return L(!0);break}x.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:b.length,index:u}),E++}}else E++}return P();function O(e){b.push(e),k=u}function I(t){var r=0;if(-1!==t){var n=e.substring(E+1,t);n&&""===n.trim()&&(r=n.length)}return r}function P(t){return p||(void 0===t&&(t=e.substring(u)),w.push(t),u=h,O(w),v&&F()),L()}function R(t){u=t,O(w),w=[],S=e.indexOf(n,u)}function L(e){return{data:b,errors:x,meta:{delimiter:r,linebreak:n,aborted:f,truncated:!!e,cursor:k+(o||0)}}}function F(){i(L()),b=[],x=[]}},this.abort=function(){f=!0},this.getCharIndex=function(){return u}}function g(e){var t=e.data,r=a[t.workerId],n=!1;if(t.error)r.userError(t.error,t.file);else if(t.results&&t.results.data){var i={abort:function(){n=!0,y(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(_(r.userStep)){for(var o=0;o<t.results.data.length&&(r.userStep({data:t.results.data[o],errors:t.results.errors,meta:t.results.meta},i),!n);o++);delete t.results}else _(r.userChunk)&&(r.userChunk(t.results,i,t.file),delete t.results)}t.finished&&!n&&y(t.workerId,t.results)}function y(e,t){var r=a[e];_(r.userComplete)&&r.userComplete(t),r.terminate(),delete a[e]}function v(){throw new Error("Not implemented.")}function b(e){if("object"!=typeof e||null===e)return e;var t=Array.isArray(e)?[]:{};for(var r in e)t[r]=b(e[r]);return t}function x(e,t){return function(){e.apply(t,arguments)}}function _(e){return"function"==typeof e}return n&&(t.onmessage=function(e){var r=e.data;if(void 0===o.WORKER_ID&&r&&(o.WORKER_ID=r.workerId),"string"==typeof r.input)t.postMessage({workerId:o.WORKER_ID,results:o.parse(r.input,r.config),finished:!0});else if(t.File&&r.input instanceof File||r.input instanceof Object){var n=o.parse(r.input,r.config);n&&t.postMessage({workerId:o.WORKER_ID,results:n,finished:!0})}}),(c.prototype=Object.create(l.prototype)).constructor=c,(u.prototype=Object.create(l.prototype)).constructor=u,(f.prototype=Object.create(f.prototype)).constructor=f,(p.prototype=Object.create(l.prototype)).constructor=p,o},void 0===(n=r.apply(t,[]))||(e.exports=n)},30363:(e,t,r)=>{e.exports=function e(t,r,n){function a(o,s){if(!r[o]){if(!t[o]){if(i)return i(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return a(t[o][1][e]||e)}),c,c.exports,e,t,r,n)}return r[o].exports}for(var i=void 0,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(e,t,r){"use strict";var n=e("../src/lib"),a={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":503}],2:[function(e,t,r){"use strict";t.exports=e("../src/transforms/aggregate")},{"../src/transforms/aggregate":1114}],3:[function(e,t,r){"use strict";t.exports=e("../src/traces/bar")},{"../src/traces/bar":656}],4:[function(e,t,r){"use strict";t.exports=e("../src/traces/barpolar")},{"../src/traces/barpolar":669}],5:[function(e,t,r){"use strict";t.exports=e("../src/traces/box")},{"../src/traces/box":679}],6:[function(e,t,r){"use strict";t.exports=e("../src/components/calendars")},{"../src/components/calendars":364}],7:[function(e,t,r){"use strict";t.exports=e("../src/traces/candlestick")},{"../src/traces/candlestick":688}],8:[function(e,t,r){"use strict";t.exports=e("../src/traces/carpet")},{"../src/traces/carpet":707}],9:[function(e,t,r){"use strict";t.exports=e("../src/traces/choropleth")},{"../src/traces/choropleth":721}],10:[function(e,t,r){"use strict";t.exports=e("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":728}],11:[function(e,t,r){"use strict";t.exports=e("../src/traces/cone")},{"../src/traces/cone":734}],12:[function(e,t,r){"use strict";t.exports=e("../src/traces/contour")},{"../src/traces/contour":749}],13:[function(e,t,r){"use strict";t.exports=e("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":760}],14:[function(e,t,r){"use strict";t.exports=e("../src/core")},{"../src/core":481}],15:[function(e,t,r){"use strict";t.exports=e("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":768}],16:[function(e,t,r){"use strict";t.exports=e("../src/transforms/filter")},{"../src/transforms/filter":1115}],17:[function(e,t,r){"use strict";t.exports=e("../src/traces/funnel")},{"../src/traces/funnel":778}],18:[function(e,t,r){"use strict";t.exports=e("../src/traces/funnelarea")},{"../src/traces/funnelarea":787}],19:[function(e,t,r){"use strict";t.exports=e("../src/transforms/groupby")},{"../src/transforms/groupby":1116}],20:[function(e,t,r){"use strict";t.exports=e("../src/traces/heatmap")},{"../src/traces/heatmap":800}],21:[function(e,t,r){"use strict";t.exports=e("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":811}],22:[function(e,t,r){"use strict";t.exports=e("../src/traces/histogram")},{"../src/traces/histogram":823}],23:[function(e,t,r){"use strict";t.exports=e("../src/traces/histogram2d")},{"../src/traces/histogram2d":829}],24:[function(e,t,r){"use strict";t.exports=e("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":833}],25:[function(e,t,r){"use strict";t.exports=e("../src/traces/icicle")},{"../src/traces/icicle":839}],26:[function(e,t,r){"use strict";t.exports=e("../src/traces/image")},{"../src/traces/image":852}],27:[function(e,t,r){"use strict";var n=e("./core");n.register([e("./bar"),e("./box"),e("./heatmap"),e("./histogram"),e("./histogram2d"),e("./histogram2dcontour"),e("./contour"),e("./scatterternary"),e("./violin"),e("./funnel"),e("./waterfall"),e("./image"),e("./pie"),e("./sunburst"),e("./treemap"),e("./icicle"),e("./funnelarea"),e("./scatter3d"),e("./surface"),e("./isosurface"),e("./volume"),e("./mesh3d"),e("./cone"),e("./streamtube"),e("./scattergeo"),e("./choropleth"),e("./scattergl"),e("./splom"),e("./pointcloud"),e("./heatmapgl"),e("./parcoords"),e("./parcats"),e("./scattermapbox"),e("./choroplethmapbox"),e("./densitymapbox"),e("./sankey"),e("./indicator"),e("./table"),e("./carpet"),e("./scattercarpet"),e("./contourcarpet"),e("./ohlc"),e("./candlestick"),e("./scatterpolar"),e("./scatterpolargl"),e("./barpolar"),e("./scattersmith"),e("./aggregate"),e("./filter"),e("./groupby"),e("./sort"),e("./calendars")]),t.exports=n},{"./aggregate":2,"./bar":3,"./barpolar":4,"./box":5,"./calendars":6,"./candlestick":7,"./carpet":8,"./choropleth":9,"./choroplethmapbox":10,"./cone":11,"./contour":12,"./contourcarpet":13,"./core":14,"./densitymapbox":15,"./filter":16,"./funnel":17,"./funnelarea":18,"./groupby":19,"./heatmap":20,"./heatmapgl":21,"./histogram":22,"./histogram2d":23,"./histogram2dcontour":24,"./icicle":25,"./image":26,"./indicator":28,"./isosurface":29,"./mesh3d":30,"./ohlc":31,"./parcats":32,"./parcoords":33,"./pie":34,"./pointcloud":35,"./sankey":36,"./scatter3d":37,"./scattercarpet":38,"./scattergeo":39,"./scattergl":40,"./scattermapbox":41,"./scatterpolar":42,"./scatterpolargl":43,"./scattersmith":44,"./scatterternary":45,"./sort":46,"./splom":47,"./streamtube":48,"./sunburst":49,"./surface":50,"./table":51,"./treemap":52,"./violin":53,"./volume":54,"./waterfall":55}],28:[function(e,t,r){"use strict";t.exports=e("../src/traces/indicator")},{"../src/traces/indicator":860}],29:[function(e,t,r){"use strict";t.exports=e("../src/traces/isosurface")},{"../src/traces/isosurface":866}],30:[function(e,t,r){"use strict";t.exports=e("../src/traces/mesh3d")},{"../src/traces/mesh3d":871}],31:[function(e,t,r){"use strict";t.exports=e("../src/traces/ohlc")},{"../src/traces/ohlc":876}],32:[function(e,t,r){"use strict";t.exports=e("../src/traces/parcats")},{"../src/traces/parcats":885}],33:[function(e,t,r){"use strict";t.exports=e("../src/traces/parcoords")},{"../src/traces/parcoords":895}],34:[function(e,t,r){"use strict";t.exports=e("../src/traces/pie")},{"../src/traces/pie":906}],35:[function(e,t,r){"use strict";t.exports=e("../src/traces/pointcloud")},{"../src/traces/pointcloud":915}],36:[function(e,t,r){"use strict";t.exports=e("../src/traces/sankey")},{"../src/traces/sankey":921}],37:[function(e,t,r){"use strict";t.exports=e("../src/traces/scatter3d")},{"../src/traces/scatter3d":959}],38:[function(e,t,r){"use strict";t.exports=e("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":966}],39:[function(e,t,r){"use strict";t.exports=e("../src/traces/scattergeo")},{"../src/traces/scattergeo":974}],40:[function(e,t,r){"use strict";t.exports=e("../src/traces/scattergl")},{"../src/traces/scattergl":987}],41:[function(e,t,r){"use strict";t.exports=e("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":997}],42:[function(e,t,r){"use strict";t.exports=e("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":1005}],43:[function(e,t,r){"use strict";t.exports=e("../src/traces/scatterpolargl")},{"../src/traces/scatterpolargl":1012}],44:[function(e,t,r){"use strict";t.exports=e("../src/traces/scattersmith")},{"../src/traces/scattersmith":1019}],45:[function(e,t,r){"use strict";t.exports=e("../src/traces/scatterternary")},{"../src/traces/scatterternary":1027}],46:[function(e,t,r){"use strict";t.exports=e("../src/transforms/sort")},{"../src/transforms/sort":1118}],47:[function(e,t,r){"use strict";t.exports=e("../src/traces/splom")},{"../src/traces/splom":1036}],48:[function(e,t,r){"use strict";t.exports=e("../src/traces/streamtube")},{"../src/traces/streamtube":1044}],49:[function(e,t,r){"use strict";t.exports=e("../src/traces/sunburst")},{"../src/traces/sunburst":1052}],50:[function(e,t,r){"use strict";t.exports=e("../src/traces/surface")},{"../src/traces/surface":1061}],51:[function(e,t,r){"use strict";t.exports=e("../src/traces/table")},{"../src/traces/table":1069}],52:[function(e,t,r){"use strict";t.exports=e("../src/traces/treemap")},{"../src/traces/treemap":1080}],53:[function(e,t,r){"use strict";t.exports=e("../src/traces/violin")},{"../src/traces/violin":1093}],54:[function(e,t,r){"use strict";t.exports=e("../src/traces/volume")},{"../src/traces/volume":1101}],55:[function(e,t,r){"use strict";t.exports=e("../src/traces/waterfall")},{"../src/traces/waterfall":1109}],56:[function(e,t,r){var n,a;n=this,a=function(e,t,r,n,a){"use strict";function i(e){return e.target.depth}function o(e,t){return e.sourceLinks.length?e.depth:t-1}function s(e){return function(){return e}}a=a&&a.hasOwnProperty("default")?a.default:a;var l="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 c(e,t){return f(e.source,t.source)||e.index-t.index}function u(e,t){return f(e.target,t.target)||e.index-t.index}function f(e,t){return e.partOfCycle===t.partOfCycle?e.y0-t.y0:"top"===e.circularLinkType||"bottom"===t.circularLinkType?-1:1}function p(e){return e.value}function h(e){return(e.y0+e.y1)/2}function d(e){return h(e.source)}function m(e){return h(e.target)}function g(e){return e.index}function y(e){return e.nodes}function v(e){return e.links}function b(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function x(e,t){return t(e)}function _(e,t,r){var n=0;if(null===r){for(var i=[],o=0;o<e.links.length;o++){var s=e.links[o],l=s.source.index,c=s.target.index;i[l]||(i[l]=[]),i[c]||(i[c]=[]),-1===i[l].indexOf(c)&&i[l].push(c)}var u=a(i);u.sort((function(e,t){return e.length-t.length}));var f={};for(o=0;o<u.length;o++){var p=u[o].slice(-2);f[p[0]]||(f[p[0]]={}),f[p[0]][p[1]]=!0}e.links.forEach((function(e){var t=e.target.index,r=e.source.index;t===r||f[r]&&f[r][t]?(e.circular=!0,e.circularLinkID=n,n+=1):e.circular=!1}))}else e.links.forEach((function(e){e.source[r]<e.target[r]?e.circular=!1:(e.circular=!0,e.circularLinkID=n,n+=1)}))}function w(e,t){var r=0,n=0;e.links.forEach((function(a){a.circular&&(a.source.circularLinkType||a.target.circularLinkType?a.circularLinkType=a.source.circularLinkType?a.source.circularLinkType:a.target.circularLinkType:a.circularLinkType=r<n?"top":"bottom","top"==a.circularLinkType?r+=1:n+=1,e.nodes.forEach((function(e){x(e,t)!=x(a.source,t)&&x(e,t)!=x(a.target,t)||(e.circularLinkType=a.circularLinkType)})))})),e.links.forEach((function(e){e.circular&&(e.source.circularLinkType==e.target.circularLinkType&&(e.circularLinkType=e.source.circularLinkType),q(e,t)&&(e.circularLinkType=e.source.circularLinkType))}))}function k(e){var t=Math.abs(e.y1-e.y0),r=Math.abs(e.target.x0-e.source.x1);return Math.atan(r/t)}function D(e,t){var r=0;e.sourceLinks.forEach((function(e){r=e.circular&&!q(e,t)?r+1:r}));var n=0;return e.targetLinks.forEach((function(e){n=e.circular&&!q(e,t)?n+1:n})),r+n}function T(e){var t=e.source.sourceLinks,r=0;t.forEach((function(e){r=e.circular?r+1:r}));var n=e.target.targetLinks,a=0;return n.forEach((function(e){a=e.circular?a+1:a})),!(r>1||a>1)}function A(e,t,r){return e.sort(M),e.forEach((function(n,a){var i,o,s=0;if(q(n,r)&&T(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;l<a;l++)if(i=e[a],o=e[l],!(i.source.column<o.target.column||i.target.column>o.source.column)){var c=e[l].circularPathData.verticalBuffer+e[l].width/2+t;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),e}function S(e,r,a,i){var o=t.min(e.links,(function(e){return e.source.y0}));e.links.forEach((function(e){e.circular&&(e.circularPathData={})})),A(e.links.filter((function(e){return"top"==e.circularLinkType})),r,i),A(e.links.filter((function(e){return"bottom"==e.circularLinkType})),r,i),e.links.forEach((function(t){if(t.circular){if(t.circularPathData.arcRadius=t.width+10,t.circularPathData.leftNodeBuffer=5,t.circularPathData.rightNodeBuffer=5,t.circularPathData.sourceWidth=t.source.x1-t.source.x0,t.circularPathData.sourceX=t.source.x0+t.circularPathData.sourceWidth,t.circularPathData.targetX=t.target.x0,t.circularPathData.sourceY=t.y0,t.circularPathData.targetY=t.y1,q(t,i)&&T(t))t.circularPathData.leftSmallArcRadius=10+t.width/2,t.circularPathData.leftLargeArcRadius=10+t.width/2,t.circularPathData.rightSmallArcRadius=10+t.width/2,t.circularPathData.rightLargeArcRadius=10+t.width/2,"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=t.source.y1+25+t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius):(t.circularPathData.verticalFullExtent=t.source.y0-25-t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius);else{var s=t.source.column,l=t.circularLinkType,c=e.links.filter((function(e){return e.source.column==s&&e.circularLinkType==l}));"bottom"==t.circularLinkType?c.sort(C):c.sort(E);var u=0;c.forEach((function(e,n){e.circularLinkID==t.circularLinkID&&(t.circularPathData.leftSmallArcRadius=10+t.width/2+u,t.circularPathData.leftLargeArcRadius=10+t.width/2+n*r+u),u+=e.width})),s=t.target.column,c=e.links.filter((function(e){return e.target.column==s&&e.circularLinkType==l})),"bottom"==t.circularLinkType?c.sort(O):c.sort(N),u=0,c.forEach((function(e,n){e.circularLinkID==t.circularLinkID&&(t.circularPathData.rightSmallArcRadius=10+t.width/2+u,t.circularPathData.rightLargeArcRadius=10+t.width/2+n*r+u),u+=e.width})),"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=Math.max(a,t.source.y1,t.target.y1)+25+t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius):(t.circularPathData.verticalFullExtent=o-25-t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius)}t.circularPathData.leftInnerExtent=t.circularPathData.sourceX+t.circularPathData.leftNodeBuffer,t.circularPathData.rightInnerExtent=t.circularPathData.targetX-t.circularPathData.rightNodeBuffer,t.circularPathData.leftFullExtent=t.circularPathData.sourceX+t.circularPathData.leftLargeArcRadius+t.circularPathData.leftNodeBuffer,t.circularPathData.rightFullExtent=t.circularPathData.targetX-t.circularPathData.rightLargeArcRadius-t.circularPathData.rightNodeBuffer}if(t.circular)t.path=function(e){return"top"==e.circularLinkType?"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 0 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY-e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 0 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 0 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY-e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 0 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY:"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 1 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY+e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 1 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 1 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY+e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 1 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY}(t);else{var f=n.linkHorizontal().source((function(e){return[e.source.x0+(e.source.x1-e.source.x0),e.y0]})).target((function(e){return[e.target.x0,e.y1]}));t.path=f(t)}}))}function M(e,t){return I(e)==I(t)?"bottom"==e.circularLinkType?C(e,t):E(e,t):I(t)-I(e)}function E(e,t){return e.y0-t.y0}function C(e,t){return t.y0-e.y0}function N(e,t){return e.y1-t.y1}function O(e,t){return t.y1-e.y1}function I(e){return e.target.column-e.source.column}function P(e){return e.target.x0-e.source.x1}function R(e,t){var r=k(e),n=P(t)/Math.tan(r);return"up"==V(e)?e.y1+n:e.y1-n}function L(e,t){var r=k(e),n=P(t)/Math.tan(r);return"up"==V(e)?e.y1-n:e.y1+n}function F(e,t,r,n){e.links.forEach((function(a){if(!a.circular&&a.target.column-a.source.column>1){var i=a.source.column+1,o=a.target.column-1,s=1,l=o-i+1;for(s=1;i<=o;i++,s++)e.nodes.forEach((function(o){if(o.column==i){var c,u=s/(l+1),f=Math.pow(1-u,3),p=3*u*Math.pow(1-u,2),h=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),m=f*a.y0+p*a.y0+h*a.y1+d*a.y1,g=m-a.width/2,y=m+a.width/2;g>o.y0&&g<o.y1?(c=o.y1-g+10,c="bottom"==o.circularLinkType?c:-c,o=z(o,c,t,r),e.nodes.forEach((function(e){x(e,n)!=x(o,n)&&e.column==o.column&&B(o,e)&&z(e,c,t,r)}))):(y>o.y0&&y<o.y1||g<o.y0&&y>o.y1)&&(c=y-o.y0+10,o=z(o,c,t,r),e.nodes.forEach((function(e){x(e,n)!=x(o,n)&&e.column==o.column&&e.y0<o.y1&&e.y1>o.y1&&z(e,c,t,r)})))}}))}}))}function B(e,t){return e.y0>t.y0&&e.y0<t.y1||e.y1>t.y0&&e.y1<t.y1||e.y0<t.y0&&e.y1>t.y1}function z(e,t,r,n){return e.y0+t>=r&&e.y1+t<=n&&(e.y0=e.y0+t,e.y1=e.y1+t,e.targetLinks.forEach((function(e){e.y1=e.y1+t})),e.sourceLinks.forEach((function(e){e.y0=e.y0+t}))),e}function j(e,t,r,n){e.nodes.forEach((function(a){n&&a.y+(a.y1-a.y0)>t&&(a.y=a.y-(a.y+(a.y1-a.y0)-t));var i=e.links.filter((function(e){return x(e.source,r)==x(a,r)})),o=i.length;o>1&&i.sort((function(e,t){if(!e.circular&&!t.circular){if(e.target.column==t.target.column)return e.y1-t.y1;if(!$(e,t))return e.y1-t.y1;if(e.target.column>t.target.column){var r=L(t,e);return e.y1-r}if(t.target.column>e.target.column)return L(e,t)-t.y1}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.target.column===t.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.target.column===t.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:"top"==e.circularLinkType?-1:1:void 0}));var s=a.y0;i.forEach((function(e){e.y0=s+e.width/2,s+=e.width})),i.forEach((function(e,t){if("bottom"==e.circularLinkType){for(var r=t+1,n=0;r<o;r++)n+=i[r].width;e.y0=a.y1-n-e.width/2}}))}))}function U(e,t,r){e.nodes.forEach((function(t){var n=e.links.filter((function(e){return x(e.target,r)==x(t,r)})),a=n.length;a>1&&n.sort((function(e,t){if(!e.circular&&!t.circular){if(e.source.column==t.source.column)return e.y0-t.y0;if(!$(e,t))return e.y0-t.y0;if(t.source.column<e.source.column){var r=R(t,e);return e.y0-r}if(e.source.column<t.source.column)return R(e,t)-t.y0}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.source.column===t.source.column?e.source.y1-t.source.y1:e.source.column-t.source.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.source.column===t.source.column?e.source.y1-t.source.y1:t.source.column-e.source.column:"top"==e.circularLinkType?-1:1:void 0}));var i=t.y0;n.forEach((function(e){e.y1=i+e.width/2,i+=e.width})),n.forEach((function(e,r){if("bottom"==e.circularLinkType){for(var i=r+1,o=0;i<a;i++)o+=n[i].width;e.y1=t.y1-o-e.width/2}}))}))}function $(e,t){return V(e)==V(t)}function V(e){return e.y0-e.y1>0?"up":"down"}function q(e,t){return x(e.source,t)==x(e.target,t)}function W(e,r,n){var a=e.nodes,i=e.links,o=!1,s=!1;if(i.forEach((function(e){"top"==e.circularLinkType?o=!0:"bottom"==e.circularLinkType&&(s=!0)})),0==o||0==s){var l=t.min(a,(function(e){return e.y0})),c=(n-r)/(t.max(a,(function(e){return e.y1}))-l);a.forEach((function(e){var t=(e.y1-e.y0)*c;e.y0=(e.y0-l)*c,e.y1=e.y0+t})),i.forEach((function(e){e.y0=(e.y0-l)*c,e.y1=(e.y1-l)*c,e.width=e.width*c}))}}e.sankeyCircular=function(){var e,n,a=0,i=0,x=1,k=1,T=24,A=g,M=o,E=y,C=v,N=32,O=2,I=null;function P(){var e={nodes:E.apply(null,arguments),links:C.apply(null,arguments)};R(e),_(e,0,I),L(e),B(e),w(e,A),z(e,N,A),$(e);for(var t=4,r=0;r<t;r++)j(e,k,A),U(e,0,A),F(e,i,k,A),j(e,k,A),U(e,0,A);return W(e,i,k),S(e,O,k,A),e}function R(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=r.map(e.nodes,A);return e.links.forEach((function(e,r){e.index=r;var n=e.source,a=e.target;"object"!==(void 0===n?"undefined":l(n))&&(n=e.source=b(t,n)),"object"!==(void 0===a?"undefined":l(a))&&(a=e.target=b(t,a)),n.sourceLinks.push(e),a.targetLinks.push(e)})),e}function L(e){e.nodes.forEach((function(e){e.partOfCycle=!1,e.value=Math.max(t.sum(e.sourceLinks,p),t.sum(e.targetLinks,p)),e.sourceLinks.forEach((function(t){t.circular&&(e.partOfCycle=!0,e.circularLinkType=t.circularLinkType)})),e.targetLinks.forEach((function(t){t.circular&&(e.partOfCycle=!0,e.circularLinkType=t.circularLinkType)}))}))}function B(e){var t,r,n;for(t=e.nodes,r=[],n=0;t.length;++n,t=r,r=[])t.forEach((function(e){e.depth=n,e.sourceLinks.forEach((function(e){r.indexOf(e.target)<0&&!e.circular&&r.push(e.target)}))}));for(t=e.nodes,r=[],n=0;t.length;++n,t=r,r=[])t.forEach((function(e){e.height=n,e.targetLinks.forEach((function(e){r.indexOf(e.source)<0&&!e.circular&&r.push(e.source)}))}));e.nodes.forEach((function(e){e.column=Math.floor(M.call(null,e,n))}))}function z(o,s,l){var c=r.nest().key((function(e){return e.column})).sortKeys(t.ascending).entries(o.nodes).map((function(e){return e.values}));!function(r){if(n){var s=1/0;c.forEach((function(e){var t=k*n/(e.length+1);s=t<s?t:s})),e=s}var l=t.min(c,(function(r){return(k-i-(r.length-1)*e)/t.sum(r,p)}));l*=.3,o.links.forEach((function(e){e.width=e.value*l}));var u=function(e){var r=0,n=0,a=0,i=0,o=t.max(e.nodes,(function(e){return e.column}));return e.links.forEach((function(e){e.circular&&("top"==e.circularLinkType?r+=e.width:n+=e.width,0==e.target.column&&(i+=e.width),e.source.column==o&&(a+=e.width))})),{top:r=r>0?r+25+10:r,bottom:n=n>0?n+25+10:n,left:i=i>0?i+25+10:i,right:a=a>0?a+25+10:a}}(o),f=function(e,r){var n=t.max(e.nodes,(function(e){return e.column})),o=x-a,s=k-i,l=o/(o+r.right+r.left),c=s/(s+r.top+r.bottom);return a=a*l+r.left,x=0==r.right?x:x*l,i=i*c+r.top,k*=c,e.nodes.forEach((function(e){e.x0=a+e.column*((x-a-T)/n),e.x1=e.x0+T})),c}(o,u);l*=f,o.links.forEach((function(e){e.width=e.value*l})),c.forEach((function(e){var t=e.length;e.forEach((function(e,n){e.depth==c.length-1&&1==t||0==e.depth&&1==t?(e.y0=k/2-e.value*l,e.y1=e.y0+e.value*l):e.partOfCycle?0==D(e,r)?(e.y0=k/2+n,e.y1=e.y0+e.value*l):"top"==e.circularLinkType?(e.y0=i+n,e.y1=e.y0+e.value*l):(e.y0=k-e.value*l-n,e.y1=e.y0+e.value*l):0==u.top||0==u.bottom?(e.y0=(k-i)/t*n,e.y1=e.y0+e.value*l):(e.y0=(k-i)/2-t/2+n,e.y1=e.y0+e.value*l)}))}))}(l),v();for(var u=1,g=s;g>0;--g)y(u*=.99,l),v();function y(e,r){var n=c.length;c.forEach((function(a){var i=a.length,o=a[0].depth;a.forEach((function(a){var s;if(a.sourceLinks.length||a.targetLinks.length)if(a.partOfCycle&&D(a,r)>0);else if(0==o&&1==i)s=a.y1-a.y0,a.y0=k/2-s/2,a.y1=k/2+s/2;else if(o==n-1&&1==i)s=a.y1-a.y0,a.y0=k/2-s/2,a.y1=k/2+s/2;else{var l=t.mean(a.sourceLinks,m),c=t.mean(a.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-h(a))*e;a.y0+=u,a.y1+=u}}))}))}function v(){c.forEach((function(t){var r,n,a,o=i,s=t.length;for(t.sort(f),a=0;a<s;++a)(n=o-(r=t[a]).y0)>0&&(r.y0+=n,r.y1+=n),o=r.y1+e;if((n=o-e-k)>0)for(o=r.y0-=n,r.y1-=n,a=s-2;a>=0;--a)(n=(r=t[a]).y1+e-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}function $(e){e.nodes.forEach((function(e){e.sourceLinks.sort(u),e.targetLinks.sort(c)})),e.nodes.forEach((function(e){var t=e.y0,r=t,n=e.y1,a=n;e.sourceLinks.forEach((function(e){e.circular?(e.y0=n-e.width/2,n-=e.width):(e.y0=t+e.width/2,t+=e.width)})),e.targetLinks.forEach((function(e){e.circular?(e.y1=a-e.width/2,a-=e.width):(e.y1=r+e.width/2,r+=e.width)}))}))}return P.nodeId=function(e){return arguments.length?(A="function"==typeof e?e:s(e),P):A},P.nodeAlign=function(e){return arguments.length?(M="function"==typeof e?e:s(e),P):M},P.nodeWidth=function(e){return arguments.length?(T=+e,P):T},P.nodePadding=function(t){return arguments.length?(e=+t,P):e},P.nodes=function(e){return arguments.length?(E="function"==typeof e?e:s(e),P):E},P.links=function(e){return arguments.length?(C="function"==typeof e?e:s(e),P):C},P.size=function(e){return arguments.length?(a=i=0,x=+e[0],k=+e[1],P):[x-a,k-i]},P.extent=function(e){return arguments.length?(a=+e[0][0],x=+e[1][0],i=+e[0][1],k=+e[1][1],P):[[a,i],[x,k]]},P.iterations=function(e){return arguments.length?(N=+e,P):N},P.circularLinkGap=function(e){return arguments.length?(O=+e,P):O},P.nodePaddingRatio=function(e){return arguments.length?(n=+e,P):n},P.sortNodes=function(e){return arguments.length?(I=e,P):I},P.update=function(e){return w(e,A),$(e),e.links.forEach((function(e){e.circular&&(e.circularLinkType=e.y0+e.y1<k?"top":"bottom",e.source.circularLinkType=e.circularLinkType,e.target.circularLinkType=e.circularLinkType)})),j(e,k,A,!1),U(e,0,A),S(e,O,k,A),e},P},e.sankeyCenter=function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?t.min(e.sourceLinks,i)-1:0},e.sankeyLeft=function(e){return e.depth},e.sankeyRight=function(e,t){return t-1-e.height},e.sankeyJustify=o,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof r&&void 0!==t?a(r,e("d3-array"),e("d3-collection"),e("d3-shape"),e("elementary-circuits-directed-graph")):a(n.d3=n.d3||{},n.d3,n.d3,n.d3,null)},{"d3-array":107,"d3-collection":108,"d3-shape":119,"elementary-circuits-directed-graph":130}],57:[function(e,t,r){var n,a;n=this,a=function(e,t,r,n){"use strict";function a(e){return e.target.depth}function i(e,t){return e.sourceLinks.length?e.depth:t-1}function o(e){return function(){return e}}function s(e,t){return c(e.source,t.source)||e.index-t.index}function l(e,t){return c(e.target,t.target)||e.index-t.index}function c(e,t){return e.y0-t.y0}function u(e){return e.value}function f(e){return(e.y0+e.y1)/2}function p(e){return f(e.source)*e.value}function h(e){return f(e.target)*e.value}function d(e){return e.index}function m(e){return e.nodes}function g(e){return e.links}function y(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function v(e){return[e.source.x1,e.y0]}function b(e){return[e.target.x0,e.y1]}e.sankey=function(){var e=0,n=0,a=1,v=1,b=24,x=8,_=d,w=i,k=m,D=g,T=32;function A(){var e={nodes:k.apply(null,arguments),links:D.apply(null,arguments)};return S(e),M(e),E(e),C(e),N(e),e}function S(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=r.map(e.nodes,_);e.links.forEach((function(e,r){e.index=r;var n=e.source,a=e.target;"object"!=typeof n&&(n=e.source=y(t,n)),"object"!=typeof a&&(a=e.target=y(t,a)),n.sourceLinks.push(e),a.targetLinks.push(e)}))}function M(e){e.nodes.forEach((function(e){e.value=Math.max(t.sum(e.sourceLinks,u),t.sum(e.targetLinks,u))}))}function E(t){var r,n,i;for(r=t.nodes,n=[],i=0;r.length;++i,r=n,n=[])r.forEach((function(e){e.depth=i,e.sourceLinks.forEach((function(e){n.indexOf(e.target)<0&&n.push(e.target)}))}));for(r=t.nodes,n=[],i=0;r.length;++i,r=n,n=[])r.forEach((function(e){e.height=i,e.targetLinks.forEach((function(e){n.indexOf(e.source)<0&&n.push(e.source)}))}));var o=(a-e-b)/(i-1);t.nodes.forEach((function(t){t.x1=(t.x0=e+Math.max(0,Math.min(i-1,Math.floor(w.call(null,t,i))))*o)+b}))}function C(e){var a=r.nest().key((function(e){return e.x0})).sortKeys(t.ascending).entries(e.nodes).map((function(e){return e.values}));!function(){var r=t.max(a,(function(e){return e.length})),i=2/3*(v-n)/(r-1);x>i&&(x=i);var o=t.min(a,(function(e){return(v-n-(e.length-1)*x)/t.sum(e,u)}));a.forEach((function(e){e.forEach((function(e,t){e.y1=(e.y0=t)+e.value*o}))})),e.links.forEach((function(e){e.width=e.value*o}))}(),d();for(var i=1,o=T;o>0;--o)l(i*=.99),d(),s(i),d();function s(e){a.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(t.sum(r.targetLinks,p)/t.sum(r.targetLinks,u)-f(r))*e;r.y0+=n,r.y1+=n}}))}))}function l(e){a.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(t.sum(r.sourceLinks,h)/t.sum(r.sourceLinks,u)-f(r))*e;r.y0+=n,r.y1+=n}}))}))}function d(){a.forEach((function(e){var t,r,a,i=n,o=e.length;for(e.sort(c),a=0;a<o;++a)(r=i-(t=e[a]).y0)>0&&(t.y0+=r,t.y1+=r),i=t.y1+x;if((r=i-x-v)>0)for(i=t.y0-=r,t.y1-=r,a=o-2;a>=0;--a)(r=(t=e[a]).y1+x-i)>0&&(t.y0-=r,t.y1-=r),i=t.y0}))}}function N(e){e.nodes.forEach((function(e){e.sourceLinks.sort(l),e.targetLinks.sort(s)})),e.nodes.forEach((function(e){var t=e.y0,r=t;e.sourceLinks.forEach((function(e){e.y0=t+e.width/2,t+=e.width})),e.targetLinks.forEach((function(e){e.y1=r+e.width/2,r+=e.width}))}))}return A.update=function(e){return N(e),e},A.nodeId=function(e){return arguments.length?(_="function"==typeof e?e:o(e),A):_},A.nodeAlign=function(e){return arguments.length?(w="function"==typeof e?e:o(e),A):w},A.nodeWidth=function(e){return arguments.length?(b=+e,A):b},A.nodePadding=function(e){return arguments.length?(x=+e,A):x},A.nodes=function(e){return arguments.length?(k="function"==typeof e?e:o(e),A):k},A.links=function(e){return arguments.length?(D="function"==typeof e?e:o(e),A):D},A.size=function(t){return arguments.length?(e=n=0,a=+t[0],v=+t[1],A):[a-e,v-n]},A.extent=function(t){return arguments.length?(e=+t[0][0],a=+t[1][0],n=+t[0][1],v=+t[1][1],A):[[e,n],[a,v]]},A.iterations=function(e){return arguments.length?(T=+e,A):T},A},e.sankeyCenter=function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?t.min(e.sourceLinks,a)-1:0},e.sankeyLeft=function(e){return e.depth},e.sankeyRight=function(e,t){return t-1-e.height},e.sankeyJustify=i,e.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(v).target(b)},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof r&&void 0!==t?a(r,e("d3-array"),e("d3-collection"),e("d3-shape")):a(n.d3=n.d3||{},n.d3,n.d3,n.d3)},{"d3-array":107,"d3-collection":108,"d3-shape":119}],58:[function(e,t,r){(function(){var e={version:"3.8.0"},r=[].slice,n=function(e){return r.call(e)},a=self.document;function i(e){return e&&(e.ownerDocument||e.document||e).documentElement}function o(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(e){n=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;s.setAttribute=function(e,t){l.call(this,e,t+"")},s.setAttributeNS=function(e,t,r){c.call(this,e,t,r+"")},u.setProperty=function(e,t,r){f.call(this,e,t+"",r)}}function p(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function h(e){return null===e?NaN:+e}function d(e){return!isNaN(e)}function m(e){return{left:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n<a;){var i=n+a>>>1;e(t[i],r)<0?n=i+1:a=i}return n},right:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n<a;){var i=n+a>>>1;e(t[i],r)>0?a=i:n=i+1}return n}}}e.ascending=p,e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.min=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=e[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=e[a])&&r>n&&(r=n)}else{for(;++a<i;)if(null!=(n=t.call(e,e[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=t.call(e,e[a],a))&&r>n&&(r=n)}return r},e.max=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=e[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=e[a])&&n>r&&(r=n)}else{for(;++a<i;)if(null!=(n=t.call(e,e[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=t.call(e,e[a],a))&&n>r&&(r=n)}return r},e.extent=function(e,t){var r,n,a,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=e[i])&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=e[i])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++i<o;)if(null!=(n=t.call(e,e[i],i))&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=t.call(e,e[i],i))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},e.sum=function(e,t){var r,n=0,a=e.length,i=-1;if(1===arguments.length)for(;++i<a;)d(r=+e[i])&&(n+=r);else for(;++i<a;)d(r=+t.call(e,e[i],i))&&(n+=r);return n},e.mean=function(e,t){var r,n=0,a=e.length,i=-1,o=a;if(1===arguments.length)for(;++i<a;)d(r=h(e[i]))?n+=r:--o;else for(;++i<a;)d(r=h(t.call(e,e[i],i)))?n+=r:--o;if(o)return n/o},e.quantile=function(e,t){var r=(e.length-1)*t+1,n=Math.floor(r),a=+e[n-1],i=r-n;return i?a+i*(e[n]-a):a},e.median=function(t,r){var n,a=[],i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)d(n=h(t[o]))&&a.push(n);else for(;++o<i;)d(n=h(r.call(t,t[o],o)))&&a.push(n);if(a.length)return e.quantile(a.sort(p),.5)},e.variance=function(e,t){var r,n,a=e.length,i=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<a;)d(r=h(e[s]))&&(o+=(n=r-i)*(r-(i+=n/++l)));else for(;++s<a;)d(r=h(t.call(e,e[s],s)))&&(o+=(n=r-i)*(r-(i+=n/++l)));if(l>1)return o/(l-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t?Math.sqrt(t):t};var g=m(p);function y(e){return e.length}e.bisectLeft=g.left,e.bisect=e.bisectRight=g.right,e.bisector=function(e){return m(1===e.length?function(t,r){return p(e(t),r)}:e)},e.shuffle=function(e,t,r){(i=arguments.length)<3&&(r=e.length,i<2&&(t=0));for(var n,a,i=r-t;i;)a=Math.random()*i--|0,n=e[i+t],e[i+t]=e[a+t],e[a+t]=n;return e},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],a=new Array(r<0?0:r);t<r;)a[t]=[n,n=e[++t]];return a},e.transpose=function(t){if(!(i=t.length))return[];for(var r=-1,n=e.min(t,y),a=new Array(n);++r<n;)for(var i,o=-1,s=a[r]=new Array(i);++o<i;)s[o]=t[o][r];return a},e.zip=function(){return e.transpose(arguments)},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t},e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.entries=function(e){var t=[];for(var r in e)t.push({key:r,value:e[r]});return t},e.merge=function(e){for(var t,r,n,a=e.length,i=-1,o=0;++i<a;)o+=e[i].length;for(r=new Array(o);--a>=0;)for(t=(n=e[a]).length;--t>=0;)r[--o]=n[t];return r};var v=Math.abs;function b(e){for(var t=1;e*t%1;)t*=10;return t}function x(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function _(){this._=Object.create(null)}function w(e){return"__proto__"==(e+="")||"\0"===e[0]?"\0"+e:e}function k(e){return"\0"===(e+="")[0]?e.slice(1):e}function D(e){return w(e)in this._}function T(e){return(e=w(e))in this._&&delete this._[e]}function A(){var e=[];for(var t in this._)e.push(k(t));return e}function S(){var e=0;for(var t in this._)++e;return e}function M(){for(var e in this._)return!1;return!0}function E(){this._=Object.create(null)}function C(e){return e}function N(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}function O(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var r=0,n=I.length;r<n;++r){var a=I[r]+t;if(a in e)return a}}e.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r==1/0)throw new Error("infinite range");var n,a=[],i=b(v(r)),o=-1;if(e*=i,t*=i,(r*=i)<0)for(;(n=e+r*++o)>t;)a.push(n/i);else for(;(n=e+r*++o)<t;)a.push(n/i);return a},e.map=function(e,t){var r=new _;if(e instanceof _)e.forEach((function(e,t){r.set(e,t)}));else if(Array.isArray(e)){var n,a=-1,i=e.length;if(1===arguments.length)for(;++a<i;)r.set(a,e[a]);else for(;++a<i;)r.set(t.call(e,n=e[a],a),n)}else for(var o in e)r.set(o,e[o]);return r},x(_,{has:D,get:function(e){return this._[w(e)]},set:function(e,t){return this._[w(e)]=t},remove:T,keys:A,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:k(t),value:this._[t]});return e},size:S,empty:M,forEach:function(e){for(var t in this._)e.call(this,k(t),this._[t])}}),e.nest=function(){var t,r,n={},a=[],i=[];function o(e,i,s){if(s>=a.length)return r?r.call(n,i):t?i.sort(t):i;for(var l,c,u,f,p=-1,h=i.length,d=a[s++],m=new _;++p<h;)(f=m.get(l=d(c=i[p])))?f.push(c):m.set(l,[c]);return e?(c=e(),u=function(t,r){c.set(t,o(e,r,s))}):(c={},u=function(t,r){c[t]=o(e,r,s)}),m.forEach(u),c}return n.map=function(e,t){return o(t,e,0)},n.entries=function(t){return function e(t,r){if(r>=a.length)return t;var n=[],o=i[r++];return t.forEach((function(t,a){n.push({key:t,values:e(a,r)})})),o?n.sort((function(e,t){return o(e.key,t.key)})):n}(o(e.map,t,0),0)},n.key=function(e){return a.push(e),n},n.sortKeys=function(e){return i[a.length-1]=e,n},n.sortValues=function(e){return t=e,n},n.rollup=function(e){return r=e,n},n},e.set=function(e){var t=new E;if(e)for(var r=0,n=e.length;r<n;++r)t.add(e[r]);return t},x(E,{has:D,add:function(e){return this._[w(e+="")]=!0,e},remove:T,values:A,size:S,empty:M,forEach:function(e){for(var t in this._)e.call(this,k(t))}}),e.behavior={},e.rebind=function(e,t){for(var r,n=1,a=arguments.length;++n<a;)e[r=arguments[n]]=N(e,t,t[r]);return e};var I=["webkit","ms","moz","Moz","o","O"];function P(){}function R(){}function L(e){var t=[],r=new _;function n(){for(var r,n=t,a=-1,i=n.length;++a<i;)(r=n[a].on)&&r.apply(this,arguments);return e}return n.on=function(n,a){var i,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,t=t.slice(0,i=t.indexOf(o)).concat(t.slice(i+1)),r.remove(n)),a&&t.push(r.set(n,{on:a})),e)},n}function F(){e.event.preventDefault()}function B(){for(var t,r=e.event;t=r.sourceEvent;)r=t;return r}function z(t){for(var r=new R,n=0,a=arguments.length;++n<a;)r[arguments[n]]=L(r);return r.of=function(n,a){return function(i){try{var o=i.sourceEvent=e.event;i.target=t,e.event=i,r[i.type].apply(n,a)}finally{e.event=o}}},r}e.dispatch=function(){for(var e=new R,t=-1,r=arguments.length;++t<r;)e[arguments[t]]=L(e);return e},R.prototype.on=function(e,t){var r=e.indexOf("."),n="";if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},e.event=null,e.requote=function(e){return e.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function $(e){return U(e,H),e}var V=function(e,t){return t.querySelector(e)},q=function(e,t){return t.querySelectorAll(e)},W=function(e,t){var r=e.matches||e[O(e,"matchesSelector")];return(W=function(e,t){return r.call(e,t)})(e,t)};"function"==typeof Sizzle&&(V=function(e,t){return Sizzle(e,t)[0]||null},q=Sizzle,W=Sizzle.matchesSelector),e.selection=function(){return e.select(a.documentElement)};var H=e.selection.prototype=[];function G(e){return"function"==typeof e?e:function(){return V(e,this)}}function X(e){return"function"==typeof e?e:function(){return q(e,this)}}H.select=function(e){var t,r,n,a,i=[];e=G(e);for(var o=-1,s=this.length;++o<s;){i.push(t=[]),t.parentNode=(n=this[o]).parentNode;for(var l=-1,c=n.length;++l<c;)(a=n[l])?(t.push(r=e.call(a,a.__data__,l,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):t.push(null)}return $(i)},H.selectAll=function(e){var t,r,a=[];e=X(e);for(var i=-1,o=this.length;++i<o;)for(var s=this[i],l=-1,c=s.length;++l<c;)(r=s[l])&&(a.push(t=n(e.call(r,r.__data__,l,i))),t.parentNode=r);return $(a)};var Y="http://www.w3.org/1999/xhtml",Z={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function K(t,r){return t=e.ns.qualify(t),null==r?t.local?function(){this.removeAttributeNS(t.space,t.local)}:function(){this.removeAttribute(t)}:"function"==typeof r?t.local?function(){var e=r.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}:function(){var e=r.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}:t.local?function(){this.setAttributeNS(t.space,t.local,r)}:function(){this.setAttribute(t,r)}}function J(e){return e.trim().replace(/\s+/g," ")}function Q(t){return new RegExp("(?:^|\\s+)"+e.requote(t)+"(?:\\s+|$)","g")}function ee(e){return(e+"").trim().split(/^|\s+/)}function te(e,t){var r=(e=ee(e).map(re)).length;return"function"==typeof t?function(){for(var n=-1,a=t.apply(this,arguments);++n<r;)e[n](this,a)}:function(){for(var n=-1;++n<r;)e[n](this,t)}}function re(e){var t=Q(e);return function(r,n){if(a=r.classList)return n?a.add(e):a.remove(e);var a=r.getAttribute("class")||"";n?(t.lastIndex=0,t.test(a)||r.setAttribute("class",J(a+" "+e))):r.setAttribute("class",J(a.replace(t," ")))}}function ne(e,t,r){return null==t?function(){this.style.removeProperty(e)}:"function"==typeof t?function(){var n=t.apply(this,arguments);null==n?this.style.removeProperty(e):this.style.setProperty(e,n,r)}:function(){this.style.setProperty(e,t,r)}}function ae(e,t){return null==t?function(){delete this[e]}:"function"==typeof t?function(){var r=t.apply(this,arguments);null==r?delete this[e]:this[e]=r}:function(){this[e]=t}}function ie(t){return"function"==typeof t?t:(t=e.ns.qualify(t)).local?function(){return this.ownerDocument.createElementNS(t.space,t.local)}:function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Y&&e.documentElement.namespaceURI===Y?e.createElement(t):e.createElementNS(r,t)}}function oe(){var e=this.parentNode;e&&e.removeChild(this)}function se(e){return{__data__:e}}function le(e){return function(){return W(this,e)}}function ce(e){return arguments.length||(e=p),function(t,r){return t&&r?e(t.__data__,r.__data__):!t-!r}}function ue(e,t){for(var r=0,n=e.length;r<n;r++)for(var a,i=e[r],o=0,s=i.length;o<s;o++)(a=i[o])&&t(a,o,r);return e}function fe(e){return U(e,pe),e}e.ns={prefix:Z,qualify:function(e){var t=e.indexOf(":"),r=e;return t>=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),Z.hasOwnProperty(r)?{space:Z[r],local:e}:e}},H.attr=function(t,r){if(arguments.length<2){if("string"==typeof t){var n=this.node();return(t=e.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(r in t)this.each(K(r,t[r]));return this}return this.each(K(t,r))},H.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var r=this.node(),n=(e=ee(e)).length,a=-1;if(t=r.classList){for(;++a<n;)if(!t.contains(e[a]))return!1}else for(t=r.getAttribute("class");++a<n;)if(!Q(e[a]).test(t))return!1;return!0}for(t in e)this.each(te(t,e[t]));return this}return this.each(te(e,t))},H.style=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=""),e)this.each(ne(r,e[r],t));return this}if(n<2){var a=this.node();return o(a).getComputedStyle(a,null).getPropertyValue(e)}r=""}return this.each(ne(e,t,r))},H.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(ae(t,e[t]));return this}return this.each(ae(e,t))},H.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},H.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},H.append=function(e){return e=ie(e),this.select((function(){return this.appendChild(e.apply(this,arguments))}))},H.insert=function(e,t){return e=ie(e),t=G(t),this.select((function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)}))},H.remove=function(){return this.each(oe)},H.data=function(e,t){var r,n,a=-1,i=this.length;if(!arguments.length){for(e=new Array(i=(r=this[0]).length);++a<i;)(n=r[a])&&(e[a]=n.__data__);return e}function o(e,r){var n,a,i,o=e.length,u=r.length,f=Math.min(o,u),p=new Array(u),h=new Array(u),d=new Array(o);if(t){var m,g=new _,y=new Array(o);for(n=-1;++n<o;)(a=e[n])&&(g.has(m=t.call(a,a.__data__,n))?d[n]=a:g.set(m,a),y[n]=m);for(n=-1;++n<u;)(a=g.get(m=t.call(r,i=r[n],n)))?!0!==a&&(p[n]=a,a.__data__=i):h[n]=se(i),g.set(m,!0);for(n=-1;++n<o;)n in y&&!0!==g.get(y[n])&&(d[n]=e[n])}else{for(n=-1;++n<f;)a=e[n],i=r[n],a?(a.__data__=i,p[n]=a):h[n]=se(i);for(;n<u;++n)h[n]=se(r[n]);for(;n<o;++n)d[n]=e[n]}h.update=p,h.parentNode=p.parentNode=d.parentNode=e.parentNode,s.push(h),l.push(p),c.push(d)}var s=fe([]),l=$([]),c=$([]);if("function"==typeof e)for(;++a<i;)o(r=this[a],e.call(r,r.parentNode.__data__,a));else for(;++a<i;)o(r=this[a],e);return l.enter=function(){return s},l.exit=function(){return c},l},H.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},H.filter=function(e){var t,r,n,a=[];"function"!=typeof e&&(e=le(e));for(var i=0,o=this.length;i<o;i++){a.push(t=[]),t.parentNode=(r=this[i]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&e.call(n,n.__data__,s,i)&&t.push(n)}return $(a)},H.order=function(){for(var e=-1,t=this.length;++e<t;)for(var r,n=this[e],a=n.length-1,i=n[a];--a>=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},H.sort=function(e){e=ce.apply(this,arguments);for(var t=-1,r=this.length;++t<r;)this[t].sort(e);return this.order()},H.each=function(e){return ue(this,(function(t,r,n){e.call(t,t.__data__,r,n)}))},H.call=function(e){var t=n(arguments);return e.apply(t[0]=this,t),this},H.empty=function(){return!this.node()},H.node=function(){for(var e=0,t=this.length;e<t;e++)for(var r=this[e],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},H.size=function(){var e=0;return ue(this,(function(){++e})),e};var pe=[];function he(e){var t,r;return function(n,a,i){var o,s=e[i].update,l=s.length;for(i!=r&&(r=i,t=0),a>=t&&(t=a+1);!(o=s[t])&&++t<l;);return o}}function de(t,r,a){var i="__on"+t,o=t.indexOf("."),s=ge;o>0&&(t=t.slice(0,o));var l=me.get(t);function c(){var e=this[i];e&&(this.removeEventListener(t,e,e.$),delete this[i])}return l&&(t=l,s=ye),o?r?function(){var e=s(r,n(arguments));c.call(this),this.addEventListener(t,this[i]=e,e.$=a),e._=r}:c:r?P:function(){var r,n=new RegExp("^__on([^.]+)"+e.requote(t)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}e.selection.enter=fe,e.selection.enter.prototype=pe,pe.append=H.append,pe.empty=H.empty,pe.node=H.node,pe.call=H.call,pe.size=H.size,pe.select=function(e){for(var t,r,n,a,i,o=[],s=-1,l=this.length;++s<l;){n=(a=this[s]).update,o.push(t=[]),t.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(i=a[c])?(t.push(n[c]=r=e.call(a.parentNode,i.__data__,c,s)),r.__data__=i.__data__):t.push(null)}return $(o)},pe.insert=function(e,t){return arguments.length<2&&(t=he(this)),H.insert.call(this,e,t)},e.select=function(e){var t;return"string"==typeof e?(t=[V(e,a)]).parentNode=a.documentElement:(t=[e]).parentNode=i(e),$([t])},e.selectAll=function(e){var t;return"string"==typeof e?(t=n(q(e,a))).parentNode=a.documentElement:(t=n(e)).parentNode=null,$([t])},H.on=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=!1),e)this.each(de(r,e[r],t));return this}if(n<2)return(n=this.node()["__on"+e])&&n._;r=!1}return this.each(de(e,t,r))};var me=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});function ge(t,r){return function(n){var a=e.event;e.event=n,r[0]=this.__data__;try{t.apply(this,r)}finally{e.event=a}}}function ye(e,t){var r=ge(e,t);return function(e){var t=e.relatedTarget;t&&(t===this||8&t.compareDocumentPosition(this))||r.call(this,e)}}a&&me.forEach((function(e){"on"+e in a&&me.remove(e)}));var ve,be=0;function xe(t){var r=".dragsuppress-"+ ++be,n="click"+r,a=e.select(o(t)).on("touchmove"+r,F).on("dragstart"+r,F).on("selectstart"+r,F);if(null==ve&&(ve=!("onselectstart"in t)&&O(t.style,"userSelect")),ve){var s=i(t).style,l=s[ve];s[ve]="none"}return function(e){if(a.on(r,null),ve&&(s[ve]=l),e){var t=function(){a.on(n,null)};a.on(n,(function(){F(),t()}),!0),setTimeout(t,0)}}}e.mouse=function(e){return we(e,B())};var _e=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function we(t,r){r.changedTouches&&(r=r.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var a=n.createSVGPoint();if(_e<0){var i=o(t);if(i.scrollX||i.scrollY){var s=(n=e.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();_e=!(s.f||s.e),n.remove()}}return _e?(a.x=r.pageX,a.y=r.pageY):(a.x=r.clientX,a.y=r.clientY),[(a=a.matrixTransform(t.getScreenCTM().inverse())).x,a.y]}var l=t.getBoundingClientRect();return[r.clientX-l.left-t.clientLeft,r.clientY-l.top-t.clientTop]}function ke(){return e.event.changedTouches[0].identifier}e.touch=function(e,t,r){if(arguments.length<3&&(r=t,t=B().changedTouches),t)for(var n,a=0,i=t.length;a<i;++a)if((n=t[a]).identifier===r)return we(e,n)},e.behavior.drag=function(){var t=z(i,"drag","dragstart","dragend"),r=null,n=s(P,e.mouse,o,"mousemove","mouseup"),a=s(ke,e.touch,C,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",a)}function s(n,a,i,o,s){return function(){var l,c=this,u=e.event.target.correspondingElement||e.event.target,f=c.parentNode,p=t.of(c,arguments),h=0,d=n(),m=".drag"+(null==d?"":"-"+d),g=e.select(i(u)).on(o+m,b).on(s+m,x),y=xe(u),v=a(f,d);function b(){var e,t,r=a(f,d);r&&(e=r[0]-v[0],t=r[1]-v[1],h|=e|t,v=r,p({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:e,dy:t}))}function x(){a(f,d)&&(g.on(o+m,null).on(s+m,null),y(h),p({type:"dragend"}))}l=r?[(l=r.apply(c,arguments)).x-v[0],l.y-v[1]]:[0,0],p({type:"dragstart"})}}return i.origin=function(e){return arguments.length?(r=e,i):r},e.rebind(i,t,"on")},e.touches=function(e,t){return arguments.length<2&&(t=B().touches),t?n(t).map((function(t){var r=we(e,t);return r.identifier=t.identifier,r})):[]};var De=1e-6,Te=Math.PI,Ae=2*Te,Se=Ae-De,Me=Te/2,Ee=Te/180,Ce=180/Te;function Ne(e){return e>1?Me:e<-1?-Me:Math.asin(e)}function Oe(e){return((e=Math.exp(e))+1/e)/2}var Ie=Math.SQRT2;e.interpolateZoom=function(e,t){var r,n,a=e[0],i=e[1],o=e[2],s=t[0],l=t[1],c=t[2],u=s-a,f=l-i,p=u*u+f*f;if(p<1e-12)n=Math.log(c/o)/Ie,r=function(e){return[a+e*u,i+e*f,o*Math.exp(Ie*e*n)]};else{var h=Math.sqrt(p),d=(c*c-o*o+4*p)/(2*o*2*h),m=(c*c-o*o-4*p)/(2*c*2*h),g=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(m*m+1)-m);n=(y-g)/Ie,r=function(e){var t,r=e*n,s=Oe(g),l=o/(2*h)*(s*(t=Ie*r+g,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(g));return[a+l*u,i+l*f,o*s/Oe(Ie*r+g)]}}return r.duration=1e3*n,r},e.behavior.zoom=function(){var t,r,n,i,s,l,c,u,f,p={x:0,y:0,k:1},h=[960,500],d=Le,m=250,g=0,y="mousedown.zoom",v="mousemove.zoom",b="mouseup.zoom",x="touchstart.zoom",_=z(w,"zoomstart","zoom","zoomend");function w(e){e.on(y,N).on(Re+".zoom",I).on("dblclick.zoom",P).on(x,O)}function k(e){return[(e[0]-p.x)/p.k,(e[1]-p.y)/p.k]}function D(e){p.k=Math.max(d[0],Math.min(d[1],e))}function T(e,t){t=function(e){return[e[0]*p.k+p.x,e[1]*p.k+p.y]}(t),p.x+=e[0]-t[0],p.y+=e[1]-t[1]}function A(t,n,a,i){t.__chart__={x:p.x,y:p.y,k:p.k},D(Math.pow(2,i)),T(r=n,a),t=e.select(t),m>0&&(t=t.transition().duration(m)),t.call(w.event)}function S(){c&&c.domain(l.range().map((function(e){return(e-p.x)/p.k})).map(l.invert)),f&&f.domain(u.range().map((function(e){return(e-p.y)/p.k})).map(u.invert))}function M(e){g++||e({type:"zoomstart"})}function E(e){S(),e({type:"zoom",scale:p.k,translate:[p.x,p.y]})}function C(e){--g||(e({type:"zoomend"}),r=null)}function N(){var t=this,r=_.of(t,arguments),n=0,a=e.select(o(t)).on(v,l).on(b,c),i=k(e.mouse(t)),s=xe(t);function l(){n=1,T(e.mouse(t),i),E(r)}function c(){a.on(v,null).on(b,null),s(n),C(r)}Ra.call(t),M(r)}function O(){var t,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+e.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],f=e.select(r),h=xe(r);function d(){var n=e.touches(r);return t=p.k,n.forEach((function(e){e.identifier in a&&(a[e.identifier]=k(e))})),n}function m(){var t=e.event.target;e.select(t).on(l,g).on(c,v),u.push(t);for(var n=e.event.changedTouches,o=0,f=n.length;o<f;++o)a[n[o].identifier]=null;var h=d(),m=Date.now();if(1===h.length){if(m-s<500){var y=h[0];A(r,y,a[y.identifier],Math.floor(Math.log(p.k)/Math.LN2)+1),F()}s=m}else if(h.length>1){y=h[0];var b=h[1],x=y[0]-b[0],_=y[1]-b[1];i=x*x+_*_}}function g(){var o,l,c,u,f=e.touches(r);Ra.call(r);for(var p=0,h=f.length;p<h;++p,u=null)if(c=f[p],u=a[c.identifier]){if(l)break;o=c,l=u}if(u){var d=(d=c[0]-o[0])*d+(d=c[1]-o[1])*d,m=i&&Math.sqrt(d/i);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],l=[(l[0]+u[0])/2,(l[1]+u[1])/2],D(m*t)}s=null,T(o,l),E(n)}function v(){if(e.event.touches.length){for(var t=e.event.changedTouches,r=0,i=t.length;r<i;++r)delete a[t[r].identifier];for(var s in a)return void d()}e.selectAll(u).on(o,null),f.on(y,N).on(x,O),h(),C(n)}m(),M(n),f.on(y,null).on(x,m)}function I(){var a=_.of(this,arguments);i?clearTimeout(i):(Ra.call(this),t=k(r=n||e.mouse(this)),M(a)),i=setTimeout((function(){i=null,C(a)}),50),F(),D(Math.pow(2,.002*Pe())*p.k),T(r,t),E(a)}function P(){var t=e.mouse(this),r=Math.log(p.k)/Math.LN2;A(this,t,k(t),e.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Re||(Re="onwheel"in a?(Pe=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(Pe=function(){return e.event.wheelDelta},"mousewheel"):(Pe=function(){return-e.event.detail},"MozMousePixelScroll")),w.event=function(t){t.each((function(){var t=_.of(this,arguments),n=p;Ba?e.select(this).transition().each("start.zoom",(function(){p=this.__chart__||{x:0,y:0,k:1},M(t)})).tween("zoom:zoom",(function(){var a=h[0],i=h[1],o=r?r[0]:a/2,s=r?r[1]:i/2,l=e.interpolateZoom([(o-p.x)/p.k,(s-p.y)/p.k,a/p.k],[(o-n.x)/n.k,(s-n.y)/n.k,a/n.k]);return function(e){var r=l(e),n=a/r[2];this.__chart__=p={x:o-r[0]*n,y:s-r[1]*n,k:n},E(t)}})).each("interrupt.zoom",(function(){C(t)})).each("end.zoom",(function(){C(t)})):(this.__chart__=p,M(t),E(t),C(t))}))},w.translate=function(e){return arguments.length?(p={x:+e[0],y:+e[1],k:p.k},S(),w):[p.x,p.y]},w.scale=function(e){return arguments.length?(p={x:p.x,y:p.y,k:null},D(+e),S(),w):p.k},w.scaleExtent=function(e){return arguments.length?(d=null==e?Le:[+e[0],+e[1]],w):d},w.center=function(e){return arguments.length?(n=e&&[+e[0],+e[1]],w):n},w.size=function(e){return arguments.length?(h=e&&[+e[0],+e[1]],w):h},w.duration=function(e){return arguments.length?(m=+e,w):m},w.x=function(e){return arguments.length?(c=e,l=e.copy(),p={x:0,y:0,k:1},w):c},w.y=function(e){return arguments.length?(f=e,u=e.copy(),p={x:0,y:0,k:1},w):f},e.rebind(w,_,"on")};var Pe,Re,Le=[0,1/0];function Fe(){}function Be(e,t,r){return this instanceof Be?(this.h=+e,this.s=+t,void(this.l=+r)):arguments.length<2?e instanceof Be?new Be(e.h,e.s,e.l):nt(""+e,at,Be):new Be(e,t,r)}e.color=Fe,Fe.prototype.toString=function(){return this.rgb()+""},e.hsl=Be;var ze=Be.prototype=new Fe;function je(e,t,r){var n,a;function i(e){return Math.round(255*function(e){return e>360?e-=360:e<0&&(e+=360),e<60?n+(a-n)*e/60:e<180?a:e<240?n+(a-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+t):r+t-r*t),new Je(i(e+120),i(e),i(e-120))}function Ue(t,r,n){return this instanceof Ue?(this.h=+t,this.c=+r,void(this.l=+n)):arguments.length<2?t instanceof Ue?new Ue(t.h,t.c,t.l):Xe(t instanceof qe?t.l:(t=it((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Ue(t,r,n)}ze.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Be(this.h,this.s,this.l/e)},ze.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Be(this.h,this.s,e*this.l)},ze.rgb=function(){return je(this.h,this.s,this.l)},e.hcl=Ue;var $e=Ue.prototype=new Fe;function Ve(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new qe(r,Math.cos(e*=Ee)*t,Math.sin(e)*t)}function qe(e,t,r){return this instanceof qe?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof qe?new qe(e.l,e.a,e.b):e instanceof Ue?Ve(e.h,e.c,e.l):it((e=Je(e)).r,e.g,e.b):new qe(e,t,r)}$e.brighter=function(e){return new Ue(this.h,this.c,Math.min(100,this.l+We*(arguments.length?e:1)))},$e.darker=function(e){return new Ue(this.h,this.c,Math.max(0,this.l-We*(arguments.length?e:1)))},$e.rgb=function(){return Ve(this.h,this.c,this.l).rgb()},e.lab=qe;var We=18,He=qe.prototype=new Fe;function Ge(e,t,r){var n=(e+16)/116,a=n+t/500,i=n-r/200;return new Je(Ke(3.2404542*(a=.95047*Ye(a))-1.5371385*(n=1*Ye(n))-.4985314*(i=1.08883*Ye(i))),Ke(-.969266*a+1.8760108*n+.041556*i),Ke(.0556434*a-.2040259*n+1.0572252*i))}function Xe(e,t,r){return e>0?new Ue(Math.atan2(r,t)*Ce,Math.sqrt(t*t+r*r),e):new Ue(NaN,NaN,e)}function Ye(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function Ze(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function Ke(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function Je(e,t,r){return this instanceof Je?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof Je?new Je(e.r,e.g,e.b):nt(""+e,Je,je):new Je(e,t,r)}function Qe(e){return new Je(e>>16,e>>8&255,255&e)}function et(e){return Qe(e)+""}He.brighter=function(e){return new qe(Math.min(100,this.l+We*(arguments.length?e:1)),this.a,this.b)},He.darker=function(e){return new qe(Math.max(0,this.l-We*(arguments.length?e:1)),this.a,this.b)},He.rgb=function(){return Ge(this.l,this.a,this.b)},e.rgb=Je;var tt=Je.prototype=new Fe;function rt(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function nt(e,t,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return t(st(a[0]),st(a[1]),st(a[2]))}return(i=lt.get(e))?t(i.r,i.g,i.b):(null==e||"#"!==e.charAt(0)||isNaN(i=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===e.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),t(o,s,l))}function at(e,t,r){var n,a,i=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=e==o?(t-r)/s+(t<r?6:0):t==o?(r-e)/s+2:(e-t)/s+4,n*=60):(n=NaN,a=l>0&&l<1?0:n),new Be(n,a,l)}function it(e,t,r){var n=Ze((.4124564*(e=ot(e))+.3575761*(t=ot(t))+.1804375*(r=ot(r)))/.95047),a=Ze((.2126729*e+.7151522*t+.072175*r)/1);return qe(116*a-16,500*(n-a),200*(a-Ze((.0193339*e+.119192*t+.9503041*r)/1.08883)))}function ot(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function st(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}tt.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,a=30;return t||r||n?(t&&t<a&&(t=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new Je(Math.min(255,t/e),Math.min(255,r/e),Math.min(255,n/e))):new Je(a,a,a)},tt.darker=function(e){return new Je((e=Math.pow(.7,arguments.length?e:1))*this.r,e*this.g,e*this.b)},tt.hsl=function(){return at(this.r,this.g,this.b)},tt.toString=function(){return"#"+rt(this.r)+rt(this.g)+rt(this.b)};var lt=e.map({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 ct(e){return"function"==typeof e?e:function(){return e}}function ut(e){return function(t,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),ft(t,r,e,n)}}function ft(t,r,a,i){var o={},s=e.dispatch("beforesend","progress","load","error"),l={},c=new XMLHttpRequest,u=null;function f(){var e,t=c.status;if(!t&&function(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}(c)||t>=200&&t<300||304===t){try{e=a.call(o,c)}catch(e){return void s.error.call(o,e)}s.load.call(o,e)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(t)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(t){var r=e.event;e.event=t;try{s.progress.call(o,c)}finally{e.event=r}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(r=null==e?null:e+"",o):r},o.responseType=function(e){return arguments.length?(u=e,o):u},o.response=function(e){return a=e,o},["get","post"].forEach((function(e){o[e]=function(){return o.send.apply(o,[e].concat(n(arguments)))}})),o.send=function(e,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(e,t,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var i in l)c.setRequestHeader(i,l[i]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=a&&o.on("error",a).on("load",(function(e){a(null,e)})),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},e.rebind(o,s,"on"),null==i?o:o.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(i))}lt.forEach((function(e,t){lt.set(e,Qe(t))})),e.functor=ct,e.xhr=ut(C),e.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function a(e,r,n){arguments.length<3&&(n=r,r=null);var a=ft(e,t,null==r?i:o(r),n);return a.row=function(e){return arguments.length?a.response(null==(r=e)?i:o(e)):r},a}function i(e){return a.parse(e.responseText)}function o(e){return function(t){return a.parse(t.responseText,e)}}function s(t){return t.map(l).join(e)}function l(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return a.parse=function(e,t){var r;return a.parseRows(e,(function(e,n){if(r)return r(e,n-1);var a=function(t){for(var r={},n=e.length,a=0;a<n;++a)r[e[a]]=t[a];return r};r=t?function(e,r){return t(a(e),r)}:a}))},a.parseRows=function(e,t){var r,a,i={},o={},s=[],l=e.length,c=0,u=0;function f(){if(c>=l)return o;if(a)return a=!1,i;var t=c;if(34===e.charCodeAt(t)){for(var r=t;r++<l;)if(34===e.charCodeAt(r)){if(34!==e.charCodeAt(r+1))break;++r}return c=r+2,13===(s=e.charCodeAt(r+1))?(a=!0,10===e.charCodeAt(r+2)&&++c):10===s&&(a=!0),e.slice(t+1,r).replace(/""/g,'"')}for(;c<l;){var s,u=1;if(10===(s=e.charCodeAt(c++)))a=!0;else if(13===s)a=!0,10===e.charCodeAt(c)&&(++c,++u);else if(s!==n)continue;return e.slice(t,c-u)}return e.slice(t)}for(;(r=f())!==o;){for(var p=[];r!==i&&r!==o;)p.push(r),r=f();t&&null==(p=t(p,u++))||s.push(p)}return s},a.format=function(t){if(Array.isArray(t[0]))return a.formatRows(t);var r=new E,n=[];return t.forEach((function(e){for(var t in e)r.has(t)||n.push(r.add(t))})),[n.map(l).join(e)].concat(t.map((function(t){return n.map((function(e){return l(t[e])})).join(e)}))).join("\n")},a.formatRows=function(e){return e.map(s).join("\n")},a},e.csv=e.dsv(",","text/csv"),e.tsv=e.dsv("\t","text/tab-separated-values");var pt,ht,dt,mt,gt=this[O(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};function yt(e,t,r){var n=arguments.length;n<2&&(t=0),n<3&&(r=Date.now());var a={c:e,t:r+t,n:null};return ht?ht.n=a:pt=a,ht=a,dt||(mt=clearTimeout(mt),dt=1,gt(vt)),a}function vt(){var e=bt(),t=xt()-e;t>24?(isFinite(t)&&(clearTimeout(mt),mt=setTimeout(vt,t)),dt=0):(dt=1,gt(vt))}function bt(){for(var e=Date.now(),t=pt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function xt(){for(var e,t=pt,r=1/0;t;)t.c?(t.t<r&&(r=t.t),t=(e=t).n):t=e?e.n=t.n:pt=t.n;return ht=e,r}function _t(e){return e[0]}function wt(e){return e[1]}function kt(e){for(var t,r,n,a=e.length,i=[0,1],o=2,s=2;s<a;s++){for(;o>1&&(t=e[i[o-2]],r=e[i[o-1]],n=e[s],(r[0]-t[0])*(n[1]-t[1])-(r[1]-t[1])*(n[0]-t[0])<=0);)--o;i[o++]=s}return i.slice(0,o)}function Dt(e,t){return e[0]-t[0]||e[1]-t[1]}e.timer=function(){yt.apply(this,arguments)},e.timer.flush=function(){bt(),xt()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},e.geom={},e.geom.hull=function(e){var t=_t,r=wt;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,a=ct(t),i=ct(r),o=e.length,s=[],l=[];for(n=0;n<o;n++)s.push([+a.call(this,e[n],n),+i.call(this,e[n],n),n]);for(s.sort(Dt),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var c=kt(s),u=kt(l),f=u[0]===c[0],p=u[u.length-1]===c[c.length-1],h=[];for(n=c.length-1;n>=0;--n)h.push(e[s[c[n]][2]]);for(n=+f;n<u.length-p;++n)h.push(e[s[u[n]][2]]);return h}return n.x=function(e){return arguments.length?(t=e,n):t},n.y=function(e){return arguments.length?(r=e,n):r},n},e.geom.polygon=function(e){return U(e,Tt),e};var Tt=e.geom.polygon.prototype=[];function At(e,t,r){return(r[0]-t[0])*(e[1]-t[1])<(r[1]-t[1])*(e[0]-t[0])}function St(e,t,r,n){var a=e[0],i=r[0],o=t[0]-a,s=n[0]-i,l=e[1],c=r[1],u=t[1]-l,f=n[1]-c,p=(s*(l-c)-f*(a-i))/(f*o-s*u);return[a+p*o,l+p*u]}function Mt(e){var t=e[0],r=e[e.length-1];return!(t[0]-r[0]||t[1]-r[1])}Tt.area=function(){for(var e,t=-1,r=this.length,n=this[r-1],a=0;++t<r;)e=n,n=this[t],a+=e[1]*n[0]-e[0]*n[1];return.5*a},Tt.centroid=function(e){var t,r,n=-1,a=this.length,i=0,o=0,s=this[a-1];for(arguments.length||(e=-1/(6*this.area()));++n<a;)t=s,s=this[n],r=t[0]*s[1]-s[0]*t[1],i+=(t[0]+s[0])*r,o+=(t[1]+s[1])*r;return[i*e,o*e]},Tt.clip=function(e){for(var t,r,n,a,i,o,s=Mt(e),l=-1,c=this.length-Mt(this),u=this[c-1];++l<c;){for(t=e.slice(),e.length=0,a=this[l],i=t[(n=t.length-s)-1],r=-1;++r<n;)At(o=t[r],u,a)?(At(i,u,a)||e.push(St(i,o,u,a)),e.push(o)):At(i,u,a)&&e.push(St(i,o,u,a)),i=o;s&&e.push(e[0]),u=a}return e};var Et,Ct,Nt,Ot,It,Pt=[],Rt=[];function Lt(){tr(this),this.edge=this.site=this.circle=null}function Ft(e){var t=Pt.pop()||new Lt;return t.site=e,t}function Bt(e){Gt(e),Nt.remove(e),Pt.push(e),tr(e)}function zt(e){var t=e.circle,r=t.x,n=t.cy,a={x:r,y:n},i=e.P,o=e.N,s=[e];Bt(e);for(var l=i;l.circle&&v(r-l.circle.x)<De&&v(n-l.circle.cy)<De;)i=l.P,s.unshift(l),Bt(l),l=i;s.unshift(l),Gt(l);for(var c=o;c.circle&&v(r-c.circle.x)<De&&v(n-c.circle.cy)<De;)o=c.N,s.push(c),Bt(c),c=o;s.push(c),Gt(c);var u,f=s.length;for(u=1;u<f;++u)c=s[u],l=s[u-1],Jt(c.edge,l.site,c.site,a);l=s[0],(c=s[f-1]).edge=Zt(l.site,c.site,null,a),Ht(l),Ht(c)}function jt(e){for(var t,r,n,a,i=e.x,o=e.y,s=Nt._;s;)if((n=Ut(s,o)-i)>De)s=s.L;else{if(!((a=i-$t(s,o))>De)){n>-De?(t=s.P,r=s):a>-De?(t=s,r=s.N):t=r=s;break}if(!s.R){t=s;break}s=s.R}var l=Ft(e);if(Nt.insert(t,l),t||r){if(t===r)return Gt(t),r=Ft(t.site),Nt.insert(l,r),l.edge=r.edge=Zt(t.site,l.site),Ht(t),void Ht(r);if(r){Gt(t),Gt(r);var c=t.site,u=c.x,f=c.y,p=e.x-u,h=e.y-f,d=r.site,m=d.x-u,g=d.y-f,y=2*(p*g-h*m),v=p*p+h*h,b=m*m+g*g,x={x:(g*v-h*b)/y+u,y:(p*b-m*v)/y+f};Jt(r.edge,c,d,x),l.edge=Zt(c,e,null,x),r.edge=Zt(e,d,null,x),Ht(t),Ht(r)}else l.edge=Zt(t.site,l.site)}}function Ut(e,t){var r=e.site,n=r.x,a=r.y,i=a-t;if(!i)return n;var o=e.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-t;if(!c)return s;var u=s-n,f=1/i-1/c,p=u/c;return f?(-p+Math.sqrt(p*p-2*f*(u*u/(-2*c)-l+c/2+a-i/2)))/f+n:(n+s)/2}function $t(e,t){var r=e.N;if(r)return Ut(r,t);var n=e.site;return n.y===t?n.x:1/0}function Vt(e){this.site=e,this.edges=[]}function qt(e,t){return t.angle-e.angle}function Wt(){tr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ht(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,a=e.site,i=r.site;if(n!==i){var o=a.x,s=a.y,l=n.x-o,c=n.y-s,u=i.x-o,f=2*(l*(g=i.y-s)-c*u);if(!(f>=-1e-12)){var p=l*l+c*c,h=u*u+g*g,d=(g*p-c*h)/f,m=(l*h-u*p)/f,g=m+s,y=Rt.pop()||new Wt;y.arc=e,y.site=a,y.x=d+o,y.y=g+Math.sqrt(d*d+m*m),y.cy=g,e.circle=y;for(var v=null,b=It._;b;)if(y.y<b.y||y.y===b.y&&y.x<=b.x){if(!b.L){v=b.P;break}b=b.L}else{if(!b.R){v=b;break}b=b.R}It.insert(v,y),v||(Ot=y)}}}}function Gt(e){var t=e.circle;t&&(t.P||(Ot=t.N),It.remove(t),Rt.push(t),tr(t),e.circle=null)}function Xt(e,t){var r=e.b;if(r)return!0;var n,a,i=e.a,o=t[0][0],s=t[1][0],l=t[0][1],c=t[1][1],u=e.l,f=e.r,p=u.x,h=u.y,d=f.x,m=f.y,g=(p+d)/2,y=(h+m)/2;if(m===h){if(g<o||g>=s)return;if(p>d){if(i){if(i.y>=c)return}else i={x:g,y:l};r={x:g,y:c}}else{if(i){if(i.y<l)return}else i={x:g,y:c};r={x:g,y:l}}}else if(a=y-(n=(p-d)/(m-h))*g,n<-1||n>1)if(p>d){if(i){if(i.y>=c)return}else i={x:(l-a)/n,y:l};r={x:(c-a)/n,y:c}}else{if(i){if(i.y<l)return}else i={x:(c-a)/n,y:c};r={x:(l-a)/n,y:l}}else if(h<m){if(i){if(i.x>=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.x<o)return}else i={x:s,y:n*s+a};r={x:o,y:n*o+a}}return e.a=i,e.b=r,!0}function Yt(e,t){this.l=e,this.r=t,this.a=this.b=null}function Zt(e,t,r,n){var a=new Yt(e,t);return Et.push(a),r&&Jt(a,e,t,r),n&&Jt(a,t,e,n),Ct[e.i].edges.push(new Qt(a,e,t)),Ct[t.i].edges.push(new Qt(a,t,e)),a}function Kt(e,t,r){var n=new Yt(e,null);return n.a=t,n.b=r,Et.push(n),n}function Jt(e,t,r,n){e.a||e.b?e.l===r?e.b=n:e.a=n:(e.a=n,e.l=t,e.r=r)}function Qt(e,t,r){var n=e.a,a=e.b;this.edge=e,this.site=t,this.angle=r?Math.atan2(r.y-t.y,r.x-t.x):e.l===t?Math.atan2(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function er(){this._=null}function tr(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function rr(e,t){var r=t,n=t.R,a=r.U;a?a.L===r?a.L=n:a.R=n:e._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function nr(e,t){var r=t,n=t.L,a=r.U;a?a.L===r?a.L=n:a.R=n:e._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function ar(e){for(;e.L;)e=e.L;return e}function ir(e,t){var r,n,a,i=e.sort(or).pop();for(Et=[],Ct=new Array(e.length),Nt=new er,It=new er;;)if(a=Ot,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(Ct[i.i]=new Vt(i),jt(i),r=i.x,n=i.y),i=e.pop();else{if(!a)break;zt(a.arc)}t&&(function(e){for(var t,r,n,a,i,o=Et,s=(r=e[0][0],n=e[0][1],a=e[1][0],i=e[1][1],function(e){var t,o=e.a,s=e.b,l=o.x,c=o.y,u=0,f=1,p=s.x-l,h=s.y-c;if(t=r-l,p||!(t>0)){if(t/=p,p<0){if(t<u)return;t<f&&(f=t)}else if(p>0){if(t>f)return;t>u&&(u=t)}if(t=a-l,p||!(t<0)){if(t/=p,p<0){if(t>f)return;t>u&&(u=t)}else if(p>0){if(t<u)return;t<f&&(f=t)}if(t=n-c,h||!(t>0)){if(t/=h,h<0){if(t<u)return;t<f&&(f=t)}else if(h>0){if(t>f)return;t>u&&(u=t)}if(t=i-c,h||!(t<0)){if(t/=h,h<0){if(t>f)return;t>u&&(u=t)}else if(h>0){if(t<u)return;t<f&&(f=t)}return u>0&&(e.a={x:l+u*p,y:c+u*h}),f<1&&(e.b={x:l+f*p,y:c+f*h}),e}}}}}),l=o.length;l--;)(!Xt(t=o[l],e)||!s(t)||v(t.a.x-t.b.x)<De&&v(t.a.y-t.b.y)<De)&&(t.a=t.b=null,o.splice(l,1))}(t),function(e){for(var t,r,n,a,i,o,s,l,c,u,f=e[0][0],p=e[1][0],h=e[0][1],d=e[1][1],m=Ct,g=m.length;g--;)if((i=m[g])&&i.prepare())for(l=(s=i.edges).length,o=0;o<l;)n=(u=s[o].end()).x,a=u.y,t=(c=s[++o%l].start()).x,r=c.y,(v(n-t)>De||v(a-r)>De)&&(s.splice(o,0,new Qt(Kt(i.site,u,v(n-f)<De&&d-a>De?{x:f,y:v(t-f)<De?r:d}:v(a-d)<De&&p-n>De?{x:v(r-d)<De?t:p,y:d}:v(n-p)<De&&a-h>De?{x:p,y:v(t-p)<De?r:h}:v(a-h)<De&&n-f>De?{x:v(r-h)<De?t:f,y:h}:null),i.site,null)),++l)}(t));var o={cells:Ct,edges:Et};return Nt=It=Et=Ct=null,o}function or(e,t){return t.y-e.y||t.x-e.x}Vt.prototype.prepare=function(){for(var e,t=this.edges,r=t.length;r--;)(e=t[r].edge).b&&e.a||t.splice(r,1);return t.sort(qt),t.length},Qt.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},er.prototype={insert:function(e,t){var r,n,a;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;r=e}else this._?(e=ar(this._),t.P=null,t.N=e,e.P=e.L=t,r=e):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,e=t;r&&r.C;)r===(n=r.U).L?(a=n.R)&&a.C?(r.C=a.C=!1,n.C=!0,e=n):(e===r.R&&(rr(this,r),r=(e=r).U),r.C=!1,n.C=!0,nr(this,n)):(a=n.L)&&a.C?(r.C=a.C=!1,n.C=!0,e=n):(e===r.L&&(nr(this,r),r=(e=r).U),r.C=!1,n.C=!0,rr(this,n)),r=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,r,n,a=e.U,i=e.L,o=e.R;if(r=i?o?ar(o):i:o,a?a.L===e?a.L=r:a.R=r:this._=r,i&&o?(n=r.C,r.C=e.C,r.L=i,i.U=r,r!==o?(a=r.U,r.U=e.U,e=r.R,a.L=e,r.R=o,o.U=r):(r.U=a,a=r,e=r.R)):(n=e.C,e=r),e&&(e.U=a),!n)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===a.L){if((t=a.R).C&&(t.C=!1,a.C=!0,rr(this,a),t=a.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,nr(this,t),t=a.R),t.C=a.C,a.C=t.R.C=!1,rr(this,a),e=this._;break}}else if((t=a.L).C&&(t.C=!1,a.C=!0,nr(this,a),t=a.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,rr(this,t),t=a.L),t.C=a.C,a.C=t.L.C=!1,nr(this,a),e=this._;break}t.C=!0,e=a,a=a.U}while(!e.C);e&&(e.C=!1)}}},e.geom.voronoi=function(e){var t=_t,r=wt,n=t,a=r,i=sr;if(e)return o(e);function o(e){var t=new Array(e.length),r=i[0][0],n=i[0][1],a=i[1][0],o=i[1][1];return ir(s(e),i).cells.forEach((function(i,s){var l=i.edges,c=i.site;(t[s]=l.length?l.map((function(e){var t=e.start();return[t.x,t.y]})):c.x>=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=e[s]})),t}function s(e){return e.map((function(e,t){return{x:Math.round(n(e,t)/De)*De,y:Math.round(a(e,t)/De)*De,i:t}}))}return o.links=function(e){return ir(s(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},o.triangles=function(e){var t=[];return ir(s(e)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,c=r.edges.sort(qt),u=-1,f=c.length,p=c[f-1].edge,h=p.l===l?p.r:p.l;++u<f;)a=h,h=(p=c[u].edge).l===l?p.r:p.l,n<a.i&&n<h.i&&(o=a,s=h,((i=l).x-s.x)*(o.y-i.y)-(i.x-o.x)*(s.y-i.y)<0)&&t.push([e[n],e[a.i],e[h.i]])})),t},o.x=function(e){return arguments.length?(n=ct(t=e),o):t},o.y=function(e){return arguments.length?(a=ct(r=e),o):r},o.clipExtent=function(e){return arguments.length?(i=null==e?sr:e,o):i===sr?null:i},o.size=function(e){return arguments.length?o.clipExtent(e&&[[0,0],e]):i===sr?null:i&&i[1]},o};var sr=[[-1e6,-1e6],[1e6,1e6]];function lr(e){return e.x}function cr(e){return e.y}function ur(e,t,r,n,a,i){if(!e(t,r,n,a,i)){var o=.5*(r+a),s=.5*(n+i),l=t.nodes;l[0]&&ur(e,l[0],r,n,o,s),l[1]&&ur(e,l[1],o,n,a,s),l[2]&&ur(e,l[2],r,s,o,i),l[3]&&ur(e,l[3],o,s,a,i)}}function fr(e,t,r,n,a,i,o){var s,l=1/0;return function e(c,u,f,p,h){if(!(u>i||f>o||p<n||h<a)){if(d=c.point){var d,m=t-c.x,g=r-c.y,y=m*m+g*g;if(y<l){var v=Math.sqrt(l=y);n=t-v,a=r-v,i=t+v,o=r+v,s=d}}for(var b=c.nodes,x=.5*(u+p),_=.5*(f+h),w=(r>=_)<<1|t>=x,k=w+4;w<k;++w)if(c=b[3&w])switch(3&w){case 0:e(c,u,f,x,_);break;case 1:e(c,x,f,p,_);break;case 2:e(c,u,_,x,h);break;case 3:e(c,x,_,p,h)}}}(e,n,a,i,o),s}function pr(t,r){t=e.rgb(t),r=e.rgb(r);var n=t.r,a=t.g,i=t.b,o=r.r-n,s=r.g-a,l=r.b-i;return function(e){return"#"+rt(Math.round(n+o*e))+rt(Math.round(a+s*e))+rt(Math.round(i+l*e))}}function hr(e,t){var r,n={},a={};for(r in e)r in t?n[r]=vr(e[r],t[r]):a[r]=e[r];for(r in t)r in e||(a[r]=t[r]);return function(e){for(r in n)a[r]=n[r](e);return a}}function dr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function mr(e,t){var r,n,a,i=gr.lastIndex=yr.lastIndex=0,o=-1,s=[],l=[];for(e+="",t+="";(r=gr.exec(e))&&(n=yr.exec(t));)(a=n.index)>i&&(a=t.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:dr(r,n)})),i=yr.lastIndex;return i<t.length&&(a=t.slice(i),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?(t=l[0].x,function(e){return t(e)+""}):function(){return t}:(t=l.length,function(e){for(var r,n=0;n<t;++n)s[(r=l[n]).i]=r.x(e);return s.join("")})}e.geom.delaunay=function(t){return e.geom.voronoi().triangles(t)},e.geom.quadtree=function(e,t,r,n,a){var i,o=_t,s=wt;if(i=arguments.length)return o=lr,s=cr,3===i&&(a=r,n=t,r=t=0),l(e);function l(e){var l,c,u,f,p,h,d,m,g,y=ct(o),b=ct(s);if(null!=t)h=t,d=r,m=n,g=a;else if(m=g=-(h=d=1/0),c=[],u=[],p=e.length,i)for(f=0;f<p;++f)(l=e[f]).x<h&&(h=l.x),l.y<d&&(d=l.y),l.x>m&&(m=l.x),l.y>g&&(g=l.y),c.push(l.x),u.push(l.y);else for(f=0;f<p;++f){var x=+y(l=e[f],f),_=+b(l,f);x<h&&(h=x),_<d&&(d=_),x>m&&(m=x),_>g&&(g=_),c.push(x),u.push(_)}var w=m-h,k=g-d;function D(e,t,r,n,a,i,o,s){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var l=e.x,c=e.y;if(null!=l)if(v(l-r)+v(c-n)<.01)T(e,t,r,n,a,i,o,s);else{var u=e.point;e.x=e.y=e.point=null,T(e,u,l,c,a,i,o,s),T(e,t,r,n,a,i,o,s)}else e.x=r,e.y=n,e.point=t}else T(e,t,r,n,a,i,o,s)}function T(e,t,r,n,a,i,o,s){var l=.5*(a+o),c=.5*(i+s),u=r>=l,f=n>=c,p=f<<1|u;e.leaf=!1,u?a=l:o=l,f?i=c:s=c,D(e=e.nodes[p]||(e.nodes[p]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,a,i,o,s)}w>k?g=d+w:m=h+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){D(A,e,+y(e,++f),+b(e,f),h,d,m,g)},visit:function(e){ur(e,A,h,d,m,g)},find:function(e){return fr(A,e[0],e[1],h,d,m,g)}};if(f=-1,null==t){for(;++f<p;)D(A,e[f],c[f],u[f],h,d,m,g);--f}else e.forEach(A.add);return c=u=e=l=null,A}return l.x=function(e){return arguments.length?(o=e,l):o},l.y=function(e){return arguments.length?(s=e,l):s},l.extent=function(e){return arguments.length?(null==e?t=r=n=a=null:(t=+e[0][0],r=+e[0][1],n=+e[1][0],a=+e[1][1]),l):null==t?null:[[t,r],[n,a]]},l.size=function(e){return arguments.length?(null==e?t=r=n=a=null:(t=r=0,n=+e[0],a=+e[1]),l):null==t?null:[n-t,a-r]},l},e.interpolateRgb=pr,e.interpolateObject=hr,e.interpolateNumber=dr,e.interpolateString=mr;var gr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yr=new RegExp(gr.source,"g");function vr(t,r){for(var n,a=e.interpolators.length;--a>=0&&!(n=e.interpolators[a](t,r)););return n}function br(e,t){var r,n=[],a=[],i=e.length,o=t.length,s=Math.min(e.length,t.length);for(r=0;r<s;++r)n.push(vr(e[r],t[r]));for(;r<i;++r)a[r]=e[r];for(;r<o;++r)a[r]=t[r];return function(e){for(r=0;r<s;++r)a[r]=n[r](e);return a}}e.interpolate=vr,e.interpolators=[function(e,t){var r=typeof t;return("string"===r?lt.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?pr:mr:t instanceof Fe?pr:Array.isArray(t)?br:"object"===r&&isNaN(t)?hr:dr)(e,t)}],e.interpolateArray=br;var xr=function(){return C},_r=e.map({linear:xr,poly:function(e){return function(t){return Math.pow(t,e)}},quad:function(){return Ar},cubic:function(){return Sr},sin:function(){return Er},exp:function(){return Cr},circle:function(){return Nr},elastic:function(e,t){var r;return arguments.length<2&&(t=.45),arguments.length?r=t/Ae*Math.asin(1/e):(e=1,r=t/4),function(n){return 1+e*Math.pow(2,-10*n)*Math.sin((n-r)*Ae/t)}},back:function(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}},bounce:function(){return Or}}),wr=e.map({in:C,out:Dr,"in-out":Tr,"out-in":function(e){return Tr(Dr(e))}});function kr(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function Dr(e){return function(t){return 1-e(1-t)}}function Tr(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Ar(e){return e*e}function Sr(e){return e*e*e}function Mr(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Er(e){return 1-Math.cos(e*Me)}function Cr(e){return Math.pow(2,10*(e-1))}function Nr(e){return 1-Math.sqrt(1-e*e)}function Or(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function Ir(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function Pr(e){var t,r,n,a=[e.a,e.b],i=[e.c,e.d],o=Lr(a),s=Rr(a,i),l=Lr(((t=i)[0]+=(n=-s)*(r=a)[0],t[1]+=n*r[1],t))||0;a[0]*i[1]<i[0]*a[1]&&(a[0]*=-1,a[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(a[1],a[0]):Math.atan2(-i[0],i[1]))*Ce,this.translate=[e.e,e.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*Ce:0}function Rr(e,t){return e[0]*t[0]+e[1]*t[1]}function Lr(e){var t=Math.sqrt(Rr(e,e));return t&&(e[0]/=t,e[1]/=t),t}e.ease=function(e){var t=e.indexOf("-"),n=t>=0?e.slice(0,t):e,a=t>=0?e.slice(t+1):"in";return n=_r.get(n)||xr,kr((a=wr.get(a)||C)(n.apply(null,r.call(arguments,1))))},e.interpolateHcl=function(t,r){t=e.hcl(t),r=e.hcl(r);var n=t.h,a=t.c,i=t.l,o=r.h-n,s=r.c-a,l=r.l-i;return isNaN(s)&&(s=0,a=isNaN(a)?r.c:a),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(e){return Ve(n+o*e,a+s*e,i+l*e)+""}},e.interpolateHsl=function(t,r){t=e.hsl(t),r=e.hsl(r);var n=t.h,a=t.s,i=t.l,o=r.h-n,s=r.s-a,l=r.l-i;return isNaN(s)&&(s=0,a=isNaN(a)?r.s:a),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(e){return je(n+o*e,a+s*e,i+l*e)+""}},e.interpolateLab=function(t,r){t=e.lab(t),r=e.lab(r);var n=t.l,a=t.a,i=t.b,o=r.l-n,s=r.a-a,l=r.b-i;return function(e){return Ge(n+o*e,a+s*e,i+l*e)+""}},e.interpolateRound=Ir,e.transform=function(t){var r=a.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(null!=e){r.setAttribute("transform",e);var t=r.transform.baseVal.consolidate()}return new Pr(t?t.matrix:Fr)})(t)},Pr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function Br(e){return e.length?e.pop()+",":""}function zr(t,r){var n=[],a=[];return t=e.transform(t),r=e.transform(r),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:dr(e[0],t[0])},{i:a-2,x:dr(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(t.translate,r.translate,n,a),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(Br(r)+"rotate(",null,")")-2,x:dr(e,t)})):t&&r.push(Br(r)+"rotate("+t+")")}(t.rotate,r.rotate,n,a),function(e,t,r,n){e!==t?n.push({i:r.push(Br(r)+"skewX(",null,")")-2,x:dr(e,t)}):t&&r.push(Br(r)+"skewX("+t+")")}(t.skew,r.skew,n,a),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push(Br(r)+"scale(",null,",",null,")");n.push({i:a-4,x:dr(e[0],t[0])},{i:a-2,x:dr(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(Br(r)+"scale("+t+")")}(t.scale,r.scale,n,a),t=r=null,function(e){for(var t,r=-1,i=a.length;++r<i;)n[(t=a[r]).i]=t.x(e);return n.join("")}}function jr(e,t){return t=(t-=e=+e)||1/t,function(r){return(r-e)/t}}function Ur(e,t){return t=(t-=e=+e)||1/t,function(r){return Math.max(0,Math.min(1,(r-e)/t))}}function $r(e){for(var t=e.source,r=e.target,n=function(e,t){if(e===t)return e;for(var r=Vr(e),n=Vr(t),a=r.pop(),i=n.pop(),o=null;a===i;)o=a,a=r.pop(),i=n.pop();return o}(t,r),a=[t];t!==n;)t=t.parent,a.push(t);for(var i=a.length;r!==n;)a.splice(i,0,r),r=r.parent;return a}function Vr(e){for(var t=[],r=e.parent;null!=r;)t.push(e),e=r,r=r.parent;return t.push(e),t}function qr(e){e.fixed|=2}function Wr(e){e.fixed&=-7}function Hr(e){e.fixed|=4,e.px=e.x,e.py=e.y}function Gr(e){e.fixed&=-5}e.interpolateTransform=zr,e.layout={},e.layout.bundle=function(){return function(e){for(var t=[],r=-1,n=e.length;++r<n;)t.push($r(e[r]));return t}},e.layout.chord=function(){var t,r,n,a,i,o,s,l={},c=0;function u(){var l,u,p,h,d,m={},g=[],y=e.range(a),v=[];for(t=[],r=[],l=0,h=-1;++h<a;){for(u=0,d=-1;++d<a;)u+=n[h][d];g.push(u),v.push(e.range(a)),l+=u}for(i&&y.sort((function(e,t){return i(g[e],g[t])})),o&&v.forEach((function(e,t){e.sort((function(e,r){return o(n[t][e],n[t][r])}))})),l=(Ae-c*a)/l,u=0,h=-1;++h<a;){for(p=u,d=-1;++d<a;){var b=y[h],x=v[b][d],_=n[b][x],w=u,k=u+=_*l;m[b+"-"+x]={index:b,subindex:x,startAngle:w,endAngle:k,value:_}}r[b]={index:b,startAngle:p,endAngle:u,value:g[b]},u+=c}for(h=-1;++h<a;)for(d=h-1;++d<a;){var D=m[h+"-"+d],T=m[d+"-"+h];(D.value||T.value)&&t.push(D.value<T.value?{source:T,target:D}:{source:D,target:T})}s&&f()}function f(){t.sort((function(e,t){return s((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)}))}return l.matrix=function(e){return arguments.length?(a=(n=e)&&n.length,t=r=null,l):n},l.padding=function(e){return arguments.length?(c=e,t=r=null,l):c},l.sortGroups=function(e){return arguments.length?(i=e,t=r=null,l):i},l.sortSubgroups=function(e){return arguments.length?(o=e,t=null,l):o},l.sortChords=function(e){return arguments.length?(s=e,t&&f(),l):s},l.chords=function(){return t||u(),t},l.groups=function(){return r||u(),r},l},e.layout.force=function(){var t,r,n,a,i,o,s={},l=e.dispatch("start","tick","end"),c=[1,1],u=.9,f=Xr,p=Yr,h=-30,d=Zr,m=.1,g=.64,y=[],v=[];function b(e){return function(t,r,n,a){if(t.point!==e){var i=t.cx-e.x,o=t.cy-e.y,s=a-r,l=i*i+o*o;if(s*s/g<l){if(l<d){var c=t.charge/l;e.px-=i*c,e.py-=o*c}return!0}t.point&&l&&l<d&&(c=t.pointCharge/l,e.px-=i*c,e.py-=o*c)}return!t.charge}}function x(t){t.px=e.event.x,t.py=e.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return t=null,l.end({type:"end",alpha:n=0}),!0;var r,s,f,p,d,g,x,_,w,k=y.length,D=v.length;for(s=0;s<D;++s)p=(f=v[s]).source,(g=(_=(d=f.target).x-p.x)*_+(w=d.y-p.y)*w)&&(_*=g=n*i[s]*((g=Math.sqrt(g))-a[s])/g,w*=g,d.x-=_*(x=p.weight+d.weight?p.weight/(p.weight+d.weight):.5),d.y-=w*x,p.x+=_*(x=1-x),p.y+=w*x);if((x=n*m)&&(_=c[0]/2,w=c[1]/2,s=-1,x))for(;++s<k;)(f=y[s]).x+=(_-f.x)*x,f.y+=(w-f.y)*x;if(h)for(function e(t,r,n){var a=0,i=0;if(t.charge=0,!t.leaf)for(var o,s=t.nodes,l=s.length,c=-1;++c<l;)null!=(o=s[c])&&(e(o,r,n),t.charge+=o.charge,a+=o.charge*o.cx,i+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var u=r*n[t.point.index];t.charge+=t.pointCharge=u,a+=u*t.point.x,i+=u*t.point.y}t.cx=a/t.charge,t.cy=i/t.charge}(r=e.geom.quadtree(y),n,o),s=-1;++s<k;)(f=y[s]).fixed||r.visit(b(f));for(s=-1;++s<k;)(f=y[s]).fixed?(f.x=f.px,f.y=f.py):(f.x-=(f.px-(f.px=f.x))*u,f.y-=(f.py-(f.py=f.y))*u);l.tick({type:"tick",alpha:n})},s.nodes=function(e){return arguments.length?(y=e,s):y},s.links=function(e){return arguments.length?(v=e,s):v},s.size=function(e){return arguments.length?(c=e,s):c},s.linkDistance=function(e){return arguments.length?(f="function"==typeof e?e:+e,s):f},s.distance=s.linkDistance,s.linkStrength=function(e){return arguments.length?(p="function"==typeof e?e:+e,s):p},s.friction=function(e){return arguments.length?(u=+e,s):u},s.charge=function(e){return arguments.length?(h="function"==typeof e?e:+e,s):h},s.chargeDistance=function(e){return arguments.length?(d=e*e,s):Math.sqrt(d)},s.gravity=function(e){return arguments.length?(m=+e,s):m},s.theta=function(e){return arguments.length?(g=e*e,s):Math.sqrt(g)},s.alpha=function(e){return arguments.length?(e=+e,n?e>0?n=e:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:n=0})):e>0&&(l.start({type:"start",alpha:n=e}),t=yt(s.tick)),s):n},s.start=function(){var e,t,r,n=y.length,l=v.length,u=c[0],d=c[1];for(e=0;e<n;++e)(r=y[e]).index=e,r.weight=0;for(e=0;e<l;++e)"number"==typeof(r=v[e]).source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(e=0;e<n;++e)r=y[e],isNaN(r.x)&&(r.x=m("x",u)),isNaN(r.y)&&(r.y=m("y",d)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(a=[],"function"==typeof f)for(e=0;e<l;++e)a[e]=+f.call(this,v[e],e);else for(e=0;e<l;++e)a[e]=f;if(i=[],"function"==typeof p)for(e=0;e<l;++e)i[e]=+p.call(this,v[e],e);else for(e=0;e<l;++e)i[e]=p;if(o=[],"function"==typeof h)for(e=0;e<n;++e)o[e]=+h.call(this,y[e],e);else for(e=0;e<n;++e)o[e]=h;function m(r,a){if(!t){for(t=new Array(n),c=0;c<n;++c)t[c]=[];for(c=0;c<l;++c){var i=v[c];t[i.source.index].push(i.target),t[i.target.index].push(i.source)}}for(var o,s=t[e],c=-1,u=s.length;++c<u;)if(!isNaN(o=s[c][r]))return o;return Math.random()*a}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=e.behavior.drag().origin(C).on("dragstart.force",qr).on("drag.force",x).on("dragend.force",Wr)),!arguments.length)return r;this.on("mouseover.force",Hr).on("mouseout.force",Gr).call(r)},e.rebind(s,l,"on")};var Xr=20,Yr=1,Zr=1/0;function Kr(t,r){return e.rebind(t,r,"sort","children","value"),t.nodes=t,t.links=nn,t}function Jr(e,t){for(var r=[e];null!=(e=r.pop());)if(t(e),(a=e.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function Qr(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(i=e.children)&&(a=i.length))for(var a,i,o=-1;++o<a;)r.push(i[o]);for(;null!=(e=n.pop());)t(e)}function en(e){return e.children}function tn(e){return e.value}function rn(e,t){return t.value-e.value}function nn(t){return e.merge(t.map((function(e){return(e.children||[]).map((function(t){return{source:e,target:t}}))})))}e.layout.hierarchy=function(){var e=rn,t=en,r=tn;function n(a){var i,o=[a],s=[];for(a.depth=0;null!=(i=o.pop());)if(s.push(i),(c=t.call(n,i,i.depth))&&(l=c.length)){for(var l,c,u;--l>=0;)o.push(u=c[l]),u.parent=i,u.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Qr(a,(function(t){var n,a;e&&(n=t.children)&&n.sort(e),r&&(a=t.parent)&&(a.value+=t.value)})),s}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(Jr(e,(function(e){e.children&&(e.value=0)})),Qr(e,(function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},n},e.layout.partition=function(){var t=e.layout.hierarchy(),r=[1,1];function n(e,n){var a=t.call(this,e,n);return function e(t,r,n,a){var i=t.children;if(t.x=r,t.y=t.depth*a,t.dx=n,t.dy=a,i&&(o=i.length)){var o,s,l,c=-1;for(n=t.value?n/t.value:0;++c<o;)e(s=i[c],r,l=s.value*n,a),r+=l}}(a[0],0,r[0],r[1]/function e(t){var r=t.children,n=0;if(r&&(a=r.length))for(var a,i=-1;++i<a;)n=Math.max(n,e(r[i]));return 1+n}(a[0])),a}return n.size=function(e){return arguments.length?(r=e,n):r},Kr(n,t)},e.layout.pie=function(){var t=Number,r=an,n=0,a=Ae,i=0;function o(s){var l,c=s.length,u=s.map((function(e,r){return+t.call(o,e,r)})),f=+("function"==typeof n?n.apply(this,arguments):n),p=("function"==typeof a?a.apply(this,arguments):a)-f,h=Math.min(Math.abs(p)/c,+("function"==typeof i?i.apply(this,arguments):i)),d=h*(p<0?-1:1),m=e.sum(u),g=m?(p-c*d)/m:0,y=e.range(c),v=[];return null!=r&&y.sort(r===an?function(e,t){return u[t]-u[e]}:function(e,t){return r(s[e],s[t])}),y.forEach((function(e){v[e]={data:s[e],value:l=u[e],startAngle:f,endAngle:f+=l*g+d,padAngle:h}})),v}return o.value=function(e){return arguments.length?(t=e,o):t},o.sort=function(e){return arguments.length?(r=e,o):r},o.startAngle=function(e){return arguments.length?(n=e,o):n},o.endAngle=function(e){return arguments.length?(a=e,o):a},o.padAngle=function(e){return arguments.length?(i=e,o):i},o};var an={};function on(e){return e.x}function sn(e){return e.y}function ln(e,t,r){e.y0=t,e.y=r}e.layout.stack=function(){var t=C,r=fn,n=pn,a=ln,i=on,o=sn;function s(l,c){if(!(h=l.length))return l;var u=l.map((function(e,r){return t.call(s,e,r)})),f=u.map((function(e){return e.map((function(e,t){return[i.call(s,e,t),o.call(s,e,t)]}))})),p=r.call(s,f,c);u=e.permute(u,p),f=e.permute(f,p);var h,d,m,g,y=n.call(s,f,c),v=u[0].length;for(m=0;m<v;++m)for(a.call(s,u[0][m],g=y[m],f[0][m][1]),d=1;d<h;++d)a.call(s,u[d][m],g+=f[d-1][m][1],f[d][m][1]);return l}return s.values=function(e){return arguments.length?(t=e,s):t},s.order=function(e){return arguments.length?(r="function"==typeof e?e:cn.get(e)||fn,s):r},s.offset=function(e){return arguments.length?(n="function"==typeof e?e:un.get(e)||pn,s):n},s.x=function(e){return arguments.length?(i=e,s):i},s.y=function(e){return arguments.length?(o=e,s):o},s.out=function(e){return arguments.length?(a=e,s):a},s};var cn=e.map({"inside-out":function(t){var r,n,a=t.length,i=t.map(hn),o=t.map(dn),s=e.range(a).sort((function(e,t){return i[e]-i[t]})),l=0,c=0,u=[],f=[];for(r=0;r<a;++r)n=s[r],l<c?(l+=o[n],u.push(n)):(c+=o[n],f.push(n));return f.reverse().concat(u)},reverse:function(t){return e.range(t.length).reverse()},default:fn}),un=e.map({silhouette:function(e){var t,r,n,a=e.length,i=e[0].length,o=[],s=0,l=[];for(r=0;r<i;++r){for(t=0,n=0;t<a;t++)n+=e[t][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<i;++r)l[r]=(s-o[r])/2;return l},wiggle:function(e){var t,r,n,a,i,o,s,l,c,u=e.length,f=e[0],p=f.length,h=[];for(h[0]=l=c=0,r=1;r<p;++r){for(t=0,a=0;t<u;++t)a+=e[t][r][1];for(t=0,i=0,s=f[r][0]-f[r-1][0];t<u;++t){for(n=0,o=(e[t][r][1]-e[t][r-1][1])/(2*s);n<t;++n)o+=(e[n][r][1]-e[n][r-1][1])/s;i+=o*e[t][r][1]}h[r]=l-=a?i/a*s:0,l<c&&(c=l)}for(r=0;r<p;++r)h[r]-=c;return h},expand:function(e){var t,r,n,a=e.length,i=e[0].length,o=1/a,s=[];for(r=0;r<i;++r){for(t=0,n=0;t<a;t++)n+=e[t][r][1];if(n)for(t=0;t<a;t++)e[t][r][1]/=n;else for(t=0;t<a;t++)e[t][r][1]=o}for(r=0;r<i;++r)s[r]=0;return s},zero:pn});function fn(t){return e.range(t.length)}function pn(e){for(var t=-1,r=e[0].length,n=[];++t<r;)n[t]=0;return n}function hn(e){for(var t,r=1,n=0,a=e[0][1],i=e.length;r<i;++r)(t=e[r][1])>a&&(n=r,a=t);return n}function dn(e){return e.reduce(mn,0)}function mn(e,t){return e+t[1]}function gn(e,t){return yn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function yn(e,t){for(var r=-1,n=+e[0],a=(e[1]-n)/t,i=[];++r<=t;)i[r]=a*r+n;return i}function vn(t){return[e.min(t),e.max(t)]}function bn(e,t){return e.value-t.value}function xn(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function _n(e,t){e._pack_next=t,t._pack_prev=e}function wn(e,t){var r=t.x-e.x,n=t.y-e.y,a=e.r+t.r;return.999*a*a>r*r+n*n}function kn(e){if((t=e.children)&&(l=t.length)){var t,r,n,a,i,o,s,l,c=1/0,u=-1/0,f=1/0,p=-1/0;if(t.forEach(Dn),(r=t[0]).x=-r.r,r.y=0,b(r),l>1&&((n=t[1]).x=n.r,n.y=0,b(n),l>2))for(An(r,n,a=t[2]),b(a),xn(r,a),r._pack_prev=a,xn(a,n),n=r._pack_next,i=3;i<l;i++){An(r,n,a=t[i]);var h=0,d=1,m=1;for(o=n._pack_next;o!==n;o=o._pack_next,d++)if(wn(o,a)){h=1;break}if(1==h)for(s=r._pack_prev;s!==o._pack_prev&&!wn(s,a);s=s._pack_prev,m++);h?(d<m||d==m&&n.r<r.r?_n(r,n=o):_n(r=s,n),i--):(xn(r,a),n=a,b(a))}var g=(c+u)/2,y=(f+p)/2,v=0;for(i=0;i<l;i++)(a=t[i]).x-=g,a.y-=y,v=Math.max(v,a.r+Math.sqrt(a.x*a.x+a.y*a.y));e.r=v,t.forEach(Tn)}function b(e){c=Math.min(e.x-e.r,c),u=Math.max(e.x+e.r,u),f=Math.min(e.y-e.r,f),p=Math.max(e.y+e.r,p)}}function Dn(e){e._pack_next=e._pack_prev=e}function Tn(e){delete e._pack_next,delete e._pack_prev}function An(e,t,r){var n=e.r+r.r,a=t.x-e.x,i=t.y-e.y;if(n&&(a||i)){var o=t.r+r.r,s=a*a+i*i,l=.5+((n*=n)-(o*=o))/(2*s),c=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=e.x+l*a+c*i,r.y=e.y+l*i-c*a}else r.x=e.x+n,r.y=e.y}function Sn(e,t){return e.parent==t.parent?1:2}function Mn(e){var t=e.children;return t.length?t[0]:e.t}function En(e){var t,r=e.children;return(t=r.length)?r[t-1]:e.t}function Cn(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 Nn(e,t,r){return e.a.parent===t.parent?e.a:r}function On(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function In(e,t){var r=e.x+t[3],n=e.y+t[0],a=e.dx-t[1]-t[3],i=e.dy-t[0]-t[2];return a<0&&(r+=a/2,a=0),i<0&&(n+=i/2,i=0),{x:r,y:n,dx:a,dy:i}}function Pn(e){var t=e[0],r=e[e.length-1];return t<r?[t,r]:[r,t]}function Rn(e){return e.rangeExtent?e.rangeExtent():Pn(e.range())}function Ln(e,t,r,n){var a=r(e[0],e[1]),i=n(t[0],t[1]);return function(e){return i(a(e))}}function Fn(e,t){var r,n=0,a=e.length-1,i=e[n],o=e[a];return o<i&&(r=n,n=a,a=r,r=i,i=o,o=r),e[n]=t.floor(i),e[a]=t.ceil(o),e}function Bn(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:zn}e.layout.histogram=function(){var t=!0,r=Number,n=vn,a=gn;function i(i,o){for(var s,l,c=[],u=i.map(r,this),f=n.call(this,u,o),p=a.call(this,f,u,o),h=(o=-1,u.length),d=p.length-1,m=t?1:1/h;++o<d;)(s=c[o]=[]).dx=p[o+1]-(s.x=p[o]),s.y=0;if(d>0)for(o=-1;++o<h;)(l=u[o])>=f[0]&&l<=f[1]&&((s=c[e.bisect(p,l,1,d)-1]).y+=m,s.push(i[o]));return c}return i.value=function(e){return arguments.length?(r=e,i):r},i.range=function(e){return arguments.length?(n=ct(e),i):n},i.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return yn(t,e)}:ct(e),i):a},i.frequency=function(e){return arguments.length?(t=!!e,i):t},i},e.layout.pack=function(){var t,r=e.layout.hierarchy().sort(bn),n=0,a=[1,1];function i(e,i){var o=r.call(this,e,i),s=o[0],l=a[0],c=a[1],u=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,Qr(s,(function(e){e.r=+u(e.value)})),Qr(s,kn),n){var f=n*(t?1:Math.max(2*s.r/l,2*s.r/c))/2;Qr(s,(function(e){e.r+=f})),Qr(s,kn),Qr(s,(function(e){e.r-=f}))}return function e(t,r,n,a){var i=t.children;if(t.x=r+=a*t.x,t.y=n+=a*t.y,t.r*=a,i)for(var o=-1,s=i.length;++o<s;)e(i[o],r,n,a)}(s,l/2,c/2,t?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return i.size=function(e){return arguments.length?(a=e,i):a},i.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,i):t},i.padding=function(e){return arguments.length?(n=+e,i):n},Kr(i,r)},e.layout.tree=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Sn,n=[1,1],a=null;function i(e,i){var c=t.call(this,e,i),u=c[0],f=function(e){for(var t,r={A:null,children:[e]},n=[r];null!=(t=n.pop());)for(var a,i=t.children,o=0,s=i.length;o<s;++o)n.push((i[o]=a={_:i[o],parent:t,children:(a=i[o].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=a);return r.children[0]}(u);if(Qr(f,o),f.parent.m=-f.z,Jr(f,s),a)Jr(u,l);else{var p=u,h=u,d=u;Jr(u,(function(e){e.x<p.x&&(p=e),e.x>h.x&&(h=e),e.depth>d.depth&&(d=e)}));var m=r(p,h)/2-p.x,g=n[0]/(h.x+r(h,p)/2+m),y=n[1]/(d.depth||1);Jr(u,(function(e){e.x=(e.x+m)*g,e.y=e.depth*y}))}return c}function o(e){var t=e.children,n=e.parent.children,a=e.i?n[e.i-1]:null;if(t.length){!function(e){for(var t,r=0,n=0,a=e.children,i=a.length;--i>=0;)(t=a[i]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var i=(t[0].z+t[t.length-1].z)/2;a?(e.z=a.z+r(e._,a._),e.m=e.z-i):e.z=i}else a&&(e.z=a.z+r(e._,a._));e.parent.A=function(e,t,n){if(t){for(var a,i=e,o=e,s=t,l=i.parent.children[0],c=i.m,u=o.m,f=s.m,p=l.m;s=En(s),i=Mn(i),s&&i;)l=Mn(l),(o=En(o)).a=e,(a=s.z+f-i.z-c+r(s._,i._))>0&&(Cn(Nn(s,e,n),e,a),c+=a,u+=a),f+=s.m,c+=i.m,p+=l.m,u+=o.m;s&&!En(o)&&(o.t=s,o.m+=f-u),i&&!Mn(l)&&(l.t=i,l.m+=c-p,n=e)}return n}(e,a,e.parent.A||n[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=n[0],e.y=e.depth*n[1]}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e)?l:null,i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null==(n=e)?null:l,i):a?n:null},Kr(i,t)},e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Sn,n=[1,1],a=!1;function i(i,o){var s,l=t.call(this,i,o),c=l[0],u=0;Qr(c,(function(t){var n=t.children;n&&n.length?(t.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(n),t.y=function(t){return 1+e.max(t,(function(e){return e.y}))}(n)):(t.x=s?u+=r(t,s):0,t.y=0,s=t)}));var f=function e(t){var r=t.children;return r&&r.length?e(r[0]):t}(c),p=function e(t){var r,n=t.children;return n&&(r=n.length)?e(n[r-1]):t}(c),h=f.x-r(f,p)/2,d=p.x+r(p,f)/2;return Qr(c,a?function(e){e.x=(e.x-c.x)*n[0],e.y=(c.y-e.y)*n[1]}:function(e){e.x=(e.x-h)/(d-h)*n[0],e.y=(1-(c.y?e.y/c.y:1))*n[1]}),l}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e),i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null!=(n=e),i):a?n:null},Kr(i,t)},e.layout.treemap=function(){var t,r=e.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=On,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(e,t){for(var r,n,a=-1,i=e.length;++a<i;)n=(r=e[a]).value*(t<0?0:t),r.area=isNaN(n)||n<=0?0:n}function f(e){var t=e.children;if(t&&t.length){var r,n,a,i=o(e),s=[],c=t.slice(),p=1/0,m="slice"===l?i.dx:"dice"===l?i.dy:"slice-dice"===l?1&e.depth?i.dy:i.dx:Math.min(i.dx,i.dy);for(u(c,i.dx*i.dy/e.value),s.area=0;(a=c.length)>0;)s.push(r=c[a-1]),s.area+=r.area,"squarify"!==l||(n=h(s,m))<=p?(c.pop(),p=n):(s.area-=s.pop().area,d(s,m,i,!1),m=Math.min(i.dx,i.dy),s.length=s.area=0,p=1/0);s.length&&(d(s,m,i,!0),s.length=s.area=0),t.forEach(f)}}function p(e){var t=e.children;if(t&&t.length){var r,n=o(e),a=t.slice(),i=[];for(u(a,n.dx*n.dy/e.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(d(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);t.forEach(p)}}function h(e,t){for(var r,n=e.area,a=0,i=1/0,o=-1,s=e.length;++o<s;)(r=e[o].area)&&(r<i&&(i=r),r>a&&(a=r));return t*=t,(n*=n)?Math.max(t*a*c/n,n/(t*i*c)):1/0}function d(e,t,r,a){var i,o=-1,s=e.length,l=r.x,c=r.y,u=t?n(e.area/t):0;if(t==r.dx){for((a||u>r.dy)&&(u=r.dy);++o<s;)(i=e[o]).x=l,i.y=c,i.dy=u,l+=i.dx=Math.min(r.x+r.dx-l,u?n(i.area/u):0);i.z=!0,i.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((a||u>r.dx)&&(u=r.dx);++o<s;)(i=e[o]).x=l,i.y=c,i.dx=u,c+=i.dy=Math.min(r.y+r.dy-c,u?n(i.area/u):0);i.z=!1,i.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function m(e){var n=t||r(e),i=n[0];return i.x=i.y=0,i.value?(i.dx=a[0],i.dy=a[1]):i.dx=i.dy=0,t&&r.revalue(i),u([i],i.dx*i.dy/i.value),(t?p:f)(i),s&&(t=n),n}return m.size=function(e){return arguments.length?(a=e,m):a},m.padding=function(e){if(!arguments.length)return i;function t(t){var r=e.call(m,t,t.depth);return null==r?On(t):In(t,"number"==typeof r?[r,r,r,r]:r)}function r(t){return In(t,e)}var n;return o=null==(i=e)?On:"function"==(n=typeof e)?t:"number"===n?(e=[e,e,e,e],r):r,m},m.round=function(e){return arguments.length?(n=e?Math.round:Number,m):n!=Number},m.sticky=function(e){return arguments.length?(s=e,t=null,m):s},m.ratio=function(e){return arguments.length?(c=e,m):c},m.mode=function(e){return arguments.length?(l=e+"",m):l},Kr(m,r)},e.random={normal:function(e,t){var r=arguments.length;return r<2&&(t=1),r<1&&(e=0),function(){var r,n,a;do{a=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!a||a>1);return e+t*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var r=e.random.irwinHall(t);return function(){return r()/t}},irwinHall:function(e){return function(){for(var t=0,r=0;r<e;r++)t+=Math.random();return t}}},e.scale={};var zn={floor:C,ceil:C};function jn(t,r,n,a){var i=[],o=[],s=0,l=Math.min(t.length,r.length)-1;for(t[l]<t[0]&&(t=t.slice().reverse(),r=r.slice().reverse());++s<=l;)i.push(n(t[s-1],t[s])),o.push(a(r[s-1],r[s]));return function(r){var n=e.bisect(t,r,1,l)-1;return o[n](i[n](r))}}function Un(t,r){return e.rebind(t,r,"range","rangeRound","interpolate","clamp")}function $n(e,t){return Fn(e,Bn(Vn(e,t)[2])),Fn(e,Bn(Vn(e,t)[2])),e}function Vn(e,t){null==t&&(t=10);var r=Pn(e),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),i=t/n*a;return i<=.15?a*=10:i<=.35?a*=5:i<=.75&&(a*=2),r[0]=Math.ceil(r[0]/a)*a,r[1]=Math.floor(r[1]/a)*a+.5*a,r[2]=a,r}function qn(t,r){return e.range.apply(e,Vn(t,r))}e.scale.linear=function(){return function e(t,r,n,a){var i,o;function s(){var e=Math.min(t.length,r.length)>2?jn:Ln,s=a?Ur:jr;return i=e(t,r,s,n),o=e(r,t,s,vr),l}function l(e){return i(e)}return l.invert=function(e){return o(e)},l.domain=function(e){return arguments.length?(t=e.map(Number),s()):t},l.range=function(e){return arguments.length?(r=e,s()):r},l.rangeRound=function(e){return l.range(e).interpolate(Ir)},l.clamp=function(e){return arguments.length?(a=e,s()):a},l.interpolate=function(e){return arguments.length?(n=e,s()):n},l.ticks=function(e){return qn(t,e)},l.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},l.nice=function(e){return $n(t,e),s()},l.copy=function(){return e(t,r,n,a)},s()}([0,1],[0,1],vr,!1)},e.scale.log=function(){return function e(t,r,n,a){function i(e){return(n?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(r)}function o(e){return n?Math.pow(r,e):-Math.pow(r,-e)}function s(e){return t(i(e))}return s.invert=function(e){return o(t.invert(e))},s.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((a=e.map(Number)).map(i)),s):a},s.base=function(e){return arguments.length?(r=+e,t.domain(a.map(i)),s):r},s.nice=function(){var e=Fn(a.map(i),n?Math:Wn);return t.domain(e),a=e.map(o),s},s.ticks=function(){var e=Pn(a),t=[],s=e[0],l=e[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),f=r%1?2:r;if(isFinite(u-c)){if(n){for(;c<u;c++)for(var p=1;p<f;p++)t.push(o(c)*p);t.push(o(c))}else for(t.push(o(c));c++<u;)for(p=f-1;p>0;p--)t.push(o(c)*p);for(c=0;t[c]<s;c++);for(u=t.length;t[u-1]>l;u--);t=t.slice(c,u)}return t},s.copy=function(){return e(t.copy(),r,n,a)},Un(s,t)}(e.scale.linear().domain([0,1]),10,!0,[1,10])};var Wn={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function Hn(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}e.scale.pow=function(){return function e(t,r,n){var a=Hn(r),i=Hn(1/r);function o(e){return t(a(e))}return o.invert=function(e){return i(t.invert(e))},o.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(a)),o):n},o.ticks=function(e){return qn(n,e)},o.tickFormat=function(e,t){return d3_scale_linearTickFormat(n,e,t)},o.nice=function(e){return o.domain($n(n,e))},o.exponent=function(e){return arguments.length?(a=Hn(r=e),i=Hn(1/r),t.domain(n.map(a)),o):r},o.copy=function(){return e(t.copy(),r,n)},Un(o,t)}(e.scale.linear(),1,[0,1])},e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return function t(r,n){var a,i,o;function s(e){return i[((a.get(e)||("range"===n.t?a.set(e,r.push(e)):NaN))-1)%i.length]}function l(t,n){return e.range(r.length).map((function(e){return t+n*e}))}return s.domain=function(e){if(!arguments.length)return r;r=[],a=new _;for(var t,i=-1,o=e.length;++i<o;)a.has(t=e[i])||a.set(t,r.push(t));return s[n.t].apply(s,n.a)},s.range=function(e){return arguments.length?(i=e,o=0,n={t:"range",a:arguments},s):i},s.rangePoints=function(e,t){arguments.length<2&&(t=0);var a=e[0],c=e[1],u=r.length<2?(a=(a+c)/2,0):(c-a)/(r.length-1+t);return i=l(a+u*t/2,u),o=0,n={t:"rangePoints",a:arguments},s},s.rangeRoundPoints=function(e,t){arguments.length<2&&(t=0);var a=e[0],c=e[1],u=r.length<2?(a=c=Math.round((a+c)/2),0):(c-a)/(r.length-1+t)|0;return i=l(a+Math.round(u*t/2+(c-a-(r.length-1+t)*u)/2),u),o=0,n={t:"rangeRoundPoints",a:arguments},s},s.rangeBands=function(e,t,a){arguments.length<2&&(t=0),arguments.length<3&&(a=t);var c=e[1]<e[0],u=e[c-0],f=(e[1-c]-u)/(r.length-t+2*a);return i=l(u+f*a,f),c&&i.reverse(),o=f*(1-t),n={t:"rangeBands",a:arguments},s},s.rangeRoundBands=function(e,t,a){arguments.length<2&&(t=0),arguments.length<3&&(a=t);var c=e[1]<e[0],u=e[c-0],f=e[1-c],p=Math.floor((f-u)/(r.length-t+2*a));return i=l(u+Math.round((f-u-(r.length-t)*p)/2),p),c&&i.reverse(),o=Math.round(p*(1-t)),n={t:"rangeRoundBands",a:arguments},s},s.rangeBand=function(){return o},s.rangeExtent=function(){return Pn(n.a[0])},s.copy=function(){return t(r,n)},s.domain(r)}([],{t:"range",a:[[]]})},e.scale.category10=function(){return e.scale.ordinal().range(Gn)},e.scale.category20=function(){return e.scale.ordinal().range(Xn)},e.scale.category20b=function(){return e.scale.ordinal().range(Yn)},e.scale.category20c=function(){return e.scale.ordinal().range(Zn)};var Gn=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(et),Xn=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(et),Yn=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(et),Zn=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(et);function Kn(){return 0}e.scale.quantile=function(){return function t(r,n){var a;function i(){var t=0,i=n.length;for(a=[];++t<i;)a[t-1]=e.quantile(r,t/i);return o}function o(t){if(!isNaN(t=+t))return n[e.bisect(a,t)]}return o.domain=function(e){return arguments.length?(r=e.map(h).filter(d).sort(p),i()):r},o.range=function(e){return arguments.length?(n=e,i()):n},o.quantiles=function(){return a},o.invertExtent=function(e){return(e=n.indexOf(e))<0?[NaN,NaN]:[e>0?a[e-1]:r[0],e<a.length?a[e]:r[r.length-1]]},o.copy=function(){return t(r,n)},i()}([],[])},e.scale.quantize=function(){return function e(t,r,n){var a,i;function o(e){return n[Math.max(0,Math.min(i,Math.floor(a*(e-t))))]}function s(){return a=n.length/(r-t),i=n.length-1,o}return o.domain=function(e){return arguments.length?(t=+e[0],r=+e[e.length-1],s()):[t,r]},o.range=function(e){return arguments.length?(n=e,s()):n},o.invertExtent=function(e){return[e=(e=n.indexOf(e))<0?NaN:e/a+t,e+1/a]},o.copy=function(){return e(t,r,n)},s()}(0,1,[0,1])},e.scale.threshold=function(){return function t(r,n){function a(t){if(t<=t)return n[e.bisect(r,t)]}return a.domain=function(e){return arguments.length?(r=e,a):r},a.range=function(e){return arguments.length?(n=e,a):n},a.invertExtent=function(e){return e=n.indexOf(e),[r[e-1],r[e]]},a.copy=function(){return t(r,n)},a}([.5],[0,1])},e.scale.identity=function(){return function e(t){function r(e){return+e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=e.map(r),r):t},r.ticks=function(e){return qn(t,e)},r.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},r.copy=function(){return e(t)},r}([0,1])},e.svg={},e.svg.arc=function(){var e=Qn,t=ea,r=Kn,n=Jn,a=ta,i=ra,o=na;function s(){var s=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+t.apply(this,arguments)),u=a.apply(this,arguments)-Me,f=i.apply(this,arguments)-Me,p=Math.abs(f-u),h=u>f?0:1;if(c<s&&(d=c,c=s,s=d),p>=Se)return l(c,h)+(s?l(s,1-h):"")+"Z";var d,m,g,y,v,b,x,_,w,k,D,T,A=0,S=0,M=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===Jn?Math.sqrt(s*s+c*c):+n.apply(this,arguments),h||(S*=-1),c&&(S=Ne(g/c*Math.sin(y))),s&&(A=Ne(g/s*Math.sin(y)))),c){v=c*Math.cos(u+S),b=c*Math.sin(u+S),x=c*Math.cos(f-S),_=c*Math.sin(f-S);var E=Math.abs(f-u-2*S)<=Te?0:1;if(S&&aa(v,b,x,_)===h^E){var C=(u+f)/2;v=c*Math.cos(C),b=c*Math.sin(C),x=_=null}}else v=b=0;if(s){w=s*Math.cos(f-A),k=s*Math.sin(f-A),D=s*Math.cos(u+A),T=s*Math.sin(u+A);var N=Math.abs(u-f+2*A)<=Te?0:1;if(A&&aa(w,k,D,T)===1-h^N){var O=(u+f)/2;w=s*Math.cos(O),k=s*Math.sin(O),D=T=null}}else w=k=0;if(p>De&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s<c^h?0:1;var I=d,P=d;if(p<Te){var R=null==D?[w,k]:null==x?[v,b]:St([v,b],[D,T],[x,_],[w,k]),L=v-R[0],F=b-R[1],B=x-R[0],z=_-R[1],j=1/Math.sin(Math.acos((L*B+F*z)/(Math.sqrt(L*L+F*F)*Math.sqrt(B*B+z*z)))/2),U=Math.sqrt(R[0]*R[0]+R[1]*R[1]);P=Math.min(d,(s-U)/(j-1)),I=Math.min(d,(c-U)/(j+1))}if(null!=x){var $=ia(null==D?[w,k]:[D,T],[v,b],c,I,h),V=ia([x,_],[w,k],c,I,h);d===I?M.push("M",$[0],"A",I,",",I," 0 0,",m," ",$[1],"A",c,",",c," 0 ",1-h^aa($[1][0],$[1][1],V[1][0],V[1][1]),",",h," ",V[1],"A",I,",",I," 0 0,",m," ",V[0]):M.push("M",$[0],"A",I,",",I," 0 1,",m," ",V[0])}else M.push("M",v,",",b);if(null!=D){var q=ia([v,b],[D,T],s,-P,h),W=ia([w,k],null==x?[v,b]:[x,_],s,-P,h);d===P?M.push("L",W[0],"A",P,",",P," 0 0,",m," ",W[1],"A",s,",",s," 0 ",h^aa(W[1][0],W[1][1],q[1][0],q[1][1]),",",1-h," ",q[1],"A",P,",",P," 0 0,",m," ",q[0]):M.push("L",W[0],"A",P,",",P," 0 0,",m," ",q[0])}else M.push("L",w,",",k)}else M.push("M",v,",",b),null!=x&&M.push("A",c,",",c," 0 ",E,",",h," ",x,",",_),M.push("L",w,",",k),null!=D&&M.push("A",s,",",s," 0 ",N,",",1-h," ",D,",",T);return M.push("Z"),M.join("")}function l(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+-e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}return s.innerRadius=function(t){return arguments.length?(e=ct(t),s):e},s.outerRadius=function(e){return arguments.length?(t=ct(e),s):t},s.cornerRadius=function(e){return arguments.length?(r=ct(e),s):r},s.padRadius=function(e){return arguments.length?(n=e==Jn?Jn:ct(e),s):n},s.startAngle=function(e){return arguments.length?(a=ct(e),s):a},s.endAngle=function(e){return arguments.length?(i=ct(e),s):i},s.padAngle=function(e){return arguments.length?(o=ct(e),s):o},s.centroid=function(){var r=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-Me;return[Math.cos(n)*r,Math.sin(n)*r]},s};var Jn="auto";function Qn(e){return e.innerRadius}function ea(e){return e.outerRadius}function ta(e){return e.startAngle}function ra(e){return e.endAngle}function na(e){return e&&e.padAngle}function aa(e,t,r,n){return(e-r)*t-(t-n)*e>0?0:1}function ia(e,t,r,n,a){var i=e[0]-t[0],o=e[1]-t[1],s=(a?n:-n)/Math.sqrt(i*i+o*o),l=s*o,c=-s*i,u=e[0]+l,f=e[1]+c,p=t[0]+l,h=t[1]+c,d=(u+p)/2,m=(f+h)/2,g=p-u,y=h-f,v=g*g+y*y,b=r-n,x=u*h-p*f,_=(y<0?-1:1)*Math.sqrt(Math.max(0,b*b*v-x*x)),w=(x*y-g*_)/v,k=(-x*g-y*_)/v,D=(x*y+g*_)/v,T=(-x*g+y*_)/v,A=w-d,S=k-m,M=D-d,E=T-m;return A*A+S*S>M*M+E*E&&(w=D,k=T),[[w-l,k-c],[w*r/b,k*r/b]]}function oa(){return!0}function sa(e){var t=_t,r=wt,n=oa,a=ca,i=a.key,o=.7;function s(i){var s,l=[],c=[],u=-1,f=i.length,p=ct(t),h=ct(r);function d(){l.push("M",a(e(c),o))}for(;++u<f;)n.call(this,s=i[u],u)?c.push([+p.call(this,s,u),+h.call(this,s,u)]):c.length&&(d(),c=[]);return c.length&&d(),l.length?l.join(""):null}return s.x=function(e){return arguments.length?(t=e,s):t},s.y=function(e){return arguments.length?(r=e,s):r},s.defined=function(e){return arguments.length?(n=e,s):n},s.interpolate=function(e){return arguments.length?(i="function"==typeof e?a=e:(a=la.get(e)||ca).key,s):i},s.tension=function(e){return arguments.length?(o=e,s):o},s}e.svg.line=function(){return sa(C)};var la=e.map({linear:ca,"linear-closed":ua,step:function(e){for(var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];++t<r;)a.push("H",(n[0]+(n=e[t])[0])/2,"V",n[1]);return r>1&&a.push("H",n[0]),a.join("")},"step-before":fa,"step-after":pa,basis:ma,"basis-open":function(e){if(e.length<4)return ca(e);for(var t,r=[],n=-1,a=e.length,i=[0],o=[0];++n<3;)t=e[n],i.push(t[0]),o.push(t[1]);for(r.push(ga(ba,i)+","+ga(ba,o)),--n;++n<a;)t=e[n],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),xa(r,i,o);return r.join("")},"basis-closed":function(e){for(var t,r,n=-1,a=e.length,i=a+4,o=[],s=[];++n<4;)r=e[n%a],o.push(r[0]),s.push(r[1]);for(t=[ga(ba,o),",",ga(ba,s)],--n;++n<i;)r=e[n%a],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),xa(t,o,s);return t.join("")},bundle:function(e,t){var r=e.length-1;if(r)for(var n,a,i=e[0][0],o=e[0][1],s=e[r][0]-i,l=e[r][1]-o,c=-1;++c<=r;)a=c/r,(n=e[c])[0]=t*n[0]+(1-t)*(i+a*s),n[1]=t*n[1]+(1-t)*(o+a*l);return ma(e)},cardinal:function(e,t){return e.length<3?ca(e):e[0]+ha(e,da(e,t))},"cardinal-open":function(e,t){return e.length<4?ca(e):e[1]+ha(e.slice(1,-1),da(e,t))},"cardinal-closed":function(e,t){return e.length<3?ua(e):e[0]+ha((e.push(e[0]),e),da([e[e.length-2]].concat(e,[e[1]]),t))},monotone:function(e){return e.length<3?ca(e):e[0]+ha(e,function(e){for(var t,r,n,a,i=[],o=function(e){for(var t=0,r=e.length-1,n=[],a=e[0],i=e[1],o=n[0]=_a(a,i);++t<r;)n[t]=(o+(o=_a(a=i,i=e[t+1])))/2;return n[t]=o,n}(e),s=-1,l=e.length-1;++s<l;)t=_a(e[s],e[s+1]),v(t)<De?o[s]=o[s+1]=0:(a=(r=o[s]/t)*r+(n=o[s+1]/t)*n)>9&&(a=3*t/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n);for(s=-1;++s<=l;)a=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),i.push([a||0,o[s]*a||0]);return i}(e))}});function ca(e){return e.length>1?e.join("L"):e+"Z"}function ua(e){return e.join("L")+"Z"}function fa(e){for(var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];++t<r;)a.push("V",(n=e[t])[1],"H",n[0]);return a.join("")}function pa(e){for(var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];++t<r;)a.push("H",(n=e[t])[0],"V",n[1]);return a.join("")}function ha(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return ca(e);var r=e.length!=t.length,n="",a=e[0],i=e[1],o=t[0],s=o,l=1;if(r&&(n+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],a=e[1],l=2),t.length>1){s=t[1],i=e[l],l++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var c=2;c<t.length;c++,l++)i=e[l],s=t[c],n+="S"+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1]}if(r){var u=e[l];n+="Q"+(i[0]+2*s[0]/3)+","+(i[1]+2*s[1]/3)+","+u[0]+","+u[1]}return n}function da(e,t){for(var r,n=[],a=(1-t)/2,i=e[0],o=e[1],s=1,l=e.length;++s<l;)r=i,i=o,o=e[s],n.push([a*(o[0]-r[0]),a*(o[1]-r[1])]);return n}function ma(e){if(e.length<3)return ca(e);var t=1,r=e.length,n=e[0],a=n[0],i=n[1],o=[a,a,a,(n=e[1])[0]],s=[i,i,i,n[1]],l=[a,",",i,"L",ga(ba,o),",",ga(ba,s)];for(e.push(e[r-1]);++t<=r;)n=e[t],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),xa(l,o,s);return e.pop(),l.push("L",n),l.join("")}function ga(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}la.forEach((function(e,t){t.key=e,t.closed=/-closed$/.test(e)}));var ya=[0,2/3,1/3,0],va=[0,1/3,2/3,0],ba=[0,1/6,2/3,1/6];function xa(e,t,r){e.push("C",ga(ya,t),",",ga(ya,r),",",ga(va,t),",",ga(va,r),",",ga(ba,t),",",ga(ba,r))}function _a(e,t){return(t[1]-e[1])/(t[0]-e[0])}function wa(e){for(var t,r,n,a=-1,i=e.length;++a<i;)r=(t=e[a])[0],n=t[1]-Me,t[0]=r*Math.cos(n),t[1]=r*Math.sin(n);return e}function ka(e){var t=_t,r=_t,n=0,a=wt,i=oa,o=ca,s=o.key,l=o,c="L",u=.7;function f(s){var f,p,h,d=[],m=[],g=[],y=-1,v=s.length,b=ct(t),x=ct(n),_=t===r?function(){return p}:ct(r),w=n===a?function(){return h}:ct(a);function k(){d.push("M",o(e(g),u),c,l(e(m.reverse()),u),"Z")}for(;++y<v;)i.call(this,f=s[y],y)?(m.push([p=+b.call(this,f,y),h=+x.call(this,f,y)]),g.push([+_.call(this,f,y),+w.call(this,f,y)])):m.length&&(k(),m=[],g=[]);return m.length&&k(),d.length?d.join(""):null}return f.x=function(e){return arguments.length?(t=r=e,f):r},f.x0=function(e){return arguments.length?(t=e,f):t},f.x1=function(e){return arguments.length?(r=e,f):r},f.y=function(e){return arguments.length?(n=a=e,f):a},f.y0=function(e){return arguments.length?(n=e,f):n},f.y1=function(e){return arguments.length?(a=e,f):a},f.defined=function(e){return arguments.length?(i=e,f):i},f.interpolate=function(e){return arguments.length?(s="function"==typeof e?o=e:(o=la.get(e)||ca).key,l=o.reverse||o,c=o.closed?"M":"L",f):s},f.tension=function(e){return arguments.length?(u=e,f):u},f}function Da(e){return e.source}function Ta(e){return e.target}function Aa(e){return e.radius}function Sa(e){return[e.x,e.y]}function Ma(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Me;return[r*Math.cos(n),r*Math.sin(n)]}}function Ea(){return 64}function Ca(){return"circle"}function Na(e){var t=Math.sqrt(e/Te);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}e.svg.line.radial=function(){var e=sa(wa);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},fa.reverse=pa,pa.reverse=fa,e.svg.area=function(){return ka(C)},e.svg.area.radial=function(){var e=ka(wa);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},e.svg.chord=function(){var e=Da,t=Ta,r=Aa,n=ta,a=ra;function i(r,n){var a,i,c=o(this,e,r,n),u=o(this,t,r,n);return"M"+c.p0+s(c.r,c.p1,c.a1-c.a0)+(i=u,((a=c).a0==i.a0&&a.a1==i.a1?l(c.r,c.p1,c.r,c.p0):l(c.r,c.p1,u.r,u.p0)+s(u.r,u.p1,u.a1-u.a0)+l(u.r,u.p1,c.r,c.p0))+"Z")}function o(e,t,i,o){var s=t.call(e,i,o),l=r.call(e,s,o),c=n.call(e,s,o)-Me,u=a.call(e,s,o)-Me;return{r:l,a0:c,a1:u,p0:[l*Math.cos(c),l*Math.sin(c)],p1:[l*Math.cos(u),l*Math.sin(u)]}}function s(e,t,r){return"A"+e+","+e+" 0 "+ +(r>Te)+",1 "+t}function l(e,t,r,n){return"Q 0,0 "+n}return i.radius=function(e){return arguments.length?(r=ct(e),i):r},i.source=function(t){return arguments.length?(e=ct(t),i):e},i.target=function(e){return arguments.length?(t=ct(e),i):t},i.startAngle=function(e){return arguments.length?(n=ct(e),i):n},i.endAngle=function(e){return arguments.length?(a=ct(e),i):a},i},e.svg.diagonal=function(){var e=Da,t=Ta,r=Sa;function n(n,a){var i=e.call(this,n,a),o=t.call(this,n,a),s=(i.y+o.y)/2,l=[i,{x:i.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(t){return arguments.length?(e=ct(t),n):e},n.target=function(e){return arguments.length?(t=ct(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),r=Sa,n=t.projection;return t.projection=function(e){return arguments.length?n(Ma(r=e)):r},t},e.svg.symbol=function(){var e=Ca,t=Ea;function r(r,n){return(Oa.get(e.call(this,r,n))||Na)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=ct(t),r):e},r.size=function(e){return arguments.length?(t=ct(e),r):t},r};var Oa=e.map({circle:Na,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Pa)),r=t*Pa;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Ia),r=t*Ia/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Ia),r=t*Ia/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});e.svg.symbolTypes=Oa.keys();var Ia=Math.sqrt(3),Pa=Math.tan(30*Ee);H.transition=function(e){for(var t,r,n=Ba||++Ua,a=qa(e),i=[],o=za||{time:Date.now(),ease:Mr,delay:0,duration:250},s=-1,l=this.length;++s<l;){i.push(t=[]);for(var c=this[s],u=-1,f=c.length;++u<f;)(r=c[u])&&Wa(r,u,a,n,o),t.push(r)}return Fa(i,a,n)},H.interrupt=function(e){return this.each(null==e?Ra:La(qa(e)))};var Ra=La(qa());function La(e){return function(){var t,r,n;(t=this[e])&&(n=t[r=t.active])&&(n.timer.c=null,n.timer.t=NaN,--t.count?delete t[r]:delete this[e],t.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Fa(e,t,r){return U(e,ja),e.namespace=t,e.id=r,e}var Ba,za,ja=[],Ua=0;function $a(e,t,r,n){var a=e.id,i=e.namespace;return ue(e,"function"==typeof r?function(e,o,s){e[i][a].tween.set(t,n(r.call(e,e.__data__,o,s)))}:(r=n(r),function(e){e[i][a].tween.set(t,r)}))}function Va(e){return null==e&&(e=""),function(){this.textContent=e}}function qa(e){return null==e?"__transition__":"__transition_"+e+"__"}function Wa(e,t,r,n,a){var i,o,s,l,c,u=e[r]||(e[r]={active:0,count:0}),f=u[n];function p(r){var a=u.active,p=u[a];for(var d in p&&(p.timer.c=null,p.timer.t=NaN,--u.count,delete u[a],p.event&&p.event.interrupt.call(e,e.__data__,p.index)),u)if(+d<n){var m=u[d];m.timer.c=null,m.timer.t=NaN,--u.count,delete u[d]}o.c=h,yt((function(){return o.c&&h(r||1)&&(o.c=null,o.t=NaN),1}),0,i),u.active=n,f.event&&f.event.start.call(e,e.__data__,t),c=[],f.tween.forEach((function(r,n){(n=n.call(e,e.__data__,t))&&c.push(n)})),l=f.ease,s=f.duration}function h(a){for(var i=a/s,o=l(i),p=c.length;p>0;)c[--p].call(e,o);if(i>=1)return f.event&&f.event.end.call(e,e.__data__,t),--u.count?delete u[n]:delete e[r],1}f||(i=a.time,o=yt((function(e){var t=f.delay;if(o.t=t+i,t<=e)return p(e-t);o.c=p}),0,i),f=u[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:t},a=null,++u.count)}ja.call=H.call,ja.empty=H.empty,ja.node=H.node,ja.size=H.size,e.transition=function(t,r){return t&&t.transition?Ba?t.transition(r):t:e.selection().transition(t)},e.transition.prototype=ja,ja.select=function(e){var t,r,n,a=this.id,i=this.namespace,o=[];e=G(e);for(var s=-1,l=this.length;++s<l;){o.push(t=[]);for(var c=this[s],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=e.call(n,n.__data__,u,s))?("__data__"in n&&(r.__data__=n.__data__),Wa(r,u,i,a,n[i][a]),t.push(r)):t.push(null)}return Fa(o,i,a)},ja.selectAll=function(e){var t,r,n,a,i,o=this.id,s=this.namespace,l=[];e=X(e);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],p=-1,h=f.length;++p<h;)if(n=f[p]){i=n[s][o],r=e.call(n,n.__data__,p,c),l.push(t=[]);for(var d=-1,m=r.length;++d<m;)(a=r[d])&&Wa(a,d,s,o,i),t.push(a)}return Fa(l,s,o)},ja.filter=function(e){var t,r,n=[];"function"!=typeof e&&(e=le(e));for(var a=0,i=this.length;a<i;a++){n.push(t=[]);for(var o,s=0,l=(o=this[a]).length;s<l;s++)(r=o[s])&&e.call(r,r.__data__,s,a)&&t.push(r)}return Fa(n,this.namespace,this.id)},ja.tween=function(e,t){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(e):ue(this,null==t?function(t){t[n][r].tween.remove(e)}:function(a){a[n][r].tween.set(e,t)})},ja.attr=function(t,r){if(arguments.length<2){for(r in t)this.attr(r,t[r]);return this}var n="transform"==t?zr:vr,a=e.ns.qualify(t);function i(){this.removeAttribute(a)}function o(){this.removeAttributeNS(a.space,a.local)}function s(e){return null==e?i:(e+="",function(){var t,r=this.getAttribute(a);return r!==e&&(t=n(r,e),function(e){this.setAttribute(a,t(e))})})}function l(e){return null==e?o:(e+="",function(){var t,r=this.getAttributeNS(a.space,a.local);return r!==e&&(t=n(r,e),function(e){this.setAttributeNS(a.space,a.local,t(e))})})}return $a(this,"attr."+t,r,a.local?l:s)},ja.attrTween=function(t,r){var n=e.ns.qualify(t);return this.tween("attr."+t,n.local?function(e,t){var a=r.call(this,e,t,this.getAttributeNS(n.space,n.local));return a&&function(e){this.setAttributeNS(n.space,n.local,a(e))}}:function(e,t){var a=r.call(this,e,t,this.getAttribute(n));return a&&function(e){this.setAttribute(n,a(e))}})},ja.style=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=""),e)this.style(r,e[r],t);return this}r=""}function a(){this.style.removeProperty(e)}function i(t){return null==t?a:(t+="",function(){var n,a=o(this).getComputedStyle(this,null).getPropertyValue(e);return a!==t&&(n=vr(a,t),function(t){this.style.setProperty(e,n(t),r)})})}return $a(this,"style."+e,t,i)},ja.styleTween=function(e,t,r){function n(n,a){var i=t.call(this,n,a,o(this).getComputedStyle(this,null).getPropertyValue(e));return i&&function(t){this.style.setProperty(e,i(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+e,n)},ja.text=function(e){return $a(this,"text",e,Va)},ja.remove=function(){var e=this.namespace;return this.each("end.transition",(function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)}))},ja.ease=function(t){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof t&&(t=e.ease.apply(e,arguments)),ue(this,(function(e){e[n][r].ease=t})))},ja.delay=function(e){var t=this.id,r=this.namespace;return arguments.length<1?this.node()[r][t].delay:ue(this,"function"==typeof e?function(n,a,i){n[r][t].delay=+e.call(n,n.__data__,a,i)}:(e=+e,function(n){n[r][t].delay=e}))},ja.duration=function(e){var t=this.id,r=this.namespace;return arguments.length<1?this.node()[r][t].duration:ue(this,"function"==typeof e?function(n,a,i){n[r][t].duration=Math.max(1,e.call(n,n.__data__,a,i))}:(e=Math.max(1,e),function(n){n[r][t].duration=e}))},ja.each=function(t,r){var n=this.id,a=this.namespace;if(arguments.length<2){var i=za,o=Ba;try{Ba=n,ue(this,(function(e,r,i){za=e[a][n],t.call(e,e.__data__,r,i)}))}finally{za=i,Ba=o}}else ue(this,(function(i){var o=i[a][n];(o.event||(o.event=e.dispatch("start","end","interrupt"))).on(t,r)}));return this},ja.transition=function(){for(var e,t,r,n=this.id,a=++Ua,i=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(e=[]);for(var c,u=0,f=(c=this[s]).length;u<f;u++)(t=c[u])&&Wa(t,u,i,a,{time:(r=t[i][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),e.push(t)}return Fa(o,i,a)},e.svg.axis=function(){var t,r=e.scale.linear(),a=Ha,i=6,o=6,s=3,l=[10],c=null;function u(n){n.each((function(){var n,u=e.select(this),f=this.__chart__||r,p=this.__chart__=r.copy(),h=null==c?p.ticks?p.ticks.apply(p,l):p.domain():c,d=null==t?p.tickFormat?p.tickFormat.apply(p,l):C:t,m=u.selectAll(".tick").data(h,p),g=m.enter().insert("g",".domain").attr("class","tick").style("opacity",De),y=e.transition(m.exit()).style("opacity",De).remove(),v=e.transition(m.order()).style("opacity",1),b=Math.max(i,0)+s,x=Rn(p),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),e.transition(_));g.append("line"),g.append("text");var k,D,T,A,S=g.select("line"),M=v.select("line"),E=m.select("text").text(d),N=g.select("text"),O=v.select("text"),I="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(n=Xa,k="x",T="y",D="x2",A="y2",E.attr("dy",I<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+I*o+"V0H"+x[1]+"V"+I*o)):(n=Ya,k="y",T="x",D="y2",A="x2",E.attr("dy",".32em").style("text-anchor",I<0?"end":"start"),w.attr("d","M"+I*o+","+x[0]+"H0V"+x[1]+"H"+I*o)),S.attr(A,I*i),N.attr(T,I*b),M.attr(D,0).attr(A,I*i),O.attr(k,0).attr(T,I*b),p.rangeBand){var P=p,R=P.rangeBand()/2;f=p=function(e){return P(e)+R}}else f.rangeBand?f=p:y.call(n,p,f);g.call(n,f,p),v.call(n,p,p)}))}return u.scale=function(e){return arguments.length?(r=e,u):r},u.orient=function(e){return arguments.length?(a=e in Ga?e+"":Ha,u):a},u.ticks=function(){return arguments.length?(l=n(arguments),u):l},u.tickValues=function(e){return arguments.length?(c=e,u):c},u.tickFormat=function(e){return arguments.length?(t=e,u):t},u.tickSize=function(e){var t=arguments.length;return t?(i=+e,o=+arguments[t-1],u):i},u.innerTickSize=function(e){return arguments.length?(i=+e,u):i},u.outerTickSize=function(e){return arguments.length?(o=+e,u):o},u.tickPadding=function(e){return arguments.length?(s=+e,u):s},u.tickSubdivide=function(){return arguments.length&&u},u};var Ha="bottom",Ga={top:1,right:1,bottom:1,left:1};function Xa(e,t,r){e.attr("transform",(function(e){var n=t(e);return"translate("+(isFinite(n)?n:r(e))+",0)"}))}function Ya(e,t,r){e.attr("transform",(function(e){var n=t(e);return"translate(0,"+(isFinite(n)?n:r(e))+")"}))}e.svg.brush=function(){var t,r,n=z(p,"brushstart","brush","brushend"),a=null,i=null,s=[0,0],l=[0,0],c=!0,u=!0,f=Ka[0];function p(t){t.each((function(){var t=e.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",g).on("touchstart.brush",g),r=t.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=t.selectAll(".resize").data(f,C);n.exit().remove(),n.enter().append("g").attr("class",(function(e){return"resize "+e})).style("cursor",(function(e){return Za[e]})).append("rect").attr("x",(function(e){return/[ew]$/.test(e)?-3:null})).attr("y",(function(e){return/^[ns]/.test(e)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",p.empty()?"none":null);var o,s=e.transition(t),l=e.transition(r);a&&(o=Rn(a),l.attr("x",o[0]).attr("width",o[1]-o[0]),d(s)),i&&(o=Rn(i),l.attr("y",o[0]).attr("height",o[1]-o[0]),m(s)),h(s)}))}function h(e){e.selectAll(".resize").attr("transform",(function(e){return"translate("+s[+/e$/.test(e)]+","+l[+/^s/.test(e)]+")"}))}function d(e){e.select(".extent").attr("x",s[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function m(e){e.select(".extent").attr("y",l[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var f,g,y=this,v=e.select(e.event.target),b=n.of(y,arguments),x=e.select(y),_=v.datum(),w=!/^(n|s)$/.test(_)&&a,k=!/^(e|w)$/.test(_)&&i,D=v.classed("extent"),T=xe(y),A=e.mouse(y),S=e.select(o(y)).on("keydown.brush",C).on("keyup.brush",N);if(e.event.changedTouches?S.on("touchmove.brush",O).on("touchend.brush",P):S.on("mousemove.brush",O).on("mouseup.brush",P),x.interrupt().selectAll("*").interrupt(),D)A[0]=s[0]-A[0],A[1]=l[0]-A[1];else if(_){var M=+/w$/.test(_),E=+/^n/.test(_);g=[s[1-M]-A[0],l[1-E]-A[1]],A[0]=s[M],A[1]=l[E]}else e.event.altKey&&(f=A.slice());function C(){32==e.event.keyCode&&(D||(f=null,A[0]-=s[1],A[1]-=l[1],D=2),F())}function N(){32==e.event.keyCode&&2==D&&(A[0]+=s[1],A[1]+=l[1],D=0,F())}function O(){var t=e.mouse(y),r=!1;g&&(t[0]+=g[0],t[1]+=g[1]),D||(e.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),A[0]=s[+(t[0]<f[0])],A[1]=l[+(t[1]<f[1])]):f=null),w&&I(t,a,0)&&(d(x),r=!0),k&&I(t,i,1)&&(m(x),r=!0),r&&(h(x),b({type:"brush",mode:D?"move":"resize"}))}function I(e,n,a){var i,o,p=Rn(n),h=p[0],d=p[1],m=A[a],g=a?l:s,y=g[1]-g[0];if(D&&(h-=m,d-=y+m),i=(a?u:c)?Math.max(h,Math.min(d,e[a])):e[a],D?o=(i+=m)+y:(f&&(m=Math.max(h,Math.min(d,2*f[a]-i))),m<i?(o=i,i=m):o=m),g[0]!=i||g[1]!=o)return a?r=null:t=null,g[0]=i,g[1]=o,!0}function P(){O(),x.style("pointer-events","all").selectAll(".resize").style("display",p.empty()?"none":null),e.select("body").style("cursor",null),S.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),T(),b({type:"brushend"})}x.style("pointer-events","none").selectAll(".resize").style("display",null),e.select("body").style("cursor",v.style("cursor")),b({type:"brushstart"}),O()}return p.event=function(a){a.each((function(){var a=n.of(this,arguments),i={x:s,y:l,i:t,j:r},o=this.__chart__||i;this.__chart__=i,Ba?e.select(this).transition().each("start.brush",(function(){t=o.i,r=o.j,s=o.x,l=o.y,a({type:"brushstart"})})).tween("brush:brush",(function(){var e=br(s,i.x),n=br(l,i.y);return t=r=null,function(t){s=i.x=e(t),l=i.y=n(t),a({type:"brush",mode:"resize"})}})).each("end.brush",(function(){t=i.i,r=i.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})})):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))}))},p.x=function(e){return arguments.length?(f=Ka[!(a=e)<<1|!i],p):a},p.y=function(e){return arguments.length?(f=Ka[!a<<1|!(i=e)],p):i},p.clamp=function(e){return arguments.length?(a&&i?(c=!!e[0],u=!!e[1]):a?c=!!e:i&&(u=!!e),p):a&&i?[c,u]:a?c:i?u:null},p.extent=function(e){var n,o,c,u,f;return arguments.length?(a&&(n=e[0],o=e[1],i&&(n=n[0],o=o[0]),t=[n,o],a.invert&&(n=a(n),o=a(o)),o<n&&(f=n,n=o,o=f),n==s[0]&&o==s[1]||(s=[n,o])),i&&(c=e[0],u=e[1],a&&(c=c[1],u=u[1]),r=[c,u],i.invert&&(c=i(c),u=i(u)),u<c&&(f=c,c=u,u=f),c==l[0]&&u==l[1]||(l=[c,u])),p):(a&&(t?(n=t[0],o=t[1]):(n=s[0],o=s[1],a.invert&&(n=a.invert(n),o=a.invert(o)),o<n&&(f=n,n=o,o=f))),i&&(r?(c=r[0],u=r[1]):(c=l[0],u=l[1],i.invert&&(c=i.invert(c),u=i.invert(u)),u<c&&(f=c,c=u,u=f))),a&&i?[[n,c],[o,u]]:a?[n,o]:i&&[c,u])},p.clear=function(){return p.empty()||(s=[0,0],l=[0,0],t=r=null),p},p.empty=function(){return!!a&&s[0]==s[1]||!!i&&l[0]==l[1]},e.rebind(p,n,"on")};var Za={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ka=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];function Ja(e){return JSON.parse(e.responseText)}function Qa(e){var t=a.createRange();return t.selectNode(a.body),t.createContextualFragment(e.responseText)}e.text=ut((function(e){return e.responseText})),e.json=function(e,t){return ft(e,"application/json",Ja,t)},e.html=function(e,t){return ft(e,"text/html",Qa,t)},e.xml=ut((function(e){return e.responseXML})),"object"==typeof t&&t.exports?t.exports=e:this.d3=e}).apply(self)},{}],59:[function(e,t,r){"use strict";t.exports=e("./quad")},{"./quad":60}],60:[function(e,t,r){"use strict";var n=e("binary-search-bounds"),a=e("clamp"),i=e("parse-rect"),o=e("array-bounds"),s=e("pick-by-alias"),l=e("defined"),c=e("flatten-vertex-data"),u=e("is-obj"),f=e("dtype"),p=e("math-log2");function h(e,t){for(var r=t[0],n=t[1],i=1/(t[2]-r),o=1/(t[3]-n),s=new Array(e.length),l=0,c=e.length/2;l<c;l++)s[2*l]=a((e[2*l]-r)*i,0,1),s[2*l+1]=a((e[2*l+1]-n)*o,0,1);return s}t.exports=function(e,t){t||(t={}),e=c(e,"float64"),t=s(t,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});var r=l(t.maxDepth,255),a=l(t.bounds,o(e,2));a[0]===a[2]&&a[2]++,a[1]===a[3]&&a[3]++;var d,m=h(e,a),g=e.length>>>1;t.dtype||(t.dtype="array"),"string"==typeof t.dtype?d=new(f(t.dtype))(g):t.dtype&&(d=t.dtype,Array.isArray(d)&&(d.length=g));for(var y=0;y<g;++y)d[y]=y;var v=[],b=[],x=[],_=[];!function e(t,n,a,i,o,s){if(!i.length)return null;var l=v[o]||(v[o]=[]),c=x[o]||(x[o]=[]),u=b[o]||(b[o]=[]),f=l.length;if(++o>r||s>1073741824){for(var p=0;p<i.length;p++)l.push(i[p]),c.push(s),u.push(null,null,null,null);return f}if(l.push(i[0]),c.push(s),i.length<=1)return u.push(null,null,null,null),f;for(var h=.5*a,d=t+h,g=n+h,y=[],_=[],w=[],k=[],D=1,T=i.length;D<T;D++){var A=i[D],S=m[2*A],M=m[2*A+1];S<d?M<g?y.push(A):_.push(A):M<g?w.push(A):k.push(A)}return s<<=2,u.push(e(t,n,h,y,o,s),e(t,g,h,_,o,s+1),e(d,n,h,w,o,s+2),e(d,g,h,k,o,s+3)),f}(0,0,1,d,0,1);for(var w=0,k=0;k<v.length;k++){var D=v[k];if(d.set)d.set(D,w);else for(var T=0,A=D.length;T<A;T++)d[T+w]=D[T];var S=w+v[k].length;_[k]=[w,S],w=S}return d.range=function(){for(var t,r=[],n=arguments.length;n--;)r[n]=arguments[n];if(u(r[r.length-1])){var o=r.pop();r.length||null==o.x&&null==o.l&&null==o.left||(r=[o],t={}),t=s(o,{level:"level maxLevel",d:"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize",lod:"lod details ranges offsets"})}else t={};r.length||(r=a);var c,f=i.apply(void 0,r),d=[Math.min(f.x,f.x+f.width),Math.min(f.y,f.y+f.height),Math.max(f.x,f.x+f.width),Math.max(f.y,f.y+f.height)],m=d[0],g=d[1],y=d[2],x=d[3],_=h([m,g,y,x],a),w=_[0],k=_[1],D=_[2],T=_[3],A=l(t.level,v.length);if(null!=t.d&&("number"==typeof t.d?c=[t.d,t.d]:t.d.length&&(c=t.d),A=Math.min(Math.max(Math.ceil(-p(Math.abs(c[0])/(a[2]-a[0]))),Math.ceil(-p(Math.abs(c[1])/(a[3]-a[1])))),A)),A=Math.min(A,v.length),t.lod)return M(w,k,D,T,A);var S=[];function E(t,r,n,a,i,o){if(null!==i&&null!==o&&!(w>t+n||k>r+n||D<t||T<r||a>=A||i===o)){var s=v[a];void 0===o&&(o=s.length);for(var l=i;l<o;l++){var c=s[l],u=e[2*c],f=e[2*c+1];u>=m&&u<=y&&f>=g&&f<=x&&S.push(c)}var p=b[a],h=p[4*i+0],d=p[4*i+1],_=p[4*i+2],M=p[4*i+3],N=C(p,i+1),O=.5*n,I=a+1;E(t,r,O,I,h,d||_||M||N),E(t,r+O,O,I,d,_||M||N),E(t+O,r,O,I,_,M||N),E(t+O,r+O,O,I,M,N)}}function C(e,t){for(var r=null,n=0;null===r;)if(r=e[4*t+n],++n>e.length)return null;return r}return E(0,0,1,0,0,1),S},d;function M(e,t,r,a,i){for(var o=[],s=0;s<i;s++){var l=x[s],c=_[s][0],u=E(e,t,s),f=E(r,a,s),p=n.ge(l,u),h=n.gt(l,f,p,l.length-1);o[s]=[p+c,h+c]}return o}function E(e,t,r){for(var n=1,a=.5,i=.5,o=.5,s=0;s<r;s++)n<<=2,n+=e<a?t<i?0:1:t<i?2:3,o*=.5,a+=e<a?-o:o,i+=t<i?-o:o;return n}}},{"array-bounds":71,"binary-search-bounds":80,clamp:86,defined:124,dtype:127,"flatten-vertex-data":191,"is-obj":235,"math-log2":240,"parse-rect":249,"pick-by-alias":253}],61:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("@turf/meta");function a(e){var t=0;if(e&&e.length>0){t+=Math.abs(i(e[0]));for(var r=1;r<e.length;r++)t-=Math.abs(i(e[r]))}return t}function i(e){var t,r,n,a,i,s,l=0,c=e.length;if(c>2){for(s=0;s<c;s++)s===c-2?(n=c-2,a=c-1,i=0):s===c-1?(n=c-1,a=0,i=1):(n=s,a=s+1,i=s+2),t=e[n],r=e[a],l+=(o(e[i][0])-o(t[0]))*Math.sin(o(r[1]));l=6378137*l*6378137/2}return l}function o(e){return e*Math.PI/180}r.default=function(e){return n.geomReduce(e,(function(e,t){return e+function(e){var t,r=0;switch(e.type){case"Polygon":return a(e.coordinates);case"MultiPolygon":for(t=0;t<e.coordinates.length;t++)r+=a(e.coordinates[t]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(t)}),0)}},{"@turf/meta":63}],62:[function(e,t,r){"use strict";function n(e,t,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function a(e,t,r){if(void 0===r&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!d(e[0])||!d(e[1]))throw new Error("coordinates must contain numbers");return n({type:"Point",coordinates:e},t,r)}function i(e,t,r){void 0===r&&(r={});for(var a=0,i=e;a<i.length;a++){var o=i[a];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:e},t,r)}function o(e,t,r){if(void 0===r&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:e},t,r)}function s(e,t){void 0===t&&(t={});var r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function l(e,t,r){return void 0===r&&(r={}),n({type:"MultiLineString",coordinates:e},t,r)}function c(e,t,r){return void 0===r&&(r={}),n({type:"MultiPoint",coordinates:e},t,r)}function u(e,t,r){return void 0===r&&(r={}),n({type:"MultiPolygon",coordinates:e},t,r)}function f(e,t){void 0===t&&(t="kilometers");var n=r.factors[t];if(!n)throw new Error(t+" units is invalid");return e*n}function p(e,t){void 0===t&&(t="kilometers");var n=r.factors[t];if(!n)throw new Error(t+" units is invalid");return e/n}function h(e){return e%(2*Math.PI)*180/Math.PI}function d(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=6371008.8,r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:1.0936*r.earthRadius},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},r.feature=n,r.geometry=function(e,t,r){switch(void 0===r&&(r={}),e){case"Point":return a(t).geometry;case"LineString":return o(t).geometry;case"Polygon":return i(t).geometry;case"MultiPoint":return c(t).geometry;case"MultiLineString":return l(t).geometry;case"MultiPolygon":return u(t).geometry;default:throw new Error(e+" is invalid")}},r.point=a,r.points=function(e,t,r){return void 0===r&&(r={}),s(e.map((function(e){return a(e,t)})),r)},r.polygon=i,r.polygons=function(e,t,r){return void 0===r&&(r={}),s(e.map((function(e){return i(e,t)})),r)},r.lineString=o,r.lineStrings=function(e,t,r){return void 0===r&&(r={}),s(e.map((function(e){return o(e,t)})),r)},r.featureCollection=s,r.multiLineString=l,r.multiPoint=c,r.multiPolygon=u,r.geometryCollection=function(e,t,r){return void 0===r&&(r={}),n({type:"GeometryCollection",geometries:e},t,r)},r.round=function(e,t){if(void 0===t&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},r.radiansToLength=f,r.lengthToRadians=p,r.lengthToDegrees=function(e,t){return h(p(e,t))},r.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},r.radiansToDegrees=h,r.degreesToRadians=function(e){return e%360*Math.PI/180},r.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return f(p(e,t),r)},r.convertArea=function(e,t,n){if(void 0===t&&(t="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var a=r.areaFactors[t];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return e/a*i},r.isNumber=d,r.isObject=function(e){return!!e&&e.constructor===Object},r.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!d(e))throw new Error("bbox must only contain numbers")}))},r.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},{}],63:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("@turf/helpers");function a(e,t,r){if(null!==e)for(var n,i,o,s,l,c,u,f,p=0,h=0,d=e.type,m="FeatureCollection"===d,g="Feature"===d,y=m?e.features.length:1,v=0;v<y;v++){l=(f=!!(u=m?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var b=0;b<l;b++){var x=0,_=0;if(null!==(s=f?u.geometries[b]:u)){c=s.coordinates;var w=s.type;switch(p=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(c,h,v,x,_))return!1;h++,x++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(!1===t(c[n],h,v,x,_))return!1;h++,"MultiPoint"===w&&x++}"LineString"===w&&x++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(i=0;i<c[n].length-p;i++){if(!1===t(c[n][i],h,v,x,_))return!1;h++}"MultiLineString"===w&&x++,"Polygon"===w&&_++}"Polygon"===w&&x++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(_=0,i=0;i<c[n].length;i++){for(o=0;o<c[n][i].length-p;o++){if(!1===t(c[n][i][o],h,v,x,_))return!1;h++}_++}x++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===a(s.geometries[n],t,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function i(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&!1!==t(e.features[r].properties,r);r++);break;case"Feature":t(e.properties,0)}}function o(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var r=0;r<e.features.length&&!1!==t(e.features[r],r);r++);}function s(e,t){var r,n,a,i,o,s,l,c,u,f,p=0,h="FeatureCollection"===e.type,d="Feature"===e.type,m=h?e.features.length:1;for(r=0;r<m;r++){for(s=h?e.features[r].geometry:d?e.geometry:e,c=h?e.features[r].properties:d?e.properties:{},u=h?e.features[r].bbox:d?e.bbox:void 0,f=h?e.features[r].id:d?e.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,a=0;a<o;a++)if(null!==(i=l?s.geometries[a]:s))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(i,p,c,u,f))return!1;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===t(i.geometries[n],p,c,u,f))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,p,c,u,f))return!1;p++}}function l(e,t){s(e,(function(e,r,a,i,o){var s,l=null===e?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==t(n.feature(e,a,{bbox:i,id:o}),r,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var c=0;c<e.coordinates.length;c++){var u={type:s,coordinates:e.coordinates[c]};if(!1===t(n.feature(u,a),r,c))return!1}}))}function c(e,t){l(e,(function(e,r,i){var o=0;if(e.geometry){var s=e.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,c=0,u=0,f=0;return!1!==a(e,(function(a,s,p,h,d){if(void 0===l||r>c||h>u||d>f)return l=a,c=r,u=h,f=d,void(o=0);var m=n.lineString([l,a],e.properties);if(!1===t(m,r,i,d,o))return!1;o++,l=a}))&&void 0}}}))}function u(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,a){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,r,a,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===t(n.lineString(o[s],e.properties),r,a,s))return!1}}}))}r.coordEach=a,r.coordReduce=function(e,t,r,n){var i=r;return a(e,(function(e,n,a,o,s){i=0===n&&void 0===r?e:t(i,e,n,a,o,s)}),n),i},r.propEach=i,r.propReduce=function(e,t,r){var n=r;return i(e,(function(e,a){n=0===a&&void 0===r?e:t(n,e,a)})),n},r.featureEach=o,r.featureReduce=function(e,t,r){var n=r;return o(e,(function(e,a){n=0===a&&void 0===r?e:t(n,e,a)})),n},r.coordAll=function(e){var t=[];return a(e,(function(e){t.push(e)})),t},r.geomEach=s,r.geomReduce=function(e,t,r){var n=r;return s(e,(function(e,a,i,o,s){n=0===a&&void 0===r?e:t(n,e,a,i,o,s)})),n},r.flattenEach=l,r.flattenReduce=function(e,t,r){var n=r;return l(e,(function(e,a,i){n=0===a&&0===i&&void 0===r?e:t(n,e,a,i)})),n},r.segmentEach=c,r.segmentReduce=function(e,t,r){var n=r,a=!1;return c(e,(function(e,i,o,s,l){n=!1===a&&void 0===r?e:t(n,e,i,o,s,l),a=!0})),n},r.lineEach=u,r.lineReduce=function(e,t,r){var n=r;return u(e,(function(e,a,i,o){n=0===a&&void 0===r?e:t(n,e,a,i,o)})),n},r.findSegment=function(e,t){if(t=t||{},!n.isObject(t))throw new Error("options is invalid");var r,a=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,s=t.segmentIndex||0,l=t.properties;switch(e.type){case"FeatureCollection":a<0&&(a=e.features.length+a),l=l||e.features[a].properties,r=e.features[a].geometry;break;case"Feature":l=l||e.properties,r=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=e;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var c=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),n.lineString([c[s],c[s+1]],l,t);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),n.lineString([c[o][s],c[o][s+1]],l,t);case"MultiLineString":return i<0&&(i=c.length+i),s<0&&(s=c[i].length+s-1),n.lineString([c[i][s],c[i][s+1]],l,t);case"MultiPolygon":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),s<0&&(s=c[i][o].length-s-1),n.lineString([c[i][o][s],c[i][o][s+1]],l,t)}throw new Error("geojson is invalid")},r.findPoint=function(e,t){if(t=t||{},!n.isObject(t))throw new Error("options is invalid");var r,a=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,s=t.coordIndex||0,l=t.properties;switch(e.type){case"FeatureCollection":a<0&&(a=e.features.length+a),l=l||e.features[a].properties,r=e.features[a].geometry;break;case"Feature":l=l||e.properties,r=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=e;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var c=r.coordinates;switch(r.type){case"Point":return n.point(c,l,t);case"MultiPoint":return i<0&&(i=c.length+i),n.point(c[i],l,t);case"LineString":return s<0&&(s=c.length+s),n.point(c[s],l,t);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),n.point(c[o][s],l,t);case"MultiLineString":return i<0&&(i=c.length+i),s<0&&(s=c[i].length+s),n.point(c[i][s],l,t);case"MultiPolygon":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),s<0&&(s=c[i][o].length-s),n.point(c[i][o][s],l,t)}throw new Error("geojson is invalid")}},{"@turf/helpers":62}],64:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("@turf/meta");function a(e){var t=[1/0,1/0,-1/0,-1/0];return n.coordEach(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])})),t}a.default=a,r.default=a},{"@turf/meta":66}],65:[function(e,t,r){arguments[4][62][0].apply(r,arguments)},{dup:62}],66:[function(e,t,r){arguments[4][63][0].apply(r,arguments)},{"@turf/helpers":65,dup:63}],67:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("@turf/meta"),a=e("@turf/helpers");r.default=function(e,t){void 0===t&&(t={});var r=0,i=0,o=0;return n.coordEach(e,(function(e){r+=e[0],i+=e[1],o++})),a.point([r/o,i/o],t.properties)}},{"@turf/helpers":68,"@turf/meta":69}],68:[function(e,t,r){"use strict";function n(e,t,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function a(e,t,r){return void 0===r&&(r={}),n({type:"Point",coordinates:e},t,r)}function i(e,t,r){void 0===r&&(r={});for(var a=0,i=e;a<i.length;a++){var o=i[a];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:e},t,r)}function o(e,t,r){if(void 0===r&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:e},t,r)}function s(e,t){void 0===t&&(t={});var r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function l(e,t,r){return void 0===r&&(r={}),n({type:"MultiLineString",coordinates:e},t,r)}function c(e,t,r){return void 0===r&&(r={}),n({type:"MultiPoint",coordinates:e},t,r)}function u(e,t,r){return void 0===r&&(r={}),n({type:"MultiPolygon",coordinates:e},t,r)}function f(e,t){void 0===t&&(t="kilometers");var n=r.factors[t];if(!n)throw new Error(t+" units is invalid");return e*n}function p(e,t){void 0===t&&(t="kilometers");var n=r.factors[t];if(!n)throw new Error(t+" units is invalid");return e/n}function h(e){return e%(2*Math.PI)*180/Math.PI}function d(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)&&!/^\s*$/.test(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=6371008.8,r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius/1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1/1.0936},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},r.feature=n,r.geometry=function(e,t,r){switch(void 0===r&&(r={}),e){case"Point":return a(t).geometry;case"LineString":return o(t).geometry;case"Polygon":return i(t).geometry;case"MultiPoint":return c(t).geometry;case"MultiLineString":return l(t).geometry;case"MultiPolygon":return u(t).geometry;default:throw new Error(e+" is invalid")}},r.point=a,r.points=function(e,t,r){return void 0===r&&(r={}),s(e.map((function(e){return a(e,t)})),r)},r.polygon=i,r.polygons=function(e,t,r){return void 0===r&&(r={}),s(e.map((function(e){return i(e,t)})),r)},r.lineString=o,r.lineStrings=function(e,t,r){return void 0===r&&(r={}),s(e.map((function(e){return o(e,t)})),r)},r.featureCollection=s,r.multiLineString=l,r.multiPoint=c,r.multiPolygon=u,r.geometryCollection=function(e,t,r){return void 0===r&&(r={}),n({type:"GeometryCollection",geometries:e},t,r)},r.round=function(e,t){if(void 0===t&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},r.radiansToLength=f,r.lengthToRadians=p,r.lengthToDegrees=function(e,t){return h(p(e,t))},r.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},r.radiansToDegrees=h,r.degreesToRadians=function(e){return e%360*Math.PI/180},r.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return f(p(e,t),r)},r.convertArea=function(e,t,n){if(void 0===t&&(t="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var a=r.areaFactors[t];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return e/a*i},r.isNumber=d,r.isObject=function(e){return!!e&&e.constructor===Object},r.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!d(e))throw new Error("bbox must only contain numbers")}))},r.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],69:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("@turf/helpers");function a(e,t,r){if(null!==e)for(var n,i,o,s,l,c,u,f,p=0,h=0,d=e.type,m="FeatureCollection"===d,g="Feature"===d,y=m?e.features.length:1,v=0;v<y;v++){l=(f=!!(u=m?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var b=0;b<l;b++){var x=0,_=0;if(null!==(s=f?u.geometries[b]:u)){c=s.coordinates;var w=s.type;switch(p=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(c,h,v,x,_))return!1;h++,x++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(!1===t(c[n],h,v,x,_))return!1;h++,"MultiPoint"===w&&x++}"LineString"===w&&x++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(i=0;i<c[n].length-p;i++){if(!1===t(c[n][i],h,v,x,_))return!1;h++}"MultiLineString"===w&&x++,"Polygon"===w&&_++}"Polygon"===w&&x++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(_=0,i=0;i<c[n].length;i++){for(o=0;o<c[n][i].length-p;o++){if(!1===t(c[n][i][o],h,v,x,_))return!1;h++}_++}x++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===a(s.geometries[n],t,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function i(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&!1!==t(e.features[r].properties,r);r++);break;case"Feature":t(e.properties,0)}}function o(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var r=0;r<e.features.length&&!1!==t(e.features[r],r);r++);}function s(e,t){var r,n,a,i,o,s,l,c,u,f,p=0,h="FeatureCollection"===e.type,d="Feature"===e.type,m=h?e.features.length:1;for(r=0;r<m;r++){for(s=h?e.features[r].geometry:d?e.geometry:e,c=h?e.features[r].properties:d?e.properties:{},u=h?e.features[r].bbox:d?e.bbox:void 0,f=h?e.features[r].id:d?e.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,a=0;a<o;a++)if(null!==(i=l?s.geometries[a]:s))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(i,p,c,u,f))return!1;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===t(i.geometries[n],p,c,u,f))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,p,c,u,f))return!1;p++}}function l(e,t){s(e,(function(e,r,a,i,o){var s,l=null===e?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==t(n.feature(e,a,{bbox:i,id:o}),r,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var c=0;c<e.coordinates.length;c++){var u={type:s,coordinates:e.coordinates[c]};if(!1===t(n.feature(u,a),r,c))return!1}}))}function c(e,t){l(e,(function(e,r,i){var o=0;if(e.geometry){var s=e.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,c=0,u=0,f=0;return!1!==a(e,(function(a,s,p,h,d){if(void 0===l||r>c||h>u||d>f)return l=a,c=r,u=h,f=d,void(o=0);var m=n.lineString([l,a],e.properties);if(!1===t(m,r,i,d,o))return!1;o++,l=a}))&&void 0}}}))}function u(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,a){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,r,a,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===t(n.lineString(o[s],e.properties),r,a,s))return!1}}}))}r.coordEach=a,r.coordReduce=function(e,t,r,n){var i=r;return a(e,(function(e,n,a,o,s){i=0===n&&void 0===r?e:t(i,e,n,a,o,s)}),n),i},r.propEach=i,r.propReduce=function(e,t,r){var n=r;return i(e,(function(e,a){n=0===a&&void 0===r?e:t(n,e,a)})),n},r.featureEach=o,r.featureReduce=function(e,t,r){var n=r;return o(e,(function(e,a){n=0===a&&void 0===r?e:t(n,e,a)})),n},r.coordAll=function(e){var t=[];return a(e,(function(e){t.push(e)})),t},r.geomEach=s,r.geomReduce=function(e,t,r){var n=r;return s(e,(function(e,a,i,o,s){n=0===a&&void 0===r?e:t(n,e,a,i,o,s)})),n},r.flattenEach=l,r.flattenReduce=function(e,t,r){var n=r;return l(e,(function(e,a,i){n=0===a&&0===i&&void 0===r?e:t(n,e,a,i)})),n},r.segmentEach=c,r.segmentReduce=function(e,t,r){var n=r,a=!1;return c(e,(function(e,i,o,s,l){n=!1===a&&void 0===r?e:t(n,e,i,o,s,l),a=!0})),n},r.lineEach=u,r.lineReduce=function(e,t,r){var n=r;return u(e,(function(e,a,i,o){n=0===a&&void 0===r?e:t(n,e,a,i,o)})),n},r.findSegment=function(e,t){if(t=t||{},!n.isObject(t))throw new Error("options is invalid");var r,a=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,s=t.segmentIndex||0,l=t.properties;switch(e.type){case"FeatureCollection":a<0&&(a=e.features.length+a),l=l||e.features[a].properties,r=e.features[a].geometry;break;case"Feature":l=l||e.properties,r=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=e;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var c=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),n.lineString([c[s],c[s+1]],l,t);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),n.lineString([c[o][s],c[o][s+1]],l,t);case"MultiLineString":return i<0&&(i=c.length+i),s<0&&(s=c[i].length+s-1),n.lineString([c[i][s],c[i][s+1]],l,t);case"MultiPolygon":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),s<0&&(s=c[i][o].length-s-1),n.lineString([c[i][o][s],c[i][o][s+1]],l,t)}throw new Error("geojson is invalid")},r.findPoint=function(e,t){if(t=t||{},!n.isObject(t))throw new Error("options is invalid");var r,a=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,s=t.coordIndex||0,l=t.properties;switch(e.type){case"FeatureCollection":a<0&&(a=e.features.length+a),l=l||e.features[a].properties,r=e.features[a].geometry;break;case"Feature":l=l||e.properties,r=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=e;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var c=r.coordinates;switch(r.type){case"Point":return n.point(c,l,t);case"MultiPoint":return i<0&&(i=c.length+i),n.point(c[i],l,t);case"LineString":return s<0&&(s=c.length+s),n.point(c[s],l,t);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),n.point(c[o][s],l,t);case"MultiLineString":return i<0&&(i=c.length+i),s<0&&(s=c[i].length+s),n.point(c[i][s],l,t);case"MultiPolygon":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),s<0&&(s=c[i][o].length-s),n.point(c[i][o][s],l,t)}throw new Error("geojson is invalid")}},{"@turf/helpers":68}],70:[function(e,t,r){t.exports=function(e){var t=0,r=0,n=0,a=0;return e.map((function(e){var i=(e=e.slice())[0],o=i.toUpperCase();if(i!=o)switch(e[0]=o,i){case"a":e[6]+=n,e[7]+=a;break;case"v":e[1]+=a;break;case"h":e[1]+=n;break;default:for(var s=1;s<e.length;)e[s++]+=n,e[s++]+=a}switch(o){case"Z":n=t,a=r;break;case"H":n=e[1];break;case"V":a=e[1];break;case"M":n=t=e[1],a=r=e[2];break;default:n=e[e.length-2],a=e[e.length-1]}return e}))}},{}],71:[function(e,t,r){"use strict";t.exports=function(e,t){if(!e||null==e.length)throw Error("Argument should be an array");t=null==t?1:Math.floor(t);for(var r=Array(2*t),n=0;n<t;n++){for(var a=-1/0,i=1/0,o=n,s=e.length;o<s;o+=t)e[o]>a&&(a=e[o]),e[o]<i&&(i=e[o]);r[n]=i,r[t+n]=a}return r}},{}],72:[function(e,t,r){"use strict";t.exports=function(e,t,r){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,r);if("function"!=typeof t)throw new TypeError("predicate must be a function");var n=Object(e),a=n.length;if(0===a)return-1;for(var i=0;i<a;i++)if(t.call(r,n[i],i,n))return i;return-1}},{}],73:[function(e,t,r){"use strict";var n=e("array-bounds");t.exports=function(e,t,r){if(!e||null==e.length)throw Error("Argument should be an array");null==t&&(t=1),null==r&&(r=n(e,t));for(var a=0;a<t;a++){var i=r[t+a],o=r[a],s=a,l=e.length;if(i===1/0&&o===-1/0)for(s=a;s<l;s+=t)e[s]=e[s]===i?1:e[s]===o?0:.5;else if(i===1/0)for(s=a;s<l;s+=t)e[s]=e[s]===i?1:0;else if(o===-1/0)for(s=a;s<l;s+=t)e[s]=e[s]===o?0:1;else{var c=i-o;for(s=a;s<l;s+=t)isNaN(e[s])||(e[s]=0===c?.5:(e[s]-o)/c)}}return e}},{"array-bounds":71}],74:[function(e,t,r){t.exports=function(e,t){var r="number"==typeof e,n="number"==typeof t;r&&!n?(t=e,e=0):r||n||(e=0,t=0);var a=(t|=0)-(e|=0);if(a<0)throw new Error("array length must be positive");for(var i=new Array(a),o=0,s=e;o<a;o++,s++)i[o]=s;return i}},{}],75:[function(e,t,n){(function(r){(function(){"use strict";var n=e("object-assign");function a(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,a=0,i=Math.min(r,n);a<i;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:n<r?1:0}function i(e){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var o=e("util/"),s=Object.prototype.hasOwnProperty,l=Array.prototype.slice,c="foo"===function(){}.name;function u(e){return Object.prototype.toString.call(e)}function f(e){return!i(e)&&"function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer)))}var p=t.exports=v,h=/\s*function\s+([^\(\s]*)\s*/;function d(e){if(o.isFunction(e)){if(c)return e.name;var t=e.toString().match(h);return t&&t[1]}}function m(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function g(e){if(c||!o.isFunction(e))return o.inspect(e);var t=d(e);return"[Function"+(t?": "+t:"")+"]"}function y(e,t,r,n,a){throw new p.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:a})}function v(e,t){e||y(e,!0,t,"==",p.ok)}function b(e,t,r,n){if(e===t)return!0;if(i(e)&&i(t))return 0===a(e,t);if(o.isDate(e)&&o.isDate(t))return e.getTime()===t.getTime();if(o.isRegExp(e)&&o.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(f(e)&&f(t)&&u(e)===u(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===a(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(e);return-1!==s&&s===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(o.isPrimitive(e)||o.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var a=x(e),i=x(t);if(a&&!i||!a&&i)return!1;if(a)return b(e=l.call(e),t=l.call(t),r);var s,c,u=k(e),f=k(t);if(u.length!==f.length)return!1;for(u.sort(),f.sort(),c=u.length-1;c>=0;c--)if(u[c]!==f[c])return!1;for(c=u.length-1;c>=0;c--)if(!b(e[s=u[c]],t[s],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function x(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function _(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(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function w(e,t,r,n){var a;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),a=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!a&&y(a,r,"Missing expected exception"+n);var i="string"==typeof n,s=!e&&a&&!r;if((!e&&o.isError(a)&&i&&_(a,r)||s)&&y(a,r,"Got unwanted exception"+n),e&&a&&r&&!_(a,r)||!e&&a)throw a}p.AssertionError=function(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(e){return m(g(e.actual),128)+" "+e.operator+" "+m(g(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,a=d(t),i=n.indexOf("\n"+a);if(i>=0){var o=n.indexOf("\n",i+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(p.AssertionError,Error),p.fail=y,p.ok=v,p.equal=function(e,t,r){e!=t&&y(e,t,r,"==",p.equal)},p.notEqual=function(e,t,r){e==t&&y(e,t,r,"!=",p.notEqual)},p.deepEqual=function(e,t,r){b(e,t,!1)||y(e,t,r,"deepEqual",p.deepEqual)},p.deepStrictEqual=function(e,t,r){b(e,t,!0)||y(e,t,r,"deepStrictEqual",p.deepStrictEqual)},p.notDeepEqual=function(e,t,r){b(e,t,!1)&&y(e,t,r,"notDeepEqual",p.notDeepEqual)},p.notDeepStrictEqual=function e(t,r,n){b(t,r,!0)&&y(t,r,n,"notDeepStrictEqual",e)},p.strictEqual=function(e,t,r){e!==t&&y(e,t,r,"===",p.strictEqual)},p.notStrictEqual=function(e,t,r){e===t&&y(e,t,r,"!==",p.notStrictEqual)},p.throws=function(e,t,r){w(!0,e,t,r)},p.doesNotThrow=function(e,t,r){w(!1,e,t,r)},p.ifError=function(e){if(e)throw e},p.strict=n((function e(t,r){t||y(t,!0,r,"==",e)}),p,{equal:p.strictEqual,deepEqual:p.deepStrictEqual,notEqual:p.notStrictEqual,notDeepEqual:p.notDeepStrictEqual}),p.strict.strict=p.strict;var k=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":247,"util/":78}],76:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],77:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],78:[function(e,t,n){(function(t,r){(function(){var a=/%[sdj%]/g;n.format=function(e){if(!y(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(a,(function(e){if("%%"===e)return"%";if(r>=i)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(e){return"[Circular]"}default:return e}})),l=n[r];r<i;l=n[++r])m(l)||!x(l)?o+=" "+l:o+=" "+s(l);return o},n.deprecate=function(e,a){if(v(r.process))return function(){return n.deprecate(e,a).apply(this,arguments)};if(!0===t.noDeprecation)return e;var i=!1;return function(){if(!i){if(t.throwDeprecation)throw new Error(a);t.traceDeprecation?console.trace(a):console.error(a),i=!0}return e.apply(this,arguments)}};var i,o={};function s(e,t){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(t)?r.showHidden=t:t&&n._extend(r,t),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),u(r,e,r.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function c(e,t){return e}function u(e,t,r){if(e.customInspect&&t&&k(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var a=t.inspect(r,e);return y(a)||(a=u(e,a,r)),a}var i=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,t);if(i)return i;var o=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),w(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(t);if(0===o.length){if(k(t)){var l=t.name?": "+t.name:"";return e.stylize("[Function"+l+"]","special")}if(b(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(_(t))return e.stylize(Date.prototype.toString.call(t),"date");if(w(t))return f(t)}var c,x="",D=!1,T=["{","}"];return h(t)&&(D=!0,T=["[","]"]),k(t)&&(x=" [Function"+(t.name?": "+t.name:"")+"]"),b(t)&&(x=" "+RegExp.prototype.toString.call(t)),_(t)&&(x=" "+Date.prototype.toUTCString.call(t)),w(t)&&(x=" "+f(t)),0!==o.length||D&&0!=t.length?r<0?b(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=D?function(e,t,r,n,a){for(var i=[],o=0,s=t.length;o<s;++o)M(t,String(o))?i.push(p(e,t,r,n,String(o),!0)):i.push("");return a.forEach((function(a){a.match(/^\d+$/)||i.push(p(e,t,r,n,a,!0))})),i}(e,t,r,s,o):o.map((function(n){return p(e,t,r,s,n,D)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,x,T)):T[0]+x+T[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,a,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,a)||{value:t[a]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),M(n,a)||(o="["+a+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?u(e,l.value,null):u(e,l.value,r-1)).indexOf("\n")>-1&&(s=i?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")),v(o)){if(i&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).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 h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return x(e)&&"[object RegExp]"===D(e)}function x(e){return"object"==typeof e&&null!==e}function _(e){return x(e)&&"[object Date]"===D(e)}function w(e){return x(e)&&("[object Error]"===D(e)||e instanceof Error)}function k(e){return"function"==typeof e}function D(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}n.debuglog=function(e){if(v(i)&&(i=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(i)){var r=t.pid;o[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else o[e]=function(){};return o[e]},n.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=d,n.isNull=m,n.isNullOrUndefined=function(e){return null==e},n.isNumber=g,n.isString=y,n.isSymbol=function(e){return"symbol"==typeof e},n.isUndefined=v,n.isRegExp=b,n.isObject=x,n.isDate=_,n.isError=w,n.isFunction=k,n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},n.isBuffer=e("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}n.log=function(){console.log("%s - %s",S(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this)}).call(this,e("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":77,_process:277,inherits:76}],79:[function(e,t,r){"use strict";r.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=c(e),o=n[0],s=n[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),u=0,f=s>0?o-4:o;for(r=0;r<f;r+=4)t=a[e.charCodeAt(r)]<<18|a[e.charCodeAt(r+1)]<<12|a[e.charCodeAt(r+2)]<<6|a[e.charCodeAt(r+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===s&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,l[u++]=255&t),1===s&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},r.fromByteArray=function(e){for(var t,r=e.length,a=r%3,i=[],o=0,s=r-a;o<s;o+=16383)i.push(u(e,o,o+16383>s?s:o+16383));return 1===a?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s<l;++s)n[s]=o[s],a[o.charCodeAt(s)]=s;function c(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 u(e,t,r){for(var a,i,o=[],s=t;s<r;s+=3)a=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(n[(i=a)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],80:[function(e,t,r){"use strict";function n(e,t,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(i=o,a=o-1):n=o+1}return i}function a(e,t,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(i=o,a=o-1):n=o+1}return i}function i(e,t,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(i=o,n=o+1):a=o-1}return i}function o(e,t,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(i=o,n=o+1):a=o-1}return i}function s(e,t,r,n,a){for(;n<=a;){var i=n+a>>>1,o=e[i],s=void 0!==r?r(o,t):o-t;if(0===s)return i;s<=0?n=i+1:a=i-1}return-1}function l(e,t,r,n,a,i){return"function"==typeof r?i(e,t,r,void 0===n?0:0|n,void 0===a?e.length-1:0|a):i(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}t.exports={ge:function(e,t,r,a,i){return l(e,t,r,a,i,n)},gt:function(e,t,r,n,i){return l(e,t,r,n,i,a)},lt:function(e,t,r,n,a){return l(e,t,r,n,a,i)},le:function(e,t,r,n,a){return l(e,t,r,n,a,o)},eq:function(e,t,r,n,a){return l(e,t,r,n,a,s)}}},{}],81:[function(e,t,r){"use strict";function n(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(e){return(e>0)-(e<0)},r.abs=function(e){var t=e>>31;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e<t)},r.max=function(e,t){return e^(e^t)&-(e<t)},r.isPow2=function(e){return!(e&e-1||!e)},r.log2=function(e){var t,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},r.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},r.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,1+((e|=e>>>8)|e>>>16)},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var a=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;e[t]=n<<a&255}}(a),r.reverse=function(e){return a[255&e]<<24|a[e>>>8&255]<<16|a[e>>>16&255]<<8|a[e>>>24&255]},r.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},r.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},r.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},r.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}},{}],82:[function(e,t,r){"use strict";var n=e("clamp");t.exports=function(e,t){t||(t={});var r,o,s,l,c,u,f,p,h,d,m,g=null==t.cutoff?.25:t.cutoff,y=null==t.radius?8:t.radius,v=t.channel||0;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,o=t.height,l=e,u=t.stride?t.stride:Math.floor(e.length/r/o)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(f=(p=e).getContext("2d"),r=p.width,o=p.height,l=(h=f.getImageData(0,0,r,o)).data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(f=e,r=(p=e.canvas).width,o=p.height,l=(h=f.getImageData(0,0,r,o)).data,u=4):window.ImageData&&e instanceof window.ImageData&&(h=e,r=e.width,o=e.height,l=h.data,u=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(r*o),d=0,m=c.length;d<m;d++)l[d]=c[d*u+v]/255;else if(1!==u)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*o),x=Array(r*o),_=Array(s),w=Array(s),k=Array(s+1),D=Array(s);for(d=0,m=r*o;d<m;d++){var T=l[d];b[d]=1===T?0:0===T?a:Math.pow(Math.max(0,.5-T),2),x[d]=1===T?a:0===T?0:Math.pow(Math.max(0,T-.5),2)}i(b,r,o,_,w,D,k),i(x,r,o,_,w,D,k);var A=window.Float32Array?new Float32Array(r*o):new Array(r*o);for(d=0,m=r*o;d<m;d++)A[d]=n(1-((b[d]-x[d])/y+g),0,1);return A};var a=1e20;function i(e,t,r,n,a,i,s){for(var l=0;l<t;l++){for(var c=0;c<r;c++)n[c]=e[c*t+l];for(o(n,a,i,s,r),c=0;c<r;c++)e[c*t+l]=a[c]}for(c=0;c<r;c++){for(l=0;l<t;l++)n[l]=e[c*t+l];for(o(n,a,i,s,t),l=0;l<t;l++)e[c*t+l]=Math.sqrt(a[l])}}function o(e,t,r,n,i){r[0]=0,n[0]=-a,n[1]=+a;for(var o=1,s=0;o<i;o++){for(var l=(e[o]+o*o-(e[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=n[s];)s--,l=(e[o]+o*o-(e[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,n[s]=l,n[s+1]=+a}for(o=0,s=0;o<i;o++){for(;n[s+1]<o;)s++;t[o]=(o-r[s])*(o-r[s])+e[r[s]]}}},{clamp:86}],83:[function(e,t,r){},{}],84:[function(e,t,r){"use strict";var n,a="object"==typeof Reflect?Reflect:null,i=a&&"function"==typeof a.apply?a.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(e,t){return new Promise((function(r,n){function a(){void 0!==i&&e.removeListener("error",i),r([].slice.call(arguments))}var i;"error"!==t&&(i=function(r){e.removeListener(t,a),n(r)},e.once("error",i)),e.once(t,a)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var a,i,o,s;if(c(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),o=i[t]),void 0===o)o=i[t]=r,++e._eventsCount;else if("function"==typeof o?o=i[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(a=u(e))>0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=p.bind(n);return a.listener=r,n.wrapFn=a,a}function d(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(a):g(a,a.length)}function m(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function g(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");l=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var c=l.length,u=g(l,c);for(r=0;r<c;++r)i(u[r],this,t)}return!0},s.prototype.addListener=function(e,t){return f(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return f(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,a,i,o;if(c(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(a=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,a),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var a,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(a=i[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],85:[function(e,t,r){(function(t){(function(){"use strict";var t=e("base64-js"),n=e("ieee754");function a(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return o(e,t,r)}function o(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!i.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|f(e,t),n=a(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r)).__proto__=i.prototype,n}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return i.from(n,t,r);var o=function(e){if(i.isBuffer(e)){var t=0|u(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||z(e.length)?a(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return s(e),a(e<0?0:0|u(e))}function c(e){for(var t=e.length<0?0:0|u(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function u(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function f(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(a)return n?-1:R(e).length;t=(""+t).toLowerCase(),a=!0}}function p(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 A(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return w(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function h(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function d(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=i.from(t,n)),i.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,a);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,a){var i,o=1,s=e.length,l=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,l/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var u=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*o}else-1!==u&&(i-=i-u),u=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){for(var f=!0,p=0;p<l;p++)if(c(e,i+p)!==c(t,p)){f=!1;break}if(f)return i}return-1}function g(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(z(s))return o;e[r+o]=s}return o}function y(e,t,r,n){return F(R(t,e.length-r),e,r,n)}function v(e,t,r,n){return F(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function b(e,t,r,n){return v(e,t,r,n)}function x(e,t,r,n){return F(L(t),e,r,n)}function _(e,t,r,n){return F(function(e,t){for(var r,n,a,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,a=r%256,i.push(a),i.push(n);return i}(t,e.length-r),e,r,n)}function w(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a<r;){var i,o,s,l,c=e[a],u=null,f=c>239?4:c>223?3:c>191?2:1;if(a+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[a+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[a+1],o=e[a+2],128==(192&i)&&128==(192&o)&&(l=(15&c)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=e[a+1],o=e[a+2],s=e[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),a+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}function T(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}function A(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var a="",i=t;i<r;++i)a+=P(e[i]);return a}function S(e,t,r){for(var n=e.slice(t,r),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+256*n[i+1]);return a}function M(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 E(e,t,r,n,a,o){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function C(e,t,r,n,a,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,a,i){return t=+t,r>>>=0,i||C(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function O(e,t,r,a,i){return t=+t,r>>>=0,i||C(e,0,r,8),n.write(e,t,r,a,52,8),r+8}r.Buffer=i,r.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,r){return o(e,t,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,r){return function(e,t,r){return s(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},i.allocUnsafe=function(e){return l(e)},i.allocUnsafeSlow=function(e){return l(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==i.prototype},i.compare=function(e,t){if(B(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),B(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,a=0,o=Math.min(r,n);a<o;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:n<r?1:0},i.isEncoding=function(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}},i.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=i.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){var o=e[r];if(B(o,Uint8Array)&&(o=i.from(o)),!i.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,a),a+=o.length}return n},i.byteLength=f,i.prototype._isBuffer=!0,i.prototype.swap16=function(){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)h(this,t,t+1);return this},i.prototype.swap32=function(){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)h(this,t,t+3),h(this,t+1,t+2);return this},i.prototype.swap64=function(){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)h(this,t,t+7),h(this,t+1,t+6),h(this,t+2,t+5),h(this,t+3,t+4);return this},i.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?k(this,0,e):p.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},i.prototype.compare=function(e,t,r,n,a){if(B(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),l=Math.min(o,s),c=this.slice(n,a),u=e.slice(t,r),f=0;f<l;++f)if(c[f]!==u[f]){o=c[f],s=u[f];break}return o<s?-1:s<o?1:0},i.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},i.prototype.indexOf=function(e,t,r){return d(this,e,t,r,!0)},i.prototype.lastIndexOf=function(e,t,r){return d(this,e,t,r,!1)},i.prototype.write=function(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 a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},i.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=i.prototype,n},i.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);for(var n=this[e],a=1,i=0;++i<t&&(a*=256);)n+=this[e+i]*a;return n},i.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},i.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);for(var n=this[e],a=1,i=0;++i<t&&(a*=256);)n+=this[e+i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},i.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);for(var n=t,a=1,i=this[e+--n];n>0&&(a*=256);)i+=this[e+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},i.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||M(e,4,this.length),n.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),n.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),n.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),n.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||E(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[t]=255&e;++i<r&&(a*=256);)this[t+i]=e/a&255;return t+r},i.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||E(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+r},i.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*r-1);E(this,e,t,r,a-1,-a)}var i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},i.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*r-1);E(this,e,t,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},i.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},i.prototype.copy=function(e,t,r,n){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");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("Index out of range");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 a=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var o=a-1;o>=0;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return a},i.prototype.fill=function(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),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var a=e.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(e=a)}}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 o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=i.isBuffer(e)?e:i.from(e,n),l=s.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%l]}return this};var I=/[^+/0-9A-Za-z-_]/g;function P(e){return e<16?"0"+e.toString(16):e.toString(16)}function R(e,t){var r;t=t||1/0;for(var n=e.length,a=null,i=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function L(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,r,n){for(var a=0;a<n&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":79,buffer:85,ieee754:230}],86:[function(e,t,r){t.exports=function(e,t,r){return t<r?e<t?t:e>r?r:e:e<r?r:e>t?t:e}},{}],87:[function(e,t,r){"use strict";var n=e("clamp");function a(e,t){null==t&&(t=!0);var r=e[0],a=e[1],i=e[2],o=e[3];return null==o&&(o=t?1:255),t&&(r*=255,a*=255,i*=255,o*=255),16777216*(r=255&n(r,0,255))+((a=255&n(a,0,255))<<16)+((i=255&n(i,0,255))<<8)+(255&n(o,0,255))}t.exports=a,t.exports.to=a,t.exports.from=function(e,t){var r=(e=+e)>>>24,n=(16711680&e)>>>16,a=(65280&e)>>>8,i=255&e;return!1===t?[r,n,a,i]:[r/255,n/255,a/255,i/255]}},{clamp:86}],88:[function(e,t,r){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],89:[function(e,t,r){"use strict";var n=e("color-rgba"),a=e("clamp"),i=e("dtype");t.exports=function(e,t){"float"!==t&&t||(t="array"),"uint"===t&&(t="uint8"),"uint_clamped"===t&&(t="uint8_clamped");var r=new(i(t))(4),o="uint8"!==t&&"uint8_clamped"!==t;return e.length&&"string"!=typeof e||((e=n(e))[0]/=255,e[1]/=255,e[2]/=255),function(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||!!(Array.isArray(e)&&(e[0]>1||0===e[0])&&(e[1]>1||0===e[1])&&(e[2]>1||0===e[2])&&(!e[3]||e[3]>1))}(e)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=null!=e[3]?e[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=null!=e[3]?e[3]:1):(r[0]=a(Math.floor(255*e[0]),0,255),r[1]=a(Math.floor(255*e[1]),0,255),r[2]=a(Math.floor(255*e[2]),0,255),r[3]=null==e[3]?255:a(Math.floor(255*e[3]),0,255)),r)}},{clamp:86,"color-rgba":91,dtype:127}],90:[function(e,t,n){(function(r){(function(){"use strict";var n=e("color-name"),a=e("is-plain-obj"),i=e("defined");t.exports=function(e){var t,s,l=[],c=1;if("string"==typeof e)if(n[e])l=n[e].slice(),s="rgb";else if("transparent"===e)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var u=(h=e.slice(1)).length;c=1,u<=4?(l=[parseInt(h[0]+h[0],16),parseInt(h[1]+h[1],16),parseInt(h[2]+h[2],16)],4===u&&(c=parseInt(h[3]+h[3],16)/255)):(l=[parseInt(h[0]+h[1],16),parseInt(h[2]+h[3],16),parseInt(h[4]+h[5],16)],8===u&&(c=parseInt(h[6]+h[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var f=t[1],p="rgb"===f,h=f.replace(/a$/,"");s=h,u="cmyk"===h?4:"gray"===h?1:3,l=t[2].trim().split(/\s*,\s*/).map((function(e,t){if(/%$/.test(e))return t===u?parseFloat(e)/100:"rgb"===h?255*parseFloat(e)/100:parseFloat(e);if("h"===h[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==o[e])return o[e]}return parseFloat(e)})),f===h&&l.push(1),c=p||void 0===l[u]?1:l[u],l=l.slice(0,u)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(l=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),s=e.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(e))if(a(e)){var d=i(e.r,e.red,e.R,null);null!==d?(s="rgb",l=[d,i(e.g,e.green,e.G),i(e.b,e.blue,e.B)]):(s="hsl",l=[i(e.h,e.hue,e.H),i(e.s,e.saturation,e.S),i(e.l,e.lightness,e.L,e.b,e.brightness)]),c=i(e.a,e.alpha,e.opacity,1),null!=e.opacity&&(c/=100)}else(Array.isArray(e)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(e))&&(l=[e[0],e[1],e[2]],s="rgb",c=4===e.length?e[3]:1);else s="rgb",l=[e>>>16,(65280&e)>>>8,255&e];return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":88,defined:124,"is-plain-obj":236}],91:[function(e,t,r){"use strict";var n=e("color-parse"),a=e("color-space/hsl"),i=e("clamp");t.exports=function(e){var t,r=n(e);return r.space?((t=Array(3))[0]=i(r.values[0],0,255),t[1]=i(r.values[1],0,255),t[2]=i(r.values[2],0,255),"h"===r.space[0]&&(t=a.rgb(t)),t.push(i(r.alpha,0,1)),t):[]}},{clamp:86,"color-parse":90,"color-space/hsl":92}],92:[function(e,t,r){"use strict";var n=e("./rgb");t.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t,r,n,a,i,o=e[0]/360,s=e[1]/100,l=e[2]/100;if(0===s)return[i=255*l,i,i];t=2*l-(r=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,i=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,a[c]=255*i;return a}},n.hsl=function(e){var t,r,n=e[0]/255,a=e[1]/255,i=e[2]/255,o=Math.min(n,a,i),s=Math.max(n,a,i),l=s-o;return s===o?t=0:n===s?t=(a-i)/l:a===s?t=2+(i-n)/l:i===s&&(t=4+(n-a)/l),(t=Math.min(60*t,360))<0&&(t+=360),r=(o+s)/2,[t,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":93}],93:[function(e,t,r){"use strict";t.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],94:[function(e,t,r){t.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],95:[function(e,t,r){t.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],96:[function(e,t,r){t.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],97:[function(e,t,r){t.exports=["normal","italic","oblique"]},{}],98:[function(e,t,r){t.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],99:[function(e,t,r){"use strict";t.exports={parse:e("./parse"),stringify:e("./stringify")}},{"./parse":101,"./stringify":102}],100:[function(e,t,r){"use strict";var n=e("css-font-size-keywords");t.exports={isSize:function(e){return/^[\d\.]/.test(e)||-1!==e.indexOf("/")||-1!==n.indexOf(e)}}},{"css-font-size-keywords":95}],101:[function(e,t,r){"use strict";var n=e("unquote"),a=e("css-global-keywords"),i=e("css-system-font-keywords"),o=e("css-font-weight-keywords"),s=e("css-font-style-keywords"),l=e("css-font-stretch-keywords"),c=e("string-split-by"),u=e("./lib/util").isSize;t.exports=p;var f=p.cache={};function p(e){if("string"!=typeof e)throw new Error("Font argument must be a string.");if(f[e])return f[e];if(""===e)throw new Error("Cannot parse an empty string.");if(-1!==i.indexOf(e))return f[e]={system:e};for(var t,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},p=c(e,/\s+/);t=p.shift();){if(-1!==a.indexOf(t))return["style","variant","weight","stretch"].forEach((function(e){r[e]=t})),f[e]=r;if(-1===s.indexOf(t))if("normal"!==t&&"small-caps"!==t)if(-1===l.indexOf(t)){if(-1===o.indexOf(t)){if(u(t)){var d=c(t,"/");if(r.size=d[0],null!=d[1]?r.lineHeight=h(d[1]):"/"===p[0]&&(p.shift(),r.lineHeight=h(p.shift())),!p.length)throw new Error("Missing required font-family.");return r.family=c(p.join(" "),/\s*,\s*/).map(n),f[e]=r}throw new Error("Unknown or unsupported font token: "+t)}r.weight=t}else r.stretch=t;else r.variant=t;else r.style=t}throw new Error("Missing required font-size.")}function h(e){var t=parseFloat(e);return t.toString()===e?t:e}},{"./lib/util":100,"css-font-stretch-keywords":96,"css-font-style-keywords":97,"css-font-weight-keywords":98,"css-global-keywords":103,"css-system-font-keywords":104,"string-split-by":305,unquote:328}],102:[function(e,t,r){"use strict";var n=e("pick-by-alias"),a=e("./lib/util").isSize,i=d(e("css-global-keywords")),o=d(e("css-system-font-keywords")),s=d(e("css-font-weight-keywords")),l=d(e("css-font-style-keywords")),c=d(e("css-font-stretch-keywords")),u={normal:1,"small-caps":1},f={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},p="serif";function h(e,t){if(e&&!t[e]&&!i[e])throw Error("Unknown keyword `"+e+"`");return e}function d(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=1;return t}t.exports=function(e){if((e=n(e,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"})).system)return e.system&&h(e.system,o),e.system;if(h(e.style,l),h(e.variant,u),h(e.weight,s),h(e.stretch,c),null==e.size&&(e.size="1rem"),"number"==typeof e.size&&(e.size+="px"),!a)throw Error("Bad size value `"+e.size+"`");e.family||(e.family=p),Array.isArray(e.family)&&(e.family.length||(e.family=[p]),e.family=e.family.map((function(e){return f[e]?e:'"'+e+'"'})).join(", "));var t=[];return t.push(e.style),e.variant!==e.style&&t.push(e.variant),e.weight!==e.variant&&e.weight!==e.style&&t.push(e.weight),e.stretch!==e.weight&&e.stretch!==e.variant&&e.stretch!==e.style&&t.push(e.stretch),t.push(e.size+(null==e.lineHeight||"normal"===e.lineHeight||e.lineHeight+""=="1"?"":"/"+e.lineHeight)),t.push(e.family),t.filter(Boolean).join(" ")}},{"./lib/util":100,"css-font-stretch-keywords":96,"css-font-style-keywords":97,"css-font-weight-keywords":98,"css-global-keywords":103,"css-system-font-keywords":104,"pick-by-alias":253}],103:[function(e,t,r){t.exports=["inherit","initial","unset"]},{}],104:[function(e,t,r){t.exports=["caption","icon","menu","message-box","small-caption","status-bar"]},{}],105:[function(e,t,r){"use strict";var n,a=e("type/value/is"),i=e("type/value/ensure"),o=e("type/plain-function/ensure"),s=e("es5-ext/object/copy"),l=e("es5-ext/object/normalize-options"),c=e("es5-ext/object/map"),u=Function.prototype.bind,f=Object.defineProperty,p=Object.prototype.hasOwnProperty;n=function(e,t,r){var n,a=i(t)&&o(t.value);return delete(n=s(t)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&p.call(this,e)?a:(t.value=u.call(a,r.resolveContext?r.resolveContext(this):this),f(this,e,t),this[e])},n},t.exports=function(e){var t=l(arguments[1]);return a(t.resolveContext)&&o(t.resolveContext),c(e,(function(e,r){return n(r,e,t)}))}},{"es5-ext/object/copy":147,"es5-ext/object/map":155,"es5-ext/object/normalize-options":156,"type/plain-function/ensure":321,"type/value/ensure":325,"type/value/is":326}],106:[function(e,t,r){"use strict";var n=e("type/value/is"),a=e("type/plain-function/is"),i=e("es5-ext/object/assign"),o=e("es5-ext/object/normalize-options"),s=e("es5-ext/string/#/contains");(t.exports=function(e,t){var r,a,l,c,u;return arguments.length<2||"string"!=typeof e?(c=t,t=e,e=null):c=arguments[2],n(e)?(r=s.call(e,"c"),a=s.call(e,"e"),l=s.call(e,"w")):(r=l=!0,a=!1),u={value:t,configurable:r,enumerable:a,writable:l},c?i(o(c),u):u}).gs=function(e,t,r){var l,c,u,f;return"string"!=typeof e?(u=r,r=t,t=e,e=null):u=arguments[3],n(t)?a(t)?n(r)?a(r)||(u=r,r=void 0):r=void 0:(u=t,t=r=void 0):t=void 0,n(e)?(l=s.call(e,"c"),c=s.call(e,"e")):(l=!0,c=!1),f={get:t,set:r,configurable:l,enumerable:c},u?i(o(u),f):f}},{"es5-ext/object/assign":144,"es5-ext/object/normalize-options":156,"es5-ext/string/#/contains":163,"type/plain-function/is":322,"type/value/is":326}],107:[function(e,t,r){!function(e,n){!function(e){"use strict";function t(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function r(e){var r;return 1===e.length&&(r=e,e=function(e,n){return t(r(e),n)}),{left:function(t,r,n,a){for(null==n&&(n=0),null==a&&(a=t.length);n<a;){var i=n+a>>>1;e(t[i],r)<0?n=i+1:a=i}return n},right:function(t,r,n,a){for(null==n&&(n=0),null==a&&(a=t.length);n<a;){var i=n+a>>>1;e(t[i],r)>0?a=i:n=i+1}return n}}}var n=r(t),a=n.right,i=n.left;function o(e,t){return[e,t]}function s(e){return null===e?NaN:+e}function l(e,t){var r,n,a=e.length,i=0,o=-1,l=0,c=0;if(null==t)for(;++o<a;)isNaN(r=s(e[o]))||(c+=(n=r-l)*(r-(l+=n/++i)));else for(;++o<a;)isNaN(r=s(t(e[o],o,e)))||(c+=(n=r-l)*(r-(l+=n/++i)));if(i>1)return c/(i-1)}function c(e,t){var r=l(e,t);return r?Math.sqrt(r):r}function u(e,t){var r,n,a,i=e.length,o=-1;if(null==t){for(;++o<i;)if(null!=(r=e[o])&&r>=r)for(n=a=r;++o<i;)null!=(r=e[o])&&(n>r&&(n=r),a<r&&(a=r))}else for(;++o<i;)if(null!=(r=t(e[o],o,e))&&r>=r)for(n=a=r;++o<i;)null!=(r=t(e[o],o,e))&&(n>r&&(n=r),a<r&&(a=r));return[n,a]}var f=Array.prototype,p=f.slice,h=f.map;function d(e){return function(){return e}}function m(e){return e}function g(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=0|Math.max(0,Math.ceil((t-e)/r)),i=new Array(a);++n<a;)i[n]=e+n*r;return i}var y=Math.sqrt(50),v=Math.sqrt(10),b=Math.sqrt(2);function x(e,t,r){var n=(t-e)/Math.max(0,r),a=Math.floor(Math.log(n)/Math.LN10),i=n/Math.pow(10,a);return a>=0?(i>=y?10:i>=v?5:i>=b?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(i>=y?10:i>=v?5:i>=b?2:1)}function _(e,t,r){var n=Math.abs(t-e)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),i=n/a;return i>=y?a*=10:i>=v?a*=5:i>=b&&(a*=2),t<e?-a:a}function w(e){return Math.ceil(Math.log(e.length)/Math.LN2)+1}function k(e,t,r){if(null==r&&(r=s),n=e.length){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,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e);return o+(+r(e[i+1],i+1,e)-o)*(a-i)}}function D(e,t){var r,n,a=e.length,i=-1;if(null==t){for(;++i<a;)if(null!=(r=e[i])&&r>=r)for(n=r;++i<a;)null!=(r=e[i])&&n>r&&(n=r)}else for(;++i<a;)if(null!=(r=t(e[i],i,e))&&r>=r)for(n=r;++i<a;)null!=(r=t(e[i],i,e))&&n>r&&(n=r);return n}function T(e){if(!(a=e.length))return[];for(var t=-1,r=D(e,A),n=new Array(r);++t<r;)for(var a,i=-1,o=n[t]=new Array(a);++i<a;)o[i]=e[i][t];return n}function A(e){return e.length}e.bisect=a,e.bisectRight=a,e.bisectLeft=i,e.ascending=t,e.bisector=r,e.cross=function(e,t,r){var n,a,i,s,l=e.length,c=t.length,u=new Array(l*c);for(null==r&&(r=o),n=i=0;n<l;++n)for(s=e[n],a=0;a<c;++a,++i)u[i]=r(s,t[a]);return u},e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.deviation=c,e.extent=u,e.histogram=function(){var e=m,t=u,r=w;function n(n){var i,o,s=n.length,l=new Array(s);for(i=0;i<s;++i)l[i]=e(n[i],i,n);var c=t(l),u=c[0],f=c[1],p=r(l,u,f);Array.isArray(p)||(p=_(u,f,p),p=g(Math.ceil(u/p)*p,f,p));for(var h=p.length;p[0]<=u;)p.shift(),--h;for(;p[h-1]>f;)p.pop(),--h;var d,m=new Array(h+1);for(i=0;i<=h;++i)(d=m[i]=[]).x0=i>0?p[i-1]:u,d.x1=i<h?p[i]:f;for(i=0;i<s;++i)u<=(o=l[i])&&o<=f&&m[a(p,o,0,h)].push(n[i]);return m}return n.value=function(t){return arguments.length?(e="function"==typeof t?t:d(t),n):e},n.domain=function(e){return arguments.length?(t="function"==typeof e?e:d([e[0],e[1]]),n):t},n.thresholds=function(e){return arguments.length?(r="function"==typeof e?e:Array.isArray(e)?d(p.call(e)):d(e),n):r},n},e.thresholdFreedmanDiaconis=function(e,r,n){return e=h.call(e,s).sort(t),Math.ceil((n-r)/(2*(k(e,.75)-k(e,.25))*Math.pow(e.length,-1/3)))},e.thresholdScott=function(e,t,r){return Math.ceil((r-t)/(3.5*c(e)*Math.pow(e.length,-1/3)))},e.thresholdSturges=w,e.max=function(e,t){var r,n,a=e.length,i=-1;if(null==t){for(;++i<a;)if(null!=(r=e[i])&&r>=r)for(n=r;++i<a;)null!=(r=e[i])&&r>n&&(n=r)}else for(;++i<a;)if(null!=(r=t(e[i],i,e))&&r>=r)for(n=r;++i<a;)null!=(r=t(e[i],i,e))&&r>n&&(n=r);return n},e.mean=function(e,t){var r,n=e.length,a=n,i=-1,o=0;if(null==t)for(;++i<n;)isNaN(r=s(e[i]))?--a:o+=r;else for(;++i<n;)isNaN(r=s(t(e[i],i,e)))?--a:o+=r;if(a)return o/a},e.median=function(e,r){var n,a=e.length,i=-1,o=[];if(null==r)for(;++i<a;)isNaN(n=s(e[i]))||o.push(n);else for(;++i<a;)isNaN(n=s(r(e[i],i,e)))||o.push(n);return k(o.sort(t),.5)},e.merge=function(e){for(var t,r,n,a=e.length,i=-1,o=0;++i<a;)o+=e[i].length;for(r=new Array(o);--a>=0;)for(t=(n=e[a]).length;--t>=0;)r[--o]=n[t];return r},e.min=D,e.pairs=function(e,t){null==t&&(t=o);for(var r=0,n=e.length-1,a=e[0],i=new Array(n<0?0:n);r<n;)i[r]=t(a,a=e[++r]);return i},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.quantile=k,e.range=g,e.scan=function(e,r){if(n=e.length){var n,a,i=0,o=0,s=e[o];for(null==r&&(r=t);++i<n;)(r(a=e[i],s)<0||0!==r(s,s))&&(s=a,o=i);return 0===r(s,s)?o:void 0}},e.shuffle=function(e,t,r){for(var n,a,i=(null==r?e.length:r)-(t=null==t?0:+t);i;)a=Math.random()*i--|0,n=e[i+t],e[i+t]=e[a+t],e[a+t]=n;return e},e.sum=function(e,t){var r,n=e.length,a=-1,i=0;if(null==t)for(;++a<n;)(r=+e[a])&&(i+=r);else for(;++a<n;)(r=+t(e[a],a,e))&&(i+=r);return i},e.ticks=function(e,t,r){var n,a,i,o,s=-1;if(r=+r,(e=+e)==(t=+t)&&r>0)return[e];if((n=t<e)&&(a=e,e=t,t=a),0===(o=x(e,t,r))||!isFinite(o))return[];if(o>0)for(e=Math.ceil(e/o),t=Math.floor(t/o),i=new Array(a=Math.ceil(t-e+1));++s<a;)i[s]=(e+s)*o;else for(e=Math.floor(e*o),t=Math.ceil(t*o),i=new Array(a=Math.ceil(e-t+1));++s<a;)i[s]=(e-s)/o;return n&&i.reverse(),i},e.tickIncrement=x,e.tickStep=_,e.transpose=T,e.variance=l,e.zip=function(){return T(arguments)},Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:e.d3=e.d3||{})}(this)},{}],108:[function(e,t,r){!function(e,n){!function(e){"use strict";function t(){}function r(e,r){var n=new t;if(e instanceof t)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var a,i=-1,o=e.length;if(null==r)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(r(a=e[i],i,e),a)}else if(e)for(var s in e)n.set(s,e[s]);return n}function n(){return{}}function a(e,t,r){e[t]=r}function i(){return r()}function o(e,t,r){e.set(t,r)}function s(){}t.prototype=r.prototype={constructor:t,has:function(e){return"$"+e in this},get:function(e){return this["$"+e]},set:function(e,t){return this["$"+e]=t,this},remove:function(e){var t="$"+e;return t in this&&delete this[t]},clear:function(){for(var e in this)"$"===e[0]&&delete this[e]},keys:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)"$"===t[0]&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)"$"===t[0]&&++e;return e},empty:function(){for(var e in this)if("$"===e[0])return!1;return!0},each:function(e){for(var t in this)"$"===t[0]&&e(this[t],t.slice(1),this)}};var l=r.prototype;function c(e,t){var r=new s;if(e instanceof s)e.each((function(e){r.add(e)}));else if(e){var n=-1,a=e.length;if(null==t)for(;++n<a;)r.add(e[n]);else for(;++n<a;)r.add(t(e[n],n,e))}return r}s.prototype=c.prototype={constructor:s,has:l.has,add:function(e){return this["$"+(e+="")]=e,this},remove:l.remove,clear:l.clear,values:l.keys,size:l.size,empty:l.empty,each:l.each},e.nest=function(){var e,t,s,l=[],c=[];function u(n,a,i,o){if(a>=l.length)return null!=e&&n.sort(e),null!=t?t(n):n;for(var s,c,f,p=-1,h=n.length,d=l[a++],m=r(),g=i();++p<h;)(f=m.get(s=d(c=n[p])+""))?f.push(c):m.set(s,[c]);return m.each((function(e,t){o(g,t,u(e,a,i,o))})),g}return s={object:function(e){return u(e,0,n,a)},map:function(e){return u(e,0,i,o)},entries:function(e){return function e(r,n){if(++n>l.length)return r;var a,i=c[n-1];return null!=t&&n>=l.length?a=r.entries():(a=[],r.each((function(t,r){a.push({key:r,values:e(t,n)})}))),null!=i?a.sort((function(e,t){return i(e.key,t.key)})):a}(u(e,0,i,o),0)},key:function(e){return l.push(e),s},sortKeys:function(e){return c[l.length-1]=e,s},sortValues:function(t){return e=t,s},rollup:function(e){return t=e,s}}},e.set=c,e.map=r,e.keys=function(e){var t=[];for(var r in e)t.push(r);return t},e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.entries=function(e){var t=[];for(var r in e)t.push({key:r,value:e[r]});return t},Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:e.d3=e.d3||{})}(this)},{}],109:[function(e,t,r){!function(e,n){!function(e){"use strict";function t(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function r(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function n(){}var a="\\s*([+-]?\\d+)\\s*",i="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3,8})$/,l=new RegExp("^rgb\\("+[a,a,a]+"\\)$"),c=new RegExp("^rgb\\("+[o,o,o]+"\\)$"),u=new RegExp("^rgba\\("+[a,a,a,i]+"\\)$"),f=new RegExp("^rgba\\("+[o,o,o,i]+"\\)$"),p=new RegExp("^hsl\\("+[i,o,o]+"\\)$"),h=new RegExp("^hsla\\("+[i,o,o,i]+"\\)$"),d={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 m(){return this.rgb().formatHex()}function g(){return this.rgb().formatRgb()}function y(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=s.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?v(t):3===r?new w(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?b(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?b(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=l.exec(e))?new w(t[1],t[2],t[3],1):(t=c.exec(e))?new w(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=u.exec(e))?b(t[1],t[2],t[3],t[4]):(t=f.exec(e))?b(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=p.exec(e))?A(t[1],t[2]/100,t[3]/100,1):(t=h.exec(e))?A(t[1],t[2]/100,t[3]/100,t[4]):d.hasOwnProperty(e)?v(d[e]):"transparent"===e?new w(NaN,NaN,NaN,0):null}function v(e){return new w(e>>16&255,e>>8&255,255&e,1)}function b(e,t,r,n){return n<=0&&(e=t=r=NaN),new w(e,t,r,n)}function x(e){return e instanceof n||(e=y(e)),e?new w((e=e.rgb()).r,e.g,e.b,e.opacity):new w}function _(e,t,r,n){return 1===arguments.length?x(e):new w(e,t,r,null==n?1:n)}function w(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function k(){return"#"+T(this.r)+T(this.g)+T(this.b)}function D(){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 T(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function A(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new E(e,t,r,n)}function S(e){if(e instanceof E)return new E(e.h,e.s,e.l,e.opacity);if(e instanceof n||(e=y(e)),!e)return new E;if(e instanceof E)return e;var t=(e=e.rgb()).r/255,r=e.g/255,a=e.b/255,i=Math.min(t,r,a),o=Math.max(t,r,a),s=NaN,l=o-i,c=(o+i)/2;return l?(s=t===o?(r-a)/l+6*(r<a):r===o?(a-t)/l+2:(t-r)/l+4,l/=c<.5?o+i:2-o-i,s*=60):l=c>0&&c<1?0:s,new E(s,l,c,e.opacity)}function M(e,t,r,n){return 1===arguments.length?S(e):new E(e,t,r,null==n?1:n)}function E(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function C(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}t(n,y,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:m,formatHex:m,formatHsl:function(){return S(this).formatHsl()},formatRgb:g,toString:g}),t(w,_,r(n,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new w(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new w(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){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:k,formatHex:k,formatRgb:D,toString:D})),t(E,M,r(n,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new E(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new E(this.h,this.s,this.l*e,this.opacity)},rgb:function(){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,a=2*r-n;return new w(C(e>=240?e-240:e+120,a,n),C(e,a,n),C(e<120?e+240:e-120,a,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){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 N=Math.PI/180,O=180/Math.PI,I=6/29,P=3*I*I;function R(e){if(e instanceof F)return new F(e.l,e.a,e.b,e.opacity);if(e instanceof q)return W(e);e instanceof w||(e=x(e));var t,r,n=U(e.r),a=U(e.g),i=U(e.b),o=B((.2225045*n+.7168786*a+.0606169*i)/1);return n===a&&a===i?t=r=o:(t=B((.4360747*n+.3850649*a+.1430804*i)/.96422),r=B((.0139322*n+.0971045*a+.7141733*i)/.82521)),new F(116*o-16,500*(t-o),200*(o-r),e.opacity)}function L(e,t,r,n){return 1===arguments.length?R(e):new F(e,t,r,null==n?1:n)}function F(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function B(e){return e>.008856451679035631?Math.pow(e,1/3):e/P+4/29}function z(e){return e>I?e*e*e:P*(e-4/29)}function j(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function U(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function $(e){if(e instanceof q)return new q(e.h,e.c,e.l,e.opacity);if(e instanceof F||(e=R(e)),0===e.a&&0===e.b)return new q(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*O;return new q(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function V(e,t,r,n){return 1===arguments.length?$(e):new q(e,t,r,null==n?1:n)}function q(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function W(e){if(isNaN(e.h))return new F(e.l,0,0,e.opacity);var t=e.h*N;return new F(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}t(F,L,r(n,{brighter:function(e){return new F(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new F(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){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 w(j(3.1338561*(t=.96422*z(t))-1.6168667*(e=1*z(e))-.4906146*(r=.82521*z(r))),j(-.9787684*t+1.9161415*e+.033454*r),j(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),t(q,V,r(n,{brighter:function(e){return new q(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new q(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return W(this).rgb()}}));var H=-.14861,G=1.78277,X=-.29227,Y=-.90649,Z=1.97294,K=Z*Y,J=Z*G,Q=G*X-Y*H;function ee(e){if(e instanceof re)return new re(e.h,e.s,e.l,e.opacity);e instanceof w||(e=x(e));var t=e.r/255,r=e.g/255,n=e.b/255,a=(Q*n+K*t-J*r)/(Q+K-J),i=n-a,o=(Z*(r-a)-X*i)/Y,s=Math.sqrt(o*o+i*i)/(Z*a*(1-a)),l=s?Math.atan2(o,i)*O-120:NaN;return new re(l<0?l+360:l,s,a,e.opacity)}function te(e,t,r,n){return 1===arguments.length?ee(e):new re(e,t,r,null==n?1:n)}function re(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}t(re,te,r(n,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new re(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new re(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*N,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),a=Math.sin(e);return new w(255*(t+r*(H*n+G*a)),255*(t+r*(X*n+Y*a)),255*(t+r*(Z*n)),this.opacity)}})),e.color=y,e.cubehelix=te,e.gray=function(e,t){return new F(e,0,0,null==t?1:t)},e.hcl=V,e.hsl=M,e.lab=L,e.lch=function(e,t,r,n){return 1===arguments.length?$(e):new q(r,t,e,null==n?1:n)},e.rgb=_,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:(e=e||self).d3=e.d3||{})}(this)},{}],110:[function(e,t,r){!function(e,n){!function(e){"use strict";var t={value:function(){}};function r(){for(var e,t=0,r=arguments.length,a={};t<r;++t){if(!(e=arguments[t]+"")||e in a||/[\s.]/.test(e))throw new Error("illegal type: "+e);a[e]=[]}return new n(a)}function n(e){this._=e}function a(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 i(e,t){for(var r,n=0,a=e.length;n<a;++n)if((r=e[n]).name===t)return r.value}function o(e,r,n){for(var a=0,i=e.length;a<i;++a)if(e[a].name===r){e[a]=t,e=e.slice(0,a).concat(e.slice(a+1));break}return null!=n&&e.push({name:r,value:n}),e}n.prototype=r.prototype={constructor:n,on:function(e,t){var r,n=this._,s=a(e+"",n),l=-1,c=s.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++l<c;)if(r=(e=s[l]).type)n[r]=o(n[r],e.name,t);else if(null==t)for(r in n)n[r]=o(n[r],e.name,null);return this}for(;++l<c;)if((r=(e=s[l]).type)&&(r=i(n[r],e.name)))return r},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new n(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var r,n,a=new Array(r),i=0;i<r;++i)a[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,r=(n=this._[e]).length;i<r;++i)n[i].value.apply(t,a)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],a=0,i=n.length;a<i;++a)n[a].value.apply(t,r)}},e.dispatch=r,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:(e=e||self).d3=e.d3||{})}(this)},{}],111:[function(e,t,r){var n,a;n=this,a=function(e,t,r,n,a){"use strict";function i(e){return function(){return e}}function o(){return 1e-6*(Math.random()-.5)}function s(e){return e.x+e.vx}function l(e){return e.y+e.vy}function c(e){return e.index}function u(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function f(e){return e.x}function p(e){return e.y}var h=Math.PI*(3-Math.sqrt(5));e.forceCenter=function(e,t){var r;function n(){var n,a,i=r.length,o=0,s=0;for(n=0;n<i;++n)o+=(a=r[n]).x,s+=a.y;for(o=o/i-e,s=s/i-t,n=0;n<i;++n)(a=r[n]).x-=o,a.y-=s}return null==e&&(e=0),null==t&&(t=0),n.initialize=function(e){r=e},n.x=function(t){return arguments.length?(e=+t,n):e},n.y=function(e){return arguments.length?(t=+e,n):t},n},e.forceCollide=function(e){var r,n,a=1,c=1;function u(){for(var e,i,u,p,h,d,m,g=r.length,y=0;y<c;++y)for(i=t.quadtree(r,s,l).visitAfter(f),e=0;e<g;++e)u=r[e],d=n[u.index],m=d*d,p=u.x+u.vx,h=u.y+u.vy,i.visit(v);function v(e,t,r,n,i){var s=e.data,l=e.r,c=d+l;if(!s)return t>p+c||n<p-c||r>h+c||i<h-c;if(s.index>u.index){var f=p-s.x-s.vx,g=h-s.y-s.vy,y=f*f+g*g;y<c*c&&(0===f&&(y+=(f=o())*f),0===g&&(y+=(g=o())*g),y=(c-(y=Math.sqrt(y)))/y*a,u.vx+=(f*=y)*(c=(l*=l)/(m+l)),u.vy+=(g*=y)*c,s.vx-=f*(c=1-c),s.vy-=g*c)}}}function f(e){if(e.data)return e.r=n[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 p(){if(r){var t,a,i=r.length;for(n=new Array(i),t=0;t<i;++t)a=r[t],n[a.index]=+e(a,t,r)}}return"function"!=typeof e&&(e=i(null==e?1:+e)),u.initialize=function(e){r=e,p()},u.iterations=function(e){return arguments.length?(c=+e,u):c},u.strength=function(e){return arguments.length?(a=+e,u):a},u.radius=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),p(),u):e},u},e.forceLink=function(e){var t,n,a,s,l,f=c,p=function(e){return 1/Math.min(s[e.source.index],s[e.target.index])},h=i(30),d=1;function m(r){for(var a=0,i=e.length;a<d;++a)for(var s,c,u,f,p,h,m,g=0;g<i;++g)c=(s=e[g]).source,f=(u=s.target).x+u.vx-c.x-c.vx||o(),p=u.y+u.vy-c.y-c.vy||o(),f*=h=((h=Math.sqrt(f*f+p*p))-n[g])/h*r*t[g],p*=h,u.vx-=f*(m=l[g]),u.vy-=p*m,c.vx+=f*(m=1-m),c.vy+=p*m}function g(){if(a){var i,o,c=a.length,p=e.length,h=r.map(a,f);for(i=0,s=new Array(c);i<p;++i)(o=e[i]).index=i,"object"!=typeof o.source&&(o.source=u(h,o.source)),"object"!=typeof o.target&&(o.target=u(h,o.target)),s[o.source.index]=(s[o.source.index]||0)+1,s[o.target.index]=(s[o.target.index]||0)+1;for(i=0,l=new Array(p);i<p;++i)o=e[i],l[i]=s[o.source.index]/(s[o.source.index]+s[o.target.index]);t=new Array(p),y(),n=new Array(p),v()}}function y(){if(a)for(var r=0,n=e.length;r<n;++r)t[r]=+p(e[r],r,e)}function v(){if(a)for(var t=0,r=e.length;t<r;++t)n[t]=+h(e[t],t,e)}return null==e&&(e=[]),m.initialize=function(e){a=e,g()},m.links=function(t){return arguments.length?(e=t,g(),m):e},m.id=function(e){return arguments.length?(f=e,m):f},m.iterations=function(e){return arguments.length?(d=+e,m):d},m.strength=function(e){return arguments.length?(p="function"==typeof e?e:i(+e),y(),m):p},m.distance=function(e){return arguments.length?(h="function"==typeof e?e:i(+e),v(),m):h},m},e.forceManyBody=function(){var e,r,n,a,s=i(-30),l=1,c=1/0,u=.81;function h(a){var i,o=e.length,s=t.quadtree(e,f,p).visitAfter(m);for(n=a,i=0;i<o;++i)r=e[i],s.visit(g)}function d(){if(e){var t,r,n=e.length;for(a=new Array(n),t=0;t<n;++t)r=e[t],a[r.index]=+s(r,t,e)}}function m(e){var t,r,n,i,o,s=0,l=0;if(e.length){for(n=i=o=0;o<4;++o)(t=e[o])&&(r=Math.abs(t.value))&&(s+=t.value,l+=r,n+=r*t.x,i+=r*t.y);e.x=n/l,e.y=i/l}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=a[t.data.index]}while(t=t.next)}e.value=s}function g(e,t,i,s){if(!e.value)return!0;var f=e.x-r.x,p=e.y-r.y,h=s-t,d=f*f+p*p;if(h*h/u<d)return d<c&&(0===f&&(d+=(f=o())*f),0===p&&(d+=(p=o())*p),d<l&&(d=Math.sqrt(l*d)),r.vx+=f*e.value*n/d,r.vy+=p*e.value*n/d),!0;if(!(e.length||d>=c)){(e.data!==r||e.next)&&(0===f&&(d+=(f=o())*f),0===p&&(d+=(p=o())*p),d<l&&(d=Math.sqrt(l*d)));do{e.data!==r&&(h=a[e.data.index]*n/d,r.vx+=f*h,r.vy+=p*h)}while(e=e.next)}}return h.initialize=function(t){e=t,d()},h.strength=function(e){return arguments.length?(s="function"==typeof e?e:i(+e),d(),h):s},h.distanceMin=function(e){return arguments.length?(l=e*e,h):Math.sqrt(l)},h.distanceMax=function(e){return arguments.length?(c=e*e,h):Math.sqrt(c)},h.theta=function(e){return arguments.length?(u=e*e,h):Math.sqrt(u)},h},e.forceRadial=function(e,t,r){var n,a,o,s=i(.1);function l(e){for(var i=0,s=n.length;i<s;++i){var l=n[i],c=l.x-t||1e-6,u=l.y-r||1e-6,f=Math.sqrt(c*c+u*u),p=(o[i]-f)*a[i]*e/f;l.vx+=c*p,l.vy+=u*p}}function c(){if(n){var t,r=n.length;for(a=new Array(r),o=new Array(r),t=0;t<r;++t)o[t]=+e(n[t],t,n),a[t]=isNaN(o[t])?0:+s(n[t],t,n)}}return"function"!=typeof e&&(e=i(+e)),null==t&&(t=0),null==r&&(r=0),l.initialize=function(e){n=e,c()},l.strength=function(e){return arguments.length?(s="function"==typeof e?e:i(+e),c(),l):s},l.radius=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),c(),l):e},l.x=function(e){return arguments.length?(t=+e,l):t},l.y=function(e){return arguments.length?(r=+e,l):r},l},e.forceSimulation=function(e){var t,i=1,o=.001,s=1-Math.pow(o,1/300),l=0,c=.6,u=r.map(),f=a.timer(d),p=n.dispatch("tick","end");function d(){m(),p.call("tick",t),i<o&&(f.stop(),p.call("end",t))}function m(r){var n,a,o=e.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(i+=(l-i)*s,u.each((function(e){e(i)})),n=0;n<o;++n)null==(a=e[n]).fx?a.x+=a.vx*=c:(a.x=a.fx,a.vx=0),null==a.fy?a.y+=a.vy*=c:(a.y=a.fy,a.vy=0);return t}function g(){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 a=10*Math.sqrt(r),i=r*h;t.x=a*Math.cos(i),t.y=a*Math.sin(i)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function y(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),g(),t={tick:m,restart:function(){return f.restart(d),t},stop:function(){return f.stop(),t},nodes:function(r){return arguments.length?(e=r,g(),u.each(y),t):e},alpha:function(e){return arguments.length?(i=+e,t):i},alphaMin:function(e){return arguments.length?(o=+e,t):o},alphaDecay:function(e){return arguments.length?(s=+e,t):+s},alphaTarget:function(e){return arguments.length?(l=+e,t):l},velocityDecay:function(e){return arguments.length?(c=1-e,t):1-c},force:function(e,r){return arguments.length>1?(null==r?u.remove(e):u.set(e,y(r)),t):u.get(e)},find:function(t,r,n){var a,i,o,s,l,c=0,u=e.length;for(null==n?n=1/0:n*=n,c=0;c<u;++c)(o=(a=t-(s=e[c]).x)*a+(i=r-s.y)*i)<n&&(l=s,n=o);return l},on:function(e,r){return arguments.length>1?(p.on(e,r),t):p.on(e)}}},e.forceX=function(e){var t,r,n,a=i(.1);function o(e){for(var a,i=0,o=t.length;i<o;++i)(a=t[i]).vx+=(n[i]-a.x)*r[i]*e}function s(){if(t){var i,o=t.length;for(r=new Array(o),n=new Array(o),i=0;i<o;++i)r[i]=isNaN(n[i]=+e(t[i],i,t))?0:+a(t[i],i,t)}}return"function"!=typeof e&&(e=i(null==e?0:+e)),o.initialize=function(e){t=e,s()},o.strength=function(e){return arguments.length?(a="function"==typeof e?e:i(+e),s(),o):a},o.x=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),s(),o):e},o},e.forceY=function(e){var t,r,n,a=i(.1);function o(e){for(var a,i=0,o=t.length;i<o;++i)(a=t[i]).vy+=(n[i]-a.y)*r[i]*e}function s(){if(t){var i,o=t.length;for(r=new Array(o),n=new Array(o),i=0;i<o;++i)r[i]=isNaN(n[i]=+e(t[i],i,t))?0:+a(t[i],i,t)}}return"function"!=typeof e&&(e=i(null==e?0:+e)),o.initialize=function(e){t=e,s()},o.strength=function(e){return arguments.length?(a="function"==typeof e?e:i(+e),s(),o):a},o.y=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),s(),o):e},o},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof r&&void 0!==t?a(r,e("d3-quadtree"),e("d3-collection"),e("d3-dispatch"),e("d3-timer")):a(n.d3=n.d3||{},n.d3,n.d3,n.d3,n.d3)},{"d3-collection":108,"d3-dispatch":110,"d3-quadtree":118,"d3-timer":123}],112:[function(e,t,r){!function(e,n){!function(e){"use strict";function t(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)]}function r(e){return(e=t(Math.abs(e)))?e[1]:NaN}var n,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(e){if(!(t=a.exec(e)))throw new Error("invalid format: "+e);var t;return new o({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 o(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function s(e,r){var n=t(e,r);if(!n)return e+"";var a=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+a:a.length>i+1?a.slice(0,i+1)+"."+a.slice(i+1):a+new Array(i-a.length+2).join("0")}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return s(100*e,t)},r:s,s:function(e,r){var a=t(e,r);if(!a)return e+"";var i=a[0],o=a[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=i.length;return s===l?i:s>l?i+new Array(s-l+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+t(e,Math.max(0,r+s-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function c(e){return e}var u,f=Array.prototype.map,p=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function h(e){var t,a,o=void 0===e.grouping||void 0===e.thousands?c:(t=f.call(e.grouping,Number),a=e.thousands+"",function(e,r){for(var n=e.length,i=[],o=0,s=t[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(e.substring(n-=s,n+s)),!((l+=s+1)>r));)s=t[o=(o+1)%t.length];return i.reverse().join(a)}),s=void 0===e.currency?"":e.currency[0]+"",u=void 0===e.currency?"":e.currency[1]+"",h=void 0===e.decimal?".":e.decimal+"",d=void 0===e.numerals?c:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(f.call(e.numerals,String)),m=void 0===e.percent?"%":e.percent+"",g=void 0===e.minus?"-":e.minus+"",y=void 0===e.nan?"NaN":e.nan+"";function v(e){var t=(e=i(e)).fill,r=e.align,a=e.sign,c=e.symbol,f=e.zero,v=e.width,b=e.comma,x=e.precision,_=e.trim,w=e.type;"n"===w?(b=!0,w="g"):l[w]||(void 0===x&&(x=12),_=!0,w="g"),(f||"0"===t&&"="===r)&&(f=!0,t="0",r="=");var k="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",D="$"===c?u:/[%p]/.test(w)?m:"",T=l[w],A=/[defgprs%]/.test(w);function S(e){var i,s,l,c=k,u=D;if("c"===w)u=T(e)+u,e="";else{var m=(e=+e)<0||1/e<0;if(e=isNaN(e)?y:T(Math.abs(e),x),_&&(e=function(e){e:for(var t,r=e.length,n=1,a=-1;n<r;++n)switch(e[n]){case".":a=t=n;break;case"0":0===a&&(a=n),t=n;break;default:if(!+e[n])break e;a>0&&(a=0)}return a>0?e.slice(0,a)+e.slice(t+1):e}(e)),m&&0==+e&&"+"!==a&&(m=!1),c=(m?"("===a?a:g:"-"===a||"("===a?"":a)+c,u=("s"===w?p[8+n/3]:"")+u+(m&&"("===a?")":""),A)for(i=-1,s=e.length;++i<s;)if(48>(l=e.charCodeAt(i))||l>57){u=(46===l?h+e.slice(i+1):e.slice(i))+u,e=e.slice(0,i);break}}b&&!f&&(e=o(e,1/0));var S=c.length+e.length+u.length,M=S<v?new Array(v-S+1).join(t):"";switch(b&&f&&(e=o(M+e,M.length?v-u.length:1/0),M=""),r){case"<":e=c+e+u+M;break;case"=":e=c+M+e+u;break;case"^":e=M.slice(0,S=M.length>>1)+c+e+u+M.slice(S);break;default:e=M+c+e+u}return d(e)}return x=void 0===x?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),S.toString=function(){return e+""},S}return{format:v,formatPrefix:function(e,t){var n=v(((e=i(e)).type="f",e)),a=3*Math.max(-8,Math.min(8,Math.floor(r(t)/3))),o=Math.pow(10,-a),s=p[8+a/3];return function(e){return n(o*e)+s}}}}function d(t){return u=h(t),e.format=u.format,e.formatPrefix=u.formatPrefix,u}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),e.FormatSpecifier=o,e.formatDefaultLocale=d,e.formatLocale=h,e.formatSpecifier=i,e.precisionFixed=function(e){return Math.max(0,-r(Math.abs(e)))},e.precisionPrefix=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(t)/3)))-r(Math.abs(e)))},e.precisionRound=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,r(t)-r(e))+1},Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:(e="undefined"!=typeof globalThis?globalThis:e||self).d3=e.d3||{})}(this)},{}],113:[function(e,t,r){var n,a;n=this,a=function(e,t,r){"use strict";var n=Math.abs,a=Math.atan,i=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,f=Math.min,p=Math.pow,h=Math.round,d=Math.sign||function(e){return e>0?1:e<0?-1:0},m=Math.sin,g=Math.tan,y=1e-6,v=Math.PI,b=v/2,x=v/4,_=Math.SQRT1_2,w=E(2),k=E(v),D=2*v,T=180/v,A=v/180;function S(e){return e>1?b:e<-1?-b:Math.asin(e)}function M(e){return e>1?0:e<-1?v:Math.acos(e)}function E(e){return e>0?Math.sqrt(e):0}function C(e){return(s(e)-s(-e))/2}function N(e){return(s(e)+s(-e))/2}function O(e){var t=g(e/2),r=2*c(o(e/2))/(t*t);function a(e,t){var n=o(e),a=o(t),i=m(t),s=a*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*a*m(e),l*i]}return a.invert=function(t,a){var s,l=E(t*t+a*a),u=-e/2,f=50;if(!l)return[0,0];do{var p=u/2,h=o(p),d=m(p),g=d/h,v=-c(n(h));u-=s=(2/g*v-r*g-l)/(-v/(d*d)+1-r/(2*h*h))*(h<0?.7:1)}while(n(s)>y&&--f>0);var b=m(u);return[i(t*b,l*o(u)),S(a*b/l)]},a}function I(e,t){var r=o(t),n=function(e){return e?e/Math.sin(e):1}(M(r*o(e/=2)));return[2*r*m(e)*n,m(t)*n]}function P(e){var t=m(e),r=o(e),a=e>=0?1:-1,s=g(a*e),l=(1+t-r)/2;function c(e,n){var c=o(n),u=o(e/=2);return[(1+c)*m(e),(a*n>-i(u,s)-.001?0:10*-a)+l+m(n)*r-(1+c)*t*u]}return c.invert=function(e,c){var u=0,f=0,p=50;do{var h=o(u),d=m(u),g=o(f),v=m(f),b=1+g,x=b*d-e,_=l+v*r-b*t*h-c,w=b*h/2,k=-d*v,D=t*b*d/2,T=r*g+t*h*v,A=k*D-T*w,S=(_*k-x*T)/A/2,M=(x*D-_*w)/A;n(M)>2&&(M/=2),u-=S,f-=M}while((n(S)>y||n(M)>y)&&--p>0);return a*f>-i(o(u),s)-.001?[2*u,f]:null},c}function R(e,t){var r=g(t/2),n=E(1-r*r),a=1+n*o(e/=2),i=m(e)*n/a,s=r/a,l=i*i,c=s*s;return[4/3*i*(3+l-3*c),4/3*s*(3+3*l-c)]}I.invert=function(e,t){if(!(e*e+4*t*t>v*v+y)){var r=e,a=t,i=25;do{var s,l=m(r),c=m(r/2),u=o(r/2),f=m(a),p=o(a),h=m(2*a),d=f*f,g=p*p,b=c*c,x=1-g*u*u,_=x?M(p*u)*E(s=1/x):s=0,w=2*_*p*c-e,k=_*f-t,D=s*(g*b+_*p*u*d),T=s*(.5*l*h-2*_*f*c),A=.25*s*(h*c-_*f*g*l),S=s*(d*u+_*b*p),C=T*A-S*D;if(!C)break;var N=(k*T-w*S)/C,O=(w*A-k*D)/C;r-=N,a-=O}while((n(N)>y||n(O)>y)&&--i>0);return[r,a]}},R.invert=function(e,t){if(t*=3/8,!(e*=3/8)&&n(t)>1)return null;var r=1+e*e+t*t,a=E((r-E(r*r-4*t*t))/2),s=S(a)/3,l=a?function(e){return c(e+E(e*e-1))}(n(t/a))/3:function(e){return c(e+E(e*e+1))}(n(e))/3,u=o(s),f=N(l),p=f*f-u*u;return[2*d(e)*i(C(l)*u,.25-p),2*d(t)*i(f*m(s),.25+p)]};var L=E(8),F=c(1+w);function B(e,t){var r=n(t);return r<x?[e,c(g(x+t/2))]:[e*o(r)*(2*w-1/m(r)),d(t)*(2*w*(r-x)-c(g(r/2)))]}function z(e){var r=2*v/e;function s(e,a){var s=t.geoAzimuthalEquidistantRaw(e,a);if(n(e)>b){var l=i(s[1],s[0]),c=E(s[0]*s[0]+s[1]*s[1]),u=r*h((l-b)/r)+b,f=i(m(l-=u),2-o(l));l=u+S(v/c*m(f))-f,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(e,n){var s=E(e*e+n*n);if(s>b){var l=i(n,e),c=r*h((l-b)/r)+b,u=l>c?-1:1,f=s*o(c-l),p=1/g(u*M((f-v)/E(v*(v-2*f)+s*s)));l=c+2*a((p+u*E(p*p-3))/3),e=s*o(l),n=s*m(l)}return t.geoAzimuthalEquidistantRaw.invert(e,n)},s}function j(e,r){if(arguments.length<2&&(r=e),1===r)return t.geoAzimuthalEqualAreaRaw;if(r===1/0)return U;function n(n,a){var i=t.geoAzimuthalEqualAreaRaw(n/r,a);return i[0]*=e,i}return n.invert=function(n,a){var i=t.geoAzimuthalEqualAreaRaw.invert(n/e,a);return i[0]*=r,i},n}function U(e,t){return[e*o(t)/o(t/=2),2*m(t)]}function $(e,t,r){var a,i,o,s=100;r=void 0===r?0:+r,t=+t;do{(i=e(r))===(o=e(r+y))&&(o=i+y),r-=a=-1*y*(i-t)/(i-o)}while(s-- >0&&n(a)>y);return s<0?NaN:r}function V(e,t,r){return void 0===t&&(t=40),void 0===r&&(r=1e-12),function(a,i,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var f=0;f<t;f++){var p=e(o,s),h=p[0]-a,d=p[1]-i;if(n(h)<r&&n(d)<r)break;var m=h*h+d*d;if(m>l)o-=c/=2,s-=u/=2;else{l=m;var g=(o>0?-1:1)*r,y=(s>0?-1:1)*r,v=e(o+g,s),b=e(o,s+y),x=(v[0]-p[0])/g,_=(v[1]-p[1])/g,w=(b[0]-p[0])/y,k=(b[1]-p[1])/y,D=k*x-_*w,T=(n(D)<.5?.5:1)/D;if(o+=c=(d*w-h*k)*T,s+=u=(h*_-d*x)*T,n(c)<r&&n(u)<r)break}}return[o,s]}}function q(){var e=j(1.68,2);function t(t,r){if(t+r<-1.4){var n=(t-r+1.6)*(t+r+1.4)/8;t+=n,r-=.8*n*m(r+v/2)}var a=e(t,r),i=(1-o(t*r))/12;return a[1]<0&&(a[0]*=1+i),a[1]>0&&(a[1]*=1+i/1.5*a[0]*a[0]),a}return t.invert=V(t),t}function W(e,t){var r,a=e*m(t),i=30;do{t-=r=(t+m(t)-a)/(1+o(t))}while(n(r)>y&&--i>0);return t/2}function H(e,t,r){function n(n,a){return[e*n*o(a=W(r,a)),t*m(a)]}return n.invert=function(n,a){return a=S(a/t),[n/(e*o(a)),S((2*a+m(2*a))/r)]},n}B.invert=function(e,t){if((i=n(t))<F)return[e,2*a(s(t))-b];var r,i,l=x,u=25;do{var f=o(l/2),p=g(l/2);l-=r=(L*(l-x)-c(p)-i)/(L-f*f/(2*p))}while(n(r)>1e-12&&--u>0);return[e/(o(l)*(L-1/m(l))),d(t)*l]},U.invert=function(e,t){var r=2*S(t/2);return[e*o(r/2)/o(r),r]};var G=H(w/b,w,v),X=2.00276,Y=1.11072;function Z(e,t){var r=W(v,t);return[X*e/(1/o(t)+Y/o(r)),(t+w*m(r))/X]}function K(e){var r=0,n=t.geoProjectionMutator(e),a=n(r);return a.parallel=function(e){return arguments.length?n(r=e*A):r*T},a}function J(e,t){return[e*o(t),t]}function Q(e){if(!e)return J;var t=1/g(e);function r(r,n){var a=t+e-n,i=a?r*o(n)/a:a;return[a*m(i),t-a*o(i)]}return r.invert=function(r,n){var a=E(r*r+(n=t-n)*n),s=t+e-a;return[a/o(s)*i(r,n),s]},r}function ee(e){function t(t,r){var n=b-r,a=n?t*e*m(n)/n:n;return[n*m(a)/e,b-n*o(a)]}return t.invert=function(t,r){var n=t*e,a=b-r,o=E(n*n+a*a),s=i(n,a);return[(o?o/m(o):1)*s/e,b-o]},t}Z.invert=function(e,t){var r,a,i=X*t,s=t<0?-x:x,l=25;do{a=i-w*m(s),s-=r=(m(2*s)+2*s-v*m(a))/(2*o(2*s)+2+v*o(a)*w*o(s))}while(n(r)>y&&--l>0);return a=i-w*m(s),[e*(1/o(a)+Y/o(s))/X,a]},J.invert=function(e,t){return[e/o(t),t]};var te=H(1,4/v,v);function re(e,t,r,a,s,l){var c,u=o(l);if(n(e)>1||n(l)>1)c=M(r*s+t*a*u);else{var f=m(e/2),p=m(l/2);c=2*S(E(f*f+t*a*p*p))}return n(c)>y?[c,i(a*m(l),t*s-r*a*u)]:[0,0]}function ne(e,t,r){return M((e*e+t*t-r*r)/(2*e*t))}function ae(e){return e-2*v*l((e+v)/(2*v))}function ie(e,t,r){for(var n,a=[[e[0],e[1],m(e[1]),o(e[1])],[t[0],t[1],m(t[1]),o(t[1])],[r[0],r[1],m(r[1]),o(r[1])]],i=a[2],s=0;s<3;++s,i=n)n=a[s],i.v=re(n[1]-i[1],i[3],i[2],n[3],n[2],n[0]-i[0]),i.point=[0,0];var l=ne(a[0].v[0],a[2].v[0],a[1].v[0]),c=ne(a[0].v[0],a[1].v[0],a[2].v[0]),u=v-l;a[2].point[1]=0,a[0].point[0]=-(a[1].point[0]=a[0].v[0]/2);var f=[a[2].point[0]=a[0].point[0]+a[2].v[0]*o(l),2*(a[0].point[1]=a[1].point[1]=a[2].v[0]*m(l))];return function(e,t){var r,n=m(t),i=o(t),s=new Array(3);for(r=0;r<3;++r){var l=a[r];if(s[r]=re(t-l[1],l[3],l[2],i,n,e-l[0]),!s[r][0])return l.point;s[r][1]=ae(s[r][1]-l.v[1])}var p=f.slice();for(r=0;r<3;++r){var h=2==r?0:r+1,d=ne(a[r].v[0],s[r][0],s[h][0]);s[r][1]<0&&(d=-d),r?1==r?(d=c-d,p[0]-=s[r][0]*o(d),p[1]-=s[r][0]*m(d)):(d=u-d,p[0]+=s[r][0]*o(d),p[1]+=s[r][0]*m(d)):(p[0]+=s[r][0]*o(d),p[1]-=s[r][0]*m(d))}return p[0]/=3,p[1]/=3,p}}function oe(e){return e[0]*=A,e[1]*=A,e}function se(e,r,n){var a=t.geoCentroid({type:"MultiPoint",coordinates:[e,r,n]}),i=[-a[0],-a[1]],o=t.geoRotation(i),s=ie(oe(o(e)),oe(o(r)),oe(o(n)));s.invert=V(s);var l=t.geoProjection(s).rotate(i),c=l.center;return delete l.rotate,l.center=function(e){return arguments.length?c(o(e)):o.invert(c())},l.clipAngle(90)}function le(e,t){var r=E(1-m(t));return[2/k*e*r,k*(1-r)]}function ce(e){var t=g(e);function r(e,r){return[e,(e?e/m(e):1)*(m(r)*o(e)-t*o(r))]}return r.invert=t?function(e,r){e&&(r*=m(e)/e);var n=o(e);return[e,2*i(E(n*n+t*t-r*r)-n,t-r)]}:function(e,t){return[e,S(e?t*g(e)/e:t)]},r}le.invert=function(e,t){var r=(r=t/k-1)*r;return[r>0?e*E(v/r)/2:0,S(1-r)]};var ue=E(3);function fe(e,t){return[ue*e*(2*o(2*t/3)-1)/k,ue*k*m(t/3)]}function pe(e){var t=o(e);function r(e,r){return[e*t,m(r)/t]}return r.invert=function(e,r){return[e/t,S(r*t)]},r}function he(e){var t=o(e);function r(e,r){return[e*t,(1+t)*g(r/2)]}return r.invert=function(e,r){return[e/t,2*a(r/(1+t))]},r}function de(e,t){var r=E(8/(3*v));return[r*e*(1-n(t)/v),r*t]}function me(e,t){var r=E(4-3*m(n(t)));return[2/E(6*v)*e*r,d(t)*E(2*v/3)*(2-r)]}function ge(e,t){var r=E(v*(4+v));return[2/r*e*(1+E(1-4*t*t/(v*v))),4/r*t]}function ye(e,t){var r=(2+b)*m(t);t/=2;for(var a=0,i=1/0;a<10&&n(i)>y;a++){var s=o(t);t-=i=(t+m(t)*(s+2)-r)/(2*s*(1+s))}return[2/E(v*(4+v))*e*(1+o(t)),2*E(v/(4+v))*m(t)]}function ve(e,t){return[e*(1+o(t))/E(2+v),2*t/E(2+v)]}function be(e,t){for(var r=(1+b)*m(t),a=0,i=1/0;a<10&&n(i)>y;a++)t-=i=(t+m(t)-r)/(1+o(t));return r=E(2+v),[e*(1+o(t))/r,2*t/r]}fe.invert=function(e,t){var r=3*S(t/(ue*k));return[k*e/(ue*(2*o(2*r/3)-1)),r]},de.invert=function(e,t){var r=E(8/(3*v)),a=t/r;return[e/(r*(1-n(a)/v)),a]},me.invert=function(e,t){var r=2-n(t)/E(2*v/3);return[e*E(6*v)/(2*r),d(t)*S((4-r*r)/3)]},ge.invert=function(e,t){var r=E(v*(4+v))/2;return[e*r/(1+E(1-t*t*(4+v)/(4*v))),t*r/2]},ye.invert=function(e,t){var r=t*E((4+v)/v)/2,n=S(r),a=o(n);return[e/(2/E(v*(4+v))*(1+a)),S((n+r*(a+2))/(2+b))]},ve.invert=function(e,t){var r=E(2+v),n=t*r/2;return[r*e/(1+o(n)),n]},be.invert=function(e,t){var r=1+b,n=E(r/2);return[2*e*n/(1+o(t*=n)),S((t+m(t))/r)]};var xe=3+2*w;function _e(e,t){var r=m(e/=2),n=o(e),i=E(o(t)),s=o(t/=2),l=m(t)/(s+w*n*i),u=E(2/(1+l*l)),f=E((w*s+(n+r)*i)/(w*s+(n-r)*i));return[xe*(u*(f-1/f)-2*c(f)),xe*(u*l*(f+1/f)-2*a(l))]}_e.invert=function(e,t){if(!(r=R.invert(e/1.2,1.065*t)))return null;var r,i=r[0],s=r[1],l=20;e/=xe,t/=xe;do{var p=i/2,h=s/2,d=m(p),g=o(p),v=m(h),x=o(h),k=o(s),D=E(k),T=v/(x+w*g*D),A=T*T,S=E(2/(1+A)),M=(w*x+(g+d)*D)/(w*x+(g-d)*D),C=E(M),N=C-1/C,O=C+1/C,I=S*N-2*c(C)-e,P=S*T*O-2*a(T)-t,L=v&&_*D*d*A/v,F=(w*g*x+D)/(2*(x+w*g*D)*(x+w*g*D)*D),B=-.5*T*S*S*S,z=B*L,j=B*F,U=(U=2*x+w*D*(g-d))*U*C,$=(w*g*x*D+k)/U,V=-w*d*v/(D*U),q=N*z-2*$/C+S*($+$/M),W=N*j-2*V/C+S*(V+V/M),H=T*O*z-2*L/(1+A)+S*O*L+S*T*($-$/M),G=T*O*j-2*F/(1+A)+S*O*F+S*T*(V-V/M),X=W*H-G*q;if(!X)break;var Y=(P*W-I*G)/X,Z=(I*H-P*q)/X;i-=Y,s=u(-b,f(b,s-Z))}while((n(Y)>y||n(Z)>y)&&--l>0);return n(n(s)-b)<y?[0,s]:l&&[i,s]};var we=o(35*A);function ke(e,t){var r=g(t/2);return[e*we*E(1-r*r),(1+we)*r]}function De(e,t){var r=t/2,n=o(r);return[2*e/k*o(t)*n*n,k*g(r)]}function Te(e){var t=1-e,r=a(v,0)[0]-a(-v,0)[0],n=E(2*(a(0,b)[1]-a(0,-b)[1])/r);function a(r,n){var a=o(n),i=m(n);return[a/(t+e*a)*r,t*n+e*i]}function i(e,t){var r=a(e,t);return[r[0]*n,r[1]/n]}function s(e){return i(0,e)[1]}return i.invert=function(r,a){var i=$(s,a);return[r/n*(e+t/o(i)),i]},i}function Ae(e){return[e[0]/2,S(g(e[1]/2*A))*T]}function Se(e){return[2*e[0],2*a(m(e[1]*A))*T]}function Me(e,r){var a=2*v/r,s=e*e;function l(r,l){var c=t.geoAzimuthalEquidistantRaw(r,l),u=c[0],f=c[1],p=u*u+f*f;if(p>s){var d=E(p),g=i(f,u),x=a*h(g/a),_=g-x,w=e*o(_),k=(e*m(_)-_*m(w))/(b-w),D=Ee(_,k),T=(v-e)/Ce(D,w,v);u=d;var A,S=50;do{u-=A=(e+Ce(D,w,u)*T-d)/(D(u)*T)}while(n(A)>y&&--S>0);f=_*m(u),u<b&&(f-=k*(u-b));var M=m(x),C=o(x);c[0]=u*C-f*M,c[1]=u*M+f*C}return c}return l.invert=function(r,l){var c=r*r+l*l;if(c>s){var u=E(c),f=i(l,r),p=a*h(f/a),d=f-p;r=u*o(d),l=u*m(d);for(var g=r-b,y=m(r),x=l/y,_=r<b?1/0:0,w=10;;){var k=e*m(x),D=e*o(x),T=m(D),A=b-D,S=(k-x*T)/A,M=Ee(x,S);if(n(_)<1e-12||!--w)break;x-=_=(x*y-S*g-l)/(y-2*g*(A*(D+x*k*o(D)-T)-k*(k-x*T))/(A*A))}r=(u=e+Ce(M,D,r)*(v-e)/Ce(M,D,v))*o(f=p+x),l=u*m(f)}return t.geoAzimuthalEquidistantRaw.invert(r,l)},l}function Ee(e,t){return function(r){var n=e*o(r);return r<b&&(n-=t),E(1+n*n)}}function Ce(e,t,r){for(var n=(r-t)/50,a=e(t)+e(r),i=1,o=t;i<50;++i)a+=2*e(o+=n);return.5*a*n}function Ne(e,t,r,a,i,s,l,c){function u(n,u){if(!u)return[e*n/v,0];var f=u*u,p=e+f*(t+f*(r+f*a)),h=u*(i-1+f*(s-c+f*l)),d=(p*p+h*h)/(2*h),g=n*S(p/d)/v;return[d*m(g),u*(1+f*c)+d*(1-o(g))]}return arguments.length<8&&(c=0),u.invert=function(u,f){var p,h,d=v*u/e,g=f,b=50;do{var x=g*g,_=e+x*(t+x*(r+x*a)),w=g*(i-1+x*(s-c+x*l)),k=_*_+w*w,D=2*w,T=k/D,A=T*T,M=S(_/T)/v,C=d*M,N=_*_,O=(2*t+x*(4*r+6*x*a))*g,I=i+x*(3*s+5*x*l),P=(2*(_*O+w*(I-1))*D-k*(2*(I-1)))/(D*D),R=o(C),L=m(C),F=T*R,B=T*L,z=d/v*(1/E(1-N/A))*(O*T-_*P)/A,j=B-u,U=g*(1+x*c)+T-F-f,$=P*L+F*z,V=F*M,q=1+P-(P*R-B*z),W=B*M,H=$*W-q*V;if(!H)break;d-=p=(U*$-j*q)/H,g-=h=(j*W-U*V)/H}while((n(p)>y||n(h)>y)&&--b>0);return[d,g]},u}ke.invert=function(e,t){var r=t/(1+we);return[e&&e/(we*E(1-r*r)),2*a(r)]},De.invert=function(e,t){var r=a(t/k),n=o(r),i=2*r;return[e*k/2/(o(i)*n*n),i]};var Oe=Ne(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Ie=Ne(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Pe=Ne(5/6*v,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Re(e,t){var r=e*e,n=t*t;return[e*(1-.162388*n)*(.87-952426e-9*r*r),t*(1+n/12)]}Re.invert=function(e,t){var r,a=e,i=t,o=50;do{var s=i*i;i-=r=(i*(1+s/12)-t)/(1+s/4)}while(n(r)>y&&--o>0);o=50,e/=1-.162388*s;do{var l=(l=a*a)*l;a-=r=(a*(.87-952426e-9*l)-e)/(.87-.00476213*l)}while(n(r)>y&&--o>0);return[a,i]};var Le=Ne(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Fe(e){var t=e(b,0)[0]-e(-b,0)[0];function r(r,n){var a=r>0?-.5:.5,i=e(r+a*v,n);return i[0]-=a*t,i}return e.invert&&(r.invert=function(r,n){var a=r>0?-.5:.5,i=e.invert(r+a*t,n),o=i[0]-a*v;return o<-v?o+=2*v:o>v&&(o-=2*v),i[0]=o,i}),r}function Be(e,t){var r=d(e),a=d(t),s=o(t),l=o(e)*s,c=m(e)*s,u=m(a*t);e=n(i(c,u)),t=S(l),n(e-b)>y&&(e%=b);var f=function(e,t){if(t===b)return[0,0];var r,a,i=m(t),s=i*i,l=s*s,c=1+l,u=1+3*l,f=1-l,p=S(1/E(c)),h=f+s*c*p,d=(1-i)/h,g=E(d),x=d*c,_=E(x),w=g*f;if(0===e)return[0,-(w+s*_)];var k,D=o(t),T=1/D,A=2*i*D,M=(-h*D-(-3*s+p*u)*A*(1-i))/(h*h),C=-T*A,N=-T*(s*c*M+d*u*A),O=-2*T*(f*(.5*M/g)-2*s*g*A),I=4*e/v;if(e>.222*v||t<v/4&&e>.175*v){if(r=(w+s*E(x*(1+l)-w*w))/(1+l),e>v/4)return[r,r];var P=r,R=.5*r;r=.5*(R+P),a=50;do{var L=r*(O+C*E(x-r*r))+N*S(r/_)-I;if(!L)break;L<0?R=r:P=r,r=.5*(R+P)}while(n(P-R)>y&&--a>0)}else{r=y,a=25;do{var F=r*r,B=E(x-F),z=O+C*B,j=r*z+N*S(r/_)-I;r-=k=B?j/(z+(N-C*F)/B):0}while(n(k)>y&&--a>0)}return[r,-w-s*E(x-r*r)]}(e>v/4?b-e:e,t);return e>v/4&&(u=f[0],f[0]=-f[1],f[1]=-u),f[0]*=r,f[1]*=-a,f}function ze(e,t){var r,i,l,c,u,f;if(t<y)return[(c=m(e))-(r=t*(e-c*(i=o(e)))/4)*i,i+r*c,1-t*c*c/2,e-r];if(t>=1-y)return r=(1-t)/4,l=1/(i=N(e)),[(c=((f=s(2*(f=e)))-1)/(f+1))+r*((u=i*C(e))-e)/(i*i),l-r*c*l*(u-e),l+r*c*l*(u+e),2*a(s(e))-b+r*(u-e)/i];var p=[1,0,0,0,0,0,0,0,0],h=[E(t),0,0,0,0,0,0,0,0],d=0;for(i=E(1-t),u=1;n(h[d]/p[d])>y&&d<8;)r=p[d++],h[d]=(r-i)/2,p[d]=(r+i)/2,i=E(r*i),u*=2;l=u*p[d]*e;do{l=(S(c=h[d]*m(i=l)/p[d])+l)/2}while(--d);return[m(l),c=o(l),c/o(l-i),l]}function je(e,t){if(!t)return e;if(1===t)return c(g(e/2+x));for(var r=1,i=E(1-t),o=E(t),s=0;n(o)>y;s++){if(e%v){var l=a(i*g(e)/r);l<0&&(l+=v),e+=l+~~(e/v)*v}else e+=e;o=(r+i)/2,i=E(r*i),o=((r=o)-i)/2}return e/(p(2,s)*r)}function Ue(e,t){var r=(w-1)/(w+1),l=E(1-r*r),u=je(b,l*l),f=c(g(v/4+n(t)/2)),p=s(-1*f)/E(r),h=function(e,t){var r=e*e,n=t+1,a=1-r-t*t;return[.5*((e>=0?b:-b)-i(a,2*e)),-.25*c(a*a+4*r)+.5*c(n*n+r)]}(p*o(-1*e),p*m(-1*e)),y=function(e,t,r){var i=n(e),o=C(n(t));if(i){var s=1/m(i),l=1/(g(i)*g(i)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+E(c*c-(r-1)*l*4))/2;return[je(a(1/E(u)),r)*d(e),je(a(E((u/l-1)/r)),1-r)*d(t)]}return[0,je(a(o),1-r)*d(t)]}(h[0],h[1],l*l);return[-y[1],(t>=0?1:-1)*(.5*u-y[0])]}function $e(e){var t=m(e),r=o(e),a=Ve(e);function s(e,i){var s=a(e,i);e=s[0],i=s[1];var l=m(i),c=o(i),u=o(e),f=M(t*l+r*c*u),p=m(f),h=n(p)>y?f/p:1;return[h*r*m(e),(n(e)>b?h:-h)*(t*c-r*l*u)]}return a.invert=Ve(-e),s.invert=function(e,r){var n=E(e*e+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,f=n*t,p=E(c*c+u*u-f*f),h=i(c*f+u*p,u*f-c*p),d=(n>b?-1:1)*i(e*s,n*o(h)*l+r*m(h)*s);return a.invert(d,h)},s}function Ve(e){var t=m(e),r=o(e);return function(e,n){var a=o(n),s=o(e)*a,l=m(e)*a,c=m(n);return[i(l,s*r-c*t),S(c*r+s*t)]}}Be.invert=function(e,t){n(e)>1&&(e=2*d(e)-e),n(t)>1&&(t=2*d(t)-t);var r=d(e),a=d(t),s=-r*e,l=-a*t,c=l/s<1,u=function(e,t){for(var r=0,a=1,i=.5,s=50;;){var l=i*i,c=E(i),u=S(1/E(1+l)),f=1-l+i*(1+l)*u,p=(1-c)/f,h=E(p),d=p*(1+l),m=h*(1-l),g=E(d-e*e),y=t+m+i*g;if(n(a-r)<1e-12||0==--s||0===y)break;y>0?r=i:a=i,i=.5*(r+a)}if(!s)return null;var b=S(c),x=o(b),_=1/x,w=2*c*x,k=(-f*x-(-3*i+u*(1+3*l))*w*(1-c))/(f*f);return[v/4*(e*(-2*_*(.5*k/h*(1-l)-2*i*h*w)+-_*w*g)+-_*(i*(1+l)*k+p*(1+3*l)*w)*S(e/E(d))),b]}(c?l:s,c?s:l),f=u[0],p=u[1],h=o(p);return c&&(f=-b-f),[r*(i(m(f)*h,-m(p))+v),a*S(o(f)*h)]},Ue.invert=function(e,t){var r,n,o,l,u,f,p=(w-1)/(w+1),h=E(1-p*p),d=(n=-e,o=h*h,(r=.5*je(b,h*h)-t)?(l=ze(r,o),n?(f=(u=ze(n,1-o))[1]*u[1]+o*l[0]*l[0]*u[0]*u[0],[[l[0]*u[2]/f,l[1]*l[2]*u[0]*u[1]/f],[l[1]*u[1]/f,-l[0]*l[2]*u[0]*u[2]/f],[l[2]*u[1]*u[2]/f,-o*l[0]*l[1]*u[0]/f]]):[[l[0],0],[l[1],0],[l[2],0]]):[[0,(u=ze(n,1-o))[0]/u[1]],[1/u[1],0],[u[2]/u[1],0]]),m=function(e,t){var r=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/r,(e[1]*t[0]-e[0]*t[1])/r]}(d[0],d[1]);return[i(m[1],m[0])/-1,2*a(s(-.5*c(p*m[0]*m[0]+p*m[1]*m[1])))-b]};var qe=S(1-1/3)*T,We=pe(0);function He(e){var t=qe*A,r=le(v,t)[0]-le(-v,t)[0],a=We(0,t)[1],i=le(0,t)[1],o=k-i,s=D/e,c=4/D,p=a+o*o*4/D;function h(h,d){var m,g=n(d);if(g>t){var y=f(e-1,u(0,l((h+v)/s)));(m=le(h+=v*(e-1)/e-y*s,g))[0]=m[0]*D/r-D*(e-1)/(2*e)+y*D/e,m[1]=a+4*(m[1]-i)*o/D,d<0&&(m[1]=-m[1])}else m=We(h,d);return m[0]*=c,m[1]/=p,m}return h.invert=function(t,h){t/=c;var d=n(h*=p);if(d>a){var m=f(e-1,u(0,l((t+v)/s)));t=(t+v*(e-1)/e-m*s)*r/D;var g=le.invert(t,.25*(d-a)*D/o+i);return g[0]-=v*(e-1)/e-m*s,h<0&&(g[1]=-g[1]),g}return We.invert(t,h)},h}function Ge(e,t){return[e,1&t?90-y:qe]}function Xe(e,t){return[e,1&t?-90+y:-qe]}function Ye(e){return[e[0]*(1-y),e[1]]}function Ze(e){var t,r=1+e,a=S(m(1/r)),s=2*E(v/(t=v+4*a*r)),l=.5*s*(r+E(e*(2+e))),c=e*e,u=r*r;function f(f,p){var h,d,g=1-m(p);if(g&&g<2){var y,x=b-p,_=25;do{var w=m(x),k=o(x),D=a+i(w,r-k),T=1+u-2*r*k;x-=y=(x-c*a-r*w+T*D-.5*g*t)/(2*r*w*D)}while(n(y)>1e-12&&--_>0);h=s*E(T),d=f*D/v}else h=s*(e+g),d=f*a/v;return[h*m(d),l-h*o(d)]}return f.invert=function(e,n){var o=e*e+(n-=l)*n,f=(1+u-o/(s*s))/(2*r),p=M(f),h=m(p),d=a+i(h,r-f);return[S(e/E(o))*v/d,S(1-2*(p-c*a-r*h+(1+u-2*r*f)*d)/t)]},f}function Ke(e,t){return t>-.7109889596207567?((e=G(e,t))[1]+=.0528035274542,e):J(e,t)}function Je(e,t){return n(t)>.7109889596207567?((e=G(e,t))[1]-=t>0?.0528035274542:-.0528035274542,e):J(e,t)}function Qe(e,t,r,n){var a=E(4*v/(2*r+(1+e-t/2)*m(2*r)+(e+t)/2*m(4*r)+t/2*m(6*r))),i=E(n*m(r)*E((1+e*o(2*r)+t*o(4*r))/(1+e+t))),s=r*c(1);function l(r){return E(1+e*o(2*r)+t*o(4*r))}function c(n){var a=n*r;return(2*a+(1+e-t/2)*m(2*a)+(e+t)/2*m(4*a)+t/2*m(6*a))/r}function u(e){return l(e)*m(e)}var f=function(e,t){var n=r*$(c,s*m(t)/r,t/v);isNaN(n)&&(n=r*d(t));var u=a*l(n);return[u*i*e/v*o(n),u/i*m(n)]};return f.invert=function(e,t){var n=$(u,t*i/a);return[e*v/(o(n)*a*i*l(n)),S(r*c(n/r)/s)]},0===r&&(a=E(n/v),(f=function(e,t){return[e*a,m(t)/a]}).invert=function(e,t){return[e/a,S(t*a)]}),f}function et(e,t,r){function a(r){return e+(1-e)*p(1-p(r,t),1/t)}function i(e){return function(e,t,r,n,a){void 0===n&&(n=1e-8),void 0===a&&(a=20);var i=e(t),o=e(.5*(t+r)),s=e(r);return function e(t,r,n,a,i,o,s,l,c,u,f){if(f.nanEncountered)return NaN;var p,h,d,m,g,y,v,b,x,_;if(h=t(r+.25*(p=n-r)),d=t(n-.25*p),isNaN(h))f.nanEncountered=!0;else{if(!isNaN(d))return _=((y=(m=p*(a+4*h+i)/12)+(g=p*(i+4*d+o)/12))-s)/15,u>c?(f.maxDepthCount++,y+_):Math.abs(_)<l?y+_:(b=e(t,r,v=r+.5*p,a,h,i,m,.5*l,c,u+1,f),isNaN(b)?(f.nanEncountered=!0,NaN):(x=e(t,v,n,i,d,o,g,.5*l,c,u+1,f),isNaN(x)?(f.nanEncountered=!0,NaN):b+x));f.nanEncountered=!0}}(e,t,r,i,o,s,(i+4*o+s)*(r-t)/6,n,a,1,{maxDepthCount:0,nanEncountered:!1})}(a,0,e,1e-4)}for(var o=1/i(1),s=1e3,l=(1+1e-8)*o,c=[],u=0;u<=s;u++)c.push(i(u/s)*l);function f(e){var t=0,r=s,n=500;do{c[n]>e?r=n:t=n,n=t+r>>1}while(n>t);var a=c[n+1]-c[n];return a&&(a=(e-c[n+1])/a),(n+1+a)/s}var h=2*f(1)/v*o/r,g=function(e,t){var r=f(n(m(t))),i=a(r)*e;return r/=h,[i,t>=0?r:-r]};return g.invert=function(e,t){var r;return n(t*=h)<1&&(r=d(t)*S(i(n(t))*o)),[e/a(n(t)),r]},g}function tt(e,t){return n(e[0]-t[0])<y&&n(e[1]-t[1])<y}function rt(e,t){for(var r,n,a,i=-1,o=e.length,s=e[0],l=[];++i<o;){n=((r=e[i])[0]-s[0])/t,a=(r[1]-s[1])/t;for(var c=0;c<t;++c)l.push([s[0]+c*n,s[1]+c*a]);s=r}return l.push(r),l}function nt(e){var t,n,a,i,o,s,l,c=[],u=e[0].length;for(l=0;l<u;++l)n=(t=e[0][l])[0][0],a=t[0][1],i=t[1][1],o=t[2][0],s=t[2][1],c.push(rt([[n+y,a+y],[n+y,i-y],[o-y,i-y],[o-y,s+y]],30));for(l=e[1].length-1;l>=0;--l)n=(t=e[1][l])[0][0],a=t[0][1],i=t[1][1],o=t[2][0],s=t[2][1],c.push(rt([[o-y,s-y],[o-y,i+y],[n+y,i+y],[n+y,a-y]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}function at(e,r,n){var a,i;function o(t,n){for(var a=n<0?-1:1,i=r[+(n<0)],o=0,s=i.length-1;o<s&&t>i[o][2][0];++o);var l=e(t-i[o][1][0],n);return l[0]+=e(i[o][1][0],a*n>a*i[o][0][1]?i[o][0][1]:n)[0],l}n?o.invert=n(o):e.invert&&(o.invert=function(t,n){for(var a=i[+(n<0)],s=r[+(n<0)],l=0,c=a.length;l<c;++l){var u=a[l];if(u[0][0]<=t&&t<u[1][0]&&u[0][1]<=n&&n<u[1][1]){var f=e.invert(t-e(s[l][1][0],0)[0],n);return f[0]+=s[l][1][0],tt(o(f[0],f[1]),[t,n])?f:null}}});var s=t.geoProjection(o),l=s.stream;return s.stream=function(e){var r=s.rotate(),n=l(e),i=(s.rotate([0,0]),l(e));return s.rotate(r),n.sphere=function(){t.geoStream(a,i)},n},s.lobes=function(t){return arguments.length?(a=nt(t),r=t.map((function(e){return e.map((function(e){return[[e[0][0]*A,e[0][1]*A],[e[1][0]*A,e[1][1]*A],[e[2][0]*A,e[2][1]*A]]}))})),i=r.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],a=e(t[2][0],t[2][1])[0],i=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return i>o&&(r=i,i=o,o=r),[[n,i],[a,o]]}))})),s):r.map((function(e){return e.map((function(e){return[[e[0][0]*T,e[0][1]*T],[e[1][0]*T,e[1][1]*T],[e[2][0]*T,e[2][1]*T]]}))}))},null!=r&&s.lobes(r),s}Ke.invert=function(e,t){return t>-.7109889596207567?G.invert(e,t-.0528035274542):J.invert(e,t)},Je.invert=function(e,t){return n(t)>.7109889596207567?G.invert(e,t+(t>0?.0528035274542:-.0528035274542)):J.invert(e,t)};var it=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],ot=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],st=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],lt=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],ct=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],ut=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function ft(e,t){return[3/D*e*E(v*v/3-t*t),t]}function pt(e){function t(t,r){if(n(n(r)-b)<y)return[0,r<0?-2:2];var a=m(r),i=p((1+a)/(1-a),e/2),s=.5*(i+1/i)+o(t*=e);return[2*m(t)/s,(i-1/i)/s]}return t.invert=function(t,r){var a=n(r);if(n(a-2)<y)return t?null:[0,d(r)*b];if(a>2)return null;var o=(t/=2)*t,s=(r/=2)*r,l=2*r/(1+o+s);return l=p((1+l)/(1-l),1/e),[i(2*t,1-o-s)/e,S((l-1)/(l+1))]},t}ft.invert=function(e,t){return[D/3*e/E(v*v/3-t*t),t]};var ht=v/w;function dt(e,t){return[e*(1+E(o(t)))/2,t/(o(t/2)*o(e/6))]}function mt(e,t){var r=e*e,n=t*t;return[e*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),t*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function gt(e,t){return[m(e)/o(t),g(t)*o(e)]}function yt(e){var t=o(e),r=g(x+e/2);function a(a,i){var o=i-e,s=n(o)<y?a*t:n(s=x+i/2)<y||n(n(s)-b)<y?0:a*o/c(g(s)/r);return[s,o]}return a.invert=function(a,i){var o,s=i+e;return[n(i)<y?a/t:n(o=x+s/2)<y||n(n(o)-b)<y?0:a*c(g(o)/r)/i,s]},a}function vt(e,t){return[e,1.25*c(g(x+.4*t))]}function bt(e){var t=e.length-1;function r(r,n){for(var a,i=o(n),s=2/(1+i*o(r)),l=s*i*m(r),c=s*m(n),u=t,f=e[u],p=f[0],h=f[1];--u>=0;)p=(f=e[u])[0]+l*(a=p)-c*h,h=f[1]+l*h+c*a;return[p=l*(a=p)-c*h,h=l*h+c*a]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var f,p=t,h=e[p],d=h[0],g=h[1],y=0,v=0;--p>=0;)y=d+c*(f=y)-u*v,v=g+c*v+u*f,d=(h=e[p])[0]+c*(f=d)-u*g,g=h[1]+c*g+u*f;var b,x,_=(y=d+c*(f=y)-u*v)*y+(v=g+c*v+u*f)*v;c-=b=((d=c*(f=d)-u*g-r)*y+(g=c*g+u*f-s)*v)/_,u-=x=(g*y-d*v)/_}while(n(b)+n(x)>1e-12&&--l>0);if(l){var w=E(c*c+u*u),k=2*a(.5*w),D=m(k);return[i(c*D,w*o(k)),w?S(u*D/w):0]}},r}dt.invert=function(e,t){var r=n(e),a=n(t),i=y,s=b;a<ht?s*=a/ht:i+=6*M(ht/a);for(var l=0;l<25;l++){var c=m(s),u=E(o(s)),f=m(s/2),p=o(s/2),h=m(i/6),d=o(i/6),g=.5*i*(1+u)-r,v=s/(p*d)-a,x=u?-.25*i*c/u:0,_=.5*(1+u),w=(1+.5*s*f/p)/(p*d),k=s/p*(h/6)/(d*d),D=x*k-w*_,T=(g*k-v*_)/D,A=(v*x-g*w)/D;if(s-=T,i-=A,n(T)<y&&n(A)<y)break}return[e<0?-i:i,t<0?-s:s]},mt.invert=function(e,t){var r=d(e)*v,a=t/2,i=50;do{var o=r*r,s=a*a,l=r*a,c=r*(.975534+s*(-.0143059*o-.119161+-.0547009*s))-e,u=a*(1.00384+o*(.0802894+-.02855*s+199025e-9*o)+s*(.0998909+-.0491032*s))-t,f=.975534-s*(.119161+3*o*.0143059+.0547009*s),p=-l*(.238322+.2188036*s+.0286118*o),h=l*(.1605788+7961e-7*o+-.0571*s),m=1.00384+o*(.0802894+199025e-9*o)+s*(3*(.0998909-.02855*o)-.245516*s),g=p*h-m*f,b=(u*p-c*m)/g,x=(c*h-u*f)/g;r-=b,a-=x}while((n(b)>y||n(x)>y)&&--i>0);return i&&[r,a]},gt.invert=function(e,t){var r=e*e,n=t*t+1,a=r+n,i=e?_*E((a-E(a*a-4*r))/r):1/E(n);return[S(e*i),d(t)*M(i)]},vt.invert=function(e,t){return[e,2.5*a(s(.8*t))-.625*v]};var xt=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],_t=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],wt=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],kt=[[.9245,0],[0,0],[.01943,0]],Dt=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Tt(e,r){var n=t.geoProjection(bt(e)).rotate(r).clipAngle(90),a=t.geoRotation(r),i=n.center;return delete n.rotate,n.center=function(e){return arguments.length?i(a(e)):a.invert(i())},n}var At=E(6),St=E(7);function Mt(e,t){var r=S(7*m(t)/(3*At));return[At*e*(2*o(2*r/3)-1)/St,9*m(r/3)/St]}function Et(e,t){for(var r,a=(1+_)*m(t),i=t,s=0;s<25&&(i-=r=(m(i/2)+m(i)-a)/(.5*o(i/2)+o(i)),!(n(r)<y));s++);return[e*(1+2*o(i)/o(i/2))/(3*w),2*E(3)*m(i/2)/E(2+w)]}function Ct(e,t){for(var r,a=E(6/(4+v)),i=(1+v/4)*m(t),s=t/2,l=0;l<25&&(s-=r=(s/2+m(s)-i)/(.5+o(s)),!(n(r)<y));l++);return[a*(.5+o(s))*e/1.5,a*s]}function Nt(e,t){var r=t*t,n=r*r,a=r*n;return[e*(.84719-.13063*r+a*a*(.05494*r-.04515-.02326*n+.00331*a)),t*(1.01183+n*n*(.01926*r-.02625-.00396*n))]}function Ot(e,t){return[e*(1+o(t))/2,2*(t-g(t/2))]}Mt.invert=function(e,t){var r=3*S(t*St/9);return[e*St/(At*(2*o(2*r/3)-1)),S(3*m(r)*At/7)]},Et.invert=function(e,t){var r=t*E(2+w)/(2*E(3)),n=2*S(r);return[3*w*e/(1+2*o(n)/o(n/2)),S((r+m(n))/(1+_))]},Ct.invert=function(e,t){var r=E(6/(4+v)),a=t/r;return n(n(a)-b)<y&&(a=a<0?-b:b),[1.5*e/(r*(.5+o(a))),S((a/2+m(a))/(1+v/4))]},Nt.invert=function(e,t){var r,a,i,o,s=t,l=25;do{s-=r=(s*(1.01183+(i=(a=s*s)*a)*i*(.01926*a-.02625-.00396*i))-t)/(1.01183+i*i*(.21186*a-.23625+-.05148*i))}while(n(r)>1e-12&&--l>0);return[e/(.84719-.13063*(a=s*s)+(o=a*(i=a*a))*o*(.05494*a-.04515-.02326*i+.00331*o)),s]},Ot.invert=function(e,t){for(var r=t/2,a=0,i=1/0;a<10&&n(i)>y;++a){var s=o(t/2);t-=i=(t-g(t/2)-r)/(1-.5/(s*s))}return[2*e/(1+o(t)),t]};var It=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Pt(e,t){var r=m(t),a=o(t),i=d(e);if(0===e||n(t)===b)return[0,t];if(0===t)return[e,0];if(n(e)===b)return[e*a,b*r];var s=v/(2*e)-2*e/v,l=2*t/v,c=(1-l*l)/(r-l),u=s*s,f=c*c,p=1+u/f,h=1+f/u,g=(s*r/c-s/2)/p,y=(f*r/u+c/2)/h,x=y*y-(f*r*r/u+c*r-1)/h;return[b*(g+E(g*g+a*a/p)*i),b*(y+E(x<0?0:x)*d(-t*s)*i)]}function Rt(e,t){var r=t*t;return[e,t*(1.0148+r*r*(.23185+r*(.02406*r-.14499)))]}function Lt(e,t){if(n(t)<y)return[e,0];var r=g(t),a=e*m(t);return[m(a)/r,t+(1-o(a))/r]}function Ft(e,t){var r=zt(e[1],e[0]),n=zt(t[1],t[0]),a=function(e,t){return i(e[0]*t[1]-e[1]*t[0],e[0]*t[0]+e[1]*t[1])}(r,n),s=jt(r)/jt(n);return Bt([1,0,e[0][0],0,1,e[0][1]],Bt([s,0,0,0,s,0],Bt([o(a),m(a),0,-m(a),o(a),0],[1,0,-t[0][0],0,1,-t[0][1]])))}function Bt(e,t){return[e[0]*t[0]+e[1]*t[3],e[0]*t[1]+e[1]*t[4],e[0]*t[2]+e[1]*t[5]+e[2],e[3]*t[0]+e[4]*t[3],e[3]*t[1]+e[4]*t[4],e[3]*t[2]+e[4]*t[5]+e[5]]}function zt(e,t){return[e[0]-t[0],e[1]-t[1]]}function jt(e){return E(e[0]*e[0]+e[1]*e[1])}function Ut(e,r,a){function i(e,t){var n,a=r(e,t),i=a.project([e*T,t*T]);return(n=a.transform)?[n[0]*i[0]+n[1]*i[1]+n[2],-(n[3]*i[0]+n[4]*i[1]+n[5])]:(i[1]=-i[1],i)}!function e(t,r){if(t.edges=function(e){for(var t=e.length,r=[],n=e[t-1],a=0;a<t;++a)r.push([n,n=e[a]]);return r}(t.face),r.face){var n=t.shared=function(e,t){for(var r,n,a=e.length,i=null,o=0;o<a;++o){r=e[o];for(var s=t.length;--s>=0;)if(n=t[s],r[0]===n[0]&&r[1]===n[1]){if(i)return[i,r];i=r}}}(t.face,r.face),a=Ft(n.map(r.project),n.map(t.project));t.transform=r.transform?Bt(r.transform,a):a;for(var i=r.edges,o=0,s=i.length;o<s;++o)$t(n[0],i[o][1])&&$t(n[1],i[o][0])&&(i[o]=t),$t(n[0],i[o][0])&&$t(n[1],i[o][1])&&(i[o]=t);for(o=0,s=(i=t.edges).length;o<s;++o)$t(n[0],i[o][0])&&$t(n[1],i[o][1])&&(i[o]=r),$t(n[0],i[o][1])&&$t(n[1],i[o][0])&&(i[o]=r)}else t.transform=r.transform;return t.children&&t.children.forEach((function(r){e(r,t)})),t}(e,{transform:null}),Vt(e)&&(i.invert=function(t,n){var a=function e(t,n){var a=t.project.invert,i=t.transform,o=n;if(i&&(i=function(e){var t=1/(e[0]*e[4]-e[1]*e[3]);return[t*e[4],-t*e[1],t*(e[1]*e[5]-e[2]*e[4]),-t*e[3],t*e[0],t*(e[2]*e[3]-e[0]*e[5])]}(i),o=[i[0]*o[0]+i[1]*o[1]+i[2],i[3]*o[0]+i[4]*o[1]+i[5]]),a&&t===function(e){return r(e[0]*A,e[1]*A)}(s=a(o)))return s;for(var s,l=t.children,c=0,u=l&&l.length;c<u;++c)if(s=e(l[c],n))return s}(e,[t,-n]);return a&&(a[0]*=A,a[1]*=A,a)});var o=t.geoProjection(i),s=o.stream;return o.stream=function(r){var a=o.rotate(),i=s(r),l=(o.rotate([0,0]),s(r));return o.rotate(a),i.sphere=function(){l.polygonStart(),l.lineStart(),function e(r,a,i){var o,s,l=a.edges,c=l.length,u={type:"MultiPoint",coordinates:a.face},f=a.face.filter((function(e){return 90!==n(e[1])})),p=t.geoBounds({type:"MultiPoint",coordinates:f}),h=!1,d=-1,m=p[1][0]-p[0][0],g=180===m||360===m?[(p[0][0]+p[1][0])/2,(p[0][1]+p[1][1])/2]:t.geoCentroid(u);if(i)for(;++d<c&&l[d]!==i;);++d;for(var v=0;v<c;++v)s=l[(v+d)%c],Array.isArray(s)?(h||(r.point((o=t.geoInterpolate(s[0],g)(y))[0],o[1]),h=!0),r.point((o=t.geoInterpolate(s[1],g)(y))[0],o[1])):(h=!1,s!==i&&e(r,s,a))}(l,e),l.lineEnd(),l.polygonEnd()},i},o.angle(null==a?-30:a*T)}function $t(e,t){return e&&t&&e[0]===t[0]&&e[1]===t[1]}function Vt(e){return e.project.invert||e.children&&e.children.some(Vt)}Pt.invert=function(e,t){var r=(e/=b)*e,n=r+(t/=b)*t,a=v*v;return[e?(n-1+E((1-n)*(1-n)+4*r))/(2*e)*b:0,$((function(e){return n*(v*m(e)-2*e)*v+4*e*e*(t-m(e))+2*v*e-a*t}),0)]},Rt.invert=function(e,t){t>1.790857183?t=1.790857183:t<-1.790857183&&(t=-1.790857183);var r,a=t;do{var i=a*a;a-=r=(a*(1.0148+i*i*(.23185+i*(.02406*i-.14499)))-t)/(1.0148+i*i*(5*.23185+i*(.21654*i-1.01493)))}while(n(r)>y);return[e,a]},Lt.invert=function(e,t){if(n(t)<y)return[e,0];var r,a=e*e+t*t,i=.5*t,s=10;do{var l=g(i),c=1/o(i),u=a-2*t*i+i*i;i-=r=(l*u+2*(i-t))/(2+u*c*c+2*(i-t)*l)}while(n(r)>y&&--s>0);return l=g(i),[(n(t)<n(i+1/l)?S(e*l):d(t)*d(e)*(M(n(e*l))+b))/m(i),i]};var qt=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],Wt=[[0,2,1],[0,3,2],[5,1,2],[5,2,3],[0,1,4],[0,4,3],[5,4,1],[5,3,4]].map((function(e){return e.map((function(e){return qt[e]}))})),Ht=2/E(3);function Gt(e,t){var r=le(e,t);return[r[0]*Ht,r[1]]}function Xt(e,t){for(var r=0,n=e.length,a=0;r<n;++r)a+=e[r]*t[r];return a}function Yt(e){return[i(e[1],e[0])*T,S(u(-1,f(1,e[2])))*T]}function Zt(e){var t=e[0]*A,r=e[1]*A,n=o(r);return[n*o(t),n*m(t),m(r)]}function Kt(){}function Jt(e,t){return{type:"FeatureCollection",features:e.features.map((function(e){return Qt(e,t)}))}}function Qt(e,t){return{type:"Feature",id:e.id,properties:e.properties,geometry:er(e.geometry,t)}}function er(e,r){if(!e)return null;if("GeometryCollection"===e.type)return function(e,t){return{type:"GeometryCollection",geometries:e.geometries.map((function(e){return er(e,t)}))}}(e,r);var n;switch(e.type){case"Point":case"MultiPoint":n=nr;break;case"LineString":case"MultiLineString":n=ar;break;case"Polygon":case"MultiPolygon":case"Sphere":n=ir;break;default:return null}return t.geoStream(e,r(n)),n.result()}Gt.invert=function(e,t){return le.invert(e/Ht,t)};var tr=[],rr=[],nr={point:function(e,t){tr.push([e,t])},result:function(){var e=tr.length?tr.length<2?{type:"Point",coordinates:tr[0]}:{type:"MultiPoint",coordinates:tr}:null;return tr=[],e}},ar={lineStart:Kt,point:function(e,t){tr.push([e,t])},lineEnd:function(){tr.length&&(rr.push(tr),tr=[])},result:function(){var e=rr.length?rr.length<2?{type:"LineString",coordinates:rr[0]}:{type:"MultiLineString",coordinates:rr}:null;return rr=[],e}},ir={polygonStart:Kt,lineStart:Kt,point:function(e,t){tr.push([e,t])},lineEnd:function(){var e=tr.length;if(e){do{tr.push(tr[0].slice())}while(++e<4);rr.push(tr),tr=[]}},polygonEnd:Kt,result:function(){if(!rr.length)return null;var e=[],t=[];return rr.forEach((function(r){!function(e){if((t=e.length)<4)return!1;for(var t,r=0,n=e[t-1][1]*e[0][0]-e[t-1][0]*e[0][1];++r<t;)n+=e[r-1][1]*e[r][0]-e[r-1][0]*e[r][1];return n<=0}(r)?t.push(r):e.push([r])})),t.forEach((function(t){var r=t[0];e.some((function(e){if(function(e,t){for(var r=t[0],n=t[1],a=!1,i=0,o=e.length,s=o-1;i<o;s=i++){var l=e[i],c=l[0],u=l[1],f=e[s],p=f[0],h=f[1];u>n^h>n&&r<(p-c)*(n-u)/(h-u)+c&&(a=!a)}return a}(e[0],r))return e.push(t),!0}))||e.push([t])})),rr=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}};function or(e){var r=e(b,0)[0]-e(-b,0)[0];function a(t,a){var i=n(t)<b,o=e(i?t:t>0?t-v:t+v,a),s=(o[0]-o[1])*_,l=(o[0]+o[1])*_;if(i)return[s,l];var c=r*_,u=s>0^l>0?-1:1;return[u*s-d(l)*c,u*l-d(s)*c]}return e.invert&&(a.invert=function(t,a){var i=(t+a)*_,o=(a-t)*_,s=n(i)<.5*r&&n(o)<.5*r;if(!s){var l=r*_,c=i>0^o>0?-1:1,u=-c*t+(o>0?1:-1)*l,f=-c*a+(i>0?1:-1)*l;i=(-u-f)*_,o=(u-f)*_}var p=e.invert(i,o);return s||(p[0]+=i>0?v:-v),p}),t.geoProjection(a).rotate([-90,-90,45]).clipAngle(179.999)}function sr(){return or(Ue).scale(111.48)}function lr(e){var t=m(e);function r(r,n){var i=t?g(r*t/2)/t:r/2;if(!n)return[2*i,-e];var s=2*a(i*m(n)),l=1/g(n);return[m(s)*l,n+(1-o(s))*l-e]}return r.invert=function(r,i){if(n(i+=e)<y)return[t?2*a(t*r/2)/t:r,0];var s,l=r*r+i*i,c=0,u=10;do{var f=g(c),p=1/o(c),h=l-2*i*c+c*c;c-=s=(f*h+2*(c-i))/(2+h*p*p+2*(c-i)*f)}while(n(s)>y&&--u>0);var d=r*(f=g(c)),b=g(n(i)<n(c+1/f)?.5*S(d):.5*M(d)+v/4)/m(c);return[t?2*a(t*b)/t:2*b,c]},r}var cr=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function ur(e,t){var r,a=f(18,36*n(t)/v),i=l(a),o=a-i,s=(r=cr[i])[0],c=r[1],u=(r=cr[++i])[0],p=r[1],h=(r=cr[f(19,++i)])[0],d=r[1];return[e*(u+o*(h-s)/2+o*o*(h-2*u+s)/2),(t>0?b:-b)*(p+o*(d-c)/2+o*o*(d-2*p+c)/2)]}function fr(e,t){var r=function(e){function t(t,r){var n=o(r),a=(e-1)/(e-n*o(t));return[a*n*m(t),a*m(r)]}return t.invert=function(t,r){var n=t*t+r*r,a=E(n),o=(e-E(1-n*(e+1)/(e-1)))/((e-1)/a+a/(e-1));return[i(t*o,a*E(1-o*o)),a?S(r*o/a):0]},t}(e);if(!t)return r;var n=o(t),a=m(t);function s(t,i){var o=r(t,i),s=o[1],l=s*a/(e-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(t,i){var o=(e-1)/(e-1-i*a);return r.invert(o*t,o*i*n)},s}cr.forEach((function(e){e[1]*=1.0144})),ur.invert=function(e,t){var r=t/b,a=90*r,i=f(18,n(a/5)),o=u(0,l(i));do{var s=cr[o][1],c=cr[o+1][1],p=cr[f(19,o+2)][1],h=p-s,d=p-2*c+s,m=2*(n(r)-c)/h,g=d/h,y=m*(1-g*m*(1-2*g*m));if(y>=0||1===o){a=(t>=0?5:-5)*(y+i);var v,x=50;do{y=(i=f(18,n(a)/5))-(o=l(i)),s=cr[o][1],c=cr[o+1][1],p=cr[f(19,o+2)][1],a-=(v=(t>=0?b:-b)*(c+y*(p-s)/2+y*y*(p-2*c+s)/2)-t)*T}while(n(v)>1e-12&&--x>0);break}}while(--o>=0);var _=cr[o][0],w=cr[o+1][0],k=cr[f(19,o+2)][0];return[e/(w+y*(k-_)/2+y*y*(k-2*w+_)/2),a*A]};var pr=-179.9999,hr=179.9999,dr=-89.9999;function mr(e){return e.length>0}function gr(e){return-90===e||90===e?[0,e]:[-180,(t=e,Math.floor(1e4*t)/1e4)];var t}function yr(e){var t=e[0],r=e[1],n=!1;return t<=pr?(t=-180,n=!0):t>=hr&&(t=180,n=!0),r<=dr?(r=-90,n=!0):r>=89.9999&&(r=90,n=!0),n?[t,r]:e}function vr(e){return e.map(yr)}function br(e,t,r){for(var n=0,a=e.length;n<a;++n){var i=e[n].slice();r.push({index:-1,polygon:t,ring:i});for(var o=0,s=i.length;o<s;++o){var l=i[o],c=l[0],u=l[1];if(c<=pr||c>=hr||u<=dr||u>=89.9999){i[o]=yr(l);for(var f=o+1;f<s;++f){var p=i[f],h=p[0],d=p[1];if(h>pr&&h<hr&&d>dr&&d<89.9999)break}if(f===o+1)continue;if(o){var m={index:-1,polygon:t,ring:i.slice(0,o+1)};m.ring[m.ring.length-1]=gr(u),r[r.length-1]=m}else r.pop();if(f>=s)break;r.push({index:-1,polygon:t,ring:i=i.slice(f-1)}),i[0]=gr(i[0][1]),o=-1,s=i.length}}}}function xr(e){var t,r,n,a,i,o,s=e.length,l={},c={};for(t=0;t<s;++t)n=(r=e[t]).ring[0],i=r.ring[r.ring.length-1],n[0]!==i[0]||n[1]!==i[1]?(r.index=t,l[n]=c[i]=r):(r.polygon.push(r.ring),e[t]=null);for(t=0;t<s;++t)if(r=e[t]){if(n=r.ring[0],i=r.ring[r.ring.length-1],a=c[n],o=l[i],delete l[n],delete c[i],n[0]===i[0]&&n[1]===i[1]){r.polygon.push(r.ring);continue}a?(delete c[n],delete l[a.ring[0]],a.ring.pop(),e[a.index]=null,r={index:-1,polygon:a.polygon,ring:a.ring.concat(r.ring)},a===o?r.polygon.push(r.ring):(r.index=s++,e.push(l[r.ring[0]]=c[r.ring[r.ring.length-1]]=r))):o?(delete l[i],delete c[o.ring[o.ring.length-1]],r.ring.pop(),r={index:s++,polygon:o.polygon,ring:r.ring.concat(o.ring)},e[o.index]=null,e.push(l[r.ring[0]]=c[r.ring[r.ring.length-1]]=r)):(r.ring.push(r.ring[0]),r.polygon.push(r.ring))}}function _r(e){var t={type:"Feature",geometry:wr(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}function wr(e){if(null==e)return e;var t,r,n,a;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(wr)};break;case"Point":t={type:"Point",coordinates:yr(e.coordinates)};break;case"MultiPoint":case"LineString":t={type:e.type,coordinates:vr(e.coordinates)};break;case"MultiLineString":t={type:"MultiLineString",coordinates:e.coordinates.map(vr)};break;case"Polygon":var i=[];br(e.coordinates,i,r=[]),xr(r),t={type:"Polygon",coordinates:i};break;case"MultiPolygon":r=[],n=-1,a=e.coordinates.length;for(var o=new Array(a);++n<a;)br(e.coordinates[n],o[n]=[],r);xr(r),t={type:"MultiPolygon",coordinates:o.filter(mr)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function kr(e,t){var r=g(t/2),n=m(x*r);return[e*(.74482-.34588*n*n),1.70711*r]}function Dr(e,r,n){var a=t.geoInterpolate(r,n),i=a(.5),o=t.geoRotation([-i[0],-i[1]])(r),s=a.distance/2,l=-S(m(o[1]*A)/m(s)),c=[-i[0],-i[1],-(o[0]>0?v-l:l)*T],u=t.geoProjection(e(s)).rotate(c),f=t.geoRotation(c),p=u.center;return delete u.rotate,u.center=function(e){return arguments.length?p(f(e)):f.invert(p())},u.clipAngle(90)}function Tr(e){var r=o(e);function n(e,n){var a=t.geoGnomonicRaw(e,n);return a[0]*=r,a}return n.invert=function(e,n){return t.geoGnomonicRaw.invert(e/r,n)},n}function Ar(e,t){return Dr(Tr,e,t)}function Sr(e){if(!(e*=2))return t.geoAzimuthalEquidistantRaw;var r=-e/2,n=-r,a=e*e,s=g(n),l=.5/m(n);function c(t,i){var s=M(o(i)*o(t-r)),l=M(o(i)*o(t-n));return[((s*=s)-(l*=l))/(2*e),(i<0?-1:1)*E(4*a*l-(a-s+l)*(a-s+l))/(2*e)]}return c.invert=function(e,t){var a,c,u=t*t,f=o(E(u+(a=e+r)*a)),p=o(E(u+(a=e+n)*a));return[i(c=f-p,a=(f+p)*s),(t<0?-1:1)*M(E(a*a+c*c)*l)]},c}function Mr(e,t){return Dr(Sr,e,t)}function Er(e,t){if(n(t)<y)return[e,0];var r=n(t/b),a=S(r);if(n(e)<y||n(n(t)-b)<y)return[0,d(t)*v*g(a/2)];var i=o(a),s=n(v/e-e/v)/2,l=s*s,c=i/(r+i-1),u=c*(2/r-1),f=u*u,p=f+l,h=c-f,m=l+c;return[d(e)*v*(s*h+E(l*h*h-p*(c*c-f)))/p,d(t)*v*(u*m-s*E((l+1)*p-m*m))/p]}function Cr(e,t){if(n(t)<y)return[e,0];var r=n(t/b),a=S(r);if(n(e)<y||n(n(t)-b)<y)return[0,d(t)*v*g(a/2)];var i=o(a),s=n(v/e-e/v)/2,l=s*s,c=i*(E(1+l)-s*i)/(1+l*r*r);return[d(e)*v*c,d(t)*v*E(1-c*(2*s+c))]}function Nr(e,t){if(n(t)<y)return[e,0];var r=t/b,a=S(r);if(n(e)<y||n(n(t)-b)<y)return[0,v*g(a/2)];var i=(v/e-e/v)/2,s=r/(1+o(a));return[v*(d(e)*E(i*i+1-s*s)-i),v*s]}function Or(e,t){if(!t)return[e,0];var r=n(t);if(!e||r===b)return[0,t];var a=r/b,i=a*a,o=(8*a-i*(i+2)-5)/(2*i*(a-1)),s=o*o,l=a*o,c=i+s+2*l,u=a+3*o,f=e/b,p=f+1/f,h=d(n(e)-b)*E(p*p-4),m=h*h,g=(h*(c+s-1)+2*E(c*(i+s*m-1)+(1-i)*(i*(u*u+4*s)+12*l*s+4*s*s)))/(4*c+m);return[d(e)*b*g,d(t)*b*E(1+h*n(g)-g*g)]}function Ir(e,t,r,n){var a=v/3;e=u(e,y),t=u(t,y),e=f(e,b),t=f(t,v-y),r=u(r,0),r=f(r,100-y);var s=(n=u(n,y))/100,l=M((r/100+1)*o(a))/a,c=m(e)/m(l*b),p=t/v,h=E(s*m(e/2)/m(t/2));return function(e,t,r,n,a){function s(i,s){var l=r*m(n*s),c=E(1-l*l),u=E(2/(1+c*o(i*=a)));return[e*c*u*m(i),t*l*u]}return s.invert=function(o,s){var l=o/e,c=s/t,u=E(l*l+c*c),f=2*S(u/2);return[i(o*g(f),e*u)/a,u&&S(s*m(f)/(t*r*u))/n]},s}(h/E(p*c*l),1/(h*E(p*c*l)),c,l,p)}function Pr(){var e=65*A,r=60*A,n=20,a=200,i=t.geoProjectionMutator(Ir),o=i(e,r,n,a);return o.poleline=function(t){return arguments.length?i(e=+t*A,r,n,a):e*T},o.parallels=function(t){return arguments.length?i(e,r=+t*A,n,a):r*T},o.inflation=function(t){return arguments.length?i(e,r,n=+t,a):n},o.ratio=function(t){return arguments.length?i(e,r,n,a=+t):a},o.scale(163.775)}kr.invert=function(e,t){var r=t/1.70711,n=m(x*r);return[e/(.74482-.34588*n*n),2*a(r)]},Er.invert=function(e,t){if(n(t)<y)return[e,0];if(n(e)<y)return[0,b*m(2*a(t/v))];var r=(e/=v)*e,i=(t/=v)*t,s=r+i,l=s*s,c=-n(t)*(1+s),u=c-2*i+r,f=-2*c+1+2*i+l,p=i/f+(2*u*u*u/(f*f*f)-9*c*u/(f*f))/27,h=(c-u*u/(3*f))/f,g=2*E(-h/3),x=M(3*p/(h*g))/3;return[v*(s-1+E(1+2*(r-i)+l))/(2*e),d(t)*v*(-g*o(x+v/3)-u/(3*f))]},Cr.invert=function(e,t){if(!e)return[0,b*m(2*a(t/v))];var r=n(e/v),o=(1-r*r-(t/=v)*t)/(2*r),s=E(o*o+1);return[d(e)*v*(s-o),d(t)*b*m(2*i(E((1-2*o*r)*(o+s)-r),E(s+o+r)))]},Nr.invert=function(e,t){if(!t)return[e,0];var r=t/v,n=(v*v*(1-r*r)-e*e)/(2*v*e);return[e?v*(d(e)*E(n*n+1)-n):0,b*m(2*a(r))]},Or.invert=function(e,t){var r;if(!e||!t)return[e,t];t/=v;var a=d(e)*e/b,i=(a*a-1+4*t*t)/n(a),o=i*i,s=2*t,l=50;do{var c=s*s,u=(8*s-c*(c+2)-5)/(2*c*(s-1)),f=(3*s-c*s-10)/(2*c*s),p=u*u,h=s*u,m=s+u,g=m*m,x=s+3*u,_=-2*m*(4*h*p+(1-4*c+3*c*c)*(1+f)+p*(14*c-6-o+(8*c-8-2*o)*f)+h*(12*c-8+(10*c-10-o)*f)),w=E(g*(c+p*o-1)+(1-c)*(c*(x*x+4*p)+p*(12*h+4*p)));s-=r=(i*(g+p-1)+2*w-a*(4*g+o))/(i*(2*u*f+2*m*(1+f))+_/w-8*m*(i*(-1+p+g)+2*w)*(1+f)/(o+4*g))}while(r>y&&--l>0);return[d(e)*(E(i*i+4)+i)*v/4,b*s]};var Rr=4*v+3*E(3),Lr=2*E(2*v*E(3)/Rr),Fr=H(Lr*E(3)/v,Lr,Rr/6);function Br(e,t){return[e*E(1-3*t*t/(v*v)),t]}function zr(e,t){var r=o(t),n=o(e)*r,a=1-n,s=o(e=i(m(e)*r,-m(t))),l=m(e);return[l*(r=E(1-n*n))-s*a,-s*r-l*a]}function jr(e,t){var r=I(e,t);return[(r[0]+e/b)/2,(r[1]+t)/2]}Br.invert=function(e,t){return[e/E(1-3*t*t/(v*v)),t]},zr.invert=function(e,t){var r=(e*e+t*t)/-2,n=E(-r*(2+r)),a=t*r+e*n,o=e*r-t*n,s=E(o*o+a*a);return[i(n*a,s*(1+r)),s?-S(n*o/s):0]},jr.invert=function(e,t){var r=e,a=t,i=25;do{var s,l=o(a),c=m(a),u=m(2*a),f=c*c,p=l*l,h=m(r),d=o(r/2),g=m(r/2),v=g*g,x=1-p*d*d,_=x?M(l*d)*E(s=1/x):s=0,w=.5*(2*_*l*g+r/b)-e,k=.5*(_*c+a)-t,D=.5*s*(p*v+_*l*d*f)+.5/b,T=s*(h*u/4-_*c*g),A=.125*s*(u*g-_*c*p*h),S=.5*s*(f*d+_*v*l)+.5,C=T*A-S*D,N=(k*T-w*S)/C,O=(w*A-k*D)/C;r-=N,a-=O}while((n(N)>y||n(O)>y)&&--i>0);return[r,a]},e.geoNaturalEarth=t.geoNaturalEarth1,e.geoNaturalEarthRaw=t.geoNaturalEarth1Raw,e.geoAiry=function(){var e=b,r=t.geoProjectionMutator(O),n=r(e);return n.radius=function(t){return arguments.length?r(e=t*A):e*T},n.scale(179.976).clipAngle(147)},e.geoAiryRaw=O,e.geoAitoff=function(){return t.geoProjection(I).scale(152.63)},e.geoAitoffRaw=I,e.geoArmadillo=function(){var e=20*A,r=e>=0?1:-1,n=g(r*e),a=t.geoProjectionMutator(P),s=a(e),l=s.stream;return s.parallel=function(t){return arguments.length?(n=g((r=(e=t*A)>=0?1:-1)*e),a(e)):e*T},s.stream=function(t){var a=s.rotate(),c=l(t),u=(s.rotate([0,0]),l(t)),f=s.precision();return s.rotate(a),c.sphere=function(){u.polygonStart(),u.lineStart();for(var t=-180*r;r*t<180;t+=90*r)u.point(t,90*r);if(e)for(;r*(t-=3*r*f)>=-180;)u.point(t,r*-i(o(t*A/2),n)*T);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},e.geoArmadilloRaw=P,e.geoAugust=function(){return t.geoProjection(R).scale(66.1603)},e.geoAugustRaw=R,e.geoBaker=function(){return t.geoProjection(B).scale(112.314)},e.geoBakerRaw=B,e.geoBerghaus=function(){var e=5,r=t.geoProjectionMutator(z),n=r(e),a=n.stream,s=-o(.01*A),l=m(.01*A);return n.lobes=function(t){return arguments.length?r(e=+t):e},n.stream=function(t){var r=n.rotate(),c=a(t),u=(n.rotate([0,0]),a(t));return n.rotate(r),c.sphere=function(){u.polygonStart(),u.lineStart();for(var t=0,r=360/e,n=2*v/e,a=90-180/e,c=b;t<e;++t,a-=r,c-=n)u.point(i(l*o(c),s)*T,S(l*m(c))*T),a<-90?(u.point(-90,-180-a-.01),u.point(-90,-180-a+.01)):(u.point(90,a+.01),u.point(90,a-.01));u.lineEnd(),u.polygonEnd()},c},n.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},e.geoBerghausRaw=z,e.geoBertin1953=function(){return t.geoProjection(q()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])},e.geoBertin1953Raw=q,e.geoBoggs=function(){return t.geoProjection(Z).scale(160.857)},e.geoBoggsRaw=Z,e.geoBonne=function(){return K(Q).scale(123.082).center([0,26.1441]).parallel(45)},e.geoBonneRaw=Q,e.geoBottomley=function(){var e=.5,r=t.geoProjectionMutator(ee),n=r(e);return n.fraction=function(t){return arguments.length?r(e=+t):e},n.scale(158.837)},e.geoBottomleyRaw=ee,e.geoBromley=function(){return t.geoProjection(te).scale(152.63)},e.geoBromleyRaw=te,e.geoChamberlin=se,e.geoChamberlinRaw=ie,e.geoChamberlinAfrica=function(){return se([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])},e.geoCollignon=function(){return t.geoProjection(le).scale(95.6464).center([0,30])},e.geoCollignonRaw=le,e.geoCraig=function(){return K(ce).scale(249.828).clipAngle(90)},e.geoCraigRaw=ce,e.geoCraster=function(){return t.geoProjection(fe).scale(156.19)},e.geoCrasterRaw=fe,e.geoCylindricalEqualArea=function(){return K(pe).parallel(38.58).scale(195.044)},e.geoCylindricalEqualAreaRaw=pe,e.geoCylindricalStereographic=function(){return K(he).scale(124.75)},e.geoCylindricalStereographicRaw=he,e.geoEckert1=function(){return t.geoProjection(de).scale(165.664)},e.geoEckert1Raw=de,e.geoEckert2=function(){return t.geoProjection(me).scale(165.664)},e.geoEckert2Raw=me,e.geoEckert3=function(){return t.geoProjection(ge).scale(180.739)},e.geoEckert3Raw=ge,e.geoEckert4=function(){return t.geoProjection(ye).scale(180.739)},e.geoEckert4Raw=ye,e.geoEckert5=function(){return t.geoProjection(ve).scale(173.044)},e.geoEckert5Raw=ve,e.geoEckert6=function(){return t.geoProjection(be).scale(173.044)},e.geoEckert6Raw=be,e.geoEisenlohr=function(){return t.geoProjection(_e).scale(62.5271)},e.geoEisenlohrRaw=_e,e.geoFahey=function(){return t.geoProjection(ke).scale(137.152)},e.geoFaheyRaw=ke,e.geoFoucaut=function(){return t.geoProjection(De).scale(135.264)},e.geoFoucautRaw=De,e.geoFoucautSinusoidal=function(){var e=.5,r=t.geoProjectionMutator(Te),n=r(e);return n.alpha=function(t){return arguments.length?r(e=+t):e},n.scale(168.725)},e.geoFoucautSinusoidalRaw=Te,e.geoGilbert=function(e){null==e&&(e=t.geoOrthographic);var r=e(),n=t.geoEquirectangular().scale(T).precision(0).clipAngle(null).translate([0,0]);function a(e){return r(Ae(e))}function i(e){a[e]=function(){return arguments.length?(r[e].apply(r,arguments),a):r[e]()}}return r.invert&&(a.invert=function(e){return Se(r.invert(e))}),a.stream=function(e){var t=r.stream(e),a=n.stream({point:function(e,r){t.point(e/2,S(g(-r/2*A))*T)},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}});return a.sphere=t.sphere,a},a.rotate=function(e){return arguments.length?(n.rotate(e),a):n.rotate()},a.center=function(e){return arguments.length?(r.center(Ae(e)),a):Se(r.center())},i("angle"),i("clipAngle"),i("clipExtent"),i("fitExtent"),i("fitHeight"),i("fitSize"),i("fitWidth"),i("scale"),i("translate"),i("precision"),a.scale(249.5)},e.geoGingery=function(){var e=6,r=30*A,n=o(r),a=m(r),s=t.geoProjectionMutator(Me),l=s(r,e),c=l.stream,u=-o(.01*A),f=m(.01*A);return l.radius=function(t){return arguments.length?(n=o(r=t*A),a=m(r),s(r,e)):r*T},l.lobes=function(t){return arguments.length?s(r,e=+t):e},l.stream=function(t){var r=l.rotate(),s=c(t),p=(l.rotate([0,0]),c(t));return l.rotate(r),s.sphere=function(){p.polygonStart(),p.lineStart();for(var t=0,r=2*v/e,s=0;t<e;++t,s-=r)p.point(i(f*o(s),u)*T,S(f*m(s))*T),p.point(i(a*o(s-r/2),n)*T,S(a*m(s-r/2))*T);p.lineEnd(),p.polygonEnd()},s},l.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},e.geoGingeryRaw=Me,e.geoGinzburg4=function(){return t.geoProjection(Oe).scale(149.995)},e.geoGinzburg4Raw=Oe,e.geoGinzburg5=function(){return t.geoProjection(Ie).scale(153.93)},e.geoGinzburg5Raw=Ie,e.geoGinzburg6=function(){return t.geoProjection(Pe).scale(130.945)},e.geoGinzburg6Raw=Pe,e.geoGinzburg8=function(){return t.geoProjection(Re).scale(131.747)},e.geoGinzburg8Raw=Re,e.geoGinzburg9=function(){return t.geoProjection(Le).scale(131.087)},e.geoGinzburg9Raw=Le,e.geoGringorten=function(){return t.geoProjection(Fe(Be)).scale(239.75)},e.geoGringortenRaw=Be,e.geoGuyou=function(){return t.geoProjection(Fe(Ue)).scale(151.496)},e.geoGuyouRaw=Ue,e.geoHammer=function(){var e=2,r=t.geoProjectionMutator(j),n=r(e);return n.coefficient=function(t){return arguments.length?r(e=+t):e},n.scale(169.529)},e.geoHammerRaw=j,e.geoHammerRetroazimuthal=function(){var e=0,r=t.geoProjectionMutator($e),n=r(e),a=n.rotate,i=n.stream,o=t.geoCircle();return n.parallel=function(t){if(!arguments.length)return e*T;var a=n.rotate();return r(e=t*A).rotate(a)},n.rotate=function(t){return arguments.length?(a.call(n,[t[0],t[1]-e*T]),o.center([-t[0],-t[1]]),n):((t=a.call(n))[1]+=e*T,t)},n.stream=function(e){return(e=i(e)).sphere=function(){e.polygonStart();var t,r=o.radius(89.99)().coordinates[0],n=r.length-1,a=-1;for(e.lineStart();++a<n;)e.point((t=r[a])[0],t[1]);for(e.lineEnd(),n=(r=o.radius(90.01)().coordinates[0]).length-1,e.lineStart();--a>=0;)e.point((t=r[a])[0],t[1]);e.lineEnd(),e.polygonEnd()},e},n.scale(79.4187).parallel(45).clipAngle(179.999)},e.geoHammerRetroazimuthalRaw=$e,e.geoHealpix=function(){var e=4,n=t.geoProjectionMutator(He),a=n(e),i=a.stream;return a.lobes=function(t){return arguments.length?n(e=+t):e},a.stream=function(n){var o=a.rotate(),s=i(n),l=(a.rotate([0,0]),i(n));return a.rotate(o),s.sphere=function(){var n,a;t.geoStream((n=180/e,a=[].concat(r.range(-180,180+n/2,n).map(Ge),r.range(180,-180-n/2,-n).map(Xe)),{type:"Polygon",coordinates:[180===n?a.map(Ye):a]}),l)},s},a.scale(239.75)},e.geoHealpixRaw=He,e.geoHill=function(){var e=1,r=t.geoProjectionMutator(Ze),n=r(e);return n.ratio=function(t){return arguments.length?r(e=+t):e},n.scale(167.774).center([0,18.67])},e.geoHillRaw=Ze,e.geoHomolosine=function(){return t.geoProjection(Je).scale(152.63)},e.geoHomolosineRaw=Je,e.geoHufnagel=function(){var e=1,r=0,n=45*A,a=2,i=t.geoProjectionMutator(Qe),o=i(e,r,n,a);return o.a=function(t){return arguments.length?i(e=+t,r,n,a):e},o.b=function(t){return arguments.length?i(e,r=+t,n,a):r},o.psiMax=function(t){return arguments.length?i(e,r,n=+t*A,a):n*T},o.ratio=function(t){return arguments.length?i(e,r,n,a=+t):a},o.scale(180.739)},e.geoHufnagelRaw=Qe,e.geoHyperelliptical=function(){var e=0,r=2.5,n=1.183136,a=t.geoProjectionMutator(et),i=a(e,r,n);return i.alpha=function(t){return arguments.length?a(e=+t,r,n):e},i.k=function(t){return arguments.length?a(e,r=+t,n):r},i.gamma=function(t){return arguments.length?a(e,r,n=+t):n},i.scale(152.63)},e.geoHyperellipticalRaw=et,e.geoInterrupt=at,e.geoInterruptedBoggs=function(){return at(Z,it).scale(160.857)},e.geoInterruptedHomolosine=function(){return at(Je,ot).scale(152.63)},e.geoInterruptedMollweide=function(){return at(G,st).scale(169.529)},e.geoInterruptedMollweideHemispheres=function(){return at(G,lt).scale(169.529).rotate([20,0])},e.geoInterruptedSinuMollweide=function(){return at(Ke,ct,V).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoInterruptedSinusoidal=function(){return at(J,ut).scale(152.63).rotate([-20,0])},e.geoKavrayskiy7=function(){return t.geoProjection(ft).scale(158.837)},e.geoKavrayskiy7Raw=ft,e.geoLagrange=function(){var e=.5,r=t.geoProjectionMutator(pt),n=r(e);return n.spacing=function(t){return arguments.length?r(e=+t):e},n.scale(124.75)},e.geoLagrangeRaw=pt,e.geoLarrivee=function(){return t.geoProjection(dt).scale(97.2672)},e.geoLarriveeRaw=dt,e.geoLaskowski=function(){return t.geoProjection(mt).scale(139.98)},e.geoLaskowskiRaw=mt,e.geoLittrow=function(){return t.geoProjection(gt).scale(144.049).clipAngle(89.999)},e.geoLittrowRaw=gt,e.geoLoximuthal=function(){return K(yt).parallel(40).scale(158.837)},e.geoLoximuthalRaw=yt,e.geoMiller=function(){return t.geoProjection(vt).scale(108.318)},e.geoMillerRaw=vt,e.geoModifiedStereographic=Tt,e.geoModifiedStereographicRaw=bt,e.geoModifiedStereographicAlaska=function(){return Tt(xt,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},e.geoModifiedStereographicGs48=function(){return Tt(_t,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},e.geoModifiedStereographicGs50=function(){return Tt(wt,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},e.geoModifiedStereographicMiller=function(){return Tt(kt,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},e.geoModifiedStereographicLee=function(){return Tt(Dt,[165,10]).scale(250).clipAngle(130).center([-165,-10])},e.geoMollweide=function(){return t.geoProjection(G).scale(169.529)},e.geoMollweideRaw=G,e.geoMtFlatPolarParabolic=function(){return t.geoProjection(Mt).scale(164.859)},e.geoMtFlatPolarParabolicRaw=Mt,e.geoMtFlatPolarQuartic=function(){return t.geoProjection(Et).scale(188.209)},e.geoMtFlatPolarQuarticRaw=Et,e.geoMtFlatPolarSinusoidal=function(){return t.geoProjection(Ct).scale(166.518)},e.geoMtFlatPolarSinusoidalRaw=Ct,e.geoNaturalEarth2=function(){return t.geoProjection(Nt).scale(175.295)},e.geoNaturalEarth2Raw=Nt,e.geoNellHammer=function(){return t.geoProjection(Ot).scale(152.63)},e.geoNellHammerRaw=Ot,e.geoInterruptedQuarticAuthalic=function(){return at(j(1/0),It).rotate([20,0]).scale(152.63)},e.geoNicolosi=function(){return t.geoProjection(Pt).scale(127.267)},e.geoNicolosiRaw=Pt,e.geoPatterson=function(){return t.geoProjection(Rt).scale(139.319)},e.geoPattersonRaw=Rt,e.geoPolyconic=function(){return t.geoProjection(Lt).scale(103.74)},e.geoPolyconicRaw=Lt,e.geoPolyhedral=Ut,e.geoPolyhedralButterfly=function(e){e=e||function(e){var r=t.geoCentroid({type:"MultiPoint",coordinates:e});return t.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=Wt.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Ut(r[0],(function(e,t){return r[e<-v/2?t<0?6:4:e<0?t<0?2:0:e<v/2?t<0?3:1:t<0?7:5]})).angle(-30).scale(101.858).center([0,45])},e.geoPolyhedralCollignon=function(e){e=e||function(e){var r=t.geoCentroid({type:"MultiPoint",coordinates:e});return t.geoProjection(Gt).translate([0,0]).scale(1).rotate(r[1]>0?[-r[0],0]:[180-r[0],180])};var r=Wt.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Ut(r[0],(function(e,t){return r[e<-v/2?t<0?6:4:e<0?t<0?2:0:e<v/2?t<0?3:1:t<0?7:5]})).angle(-30).scale(121.906).center([0,48.5904])},e.geoPolyhedralWaterman=function(e){e=e||function(e){var r=6===e.length?t.geoCentroid({type:"MultiPoint",coordinates:e}):e[0];return t.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=Wt.map((function(e){for(var t,r=e.map(Zt),n=r.length,a=r[n-1],i=[],o=0;o<n;++o)t=r[o],i.push(Yt([.9486832980505138*a[0]+.31622776601683794*t[0],.9486832980505138*a[1]+.31622776601683794*t[1],.9486832980505138*a[2]+.31622776601683794*t[2]]),Yt([.9486832980505138*t[0]+.31622776601683794*a[0],.9486832980505138*t[1]+.31622776601683794*a[1],.9486832980505138*t[2]+.31622776601683794*a[2]])),a=t;return i})),n=[],a=[-1,0,0,1,0,1,4,5];r.forEach((function(e,t){for(var i,o,s=Wt[t],l=s.length,c=n[t]=[],u=0;u<l;++u)r.push([s[u],e[(2*u+2)%(2*l)],e[(2*u+1)%(2*l)]]),a.push(t),c.push((i=Zt(e[(2*u+2)%(2*l)]),o=Zt(e[(2*u+1)%(2*l)]),[i[1]*o[2]-i[2]*o[1],i[2]*o[0]-i[0]*o[2],i[0]*o[1]-i[1]*o[0]]))}));var i=r.map((function(t){return{project:e(t),face:t}}));return a.forEach((function(e,t){var r=i[e];r&&(r.children||(r.children=[])).push(i[t])})),Ut(i[0],(function(e,t){var r=o(t),a=[r*o(e),r*m(e),m(t)],s=e<-v/2?t<0?6:4:e<0?t<0?2:0:e<v/2?t<0?3:1:t<0?7:5,l=n[s];return i[Xt(l[0],a)<0?8+3*s:Xt(l[1],a)<0?8+3*s+1:Xt(l[2],a)<0?8+3*s+2:s]})).angle(-30).scale(110.625).center([0,45])},e.geoProject=function(e,t){var r,n=t.stream;if(!n)throw new Error("invalid projection");switch(e&&e.type){case"Feature":r=Qt;break;case"FeatureCollection":r=Jt;break;default:r=er}return r(e,n)},e.geoGringortenQuincuncial=function(){return or(Be).scale(176.423)},e.geoPeirceQuincuncial=sr,e.geoPierceQuincuncial=sr,e.geoQuantize=function(e,t){if(!(0<=(t=+t)&&t<=20))throw new Error("invalid digits");function r(e){var r=e.length,n=2,a=new Array(r);for(a[0]=+e[0].toFixed(t),a[1]=+e[1].toFixed(t);n<r;)a[n]=e[n],++n;return a}function n(e){return e.map(r)}function a(e){for(var t=r(e[0]),n=[t],a=1;a<e.length;a++){var i=r(e[a]);(i.length>2||i[0]!=t[0]||i[1]!=t[1])&&(n.push(i),t=i)}return 1===n.length&&e.length>1&&n.push(r(e[e.length-1])),n}function i(e){return e.map(a)}function o(e){if(null==e)return e;var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(o)};break;case"Point":t={type:"Point",coordinates:r(e.coordinates)};break;case"MultiPoint":t={type:e.type,coordinates:n(e.coordinates)};break;case"LineString":t={type:e.type,coordinates:a(e.coordinates)};break;case"MultiLineString":case"Polygon":t={type:e.type,coordinates:i(e.coordinates)};break;case"MultiPolygon":t={type:"MultiPolygon",coordinates:e.coordinates.map(i)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function s(e){var t={type:"Feature",properties:e.properties,geometry:o(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),t}if(null!=e)switch(e.type){case"Feature":return s(e);case"FeatureCollection":var l={type:"FeatureCollection",features:e.features.map(s)};return null!=e.bbox&&(l.bbox=e.bbox),l;default:return o(e)}return e},e.geoQuincuncial=or,e.geoRectangularPolyconic=function(){return K(lr).scale(131.215)},e.geoRectangularPolyconicRaw=lr,e.geoRobinson=function(){return t.geoProjection(ur).scale(152.63)},e.geoRobinsonRaw=ur,e.geoSatellite=function(){var e=2,r=0,n=t.geoProjectionMutator(fr),a=n(e,r);return a.distance=function(t){return arguments.length?n(e=+t,r):e},a.tilt=function(t){return arguments.length?n(e,r=t*A):r*T},a.scale(432.147).clipAngle(M(1/e)*T-1e-6)},e.geoSatelliteRaw=fr,e.geoSinuMollweide=function(){return t.geoProjection(Ke).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoSinuMollweideRaw=Ke,e.geoSinusoidal=function(){return t.geoProjection(J).scale(152.63)},e.geoSinusoidalRaw=J,e.geoStitch=function(e){if(null==e)return e;switch(e.type){case"Feature":return _r(e);case"FeatureCollection":var t={type:"FeatureCollection",features:e.features.map(_r)};return null!=e.bbox&&(t.bbox=e.bbox),t;default:return wr(e)}},e.geoTimes=function(){return t.geoProjection(kr).scale(146.153)},e.geoTimesRaw=kr,e.geoTwoPointAzimuthal=Ar,e.geoTwoPointAzimuthalRaw=Tr,e.geoTwoPointAzimuthalUsa=function(){return Ar([-158,21.5],[-77,39]).clipAngle(60).scale(400)},e.geoTwoPointEquidistant=Mr,e.geoTwoPointEquidistantRaw=Sr,e.geoTwoPointEquidistantUsa=function(){return Mr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},e.geoVanDerGrinten=function(){return t.geoProjection(Er).scale(79.4183)},e.geoVanDerGrintenRaw=Er,e.geoVanDerGrinten2=function(){return t.geoProjection(Cr).scale(79.4183)},e.geoVanDerGrinten2Raw=Cr,e.geoVanDerGrinten3=function(){return t.geoProjection(Nr).scale(79.4183)},e.geoVanDerGrinten3Raw=Nr,e.geoVanDerGrinten4=function(){return t.geoProjection(Or).scale(127.16)},e.geoVanDerGrinten4Raw=Or,e.geoWagner=Pr,e.geoWagner7=function(){return Pr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},e.geoWagnerRaw=Ir,e.geoWagner4=function(){return t.geoProjection(Fr).scale(176.84)},e.geoWagner4Raw=Fr,e.geoWagner6=function(){return t.geoProjection(Br).scale(152.63)},e.geoWagner6Raw=Br,e.geoWiechel=function(){return t.geoProjection(zr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},e.geoWiechelRaw=zr,e.geoWinkel3=function(){return t.geoProjection(jr).scale(158.837)},e.geoWinkel3Raw=jr,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof r&&void 0!==t?a(r,e("d3-geo"),e("d3-array")):a(n.d3=n.d3||{},n.d3,n.d3)},{"d3-array":107,"d3-geo":114}],114:[function(e,t,r){var n,a;n=this,a=function(e,t){"use strict";function r(){return new n}function n(){this.reset()}n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(e){i(a,e,this.t),i(this,a.s,this.s),this.s?this.t+=a.t:this.s=a.t},valueOf:function(){return this.s}};var a=new n;function i(e,t,r){var n=e.s=t+r,a=n-t,i=n-a;e.t=t-i+(r-a)}var o=1e-6,s=Math.PI,l=s/2,c=s/4,u=2*s,f=180/s,p=s/180,h=Math.abs,d=Math.atan,m=Math.atan2,g=Math.cos,y=Math.ceil,v=Math.exp,b=Math.log,x=Math.pow,_=Math.sin,w=Math.sign||function(e){return e>0?1:e<0?-1:0},k=Math.sqrt,D=Math.tan;function T(e){return e>1?0:e<-1?s:Math.acos(e)}function A(e){return e>1?l:e<-1?-l:Math.asin(e)}function S(e){return(e=_(e/2))*e}function M(){}function E(e,t){e&&N.hasOwnProperty(e.type)&&N[e.type](e,t)}var C={Feature:function(e,t){E(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,a=r.length;++n<a;)E(r[n].geometry,t)}},N={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)e=r[n],t.point(e[0],e[1],e[2])},LineString:function(e,t){O(e.coordinates,t,0)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)O(r[n],t,0)},Polygon:function(e,t){I(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)I(r[n],t)},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,a=r.length;++n<a;)E(r[n],t)}};function O(e,t,r){var n,a=-1,i=e.length-r;for(t.lineStart();++a<i;)n=e[a],t.point(n[0],n[1],n[2]);t.lineEnd()}function I(e,t){var r=-1,n=e.length;for(t.polygonStart();++r<n;)O(e[r],t,1);t.polygonEnd()}function P(e,t){e&&C.hasOwnProperty(e.type)?C[e.type](e,t):E(e,t)}var R,L,F,B,z,j=r(),U=r(),$={point:M,lineStart:M,lineEnd:M,polygonStart:function(){j.reset(),$.lineStart=V,$.lineEnd=q},polygonEnd:function(){var e=+j;U.add(e<0?u+e:e),this.lineStart=this.lineEnd=this.point=M},sphere:function(){U.add(u)}};function V(){$.point=W}function q(){H(R,L)}function W(e,t){$.point=H,R=e,L=t,F=e*=p,B=g(t=(t*=p)/2+c),z=_(t)}function H(e,t){var r=(e*=p)-F,n=r>=0?1:-1,a=n*r,i=g(t=(t*=p)/2+c),o=_(t),s=z*o,l=B*i+s*g(a),u=s*n*_(a);j.add(m(u,l)),F=e,B=i,z=o}function G(e){return[m(e[1],e[0]),A(e[2])]}function X(e){var t=e[0],r=e[1],n=g(r);return[n*g(t),n*_(t),_(r)]}function Y(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Z(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 K(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function J(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Q(e){var t=k(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var ee,te,re,ne,ae,ie,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,ke,De,Te,Ae=r(),Se={point:Me,lineStart:Ce,lineEnd:Ne,polygonStart:function(){Se.point=Oe,Se.lineStart=Ie,Se.lineEnd=Pe,Ae.reset(),$.polygonStart()},polygonEnd:function(){$.polygonEnd(),Se.point=Me,Se.lineStart=Ce,Se.lineEnd=Ne,j<0?(ee=-(re=180),te=-(ne=90)):Ae>o?ne=90:Ae<-o&&(te=-90),ce[0]=ee,ce[1]=re},sphere:function(){ee=-(re=180),te=-(ne=90)}};function Me(e,t){le.push(ce=[ee=e,re=e]),t<te&&(te=t),t>ne&&(ne=t)}function Ee(e,t){var r=X([e*p,t*p]);if(se){var n=Z(se,r),a=Z([n[1],-n[0],0],n);Q(a),a=G(a);var i,o=e-ae,s=o>0?1:-1,l=a[0]*f*s,c=h(o)>180;c^(s*ae<l&&l<s*e)?(i=a[1]*f)>ne&&(ne=i):c^(s*ae<(l=(l+360)%360-180)&&l<s*e)?(i=-a[1]*f)<te&&(te=i):(t<te&&(te=t),t>ne&&(ne=t)),c?e<ae?Re(ee,e)>Re(ee,re)&&(re=e):Re(e,re)>Re(ee,re)&&(ee=e):re>=ee?(e<ee&&(ee=e),e>re&&(re=e)):e>ae?Re(ee,e)>Re(ee,re)&&(re=e):Re(e,re)>Re(ee,re)&&(ee=e)}else le.push(ce=[ee=e,re=e]);t<te&&(te=t),t>ne&&(ne=t),se=r,ae=e}function Ce(){Se.point=Ee}function Ne(){ce[0]=ee,ce[1]=re,Se.point=Me,se=null}function Oe(e,t){if(se){var r=e-ae;Ae.add(h(r)>180?r+(r>0?360:-360):r)}else ie=e,oe=t;$.point(e,t),Ee(e,t)}function Ie(){$.lineStart()}function Pe(){Oe(ie,oe),$.lineEnd(),h(Ae)>o&&(ee=-(re=180)),ce[0]=ee,ce[1]=re,se=null}function Re(e,t){return(t-=e)<0?t+360:t}function Le(e,t){return e[0]-t[0]}function Fe(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var Be={sphere:M,point:ze,lineStart:Ue,lineEnd:qe,polygonStart:function(){Be.lineStart=We,Be.lineEnd=He},polygonEnd:function(){Be.lineStart=Ue,Be.lineEnd=qe}};function ze(e,t){e*=p;var r=g(t*=p);je(r*g(e),r*_(e),_(t))}function je(e,t,r){++ue,pe+=(e-pe)/ue,he+=(t-he)/ue,de+=(r-de)/ue}function Ue(){Be.point=$e}function $e(e,t){e*=p;var r=g(t*=p);ke=r*g(e),De=r*_(e),Te=_(t),Be.point=Ve,je(ke,De,Te)}function Ve(e,t){e*=p;var r=g(t*=p),n=r*g(e),a=r*_(e),i=_(t),o=m(k((o=De*i-Te*a)*o+(o=Te*n-ke*i)*o+(o=ke*a-De*n)*o),ke*n+De*a+Te*i);fe+=o,me+=o*(ke+(ke=n)),ge+=o*(De+(De=a)),ye+=o*(Te+(Te=i)),je(ke,De,Te)}function qe(){Be.point=ze}function We(){Be.point=Ge}function He(){Xe(_e,we),Be.point=ze}function Ge(e,t){_e=e,we=t,e*=p,t*=p,Be.point=Xe;var r=g(t);ke=r*g(e),De=r*_(e),Te=_(t),je(ke,De,Te)}function Xe(e,t){e*=p;var r=g(t*=p),n=r*g(e),a=r*_(e),i=_(t),o=De*i-Te*a,s=Te*n-ke*i,l=ke*a-De*n,c=k(o*o+s*s+l*l),u=A(c),f=c&&-u/c;ve+=f*o,be+=f*s,xe+=f*l,fe+=u,me+=u*(ke+(ke=n)),ge+=u*(De+(De=a)),ye+=u*(Te+(Te=i)),je(ke,De,Te)}function Ye(e){return function(){return e}}function Ze(e,t){function r(r,n){return r=e(r,n),t(r[0],r[1])}return e.invert&&t.invert&&(r.invert=function(r,n){return(r=t.invert(r,n))&&e.invert(r[0],r[1])}),r}function Ke(e,t){return[h(e)>s?e+Math.round(-e/u)*u:e,t]}function Je(e,t,r){return(e%=u)?t||r?Ze(et(e),tt(t,r)):et(e):t||r?tt(t,r):Ke}function Qe(e){return function(t,r){return[(t+=e)>s?t-u:t<-s?t+u:t,r]}}function et(e){var t=Qe(e);return t.invert=Qe(-e),t}function tt(e,t){var r=g(e),n=_(e),a=g(t),i=_(t);function o(e,t){var o=g(t),s=g(e)*o,l=_(e)*o,c=_(t),u=c*r+s*n;return[m(l*a-u*i,s*r-c*n),A(u*a+l*i)]}return o.invert=function(e,t){var o=g(t),s=g(e)*o,l=_(e)*o,c=_(t),u=c*a-l*i;return[m(l*a+c*i,s*r+u*n),A(u*r-s*n)]},o}function rt(e){function t(t){return(t=e(t[0]*p,t[1]*p))[0]*=f,t[1]*=f,t}return e=Je(e[0]*p,e[1]*p,e.length>2?e[2]*p:0),t.invert=function(t){return(t=e.invert(t[0]*p,t[1]*p))[0]*=f,t[1]*=f,t},t}function nt(e,t,r,n,a,i){if(r){var o=g(t),s=_(t),l=n*r;null==a?(a=t+n*u,i=t-l/2):(a=at(o,a),i=at(o,i),(n>0?a<i:a>i)&&(a+=n*u));for(var c,f=a;n>0?f>i:f<i;f-=l)c=G([o,-s*g(f),-s*_(f)]),e.point(c[0],c[1])}}function at(e,t){(t=X(t))[0]-=e,Q(t);var r=T(-t[1]);return((-t[2]<0?-r:r)+u-o)%u}function it(){var e,t=[];return{point:function(t,r,n){e.push([t,r,n])},lineStart:function(){t.push(e=[])},lineEnd:M,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}function ot(e,t){return h(e[0]-t[0])<o&&h(e[1]-t[1])<o}function st(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function lt(e,t,r,n,a){var i,s,l=[],c=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,r,n=e[0],s=e[t];if(ot(n,s)){if(!n[2]&&!s[2]){for(a.lineStart(),i=0;i<t;++i)a.point((n=e[i])[0],n[1]);return void a.lineEnd()}s[0]+=2*o}l.push(r=new st(n,e,null,!0)),c.push(r.o=new st(n,null,r,!1)),l.push(r=new st(s,e,null,!1)),c.push(r.o=new st(s,null,r,!0))}})),l.length){for(c.sort(t),ct(l),ct(c),i=0,s=c.length;i<s;++i)c[i].e=r=!r;for(var u,f,p=l[0];;){for(var h=p,d=!0;h.v;)if((h=h.n)===p)return;u=h.z,a.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(i=0,s=u.length;i<s;++i)a.point((f=u[i])[0],f[1]);else n(h.x,h.n.x,1,a);h=h.n}else{if(d)for(u=h.p.z,i=u.length-1;i>=0;--i)a.point((f=u[i])[0],f[1]);else n(h.x,h.p.x,-1,a);h=h.p}u=(h=h.o).z,d=!d}while(!h.v);a.lineEnd()}}}function ct(e){if(t=e.length){for(var t,r,n=0,a=e[0];++n<t;)a.n=r=e[n],r.p=a,a=r;a.n=r=e[0],r.p=a}}Ke.invert=Ke;var ut=r();function ft(e){return h(e[0])<=s?e[0]:w(e[0])*((h(e[0])+s)%u-s)}function pt(e,t){var r=ft(t),n=t[1],a=_(n),i=[_(r),-g(r),0],f=0,p=0;ut.reset(),1===a?n=l+o:-1===a&&(n=-l-o);for(var h=0,d=e.length;h<d;++h)if(v=(y=e[h]).length)for(var y,v,b=y[v-1],x=ft(b),w=b[1]/2+c,k=_(w),D=g(w),T=0;T<v;++T,x=M,k=C,D=N,b=S){var S=y[T],M=ft(S),E=S[1]/2+c,C=_(E),N=g(E),O=M-x,I=O>=0?1:-1,P=I*O,R=P>s,L=k*C;if(ut.add(m(L*I*_(P),D*N+L*g(P))),f+=R?O+I*u:O,R^x>=r^M>=r){var F=Z(X(b),X(S));Q(F);var B=Z(i,F);Q(B);var z=(R^O>=0?-1:1)*A(B[2]);(n>z||n===z&&(F[0]||F[1]))&&(p+=R^O>=0?1:-1)}}return(f<-o||f<o&&ut<-o)^1&p}function ht(e,r,n,a){return function(i){var o,s,l,c=r(i),u=it(),f=r(u),p=!1,h={point:d,lineStart:g,lineEnd:y,polygonStart:function(){h.point=v,h.lineStart=b,h.lineEnd=x,s=[],o=[]},polygonEnd:function(){h.point=d,h.lineStart=g,h.lineEnd=y,s=t.merge(s);var e=pt(o,a);s.length?(p||(i.polygonStart(),p=!0),lt(s,mt,e,n,i)):e&&(p||(i.polygonStart(),p=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),p&&(i.polygonEnd(),p=!1),s=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(t,r){e(t,r)&&i.point(t,r)}function m(e,t){c.point(e,t)}function g(){h.point=m,c.lineStart()}function y(){h.point=d,c.lineEnd()}function v(e,t){l.push([e,t]),f.point(e,t)}function b(){f.lineStart(),l=[]}function x(){v(l[0][0],l[0][1]),f.lineEnd();var e,t,r,n,a=f.clean(),c=u.result(),h=c.length;if(l.pop(),o.push(l),l=null,h)if(1&a){if((t=(r=c[0]).length-1)>0){for(p||(i.polygonStart(),p=!0),i.lineStart(),e=0;e<t;++e)i.point((n=r[e])[0],n[1]);i.lineEnd()}}else h>1&&2&a&&c.push(c.pop().concat(c.shift())),s.push(c.filter(dt))}return h}}function dt(e){return e.length>1}function mt(e,t){return((e=e.x)[0]<0?e[1]-l-o:l-e[1])-((t=t.x)[0]<0?t[1]-l-o:l-t[1])}var gt=ht((function(){return!0}),(function(e){var t,r=NaN,n=NaN,a=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(i,c){var u=i>0?s:-s,f=h(i-r);h(f-s)<o?(e.point(r,n=(n+c)/2>0?l:-l),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(u,n),e.point(i,n),t=0):a!==u&&f>=s&&(h(r-a)<o&&(r-=a*o),h(i-u)<o&&(i-=u*o),n=function(e,t,r,n){var a,i,s=_(e-r);return h(s)>o?d((_(t)*(i=g(n))*_(r)-_(n)*(a=g(t))*_(e))/(a*i*s)):(t+n)/2}(r,n,i,c),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(u,n),t=0),e.point(r=i,n=c),a=u},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}}),(function(e,t,r,n){var a;if(null==e)a=r*l,n.point(-s,a),n.point(0,a),n.point(s,a),n.point(s,0),n.point(s,-a),n.point(0,-a),n.point(-s,-a),n.point(-s,0),n.point(-s,a);else if(h(e[0]-t[0])>o){var i=e[0]<t[0]?s:-s;a=r*i/2,n.point(-i,a),n.point(0,a),n.point(i,a)}else n.point(t[0],t[1])}),[-s,-l]);function yt(e){var t=g(e),r=6*p,n=t>0,a=h(t)>o;function i(e,r){return g(e)*g(r)>t}function l(e,r,n){var a=[1,0,0],i=Z(X(e),X(r)),l=Y(i,i),c=i[0],u=l-c*c;if(!u)return!n&&e;var f=t*l/u,p=-t*c/u,d=Z(a,i),m=J(a,f);K(m,J(i,p));var g=d,y=Y(m,g),v=Y(g,g),b=y*y-v*(Y(m,m)-1);if(!(b<0)){var x=k(b),_=J(g,(-y-x)/v);if(K(_,m),_=G(_),!n)return _;var w,D=e[0],T=r[0],A=e[1],S=r[1];T<D&&(w=D,D=T,T=w);var M=T-D,E=h(M-s)<o;if(!E&&S<A&&(w=A,A=S,S=w),E||M<o?E?A+S>0^_[1]<(h(_[0]-D)<o?A:S):A<=_[1]&&_[1]<=S:M>s^(D<=_[0]&&_[0]<=T)){var C=J(g,(-y+x)/v);return K(C,m),[_,G(C)]}}}function c(t,r){var a=n?e:s-e,i=0;return t<-a?i|=1:t>a&&(i|=2),r<-a?i|=4:r>a&&(i|=8),i}return ht(i,(function(e){var t,r,o,u,f;return{lineStart:function(){u=o=!1,f=1},point:function(p,h){var d,m=[p,h],g=i(p,h),y=n?g?0:c(p,h):g?c(p+(p<0?s:-s),h):0;if(!t&&(u=o=g)&&e.lineStart(),g!==o&&(!(d=l(t,m))||ot(t,d)||ot(m,d))&&(m[2]=1),g!==o)f=0,g?(e.lineStart(),d=l(m,t),e.point(d[0],d[1])):(d=l(t,m),e.point(d[0],d[1],2),e.lineEnd()),t=d;else if(a&&t&&n^g){var v;y&r||!(v=l(m,t,!0))||(f=0,n?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1],3)))}!g||t&&ot(t,m)||e.point(m[0],m[1]),t=m,o=g,r=y},lineEnd:function(){o&&e.lineEnd(),t=null},clean:function(){return f|(u&&o)<<1}}}),(function(t,n,a,i){nt(i,e,r,a,t,n)}),n?[0,-e]:[-s,e-s])}function vt(e,r,n,a){function i(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function s(t,i,o,s){var c=0,f=0;if(null==t||(c=l(t,o))!==(f=l(i,o))||u(t,i)<0^o>0)do{s.point(0===c||3===c?e:n,c>1?a:r)}while((c=(c+o+4)%4)!==f);else s.point(i[0],i[1])}function l(t,a){return h(t[0]-e)<o?a>0?0:3:h(t[0]-n)<o?a>0?2:1:h(t[1]-r)<o?a>0?1:0:a>0?3:2}function c(e,t){return u(e.x,t.x)}function u(e,t){var r=l(e,1),n=l(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(o){var l,u,f,p,h,d,m,g,y,v,b,x=o,_=it(),w={point:k,lineStart:function(){w.point=D,u&&u.push(f=[]),v=!0,y=!1,m=g=NaN},lineEnd:function(){l&&(D(p,h),d&&y&&_.rejoin(),l.push(_.result())),w.point=k,y&&x.lineEnd()},polygonStart:function(){x=_,l=[],u=[],b=!0},polygonEnd:function(){var r=function(){for(var t=0,r=0,n=u.length;r<n;++r)for(var i,o,s=u[r],l=1,c=s.length,f=s[0],p=f[0],h=f[1];l<c;++l)i=p,o=h,p=(f=s[l])[0],h=f[1],o<=a?h>a&&(p-i)*(a-o)>(h-o)*(e-i)&&++t:h<=a&&(p-i)*(a-o)<(h-o)*(e-i)&&--t;return t}(),n=b&&r,i=(l=t.merge(l)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),i&&lt(l,c,r,s,o),o.polygonEnd()),x=o,l=u=f=null}};function k(e,t){i(e,t)&&x.point(e,t)}function D(t,o){var s=i(t,o);if(u&&f.push([t,o]),v)p=t,h=o,d=s,v=!1,s&&(x.lineStart(),x.point(t,o));else if(s&&y)x.point(t,o);else{var l=[m=Math.max(-1e9,Math.min(1e9,m)),g=Math.max(-1e9,Math.min(1e9,g))],c=[t=Math.max(-1e9,Math.min(1e9,t)),o=Math.max(-1e9,Math.min(1e9,o))];!function(e,t,r,n,a,i){var o,s=e[0],l=e[1],c=0,u=1,f=t[0]-s,p=t[1]-l;if(o=r-s,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<u&&(u=o)}else if(f>0){if(o>u)return;o>c&&(c=o)}if(o=a-s,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<u&&(u=o)}if(o=n-l,p||!(o>0)){if(o/=p,p<0){if(o<c)return;o<u&&(u=o)}else if(p>0){if(o>u)return;o>c&&(c=o)}if(o=i-l,p||!(o<0)){if(o/=p,p<0){if(o>u)return;o>c&&(c=o)}else if(p>0){if(o<c)return;o<u&&(u=o)}return c>0&&(e[0]=s+c*f,e[1]=l+c*p),u<1&&(t[0]=s+u*f,t[1]=l+u*p),!0}}}}}(l,c,e,r,n,a)?s&&(x.lineStart(),x.point(t,o),b=!1):(y||(x.lineStart(),x.point(l[0],l[1])),x.point(c[0],c[1]),s||x.lineEnd(),b=!1)}m=t,g=o,y=s}return w}}var bt,xt,_t,wt=r(),kt={sphere:M,point:M,lineStart:function(){kt.point=Tt,kt.lineEnd=Dt},lineEnd:M,polygonStart:M,polygonEnd:M};function Dt(){kt.point=kt.lineEnd=M}function Tt(e,t){bt=e*=p,xt=_(t*=p),_t=g(t),kt.point=At}function At(e,t){e*=p;var r=_(t*=p),n=g(t),a=h(e-bt),i=g(a),o=n*_(a),s=_t*r-xt*n*i,l=xt*r+_t*n*i;wt.add(m(k(o*o+s*s),l)),bt=e,xt=r,_t=n}function St(e){return wt.reset(),P(e,kt),+wt}var Mt=[null,null],Et={type:"LineString",coordinates:Mt};function Ct(e,t){return Mt[0]=e,Mt[1]=t,St(Et)}var Nt={Feature:function(e,t){return It(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,a=r.length;++n<a;)if(It(r[n].geometry,t))return!0;return!1}},Ot={Sphere:function(){return!0},Point:function(e,t){return Pt(e.coordinates,t)},MultiPoint:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)if(Pt(r[n],t))return!0;return!1},LineString:function(e,t){return Rt(e.coordinates,t)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)if(Rt(r[n],t))return!0;return!1},Polygon:function(e,t){return Lt(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)if(Lt(r[n],t))return!0;return!1},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,a=r.length;++n<a;)if(It(r[n],t))return!0;return!1}};function It(e,t){return!(!e||!Ot.hasOwnProperty(e.type))&&Ot[e.type](e,t)}function Pt(e,t){return 0===Ct(e,t)}function Rt(e,t){for(var r,n,a,i=0,o=e.length;i<o;i++){if(0===(n=Ct(e[i],t)))return!0;if(i>0&&(a=Ct(e[i],e[i-1]))>0&&r<=a&&n<=a&&(r+n-a)*(1-Math.pow((r-n)/a,2))<1e-12*a)return!0;r=n}return!1}function Lt(e,t){return!!pt(e.map(Ft),Bt(t))}function Ft(e){return(e=e.map(Bt)).pop(),e}function Bt(e){return[e[0]*p,e[1]*p]}function zt(e,r,n){var a=t.range(e,r-o,n).concat(r);return function(e){return a.map((function(t){return[e,t]}))}}function jt(e,r,n){var a=t.range(e,r-o,n).concat(r);return function(e){return a.map((function(t){return[t,e]}))}}function Ut(){var e,r,n,a,i,s,l,c,u,f,p,d,m=10,g=m,v=90,b=360,x=2.5;function _(){return{type:"MultiLineString",coordinates:w()}}function w(){return t.range(y(a/v)*v,n,v).map(p).concat(t.range(y(c/b)*b,l,b).map(d)).concat(t.range(y(r/m)*m,e,m).filter((function(e){return h(e%v)>o})).map(u)).concat(t.range(y(s/g)*g,i,g).filter((function(e){return h(e%b)>o})).map(f))}return _.lines=function(){return w().map((function(e){return{type:"LineString",coordinates:e}}))},_.outline=function(){return{type:"Polygon",coordinates:[p(a).concat(d(l).slice(1),p(n).reverse().slice(1),d(c).reverse().slice(1))]}},_.extent=function(e){return arguments.length?_.extentMajor(e).extentMinor(e):_.extentMinor()},_.extentMajor=function(e){return arguments.length?(a=+e[0][0],n=+e[1][0],c=+e[0][1],l=+e[1][1],a>n&&(e=a,a=n,n=e),c>l&&(e=c,c=l,l=e),_.precision(x)):[[a,c],[n,l]]},_.extentMinor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],s=+t[0][1],i=+t[1][1],r>e&&(t=r,r=e,e=t),s>i&&(t=s,s=i,i=t),_.precision(x)):[[r,s],[e,i]]},_.step=function(e){return arguments.length?_.stepMajor(e).stepMinor(e):_.stepMinor()},_.stepMajor=function(e){return arguments.length?(v=+e[0],b=+e[1],_):[v,b]},_.stepMinor=function(e){return arguments.length?(m=+e[0],g=+e[1],_):[m,g]},_.precision=function(t){return arguments.length?(x=+t,u=zt(s,i,90),f=jt(r,e,x),p=zt(c,l,90),d=jt(a,n,x),_):x},_.extentMajor([[-180,-90+o],[180,90-o]]).extentMinor([[-180,-80-o],[180,80+o]])}function $t(e){return e}var Vt,qt,Wt,Ht,Gt=r(),Xt=r(),Yt={point:M,lineStart:M,lineEnd:M,polygonStart:function(){Yt.lineStart=Zt,Yt.lineEnd=Qt},polygonEnd:function(){Yt.lineStart=Yt.lineEnd=Yt.point=M,Gt.add(h(Xt)),Xt.reset()},result:function(){var e=Gt/2;return Gt.reset(),e}};function Zt(){Yt.point=Kt}function Kt(e,t){Yt.point=Jt,Vt=Wt=e,qt=Ht=t}function Jt(e,t){Xt.add(Ht*e-Wt*t),Wt=e,Ht=t}function Qt(){Jt(Vt,qt)}var er,tr,rr,nr,ar=1/0,ir=ar,or=-ar,sr=or,lr={point:function(e,t){e<ar&&(ar=e),e>or&&(or=e),t<ir&&(ir=t),t>sr&&(sr=t)},lineStart:M,lineEnd:M,polygonStart:M,polygonEnd:M,result:function(){var e=[[ar,ir],[or,sr]];return or=sr=-(ir=ar=1/0),e}},cr=0,ur=0,fr=0,pr=0,hr=0,dr=0,mr=0,gr=0,yr=0,vr={point:br,lineStart:xr,lineEnd:kr,polygonStart:function(){vr.lineStart=Dr,vr.lineEnd=Tr},polygonEnd:function(){vr.point=br,vr.lineStart=xr,vr.lineEnd=kr},result:function(){var e=yr?[mr/yr,gr/yr]:dr?[pr/dr,hr/dr]:fr?[cr/fr,ur/fr]:[NaN,NaN];return cr=ur=fr=pr=hr=dr=mr=gr=yr=0,e}};function br(e,t){cr+=e,ur+=t,++fr}function xr(){vr.point=_r}function _r(e,t){vr.point=wr,br(rr=e,nr=t)}function wr(e,t){var r=e-rr,n=t-nr,a=k(r*r+n*n);pr+=a*(rr+e)/2,hr+=a*(nr+t)/2,dr+=a,br(rr=e,nr=t)}function kr(){vr.point=br}function Dr(){vr.point=Ar}function Tr(){Sr(er,tr)}function Ar(e,t){vr.point=Sr,br(er=rr=e,tr=nr=t)}function Sr(e,t){var r=e-rr,n=t-nr,a=k(r*r+n*n);pr+=a*(rr+e)/2,hr+=a*(nr+t)/2,dr+=a,mr+=(a=nr*e-rr*t)*(rr+e),gr+=a*(nr+t),yr+=3*a,br(rr=e,nr=t)}function Mr(e){this._context=e}Mr.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,u)}},result:M};var Er,Cr,Nr,Or,Ir,Pr=r(),Rr={point:M,lineStart:function(){Rr.point=Lr},lineEnd:function(){Er&&Fr(Cr,Nr),Rr.point=M},polygonStart:function(){Er=!0},polygonEnd:function(){Er=null},result:function(){var e=+Pr;return Pr.reset(),e}};function Lr(e,t){Rr.point=Fr,Cr=Or=e,Nr=Ir=t}function Fr(e,t){Or-=e,Ir-=t,Pr.add(k(Or*Or+Ir*Ir)),Or=e,Ir=t}function Br(){this._string=[]}function zr(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function jr(e){return function(t){var r=new Ur;for(var n in e)r[n]=e[n];return r.stream=t,r}}function Ur(){}function $r(e,t,r){var n=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=n&&e.clipExtent(null),P(r,e.stream(lr)),t(lr.result()),null!=n&&e.clipExtent(n),e}function Vr(e,t,r){return $r(e,(function(r){var n=t[1][0]-t[0][0],a=t[1][1]-t[0][1],i=Math.min(n/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),o=+t[0][0]+(n-i*(r[1][0]+r[0][0]))/2,s=+t[0][1]+(a-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([o,s])}),r)}function qr(e,t,r){return Vr(e,[[0,0],t],r)}function Wr(e,t,r){return $r(e,(function(r){var n=+t,a=n/(r[1][0]-r[0][0]),i=(n-a*(r[1][0]+r[0][0]))/2,o=-a*r[0][1];e.scale(150*a).translate([i,o])}),r)}function Hr(e,t,r){return $r(e,(function(r){var n=+t,a=n/(r[1][1]-r[0][1]),i=-a*r[0][0],o=(n-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([i,o])}),r)}Br.prototype={_radius:4.5,_circle:zr(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(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=zr(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}},Ur.prototype={constructor:Ur,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Gr=g(30*p);function Xr(e,t){return+t?function(e,t){function r(n,a,i,s,l,c,u,f,p,d,g,y,v,b){var x=u-n,_=f-a,w=x*x+_*_;if(w>4*t&&v--){var D=s+d,T=l+g,S=c+y,M=k(D*D+T*T+S*S),E=A(S/=M),C=h(h(S)-1)<o||h(i-p)<o?(i+p)/2:m(T,D),N=e(C,E),O=N[0],I=N[1],P=O-n,R=I-a,L=_*P-x*R;(L*L/w>t||h((x*P+_*R)/w-.5)>.3||s*d+l*g+c*y<Gr)&&(r(n,a,i,s,l,c,O,I,C,D/=M,T/=M,S,v,b),b.point(O,I),r(O,I,C,D,T,S,u,f,p,d,g,y,v,b))}}return function(t){var n,a,i,o,s,l,c,u,f,p,h,d,m={point:g,lineStart:y,lineEnd:b,polygonStart:function(){t.polygonStart(),m.lineStart=x},polygonEnd:function(){t.polygonEnd(),m.lineStart=y}};function g(r,n){r=e(r,n),t.point(r[0],r[1])}function y(){u=NaN,m.point=v,t.lineStart()}function v(n,a){var i=X([n,a]),o=e(n,a);r(u,f,c,p,h,d,u=o[0],f=o[1],c=n,p=i[0],h=i[1],d=i[2],16,t),t.point(u,f)}function b(){m.point=g,t.lineEnd()}function x(){y(),m.point=_,m.lineEnd=w}function _(e,t){v(n=e,t),a=u,i=f,o=p,s=h,l=d,m.point=v}function w(){r(u,f,c,p,h,d,a,i,n,o,s,l,16,t),m.lineEnd=b,b()}return m}}(e,t):function(e){return jr({point:function(t,r){t=e(t,r),this.stream.point(t[0],t[1])}})}(e)}var Yr=jr({point:function(e,t){this.stream.point(e*p,t*p)}});function Zr(e,t,r,n,a){function i(i,o){return[t+e*(i*=n),r-e*(o*=a)]}return i.invert=function(i,o){return[(i-t)/e*n,(r-o)/e*a]},i}function Kr(e,t,r,n,a,i){var o=g(i),s=_(i),l=o*e,c=s*e,u=o/e,f=s/e,p=(s*r-o*t)/e,h=(s*t+o*r)/e;function d(e,i){return[l*(e*=n)-c*(i*=a)+t,r-c*e-l*i]}return d.invert=function(e,t){return[n*(u*e-f*t+p),a*(h-f*e-u*t)]},d}function Jr(e){return Qr((function(){return e}))()}function Qr(e){var t,r,n,a,i,o,s,l,c,u,h=150,d=480,m=250,g=0,y=0,v=0,b=0,x=0,_=0,w=1,D=1,T=null,A=gt,S=null,M=$t,E=.5;function C(e){return l(e[0]*p,e[1]*p)}function N(e){return(e=l.invert(e[0],e[1]))&&[e[0]*f,e[1]*f]}function O(){var e=Kr(h,0,0,w,D,_).apply(null,t(g,y)),n=(_?Kr:Zr)(h,d-e[0],m-e[1],w,D,_);return r=Je(v,b,x),s=Ze(t,n),l=Ze(r,s),o=Xr(s,E),I()}function I(){return c=u=null,C}return C.stream=function(e){return c&&u===e?c:c=Yr(function(e){return jr({point:function(t,r){var n=e(t,r);return this.stream.point(n[0],n[1])}})}(r)(A(o(M(u=e)))))},C.preclip=function(e){return arguments.length?(A=e,T=void 0,I()):A},C.postclip=function(e){return arguments.length?(M=e,S=n=a=i=null,I()):M},C.clipAngle=function(e){return arguments.length?(A=+e?yt(T=e*p):(T=null,gt),I()):T*f},C.clipExtent=function(e){return arguments.length?(M=null==e?(S=n=a=i=null,$t):vt(S=+e[0][0],n=+e[0][1],a=+e[1][0],i=+e[1][1]),I()):null==S?null:[[S,n],[a,i]]},C.scale=function(e){return arguments.length?(h=+e,O()):h},C.translate=function(e){return arguments.length?(d=+e[0],m=+e[1],O()):[d,m]},C.center=function(e){return arguments.length?(g=e[0]%360*p,y=e[1]%360*p,O()):[g*f,y*f]},C.rotate=function(e){return arguments.length?(v=e[0]%360*p,b=e[1]%360*p,x=e.length>2?e[2]%360*p:0,O()):[v*f,b*f,x*f]},C.angle=function(e){return arguments.length?(_=e%360*p,O()):_*f},C.reflectX=function(e){return arguments.length?(w=e?-1:1,O()):w<0},C.reflectY=function(e){return arguments.length?(D=e?-1:1,O()):D<0},C.precision=function(e){return arguments.length?(o=Xr(s,E=e*e),I()):k(E)},C.fitExtent=function(e,t){return Vr(C,e,t)},C.fitSize=function(e,t){return qr(C,e,t)},C.fitWidth=function(e,t){return Wr(C,e,t)},C.fitHeight=function(e,t){return Hr(C,e,t)},function(){return t=e.apply(this,arguments),C.invert=t.invert&&N,O()}}function en(e){var t=0,r=s/3,n=Qr(e),a=n(t,r);return a.parallels=function(e){return arguments.length?n(t=e[0]*p,r=e[1]*p):[t*f,r*f]},a}function tn(e,t){var r=_(e),n=(r+_(t))/2;if(h(n)<o)return function(e){var t=g(e);function r(e,r){return[e*t,_(r)/t]}return r.invert=function(e,r){return[e/t,A(r*t)]},r}(e);var a=1+r*(2*n-r),i=k(a)/n;function l(e,t){var r=k(a-2*n*_(t))/n;return[r*_(e*=n),i-r*g(e)]}return l.invert=function(e,t){var r=i-t,o=m(e,h(r))*w(r);return r*n<0&&(o-=s*w(e)*w(r)),[o/n,A((a-(e*e+r*r)*n*n)/(2*n))]},l}function rn(){return en(tn).scale(155.424).center([0,33.6442])}function nn(){return rn().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function an(e){return function(t,r){var n=g(t),a=g(r),i=e(n*a);return[i*a*_(t),i*_(r)]}}function on(e){return function(t,r){var n=k(t*t+r*r),a=e(n),i=_(a),o=g(a);return[m(t*i,n*o),A(n&&r*i/n)]}}var sn=an((function(e){return k(2/(1+e))}));sn.invert=on((function(e){return 2*A(e/2)}));var ln=an((function(e){return(e=T(e))&&e/_(e)}));function cn(e,t){return[e,b(D((l+t)/2))]}function un(e){var t,r,n,a=Jr(e),i=a.center,o=a.scale,l=a.translate,c=a.clipExtent,u=null;function f(){var i=s*o(),l=a(rt(a.rotate()).invert([0,0]));return c(null==u?[[l[0]-i,l[1]-i],[l[0]+i,l[1]+i]]:e===cn?[[Math.max(l[0]-i,u),t],[Math.min(l[0]+i,r),n]]:[[u,Math.max(l[1]-i,t)],[r,Math.min(l[1]+i,n)]])}return a.scale=function(e){return arguments.length?(o(e),f()):o()},a.translate=function(e){return arguments.length?(l(e),f()):l()},a.center=function(e){return arguments.length?(i(e),f()):i()},a.clipExtent=function(e){return arguments.length?(null==e?u=t=r=n=null:(u=+e[0][0],t=+e[0][1],r=+e[1][0],n=+e[1][1]),f()):null==u?null:[[u,t],[r,n]]},f()}function fn(e){return D((l+e)/2)}function pn(e,t){var r=g(e),n=e===t?_(e):b(r/g(t))/b(fn(t)/fn(e)),a=r*x(fn(e),n)/n;if(!n)return cn;function i(e,t){a>0?t<-l+o&&(t=-l+o):t>l-o&&(t=l-o);var r=a/x(fn(t),n);return[r*_(n*e),a-r*g(n*e)]}return i.invert=function(e,t){var r=a-t,i=w(n)*k(e*e+r*r),o=m(e,h(r))*w(r);return r*n<0&&(o-=s*w(e)*w(r)),[o/n,2*d(x(a/i,1/n))-l]},i}function hn(e,t){return[e,t]}function dn(e,t){var r=g(e),n=e===t?_(e):(r-g(t))/(t-e),a=r/n+e;if(h(n)<o)return hn;function i(e,t){var r=a-t,i=n*e;return[r*_(i),a-r*g(i)]}return i.invert=function(e,t){var r=a-t,i=m(e,h(r))*w(r);return r*n<0&&(i-=s*w(e)*w(r)),[i/n,a-w(n)*k(e*e+r*r)]},i}ln.invert=on((function(e){return e})),cn.invert=function(e,t){return[e,2*d(v(t))-l]},hn.invert=hn;var mn=1.340264,gn=-.081106,yn=893e-6,vn=.003796,bn=k(3)/2;function xn(e,t){var r=A(bn*_(t)),n=r*r,a=n*n*n;return[e*g(r)/(bn*(mn+3*gn*n+a*(7*yn+9*vn*n))),r*(mn+gn*n+a*(yn+vn*n))]}function _n(e,t){var r=g(t),n=g(e)*r;return[r*_(e)/n,_(t)/n]}function wn(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)))]}function kn(e,t){return[g(t)*_(e),_(t)]}function Dn(e,t){var r=g(t),n=1+g(e)*r;return[r*_(e)/n,_(t)/n]}function Tn(e,t){return[b(D((l+t)/2)),-e]}xn.invert=function(e,t){for(var r,n=t,a=n*n,i=a*a*a,o=0;o<12&&(i=(a=(n-=r=(n*(mn+gn*a+i*(yn+vn*a))-t)/(mn+3*gn*a+i*(7*yn+9*vn*a)))*n)*a*a,!(h(r)<1e-12));++o);return[bn*e*(mn+3*gn*a+i*(7*yn+9*vn*a))/g(n),A(_(n)/bn)]},_n.invert=on(d),wn.invert=function(e,t){var r,n=t,a=25;do{var i=n*n,s=i*i;n-=r=(n*(1.007226+i*(.015085+s*(.028874*i-.044475-.005916*s)))-t)/(1.007226+i*(.045255+s*(.259866*i-.311325-.005916*11*s)))}while(h(r)>o&&--a>0);return[e/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},kn.invert=on(A),Dn.invert=on((function(e){return 2*d(e)})),Tn.invert=function(e,t){return[-t,2*d(v(e))-l]},e.geoAlbers=nn,e.geoAlbersUsa=function(){var e,t,r,n,a,i,s=nn(),l=rn().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=rn().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,t){i=[e,t]}};function f(e){var t=e[0],o=e[1];return i=null,r.point(t,o),i||(n.point(t,o),i)||(a.point(t,o),i)}function p(){return e=t=null,f}return f.invert=function(e){var t=s.scale(),r=s.translate(),n=(e[0]-r[0])/t,a=(e[1]-r[1])/t;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?l:a>=.166&&a<.234&&n>=-.214&&n<-.115?c:s).invert(e)},f.stream=function(r){return e&&t===r?e:(n=[s.stream(t=r),l.stream(r),c.stream(r)],a=n.length,e={point:function(e,t){for(var r=-1;++r<a;)n[r].point(e,t)},sphere:function(){for(var e=-1;++e<a;)n[e].sphere()},lineStart:function(){for(var e=-1;++e<a;)n[e].lineStart()},lineEnd:function(){for(var e=-1;++e<a;)n[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<a;)n[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<a;)n[e].polygonEnd()}});var n,a},f.precision=function(e){return arguments.length?(s.precision(e),l.precision(e),c.precision(e),p()):s.precision()},f.scale=function(e){return arguments.length?(s.scale(e),l.scale(.35*e),c.scale(e),f.translate(s.translate())):s.scale()},f.translate=function(e){if(!arguments.length)return s.translate();var t=s.scale(),i=+e[0],f=+e[1];return r=s.translate(e).clipExtent([[i-.455*t,f-.238*t],[i+.455*t,f+.238*t]]).stream(u),n=l.translate([i-.307*t,f+.201*t]).clipExtent([[i-.425*t+o,f+.12*t+o],[i-.214*t-o,f+.234*t-o]]).stream(u),a=c.translate([i-.205*t,f+.212*t]).clipExtent([[i-.214*t+o,f+.166*t+o],[i-.115*t-o,f+.234*t-o]]).stream(u),p()},f.fitExtent=function(e,t){return Vr(f,e,t)},f.fitSize=function(e,t){return qr(f,e,t)},f.fitWidth=function(e,t){return Wr(f,e,t)},f.fitHeight=function(e,t){return Hr(f,e,t)},f.scale(1070)},e.geoArea=function(e){return U.reset(),P(e,$),2*U},e.geoAzimuthalEqualArea=function(){return Jr(sn).scale(124.75).clipAngle(179.999)},e.geoAzimuthalEqualAreaRaw=sn,e.geoAzimuthalEquidistant=function(){return Jr(ln).scale(79.4188).clipAngle(179.999)},e.geoAzimuthalEquidistantRaw=ln,e.geoBounds=function(e){var t,r,n,a,i,o,s;if(ne=re=-(ee=te=1/0),le=[],P(e,Se),r=le.length){for(le.sort(Le),t=1,i=[n=le[0]];t<r;++t)Fe(n,(a=le[t])[0])||Fe(n,a[1])?(Re(n[0],a[1])>Re(n[0],n[1])&&(n[1]=a[1]),Re(a[0],n[1])>Re(n[0],n[1])&&(n[0]=a[0])):i.push(n=a);for(o=-1/0,t=0,n=i[r=i.length-1];t<=r;n=a,++t)a=i[t],(s=Re(n[1],a[0]))>o&&(o=s,ee=a[0],re=n[1])}return le=ce=null,ee===1/0||te===1/0?[[NaN,NaN],[NaN,NaN]]:[[ee,te],[re,ne]]},e.geoCentroid=function(e){ue=fe=pe=he=de=me=ge=ye=ve=be=xe=0,P(e,Be);var t=ve,r=be,n=xe,a=t*t+r*r+n*n;return a<1e-12&&(t=me,r=ge,n=ye,fe<o&&(t=pe,r=he,n=de),(a=t*t+r*r+n*n)<1e-12)?[NaN,NaN]:[m(r,t)*f,A(n/k(a))*f]},e.geoCircle=function(){var e,t,r=Ye([0,0]),n=Ye(90),a=Ye(6),i={point:function(r,n){e.push(r=t(r,n)),r[0]*=f,r[1]*=f}};function o(){var o=r.apply(this,arguments),s=n.apply(this,arguments)*p,l=a.apply(this,arguments)*p;return e=[],t=Je(-o[0]*p,-o[1]*p,0).invert,nt(i,s,l,1),o={type:"Polygon",coordinates:[e]},e=t=null,o}return o.center=function(e){return arguments.length?(r="function"==typeof e?e:Ye([+e[0],+e[1]]),o):r},o.radius=function(e){return arguments.length?(n="function"==typeof e?e:Ye(+e),o):n},o.precision=function(e){return arguments.length?(a="function"==typeof e?e:Ye(+e),o):a},o},e.geoClipAntimeridian=gt,e.geoClipCircle=yt,e.geoClipExtent=function(){var e,t,r,n=0,a=0,i=960,o=500;return r={stream:function(r){return e&&t===r?e:e=vt(n,a,i,o)(t=r)},extent:function(s){return arguments.length?(n=+s[0][0],a=+s[0][1],i=+s[1][0],o=+s[1][1],e=t=null,r):[[n,a],[i,o]]}}},e.geoClipRectangle=vt,e.geoConicConformal=function(){return en(pn).scale(109.5).parallels([30,30])},e.geoConicConformalRaw=pn,e.geoConicEqualArea=rn,e.geoConicEqualAreaRaw=tn,e.geoConicEquidistant=function(){return en(dn).scale(131.154).center([0,13.9389])},e.geoConicEquidistantRaw=dn,e.geoContains=function(e,t){return(e&&Nt.hasOwnProperty(e.type)?Nt[e.type]:It)(e,t)},e.geoDistance=Ct,e.geoEqualEarth=function(){return Jr(xn).scale(177.158)},e.geoEqualEarthRaw=xn,e.geoEquirectangular=function(){return Jr(hn).scale(152.63)},e.geoEquirectangularRaw=hn,e.geoGnomonic=function(){return Jr(_n).scale(144.049).clipAngle(60)},e.geoGnomonicRaw=_n,e.geoGraticule=Ut,e.geoGraticule10=function(){return Ut()()},e.geoIdentity=function(){var e,t,r,n,a,i,o,s=1,l=0,c=0,u=1,h=1,d=0,m=null,y=1,v=1,b=jr({point:function(e,t){var r=k([e,t]);this.stream.point(r[0],r[1])}}),x=$t;function w(){return y=s*u,v=s*h,i=o=null,k}function k(r){var n=r[0]*y,a=r[1]*v;if(d){var i=a*e-n*t;n=n*e+a*t,a=i}return[n+l,a+c]}return k.invert=function(r){var n=r[0]-l,a=r[1]-c;if(d){var i=a*e+n*t;n=n*e-a*t,a=i}return[n/y,a/v]},k.stream=function(e){return i&&o===e?i:i=b(x(o=e))},k.postclip=function(e){return arguments.length?(x=e,m=r=n=a=null,w()):x},k.clipExtent=function(e){return arguments.length?(x=null==e?(m=r=n=a=null,$t):vt(m=+e[0][0],r=+e[0][1],n=+e[1][0],a=+e[1][1]),w()):null==m?null:[[m,r],[n,a]]},k.scale=function(e){return arguments.length?(s=+e,w()):s},k.translate=function(e){return arguments.length?(l=+e[0],c=+e[1],w()):[l,c]},k.angle=function(r){return arguments.length?(t=_(d=r%360*p),e=g(d),w()):d*f},k.reflectX=function(e){return arguments.length?(u=e?-1:1,w()):u<0},k.reflectY=function(e){return arguments.length?(h=e?-1:1,w()):h<0},k.fitExtent=function(e,t){return Vr(k,e,t)},k.fitSize=function(e,t){return qr(k,e,t)},k.fitWidth=function(e,t){return Wr(k,e,t)},k.fitHeight=function(e,t){return Hr(k,e,t)},k},e.geoInterpolate=function(e,t){var r=e[0]*p,n=e[1]*p,a=t[0]*p,i=t[1]*p,o=g(n),s=_(n),l=g(i),c=_(i),u=o*g(r),h=o*_(r),d=l*g(a),y=l*_(a),v=2*A(k(S(i-n)+o*l*S(a-r))),b=_(v),x=v?function(e){var t=_(e*=v)/b,r=_(v-e)/b,n=r*u+t*d,a=r*h+t*y,i=r*s+t*c;return[m(a,n)*f,m(i,k(n*n+a*a))*f]}:function(){return[r*f,n*f]};return x.distance=v,x},e.geoLength=St,e.geoMercator=function(){return un(cn).scale(961/u)},e.geoMercatorRaw=cn,e.geoNaturalEarth1=function(){return Jr(wn).scale(175.295)},e.geoNaturalEarth1Raw=wn,e.geoOrthographic=function(){return Jr(kn).scale(249.5).clipAngle(90+o)},e.geoOrthographicRaw=kn,e.geoPath=function(e,t){var r,n,a=4.5;function i(e){return e&&("function"==typeof a&&n.pointRadius(+a.apply(this,arguments)),P(e,r(n))),n.result()}return i.area=function(e){return P(e,r(Yt)),Yt.result()},i.measure=function(e){return P(e,r(Rr)),Rr.result()},i.bounds=function(e){return P(e,r(lr)),lr.result()},i.centroid=function(e){return P(e,r(vr)),vr.result()},i.projection=function(t){return arguments.length?(r=null==t?(e=null,$t):(e=t).stream,i):e},i.context=function(e){return arguments.length?(n=null==e?(t=null,new Br):new Mr(t=e),"function"!=typeof a&&n.pointRadius(a),i):t},i.pointRadius=function(e){return arguments.length?(a="function"==typeof e?e:(n.pointRadius(+e),+e),i):a},i.projection(e).context(t)},e.geoProjection=Jr,e.geoProjectionMutator=Qr,e.geoRotation=rt,e.geoStereographic=function(){return Jr(Dn).scale(250).clipAngle(142)},e.geoStereographicRaw=Dn,e.geoStream=P,e.geoTransform=function(e){return{stream:jr(e)}},e.geoTransverseMercator=function(){var e=un(Tn),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)},e.geoTransverseMercatorRaw=Tn,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof r&&void 0!==t?a(r,e("d3-array")):a((n=n||self).d3=n.d3||{},n.d3)},{"d3-array":107}],115:[function(e,t,r){!function(e,n){!function(e){"use strict";function t(e,t){return e.parent===t.parent?1:2}function r(e,t){return e+t.x}function n(e,t){return Math.max(e,t.y)}function a(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 i(e,t){var r,n,a,i,s,u=new c(e),f=+e.value&&(u.value=e.value),p=[u];for(null==t&&(t=o);r=p.pop();)if(f&&(r.value=+r.data.value),(a=t(r.data))&&(s=a.length))for(r.children=new Array(s),i=s-1;i>=0;--i)p.push(n=r.children[i]=new c(a[i])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(e){return e.children}function s(e){e.data=e.data.data}function l(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function c(e){this.data=e,this.depth=this.height=0,this.parent=null}c.prototype=i.prototype={constructor:c,count:function(){return this.eachAfter(a)},each:function(e){var t,r,n,a,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(e(i),r=i.children)for(n=0,a=r.length;n<a;++n)o.push(r[n])}while(o.length);return this},eachAfter:function(e){for(var t,r,n,a=this,i=[a],o=[];a=i.pop();)if(o.push(a),t=a.children)for(r=0,n=t.length;r<n;++r)i.push(t[r]);for(;a=o.pop();)e(a);return this},eachBefore:function(e){for(var t,r,n=this,a=[n];n=a.pop();)if(e(n),t=n.children)for(r=t.length-1;r>=0;--r)a.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,a=n&&n.length;--a>=0;)r+=n[a].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(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),a=null;for(e=r.pop(),t=n.pop();e===t;)a=e,e=r.pop(),t=n.pop();return a}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var a=n.length;e!==r;)n.splice(a,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(){return i(this).eachBefore(s)}};var u=Array.prototype.slice;function f(e){for(var t,r,n=0,a=(e=function(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}(u.call(e))).length,i=[];n<a;)t=e[n],r&&d(r,t)?++n:(r=g(i=p(i,t)),n=0);return r}function p(e,t){var r,n;if(m(t,e))return[t];for(r=0;r<e.length;++r)if(h(t,e[r])&&m(y(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(h(y(e[r],e[n]),t)&&h(y(e[r],t),e[n])&&h(y(e[n],t),e[r])&&m(v(e[r],e[n],t),e))return[e[r],e[n],t];throw new Error}function h(e,t){var r=e.r-t.r,n=t.x-e.x,a=t.y-e.y;return r<0||r*r<n*n+a*a}function d(e,t){var r=e.r-t.r+1e-6,n=t.x-e.x,a=t.y-e.y;return r>0&&r*r>n*n+a*a}function m(e,t){for(var r=0;r<t.length;++r)if(!d(e,t[r]))return!1;return!0}function g(e){switch(e.length){case 1:return{x:(t=e[0]).x,y:t.y,r:t.r};case 2:return y(e[0],e[1]);case 3:return v(e[0],e[1],e[2])}var t}function y(e,t){var r=e.x,n=e.y,a=e.r,i=t.x,o=t.y,s=t.r,l=i-r,c=o-n,u=s-a,f=Math.sqrt(l*l+c*c);return{x:(r+i+l/f*u)/2,y:(n+o+c/f*u)/2,r:(f+a+s)/2}}function v(e,t,r){var n=e.x,a=e.y,i=e.r,o=t.x,s=t.y,l=t.r,c=r.x,u=r.y,f=r.r,p=n-o,h=n-c,d=a-s,m=a-u,g=l-i,y=f-i,v=n*n+a*a-i*i,b=v-o*o-s*s+l*l,x=v-c*c-u*u+f*f,_=h*d-p*m,w=(d*x-m*b)/(2*_)-n,k=(m*g-d*y)/_,D=(h*b-p*x)/(2*_)-a,T=(p*y-h*g)/_,A=k*k+T*T-1,S=2*(i+w*k+D*T),M=w*w+D*D-i*i,E=-(A?(S+Math.sqrt(S*S-4*A*M))/(2*A):M/S);return{x:n+w+k*E,y:a+D+T*E,r:E}}function b(e,t,r){var n,a,i,o,s=e.x-t.x,l=e.y-t.y,c=s*s+l*l;c?(a=t.r+r.r,a*=a,o=e.r+r.r,a>(o*=o)?(n=(c+o-a)/(2*c),i=Math.sqrt(Math.max(0,o/c-n*n)),r.x=e.x-n*s-i*l,r.y=e.y-n*l+i*s):(n=(c+a-o)/(2*c),i=Math.sqrt(Math.max(0,a/c-n*n)),r.x=t.x+n*s-i*l,r.y=t.y+n*l+i*s)):(r.x=t.x+r.r,r.y=t.y)}function x(e,t){var r=e.r+t.r-1e-6,n=t.x-e.x,a=t.y-e.y;return r>0&&r*r>n*n+a*a}function _(e){var t=e._,r=e.next._,n=t.r+r.r,a=(t.x*r.r+r.x*t.r)/n,i=(t.y*r.r+r.y*t.r)/n;return a*a+i*i}function w(e){this._=e,this.next=null,this.previous=null}function k(e){if(!(a=e.length))return 0;var t,r,n,a,i,o,s,l,c,u,p;if((t=e[0]).x=0,t.y=0,!(a>1))return t.r;if(r=e[1],t.x=-r.r,r.x=t.r,r.y=0,!(a>2))return t.r+r.r;b(r,t,n=e[2]),t=new w(t),r=new w(r),n=new w(n),t.next=n.previous=r,r.next=t.previous=n,n.next=r.previous=t;e:for(s=3;s<a;++s){b(t._,r._,n=e[s]),n=new w(n),l=r.next,c=t.previous,u=r._.r,p=t._.r;do{if(u<=p){if(x(l._,n._)){r=l,t.next=r,r.previous=t,--s;continue e}u+=l._.r,l=l.next}else{if(x(c._,n._)){(t=c).next=r,r.previous=t,--s;continue e}p+=c._.r,c=c.previous}}while(l!==c.next);for(n.previous=t,n.next=r,t.next=r.previous=r=n,i=_(t);(n=n.next)!==r;)(o=_(n))<i&&(t=n,i=o);r=t.next}for(t=[r._],n=r;(n=n.next)!==r;)t.push(n._);for(n=f(t),s=0;s<a;++s)(t=e[s]).x-=n.x,t.y-=n.y;return n.r}function D(e){return null==e?null:T(e)}function T(e){if("function"!=typeof e)throw new Error;return e}function A(){return 0}function S(e){return function(){return e}}function M(e){return Math.sqrt(e.value)}function E(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function C(e,t){return function(r){if(n=r.children){var n,a,i,o=n.length,s=e(r)*t||0;if(s)for(a=0;a<o;++a)n[a].r+=s;if(i=k(n),s)for(a=0;a<o;++a)n[a].r-=s;r.r=i+s}}}function N(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)}}function O(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)}function I(e,t,r,n,a){for(var i,o=e.children,s=-1,l=o.length,c=e.value&&(n-t)/e.value;++s<l;)(i=o[s]).y0=r,i.y1=a,i.x0=t,i.x1=t+=i.value*c}var P={depth:-1},R={};function L(e){return e.id}function F(e){return e.parentId}function B(e,t){return e.parent===t.parent?1:2}function z(e){var t=e.children;return t?t[0]:e.t}function j(e){var t=e.children;return t?t[t.length-1]:e.t}function U(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 $(e,t,r){return e.a.parent===t.parent?e.a:r}function V(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function q(e,t,r,n,a){for(var i,o=e.children,s=-1,l=o.length,c=e.value&&(a-r)/e.value;++s<l;)(i=o[s]).x0=t,i.x1=n,i.y0=r,i.y1=r+=i.value*c}V.prototype=Object.create(c.prototype);var W=(1+Math.sqrt(5))/2;function H(e,t,r,n,a,i){for(var o,s,l,c,u,f,p,h,d,m,g,y=[],v=t.children,b=0,x=0,_=v.length,w=t.value;b<_;){l=a-r,c=i-n;do{u=v[x++].value}while(!u&&x<_);for(f=p=u,g=u*u*(m=Math.max(c/l,l/c)/(w*e)),d=Math.max(p/g,g/f);x<_;++x){if(u+=s=v[x].value,s<f&&(f=s),s>p&&(p=s),g=u*u*m,(h=Math.max(p/g,g/f))>d){u-=s;break}d=h}y.push(o={value:u,dice:l<c,children:v.slice(b,x)}),o.dice?I(o,r,n,a,w?n+=c*u/w:i):q(o,r,n,w?r+=l*u/w:a,i),w-=u,b=x}return y}var G=function e(t){function r(e,r,n,a,i){H(t,e,r,n,a,i)}return r.ratio=function(t){return e((t=+t)>1?t:1)},r}(W),X=function e(t){function r(e,r,n,a,i){if((o=e._squarify)&&o.ratio===t)for(var o,s,l,c,u,f=-1,p=o.length,h=e.value;++f<p;){for(l=(s=o[f]).children,c=s.value=0,u=l.length;c<u;++c)s.value+=l[c].value;s.dice?I(s,r,n,a,n+=(i-n)*s.value/h):q(s,r,n,r+=(a-r)*s.value/h,i),h-=s.value}else e._squarify=o=H(t,e,r,n,a,i),o.ratio=t}return r.ratio=function(t){return e((t=+t)>1?t:1)},r}(W);e.cluster=function(){var e=t,a=1,i=1,o=!1;function s(t){var s,l=0;t.eachAfter((function(t){var a=t.children;a?(t.x=function(e){return e.reduce(r,0)/e.length}(a),t.y=function(e){return 1+e.reduce(n,0)}(a)):(t.x=s?l+=e(t,s):0,t.y=0,s=t)}));var c=function(e){for(var t;t=e.children;)e=t[0];return e}(t),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(t),f=c.x-e(c,u)/2,p=u.x+e(u,c)/2;return t.eachAfter(o?function(e){e.x=(e.x-t.x)*a,e.y=(t.y-e.y)*i}:function(e){e.x=(e.x-f)/(p-f)*a,e.y=(1-(t.y?e.y/t.y:1))*i})}return s.separation=function(t){return arguments.length?(e=t,s):e},s.size=function(e){return arguments.length?(o=!1,a=+e[0],i=+e[1],s):o?null:[a,i]},s.nodeSize=function(e){return arguments.length?(o=!0,a=+e[0],i=+e[1],s):o?[a,i]:null},s},e.hierarchy=i,e.pack=function(){var e=null,t=1,r=1,n=A;function a(a){return a.x=t/2,a.y=r/2,e?a.eachBefore(E(e)).eachAfter(C(n,.5)).eachBefore(N(1)):a.eachBefore(E(M)).eachAfter(C(A,1)).eachAfter(C(n,a.r/Math.min(t,r))).eachBefore(N(Math.min(t,r)/(2*a.r))),a}return a.radius=function(t){return arguments.length?(e=D(t),a):e},a.size=function(e){return arguments.length?(t=+e[0],r=+e[1],a):[t,r]},a.padding=function(e){return arguments.length?(n="function"==typeof e?e:S(+e),a):n},a},e.packEnclose=f,e.packSiblings=function(e){return k(e),e},e.partition=function(){var e=1,t=1,r=0,n=!1;function a(a){var i=a.height+1;return a.x0=a.y0=r,a.x1=e,a.y1=t/i,a.eachBefore(function(e,t){return function(n){n.children&&I(n,n.x0,e*(n.depth+1)/t,n.x1,e*(n.depth+2)/t);var a=n.x0,i=n.y0,o=n.x1-r,s=n.y1-r;o<a&&(a=o=(a+o)/2),s<i&&(i=s=(i+s)/2),n.x0=a,n.y0=i,n.x1=o,n.y1=s}}(t,i)),n&&a.eachBefore(O),a}return a.round=function(e){return arguments.length?(n=!!e,a):n},a.size=function(r){return arguments.length?(e=+r[0],t=+r[1],a):[e,t]},a.padding=function(e){return arguments.length?(r=+e,a):r},a},e.stratify=function(){var e=L,t=F;function r(r){var n,a,i,o,s,u,f,p=r.length,h=new Array(p),d={};for(a=0;a<p;++a)n=r[a],s=h[a]=new c(n),null!=(u=e(n,a,r))&&(u+="")&&(d[f="$"+(s.id=u)]=f in d?R:s);for(a=0;a<p;++a)if(s=h[a],null!=(u=t(r[a],a,r))&&(u+="")){if(!(o=d["$"+u]))throw new Error("missing: "+u);if(o===R)throw new Error("ambiguous: "+u);o.children?o.children.push(s):o.children=[s],s.parent=o}else{if(i)throw new Error("multiple roots");i=s}if(!i)throw new Error("no root");if(i.parent=P,i.eachBefore((function(e){e.depth=e.parent.depth+1,--p})).eachBefore(l),i.parent=null,p>0)throw new Error("cycle");return i}return r.id=function(t){return arguments.length?(e=T(t),r):e},r.parentId=function(e){return arguments.length?(t=T(e),r):t},r},e.tree=function(){var e=B,t=1,r=1,n=null;function a(a){var l=function(e){for(var t,r,n,a,i,o=new V(e,0),s=[o];t=s.pop();)if(n=t._.children)for(t.children=new Array(i=n.length),a=i-1;a>=0;--a)s.push(r=t.children[a]=new V(n[a],a)),r.parent=t;return(o.parent=new V(null,0)).children=[o],o}(a);if(l.eachAfter(i),l.parent.m=-l.z,l.eachBefore(o),n)a.eachBefore(s);else{var c=a,u=a,f=a;a.eachBefore((function(e){e.x<c.x&&(c=e),e.x>u.x&&(u=e),e.depth>f.depth&&(f=e)}));var p=c===u?1:e(c,u)/2,h=p-c.x,d=t/(u.x+p+h),m=r/(f.depth||1);a.eachBefore((function(e){e.x=(e.x+h)*d,e.y=e.depth*m}))}return a}function i(t){var r=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,a=e.children,i=a.length;--i>=0;)(t=a[i]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var i=(r[0].z+r[r.length-1].z)/2;a?(t.z=a.z+e(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+e(t._,a._));t.parent.A=function(t,r,n){if(r){for(var a,i=t,o=t,s=r,l=i.parent.children[0],c=i.m,u=o.m,f=s.m,p=l.m;s=j(s),i=z(i),s&&i;)l=z(l),(o=j(o)).a=t,(a=s.z+f-i.z-c+e(s._,i._))>0&&(U($(s,t,n),t,a),c+=a,u+=a),f+=s.m,c+=i.m,p+=l.m,u+=o.m;s&&!j(o)&&(o.t=s,o.m+=f-u),i&&!z(l)&&(l.t=i,l.m+=c-p,n=t)}return n}(t,a,t.parent.A||n[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return a.separation=function(t){return arguments.length?(e=t,a):e},a.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],a):n?null:[t,r]},a.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],a):n?[t,r]:null},a},e.treemap=function(){var e=G,t=!1,r=1,n=1,a=[0],i=A,o=A,s=A,l=A,c=A;function u(e){return e.x0=e.y0=0,e.x1=r,e.y1=n,e.eachBefore(f),a=[0],t&&e.eachBefore(O),e}function f(t){var r=a[t.depth],n=t.x0+r,u=t.y0+r,f=t.x1-r,p=t.y1-r;f<n&&(n=f=(n+f)/2),p<u&&(u=p=(u+p)/2),t.x0=n,t.y0=u,t.x1=f,t.y1=p,t.children&&(r=a[t.depth+1]=i(t)/2,n+=c(t)-r,u+=o(t)-r,(f-=s(t)-r)<n&&(n=f=(n+f)/2),(p-=l(t)-r)<u&&(u=p=(u+p)/2),e(t,n,u,f,p))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(r=+e[0],n=+e[1],u):[r,n]},u.tile=function(t){return arguments.length?(e=T(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(i="function"==typeof e?e:S(+e),u):i},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o="function"==typeof e?e:S(+e),u):o},u.paddingRight=function(e){return arguments.length?(s="function"==typeof e?e:S(+e),u):s},u.paddingBottom=function(e){return arguments.length?(l="function"==typeof e?e:S(+e),u):l},u.paddingLeft=function(e){return arguments.length?(c="function"==typeof e?e:S(+e),u):c},u},e.treemapBinary=function(e,t,r,n,a){var i,o,s=e.children,l=s.length,c=new Array(l+1);for(c[0]=o=i=0;i<l;++i)c[i+1]=o+=s[i].value;!function e(t,r,n,a,i,o,l){if(t>=r-1){var u=s[t];return u.x0=a,u.y0=i,u.x1=o,void(u.y1=l)}for(var f=c[t],p=n/2+f,h=t+1,d=r-1;h<d;){var m=h+d>>>1;c[m]<p?h=m+1:d=m}p-c[h-1]<c[h]-p&&t+1<h&&--h;var g=c[h]-f,y=n-g;if(o-a>l-i){var v=(a*y+o*g)/n;e(t,h,g,a,i,v,l),e(h,r,y,v,i,o,l)}else{var b=(i*y+l*g)/n;e(t,h,g,a,i,o,b),e(h,r,y,a,b,o,l)}}(0,l,e.value,t,r,n,a)},e.treemapDice=I,e.treemapResquarify=X,e.treemapSlice=q,e.treemapSliceDice=function(e,t,r,n,a){(1&e.depth?q:I)(e,t,r,n,a)},e.treemapSquarify=G,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:(e=e||self).d3=e.d3||{})}(this)},{}],116:[function(e,t,r){var n,a;n=this,a=function(e,t){"use strict";function r(e,t,r,n,a){var i=e*e,o=i*e;return((1-3*e+3*i-o)*t+(4-6*i+3*o)*r+(1+3*e+3*i-3*o)*n+o*a)/6}function n(e){var t=e.length-1;return function(n){var a=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[a],o=e[a+1],s=a>0?e[a-1]:2*i-o,l=a<t-1?e[a+2]:2*o-i;return r((n-a/t)*t,s,i,o,l)}}function a(e){var t=e.length;return function(n){var a=Math.floor(((n%=1)<0?++n:n)*t),i=e[(a+t-1)%t],o=e[a%t],s=e[(a+1)%t],l=e[(a+2)%t];return r((n-a/t)*t,i,o,s,l)}}function i(e){return function(){return e}}function o(e,t){return function(r){return e+r*t}}function s(e,t){var r=t-e;return r?o(e,r>180||r<-180?r-360*Math.round(r/360):r):i(isNaN(e)?t:e)}function l(e,t){var r=t-e;return r?o(e,r):i(isNaN(e)?t:e)}var c=function e(r){var n=function(e){return 1==(e=+e)?l:function(t,r){return r-t?function(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):i(isNaN(t)?r:t)}}(r);function a(e,r){var a=n((e=t.rgb(e)).r,(r=t.rgb(r)).r),i=n(e.g,r.g),o=n(e.b,r.b),s=l(e.opacity,r.opacity);return function(t){return e.r=a(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return a.gamma=e,a}(1);function u(e){return function(r){var n,a,i=r.length,o=new Array(i),s=new Array(i),l=new Array(i);for(n=0;n<i;++n)a=t.rgb(r[n]),o[n]=a.r||0,s[n]=a.g||0,l[n]=a.b||0;return o=e(o),s=e(s),l=e(l),a.opacity=1,function(e){return a.r=o(e),a.g=s(e),a.b=l(e),a+""}}}var f=u(n),p=u(a);function h(e,t){t||(t=[]);var r,n=e?Math.min(t.length,e.length):0,a=t.slice();return function(i){for(r=0;r<n;++r)a[r]=e[r]*(1-i)+t[r]*i;return a}}function d(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function m(e,t){var r,n=t?t.length:0,a=e?Math.min(n,e.length):0,i=new Array(a),o=new Array(n);for(r=0;r<a;++r)i[r]=w(e[r],t[r]);for(;r<n;++r)o[r]=t[r];return function(e){for(r=0;r<a;++r)o[r]=i[r](e);return o}}function g(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function y(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function v(e,t){var r,n={},a={};for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=w(e[r],t[r]):a[r]=t[r];return function(e){for(r in n)a[r]=n[r](e);return a}}var b=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,x=new RegExp(b.source,"g");function _(e,t){var r,n,a,i=b.lastIndex=x.lastIndex=0,o=-1,s=[],l=[];for(e+="",t+="";(r=b.exec(e))&&(n=x.exec(t));)(a=n.index)>i&&(a=t.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:y(r,n)})),i=x.lastIndex;return i<t.length&&(a=t.slice(i),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var r,n=0;n<t;++n)s[(r=l[n]).i]=r.x(e);return s.join("")})}function w(e,r){var n,a=typeof r;return null==r||"boolean"===a?i(r):("number"===a?y:"string"===a?(n=t.color(r))?(r=n,c):_:r instanceof t.color?c:r instanceof Date?g:d(r)?h:Array.isArray(r)?m:"function"!=typeof r.valueOf&&"function"!=typeof r.toString||isNaN(r)?v:y)(e,r)}var k,D,T,A,S=180/Math.PI,M={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function E(e,t,r,n,a,i){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),e*n<t*r&&(e=-e,t=-t,l=-l,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*S,skewX:Math.atan(l)*S,scaleX:o,scaleY:s}}function C(e,t,r,n){function a(e){return e.length?e.pop()+" ":""}return function(i,o){var s=[],l=[];return i=e(i),o=e(o),function(e,n,a,i,o,s){if(e!==a||n!==i){var l=o.push("translate(",null,t,null,r);s.push({i:l-4,x:y(e,a)},{i:l-2,x:y(n,i)})}else(a||i)&&o.push("translate("+a+t+i+r)}(i.translateX,i.translateY,o.translateX,o.translateY,s,l),function(e,t,r,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:r.push(a(r)+"rotate(",null,n)-2,x:y(e,t)})):t&&r.push(a(r)+"rotate("+t+n)}(i.rotate,o.rotate,s,l),function(e,t,r,i){e!==t?i.push({i:r.push(a(r)+"skewX(",null,n)-2,x:y(e,t)}):t&&r.push(a(r)+"skewX("+t+n)}(i.skewX,o.skewX,s,l),function(e,t,r,n,i,o){if(e!==r||t!==n){var s=i.push(a(i)+"scale(",null,",",null,")");o.push({i:s-4,x:y(e,r)},{i:s-2,x:y(t,n)})}else 1===r&&1===n||i.push(a(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,o.scaleX,o.scaleY,s,l),i=o=null,function(e){for(var t,r=-1,n=l.length;++r<n;)s[(t=l[r]).i]=t.x(e);return s.join("")}}}var N=C((function(e){return"none"===e?M:(k||(k=document.createElement("DIV"),D=document.documentElement,T=document.defaultView),k.style.transform=e,e=T.getComputedStyle(D.appendChild(k),null).getPropertyValue("transform"),D.removeChild(k),E(+(e=e.slice(7,-1).split(","))[0],+e[1],+e[2],+e[3],+e[4],+e[5]))}),"px, ","px)","deg)"),O=C((function(e){return null==e?M:(A||(A=document.createElementNS("http://www.w3.org/2000/svg","g")),A.setAttribute("transform",e),(e=A.transform.baseVal.consolidate())?E((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):M)}),", ",")",")"),I=Math.SQRT2;function P(e){return((e=Math.exp(e))+1/e)/2}function R(e){return function(r,n){var a=e((r=t.hsl(r)).h,(n=t.hsl(n)).h),i=l(r.s,n.s),o=l(r.l,n.l),s=l(r.opacity,n.opacity);return function(e){return r.h=a(e),r.s=i(e),r.l=o(e),r.opacity=s(e),r+""}}}var L=R(s),F=R(l);function B(e){return function(r,n){var a=e((r=t.hcl(r)).h,(n=t.hcl(n)).h),i=l(r.c,n.c),o=l(r.l,n.l),s=l(r.opacity,n.opacity);return function(e){return r.h=a(e),r.c=i(e),r.l=o(e),r.opacity=s(e),r+""}}}var z=B(s),j=B(l);function U(e){return function r(n){function a(r,a){var i=e((r=t.cubehelix(r)).h,(a=t.cubehelix(a)).h),o=l(r.s,a.s),s=l(r.l,a.l),c=l(r.opacity,a.opacity);return function(e){return r.h=i(e),r.s=o(e),r.l=s(Math.pow(e,n)),r.opacity=c(e),r+""}}return n=+n,a.gamma=r,a}(1)}var $=U(s),V=U(l);e.interpolate=w,e.interpolateArray=function(e,t){return(d(t)?h:m)(e,t)},e.interpolateBasis=n,e.interpolateBasisClosed=a,e.interpolateCubehelix=$,e.interpolateCubehelixLong=V,e.interpolateDate=g,e.interpolateDiscrete=function(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}},e.interpolateHcl=z,e.interpolateHclLong=j,e.interpolateHsl=L,e.interpolateHslLong=F,e.interpolateHue=function(e,t){var r=s(+e,+t);return function(e){var t=r(e);return t-360*Math.floor(t/360)}},e.interpolateLab=function(e,r){var n=l((e=t.lab(e)).l,(r=t.lab(r)).l),a=l(e.a,r.a),i=l(e.b,r.b),o=l(e.opacity,r.opacity);return function(t){return e.l=n(t),e.a=a(t),e.b=i(t),e.opacity=o(t),e+""}},e.interpolateNumber=y,e.interpolateNumberArray=h,e.interpolateObject=v,e.interpolateRgb=c,e.interpolateRgbBasis=f,e.interpolateRgbBasisClosed=p,e.interpolateRound=function(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}},e.interpolateString=_,e.interpolateTransformCss=N,e.interpolateTransformSvg=O,e.interpolateZoom=function(e,t){var r,n,a=e[0],i=e[1],o=e[2],s=t[0],l=t[1],c=t[2],u=s-a,f=l-i,p=u*u+f*f;if(p<1e-12)n=Math.log(c/o)/I,r=function(e){return[a+e*u,i+e*f,o*Math.exp(I*e*n)]};else{var h=Math.sqrt(p),d=(c*c-o*o+4*p)/(2*o*2*h),m=(c*c-o*o-4*p)/(2*c*2*h),g=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(m*m+1)-m);n=(y-g)/I,r=function(e){var t,r=e*n,s=P(g),l=o/(2*h)*(s*(t=I*r+g,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(g));return[a+l*u,i+l*f,o*s/P(I*r+g)]}}return r.duration=1e3*n,r},e.piecewise=function(e,t){for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return function(e){var t=Math.max(0,Math.min(n-1,Math.floor(e*=n)));return i[t](e-t)}},e.quantize=function(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e(n/(t-1));return r},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof r&&void 0!==t?a(r,e("d3-color")):a((n=n||self).d3=n.d3||{},n.d3)},{"d3-color":109}],117:[function(e,t,r){!function(e,n){!function(e){"use strict";var t=Math.PI,r=2*t,n=r-1e-6;function a(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function i(){return new a}a.prototype=i.prototype={constructor:a,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,a,i){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+a)+","+(this._y1=+i)},arcTo:function(e,r,n,a,i){e=+e,r=+r,n=+n,a=+a,i=+i;var o=this._x1,s=this._y1,l=n-e,c=a-r,u=o-e,f=s-r,p=u*u+f*f;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=r);else if(p>1e-6)if(Math.abs(f*l-c*u)>1e-6&&i){var h=n-o,d=a-s,m=l*l+c*c,g=h*h+d*d,y=Math.sqrt(m),v=Math.sqrt(p),b=i*Math.tan((t-Math.acos((m+p-g)/(2*y*v)))/2),x=b/v,_=b/y;Math.abs(x-1)>1e-6&&(this._+="L"+(e+x*u)+","+(r+x*f)),this._+="A"+i+","+i+",0,0,"+ +(f*h>u*d)+","+(this._x1=e+_*l)+","+(this._y1=r+_*c)}else this._+="L"+(this._x1=e)+","+(this._y1=r)},arc:function(e,a,i,o,s,l){e=+e,a=+a,l=!!l;var c=(i=+i)*Math.cos(o),u=i*Math.sin(o),f=e+c,p=a+u,h=1^l,d=l?o-s:s-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+f+","+p:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-p)>1e-6)&&(this._+="L"+f+","+p),i&&(d<0&&(d=d%r+r),d>n?this._+="A"+i+","+i+",0,1,"+h+","+(e-c)+","+(a-u)+"A"+i+","+i+",0,1,"+h+","+(this._x1=f)+","+(this._y1=p):d>1e-6&&(this._+="A"+i+","+i+",0,"+ +(d>=t)+","+h+","+(this._x1=e+i*Math.cos(s))+","+(this._y1=a+i*Math.sin(s))))},rect:function(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(){return this._}},e.path=i,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:(e=e||self).d3=e.d3||{})}(this)},{}],118:[function(e,t,r){!function(e,n){!function(e){"use strict";function t(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var a,i,o,s,l,c,u,f,p,h=e._root,d={data:n},m=e._x0,g=e._y0,y=e._x1,v=e._y1;if(!h)return e._root=d,e;for(;h.length;)if((c=t>=(i=(m+y)/2))?m=i:y=i,(u=r>=(o=(g+v)/2))?g=o:v=o,a=h,!(h=h[f=u<<1|c]))return a[f]=d,e;if(s=+e._x.call(null,h.data),l=+e._y.call(null,h.data),t===s&&r===l)return d.next=h,a?a[f]=d:e._root=d,e;do{a=a?a[f]=new Array(4):e._root=new Array(4),(c=t>=(i=(m+y)/2))?m=i:y=i,(u=r>=(o=(g+v)/2))?g=o:v=o}while((f=u<<1|c)==(p=(l>=o)<<1|s>=i));return a[p]=h,a[f]=d,e}function r(e,t,r,n,a){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=a}function n(e){return e[0]}function a(e){return e[1]}function i(e,t,r){var i=new o(null==t?n:t,null==r?a:r,NaN,NaN,NaN,NaN);return null==e?i:i.addAll(e)}function o(e,t,r,n,a,i){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=a,this._y1=i,this._root=void 0}function s(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var l=i.prototype=o.prototype;l.copy=function(){var e,t,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var a=0;a<4;++a)(t=n.source[a])&&(t.length?e.push({source:t,target:n.target[a]=new Array(4)}):n.target[a]=s(t));return r},l.add=function(e){var r=+this._x.call(null,e),n=+this._y.call(null,e);return t(this.cover(r,n),r,n,e)},l.addAll=function(e){var r,n,a,i,o=e.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-1/0,p=-1/0;for(n=0;n<o;++n)isNaN(a=+this._x.call(null,r=e[n]))||isNaN(i=+this._y.call(null,r))||(s[n]=a,l[n]=i,a<c&&(c=a),a>f&&(f=a),i<u&&(u=i),i>p&&(p=i));if(c>f||u>p)return this;for(this.cover(c,u).cover(f,p),n=0;n<o;++n)t(this,s[n],l[n],e[n]);return this},l.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,a=this._x1,i=this._y1;if(isNaN(r))a=(r=Math.floor(e))+1,i=(n=Math.floor(t))+1;else{for(var o,s,l=a-r,c=this._root;r>e||e>=a||n>t||t>=i;)switch(s=(t<n)<<1|e<r,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:a=r+l,i=n+l;break;case 1:r=a-l,i=n+l;break;case 2:a=r+l,n=i-l;break;case 3:r=a-l,n=i-l}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=a,this._y1=i,this},l.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},l.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]]},l.find=function(e,t,n){var a,i,o,s,l,c,u,f=this._x0,p=this._y0,h=this._x1,d=this._y1,m=[],g=this._root;for(g&&m.push(new r(g,f,p,h,d)),null==n?n=1/0:(f=e-n,p=t-n,h=e+n,d=t+n,n*=n);c=m.pop();)if(!(!(g=c.node)||(i=c.x0)>h||(o=c.y0)>d||(s=c.x1)<f||(l=c.y1)<p))if(g.length){var y=(i+s)/2,v=(o+l)/2;m.push(new r(g[3],y,v,s,l),new r(g[2],i,v,y,l),new r(g[1],y,o,s,v),new r(g[0],i,o,y,v)),(u=(t>=v)<<1|e>=y)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var b=e-+this._x.call(null,g.data),x=t-+this._y.call(null,g.data),_=b*b+x*x;if(_<n){var w=Math.sqrt(n=_);f=e-w,p=t-w,h=e+w,d=t+w,a=g.data}}return a},l.remove=function(e){if(isNaN(i=+this._x.call(null,e))||isNaN(o=+this._y.call(null,e)))return this;var t,r,n,a,i,o,s,l,c,u,f,p,h=this._root,d=this._x0,m=this._y0,g=this._x1,y=this._y1;if(!h)return this;if(h.length)for(;;){if((c=i>=(s=(d+g)/2))?d=s:g=s,(u=o>=(l=(m+y)/2))?m=l:y=l,t=h,!(h=h[f=u<<1|c]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(r=t,p=f)}for(;h.data!==e;)if(n=h,!(h=h.next))return this;return(a=h.next)&&delete h.next,n?(a?n.next=a:delete n.next,this):t?(a?t[f]=a: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[p]=h:this._root=h),this):(this._root=a,this)},l.removeAll=function(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this},l.root=function(){return this._root},l.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},l.visit=function(e){var t,n,a,i,o,s,l=[],c=this._root;for(c&&l.push(new r(c,this._x0,this._y0,this._x1,this._y1));t=l.pop();)if(!e(c=t.node,a=t.x0,i=t.y0,o=t.x1,s=t.y1)&&c.length){var u=(a+o)/2,f=(i+s)/2;(n=c[3])&&l.push(new r(n,u,f,o,s)),(n=c[2])&&l.push(new r(n,a,f,u,s)),(n=c[1])&&l.push(new r(n,u,i,o,f)),(n=c[0])&&l.push(new r(n,a,i,u,f))}return this},l.visitAfter=function(e){var t,n=[],a=[];for(this._root&&n.push(new r(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var i=t.node;if(i.length){var o,s=t.x0,l=t.y0,c=t.x1,u=t.y1,f=(s+c)/2,p=(l+u)/2;(o=i[0])&&n.push(new r(o,s,l,f,p)),(o=i[1])&&n.push(new r(o,f,l,c,p)),(o=i[2])&&n.push(new r(o,s,p,f,u)),(o=i[3])&&n.push(new r(o,f,p,c,u))}a.push(t)}for(;t=a.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},l.x=function(e){return arguments.length?(this._x=e,this):this._x},l.y=function(e){return arguments.length?(this._y=e,this):this._y},e.quadtree=i,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:(e=e||self).d3=e.d3||{})}(this)},{}],119:[function(e,t,r){var n,a;n=this,a=function(e,t){"use strict";function r(e){return function(){return e}}var n=Math.abs,a=Math.atan2,i=Math.cos,o=Math.max,s=Math.min,l=Math.sin,c=Math.sqrt,u=Math.PI,f=u/2,p=2*u;function h(e){return e>1?0:e<-1?u:Math.acos(e)}function d(e){return e>=1?f:e<=-1?-f:Math.asin(e)}function m(e){return e.innerRadius}function g(e){return e.outerRadius}function y(e){return e.startAngle}function v(e){return e.endAngle}function b(e){return e&&e.padAngle}function x(e,t,r,n,a,i,o,s){var l=r-e,c=n-t,u=o-a,f=s-i,p=f*l-u*c;if(!(p*p<1e-12))return[e+(p=(u*(t-i)-f*(e-a))/p)*l,t+p*c]}function _(e,t,r,n,a,i,s){var l=e-r,u=t-n,f=(s?i:-i)/c(l*l+u*u),p=f*u,h=-f*l,d=e+p,m=t+h,g=r+p,y=n+h,v=(d+g)/2,b=(m+y)/2,x=g-d,_=y-m,w=x*x+_*_,k=a-i,D=d*y-g*m,T=(_<0?-1:1)*c(o(0,k*k*w-D*D)),A=(D*_-x*T)/w,S=(-D*x-_*T)/w,M=(D*_+x*T)/w,E=(-D*x+_*T)/w,C=A-v,N=S-b,O=M-v,I=E-b;return C*C+N*N>O*O+I*I&&(A=M,S=E),{cx:A,cy:S,x01:-p,y01:-h,x11:A*(a/k-1),y11:S*(a/k-1)}}function w(e){this._context=e}function k(e){return new w(e)}function D(e){return e[0]}function T(e){return e[1]}function A(){var e=D,n=T,a=r(!0),i=null,o=k,s=null;function l(r){var l,c,u,f=r.length,p=!1;for(null==i&&(s=o(u=t.path())),l=0;l<=f;++l)!(l<f&&a(c=r[l],l,r))===p&&((p=!p)?s.lineStart():s.lineEnd()),p&&s.point(+e(c,l,r),+n(c,l,r));if(u)return s=null,u+""||null}return l.x=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),l):e},l.y=function(e){return arguments.length?(n="function"==typeof e?e:r(+e),l):n},l.defined=function(e){return arguments.length?(a="function"==typeof e?e:r(!!e),l):a},l.curve=function(e){return arguments.length?(o=e,null!=i&&(s=o(i)),l):o},l.context=function(e){return arguments.length?(null==e?i=s=null:s=o(i=e),l):i},l}function S(){var e=D,n=null,a=r(0),i=T,o=r(!0),s=null,l=k,c=null;function u(r){var u,f,p,h,d,m=r.length,g=!1,y=new Array(m),v=new Array(m);for(null==s&&(c=l(d=t.path())),u=0;u<=m;++u){if(!(u<m&&o(h=r[u],u,r))===g)if(g=!g)f=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),p=u-1;p>=f;--p)c.point(y[p],v[p]);c.lineEnd(),c.areaEnd()}g&&(y[u]=+e(h,u,r),v[u]=+a(h,u,r),c.point(n?+n(h,u,r):y[u],i?+i(h,u,r):v[u]))}if(d)return c=null,d+""||null}function f(){return A().defined(o).curve(l).context(s)}return u.x=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),n=null,u):e},u.x0=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),u):e},u.x1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:r(+e),u):n},u.y=function(e){return arguments.length?(a="function"==typeof e?e:r(+e),i=null,u):a},u.y0=function(e){return arguments.length?(a="function"==typeof e?e:r(+e),u):a},u.y1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:r(+e),u):i},u.lineX0=u.lineY0=function(){return f().x(e).y(a)},u.lineY1=function(){return f().x(e).y(i)},u.lineX1=function(){return f().x(n).y(a)},u.defined=function(e){return arguments.length?(o="function"==typeof e?e:r(!!e),u):o},u.curve=function(e){return arguments.length?(l=e,null!=s&&(c=l(s)),u):l},u.context=function(e){return arguments.length?(null==e?s=c=null:c=l(s=e),u):s},u}function M(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function E(e){return e}w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(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 C=O(k);function N(e){this._curve=e}function O(e){function t(t){return new N(e(t))}return t._curve=e,t}function I(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t(O(e)):t()._curve},e}function P(){return I(A().curve(C))}function R(){var e=S().curve(C),t=e.curve,r=e.lineX0,n=e.lineX1,a=e.lineY0,i=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return I(r())},delete e.lineX0,e.lineEndAngle=function(){return I(n())},delete e.lineX1,e.lineInnerRadius=function(){return I(a())},delete e.lineY0,e.lineOuterRadius=function(){return I(i())},delete e.lineY1,e.curve=function(e){return arguments.length?t(O(e)):t()._curve},e}function L(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}N.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};var F=Array.prototype.slice;function B(e){return e.source}function z(e){return e.target}function j(e){var n=B,a=z,i=D,o=T,s=null;function l(){var r,l=F.call(arguments),c=n.apply(this,l),u=a.apply(this,l);if(s||(s=r=t.path()),e(s,+i.apply(this,(l[0]=c,l)),+o.apply(this,l),+i.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(e){return arguments.length?(n=e,l):n},l.target=function(e){return arguments.length?(a=e,l):a},l.x=function(e){return arguments.length?(i="function"==typeof e?e:r(+e),l):i},l.y=function(e){return arguments.length?(o="function"==typeof e?e:r(+e),l):o},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function U(e,t,r,n,a){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,a,n,a)}function $(e,t,r,n,a){e.moveTo(t,r),e.bezierCurveTo(t,r=(r+a)/2,n,r,n,a)}function V(e,t,r,n,a){var i=L(t,r),o=L(t,r=(r+a)/2),s=L(n,r),l=L(n,a);e.moveTo(i[0],i[1]),e.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var q={draw:function(e,t){var r=Math.sqrt(t/u);e.moveTo(r,0),e.arc(0,0,r,0,p)}},W={draw:function(e,t){var r=Math.sqrt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},H=Math.sqrt(1/3),G=2*H,X={draw:function(e,t){var r=Math.sqrt(t/G),n=r*H;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Y=Math.sin(u/10)/Math.sin(7*u/10),Z=Math.sin(p/10)*Y,K=-Math.cos(p/10)*Y,J={draw:function(e,t){var r=Math.sqrt(.8908130915292852*t),n=Z*r,a=K*r;e.moveTo(0,-r),e.lineTo(n,a);for(var i=1;i<5;++i){var o=p*i/5,s=Math.cos(o),l=Math.sin(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*a,l*n+s*a)}e.closePath()}},Q={draw:function(e,t){var r=Math.sqrt(t),n=-r/2;e.rect(n,n,r,r)}},ee=Math.sqrt(3),te={draw:function(e,t){var r=-Math.sqrt(t/(3*ee));e.moveTo(0,2*r),e.lineTo(-ee*r,-r),e.lineTo(ee*r,-r),e.closePath()}},re=-.5,ne=Math.sqrt(3)/2,ae=1/Math.sqrt(12),ie=3*(ae/2+1),oe={draw:function(e,t){var r=Math.sqrt(t/ie),n=r/2,a=r*ae,i=n,o=r*ae+r,s=-i,l=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(s,l),e.lineTo(re*n-ne*a,ne*n+re*a),e.lineTo(re*i-ne*o,ne*i+re*o),e.lineTo(re*s-ne*l,ne*s+re*l),e.lineTo(re*n+ne*a,re*a-ne*n),e.lineTo(re*i+ne*o,re*o-ne*i),e.lineTo(re*s+ne*l,re*l-ne*s),e.closePath()}},se=[q,W,X,Q,J,te,oe];function le(){}function ce(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 ue(e){this._context=e}function fe(e){this._context=e}function pe(e){this._context=e}function he(e,t){this._basis=new ue(e),this._beta=t}ue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ce(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(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:ce(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},fe.prototype={areaStart:le,areaEnd:le,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(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:ce(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},pe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(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:ce(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},he.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n,a=e[0],i=t[0],o=e[r]-a,s=t[r]-i,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(a+n*o),this._beta*t[l]+(1-this._beta)*(i+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var de=function e(t){function r(e){return 1===t?new ue(e):new he(e,t)}return r.beta=function(t){return e(+t)},r}(.85);function me(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 ge(e,t){this._context=e,this._k=(1-t)/6}ge.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:me(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:me(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 ye=function e(t){function r(e){return new ge(e,t)}return r.tension=function(t){return e(+t)},r}(0);function ve(e,t){this._context=e,this._k=(1-t)/6}ve.prototype={areaStart:le,areaEnd:le,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:me(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 be=function e(t){function r(e){return new ve(e,t)}return r.tension=function(t){return e(+t)},r}(0);function xe(e,t){this._context=e,this._k=(1-t)/6}xe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:me(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 _e=function e(t){function r(e){return new xe(e,t)}return r.tension=function(t){return e(+t)},r}(0);function we(e,t,r){var n=e._x1,a=e._y1,i=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,a=(a*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>1e-12){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);i=(i*c+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*c+e._y1*e._l23_2a-r*e._l12_2a)/u}e._context.bezierCurveTo(n,a,i,o,e._x2,e._y2)}function ke(e,t){this._context=e,this._alpha=t}ke.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var 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:we(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 De=function e(t){function r(e){return t?new ke(e,t):new ge(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function Te(e,t){this._context=e,this._alpha=t}Te.prototype={areaStart:le,areaEnd:le,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var 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:we(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 Ae=function e(t){function r(e){return t?new Te(e,t):new ve(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function Se(e,t){this._context=e,this._alpha=t}Se.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var 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:we(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 Me=function e(t){function r(e){return t?new Se(e,t):new xe(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function Ee(e){this._context=e}function Ce(e){return e<0?-1:1}function Ne(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),s=(i*a+o*n)/(n+a);return(Ce(i)+Ce(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function Oe(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ie(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,s=(i-n)/3;e._context.bezierCurveTo(n+s,a+s*t,i-s,o-s*r,i,o)}function Pe(e){this._context=e}function Re(e){this._context=new Le(e)}function Le(e){this._context=e}function Fe(e){this._context=e}function Be(e){var t,r,n=e.length-1,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/i[t-1],i[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function ze(e,t){this._context=e,this._t=t}function je(e,t){if((a=e.length)>1)for(var r,n,a,i=1,o=e[t[0]],s=o.length;i<a;++i)for(n=o,o=e[t[i]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}function Ue(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function $e(e,t){return e[t]}function Ve(e){var t=e.map(qe);return Ue(e).sort((function(e,r){return t[e]-t[r]}))}function qe(e){for(var t,r=-1,n=0,a=e.length,i=-1/0;++r<a;)(t=+e[r][1])>i&&(i=t,n=r);return n}function We(e){var t=e.map(He);return Ue(e).sort((function(e,r){return t[e]-t[r]}))}function He(e){for(var t,r=0,n=-1,a=e.length;++n<a;)(t=+e[n][1])&&(r+=t);return r}Ee.prototype={areaStart:le,areaEnd:le,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},Pe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ie(this,this._t0,Oe(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(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,Ie(this,Oe(this,r=Ne(this,e,t)),r);break;default:Ie(this,this._t0,r=Ne(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}},(Re.prototype=Object.create(Pe.prototype)).point=function(e,t){Pe.prototype.point.call(this,t,e)},Le.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}},Fe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){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=Be(e),a=Be(t),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],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(e,t){this._x.push(+e),this._y.push(+t)}},ze.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){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(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}},e.arc=function(){var e=m,o=g,w=r(0),k=null,D=y,T=v,A=b,S=null;function M(){var r,m,g=+e.apply(this,arguments),y=+o.apply(this,arguments),v=D.apply(this,arguments)-f,b=T.apply(this,arguments)-f,M=n(b-v),E=b>v;if(S||(S=r=t.path()),y<g&&(m=y,y=g,g=m),y>1e-12)if(M>p-1e-12)S.moveTo(y*i(v),y*l(v)),S.arc(0,0,y,v,b,!E),g>1e-12&&(S.moveTo(g*i(b),g*l(b)),S.arc(0,0,g,b,v,E));else{var C,N,O=v,I=b,P=v,R=b,L=M,F=M,B=A.apply(this,arguments)/2,z=B>1e-12&&(k?+k.apply(this,arguments):c(g*g+y*y)),j=s(n(y-g)/2,+w.apply(this,arguments)),U=j,$=j;if(z>1e-12){var V=d(z/g*l(B)),q=d(z/y*l(B));(L-=2*V)>1e-12?(P+=V*=E?1:-1,R-=V):(L=0,P=R=(v+b)/2),(F-=2*q)>1e-12?(O+=q*=E?1:-1,I-=q):(F=0,O=I=(v+b)/2)}var W=y*i(O),H=y*l(O),G=g*i(R),X=g*l(R);if(j>1e-12){var Y,Z=y*i(I),K=y*l(I),J=g*i(P),Q=g*l(P);if(M<u&&(Y=x(W,H,J,Q,Z,K,G,X))){var ee=W-Y[0],te=H-Y[1],re=Z-Y[0],ne=K-Y[1],ae=1/l(h((ee*re+te*ne)/(c(ee*ee+te*te)*c(re*re+ne*ne)))/2),ie=c(Y[0]*Y[0]+Y[1]*Y[1]);U=s(j,(g-ie)/(ae-1)),$=s(j,(y-ie)/(ae+1))}}F>1e-12?$>1e-12?(C=_(J,Q,W,H,y,$,E),N=_(Z,K,G,X,y,$,E),S.moveTo(C.cx+C.x01,C.cy+C.y01),$<j?S.arc(C.cx,C.cy,$,a(C.y01,C.x01),a(N.y01,N.x01),!E):(S.arc(C.cx,C.cy,$,a(C.y01,C.x01),a(C.y11,C.x11),!E),S.arc(0,0,y,a(C.cy+C.y11,C.cx+C.x11),a(N.cy+N.y11,N.cx+N.x11),!E),S.arc(N.cx,N.cy,$,a(N.y11,N.x11),a(N.y01,N.x01),!E))):(S.moveTo(W,H),S.arc(0,0,y,O,I,!E)):S.moveTo(W,H),g>1e-12&&L>1e-12?U>1e-12?(C=_(G,X,Z,K,g,-U,E),N=_(W,H,J,Q,g,-U,E),S.lineTo(C.cx+C.x01,C.cy+C.y01),U<j?S.arc(C.cx,C.cy,U,a(C.y01,C.x01),a(N.y01,N.x01),!E):(S.arc(C.cx,C.cy,U,a(C.y01,C.x01),a(C.y11,C.x11),!E),S.arc(0,0,g,a(C.cy+C.y11,C.cx+C.x11),a(N.cy+N.y11,N.cx+N.x11),E),S.arc(N.cx,N.cy,U,a(N.y11,N.x11),a(N.y01,N.x01),!E))):S.arc(0,0,g,R,P,E):S.lineTo(G,X)}else S.moveTo(0,0);if(S.closePath(),r)return S=null,r+""||null}return M.centroid=function(){var t=(+e.apply(this,arguments)+ +o.apply(this,arguments))/2,r=(+D.apply(this,arguments)+ +T.apply(this,arguments))/2-u/2;return[i(r)*t,l(r)*t]},M.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),M):e},M.outerRadius=function(e){return arguments.length?(o="function"==typeof e?e:r(+e),M):o},M.cornerRadius=function(e){return arguments.length?(w="function"==typeof e?e:r(+e),M):w},M.padRadius=function(e){return arguments.length?(k=null==e?null:"function"==typeof e?e:r(+e),M):k},M.startAngle=function(e){return arguments.length?(D="function"==typeof e?e:r(+e),M):D},M.endAngle=function(e){return arguments.length?(T="function"==typeof e?e:r(+e),M):T},M.padAngle=function(e){return arguments.length?(A="function"==typeof e?e:r(+e),M):A},M.context=function(e){return arguments.length?(S=null==e?null:e,M):S},M},e.area=S,e.areaRadial=R,e.curveBasis=function(e){return new ue(e)},e.curveBasisClosed=function(e){return new fe(e)},e.curveBasisOpen=function(e){return new pe(e)},e.curveBundle=de,e.curveCardinal=ye,e.curveCardinalClosed=be,e.curveCardinalOpen=_e,e.curveCatmullRom=De,e.curveCatmullRomClosed=Ae,e.curveCatmullRomOpen=Me,e.curveLinear=k,e.curveLinearClosed=function(e){return new Ee(e)},e.curveMonotoneX=function(e){return new Pe(e)},e.curveMonotoneY=function(e){return new Re(e)},e.curveNatural=function(e){return new Fe(e)},e.curveStep=function(e){return new ze(e,.5)},e.curveStepAfter=function(e){return new ze(e,1)},e.curveStepBefore=function(e){return new ze(e,0)},e.line=A,e.lineRadial=P,e.linkHorizontal=function(){return j(U)},e.linkRadial=function(){var e=j(V);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e},e.linkVertical=function(){return j($)},e.pie=function(){var e=E,t=M,n=null,a=r(0),i=r(p),o=r(0);function s(r){var s,l,c,u,f,h=r.length,d=0,m=new Array(h),g=new Array(h),y=+a.apply(this,arguments),v=Math.min(p,Math.max(-p,i.apply(this,arguments)-y)),b=Math.min(Math.abs(v)/h,o.apply(this,arguments)),x=b*(v<0?-1:1);for(s=0;s<h;++s)(f=g[m[s]=s]=+e(r[s],s,r))>0&&(d+=f);for(null!=t?m.sort((function(e,r){return t(g[e],g[r])})):null!=n&&m.sort((function(e,t){return n(r[e],r[t])})),s=0,c=d?(v-h*x)/d:0;s<h;++s,y=u)l=m[s],u=y+((f=g[l])>0?f*c:0)+x,g[l]={data:r[l],index:s,value:f,startAngle:y,endAngle:u,padAngle:b};return g}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(a="function"==typeof e?e:r(+e),s):a},s.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:r(+e),s):i},s.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:r(+e),s):o},s},e.pointRadial=L,e.radialArea=R,e.radialLine=P,e.stack=function(){var e=r([]),t=Ue,n=je,a=$e;function i(r){var i,o,s=e.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(i=0;i<c;++i){for(var f,p=s[i],h=u[i]=new Array(l),d=0;d<l;++d)h[d]=f=[0,+a(r[d],p,d,r)],f.data=r[d];h.key=p}for(i=0,o=t(u);i<c;++i)u[o[i]].index=i;return n(u,o),u}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:r(F.call(t)),i):e},i.value=function(e){return arguments.length?(a="function"==typeof e?e:r(+e),i):a},i.order=function(e){return arguments.length?(t=null==e?Ue:"function"==typeof e?e:r(F.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?je:e,i):n},i},e.stackOffsetDiverging=function(e,t){if((s=e.length)>0)for(var r,n,a,i,o,s,l=0,c=e[t[0]].length;l<c;++l)for(i=o=0,r=0;r<s;++r)(a=(n=e[t[r]][l])[1]-n[0])>0?(n[0]=i,n[1]=i+=a):a<0?(n[1]=o,n[0]=o+=a):(n[0]=0,n[1]=a)},e.stackOffsetExpand=function(e,t){if((n=e.length)>0){for(var r,n,a,i=0,o=e[0].length;i<o;++i){for(a=r=0;r<n;++r)a+=e[r][i][1]||0;if(a)for(r=0;r<n;++r)e[r][i][1]/=a}je(e,t)}},e.stackOffsetNone=je,e.stackOffsetSilhouette=function(e,t){if((r=e.length)>0){for(var r,n=0,a=e[t[0]],i=a.length;n<i;++n){for(var o=0,s=0;o<r;++o)s+=e[o][n][1]||0;a[n][1]+=a[n][0]=-s/2}je(e,t)}},e.stackOffsetWiggle=function(e,t){if((a=e.length)>0&&(n=(r=e[t[0]]).length)>0){for(var r,n,a,i=0,o=1;o<n;++o){for(var s=0,l=0,c=0;s<a;++s){for(var u=e[t[s]],f=u[o][1]||0,p=(f-(u[o-1][1]||0))/2,h=0;h<s;++h){var d=e[t[h]];p+=(d[o][1]||0)-(d[o-1][1]||0)}l+=f,c+=p*f}r[o-1][1]+=r[o-1][0]=i,l&&(i-=c/l)}r[o-1][1]+=r[o-1][0]=i,je(e,t)}},e.stackOrderAppearance=Ve,e.stackOrderAscending=We,e.stackOrderDescending=function(e){return We(e).reverse()},e.stackOrderInsideOut=function(e){var t,r,n=e.length,a=e.map(He),i=Ve(e),o=0,s=0,l=[],c=[];for(t=0;t<n;++t)r=i[t],o<s?(o+=a[r],l.push(r)):(s+=a[r],c.push(r));return c.reverse().concat(l)},e.stackOrderNone=Ue,e.stackOrderReverse=function(e){return Ue(e).reverse()},e.symbol=function(){var e=r(q),n=r(64),a=null;function i(){var r;if(a||(a=r=t.path()),e.apply(this,arguments).draw(a,+n.apply(this,arguments)),r)return a=null,r+""||null}return i.type=function(t){return arguments.length?(e="function"==typeof t?t:r(t),i):e},i.size=function(e){return arguments.length?(n="function"==typeof e?e:r(+e),i):n},i.context=function(e){return arguments.length?(a=null==e?null:e,i):a},i},e.symbolCircle=q,e.symbolCross=W,e.symbolDiamond=X,e.symbolSquare=Q,e.symbolStar=J,e.symbolTriangle=te,e.symbolWye=oe,e.symbols=se,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof r&&void 0!==t?a(r,e("d3-path")):a((n=n||self).d3=n.d3||{},n.d3)},{"d3-path":117}],120:[function(e,t,r){var n,a;n=this,a=function(e,t){"use strict";function r(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 n(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 a(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function i(e){var i=e.dateTime,o=e.date,l=e.time,c=e.periods,u=e.days,f=e.shortDays,p=e.months,ve=e.shortMonths,be=h(c),xe=d(c),_e=h(u),we=d(u),ke=h(f),De=d(f),Te=h(p),Ae=d(p),Se=h(ve),Me=d(ve),Ee={a:function(e){return f[e.getDay()]},A:function(e){return u[e.getDay()]},b:function(e){return ve[e.getMonth()]},B:function(e){return p[e.getMonth()]},c:null,d:R,e:R,f:j,H:L,I:F,j:B,L:z,m:U,M:$,p:function(e){return c[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:ge,s:ye,S:V,u:q,U:W,V:H,w:G,W:X,x:null,X:null,y:Y,Y:Z,Z:K,"%":me},Ce={a:function(e){return f[e.getUTCDay()]},A:function(e){return u[e.getUTCDay()]},b:function(e){return ve[e.getUTCMonth()]},B:function(e){return p[e.getUTCMonth()]},c:null,d:J,e:J,f:ne,H:Q,I:ee,j:te,L:re,m:ae,M:ie,p:function(e){return c[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:ge,s:ye,S:oe,u:se,U:le,V:ce,w:ue,W:fe,x:null,X:null,y:pe,Y:he,Z:de,"%":me},Ne={a:function(e,t,r){var n=ke.exec(t.slice(r));return n?(e.w=De[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=_e.exec(t.slice(r));return n?(e.w=we[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=Se.exec(t.slice(r));return n?(e.m=Me[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=Te.exec(t.slice(r));return n?(e.m=Ae[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,t,r){return Pe(e,i,t,r)},d:T,e:T,f:N,H:S,I:S,j:A,L:C,m:D,M,p:function(e,t,r){var n=be.exec(t.slice(r));return n?(e.p=xe[n[0].toLowerCase()],r+n[0].length):-1},q:k,Q:I,s:P,S:E,u:g,U:y,V:v,w:m,W:b,x:function(e,t,r){return Pe(e,o,t,r)},X:function(e,t,r){return Pe(e,l,t,r)},y:_,Y:x,Z:w,"%":O};function Oe(e,t){return function(r){var n,a,i,o=[],l=-1,c=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++l<u;)37===e.charCodeAt(l)&&(o.push(e.slice(c,l)),null!=(a=s[n=e.charAt(++l)])?n=e.charAt(++l):a="e"===n?" ":"0",(i=t[n])&&(n=i(r,a)),o.push(n),c=l+1);return o.push(e.slice(c,l)),o.join("")}}function Ie(e,i){return function(o){var s,l,c=a(1900,void 0,1);if(Pe(c,e,o+="",0)!=o.length)return null;if("Q"in c)return new Date(c.Q);if("s"in c)return new Date(1e3*c.s+("L"in c?c.L:0));if(i&&!("Z"in c)&&(c.Z=0),"p"in c&&(c.H=c.H%12+12*c.p),void 0===c.m&&(c.m="q"in c?c.q:0),"V"in c){if(c.V<1||c.V>53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(a(c.y,0,1))).getUTCDay(),s=l>4||0===l?t.utcMonday.ceil(s):t.utcMonday(s),s=t.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(a(c.y,0,1))).getDay(),s=l>4||0===l?t.timeMonday.ceil(s):t.timeMonday(s),s=t.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(a(c.y,0,1)).getUTCDay():r(a(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Pe(e,t,r,n){for(var a,i,o=0,l=t.length,c=r.length;o<l;){if(n>=c)return-1;if(37===(a=t.charCodeAt(o++))){if(a=t.charAt(o++),!(i=Ne[a in s?t.charAt(o++):a])||(n=i(e,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Ee.x=Oe(o,Ee),Ee.X=Oe(l,Ee),Ee.c=Oe(i,Ee),Ce.x=Oe(o,Ce),Ce.X=Oe(l,Ce),Ce.c=Oe(i,Ce),{format:function(e){var t=Oe(e+="",Ee);return t.toString=function(){return e},t},parse:function(e){var t=Ie(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=Oe(e+="",Ce);return t.toString=function(){return e},t},utcParse:function(e){var t=Ie(e+="",!0);return t.toString=function(){return e},t}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function f(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function p(e){return e.replace(u,"\\$&")}function h(e){return new RegExp("^(?:"+e.map(p).join("|")+")","i")}function d(e){for(var t={},r=-1,n=e.length;++r<n;)t[e[r].toLowerCase()]=r;return t}function m(e,t,r){var n=l.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function g(e,t,r){var n=l.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function y(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function v(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function b(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function x(e,t,r){var n=l.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function _(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function w(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 k(e,t,r){var n=l.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function D(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function T(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function A(e,t,r){var n=l.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function S(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function M(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function E(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function C(e,t,r){var n=l.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function N(e,t,r){var n=l.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function O(e,t,r){var n=c.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function I(e,t,r){var n=l.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function P(e,t,r){var n=l.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function R(e,t){return f(e.getDate(),t,2)}function L(e,t){return f(e.getHours(),t,2)}function F(e,t){return f(e.getHours()%12||12,t,2)}function B(e,r){return f(1+t.timeDay.count(t.timeYear(e),e),r,3)}function z(e,t){return f(e.getMilliseconds(),t,3)}function j(e,t){return z(e,t)+"000"}function U(e,t){return f(e.getMonth()+1,t,2)}function $(e,t){return f(e.getMinutes(),t,2)}function V(e,t){return f(e.getSeconds(),t,2)}function q(e){var t=e.getDay();return 0===t?7:t}function W(e,r){return f(t.timeSunday.count(t.timeYear(e)-1,e),r,2)}function H(e,r){var n=e.getDay();return e=n>=4||0===n?t.timeThursday(e):t.timeThursday.ceil(e),f(t.timeThursday.count(t.timeYear(e),e)+(4===t.timeYear(e).getDay()),r,2)}function G(e){return e.getDay()}function X(e,r){return f(t.timeMonday.count(t.timeYear(e)-1,e),r,2)}function Y(e,t){return f(e.getFullYear()%100,t,2)}function Z(e,t){return f(e.getFullYear()%1e4,t,4)}function K(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+f(t/60|0,"0",2)+f(t%60,"0",2)}function J(e,t){return f(e.getUTCDate(),t,2)}function Q(e,t){return f(e.getUTCHours(),t,2)}function ee(e,t){return f(e.getUTCHours()%12||12,t,2)}function te(e,r){return f(1+t.utcDay.count(t.utcYear(e),e),r,3)}function re(e,t){return f(e.getUTCMilliseconds(),t,3)}function ne(e,t){return re(e,t)+"000"}function ae(e,t){return f(e.getUTCMonth()+1,t,2)}function ie(e,t){return f(e.getUTCMinutes(),t,2)}function oe(e,t){return f(e.getUTCSeconds(),t,2)}function se(e){var t=e.getUTCDay();return 0===t?7:t}function le(e,r){return f(t.utcSunday.count(t.utcYear(e)-1,e),r,2)}function ce(e,r){var n=e.getUTCDay();return e=n>=4||0===n?t.utcThursday(e):t.utcThursday.ceil(e),f(t.utcThursday.count(t.utcYear(e),e)+(4===t.utcYear(e).getUTCDay()),r,2)}function ue(e){return e.getUTCDay()}function fe(e,r){return f(t.utcMonday.count(t.utcYear(e)-1,e),r,2)}function pe(e,t){return f(e.getUTCFullYear()%100,t,2)}function he(e,t){return f(e.getUTCFullYear()%1e4,t,4)}function de(){return"+0000"}function me(){return"%"}function ge(e){return+e}function ye(e){return Math.floor(+e/1e3)}function ve(t){return o=i(t),e.timeFormat=o.format,e.timeParse=o.parse,e.utcFormat=o.utcFormat,e.utcParse=o.utcParse,o}ve({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var be=Date.prototype.toISOString?function(e){return e.toISOString()}:e.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ"),xe=+new Date("2000-01-01T00:00:00.000Z")?function(e){var t=new Date(e);return isNaN(t)?null:t}:e.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");e.isoFormat=be,e.isoParse=xe,e.timeFormatDefaultLocale=ve,e.timeFormatLocale=i,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof r&&void 0!==t?a(r,e("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)},{"d3-time":121}],121:[function(e,t,r){!function(e,n){!function(e){"use strict";var t=new Date,r=new Date;function n(e,a,i,o){function s(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return s.floor=function(t){return e(t=new Date(+t)),t},s.ceil=function(t){return e(t=new Date(t-1)),a(t,1),e(t),t},s.round=function(e){var t=s(e),r=s.ceil(e);return e-t<r-e?t:r},s.offset=function(e,t){return a(e=new Date(+e),null==t?1:Math.floor(t)),e},s.range=function(t,r,n){var i,o=[];if(t=s.ceil(t),n=null==n?1:Math.floor(n),!(t<r&&n>0))return o;do{o.push(i=new Date(+t)),a(t,n),e(t)}while(i<t&&t<r);return o},s.filter=function(t){return n((function(r){if(r>=r)for(;e(r),!t(r);)r.setTime(r-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;a(e,-1),!t(e););else for(;--r>=0;)for(;a(e,1),!t(e););}))},i&&(s.count=function(n,a){return t.setTime(+n),r.setTime(+a),e(t),e(r),Math.floor(i(t,r))},s.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?s.filter(o?function(t){return o(t)%e==0}:function(t){return s.count(0,t)%e==0}):s:null}),s}var a=n((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));a.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?n((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):a:null};var i=a.range,o=n((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()})),s=o.range,l=n((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})),c=l.range,u=n((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()})),f=u.range,p=n((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1})),h=p.range;function d(e){return n((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-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var m=d(0),g=d(1),y=d(2),v=d(3),b=d(4),x=d(5),_=d(6),w=m.range,k=g.range,D=y.range,T=v.range,A=b.range,S=x.range,M=_.range,E=n((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()})),C=E.range,N=n((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()}));N.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((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 O=N.range,I=n((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()})),P=I.range,R=n((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()})),L=R.range,F=n((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})),B=F.range;function z(e){return n((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)/6048e5}))}var j=z(0),U=z(1),$=z(2),V=z(3),q=z(4),W=z(5),H=z(6),G=j.range,X=U.range,Y=$.range,Z=V.range,K=q.range,J=W.range,Q=H.range,ee=n((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()})),te=ee.range,re=n((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()}));re.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((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 ne=re.range;e.timeDay=p,e.timeDays=h,e.timeFriday=x,e.timeFridays=S,e.timeHour=u,e.timeHours=f,e.timeInterval=n,e.timeMillisecond=a,e.timeMilliseconds=i,e.timeMinute=l,e.timeMinutes=c,e.timeMonday=g,e.timeMondays=k,e.timeMonth=E,e.timeMonths=C,e.timeSaturday=_,e.timeSaturdays=M,e.timeSecond=o,e.timeSeconds=s,e.timeSunday=m,e.timeSundays=w,e.timeThursday=b,e.timeThursdays=A,e.timeTuesday=y,e.timeTuesdays=D,e.timeWednesday=v,e.timeWednesdays=T,e.timeWeek=m,e.timeWeeks=w,e.timeYear=N,e.timeYears=O,e.utcDay=F,e.utcDays=B,e.utcFriday=W,e.utcFridays=J,e.utcHour=R,e.utcHours=L,e.utcMillisecond=a,e.utcMilliseconds=i,e.utcMinute=I,e.utcMinutes=P,e.utcMonday=U,e.utcMondays=X,e.utcMonth=ee,e.utcMonths=te,e.utcSaturday=H,e.utcSaturdays=Q,e.utcSecond=o,e.utcSeconds=s,e.utcSunday=j,e.utcSundays=G,e.utcThursday=q,e.utcThursdays=K,e.utcTuesday=$,e.utcTuesdays=Y,e.utcWednesday=V,e.utcWednesdays=Z,e.utcWeek=j,e.utcWeeks=G,e.utcYear=re,e.utcYears=ne,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:(e=e||self).d3=e.d3||{})}(this)},{}],122:[function(e,t,r){arguments[4][121][0].apply(r,arguments)},{dup:121}],123:[function(e,t,r){!function(e,n){!function(e){"use strict";var t,r,n=0,a=0,i=0,o=0,s=0,l=0,c="object"==typeof performance&&performance.now?performance:Date,u="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function f(){return s||(u(p),s=c.now()+l)}function p(){s=0}function h(){this._call=this._time=this._next=null}function d(e,t,r){var n=new h;return n.restart(e,t,r),n}function m(){f(),++n;for(var e,r=t;r;)(e=s-r._time)>=0&&r._call.call(null,e),r=r._next;--n}function g(){s=(o=c.now())+l,n=a=0;try{m()}finally{n=0,function(){for(var e,n,a=t,i=1/0;a;)a._call?(i>a._time&&(i=a._time),e=a,a=a._next):(n=a._next,a._next=null,a=e?e._next=n:t=n);r=e,v(i)}(),s=0}}function y(){var e=c.now(),t=e-o;t>1e3&&(l-=t,o=e)}function v(e){n||(a&&(a=clearTimeout(a)),e-s>24?(e<1/0&&(a=setTimeout(g,e-c.now()-l)),i&&(i=clearInterval(i))):(i||(o=c.now(),i=setInterval(y,1e3)),n=1,u(g)))}h.prototype=d.prototype={constructor:h,restart:function(e,n,a){if("function"!=typeof e)throw new TypeError("callback is not a function");a=(null==a?f():+a)+(null==n?0:+n),this._next||r===this||(r?r._next=this:t=this,r=this),this._call=e,this._time=a,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},e.interval=function(e,t,r){var n=new h,a=t;return null==t?(n.restart(e,t,r),n):(t=+t,r=null==r?f():+r,n.restart((function i(o){o+=a,n.restart(i,a+=t,r),e(o)}),t,r),n)},e.now=f,e.timeout=function(e,t,r){var n=new h;return t=null==t?0:+t,n.restart((function(r){n.stop(),e(r+t)}),t,r),n},e.timer=d,e.timerFlush=m,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:(e=e||self).d3=e.d3||{})}(this)},{}],124:[function(e,t,r){t.exports=function(){for(var e=0;e<arguments.length;e++)if(void 0!==arguments[e])return arguments[e]}},{}],125:[function(e,t,r){"use strict";t.exports=i;var n=(i.canvas=document.createElement("canvas")).getContext("2d"),a=o([32,126]);function i(e,t){Array.isArray(e)&&(e=e.join(", "));var r,i={},s=16,l=.05;t&&(2===t.length&&"number"==typeof t[0]?r=o(t):Array.isArray(t)?r=t:(t.o?r=o(t.o):t.pairs&&(r=t.pairs),t.fontSize&&(s=t.fontSize),null!=t.threshold&&(l=t.threshold))),r||(r=a),n.font=s+"px "+e;for(var c=0;c<r.length;c++){var u=r[c],f=n.measureText(u[0]).width+n.measureText(u[1]).width,p=n.measureText(u).width;if(Math.abs(f-p)>s*l){var h=(p-f)/s;i[u]=1e3*h}}return i}function o(e){for(var t=[],r=e[0];r<=e[1];r++)for(var n=String.fromCharCode(r),a=e[0];a<e[1];a++){var i=n+String.fromCharCode(a);t.push(i)}return t}i.createPairs=o,i.ascii=a},{}],126:[function(e,t,r){var n=e("abs-svg-path"),a=e("normalize-svg-path"),i={M:"moveTo",C:"bezierCurveTo"};t.exports=function(e,t){e.beginPath(),a(n(t)).forEach((function(t){var r=t[0],n=t.slice(1);e[i[r]].apply(e,n)})),e.closePath()}},{"abs-svg-path":70,"normalize-svg-path":246}],127:[function(e,t,r){t.exports=function(e){switch(e){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],128:[function(e,t,r){"use strict";t.exports=function(e,t){switch(void 0===t&&(t=0),typeof e){case"number":if(e>0)return function(e,t){var r,n;for(r=new Array(e),n=0;n<e;++n)r[n]=t;return r}(0|e,t);break;case"object":if("number"==typeof e.length)return function e(t,r,n){var a=0|t[n];if(a<=0)return[];var i,o=new Array(a);if(n===t.length-1)for(i=0;i<a;++i)o[i]=r;else for(i=0;i<a;++i)o[i]=e(t,r,n+1);return o}(e,t,0)}return[]}},{}],129:[function(e,t,r){"use strict";function n(e,t,r){r=r||2;var n,s,l,c,u,h,d,g=t&&t.length,y=g?t[0]*r:e.length,v=a(e,0,y,r,!0),b=[];if(!v||v.next===v.prev)return b;if(g&&(v=function(e,t,r,n){var o,s,l,c=[];for(o=0,s=t.length;o<s;o++)(l=a(e,t[o]*n,o<s-1?t[o+1]*n:e.length,n,!1))===l.next&&(l.steiner=!0),c.push(m(l));for(c.sort(f),o=0;o<c.length;o++)p(c[o],r),r=i(r,r.next);return r}(e,t,v,r)),e.length>80*r){n=l=e[0],s=c=e[1];for(var x=r;x<y;x+=r)(u=e[x])<n&&(n=u),(h=e[x+1])<s&&(s=h),u>l&&(l=u),h>c&&(c=h);d=0!==(d=Math.max(l-n,c-s))?1/d:0}return o(v,b,r,n,s,d),b}function a(e,t,r,n,a){var i,o;if(a===M(e,t,r,n)>0)for(i=t;i<r;i+=n)o=T(i,e[i],e[i+1],o);else for(i=r-n;i>=t;i-=n)o=T(i,e[i],e[i+1],o);return o&&b(o,o.next)&&(A(o),o=o.next),o}function i(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!b(n,n.next)&&0!==v(n.prev,n,n.next))n=n.next;else{if(A(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function o(e,t,r,n,a,f,p){if(e){!p&&f&&function(e,t,r,n){var a=e;do{null===a.z&&(a.z=d(a.x,a.y,t,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,function(e){var t,r,n,a,i,o,s,l,c=1;do{for(r=e,e=null,i=null,o=0;r;){for(o++,n=r,s=0,t=0;t<c&&(s++,n=n.nextZ);t++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,l--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;r=n}i.nextZ=null,c*=2}while(o>1)}(a)}(e,n,a,f);for(var h,m,g=e;e.prev!==e.next;)if(h=e.prev,m=e.next,f?l(e,n,a,f):s(e))t.push(h.i/r),t.push(e.i/r),t.push(m.i/r),A(e),e=m.next,g=m.next;else if((e=m)===g){p?1===p?o(e=c(i(e),t,r),t,r,n,a,f,2):2===p&&u(e,t,r,n,a,f):o(i(e),t,r,n,a,f,1);break}}}function s(e){var t=e.prev,r=e,n=e.next;if(v(t,r,n)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(g(t.x,t.y,r.x,r.y,n.x,n.y,a.x,a.y)&&v(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function l(e,t,r,n){var a=e.prev,i=e,o=e.next;if(v(a,i,o)>=0)return!1;for(var s=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,l=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,u=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=d(s,l,t,r,n),p=d(c,u,t,r,n),h=e.prevZ,m=e.nextZ;h&&h.z>=f&&m&&m.z<=p;){if(h!==e.prev&&h!==e.next&&g(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&v(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,m!==e.prev&&m!==e.next&&g(a.x,a.y,i.x,i.y,o.x,o.y,m.x,m.y)&&v(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;h&&h.z>=f;){if(h!==e.prev&&h!==e.next&&g(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&v(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;m&&m.z<=p;){if(m!==e.prev&&m!==e.next&&g(a.x,a.y,i.x,i.y,o.x,o.y,m.x,m.y)&&v(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function c(e,t,r){var n=e;do{var a=n.prev,o=n.next.next;!b(a,o)&&x(a,n,n.next,o)&&k(a,o)&&k(o,a)&&(t.push(a.i/r),t.push(n.i/r),t.push(o.i/r),A(n),A(n.next),n=e=o),n=n.next}while(n!==e);return i(n)}function u(e,t,r,n,a,s){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&y(l,c)){var u=D(l,c);return l=i(l,l.next),u=i(u,u.next),o(l,t,r,n,a,s),void o(u,t,r,n,a,s)}c=c.next}l=l.next}while(l!==e)}function f(e,t){return e.x-t.x}function p(e,t){if(t=function(e,t){var r,n=t,a=e.x,i=e.y,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=a&&s>o){if(o=s,s===a){if(i===n.y)return n;if(i===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(a===o)return r;var l,c=r,u=r.x,f=r.y,p=1/0;n=r;do{a>=n.x&&n.x>=u&&a!==n.x&&g(i<f?a:o,i,u,f,i<f?o:a,i,n.x,n.y)&&(l=Math.abs(i-n.y)/(a-n.x),k(n,e)&&(l<p||l===p&&(n.x>r.x||n.x===r.x&&h(r,n)))&&(r=n,p=l)),n=n.next}while(n!==c);return r}(e,t)){var r=D(t,e);i(t,t.next),i(r,r.next)}}function h(e,t){return v(e.prev,e,t.prev)<0&&v(t.next,e,e.next)<0}function d(e,t,r,n,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*a)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*a)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function m(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function g(e,t,r,n,a,i,o,s){return(a-o)*(t-s)-(e-o)*(i-s)>=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(i-s)-(a-o)*(n-s)>=0}function y(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&x(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(k(e,t)&&k(t,e)&&function(e,t){var r=e,n=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(v(e.prev,e,t.prev)||v(e,t.prev,t))||b(e,t)&&v(e.prev,e,e.next)>0&&v(t.prev,t,t.next)>0)}function v(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function b(e,t){return e.x===t.x&&e.y===t.y}function x(e,t,r,n){var a=w(v(e,t,r)),i=w(v(e,t,n)),o=w(v(r,n,e)),s=w(v(r,n,t));return a!==i&&o!==s||!(0!==a||!_(e,r,t))||!(0!==i||!_(e,n,t))||!(0!==o||!_(r,e,n))||!(0!==s||!_(r,t,n))}function _(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function w(e){return e>0?1:e<0?-1:0}function k(e,t){return v(e.prev,e,e.next)<0?v(e,t,e.next)>=0&&v(e,e.prev,t)>=0:v(e,t,e.prev)<0||v(e,e.next,t)<0}function D(e,t){var r=new S(e.i,e.x,e.y),n=new S(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function T(e,t,r,n){var a=new S(e,t,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function A(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function S(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,r,n){for(var a=0,i=t,o=r-n;i<r;i+=n)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}t.exports=n,t.exports.default=n,n.deviation=function(e,t,r,n){var a=t&&t.length,i=a?t[0]*r:e.length,o=Math.abs(M(e,0,i,r));if(a)for(var s=0,l=t.length;s<l;s++){var c=t[s]*r,u=s<l-1?t[s+1]*r:e.length;o-=Math.abs(M(e,c,u,r))}var f=0;for(s=0;s<n.length;s+=3){var p=n[s]*r,h=n[s+1]*r,d=n[s+2]*r;f+=Math.abs((e[p]-e[d])*(e[h+1]-e[p+1])-(e[p]-e[h])*(e[d+1]-e[p+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},n.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)r.vertices.push(e[a][i][o]);a>0&&(n+=e[a-1].length,r.holes.push(n))}return r}},{}],130:[function(e,t,r){var n=e("strongly-connected-components");t.exports=function(e,t){var r,a=[],i=[],o=[],s={},l=[];function c(e){var t,n,a=!1;for(i.push(e),o[e]=!0,t=0;t<l[e].length;t++)(n=l[e][t])===r?(u(r,i),a=!0):o[n]||(a=c(n));if(a)!function e(t){o[t]=!1,s.hasOwnProperty(t)&&Object.keys(s[t]).forEach((function(r){delete s[t][r],o[r]&&e(r)}))}(e);else for(t=0;t<l[e].length;t++){n=l[e][t];var f=s[n];f||(f={},s[n]=f),f[n]=!0}return i.pop(),a}function u(e,r){var n=[].concat(r).concat(e);t?t(c):a.push(n)}function f(t){!function(t){for(var r=0;r<e.length;r++)r<t&&(e[r]=[]),e[r]=e[r].filter((function(e){return e>=t}))}(t);for(var r,a=n(e).components.filter((function(e){return e.length>1})),i=1/0,o=0;o<a.length;o++)for(var s=0;s<a[o].length;s++)a[o][s]<i&&(i=a[o][s],r=o);var l=a[r];return!!l&&{leastVertex:i,adjList:e.map((function(e,t){return-1===l.indexOf(t)?[]:e.filter((function(e){return-1!==l.indexOf(e)}))}))}}r=0;for(var p=e.length;r<p;){var h=f(r);if(r=h.leastVertex,l=h.adjList){for(var d=0;d<l.length;d++)for(var m=0;m<l[d].length;m++){var g=l[d][m];o[+g]=!1,s[g]={}}c(r),r+=1}else r=p}return t?void 0:a}},{"strongly-connected-components":306}],131:[function(e,t,r){"use strict";var n=e("../../object/valid-value");t.exports=function(){return n(this).length=0,this}},{"../../object/valid-value":162}],132:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?Array.from:e("./shim")},{"./is-implemented":133,"./shim":134}],133:[function(e,t,r){"use strict";t.exports=function(){var e,t,r=Array.from;return"function"==typeof r&&(t=r(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}},{}],134:[function(e,t,r){"use strict";var n=e("es6-symbol").iterator,a=e("../../function/is-arguments"),i=e("../../function/is-function"),o=e("../../number/to-pos-integer"),s=e("../../object/valid-callable"),l=e("../../object/valid-value"),c=e("../../object/is-value"),u=e("../../string/is-string"),f=Array.isArray,p=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;t.exports=function(e){var t,r,m,g,y,v,b,x,_,w,k=arguments[1],D=arguments[2];if(e=Object(l(e)),c(k)&&s(k),this&&this!==Array&&i(this))t=this;else{if(!k){if(a(e))return 1!==(y=e.length)?Array.apply(null,e):((g=new Array(1))[0]=e[0],g);if(f(e)){for(g=new Array(y=e.length),r=0;r<y;++r)g[r]=e[r];return g}}g=[]}if(!f(e))if(void 0!==(_=e[n])){for(b=s(_).call(e),t&&(g=new t),x=b.next(),r=0;!x.done;)w=k?p.call(k,D,x.value,r):x.value,t?(h.value=w,d(g,r,h)):g[r]=w,x=b.next(),++r;y=r}else if(u(e)){for(y=e.length,t&&(g=new t),r=0,m=0;r<y;++r)w=e[r],r+1<y&&(v=w.charCodeAt(0))>=55296&&v<=56319&&(w+=e[++r]),w=k?p.call(k,D,w,m):w,t?(h.value=w,d(g,m,h)):g[m]=w,++m;y=m}if(void 0===y)for(y=o(e.length),t&&(g=new t(y)),r=0;r<y;++r)w=k?p.call(k,D,e[r],r):e[r],t?(h.value=w,d(g,r,h)):g[r]=w;return t&&(h.value=null,g.length=y),g}},{"../../function/is-arguments":135,"../../function/is-function":136,"../../number/to-pos-integer":142,"../../object/is-value":151,"../../object/valid-callable":160,"../../object/valid-value":162,"../../string/is-string":166,"es6-symbol":175}],135:[function(e,t,r){"use strict";var n=Object.prototype.toString,a=n.call(function(){return arguments}());t.exports=function(e){return n.call(e)===a}},{}],136:[function(e,t,r){"use strict";var n=Object.prototype.toString,a=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);t.exports=function(e){return"function"==typeof e&&a(n.call(e))}},{}],137:[function(e,t,r){"use strict";t.exports=function(){}},{}],138:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?Math.sign:e("./shim")},{"./is-implemented":139,"./shim":140}],139:[function(e,t,r){"use strict";t.exports=function(){var e=Math.sign;return"function"==typeof e&&1===e(10)&&-1===e(-20)}},{}],140:[function(e,t,r){"use strict";t.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},{}],141:[function(e,t,r){"use strict";var n=e("../math/sign"),a=Math.abs,i=Math.floor;t.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?n(e)*i(a(e)):e}},{"../math/sign":138}],142:[function(e,t,r){"use strict";var n=e("./to-integer"),a=Math.max;t.exports=function(e){return a(0,n(e))}},{"./to-integer":141}],143:[function(e,t,r){"use strict";var n=e("./valid-callable"),a=e("./valid-value"),i=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;t.exports=function(e,t){return function(r,c){var u,f=arguments[2],p=arguments[3];return r=Object(a(r)),n(c),u=s(r),p&&u.sort("function"==typeof p?i.call(p,r):void 0),"function"!=typeof e&&(e=u[e]),o.call(e,u,(function(e,n){return l.call(r,e)?o.call(c,f,r[e],e,r,n):t}))}}},{"./valid-callable":160,"./valid-value":162}],144:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?Object.assign:e("./shim")},{"./is-implemented":145,"./shim":146}],145:[function(e,t,r){"use strict";t.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},{}],146:[function(e,t,r){"use strict";var n=e("../keys"),a=e("../valid-value"),i=Math.max;t.exports=function(e,t){var r,o,s,l=i(arguments.length,2);for(e=Object(a(e)),s=function(n){try{e[n]=t[n]}catch(e){r||(r=e)}},o=1;o<l;++o)n(t=arguments[o]).forEach(s);if(void 0!==r)throw r;return e}},{"../keys":152,"../valid-value":162}],147:[function(e,t,r){"use strict";var n=e("../array/from"),a=e("./assign"),i=e("./valid-value");t.exports=function(e){var t=Object(i(e)),r=arguments[1],o=Object(arguments[2]);if(t!==e&&!r)return t;var s={};return r?n(r,(function(t){(o.ensure||t in e)&&(s[t]=e[t])})):a(s,e),s}},{"../array/from":132,"./assign":144,"./valid-value":162}],148:[function(e,t,r){"use strict";var n,a,i,o,s=Object.create;e("./set-prototype-of/is-implemented")()||(n=e("./set-prototype-of/shim")),t.exports=n?1!==n.level?s:(a={},i={},o={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(e){i[e]="__proto__"!==e?o:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(a,i),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:a}),function(e,t){return s(null===e?a:e,t)}):s},{"./set-prototype-of/is-implemented":158,"./set-prototype-of/shim":159}],149:[function(e,t,r){"use strict";t.exports=e("./_iterate")("forEach")},{"./_iterate":143}],150:[function(e,t,r){"use strict";var n=e("./is-value"),a={function:!0,object:!0};t.exports=function(e){return n(e)&&a[typeof e]||!1}},{"./is-value":151}],151:[function(e,t,r){"use strict";var n=e("../function/noop")();t.exports=function(e){return e!==n&&null!==e}},{"../function/noop":137}],152:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?Object.keys:e("./shim")},{"./is-implemented":153,"./shim":154}],153:[function(e,t,r){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},{}],154:[function(e,t,r){"use strict";var n=e("../is-value"),a=Object.keys;t.exports=function(e){return a(n(e)?Object(e):e)}},{"../is-value":151}],155:[function(e,t,r){"use strict";var n=e("./valid-callable"),a=e("./for-each"),i=Function.prototype.call;t.exports=function(e,t){var r={},o=arguments[2];return n(t),a(e,(function(e,n,a,s){r[n]=i.call(t,o,e,n,a,s)})),r}},{"./for-each":149,"./valid-callable":160}],156:[function(e,t,r){"use strict";var n=e("./is-value"),a=Array.prototype.forEach,i=Object.create,o=function(e,t){var r;for(r in e)t[r]=e[r]};t.exports=function(e){var t=i(null);return a.call(arguments,(function(e){n(e)&&o(Object(e),t)})),t}},{"./is-value":151}],157:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?Object.setPrototypeOf:e("./shim")},{"./is-implemented":158,"./shim":159}],158:[function(e,t,r){"use strict";var n=Object.create,a=Object.getPrototypeOf,i={};t.exports=function(){var e=Object.setPrototypeOf;return"function"==typeof e&&a(e((arguments[0]||n)(null),i))===i}},{}],159:[function(e,t,r){"use strict";var n,a=e("../is-object"),i=e("../valid-value"),o=Object.prototype.isPrototypeOf,s=Object.defineProperty,l={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(e,t){if(i(e),null===t||a(t))return e;throw new TypeError("Prototype must be null or an object")},t.exports=function(e){var t,r;return e?(2===e.level?e.set?(r=e.set,t=function(e,t){return r.call(n(e,t),t),e}):t=function(e,t){return n(e,t).__proto__=t,e}:t=function e(t,r){var a;return n(t,r),(a=o.call(e.nullPolyfill,t))&&delete e.nullPolyfill.__proto__,null===r&&(r=e.nullPolyfill),t.__proto__=r,a&&s(e.nullPolyfill,"__proto__",l),t},Object.defineProperty(t,"level",{configurable:!1,enumerable:!1,writable:!1,value:e.level})):null}(function(){var e,t=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(e=n.set).call(t,r)}catch(e){}if(Object.getPrototypeOf(t)===r)return{set:e,level:2}}return t.__proto__=r,Object.getPrototypeOf(t)===r?{level:2}:((t={}).__proto__=r,Object.getPrototypeOf(t)===r&&{level:1})}()),e("../create")},{"../create":148,"../is-object":150,"../valid-value":162}],160:[function(e,t,r){"use strict";t.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},{}],161:[function(e,t,r){"use strict";var n=e("./is-object");t.exports=function(e){if(!n(e))throw new TypeError(e+" is not an Object");return e}},{"./is-object":150}],162:[function(e,t,r){"use strict";var n=e("./is-value");t.exports=function(e){if(!n(e))throw new TypeError("Cannot use null or undefined");return e}},{"./is-value":151}],163:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?String.prototype.contains:e("./shim")},{"./is-implemented":164,"./shim":165}],164:[function(e,t,r){"use strict";var n="razdwatrzy";t.exports=function(){return"function"==typeof n.contains&&!0===n.contains("dwa")&&!1===n.contains("foo")}},{}],165:[function(e,t,r){"use strict";var n=String.prototype.indexOf;t.exports=function(e){return n.call(this,e,arguments[1])>-1}},{}],166:[function(e,t,r){"use strict";var n=Object.prototype.toString,a=n.call("");t.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||n.call(e)===a)||!1}},{}],167:[function(e,t,r){"use strict";var n=Object.create(null),a=Math.random;t.exports=function(){var e;do{e=a().toString(36).slice(2)}while(n[e]);return e}},{}],168:[function(e,t,r){"use strict";var n,a=e("es5-ext/object/set-prototype-of"),i=e("es5-ext/string/#/contains"),o=e("d"),s=e("es6-symbol"),l=e("./"),c=Object.defineProperty;n=t.exports=function(e,t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,e),t=t?i.call(t,"key+value")?"key+value":i.call(t,"key")?"key":"value":"value",c(this,"__kind__",o("",t))},a&&a(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),c(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":171,d:106,"es5-ext/object/set-prototype-of":157,"es5-ext/string/#/contains":163,"es6-symbol":175}],169:[function(e,t,r){"use strict";var n=e("es5-ext/function/is-arguments"),a=e("es5-ext/object/valid-callable"),i=e("es5-ext/string/is-string"),o=e("./get"),s=Array.isArray,l=Function.prototype.call,c=Array.prototype.some;t.exports=function(e,t){var r,u,f,p,h,d,m,g,y=arguments[2];if(s(e)||n(e)?r="array":i(e)?r="string":e=o(e),a(t),f=function(){p=!0},"array"!==r)if("string"!==r)for(u=e.next();!u.done;){if(l.call(t,y,u.value,f),p)return;u=e.next()}else for(d=e.length,h=0;h<d&&(m=e[h],h+1<d&&(g=m.charCodeAt(0))>=55296&&g<=56319&&(m+=e[++h]),l.call(t,y,m,f),!p);++h);else c.call(e,(function(e){return l.call(t,y,e,f),p}))}},{"./get":170,"es5-ext/function/is-arguments":135,"es5-ext/object/valid-callable":160,"es5-ext/string/is-string":166}],170:[function(e,t,r){"use strict";var n=e("es5-ext/function/is-arguments"),a=e("es5-ext/string/is-string"),i=e("./array"),o=e("./string"),s=e("./valid-iterable"),l=e("es6-symbol").iterator;t.exports=function(e){return"function"==typeof s(e)[l]?e[l]():n(e)?new i(e):a(e)?new o(e):new i(e)}},{"./array":168,"./string":173,"./valid-iterable":174,"es5-ext/function/is-arguments":135,"es5-ext/string/is-string":166,"es6-symbol":175}],171:[function(e,t,r){"use strict";var n,a=e("es5-ext/array/#/clear"),i=e("es5-ext/object/assign"),o=e("es5-ext/object/valid-callable"),s=e("es5-ext/object/valid-value"),l=e("d"),c=e("d/auto-bind"),u=e("es6-symbol"),f=Object.defineProperty,p=Object.defineProperties;t.exports=n=function(e,t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");p(this,{__list__:l("w",s(e)),__context__:l("w",t),__nextIndex__:l("w",0)}),t&&(o(t.on),t.on("_add",this._onAdd),t.on("_delete",this._onDelete),t.on("_clear",this._onClear))},delete n.prototype.constructor,p(n.prototype,i({_next:l((function(){var e;if(this.__list__)return this.__redo__&&void 0!==(e=this.__redo__.shift())?e:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()})),next:l((function(){return this._createResult(this._next())})),_createResult:l((function(e){return void 0===e?{done:!0,value:void 0}:{done:!1,value:this._resolve(e)}})),_resolve:l((function(e){return this.__list__[e]})),_unBind:l((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)})),toString:l((function(){return"[object "+(this[u.toStringTag]||"Object")+"]"}))},c({_onAdd:l((function(e){e>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(t,r){t>=e&&(this.__redo__[r]=++t)}),this),this.__redo__.push(e)):f(this,"__redo__",l("c",[e])))})),_onDelete:l((function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach((function(t,r){t>e&&(this.__redo__[r]=--t)}),this)))})),_onClear:l((function(){this.__redo__&&a.call(this.__redo__),this.__nextIndex__=0}))}))),f(n.prototype,u.iterator,l((function(){return this})))},{d:106,"d/auto-bind":105,"es5-ext/array/#/clear":131,"es5-ext/object/assign":144,"es5-ext/object/valid-callable":160,"es5-ext/object/valid-value":162,"es6-symbol":175}],172:[function(e,t,r){"use strict";var n=e("es5-ext/function/is-arguments"),a=e("es5-ext/object/is-value"),i=e("es5-ext/string/is-string"),o=e("es6-symbol").iterator,s=Array.isArray;t.exports=function(e){return!(!a(e)||!s(e)&&!i(e)&&!n(e)&&"function"!=typeof e[o])}},{"es5-ext/function/is-arguments":135,"es5-ext/object/is-value":151,"es5-ext/string/is-string":166,"es6-symbol":175}],173:[function(e,t,r){"use strict";var n,a=e("es5-ext/object/set-prototype-of"),i=e("d"),o=e("es6-symbol"),s=e("./"),l=Object.defineProperty;n=t.exports=function(e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");e=String(e),s.call(this,e),l(this,"__length__",i("",e.length))},a&&a(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()})),_resolve:i((function(e){var t,r=this.__list__[e];return this.__nextIndex__===this.__length__?r:(t=r.charCodeAt(0))>=55296&&t<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,i("c","String Iterator"))},{"./":171,d:106,"es5-ext/object/set-prototype-of":157,"es6-symbol":175}],174:[function(e,t,r){"use strict";var n=e("./is-iterable");t.exports=function(e){if(!n(e))throw new TypeError(e+" is not iterable");return e}},{"./is-iterable":172}],175:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?e("ext/global-this").Symbol:e("./polyfill")},{"./is-implemented":176,"./polyfill":181,"ext/global-this":188}],176:[function(e,t,r){"use strict";var n=e("ext/global-this"),a={object:!0,symbol:!0};t.exports=function(){var e,t=n.Symbol;if("function"!=typeof t)return!1;e=t("test symbol");try{String(e)}catch(e){return!1}return!!a[typeof t.iterator]&&!!a[typeof t.toPrimitive]&&!!a[typeof t.toStringTag]}},{"ext/global-this":188}],177:[function(e,t,r){"use strict";t.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&"Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag])}},{}],178:[function(e,t,r){"use strict";var n=e("d"),a=Object.create,i=Object.defineProperty,o=Object.prototype,s=a(null);t.exports=function(e){for(var t,r,a=0;s[e+(a||"")];)++a;return s[e+=a||""]=!0,i(o,t="@@"+e,n.gs(null,(function(e){r||(r=!0,i(this,t,n(e)),r=!1)}))),t}},{d:106}],179:[function(e,t,r){"use strict";var n=e("d"),a=e("ext/global-this").Symbol;t.exports=function(e){return Object.defineProperties(e,{hasInstance:n("",a&&a.hasInstance||e("hasInstance")),isConcatSpreadable:n("",a&&a.isConcatSpreadable||e("isConcatSpreadable")),iterator:n("",a&&a.iterator||e("iterator")),match:n("",a&&a.match||e("match")),replace:n("",a&&a.replace||e("replace")),search:n("",a&&a.search||e("search")),species:n("",a&&a.species||e("species")),split:n("",a&&a.split||e("split")),toPrimitive:n("",a&&a.toPrimitive||e("toPrimitive")),toStringTag:n("",a&&a.toStringTag||e("toStringTag")),unscopables:n("",a&&a.unscopables||e("unscopables"))})}},{d:106,"ext/global-this":188}],180:[function(e,t,r){"use strict";var n=e("d"),a=e("../../../validate-symbol"),i=Object.create(null);t.exports=function(e){return Object.defineProperties(e,{for:n((function(t){return i[t]?i[t]:i[t]=e(String(t))})),keyFor:n((function(e){var t;for(t in a(e),i)if(i[t]===e)return t}))})}},{"../../../validate-symbol":182,d:106}],181:[function(e,t,r){"use strict";var n,a,i,o=e("d"),s=e("./validate-symbol"),l=e("ext/global-this").Symbol,c=e("./lib/private/generate-name"),u=e("./lib/private/setup/standard-symbols"),f=e("./lib/private/setup/symbol-registry"),p=Object.create,h=Object.defineProperties,d=Object.defineProperty;if("function"==typeof l)try{String(l()),i=!0}catch(e){}else l=null;a=function(e){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return n(e)},t.exports=n=function e(t){var r;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return i?l(t):(r=p(a.prototype),t=void 0===t?"":String(t),h(r,{__description__:o("",t),__name__:o("",c(t))}))},u(n),f(n),h(a.prototype,{constructor:o(n),toString:o("",(function(){return this.__name__}))}),h(n.prototype,{toString:o((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:o((function(){return s(this)}))}),d(n.prototype,n.toPrimitive,o("",(function(){var e=s(this);return"symbol"==typeof e?e:e.toString()}))),d(n.prototype,n.toStringTag,o("c","Symbol")),d(a.prototype,n.toStringTag,o("c",n.prototype[n.toStringTag])),d(a.prototype,n.toPrimitive,o("c",n.prototype[n.toPrimitive]))},{"./lib/private/generate-name":178,"./lib/private/setup/standard-symbols":179,"./lib/private/setup/symbol-registry":180,"./validate-symbol":182,d:106,"ext/global-this":188}],182:[function(e,t,r){"use strict";var n=e("./is-symbol");t.exports=function(e){if(!n(e))throw new TypeError(e+" is not a symbol");return e}},{"./is-symbol":177}],183:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?WeakMap:e("./polyfill")},{"./is-implemented":184,"./polyfill":186}],184:[function(e,t,r){"use strict";t.exports=function(){var e,t;if("function"!=typeof WeakMap)return!1;try{e=new WeakMap([[t={},"one"],[{},"two"],[{},"three"]])}catch(e){return!1}return"[object WeakMap]"===String(e)&&"function"==typeof e.set&&e.set({},1)===e&&"function"==typeof e.delete&&"function"==typeof e.has&&"one"===e.get(t)}},{}],185:[function(e,t,r){"use strict";t.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},{}],186:[function(e,t,r){"use strict";var n,a=e("es5-ext/object/is-value"),i=e("es5-ext/object/set-prototype-of"),o=e("es5-ext/object/valid-object"),s=e("es5-ext/object/valid-value"),l=e("es5-ext/string/random-uniq"),c=e("d"),u=e("es6-iterator/get"),f=e("es6-iterator/for-of"),p=e("es6-symbol").toStringTag,h=e("./is-native-implemented"),d=Array.isArray,m=Object.defineProperty,g=Object.prototype.hasOwnProperty,y=Object.getPrototypeOf;t.exports=n=function(){var e,t=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return e=h&&i&&WeakMap!==n?i(new WeakMap,y(this)):this,a(t)&&(d(t)||(t=u(t))),m(e,"__weakMapData__",c("c","$weakMap$"+l())),t?(f(t,(function(t){s(t),e.set(t[0],t[1])})),e):e},h&&(i&&i(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:c(n)})),Object.defineProperties(n.prototype,{delete:c((function(e){return!!g.call(o(e),this.__weakMapData__)&&(delete e[this.__weakMapData__],!0)})),get:c((function(e){if(g.call(o(e),this.__weakMapData__))return e[this.__weakMapData__]})),has:c((function(e){return g.call(o(e),this.__weakMapData__)})),set:c((function(e,t){return m(o(e),this.__weakMapData__,c("c",t)),this})),toString:c((function(){return"[object WeakMap]"}))}),m(n.prototype,p,c("c","WeakMap"))},{"./is-native-implemented":185,d:106,"es5-ext/object/is-value":151,"es5-ext/object/set-prototype-of":157,"es5-ext/object/valid-object":161,"es5-ext/object/valid-value":162,"es5-ext/string/random-uniq":167,"es6-iterator/for-of":169,"es6-iterator/get":170,"es6-symbol":175}],187:[function(e,t,r){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},{}],188:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?globalThis:e("./implementation")},{"./implementation":187,"./is-implemented":189}],189:[function(e,t,r){"use strict";t.exports=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}},{}],190:[function(e,t,r){"use strict";var n=e("is-string-blank");t.exports=function(e){var t=typeof e;if("string"===t){var r=e;if(0==(e=+e)&&n(r))return!1}else if("number"!==t)return!1;return e-e<1}},{"is-string-blank":237}],191:[function(e,t,r){var n=e("dtype");t.exports=function(e,t,r){if(!e)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(e)&&e[0]&&"number"==typeof e[0][0]){var a,i,o,s,l=e[0].length,c=e.length*l;t&&"string"!=typeof t||(t=new(n(t||"float32"))(c+r));var u=t.length-r;if(c!==u)throw new Error("source length "+c+" ("+l+"x"+e.length+") does not match destination length "+u);for(a=0,o=r;a<e.length;a++)for(i=0;i<l;i++)t[o++]=null===e[a][i]?NaN:e[a][i]}else if(t&&"string"!=typeof t)t.set(e,r);else{var f=n(t||"float32");if(Array.isArray(e)||"array"===t)for(a=0,o=r,s=(t=new f(e.length+r)).length;o<s;o++,a++)t[o]=null===e[a]?NaN:e[a];else 0===r?t=new f(e):(t=new f(e.length+r)).set(e,r)}return t}},{dtype:127}],192:[function(e,t,r){"use strict";var n=e("css-font/stringify"),a=[32,126];t.exports=function(e){var t=(e=e||{}).shape?e.shape:e.canvas?[e.canvas.width,e.canvas.height]:[512,512],r=e.canvas||document.createElement("canvas"),i=e.font,o="number"==typeof e.step?[e.step,e.step]:e.step||[32,32],s=e.chars||a;if(i&&"string"!=typeof i&&(i=n(i)),Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);s=l}}else s=String(s).split("");t=t.slice(),r.width=t[0],r.height=t[1];var f=r.getContext("2d");f.fillStyle="#000",f.fillRect(0,0,r.width,r.height),f.font=i,f.textAlign="center",f.textBaseline="middle",f.fillStyle="#fff";var p=o[0]/2,h=o[1]/2;for(c=0;c<s.length;c++)f.fillText(s[c],p,h),(p+=o[0])>t[0]-o[0]/2&&(p=o[0]/2,h+=o[1]);return r}},{"css-font/stringify":102}],193:[function(e,t,r){"use strict";function n(e,t){t||(t={}),("string"==typeof e||Array.isArray(e))&&(t.family=e);var r=Array.isArray(t.family)?t.family.join(", "):t.family;if(!r)throw Error("`family` must be defined");var s=t.size||t.fontSize||t.em||48,l=t.weight||t.fontWeight||"",c=(e=[t.style||t.fontStyle||"",l,s].join(" ")+"px "+r,t.origin||"top");if(n.cache[r]&&s<=n.cache[r].em)return a(n.cache[r],c);var u=t.canvas||n.canvas,f=u.getContext("2d"),p={upper:void 0!==t.upper?t.upper:"H",lower:void 0!==t.lower?t.lower:"x",descent:void 0!==t.descent?t.descent:"p",ascent:void 0!==t.ascent?t.ascent:"h",tittle:void 0!==t.tittle?t.tittle:"i",overshoot:void 0!==t.overshoot?t.overshoot:"O"},h=Math.ceil(1.5*s);u.height=h,u.width=.5*h,f.font=e;var d={top:0};f.clearRect(0,0,h,h),f.textBaseline="top",f.fillStyle="black",f.fillText("H",0,0);var m=i(f.getImageData(0,0,h,h));f.clearRect(0,0,h,h),f.textBaseline="bottom",f.fillText("H",0,h);var g=i(f.getImageData(0,0,h,h));d.lineHeight=d.bottom=h-g+m,f.clearRect(0,0,h,h),f.textBaseline="alphabetic",f.fillText("H",0,h);var y=h-i(f.getImageData(0,0,h,h))-1+m;d.baseline=d.alphabetic=y,f.clearRect(0,0,h,h),f.textBaseline="middle",f.fillText("H",0,.5*h);var v=i(f.getImageData(0,0,h,h));d.median=d.middle=h-v-1+m-.5*h,f.clearRect(0,0,h,h),f.textBaseline="hanging",f.fillText("H",0,.5*h);var b=i(f.getImageData(0,0,h,h));d.hanging=h-b-1+m-.5*h,f.clearRect(0,0,h,h),f.textBaseline="ideographic",f.fillText("H",0,h);var x=i(f.getImageData(0,0,h,h));if(d.ideographic=h-x-1+m,p.upper&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.upper,0,0),d.upper=i(f.getImageData(0,0,h,h)),d.capHeight=d.baseline-d.upper),p.lower&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.lower,0,0),d.lower=i(f.getImageData(0,0,h,h)),d.xHeight=d.baseline-d.lower),p.tittle&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.tittle,0,0),d.tittle=i(f.getImageData(0,0,h,h))),p.ascent&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.ascent,0,0),d.ascent=i(f.getImageData(0,0,h,h))),p.descent&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.descent,0,0),d.descent=o(f.getImageData(0,0,h,h))),p.overshoot){f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.overshoot,0,0);var _=o(f.getImageData(0,0,h,h));d.overshoot=_-y}for(var w in d)d[w]/=s;return d.em=s,n.cache[r]=d,a(d,c)}function a(e,t){var r={};for(var n in"string"==typeof t&&(t=e[t]),e)"em"!==n&&(r[n]=e[n]-t);return r}function i(e){for(var t=e.height,r=e.data,n=3;n<r.length;n+=4)if(0!==r[n])return Math.floor(.25*(n-3)/t)}function o(e){for(var t=e.height,r=e.data,n=r.length-1;n>0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/t)}t.exports=n,n.canvas=document.createElement("canvas"),n.cache={}},{}],194:[function(e,t,r){t.exports=function(e,t){if("string"!=typeof e)throw new TypeError("must specify type string");if(t=t||{},"undefined"==typeof document&&!t.canvas)return null;var r=t.canvas||document.createElement("canvas");"number"==typeof t.width&&(r.width=t.width),"number"==typeof t.height&&(r.height=t.height);var n,a=t;try{var i=[e];0===e.indexOf("webgl")&&i.push("experimental-"+e);for(var o=0;o<i.length;o++)if(n=r.getContext(i[o],a))return n}catch(e){n=null}return n||null}},{}],195:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],p=t[10],h=t[11],d=t[12],m=t[13],g=t[14],y=t[15];return e[0]=s*(p*y-h*g)-f*(l*y-c*g)+m*(l*h-c*p),e[1]=-(n*(p*y-h*g)-f*(a*y-i*g)+m*(a*h-i*p)),e[2]=n*(l*y-c*g)-s*(a*y-i*g)+m*(a*c-i*l),e[3]=-(n*(l*h-c*p)-s*(a*h-i*p)+f*(a*c-i*l)),e[4]=-(o*(p*y-h*g)-u*(l*y-c*g)+d*(l*h-c*p)),e[5]=r*(p*y-h*g)-u*(a*y-i*g)+d*(a*h-i*p),e[6]=-(r*(l*y-c*g)-o*(a*y-i*g)+d*(a*c-i*l)),e[7]=r*(l*h-c*p)-o*(a*h-i*p)+u*(a*c-i*l),e[8]=o*(f*y-h*m)-u*(s*y-c*m)+d*(s*h-c*f),e[9]=-(r*(f*y-h*m)-u*(n*y-i*m)+d*(n*h-i*f)),e[10]=r*(s*y-c*m)-o*(n*y-i*m)+d*(n*c-i*s),e[11]=-(r*(s*h-c*f)-o*(n*h-i*f)+u*(n*c-i*s)),e[12]=-(o*(f*g-p*m)-u*(s*g-l*m)+d*(s*p-l*f)),e[13]=r*(f*g-p*m)-u*(n*g-a*m)+d*(n*p-a*f),e[14]=-(r*(s*g-l*m)-o*(n*g-a*m)+d*(n*l-a*s)),e[15]=r*(s*p-l*f)-o*(n*p-a*f)+u*(n*l-a*s),e}},{}],196:[function(e,t,r){t.exports=function(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],197:[function(e,t,r){t.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],198:[function(e,t,r){t.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],199:[function(e,t,r){t.exports=function(e){var t=e[0],r=e[1],n=e[2],a=e[3],i=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],f=e[10],p=e[11],h=e[12],d=e[13],m=e[14],g=e[15];return(t*o-r*i)*(f*g-p*m)-(t*s-n*i)*(u*g-p*d)+(t*l-a*i)*(u*m-f*d)+(r*s-n*o)*(c*g-p*h)-(r*l-a*o)*(c*m-f*h)+(n*l-a*s)*(c*d-u*h)}},{}],200:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r+r,s=n+n,l=a+a,c=r*o,u=n*o,f=n*s,p=a*o,h=a*s,d=a*l,m=i*o,g=i*s,y=i*l;return e[0]=1-f-d,e[1]=u+y,e[2]=p-g,e[3]=0,e[4]=u-y,e[5]=1-c-d,e[6]=h+m,e[7]=0,e[8]=p+g,e[9]=h-m,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],201:[function(e,t,r){t.exports=function(e,t,r){var n,a,i,o=r[0],s=r[1],l=r[2],c=Math.sqrt(o*o+s*s+l*l);return Math.abs(c)<1e-6?null:(o*=c=1/c,s*=c,l*=c,n=Math.sin(t),i=1-(a=Math.cos(t)),e[0]=o*o*i+a,e[1]=s*o*i+l*n,e[2]=l*o*i-s*n,e[3]=0,e[4]=o*s*i-l*n,e[5]=s*s*i+a,e[6]=l*s*i+o*n,e[7]=0,e[8]=o*l*i+s*n,e[9]=s*l*i-o*n,e[10]=l*l*i+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}},{}],202:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=n+n,l=a+a,c=i+i,u=n*s,f=n*l,p=n*c,h=a*l,d=a*c,m=i*c,g=o*s,y=o*l,v=o*c;return e[0]=1-(h+m),e[1]=f+v,e[2]=p-y,e[3]=0,e[4]=f-v,e[5]=1-(u+m),e[6]=d+g,e[7]=0,e[8]=p+y,e[9]=d-g,e[10]=1-(u+h),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}},{}],203:[function(e,t,r){t.exports=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],204:[function(e,t,r){t.exports=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}},{}],205:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],206:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],207:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],208:[function(e,t,r){t.exports=function(e,t,r,n,a,i,o){var s=1/(r-t),l=1/(a-n),c=1/(i-o);return e[0]=2*i*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*i*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(a+n)*l,e[10]=(o+i)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*i*2*c,e[15]=0,e}},{}],209:[function(e,t,r){t.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],210:[function(e,t,r){t.exports={create:e("./create"),clone:e("./clone"),copy:e("./copy"),identity:e("./identity"),transpose:e("./transpose"),invert:e("./invert"),adjoint:e("./adjoint"),determinant:e("./determinant"),multiply:e("./multiply"),translate:e("./translate"),scale:e("./scale"),rotate:e("./rotate"),rotateX:e("./rotateX"),rotateY:e("./rotateY"),rotateZ:e("./rotateZ"),fromRotation:e("./fromRotation"),fromRotationTranslation:e("./fromRotationTranslation"),fromScaling:e("./fromScaling"),fromTranslation:e("./fromTranslation"),fromXRotation:e("./fromXRotation"),fromYRotation:e("./fromYRotation"),fromZRotation:e("./fromZRotation"),fromQuat:e("./fromQuat"),frustum:e("./frustum"),perspective:e("./perspective"),perspectiveFromFieldOfView:e("./perspectiveFromFieldOfView"),ortho:e("./ortho"),lookAt:e("./lookAt"),str:e("./str")}},{"./adjoint":195,"./clone":196,"./copy":197,"./create":198,"./determinant":199,"./fromQuat":200,"./fromRotation":201,"./fromRotationTranslation":202,"./fromScaling":203,"./fromTranslation":204,"./fromXRotation":205,"./fromYRotation":206,"./fromZRotation":207,"./frustum":208,"./identity":209,"./invert":211,"./lookAt":212,"./multiply":213,"./ortho":214,"./perspective":215,"./perspectiveFromFieldOfView":216,"./rotate":217,"./rotateX":218,"./rotateY":219,"./rotateZ":220,"./scale":221,"./str":222,"./translate":223,"./transpose":224}],211:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],p=t[10],h=t[11],d=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,b=r*l-a*o,x=r*c-i*o,_=n*l-a*s,w=n*c-i*s,k=a*c-i*l,D=u*m-f*d,T=u*g-p*d,A=u*y-h*d,S=f*g-p*m,M=f*y-h*m,E=p*y-h*g,C=v*E-b*M+x*S+_*A-w*T+k*D;return C?(C=1/C,e[0]=(s*E-l*M+c*S)*C,e[1]=(a*M-n*E-i*S)*C,e[2]=(m*k-g*w+y*_)*C,e[3]=(p*w-f*k-h*_)*C,e[4]=(l*A-o*E-c*T)*C,e[5]=(r*E-a*A+i*T)*C,e[6]=(g*x-d*k-y*b)*C,e[7]=(u*k-p*x+h*b)*C,e[8]=(o*M-s*A+c*D)*C,e[9]=(n*A-r*M-i*D)*C,e[10]=(d*w-m*x+y*v)*C,e[11]=(f*x-u*w-h*v)*C,e[12]=(s*T-o*S-l*D)*C,e[13]=(r*S-n*T+a*D)*C,e[14]=(m*b-d*_-g*v)*C,e[15]=(u*_-f*b+p*v)*C,e):null}},{}],212:[function(e,t,r){var n=e("./identity");t.exports=function(e,t,r,a){var i,o,s,l,c,u,f,p,h,d,m=t[0],g=t[1],y=t[2],v=a[0],b=a[1],x=a[2],_=r[0],w=r[1],k=r[2];return Math.abs(m-_)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-k)<1e-6?n(e):(f=m-_,p=g-w,h=y-k,i=b*(h*=d=1/Math.sqrt(f*f+p*p+h*h))-x*(p*=d),o=x*(f*=d)-v*h,s=v*p-b*f,(d=Math.sqrt(i*i+o*o+s*s))?(i*=d=1/d,o*=d,s*=d):(i=0,o=0,s=0),l=p*s-h*o,c=h*i-f*s,u=f*o-p*i,(d=Math.sqrt(l*l+c*c+u*u))?(l*=d=1/d,c*=d,u*=d):(l=0,c=0,u=0),e[0]=i,e[1]=l,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=p,e[7]=0,e[8]=s,e[9]=u,e[10]=h,e[11]=0,e[12]=-(i*m+o*g+s*y),e[13]=-(l*m+c*g+u*y),e[14]=-(f*m+p*g+h*y),e[15]=1,e)}},{"./identity":209}],213:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],p=t[9],h=t[10],d=t[11],m=t[12],g=t[13],y=t[14],v=t[15],b=r[0],x=r[1],_=r[2],w=r[3];return e[0]=b*n+x*s+_*f+w*m,e[1]=b*a+x*l+_*p+w*g,e[2]=b*i+x*c+_*h+w*y,e[3]=b*o+x*u+_*d+w*v,b=r[4],x=r[5],_=r[6],w=r[7],e[4]=b*n+x*s+_*f+w*m,e[5]=b*a+x*l+_*p+w*g,e[6]=b*i+x*c+_*h+w*y,e[7]=b*o+x*u+_*d+w*v,b=r[8],x=r[9],_=r[10],w=r[11],e[8]=b*n+x*s+_*f+w*m,e[9]=b*a+x*l+_*p+w*g,e[10]=b*i+x*c+_*h+w*y,e[11]=b*o+x*u+_*d+w*v,b=r[12],x=r[13],_=r[14],w=r[15],e[12]=b*n+x*s+_*f+w*m,e[13]=b*a+x*l+_*p+w*g,e[14]=b*i+x*c+_*h+w*y,e[15]=b*o+x*u+_*d+w*v,e}},{}],214:[function(e,t,r){t.exports=function(e,t,r,n,a,i,o){var s=1/(t-r),l=1/(n-a),c=1/(i-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*l,e[14]=(o+i)*c,e[15]=1,e}},{}],215:[function(e,t,r){t.exports=function(e,t,r,n,a){var i=1/Math.tan(t/2),o=1/(n-a);return e[0]=i/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(a+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*a*n*o,e[15]=0,e}},{}],216:[function(e,t,r){t.exports=function(e,t,r,n){var a=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(a+i);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(o-s)*l*.5,e[9]=(a-i)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}},{}],217:[function(e,t,r){t.exports=function(e,t,r,n){var a,i,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,k,D,T,A,S,M=n[0],E=n[1],C=n[2],N=Math.sqrt(M*M+E*E+C*C);return Math.abs(N)<1e-6?null:(M*=N=1/N,E*=N,C*=N,a=Math.sin(r),o=1-(i=Math.cos(r)),s=t[0],l=t[1],c=t[2],u=t[3],f=t[4],p=t[5],h=t[6],d=t[7],m=t[8],g=t[9],y=t[10],v=t[11],b=M*M*o+i,x=E*M*o+C*a,_=C*M*o-E*a,w=M*E*o-C*a,k=E*E*o+i,D=C*E*o+M*a,T=M*C*o+E*a,A=E*C*o-M*a,S=C*C*o+i,e[0]=s*b+f*x+m*_,e[1]=l*b+p*x+g*_,e[2]=c*b+h*x+y*_,e[3]=u*b+d*x+v*_,e[4]=s*w+f*k+m*D,e[5]=l*w+p*k+g*D,e[6]=c*w+h*k+y*D,e[7]=u*w+d*k+v*D,e[8]=s*T+f*A+m*S,e[9]=l*T+p*A+g*S,e[10]=c*T+h*A+y*S,e[11]=u*T+d*A+v*S,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}},{}],218:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*a+c*n,e[5]=o*a+u*n,e[6]=s*a+f*n,e[7]=l*a+p*n,e[8]=c*a-i*n,e[9]=u*a-o*n,e[10]=f*a-s*n,e[11]=p*a-l*n,e}},{}],219:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],s=t[2],l=t[3],c=t[8],u=t[9],f=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*a-c*n,e[1]=o*a-u*n,e[2]=s*a-f*n,e[3]=l*a-p*n,e[8]=i*n+c*a,e[9]=o*n+u*a,e[10]=s*n+f*a,e[11]=l*n+p*a,e}},{}],220:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],f=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*a+c*n,e[1]=o*a+u*n,e[2]=s*a+f*n,e[3]=l*a+p*n,e[4]=c*a-i*n,e[5]=u*a-o*n,e[6]=f*a-s*n,e[7]=p*a-l*n,e}},{}],221:[function(e,t,r){t.exports=function(e,t,r){var n=r[0],a=r[1],i=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],222:[function(e,t,r){t.exports=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}},{}],223:[function(e,t,r){t.exports=function(e,t,r){var n,a,i,o,s,l,c,u,f,p,h,d,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],p=t[9],h=t[10],d=t[11],e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=f,e[9]=p,e[10]=h,e[11]=d,e[12]=n*m+s*g+f*y+t[12],e[13]=a*m+l*g+p*y+t[13],e[14]=i*m+c*g+h*y+t[14],e[15]=o*m+u*g+d*y+t[15]),e}},{}],224:[function(e,t,r){t.exports=function(e,t){if(e===t){var r=t[1],n=t[2],a=t[3],i=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=i,e[11]=t[14],e[12]=a,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},{}],225:[function(e,t,r){"use strict";var n=e("css-font"),a=e("pick-by-alias"),i=e("regl"),o=e("gl-util/context"),s=e("es6-weak-map"),l=e("color-normalize"),c=e("font-atlas"),u=e("typedarray-pool"),f=e("parse-rect"),p=e("is-plain-obj"),h=e("parse-unit"),d=e("to-px"),m=e("detect-kerning"),g=e("object-assign"),y=e("font-measure"),v=e("flatten-vertex-data"),b=e("bit-twiddle").nextPow2,x=new s,_=!1;if(document.body){var w=document.body.appendChild(document.createElement("div"));w.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(w).fontStretch&&(_=!0),document.body.removeChild(w)}var k=function(e){!function(e){return"function"==typeof e&&e._gl&&e.prop&&e.texture&&e.buffer}(e)?this.gl=o(e):(e={regl:e},this.gl=e.regl._gl),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=e.regl||i({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(p(e)?e:{})};k.prototype.createShader=function(){var e=this.regl,t=e({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:e.prop("count"),offset:e.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:e.this("sizeBuffer")},width:{offset:0,stride:8,buffer:e.this("sizeBuffer")},char:e.this("charBuffer"),position:e.this("position")},uniforms:{atlasSize:function(e,t){return[t.atlas.width,t.atlas.height]},atlasDim:function(e,t){return[t.atlas.cols,t.atlas.rows]},atlas:function(e,t){return t.atlas.texture},charStep:function(e,t){return t.atlas.step},em:function(e,t){return t.atlas.em},color:e.prop("color"),opacity:e.prop("opacity"),viewport:e.this("viewportArray"),scale:e.this("scale"),align:e.prop("align"),baseline:e.prop("baseline"),translate:e.this("translate"),positionOffset:e.prop("positionOffset")},primitive:"points",viewport:e.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:e,draw:t,atlas:{}}},k.prototype.update=function(e){var t=this;if("string"==typeof e)e={text:e};else if(!e)return;null!=(e=a(e,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(e.opacity)?this.opacity=e.opacity.map((function(e){return parseFloat(e)})):this.opacity=parseFloat(e.opacity)),null!=e.viewport&&(this.viewport=f(e.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=e.kerning&&(this.kerning=e.kerning),null!=e.offset&&("number"==typeof e.offset&&(e.offset=[e.offset,0]),this.positionOffset=v(e.offset)),e.direction&&(this.direction=e.direction),e.range&&(this.range=e.range,this.scale=[1/(e.range[2]-e.range[0]),1/(e.range[3]-e.range[1])],this.translate=[-e.range[0],-e.range[1]]),e.scale&&(this.scale=e.scale),e.translate&&(this.translate=e.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||e.font||(e.font=k.baseFontSize+"px sans-serif");var r,i=!1,o=!1;if(e.font&&(Array.isArray(e.font)?e.font:[e.font]).forEach((function(e,r){if("string"==typeof e)try{e=n.parse(e)}catch(t){e=n.parse(k.baseFontSize+"px "+e)}else e=n.parse(n.stringify(e));var a=n.stringify({size:k.baseFontSize,family:e.family,stretch:_?e.stretch:void 0,variant:e.variant,weight:e.weight,style:e.style}),s=h(e.size),l=Math.round(s[0]*d(s[1]));if(l!==t.fontSize[r]&&(o=!0,t.fontSize[r]=l),!(t.font[r]&&a==t.font[r].baseString||(i=!0,t.font[r]=k.fonts[a],t.font[r]))){var c=e.family.join(", "),u=[e.style];e.style!=e.variant&&u.push(e.variant),e.variant!=e.weight&&u.push(e.weight),_&&e.weight!=e.stretch&&u.push(e.stretch),t.font[r]={baseString:a,family:c,weight:e.weight,stretch:e.stretch,style:e.style,variant:e.variant,width:{},kerning:{},metrics:y(c,{origin:"top",fontSize:k.baseFontSize,fontStyle:u.join(" ")})},k.fonts[a]=t.font[r]}})),(i||o)&&this.font.forEach((function(r,a){var i=n.stringify({size:t.fontSize[a],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(t.fontAtlas[a]=t.shader.atlas[i],!t.fontAtlas[a]){var o=r.metrics;t.shader.atlas[i]=t.fontAtlas[a]={fontString:i,step:2*Math.ceil(t.fontSize[a]*o.bottom*.5),em:t.fontSize[a],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:t.regl.texture()}}null==e.text&&(e.text=t.text)})),"string"==typeof e.text&&e.position&&e.position.length>2){for(var s=Array(.5*e.position.length),p=0;p<s.length;p++)s[p]=e.text;e.text=s}if(null!=e.text||i){if(this.textOffsets=[0],Array.isArray(e.text)){this.count=e.text[0].length,this.counts=[this.count];for(var x=1;x<e.text.length;x++)this.textOffsets[x]=this.textOffsets[x-1]+e.text[x-1].length,this.count+=e.text[x].length,this.counts.push(e.text[x].length);this.text=e.text.join("")}else this.text=e.text,this.count=this.text.length,this.counts=[this.count];r=[],this.font.forEach((function(e,n){k.atlasContext.font=e.baseString;for(var a=t.fontAtlas[n],i=0;i<t.text.length;i++){var o=t.text.charAt(i);if(null==a.ids[o]&&(a.ids[o]=a.chars.length,a.chars.push(o),r.push(o)),null==e.width[o]&&(e.width[o]=k.atlasContext.measureText(o).width/k.baseFontSize,t.kerning)){var s=[];for(var l in e.width)s.push(l+o,o+l);g(e.kerning,m(e.family,{pairs:s}))}}}))}if(e.position)if(e.position.length>2){for(var w=!e.position[0].length,D=u.mallocFloat(2*this.count),T=0,A=0;T<this.counts.length;T++){var S=this.counts[T];if(w)for(var M=0;M<S;M++)D[A++]=e.position[2*T],D[A++]=e.position[2*T+1];else for(var E=0;E<S;E++)D[A++]=e.position[T][0],D[A++]=e.position[T][1]}this.position.call?this.position({type:"float",data:D}):this.position=this.regl.buffer({type:"float",data:D}),u.freeFloat(D)}else this.position.destroy&&this.position.destroy(),this.position={constant:e.position};if(e.text||i){var C=u.mallocUint8(this.count),N=u.mallocFloat(2*this.count);this.textWidth=[];for(var O=0,I=0;O<this.counts.length;O++){for(var P=this.counts[O],R=this.font[O]||this.font[0],L=this.fontAtlas[O]||this.fontAtlas[0],F=0;F<P;F++){var B=this.text.charAt(I),z=this.text.charAt(I-1);if(C[I]=L.ids[B],N[2*I]=R.width[B],F){var j=N[2*I-2],U=N[2*I],$=N[2*I-1]+.5*j+.5*U;if(this.kerning){var V=R.kerning[z+B];V&&($+=.001*V)}N[2*I+1]=$}else N[2*I+1]=.5*N[2*I];I++}this.textWidth.push(N.length?.5*N[2*I-2]+N[2*I-1]:0)}e.align||(e.align=this.align),this.charBuffer({data:C,type:"uint8",usage:"stream"}),this.sizeBuffer({data:N,type:"float",usage:"stream"}),u.freeUint8(C),u.freeFloat(N),r.length&&this.font.forEach((function(e,r){var n=t.fontAtlas[r],a=n.step,i=Math.floor(k.maxAtlasSize/a),o=Math.min(i,n.chars.length),s=Math.ceil(n.chars.length/o),l=b(o*a),u=b(s*a);n.width=l,n.height=u,n.rows=s,n.cols=o,n.em&&n.texture({data:c({canvas:k.atlasCanvas,font:n.fontString,chars:n.chars,shape:[l,u],step:[a,a]})})}))}if(e.align&&(this.align=e.align,this.alignOffset=this.textWidth.map((function(e,r){var n=Array.isArray(t.align)?t.align.length>1?t.align[r]:t.align[0]:t.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-e;case"center":case"centre":case"middle":return.5*-e}return 0}))),null==this.baseline&&null==e.baseline&&(e.baseline=0),null!=e.baseline&&(this.baseline=e.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(e,r){var n=(t.font[r]||t.font[0]).metrics,a=0;return-1*((a+=.5*n.bottom)+("number"==typeof e?e-n.baseline:-n[e]))}))),null!=e.color)if(e.color||(e.color="transparent"),"string"!=typeof e.color&&isNaN(e.color)){var q;if("number"==typeof e.color[0]&&e.color.length>this.counts.length){var W=e.color.length;q=u.mallocUint8(W);for(var H=(e.color.subarray||e.color.slice).bind(e.color),G=0;G<W;G+=4)q.set(l(H(G,G+4),"uint8"),G)}else{var X=e.color.length;q=u.mallocUint8(4*X);for(var Y=0;Y<X;Y++)q.set(l(e.color[Y]||0,"uint8"),4*Y)}this.color=q}else this.color=l(e.color,"uint8");if(e.position||e.text||e.color||e.baseline||e.align||e.font||e.offset||e.opacity)if(this.color.length>4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var Z=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(Z);for(var K=0;K<this.batch.length;K++)this.batch[K]={count:this.counts.length>1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},k.prototype.destroy=function(){},k.prototype.kerning=!0,k.prototype.position={constant:new Float32Array(2)},k.prototype.translate=null,k.prototype.scale=null,k.prototype.font=null,k.prototype.text="",k.prototype.positionOffset=[0,0],k.prototype.opacity=1,k.prototype.color=new Uint8Array([0,0,0,255]),k.prototype.alignOffset=[0,0],k.maxAtlasSize=1024,k.atlasCanvas=document.createElement("canvas"),k.atlasContext=k.atlasCanvas.getContext("2d",{alpha:!1}),k.baseFontSize=64,k.fonts={},t.exports=k},{"bit-twiddle":81,"color-normalize":89,"css-font":99,"detect-kerning":125,"es6-weak-map":183,"flatten-vertex-data":191,"font-atlas":192,"font-measure":193,"gl-util/context":226,"is-plain-obj":236,"object-assign":247,"parse-rect":249,"parse-unit":251,"pick-by-alias":253,regl:283,"to-px":314,"typedarray-pool":327}],226:[function(e,t,n){(function(r){(function(){"use strict";var n=e("pick-by-alias");function a(e){if(e.container)if(e.container==document.body)document.body.style.width||(e.canvas.width=e.width||e.pixelRatio*r.innerWidth),document.body.style.height||(e.canvas.height=e.height||e.pixelRatio*r.innerHeight);else{var t=e.container.getBoundingClientRect();e.canvas.width=e.width||t.right-t.left,e.canvas.height=e.height||t.bottom-t.top}}function i(e){return"function"==typeof e.getContext&&"width"in e&&"height"in e}function o(){var e=document.createElement("canvas");return e.style.position="absolute",e.style.top=0,e.style.left=0,e}t.exports=function(e){var t;if(e?"string"==typeof e&&(e={container:e}):e={},(e=i(e)||"string"==typeof(t=e).nodeName&&"function"==typeof t.appendChild&&"function"==typeof t.getBoundingClientRect?{container:e}:function(e){return"function"==typeof e.drawArrays||"function"==typeof e.drawElements}(e)?{gl:e}:n(e,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(e.pixelRatio=r.pixelRatio||1),e.gl)return e.gl;if(e.canvas&&(e.container=e.canvas.parentNode),e.container){if("string"==typeof e.container){var s=document.querySelector(e.container);if(!s)throw Error("Element "+e.container+" is not found");e.container=s}i(e.container)?(e.canvas=e.container,e.container=e.canvas.parentNode):e.canvas||(e.canvas=o(),e.container.appendChild(e.canvas),a(e))}else if(!e.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");e.container=document.body||document.documentElement,e.canvas=o(),e.container.appendChild(e.canvas),a(e)}return e.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(t){try{e.gl=e.canvas.getContext(t,e.attrs)}catch(e){}return e.gl})),e.gl}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"pick-by-alias":253}],227:[function(e,t,r){t.exports=function(e){"string"==typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n<e.length-1;n++)r.push(e[n],t[n]||"");return r.push(e[n]),r.join("")}},{}],228:[function(e,t,n){(function(r){(function(){"use strict";var n,a=e("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,t.exports=n}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":232}],229:[function(e,t,r){"use strict";var n=e("is-browser");t.exports=n&&function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){e=!1}return e}()},{"is-browser":232}],230:[function(e,t,r){r.read=function(e,t,r,n,a){var i,o,s=8*a-n-1,l=(1<<s)-1,c=l>>1,u=-7,f=r?a-1:0,p=r?-1:1,h=e[t+f];for(f+=p,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+f],f+=p,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+e[t+f],f+=p,u-=8);if(0===i)i=1-c;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),i-=c}return(h?-1:1)*o*Math.pow(2,i-n)},r.write=function(e,t,r,n,a,i){var o,s,l,c=8*i-a-1,u=(1<<c)-1,f=u>>1,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=n?1:-1,m=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=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?p/l:p*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(t*l-1)*Math.pow(2,a),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;e[r+h]=255&s,h+=d,s/=256,a-=8);for(o=o<<a|s,c+=a;c>0;e[r+h]=255&o,h+=d,o/=256,c-=8);e[r+h-d]|=128*m}},{}],231:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],232:[function(e,t,r){t.exports=!0},{}],233:[function(e,t,r){"use strict";t.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},{}],234:[function(e,t,r){"use strict";t.exports=i,t.exports.isMobile=i,t.exports.default=i;var n=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(e){e||(e={});var t=e.ua;if(t||"undefined"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!=typeof t)return!1;var r=e.tablet?a.test(t):n.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(r=!0),r}},{}],235:[function(e,t,r){"use strict";t.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},{}],236:[function(e,t,r){"use strict";var n=Object.prototype.toString;t.exports=function(e){var t;return"[object Object]"===n.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}},{}],237:[function(e,t,r){"use strict";t.exports=function(e){for(var t,r=e.length,n=0;n<r;n++)if(((t=e.charCodeAt(n))<9||t>13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},{}],238:[function(e,t,r){"use strict";t.exports=function(e){return"string"==typeof e&&(e=e.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(e)&&/[\dz]$/i.test(e)&&e.length>4))}},{}],239:[function(e,t,r){!function(e,n){"object"==typeof r&&void 0!==t?t.exports=n():(e=e||self).mapboxgl=n()}(this,(function(){"use strict";var e,t,r;function n(n,a){if(e)if(t){var i="var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk);",o={};e(o),(r=a(o)).workerUrl=window.URL.createObjectURL(new Blob([i],{type:"text/javascript"}))}else t=a;else e=a}return n(0,(function(e){function t(e,t){return e(t={exports:{}},t.exports),t.exports}var r=n;function n(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=n,this.p2x=r,this.p2y=n}n.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},n.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},n.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},n.prototype.solveCurveX=function(e,t){var r,n,a,i,o;for(void 0===t&&(t=1e-6),a=e,o=0;o<8;o++){if(i=this.sampleCurveX(a)-e,Math.abs(i)<t)return a;var s=this.sampleCurveDerivativeX(a);if(Math.abs(s)<1e-6)break;a-=i/s}if((a=e)<(r=0))return r;if(a>(n=1))return n;for(;r<n;){if(i=this.sampleCurveX(a),Math.abs(i-e)<t)return a;e>i?r=a:n=a,a=.5*(n-r)+r}return a},n.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var a=i;function i(e,t){this.x=e,this.y=t}function o(e,t,n,a){var i=new r(e,t,n,a);return function(e){return i.solve(e)}}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,a=r*this.x+t*this.y;return this.x=n,this.y=a,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),a=t.x+r*(this.x-t.x)-n*(this.y-t.y),i=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=a,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(e){return e instanceof i?e:Array.isArray(e)?new i(e[0],e[1]):e};var s=o(.25,.1,.25,1);function l(e,t,r){return Math.min(r,Math.max(t,e))}function c(e,t,r){var n=r-t,a=((e-t)%n+n)%n+t;return a===t?r:a}function u(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,a=t;n<a.length;n+=1){var i=a[n];for(var o in i)e[o]=i[o]}return e}var f=1;function p(){return f++}function h(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function d(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function m(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function g(e,t){return-1!==e.indexOf(t,e.length-t.length)}function y(e,t,r){var n={};for(var a in e)n[a]=t.call(r||this,e[a],a,e);return n}function v(e,t,r){var n={};for(var a in e)t.call(r||this,e[a],a,e)&&(n[a]=e[a]);return n}function b(e){return Array.isArray(e)?e.map(b):"object"==typeof e&&e?y(e,b):e}var x={};function _(e){x[e]||("undefined"!=typeof console&&console.warn(e),x[e]=!0)}function w(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function k(e){for(var t=0,r=0,n=e.length,a=n-1,i=void 0,o=void 0;r<n;a=r++)i=e[r],t+=((o=e[a]).x-i.x)*(i.y+o.y);return t}function D(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function T(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(e,r,n,a){var i=n||a;return t[r]=!i||i.toLowerCase(),""})),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var A=null;function S(e){if(null==A){var t=e.navigator?e.navigator.userAgent:null;A=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return A}function M(e){try{var t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}}var E,C,N,O,I=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),P=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,R=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,L={now:I,frame:function(e){var t=P(e);return{cancel:function(){return R(t)}}},getImageData:function(e,t){void 0===t&&(t=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return E||(E=self.document.createElement("a")),E.href=e,E.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==C&&(C=self.matchMedia("(prefers-reduced-motion: reduce)")),C.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},B={supported:!1,testSupport:function(e){!z&&O&&(j?U(e):N=e)}},z=!1,j=!1;function U(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,O),e.isContextLost())return;B.supported=!0}catch(e){}e.deleteTexture(t),z=!0}self.document&&((O=self.document.createElement("img")).onload=function(){N&&U(N),N=null,j=!0},O.onerror=function(){z=!0,N=null},O.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var $="01",V=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function q(e){return 0===e.indexOf("mapbox:")}V.prototype._createSkuToken=function(){var e=function(){for(var e="",t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",$,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},V.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},V.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},V.prototype.normalizeStyleURL=function(e,t){if(!q(e))return e;var r=X(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},V.prototype.normalizeGlyphsURL=function(e,t){if(!q(e))return e;var r=X(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},V.prototype.normalizeSourceURL=function(e,t){if(!q(e))return e;var r=X(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},V.prototype.normalizeSpriteURL=function(e,t,r,n){var a=X(e);return q(e)?(a.path="/styles/v1"+a.path+"/sprite"+t+r,this._makeAPIURL(a,this._customAccessToken||n)):(a.path+=""+t+r,Y(a))},V.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!q(e))return e;var r=X(e),n=L.devicePixelRatio>=2||512===t?"@2x":"",a=B.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+a),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var i=this._customAccessToken||function(e){for(var t=0,r=e;t<r.length;t+=1){var n=r[t].match(/^access_token=(.*)$/);if(n)return n[1]}return null}(r.params)||F.ACCESS_TOKEN;return F.REQUIRE_ACCESS_TOKEN&&i&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,i)},V.prototype.canonicalizeTileURL=function(e,t){var r=X(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var n="mapbox://tiles/";n+=r.path.replace("/v4/","");var a=r.params;return t&&(a=a.filter((function(e){return!e.match(/^access_token=/)}))),a.length&&(n+="?"+a.join("&")),n},V.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&q(t),n=[],a=0,i=e.tiles||[];a<i.length;a+=1){var o=i[a];H(o)?n.push(this.canonicalizeTileURL(o,r)):n.push(o)}return n},V.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=X(F.API_URL);if(e.protocol=n.protocol,e.authority=n.authority,"/"!==n.path&&(e.path=""+n.path+e.path),!F.REQUIRE_ACCESS_TOKEN)return Y(e);if(!(t=t||F.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===t[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(e){return-1===e.indexOf("access_token")})),e.params.push("access_token="+t),Y(e)};var W=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function H(e){return W.test(e)}var G=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function X(e){var t=e.match(G);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Y(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}function Z(e){if(!e)return null;var t,r=e.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((t=r[1],decodeURIComponent(self.atob(t).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(e){return null}}var K=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};K.prototype.getStorageKey=function(e){var t,r=Z(F.ACCESS_TOKEN),n="";return r&&r.u?(t=r.u,n=self.btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(Number("0x"+t))})))):n=F.ACCESS_TOKEN||"",e?"mapbox.eventData."+e+":"+n:"mapbox.eventData:"+n},K.prototype.fetchEventData=function(){var e=M("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var n=self.localStorage.getItem(t);n&&(this.eventData=JSON.parse(n));var a=self.localStorage.getItem(r);a&&(this.anonId=a)}catch(e){_("Unable to read from LocalStorage")}},K.prototype.saveEventData=function(){var e=M("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(t,JSON.stringify(this.eventData))}catch(e){_("Unable to write to LocalStorage")}},K.prototype.processRequests=function(e){},K.prototype.postEvent=function(e,t,r,n){var a=this;if(F.EVENTS_URL){var i=X(F.EVENTS_URL);i.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.10.1",skuId:$,userId:this.anonId},s=t?u(o,t):o,l={url:Y(i),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=xe(l,(function(e){a.pendingRequest=null,r(e),a.saveEventData(),a.processRequests(n)}))}},K.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var J,Q,ee=function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postMapLoadEvent=function(e,t,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return q(e)||H(e)})))&&this.queueRequest({id:t,timestamp:Date.now()},n)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,a=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=h()),this.postEvent(a,{skuToken:this.skuToken},(function(e){e||n&&(t.success[n]=!0)}),e))}},t}(K),te=new(function(e){function t(t){e.call(this,"appUserTurnstile"),this._customAccessToken=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postTurnstileEvent=function(e,t){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return q(e)||H(e)}))&&this.queueRequest(Date.now(),t)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=Z(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,a=n!==this.eventData.tokenU;d(this.anonId)||(this.anonId=h(),a=!0);var i=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(i),l=(i-this.eventData.lastSuccess)/864e5;a=a||l>=1||l<-1||o.getDate()!==s.getDate()}else a=!0;if(!a)return this.processRequests();this.postEvent(i,{"enabled.telemetry":!1},(function(e){e||(t.eventData.lastSuccess=i,t.eventData.tokenU=n)}),e)}},t}(K)),re=te.postTurnstileEvent.bind(te),ne=new ee,ae=ne.postMapLoadEvent.bind(ne),ie=500,oe=50;function se(){self.caches&&!J&&(J=self.caches.open("mapbox-tiles"))}function le(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var ce,ue=1/0;function fe(){return null==ce&&(ce=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ce}var pe={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(pe);var he=function(e){function t(t,r,n){401===r&&H(n)&&(t+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,t),this.status=r,this.url=n,this.name=this.constructor.name,this.message=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t}(Error),de=D()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function me(e,t){var r,n=new self.AbortController,a=new self.Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:de(),signal:n.signal}),i=!1,o=!1,s=(r=a.url).indexOf("sku=")>0&&H(r);"json"===e.type&&a.headers.set("Accept","application/json");var l=function(r,n,i){if(!o){if(r&&"SecurityError"!==r.message&&_(r),n&&i)return c(n);var l=Date.now();self.fetch(a).then((function(r){if(r.ok){var n=s?r.clone():null;return c(r,n,l)}return t(new he(r.statusText,r.status,e.url))})).catch((function(e){20!==e.code&&t(new Error(e.message))}))}},c=function(r,n,s){("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((function(e){o||(n&&s&&function(e,t,r){if(se(),J){var n={status:t.status,statusText:t.statusText,headers:new self.Headers};t.headers.forEach((function(e,t){return n.headers.set(t,e)}));var a=T(t.headers.get("Cache-Control")||"");a["no-store"]||(a["max-age"]&&n.headers.set("Expires",new Date(r+1e3*a["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(e,t){if(void 0===Q)try{new Response(new ReadableStream),Q=!0}catch(e){Q=!1}Q?t(e.body):e.blob().then(t)}(t,(function(t){var r=new self.Response(t,n);se(),J&&J.then((function(t){return t.put(le(e.url),r)})).catch((function(e){return _(e.message)}))})))}}(a,n,s),i=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(e){o||t(new Error(e.message))}))};return s?function(e,t){if(se(),!J)return t(null);var r=le(e.url);J.then((function(e){e.match(r).then((function(n){var a=function(e){if(!e)return!1;var t=new Date(e.headers.get("Expires")||0),r=T(e.headers.get("Cache-Control")||"");return t>Date.now()&&!r["no-cache"]}(n);e.delete(r),a&&e.put(r,n.clone()),t(null,n,a)})).catch(t)})).catch(t)}(a,l):l(null,null),{cancel:function(){o=!0,i||n.abort()}}}var ge,ye,ve=function(e,t){if(r=e.url,!(/^file:/.test(r)||/^file:/.test(de())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return me(e,t);if(D()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(e,t){var r=new self.XMLHttpRequest;for(var n in r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer"),e.headers)r.setRequestHeader(n,e.headers[n]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=function(){t(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(e){return t(e)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new he(r.statusText,r.status,e.url))},r.send(e.body),{cancel:function(){return r.abort()}}}(e,t)},be=function(e,t){return ve(u(e,{type:"arrayBuffer"}),t)},xe=function(e,t){return ve(u(e,{method:"POST"}),t)};ge=[],ye=0;var _e=function(e,t){if(B.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),ye>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return ge.push(r),r}ye++;var n=!1,a=function(){if(!n)for(n=!0,ye--;ge.length&&ye<F.MAX_PARALLEL_IMAGE_REQUESTS;){var e=ge.shift(),t=e.requestParameters,r=e.callback;e.cancelled||(e.cancel=_e(t,r).cancel)}},i=be(e,(function(e,r,n,i){a(),e?t(e):r&&(fe()?function(e,t){var r=new self.Blob([new Uint8Array(e)],{type:"image/png"});self.createImageBitmap(r).then((function(e){t(null,e)})).catch((function(e){t(new Error("Could not load image because of "+e.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(r,t):function(e,t,r,n){var a=new self.Image,i=self.URL;a.onload=function(){t(null,a),i.revokeObjectURL(a.src)},a.onerror=function(){return t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new self.Blob([new Uint8Array(e)],{type:"image/png"});a.cacheControl=r,a.expires=n,a.src=e.byteLength?i.createObjectURL(o):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}(r,t,n,i))}));return{cancel:function(){i.cancel(),a()}}};function we(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function ke(e,t,r){if(r&&r[e]){var n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}var De=function(e,t){void 0===t&&(t={}),u(this,t),this.type=e},Te=function(e){function t(t,r){void 0===r&&(r={}),e.call(this,"error",u({error:t},r))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(De),Ae=function(){};Ae.prototype.on=function(e,t){return this._listeners=this._listeners||{},we(e,t,this._listeners),this},Ae.prototype.off=function(e,t){return ke(e,t,this._listeners),ke(e,t,this._oneTimeListeners),this},Ae.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},we(e,t,this._oneTimeListeners),this},Ae.prototype.fire=function(e,t){"string"==typeof e&&(e=new De(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var n=0,a=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<a.length;n+=1)a[n].call(this,e);for(var i=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];i<o.length;i+=1){var s=o[i];ke(r,s,this._oneTimeListeners),s.call(this,e)}var l=this._eventedParent;l&&(u(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(e))}else e instanceof Te&&console.error(e.error);return this},Ae.prototype.listens=function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},Ae.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var Se={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Me=function(e,t,r,n){this.message=(e?e+": ":"")+r,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)};function Ee(e){var t=e.key,r=e.value;return r?[new Me(t,r,"constants have been deprecated as of v8")]:[]}function Ce(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,a=t;n<a.length;n+=1){var i=a[n];for(var o in i)e[o]=i[o]}return e}function Ne(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Oe(e){if(Array.isArray(e))return e.map(Oe);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=Oe(e[r]);return t}return Ne(e)}var Ie=function(e){function t(t,r){e.call(this,r),this.message=r,this.key=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),Pe=function(e,t){void 0===t&&(t=[]),this.parent=e,this.bindings={};for(var r=0,n=t;r<n.length;r+=1){var a=n[r],i=a[0],o=a[1];this.bindings[i]=o}};Pe.prototype.concat=function(e){return new Pe(this,e)},Pe.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},Pe.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Re={kind:"null"},Le={kind:"number"},Fe={kind:"string"},Be={kind:"boolean"},ze={kind:"color"},je={kind:"object"},Ue={kind:"value"},$e={kind:"collator"},Ve={kind:"formatted"},qe={kind:"resolvedImage"};function We(e,t){return{kind:"array",itemType:e,N:t}}function He(e){if("array"===e.kind){var t=He(e.itemType);return"number"==typeof e.N?"array<"+t+", "+e.N+">":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var Ge=[Re,Le,Fe,Be,ze,Ve,je,We(Ue),qe];function Xe(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Xe(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var r=0,n=Ge;r<n.length;r+=1)if(!Xe(n[r],t))return null}return"Expected "+He(e)+" but found "+He(t)+" instead."}function Ye(e,t){return t.some((function(t){return t.kind===e.kind}))}function Ze(e,t){return t.some((function(t){return"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e}))}var Ke=t((function(e,t){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(e){return(e=Math.round(e))<0?0:e>255?255:e}function a(e){return e<0?0:e>1?1:e}function i(e){return"%"===e[e.length-1]?n(parseFloat(e)/100*255):n(parseInt(e))}function o(e){return"%"===e[e.length-1]?a(parseFloat(e)/100):a(parseFloat(e))}function s(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{t.parseCSSColor=function(e){var t,a=e.replace(/ /g,"").toLowerCase();if(a in r)return r[a].slice();if("#"===a[0])return 4===a.length?(t=parseInt(a.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===a.length&&(t=parseInt(a.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=a.indexOf("("),c=a.indexOf(")");if(-1!==l&&c+1===a.length){var u=a.substr(0,l),f=a.substr(l+1,c-(l+1)).split(","),p=1;switch(u){case"rgba":if(4!==f.length)return null;p=o(f.pop());case"rgb":return 3!==f.length?null:[i(f[0]),i(f[1]),i(f[2]),p];case"hsla":if(4!==f.length)return null;p=o(f.pop());case"hsl":if(3!==f.length)return null;var h=(parseFloat(f[0])%360+360)%360/360,d=o(f[1]),m=o(f[2]),g=m<=.5?m*(d+1):m+d-m*d,y=2*m-g;return[n(255*s(y,g,h+1/3)),n(255*s(y,g,h)),n(255*s(y,g,h-1/3)),p];default:return null}}return null}}catch(e){}})).parseCSSColor,Je=function(e,t,r,n){void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n};Je.parse=function(e){if(e){if(e instanceof Je)return e;if("string"==typeof e){var t=Ke(e);if(t)return new Je(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Je.prototype.toString=function(){var e=this.toArray(),t=e[0],r=e[1],n=e[2],a=e[3];return"rgba("+Math.round(t)+","+Math.round(r)+","+Math.round(n)+","+a+")"},Je.prototype.toArray=function(){var e=this.r,t=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*e/n,255*t/n,255*r/n,n]},Je.black=new Je(0,0,0,1),Je.white=new Je(1,1,1,1),Je.transparent=new Je(0,0,0,0),Je.red=new Je(1,0,0,1);var Qe=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Qe.prototype.compare=function(e,t){return this.collator.compare(e,t)},Qe.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var et=function(e,t,r,n,a){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=a},tt=function(e){this.sections=e};tt.fromString=function(e){return new tt([new et(e,null,null,null,null)])},tt.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))},tt.factory=function(e){return e instanceof tt?e:tt.fromString(e)},tt.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")},tt.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var n=r[t];if(n.image)e.push(["image",n.image.name]);else{e.push(n.text);var a={};n.fontStack&&(a["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(a["font-scale"]=n.scale),n.textColor&&(a["text-color"]=["rgba"].concat(n.textColor.toArray())),e.push(a)}}return e};var rt=function(e){this.name=e.name,this.available=e.available};function nt(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[e,t,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function at(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Je)return!0;if(e instanceof Qe)return!0;if(e instanceof tt)return!0;if(e instanceof rt)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!at(r[t]))return!1;return!0}if("object"==typeof e){for(var n in e)if(!at(e[n]))return!1;return!0}return!1}function it(e){if(null===e)return Re;if("string"==typeof e)return Fe;if("boolean"==typeof e)return Be;if("number"==typeof e)return Le;if(e instanceof Je)return ze;if(e instanceof Qe)return $e;if(e instanceof tt)return Ve;if(e instanceof rt)return qe;if(Array.isArray(e)){for(var t,r=e.length,n=0,a=e;n<a.length;n+=1){var i=it(a[n]);if(t){if(t===i)continue;t=Ue;break}t=i}return We(t||Ue,r)}return je}function ot(e){var t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Je||e instanceof tt||e instanceof rt?e.toString():JSON.stringify(e)}rt.prototype.toString=function(){return this.name},rt.fromString=function(e){return e?new rt({name:e,available:!1}):null},rt.prototype.serialize=function(){return["image",this.name]};var st=function(e,t){this.type=e,this.value=t};st.parse=function(e,t){if(2!==e.length)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!at(e[1]))return t.error("invalid value");var r=e[1],n=it(r),a=t.expectedType;return"array"!==n.kind||0!==n.N||!a||"array"!==a.kind||"number"==typeof a.N&&0!==a.N||(n=a),new st(n,r)},st.prototype.evaluate=function(){return this.value},st.prototype.eachChild=function(){},st.prototype.outputDefined=function(){return!0},st.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Je?["rgba"].concat(this.value.toArray()):this.value instanceof tt?this.value.serialize():this.value};var lt=function(e){this.name="ExpressionEvaluationError",this.message=e};lt.prototype.toJSON=function(){return this.message};var ct={string:Fe,number:Le,boolean:Be,object:je},ut=function(e,t){this.type=e,this.args=t};ut.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,n=1,a=e[0];if("array"===a){var i,o;if(e.length>2){var s=e[1];if("string"!=typeof s||!(s in ct)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=ct[s],n++}else i=Ue;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=We(i,o)}else r=ct[a];for(var l=[];n<e.length;n++){var c=t.parse(e[n],n,Ue);if(!c)return null;l.push(c)}return new ut(r,l)},ut.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Xe(this.type,it(r)))return r;if(t===this.args.length-1)throw new lt("Expected value to be of type "+He(this.type)+", but found "+He(it(r))+" instead.")}return null},ut.prototype.eachChild=function(e){this.args.forEach(e)},ut.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},ut.prototype.serialize=function(){var e=this.type,t=[e.kind];if("array"===e.kind){var r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);var n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var ft=function(e){this.type=Ve,this.sections=e};ft.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");for(var n=[],a=!1,i=1;i<=e.length-1;++i){var o=e[i];if(a&&"object"==typeof o&&!Array.isArray(o)){a=!1;var s=null;if(o["font-scale"]&&!(s=t.parse(o["font-scale"],1,Le)))return null;var l=null;if(o["text-font"]&&!(l=t.parse(o["text-font"],1,We(Fe))))return null;var c=null;if(o["text-color"]&&!(c=t.parse(o["text-color"],1,ze)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var f=t.parse(e[i],1,Ue);if(!f)return null;var p=f.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:f,scale:null,font:null,textColor:null})}}return new ft(n)},ft.prototype.evaluate=function(e){return new tt(this.sections.map((function(t){var r=t.content.evaluate(e);return it(r)===qe?new et("",r,null,null,null):new et(ot(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},ft.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var n=r[t];e(n.content),n.scale&&e(n.scale),n.font&&e(n.font),n.textColor&&e(n.textColor)}},ft.prototype.outputDefined=function(){return!1},ft.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var n=r[t];e.push(n.content.serialize());var a={};n.scale&&(a["font-scale"]=n.scale.serialize()),n.font&&(a["text-font"]=n.font.serialize()),n.textColor&&(a["text-color"]=n.textColor.serialize()),e.push(a)}return e};var pt=function(e){this.type=qe,this.input=e};pt.parse=function(e,t){if(2!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Fe);return r?new pt(r):t.error("No image name provided.")},pt.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=rt.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},pt.prototype.eachChild=function(e){e(this.input)},pt.prototype.outputDefined=function(){return!1},pt.prototype.serialize=function(){return["image",this.input.serialize()]};var ht={"to-boolean":Be,"to-color":ze,"to-number":Le,"to-string":Fe},dt=function(e,t){this.type=e,this.args=t};dt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");for(var n=ht[r],a=[],i=1;i<e.length;i++){var o=t.parse(e[i],i,Ue);if(!o)return null;a.push(o)}return new dt(n,a)},dt.prototype.evaluate=function(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){for(var t,r,n=0,a=this.args;n<a.length;n+=1){if(r=null,(t=a[n].evaluate(e))instanceof Je)return t;if("string"==typeof t){var i=e.parseColor(t);if(i)return i}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":nt(t[0],t[1],t[2],t[3])))return new Je(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new lt(r||"Could not parse color from value '"+("string"==typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(e)))return 0;var c=Number(o);if(!isNaN(c))return c}throw new lt("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?tt.fromString(ot(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?rt.fromString(ot(this.args[0].evaluate(e))):ot(this.args[0].evaluate(e))},dt.prototype.eachChild=function(e){this.args.forEach(e)},dt.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},dt.prototype.serialize=function(){if("formatted"===this.type.kind)return new ft([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new pt(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild((function(t){e.push(t.serialize())})),e};var mt=["Unknown","Point","LineString","Polygon"],gt=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};gt.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},gt.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?mt[this.feature.type]:this.feature.type:null},gt.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},gt.prototype.canonicalID=function(){return this.canonical},gt.prototype.properties=function(){return this.feature&&this.feature.properties||{}},gt.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Je.parse(e)),t};var yt=function(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n};yt.prototype.evaluate=function(e){return this._evaluate(e,this.args)},yt.prototype.eachChild=function(e){this.args.forEach(e)},yt.prototype.outputDefined=function(){return!1},yt.prototype.serialize=function(){return[this.name].concat(this.args.map((function(e){return e.serialize()})))},yt.parse=function(e,t){var r,n=e[0],a=yt.definitions[n];if(!a)return t.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var i=Array.isArray(a)?a[0]:a.type,o=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,s=o.filter((function(t){var r=t[0];return!Array.isArray(r)||r.length===e.length-1})),l=null,c=0,u=s;c<u.length;c+=1){var f=u[c],p=f[0],h=f[1];l=new zt(t.registry,t.path,null,t.scope);for(var d=[],m=!1,g=1;g<e.length;g++){var y=e[g],v=Array.isArray(p)?p[g-1]:p.type,b=l.parse(y,1+d.length,v);if(!b){m=!0;break}d.push(b)}if(!m)if(Array.isArray(p)&&p.length!==d.length)l.error("Expected "+p.length+" arguments, but found "+d.length+" instead.");else{for(var x=0;x<d.length;x++){var _=Array.isArray(p)?p[x]:p.type,w=d[x];l.concat(x+1).checkSubtype(_,w.type)}if(0===l.errors.length)return new yt(n,i,h,d)}}if(1===s.length)(r=t.errors).push.apply(r,l.errors);else{for(var k=(s.length?s:o).map((function(e){var t;return t=e[0],Array.isArray(t)?"("+t.map(He).join(", ")+")":"("+He(t.type)+"...)"})).join(" | "),D=[],T=1;T<e.length;T++){var A=t.parse(e[T],1+D.length);if(!A)return null;D.push(He(A.type))}t.error("Expected arguments of type "+k+", but found ("+D.join(", ")+") instead.")}return null},yt.register=function(e,t){for(var r in yt.definitions=t,t)e[r]=yt};var vt=function(e,t,r){this.type=$e,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};function bt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function xt(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function _t(e,t){var r,n=(180+e[0])/360,a=(r=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),i=Math.pow(2,t.z);return[Math.round(n*i*8192),Math.round(a*i*8192)]}function wt(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function kt(e,t){for(var r,n,a,i,o,s,l,c=!1,u=0,f=t.length;u<f;u++)for(var p=t[u],h=0,d=p.length;h<d-1;h++){if(r=e,n=p[h],a=p[h+1],void 0,void 0,void 0,void 0,i=r[0]-n[0],o=r[1]-n[1],s=r[0]-a[0],i*(l=r[1]-a[1])-s*o==0&&i*s<=0&&o*l<=0)return!1;wt(e,p[h],p[h+1])&&(c=!c)}return c}function Dt(e,t){for(var r=0;r<t.length;r++)if(kt(e,t[r]))return!0;return!1}function Tt(e,t,r,n){var a=e[0]-r[0],i=e[1]-r[1],o=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],c=n[1]-r[1],u=a*c-l*i,f=o*c-l*s;return u>0&&f<0||u<0&&f>0}function At(e,t,r){for(var n=0,a=r;n<a.length;n+=1)for(var i=a[n],o=0;o<i.length-1;++o)if(s=e,l=t,c=i[o],u=i[o+1],void 0,void 0,void 0,h=[l[0]-s[0],l[1]-s[1]],0!=(f=[u[0]-c[0],u[1]-c[1]])[0]*(p=h)[1]-f[1]*p[0]&&Tt(s,l,c,u)&&Tt(c,u,s,l))return!0;var s,l,c,u,f,p,h;return!1}function St(e,t){for(var r=0;r<e.length;++r)if(!kt(e[r],t))return!1;for(var n=0;n<e.length-1;++n)if(At(e[n],e[n+1],t))return!1;return!0}function Mt(e,t){for(var r=0;r<t.length;r++)if(St(e,t[r]))return!0;return!1}function Et(e,t,r){for(var n=[],a=0;a<e.length;a++){for(var i=[],o=0;o<e[a].length;o++){var s=_t(e[a][o],r);bt(t,s),i.push(s)}n.push(i)}return n}function Ct(e,t,r){for(var n=[],a=0;a<e.length;a++){var i=Et(e[a],t,r);n.push(i)}return n}function Nt(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){var a=.5*n,i=e[0]-r[0]>a?-n:r[0]-e[0]>a?n:0;0===i&&(i=e[0]-r[2]>a?-n:r[2]-e[0]>a?n:0),e[0]+=i}bt(t,e)}function Ot(e,t,r,n){for(var a=8192*Math.pow(2,n.z),i=[8192*n.x,8192*n.y],o=[],s=0,l=e;s<l.length;s+=1)for(var c=0,u=l[s];c<u.length;c+=1){var f=u[c],p=[f.x+i[0],f.y+i[1]];Nt(p,t,r,a),o.push(p)}return o}function It(e,t,r,n){for(var a,i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[],l=0,c=e;l<c.length;l+=1){for(var u=[],f=0,p=c[l];f<p.length;f+=1){var h=p[f],d=[h.x+o[0],h.y+o[1]];bt(t,d),u.push(d)}s.push(u)}if(t[2]-t[0]<=i/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(var m=0,g=s;m<g.length;m+=1)for(var y=0,v=g[m];y<v.length;y+=1)Nt(v[y],t,r,i)}return s}vt.parse=function(e,t){if(2!==e.length)return t.error("Expected one argument.");var r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");var n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Be);if(!n)return null;var a=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Be);if(!a)return null;var i=null;return r.locale&&!(i=t.parse(r.locale,1,Fe))?null:new vt(n,a,i)},vt.prototype.evaluate=function(e){return new Qe(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},vt.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},vt.prototype.outputDefined=function(){return!1},vt.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var Pt=function(e,t){this.type=Be,this.geojson=e,this.geometries=t};function Rt(e){if(e instanceof yt){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Pt)return!1;var t=!0;return e.eachChild((function(e){t&&!Rt(e)&&(t=!1)})),t}function Lt(e){if(e instanceof yt&&"feature-state"===e.name)return!1;var t=!0;return e.eachChild((function(e){t&&!Lt(e)&&(t=!1)})),t}function Ft(e,t){if(e instanceof yt&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Ft(e,t)&&(r=!1)})),r}Pt.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(at(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var a=r.features[n].geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new Pt(r,r.features[n].geometry)}else if("Feature"===r.type){var i=r.geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Pt(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Pt(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Pt.prototype.evaluate=function(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],a=e.canonicalID();if("Polygon"===t.type){var i=Et(t.coordinates,n,a),o=Ot(e.geometry(),r,n,a);if(!xt(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!kt(l[s],i))return!1}if("MultiPolygon"===t.type){var c=Ct(t.coordinates,n,a),u=Ot(e.geometry(),r,n,a);if(!xt(r,n))return!1;for(var f=0,p=u;f<p.length;f+=1)if(!Dt(p[f],c))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],a=e.canonicalID();if("Polygon"===t.type){var i=Et(t.coordinates,n,a),o=It(e.geometry(),r,n,a);if(!xt(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!St(l[s],i))return!1}if("MultiPolygon"===t.type){var c=Ct(t.coordinates,n,a),u=It(e.geometry(),r,n,a);if(!xt(r,n))return!1;for(var f=0,p=u;f<p.length;f+=1)if(!Mt(p[f],c))return!1}return!0}(e,this.geometries)}return!1},Pt.prototype.eachChild=function(){},Pt.prototype.outputDefined=function(){return!0},Pt.prototype.serialize=function(){return["within",this.geojson]};var Bt=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};Bt.parse=function(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new Bt(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Bt.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},Bt.prototype.eachChild=function(){},Bt.prototype.outputDefined=function(){return!1},Bt.prototype.serialize=function(){return["var",this.name]};var zt=function(e,t,r,n,a){void 0===t&&(t=[]),void 0===n&&(n=new Pe),void 0===a&&(a=[]),this.registry=e,this.path=t,this.key=t.map((function(e){return"["+e+"]"})).join(""),this.scope=n,this.errors=a,this.expectedType=r};function jt(e,t){for(var r,n,a=e.length-1,i=0,o=a,s=0;i<=o;)if(r=e[s=Math.floor((i+o)/2)],n=e[s+1],r<=t){if(s===a||t<n)return s;i=s+1}else{if(!(r>t))throw new lt("Input is not a number.");o=s-1}return 0}zt.prototype.parse=function(e,t,r,n,a){return void 0===a&&(a={}),t?this.concat(t,r,n)._parse(e,a):this._parse(e,a)},zt.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new ut(t,[e]):"coerce"===r?new dt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=e[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var a=this.registry[n];if(a){var i=a.parse(e,this);if(!i)return null;if(this.expectedType){var o=this.expectedType,s=i.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else i=r(i,o,t.typeAnnotation||"coerce");else i=r(i,o,t.typeAnnotation||"assert")}if(!(i instanceof st)&&"resolvedImage"!==i.type.kind&&function e(t){if(t instanceof Bt)return e(t.boundExpression);if(t instanceof yt&&"error"===t.name)return!1;if(t instanceof vt)return!1;if(t instanceof Pt)return!1;var r=t instanceof dt||t instanceof ut,n=!0;return t.eachChild((function(t){n=r?n&&e(t):n&&t instanceof st})),!!n&&Rt(t)&&Ft(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(i)){var l=new gt;try{i=new st(i.type,i.evaluate(l))}catch(e){return this.error(e.message),null}}return i}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},zt.prototype.concat=function(e,t,r){var n="number"==typeof e?this.path.concat(e):this.path,a=r?this.scope.concat(r):this.scope;return new zt(this.registry,n,t||null,a,this.errors)},zt.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var n=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new Ie(n,e))},zt.prototype.checkSubtype=function(e,t){var r=Xe(e,t);return r&&this.error(r),r};var Ut=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,a=r;n<a.length;n+=1){var i=a[n],o=i[0],s=i[1];this.labels.push(o),this.outputs.push(s)}};function $t(e,t,r){return e*(1-r)+t*r}Ut.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,Le);if(!r)return null;var n=[],a=null;t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(var i=1;i<e.length;i+=2){var o=1===i?-1/0:e[i],s=e[i+1],l=i,c=i+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=t.parse(s,c,a);if(!u)return null;a=a||u.type,n.push([o,u])}return new Ut(a,r,n)},Ut.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var a=t.length;return n>=t[a-1]?r[a-1].evaluate(e):r[jt(t,n)].evaluate(e)},Ut.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},Ut.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},Ut.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Vt=Object.freeze({__proto__:null,number:$t,color:function(e,t,r){return new Je($t(e.r,t.r,r),$t(e.g,t.g,r),$t(e.b,t.b,r),$t(e.a,t.a,r))},array:function(e,t,r){return e.map((function(e,n){return $t(e,t[n],r)}))}}),qt=6/29,Wt=3*qt*qt,Ht=Math.PI/180,Gt=180/Math.PI;function Xt(e){return e>.008856451679035631?Math.pow(e,1/3):e/Wt+4/29}function Yt(e){return e>qt?e*e*e:Wt*(e-4/29)}function Zt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Kt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Jt(e){var t=Kt(e.r),r=Kt(e.g),n=Kt(e.b),a=Xt((.4124564*t+.3575761*r+.1804375*n)/.95047),i=Xt((.2126729*t+.7151522*r+.072175*n)/1);return{l:116*i-16,a:500*(a-i),b:200*(i-Xt((.0193339*t+.119192*r+.9503041*n)/1.08883)),alpha:e.a}}function Qt(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*Yt(t),r=.95047*Yt(r),n=1.08883*Yt(n),new Je(Zt(3.2404542*r-1.5371385*t-.4985314*n),Zt(-.969266*r+1.8760108*t+.041556*n),Zt(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function er(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var tr={forward:Jt,reverse:Qt,interpolate:function(e,t,r){return{l:$t(e.l,t.l,r),a:$t(e.a,t.a,r),b:$t(e.b,t.b,r),alpha:$t(e.alpha,t.alpha,r)}}},rr={forward:function(e){var t=Jt(e),r=t.l,n=t.a,a=t.b,i=Math.atan2(a,n)*Gt;return{h:i<0?i+360:i,c:Math.sqrt(n*n+a*a),l:r,alpha:e.a}},reverse:function(e){var t=e.h*Ht,r=e.c;return Qt({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:er(e.h,t.h,r),c:$t(e.c,t.c,r),l:$t(e.l,t.l,r),alpha:$t(e.alpha,t.alpha,r)}}},nr=Object.freeze({__proto__:null,lab:tr,hcl:rr}),ar=function(e,t,r,n,a){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var i=0,o=a;i<o.length;i+=1){var s=o[i],l=s[0],c=s[1];this.labels.push(l),this.outputs.push(c)}};function ir(e,t,r,n){var a=n-r,i=e-r;return 0===a?0:1===t?i/a:(Math.pow(t,i)-1)/(Math.pow(t,a)-1)}ar.interpolationFactor=function(e,t,n,a){var i=0;if("exponential"===e.name)i=ir(t,e.base,n,a);else if("linear"===e.name)i=ir(t,1,n,a);else if("cubic-bezier"===e.name){var o=e.controlPoints;i=new r(o[0],o[1],o[2],o[3]).solve(ir(t,1,n,a))}return i},ar.parse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e.slice(3);if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!=typeof o)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o}}else{if("cubic-bezier"!==n[0])return t.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(e){return"number"!=typeof e||e<0||e>1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(a=t.parse(a,2,Le)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=ze:t.expectedType&&"value"!==t.expectedType.kind&&(c=t.expectedType);for(var u=0;u<i.length;u+=2){var f=i[u],p=i[u+1],h=u+3,d=u+4;if("number"!=typeof f)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',h);if(l.length&&l[l.length-1][0]>=f)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);var m=t.parse(p,d,c);if(!m)return null;c=c||m.type,l.push([f,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new ar(c,r,n,a,l):t.error("Type "+He(c)+" is not interpolatable.")},ar.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var a=t.length;if(n>=t[a-1])return r[a-1].evaluate(e);var i=jt(t,n),o=t[i],s=t[i+1],l=ar.interpolationFactor(this.interpolation,n,o,s),c=r[i].evaluate(e),u=r[i+1].evaluate(e);return"interpolate"===this.operator?Vt[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?rr.reverse(rr.interpolate(rr.forward(c),rr.forward(u),l)):tr.reverse(tr.interpolate(tr.forward(c),tr.forward(u),l))},ar.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},ar.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},ar.prototype.serialize=function(){var e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var or=function(e,t){this.type=e,this.args=t};or.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,n=t.expectedType;n&&"value"!==n.kind&&(r=n);for(var a=[],i=0,o=e.slice(1);i<o.length;i+=1){var s=o[i],l=t.parse(s,1+a.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,a.push(l)}var c=n&&a.some((function(e){return Xe(n,e.type)}));return new or(c?Ue:r,a)},or.prototype.evaluate=function(e){for(var t,r=null,n=0,a=0,i=this.args;a<i.length&&(n++,(r=i[a].evaluate(e))&&r instanceof rt&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null===r);a+=1);return r},or.prototype.eachChild=function(e){this.args.forEach(e)},or.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},or.prototype.serialize=function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e};var sr=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};sr.prototype.evaluate=function(e){return this.result.evaluate(e)},sr.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},sr.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],n=1;n<e.length-1;n+=2){var a=e[n];if("string"!=typeof a)return t.error("Expected string, but found "+typeof a+" instead.",n);if(/[^a-zA-Z0-9_]/.test(a))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);var i=t.parse(e[n+1],n+1);if(!i)return null;r.push([a,i])}var o=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return o?new sr(r,o):null},sr.prototype.outputDefined=function(){return this.result.outputDefined()},sr.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var n=r[t],a=n[0],i=n[1];e.push(a,i.serialize())}return e.push(this.result.serialize()),e};var lr=function(e,t,r){this.type=e,this.index=t,this.input=r};lr.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Le),n=t.parse(e[2],2,We(t.expectedType||Ue));if(!r||!n)return null;var a=n.type;return new lr(a.itemType,r,n)},lr.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new lt("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new lt("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new lt("Array index must be an integer, but found "+t+" instead.");return r[t]},lr.prototype.eachChild=function(e){e(this.index),e(this.input)},lr.prototype.outputDefined=function(){return!1},lr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var cr=function(e,t){this.type=Be,this.needle=e,this.haystack=t};cr.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ue),n=t.parse(e[2],2,Ue);return r&&n?Ye(r.type,[Be,Fe,Le,Re,Ue])?new cr(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+He(r.type)+" instead"):null},cr.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Ze(t,["boolean","string","number","null"]))throw new lt("Expected first argument to be of type boolean, string, number or null, but found "+He(it(t))+" instead.");if(!Ze(r,["string","array"]))throw new lt("Expected second argument to be of type array or string, but found "+He(it(r))+" instead.");return r.indexOf(t)>=0},cr.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},cr.prototype.outputDefined=function(){return!0},cr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ur=function(e,t,r){this.type=Le,this.needle=e,this.haystack=t,this.fromIndex=r};ur.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ue),n=t.parse(e[2],2,Ue);if(!r||!n)return null;if(!Ye(r.type,[Be,Fe,Le,Re,Ue]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+He(r.type)+" instead");if(4===e.length){var a=t.parse(e[3],3,Le);return a?new ur(r,n,a):null}return new ur(r,n)},ur.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Ze(t,["boolean","string","number","null"]))throw new lt("Expected first argument to be of type boolean, string, number or null, but found "+He(it(t))+" instead.");if(!Ze(r,["string","array"]))throw new lt("Expected second argument to be of type array or string, but found "+He(it(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},ur.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},ur.prototype.outputDefined=function(){return!1},ur.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var fr=function(e,t,r,n,a,i){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=a,this.otherwise=i};fr.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var a={},i=[],o=2;o<e.length-1;o+=2){var s=e[o],l=e[o+1];Array.isArray(s)||(s=[s]);var c=t.concat(o);if(0===s.length)return c.error("Expected at least one branch label.");for(var u=0,f=s;u<f.length;u+=1){var p=f[u];if("number"!=typeof p&&"string"!=typeof p)return c.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,it(p)))return null}else r=it(p);if(void 0!==a[String(p)])return c.error("Branch labels must be unique.");a[String(p)]=i.length}var h=t.parse(l,o,n);if(!h)return null;n=n||h.type,i.push(h)}var d=t.parse(e[1],1,Ue);if(!d)return null;var m=t.parse(e[e.length-1],e.length-1,n);return m?"value"!==d.type.kind&&t.concat(1).checkSubtype(r,d.type)?null:new fr(r,n,d,a,i,m):null},fr.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(it(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},fr.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},fr.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},fr.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],n={},a=0,i=Object.keys(this.cases).sort();a<i.length;a+=1){var o=i[a];void 0===(f=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[f][1].push(o)}for(var s=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,c=r;l<c.length;l+=1){var u=c[l],f=u[0],p=u[1];1===p.length?t.push(s(p[0])):t.push(p.map(s)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var pr=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};pr.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var n=[],a=1;a<e.length-1;a+=2){var i=t.parse(e[a],a,Be);if(!i)return null;var o=t.parse(e[a+1],a+1,r);if(!o)return null;n.push([i,o]),r=r||o.type}var s=t.parse(e[e.length-1],e.length-1,r);return s?new pr(r,n,s):null},pr.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var n=r[t],a=n[0],i=n[1];if(a.evaluate(e))return i.evaluate(e)}return this.otherwise.evaluate(e)},pr.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var n=r[t],a=n[0],i=n[1];e(a),e(i)}e(this.otherwise)},pr.prototype.outputDefined=function(){return this.branches.every((function(e){return e[0],e[1].outputDefined()}))&&this.otherwise.outputDefined()},pr.prototype.serialize=function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e};var hr=function(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n};function dr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function mr(e,t,r,n){return 0===n.compare(t,r)}function gr(e,t,r){var n="=="!==e&&"!="!==e;return function(){function a(e,t,r){this.type=Be,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return a.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],i=t.parse(e[1],1,Ue);if(!i)return null;if(!dr(r,i.type))return t.concat(1).error('"'+r+"\" comparisons are not supported for type '"+He(i.type)+"'.");var o=t.parse(e[2],2,Ue);if(!o)return null;if(!dr(r,o.type))return t.concat(2).error('"'+r+"\" comparisons are not supported for type '"+He(o.type)+"'.");if(i.type.kind!==o.type.kind&&"value"!==i.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '"+He(i.type)+"' and '"+He(o.type)+"'.");n&&("value"===i.type.kind&&"value"!==o.type.kind?i=new ut(o.type,[i]):"value"!==i.type.kind&&"value"===o.type.kind&&(o=new ut(i.type,[o])));var s=null;if(4===e.length){if("string"!==i.type.kind&&"string"!==o.type.kind&&"value"!==i.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,$e)))return null}return new a(i,o,s)},a.prototype.evaluate=function(a){var i=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(n&&this.hasUntypedArgument){var s=it(i),l=it(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new lt('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var c=it(i),u=it(o);if("string"!==c.kind||"string"!==u.kind)return t(a,i,o)}return this.collator?r(a,i,o,this.collator.evaluate(a)):t(a,i,o)},a.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},a.prototype.outputDefined=function(){return!0},a.prototype.serialize=function(){var t=[e];return this.eachChild((function(e){t.push(e.serialize())})),t},a}()}hr.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ue),n=t.parse(e[2],2,Le);if(!r||!n)return null;if(!Ye(r.type,[We(Ue),Fe,Ue]))return t.error("Expected first argument to be of type array or string, but found "+He(r.type)+" instead");if(4===e.length){var a=t.parse(e[3],3,Le);return a?new hr(r.type,r,n,a):null}return new hr(r.type,r,n)},hr.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Ze(t,["string","array"]))throw new lt("Expected first argument to be of type array or string, but found "+He(it(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},hr.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var yr=gr("==",(function(e,t,r){return t===r}),mr),vr=gr("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!mr(0,t,r,n)})),br=gr("<",(function(e,t,r){return t<r}),(function(e,t,r,n){return n.compare(t,r)<0})),xr=gr(">",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),_r=gr("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),wr=gr(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0})),kr=function(e,t,r,n,a){this.type=Fe,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=a};kr.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Le);if(!r)return null;var n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");var a=null;if(n.locale&&!(a=t.parse(n.locale,1,Fe)))return null;var i=null;if(n.currency&&!(i=t.parse(n.currency,1,Fe)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=t.parse(n["min-fraction-digits"],1,Le)))return null;var s=null;return n["max-fraction-digits"]&&!(s=t.parse(n["max-fraction-digits"],1,Le))?null:new kr(r,a,i,o,s)},kr.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},kr.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},kr.prototype.outputDefined=function(){return!1},kr.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Dr=function(e){this.type=Le,this.input=e};Dr.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+He(r.type)+" instead."):new Dr(r):null},Dr.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new lt("Expected value to be of type string or array, but found "+He(it(t))+" instead.")},Dr.prototype.eachChild=function(e){e(this.input)},Dr.prototype.outputDefined=function(){return!1},Dr.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Tr={"==":yr,"!=":vr,">":xr,"<":br,">=":wr,"<=":_r,array:ut,at:lr,boolean:ut,case:pr,coalesce:or,collator:vt,format:ft,image:pt,in:cr,"index-of":ur,interpolate:ar,"interpolate-hcl":ar,"interpolate-lab":ar,length:Dr,let:sr,literal:st,match:fr,number:ut,"number-format":kr,object:ut,slice:hr,step:Ut,string:ut,"to-boolean":dt,"to-color":dt,"to-number":dt,"to-string":dt,var:Bt,within:Pt};function Ar(e,t){var r=t[0],n=t[1],a=t[2],i=t[3];r=r.evaluate(e),n=n.evaluate(e),a=a.evaluate(e);var o=i?i.evaluate(e):1,s=nt(r,n,a,o);if(s)throw new lt(s);return new Je(r/255*o,n/255*o,a/255*o,o)}function Sr(e,t){return e in t}function Mr(e,t){var r=t[e];return void 0===r?null:r}function Er(e){return{type:e}}function Cr(e){return{result:"success",value:e}}function Nr(e){return{result:"error",value:e}}function Or(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function Ir(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Pr(e){return!!e.expression&&e.expression.interpolated}function Rr(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Lr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Fr(e){return e}function Br(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function zr(e,t,r,n,a){return Br(typeof r===a?n[r]:void 0,e.default,t.default)}function jr(e,t,r){if("number"!==Rr(r))return Br(e.default,t.default);var n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];var a=jt(e.stops.map((function(e){return e[0]})),r);return e.stops[a][1]}function Ur(e,t,r){var n=void 0!==e.base?e.base:1;if("number"!==Rr(r))return Br(e.default,t.default);var a=e.stops.length;if(1===a)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[a-1][0])return e.stops[a-1][1];var i=jt(e.stops.map((function(e){return e[0]})),r),o=function(e,t,r,n){var a=n-r,i=e-r;return 0===a?0:1===t?i/a:(Math.pow(t,i)-1)/(Math.pow(t,a)-1)}(r,n,e.stops[i][0],e.stops[i+1][0]),s=e.stops[i][1],l=e.stops[i+1][1],c=Vt[t.type]||Fr;if(e.colorSpace&&"rgb"!==e.colorSpace){var u=nr[e.colorSpace];c=function(e,t){return u.reverse(u.interpolate(u.forward(e),u.forward(t),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function $r(e,t,r){return"color"===t.type?r=Je.parse(r):"formatted"===t.type?r=tt.fromString(r.toString()):"resolvedImage"===t.type?r=rt.fromString(r.toString()):Rr(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),Br(r,e.default,t.default)}yt.register(Tr,{error:[{kind:"error"},[Fe],function(e,t){var r=t[0];throw new lt(r.evaluate(e))}],typeof:[Fe,[Ue],function(e,t){return He(it(t[0].evaluate(e)))}],"to-rgba":[We(Le,4),[ze],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[ze,[Le,Le,Le],Ar],rgba:[ze,[Le,Le,Le,Le],Ar],has:{type:Be,overloads:[[[Fe],function(e,t){return Sr(t[0].evaluate(e),e.properties())}],[[Fe,je],function(e,t){var r=t[0],n=t[1];return Sr(r.evaluate(e),n.evaluate(e))}]]},get:{type:Ue,overloads:[[[Fe],function(e,t){return Mr(t[0].evaluate(e),e.properties())}],[[Fe,je],function(e,t){var r=t[0],n=t[1];return Mr(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[Ue,[Fe],function(e,t){return Mr(t[0].evaluate(e),e.featureState||{})}],properties:[je,[],function(e){return e.properties()}],"geometry-type":[Fe,[],function(e){return e.geometryType()}],id:[Ue,[],function(e){return e.id()}],zoom:[Le,[],function(e){return e.globals.zoom}],"heatmap-density":[Le,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[Le,[],function(e){return e.globals.lineProgress||0}],accumulated:[Ue,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[Le,Er(Le),function(e,t){for(var r=0,n=0,a=t;n<a.length;n+=1)r+=a[n].evaluate(e);return r}],"*":[Le,Er(Le),function(e,t){for(var r=1,n=0,a=t;n<a.length;n+=1)r*=a[n].evaluate(e);return r}],"-":{type:Le,overloads:[[[Le,Le],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)-n.evaluate(e)}],[[Le],function(e,t){return-t[0].evaluate(e)}]]},"/":[Le,[Le,Le],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)/n.evaluate(e)}],"%":[Le,[Le,Le],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)%n.evaluate(e)}],ln2:[Le,[],function(){return Math.LN2}],pi:[Le,[],function(){return Math.PI}],e:[Le,[],function(){return Math.E}],"^":[Le,[Le,Le],function(e,t){var r=t[0],n=t[1];return Math.pow(r.evaluate(e),n.evaluate(e))}],sqrt:[Le,[Le],function(e,t){var r=t[0];return Math.sqrt(r.evaluate(e))}],log10:[Le,[Le],function(e,t){var r=t[0];return Math.log(r.evaluate(e))/Math.LN10}],ln:[Le,[Le],function(e,t){var r=t[0];return Math.log(r.evaluate(e))}],log2:[Le,[Le],function(e,t){var r=t[0];return Math.log(r.evaluate(e))/Math.LN2}],sin:[Le,[Le],function(e,t){var r=t[0];return Math.sin(r.evaluate(e))}],cos:[Le,[Le],function(e,t){var r=t[0];return Math.cos(r.evaluate(e))}],tan:[Le,[Le],function(e,t){var r=t[0];return Math.tan(r.evaluate(e))}],asin:[Le,[Le],function(e,t){var r=t[0];return Math.asin(r.evaluate(e))}],acos:[Le,[Le],function(e,t){var r=t[0];return Math.acos(r.evaluate(e))}],atan:[Le,[Le],function(e,t){var r=t[0];return Math.atan(r.evaluate(e))}],min:[Le,Er(Le),function(e,t){return Math.min.apply(Math,t.map((function(t){return t.evaluate(e)})))}],max:[Le,Er(Le),function(e,t){return Math.max.apply(Math,t.map((function(t){return t.evaluate(e)})))}],abs:[Le,[Le],function(e,t){var r=t[0];return Math.abs(r.evaluate(e))}],round:[Le,[Le],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Le,[Le],function(e,t){var r=t[0];return Math.floor(r.evaluate(e))}],ceil:[Le,[Le],function(e,t){var r=t[0];return Math.ceil(r.evaluate(e))}],"filter-==":[Be,[Fe,Ue],function(e,t){var r=t[0],n=t[1];return e.properties()[r.value]===n.value}],"filter-id-==":[Be,[Ue],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[Be,[Fe],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[Be,[Fe,Ue],function(e,t){var r=t[0],n=t[1],a=e.properties()[r.value],i=n.value;return typeof a==typeof i&&a<i}],"filter-id-<":[Be,[Ue],function(e,t){var r=t[0],n=e.id(),a=r.value;return typeof n==typeof a&&n<a}],"filter->":[Be,[Fe,Ue],function(e,t){var r=t[0],n=t[1],a=e.properties()[r.value],i=n.value;return typeof a==typeof i&&a>i}],"filter-id->":[Be,[Ue],function(e,t){var r=t[0],n=e.id(),a=r.value;return typeof n==typeof a&&n>a}],"filter-<=":[Be,[Fe,Ue],function(e,t){var r=t[0],n=t[1],a=e.properties()[r.value],i=n.value;return typeof a==typeof i&&a<=i}],"filter-id-<=":[Be,[Ue],function(e,t){var r=t[0],n=e.id(),a=r.value;return typeof n==typeof a&&n<=a}],"filter->=":[Be,[Fe,Ue],function(e,t){var r=t[0],n=t[1],a=e.properties()[r.value],i=n.value;return typeof a==typeof i&&a>=i}],"filter-id->=":[Be,[Ue],function(e,t){var r=t[0],n=e.id(),a=r.value;return typeof n==typeof a&&n>=a}],"filter-has":[Be,[Ue],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Be,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[Be,[We(Fe)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Be,[We(Ue)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Be,[Fe,We(Ue)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Be,[Fe,We(Ue)],function(e,t){var r=t[0],n=t[1];return function(e,t,r,n){for(;r<=n;){var a=r+n>>1;if(t[a]===e)return!0;t[a]>e?n=a-1:r=a+1}return!1}(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Be,overloads:[[[Be,Be],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[Er(Be),function(e,t){for(var r=0,n=t;r<n.length;r+=1)if(!n[r].evaluate(e))return!1;return!0}]]},any:{type:Be,overloads:[[[Be,Be],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)||n.evaluate(e)}],[Er(Be),function(e,t){for(var r=0,n=t;r<n.length;r+=1)if(n[r].evaluate(e))return!0;return!1}]]},"!":[Be,[Be],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[Be,[Fe],function(e,t){var r=t[0],n=e.globals&&e.globals.isSupportedScript;return!n||n(r.evaluate(e))}],upcase:[Fe,[Fe],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[Fe,[Fe],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[Fe,Er(Ue),function(e,t){return t.map((function(t){return ot(t.evaluate(e))})).join("")}],"resolved-locale":[Fe,[$e],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var Vr=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new gt,this._defaultValue=t?function(e){return"color"===e.type&&Lr(e.default)?new Je(0,0,0,0):"color"===e.type?Je.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null};function qr(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Tr}function Wr(e,t){var r=new zt(Tr,[],t?function(e){var t={color:ze,string:Fe,number:Le,enum:Fe,boolean:Be,formatted:Ve,resolvedImage:qe};return"array"===e.type?We(t[e.value]||Ue,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Cr(new Vr(n,t)):Nr(r.errors)}Vr.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,a,i){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},Vr.prototype.evaluate=function(e,t,r,n,a,i){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new lt("Expected value to be one of "+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}};var Hr=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Lt(t.expression)};Hr.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,a,i){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,a,i)},Hr.prototype.evaluate=function(e,t,r,n,a,i){return this._styleExpression.evaluate(e,t,r,n,a,i)};var Gr=function(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Lt(t.expression),this.interpolationType=n};function Xr(e,t){if("error"===(e=Wr(e,t)).result)return e;var r=e.value.expression,n=Rt(r);if(!n&&!Or(t))return Nr([new Ie("","data expressions not supported")]);var a=Ft(r,["zoom"]);if(!a&&!Ir(t))return Nr([new Ie("","zoom expressions not supported")]);var i=function e(t){var r=null;if(t instanceof sr)r=e(t.result);else if(t instanceof or)for(var n=0,a=t.args;n<a.length;n+=1){var i=a[n];if(r=e(i))break}else(t instanceof Ut||t instanceof ar)&&t.input instanceof yt&&"zoom"===t.input.name&&(r=t);return r instanceof Ie||t.eachChild((function(t){var n=e(t);n instanceof Ie?r=n:!r&&n?r=new Ie("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new Ie("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r);if(!i&&!a)return Nr([new Ie("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(i instanceof Ie)return Nr([i]);if(i instanceof ar&&!Pr(t))return Nr([new Ie("",'"interpolate" expressions cannot be used with this property')]);if(!i)return Cr(new Hr(n?"constant":"source",e.value));var o=i instanceof ar?i.interpolation:void 0;return Cr(new Gr(n?"camera":"composite",e.value,i.labels,o))}Gr.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,a,i){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,a,i)},Gr.prototype.evaluate=function(e,t,r,n,a,i){return this._styleExpression.evaluate(e,t,r,n,a,i)},Gr.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?ar.interpolationFactor(this.interpolationType,e,t,r):0};var Yr=function(e,t){this._parameters=e,this._specification=t,Ce(this,function e(t,r){var n,a,i,o="color"===r.type,s=t.stops&&"object"==typeof t.stops[0][0],l=s||void 0!==t.property,c=s||!l,u=t.type||(Pr(r)?"exponential":"interval");if(o&&((t=Ce({},t)).stops&&(t.stops=t.stops.map((function(e){return[e[0],Je.parse(e[1])]}))),t.default?t.default=Je.parse(t.default):t.default=Je.parse(r.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!nr[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===u)n=Ur;else if("interval"===u)n=jr;else if("categorical"===u){n=zr,a=Object.create(null);for(var f=0,p=t.stops;f<p.length;f+=1){var h=p[f];a[h[0]]=h[1]}i=typeof t.stops[0][0]}else{if("identity"!==u)throw new Error('Unknown function type "'+u+'"');n=$r}if(s){for(var d={},m=[],g=0;g<t.stops.length;g++){var y=t.stops[g],v=y[0].zoom;void 0===d[v]&&(d[v]={zoom:v,type:t.type,property:t.property,default:t.default,stops:[]},m.push(v)),d[v].stops.push([y[0].value,y[1]])}for(var b=[],x=0,_=m;x<_.length;x+=1){var w=_[x];b.push([d[w].zoom,e(d[w],r)])}var k={name:"linear"};return{kind:"composite",interpolationType:k,interpolationFactor:ar.interpolationFactor.bind(void 0,k),zoomStops:b.map((function(e){return e[0]})),evaluate:function(e,n){var a=e.zoom;return Ur({stops:b,base:t.base},r,a).evaluate(a,n)}}}if(c){var D="exponential"===u?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:D,interpolationFactor:ar.interpolationFactor.bind(void 0,D),zoomStops:t.stops.map((function(e){return e[0]})),evaluate:function(e){var o=e.zoom;return n(t,r,o,a,i)}}}return{kind:"source",evaluate:function(e,o){var s=o&&o.properties?o.properties[t.property]:void 0;return void 0===s?Br(t.default,r.default):n(t,r,s,a,i)}}}(this._parameters,this._specification))};function Zr(e){var t=e.key,r=e.value,n=e.valueSpec||{},a=e.objectElementValidators||{},i=e.style,o=e.styleSpec,s=[],l=Rr(r);if("object"!==l)return[new Me(t,r,"object expected, "+l+" found")];for(var c in r){var u=c.split(".")[0],f=n[u]||n["*"],p=void 0;if(a[u])p=a[u];else if(n[u])p=wn;else if(a["*"])p=a["*"];else{if(!n["*"]){s.push(new Me(t,r[c],'unknown property "'+c+'"'));continue}p=wn}s=s.concat(p({key:(t?t+".":t)+c,value:r[c],valueSpec:f,style:i,styleSpec:o,object:r,objectKey:c},r))}for(var h in n)a[h]||n[h].required&&void 0===n[h].default&&void 0===r[h]&&s.push(new Me(t,r,'missing required property "'+h+'"'));return s}function Kr(e){var t=e.value,r=e.valueSpec,n=e.style,a=e.styleSpec,i=e.key,o=e.arrayElementValidator||wn;if("array"!==Rr(t))return[new Me(i,t,"array expected, "+Rr(t)+" found")];if(r.length&&t.length!==r.length)return[new Me(i,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new Me(i,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var s={type:r.value,values:r.values};a.$version<7&&(s.function=r.function),"object"===Rr(r.value)&&(s=r.value);for(var l=[],c=0;c<t.length;c++)l=l.concat(o({array:t,arrayIndex:c,value:t[c],valueSpec:s,style:n,styleSpec:a,key:i+"["+c+"]"}));return l}function Jr(e){var t=e.key,r=e.value,n=e.valueSpec,a=Rr(r);return"number"===a&&r!=r&&(a="NaN"),"number"!==a?[new Me(t,r,"number expected, "+a+" found")]:"minimum"in n&&r<n.minimum?[new Me(t,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Me(t,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Qr(e){var t,r,n,a=e.valueSpec,i=Ne(e.value.type),o={},s="categorical"!==i&&void 0===e.value.property,l=!s,c="array"===Rr(e.value.stops)&&"array"===Rr(e.value.stops[0])&&"object"===Rr(e.value.stops[0][0]),u=Zr({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===i)return[new Me(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;return t=t.concat(Kr({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:f})),"array"===Rr(r)&&0===r.length&&t.push(new Me(e.key,r,"array must have at least one stop")),t},default:function(e){return wn({key:e.key,value:e.value,valueSpec:a,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===i&&s&&u.push(new Me(e.key,e.value,'missing required property "property"')),"identity"===i||e.value.stops||u.push(new Me(e.key,e.value,'missing required property "stops"')),"exponential"===i&&e.valueSpec.expression&&!Pr(e.valueSpec)&&u.push(new Me(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Or(e.valueSpec)?u.push(new Me(e.key,e.value,"property functions not supported")):s&&!Ir(e.valueSpec)&&u.push(new Me(e.key,e.value,"zoom functions not supported"))),"categorical"!==i&&!c||void 0!==e.value.property||u.push(new Me(e.key,e.value,'"property" property is required')),u;function f(e){var t=[],i=e.value,s=e.key;if("array"!==Rr(i))return[new Me(s,i,"array expected, "+Rr(i)+" found")];if(2!==i.length)return[new Me(s,i,"array length 2 expected, length "+i.length+" found")];if(c){if("object"!==Rr(i[0]))return[new Me(s,i,"object expected, "+Rr(i[0])+" found")];if(void 0===i[0].zoom)return[new Me(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new Me(s,i,"object stop key must have value")];if(n&&n>Ne(i[0].zoom))return[new Me(s,i[0].zoom,"stop zoom values must appear in ascending order")];Ne(i[0].zoom)!==n&&(n=Ne(i[0].zoom),r=void 0,o={}),t=t.concat(Zr({key:s+"[0]",value:i[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Jr,value:p}}))}else t=t.concat(p({key:s+"[0]",value:i[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},i));return qr(Oe(i[1]))?t.concat([new Me(s+"[1]",i[1],"expressions are not allowed in function stops.")]):t.concat(wn({key:s+"[1]",value:i[1],valueSpec:a,style:e.style,styleSpec:e.styleSpec}))}function p(e,n){var s=Rr(e.value),l=Ne(e.value),c=null!==e.value?e.value:n;if(t){if(s!==t)return[new Me(e.key,c,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Me(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==i){var u="number expected, "+s+" found";return Or(a)&&void 0===i&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Me(e.key,c,u)]}return"categorical"!==i||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===s&&void 0!==r&&l<r?[new Me(e.key,c,"stop domain values must appear in ascending order")]:(r=l,"categorical"===i&&l in o?[new Me(e.key,c,"stop domain values must be unique")]:(o[l]=!0,[])):[new Me(e.key,c,"integer expected, found "+l)]}}function en(e){var t=("property"===e.expressionContext?Xr:Wr)(Oe(e.value),e.valueSpec);if("error"===t.result)return t.value.map((function(t){return new Me(""+e.key+t.key,e.value,t.message)}));var r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new Me(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===e.expressionContext&&"layout"===e.propertyType&&!Lt(r))return[new Me(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!Lt(r))return[new Me(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!Ft(r,["zoom","feature-state"]))return[new Me(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!Rt(r))return[new Me(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function tn(e){var t=e.key,r=e.value,n=e.valueSpec,a=[];return Array.isArray(n.values)?-1===n.values.indexOf(Ne(r))&&a.push(new Me(t,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Ne(r))&&a.push(new Me(t,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),a}function rn(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var n=r[t];if(!rn(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}Yr.deserialize=function(e){return new Yr(e._parameters,e._specification)},Yr.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var nn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function an(e){if(null==e)return{filter:function(){return!0},needGeometry:!1};rn(e)||(e=sn(e));var t=Wr(e,nn);if("error"===t.result)throw new Error(t.value.map((function(e){return e.key+": "+e.message})).join(", "));return{filter:function(e,r,n){return t.value.evaluate(e,r,{},n)},needGeometry:function e(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var r=1;r<t.length;r++)if(e(t[r]))return!0;return!1}(e)}}function on(e,t){return e<t?-1:e>t?1:0}function sn(e){if(!e)return!0;var t,r=e[0];return e.length<=1?"any"!==r:"=="===r?ln(e[1],e[2],"=="):"!="===r?fn(ln(e[1],e[2],"==")):"<"===r||">"===r||"<="===r||">="===r?ln(e[1],e[2],r):"any"===r?(t=e.slice(1),["any"].concat(t.map(sn))):"all"===r?["all"].concat(e.slice(1).map(sn)):"none"===r?["all"].concat(e.slice(1).map(sn).map(fn)):"in"===r?cn(e[1],e.slice(2)):"!in"===r?fn(cn(e[1],e.slice(2))):"has"===r?un(e[1]):"!has"===r?fn(un(e[1])):"within"!==r||e}function ln(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function cn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return typeof e!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(on)]]:["filter-in-small",e,["literal",t]]}}function un(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function fn(e){return["!",e]}function pn(e){return rn(Oe(e.value))?en(Ce({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function e(t){var r=t.value,n=t.key;if("array"!==Rr(r))return[new Me(n,r,"array expected, "+Rr(r)+" found")];var a,i=t.styleSpec,o=[];if(r.length<1)return[new Me(n,r,"filter array must have at least 1 element")];switch(o=o.concat(tn({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Ne(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Ne(r[1])&&o.push(new Me(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new Me(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(a=Rr(r[1]))&&o.push(new Me(n+"[1]",r[1],"string expected, "+a+" found"));for(var s=2;s<r.length;s++)a=Rr(r[s]),"$type"===Ne(r[1])?o=o.concat(tn({key:n+"["+s+"]",value:r[s],valueSpec:i.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==a&&"number"!==a&&"boolean"!==a&&o.push(new Me(n+"["+s+"]",r[s],"string, number, or boolean expected, "+a+" found"));break;case"any":case"all":case"none":for(var l=1;l<r.length;l++)o=o.concat(e({key:n+"["+l+"]",value:r[l],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":a=Rr(r[1]),2!==r.length?o.push(new Me(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==a&&o.push(new Me(n+"[1]",r[1],"string expected, "+a+" found"));break;case"within":a=Rr(r[1]),2!==r.length?o.push(new Me(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"object"!==a&&o.push(new Me(n+"[1]",r[1],"object expected, "+a+" found"))}return o}(e)}function hn(e,t){var r=e.key,n=e.style,a=e.styleSpec,i=e.value,o=e.objectKey,s=a[t+"_"+e.layerType];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return wn({key:r,value:i,valueSpec:a.transition,style:n,styleSpec:a});var c,u=e.valueSpec||s[o];if(!u)return[new Me(r,i,'unknown property "'+o+'"')];if("string"===Rr(i)&&Or(u)&&!u.tokens&&(c=/^{([^}]+)}$/.exec(i)))return[new Me(r,i,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(c[1])+" }`.")];var f=[];return"symbol"===e.layerType&&("text-field"===o&&n&&!n.glyphs&&f.push(new Me(r,i,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Lr(Oe(i))&&"identity"===Ne(i.type)&&f.push(new Me(r,i,'"text-font" does not support identity functions'))),f.concat(wn({key:e.key,value:i,valueSpec:u,style:n,styleSpec:a,expressionContext:"property",propertyType:t,propertyKey:o}))}function dn(e){return hn(e,"paint")}function mn(e){return hn(e,"layout")}function gn(e){var t=[],r=e.value,n=e.key,a=e.style,i=e.styleSpec;r.type||r.ref||t.push(new Me(n,r,'either "type" or "ref" is required'));var o,s=Ne(r.type),l=Ne(r.ref);if(r.id)for(var c=Ne(r.id),u=0;u<e.arrayIndex;u++){var f=a.layers[u];Ne(f.id)===c&&t.push(new Me(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+f.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(e){e in r&&t.push(new Me(n,r[e],'"'+e+'" is prohibited for ref layers'))})),a.layers.forEach((function(e){Ne(e.id)===l&&(o=e)})),o?o.ref?t.push(new Me(n,r.ref,"ref cannot reference another ref layer")):s=Ne(o.type):t.push(new Me(n,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var p=a.sources&&a.sources[r.source],h=p&&Ne(p.type);p?"vector"===h&&"raster"===s?t.push(new Me(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===h&&"raster"!==s?t.push(new Me(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==h||r["source-layer"]?"raster-dem"===h&&"hillshade"!==s?t.push(new Me(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===h&&p.lineMetrics||t.push(new Me(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new Me(n,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new Me(n,r.source,'source "'+r.source+'" not found'))}else t.push(new Me(n,r,'missing required property "source"'));return t=t.concat(Zr({key:n,value:r,valueSpec:i.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return wn({key:n+".type",value:r.type,valueSpec:i.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:pn,layout:function(e){return Zr({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return mn(Ce({layerType:s},e))}}})},paint:function(e){return Zr({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return dn(Ce({layerType:s},e))}}})}}}))}function yn(e){var t=e.value,r=e.key,n=Rr(t);return"string"!==n?[new Me(r,t,"string expected, "+n+" found")]:[]}var vn={promoteId:function(e){var t=e.key,r=e.value;if("string"===Rr(r))return yn({key:t,value:r});var n=[];for(var a in r)n.push.apply(n,yn({key:t+"."+a,value:r[a]}));return n}};function bn(e){var t=e.value,r=e.key,n=e.styleSpec,a=e.style;if(!t.type)return[new Me(r,t,'"type" is required')];var i,o=Ne(t.type);switch(o){case"vector":case"raster":case"raster-dem":return Zr({key:r,value:t,valueSpec:n["source_"+o.replace("-","_")],style:e.style,styleSpec:n,objectElementValidators:vn});case"geojson":if(i=Zr({key:r,value:t,valueSpec:n.source_geojson,style:a,styleSpec:n,objectElementValidators:vn}),t.cluster)for(var s in t.clusterProperties){var l=t.clusterProperties[s],c=l[0],u=l[1],f="string"==typeof c?[c,["accumulated"],["get",s]]:c;i.push.apply(i,en({key:r+"."+s+".map",value:u,expressionContext:"cluster-map"})),i.push.apply(i,en({key:r+"."+s+".reduce",value:f,expressionContext:"cluster-reduce"}))}return i;case"video":return Zr({key:r,value:t,valueSpec:n.source_video,style:a,styleSpec:n});case"image":return Zr({key:r,value:t,valueSpec:n.source_image,style:a,styleSpec:n});case"canvas":return[new Me(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return tn({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:a,styleSpec:n})}}function xn(e){var t=e.value,r=e.styleSpec,n=r.light,a=e.style,i=[],o=Rr(t);if(void 0===t)return i;if("object"!==o)return i.concat([new Me("light",t,"object expected, "+o+" found")]);for(var s in t){var l=s.match(/^(.*)-transition$/);i=l&&n[l[1]]&&n[l[1]].transition?i.concat(wn({key:s,value:t[s],valueSpec:r.transition,style:a,styleSpec:r})):n[s]?i.concat(wn({key:s,value:t[s],valueSpec:n[s],style:a,styleSpec:r})):i.concat([new Me(s,t[s],'unknown property "'+s+'"')])}return i}var _n={"*":function(){return[]},array:Kr,boolean:function(e){var t=e.value,r=e.key,n=Rr(t);return"boolean"!==n?[new Me(r,t,"boolean expected, "+n+" found")]:[]},number:Jr,color:function(e){var t=e.key,r=e.value,n=Rr(r);return"string"!==n?[new Me(t,r,"color expected, "+n+" found")]:null===Ke(r)?[new Me(t,r,'color expected, "'+r+'" found')]:[]},constants:Ee,enum:tn,filter:pn,function:Qr,layer:gn,object:Zr,source:bn,light:xn,string:yn,formatted:function(e){return 0===yn(e).length?[]:en(e)},resolvedImage:function(e){return 0===yn(e).length?[]:en(e)}};function wn(e){var t=e.value,r=e.valueSpec,n=e.styleSpec;return r.expression&&Lr(Ne(t))?Qr(e):r.expression&&qr(Oe(t))?en(e):r.type&&_n[r.type]?_n[r.type](e):Zr(Ce({},e,{valueSpec:r.type?n[r.type]:r}))}function kn(e){var t=e.value,r=e.key,n=yn(e);return n.length||(-1===t.indexOf("{fontstack}")&&n.push(new Me(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&n.push(new Me(r,t,'"glyphs" url must include a "{range}" token'))),n}function Dn(e,t){void 0===t&&(t=Se);var r=[];return r=r.concat(wn({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:kn,"*":function(){return[]}}})),e.constants&&(r=r.concat(Ee({key:"constants",value:e.constants,style:e,styleSpec:t}))),Tn(r)}function Tn(e){return[].concat(e).sort((function(e,t){return e.line-t.line}))}function An(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Tn(e.apply(this,t))}}Dn.source=An(bn),Dn.light=An(xn),Dn.layer=An(gn),Dn.filter=An(pn),Dn.paintProperty=An(dn),Dn.layoutProperty=An(mn);var Sn=Dn,Mn=Sn.light,En=Sn.paintProperty,Cn=Sn.layoutProperty;function Nn(e,t){var r=!1;if(t&&t.length)for(var n=0,a=t;n<a.length;n+=1){var i=a[n];e.fire(new Te(new Error(i.message))),r=!0}return r}var On=In;function In(e,t,r){var n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var a=new Int32Array(this.arrayBuffer);e=a[0],t=a[1],r=a[2],this.d=t+2*r;for(var i=0;i<this.d*this.d;i++){var o=a[3+i],s=a[3+i+1];n.push(o===s?null:a.subarray(o,s))}var l=a[3+n.length],c=a[3+n.length+1];this.keys=a.subarray(l,c),this.bboxes=a.subarray(c),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var u=0;u<this.d*this.d;u++)n.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var f=r/t*e;this.min=-f,this.max=e+f}In.prototype.insert=function(e,t,r,n,a){this._forEachCell(t,r,n,a,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(a)},In.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},In.prototype._insertCell=function(e,t,r,n,a,i){this.cells[a].push(i)},In.prototype.query=function(e,t,r,n,a){var i=this.min,o=this.max;if(e<=i&&t<=i&&o<=r&&o<=n&&!a)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,r,n,this._queryCell,s,{},a),s},In.prototype._queryCell=function(e,t,r,n,a,i,o,s){var l=this.cells[a];if(null!==l)for(var c=this.keys,u=this.bboxes,f=0;f<l.length;f++){var p=l[f];if(void 0===o[p]){var h=4*p;(s?s(u[h+0],u[h+1],u[h+2],u[h+3]):e<=u[h+2]&&t<=u[h+3]&&r>=u[h+0]&&n>=u[h+1])?(o[p]=!0,i.push(c[p])):o[p]=!1}}},In.prototype._forEachCell=function(e,t,r,n,a,i,o,s){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),f=this._convertToCellCoord(n),p=l;p<=u;p++)for(var h=c;h<=f;h++){var d=this.d*h+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(h),this._convertFromCellCoord(p+1),this._convertFromCellCoord(h+1)))&&a.call(this,e,t,r,n,d,i,o,s))return}},In.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},In.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},In.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var a=new Int32Array(t+r+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;for(var i=t,o=0;o<e.length;o++){var s=e[o];a[3+o]=i,a.set(s,i),i+=s.length}return a[3+e.length]=i,a.set(this.keys,i),i+=this.keys.length,a[3+e.length+1]=i,a.set(this.bboxes,i),i+=this.bboxes.length,a.buffer};var Pn=self.ImageData,Rn=self.ImageBitmap,Ln={};function Fn(e,t,r){void 0===r&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),Ln[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var Bn in Fn("Object",Object),On.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},On.deserialize=function(e){return new On(e.buffer)},Fn("Grid",On),Fn("Color",Je),Fn("Error",Error),Fn("ResolvedImage",rt),Fn("StylePropertyFunction",Yr),Fn("StyleExpression",Vr,{omit:["_evaluator"]}),Fn("ZoomDependentExpression",Gr),Fn("ZoomConstantExpression",Hr),Fn("CompoundExpression",yt,{omit:["_evaluate"]}),Tr)Tr[Bn]._classRegistryKey||Fn("Expression_"+Bn,Tr[Bn]);function zn(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function jn(e){return Rn&&e instanceof Rn}function Un(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(zn(e)||jn(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof Pn)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var n=[],a=0,i=e;a<i.length;a+=1){var o=i[a];n.push(Un(o,t))}return n}if("object"==typeof e){var s=e.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var c=s.serialize?s.serialize(e,t):{};if(!s.serialize){for(var u in e)if(e.hasOwnProperty(u)&&!(Ln[l].omit.indexOf(u)>=0)){var f=e[u];c[u]=Ln[l].shallow.indexOf(u)>=0?f:Un(f,t)}e instanceof Error&&(c.message=e.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof e)}function $n(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||zn(e)||jn(e)||ArrayBuffer.isView(e)||e instanceof Pn)return e;if(Array.isArray(e))return e.map($n);if("object"==typeof e){var t=e.$name||"Object",r=Ln[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var n=Object.create(r.prototype),a=0,i=Object.keys(e);a<i.length;a+=1){var o=i[a];if("$name"!==o){var s=e[o];n[o]=Ln[t].shallow.indexOf(o)>=0?s:$n(s)}}return n}throw new Error("can't deserialize object of type "+typeof e)}var Vn=function(){this.first=!0};Vn.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var qn={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function Wn(e){for(var t=0,r=e;t<r.length;t+=1)if(Gn(r[t].charCodeAt(0)))return!0;return!1}function Hn(e){return!(qn.Arabic(e)||qn["Arabic Supplement"](e)||qn["Arabic Extended-A"](e)||qn["Arabic Presentation Forms-A"](e)||qn["Arabic Presentation Forms-B"](e))}function Gn(e){return!(746!==e&&747!==e&&(e<4352||!(qn["Bopomofo Extended"](e)||qn.Bopomofo(e)||qn["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||qn["CJK Compatibility Ideographs"](e)||qn["CJK Compatibility"](e)||qn["CJK Radicals Supplement"](e)||qn["CJK Strokes"](e)||!(!qn["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||qn["CJK Unified Ideographs Extension A"](e)||qn["CJK Unified Ideographs"](e)||qn["Enclosed CJK Letters and Months"](e)||qn["Hangul Compatibility Jamo"](e)||qn["Hangul Jamo Extended-A"](e)||qn["Hangul Jamo Extended-B"](e)||qn["Hangul Jamo"](e)||qn["Hangul Syllables"](e)||qn.Hiragana(e)||qn["Ideographic Description Characters"](e)||qn.Kanbun(e)||qn["Kangxi Radicals"](e)||qn["Katakana Phonetic Extensions"](e)||qn.Katakana(e)&&12540!==e||!(!qn["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!qn["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||qn["Unified Canadian Aboriginal Syllabics"](e)||qn["Unified Canadian Aboriginal Syllabics Extended"](e)||qn["Vertical Forms"](e)||qn["Yijing Hexagram Symbols"](e)||qn["Yi Syllables"](e)||qn["Yi Radicals"](e))))}function Xn(e){return!(Gn(e)||function(e){return!!(qn["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||qn["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||qn["Letterlike Symbols"](e)||qn["Number Forms"](e)||qn["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||qn["Control Pictures"](e)&&9251!==e||qn["Optical Character Recognition"](e)||qn["Enclosed Alphanumerics"](e)||qn["Geometric Shapes"](e)||qn["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||qn["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||qn["CJK Symbols and Punctuation"](e)||qn.Katakana(e)||qn["Private Use Area"](e)||qn["CJK Compatibility Forms"](e)||qn["Small Form Variants"](e)||qn["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function Yn(e){return e>=1424&&e<=2303||qn["Arabic Presentation Forms-A"](e)||qn["Arabic Presentation Forms-B"](e)}function Zn(e,t){return!(!t&&Yn(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||qn.Khmer(e))}function Kn(e){for(var t=0,r=e;t<r.length;t+=1)if(Yn(r[t].charCodeAt(0)))return!0;return!1}var Jn="deferred",Qn="loading",ea="loaded",ta=null,ra="unavailable",na=null,aa=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(ra="error"),ta&&ta(e)};function ia(){oa.fire(new De("pluginStateChange",{pluginStatus:ra,pluginURL:na}))}var oa=new Ae,sa=function(){return ra},la=function(){if(ra!==Jn||!na)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ra=Qn,ia(),na&&be({url:na},(function(e){e?aa(e):(ra=ea,ia())}))},ca={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ra===ea||null!=ca.applyArabicShaping},isLoading:function(){return ra===Qn},setState:function(e){ra=e.pluginStatus,na=e.pluginURL},isParsed:function(){return null!=ca.applyArabicShaping&&null!=ca.processBidirectionalText&&null!=ca.processStyledBidirectionalText},getPluginURL:function(){return na}},ua=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Vn,this.transition={})};ua.prototype.isSupportedScript=function(e){return function(e,t){for(var r=0,n=e;r<n.length;r+=1)if(!Zn(n[r].charCodeAt(0),t))return!1;return!0}(e,ca.isLoaded())},ua.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},ua.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var fa=function(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(Lr(e))return new Yr(e,t);if(qr(e)){var r=Xr(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}var n=e;return"string"==typeof e&&"color"===t.type&&(n=Je.parse(e)),{kind:"constant",evaluate:function(){return n}}}(void 0===t?e.specification.default:t,e.specification)};fa.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},fa.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var pa=function(e){this.property=e,this.value=new fa(e,void 0)};pa.prototype.transitioned=function(e,t){return new da(this.property,this.value,t,u({},e.transition,this.transition),e.now)},pa.prototype.untransitioned=function(){return new da(this.property,this.value,null,{},0)};var ha=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};ha.prototype.getValue=function(e){return b(this._values[e].value.value)},ha.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new pa(this._values[e].property)),this._values[e].value=new fa(this._values[e].property,null===t?void 0:b(t))},ha.prototype.getTransition=function(e){return b(this._values[e].transition)},ha.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new pa(this._values[e].property)),this._values[e].transition=b(t)||void 0},ha.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var n=r[t],a=this.getValue(n);void 0!==a&&(e[n]=a);var i=this.getTransition(n);void 0!==i&&(e[n+"-transition"]=i)}return e},ha.prototype.transitioned=function(e,t){for(var r=new ma(this._properties),n=0,a=Object.keys(this._values);n<a.length;n+=1){var i=a[n];r._values[i]=this._values[i].transitioned(e,t._values[i])}return r},ha.prototype.untransitioned=function(){for(var e=new ma(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var n=r[t];e._values[n]=this._values[n].untransitioned()}return e};var da=function(e,t,r,n,a){this.property=e,this.value=t,this.begin=a+n.delay||0,this.end=this.begin+n.duration||0,e.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};da.prototype.possiblyEvaluate=function(e,t,r){var n=e.now||0,a=this.value.possiblyEvaluate(e,t,r),i=this.prior;if(i){if(n>this.end)return this.prior=null,a;if(this.value.isDataDriven())return this.prior=null,a;if(n<this.begin)return i.possiblyEvaluate(e,t,r);var o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(i.possiblyEvaluate(e,t,r),a,function(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(o))}return a};var ma=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};ma.prototype.possiblyEvaluate=function(e,t,r){for(var n=new va(this._properties),a=0,i=Object.keys(this._values);a<i.length;a+=1){var o=i[a];n._values[o]=this._values[o].possiblyEvaluate(e,t,r)}return n},ma.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1){var r=t[e];if(this._values[r].prior)return!0}return!1};var ga=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};ga.prototype.getValue=function(e){return b(this._values[e].value)},ga.prototype.setValue=function(e,t){this._values[e]=new fa(this._values[e].property,null===t?void 0:b(t))},ga.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var n=r[t],a=this.getValue(n);void 0!==a&&(e[n]=a)}return e},ga.prototype.possiblyEvaluate=function(e,t,r){for(var n=new va(this._properties),a=0,i=Object.keys(this._values);a<i.length;a+=1){var o=i[a];n._values[o]=this._values[o].possiblyEvaluate(e,t,r)}return n};var ya=function(e,t,r){this.property=e,this.value=t,this.parameters=r};ya.prototype.isConstant=function(){return"constant"===this.value.kind},ya.prototype.constantOr=function(e){return"constant"===this.value.kind?this.value.value:e},ya.prototype.evaluate=function(e,t,r,n){return this.property.evaluate(this.value,this.parameters,e,t,r,n)};var va=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};va.prototype.get=function(e){return this._values[e]};var ba=function(e){this.specification=e};ba.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},ba.prototype.interpolate=function(e,t,r){var n=Vt[this.specification.type];return n?n(e,t,r):e};var xa=function(e,t){this.specification=e,this.overrides=t};xa.prototype.possiblyEvaluate=function(e,t,r,n){return"constant"===e.expression.kind||"camera"===e.expression.kind?new ya(this,{kind:"constant",value:e.expression.evaluate(t,null,{},r,n)},t):new ya(this,e.expression,t)},xa.prototype.interpolate=function(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new ya(this,{kind:"constant",value:void 0},e.parameters);var n=Vt[this.specification.type];return n?new ya(this,{kind:"constant",value:n(e.value.value,t.value.value,r)},e.parameters):e},xa.prototype.evaluate=function(e,t,r,n,a,i){return"constant"===e.kind?e.value:e.evaluate(t,r,n,a,i)};var _a=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(e,t,r,n){if(void 0===e.value)return new ya(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){var a=e.expression.evaluate(t,null,{},r,n),i="resolvedImage"===e.property.specification.type&&"string"!=typeof a?a.name:a,o=this._calculate(i,i,i,t);return new ya(this,{kind:"constant",value:o},t)}if("camera"===e.expression.kind){var s=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new ya(this,{kind:"constant",value:s},t)}return new ya(this,e.expression,t)},t.prototype.evaluate=function(e,t,r,n,a,i){if("source"===e.kind){var o=e.evaluate(t,r,n,a,i);return this._calculate(o,o,o,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,n),e.evaluate({zoom:Math.floor(t.zoom)},r,n),e.evaluate({zoom:Math.floor(t.zoom)+1},r,n),t):e.value},t.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},t.prototype.interpolate=function(e){return e},t}(xa),wa=function(e){this.specification=e};wa.prototype.possiblyEvaluate=function(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){var a=e.expression.evaluate(t,null,{},r,n);return this._calculate(a,a,a,t)}return this._calculate(e.expression.evaluate(new ua(Math.floor(t.zoom-1),t)),e.expression.evaluate(new ua(Math.floor(t.zoom),t)),e.expression.evaluate(new ua(Math.floor(t.zoom+1),t)),t)}},wa.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},wa.prototype.interpolate=function(e){return e};var ka=function(e){this.specification=e};ka.prototype.possiblyEvaluate=function(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)},ka.prototype.interpolate=function(){return!1};var Da=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var n=this.defaultPropertyValues[t]=new fa(r,void 0),a=this.defaultTransitionablePropertyValues[t]=new pa(r);this.defaultTransitioningPropertyValues[t]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}};Fn("DataDrivenProperty",xa),Fn("DataConstantProperty",ba),Fn("CrossFadedDataDrivenProperty",_a),Fn("CrossFadedProperty",wa),Fn("ColorRampProperty",ka);var Ta=function(e){function t(t,r){if(e.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==t.type&&(t=t,this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new ga(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ha(r.paint),t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(var a in t.layout)this.setLayoutProperty(a,t.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new va(r.paint)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,r){if(void 0===r&&(r={}),null!=t){var n="layers."+this.id+".layout."+e;if(this._validate(Cn,n,e,t,r))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t},t.prototype.getPaintProperty=function(e){return g(e,"-transition")?this._transitionablePaint.getTransition(e.slice(0,-"-transition".length)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,r){if(void 0===r&&(r={}),null!=t){var n="layers."+this.id+".paint."+e;if(this._validate(En,n,e,t,r))return!1}if(g(e,"-transition"))return this._transitionablePaint.setTransition(e.slice(0,-"-transition".length),t||void 0),!1;var a=this._transitionablePaint._values[e],i="cross-faded-data-driven"===a.property.specification["property-type"],o=a.value.isDataDriven(),s=a.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var l=this._transitionablePaint._values[e].value;return l.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(e,s,l)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype._handleOverridablePaintPropertyUpdate=function(e,t,r){return!1},t.prototype.isHidden=function(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility},t.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)},t.prototype.serialize=function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),v(e,(function(e,t){return!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)}))},t.prototype._validate=function(e,t,r,n,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&Nn(this,e.call(Sn,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:Se,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof ya&&Or(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1},t}(Ae),Aa={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Sa=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ma=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ea(e,t){void 0===t&&(t=1);var r=0,n=0;return{members:e.map((function(e){var a,i=(a=e.type,Aa[a].BYTES_PER_ELEMENT),o=r=Ca(r,Math.max(t,i)),s=e.components||1;return n=Math.max(n,i),r+=i*s,{name:e.name,type:e.type,components:s,offset:o}})),size:Ca(r,Math.max(n,t)),alignment:t}}function Ca(e,t){return Math.ceil(e/t)*t}Ma.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Ma.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Ma.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ma.prototype.clear=function(){this.length=0},Ma.prototype.resize=function(e){this.reserve(e),this.length=e},Ma.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Ma.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Na=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e},t}(Ma);Na.prototype.bytesPerElement=4,Fn("StructArrayLayout2i4",Na);var Oa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,a){var i=4*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,this.int16[i+3]=a,e},t}(Ma);Oa.prototype.bytesPerElement=8,Fn("StructArrayLayout4i8",Oa);var Ia=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,a,i)},t.prototype.emplace=function(e,t,r,n,a,i,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=a,this.int16[s+4]=i,this.int16[s+5]=o,e},t}(Ma);Ia.prototype.bytesPerElement=12,Fn("StructArrayLayout2i4i12",Ia);var Pa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,a,i)},t.prototype.emplace=function(e,t,r,n,a,i,o){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=a,this.uint8[l+6]=i,this.uint8[l+7]=o,e},t}(Ma);Pa.prototype.bytesPerElement=8,Fn("StructArrayLayout2i4ub8",Pa);var Ra=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,a,i,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,a,i,o,s,l,c)},t.prototype.emplace=function(e,t,r,n,a,i,o,s,l,c,u){var f=9*e,p=18*e;return this.uint16[f+0]=t,this.uint16[f+1]=r,this.uint16[f+2]=n,this.uint16[f+3]=a,this.uint16[f+4]=i,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.uint8[p+16]=c,this.uint8[p+17]=u,e},t}(Ma);Ra.prototype.bytesPerElement=18,Fn("StructArrayLayout8ui2ub18",Ra);var La=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,a,i,o,s,l,c,u,f){var p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,n,a,i,o,s,l,c,u,f)},t.prototype.emplace=function(e,t,r,n,a,i,o,s,l,c,u,f,p){var h=12*e;return this.int16[h+0]=t,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=a,this.uint16[h+4]=i,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.int16[h+8]=c,this.int16[h+9]=u,this.int16[h+10]=f,this.int16[h+11]=p,e},t}(Ma);La.prototype.bytesPerElement=24,Fn("StructArrayLayout4i4ui4i24",La);var Fa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var a=3*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,e},t}(Ma);Fa.prototype.bytesPerElement=12,Fn("StructArrayLayout3f12",Fa);var Ba=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint32[r+0]=t,e},t}(Ma);Ba.prototype.bytesPerElement=4,Fn("StructArrayLayout1ul4",Ba);var za=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,a,i,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,a,i,o,s,l)},t.prototype.emplace=function(e,t,r,n,a,i,o,s,l,c){var u=10*e,f=5*e;return this.int16[u+0]=t,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=a,this.int16[u+4]=i,this.int16[u+5]=o,this.uint32[f+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,e},t}(Ma);za.prototype.bytesPerElement=20,Fn("StructArrayLayout6i1ul2ui20",za);var ja=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,a,i)},t.prototype.emplace=function(e,t,r,n,a,i,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=a,this.int16[s+4]=i,this.int16[s+5]=o,e},t}(Ma);ja.prototype.bytesPerElement=12,Fn("StructArrayLayout2i2i2i12",ja);var Ua=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,a){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n,a)},t.prototype.emplace=function(e,t,r,n,a,i){var o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=a,this.int16[s+7]=i,e},t}(Ma);Ua.prototype.bytesPerElement=16,Fn("StructArrayLayout2f1f2i16",Ua);var $a=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,a){var i=12*e,o=3*e;return this.uint8[i+0]=t,this.uint8[i+1]=r,this.float32[o+1]=n,this.float32[o+2]=a,e},t}(Ma);$a.prototype.bytesPerElement=12,Fn("StructArrayLayout2ub2f12",$a);var Va=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var a=3*e;return this.uint16[a+0]=t,this.uint16[a+1]=r,this.uint16[a+2]=n,e},t}(Ma);Va.prototype.bytesPerElement=6,Fn("StructArrayLayout3ui6",Va);var qa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,a,i,o,s,l,c,u,f,p,h,d,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,n,a,i,o,s,l,c,u,f,p,h,d,m,g)},t.prototype.emplace=function(e,t,r,n,a,i,o,s,l,c,u,f,p,h,d,m,g,y){var v=24*e,b=12*e,x=48*e;return this.int16[v+0]=t,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=a,this.uint32[b+2]=i,this.uint32[b+3]=o,this.uint32[b+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[b+7]=f,this.float32[b+8]=p,this.uint8[x+36]=h,this.uint8[x+37]=d,this.uint8[x+38]=m,this.uint32[b+10]=g,this.int16[v+22]=y,e},t}(Ma);qa.prototype.bytesPerElement=48,Fn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",qa);var Wa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,a,i,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,k,D,T,A,S){var M=this.length;return this.resize(M+1),this.emplace(M,e,t,r,n,a,i,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,k,D,T,A,S)},t.prototype.emplace=function(e,t,r,n,a,i,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,k,D,T,A,S,M){var E=34*e,C=17*e;return this.int16[E+0]=t,this.int16[E+1]=r,this.int16[E+2]=n,this.int16[E+3]=a,this.int16[E+4]=i,this.int16[E+5]=o,this.int16[E+6]=s,this.int16[E+7]=l,this.uint16[E+8]=c,this.uint16[E+9]=u,this.uint16[E+10]=f,this.uint16[E+11]=p,this.uint16[E+12]=h,this.uint16[E+13]=d,this.uint16[E+14]=m,this.uint16[E+15]=g,this.uint16[E+16]=y,this.uint16[E+17]=v,this.uint16[E+18]=b,this.uint16[E+19]=x,this.uint16[E+20]=_,this.uint16[E+21]=w,this.uint16[E+22]=k,this.uint32[C+12]=D,this.float32[C+13]=T,this.float32[C+14]=A,this.float32[C+15]=S,this.float32[C+16]=M,e},t}(Ma);Wa.prototype.bytesPerElement=68,Fn("StructArrayLayout8i15ui1ul4f68",Wa);var Ha=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.float32[r+0]=t,e},t}(Ma);Ha.prototype.bytesPerElement=4,Fn("StructArrayLayout1f4",Ha);var Ga=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var a=3*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,e},t}(Ma);Ga.prototype.bytesPerElement=6,Fn("StructArrayLayout3i6",Ga);var Xa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var a=2*e,i=4*e;return this.uint32[a+0]=t,this.uint16[i+2]=r,this.uint16[i+3]=n,e},t}(Ma);Xa.prototype.bytesPerElement=8,Fn("StructArrayLayout1ul2ui8",Xa);var Ya=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e},t}(Ma);Ya.prototype.bytesPerElement=4,Fn("StructArrayLayout2ui4",Ya);var Za=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint16[r+0]=t,e},t}(Ma);Za.prototype.bytesPerElement=2,Fn("StructArrayLayout1ui2",Za);var Ka=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e},t}(Ma);Ka.prototype.bytesPerElement=8,Fn("StructArrayLayout2f8",Ka);var Ja=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,a){var i=4*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,this.float32[i+3]=a,e},t}(Ma);Ja.prototype.bytesPerElement=16,Fn("StructArrayLayout4f16",Ja);var Qa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(Sa);Qa.prototype.size=20;var ei=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Qa(this,e)},t}(za);Fn("CollisionBoxArray",ei);var ti=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(Sa);ti.prototype.size=48;var ri=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new ti(this,e)},t}(qa);Fn("PlacedSymbolArray",ri);var ni=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+12]=e},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(Sa);ni.prototype.size=68;var ai=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new ni(this,e)},t}(Wa);Fn("SymbolInstanceArray",ai);var ii=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t}(Ha);Fn("GlyphOffsetArray",ii);var oi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t}(Ga);Fn("SymbolLineVertexArray",oi);var si=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(Sa);si.prototype.size=8;var li=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new si(this,e)},t}(Xa);Fn("FeatureIndexArray",li);var ci=Ea([{name:"a_pos",components:2,type:"Int16"}],4).members,ui=function(e){void 0===e&&(e=[]),this.segments=e};function fi(e,t){return 256*(e=l(Math.floor(e),0,255))+l(Math.floor(t),0,255)}ui.prototype.prepareSegment=function(e,t,r,n){var a=this.segments[this.segments.length-1];return e>ui.MAX_VERTEX_ARRAY_LENGTH&&_("Max vertices per segment is "+ui.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!a||a.vertexLength+e>ui.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n)&&(a={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(a.sortKey=n),this.segments.push(a)),a},ui.prototype.get=function(){return this.segments},ui.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var n in r.vaos)r.vaos[n].destroy()}},ui.simpleSegment=function(e,t,r,n){return new ui([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},ui.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Fn("SegmentVector",ui);var pi=Ea([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint8"},{name:"a_pixel_ratio_to",components:1,type:"Uint8"}]),hi=t((function(e){e.exports=function(e,t){var r,n,a,i,o,s,l,c;for(r=3&e.length,n=e.length-r,a=t,o=3432918353,s=461845907,c=0;c<n;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,a=27492+(65535&(i=5*(65535&(a=(a^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:a^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return a^=e.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0}})),di=t((function(e){e.exports=function(e,t){for(var r,n=e.length,a=t^n,i=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+((1540483477*(r>>>16)&65535)<<16),a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++i;switch(n){case 3:a^=(255&e.charCodeAt(i+2))<<16;case 2:a^=(255&e.charCodeAt(i+1))<<8;case 1:a=1540483477*(65535&(a^=255&e.charCodeAt(i)))+((1540483477*(a>>>16)&65535)<<16)}return a=1540483477*(65535&(a^=a>>>13))+((1540483477*(a>>>16)&65535)<<16),(a^=a>>>15)>>>0}})),mi=hi,gi=hi,yi=di;mi.murmur3=gi,mi.murmur2=yi;var vi=function(){this.ids=[],this.positions=[],this.indexed=!1};vi.prototype.add=function(e,t,r,n){this.ids.push(xi(e)),this.positions.push(t,r,n)},vi.prototype.getPositions=function(e){for(var t=xi(e),r=0,n=this.ids.length-1;r<n;){var a=r+n>>1;this.ids[a]>=t?n=a:r=a+1}for(var i=[];this.ids[r]===t;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];i.push({index:o,start:s,end:l}),r++}return i},vi.serialize=function(e,t){var r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return function e(t,r,n,a){for(;n<a;){for(var i=t[n+a>>1],o=n-1,s=a+1;;){do{o++}while(t[o]<i);do{s--}while(t[s]>i);if(o>=s)break;_i(t,o,s),_i(r,3*o,3*s),_i(r,3*o+1,3*s+1),_i(r,3*o+2,3*s+2)}s-n<a-s?(e(t,r,n,s),n=s+1):(e(t,r,s+1,a),a=s)}}(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}},vi.deserialize=function(e){var t=new vi;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var bi=Math.pow(2,53)-1;function xi(e){var t=+e;return!isNaN(t)&&t<=bi?t:mi(String(e))}function _i(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}Fn("FeaturePositionMap",vi);var wi=function(e,t){this.gl=e.gl,this.location=t},ki=function(e){function t(t,r){e.call(this,t,r),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))},t}(wi),Di=function(e){function t(t,r){e.call(this,t,r),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))},t}(wi),Ti=function(e){function t(t,r){e.call(this,t,r),this.current=[0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e[0]===this.current[0]&&e[1]===this.current[1]||(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))},t}(wi),Ai=function(e){function t(t,r){e.call(this,t,r),this.current=[0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]||(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))},t}(wi),Si=function(e){function t(t,r){e.call(this,t,r),this.current=[0,0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))},t}(wi),Mi=function(e){function t(t,r){e.call(this,t,r),this.current=Je.transparent}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))},t}(wi),Ei=new Float32Array(16),Ci=function(e){function t(t,r){e.call(this,t,r),this.current=Ei}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);for(var t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}},t}(wi);function Ni(e){return[fi(255*e.r,255*e.g),fi(255*e.b,255*e.a)]}var Oi=function(e,t,r){this.value=e,this.uniformNames=t.map((function(e){return"u_"+e})),this.type=r};Oi.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},Oi.prototype.getBinding=function(e,t,r){return"color"===this.type?new Mi(e,t):new Di(e,t)};var Ii=function(e,t){this.uniformNames=t.map((function(e){return"u_"+e})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Ii.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},Ii.prototype.setUniform=function(e,t,r,n){var a="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;a&&e.set(a)},Ii.prototype.getBinding=function(e,t,r){return"u_pattern"===r.substr(0,9)?new Si(e,t):new Di(e,t)};var Pi=function(e,t,r,n){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};Pi.prototype.populatePaintArray=function(e,t,r,n,a){var i=this.paintVertexArray.length,o=this.expression.evaluate(new ua(0),t,{},n,[],a);this.paintVertexArray.resize(e),this._setPaintValue(i,e,o)},Pi.prototype.updatePaintArray=function(e,t,r,n){var a=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(e,t,a)},Pi.prototype._setPaintValue=function(e,t,r){if("color"===this.type)for(var n=Ni(r),a=e;a<t;a++)this.paintVertexArray.emplace(a,n[0],n[1]);else{for(var i=e;i<t;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},Pi.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Pi.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Ri=function(e,t,r,n,a,i){this.expression=e,this.uniformNames=t.map((function(e){return"u_"+e+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=a,this.maxValue=0,this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new i};Ri.prototype.populatePaintArray=function(e,t,r,n,a){var i=this.expression.evaluate(new ua(this.zoom),t,{},n,[],a),o=this.expression.evaluate(new ua(this.zoom+1),t,{},n,[],a),s=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(s,e,i,o)},Ri.prototype.updatePaintArray=function(e,t,r,n){var a=this.expression.evaluate({zoom:this.zoom},r,n),i=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(e,t,a,i)},Ri.prototype._setPaintValue=function(e,t,r,n){if("color"===this.type)for(var a=Ni(r),i=Ni(n),o=e;o<t;o++)this.paintVertexArray.emplace(o,a[0],a[1],i[0],i[1]);else{for(var s=e;s<t;s++)this.paintVertexArray.emplace(s,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}},Ri.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Ri.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Ri.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,n=l(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(n)},Ri.prototype.getBinding=function(e,t,r){return new Di(e,t)};var Li=function(e,t,r,n,a,i){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=n,this.layerId=i,this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a};Li.prototype.populatePaintArray=function(e,t,r){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(n,e,t.patterns&&t.patterns[this.layerId],r)},Li.prototype.updatePaintArray=function(e,t,r,n,a){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],a)},Li.prototype._setPaintValues=function(e,t,r,n){if(n&&r){var a=r.min,i=r.mid,o=r.max,s=n[a],l=n[i],c=n[o];if(s&&l&&c)for(var u=e;u<t;u++)this.zoomInPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}},Li.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,pi.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,pi.members,this.expression.isStateDependent))},Li.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Fi=function(e,t,r,n){this.binders={},this.layoutAttributes=n,this._buffers=[];var a=[];for(var i in e.paint._values)if(r(i)){var o=e.paint.get(i);if(o instanceof ya&&Or(o.property.specification)){var s=zi(i,e.type),l=o.value,c=o.property.specification.type,u=o.property.useIntegerZoom,f=o.property.specification["property-type"],p="cross-faded"===f||"cross-faded-data-driven"===f;if("constant"===l.kind)this.binders[i]=p?new Ii(l.value,s):new Oi(l.value,s,c),a.push("/u_"+i);else if("source"===l.kind||p){var h=ji(i,c,"source");this.binders[i]=p?new Li(l,c,u,t,h,e.id):new Pi(l,s,c,h),a.push("/a_"+i)}else{var d=ji(i,c,"composite");this.binders[i]=new Ri(l,s,c,u,t,d),a.push("/z_"+i)}}}this.cacheKey=a.sort().join("")};Fi.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof Pi||t instanceof Ri?t.maxValue:0},Fi.prototype.populatePaintArrays=function(e,t,r,n,a){for(var i in this.binders){var o=this.binders[i];(o instanceof Pi||o instanceof Ri||o instanceof Li)&&o.populatePaintArray(e,t,r,n,a)}},Fi.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var n=this.binders[r];n instanceof Ii&&n.setConstantPatternPositions(e,t)}},Fi.prototype.updatePaintArrays=function(e,t,r,n,a){var i=!1;for(var o in e)for(var s=0,l=t.getPositions(o);s<l.length;s+=1){var c=l[s],u=r.feature(c.index);for(var f in this.binders){var p=this.binders[f];if((p instanceof Pi||p instanceof Ri||p instanceof Li)&&!0===p.expression.isStateDependent){var h=n.paint.get(f);p.expression=h.value,p.updatePaintArray(c.start,c.end,u,e[o],a),i=!0}}}return i},Fi.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof Oi||r instanceof Ii)&&e.push.apply(e,r.uniformNames.map((function(e){return"#define HAS_UNIFORM_"+e})))}return e},Fi.prototype.getPaintVertexBuffers=function(){return this._buffers},Fi.prototype.getUniforms=function(e,t){var r=[];for(var n in this.binders){var a=this.binders[n];if(a instanceof Oi||a instanceof Ii||a instanceof Ri)for(var i=0,o=a.uniformNames;i<o.length;i+=1){var s=o[i];if(t[s]){var l=a.getBinding(e,t[s],s);r.push({name:s,property:n,binding:l})}}}return r},Fi.prototype.setUniforms=function(e,t,r,n){for(var a=0,i=t;a<i.length;a+=1){var o=i[a],s=o.name,l=o.property,c=o.binding;this.binders[l].setUniform(c,n,r.get(l),s)}},Fi.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof Li){var n=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(r instanceof Pi||r instanceof Ri)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},Fi.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof Pi||r instanceof Ri||r instanceof Li)&&r.upload(e)}this.updatePaintBuffers()},Fi.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof Pi||t instanceof Ri||t instanceof Li)&&t.destroy()}};var Bi=function(e,t,r,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var a=0,i=t;a<i.length;a+=1){var o=i[a];this.programConfigurations[o.id]=new Fi(o,r,n,e)}this.needsUpload=!1,this._featureMap=new vi,this._bufferOffset=0};function zi(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function ji(e,t,r){var n={color:{source:Ka,composite:Ja},number:{source:Ha,composite:Ka}},a=function(e){return{"line-pattern":{source:Ra,composite:Ra},"fill-pattern":{source:Ra,composite:Ra},"fill-extrusion-pattern":{source:Ra,composite:Ra}}[e]}(e);return a&&a[r]||n[t][r]}Bi.prototype.populatePaintArrays=function(e,t,r,n,a,i){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(e,t,n,a,i);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},Bi.prototype.updatePaintArrays=function(e,t,r,n){for(var a=0,i=r;a<i.length;a+=1){var o=i[a];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,t,o,n)||this.needsUpload}},Bi.prototype.get=function(e){return this.programConfigurations[e]},Bi.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},Bi.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},Fn("ConstantBinder",Oi),Fn("CrossFadedConstantBinder",Ii),Fn("SourceExpressionBinder",Pi),Fn("CrossFadedCompositeBinder",Li),Fn("CompositeExpressionBinder",Ri),Fn("ProgramConfiguration",Fi,{omit:["_buffers"]}),Fn("ProgramConfigurationSet",Bi);var Ui=(15,{min:-1*Math.pow(2,14),max:Math.pow(2,14)-1});function $i(e){for(var t=8192/e.extent,r=e.loadGeometry(),n=0;n<r.length;n++)for(var a=r[n],i=0;i<a.length;i++){var o=a[i];o.x=Math.round(o.x*t),o.y=Math.round(o.y*t),(o.x<Ui.min||o.x>Ui.max||o.y<Ui.min||o.y>Ui.max)&&(_("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=l(o.x,Ui.min,Ui.max),o.y=l(o.y,Ui.min,Ui.max))}return r}function Vi(e,t,r,n,a){e.emplaceBack(2*t+(n+1)/2,2*r+(a+1)/2)}var qi=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Na,this.indexArray=new Va,this.segments=new ui,this.programConfigurations=new Bi(ci,e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function Wi(e,t){for(var r=0;r<e.length;r++)if(eo(t,e[r]))return!0;for(var n=0;n<t.length;n++)if(eo(e,t[n]))return!0;return!!Yi(e,t)}function Hi(e,t,r){return!!eo(e,t)||!!Ki(t,e,r)}function Gi(e,t){if(1===e.length)return Qi(t,e[0]);for(var r=0;r<t.length;r++)for(var n=t[r],a=0;a<n.length;a++)if(eo(e,n[a]))return!0;for(var i=0;i<e.length;i++)if(Qi(t,e[i]))return!0;for(var o=0;o<t.length;o++)if(Yi(e,t[o]))return!0;return!1}function Xi(e,t,r){if(e.length>1){if(Yi(e,t))return!0;for(var n=0;n<t.length;n++)if(Ki(t[n],e,r))return!0}for(var a=0;a<e.length;a++)if(Ki(e[a],t,r))return!0;return!1}function Yi(e,t){if(0===e.length||0===t.length)return!1;for(var r=0;r<e.length-1;r++)for(var n=e[r],a=e[r+1],i=0;i<t.length-1;i++)if(Zi(n,a,t[i],t[i+1]))return!0;return!1}function Zi(e,t,r,n){return w(e,r,n)!==w(t,r,n)&&w(e,t,r)!==w(e,t,n)}function Ki(e,t,r){var n=r*r;if(1===t.length)return e.distSqr(t[0])<n;for(var a=1;a<t.length;a++)if(Ji(e,t[a-1],t[a])<n)return!0;return!1}function Ji(e,t,r){var n=t.distSqr(r);if(0===n)return e.distSqr(t);var a=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/n;return a<0?e.distSqr(t):a>1?e.distSqr(r):e.distSqr(r.sub(t)._mult(a)._add(t))}function Qi(e,t){for(var r,n,a,i=!1,o=0;o<e.length;o++)for(var s=0,l=(r=e[o]).length-1;s<r.length;l=s++)n=r[s],a=r[l],n.y>t.y!=a.y>t.y&&t.x<(a.x-n.x)*(t.y-n.y)/(a.y-n.y)+n.x&&(i=!i);return i}function eo(e,t){for(var r=!1,n=0,a=e.length-1;n<e.length;a=n++){var i=e[n],o=e[a];i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(r=!r)}return r}function to(e,t,r){var n=r[0],a=r[2];if(e.x<n.x&&t.x<n.x||e.x>a.x&&t.x>a.x||e.y<n.y&&t.y<n.y||e.y>a.y&&t.y>a.y)return!1;var i=w(e,t,r[0]);return i!==w(e,t,r[1])||i!==w(e,t,r[2])||i!==w(e,t,r[3])}function ro(e,t,r){var n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function no(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function ao(e,t,r,n,i){if(!t[0]&&!t[1])return e;var o=a.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l<e.length;l++){var c=e[l];s.push(c.sub(o))}return s}qi.prototype.populate=function(e,t,r){var n=this.layers[0],a=[],i=null;"circle"===n.type&&(i=n.layout.get("circle-sort-key"));for(var o=0,s=e;o<s.length;o+=1){var l=s[o],c=l.feature,u=l.id,f=l.index,p=l.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,d={type:c.type,id:u,properties:c.properties,geometry:h?$i(c):[]};if(this.layers[0]._featureFilter.filter(new ua(this.zoom),d,r)){h||(d.geometry=$i(c));var m=i?i.evaluate(d,{},r):void 0,g={id:u,properties:c.properties,type:c.type,sourceLayerIndex:p,index:f,geometry:d.geometry,patterns:{},sortKey:m};a.push(g)}}i&&a.sort((function(e,t){return e.sortKey-t.sortKey}));for(var y=0,v=a;y<v.length;y+=1){var b=v[y],x=b,_=x.geometry,w=x.index,k=x.sourceLayerIndex,D=e[w].feature;this.addFeature(b,_,w,r),t.featureIndex.insert(D,_,w,k,this.index)}},qi.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},qi.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},qi.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},qi.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ci),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},qi.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},qi.prototype.addFeature=function(e,t,r,n){for(var a=0,i=t;a<i.length;a+=1)for(var o=0,s=i[a];o<s.length;o+=1){var l=s[o],c=l.x,u=l.y;if(!(c<0||c>=8192||u<0||u>=8192)){var f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),p=f.vertexLength;Vi(this.layoutVertexArray,c,u,-1,-1),Vi(this.layoutVertexArray,c,u,1,-1),Vi(this.layoutVertexArray,c,u,1,1),Vi(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),f.vertexLength+=4,f.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)},Fn("CircleBucket",qi,{omit:["layers"]});var io=new Da({"circle-sort-key":new xa(Se.layout_circle["circle-sort-key"])}),oo={paint:new Da({"circle-radius":new xa(Se.paint_circle["circle-radius"]),"circle-color":new xa(Se.paint_circle["circle-color"]),"circle-blur":new xa(Se.paint_circle["circle-blur"]),"circle-opacity":new xa(Se.paint_circle["circle-opacity"]),"circle-translate":new ba(Se.paint_circle["circle-translate"]),"circle-translate-anchor":new ba(Se.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ba(Se.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ba(Se.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new xa(Se.paint_circle["circle-stroke-width"]),"circle-stroke-color":new xa(Se.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new xa(Se.paint_circle["circle-stroke-opacity"])}),layout:io},so="undefined"!=typeof Float32Array?Float32Array:Array;function lo(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function co(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],p=t[9],h=t[10],d=t[11],m=t[12],g=t[13],y=t[14],v=t[15],b=r[0],x=r[1],_=r[2],w=r[3];return e[0]=b*n+x*s+_*f+w*m,e[1]=b*a+x*l+_*p+w*g,e[2]=b*i+x*c+_*h+w*y,e[3]=b*o+x*u+_*d+w*v,b=r[4],x=r[5],_=r[6],w=r[7],e[4]=b*n+x*s+_*f+w*m,e[5]=b*a+x*l+_*p+w*g,e[6]=b*i+x*c+_*h+w*y,e[7]=b*o+x*u+_*d+w*v,b=r[8],x=r[9],_=r[10],w=r[11],e[8]=b*n+x*s+_*f+w*m,e[9]=b*a+x*l+_*p+w*g,e[10]=b*i+x*c+_*h+w*y,e[11]=b*o+x*u+_*d+w*v,b=r[12],x=r[13],_=r[14],w=r[15],e[12]=b*n+x*s+_*f+w*m,e[13]=b*a+x*l+_*p+w*g,e[14]=b*i+x*c+_*h+w*y,e[15]=b*o+x*u+_*d+w*v,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var uo,fo=co;function po(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3];return e[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*o,e[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*o,e[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*o,e[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*o,e}uo=new so(3),so!=Float32Array&&(uo[0]=0,uo[1]=0,uo[2]=0),function(){var e=new so(4);so!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var ho=(function(){var e=new so(2);so!=Float32Array&&(e[0]=0,e[1]=0)}(),function(e){function t(t){e.call(this,t,oo)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new qi(e)},t.prototype.queryRadius=function(e){var t=e;return ro("circle-radius",this,t)+ro("circle-stroke-width",this,t)+no(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,a,i,o,s){for(var l=ao(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),i.angle,o),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),u="map"===this.paint.get("circle-pitch-alignment"),f=u?l:function(e,t){return e.map((function(e){return mo(e,t)}))}(l,s),p=u?c*o:c,h=0,d=n;h<d.length;h+=1)for(var m=0,g=d[h];m<g.length;m+=1){var y=g[m],v=u?y:mo(y,s),b=p,x=po([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?b*=x[3]/i.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(b*=i.cameraToCenterDistance/x[3]),Hi(f,v,b))return!0}return!1},t}(Ta));function mo(e,t){var r=po([],[e.x,e.y,0,1],t);return new a(r[0]/r[3],r[1]/r[3])}var go=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(qi);function yo(e,t,r,n){var a=t.width,i=t.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==a*i*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(a*i*r);return e.width=a,e.height=i,e.data=n,e}function vo(e,t,r){var n=t.width,a=t.height;if(n!==e.width||a!==e.height){var i=yo({},{width:n,height:a},r);bo(e,i,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,a)},r),e.width=n,e.height=a,e.data=i.data}}function bo(e,t,r,n,a,i){if(0===a.width||0===a.height)return t;if(a.width>e.width||a.height>e.height||r.x>e.width-a.width||r.y>e.height-a.height)throw new RangeError("out of range source coordinates for image copy");if(a.width>t.width||a.height>t.height||n.x>t.width-a.width||n.y>t.height-a.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=e.data,s=t.data,l=0;l<a.height;l++)for(var c=((r.y+l)*e.width+r.x)*i,u=((n.y+l)*t.width+n.x)*i,f=0;f<a.width*i;f++)s[u+f]=o[c+f];return t}Fn("HeatmapBucket",go,{omit:["layers"]});var xo=function(e,t){yo(this,e,1,t)};xo.prototype.resize=function(e){vo(this,e,1)},xo.prototype.clone=function(){return new xo({width:this.width,height:this.height},new Uint8Array(this.data))},xo.copy=function(e,t,r,n,a){bo(e,t,r,n,a,1)};var _o=function(e,t){yo(this,e,4,t)};_o.prototype.resize=function(e){vo(this,e,4)},_o.prototype.replace=function(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e},_o.prototype.clone=function(){return new _o({width:this.width,height:this.height},new Uint8Array(this.data))},_o.copy=function(e,t,r,n,a){bo(e,t,r,n,a,4)},Fn("AlphaImage",xo),Fn("RGBAImage",_o);var wo={paint:new Da({"heatmap-radius":new xa(Se.paint_heatmap["heatmap-radius"]),"heatmap-weight":new xa(Se.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ba(Se.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ka(Se.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ba(Se.paint_heatmap["heatmap-opacity"])})};function ko(e,t){for(var r=new Uint8Array(1024),n={},a=0,i=0;a<256;a++,i+=4){n[t]=a/255;var o=e.evaluate(n);r[i+0]=Math.floor(255*o.r/o.a),r[i+1]=Math.floor(255*o.g/o.a),r[i+2]=Math.floor(255*o.b/o.a),r[i+3]=Math.floor(255*o.a)}return new _o({width:256,height:1},r)}var Do=function(e){function t(t){e.call(this,t,wo),this._updateColorRamp()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new go(e)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){"heatmap-color"===e&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){var e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=ko(e,"heatmapDensity"),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},t}(Ta),To={paint:new Da({"hillshade-illumination-direction":new ba(Se.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new ba(Se.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ba(Se.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ba(Se.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ba(Se.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ba(Se.paint_hillshade["hillshade-accent-color"])})},Ao=function(e){function t(t){e.call(this,t,To)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},t}(Ta),So=Ea([{name:"a_pos",components:2,type:"Int16"}],4).members,Mo=Co,Eo=Co;function Co(e,t,r){r=r||2;var n,a,i,o,s,l,c,u=t&&t.length,f=u?t[0]*r:e.length,p=No(e,0,f,r,!0),h=[];if(!p||p.next===p.prev)return h;if(u&&(p=function(e,t,r,n){var a,i,o,s=[];for(a=0,i=t.length;a<i;a++)(o=No(e,t[a]*n,a<i-1?t[a+1]*n:e.length,n,!1))===o.next&&(o.steiner=!0),s.push($o(o));for(s.sort(Bo),a=0;a<s.length;a++)zo(s[a],r),r=Oo(r,r.next);return r}(e,t,p,r)),e.length>80*r){n=i=e[0],a=o=e[1];for(var d=r;d<f;d+=r)(s=e[d])<n&&(n=s),(l=e[d+1])<a&&(a=l),s>i&&(i=s),l>o&&(o=l);c=0!==(c=Math.max(i-n,o-a))?1/c:0}return Io(p,h,r,n,a,c),h}function No(e,t,r,n,a){var i,o;if(a===ts(e,t,r,n)>0)for(i=t;i<r;i+=n)o=Jo(i,e[i],e[i+1],o);else for(i=r-n;i>=t;i-=n)o=Jo(i,e[i],e[i+1],o);return o&&Ho(o,o.next)&&(Qo(o),o=o.next),o}function Oo(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!Ho(n,n.next)&&0!==Wo(n.prev,n,n.next))n=n.next;else{if(Qo(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function Io(e,t,r,n,a,i,o){if(e){!o&&i&&function(e,t,r,n){var a=e;do{null===a.z&&(a.z=Uo(a.x,a.y,t,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,function(e){var t,r,n,a,i,o,s,l,c=1;do{for(r=e,e=null,i=null,o=0;r;){for(o++,n=r,s=0,t=0;t<c&&(s++,n=n.nextZ);t++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,l--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;r=n}i.nextZ=null,c*=2}while(o>1)}(a)}(e,n,a,i);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,i?Ro(e,n,a,i):Po(e))t.push(s.i/r),t.push(e.i/r),t.push(l.i/r),Qo(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?Io(e=Lo(Oo(e),t,r),t,r,n,a,i,2):2===o&&Fo(e,t,r,n,a,i):Io(Oo(e),t,r,n,a,i,1);break}}}function Po(e){var t=e.prev,r=e,n=e.next;if(Wo(t,r,n)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(Vo(t.x,t.y,r.x,r.y,n.x,n.y,a.x,a.y)&&Wo(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function Ro(e,t,r,n){var a=e.prev,i=e,o=e.next;if(Wo(a,i,o)>=0)return!1;for(var s=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,l=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,u=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=Uo(s,l,t,r,n),p=Uo(c,u,t,r,n),h=e.prevZ,d=e.nextZ;h&&h.z>=f&&d&&d.z<=p;){if(h!==e.prev&&h!==e.next&&Vo(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&Wo(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,d!==e.prev&&d!==e.next&&Vo(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&Wo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;h&&h.z>=f;){if(h!==e.prev&&h!==e.next&&Vo(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&Wo(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;d&&d.z<=p;){if(d!==e.prev&&d!==e.next&&Vo(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&Wo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Lo(e,t,r){var n=e;do{var a=n.prev,i=n.next.next;!Ho(a,i)&&Go(a,n,n.next,i)&&Zo(a,i)&&Zo(i,a)&&(t.push(a.i/r),t.push(n.i/r),t.push(i.i/r),Qo(n),Qo(n.next),n=e=i),n=n.next}while(n!==e);return Oo(n)}function Fo(e,t,r,n,a,i){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&qo(o,s)){var l=Ko(o,s);return o=Oo(o,o.next),l=Oo(l,l.next),Io(o,t,r,n,a,i),void Io(l,t,r,n,a,i)}s=s.next}o=o.next}while(o!==e)}function Bo(e,t){return e.x-t.x}function zo(e,t){if(t=function(e,t){var r,n=t,a=e.x,i=e.y,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=a&&s>o){if(o=s,s===a){if(i===n.y)return n;if(i===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(a===o)return r;var l,c=r,u=r.x,f=r.y,p=1/0;n=r;do{a>=n.x&&n.x>=u&&a!==n.x&&Vo(i<f?a:o,i,u,f,i<f?o:a,i,n.x,n.y)&&(l=Math.abs(i-n.y)/(a-n.x),Zo(n,e)&&(l<p||l===p&&(n.x>r.x||n.x===r.x&&jo(r,n)))&&(r=n,p=l)),n=n.next}while(n!==c);return r}(e,t)){var r=Ko(t,e);Oo(t,t.next),Oo(r,r.next)}}function jo(e,t){return Wo(e.prev,e,t.prev)<0&&Wo(t.next,e,e.next)<0}function Uo(e,t,r,n,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*a)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*a)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function $o(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function Vo(e,t,r,n,a,i,o,s){return(a-o)*(t-s)-(e-o)*(i-s)>=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(i-s)-(a-o)*(n-s)>=0}function qo(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Go(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Zo(e,t)&&Zo(t,e)&&function(e,t){var r=e,n=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Wo(e.prev,e,t.prev)||Wo(e,t.prev,t))||Ho(e,t)&&Wo(e.prev,e,e.next)>0&&Wo(t.prev,t,t.next)>0)}function Wo(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Ho(e,t){return e.x===t.x&&e.y===t.y}function Go(e,t,r,n){var a=Yo(Wo(e,t,r)),i=Yo(Wo(e,t,n)),o=Yo(Wo(r,n,e)),s=Yo(Wo(r,n,t));return a!==i&&o!==s||!(0!==a||!Xo(e,r,t))||!(0!==i||!Xo(e,n,t))||!(0!==o||!Xo(r,e,n))||!(0!==s||!Xo(r,t,n))}function Xo(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Yo(e){return e>0?1:e<0?-1:0}function Zo(e,t){return Wo(e.prev,e,e.next)<0?Wo(e,t,e.next)>=0&&Wo(e,e.prev,t)>=0:Wo(e,t,e.prev)<0||Wo(e,e.next,t)<0}function Ko(e,t){var r=new es(e.i,e.x,e.y),n=new es(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function Jo(e,t,r,n){var a=new es(e,t,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function Qo(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function es(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ts(e,t,r,n){for(var a=0,i=t,o=r-n;i<r;i+=n)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}function rs(e,t,r,n,a){!function e(t,r,n,a,i){for(;a>n;){if(a-n>600){var o=a-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);e(t,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(a,Math.floor(r+(o-s)*c/o+u)),i)}var f=t[r],p=n,h=a;for(ns(t,n,r),i(t[a],f)>0&&ns(t,n,a);p<h;){for(ns(t,p,h),p++,h--;i(t[p],f)<0;)p++;for(;i(t[h],f)>0;)h--}0===i(t[n],f)?ns(t,n,h):ns(t,++h,a),h<=r&&(n=h+1),r<=h&&(a=h-1)}}(e,t,r||0,n||e.length-1,a||as)}function ns(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function as(e,t){return e<t?-1:e>t?1:0}function is(e,t){var r=e.length;if(r<=1)return[e];for(var n,a,i=[],o=0;o<r;o++){var s=k(e[o]);0!==s&&(e[o].area=Math.abs(s),void 0===a&&(a=s<0),a===s<0?(n&&i.push(n),n=[e[o]]):n.push(e[o]))}if(n&&i.push(n),t>1)for(var l=0;l<i.length;l++)i[l].length<=t||(rs(i[l],t,1,i[l].length-1,os),i[l]=i[l].slice(0,t));return i}function os(e,t){return t.area-e.area}function ss(e,t,r){for(var n=r.patternDependencies,a=!1,i=0,o=t;i<o.length;i+=1){var s=o[i].paint.get(e+"-pattern");s.isConstant()||(a=!0);var l=s.constantOr(null);l&&(a=!0,n[l.to]=!0,n[l.from]=!0)}return a}function ls(e,t,r,n,a){for(var i=a.patternDependencies,o=0,s=t;o<s.length;o+=1){var l=s[o],c=l.paint.get(e+"-pattern").value;if("constant"!==c.kind){var u=c.evaluate({zoom:n-1},r,{},a.availableImages),f=c.evaluate({zoom:n},r,{},a.availableImages),p=c.evaluate({zoom:n+1},r,{},a.availableImages);u=u&&u.name?u.name:u,f=f&&f.name?f.name:f,p=p&&p.name?p.name:p,i[u]=!0,i[f]=!0,i[p]=!0,r.patterns[l.id]={min:u,mid:f,max:p}}}return r}Co.deviation=function(e,t,r,n){var a=t&&t.length,i=a?t[0]*r:e.length,o=Math.abs(ts(e,0,i,r));if(a)for(var s=0,l=t.length;s<l;s++){var c=t[s]*r,u=s<l-1?t[s+1]*r:e.length;o-=Math.abs(ts(e,c,u,r))}var f=0;for(s=0;s<n.length;s+=3){var p=n[s]*r,h=n[s+1]*r,d=n[s+2]*r;f+=Math.abs((e[p]-e[d])*(e[h+1]-e[p+1])-(e[p]-e[h])*(e[d+1]-e[p+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},Co.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)r.vertices.push(e[a][i][o]);a>0&&(n+=e[a-1].length,r.holes.push(n))}return r},Mo.default=Eo;var cs=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Na,this.indexArray=new Va,this.indexArray2=new Ya,this.programConfigurations=new Bi(So,e.layers,e.zoom),this.segments=new ui,this.segments2=new ui,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};cs.prototype.populate=function(e,t,r){this.hasPattern=ss("fill",this.layers,t);for(var n=this.layers[0].layout.get("fill-sort-key"),a=[],i=0,o=e;i<o.length;i+=1){var s=o[i],l=s.feature,c=s.id,u=s.index,f=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,h={type:l.type,id:c,properties:l.properties,geometry:p?$i(l):[]};if(this.layers[0]._featureFilter.filter(new ua(this.zoom),h,r)){p||(h.geometry=$i(l));var d=n?n.evaluate(h,{},r,t.availableImages):void 0,m={id:c,properties:l.properties,type:l.type,sourceLayerIndex:f,index:u,geometry:h.geometry,patterns:{},sortKey:d};a.push(m)}}n&&a.sort((function(e,t){return e.sortKey-t.sortKey}));for(var g=0,y=a;g<y.length;g+=1){var v=y[g],b=v,x=b.geometry,_=b.index,w=b.sourceLayerIndex;if(this.hasPattern){var k=ls("fill",this.layers,v,this.zoom,t);this.patternFeatures.push(k)}else this.addFeature(v,x,_,r,{});var D=e[_].feature;t.featureIndex.insert(D,x,_,w,this.index)}},cs.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},cs.prototype.addFeatures=function(e,t,r){for(var n=0,a=this.patternFeatures;n<a.length;n+=1){var i=a[n];this.addFeature(i,i.geometry,i.index,t,r)}},cs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},cs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},cs.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,So),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},cs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},cs.prototype.addFeature=function(e,t,r,n,a){for(var i=0,o=is(t,500);i<o.length;i+=1){for(var s=o[i],l=0,c=0,u=s;c<u.length;c+=1)l+=u[c].length;for(var f=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),p=f.vertexLength,h=[],d=[],m=0,g=s;m<g.length;m+=1){var y=g[m];if(0!==y.length){y!==s[0]&&d.push(h.length/2);var v=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),b=v.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(b+y.length-1,b),h.push(y[0].x),h.push(y[0].y);for(var x=1;x<y.length;x++)this.layoutVertexArray.emplaceBack(y[x].x,y[x].y),this.indexArray2.emplaceBack(b+x-1,b+x),h.push(y[x].x),h.push(y[x].y);v.vertexLength+=y.length,v.primitiveLength+=y.length}}for(var _=Mo(h,d),w=0;w<_.length;w+=3)this.indexArray.emplaceBack(p+_[w],p+_[w+1],p+_[w+2]);f.vertexLength+=l,f.primitiveLength+=_.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,a,n)},Fn("FillBucket",cs,{omit:["layers","patternFeatures"]});var us=new Da({"fill-sort-key":new xa(Se.layout_fill["fill-sort-key"])}),fs={paint:new Da({"fill-antialias":new ba(Se.paint_fill["fill-antialias"]),"fill-opacity":new xa(Se.paint_fill["fill-opacity"]),"fill-color":new xa(Se.paint_fill["fill-color"]),"fill-outline-color":new xa(Se.paint_fill["fill-outline-color"]),"fill-translate":new ba(Se.paint_fill["fill-translate"]),"fill-translate-anchor":new ba(Se.paint_fill["fill-translate-anchor"]),"fill-pattern":new _a(Se.paint_fill["fill-pattern"])}),layout:us},ps=function(e){function t(t){e.call(this,t,fs)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(e){return new cs(e)},t.prototype.queryRadius=function(){return no(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,a,i,o){return Gi(ao(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),i.angle,o),n)},t.prototype.isTileClipped=function(){return!0},t}(Ta),hs=Ea([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,ds=ms;function ms(e,t,r,n,a){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=a,e.readFields(gs,this,t)}function gs(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],a=t._values[e.readVarint()];t.properties[n]=a}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function ys(e){for(var t,r,n=0,a=0,i=e.length,o=i-1;a<i;o=a++)t=e[a],n+=((r=e[o]).x-t.x)*(t.y+r.y);return n}ms.types=["Unknown","Point","LineString","Polygon"],ms.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,l=[];e.pos<r;){if(i<=0){var c=e.readVarint();n=7&c,i=c>>3}if(i--,1===n||2===n)o+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&l.push(t),t=[]),t.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&l.push(t),l},ms.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,a=0,i=0,o=1/0,s=-1/0,l=1/0,c=-1/0;e.pos<t;){if(n<=0){var u=e.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(a+=e.readSVarint())<o&&(o=a),a>s&&(s=a),(i+=e.readSVarint())<l&&(l=i),i>c&&(c=i);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},ms.prototype.toGeoJSON=function(e,t,r){var n,a,i=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=ms.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t],n=180-360*(r.y+s)/i;e[t]=[360*(r.x+o)/i-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var f=[];for(n=0;n<l.length;n++)f[n]=l[n][0];u(l=f);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,a=[],i=0;i<t;i++){var o=ys(e[i]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&a.push(r),r=[e[i]]):r.push(e[i]))}return r&&a.push(r),a}(l),n=0;n<l.length;n++)for(a=0;a<l[n].length;a++)u(l[n][a])}1===l.length?l=l[0]:c="Multi"+c;var p={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var vs=bs;function bs(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(xs,this,t),this.length=this._features.length}function xs(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}function _s(e,t,r){if(3===e){var n=new vs(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}bs.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new ds(this._pbf,t,this.extent,this._keys,this._values)};var ws={VectorTile:function(e,t){this.layers=e.readFields(_s,{},t)},VectorTileFeature:ds,VectorTileLayer:vs},ks=ws.VectorTileFeature.types,Ds=Math.pow(2,13);function Ts(e,t,r,n,a,i,o,s){e.emplaceBack(t,r,2*Math.floor(n*Ds)+o,a*Ds*2,i*Ds*2,Math.round(s))}var As=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Ia,this.indexArray=new Va,this.programConfigurations=new Bi(hs,e.layers,e.zoom),this.segments=new ui,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function Ss(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}function Ms(e){return e.every((function(e){return e.x<0}))||e.every((function(e){return e.x>8192}))||e.every((function(e){return e.y<0}))||e.every((function(e){return e.y>8192}))}As.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=ss("fill-extrusion",this.layers,t);for(var n=0,a=e;n<a.length;n+=1){var i=a[n],o=i.feature,s=i.id,l=i.index,c=i.sourceLayerIndex,u=this.layers[0]._featureFilter.needGeometry,f={type:o.type,id:s,properties:o.properties,geometry:u?$i(o):[]};if(this.layers[0]._featureFilter.filter(new ua(this.zoom),f,r)){var p={id:s,sourceLayerIndex:c,index:l,geometry:u?f.geometry:$i(o),properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(p.id=o.id),this.hasPattern?this.features.push(ls("fill-extrusion",this.layers,p,this.zoom,t)):this.addFeature(p,p.geometry,l,r,{}),t.featureIndex.insert(o,p.geometry,l,c,this.index,!0)}}},As.prototype.addFeatures=function(e,t,r){for(var n=0,a=this.features;n<a.length;n+=1){var i=a[n],o=i.geometry;this.addFeature(i,o,i.index,t,r)}},As.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},As.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},As.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},As.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hs),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},As.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},As.prototype.addFeature=function(e,t,r,n,a){for(var i=0,o=is(t,500);i<o.length;i+=1){for(var s=o[i],l=0,c=0,u=s;c<u.length;c+=1)l+=u[c].length;for(var f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),p=0,h=s;p<h.length;p+=1){var d=h[p];if(0!==d.length&&!Ms(d))for(var m=0,g=0;g<d.length;g++){var y=d[g];if(g>=1){var v=d[g-1];if(!Ss(y,v)){f.vertexLength+4>ui.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var b=y.sub(v)._perp()._unit(),x=v.dist(y);m+x>32768&&(m=0),Ts(this.layoutVertexArray,y.x,y.y,b.x,b.y,0,0,m),Ts(this.layoutVertexArray,y.x,y.y,b.x,b.y,0,1,m),m+=x,Ts(this.layoutVertexArray,v.x,v.y,b.x,b.y,0,0,m),Ts(this.layoutVertexArray,v.x,v.y,b.x,b.y,0,1,m);var _=f.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),f.vertexLength+=4,f.primitiveLength+=2}}}}if(f.vertexLength+l>ui.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===ks[e.type]){for(var w=[],k=[],D=f.vertexLength,T=0,A=s;T<A.length;T+=1){var S=A[T];if(0!==S.length){S!==s[0]&&k.push(w.length/2);for(var M=0;M<S.length;M++){var E=S[M];Ts(this.layoutVertexArray,E.x,E.y,0,0,1,1,0),w.push(E.x),w.push(E.y)}}}for(var C=Mo(w,k),N=0;N<C.length;N+=3)this.indexArray.emplaceBack(D+C[N],D+C[N+2],D+C[N+1]);f.primitiveLength+=C.length/3,f.vertexLength+=l}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,a,n)},Fn("FillExtrusionBucket",As,{omit:["layers","features"]});var Es={paint:new Da({"fill-extrusion-opacity":new ba(Se["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new xa(Se["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ba(Se["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ba(Se["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new _a(Se["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new xa(Se["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new xa(Se["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ba(Se["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Cs=function(e){function t(t){e.call(this,t,Es)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new As(e)},t.prototype.queryRadius=function(){return no(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,o,s,l){var c=ao(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),u=this.paint.get("fill-extrusion-height").evaluate(t,r),f=this.paint.get("fill-extrusion-base").evaluate(t,r),p=function(e,t,r,n){for(var i=[],o=0,s=e;o<s.length;o+=1){var l=s[o],c=[l.x,l.y,0,1];po(c,c,t),i.push(new a(c[0]/c[3],c[1]/c[3]))}return i}(c,l),h=function(e,t,r,n){for(var i=[],o=[],s=n[8]*t,l=n[9]*t,c=n[10]*t,u=n[11]*t,f=n[8]*r,p=n[9]*r,h=n[10]*r,d=n[11]*r,m=0,g=e;m<g.length;m+=1){for(var y=[],v=[],b=0,x=g[m];b<x.length;b+=1){var _=x[b],w=_.x,k=_.y,D=n[0]*w+n[4]*k+n[12],T=n[1]*w+n[5]*k+n[13],A=n[2]*w+n[6]*k+n[14],S=n[3]*w+n[7]*k+n[15],M=A+c,E=S+u,C=D+f,N=T+p,O=A+h,I=S+d,P=new a((D+s)/E,(T+l)/E);P.z=M/E,y.push(P);var R=new a(C/I,N/I);R.z=O/I,v.push(R)}i.push(y),o.push(v)}return[i,o]}(n,f,u,l);return function(e,t,r){var n=1/0;Gi(r,t)&&(n=Os(r,t[0]));for(var a=0;a<t.length;a++)for(var i=t[a],o=e[a],s=0;s<i.length-1;s++){var l=i[s],c=i[s+1],u=o[s],f=[l,c,o[s+1],u,l];Wi(r,f)&&(n=Math.min(n,Os(r,f)))}return n!==1/0&&n}(h[0],h[1],p)},t}(Ta);function Ns(e,t){return e.x*t.x+e.y*t.y}function Os(e,t){if(1===e.length){for(var r,n=0,a=t[n++];!r||a.equals(r);)if(!(r=t[n++]))return 1/0;for(;n<t.length;n++){var i=t[n],o=e[0],s=r.sub(a),l=i.sub(a),c=o.sub(a),u=Ns(s,s),f=Ns(s,l),p=Ns(l,l),h=Ns(c,s),d=Ns(c,l),m=u*p-f*f,g=(p*h-f*d)/m,y=(u*d-f*h)/m,v=1-g-y,b=a.z*v+r.z*g+i.z*y;if(isFinite(b))return b}return 1/0}for(var x=1/0,_=0,w=t;_<w.length;_+=1){var k=w[_];x=Math.min(x,k.z)}return x}var Is=Ea([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Ps=ws.VectorTileFeature.types,Rs=Math.cos(Math.PI/180*37.5),Ls=Math.pow(2,14)/.5,Fs=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Pa,this.indexArray=new Va,this.programConfigurations=new Bi(Is,e.layers,e.zoom),this.segments=new ui,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};Fs.prototype.populate=function(e,t,r){this.hasPattern=ss("line",this.layers,t);for(var n=this.layers[0].layout.get("line-sort-key"),a=[],i=0,o=e;i<o.length;i+=1){var s=o[i],l=s.feature,c=s.id,u=s.index,f=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,h={type:l.type,id:c,properties:l.properties,geometry:p?$i(l):[]};if(this.layers[0]._featureFilter.filter(new ua(this.zoom),h,r)){p||(h.geometry=$i(l));var d=n?n.evaluate(h,{},r):void 0,m={id:c,properties:l.properties,type:l.type,sourceLayerIndex:f,index:u,geometry:h.geometry,patterns:{},sortKey:d};a.push(m)}}n&&a.sort((function(e,t){return e.sortKey-t.sortKey}));for(var g=0,y=a;g<y.length;g+=1){var v=y[g],b=v,x=b.geometry,_=b.index,w=b.sourceLayerIndex;if(this.hasPattern){var k=ls("line",this.layers,v,this.zoom,t);this.patternFeatures.push(k)}else this.addFeature(v,x,_,r,{});var D=e[_].feature;t.featureIndex.insert(D,x,_,w,this.index)}},Fs.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Fs.prototype.addFeatures=function(e,t,r){for(var n=0,a=this.patternFeatures;n<a.length;n+=1){var i=a[n];this.addFeature(i,i.geometry,i.index,t,r)}},Fs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Fs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Fs.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Is),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Fs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Fs.prototype.addFeature=function(e,t,r,n,a){for(var i=this.layers[0].layout,o=i.get("line-join").evaluate(e,{}),s=i.get("line-cap"),l=i.get("line-miter-limit"),c=i.get("line-round-limit"),u=0,f=t;u<f.length;u+=1){var p=f[u];this.addLine(p,e,o,s,l,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,a,n)},Fs.prototype.addLine=function(e,t,r,n,a,i){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+t.properties.mapbox_clip_start,this.clipEnd=+t.properties.mapbox_clip_end;for(var o=0;o<e.length-1;o++)this.totalDistance+=e[o].dist(e[o+1]);this.updateScaledDistance()}for(var s="Polygon"===Ps[t.type],l=e.length;l>=2&&e[l-1].equals(e[l-2]);)l--;for(var c=0;c<l-1&&e[c].equals(e[c+1]);)c++;if(!(l<(s?3:2))){"bevel"===r&&(a=1.05);var u,f=this.overscaling<=16?122880/(512*this.overscaling):0,p=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),h=void 0,d=void 0,m=void 0,g=void 0;this.e1=this.e2=-1,s&&(u=e[l-2],g=e[c].sub(u)._unit()._perp());for(var y=c;y<l;y++)if(!(d=y===l-1?s?e[c+1]:void 0:e[y+1])||!e[y].equals(d)){g&&(m=g),u&&(h=u),u=e[y],g=d?d.sub(u)._unit()._perp():m;var v=(m=m||g).add(g);0===v.x&&0===v.y||v._unit();var b=m.x*g.x+m.y*g.y,x=v.x*g.x+v.y*g.y,_=0!==x?1/x:1/0,w=2*Math.sqrt(2-2*x),k=x<Rs&&h&&d,D=m.x*g.y-m.y*g.x>0;if(k&&y>c){var T=u.dist(h);if(T>2*f){var A=u.sub(u.sub(h)._mult(f/T)._round());this.updateDistance(h,A),this.addCurrentVertex(A,m,0,0,p),h=A}}var S=h&&d,M=S?r:s?"butt":n;if(S&&"round"===M&&(_<i?M="miter":_<=2&&(M="fakeround")),"miter"===M&&_>a&&(M="bevel"),"bevel"===M&&(_>2&&(M="flipbevel"),_<a&&(M="miter")),h&&this.updateDistance(h,u),"miter"===M)v._mult(_),this.addCurrentVertex(u,v,0,0,p);else if("flipbevel"===M){if(_>100)v=g.mult(-1);else{var E=_*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(E*(D?-1:1))}this.addCurrentVertex(u,v,0,0,p),this.addCurrentVertex(u,v.mult(-1),0,0,p)}else if("bevel"===M||"fakeround"===M){var C=-Math.sqrt(_*_-1),N=D?C:0,O=D?0:C;if(h&&this.addCurrentVertex(u,m,N,O,p),"fakeround"===M)for(var I=Math.round(180*w/Math.PI/20),P=1;P<I;P++){var R=P/I;if(.5!==R){var L=R-.5;R+=R*L*(R-1)*((1.0904+b*(b*(3.55645-1.43519*b)-3.2452))*L*L+(.848013+b*(.215638*b-1.06021)))}var F=g.sub(m)._mult(R)._add(m)._unit()._mult(D?-1:1);this.addHalfVertex(u,F.x,F.y,!1,D,0,p)}d&&this.addCurrentVertex(u,g,-N,-O,p)}else if("butt"===M)this.addCurrentVertex(u,v,0,0,p);else if("square"===M){var B=h?1:-1;this.addCurrentVertex(u,v,B,B,p)}else"round"===M&&(h&&(this.addCurrentVertex(u,m,0,0,p),this.addCurrentVertex(u,m,1,1,p,!0)),d&&(this.addCurrentVertex(u,g,-1,-1,p,!0),this.addCurrentVertex(u,g,0,0,p)));if(k&&y<l-1){var z=u.dist(d);if(z>2*f){var j=u.add(d.sub(u)._mult(f/z)._round());this.updateDistance(u,j),this.addCurrentVertex(j,g,0,0,p),u=j}}}}},Fs.prototype.addCurrentVertex=function(e,t,r,n,a,i){void 0===i&&(i=!1);var o=t.x+t.y*r,s=t.y-t.x*r,l=-t.x+t.y*n,c=-t.y-t.x*n;this.addHalfVertex(e,o,s,i,!1,r,a),this.addHalfVertex(e,l,c,i,!0,-n,a),this.distance>Ls/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,r,n,a,i))},Fs.prototype.addHalfVertex=function(e,t,r,n,a,i,o){var s=e.x,l=e.y,c=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(a?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(0===i?0:i<0?-1:1)|(63&c)<<2,c>>6);var u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),a?this.e2=u:this.e1=u},Fs.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Ls-1):this.distance},Fs.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},Fn("LineBucket",Fs,{omit:["layers","patternFeatures"]});var Bs=new Da({"line-cap":new ba(Se.layout_line["line-cap"]),"line-join":new xa(Se.layout_line["line-join"]),"line-miter-limit":new ba(Se.layout_line["line-miter-limit"]),"line-round-limit":new ba(Se.layout_line["line-round-limit"]),"line-sort-key":new xa(Se.layout_line["line-sort-key"])}),zs={paint:new Da({"line-opacity":new xa(Se.paint_line["line-opacity"]),"line-color":new xa(Se.paint_line["line-color"]),"line-translate":new ba(Se.paint_line["line-translate"]),"line-translate-anchor":new ba(Se.paint_line["line-translate-anchor"]),"line-width":new xa(Se.paint_line["line-width"]),"line-gap-width":new xa(Se.paint_line["line-gap-width"]),"line-offset":new xa(Se.paint_line["line-offset"]),"line-blur":new xa(Se.paint_line["line-blur"]),"line-dasharray":new wa(Se.paint_line["line-dasharray"]),"line-pattern":new _a(Se.paint_line["line-pattern"]),"line-gradient":new ka(Se.paint_line["line-gradient"])}),layout:Bs},js=new(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(t,r){return r=new ua(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),e.prototype.possiblyEvaluate.call(this,t,r)},t.prototype.evaluate=function(t,r,n,a){return r=u({},r,{zoom:Math.floor(r.zoom)}),e.prototype.evaluate.call(this,t,r,n,a)},t}(xa))(zs.paint.properties["line-width"].specification);js.useIntegerZoom=!0;var Us=function(e){function t(t){e.call(this,t,zs)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){"line-gradient"===e&&this._updateGradient()},t.prototype._updateGradient=function(){var e=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=ko(e,"lineProgress"),this.gradientTexture=null},t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r),this.paint._values["line-floorwidth"]=js.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new Fs(e)},t.prototype.queryRadius=function(e){var t=e,r=$s(ro("line-width",this,t),ro("line-gap-width",this,t)),n=ro("line-offset",this,t);return r/2+Math.abs(n)+no(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,o,s){var l=ao(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*$s(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),u=this.paint.get("line-offset").evaluate(t,r);return u&&(n=function(e,t){for(var r=[],n=new a(0,0),i=0;i<e.length;i++){for(var o=e[i],s=[],l=0;l<o.length;l++){var c=o[l-1],u=o[l],f=o[l+1],p=0===l?n:u.sub(c)._unit()._perp(),h=l===o.length-1?n:f.sub(u)._unit()._perp(),d=p._add(h)._unit(),m=d.x*h.x+d.y*h.y;d._mult(1/m),s.push(d._mult(t)._add(u))}r.push(s)}return r}(n,u*s)),function(e,t,r){for(var n=0;n<t.length;n++){var a=t[n];if(e.length>=3)for(var i=0;i<a.length;i++)if(eo(e,a[i]))return!0;if(Xi(e,a,r))return!0}return!1}(l,n,c)},t.prototype.isTileClipped=function(){return!0},t}(Ta);function $s(e,t){return t>0?t+2*e:e}var Vs=Ea([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),qs=Ea([{name:"a_projected_pos",components:3,type:"Float32"}],4),Ws=(Ea([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ea([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Hs=(Ea([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ea([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Gs=Ea([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Xs(e,t,r){return e.sections.forEach((function(e){e.text=function(e,t,r){var n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),ca.applyArabicShaping&&(e=ca.applyArabicShaping(e)),e}(e.text,t,r)})),e}Ea([{name:"triangle",components:3,type:"Uint16"}]),Ea([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ea([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ea([{type:"Float32",name:"offsetX"}]),Ea([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ys={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Zs=function(e,t,r,n,a){var i,o,s=8*a-n-1,l=(1<<s)-1,c=l>>1,u=-7,f=r?a-1:0,p=r?-1:1,h=e[t+f];for(f+=p,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+f],f+=p,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+e[t+f],f+=p,u-=8);if(0===i)i=1-c;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),i-=c}return(h?-1:1)*o*Math.pow(2,i-n)},Ks=function(e,t,r,n,a,i){var o,s,l,c=8*i-a-1,u=(1<<c)-1,f=u>>1,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=n?1:-1,m=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=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?p/l:p*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(t*l-1)*Math.pow(2,a),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;e[r+h]=255&s,h+=d,s/=256,a-=8);for(o=o<<a|s,c+=a;c>0;e[r+h]=255&o,h+=d,o/=256,c-=8);e[r+h-d]|=128*m},Js=Qs;function Qs(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Qs.Varint=0,Qs.Fixed64=1,Qs.Bytes=2,Qs.Fixed32=5;var el="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function tl(e){return e.type===Qs.Bytes?e.readVarint()+e.pos:e.pos+1}function rl(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function nl(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var a=r.pos-1;a>=e;a--)r.buf[a+n]=r.buf[a]}function al(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function il(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function ol(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function sl(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function ll(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function cl(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function ul(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function fl(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function pl(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function hl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function dl(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function ml(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function gl(e,t,r){1===e&&r.readMessage(yl,t)}function yl(e,t,r){if(3===e){var n=r.readMessage(vl,{}),a=n.id,i=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;t.push({id:a,bitmap:new xo({width:o+6,height:s+6},i),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function vl(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function bl(e){for(var t=0,r=0,n=0,a=e;n<a.length;n+=1){var i=a[n];t+=i.w*i.h,r=Math.max(r,i.w)}e.sort((function(e,t){return t.h-e.h}));for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],s=0,l=0,c=0,u=e;c<u.length;c+=1)for(var f=u[c],p=o.length-1;p>=0;p--){var h=o[p];if(!(f.w>h.w||f.h>h.h)){if(f.x=h.x,f.y=h.y,l=Math.max(l,f.y+f.h),s=Math.max(s,f.x+f.w),f.w===h.w&&f.h===h.h){var d=o.pop();p<o.length&&(o[p]=d)}else f.h===h.h?(h.x+=f.w,h.w-=f.w):f.w===h.w?(h.y+=f.h,h.h-=f.h):(o.push({x:h.x+f.w,y:h.y,w:h.w-f.w,h:f.h}),h.y+=f.h,h.h-=f.h);break}}return{w:s,h:l,fill:t/(s*l)||0}}Qs.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),a=n>>3,i=this.pos;this.type=7&n,e(a,t,this),this.pos===i&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=hl(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=ml(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=hl(this.buf,this.pos)+4294967296*hl(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=hl(this.buf,this.pos)+4294967296*ml(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=Zs(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Zs(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,a,i=r.buf;if(n=(112&(a=i[r.pos++]))>>4,a<128)return rl(e,n,t);if(n|=(127&(a=i[r.pos++]))<<3,a<128)return rl(e,n,t);if(n|=(127&(a=i[r.pos++]))<<10,a<128)return rl(e,n,t);if(n|=(127&(a=i[r.pos++]))<<17,a<128)return rl(e,n,t);if(n|=(127&(a=i[r.pos++]))<<24,a<128)return rl(e,n,t);if(n|=(1&(a=i[r.pos++]))<<31,a<128)return rl(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&el?function(e,t,r){return el.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){for(var n="",a=t;a<r;){var i,o,s,l=e[a],c=null,u=l>239?4:l>223?3:l>191?2:1;if(a+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(i=e[a+1]))&&(c=(31&l)<<6|63&i)<=127&&(c=null):3===u?(i=e[a+1],o=e[a+2],128==(192&i)&&128==(192&o)&&((c=(15&l)<<12|(63&i)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(i=e[a+1],o=e[a+2],s=e[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&i)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),a+=u}return n}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Qs.Bytes)return e.push(this.readVarint(t));var r=tl(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Qs.Bytes)return e.push(this.readSVarint());var t=tl(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Qs.Bytes)return e.push(this.readBoolean());var t=tl(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Qs.Bytes)return e.push(this.readFloat());var t=tl(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Qs.Bytes)return e.push(this.readDouble());var t=tl(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Qs.Bytes)return e.push(this.readFixed32());var t=tl(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Qs.Bytes)return e.push(this.readSFixed32());var t=tl(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Qs.Bytes)return e.push(this.readFixed64());var t=tl(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Qs.Bytes)return e.push(this.readSFixed64());var t=tl(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===Qs.Varint)for(;this.buf[this.pos++]>127;);else if(t===Qs.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Qs.Fixed32)this.pos+=4;else{if(t!==Qs.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),dl(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),dl(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),dl(this.buf,-1&e,this.pos),dl(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),dl(this.buf,-1&e,this.pos),dl(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,a,i=0;i<t.length;i++){if((n=t.charCodeAt(i))>55295&&n<57344){if(!a){n>56319||i+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):a=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else a&&(e[r++]=239,e[r++]=191,e[r++]=189,a=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&nl(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Ks(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Ks(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&nl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,Qs.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,al,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,il,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,ll,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,ol,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,sl,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,cl,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,ul,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,fl,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,pl,t)},writeBytesField:function(e,t){this.writeTag(e,Qs.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Qs.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Qs.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Qs.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Qs.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Qs.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Qs.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Qs.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Qs.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Qs.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var xl=function(e,t){var r=t.pixelRatio,n=t.version,a=t.stretchX,i=t.stretchY,o=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=a,this.stretchY=i,this.content=o,this.version=n},_l={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};_l.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},_l.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},_l.tlbr.get=function(){return this.tl.concat(this.br)},_l.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(xl.prototype,_l);var wl=function(e,t){var r={},n={};this.haveRenderCallbacks=[];var a=[];this.addImages(e,r,a),this.addImages(t,n,a);var i=bl(a),o=i.w,s=i.h,l=new _o({width:o||1,height:s||1});for(var c in e){var u=e[c],f=r[c].paddedRect;_o.copy(u.data,l,{x:0,y:0},{x:f.x+1,y:f.y+1},u.data)}for(var p in t){var h=t[p],d=n[p].paddedRect,m=d.x+1,g=d.y+1,y=h.data.width,v=h.data.height;_o.copy(h.data,l,{x:0,y:0},{x:m,y:g},h.data),_o.copy(h.data,l,{x:0,y:v-1},{x:m,y:g-1},{width:y,height:1}),_o.copy(h.data,l,{x:0,y:0},{x:m,y:g+v},{width:y,height:1}),_o.copy(h.data,l,{x:y-1,y:0},{x:m-1,y:g},{width:1,height:v}),_o.copy(h.data,l,{x:0,y:0},{x:m+y,y:g},{width:1,height:v})}this.image=l,this.iconPositions=r,this.patternPositions=n};wl.prototype.addImages=function(e,t,r){for(var n in e){var a=e[n],i={x:0,y:0,w:a.data.width+2,h:a.data.height+2};r.push(i),t[n]=new xl(i,a),a.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},wl.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},wl.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var n=e.tl,a=n[0],i=n[1];r.update(t.data,void 0,{x:a,y:i})}},Fn("ImagePosition",xl),Fn("ImageAtlas",wl);var kl={horizontal:1,vertical:2,horizontalOnly:3},Dl=function(){this.scale=1,this.fontStack="",this.imageName=null};Dl.forText=function(e,t){var r=new Dl;return r.scale=e||1,r.fontStack=t,r},Dl.forImage=function(e){var t=new Dl;return t.imageName=e,t};var Tl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Al(e,t,r,n,a,i,o,s,l,c,u,f,p,h,d,m){var g,y=Tl.fromFeature(e,a);f===kl.vertical&&y.verticalizePunctuation();var v=ca.processBidirectionalText,b=ca.processStyledBidirectionalText;if(v&&1===y.sections.length){g=[];for(var x=0,_=v(y.toString(),Il(y,c,i,t,n,h,d));x<_.length;x+=1){var w=_[x],k=new Tl;k.text=w,k.sections=y.sections;for(var D=0;D<w.length;D++)k.sectionIndex.push(0);g.push(k)}}else if(b){g=[];for(var T=0,A=b(y.text,y.sectionIndex,Il(y,c,i,t,n,h,d));T<A.length;T+=1){var S=A[T],M=new Tl;M.text=S[0],M.sectionIndex=S[1],M.sections=y.sections,g.push(M)}}else g=function(e,t){for(var r=[],n=e.text,a=0,i=0,o=t;i<o.length;i+=1){var s=o[i];r.push(e.substring(a,s)),a=s}return a<n.length&&r.push(e.substring(a,n.length)),r}(y,Il(y,c,i,t,n,h,d));var E=[],C={positionedLines:E,text:y.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:f,iconsInText:!1,verticalizable:!1};return function(e,t,r,n,a,i,o,s,l,c,u,f){for(var p=0,h=-17,d=0,m=0,g="right"===s?1:"left"===s?0:.5,y=0,v=0,b=a;v<b.length;v+=1){var x=b[v];x.trim();var _=x.getMaxScale(),w=24*(_-1),k={positionedGlyphs:[],lineOffset:0};e.positionedLines[y]=k;var D=k.positionedGlyphs,T=0;if(x.length()){for(var A=0;A<x.length();A++){var S=x.getSection(A),M=x.getSectionIndex(A),E=x.getCharCode(A),C=0,N=null,O=null,I=null,P=24,R=!(l===kl.horizontal||!u&&!Gn(E)||u&&(Sl[E]||(W=E,qn.Arabic(W)||qn["Arabic Supplement"](W)||qn["Arabic Extended-A"](W)||qn["Arabic Presentation Forms-A"](W)||qn["Arabic Presentation Forms-B"](W))));if(S.imageName){var L=n[S.imageName];if(!L)continue;I=S.imageName,e.iconsInText=e.iconsInText||!0,O=L.paddedRect;var F=L.displaySize;S.scale=24*S.scale/f,N={width:F[0],height:F[1],left:1,top:-3,advance:R?F[1]:F[0]},C=w+(24-F[1]*S.scale),P=N.advance;var B=R?F[0]*S.scale-24*_:F[1]*S.scale-24*_;B>0&&B>T&&(T=B)}else{var z=r[S.fontStack],j=z&&z[E];if(j&&j.rect)O=j.rect,N=j.metrics;else{var U=t[S.fontStack],$=U&&U[E];if(!$)continue;N=$.metrics}C=24*(_-S.scale)}R?(e.verticalizable=!0,D.push({glyph:E,imageName:I,x:p,y:h+C,vertical:R,scale:S.scale,fontStack:S.fontStack,sectionIndex:M,metrics:N,rect:O}),p+=P*S.scale+c):(D.push({glyph:E,imageName:I,x:p,y:h+C,vertical:R,scale:S.scale,fontStack:S.fontStack,sectionIndex:M,metrics:N,rect:O}),p+=N.advance*S.scale+c)}if(0!==D.length){var V=p-c;d=Math.max(V,d),Rl(D,0,D.length-1,g,T)}p=0;var q=i*_+T;k.lineOffset=Math.max(T,w),h+=q,m=Math.max(q,m),++y}else h+=i,++y}var W,H=h- -17,G=Pl(o),X=G.horizontalAlign,Y=G.verticalAlign;(function(e,t,r,n,a,i,o,s,l){var c,u=(t-r)*a;c=i!==o?-s*n- -17:(-n*l+.5)*o;for(var f=0,p=e;f<p.length;f+=1)for(var h=0,d=p[f].positionedGlyphs;h<d.length;h+=1){var m=d[h];m.x+=u,m.y+=c}})(e.positionedLines,g,X,Y,d,m,i,H,a.length),e.top+=-Y*H,e.bottom=e.top+H,e.left+=-X*d,e.right=e.left+d}(C,t,r,n,g,o,s,l,f,c,p,m),!function(e){for(var t=0,r=e;t<r.length;t+=1)if(0!==r[t].positionedGlyphs.length)return!1;return!0}(E)&&C}Tl.fromFeature=function(e,t){for(var r=new Tl,n=0;n<e.sections.length;n++){var a=e.sections[n];a.image?r.addImageSection(a):r.addTextSection(a,t)}return r},Tl.prototype.length=function(){return this.text.length},Tl.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},Tl.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},Tl.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},Tl.prototype.verticalizePunctuation=function(){this.text=function(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r+1)||null,a=e.charCodeAt(r-1)||null;n&&Xn(n)&&!Ys[e[r+1]]||a&&Xn(a)&&!Ys[e[r-1]]||!Ys[e[r]]?t+=e[r]:t+=Ys[e[r]]}return t}(this.text)},Tl.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&Sl[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=e&&Sl[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Tl.prototype.substring=function(e,t){var r=new Tl;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Tl.prototype.toString=function(){return this.text},Tl.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},Tl.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(Dl.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,n=0;n<e.text.length;++n)this.sectionIndex.push(r)},Tl.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(0!==t.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Dl.forImage(t)),this.sectionIndex.push(this.sections.length-1)):_("Reached maximum number of images 6401")}else _("Can't add FormattedSection with an empty image.")},Tl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Sl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ml={};function El(e,t,r,n,a,i){if(t.imageName){var o=n[t.imageName];return o?o.displaySize[0]*t.scale*24/i+a:0}var s=r[t.fontStack],l=s&&s[e];return l?l.metrics.advance*t.scale+a:0}function Cl(e,t,r,n){var a=Math.pow(e-t,2);return n?e<t?a/2:2*a:a+Math.abs(r)*r}function Nl(e,t,r){var n=0;return 10===e&&(n-=1e4),r&&(n+=150),40!==e&&65288!==e||(n+=50),41!==t&&65289!==t||(n+=50),n}function Ol(e,t,r,n,a,i){for(var o=null,s=Cl(t,r,a,i),l=0,c=n;l<c.length;l+=1){var u=c[l],f=Cl(t-u.x,r,a,i)+u.badness;f<=s&&(o=u,s=f)}return{index:e,x:t,priorBreak:o,badness:s}}function Il(e,t,r,n,a,i,o){if("point"!==i)return[];if(!e)return[];for(var s,l=[],c=function(e,t,r,n,a,i){for(var o=0,s=0;s<e.length();s++){var l=e.getSection(s);o+=El(e.getCharCode(s),l,n,a,t,i)}return o/Math.max(1,Math.ceil(o/r))}(e,t,r,n,a,o),u=e.text.indexOf("​")>=0,f=0,p=0;p<e.length();p++){var h=e.getSection(p),d=e.getCharCode(p);if(Sl[d]||(f+=El(d,h,n,a,t,o)),p<e.length()-1){var m=!((s=d)<11904||!(qn["Bopomofo Extended"](s)||qn.Bopomofo(s)||qn["CJK Compatibility Forms"](s)||qn["CJK Compatibility Ideographs"](s)||qn["CJK Compatibility"](s)||qn["CJK Radicals Supplement"](s)||qn["CJK Strokes"](s)||qn["CJK Symbols and Punctuation"](s)||qn["CJK Unified Ideographs Extension A"](s)||qn["CJK Unified Ideographs"](s)||qn["Enclosed CJK Letters and Months"](s)||qn["Halfwidth and Fullwidth Forms"](s)||qn.Hiragana(s)||qn["Ideographic Description Characters"](s)||qn["Kangxi Radicals"](s)||qn["Katakana Phonetic Extensions"](s)||qn.Katakana(s)||qn["Vertical Forms"](s)||qn["Yi Radicals"](s)||qn["Yi Syllables"](s)));(Ml[d]||m||h.imageName)&&l.push(Ol(p+1,f,c,l,Nl(d,e.getCharCode(p+1),m&&u),!1))}}return function e(t){return t?e(t.priorBreak).concat(t.index):[]}(Ol(e.length(),f,c,l,0,!0))}function Pl(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Rl(e,t,r,n,a){if(n||a)for(var i=e[r],o=i.metrics.advance*i.scale,s=(e[r].x+o)*n,l=t;l<=r;l++)e[l].x-=s,e[l].y+=a}function Ll(e,t,r,n,a,i){var o,s=e.image;if(s.content){var l=s.content,c=s.pixelRatio||1;o=[l[0]/c,l[1]/c,s.displaySize[0]-l[2]/c,s.displaySize[1]-l[3]/c]}var u,f,p,h,d=t.left*i,m=t.right*i;"width"===r||"both"===r?(h=a[0]+d-n[3],f=a[0]+m+n[1]):f=(h=a[0]+(d+m-s.displaySize[0])/2)+s.displaySize[0];var g=t.top*i,y=t.bottom*i;return"height"===r||"both"===r?(u=a[1]+g-n[0],p=a[1]+y+n[2]):p=(u=a[1]+(g+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:u,right:f,bottom:p,left:h,collisionPadding:o}}Ml[10]=!0,Ml[32]=!0,Ml[38]=!0,Ml[40]=!0,Ml[41]=!0,Ml[43]=!0,Ml[45]=!0,Ml[47]=!0,Ml[173]=!0,Ml[183]=!0,Ml[8203]=!0,Ml[8208]=!0,Ml[8211]=!0,Ml[8231]=!0;var Fl=function(e){function t(t,r,n,a){e.call(this,t,r),this.angle=n,void 0!==a&&(this.segment=a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t}(a);function Bl(e,t){var r=t.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new ua(e+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,a=r.interpolationType,i=0;i<n.length&&n[i]<=e;)i++;for(var o=i=Math.max(0,i-1);o<n.length&&n[o]<e+1;)o++;o=Math.min(n.length-1,o);var s=n[i],l=n[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:a}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new ua(s)),maxSize:r.evaluate(new ua(l)),interpolationType:a}}function zl(e,t,r){var n=t.uSize,a=t.uSizeT,i=r.lowerSize,o=r.upperSize;return"source"===e.kind?i/128:"composite"===e.kind?$t(i/128,o/128,a):n}function jl(e,t){var r=0,n=0;if("constant"===e.kind)n=e.layoutSize;else if("source"!==e.kind){var a=e.interpolationType,i=e.minZoom,o=e.maxZoom,s=a?l(ar.interpolationFactor(a,t,i,o),0,1):0;"camera"===e.kind?n=$t(e.minSize,e.maxSize,s):r=s}return{uSizeT:r,uSize:n}}Fn("Anchor",Fl);var Ul=Object.freeze({__proto__:null,getSizeData:Bl,evaluateSizeForFeature:zl,evaluateSizeForZoom:jl,SIZE_PACK_FACTOR:128});function $l(e,t,r,n,a){if(void 0===t.segment)return!0;for(var i=t,o=t.segment+1,s=0;s>-r/2;){if(--o<0)return!1;s-=e[o].dist(i),i=e[o]}s+=e[o].dist(e[o+1]),o++;for(var l=[],c=0;s<r/2;){var u=e[o-1],f=e[o],p=e[o+1];if(!p)return!1;var h=u.angleTo(f)-f.angleTo(p);for(h=Math.abs((h+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:h}),c+=h;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>a)return!1;o++,s+=f.dist(p)}return!0}function Vl(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function ql(e,t,r){return e?.6*t*r:0}function Wl(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Hl(e,t,r,n,a,i){for(var o=ql(r,a,i),s=Wl(r,n)*i,l=0,c=Vl(e)/2,u=0;u<e.length-1;u++){var f=e[u],p=e[u+1],h=f.dist(p);if(l+h>c){var d=(c-l)/h,m=$t(f.x,p.x,d),g=$t(f.y,p.y,d),y=new Fl(m,g,p.angleTo(f),u);return y._round(),!o||$l(e,y,s,o,t)?y:void 0}l+=h}}function Gl(e,t,r,n,a,i,o,s,l){var c=ql(n,i,o),u=Wl(n,a),f=u*o,p=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-f<t/4&&(t=f+t/4),function e(t,r,n,a,i,o,s,l,c){for(var u=o/2,f=Vl(t),p=0,h=r-n,d=[],m=0;m<t.length-1;m++){for(var g=t[m],y=t[m+1],v=g.dist(y),b=y.angleTo(g);h+n<p+v;){var x=((h+=n)-p)/v,_=$t(g.x,y.x,x),w=$t(g.y,y.y,x);if(_>=0&&_<c&&w>=0&&w<c&&h-u>=0&&h+u<=f){var k=new Fl(_,w,b,m);k._round(),a&&!$l(t,k,o,a,i)||d.push(k)}}p+=v}return l||d.length||s||(d=e(t,p/2,n,a,i,o,s,!0,c)),d}(e,p?t/2*s%t:(u/2+2*i)*o*s%t,t,c,r,f,p,!1,l)}function Xl(e,t,r,n,i){for(var o=[],s=0;s<e.length;s++)for(var l=e[s],c=void 0,u=0;u<l.length-1;u++){var f=l[u],p=l[u+1];f.x<t&&p.x<t||(f.x<t?f=new a(t,f.y+(p.y-f.y)*((t-f.x)/(p.x-f.x)))._round():p.x<t&&(p=new a(t,f.y+(p.y-f.y)*((t-f.x)/(p.x-f.x)))._round()),f.y<r&&p.y<r||(f.y<r?f=new a(f.x+(p.x-f.x)*((r-f.y)/(p.y-f.y)),r)._round():p.y<r&&(p=new a(f.x+(p.x-f.x)*((r-f.y)/(p.y-f.y)),r)._round()),f.x>=n&&p.x>=n||(f.x>=n?f=new a(n,f.y+(p.y-f.y)*((n-f.x)/(p.x-f.x)))._round():p.x>=n&&(p=new a(n,f.y+(p.y-f.y)*((n-f.x)/(p.x-f.x)))._round()),f.y>=i&&p.y>=i||(f.y>=i?f=new a(f.x+(p.x-f.x)*((i-f.y)/(p.y-f.y)),i)._round():p.y>=i&&(p=new a(f.x+(p.x-f.x)*((i-f.y)/(p.y-f.y)),i)._round()),c&&f.equals(c[c.length-1])||(c=[f],o.push(c)),c.push(p)))))}return o}function Yl(e,t,r,n){var i=[],o=e.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=e.right-e.left,f=e.bottom-e.top,p=o.stretchX||[[0,l]],h=o.stretchY||[[0,c]],d=function(e,t){return e+t[1]-t[0]},m=p.reduce(d,0),g=h.reduce(d,0),y=l-m,v=c-g,b=0,x=m,_=0,w=g,k=0,D=y,T=0,A=v;if(o.content&&n){var S=o.content;b=Zl(p,0,S[0]),_=Zl(h,0,S[1]),x=Zl(p,S[0],S[2]),w=Zl(h,S[1],S[3]),k=S[0]-b,T=S[1]-_,D=S[2]-S[0]-x,A=S[3]-S[1]-w}var M=function(n,i,l,c){var p=Jl(n.stretch-b,x,u,e.left),h=Ql(n.fixed-k,D,n.stretch,m),d=Jl(i.stretch-_,w,f,e.top),y=Ql(i.fixed-T,A,i.stretch,g),v=Jl(l.stretch-b,x,u,e.left),S=Ql(l.fixed-k,D,l.stretch,m),M=Jl(c.stretch-_,w,f,e.top),E=Ql(c.fixed-T,A,c.stretch,g),C=new a(p,d),N=new a(v,d),O=new a(v,M),I=new a(p,M),P=new a(h/s,y/s),R=new a(S/s,E/s),L=t*Math.PI/180;if(L){var F=Math.sin(L),B=Math.cos(L),z=[B,-F,F,B];C._matMult(z),N._matMult(z),I._matMult(z),O._matMult(z)}var j=n.stretch+n.fixed,U=l.stretch+l.fixed,$=i.stretch+i.fixed,V=c.stretch+c.fixed;return{tl:C,tr:N,bl:I,br:O,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+$,w:U-j,h:V-$},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:P,pixelOffsetBR:R,minFontScaleX:D/s/u,minFontScaleY:A/s/f,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var E=Kl(p,y,m),C=Kl(h,v,g),N=0;N<E.length-1;N++)for(var O=E[N],I=E[N+1],P=0;P<C.length-1;P++){var R=C[P],L=C[P+1];i.push(M(O,R,I,L))}else i.push(M({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return i}function Zl(e,t,r){for(var n=0,a=0,i=e;a<i.length;a+=1){var o=i[a];n+=Math.max(t,Math.min(r,o[1]))-Math.max(t,Math.min(r,o[0]))}return n}function Kl(e,t,r){for(var n=[{fixed:-1,stretch:0}],a=0,i=e;a<i.length;a+=1){var o=i[a],s=o[0],l=o[1],c=n[n.length-1];n.push({fixed:s-c.stretch,stretch:c.stretch}),n.push({fixed:s-c.stretch,stretch:c.stretch+(l-s)})}return n.push({fixed:t+1,stretch:r}),n}function Jl(e,t,r,n){return e/t*r+n}function Ql(e,t,r,n){return e-t*r/n}var ec=function(e,t,r,n,i,o,s,l,c,u){if(this.boxStartIndex=e.length,c){var f=o.top,p=o.bottom,h=o.collisionPadding;h&&(f-=h[1],p+=h[3]);var d=p-f;d>0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,g=o.bottom*s+l,y=o.left*s-l,v=o.right*s+l,b=o.collisionPadding;if(b&&(y-=b[0]*s,m-=b[1]*s,v+=b[2]*s,g+=b[3]*s),u){var x=new a(y,m),_=new a(v,m),w=new a(y,g),k=new a(v,g),D=u*Math.PI/180;x._rotate(D),_._rotate(D),w._rotate(D),k._rotate(D),y=Math.min(x.x,_.x,w.x,k.x),v=Math.max(x.x,_.x,w.x,k.x),m=Math.min(x.y,_.y,w.y,k.y),g=Math.max(x.y,_.y,w.y,k.y)}e.emplaceBack(t.x,t.y,y,m,v,g,r,n,i)}this.boxEndIndex=e.length},tc=function(e,t){if(void 0===e&&(e=[]),void 0===t&&(t=rc),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function rc(e,t){return e<t?-1:e>t?1:0}function nc(e,t,r){void 0===t&&(t=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=e[0],c=0;c<l.length;c++){var u=l[c];(!c||u.x<n)&&(n=u.x),(!c||u.y<i)&&(i=u.y),(!c||u.x>o)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var f=o-n,p=s-i,h=Math.min(f,p),d=h/2,m=new tc([],ac);if(0===h)return new a(n,i);for(var g=n;g<o;g+=h)for(var y=i;y<s;y+=h)m.push(new ic(g+d,y+d,d,e));for(var v=function(e){for(var t=0,r=0,n=0,a=e[0],i=0,o=a.length,s=o-1;i<o;s=i++){var l=a[i],c=a[s],u=l.x*c.y-c.x*l.y;r+=(l.x+c.x)*u,n+=(l.y+c.y)*u,t+=3*u}return new ic(r/t,n/t,0,e)}(e),b=m.length;m.length;){var x=m.pop();(x.d>v.d||!v.d)&&(v=x,r&&console.log("found best %d after %d probes",Math.round(1e4*x.d)/1e4,b)),x.max-v.d<=t||(d=x.h/2,m.push(new ic(x.p.x-d,x.p.y-d,d,e)),m.push(new ic(x.p.x+d,x.p.y-d,d,e)),m.push(new ic(x.p.x-d,x.p.y+d,d,e)),m.push(new ic(x.p.x+d,x.p.y+d,d,e)),b+=4)}return r&&(console.log("num probes: "+b),console.log("best distance: "+v.d)),v.p}function ac(e,t){return t.max-e.max}function ic(e,t,r,n){this.p=new a(e,t),this.h=r,this.d=function(e,t){for(var r=!1,n=1/0,a=0;a<t.length;a++)for(var i=t[a],o=0,s=i.length,l=s-1;o<s;l=o++){var c=i[o],u=i[l];c.y>e.y!=u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,Ji(e,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}tc.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},tc.prototype.pop=function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},tc.prototype.peek=function(){return this.data[0]},tc.prototype._up=function(e){for(var t=this.data,r=this.compare,n=t[e];e>0;){var a=e-1>>1,i=t[a];if(r(n,i)>=0)break;t[e]=i,e=a}t[e]=n},tc.prototype._down=function(e){for(var t=this.data,r=this.compare,n=this.length>>1,a=t[e];e<n;){var i=1+(e<<1),o=t[i],s=i+1;if(s<this.length&&r(t[s],o)<0&&(i=s,o=t[s]),r(o,a)>=0)break;t[e]=o,e=i}t[e]=a};var oc=Number.POSITIVE_INFINITY;function sc(e,t){return t[1]!==oc?function(e,t,r){var n=0,a=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":a=r-7;break;case"bottom-right":case"bottom-left":case"bottom":a=7-r}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,a]}(e,t[0],t[1]):function(e,t){var r=0,n=0;t<0&&(t=0);var a=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":n=a-7;break;case"bottom-right":case"bottom-left":n=7-a;break;case"bottom":n=7-t;break;case"top":n=t-7}switch(e){case"top-right":case"bottom-right":r=-a;break;case"top-left":case"bottom-left":r=a;break;case"left":r=t;break;case"right":r=-t}return[r,n]}(e,t[0])}function lc(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function cc(e,t,r,n,i,o,s,l,c,u,f,p,h,d,m){var g=function(e,t,r,n,i,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],f=0,p=t.positionedLines;f<p.length;f+=1)for(var h=p[f],d=0,m=h.positionedGlyphs;d<m.length;d+=1){var g=m[d];if(g.rect){var y=g.rect||{},v=4,b=!0,x=1,_=0,w=(i||l)&&g.vertical,k=g.metrics.advance*g.scale/2;if(l&&t.verticalizable){var D=24*(g.scale-1),T=(24-g.metrics.width*g.scale)/2;_=h.lineOffset/2-(g.imageName?-T:D)}if(g.imageName){var A=s[g.imageName];b=A.sdf,v=1/(x=A.pixelRatio)}var S=i?[g.x+k,g.y]:[0,0],M=i?[0,0]:[g.x+k+r[0],g.y+r[1]-_],E=[0,0];w&&(E=M,M=[0,0]);var C=(g.metrics.left-v)*g.scale-k+M[0],N=(-g.metrics.top-v)*g.scale+M[1],O=C+y.w*g.scale/x,I=N+y.h*g.scale/x,P=new a(C,N),R=new a(O,N),L=new a(C,I),F=new a(O,I);if(w){var B=new a(-k,k- -17),z=-Math.PI/2,j=12-k,U=g.imageName?j:0,$=new a(22-j,-U),V=new(Function.prototype.bind.apply(a,[null].concat(E)));P._rotateAround(z,B)._add($)._add(V),R._rotateAround(z,B)._add($)._add(V),L._rotateAround(z,B)._add($)._add(V),F._rotateAround(z,B)._add($)._add(V)}if(c){var q=Math.sin(c),W=Math.cos(c),H=[W,-q,q,W];P._matMult(H),R._matMult(H),L._matMult(H),F._matMult(H)}var G=new a(0,0),X=new a(0,0);u.push({tl:P,tr:R,bl:L,br:F,tex:y,writingMode:t.writingMode,glyphOffset:S,sectionIndex:g.sectionIndex,isSDF:b,pixelOffsetTL:G,pixelOffsetBR:X,minFontScaleX:0,minFontScaleY:0})}}return u}(0,r,l,i,o,s,n,e.allowVerticalPlacement),y=e.textSizeData,v=null;"source"===y.kind?(v=[128*i.layout.get("text-size").evaluate(s,{})])[0]>32640&&_(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===y.kind&&((v=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||v[1]>32640)&&_(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,g,v,l,o,s,u,t,c.lineStartIndex,c.lineLength,h,m);for(var b=0,x=f;b<x.length;b+=1)p[x[b]]=e.text.placedSymbolArray.length-1;return 4*g.length}function uc(e){for(var t in e)return e[t];return null}function fc(e,t,r,n){var a=e.compareText;if(t in a){for(var i=a[t],o=i.length-1;o>=0;o--)if(n.dist(i[o])<r)return!0}else a[t]=[];return a[t].push(n),!1}var pc=ws.VectorTileFeature.types,hc=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function dc(e,t,r,n,a,i,o,s,l,c,u,f,p){var h=s?Math.min(32640,Math.round(s[0])):0,d=s?Math.min(32640,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(32*n),Math.round(32*a),i,o,(h<<1)+(l?1:0),d,16*c,16*u,256*f,256*p)}function mc(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function gc(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(Kn(r[t].text))return!0;return!1}var yc=function(e){this.layoutVertexArray=new La,this.indexArray=new Va,this.programConfigurations=e,this.segments=new ui,this.dynamicLayoutVertexArray=new Fa,this.opacityVertexArray=new Ba,this.placedSymbolArray=new ri};yc.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},yc.prototype.upload=function(e,t,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Vs.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,qs.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,hc,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(e))},yc.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Fn("SymbolBuffers",yc);var vc=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new ui,this.collisionVertexArray=new $a};vc.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Ws.members,!0)},vc.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Fn("CollisionBuffers",vc);var bc=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=lo([]),this.placementViewportMatrix=lo([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Bl(this.zoom,t["text-size"]),this.iconSizeData=Bl(this.zoom,t["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),a=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==a&&void 0!==n.constantOr(1);var i="viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey;this.sortFeaturesByY=i&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(e){return kl[e]}))),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id})),this.sourceID=e.sourceID};bc.prototype.createArrays=function(){this.text=new yc(new Bi(Vs.members,this.layers,this.zoom,(function(e){return/^text/.test(e)}))),this.icon=new yc(new Bi(Vs.members,this.layers,this.zoom,(function(e){return/^icon/.test(e)}))),this.glyphOffsetArray=new ii,this.lineVertexArray=new oi,this.symbolInstances=new ai},bc.prototype.calculateGlyphDependencies=function(e,t,r,n,a){for(var i=0;i<e.length;i++)if(t[e.charCodeAt(i)]=!0,(r||n)&&a){var o=Ys[e.charAt(i)];o&&(t[o.charCodeAt(0)]=!0)}},bc.prototype.populate=function(e,t,r){var n=this.layers[0],a=n.layout,i=a.get("text-font"),o=a.get("text-field"),s=a.get("icon-image"),l=("constant"!==o.value.kind||o.value.value instanceof tt&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==i.value.kind||i.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=a.get("symbol-sort-key");if(this.features=[],l||c){for(var f=t.iconDependencies,p=t.glyphDependencies,h=t.availableImages,d=new ua(this.zoom),m=0,g=e;m<g.length;m+=1){var y=g[m],v=y.feature,b=y.id,x=y.index,_=y.sourceLayerIndex,w=n._featureFilter.needGeometry,k={type:v.type,id:b,properties:v.properties,geometry:w?$i(v):[]};if(n._featureFilter.filter(d,k,r)){w||(k.geometry=$i(v));var D=void 0;if(l){var T=n.getValueAndResolveTokens("text-field",k,r,h),A=tt.factory(T);gc(A)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===sa()||this.hasRTLText&&ca.isParsed())&&(D=Xs(A,n,k))}var S=void 0;if(c){var M=n.getValueAndResolveTokens("icon-image",k,r,h);S=M instanceof rt?M:rt.fromString(M)}if(D||S){var E=this.sortFeaturesByKey?u.evaluate(k,{},r):void 0,C={id:b,text:D,icon:S,index:x,sourceLayerIndex:_,geometry:$i(v),properties:v.properties,type:pc[v.type],sortKey:E};if(this.features.push(C),S&&(f[S.name]=!0),D){var N=i.evaluate(k,{},r).join(","),O="map"===a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(kl.vertical)>=0;for(var I=0,P=D.sections;I<P.length;I+=1){var R=P[I];if(R.image)f[R.image.name]=!0;else{var L=Wn(D.toString()),F=R.fontStack||N,B=p[F]=p[F]||{};this.calculateGlyphDependencies(R.text,B,O,this.allowVerticalPlacement,L)}}}}}}"line"===a.get("symbol-placement")&&(this.features=function(e){var t={},r={},n=[],a=0;function i(t){n.push(e[t]),a++}function o(e,t,a){var i=r[e];return delete r[e],r[t]=i,n[i].geometry[0].pop(),n[i].geometry[0]=n[i].geometry[0].concat(a[0]),i}function s(e,r,a){var i=t[r];return delete t[r],t[e]=i,n[i].geometry[0].shift(),n[i].geometry[0]=a[0].concat(n[i].geometry[0]),i}function l(e,t,r){var n=r?t[0][t[0].length-1]:t[0][0];return e+":"+n.x+":"+n.y}for(var c=0;c<e.length;c++){var u=e[c],f=u.geometry,p=u.text?u.text.toString():null;if(p){var h=l(p,f),d=l(p,f,!0);if(h in r&&d in t&&r[h]!==t[d]){var m=s(h,d,f),g=o(h,d,n[m].geometry);delete t[h],delete r[d],r[l(p,n[g].geometry,!0)]=g,n[m].geometry=null}else h in r?o(h,d,f):d in t?s(h,d,f):(i(c),t[h]=a-1,r[d]=a-1)}else i(c)}return n.filter((function(e){return e.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(e,t){return e.sortKey-t.sortKey}))}},bc.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},bc.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},bc.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},bc.prototype.upload=function(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},bc.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},bc.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},bc.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(void 0!==e.segment){for(var n=e.dist(t[e.segment+1]),a=e.dist(t[e.segment]),i={},o=e.segment+1;o<t.length;o++)i[o]={x:t[o].x,y:t[o].y,tileUnitDistanceFromAnchor:n},o<t.length-1&&(n+=t[o+1].dist(t[o]));for(var s=e.segment||0;s>=0;s--)i[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:a},s>0&&(a+=t[s-1].dist(t[s]));for(var l=0;l<t.length;l++){var c=i[l];this.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},bc.prototype.addSymbols=function(e,t,r,n,a,i,o,s,l,c,u,f){for(var p=e.indexArray,h=e.layoutVertexArray,d=e.segments.prepareSegment(4*t.length,h,p,i.sortKey),m=this.glyphOffsetArray.length,g=d.vertexLength,y=this.allowVerticalPlacement&&o===kl.vertical?Math.PI/2:0,v=i.text&&i.text.sections,b=0;b<t.length;b++){var x=t[b],_=x.tl,w=x.tr,k=x.bl,D=x.br,T=x.tex,A=x.pixelOffsetTL,S=x.pixelOffsetBR,M=x.minFontScaleX,E=x.minFontScaleY,C=x.glyphOffset,N=x.isSDF,O=x.sectionIndex,I=d.vertexLength,P=C[1];dc(h,s.x,s.y,_.x,P+_.y,T.x,T.y,r,N,A.x,A.y,M,E),dc(h,s.x,s.y,w.x,P+w.y,T.x+T.w,T.y,r,N,S.x,A.y,M,E),dc(h,s.x,s.y,k.x,P+k.y,T.x,T.y+T.h,r,N,A.x,S.y,M,E),dc(h,s.x,s.y,D.x,P+D.y,T.x+T.w,T.y+T.h,r,N,S.x,S.y,M,E),mc(e.dynamicLayoutVertexArray,s,y),p.emplaceBack(I,I+1,I+2),p.emplaceBack(I+1,I+2,I+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),b!==t.length-1&&O===t[b+1].sectionIndex||e.programConfigurations.populatePaintArrays(h.length,i,i.index,{},f,v&&v[O])}e.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,g,l,c,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0,u)},bc.prototype._addCollisionDebugVertex=function(e,t,r,n,a,i){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,n,a,Math.round(i.x),Math.round(i.y))},bc.prototype.addCollisionDebugVertices=function(e,t,r,n,i,o,s){var l=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),c=l.vertexLength,u=i.layoutVertexArray,f=i.collisionVertexArray,p=s.anchorX,h=s.anchorY;this._addCollisionDebugVertex(u,f,o,p,h,new a(e,t)),this._addCollisionDebugVertex(u,f,o,p,h,new a(r,t)),this._addCollisionDebugVertex(u,f,o,p,h,new a(r,n)),this._addCollisionDebugVertex(u,f,o,p,h,new a(e,n)),l.vertexLength+=4;var d=i.indexArray;d.emplaceBack(c,c+1),d.emplaceBack(c+1,c+2),d.emplaceBack(c+2,c+3),d.emplaceBack(c+3,c),l.primitiveLength+=4},bc.prototype.addDebugCollisionBoxes=function(e,t,r,n){for(var a=e;a<t;a++){var i=this.collisionBoxArray.get(a),o=i.x1,s=i.y1,l=i.x2,c=i.y2;this.addCollisionDebugVertices(o,s,l,c,n?this.textCollisionBox:this.iconCollisionBox,i.anchorPoint,r)}},bc.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new vc(ja,Hs.members,Ya),this.iconCollisionBox=new vc(ja,Hs.members,Ya);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},bc.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,n,a,i,o,s,l){for(var c={},u=t;u<r;u++){var f=e.get(u);c.textBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.textFeatureIndex=f.featureIndex;break}for(var p=n;p<a;p++){var h=e.get(p);c.verticalTextBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},c.verticalTextFeatureIndex=h.featureIndex;break}for(var d=i;d<o;d++){var m=e.get(d);c.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},c.iconFeatureIndex=m.featureIndex;break}for(var g=s;g<l;g++){var y=e.get(g);c.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},c.verticalIconFeatureIndex=y.featureIndex;break}return c},bc.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},bc.prototype.hasTextData=function(){return this.text.segments.get().length>0},bc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},bc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},bc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},bc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},bc.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs,a=r.vertexStartIndex;a<n;a+=4)e.indexArray.emplaceBack(a,a+1,a+2),e.indexArray.emplaceBack(a+1,a+2,a+3)},bc.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),n=[],a=[],i=[],o=0;o<this.symbolInstances.length;++o){i.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(t*s.anchorX+r*s.anchorY)),a.push(s.featureIndex)}return i.sort((function(e,t){return n[e]-n[t]||a[t]-a[e]})),i},bc.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},bc.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var a=n[r],i=this.symbolInstances.get(a);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(e,r,n){e>=0&&n.indexOf(e)===r&&t.addIndicesForPlacedSymbol(t.text,e)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Fn("SymbolBucket",bc,{omit:["layers","collisionBoxArray","features","compareText"]}),bc.MAX_GLYPHS=65535,bc.addDynamicAttributes=mc;var xc=new Da({"symbol-placement":new ba(Se.layout_symbol["symbol-placement"]),"symbol-spacing":new ba(Se.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ba(Se.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new xa(Se.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ba(Se.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ba(Se.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ba(Se.layout_symbol["icon-ignore-placement"]),"icon-optional":new ba(Se.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ba(Se.layout_symbol["icon-rotation-alignment"]),"icon-size":new xa(Se.layout_symbol["icon-size"]),"icon-text-fit":new ba(Se.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ba(Se.layout_symbol["icon-text-fit-padding"]),"icon-image":new xa(Se.layout_symbol["icon-image"]),"icon-rotate":new xa(Se.layout_symbol["icon-rotate"]),"icon-padding":new ba(Se.layout_symbol["icon-padding"]),"icon-keep-upright":new ba(Se.layout_symbol["icon-keep-upright"]),"icon-offset":new xa(Se.layout_symbol["icon-offset"]),"icon-anchor":new xa(Se.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ba(Se.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ba(Se.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ba(Se.layout_symbol["text-rotation-alignment"]),"text-field":new xa(Se.layout_symbol["text-field"]),"text-font":new xa(Se.layout_symbol["text-font"]),"text-size":new xa(Se.layout_symbol["text-size"]),"text-max-width":new xa(Se.layout_symbol["text-max-width"]),"text-line-height":new ba(Se.layout_symbol["text-line-height"]),"text-letter-spacing":new xa(Se.layout_symbol["text-letter-spacing"]),"text-justify":new xa(Se.layout_symbol["text-justify"]),"text-radial-offset":new xa(Se.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ba(Se.layout_symbol["text-variable-anchor"]),"text-anchor":new xa(Se.layout_symbol["text-anchor"]),"text-max-angle":new ba(Se.layout_symbol["text-max-angle"]),"text-writing-mode":new ba(Se.layout_symbol["text-writing-mode"]),"text-rotate":new xa(Se.layout_symbol["text-rotate"]),"text-padding":new ba(Se.layout_symbol["text-padding"]),"text-keep-upright":new ba(Se.layout_symbol["text-keep-upright"]),"text-transform":new xa(Se.layout_symbol["text-transform"]),"text-offset":new xa(Se.layout_symbol["text-offset"]),"text-allow-overlap":new ba(Se.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ba(Se.layout_symbol["text-ignore-placement"]),"text-optional":new ba(Se.layout_symbol["text-optional"])}),_c={paint:new Da({"icon-opacity":new xa(Se.paint_symbol["icon-opacity"]),"icon-color":new xa(Se.paint_symbol["icon-color"]),"icon-halo-color":new xa(Se.paint_symbol["icon-halo-color"]),"icon-halo-width":new xa(Se.paint_symbol["icon-halo-width"]),"icon-halo-blur":new xa(Se.paint_symbol["icon-halo-blur"]),"icon-translate":new ba(Se.paint_symbol["icon-translate"]),"icon-translate-anchor":new ba(Se.paint_symbol["icon-translate-anchor"]),"text-opacity":new xa(Se.paint_symbol["text-opacity"]),"text-color":new xa(Se.paint_symbol["text-color"],{runtimeType:ze,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new xa(Se.paint_symbol["text-halo-color"]),"text-halo-width":new xa(Se.paint_symbol["text-halo-width"]),"text-halo-blur":new xa(Se.paint_symbol["text-halo-blur"]),"text-translate":new ba(Se.paint_symbol["text-translate"]),"text-translate-anchor":new ba(Se.paint_symbol["text-translate-anchor"])}),layout:xc},wc=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Re,this.defaultValue=e};wc.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},wc.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},wc.prototype.outputDefined=function(){return!1},wc.prototype.serialize=function(){return null},Fn("FormatSectionOverride",wc,{omit:["defaultValue"]});var kc=function(e){function t(t){e.call(this,t,_c)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){if(e.prototype.recalculate.call(this,t,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var a=[],i=0,o=n;i<o.length;i+=1){var s=o[i];a.indexOf(s)<0&&a.push(s)}this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(e,t,r,n){var a=this.layout.get(e).evaluate(t,{},r,n),i=this._unevaluatedLayout._values[e];return i.isDataDriven()||qr(i.value)||!a?a:function(e,t){return t.replace(/{([^{}]+)}/g,(function(t,r){return r in e?String(e[r]):""}))}(t.properties,a)},t.prototype.createBucket=function(e){return new bc(e)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var e=0,r=_c.paint.overridableProperties;e<r.length;e+=1){var n=r[e];if(t.hasPaintOverride(this.layout,n)){var a,i=this.paint.get(n),o=new wc(i),s=new Vr(o,i.property.specification);a="constant"===i.value.kind||"source"===i.value.kind?new Hr("source",s):new Gr("composite",s,i.value.zoomStops,i.value._interpolationType),this.paint._values[n]=new ya(i.property,a,i.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(e,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&t.hasPaintOverride(this.layout,e)},t.hasPaintOverride=function(e,t){var r=e.get("text-field"),n=_c.paint.properties[t],a=!1,i=function(e){for(var t=0,r=e;t<r.length;t+=1){var i=r[t];if(n.overrides&&n.overrides.hasOverride(i))return void(a=!0)}};if("constant"===r.value.kind&&r.value.value instanceof tt)i(r.value.value.sections);else if("source"===r.value.kind){var o=function(e){if(!a)if(e instanceof st&&it(e.value)===Ve){var t=e.value;i(t.sections)}else e instanceof ft?i(e.sections):e.eachChild(o)},s=r.value;s._styleExpression&&o(s._styleExpression.expression)}return a},t}(Ta),Dc={paint:new Da({"background-color":new ba(Se.paint_background["background-color"]),"background-pattern":new wa(Se.paint_background["background-pattern"]),"background-opacity":new ba(Se.paint_background["background-opacity"])})},Tc=function(e){function t(t){e.call(this,t,Dc)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Ta),Ac={paint:new Da({"raster-opacity":new ba(Se.paint_raster["raster-opacity"]),"raster-hue-rotate":new ba(Se.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ba(Se.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ba(Se.paint_raster["raster-brightness-max"]),"raster-saturation":new ba(Se.paint_raster["raster-saturation"]),"raster-contrast":new ba(Se.paint_raster["raster-contrast"]),"raster-resampling":new ba(Se.paint_raster["raster-resampling"]),"raster-fade-duration":new ba(Se.paint_raster["raster-fade-duration"])})},Sc=function(e){function t(t){e.call(this,t,Ac)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Ta),Mc=function(e){function t(t){e.call(this,t,{}),this.implementation=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},t.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},t.prototype.onRemove=function(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},t}(Ta),Ec={circle:ho,heatmap:Do,hillshade:Ao,fill:ps,"fill-extrusion":Cs,line:Us,symbol:kc,background:Tc,raster:Sc},Cc=self.HTMLImageElement,Nc=self.HTMLCanvasElement,Oc=self.HTMLVideoElement,Ic=self.ImageData,Pc=self.ImageBitmap,Rc=function(e,t,r,n){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,n)};Rc.prototype.update=function(e,t,r){var n=e.width,a=e.height,i=!(this.size&&this.size[0]===n&&this.size[1]===a||r),o=this.context,s=o.gl;if(this.useMipmap=Boolean(t&&t.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!t||!1!==t.premultiply)),i)this.size=[n,a],e instanceof Cc||e instanceof Nc||e instanceof Oc||e instanceof Ic||Pc&&e instanceof Pc?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,e):s.texImage2D(s.TEXTURE_2D,0,this.format,n,a,0,this.format,s.UNSIGNED_BYTE,e.data);else{var l=r||{x:0,y:0},c=l.x,u=l.y;e instanceof Cc||e instanceof Nc||e instanceof Oc||e instanceof Ic||Pc&&e instanceof Pc?s.texSubImage2D(s.TEXTURE_2D,0,c,u,s.RGBA,s.UNSIGNED_BYTE,e):s.texSubImage2D(s.TEXTURE_2D,0,c,u,n,a,s.RGBA,s.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Rc.prototype.bind=function(e,t,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),e!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrap=t)},Rc.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Rc.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Lc=function(e){var t=this;this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};Lc.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){e._triggered=!1,e._callback()}),0))},Lc.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Fc=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},m(["receive","process"],this),this.invoker=new Lc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=D()?e:self};function Bc(e,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}Fc.prototype.send=function(e,t,r,n,a){var i=this;void 0===a&&(a=!1);var o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var s=S(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:e,hasCallback:!!r,targetMapId:n,mustQueue:a,sourceMapId:this.mapId,data:Un(t,s)},s),{cancel:function(){r&&delete i.callbacks[o],i.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:i.mapId})}}},Fc.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else D()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},Fc.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},Fc.prototype.processTask=function(e,t){var r=this;if("<response>"===t.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n($n(t.error)):n(null,$n(t.data)))}else{var a=!1,i=S(this.globalScope)?void 0:[],o=t.hasCallback?function(t,n){a=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:t?Un(t):null,data:Un(n,i)},i)}:function(e){a=!0},s=null,l=$n(t.data);if(this.parent[t.type])s=this.parent[t.type](t.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=t.type.split(".");s=this.parent.getWorkerSource(t.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+t.type));!a&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}},Fc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var zc=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};zc.prototype.setNorthEast=function(e){return this._ne=e instanceof jc?new jc(e.lng,e.lat):jc.convert(e),this},zc.prototype.setSouthWest=function(e){return this._sw=e instanceof jc?new jc(e.lng,e.lat):jc.convert(e),this},zc.prototype.extend=function(e){var t,r,n=this._sw,a=this._ne;if(e instanceof jc)t=e,r=e;else{if(!(e instanceof zc)){if(Array.isArray(e)){if(4===e.length||e.every(Array.isArray)){var i=e;return this.extend(zc.convert(i))}var o=e;return this.extend(jc.convert(o))}return this}if(t=e._sw,r=e._ne,!t||!r)return this}return n||a?(n.lng=Math.min(t.lng,n.lng),n.lat=Math.min(t.lat,n.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new jc(t.lng,t.lat),this._ne=new jc(r.lng,r.lat)),this},zc.prototype.getCenter=function(){return new jc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},zc.prototype.getSouthWest=function(){return this._sw},zc.prototype.getNorthEast=function(){return this._ne},zc.prototype.getNorthWest=function(){return new jc(this.getWest(),this.getNorth())},zc.prototype.getSouthEast=function(){return new jc(this.getEast(),this.getSouth())},zc.prototype.getWest=function(){return this._sw.lng},zc.prototype.getSouth=function(){return this._sw.lat},zc.prototype.getEast=function(){return this._ne.lng},zc.prototype.getNorth=function(){return this._ne.lat},zc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},zc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},zc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},zc.prototype.contains=function(e){var t=jc.convert(e),r=t.lng,n=t.lat,a=this._sw.lat<=n&&n<=this._ne.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),a&&i},zc.convert=function(e){return!e||e instanceof zc?e:new zc(e)};var jc=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};jc.prototype.wrap=function(){return new jc(c(this.lng,-180,180),this.lat)},jc.prototype.toArray=function(){return[this.lng,this.lat]},jc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},jc.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,n=e.lat*t,a=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return 6371008.8*Math.acos(Math.min(a,1))},jc.prototype.toBounds=function(e){void 0===e&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new zc(new jc(this.lng-r,this.lat-t),new jc(this.lng+r,this.lat+t))},jc.convert=function(e){if(e instanceof jc)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new jc(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new jc(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Uc=2*Math.PI*6371008.8;function $c(e){return Uc*Math.cos(e*Math.PI/180)}function Vc(e){return(180+e)/360}function qc(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Wc(e,t){return e/$c(t)}function Hc(e){var t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}var Gc=function(e,t,r){void 0===r&&(r=0),this.x=+e,this.y=+t,this.z=+r};Gc.fromLngLat=function(e,t){void 0===t&&(t=0);var r=jc.convert(e);return new Gc(Vc(r.lng),qc(r.lat),Wc(t,r.lat))},Gc.prototype.toLngLat=function(){return new jc(360*this.x-180,Hc(this.y))},Gc.prototype.toAltitude=function(){return this.z*$c(Hc(this.y))},Gc.prototype.meterInMercatorCoordinateUnits=function(){return 1/Uc*(e=Hc(this.y),1/Math.cos(e*Math.PI/180));var e};var Xc=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Kc(0,e,e,t,r)};Xc.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Xc.prototype.url=function(e,t){var r,n,a,i,o,s=(r=this.x,n=this.y,a=this.z,i=Bc(256*r,256*(n=Math.pow(2,a)-n-1),a),o=Bc(256*(r+1),256*(n+1),a),i[0]+","+i[1]+","+o[0]+","+o[1]),l=function(e,t,r){for(var n,a="",i=e;i>0;i--)a+=(t&(n=1<<i-1)?1:0)+(r&n?2:0);return a}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",l).replace("{bbox-epsg-3857}",s)},Xc.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new a(8192*(e.x*t-this.x),8192*(e.y*t-this.y))},Xc.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Yc=function(e,t){this.wrap=e,this.canonical=t,this.key=Kc(e,t.z,t.z,t.x,t.y)},Zc=function(e,t,r,n,a){this.overscaledZ=e,this.wrap=t,this.canonical=new Xc(r,+n,+a),this.key=Kc(t,e,r,n,a)};function Kc(e,t,r,n,a){(e*=2)<0&&(e=-1*e-1);var i=1<<r;return(i*i*e+i*a+n).toString(36)+r.toString(36)+t.toString(36)}Zc.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},Zc.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new Zc(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Zc(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},Zc.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Kc(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Kc(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},Zc.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},Zc.prototype.children=function(e){if(this.overscaledZ>=e)return[new Zc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Zc(t,this.wrap,t,r,n),new Zc(t,this.wrap,t,r+1,n),new Zc(t,this.wrap,t,r,n+1),new Zc(t,this.wrap,t,r+1,n+1)]},Zc.prototype.isLessThan=function(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))},Zc.prototype.wrapped=function(){return new Zc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Zc.prototype.unwrapTo=function(e){return new Zc(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},Zc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Zc.prototype.toUnwrapped=function(){return new Yc(this.wrap,this.canonical)},Zc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Zc.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Gc(e.x-this.wrap,e.y))},Fn("CanonicalTileID",Xc),Fn("OverscaledTileID",Zc,{omit:["posMatrix"]});var Jc=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return _('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var n=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var a=0;a<n;a++)this.data[this._idx(-1,a)]=this.data[this._idx(0,a)],this.data[this._idx(n,a)]=this.data[this._idx(n-1,a)],this.data[this._idx(a,-1)]=this.data[this._idx(a,0)],this.data[this._idx(a,n)]=this.data[this._idx(a,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)]};Jc.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),n=4*this._idx(e,t);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},Jc.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Jc.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Jc.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Jc.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Jc.prototype.getPixels=function(){return new _o({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Jc.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var n=t*this.dim,a=t*this.dim+this.dim,i=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:n=a-1;break;case 1:a=n+1}switch(r){case-1:i=o-1;break;case 1:o=i+1}for(var s=-t*this.dim,l=-r*this.dim,c=i;c<o;c++)for(var u=n;u<a;u++)this.data[this._idx(u,c)]=e.data[this._idx(u+s,c+l)]},Fn("DEMData",Jc);var Qc=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};Qc.prototype.encode=function(e){return this._stringToNumber[e]},Qc.prototype.decode=function(e){return this._numberToString[e]};var eu=function(e,t,r,n,a){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=n,this.properties=e.properties,this.id=a},tu={geometry:{configurable:!0}};tu.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},tu.geometry.set=function(e){this._geometry=e},eu.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e},Object.defineProperties(eu.prototype,tu);var ru=function(){this.state={},this.stateChanges={},this.deletedStates={}};ru.prototype.updateState=function(e,t,r){var n=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][n]=this.stateChanges[e][n]||{},u(this.stateChanges[e][n],r),null===this.deletedStates[e])for(var a in this.deletedStates[e]={},this.state[e])a!==n&&(this.deletedStates[e][a]=null);else if(this.deletedStates[e]&&null===this.deletedStates[e][n])for(var i in this.deletedStates[e][n]={},this.state[e][n])r[i]||(this.deletedStates[e][n][i]=null);else for(var o in r)this.deletedStates[e]&&this.deletedStates[e][n]&&null===this.deletedStates[e][n][o]&&delete this.deletedStates[e][n][o]},ru.prototype.removeFeatureState=function(e,t,r){if(null!==this.deletedStates[e]){var n=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==t)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||{},this.deletedStates[e][n][r]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][n])for(r in this.deletedStates[e][n]={},this.stateChanges[e][n])this.deletedStates[e][n][r]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}},ru.prototype.getState=function(e,t){var r=String(t),n=this.state[e]||{},a=this.stateChanges[e]||{},i=u({},n[r],a[r]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){var o=this.deletedStates[e][t];if(null===o)return{};for(var s in o)delete i[s]}return i},ru.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},ru.prototype.coalesceChanges=function(e,t){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var a={};for(var i in this.stateChanges[n])this.state[n][i]||(this.state[n][i]={}),u(this.state[n][i],this.stateChanges[n][i]),a[i]=this.state[n][i];r[n]=a}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var l in this.state[o])s[l]={},this.state[o][l]={};else for(var c in this.deletedStates[o]){if(null===this.deletedStates[o][c])this.state[o][c]={};else for(var f=0,p=Object.keys(this.deletedStates[o][c]);f<p.length;f+=1){var h=p[f];delete this.state[o][c][h]}s[c]=this.state[o][c]}r[o]=r[o]||{},u(r[o],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var d in e)e[d].setFeatureState(r,t)};var nu=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new On(8192,16,0),this.grid3D=new On(8192,16,0),this.featureIndexArray=new li,this.promoteId=t};function au(e,t,r,n,a){return y(e,(function(e,i){var o=t instanceof va?t.get(i):null;return o&&o.evaluate?o.evaluate(r,n,a):o}))}function iu(e){for(var t=1/0,r=1/0,n=-1/0,a=-1/0,i=0,o=e;i<o.length;i+=1){var s=o[i];t=Math.min(t,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),a=Math.max(a,s.y)}return{minX:t,minY:r,maxX:n,maxY:a}}function ou(e,t){return t-e}nu.prototype.insert=function(e,t,r,n,a,i){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,a);for(var s=i?this.grid3D:this.grid,l=0;l<t.length;l++){for(var c=t[l],u=[1/0,1/0,-1/0,-1/0],f=0;f<c.length;f++){var p=c[f];u[0]=Math.min(u[0],p.x),u[1]=Math.min(u[1],p.y),u[2]=Math.max(u[2],p.x),u[3]=Math.max(u[3],p.y)}u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},nu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ws.VectorTile(new Js(this.rawTileData)).layers,this.sourceLayerCoder=new Qc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},nu.prototype.query=function(e,t,r,n){var i=this;this.loadVTLayers();for(var o=e.params||{},s=8192/e.tileSize/e.scale,l=an(o.filter),c=e.queryGeometry,u=e.queryPadding*s,f=iu(c),p=this.grid.query(f.minX-u,f.minY-u,f.maxX+u,f.maxY+u),h=iu(e.cameraQueryGeometry),d=this.grid3D.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u,(function(t,r,n,i){return function(e,t,r,n,i){for(var o=0,s=e;o<s.length;o+=1){var l=s[o];if(t<=l.x&&r<=l.y&&n>=l.x&&i>=l.y)return!0}var c=[new a(t,r),new a(t,i),new a(n,i),new a(n,r)];if(e.length>2)for(var u=0,f=c;u<f.length;u+=1)if(eo(e,f[u]))return!0;for(var p=0;p<e.length-1;p++)if(to(e[p],e[p+1],c))return!0;return!1}(e.cameraQueryGeometry,t-u,r-u,n+u,i+u)})),m=0,g=d;m<g.length;m+=1){var y=g[m];p.push(y)}p.sort(ou);for(var v,b={},x=function(a){var u=p[a];if(u!==v){v=u;var f=i.featureIndexArray.get(u),h=null;i.loadMatchingFeature(b,f.bucketIndex,f.sourceLayerIndex,f.featureIndex,l,o.layers,o.availableImages,t,r,n,(function(t,r,n){return h||(h=$i(t)),r.queryIntersectsFeature(c,t,n,h,i.z,e.transform,s,e.pixelPosMatrix)}))}},_=0;_<p.length;_++)x(_);return b},nu.prototype.loadMatchingFeature=function(e,t,r,n,a,i,o,s,l,c,u){var f=this.bucketLayerIDs[t];if(!i||function(e,t){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}(i,f)){var p=this.sourceLayerCoder.decode(r),h=this.vtLayers[p].feature(n);if(a.filter(new ua(this.tileID.overscaledZ),h))for(var d=this.getId(h,p),m=0;m<f.length;m++){var g=f[m];if(!(i&&i.indexOf(g)<0)){var y=s[g];if(y){var v={};void 0!==d&&c&&(v=c.getState(y.sourceLayer||"_geojsonTileLayer",d));var b=l[g];b.paint=au(b.paint,y.paint,h,v,o),b.layout=au(b.layout,y.layout,h,v,o);var x=!u||u(h,y,v);if(x){var _=new eu(h,this.z,this.x,this.y,d);_.layer=b;var w=e[g];void 0===w&&(w=e[g]=[]),w.push({featureIndex:n,feature:_,intersectionZ:x})}}}}}},nu.prototype.lookupSymbolFeatures=function(e,t,r,n,a,i,o,s){var l={};this.loadVTLayers();for(var c=an(a),u=0,f=e;u<f.length;u+=1){var p=f[u];this.loadMatchingFeature(l,r,n,p,c,i,o,s,t)}return l},nu.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var n=0,a=r[t];n<a.length;n+=1)if(e===a[n])return!0;return!1},nu.prototype.getId=function(e,t){var r=e.id;if(this.promoteId){var n="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];"boolean"==typeof(r=e.properties[n])&&(r=Number(r))}return r},Fn("FeatureIndex",nu,{omit:["rawTileData","sourceLayerCoder"]});var su=function(e,t){this.tileID=e,this.uid=p(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};su.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<L.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},su.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},su.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var n in e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(e,t){var r={};if(!t)return r;for(var n=function(){var e=i[a],n=e.layerIds.map((function(e){return t.getLayer(e)})).filter(Boolean);if(0!==n.length){e.layers=n,e.stateDependentLayerIds&&(e.stateDependentLayers=e.stateDependentLayerIds.map((function(e){return n.filter((function(t){return t.id===e}))[0]})));for(var o=0,s=n;o<s.length;o+=1){var l=s[o];r[l.id]=e}}},a=0,i=e;a<i.length;a+=1)n();return r}(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var a=this.buckets[n];if(a instanceof bc){if(this.hasSymbolBuckets=!0,!r)break;a.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var i in this.buckets){var o=this.buckets[i];if(o instanceof bc&&o.hasRTLText){this.hasRTLText=!0,ca.isLoading()||ca.isLoaded()||"deferred"!==sa()||la();break}}for(var s in this.queryPadding=0,this.buckets){var l=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(s).queryRadius(l))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new ei},su.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},su.prototype.getBucket=function(e){return this.buckets[e.id]},su.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var n=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Rc(e,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Rc(e,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},su.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},su.prototype.queryRenderedFeatures=function(e,t,r,n,a,i,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:a,scale:i,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},e,t,r):{}},su.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var n=r.loadVTLayers(),a=t?t.sourceLayer:"",i=n._geojsonTileLayer||n[a];if(i)for(var o=an(t&&t.filter),s=this.tileID.canonical,l=s.z,c=s.x,u=s.y,f={z:l,x:c,y:u},p=0;p<i.length;p++){var h=i.feature(p);if(o.filter(new ua(this.tileID.overscaledZ),h)){var d=r.getId(h,a),m=new eu(h,l,c,u,d);m.tile=f,e.push(m)}}}},su.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},su.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},su.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=T(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var n=Date.now(),a=!1;if(this.expirationTime>n)a=!1;else if(t)if(this.expirationTime<t)a=!0;else{var i=this.expirationTime-t;i?this.expirationTime=n+Math.max(i,3e4):a=!0}else a=!0;a?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},su.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},su.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(e).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets)if(t.style.hasLayer(n)){var a=this.buckets[n],i=a.layers[0].sourceLayer||"_geojsonTileLayer",o=r[i],s=e[i];if(o&&s&&0!==Object.keys(s).length){a.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=t&&t.style&&t.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(a)))}}}},su.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},su.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<L.now()},su.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},su.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=L.now()+e},su.prototype.setDependencies=function(e,t){for(var r={},n=0,a=t;n<a.length;n+=1)r[a[n]]=!0;this.dependencies[e]=r},su.prototype.hasDependency=function(e,t){for(var r=0,n=e;r<n.length;r+=1){var a=n[r],i=this.dependencies[a];if(i)for(var o=0,s=t;o<s.length;o+=1)if(i[s[o]])return!0}return!1};var lu=self.performance,cu=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},lu.mark(this._marks.start)};cu.prototype.finish=function(){lu.mark(this._marks.end);var e=lu.getEntriesByName(this._marks.measure);return 0===e.length&&(lu.measure(this._marks.measure,this._marks.start,this._marks.end),e=lu.getEntriesByName(this._marks.measure),lu.clearMarks(this._marks.start),lu.clearMarks(this._marks.end),lu.clearMeasures(this._marks.measure)),e},e.Actor=Fc,e.AlphaImage=xo,e.CanonicalTileID=Xc,e.CollisionBoxArray=ei,e.Color=Je,e.DEMData=Jc,e.DataConstantProperty=ba,e.DictionaryCoder=Qc,e.EXTENT=8192,e.ErrorEvent=Te,e.EvaluationParameters=ua,e.Event=De,e.Evented=Ae,e.FeatureIndex=nu,e.FillBucket=cs,e.FillExtrusionBucket=As,e.ImageAtlas=wl,e.ImagePosition=xl,e.LineBucket=Fs,e.LngLat=jc,e.LngLatBounds=zc,e.MercatorCoordinate=Gc,e.ONE_EM=24,e.OverscaledTileID=Zc,e.Point=a,e.Point$1=a,e.Properties=Da,e.Protobuf=Js,e.RGBAImage=_o,e.RequestManager=V,e.RequestPerformance=cu,e.ResourceType=pe,e.SegmentVector=ui,e.SourceFeatureState=ru,e.StructArrayLayout1ui2=Za,e.StructArrayLayout2f1f2i16=Ua,e.StructArrayLayout2i4=Na,e.StructArrayLayout3ui6=Va,e.StructArrayLayout4i8=Oa,e.SymbolBucket=bc,e.Texture=Rc,e.Tile=su,e.Transitionable=ha,e.Uniform1f=Di,e.Uniform1i=ki,e.Uniform2f=Ti,e.Uniform3f=Ai,e.Uniform4f=Si,e.UniformColor=Mi,e.UniformMatrix4f=Ci,e.UnwrappedTileID=Yc,e.ValidationError=Me,e.WritingMode=kl,e.ZoomHistory=Vn,e.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},e.addDynamicAttributes=mc,e.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var n=e.length,a=new Array(e.length),i=null;e.forEach((function(e,o){t(e,(function(e,t){e&&(i=e),a[o]=t,0==--n&&r(i,a)}))}))},e.bezier=o,e.bindAll=m,e.browser=L,e.cacheEntryPossiblyAdded=function(e){++ue>oe&&(e.getActor().send("enforceCacheSizeLimit",ie),ue=0)},e.clamp=l,e.clearTileCache=function(e){var t=self.caches.delete("mapbox-tiles");e&&t.catch(e).then((function(){return e()}))},e.clipLine=Xl,e.clone=function(e){var t=new so(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.clone$1=b,e.clone$2=function(e){var t=new so(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.collisionCircleLayout=Gs,e.config=F,e.create=function(){var e=new so(16);return so!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.create$1=function(){var e=new so(9);return so!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},e.create$2=function(){var e=new so(4);return so!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},e.createCommonjsModule=t,e.createExpression=Wr,e.createLayout=Ea,e.createStyleLayer=function(e){return"custom"===e.type?new Mc(e):new Ec[e.type](e)},e.cross=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=r[0],s=r[1],l=r[2];return e[0]=a*l-i*s,e[1]=i*o-n*l,e[2]=n*s-a*o,e},e.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(t).length!==Object.keys(r).length)return!1;for(var a in t)if(!e(t[a],r[a]))return!1;return!0}return t===r},e.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},e.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},e.ease=s,e.emitValidationErrors=Nn,e.endsWith=g,e.enforceCacheSizeLimit=function(e){se(),J&&J.then((function(t){t.keys().then((function(r){for(var n=0;n<r.length-e;n++)t.delete(r[n])}))}))},e.evaluateSizeForFeature=zl,e.evaluateSizeForZoom=jl,e.evaluateVariableOffset=sc,e.evented=oa,e.extend=u,e.featureFilter=an,e.filterObject=v,e.fromRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.getAnchorAlignment=Pl,e.getAnchorJustification=lc,e.getArrayBuffer=be,e.getImage=_e,e.getJSON=function(e,t){return ve(u(e,{type:"json"}),t)},e.getRTLTextPluginStatus=sa,e.getReferrer=de,e.getVideo=function(e,t){var r,n,a=self.document.createElement("video");a.muted=!0,a.onloadstart=function(){t(null,a)};for(var i=0;i<e.length;i++){var o=self.document.createElement("source");r=e[i],n=void 0,(n=self.document.createElement("a")).href=r,(n.protocol!==self.document.location.protocol||n.host!==self.document.location.host)&&(a.crossOrigin="Anonymous"),o.src=e[i],a.appendChild(o)}return{cancel:function(){}}},e.identity=lo,e.invert=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],p=t[10],h=t[11],d=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,b=r*l-a*o,x=r*c-i*o,_=n*l-a*s,w=n*c-i*s,k=a*c-i*l,D=u*m-f*d,T=u*g-p*d,A=u*y-h*d,S=f*g-p*m,M=f*y-h*m,E=p*y-h*g,C=v*E-b*M+x*S+_*A-w*T+k*D;return C?(C=1/C,e[0]=(s*E-l*M+c*S)*C,e[1]=(a*M-n*E-i*S)*C,e[2]=(m*k-g*w+y*_)*C,e[3]=(p*w-f*k-h*_)*C,e[4]=(l*A-o*E-c*T)*C,e[5]=(r*E-a*A+i*T)*C,e[6]=(g*x-d*k-y*b)*C,e[7]=(u*k-p*x+h*b)*C,e[8]=(o*M-s*A+c*D)*C,e[9]=(n*A-r*M-i*D)*C,e[10]=(d*w-m*x+y*v)*C,e[11]=(f*x-u*w-h*v)*C,e[12]=(s*T-o*S-l*D)*C,e[13]=(r*S-n*T+a*D)*C,e[14]=(m*b-d*_-g*v)*C,e[15]=(u*_-f*b+p*v)*C,e):null},e.isChar=qn,e.isMapboxURL=q,e.keysDifference=function(e,t){var r=[];for(var n in e)n in t||r.push(n);return r},e.makeRequest=ve,e.mapObject=y,e.mercatorXfromLng=Vc,e.mercatorYfromLat=qc,e.mercatorZfromAltitude=Wc,e.mul=fo,e.multiply=co,e.mvt=ws,e.normalize=function(e,t){var r=t[0],n=t[1],a=t[2],i=r*r+n*n+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e},e.number=$t,e.offscreenCanvasSupported=fe,e.ortho=function(e,t,r,n,a,i,o){var s=1/(t-r),l=1/(n-a),c=1/(i-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*l,e[14]=(o+i)*c,e[15]=1,e},e.parseGlyphPBF=function(e){return new Js(e).readFields(gl,[])},e.pbf=Js,e.performSymbolLayout=function(e,t,r,n,a,i,o){e.createArrays();var s=512*e.overscaling;e.tilePixelRatio=8192/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,c=e.layers[0]._unevaluatedLayout._values,u={};if("composite"===e.textSizeData.kind){var f=e.textSizeData,p=f.minZoom,h=f.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new ua(p),o),c["text-size"].possiblyEvaluate(new ua(h),o)]}if("composite"===e.iconSizeData.kind){var d=e.iconSizeData,m=d.minZoom,g=d.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new ua(m),o),c["icon-size"].possiblyEvaluate(new ua(g),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new ua(e.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new ua(e.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new ua(18));for(var y=24*l.get("text-line-height"),v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),b=l.get("text-keep-upright"),x=l.get("text-size"),w=function(){var i=D[k],s=l.get("text-font").evaluate(i,{},o).join(","),c=x.evaluate(i,{},o),f=u.layoutTextSize.evaluate(i,{},o),p=u.layoutIconSize.evaluate(i,{},o),h={horizontal:{},vertical:void 0},d=i.text,m=[0,0];if(d){var g=d.toString(),w=24*l.get("text-letter-spacing").evaluate(i,{},o),T=function(e){for(var t=0,r=e;t<r.length;t+=1)if(!Hn(r[t].charCodeAt(0)))return!1;return!0}(g)?w:0,A=l.get("text-anchor").evaluate(i,{},o),S=l.get("text-variable-anchor");if(!S){var M=l.get("text-radial-offset").evaluate(i,{},o);m=M?sc(A,[24*M,oc]):l.get("text-offset").evaluate(i,{},o).map((function(e){return 24*e}))}var E=v?"center":l.get("text-justify").evaluate(i,{},o),C=l.get("symbol-placement"),N="point"===C?24*l.get("text-max-width").evaluate(i,{},o):0,O=function(){e.allowVerticalPlacement&&Wn(g)&&(h.vertical=Al(d,t,r,a,s,N,y,A,"left",T,m,kl.vertical,!0,C,f,c))};if(!v&&S){for(var I="auto"===E?S.map((function(e){return lc(e)})):[E],P=!1,R=0;R<I.length;R++){var L=I[R];if(!h.horizontal[L])if(P)h.horizontal[L]=h.horizontal[0];else{var F=Al(d,t,r,a,s,N,y,"center",L,T,m,kl.horizontal,!1,C,f,c);F&&(h.horizontal[L]=F,P=1===F.positionedLines.length)}}O()}else{"auto"===E&&(E=lc(A));var B=Al(d,t,r,a,s,N,y,A,E,T,m,kl.horizontal,!1,C,f,c);B&&(h.horizontal[E]=B),O(),Wn(g)&&v&&b&&(h.vertical=Al(d,t,r,a,s,N,y,A,E,T,m,kl.vertical,!1,C,f,c))}}var z=void 0,j=!1;if(i.icon&&i.icon.name){var U=n[i.icon.name];U&&(z=function(e,t,r){var n=Pl(r),a=n.horizontalAlign,i=n.verticalAlign,o=t[0],s=t[1],l=o-e.displaySize[0]*a,c=l+e.displaySize[0],u=s-e.displaySize[1]*i;return{image:e,top:u,bottom:u+e.displaySize[1],left:l,right:c}}(a[i.icon.name],l.get("icon-offset").evaluate(i,{},o),l.get("icon-anchor").evaluate(i,{},o)),j=U.sdf,void 0===e.sdfIcons?e.sdfIcons=U.sdf:e.sdfIcons!==U.sdf&&_("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(U.pixelRatio!==e.pixelRatio||0!==l.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0))}var $=uc(h.horizontal)||h.vertical;e.iconsInText=!!$&&$.iconsInText,($||z)&&function(e,t,r,n,a,i,o,s,l,c,u){var f=i.textMaxSize.evaluate(t,{});void 0===f&&(f=o);var p,h=e.layers[0].layout,d=h.get("icon-offset").evaluate(t,{},u),m=uc(r.horizontal),g=o/24,y=e.tilePixelRatio*g,v=e.tilePixelRatio*f/24,b=e.tilePixelRatio*s,x=e.tilePixelRatio*h.get("symbol-spacing"),w=h.get("text-padding")*e.tilePixelRatio,k=h.get("icon-padding")*e.tilePixelRatio,D=h.get("text-max-angle")/180*Math.PI,T="map"===h.get("text-rotation-alignment")&&"point"!==h.get("symbol-placement"),A="map"===h.get("icon-rotation-alignment")&&"point"!==h.get("symbol-placement"),S=h.get("symbol-placement"),M=x/2,E=h.get("icon-text-fit");n&&"none"!==E&&(e.allowVerticalPlacement&&r.vertical&&(p=Ll(n,r.vertical,E,h.get("icon-text-fit-padding"),d,g)),m&&(n=Ll(n,m,E,h.get("icon-text-fit-padding"),d,g)));var C=function(s,f){f.x<0||f.x>=8192||f.y<0||f.y>=8192||function(e,t,r,n,a,i,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,w,k,D,T){var A,S,M,E,C,N=e.addToLineVertexArray(t,r),O=0,I=0,P=0,R=0,L=-1,F=-1,B={},z=mi(""),j=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(A=s.layout.get("text-offset").evaluate(x,{},D).map((function(e){return 24*e})),j=A[0],U=A[1]):(j=24*s.layout.get("text-radial-offset").evaluate(x,{},D),U=oc),e.allowVerticalPlacement&&n.vertical){var $=s.layout.get("text-rotate").evaluate(x,{},D)+90,V=n.vertical;E=new ec(l,t,c,u,f,V,p,h,d,$),o&&(C=new ec(l,t,c,u,f,o,g,y,d,$))}if(a){var q=s.layout.get("icon-rotate").evaluate(x,{}),W="none"!==s.layout.get("icon-text-fit"),H=Yl(a,q,k,W),G=o?Yl(o,q,k,W):void 0;M=new ec(l,t,c,u,f,a,g,y,!1,q),O=4*H.length;var X=e.iconSizeData,Y=null;"source"===X.kind?(Y=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&_(e.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((Y=[128*w.compositeIconSizes[0].evaluate(x,{},D),128*w.compositeIconSizes[1].evaluate(x,{},D)])[0]>32640||Y[1]>32640)&&_(e.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),e.addSymbols(e.icon,H,Y,b,v,x,!1,t,N.lineStartIndex,N.lineLength,-1,D),L=e.icon.placedSymbolArray.length-1,G&&(I=4*G.length,e.addSymbols(e.icon,G,Y,b,v,x,kl.vertical,t,N.lineStartIndex,N.lineLength,-1,D),F=e.icon.placedSymbolArray.length-1)}for(var Z in n.horizontal){var K=n.horizontal[Z];if(!S){z=mi(K.text);var J=s.layout.get("text-rotate").evaluate(x,{},D);S=new ec(l,t,c,u,f,K,p,h,d,J)}var Q=1===K.positionedLines.length;if(P+=cc(e,t,K,i,s,d,x,m,N,n.vertical?kl.horizontal:kl.horizontalOnly,Q?Object.keys(n.horizontal):[Z],B,L,w,D),Q)break}n.vertical&&(R+=cc(e,t,n.vertical,i,s,d,x,m,N,kl.vertical,["vertical"],B,F,w,D));var ee=S?S.boxStartIndex:e.collisionBoxArray.length,te=S?S.boxEndIndex:e.collisionBoxArray.length,re=E?E.boxStartIndex:e.collisionBoxArray.length,ne=E?E.boxEndIndex:e.collisionBoxArray.length,ae=M?M.boxStartIndex:e.collisionBoxArray.length,ie=M?M.boxEndIndex:e.collisionBoxArray.length,oe=C?C.boxStartIndex:e.collisionBoxArray.length,se=C?C.boxEndIndex:e.collisionBoxArray.length,le=-1,ce=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};le=ce(S,le),le=ce(E,le),le=ce(M,le);var ue=(le=ce(C,le))>-1?1:0;ue&&(le*=T/24),e.glyphOffsetArray.length>=bc.MAX_GLYPHS&&_("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,x.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,L,F,z,ee,te,re,ne,ae,ie,oe,se,c,P,R,O,I,ue,0,p,j,U,le)}(e,f,s,r,n,a,p,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,y,w,T,l,b,k,A,d,t,i,c,u,o)};if("line"===S)for(var N=0,O=Xl(t.geometry,0,0,8192,8192);N<O.length;N+=1)for(var I=O[N],P=0,R=Gl(I,x,D,r.vertical||m,n,24,v,e.overscaling,8192);P<R.length;P+=1){var L=R[P];m&&fc(e,m.text,M,L)||C(I,L)}else if("line-center"===S)for(var F=0,B=t.geometry;F<B.length;F+=1){var z=B[F];if(z.length>1){var j=Hl(z,D,r.vertical||m,n,24,v);j&&C(z,j)}}else if("Polygon"===t.type)for(var U=0,$=is(t.geometry,0);U<$.length;U+=1){var V=$[U],q=nc(V,16);C(V[0],new Fl(q.x,q.y,0))}else if("LineString"===t.type)for(var W=0,H=t.geometry;W<H.length;W+=1){var G=H[W];C(G,new Fl(G[0].x,G[0].y,0))}else if("Point"===t.type)for(var X=0,Y=t.geometry;X<Y.length;X+=1)for(var Z=0,K=Y[X];Z<K.length;Z+=1){var J=K[Z];C([J],new Fl(J.x,J.y,0))}}(e,i,h,z,n,u,f,p,m,j,o)},k=0,D=e.features;k<D.length;k+=1)w();i&&e.generateCollisionDebugBuffers()},e.perspective=function(e,t,r,n,a){var i,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=a&&a!==1/0?(i=1/(n-a),e[10]=(a+n)*i,e[14]=2*a*n*i):(e[10]=-1,e[14]=-2*n),e},e.pick=function(e,t){for(var r={},n=0;n<t.length;n++){var a=t[n];a in e&&(r[a]=e[a])}return r},e.plugin=ca,e.polygonIntersectsPolygon=Wi,e.postMapLoadEvent=ae,e.postTurnstileEvent=re,e.potpack=bl,e.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.register=Fn,e.registerForPluginStateChange=function(e){return e({pluginStatus:ra,pluginURL:na}),oa.on("pluginStateChange",e),e},e.rotate=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+i*s,e[1]=a*l+o*s,e[2]=n*-s+i*l,e[3]=a*-s+o*l,e},e.rotateX=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*a+c*n,e[5]=o*a+u*n,e[6]=s*a+f*n,e[7]=l*a+p*n,e[8]=c*a-i*n,e[9]=u*a-o*n,e[10]=f*a-s*n,e[11]=p*a-l*n,e},e.rotateZ=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],f=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*a+c*n,e[1]=o*a+u*n,e[2]=s*a+f*n,e[3]=l*a+p*n,e[4]=c*a-i*n,e[5]=u*a-o*n,e[6]=f*a-s*n,e[7]=p*a-l*n,e},e.scale=function(e,t,r){var n=r[0],a=r[1],i=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},e.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},e.setCacheLimits=function(e,t){ie=e,oe=t},e.setRTLTextPlugin=function(e,t,r){if(void 0===r&&(r=!1),ra===Jn||ra===Qn||ra===ea)throw new Error("setRTLTextPlugin cannot be called multiple times.");na=L.resolveURL(e),ra=Jn,ta=t,ia(),r||la()},e.sphericalToCartesian=function(e){var t=e[0],r=e[1],n=e[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(n),y:t*Math.sin(r)*Math.sin(n),z:t*Math.cos(n)}},e.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},e.styleSpec=Se,e.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},e.symbolSize=Ul,e.transformMat3=function(e,t,r){var n=t[0],a=t[1],i=t[2];return e[0]=n*r[0]+a*r[3]+i*r[6],e[1]=n*r[1]+a*r[4]+i*r[7],e[2]=n*r[2]+a*r[5]+i*r[8],e},e.transformMat4=po,e.translate=function(e,t,r){var n,a,i,o,s,l,c,u,f,p,h,d,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],p=t[9],h=t[10],d=t[11],e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=f,e[9]=p,e[10]=h,e[11]=d,e[12]=n*m+s*g+f*y+t[12],e[13]=a*m+l*g+p*y+t[13],e[14]=i*m+c*g+h*y+t[14],e[15]=o*m+u*g+d*y+t[15]),e},e.triggerPluginCompletionEvent=aa,e.uniqueId=p,e.validateCustomStyleLayer=function(e){var t=[],r=e.id;return void 0===r&&t.push({message:"layers."+r+': missing required property "id"'}),void 0===e.render&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},e.validateLight=Mn,e.validateStyle=Sn,e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.vectorTile=ws,e.version="1.10.1",e.warnOnce=_,e.webpSupported=B,e.window=self,e.wrap=c})),n(0,(function(e){function t(e){var r=typeof e;if("number"===r||"boolean"===r||"string"===r||null==e)return JSON.stringify(e);if(Array.isArray(e)){for(var n="[",a=0,i=e;a<i.length;a+=1)n+=t(i[a])+",";return n+"]"}for(var o=Object.keys(e).sort(),s="{",l=0;l<o.length;l++)s+=JSON.stringify(o[l])+":"+t(e[o[l]])+",";return s+"}"}function r(r){for(var n="",a=0,i=e.refProperties;a<i.length;a+=1)n+="/"+t(r[i[a]]);return n}var n=function(e){this.keyCache={},e&&this.replace(e)};n.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[])},n.prototype.update=function(t,n){for(var a=this,i=0,o=t;i<o.length;i+=1){var s=o[i];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=e.createStyleLayer(s);l._featureFilter=e.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var c=0,u=n;c<u.length;c+=1){var f=u[c];delete this.keyCache[f],delete this._layerConfigs[f],delete this._layers[f]}this.familiesBySource={};for(var p=0,h=function(e,t){for(var n={},a=0;a<e.length;a++){var i=t&&t[e[a].id]||r(e[a]);t&&(t[e[a].id]=i);var o=n[i];o||(o=n[i]=[]),o.push(e[a])}var s=[];for(var l in n)s.push(n[l]);return s}(e.values(this._layerConfigs),this.keyCache);p<h.length;p+=1){var d=h[p].map((function(e){return a._layers[e.id]})),m=d[0];if("none"!==m.visibility){var g=m.source||"",y=this.familiesBySource[g];y||(y=this.familiesBySource[g]={});var v=m.sourceLayer||"_geojsonTileLayer",b=y[v];b||(b=y[v]=[]),b.push(d)}}};var a=function(t){var r={},n=[];for(var a in t){var i=t[a],o=r[a]={};for(var s in i){var l=i[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var c={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(c),o[s]={rect:c,metrics:l.metrics}}}}var u=e.potpack(n),f=u.w,p=u.h,h=new e.AlphaImage({width:f||1,height:p||1});for(var d in t){var m=t[d];for(var g in m){var y=m[+g];if(y&&0!==y.bitmap.width&&0!==y.bitmap.height){var v=r[d][g].rect;e.AlphaImage.copy(y.bitmap,h,{x:0,y:0},{x:v.x+1,y:v.y+1},y.bitmap)}}}this.image=h,this.positions=r};e.register("GlyphAtlas",a);var i=function(t){this.tileID=new e.OverscaledTileID(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId};function o(t,r,n){for(var a=new e.EvaluationParameters(r),i=0,o=t;i<o.length;i+=1)o[i].recalculate(a,n)}function s(t,r){var n=e.getArrayBuffer(t.request,(function(t,n,a,i){t?r(t):n&&r(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(n)),rawData:n,cacheControl:a,expires:i})}));return function(){n.cancel(),r()}}i.prototype.parse=function(t,r,n,i,s){var l=this;this.status="parsing",this.data=t,this.collisionBoxArray=new e.CollisionBoxArray;var c=new e.DictionaryCoder(Object.keys(t.layers).sort()),u=new e.FeatureIndex(this.tileID,this.promoteId);u.bucketLayerIDs=[];var f,p,h,d,m={},g={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},y=r.familiesBySource[this.source];for(var v in y){var b=t.layers[v];if(b){1===b.version&&e.warnOnce('Vector tile source "'+this.source+'" layer "'+v+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var x=c.encode(v),_=[],w=0;w<b.length;w++){var k=b.feature(w),D=u.getId(k,v);_.push({feature:k,id:D,index:w,sourceLayerIndex:x})}for(var T=0,A=y[v];T<A.length;T+=1){var S=A[T],M=S[0];M.minzoom&&this.zoom<Math.floor(M.minzoom)||M.maxzoom&&this.zoom>=M.maxzoom||"none"!==M.visibility&&(o(S,this.zoom,n),(m[M.id]=M.createBucket({index:u.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(_,g,this.tileID.canonical),u.bucketLayerIDs.push(S.map((function(e){return e.id}))))}}}var E=e.mapObject(g.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(E).length?i.send("getGlyphs",{uid:this.uid,stacks:E},(function(e,t){f||(f=e,p=t,O.call(l))})):p={};var C=Object.keys(g.iconDependencies);C.length?i.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){f||(f=e,h=t,O.call(l))})):h={};var N=Object.keys(g.patternDependencies);function O(){if(f)return s(f);if(p&&h&&d){var t=new a(p),r=new e.ImageAtlas(h,d);for(var i in m){var l=m[i];l instanceof e.SymbolBucket?(o(l.layers,this.zoom,n),e.performSymbolLayout(l,p,t.positions,h,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof e.LineBucket||l instanceof e.FillBucket||l instanceof e.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(g,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:e.values(m).filter((function(e){return!e.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?h:null,glyphPositions:this.returnDependencies?t.positions:null})}}N.length?i.send("getImages",{icons:N,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){f||(f=e,d=t,O.call(l))})):d={},O.call(this)};var l=function(e,t,r,n){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(t,r){var n=this,a=t.uid;this.loading||(this.loading={});var o=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),s=this.loading[a]=new i(t);s.abort=this.loadVectorData(t,(function(t,i){if(delete n.loading[a],t||!i)return s.status="done",n.loaded[a]=s,r(t);var l=i.rawData,c={};i.expires&&(c.expires=i.expires),i.cacheControl&&(c.cacheControl=i.cacheControl);var u={};if(o){var f=o.finish();f&&(u.resourceTiming=JSON.parse(JSON.stringify(f)))}s.vectorTile=i.vectorTile,s.parse(i.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(t,n){if(t||!n)return r(t);r(null,e.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[a]=s}))},l.prototype.reloadTile=function(e,t){var r=this,n=this.loaded,a=e.uid,i=this;if(n&&n[a]){var o=n[a];o.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,n){var a=o.reloadCallback;a&&(delete o.reloadCallback,o.parse(o.vectorTile,i.layerIndex,r.availableImages,i.actor,a)),t(e,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(e,t){var r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),t()},l.prototype.removeTile=function(e,t){var r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t()};var c=e.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(t,r){var n=t.uid,a=t.encoding,i=t.rawImageData,o=c&&i instanceof c?this.getImageData(i):i,s=new e.DEMData(n,o,a);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)},u.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]};var f=function e(t,r){var n,a=t&&t.type;if("FeatureCollection"===a)for(n=0;n<t.features.length;n++)e(t.features[n],r);else if("GeometryCollection"===a)for(n=0;n<t.geometries.length;n++)e(t.geometries[n],r);else if("Feature"===a)e(t.geometry,r);else if("Polygon"===a)p(t.coordinates,r);else if("MultiPolygon"===a)for(n=0;n<t.coordinates.length;n++)p(t.coordinates[n],r);return t};function p(e,t){if(0!==e.length){h(e[0],t);for(var r=1;r<e.length;r++)h(e[r],!t)}}function h(e,t){for(var r=0,n=0,a=e.length,i=a-1;n<a;i=n++)r+=(e[n][0]-e[i][0])*(e[i][1]+e[n][1]);r>=0!=!!t&&e.reverse()}var d=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var a=n[r];t.push([new e.Point$1(a[0],a[1])])}return t}for(var i=[],o=0,s=this._feature.geometry;o<s.length;o+=1){for(var l=[],c=0,u=s[o];c<u.length;c+=1){var f=u[c];l.push(new e.Point$1(f[0],f[1]))}i.push(l)}return i},m.prototype.toGeoJSON=function(e,t,r){return d.call(this,e,t,r)};var g=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t};g.prototype.feature=function(e){return new m(this._features[e])};var y=e.vectorTile.VectorTileFeature,v=b;function b(e,t){this.options=t||{},this.features=e,this.length=e.length}function x(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}b.prototype.feature=function(e){return new x(this.features[e],this.options.extent)},x.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var r=0;r<t.length;r++){for(var n=t[r],a=[],i=0;i<n.length;i++)a.push(new e.Point$1(n[i][0],n[i][1]));this.geometry.push(a)}return this.geometry},x.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,n=1/0,a=-1/0,i=0;i<e.length;i++)for(var o=e[i],s=0;s<o.length;s++){var l=o[s];t=Math.min(t,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),a=Math.max(a,l.y)}return[t,n,r,a]},x.prototype.toGeoJSON=y.prototype.toGeoJSON;var _=D,w=D,k=v;function D(t){var r=new e.pbf;return function(e,t){for(var r in e.layers)t.writeMessage(3,T,e.layers[r])}(t,r),r.finish()}function T(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)n.feature=e.feature(r),t.writeMessage(2,A,n);var a=n.keys;for(r=0;r<a.length;r++)t.writeStringField(3,a[r]);var i=n.values;for(r=0;r<i.length;r++)t.writeMessage(4,N,i[r])}function A(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,S,e),t.writeVarintField(3,r.type),t.writeMessage(4,C,r)}function S(e,t){var r=e.feature,n=e.keys,a=e.values,i=e.keycache,o=e.valuecache;for(var s in r.properties){var l=i[s];void 0===l&&(n.push(s),l=n.length-1,i[s]=l),t.writeVarint(l);var c=r.properties[s],u=typeof c;"string"!==u&&"boolean"!==u&&"number"!==u&&(c=JSON.stringify(c));var f=u+":"+c,p=o[f];void 0===p&&(a.push(c),p=a.length-1,o[f]=p),t.writeVarint(p)}}function M(e,t){return(t<<3)+(7&e)}function E(e){return e<<1^e>>31}function C(e,t){for(var r=e.loadGeometry(),n=e.type,a=0,i=0,o=r.length,s=0;s<o;s++){var l=r[s],c=1;1===n&&(c=l.length),t.writeVarint(M(1,c));for(var u=3===n?l.length-1:l.length,f=0;f<u;f++){1===f&&1!==n&&t.writeVarint(M(2,u-1));var p=l[f].x-a,h=l[f].y-i;t.writeVarint(E(p)),t.writeVarint(E(h)),a+=p,i+=h}3===n&&t.writeVarint(M(7,1))}}function N(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}function O(e,t,r,n,a,i){if(!(a-n<=r)){var o=n+a>>1;!function e(t,r,n,a,i,o){for(;i>a;){if(i-a>600){var s=i-a+1,l=n-a+1,c=Math.log(s),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);e(t,r,n,Math.max(a,Math.floor(n-l*u/s+f)),Math.min(i,Math.floor(n+(s-l)*u/s+f)),o)}var p=r[2*n+o],h=a,d=i;for(I(t,r,a,n),r[2*i+o]>p&&I(t,r,a,i);h<d;){for(I(t,r,h,d),h++,d--;r[2*h+o]<p;)h++;for(;r[2*d+o]>p;)d--}r[2*a+o]===p?I(t,r,a,d):I(t,r,++d,i),d<=n&&(a=d+1),n<=d&&(i=d-1)}}(e,t,o,n,a,i%2),O(e,t,r,n,o-1,i+1),O(e,t,r,o+1,a,i+1)}}function I(e,t,r,n){P(e,r,n),P(t,2*r,2*n),P(t,2*r+1,2*n+1)}function P(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function R(e,t,r,n){var a=e-r,i=t-n;return a*a+i*i}_.fromVectorTileJs=w,_.fromGeojsonVt=function(e,t){t=t||{};var r={};for(var n in e)r[n]=new v(e[n].features,t),r[n].name=n,r[n].version=t.version,r[n].extent=t.extent;return D({layers:r})},_.GeoJSONWrapper=k;var L=function(e){return e[0]},F=function(e){return e[1]},B=function(e,t,r,n,a){void 0===t&&(t=L),void 0===r&&(r=F),void 0===n&&(n=64),void 0===a&&(a=Float64Array),this.nodeSize=n,this.points=e;for(var i=e.length<65536?Uint16Array:Uint32Array,o=this.ids=new i(e.length),s=this.coords=new a(2*e.length),l=0;l<e.length;l++)o[l]=l,s[2*l]=t(e[l]),s[2*l+1]=r(e[l]);O(o,s,n,0,o.length-1,0)};B.prototype.range=function(e,t,r,n){return function(e,t,r,n,a,i,o){for(var s,l,c=[0,e.length-1,0],u=[];c.length;){var f=c.pop(),p=c.pop(),h=c.pop();if(p-h<=o)for(var d=h;d<=p;d++)s=t[2*d],l=t[2*d+1],s>=r&&s<=a&&l>=n&&l<=i&&u.push(e[d]);else{var m=Math.floor((h+p)/2);s=t[2*m],l=t[2*m+1],s>=r&&s<=a&&l>=n&&l<=i&&u.push(e[m]);var g=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(h),c.push(m-1),c.push(g)),(0===f?a>=s:i>=l)&&(c.push(m+1),c.push(p),c.push(g))}}return u}(this.ids,this.coords,e,t,r,n,this.nodeSize)},B.prototype.within=function(e,t,r){return function(e,t,r,n,a,i){for(var o=[0,e.length-1,0],s=[],l=a*a;o.length;){var c=o.pop(),u=o.pop(),f=o.pop();if(u-f<=i)for(var p=f;p<=u;p++)R(t[2*p],t[2*p+1],r,n)<=l&&s.push(e[p]);else{var h=Math.floor((f+u)/2),d=t[2*h],m=t[2*h+1];R(d,m,r,n)<=l&&s.push(e[h]);var g=(c+1)%2;(0===c?r-a<=d:n-a<=m)&&(o.push(f),o.push(h-1),o.push(g)),(0===c?r+a>=d:n+a>=m)&&(o.push(h+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,e,t,r,this.nodeSize)};var z={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},j=function(e){this.options=G(Object.create(z),e),this.trees=new Array(this.options.maxZoom+1)};function U(e,t,r,n,a){return{x:e,y:t,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:a}}function $(e,t){var r=e.geometry.coordinates,n=r[0],a=r[1];return{x:W(n),y:H(a),zoom:1/0,index:t,parentId:-1}}function V(e){return{type:"Feature",id:e.id,properties:q(e),geometry:{type:"Point",coordinates:[(n=e.x,360*(n-.5)),(t=e.y,r=(180-360*t)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var t,r,n}function q(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return G(G({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function W(e){return e/360+.5}function H(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function G(e,t){for(var r in t)e[r]=t[r];return e}function X(e){return e.x}function Y(e){return e.y}function Z(e,t,r,n,a,i){var o=a-r,s=i-n;if(0!==o||0!==s){var l=((e-r)*o+(t-n)*s)/(o*o+s*s);l>1?(r=a,n=i):l>0&&(r+=o*l,n+=s*l)}return(o=e-r)*o+(s=t-n)*s}function K(e,t,r,n){var a={id:void 0===e?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)J(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<t.length;n++)J(e,t[n]);else if("MultiPolygon"===r)for(n=0;n<t.length;n++)for(var a=0;a<t[n].length;a++)J(e,t[n][a])}(a),a}function J(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function Q(e,t,r,n){if(t.geometry){var a=t.geometry.coordinates,i=t.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===i)ee(a,s);else if("MultiPoint"===i)for(var c=0;c<a.length;c++)ee(a[c],s);else if("LineString"===i)te(a,s,o,!1);else if("MultiLineString"===i){if(r.lineMetrics){for(c=0;c<a.length;c++)s=[],te(a[c],s,o,!1),e.push(K(l,"LineString",s,t.properties));return}re(a,s,o,!1)}else if("Polygon"===i)re(a,s,o,!0);else{if("MultiPolygon"!==i){if("GeometryCollection"===i){for(c=0;c<t.geometry.geometries.length;c++)Q(e,{id:l,geometry:t.geometry.geometries[c],properties:t.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<a.length;c++){var u=[];re(a[c],u,o,!0),s.push(u)}}e.push(K(l,i,s,t.properties))}}function ee(e,t){t.push(ne(e[0])),t.push(ae(e[1])),t.push(0)}function te(e,t,r,n){for(var a,i,o=0,s=0;s<e.length;s++){var l=ne(e[s][0]),c=ae(e[s][1]);t.push(l),t.push(c),t.push(0),s>0&&(o+=n?(a*c-l*i)/2:Math.sqrt(Math.pow(l-a,2)+Math.pow(c-i,2))),a=l,i=c}var u=t.length-3;t[2]=1,function e(t,r,n,a){for(var i,o=a,s=n-r>>1,l=n-r,c=t[r],u=t[r+1],f=t[n],p=t[n+1],h=r+3;h<n;h+=3){var d=Z(t[h],t[h+1],c,u,f,p);if(d>o)i=h,o=d;else if(d===o){var m=Math.abs(h-s);m<l&&(i=h,l=m)}}o>a&&(i-r>3&&e(t,r,i,a),t[i+2]=o,n-i>3&&e(t,i,n,a))}(t,0,u,r),t[u+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function re(e,t,r,n){for(var a=0;a<e.length;a++){var i=[];te(e[a],i,r,n),t.push(i)}}function ne(e){return e/360+.5}function ae(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function ie(e,t,r,n,a,i,o,s){if(n/=t,i>=(r/=t)&&o<n)return e;if(o<r||i>=n)return null;for(var l=[],c=0;c<e.length;c++){var u=e[c],f=u.geometry,p=u.type,h=0===a?u.minX:u.minY,d=0===a?u.maxX:u.maxY;if(h>=r&&d<n)l.push(u);else if(!(d<r||h>=n)){var m=[];if("Point"===p||"MultiPoint"===p)oe(f,m,r,n,a);else if("LineString"===p)se(f,m,r,n,a,!1,s.lineMetrics);else if("MultiLineString"===p)ce(f,m,r,n,a,!1);else if("Polygon"===p)ce(f,m,r,n,a,!0);else if("MultiPolygon"===p)for(var g=0;g<f.length;g++){var y=[];ce(f[g],y,r,n,a,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===p){for(g=0;g<m.length;g++)l.push(K(u.id,p,m[g],u.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),l.push(K(u.id,p,m,u.tags))}}}return l.length?l:null}function oe(e,t,r,n,a){for(var i=0;i<e.length;i+=3){var o=e[i+a];o>=r&&o<=n&&(t.push(e[i]),t.push(e[i+1]),t.push(e[i+2]))}}function se(e,t,r,n,a,i,o){for(var s,l,c=le(e),u=0===a?fe:pe,f=e.start,p=0;p<e.length-3;p+=3){var h=e[p],d=e[p+1],m=e[p+2],g=e[p+3],y=e[p+4],v=0===a?h:d,b=0===a?g:y,x=!1;o&&(s=Math.sqrt(Math.pow(h-g,2)+Math.pow(d-y,2))),v<r?b>r&&(l=u(c,h,d,g,y,r),o&&(c.start=f+s*l)):v>n?b<n&&(l=u(c,h,d,g,y,n),o&&(c.start=f+s*l)):ue(c,h,d,m),b<r&&v>=r&&(l=u(c,h,d,g,y,r),x=!0),b>n&&v<=n&&(l=u(c,h,d,g,y,n),x=!0),!i&&x&&(o&&(c.end=f+s*l),t.push(c),c=le(e)),o&&(f+=s)}var _=e.length-3;h=e[_],d=e[_+1],m=e[_+2],(v=0===a?h:d)>=r&&v<=n&&ue(c,h,d,m),_=c.length-3,i&&_>=3&&(c[_]!==c[0]||c[_+1]!==c[1])&&ue(c,c[0],c[1],c[2]),c.length&&t.push(c)}function le(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ce(e,t,r,n,a,i){for(var o=0;o<e.length;o++)se(e[o],t,r,n,a,i,!1)}function ue(e,t,r,n){e.push(t),e.push(r),e.push(n)}function fe(e,t,r,n,a,i){var o=(i-t)/(n-t);return e.push(i),e.push(r+(a-r)*o),e.push(1),o}function pe(e,t,r,n,a,i){var o=(i-r)/(a-r);return e.push(t+(n-t)*o),e.push(i),e.push(1),o}function he(e,t){for(var r=[],n=0;n<e.length;n++){var a,i=e[n],o=i.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)a=de(i.geometry,t);else if("MultiLineString"===o||"Polygon"===o){a=[];for(var s=0;s<i.geometry.length;s++)a.push(de(i.geometry[s],t))}else if("MultiPolygon"===o)for(a=[],s=0;s<i.geometry.length;s++){for(var l=[],c=0;c<i.geometry[s].length;c++)l.push(de(i.geometry[s][c],t));a.push(l)}r.push(K(i.id,o,a,i.tags))}return r}function de(e,t){var r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(var n=0;n<e.length;n+=3)r.push(e[n]+t,e[n+1],e[n+2]);return r}function me(e,t){if(e.transformed)return e;var r,n,a,i=1<<e.z,o=e.x,s=e.y;for(r=0;r<e.features.length;r++){var l=e.features[r],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(n=0;n<c.length;n+=2)l.geometry.push(ge(c[n],c[n+1],t,i,o,s));else for(n=0;n<c.length;n++){var f=[];for(a=0;a<c[n].length;a+=2)f.push(ge(c[n][a],c[n][a+1],t,i,o,s));l.geometry.push(f)}}return e.transformed=!0,e}function ge(e,t,r,n,a,i){return[Math.round(r*(e*n-a)),Math.round(r*(t*n-i))]}function ye(e,t,r,n,a){for(var i=t===a.maxZoom?0:a.tolerance/((1<<t)*a.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){o.numFeatures++,ve(o,e[s],i,a);var l=e[s].minX,c=e[s].minY,u=e[s].maxX,f=e[s].maxY;l<o.minX&&(o.minX=l),c<o.minY&&(o.minY=c),u>o.maxX&&(o.maxX=u),f>o.maxY&&(o.maxY=f)}return o}function ve(e,t,r,n){var a=t.geometry,i=t.type,o=[];if("Point"===i||"MultiPoint"===i)for(var s=0;s<a.length;s+=3)o.push(a[s]),o.push(a[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===i)be(o,a,e,r,!1,!1);else if("MultiLineString"===i||"Polygon"===i)for(s=0;s<a.length;s++)be(o,a[s],e,r,"Polygon"===i,0===s);else if("MultiPolygon"===i)for(var l=0;l<a.length;l++){var c=a[l];for(s=0;s<c.length;s++)be(o,c[s],e,r,!0,0===s)}if(o.length){var u=t.tags||null;if("LineString"===i&&n.lineMetrics){for(var f in u={},t.tags)u[f]=t.tags[f];u.mapbox_clip_start=a.start/a.size,u.mapbox_clip_end=a.end/a.size}var p={geometry:o,type:"Polygon"===i||"MultiPolygon"===i?3:"LineString"===i||"MultiLineString"===i?2:1,tags:u};null!==t.id&&(p.id=t.id),e.features.push(p)}}function be(e,t,r,n,a,i){var o=n*n;if(n>0&&t.size<(a?o:n))r.numPoints+=t.length/3;else{for(var s=[],l=0;l<t.length;l+=3)(0===n||t[l+2]>o)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;a&&function(e,t){for(var r=0,n=0,a=e.length,i=a-2;n<a;i=n,n+=2)r+=(e[n]-e[i])*(e[n+1]+e[i+1]);if(r>0===t)for(n=0,a=e.length;n<a/2;n+=2){var o=e[n],s=e[n+1];e[n]=e[a-2-n],e[n+1]=e[a-1-n],e[a-2-n]=o,e[a-1-n]=s}}(s,i),e.push(s)}}function xe(e,t){var r=(t=this.options=function(e,t){for(var r in t)e[r]=t[r];return e}(Object.create(this.options),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(e,t){var r=[];if("FeatureCollection"===e.type)for(var n=0;n<e.features.length;n++)Q(r,e.features[n],t,n);else"Feature"===e.type?Q(r,e,t):Q(r,{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(e,t){var r=t.buffer/t.extent,n=e,a=ie(e,1,-1-r,r,0,-1,2,t),i=ie(e,1,1-r,2+r,0,-1,2,t);return(a||i)&&(n=ie(e,1,-r,1+r,0,-1,2,t)||[],a&&(n=he(a,1).concat(n)),i&&(n=n.concat(he(i,-1)))),n}(n,t)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function _e(e,t,r){return 32*((1<<e)*r+t)+e}function we(e,t){var r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return t(null,null);var a=new g(n.features),i=_(a);0===i.byteOffset&&i.byteLength===i.buffer.byteLength||(i=new Uint8Array(i)),t(null,{vectorTile:a,rawData:i.buffer})}j.prototype.load=function(e){var t=this.options,r=t.log,n=t.minZoom,a=t.maxZoom,i=t.nodeSize;r&&console.time("total time");var o="prepare "+e.length+" points";r&&console.time(o),this.points=e;for(var s=[],l=0;l<e.length;l++)e[l].geometry&&s.push($(e[l],l));this.trees[a+1]=new B(s,X,Y,i,Float32Array),r&&console.timeEnd(o);for(var c=a;c>=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new B(s,X,Y,i,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},j.prototype.getClusters=function(e,t){var r=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),a=180===e[2]?180:((e[2]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,a=180;else if(r>a){var o=this.getClusters([r,n,180,i],t),s=this.getClusters([-180,n,a,i],t);return o.concat(s)}for(var l=this.trees[this._limitZoom(t)],c=[],u=0,f=l.range(W(r),H(i),W(a),H(n));u<f.length;u+=1){var p=f[u],h=l.points[p];c.push(h.numPoints?V(h):this.points[h.index])}return c},j.prototype.getChildren=function(e){var t=this._getOriginId(e),r=this._getOriginZoom(e),n="No cluster with the specified id.",a=this.trees[r];if(!a)throw new Error(n);var i=a.points[t];if(!i)throw new Error(n);for(var o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,c=a.within(i.x,i.y,o);l<c.length;l+=1){var u=c[l],f=a.points[u];f.parentId===e&&s.push(f.numPoints?V(f):this.points[f.index])}if(0===s.length)throw new Error(n);return s},j.prototype.getLeaves=function(e,t,r){t=t||10,r=r||0;var n=[];return this._appendLeaves(n,e,t,r,0),n},j.prototype.getTile=function(e,t,r){var n=this.trees[this._limitZoom(e)],a=Math.pow(2,e),i=this.options,o=i.extent,s=i.radius/o,l=(r-s)/a,c=(r+1+s)/a,u={features:[]};return this._addTileFeatures(n.range((t-s)/a,l,(t+1+s)/a,c),n.points,t,r,a,u),0===t&&this._addTileFeatures(n.range(1-s/a,l,1,c),n.points,a,r,a,u),t===a-1&&this._addTileFeatures(n.range(0,l,s/a,c),n.points,-1,r,a,u),u.features.length?u:null},j.prototype.getClusterExpansionZoom=function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t},j.prototype._appendLeaves=function(e,t,r,n,a){for(var i=0,o=this.getChildren(t);i<o.length;i+=1){var s=o[i],l=s.properties;if(l&&l.cluster?a+l.point_count<=n?a+=l.point_count:a=this._appendLeaves(e,l.cluster_id,r,n,a):a<n?a++:e.push(s),e.length===r)break}return a},j.prototype._addTileFeatures=function(e,t,r,n,a,i){for(var o=0,s=e;o<s.length;o+=1){var l=t[s[o]],c=l.numPoints,u={type:1,geometry:[[Math.round(this.options.extent*(l.x*a-r)),Math.round(this.options.extent*(l.y*a-n))]],tags:c?q(l):this.points[l.index].properties},f=void 0;c?f=l.id:this.options.generateId?f=l.index:this.points[l.index].id&&(f=this.points[l.index].id),void 0!==f&&(u.id=f),i.features.push(u)}},j.prototype._limitZoom=function(e){return Math.max(this.options.minZoom,Math.min(e,this.options.maxZoom+1))},j.prototype._cluster=function(e,t){for(var r=[],n=this.options,a=n.radius,i=n.extent,o=n.reduce,s=a/(i*Math.pow(2,t)),l=0;l<e.length;l++){var c=e[l];if(!(c.zoom<=t)){c.zoom=t;for(var u=this.trees[t+1],f=u.within(c.x,c.y,s),p=c.numPoints||1,h=c.x*p,d=c.y*p,m=o&&p>1?this._map(c,!0):null,g=(l<<5)+(t+1)+this.points.length,y=0,v=f;y<v.length;y+=1){var b=v[y],x=u.points[b];if(!(x.zoom<=t)){x.zoom=t;var _=x.numPoints||1;h+=x.x*_,d+=x.y*_,p+=_,x.parentId=g,o&&(m||(m=this._map(c,!0)),o(m,this._map(x)))}}1===p?r.push(c):(c.parentId=g,r.push(U(h/p,d/p,g,p,m)))}}return r},j.prototype._getOriginId=function(e){return e-this.points.length>>5},j.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},j.prototype._map=function(e,t){if(e.numPoints)return t?G({},e.properties):e.properties;var r=this.points[e.index].properties,n=this.options.map(r);return t&&n===r?G({},n):n},xe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},xe.prototype.splitTile=function(e,t,r,n,a,i,o){for(var s=[e,t,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var u=1<<t,f=_e(t,r,n),p=this.tiles[f];if(!p&&(c>1&&console.time("creation"),p=this.tiles[f]=ye(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var h="z"+t;this.stats[h]=(this.stats[h]||0)+1,this.total++}if(p.source=e,a){if(t===l.maxZoom||t===a)continue;var d=1<<a-t;if(r!==Math.floor(i/d)||n!==Math.floor(o/d))continue}else if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==e.length){c>1&&console.time("clipping");var m,g,y,v,b,x,_=.5*l.buffer/l.extent,w=.5-_,k=.5+_,D=1+_;m=g=y=v=null,b=ie(e,u,r-_,r+k,0,p.minX,p.maxX,l),x=ie(e,u,r+w,r+D,0,p.minX,p.maxX,l),e=null,b&&(m=ie(b,u,n-_,n+k,1,p.minY,p.maxY,l),g=ie(b,u,n+w,n+D,1,p.minY,p.maxY,l),b=null),x&&(y=ie(x,u,n-_,n+k,1,p.minY,p.maxY,l),v=ie(x,u,n+w,n+D,1,p.minY,p.maxY,l),x=null),c>1&&console.timeEnd("clipping"),s.push(m||[],t+1,2*r,2*n),s.push(g||[],t+1,2*r,2*n+1),s.push(y||[],t+1,2*r+1,2*n),s.push(v||[],t+1,2*r+1,2*n+1)}}},xe.prototype.getTile=function(e,t,r){var n=this.options,a=n.extent,i=n.debug;if(e<0||e>24)return null;var o=1<<e,s=_e(e,t=(t%o+o)%o,r);if(this.tiles[s])return me(this.tiles[s],a);i>1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,c=e,u=t,f=r;!l&&c>0;)c--,u=Math.floor(u/2),f=Math.floor(f/2),l=this.tiles[_e(c,u,f)];return l&&l.source?(i>1&&console.log("found parent tile z%d-%d-%d",c,u,f),i>1&&console.time("drilling down"),this.splitTile(l.source,c,u,f,e,t,r),i>1&&console.timeEnd("drilling down"),this.tiles[s]?me(this.tiles[s],a):null):null};var ke=function(t){function r(e,r,n,a){t.call(this,e,r,n,we),a&&(this.loadGeoJSON=a)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var a=!!(n&&n.request&&n.request.collectResourceTiming)&&new e.RequestPerformance(n.request);this.loadGeoJSON(n,(function(i,o){if(i||!o)return r(i);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));f(o,!0);try{t._geoJSONIndex=n.cluster?new j(function(t){var r=t.superclusterOptions,n=t.clusterProperties;if(!n||!r)return r;for(var a={},i={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c<u.length;c+=1){var f=u[c],p=n[f],h=p[0],d=p[1],m=e.createExpression(d),g=e.createExpression("string"==typeof h?[h,["accumulated"],["get",f]]:h);a[f]=m.value,i[f]=g.value}return r.map=function(e){s.properties=e;for(var t={},r=0,n=l;r<n.length;r+=1){var i=n[r];t[i]=a[i].evaluate(o,s)}return t},r.reduce=function(e,t){s.properties=t;for(var r=0,n=l;r<n.length;r+=1){var a=n[r];o.accumulated=e[a],e[a]=i[a].evaluate(o,s)}},r}(n)).load(o.features):function(e,t){return new xe(e,t)}(o,n.geojsonVtOptions)}catch(i){return r(i)}t.loaded={};var s={};if(a){var l=a.finish();l&&(s.resourceTiming={},s.resourceTiming[n.source]=JSON.parse(JSON.stringify(l)))}r(null,s)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(e,r){var n=this.loaded,a=e.uid;return n&&n[a]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},r.prototype.loadGeoJSON=function(t,r){if(t.request)e.getJSON(t.request,r);else{if("string"!=typeof t.data)return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(t.data))}catch(e){return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()},r.prototype.getClusterExpansionZoom=function(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}},r.prototype.getClusterChildren=function(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}},r.prototype.getClusterLeaves=function(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}},r}(l),De=function(t){var r=this;this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:ke},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(e,t){if(r.workerSourceTypes[e])throw new Error('Worker source with name "'+e+'" already registered.');r.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=function(t){if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}};return De.prototype.setReferrer=function(e,t){this.referrer=t},De.prototype.setImages=function(e,t,r){for(var n in this.availableImages[e]=t,this.workerSources[e]){var a=this.workerSources[e][n];for(var i in a)a[i].availableImages=t}r()},De.prototype.setLayers=function(e,t,r){this.getLayerIndex(e).replace(t),r()},De.prototype.updateLayers=function(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r()},De.prototype.loadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r)},De.prototype.loadDEMTile=function(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r)},De.prototype.reloadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r)},De.prototype.abortTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r)},De.prototype.removeTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r)},De.prototype.removeDEMTile=function(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t)},De.prototype.removeSource=function(e,t,r){if(this.workerSources[e]&&this.workerSources[e][t.type]&&this.workerSources[e][t.type][t.source]){var n=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==n.removeSource?n.removeSource(t,r):r()}},De.prototype.loadWorkerSource=function(e,t,r){try{this.self.importScripts(t.url),r()}catch(e){r(e.toString())}},De.prototype.syncRTLPluginState=function(t,r,n){try{e.plugin.setState(r);var a=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=a){this.self.importScripts(a);var i=e.plugin.isParsed();n(i?void 0:new Error("RTL Text Plugin failed to import scripts from "+a),i)}}catch(e){n(e.toString())}},De.prototype.getAvailableImages=function(e){var t=this.availableImages[e];return t||(t=[]),t},De.prototype.getLayerIndex=function(e){var t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new n),t},De.prototype.getWorkerSource=function(e,t,r){var n=this;if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){var a={send:function(t,r,a){n.actor.send(t,r,a,e)}};this.workerSources[e][t][r]=new this.workerSourceTypes[t](a,this.getLayerIndex(e),this.getAvailableImages(e))}return this.workerSources[e][t][r]},De.prototype.getDEMWorkerSource=function(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new u),this.demWorkerSources[e][t]},De.prototype.enforceCacheSizeLimit=function(t,r){e.enforceCacheSizeLimit(r)},"undefined"!=typeof WorkerGlobalScope&&void 0!==e.window&&e.window instanceof WorkerGlobalScope&&(e.window.worker=new De(e.window)),De})),n(0,(function(e){var t=e.createCommonjsModule((function(e){function t(e){return!r(e)}function r(e){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{t=new Worker(n),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(n),e}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var r=t.getImageData(0,0,1,1);return r&&r.width===e.width}()?function(e){return void 0===n[e]&&(n[e]=function(e){var r=function(e){var r=document.createElement("canvas"),n=Object.create(t.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=e,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(e);if(!r)return!1;var n=r.createShader(r.VERTEX_SHADER);return!(!n||r.isContextLost())&&(r.shaderSource(n,"void main() {}"),r.compileShader(n),!0===r.getShaderParameter(n,r.COMPILE_STATUS))}(e)),n[e]}(e&&e.failIfMajorPerformanceCaveat)?void 0:"insufficient WebGL support":"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support"}e.exports?e.exports=t:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=t,window.mapboxgl.notSupportedReason=r);var n={};t.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(t,r,n){var a=e.window.document.createElement(t);return void 0!==r&&(a.className=r),n&&n.appendChild(a),a},createNS:function(t,r){return e.window.document.createElementNS(t,r)}},n=e.window.document.documentElement.style;function a(e){if(!n)return e[0];for(var t=0;t<e.length;t++)if(e[t]in n)return e[t];return e[0]}var i,o=a(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){n&&o&&(i=n[o],n[o]="none")},r.enableDrag=function(){n&&o&&(n[o]=i)};var s=a(["transform","WebkitTransform"]);r.setTransform=function(e,t){e.style[s]=t};var l=!1;try{var c=Object.defineProperty({},"passive",{get:function(){l=!0}});e.window.addEventListener("test",c,c),e.window.removeEventListener("test",c,c)}catch(e){l=!1}r.addEventListener=function(e,t,r,n){void 0===n&&(n={}),"passive"in n&&l?e.addEventListener(t,r,n):e.addEventListener(t,r,n.capture)},r.removeEventListener=function(e,t,r,n){void 0===n&&(n={}),"passive"in n&&l?e.removeEventListener(t,r,n):e.removeEventListener(t,r,n.capture)};var u=function(t){t.preventDefault(),t.stopPropagation(),e.window.removeEventListener("click",u,!0)};function f(e){var t=e.userImage;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}r.suppressClick=function(){e.window.addEventListener("click",u,!0),e.window.setTimeout((function(){e.window.removeEventListener("click",u,!0)}),0)},r.mousePos=function(t,r){var n=t.getBoundingClientRect();return new e.Point(r.clientX-n.left-t.clientLeft,r.clientY-n.top-t.clientTop)},r.touchPos=function(t,r){for(var n=t.getBoundingClientRect(),a=[],i=0;i<r.length;i++)a.push(new e.Point(r[i].clientX-n.left-t.clientLeft,r[i].clientY-n.top-t.clientTop));return a},r.mouseButton=function(t){return void 0!==e.window.InstallTrigger&&2===t.button&&t.ctrlKey&&e.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:t.button},r.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var p=function(t){function r(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,r=this.requestors;t<r.length;t+=1){var n=r[t],a=n.ids,i=n.callback;this._notify(a,i)}this.requestors=[]}},r.prototype.getImage=function(e){return this.images[e]},r.prototype.addImage=function(e,t){this._validate(e,t)&&(this.images[e]=t)},r.prototype._validate=function(t,r){var n=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new e.ErrorEvent(new Error('Image "'+t+'" has invalid "stretchX" value'))),n=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new e.ErrorEvent(new Error('Image "'+t+'" has invalid "stretchY" value'))),n=!1),this._validateContent(r.content,r)||(this.fire(new e.ErrorEvent(new Error('Image "'+t+'" has invalid "content" value'))),n=!1),n},r.prototype._validateStretch=function(e,t){if(!e)return!0;for(var r=0,n=0,a=e;n<a.length;n+=1){var i=a[n];if(i[0]<r||i[1]<i[0]||t<i[1])return!1;r=i[1]}return!0},r.prototype._validateContent=function(e,t){return!(e&&(4!==e.length||e[0]<0||t.data.width<e[0]||e[1]<0||t.data.height<e[1]||e[2]<0||t.data.width<e[2]||e[3]<0||t.data.height<e[3]||e[2]<e[0]||e[3]<e[1]))},r.prototype.updateImage=function(e,t){var r=this.images[e];t.version=r.version+1,this.images[e]=t,this.updatedImages[e]=!0},r.prototype.removeImage=function(e){var t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(e,t){var r=!0;if(!this.isLoaded())for(var n=0,a=e;n<a.length;n+=1){var i=a[n];this.images[i]||(r=!1)}this.isLoaded()||r?this._notify(e,t):this.requestors.push({ids:e,callback:t})},r.prototype._notify=function(t,r){for(var n={},a=0,i=t;a<i.length;a+=1){var o=i[a];this.images[o]||this.fire(new e.Event("styleimagemissing",{id:o}));var s=this.images[o];s?n[o]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:e.warnOnce('Image "'+o+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}r(null,n)},r.prototype.getPixelSize=function(){var e=this.atlasImage;return{width:e.width,height:e.height}},r.prototype.getPattern=function(t){var r=this.patterns[t],n=this.getImage(t);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{var a={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new e.ImagePosition(a,n);this.patterns[t]={bin:a,position:i}}return this._updatePatternAtlas(),this.patterns[t].position},r.prototype.bind=function(t){var r=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new e.Texture(t,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var t=[];for(var r in this.patterns)t.push(this.patterns[r].bin);var n=e.potpack(t),a=n.w,i=n.h,o=this.atlasImage;for(var s in o.resize({width:a||1,height:i||1}),this.patterns){var l=this.patterns[s].bin,c=l.x+1,u=l.y+1,f=this.images[s].data,p=f.width,h=f.height;e.RGBAImage.copy(f,o,{x:0,y:0},{x:c,y:u},{width:p,height:h}),e.RGBAImage.copy(f,o,{x:0,y:h-1},{x:c,y:u-1},{width:p,height:1}),e.RGBAImage.copy(f,o,{x:0,y:0},{x:c,y:u+h},{width:p,height:1}),e.RGBAImage.copy(f,o,{x:p-1,y:0},{x:c-1,y:u},{width:1,height:h}),e.RGBAImage.copy(f,o,{x:0,y:0},{x:c+p,y:u},{width:1,height:h})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(e){for(var t=0,r=e;t<r.length;t+=1){var n=r[t];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var a=this.images[n];f(a)&&this.updateImage(n,a)}}},r}(e.Evented),h=g,d=g,m=1e20;function g(e,t,r,n,a,i){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=n||.25,this.fontFamily=a||"sans-serif",this.fontWeight=i||"normal",this.radius=r||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function y(e,t,r,n,a,i,o){for(var s=0;s<t;s++){for(var l=0;l<r;l++)n[l]=e[l*t+s];for(v(n,a,i,o,r),l=0;l<r;l++)e[l*t+s]=a[l]}for(l=0;l<r;l++){for(s=0;s<t;s++)n[s]=e[l*t+s];for(v(n,a,i,o,t),s=0;s<t;s++)e[l*t+s]=Math.sqrt(a[s])}}function v(e,t,r,n,a){r[0]=0,n[0]=-m,n[1]=+m;for(var i=1,o=0;i<a;i++){for(var s=(e[i]+i*i-(e[r[o]]+r[o]*r[o]))/(2*i-2*r[o]);s<=n[o];)o--,s=(e[i]+i*i-(e[r[o]]+r[o]*r[o]))/(2*i-2*r[o]);r[++o]=i,n[o]=s,n[o+1]=+m}for(i=0,o=0;i<a;i++){for(;n[o+1]<i;)o++;t[i]=(i-r[o])*(i-r[o])+e[r[o]]}}g.prototype.draw=function(e){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(e,this.buffer,this.middle);for(var t=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var a=t.data[4*n+3]/255;this.gridOuter[n]=1===a?0:0===a?m:Math.pow(Math.max(0,.5-a),2),this.gridInner[n]=1===a?m:0===a?0:Math.pow(Math.max(0,a-.5),2)}for(y(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),y(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var i=this.gridOuter[n]-this.gridInner[n];r[n]=Math.max(0,Math.min(255,Math.round(255-255*(i/this.radius+this.cutoff))))}return r},h.default=d;var b=function(e,t){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={}};b.prototype.setURL=function(e){this.url=e},b.prototype.getGlyphs=function(t,r){var n=this,a=[];for(var i in t)for(var o=0,s=t[i];o<s.length;o+=1){var l=s[o];a.push({stack:i,id:l})}e.asyncAll(a,(function(e,t){var r=e.stack,a=e.id,i=n.entries[r];i||(i=n.entries[r]={glyphs:{},requests:{},ranges:{}});var o=i.glyphs[a];if(void 0===o){if(o=n._tinySDF(i,r,a))return i.glyphs[a]=o,void t(null,{stack:r,id:a,glyph:o});var s=Math.floor(a/256);if(256*s>65535)t(new Error("glyphs > 65535 not supported"));else if(i.ranges[s])t(null,{stack:r,id:a,glyph:o});else{var l=i.requests[s];l||(l=i.requests[s]=[],b.loadGlyphRange(r,s,n.url,n.requestManager,(function(e,t){if(t){for(var r in t)n._doesCharSupportLocalGlyph(+r)||(i.glyphs[+r]=t[+r]);i.ranges[s]=!0}for(var a=0,o=l;a<o.length;a+=1)(0,o[a])(e,t);delete i.requests[s]}))),l.push((function(e,n){e?t(e):n&&t(null,{stack:r,id:a,glyph:n[a]||null})}))}}else t(null,{stack:r,id:a,glyph:o})}),(function(e,t){if(e)r(e);else if(t){for(var n={},a=0,i=t;a<i.length;a+=1){var o=i[a],s=o.stack,l=o.id,c=o.glyph;(n[s]||(n[s]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics}}r(null,n)}}))},b.prototype._doesCharSupportLocalGlyph=function(t){return!!this.localIdeographFontFamily&&(e.isChar["CJK Unified Ideographs"](t)||e.isChar["Hangul Syllables"](t)||e.isChar.Hiragana(t)||e.isChar.Katakana(t))},b.prototype._tinySDF=function(t,r,n){var a=this.localIdeographFontFamily;if(a&&this._doesCharSupportLocalGlyph(n)){var i=t.tinySDF;if(!i){var o="400";/bold/i.test(r)?o="900":/medium/i.test(r)?o="500":/light/i.test(r)&&(o="200"),i=t.tinySDF=new b.TinySDF(24,3,8,.25,a,o)}return{id:n,bitmap:new e.AlphaImage({width:30,height:30},i.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},b.loadGlyphRange=function(t,r,n,a,i){var o=256*r,s=o+255,l=a.transformRequest(a.normalizeGlyphsURL(n).replace("{fontstack}",t).replace("{range}",o+"-"+s),e.ResourceType.Glyphs);e.getArrayBuffer(l,(function(t,r){if(t)i(t);else if(r){for(var n={},a=0,o=e.parseGlyphPBF(r);a<o.length;a+=1){var s=o[a];n[s.id]=s}i(null,n)}}))},b.TinySDF=h;var x=function(){this.specification=e.styleSpec.light.position};x.prototype.possiblyEvaluate=function(t,r){return e.sphericalToCartesian(t.expression.evaluate(r))},x.prototype.interpolate=function(t,r,n){return{x:e.number(t.x,r.x,n),y:e.number(t.y,r.y,n),z:e.number(t.z,r.z,n)}};var _=new e.Properties({anchor:new e.DataConstantProperty(e.styleSpec.light.anchor),position:new x,color:new e.DataConstantProperty(e.styleSpec.light.color),intensity:new e.DataConstantProperty(e.styleSpec.light.intensity)}),w=function(t){function r(r){t.call(this),this._transitionable=new e.Transitionable(_),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(t,r){if(void 0===r&&(r={}),!this._validate(e.validateLight,t,r))for(var n in t){var a=t[n];e.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-"-transition".length),a):this._transitionable.setValue(n,a)}},r.prototype.updateTransitions=function(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(e){this.properties=this._transitioning.possiblyEvaluate(e)},r.prototype._validate=function(t,r,n){return(!n||!1!==n.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.styleSpec})))},r}(e.Evented),k=function(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};k.prototype.getDash=function(e,t){var r=e.join(",")+String(t);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(e,t)),this.dashEntry[r]},k.prototype.getDashRanges=function(e,t,r){var n=[],a=e.length%2==1?-e[e.length-1]*r:0,i=e[0]*r,o=!0;n.push({left:a,right:i,isDash:o,zeroLength:0===e[0]});for(var s=e[0],l=1;l<e.length;l++){o=!o;var c=e[l];a=s*r,i=(s+=c)*r,n.push({left:a,right:i,isDash:o,zeroLength:0===c})}return n},k.prototype.addRoundDash=function(e,t,r){for(var n=t/2,a=-r;a<=r;a++)for(var i=this.nextRow+r+a,o=this.width*i,s=0,l=e[s],c=0;c<this.width;c++){c/l.right>1&&(l=e[++s]);var u=Math.abs(c-l.left),f=Math.abs(c-l.right),p=Math.min(u,f),h=void 0,d=a/r*(n+1);if(l.isDash){var m=n-Math.abs(d);h=Math.sqrt(p*p+m*m)}else h=n-Math.sqrt(p*p+d*d);this.data[o+c]=Math.max(0,Math.min(255,h+128))}},k.prototype.addRegularDash=function(e){for(var t=e.length-1;t>=0;--t){var r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}var a=e[0],i=e[e.length-1];a.isDash===i.isDash&&(a.left=i.left-this.width,i.right=a.right+this.width);for(var o=this.width*this.nextRow,s=0,l=e[s],c=0;c<this.width;c++){c/l.right>1&&(l=e[++s]);var u=Math.abs(c-l.left),f=Math.abs(c-l.right),p=Math.min(u,f),h=l.isDash?p:-p;this.data[o+c]=Math.max(0,Math.min(255,h+128))}},k.prototype.addDash=function(t,r){var n=r?7:0,a=2*n+1;if(this.nextRow+a>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var i=0,o=0;o<t.length;o++)i+=t[o];if(0!==i){var s=this.width/i,l=this.getDashRanges(t,this.width,s);r?this.addRoundDash(l,s,n):this.addRegularDash(l)}var c={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:i};return this.nextRow+=a,this.dirty=!0,c},k.prototype.bind=function(e){var t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))};var D=function t(r,n){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=e.uniqueId();for(var a=this.workerPool.acquire(this.id),i=0;i<a.length;i++){var o=a[i],s=new t.Actor(o,n,this.id);s.name="Worker "+i,this.actors.push(s)}};function T(t,r,n){var a=function(a,i){if(a)return n(a);if(i){var o=e.pick(e.extend(i,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);i.vector_layers&&(o.vectorLayers=i.vector_layers,o.vectorLayerIds=o.vectorLayers.map((function(e){return e.id}))),o.tiles=r.canonicalizeTileset(o,t.url),n(null,o)}};return t.url?e.getJSON(r.transformRequest(r.normalizeSourceURL(t.url),e.ResourceType.Source),a):e.browser.frame((function(){return a(null,t)}))}D.prototype.broadcast=function(t,r,n){n=n||function(){},e.asyncAll(this.actors,(function(e,n){e.send(t,r,n)}),n)},D.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},D.prototype.remove=function(){this.actors.forEach((function(e){e.remove()})),this.actors=[],this.workerPool.release(this.id)},D.Actor=e.Actor;var A=function(t,r,n){this.bounds=e.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=r||0,this.maxzoom=n||24};A.prototype.validateBounds=function(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]},A.prototype.contains=function(t){var r=Math.pow(2,t.z),n=Math.floor(e.mercatorXfromLng(this.bounds.getWest())*r),a=Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*r),i=Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*r),o=Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*r);return t.x>=n&&t.x<i&&t.y>=a&&t.y<o};var S=function(t){function r(r,n,a,i){if(t.call(this),this.id=r,this.dispatcher=a,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.extend(this,e.pick(n,["url","scheme","tileSize","promoteId"])),this._options=e.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(i)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=T(this._options,this.map._requestManager,(function(r,n){t._tileJSONRequest=null,t._loaded=!0,r?t.fire(new e.ErrorEvent(r)):n&&(e.extend(t,n),n.bounds&&(t.tileBounds=new A(n.bounds,t.minzoom,t.maxzoom)),e.postTurnstileEvent(n.tiles,t.map._requestManager._customAccessToken),e.postMapLoadEvent(n.tiles,t.map._getMapId(),t.map._requestManager._skuToken,t.map._requestManager._customAccessToken),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return e.extend({},this._options)},r.prototype.loadTile=function(t,r){var n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),a={request:this.map._requestManager.transformRequest(n,e.ResourceType.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function i(n,a){return delete t.request,t.aborted?r(null):n&&404!==n.status?r(n):(a&&a.resourceTiming&&(t.resourceTiming=a.resourceTiming),this.map._refreshExpiredTiles&&a&&t.setExpiryData(a),t.loadVectorData(a,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}a.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=r:t.request=t.actor.send("reloadTile",a,i.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",a,i.bind(this)))},r.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id},void 0)},r.prototype.unloadTile=function(e){e.unloadVectorData(),e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id},void 0)},r.prototype.hasTransition=function(){return!1},r}(e.Evented),M=function(t){function r(r,n,a,i){t.call(this),this.id=r,this.dispatcher=a,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.extend({type:"raster"},n),e.extend(this,e.pick(n,["url","scheme","tileSize"]))}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=T(this._options,this.map._requestManager,(function(r,n){t._tileJSONRequest=null,t._loaded=!0,r?t.fire(new e.ErrorEvent(r)):n&&(e.extend(t,n),n.bounds&&(t.tileBounds=new A(n.bounds,t.minzoom,t.maxzoom)),e.postTurnstileEvent(n.tiles),e.postMapLoadEvent(n.tiles,t.map._getMapId(),t.map._requestManager._skuToken),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return e.extend({},this._options)},r.prototype.hasTile=function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)},r.prototype.loadTile=function(t,r){var n=this,a=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);t.request=e.getImage(this.map._requestManager.transformRequest(a,e.ResourceType.Tile),(function(a,i){if(delete t.request,t.aborted)t.state="unloaded",r(null);else if(a)t.state="errored",r(a);else if(i){n.map._refreshExpiredTiles&&t.setExpiryData(i),delete i.cacheControl,delete i.expires;var o=n.map.painter.context,s=o.gl;t.texture=n.map.painter.getTileTexture(i.width),t.texture?t.texture.update(i,{useMipmap:!0}):(t.texture=new e.Texture(o,i,s.RGBA,{useMipmap:!0}),t.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),t.state="loaded",e.cacheEntryPossiblyAdded(n.dispatcher),r(null)}}))},r.prototype.abortTile=function(e,t){e.request&&(e.request.cancel(),delete e.request),t()},r.prototype.unloadTile=function(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()},r.prototype.hasTransition=function(){return!1},r}(e.Evented),E=function(t){function r(r,n,a,i){t.call(this,r,n,a,i),this.type="raster-dem",this.maxzoom=22,this._options=e.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(t,r){var n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function a(e,n){e&&(t.state="errored",r(e)),n&&(t.dem=n,t.needsHillshadePrepare=!0,t.state="loaded",r(null))}t.request=e.getImage(this.map._requestManager.transformRequest(n,e.ResourceType.Tile),function(n,i){if(delete t.request,t.aborted)t.state="unloaded",r(null);else if(n)t.state="errored",r(n);else if(i){this.map._refreshExpiredTiles&&t.setExpiryData(i),delete i.cacheControl,delete i.expires;var o=e.window.ImageBitmap&&i instanceof e.window.ImageBitmap&&e.offscreenCanvasSupported()?i:e.browser.getImageData(i,1),s={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:o,encoding:this.encoding};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",s,a.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)},r.prototype._getNeighboringTiles=function(t){var r=t.canonical,n=Math.pow(2,r.z),a=(r.x-1+n)%n,i=0===r.x?t.wrap-1:t.wrap,o=(r.x+1+n)%n,s=r.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.OverscaledTileID(t.overscaledZ,i,r.z,a,r.y).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new e.OverscaledTileID(t.overscaledZ,i,r.z,a,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new e.OverscaledTileID(t.overscaledZ,i,r.z,a,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l},r.prototype.unloadTile=function(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&e.actor.send("removeDEMTile",{uid:e.uid,source:this.id})},r}(M),C=function(t){function r(r,n,a,i){t.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=a.getActor(),this.setEventedParent(i),this._data=n.data,this._options=e.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;var o=e.EXTENT/this.tileSize;this.workerOptions=e.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*o,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*o,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:e.EXTENT,radius:(n.clusterRadius||50)*o,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties},n.workerOptions)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){if(r)t.fire(new e.ErrorEvent(r));else{var n={dataType:"source",sourceDataType:"metadata"};t._collectResourceTiming&&t._resourceTiming&&t._resourceTiming.length>0&&(n.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new e.Event("data",n))}}))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setData=function(t){var r=this;return this._data=t,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)r.fire(new e.ErrorEvent(t));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new e.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this},r.prototype.getClusterChildren=function(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this},r.prototype.getClusterLeaves=function(e,t,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:r},n),this},r.prototype._updateWorkerData=function(t){var r=this;this._loaded=!1;var n=e.extend({},this.workerOptions),a=this._data;"string"==typeof a?(n.request=this.map._requestManager.transformRequest(e.browser.resolveURL(a),e.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(a),this.actor.send(this.type+".loadData",n,(function(e,a){r._removed||a&&a.abandoned||(r._loaded=!0,a&&a.resourceTiming&&a.resourceTiming[r.id]&&(r._resourceTiming=a.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),t(e))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(t,r){var n=this,a=t.actor?"reloadTile":"loadTile";t.actor=this.actor;var i={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(a,i,(function(e,i){return delete t.request,t.unloadVectorData(),t.aborted?r(null):e?r(e):(t.loadVectorData(i,n.map.painter,"reloadTile"===a),r(null))}))},r.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0},r.prototype.unloadTile=function(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(e.Evented),N=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),O=function(t){function r(e,r,n,a){t.call(this),this.id=e,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(a),this.options=r}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(t,r){var n=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),(function(a,i){n._loaded=!0,a?n.fire(new e.ErrorEvent(a)):i&&(n.image=i,t&&(n.coordinates=t),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(e){var t=this;return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,(function(){t.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setCoordinates=function(t){var r=this;this.coordinates=t;var n=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=function(t){for(var r=1/0,n=1/0,a=-1/0,i=-1/0,o=0,s=t;o<s.length;o+=1){var l=s[o];r=Math.min(r,l.x),n=Math.min(n,l.y),a=Math.max(a,l.x),i=Math.max(i,l.y)}var c=a-r,u=i-n,f=Math.max(c,u),p=Math.max(0,Math.floor(-Math.log(f)/Math.LN2)),h=Math.pow(2,p);return new e.CanonicalTileID(p,Math.floor((r+a)/2*h),Math.floor((n+i)/2*h))}(n),this.minzoom=this.maxzoom=this.tileID.z;var a=n.map((function(e){return r.tileID.getTilePoint(e)._round()}));return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(a[2].x,a[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,N.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var a=this.tiles[n];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.loadTile=function(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(e.Evented),I=function(t){function r(e,r,n,a){t.call(this,e,r,n,a),this.roundZoom=!0,this.type="video",this.options=r}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this._loaded=!1;var r=this.options;this.urls=[];for(var n=0,a=r.urls;n<a.length;n+=1){var i=a[n];this.urls.push(this.map._requestManager.transformRequest(i,e.ResourceType.Source).url)}e.getVideo(this.urls,(function(r,n){t._loaded=!0,r?t.fire(new e.ErrorEvent(r)):n&&(t.video=n,t.video.loop=!0,t.video.addEventListener("playing",(function(){t.map.triggerRepaint()})),t.map&&t.video.play(),t._finishLoading())}))},r.prototype.pause=function(){this.video&&this.video.pause()},r.prototype.play=function(){this.video&&this.video.play()},r.prototype.seek=function(t){if(this.video){var r=this.video.seekable;t<r.start(0)||t>r.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=t}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,N.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var a=this.tiles[n];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(O),P=function(t){function r(r,n,a,i){t.call(this,r,n,a,i),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(e){return!Array.isArray(e)||2!==e.length||e.some((function(e){return"number"!=typeof e}))}))||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var a in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,N.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var i=this.tiles[a];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var e=0,t=[this.canvas.width,this.canvas.height];e<t.length;e+=1){var r=t[e];if(isNaN(r)||r<=0)return!0}return!1},r}(O),R={vector:S,raster:M,"raster-dem":E,geojson:C,video:I,image:O,canvas:P};function L(t,r){var n=e.identity([]);return e.translate(n,n,[1,1,0]),e.scale(n,n,[.5*t.width,.5*t.height,1]),e.multiply(n,n,t.calculatePosMatrix(r.toUnwrapped()))}function F(e,t,r,n,a,i){var o=function(e,t,r){if(e)for(var n=0,a=e;n<a.length;n+=1){var i=t[a[n]];if(i&&i.source===r&&"fill-extrusion"===i.type)return!0}else for(var o in t){var s=t[o];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(a&&a.layers,t,e.id),s=i.maxPitchScaleFactor(),l=e.tilesIn(n,s,o);l.sort(B);for(var c=[],u=0,f=l;u<f.length;u+=1){var p=f[u];c.push({wrappedTileID:p.tileID.wrapped().key,queryResults:p.tile.queryRenderedFeatures(t,r,e._state,p.queryGeometry,p.cameraQueryGeometry,p.scale,a,i,s,L(e.transform,p.tileID))})}var h=function(e){for(var t={},r={},n=0,a=e;n<a.length;n+=1){var i=a[n],o=i.queryResults,s=i.wrappedTileID,l=r[s]=r[s]||{};for(var c in o)for(var u=o[c],f=l[c]=l[c]||{},p=t[c]=t[c]||[],h=0,d=u;h<d.length;h+=1){var m=d[h];f[m.featureIndex]||(f[m.featureIndex]=!0,p.push(m))}}return t}(c);for(var d in h)h[d].forEach((function(t){var r=t.feature,n=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return h}function B(e,t){var r=e.tileID,n=t.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}var z=function(e,t){this.max=e,this.onRemove=t,this.reset()};z.prototype.reset=function(){for(var e in this.data)for(var t=0,r=this.data[e];t<r.length;t+=1){var n=r[t];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},z.prototype.add=function(e,t,r){var n=this,a=e.wrapped().key;void 0===this.data[a]&&(this.data[a]=[]);var i={value:t,timeout:void 0};if(void 0!==r&&(i.timeout=setTimeout((function(){n.remove(e,i)}),r)),this.data[a].push(i),this.order.push(a),this.order.length>this.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},z.prototype.has=function(e){return e.wrapped().key in this.data},z.prototype.getAndRemove=function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null},z.prototype._getAndRemoveByKey=function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value},z.prototype.getByKey=function(e){var t=this.data[e];return t?t[0].value:null},z.prototype.get=function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null},z.prototype.remove=function(e,t){if(!this.has(e))return this;var r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),a=this.data[r][n];return this.data[r].splice(n,1),a.timeout&&clearTimeout(a.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(a.value),this.order.splice(this.order.indexOf(r),1),this},z.prototype.setMaxSize=function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this},z.prototype.filter=function(e){var t=[];for(var r in this.data)for(var n=0,a=this.data[r];n<a.length;n+=1){var i=a[n];e(i.value)||t.push(i)}for(var o=0,s=t;o<s.length;o+=1){var l=s[o];this.remove(l.value.tileID,l)}};var j=function(e,t,r){this.context=e;var n=e.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer};j.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},j.prototype.updateData=function(e){var t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)},j.prototype.destroy=function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)};var U={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},$=function(e,t,r,n){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,this.context=e;var a=e.gl;this.buffer=a.createBuffer(),e.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer};$.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},$.prototype.updateData=function(e){var t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)},$.prototype.enableAttributes=function(e,t){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],a=t.attributes[n.name];void 0!==a&&e.enableVertexAttribArray(a)}},$.prototype.setVertexAttribPointers=function(e,t,r){for(var n=0;n<this.attributes.length;n++){var a=this.attributes[n],i=t.attributes[a.name];void 0!==i&&e.vertexAttribPointer(i,a.components,e[U[a.type]],!1,this.itemSize,a.offset+this.itemSize*(r||0))}},$.prototype.destroy=function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)};var V=function(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};V.prototype.get=function(){return this.current},V.prototype.set=function(e){},V.prototype.getDefault=function(){return this.default},V.prototype.setDefault=function(){this.set(this.default)};var q=function(t){function r(){t.apply(this,arguments)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return e.Color.transparent},r.prototype.set=function(e){var t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)},r}(V),W=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 1},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)},t}(V),H=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 0},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)},t}(V),G=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return[!0,!0,!0,!0]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)},t}(V),X=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!0},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)},t}(V),Y=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 255},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)},t}(V),Z=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},t.prototype.set=function(e){var t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)},t}(V),K=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){var e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)},t}(V),J=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}},t}(V),Q=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return[0,1]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)},t}(V),ee=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}},t}(V),te=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.LESS},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)},t}(V),re=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}},t}(V),ne=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){var e=this.gl;return[e.ONE,e.ZERO]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)},t}(V),ae=function(t){function r(){t.apply(this,arguments)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return e.Color.transparent},r.prototype.set=function(e){var t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)},r}(V),ie=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.FUNC_ADD},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)},t}(V),oe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}},t}(V),se=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.BACK},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)},t}(V),le=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.CCW},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)},t}(V),ce=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)},t}(V),ue=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.TEXTURE0},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)},t}(V),fe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){var e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)},t}(V),pe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}},t}(V),he=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},t}(V),de=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}},t}(V),me=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},t}(V),ge=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1},t}(V),ye=function(e){function t(t){e.call(this,t),this.vao=t.extVertexArrayObject}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){this.vao&&(e!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(e),this.current=e,this.dirty=!1)},t}(V),ve=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 4},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}},t}(V),be=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}},t}(V),xe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}},t}(V),_e=function(e){function t(t,r){e.call(this,t),this.context=t,this.parent=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t}(V),we=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setDirty=function(){this.dirty=!0},t.prototype.set=function(e){if(e!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}},t}(_e),ke=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){if(e!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},t}(_e),De=function(e,t,r,n){this.context=e,this.width=t,this.height=r;var a=e.gl,i=this.framebuffer=a.createFramebuffer();this.colorAttachment=new we(e,i),n&&(this.depthAttachment=new ke(e,i))};De.prototype.destroy=function(){var e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){var r=this.depthAttachment.get();r&&e.deleteRenderbuffer(r)}e.deleteFramebuffer(this.framebuffer)};var Te=function(e,t,r){this.func=e,this.mask=t,this.range=r};Te.ReadOnly=!1,Te.ReadWrite=!0,Te.disabled=new Te(519,Te.ReadOnly,[0,1]);var Ae=function(e,t,r,n,a,i){this.test=e,this.ref=t,this.mask=r,this.fail=n,this.depthFail=a,this.pass=i};Ae.disabled=new Ae({func:519,mask:0},0,0,7680,7680,7680);var Se=function(e,t,r){this.blendFunction=e,this.blendColor=t,this.mask=r};Se.disabled=new Se(Se.Replace=[1,0],e.Color.transparent,[!1,!1,!1,!1]),Se.unblended=new Se(Se.Replace,e.Color.transparent,[!0,!0,!0,!0]),Se.alphaBlended=new Se([1,771],e.Color.transparent,[!0,!0,!0,!0]);var Me=function(e,t,r){this.enable=e,this.mode=t,this.frontFace=r};Me.disabled=new Me(!1,1029,2305),Me.backCCW=new Me(!0,1029,2305);var Ee=function(e){this.gl=e,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new q(this),this.clearDepth=new W(this),this.clearStencil=new H(this),this.colorMask=new G(this),this.depthMask=new X(this),this.stencilMask=new Y(this),this.stencilFunc=new Z(this),this.stencilOp=new K(this),this.stencilTest=new J(this),this.depthRange=new Q(this),this.depthTest=new ee(this),this.depthFunc=new te(this),this.blend=new re(this),this.blendFunc=new ne(this),this.blendColor=new ae(this),this.blendEquation=new ie(this),this.cullFace=new oe(this),this.cullFaceSide=new se(this),this.frontFace=new le(this),this.program=new ce(this),this.activeTexture=new ue(this),this.viewport=new fe(this),this.bindFramebuffer=new pe(this),this.bindRenderbuffer=new he(this),this.bindTexture=new de(this),this.bindVertexBuffer=new me(this),this.bindElementBuffer=new ge(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new ye(this),this.pixelStoreUnpack=new ve(this),this.pixelStoreUnpackPremultiplyAlpha=new be(this),this.pixelStoreUnpackFlipY=new xe(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=e.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(e.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query")};Ee.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Ee.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Ee.prototype.createIndexBuffer=function(e,t){return new j(this,e,t)},Ee.prototype.createVertexBuffer=function(e,t,r){return new $(this,e,t,r)},Ee.prototype.createRenderbuffer=function(e,t,r){var n=this.gl,a=n.createRenderbuffer();return this.bindRenderbuffer.set(a),n.renderbufferStorage(n.RENDERBUFFER,e,t,r),this.bindRenderbuffer.set(null),a},Ee.prototype.createFramebuffer=function(e,t,r){return new De(this,e,t,r)},Ee.prototype.clear=function(e){var t=e.color,r=e.depth,n=this.gl,a=0;t&&(a|=n.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(a|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),n.clear(a)},Ee.prototype.setCullFace=function(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))},Ee.prototype.setDepthMode=function(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)},Ee.prototype.setStencilMode=function(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)},Ee.prototype.setColorMode=function(t){e.deepEqual(t.blendFunction,Se.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)},Ee.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Ce=function(t){function r(r,n,a){var i=this;t.call(this),this.id=r,this.dispatcher=a,this.on("data",(function(e){"source"===e.dataType&&"metadata"===e.sourceDataType&&(i._sourceLoaded=!0),i._sourceLoaded&&!i._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(i.reload(),i.transform&&i.update(i.transform))})),this.on("error",(function(){i._sourceErrored=!0})),this._source=function(t,r,n,a){var i=new R[r.type](t,r,n,a);if(i.id!==t)throw new Error("Expected Source id to be "+t+" instead of "+i.id);return e.bindAll(["load","abort","unload","serialize","prepare"],i),i}(r,n,a,this),this._tiles={},this._cache=new z(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new e.SourceFeatureState}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(e)},r.prototype.onRemove=function(e){this._source&&this._source.onRemove&&this._source.onRemove(e)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var e in this._tiles){var t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(e,t){return this._source.loadTile(e,t)},r.prototype._unloadTile=function(e){if(this._source.unloadTile)return this._source.unloadTile(e,(function(){}))},r.prototype._abortTile=function(e){if(this._source.abortTile)return this._source.abortTile(e,(function(){}))},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(e){for(var t in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[t];r.upload(e),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return e.values(this._tiles).map((function(e){return e.tileID})).sort(Ne).map((function(e){return e.key}))},r.prototype.getRenderableIds=function(t){var r=this,n=[];for(var a in this._tiles)this._isIdRenderable(a,t)&&n.push(this._tiles[a]);return t?n.sort((function(t,n){var a=t.tileID,i=n.tileID,o=new e.Point(a.canonical.x,a.canonical.y)._rotate(r.transform.angle),s=new e.Point(i.canonical.x,i.canonical.y)._rotate(r.transform.angle);return a.overscaledZ-i.overscaledZ||s.y-o.y||s.x-o.x})).map((function(e){return e.tileID.key})):n.map((function(e){return e.tileID})).sort(Ne).map((function(e){return e.key}))},r.prototype.hasRenderableParent=function(e){var t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)},r.prototype._isIdRenderable=function(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var e in this._cache.reset(),this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(e,"reloading")},r.prototype._reloadTile=function(e,t){var r=this._tiles[e];r&&("loading"!==r.state&&(r.state=t),this._loadTile(r,this._tileLoaded.bind(this,r,e,t)))},r.prototype._tileLoaded=function(t,r,n,a){if(a)return t.state="errored",void(404!==a.status?this._source.fire(new e.ErrorEvent(a,{tile:t})):this.update(this.transform));t.timeAdded=e.browser.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new e.Event("data",{dataType:"source",tile:t,coord:t.tileID}))},r.prototype._backfillDEM=function(e){for(var t=this.getRenderableIds(),r=0;r<t.length;r++){var n=t[r];if(e.neighboringTiles&&e.neighboringTiles[n]){var a=this.getTileByID(n);i(e,a),i(a,e)}}function i(e,t){e.needsHillshadePrepare=!0;var r=t.tileID.canonical.x-e.tileID.canonical.x,n=t.tileID.canonical.y-e.tileID.canonical.y,a=Math.pow(2,e.tileID.canonical.z),i=t.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+a)?r+=a:1===Math.abs(r-a)&&(r-=a)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[i]&&(e.neighboringTiles[i].backfilled=!0)))}},r.prototype.getTile=function(e){return this.getTileByID(e.key)},r.prototype.getTileByID=function(e){return this._tiles[e]},r.prototype._retainLoadedChildren=function(e,t,r,n){for(var a in this._tiles){var i=this._tiles[a];if(!(n[a]||!i.hasData()||i.tileID.overscaledZ<=t||i.tileID.overscaledZ>r)){for(var o=i.tileID;i&&i.tileID.overscaledZ>t+1;){var s=i.tileID.scaledTo(i.tileID.overscaledZ-1);(i=this._tiles[s.key])&&i.hasData()&&(o=s)}for(var l=o;l.overscaledZ>t;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(e,t){if(e.key in this._loadedParentTiles){var r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(var n=e.overscaledZ-1;n>=t;n--){var a=e.scaledTo(n),i=this._getLoadedTile(a);if(i)return i}},r.prototype._getLoadedTile=function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)},r.prototype.updateCacheSize=function(e){var t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),r=Math.floor(5*t),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(e){var t=(e-(void 0===this._prevLng?e:this._prevLng))/360,r=Math.round(t);if(this._prevLng=e,r){var n={};for(var a in this._tiles){var i=this._tiles[a];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+r),n[i.tileID.key]=i}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(t){var n=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var a;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(a=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(a=a.filter((function(e){return n._source.hasTile(e)})))):a=[];var i=t.coveringZoomLevel(this._source),o=Math.max(i-r.maxOverzooming,this._source.minzoom),s=Math.max(i+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(a,i);if(Oe(this._source.type)){for(var c={},u={},f=0,p=Object.keys(l);f<p.length;f+=1){var h=p[f],d=l[h],m=this._tiles[h];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=e.browser.now())){var g=this.findLoadedParent(d,o);g&&(this._addTile(g.tileID),c[g.tileID.key]=g.tileID),u[h]=d}}for(var y in this._retainLoadedChildren(u,i,s,l),c)l[y]||(this._coveredTiles[y]=!0,l[y]=c[y])}for(var v in l)this._tiles[v].clearFadeHold();for(var b=0,x=e.keysDifference(this._tiles,l);b<x.length;b+=1){var _=x[b],w=this._tiles[_];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(_)}this._updateLoadedParentTileCache()}},r.prototype.releaseSymbolFadeTiles=function(){for(var e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)},r.prototype._updateRetainedTiles=function(e,t){for(var n={},a={},i=Math.max(t-r.maxOverzooming,this._source.minzoom),o=Math.max(t+r.maxUnderzooming,this._source.minzoom),s={},l=0,c=e;l<c.length;l+=1){var u=c[l],f=this._addTile(u);n[u.key]=u,f.hasData()||t<this._source.maxzoom&&(s[u.key]=u)}this._retainLoadedChildren(s,t,o,n);for(var p=0,h=e;p<h.length;p+=1){var d=h[p],m=this._tiles[d.key];if(!m.hasData()){if(t+1>this._source.maxzoom){var g=d.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var b=m.wasRequested(),x=d.overscaledZ-1;x>=i;--x){var _=d.scaledTo(x);if(a[_.key])break;if(a[_.key]=!0,!(m=this.getTile(_))&&b&&(m=this._addTile(_)),m&&(n[_.key]=_,b=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],r=void 0,n=this._tiles[e].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);var a=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(a))break;n=a}for(var i=0,o=t;i<o.length;i+=1){var s=o[i];this._loadedParentTiles[s]=r}}},r.prototype._addTile=function(t){var r=this._tiles[t.key];if(r)return r;(r=this._cache.getAndRemove(t))&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));var n=Boolean(r);return n||(r=new e.Tile(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,t.key,r.state))),r?(r.uses++,this._tiles[t.key]=r,n||this._source.fire(new e.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(e,t){var r=this;e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);var n=t.getExpiryTimeout();n&&(this._timers[e]=setTimeout((function(){r._reloadTile(e,"expired"),delete r._timers[e]}),n))},r.prototype._removeTile=function(e){var t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))},r.prototype.clearTiles=function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()},r.prototype.tilesIn=function(t,r,n){var a=this,i=[],o=this.transform;if(!o)return i;for(var s=n?o.getCameraQueryGeometry(t):t,l=t.map((function(e){return o.pointCoordinate(e)})),c=s.map((function(e){return o.pointCoordinate(e)})),u=this.getIds(),f=1/0,p=1/0,h=-1/0,d=-1/0,m=0,g=c;m<g.length;m+=1){var y=g[m];f=Math.min(f,y.x),p=Math.min(p,y.y),h=Math.max(h,y.x),d=Math.max(d,y.y)}for(var v=function(t){var n=a._tiles[u[t]];if(!n.holdingForFade()){var s=n.tileID,m=Math.pow(2,o.zoom-n.tileID.overscaledZ),g=r*n.queryPadding*e.EXTENT/n.tileSize/m,y=[s.getTilePoint(new e.MercatorCoordinate(f,p)),s.getTilePoint(new e.MercatorCoordinate(h,d))];if(y[0].x-g<e.EXTENT&&y[0].y-g<e.EXTENT&&y[1].x+g>=0&&y[1].y+g>=0){var v=l.map((function(e){return s.getTilePoint(e)})),b=c.map((function(e){return s.getTilePoint(e)}));i.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:b,scale:m})}}},b=0;b<u.length;b++)v(b);return i},r.prototype.getVisibleCoordinates=function(e){for(var t=this,r=this.getRenderableIds(e).map((function(e){return t._tiles[e].tileID})),n=0,a=r;n<a.length;n+=1){var i=a[n];i.posMatrix=this.transform.calculatePosMatrix(i.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Oe(this._source.type))for(var t in this._tiles){var r=this._tiles[t];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=e.browser.now())return!0}return!1},r.prototype.setFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.updateState(e,t,r)},r.prototype.removeFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.removeFeatureState(e,t,r)},r.prototype.getFeatureState=function(e,t){return e=e||"_geojsonTileLayer",this._state.getState(e,t)},r.prototype.setDependencies=function(e,t,r){var n=this._tiles[e];n&&n.setDependencies(t,r)},r.prototype.reloadTilesForDependencies=function(e,t){for(var r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(e,t)}))},r}(e.Evented);function Ne(e,t){var r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Oe(e){return"raster"===e||"image"===e||"video"===e}function Ie(){return new e.window.Worker(Ga.workerUrl)}Ce.maxOverzooming=10,Ce.maxUnderzooming=3;var Pe="mapboxgl_preloaded_worker_pool",Re=function(){this.active={}};Re.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.length<Re.workerCount;)this.workers.push(new Ie);return this.active[e]=!0,this.workers.slice()},Re.prototype.release=function(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((function(e){e.terminate()})),this.workers=null)},Re.prototype.isPreloaded=function(){return!!this.active[Pe]},Re.prototype.numActive=function(){return Object.keys(this.active).length};var Le,Fe=Math.floor(e.browser.hardwareConcurrency/2);function Be(){return Le||(Le=new Re),Le}function ze(t,r){var n={};for(var a in t)"ref"!==a&&(n[a]=t[a]);return e.refProperties.forEach((function(e){e in r&&(n[e]=r[e])})),n}function je(e){e=e.slice();for(var t=Object.create(null),r=0;r<e.length;r++)t[e[r].id]=e[r];for(var n=0;n<e.length;n++)"ref"in e[n]&&(e[n]=ze(e[n],t[e[n].ref]));return e}Re.workerCount=Math.max(Math.min(Fe,6),1);var Ue={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function $e(e,t,r){r.push({command:Ue.addSource,args:[e,t[e]]})}function Ve(e,t,r){t.push({command:Ue.removeSource,args:[e]}),r[e]=!0}function qe(e,t,r,n){Ve(e,r,n),$e(e,t,r)}function We(t,r,n){var a;for(a in t[n])if(t[n].hasOwnProperty(a)&&"data"!==a&&!e.deepEqual(t[n][a],r[n][a]))return!1;for(a in r[n])if(r[n].hasOwnProperty(a)&&"data"!==a&&!e.deepEqual(t[n][a],r[n][a]))return!1;return!0}function He(t,r,n,a,i,o){var s;for(s in r=r||{},t=t||{})t.hasOwnProperty(s)&&(e.deepEqual(t[s],r[s])||n.push({command:o,args:[a,s,r[s],i]}));for(s in r)r.hasOwnProperty(s)&&!t.hasOwnProperty(s)&&(e.deepEqual(t[s],r[s])||n.push({command:o,args:[a,s,r[s],i]}))}function Ge(e){return e.id}function Xe(e,t){return e[t.id]=t,e}var Ye=function(e,t){this.reset(e,t)};Ye.prototype.reset=function(e,t){this.points=e||[],this._distances=[0];for(var r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Ye.prototype.lerp=function(t){if(1===this.points.length)return this.points[0];t=e.clamp(t,0,1);for(var r=1,n=this._distances[r],a=t*this.paddedLength+this.padding;n<a&&r<this._distances.length;)n=this._distances[++r];var i=r-1,o=this._distances[i],s=n-o,l=s>0?(a-o)/s:0;return this.points[i].mult(1-l).add(this.points[r].mult(l))};var Ze=function(e,t,r){var n=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(var i=0;i<this.xCellCount*this.yCellCount;i++)n.push([]),a.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0};function Ke(t,r,n,a,i){var o=e.create();return r?(e.scale(o,o,[1/i,1/i,1]),n||e.rotateZ(o,o,a.angle)):e.multiply(o,a.labelPlaneMatrix,t),o}function Je(t,r,n,a,i){if(r){var o=e.clone(t);return e.scale(o,o,[i,i,1]),n||e.rotateZ(o,o,-a.angle),o}return a.glCoordMatrix}function Qe(t,r){var n=[t.x,t.y,0,1];ut(n,n,r);var a=n[3];return{point:new e.Point(n[0]/a,n[1]/a),signedDistanceFromCamera:a}}function et(e,t){return.5+e/t*.5}function tt(e,t){var r=e[0]/e[3],n=e[1]/e[3];return r>=-t[0]&&r<=t[0]&&n>=-t[1]&&n<=t[1]}function rt(t,r,n,a,i,o,s,l){var c=a?t.textSizeData:t.iconSizeData,u=e.evaluateSizeForZoom(c,n.transform.zoom),f=[256/n.width*2+1,256/n.height*2+1],p=a?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;p.clear();for(var h=t.lineVertexArray,d=a?t.text.placedSymbolArray:t.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,y=0;y<d.length;y++){var v=d.get(y);if(v.hidden||v.writingMode===e.WritingMode.vertical&&!g)ct(v.numGlyphs,p);else{g=!1;var b=[v.anchorX,v.anchorY,0,1];if(e.transformMat4(b,b,r),tt(b,f)){var x=b[3],_=et(n.transform.cameraToCenterDistance,x),w=e.evaluateSizeForFeature(c,u,v),k=s?w/_:w*_,D=new e.Point(v.anchorX,v.anchorY),T=Qe(D,i).point,A={},S=it(v,k,!1,l,r,i,o,t.glyphOffsetArray,h,p,T,D,A,m);g=S.useVertical,(S.notEnoughRoom||g||S.needsFlipping&&it(v,k,!0,l,r,i,o,t.glyphOffsetArray,h,p,T,D,A,m).notEnoughRoom)&&ct(v.numGlyphs,p)}else ct(v.numGlyphs,p)}}a?t.text.dynamicLayoutVertexBuffer.updateData(p):t.icon.dynamicLayoutVertexBuffer.updateData(p)}function nt(e,t,r,n,a,i,o,s,l,c,u){var f=s.glyphStartIndex+s.numGlyphs,p=s.lineStartIndex,h=s.lineStartIndex+s.lineLength,d=t.getoffsetX(s.glyphStartIndex),m=t.getoffsetX(f-1),g=st(e*d,r,n,a,i,o,s.segment,p,h,l,c,u);if(!g)return null;var y=st(e*m,r,n,a,i,o,s.segment,p,h,l,c,u);return y?{first:g,last:y}:null}function at(t,r,n,a){return t===e.WritingMode.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*a?{useVertical:!0}:(t===e.WritingMode.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function it(t,r,n,a,i,o,s,l,c,u,f,p,h,d){var m,g=r/24,y=t.lineOffsetX*g,v=t.lineOffsetY*g;if(t.numGlyphs>1){var b=t.glyphStartIndex+t.numGlyphs,x=t.lineStartIndex,_=t.lineStartIndex+t.lineLength,w=nt(g,l,y,v,n,f,p,t,c,o,h);if(!w)return{notEnoughRoom:!0};var k=Qe(w.first.point,s).point,D=Qe(w.last.point,s).point;if(a&&!n){var T=at(t.writingMode,k,D,d);if(T)return T}m=[w.first];for(var A=t.glyphStartIndex+1;A<b-1;A++)m.push(st(g*l.getoffsetX(A),y,v,n,f,p,t.segment,x,_,c,o,h));m.push(w.last)}else{if(a&&!n){var S=Qe(p,i).point,M=t.lineStartIndex+t.segment+1,E=new e.Point(c.getx(M),c.gety(M)),C=Qe(E,i),N=C.signedDistanceFromCamera>0?C.point:ot(p,E,S,1,i),O=at(t.writingMode,S,N,d);if(O)return O}var I=st(g*l.getoffsetX(t.glyphStartIndex),y,v,n,f,p,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,c,o,h);if(!I)return{notEnoughRoom:!0};m=[I]}for(var P=0,R=m;P<R.length;P+=1){var L=R[P];e.addDynamicAttributes(u,L.point,L.angle)}return{}}function ot(e,t,r,n,a){var i=Qe(e.add(e.sub(t)._unit()),a).point,o=r.sub(i);return r.add(o._mult(n/o.mag()))}function st(t,r,n,a,i,o,s,l,c,u,f,p){var h=a?t-r:t+r,d=h>0?1:-1,m=0;a&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var g=d>0?l+s:l+s+1,y=i,v=i,b=0,x=0,_=Math.abs(h),w=[];b+x<=_;){if((g+=d)<l||g>=c)return null;if(v=y,w.push(y),void 0===(y=p[g])){var k=new e.Point(u.getx(g),u.gety(g)),D=Qe(k,f);if(D.signedDistanceFromCamera>0)y=p[g]=D.point;else{var T=g-d;y=ot(0===b?o:new e.Point(u.getx(T),u.gety(T)),k,v,_-b+1,f)}}b+=x,x=v.dist(y)}var A=(_-b)/x,S=y.sub(v),M=S.mult(A)._add(v);M._add(S._unit()._perp()._mult(n*d));var E=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(M),{point:M,angle:E,path:w}}Ze.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ze.prototype.insert=function(e,t,r,n,a){this._forEachCell(t,r,n,a,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(a)},Ze.prototype.insertCircle=function(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)},Ze.prototype._insertBoxCell=function(e,t,r,n,a,i){this.boxCells[a].push(i)},Ze.prototype._insertCircleCell=function(e,t,r,n,a,i){this.circleCells[a].push(i)},Ze.prototype._query=function(e,t,r,n,a,i){if(r<0||e>this.width||n<0||t>this.height)return!a&&[];var o=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(a)return!0;for(var s=0;s<this.boxKeys.length;s++)o.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var c=this.circles[3*l],u=this.circles[3*l+1],f=this.circles[3*l+2];o.push({key:this.circleKeys[l],x1:c-f,y1:u-f,x2:c+f,y2:u+f})}return i?o.filter(i):o}var p={hitTest:a,seenUids:{box:{},circle:{}}};return this._forEachCell(e,t,r,n,this._queryCell,o,p,i),a?o.length>0:o},Ze.prototype._queryCircle=function(e,t,r,n,a){var i=e-r,o=e+r,s=t-r,l=t+r;if(o<0||i>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(i,s,o,l,this._queryCellCircle,c,u,a),n?c.length>0:c},Ze.prototype.query=function(e,t,r,n,a){return this._query(e,t,r,n,!1,a)},Ze.prototype.hitTest=function(e,t,r,n,a){return this._query(e,t,r,n,!0,a)},Ze.prototype.hitTestCircle=function(e,t,r,n){return this._queryCircle(e,t,r,!0,n)},Ze.prototype._queryCell=function(e,t,r,n,a,i,o,s){var l=o.seenUids,c=this.boxCells[a];if(null!==c)for(var u=this.bboxes,f=0,p=c;f<p.length;f+=1){var h=p[f];if(!l.box[h]){l.box[h]=!0;var d=4*h;if(e<=u[d+2]&&t<=u[d+3]&&r>=u[d+0]&&n>=u[d+1]&&(!s||s(this.boxKeys[h]))){if(o.hitTest)return i.push(!0),!0;i.push({key:this.boxKeys[h],x1:u[d],y1:u[d+1],x2:u[d+2],y2:u[d+3]})}}}var m=this.circleCells[a];if(null!==m)for(var g=this.circles,y=0,v=m;y<v.length;y+=1){var b=v[y];if(!l.circle[b]){l.circle[b]=!0;var x=3*b;if(this._circleAndRectCollide(g[x],g[x+1],g[x+2],e,t,r,n)&&(!s||s(this.circleKeys[b]))){if(o.hitTest)return i.push(!0),!0;var _=g[x],w=g[x+1],k=g[x+2];i.push({key:this.circleKeys[b],x1:_-k,y1:w-k,x2:_+k,y2:w+k})}}}},Ze.prototype._queryCellCircle=function(e,t,r,n,a,i,o,s){var l=o.circle,c=o.seenUids,u=this.boxCells[a];if(null!==u)for(var f=this.bboxes,p=0,h=u;p<h.length;p+=1){var d=h[p];if(!c.box[d]){c.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(l.x,l.y,l.radius,f[m+0],f[m+1],f[m+2],f[m+3])&&(!s||s(this.boxKeys[d])))return i.push(!0),!0}}var g=this.circleCells[a];if(null!==g)for(var y=this.circles,v=0,b=g;v<b.length;v+=1){var x=b[v];if(!c.circle[x]){c.circle[x]=!0;var _=3*x;if(this._circlesCollide(y[_],y[_+1],y[_+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return i.push(!0),!0}}},Ze.prototype._forEachCell=function(e,t,r,n,a,i,o,s){for(var l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(r),f=this._convertToYCellCoord(n),p=l;p<=u;p++)for(var h=c;h<=f;h++){var d=this.xCellCount*h+p;if(a.call(this,e,t,r,n,d,i,o,s))return}},Ze.prototype._convertToXCellCoord=function(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))},Ze.prototype._convertToYCellCoord=function(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))},Ze.prototype._circlesCollide=function(e,t,r,n,a,i){var o=n-e,s=a-t,l=r+i;return l*l>o*o+s*s},Ze.prototype._circleAndRectCollide=function(e,t,r,n,a,i,o){var s=(i-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;var c=(o-a)/2,u=Math.abs(t-(a+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var f=l-s,p=u-c;return f*f+p*p<=r*r};var lt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ct(e,t){for(var r=0;r<e;r++){var n=t.length;t.resize(n+4),t.float32.set(lt,3*n)}}function ut(e,t,r){var n=t[0],a=t[1];return e[0]=r[0]*n+r[4]*a+r[12],e[1]=r[1]*n+r[5]*a+r[13],e[3]=r[3]*n+r[7]*a+r[15],e}var ft=function(e,t,r){void 0===t&&(t=new Ze(e.width+200,e.height+200,25)),void 0===r&&(r=new Ze(e.width+200,e.height+200,25)),this.transform=e,this.grid=t,this.ignoredGrid=r,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200};function pt(t,r,n){return r*(e.EXTENT/(t.tileSize*Math.pow(2,n-t.tileID.overscaledZ)))}ft.prototype.placeCollisionBox=function(e,t,r,n,a){var i=this.projectAndGetPerspectiveRatio(n,e.anchorPointX,e.anchorPointY),o=r*i.perspectiveRatio,s=e.x1*o+i.point.x,l=e.y1*o+i.point.y,c=e.x2*o+i.point.x,u=e.y2*o+i.point.y;return!this.isInsideGrid(s,l,c,u)||!t&&this.grid.hitTest(s,l,c,u,a)?{box:[],offscreen:!1}:{box:[s,l,c,u],offscreen:this.isOffscreen(s,l,c,u)}},ft.prototype.placeCollisionCircles=function(t,r,n,a,i,o,s,l,c,u,f,p,h){var d=[],m=new e.Point(r.anchorX,r.anchorY),g=Qe(m,o),y=et(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),v=(u?i/y:i*y)/e.ONE_EM,b=Qe(m,s).point,x=nt(v,a,r.lineOffsetX*v,r.lineOffsetY*v,!1,b,m,r,n,s,{}),_=!1,w=!1,k=!0;if(x){for(var D=.5*p*y+h,T=new e.Point(-100,-100),A=new e.Point(this.screenRightBoundary,this.screenBottomBoundary),S=new Ye,M=x.first,E=x.last,C=[],N=M.path.length-1;N>=1;N--)C.push(M.path[N]);for(var O=1;O<E.path.length;O++)C.push(E.path[O]);var I=2.5*D;if(l){var P=C.map((function(e){return Qe(e,l)}));C=P.some((function(e){return e.signedDistanceFromCamera<=0}))?[]:P.map((function(e){return e.point}))}var R=[];if(C.length>0){for(var L=C[0].clone(),F=C[0].clone(),B=1;B<C.length;B++)L.x=Math.min(L.x,C[B].x),L.y=Math.min(L.y,C[B].y),F.x=Math.max(F.x,C[B].x),F.y=Math.max(F.y,C[B].y);R=L.x>=T.x&&F.x<=A.x&&L.y>=T.y&&F.y<=A.y?[C]:F.x<T.x||L.x>A.x||F.y<T.y||L.y>A.y?[]:e.clipLine([C],T.x,T.y,A.x,A.y)}for(var z=0,j=R;z<j.length;z+=1){var U=j[z];S.reset(U,.25*D);var $;$=S.length<=.5*D?1:Math.ceil(S.paddedLength/I)+1;for(var V=0;V<$;V++){var q=V/Math.max($-1,1),W=S.lerp(q),H=W.x+100,G=W.y+100;d.push(H,G,D,0);var X=H-D,Y=G-D,Z=H+D,K=G+D;if(k=k&&this.isOffscreen(X,Y,Z,K),w=w||this.isInsideGrid(X,Y,Z,K),!t&&this.grid.hitTestCircle(H,G,D,f)&&(_=!0,!c))return{circles:[],offscreen:!1,collisionDetected:_}}}}return{circles:!c&&_||!w?[]:d,offscreen:k,collisionDetected:_}},ft.prototype.queryRenderedSymbols=function(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],n=1/0,a=1/0,i=-1/0,o=-1/0,s=0,l=t;s<l.length;s+=1){var c=l[s],u=new e.Point(c.x+100,c.y+100);n=Math.min(n,u.x),a=Math.min(a,u.y),i=Math.max(i,u.x),o=Math.max(o,u.y),r.push(u)}for(var f={},p={},h=0,d=this.grid.query(n,a,i,o).concat(this.ignoredGrid.query(n,a,i,o));h<d.length;h+=1){var m=d[h],g=m.key;if(void 0===f[g.bucketInstanceId]&&(f[g.bucketInstanceId]={}),!f[g.bucketInstanceId][g.featureIndex]){var y=[new e.Point(m.x1,m.y1),new e.Point(m.x2,m.y1),new e.Point(m.x2,m.y2),new e.Point(m.x1,m.y2)];e.polygonIntersectsPolygon(r,y)&&(f[g.bucketInstanceId][g.featureIndex]=!0,void 0===p[g.bucketInstanceId]&&(p[g.bucketInstanceId]=[]),p[g.bucketInstanceId].push(g.featureIndex))}}return p},ft.prototype.insertCollisionBox=function(e,t,r,n,a){var i={bucketInstanceId:r,featureIndex:n,collisionGroupID:a};(t?this.ignoredGrid:this.grid).insert(i,e[0],e[1],e[2],e[3])},ft.prototype.insertCollisionCircles=function(e,t,r,n,a){for(var i=t?this.ignoredGrid:this.grid,o={bucketInstanceId:r,featureIndex:n,collisionGroupID:a},s=0;s<e.length;s+=4)i.insertCircle(o,e[s],e[s+1],e[s+2])},ft.prototype.projectAndGetPerspectiveRatio=function(t,r,n){var a=[r,n,0,1];return ut(a,a,t),{point:new e.Point((a[0]/a[3]+1)/2*this.transform.width+100,(-a[1]/a[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/a[3]*.5}},ft.prototype.isOffscreen=function(e,t,r,n){return r<100||e>=this.screenRightBoundary||n<100||t>this.screenBottomBoundary},ft.prototype.isInsideGrid=function(e,t,r,n){return r>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary},ft.prototype.getViewportMatrix=function(){var t=e.identity([]);return e.translate(t,t,[-100,-100,0]),t};var ht=function(e,t,r,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):n&&r?1:0,this.placed=r};ht.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var dt=function(e,t,r,n,a){this.text=new ht(e?e.text:null,t,r,a),this.icon=new ht(e?e.icon:null,t,n,a)};dt.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var mt=function(e,t,r){this.text=e,this.icon=t,this.skipFade=r},gt=function(){this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]},yt=function(e,t,r,n,a){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=a},vt=function(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}};function bt(t,r,n,a,i){var o=e.getAnchorAlignment(t),s=-(o.horizontalAlign-.5)*r,l=-(o.verticalAlign-.5)*n,c=e.evaluateVariableOffset(t,a);return new e.Point(s+c[0]*i,l+c[1]*i)}function xt(t,r,n,a,i,o){var s=t.x1,l=t.x2,c=t.y1,u=t.y2,f=t.anchorPointX,p=t.anchorPointY,h=new e.Point(r,n);return a&&h._rotate(i?o:-o),{x1:s+h.x,y1:c+h.y,x2:l+h.x,y2:u+h.y,anchorPointX:f,anchorPointY:p}}vt.prototype.get=function(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){var t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:function(e){return e.collisionGroupID===t}}}return this.collisionGroups[e]};var _t=function(e,t,r,n){this.transform=e.clone(),this.collisionIndex=new ft(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new vt(r),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}};function wt(e,t,r,n,a){e.emplaceBack(t?1:0,r?1:0,n||0,a||0),e.emplaceBack(t?1:0,r?1:0,n||0,a||0),e.emplaceBack(t?1:0,r?1:0,n||0,a||0),e.emplaceBack(t?1:0,r?1:0,n||0,a||0)}_t.prototype.getBucketParts=function(t,r,n,a){var i=n.getBucket(r),o=n.latestFeatureIndex;if(i&&o&&r.id===i.layerIds[0]){var s=n.collisionBoxArray,l=i.layers[0].layout,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),u=n.tileSize/e.EXTENT,f=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),p="map"===l.get("text-pitch-alignment"),h="map"===l.get("text-rotation-alignment"),d=pt(n,1,this.transform.zoom),m=Ke(f,p,h,this.transform,d),g=null;if(p){var y=Je(f,p,h,this.transform,d);g=e.multiply([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[i.bucketInstanceId]=new yt(i.bucketInstanceId,o,i.sourceLayerIndex,i.index,n.tileID);var v={bucket:i,layout:l,posMatrix:f,textLabelPlaneMatrix:m,labelToScreenMatrix:g,scale:c,textPixelRatio:u,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(i.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(i.sourceID)};if(a)for(var b=0,x=i.sortKeyRanges;b<x.length;b+=1){var _=x[b],w=_.sortKey,k=_.symbolInstanceStart,D=_.symbolInstanceEnd;t.push({sortKey:w,symbolInstanceStart:k,symbolInstanceEnd:D,parameters:v})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:i.symbolInstances.length,parameters:v})}},_t.prototype.attemptAnchorPlacement=function(e,t,r,n,a,i,o,s,l,c,u,f,p,h,d){var m,g=[f.textOffset0,f.textOffset1],y=bt(e,r,n,g,a),v=this.collisionIndex.placeCollisionBox(xt(t,y.x,y.y,i,o,this.transform.angle),u,s,l,c.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(xt(d,y.x,y.y,i,o,this.transform.angle),u,s,l,c.predicate).box.length)return v.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(m=this.prevPlacement.variableOffsets[f.crossTileID].anchor),this.variableOffsets[f.crossTileID]={textOffset:g,width:r,height:n,anchor:e,textBoxScale:a,prevAnchor:m},this.markUsedJustification(p,e,f,h),p.allowVerticalPlacement&&(this.markUsedOrientation(p,h,f),this.placedOrientations[f.crossTileID]=h),{shift:y,placedGlyphBoxes:v}):void 0},_t.prototype.placeLayerBucketPart=function(t,r,n){var a=this,i=t.parameters,o=i.bucket,s=i.layout,l=i.posMatrix,c=i.textLabelPlaneMatrix,u=i.labelToScreenMatrix,f=i.textPixelRatio,p=i.holdingForFade,h=i.collisionBoxArray,d=i.partiallyEvaluatedTextSize,m=i.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),b=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),_="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),k="viewport-y"===s.get("symbol-z-order"),D=v&&(b||!o.hasIconData()||y),T=b&&(v||!o.hasTextData()||g);!o.collisionArrays&&h&&o.deserializeCollisionBoxes(h);var A=function(t,i){if(!r[t.crossTileID])if(p)a.placements[t.crossTileID]=new mt(!1,!1,!1);else{var h,k=!1,A=!1,S=!0,M=null,E={box:null,offscreen:null},C={box:null,offscreen:null},N=null,O=null,I=0,P=0,R=0;i.textFeatureIndex?I=i.textFeatureIndex:t.useRuntimeCollisionCircles&&(I=t.featureIndex),i.verticalTextFeatureIndex&&(P=i.verticalTextFeatureIndex);var L=i.textBox;if(L){var F=function(r){var n=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&a.prevPlacement){var i=a.prevPlacement.placedOrientations[t.crossTileID];i&&(a.placedOrientations[t.crossTileID]=i,n=i,a.markUsedOrientation(o,n,t))}return n},B=function(r,n){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&i.verticalTextBox)for(var a=0,s=o.writingModes;a<s.length&&(s[a]===e.WritingMode.vertical?(E=n(),C=E):E=r(),!(E&&E.box&&E.box.length));a+=1);else E=r()};if(s.get("text-variable-anchor")){var z=s.get("text-variable-anchor");if(a.prevPlacement&&a.prevPlacement.variableOffsets[t.crossTileID]){var j=a.prevPlacement.variableOffsets[t.crossTileID];z.indexOf(j.anchor)>0&&(z=z.filter((function(e){return e!==j.anchor}))).unshift(j.anchor)}var U=function(e,r,n){for(var i=e.x2-e.x1,s=e.y2-e.y1,c=t.textBoxScale,u=w&&!b?r:null,p={box:[],offscreen:!1},h=v?2*z.length:z.length,d=0;d<h;++d){var g=z[d%z.length],y=d>=z.length,D=a.attemptAnchorPlacement(g,e,i,s,c,x,_,f,l,m,y,t,o,n,u);if(D&&(p=D.placedGlyphBoxes)&&p.box&&p.box.length){k=!0,M=D.shift;break}}return p};B((function(){return U(L,i.iconBox,e.WritingMode.horizontal)}),(function(){var r=i.verticalTextBox,n=E&&E.box&&E.box.length;return o.allowVerticalPlacement&&!n&&t.numVerticalGlyphVertices>0&&r?U(r,i.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}})),E&&(k=E.box,S=E.offscreen);var $=F(E&&E.box);if(!k&&a.prevPlacement){var V=a.prevPlacement.variableOffsets[t.crossTileID];V&&(a.variableOffsets[t.crossTileID]=V,a.markUsedJustification(o,V.anchor,t,$))}}else{var q=function(e,r){var n=a.collisionIndex.placeCollisionBox(e,v,f,l,m.predicate);return n&&n.box&&n.box.length&&(a.markUsedOrientation(o,r,t),a.placedOrientations[t.crossTileID]=r),n};B((function(){return q(L,e.WritingMode.horizontal)}),(function(){var r=i.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?q(r,e.WritingMode.vertical):{box:null,offscreen:null}})),F(E&&E.box&&E.box.length)}}if(k=(h=E)&&h.box&&h.box.length>0,S=h&&h.offscreen,t.useRuntimeCollisionCircles){var W=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),H=e.evaluateSizeForFeature(o.textSizeData,d,W),G=s.get("text-padding"),X=t.collisionCircleDiameter;N=a.collisionIndex.placeCollisionCircles(v,W,o.lineVertexArray,o.glyphOffsetArray,H,l,c,u,n,_,m.predicate,X,G),k=v||N.circles.length>0&&!N.collisionDetected,S=S&&N.offscreen}if(i.iconFeatureIndex&&(R=i.iconFeatureIndex),i.iconBox){var Y=function(e){var t=w&&M?xt(e,M.x,M.y,x,_,a.transform.angle):e;return a.collisionIndex.placeCollisionBox(t,b,f,l,m.predicate)};A=C&&C.box&&C.box.length&&i.verticalIconBox?(O=Y(i.verticalIconBox)).box.length>0:(O=Y(i.iconBox)).box.length>0,S=S&&O.offscreen}var Z=g||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,K=y||0===t.numIconVertices;if(Z||K?K?Z||(A=A&&k):k=A&&k:A=k=A&&k,k&&h&&h.box&&(C&&C.box&&P?a.collisionIndex.insertCollisionBox(h.box,s.get("text-ignore-placement"),o.bucketInstanceId,P,m.ID):a.collisionIndex.insertCollisionBox(h.box,s.get("text-ignore-placement"),o.bucketInstanceId,I,m.ID)),A&&O&&a.collisionIndex.insertCollisionBox(O.box,s.get("icon-ignore-placement"),o.bucketInstanceId,R,m.ID),N&&(k&&a.collisionIndex.insertCollisionCircles(N.circles,s.get("text-ignore-placement"),o.bucketInstanceId,I,m.ID),n)){var J=o.bucketInstanceId,Q=a.collisionCircleArrays[J];void 0===Q&&(Q=a.collisionCircleArrays[J]=new gt);for(var ee=0;ee<N.circles.length;ee+=4)Q.circles.push(N.circles[ee+0]),Q.circles.push(N.circles[ee+1]),Q.circles.push(N.circles[ee+2]),Q.circles.push(N.collisionDetected?1:0)}a.placements[t.crossTileID]=new mt(k||D,A||T,S||o.justReloaded),r[t.crossTileID]=!0}};if(k)for(var S=o.getSortedSymbolIndexes(this.transform.angle),M=S.length-1;M>=0;--M){var E=S[M];A(o.symbolInstances.get(E),o.collisionArrays[E])}else for(var C=t.symbolInstanceStart;C<t.symbolInstanceEnd;C++)A(o.symbolInstances.get(C),o.collisionArrays[C]);if(n&&o.bucketInstanceId in this.collisionCircleArrays){var N=this.collisionCircleArrays[o.bucketInstanceId];e.invert(N.invProjMatrix,l),N.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1},_t.prototype.markUsedJustification=function(t,r,n,a){var i,o={left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex};i=a===e.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:o[e.getAnchorJustification(r)];for(var s=0,l=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];s<l.length;s+=1){var c=l[s];c>=0&&(t.text.placedSymbolArray.get(c).crossTileID=i>=0&&c!==i?0:n.crossTileID)}},_t.prototype.markUsedOrientation=function(t,r,n){for(var a=r===e.WritingMode.horizontal||r===e.WritingMode.horizontalOnly?r:0,i=r===e.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o<s.length;o+=1){var l=s[o];t.text.placedSymbolArray.get(l).placedOrientation=a}n.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=i)},_t.prototype.commit=function(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;var t=this.prevPlacement,r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;var n=t?t.symbolFadeChange(e):1,a=t?t.opacities:{},i=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],c=a[s];c?(this.opacities[s]=new dt(c,n,l.text,l.icon),r=r||l.text!==c.text.placed||l.icon!==c.icon.placed):(this.opacities[s]=new dt(null,n,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var u in a){var f=a[u];if(!this.opacities[u]){var p=new dt(f,n,!1,!1);p.isHidden()||(this.opacities[u]=p,r=r||f.text.placed||f.icon.placed)}}for(var h in i)this.variableOffsets[h]||!this.opacities[h]||this.opacities[h].isHidden()||(this.variableOffsets[h]=i[h]);for(var d in o)this.placedOrientations[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.placedOrientations[d]=o[d]);r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)},_t.prototype.updateLayerOpacities=function(e,t){for(var r={},n=0,a=t;n<a.length;n+=1){var i=a[n],o=i.getBucket(e);o&&i.latestFeatureIndex&&e.id===o.layerIds[0]&&this.updateBucketOpacities(o,r,i.collisionBoxArray)}},_t.prototype.updateBucketOpacities=function(t,r,n){var a=this;t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();var i=t.layers[0].layout,o=new dt(null,0,!1,!1,!0),s=i.get("text-allow-overlap"),l=i.get("icon-allow-overlap"),c=i.get("text-variable-anchor"),u="map"===i.get("text-rotation-alignment"),f="map"===i.get("text-pitch-alignment"),p="none"!==i.get("icon-text-fit"),h=new dt(null,0,s&&(l||!t.hasIconData()||i.get("icon-optional")),l&&(s||!t.hasTextData()||i.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(n);for(var d=function(e,t,r){for(var n=0;n<t/4;n++)e.opacityVertexArray.emplaceBack(r)},m=function(n){var i=t.symbolInstances.get(n),s=i.numHorizontalGlyphVertices,l=i.numVerticalGlyphVertices,m=i.crossTileID,g=r[m],y=a.opacities[m];g?y=o:y||(y=h,a.opacities[m]=y),r[m]=!0;var v=s>0||l>0,b=i.numIconVertices>0,x=a.placedOrientations[i.crossTileID],_=x===e.WritingMode.vertical,w=x===e.WritingMode.horizontal||x===e.WritingMode.horizontalOnly;if(v){var k=Ct(y.text),D=_?Nt:k;d(t.text,s,D);var T=w?Nt:k;d(t.text,l,T);var A=y.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=A||_?1:0)})),i.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=A||w?1:0);var S=a.variableOffsets[i.crossTileID];S&&a.markUsedJustification(t,S.anchor,i,x);var M=a.placedOrientations[i.crossTileID];M&&(a.markUsedJustification(t,"left",i,M),a.markUsedOrientation(t,M,i))}if(b){var E=Ct(y.icon),C=!(p&&i.verticalPlacedIconSymbolIndex&&_);if(i.placedIconSymbolIndex>=0){var N=C?E:Nt;d(t.icon,i.numIconVertices,N),t.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(i.verticalPlacedIconSymbolIndex>=0){var O=C?Nt:E;d(t.icon,i.numVerticalIconVertices,O),t.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var I=t.collisionArrays[n];if(I){var P=new e.Point(0,0);if(I.textBox||I.verticalTextBox){var R=!0;if(c){var L=a.variableOffsets[m];L?(P=bt(L.anchor,L.width,L.height,L.textOffset,L.textBoxScale),u&&P._rotate(f?a.transform.angle:-a.transform.angle)):R=!1}I.textBox&&wt(t.textCollisionBox.collisionVertexArray,y.text.placed,!R||_,P.x,P.y),I.verticalTextBox&&wt(t.textCollisionBox.collisionVertexArray,y.text.placed,!R||w,P.x,P.y)}var F=Boolean(!w&&I.verticalIconBox);I.iconBox&&wt(t.iconCollisionBox.collisionVertexArray,y.icon.placed,F,p?P.x:0,p?P.y:0),I.verticalIconBox&&wt(t.iconCollisionBox.collisionVertexArray,y.icon.placed,!F,p?P.x:0,p?P.y:0)}}},g=0;g<t.symbolInstances.length;g++)m(g);if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){var y=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=y.invProjMatrix,t.placementViewportMatrix=y.viewportMatrix,t.collisionCircleArray=y.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}},_t.prototype.symbolFadeChange=function(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},_t.prototype.zoomAdjustment=function(e){return Math.max(0,(this.transform.zoom-e)/1.5)},_t.prototype.hasTransitions=function(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration},_t.prototype.stillRecent=function(e,t){var r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e},_t.prototype.setStale=function(){this.stale=!0};var kt=Math.pow(2,25),Dt=Math.pow(2,24),Tt=Math.pow(2,17),At=Math.pow(2,16),St=Math.pow(2,9),Mt=Math.pow(2,8),Et=Math.pow(2,1);function Ct(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*kt+t*Dt+r*Tt+t*At+r*St+t*Mt+r*Et+t}var Nt=0,Ot=function(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Ot.prototype.continuePlacement=function(e,t,r,n,a){for(var i=this._bucketParts;this._currentTileIndex<e.length;){var o=e[this._currentTileIndex];if(t.getBucketParts(i,n,o,this._sortAcrossTiles),this._currentTileIndex++,a())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,i.sort((function(e,t){return e.sortKey-t.sortKey})));this._currentPartIndex<i.length;){var s=i[this._currentPartIndex];if(t.placeLayerBucketPart(s,this._seenCrossTileIDs,r),this._currentPartIndex++,a())return!0}return!1};var It=function(e,t,r,n,a,i,o){this.placement=new _t(e,a,i,o),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1};It.prototype.isDone=function(){return this._done},It.prototype.continuePlacement=function(t,r,n){for(var a=this,i=e.browser.now(),o=function(){var t=e.browser.now()-i;return!a._forceFullPlacement&&t>2};this._currentPlacementIndex>=0;){var s=r[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Ot(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},It.prototype.commit=function(e){return this.placement.commit(e),this.placement};var Pt=512/e.EXTENT/2,Rt=function(e,t,r){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;n<t.length;n++){var a=t.get(n),i=a.key;this.indexedSymbolInstances[i]||(this.indexedSymbolInstances[i]=[]),this.indexedSymbolInstances[i].push({crossTileID:a.crossTileID,coord:this.getScaledCoordinates(a,e)})}};Rt.prototype.getScaledCoordinates=function(t,r){var n=r.canonical.z-this.tileID.canonical.z,a=Pt/Math.pow(2,n);return{x:Math.floor((r.canonical.x*e.EXTENT+t.anchorX)*a),y:Math.floor((r.canonical.y*e.EXTENT+t.anchorY)*a)}},Rt.prototype.findMatches=function(e,t,r){for(var n=this.tileID.canonical.z<t.canonical.z?1:Math.pow(2,this.tileID.canonical.z-t.canonical.z),a=0;a<e.length;a++){var i=e.get(a);if(!i.crossTileID){var o=this.indexedSymbolInstances[i.key];if(o)for(var s=this.getScaledCoordinates(i,t),l=0,c=o;l<c.length;l+=1){var u=c[l];if(Math.abs(u.coord.x-s.x)<=n&&Math.abs(u.coord.y-s.y)<=n&&!r[u.crossTileID]){r[u.crossTileID]=!0,i.crossTileID=u.crossTileID;break}}}}};var Lt=function(){this.maxCrossTileID=0};Lt.prototype.generate=function(){return++this.maxCrossTileID};var Ft=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Ft.prototype.handleWrapJump=function(e){var t=Math.round((e-this.lng)/360);if(0!==t)for(var r in this.indexes){var n=this.indexes[r],a={};for(var i in n){var o=n[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+t),a[o.tileID.key]=o}this.indexes[r]=a}this.lng=e},Ft.prototype.addBucket=function(e,t,r){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(var n=0;n<t.symbolInstances.length;n++)t.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});var a=this.usedCrossTileIDs[e.overscaledZ];for(var i in this.indexes){var o=this.indexes[i];if(Number(i)>e.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,a)}else{var c=o[e.scaledTo(Number(i)).key];c&&c.findMatches(t.symbolInstances,e,a)}}for(var u=0;u<t.symbolInstances.length;u++){var f=t.symbolInstances.get(u);f.crossTileID||(f.crossTileID=r.generate(),a[f.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Rt(e,t.symbolInstances,t.bucketInstanceId),!0},Ft.prototype.removeBucketCrossTileIDs=function(e,t){for(var r in t.indexedSymbolInstances)for(var n=0,a=t.indexedSymbolInstances[r];n<a.length;n+=1){var i=a[n];delete this.usedCrossTileIDs[e][i.crossTileID]}},Ft.prototype.removeStaleBuckets=function(e){var t=!1;for(var r in this.indexes){var n=this.indexes[r];for(var a in n)e[n[a].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[a]),delete n[a],t=!0)}return t};var Bt=function(){this.layerIndexes={},this.crossTileIDs=new Lt,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Bt.prototype.addLayer=function(e,t,r){var n=this.layerIndexes[e.id];void 0===n&&(n=this.layerIndexes[e.id]=new Ft);var a=!1,i={};n.handleWrapJump(r);for(var o=0,s=t;o<s.length;o+=1){var l=s[o],c=l.getBucket(e);c&&e.id===c.layerIds[0]&&(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,c,this.crossTileIDs)&&(a=!0),i[c.bucketInstanceId]=!0)}return n.removeStaleBuckets(i)&&(a=!0),a},Bt.prototype.pruneUnusedLayers=function(e){var t={};for(var r in e.forEach((function(e){t[e]=!0})),this.layerIndexes)t[r]||delete this.layerIndexes[r]};var zt=function(t,r){return e.emitValidationErrors(t,r&&r.filter((function(e){return"source.canvas"!==e.identifier})))},jt=e.pick(Ue,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ut=e.pick(Ue,["setCenter","setZoom","setBearing","setPitch"]),$t=function(){var t={},r=e.styleSpec.$version;for(var n in e.styleSpec.$root){var a=e.styleSpec.$root[n];if(a.required){var i;null!=(i="version"===n?r:"array"===a.type?[]:{})&&(t[n]=i)}}return t}(),Vt=function(t){function r(n,a){var i=this;void 0===a&&(a={}),t.call(this),this.map=n,this.dispatcher=new D(Be(),this),this.imageManager=new p,this.imageManager.setEventedParent(this),this.glyphManager=new b(n._requestManager,a.localIdeographFontFamily),this.lineAtlas=new k(256,512),this.crossTileSymbolIndex=new Bt,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",e.getReferrer());var o=this;this._rtlTextPluginCallback=r.registerForPluginStateChange((function(t){var r={pluginStatus:t.pluginStatus,pluginURL:t.pluginURL};o.dispatcher.broadcast("syncRTLPluginState",r,(function(t,r){if(e.triggerPluginCompletionEvent(t),r&&r.every((function(e){return e})))for(var n in o.sourceCaches)o.sourceCaches[n].reload()}))})),this.on("data",(function(e){if("source"===e.dataType&&"metadata"===e.sourceDataType){var t=i.sourceCaches[e.sourceId];if(t){var r=t.getSource();if(r&&r.vectorLayerIds)for(var n in i._layers){var a=i._layers[n];a.source===r.id&&i._validateLayer(a)}}}}))}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadURL=function(t,r){var n=this;void 0===r&&(r={}),this.fire(new e.Event("dataloading",{dataType:"style"}));var a="boolean"==typeof r.validate?r.validate:!e.isMapboxURL(t);t=this.map._requestManager.normalizeStyleURL(t,r.accessToken);var i=this.map._requestManager.transformRequest(t,e.ResourceType.Style);this._request=e.getJSON(i,(function(t,r){n._request=null,t?n.fire(new e.ErrorEvent(t)):r&&n._load(r,a)}))},r.prototype.loadJSON=function(t,r){var n=this;void 0===r&&(r={}),this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.browser.frame((function(){n._request=null,n._load(t,!1!==r.validate)}))},r.prototype.loadEmpty=function(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load($t,!1)},r.prototype._load=function(t,r){if(!r||!zt(this,e.validateStyle(t))){for(var n in this._loaded=!0,this.stylesheet=t,t.sources)this.addSource(n,t.sources[n],{validate:!1});t.sprite?this._loadSprite(t.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);var a=je(this.stylesheet.layers);this._order=a.map((function(e){return e.id})),this._layers={},this._serializedLayers={};for(var i=0,o=a;i<o.length;i+=1){var s=o[i];(s=e.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new w(this.stylesheet.light),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}},r.prototype._loadSprite=function(t){var r=this;this._spriteRequest=function(t,r,n){var a,i,o,s=e.browser.devicePixelRatio>1?"@2x":"",l=e.getJSON(r.transformRequest(r.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),(function(e,t){l=null,o||(o=e,a=t,u())})),c=e.getImage(r.transformRequest(r.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),(function(e,t){c=null,o||(o=e,i=t,u())}));function u(){if(o)n(o);else if(a&&i){var t=e.browser.getImageData(i),r={};for(var s in a){var l=a[s],c=l.width,u=l.height,f=l.x,p=l.y,h=l.sdf,d=l.pixelRatio,m=l.stretchX,g=l.stretchY,y=l.content,v=new e.RGBAImage({width:c,height:u});e.RGBAImage.copy(t,v,{x:f,y:p},{x:0,y:0},{width:c,height:u}),r[s]={data:v,pixelRatio:d,sdf:h,stretchX:m,stretchY:g,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,(function(t,n){if(r._spriteRequest=null,t)r.fire(new e.ErrorEvent(t));else if(n)for(var a in n)r.imageManager.addImage(a,n[a]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new e.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(t){var r=this.sourceCaches[t.source];if(r){var n=t.sourceLayer;if(n){var a=r.getSource();("geojson"===a.type||a.vectorLayerIds&&-1===a.vectorLayerIds.indexOf(n))&&this.fire(new e.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+a.id+'" as specified by style layer "'+t.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(e){for(var t=[],r=0,n=e;r<n.length;r+=1){var a=n[r],i=this._layers[a];"custom"!==i.type&&t.push(i.serialize())}return t},r.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(var t in this._layers)if(this._layers[t].hasTransition())return!0;return!1},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(t){if(this._loaded){var r=this._changed;if(this._changed){var n=Object.keys(this._updatedLayers),a=Object.keys(this._removedLayers);for(var i in(n.length||a.length)&&this._updateWorkerLayers(n,a),this._updatedSources){var o=this._updatedSources[i];"reload"===o?this._reloadSource(i):"clear"===o&&this._clearSource(i)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}for(var l in this.sourceCaches)this.sourceCaches[l].used=!1;for(var c=0,u=this._order;c<u.length;c+=1){var f=u[c],p=this._layers[f];p.recalculate(t,this._availableImages),!p.isHidden(t.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}this.light.recalculate(t),this.z=t.zoom,r&&this.fire(new e.Event("data",{dataType:"style"}))}},r.prototype._updateTilesForChangedImages=function(){var e=Object.keys(this._changedImages);if(e.length){for(var t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}},r.prototype._updateWorkerLayers=function(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(e),removedIds:t})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},r.prototype.setState=function(t){var r=this;if(this._checkLoaded(),zt(this,e.validateStyle(t)))return!1;(t=e.clone$1(t)).layers=je(t.layers);var n=function(t,r){if(!t)return[{command:Ue.setStyle,args:[r]}];var n=[];try{if(!e.deepEqual(t.version,r.version))return[{command:Ue.setStyle,args:[r]}];e.deepEqual(t.center,r.center)||n.push({command:Ue.setCenter,args:[r.center]}),e.deepEqual(t.zoom,r.zoom)||n.push({command:Ue.setZoom,args:[r.zoom]}),e.deepEqual(t.bearing,r.bearing)||n.push({command:Ue.setBearing,args:[r.bearing]}),e.deepEqual(t.pitch,r.pitch)||n.push({command:Ue.setPitch,args:[r.pitch]}),e.deepEqual(t.sprite,r.sprite)||n.push({command:Ue.setSprite,args:[r.sprite]}),e.deepEqual(t.glyphs,r.glyphs)||n.push({command:Ue.setGlyphs,args:[r.glyphs]}),e.deepEqual(t.transition,r.transition)||n.push({command:Ue.setTransition,args:[r.transition]}),e.deepEqual(t.light,r.light)||n.push({command:Ue.setLight,args:[r.light]});var a={},i=[];!function(t,r,n,a){var i;for(i in r=r||{},t=t||{})t.hasOwnProperty(i)&&(r.hasOwnProperty(i)||Ve(i,n,a));for(i in r)r.hasOwnProperty(i)&&(t.hasOwnProperty(i)?e.deepEqual(t[i],r[i])||("geojson"===t[i].type&&"geojson"===r[i].type&&We(t,r,i)?n.push({command:Ue.setGeoJSONSourceData,args:[i,r[i].data]}):qe(i,r,n,a)):$e(i,r,n))}(t.sources,r.sources,i,a);var o=[];t.layers&&t.layers.forEach((function(e){a[e.source]?n.push({command:Ue.removeLayer,args:[e.id]}):o.push(e)})),n=n.concat(i),function(t,r,n){r=r||[];var a,i,o,s,l,c,u,f=(t=t||[]).map(Ge),p=r.map(Ge),h=t.reduce(Xe,{}),d=r.reduce(Xe,{}),m=f.slice(),g=Object.create(null);for(a=0,i=0;a<f.length;a++)o=f[a],d.hasOwnProperty(o)?i++:(n.push({command:Ue.removeLayer,args:[o]}),m.splice(m.indexOf(o,i),1));for(a=0,i=0;a<p.length;a++)o=p[p.length-1-a],m[m.length-1-a]!==o&&(h.hasOwnProperty(o)?(n.push({command:Ue.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-i),1)):i++,c=m[m.length-a],n.push({command:Ue.addLayer,args:[d[o],c]}),m.splice(m.length-a,0,o),g[o]=!0);for(a=0;a<p.length;a++)if(s=h[o=p[a]],l=d[o],!g[o]&&!e.deepEqual(s,l))if(e.deepEqual(s.source,l.source)&&e.deepEqual(s["source-layer"],l["source-layer"])&&e.deepEqual(s.type,l.type)){for(u in He(s.layout,l.layout,n,o,null,Ue.setLayoutProperty),He(s.paint,l.paint,n,o,null,Ue.setPaintProperty),e.deepEqual(s.filter,l.filter)||n.push({command:Ue.setFilter,args:[o,l.filter]}),e.deepEqual(s.minzoom,l.minzoom)&&e.deepEqual(s.maxzoom,l.maxzoom)||n.push({command:Ue.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?He(s[u],l[u],n,o,u.slice(6),Ue.setPaintProperty):e.deepEqual(s[u],l[u])||n.push({command:Ue.setLayerProperty,args:[o,u,l[u]]}));for(u in l)l.hasOwnProperty(u)&&!s.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?He(s[u],l[u],n,o,u.slice(6),Ue.setPaintProperty):e.deepEqual(s[u],l[u])||n.push({command:Ue.setLayerProperty,args:[o,u,l[u]]}))}else n.push({command:Ue.removeLayer,args:[o]}),c=m[m.lastIndexOf(o)+1],n.push({command:Ue.addLayer,args:[l,c]})}(o,r.layers,n)}catch(e){console.warn("Unable to compute style diff:",e),n=[{command:Ue.setStyle,args:[r]}]}return n}(this.serialize(),t).filter((function(e){return!(e.command in Ut)}));if(0===n.length)return!1;var a=n.filter((function(e){return!(e.command in jt)}));if(a.length>0)throw new Error("Unimplemented: "+a.map((function(e){return e.command})).join(", ")+".");return n.forEach((function(e){"setTransition"!==e.command&&r[e.command].apply(r,e.args)})),this.stylesheet=t,!0},r.prototype.addImage=function(t,r){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(t,r),this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.fire(new e.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(e,t){this.imageManager.updateImage(e,t)},r.prototype.getImage=function(e){return this.imageManager.getImage(e)},r.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.fire(new e.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(t,r,n){var a=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(e.validateStyle.source,"sources."+t,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var i=this.sourceCaches[t]=new Ce(t,r,this.dispatcher);i.style=this,i.setEventedParent(this,(function(){return{isSourceLoaded:a.loaded(),source:i.serialize(),sourceId:t}})),i.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'+t+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},r.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},r.prototype.addLayer=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var a=t.id;if(this.getLayer(a))this.fire(new e.ErrorEvent(new Error('Layer with id "'+a+'" already exists on this map')));else{var i;if("custom"===t.type){if(zt(this,e.validateCustomStyleLayer(t)))return;i=e.createStyleLayer(t)}else{if("object"==typeof t.source&&(this.addSource(a,t.source),t=e.clone$1(t),t=e.extend(t,{source:a})),this._validate(e.validateStyle.layer,"layers."+a,t,{arrayIndex:-1},n))return;i=e.createStyleLayer(t),this._validateLayer(i),i.setEventedParent(this,{layer:{id:a}}),this._serializedLayers[i.id]=i.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,a),this._layerOrderChanged=!0,this._layers[a]=i,this._removedLayers[a]&&i.source&&"custom"!==i.type){var s=this._removedLayers[a];delete this._removedLayers[a],s.type!==i.type?this._updatedSources[i.source]="clear":(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause())}this._updateLayer(i),i.onAdd&&i.onAdd(this.map)}}},r.prototype.moveLayer=function(t,r){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==r){var n=this._order.indexOf(t);this._order.splice(n,1);var a=r?this._order.indexOf(r):this._order.length;r&&-1===a?this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(a,0,t),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(t){this._checkLoaded();var r=this._layers[t];if(r){r.setEventedParent(null);var n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(e){return this._layers[e]},r.prototype.hasLayer=function(e){return e in this._layers},r.prototype.setLayerZoomRange=function(t,r,n){this._checkLoaded();var a=this.getLayer(t);a?a.minzoom===r&&a.maxzoom===n||(null!=r&&(a.minzoom=r),null!=n&&(a.maxzoom=n),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var a=this.getLayer(t);if(a){if(!e.deepEqual(a.filter,r))return null==r?(a.filter=void 0,void this._updateLayer(a)):void(this._validate(e.validateStyle.filter,"layers."+a.id+".filter",r,null,n)||(a.filter=e.clone$1(r),this._updateLayer(a)))}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(t){return e.clone$1(this.getLayer(t).filter)},r.prototype.setLayoutProperty=function(t,r,n,a){void 0===a&&(a={}),this._checkLoaded();var i=this.getLayer(t);i?e.deepEqual(i.getLayoutProperty(r),n)||(i.setLayoutProperty(r,n,a),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(t,r){var n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(t,r,n,a){void 0===a&&(a={}),this._checkLoaded();var i=this.getLayer(t);i?e.deepEqual(i.getPaintProperty(r),n)||(i.setPaintProperty(r,n,a)&&this._updateLayer(i),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},r.prototype.setFeatureState=function(t,r){this._checkLoaded();var n=t.source,a=t.sourceLayer,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type;"geojson"===o&&a?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||a?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),i.setFeatureState(a,t.id,r)):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(t,r){this._checkLoaded();var n=t.source,a=this.sourceCaches[n];if(void 0!==a){var i=a.getSource().type,o="vector"===i?t.sourceLayer:void 0;"vector"!==i||o?r&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):a.removeFeatureState(o,t.id,r):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(t){this._checkLoaded();var r=t.source,n=t.sourceLayer,a=this.sourceCaches[r];if(void 0!==a){if("vector"!==a.getSource().type||n)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),a.getFeatureState(n,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,(function(e){return e.serialize()})),layers:this._serializeLayers(this._order)},(function(e){return void 0!==e}))},r.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(e){for(var t=this,r=function(e){return"fill-extrusion"===t._layers[e].type},n={},a=[],i=this._order.length-1;i>=0;i--){var o=this._order[i];if(r(o)){n[o]=i;for(var s=0,l=e;s<l.length;s+=1){var c=l[s][o];if(c)for(var u=0,f=c;u<f.length;u+=1){var p=f[u];a.push(p)}}}}a.sort((function(e,t){return t.intersectionZ-e.intersectionZ}));for(var h=[],d=this._order.length-1;d>=0;d--){var m=this._order[d];if(r(m))for(var g=a.length-1;g>=0;g--){var y=a[g].feature;if(n[y.layer.id]<d)break;h.push(y),a.pop()}else for(var v=0,b=e;v<b.length;v+=1){var x=b[v][m];if(x)for(var _=0,w=x;_<w.length;_+=1){var k=w[_];h.push(k.feature)}}}return h},r.prototype.queryRenderedFeatures=function(t,r,n){r&&r.filter&&this._validate(e.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var a={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new e.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var i=0,o=r.layers;i<o.length;i+=1){var s=o[i],l=this._layers[s];if(!l)return this.fire(new e.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];a[l.source]=!0}}var c=[];for(var u in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!a[u]||c.push(F(this.sourceCaches[u],this._layers,this._serializedLayers,t,r,n));return this.placement&&c.push(function(e,t,r,n,a,i,o){for(var s={},l=i.queryRenderedSymbols(n),c=[],u=0,f=Object.keys(l).map(Number);u<f.length;u+=1){var p=f[u];c.push(o[p])}c.sort(B);for(var h=function(){var r=m[d],n=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],t,r.bucketIndex,r.sourceLayerIndex,a.filter,a.layers,a.availableImages,e);for(var i in n){var o=s[i]=s[i]||[],c=n[i];c.sort((function(e,t){var n=r.featureSortOrder;if(n){var a=n.indexOf(e.featureIndex);return n.indexOf(t.featureIndex)-a}return t.featureIndex-e.featureIndex}));for(var u=0,f=c;u<f.length;u+=1){var p=f[u];o.push(p)}}},d=0,m=c;d<m.length;d+=1)h();var g=function(t){s[t].forEach((function(n){var a=n.feature,i=e[t],o=r[i.source].getFeatureState(a.layer["source-layer"],a.id);a.source=a.layer.source,a.layer["source-layer"]&&(a.sourceLayer=a.layer["source-layer"]),a.state=o}))};for(var y in s)g(y);return s}(this._layers,this._serializedLayers,this.sourceCaches,t,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},r.prototype.querySourceFeatures=function(t,r){r&&r.filter&&this._validate(e.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var n=this.sourceCaches[t];return n?function(e,t){for(var r=e.getRenderableIds().map((function(t){return e.getTileByID(t)})),n=[],a={},i=0;i<r.length;i++){var o=r[i],s=o.tileID.canonical.key;a[s]||(a[s]=!0,o.querySourceFeatures(n,t))}return n}(n,r):[]},r.prototype.addSourceType=function(e,t,n){return r.getSourceType(e)?n(new Error('A source type called "'+e+'" already exists.')):(r.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},n):n(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(t,r){void 0===r&&(r={}),this._checkLoaded();var n=this.light.getLight(),a=!1;for(var i in t)if(!e.deepEqual(t[i],n[i])){a=!0;break}if(a){var o={now:e.browser.now(),transition:e.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,r),this.light.updateTransitions(o)}},r.prototype._validate=function(t,r,n,a,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&zt(this,t.call(e.validateStyle,e.extend({key:r,style:this.serialize(),value:n,styleSpec:e.styleSpec},a)))},r.prototype._remove=function(){for(var t in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[t].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},r.prototype._clearSource=function(e){this.sourceCaches[e].clearTiles()},r.prototype._reloadSource=function(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()},r.prototype._updateSources=function(e){for(var t in this.sourceCaches)this.sourceCaches[t].update(e)},r.prototype._generateCollisionBoxes=function(){for(var e in this.sourceCaches)this._reloadSource(e)},r.prototype._updatePlacement=function(t,r,n,a,i){void 0===i&&(i=!1);for(var o=!1,s=!1,l={},c=0,u=this._order;c<u.length;c+=1){var f=u[c],p=this._layers[f];if("symbol"===p.type){if(!l[p.source]){var h=this.sourceCaches[p.source];l[p.source]=h.getRenderableIds(!0).map((function(e){return h.getTileByID(e)})).sort((function(e,t){return t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)}))}var d=this.crossTileSymbolIndex.addLayer(p,l[p.source],t.center.lng);o=o||d}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||0===n)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.browser.now(),t.zoom))&&(this.pauseablePlacement=new It(t,this._order,i,r,n,a,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.browser.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(var m=0,g=this._order;m<g.length;m+=1){var y=g[m],v=this._layers[y];"symbol"===v.type&&this.placement.updateLayerOpacities(v,l[v.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()},r.prototype.getImages=function(e,t,r){this.imageManager.getImages(t.icons,r),this._updateTilesForChangedImages();var n=this.sourceCaches[t.source];n&&n.setDependencies(t.tileID.key,t.type,t.icons)},r.prototype.getGlyphs=function(e,t,r){this.glyphManager.getGlyphs(t.stacks,r)},r.prototype.getResource=function(t,r,n){return e.makeRequest(r,n)},r}(e.Evented);Vt.getSourceType=function(e){return R[e]},Vt.setSourceType=function(e,t){R[e]=t},Vt.registerForPluginStateChange=e.registerForPluginStateChange;var qt=e.createLayout([{name:"a_pos",type:"Int16",components:2}]),Wt=yr("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),Ht=yr("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Gt=yr("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Xt=yr("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Yt=yr("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Zt=yr("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),Kt=yr("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),Jt=yr("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Qt=yr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),er=yr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),tr=yr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),rr=yr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),nr=yr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ar=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),ir=yr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),or=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),sr=yr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),lr=yr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),cr=yr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),ur=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),fr=yr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),hr=yr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),dr=yr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),mr=yr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),gr=yr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yr(e,t){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:e=e.replace(r,(function(e,t,r,a,i){return n[i]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+a+" "+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n    "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:t=t.replace(r,(function(e,t,r,a,i){var o="float"===a?"vec2":"vec4",s=i.match(/color/)?"color":o;return n[i]?"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+a+" "+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+i+" = a_"+i+";\n#else\n    "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+i+" = unpack_mix_"+s+"(a_"+i+", u_"+i+"_t);\n#else\n    "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+r+" "+a+" "+i+" = a_"+i+";\n#else\n    "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+r+" "+a+" "+i+" = unpack_mix_"+s+"(a_"+i+", u_"+i+"_t);\n#else\n    "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n"}))}}var vr=Object.freeze({__proto__:null,prelude:Wt,background:Ht,backgroundPattern:Gt,circle:Xt,clippingMask:Yt,heatmap:Zt,heatmapTexture:Kt,collisionBox:Jt,collisionCircle:Qt,debug:er,fill:tr,fillOutline:rr,fillOutlinePattern:nr,fillPattern:ar,fillExtrusion:ir,fillExtrusionPattern:or,hillshadePrepare:sr,hillshade:lr,line:cr,lineGradient:ur,linePattern:fr,lineSDF:pr,raster:hr,symbolIcon:dr,symbolSDF:mr,symbolTextAndIcon:gr}),br=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};br.prototype.bind=function(e,t,r,n,a,i,o,s){this.context=e;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c<n.length;c++)this.boundPaintVertexBuffers[c]!==n[c]&&(l=!0);var u=!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==r||l||this.boundIndexBuffer!==a||this.boundVertexOffset!==i||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s;!e.extVertexArrayObject||u?this.freshBind(t,r,n,a,i,o,s):(e.bindVertexArrayOES.set(this.vao),o&&o.bind(),a&&a.dynamicDraw&&a.bind(),s&&s.bind())},br.prototype.freshBind=function(e,t,r,n,a,i,o){var s,l=e.numAttributes,c=this.context,u=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=a,this.boundDynamicVertexBuffer=i,this.boundDynamicVertexBuffer2=o;else{s=c.currentNumAttributes||0;for(var f=l;f<s;f++)u.disableVertexAttribArray(f)}t.enableAttributes(u,e);for(var p=0,h=r;p<h.length;p+=1)h[p].enableAttributes(u,e);i&&i.enableAttributes(u,e),o&&o.enableAttributes(u,e),t.bind(),t.setVertexAttribPointers(u,e,a);for(var d=0,m=r;d<m.length;d+=1){var g=m[d];g.bind(),g.setVertexAttribPointers(u,e,a)}i&&(i.bind(),i.setVertexAttribPointers(u,e,a)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,e,a)),c.currentNumAttributes=l},br.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var xr=function(e,t,r,n,a){var i=e.gl;this.program=i.createProgram();var o=r?r.defines():[];a&&o.push("#define OVERDRAW_INSPECTOR;");var s=o.concat(Wt.fragmentSource,t.fragmentSource).join("\n"),l=o.concat(Wt.vertexSource,t.vertexSource).join("\n"),c=i.createShader(i.FRAGMENT_SHADER);if(i.isContextLost())this.failedToCreate=!0;else{i.shaderSource(c,s),i.compileShader(c),i.attachShader(this.program,c);var u=i.createShader(i.VERTEX_SHADER);if(i.isContextLost())this.failedToCreate=!0;else{i.shaderSource(u,l),i.compileShader(u),i.attachShader(this.program,u);for(var f=r?r.layoutAttributes:[],p=0;p<f.length;p++)i.bindAttribLocation(this.program,p,f[p].name);i.linkProgram(this.program),i.deleteShader(u),i.deleteShader(c),this.numAttributes=i.getProgramParameter(this.program,i.ACTIVE_ATTRIBUTES),this.attributes={};for(var h={},d=0;d<this.numAttributes;d++){var m=i.getActiveAttrib(this.program,d);m&&(this.attributes[m.name]=i.getAttribLocation(this.program,m.name))}for(var g=i.getProgramParameter(this.program,i.ACTIVE_UNIFORMS),y=0;y<g;y++){var v=i.getActiveUniform(this.program,y);v&&(h[v.name]=i.getUniformLocation(this.program,v.name))}this.fixedUniforms=n(e,h),this.binderUniforms=r?r.getUniforms(e,h):[]}}};function _r(e,t,r){var n=1/pt(r,1,t.transform.tileZoom),a=Math.pow(2,r.tileID.overscaledZ),i=r.tileSize*Math.pow(2,t.transform.tileZoom)/a,o=i*(r.tileID.canonical.x+r.tileID.wrap*a),s=i*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}xr.prototype.draw=function(e,t,r,n,a,i,o,s,l,c,u,f,p,h,d,m){var g,y=e.gl;if(!this.failedToCreate){for(var v in e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),e.setColorMode(a),e.setCullFace(i),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);h&&h.setUniforms(e,this.binderUniforms,f,{zoom:p});for(var b=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[t],x=0,_=u.get();x<_.length;x+=1){var w=_[x],k=w.vaos||(w.vaos={});(k[s]||(k[s]=new br)).bind(e,this,l,h?h.getPaintVertexBuffers():[],c,w.vertexOffset,d,m),y.drawElements(t,w.primitiveLength*b,y.UNSIGNED_SHORT,w.primitiveOffset*b*2)}}};var wr=function(t,r,n,a){var i=r.style.light,o=i.properties.get("position"),s=[o.x,o.y,o.z],l=e.create$1();"viewport"===i.properties.get("anchor")&&e.fromRotation(l,-r.transform.angle),e.transformMat3(s,s,l);var c=i.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:i.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:a}},kr=function(t,r,n,a,i,o,s){return e.extend(wr(t,r,n,a),_r(o,r,s),{u_height_factor:-Math.pow(2,i.overscaledZ)/s.tileSize/8})},Dr=function(e){return{u_matrix:e}},Tr=function(t,r,n,a){return e.extend(Dr(t),_r(n,r,a))},Ar=function(e,t){return{u_matrix:e,u_world:t}},Sr=function(t,r,n,a,i){return e.extend(Tr(t,r,n,a),{u_world:i})},Mr=function(t,r,n,a){var i,o,s=t.transform;if("map"===a.paint.get("circle-pitch-alignment")){var l=pt(n,1,s.zoom);i=!0,o=[l,l]}else i=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===a.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(r.posMatrix,n,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+i,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:o}},Er=function(e,t,r){var n=pt(r,1,t.zoom),a=Math.pow(2,t.zoom-r.tileID.overscaledZ),i=r.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[t.pixelsToGLUnits[0]/(n*a),t.pixelsToGLUnits[1]/(n*a)],u_overscale_factor:i}},Cr=function(e,t,r){return{u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Nr=function(e,t,r){return void 0===r&&(r=1),{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:r}},Or=function(e){return{u_matrix:e}},Ir=function(e,t,r,n){return{u_matrix:e,u_extrude_scale:pt(t,1,r),u_intensity:n}};function Pr(t,r){var n=Math.pow(2,r.canonical.z),a=r.canonical.y;return[new e.MercatorCoordinate(0,a/n).toLngLat().lat,new e.MercatorCoordinate(0,(a+1)/n).toLngLat().lat]}var Rr=function(t,r,n){var a=t.transform;return{u_matrix:jr(t,r,n),u_ratio:1/pt(r,1,a.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Lr=function(t,r,n){return e.extend(Rr(t,r,n),{u_image:0})},Fr=function(t,r,n,a){var i=t.transform,o=zr(r,i);return{u_matrix:jr(t,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/pt(r,1,i.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[o,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Br=function(t,r,n,a,i){var o=t.transform,s=t.lineAtlas,l=zr(r,o),c="round"===n.layout.get("line-cap"),u=s.getDash(a.from,c),f=s.getDash(a.to,c),p=u.width*i.fromScale,h=f.width*i.toScale;return e.extend(Rr(t,r,n),{u_patternscale_a:[l/p,-u.height/2],u_patternscale_b:[l/h,-f.height/2],u_sdfgamma:s.width/(256*Math.min(p,h)*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:f.y,u_mix:i.t})};function zr(e,t){return 1/pt(e,1,t.tileZoom)}function jr(e,t,r){return e.translatePosMatrix(t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Ur=function(e,t,r,n,a){return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*a.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:a.paint.get("raster-brightness-min"),u_brightness_high:a.paint.get("raster-brightness-max"),u_saturation_factor:(o=a.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(i=a.paint.get("raster-contrast"),i>0?1/(1-i):1+i),u_spin_weights:$r(a.paint.get("raster-hue-rotate"))};var i,o};function $r(e){e*=Math.PI/180;var t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}var Vr,qr=function(e,t,r,n,a,i,o,s,l,c){var u=a.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.height,u_fade_change:a.options.fadeDuration?a.symbolFadeChange:1,u_matrix:i,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Wr=function(t,r,n,a,i,o,s,l,c,u,f){var p=i.transform;return e.extend(qr(t,r,n,a,i,o,s,l,c,u),{u_gamma_scale:a?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+f})},Hr=function(t,r,n,a,i,o,s,l,c,u){return e.extend(Wr(t,r,n,a,i,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Gr=function(e,t,r){return{u_matrix:e,u_opacity:t,u_color:r}},Xr=function(t,r,n,a,i,o){return e.extend(function(e,t,r,n){var a=r.imageManager.getPattern(e.from.toString()),i=r.imageManager.getPattern(e.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,f=u*(n.tileID.canonical.x+n.tileID.wrap*c),p=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:i.tl,u_pattern_br_b:i.br,u_texsize:[s,l],u_mix:t.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:i.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/pt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[f>>16,p>>16],u_pixel_coord_lower:[65535&f,65535&p]}}(a,o,n,i),{u_matrix:t,u_opacity:r})},Yr={fillExtrusion:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fillExtrusionPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,r.u_height_factor),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fill:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},fillPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},fillOutline:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world)}},fillOutlinePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},circle:function(t,r){return{u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,r.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},collisionBox:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,r.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,r.u_overscale_factor)}},collisionCircle:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,r.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,r.u_viewport_size)}},debug:function(t,r){return{u_color:new e.UniformColor(t,r.u_color),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_overlay:new e.Uniform1i(t,r.u_overlay),u_overlay_scale:new e.Uniform1f(t,r.u_overlay_scale)}},clippingMask:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmap:function(t,r){return{u_extrude_scale:new e.Uniform1f(t,r.u_extrude_scale),u_intensity:new e.Uniform1f(t,r.u_intensity),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmapTexture:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_color_ramp:new e.Uniform1i(t,r.u_color_ramp),u_opacity:new e.Uniform1f(t,r.u_opacity)}},hillshade:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_latrange:new e.Uniform2f(t,r.u_latrange),u_light:new e.Uniform2f(t,r.u_light),u_shadow:new e.UniformColor(t,r.u_shadow),u_highlight:new e.UniformColor(t,r.u_highlight),u_accent:new e.UniformColor(t,r.u_accent)}},hillshadePrepare:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_dimension:new e.Uniform2f(t,r.u_dimension),u_zoom:new e.Uniform1f(t,r.u_zoom),u_maxzoom:new e.Uniform1f(t,r.u_maxzoom),u_unpack:new e.Uniform4f(t,r.u_unpack)}},line:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels)}},lineGradient:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_image:new e.Uniform1i(t,r.u_image)}},linePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texsize:new e.Uniform2f(t,r.u_texsize),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_image:new e.Uniform1i(t,r.u_image),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},lineSDF:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,r.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,r.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,r.u_sdfgamma),u_image:new e.Uniform1i(t,r.u_image),u_tex_y_a:new e.Uniform1f(t,r.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,r.u_tex_y_b),u_mix:new e.Uniform1f(t,r.u_mix)}},raster:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_tl_parent:new e.Uniform2f(t,r.u_tl_parent),u_scale_parent:new e.Uniform1f(t,r.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,r.u_buffer_scale),u_fade_t:new e.Uniform1f(t,r.u_fade_t),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image0:new e.Uniform1i(t,r.u_image0),u_image1:new e.Uniform1i(t,r.u_image1),u_brightness_low:new e.Uniform1f(t,r.u_brightness_low),u_brightness_high:new e.Uniform1f(t,r.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,r.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,r.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,r.u_spin_weights)}},symbolIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture)}},symbolSDF:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},symbolTextAndIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texsize_icon:new e.Uniform2f(t,r.u_texsize_icon),u_texture:new e.Uniform1i(t,r.u_texture),u_texture_icon:new e.Uniform1i(t,r.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},background:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_color:new e.UniformColor(t,r.u_color)}},backgroundPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image:new e.Uniform1i(t,r.u_image),u_pattern_tl_a:new e.Uniform2f(t,r.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,r.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,r.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,r.u_pattern_br_b),u_texsize:new e.Uniform2f(t,r.u_texsize),u_mix:new e.Uniform1f(t,r.u_mix),u_pattern_size_a:new e.Uniform2f(t,r.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,r.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,r.u_scale_a),u_scale_b:new e.Uniform1f(t,r.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,r.u_tile_units_to_pixels)}}};function Zr(t,r,n,a,i,o,s){for(var l=t.context,c=l.gl,u=t.useProgram("collisionBox"),f=[],p=0,h=0,d=0;d<a.length;d++){var m=a[d],g=r.getTile(m),y=g.getBucket(n);if(y){var v=m.posMatrix;0===i[0]&&0===i[1]||(v=t.translatePosMatrix(m.posMatrix,g,i,o));var b=s?y.textCollisionBox:y.iconCollisionBox,x=y.collisionCircleArray;if(x.length>0){var _=e.create(),w=v;e.mul(_,y.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(_,_,y.placementViewportMatrix),f.push({circleArray:x,circleOffset:h,transform:w,invTransform:_}),h=p+=x.length/4}b&&u.draw(l,c.LINES,Te.disabled,Ae.disabled,t.colorModeForRenderPass(),Me.disabled,Er(v,t.transform,g),n.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,null,t.transform.zoom,null,null,b.collisionVertexBuffer)}}if(s&&f.length){var k=t.useProgram("collisionCircle"),D=new e.StructArrayLayout2f1f2i16;D.resize(4*p),D._trim();for(var T=0,A=0,S=f;A<S.length;A+=1)for(var M=S[A],E=0;E<M.circleArray.length/4;E++){var C=4*E,N=M.circleArray[C+0],O=M.circleArray[C+1],I=M.circleArray[C+2],P=M.circleArray[C+3];D.emplace(T++,N,O,I,P,0),D.emplace(T++,N,O,I,P,1),D.emplace(T++,N,O,I,P,2),D.emplace(T++,N,O,I,P,3)}(!Vr||Vr.length<2*p)&&(Vr=function(t){var r=2*t,n=new e.StructArrayLayout3ui6;n.resize(r),n._trim();for(var a=0;a<r;a++){var i=6*a;n.uint16[i+0]=4*a+0,n.uint16[i+1]=4*a+1,n.uint16[i+2]=4*a+2,n.uint16[i+3]=4*a+2,n.uint16[i+4]=4*a+3,n.uint16[i+5]=4*a+0}return n}(p));for(var R=l.createIndexBuffer(Vr,!0),L=l.createVertexBuffer(D,e.collisionCircleLayout.members,!0),F=0,B=f;F<B.length;F+=1){var z=B[F],j=Cr(z.transform,z.invTransform,t.transform);k.draw(l,c.TRIANGLES,Te.disabled,Ae.disabled,t.colorModeForRenderPass(),Me.disabled,j,n.id,L,R,e.SegmentVector.simpleSegment(0,2*z.circleOffset,z.circleArray.length,z.circleArray.length/2),null,t.transform.zoom,null,null,null)}L.destroy(),R.destroy()}}var Kr=e.identity(new Float32Array(16));function Jr(t,r,n,a,i,o){var s=e.getAnchorAlignment(t),l=-(s.horizontalAlign-.5)*r,c=-(s.verticalAlign-.5)*n,u=e.evaluateVariableOffset(t,a);return new e.Point((l/i+u[0])*o,(c/i+u[1])*o)}function Qr(t,r,n,a,i,o,s,l,c,u,f){var p=t.text.placedSymbolArray,h=t.text.dynamicLayoutVertexArray,d=t.icon.dynamicLayoutVertexArray,m={};h.clear();for(var g=0;g<p.length;g++){var y=p.get(g),v=t.allowVerticalPlacement&&!y.placedOrientation,b=y.hidden||!y.crossTileID||v?null:a[y.crossTileID];if(b){var x=new e.Point(y.anchorX,y.anchorY),_=Qe(x,n?l:s),w=et(o.cameraToCenterDistance,_.signedDistanceFromCamera),k=i.evaluateSizeForFeature(t.textSizeData,u,y)*w/e.ONE_EM;n&&(k*=t.tilePixelRatio/c);for(var D=b.width,T=b.height,A=Jr(b.anchor,D,T,b.textOffset,b.textBoxScale,k),S=n?Qe(x.add(A),s).point:_.point.add(r?A.rotate(-o.angle):A),M=t.allowVerticalPlacement&&y.placedOrientation===e.WritingMode.vertical?Math.PI/2:0,E=0;E<y.numGlyphs;E++)e.addDynamicAttributes(h,S,M);f&&y.associatedIconIndex>=0&&(m[y.associatedIconIndex]={shiftedAnchor:S,angle:M})}else ct(y.numGlyphs,h)}if(f){d.clear();for(var C=t.icon.placedSymbolArray,N=0;N<C.length;N++){var O=C.get(N);if(O.hidden)ct(O.numGlyphs,d);else{var I=m[N];if(I)for(var P=0;P<O.numGlyphs;P++)e.addDynamicAttributes(d,I.shiftedAnchor,I.angle);else ct(O.numGlyphs,d)}}t.icon.dynamicLayoutVertexBuffer.updateData(d)}t.text.dynamicLayoutVertexBuffer.updateData(h)}function en(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function tn(t,r,n,a,i,o,s,l,c,u,f,p){for(var h=t.context,d=h.gl,m=t.transform,g="map"===l,y="map"===c,v=g&&"point"!==n.layout.get("symbol-placement"),b=g&&!y&&!v,x=void 0!==n.layout.get("symbol-sort-key").constantOr(1),_=t.depthModeForSublayer(0,Te.ReadOnly),w=n.layout.get("text-variable-anchor"),k=[],D=0,T=a;D<T.length;D+=1){var A=T[D],S=r.getTile(A),M=S.getBucket(n);if(M){var E=i?M.text:M.icon;if(E&&E.segments.get().length){var C=E.programConfigurations.get(n.id),N=i||M.sdfIcons,O=i?M.textSizeData:M.iconSizeData,I=y||0!==m.pitch,P=t.useProgram(en(N,i,M),C),R=e.evaluateSizeForZoom(O,m.zoom),L=void 0,F=[0,0],B=void 0,z=void 0,j=null,U=void 0;if(i){if(B=S.glyphAtlasTexture,z=d.LINEAR,L=S.glyphAtlasTexture.size,M.iconsInText){F=S.imageAtlasTexture.size,j=S.imageAtlasTexture;var $="composite"===O.kind||"camera"===O.kind;U=I||t.options.rotating||t.options.zooming||$?d.LINEAR:d.NEAREST}}else{var V=1!==n.layout.get("icon-size").constantOr(0)||M.iconsNeedLinear;B=S.imageAtlasTexture,z=N||t.options.rotating||t.options.zooming||V||I?d.LINEAR:d.NEAREST,L=S.imageAtlasTexture.size}var q=pt(S,1,t.transform.zoom),W=Ke(A.posMatrix,y,g,t.transform,q),H=Je(A.posMatrix,y,g,t.transform,q),G=w&&M.hasTextData(),X="none"!==n.layout.get("icon-text-fit")&&G&&M.hasIconData();v&&rt(M,A.posMatrix,t,i,W,H,y,u);var Y=t.translatePosMatrix(A.posMatrix,S,o,s),Z=v||i&&w||X?Kr:W,K=t.translatePosMatrix(H,S,o,s,!0),J=N&&0!==n.paint.get(i?"text-halo-width":"icon-halo-width").constantOr(1),Q={program:P,buffers:E,uniformValues:N?M.iconsInText?Hr(O.kind,R,b,y,t,Y,Z,K,L,F):Wr(O.kind,R,b,y,t,Y,Z,K,i,L,!0):qr(O.kind,R,b,y,t,Y,Z,K,i,L),atlasTexture:B,atlasTextureIcon:j,atlasInterpolation:z,atlasInterpolationIcon:U,isSDF:N,hasHalo:J};if(x)for(var ee=0,te=E.segments.get();ee<te.length;ee+=1){var re=te[ee];k.push({segments:new e.SegmentVector([re]),sortKey:re.sortKey,state:Q})}else k.push({segments:E.segments,sortKey:0,state:Q})}}}x&&k.sort((function(e,t){return e.sortKey-t.sortKey}));for(var ne=0,ae=k;ne<ae.length;ne+=1){var ie=ae[ne],oe=ie.state;if(h.activeTexture.set(d.TEXTURE0),oe.atlasTexture.bind(oe.atlasInterpolation,d.CLAMP_TO_EDGE),oe.atlasTextureIcon&&(h.activeTexture.set(d.TEXTURE1),oe.atlasTextureIcon&&oe.atlasTextureIcon.bind(oe.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),oe.isSDF){var se=oe.uniformValues;oe.hasHalo&&(se.u_is_halo=1,rn(oe.buffers,ie.segments,n,t,oe.program,_,f,p,se)),se.u_is_halo=0}rn(oe.buffers,ie.segments,n,t,oe.program,_,f,p,oe.uniformValues)}}function rn(e,t,r,n,a,i,o,s,l){var c=n.context,u=c.gl;a.draw(c,u.TRIANGLES,i,o,s,Me.disabled,l,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,n.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function nn(e,t,r,n,a,i,o){var s,l,c,u,f,p=e.context.gl,h=r.paint.get("fill-pattern"),d=h&&h.constantOr(1),m=r.getCrossfadeParameters();o?(l=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(l=d?"fillPattern":"fill",s=p.TRIANGLES);for(var g=0,y=n;g<y.length;g+=1){var v=y[g],b=t.getTile(v);if(!d||b.patternsLoaded()){var x=b.getBucket(r);if(x){var _=x.programConfigurations.get(r.id),w=e.useProgram(l,_);d&&(e.context.activeTexture.set(p.TEXTURE0),b.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),_.updatePaintBuffers(m));var k=h.constantOr(null);if(k&&b.imageAtlas){var D=b.imageAtlas,T=D.patternPositions[k.to.toString()],A=D.patternPositions[k.from.toString()];T&&A&&_.setConstantPatternPositions(T,A)}var S=e.translatePosMatrix(v.posMatrix,b,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){u=x.indexBuffer2,f=x.segments2;var M=[p.drawingBufferWidth,p.drawingBufferHeight];c="fillOutlinePattern"===l&&d?Sr(S,e,m,b,M):Ar(S,M)}else u=x.indexBuffer,f=x.segments,c=d?Tr(S,e,m,b):Dr(S);w.draw(e.context,s,a,e.stencilModeForClipping(v),i,Me.disabled,c,r.id,x.layoutVertexBuffer,u,f,r.paint,e.transform.zoom,_)}}}}function an(e,t,r,n,a,i,o){for(var s=e.context,l=s.gl,c=r.paint.get("fill-extrusion-pattern"),u=c.constantOr(1),f=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),h=0,d=n;h<d.length;h+=1){var m=d[h],g=t.getTile(m),y=g.getBucket(r);if(y){var v=y.programConfigurations.get(r.id),b=e.useProgram(u?"fillExtrusionPattern":"fillExtrusion",v);u&&(e.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers(f));var x=c.constantOr(null);if(x&&g.imageAtlas){var _=g.imageAtlas,w=_.patternPositions[x.to.toString()],k=_.patternPositions[x.from.toString()];w&&k&&v.setConstantPatternPositions(w,k)}var D=e.translatePosMatrix(m.posMatrix,g,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),T=r.paint.get("fill-extrusion-vertical-gradient"),A=u?kr(D,e,T,p,m,f,g):wr(D,e,T,p);b.draw(s,s.gl.TRIANGLES,a,i,o,Me.backCCW,A,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,e.transform.zoom,v)}}}function on(e,t,r,n,a,i){var o=e.context,s=o.gl,l=t.fbo;if(l){var c=e.useProgram("hillshade");o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get());var u=function(e,t,r){var n=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),i=r.paint.get("hillshade-accent-color"),o=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(o-=e.transform.angle);var s=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),s),u_image:0,u_latrange:Pr(0,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:a,u_accent:i}}(e,t,r);c.draw(o,s.TRIANGLES,n,a,i,Me.disabled,u,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function sn(t,r,n,a,i,o,s){var l=t.context,c=l.gl,u=r.dem;if(u&&u.data){var f=u.dim,p=u.stride,h=u.getPixels();if(l.activeTexture.set(c.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(p),r.demTexture){var d=r.demTexture;d.update(h,{premultiply:!1}),d.bind(c.NEAREST,c.CLAMP_TO_EDGE)}else r.demTexture=new e.Texture(l,h,c.RGBA,{premultiply:!1}),r.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);l.activeTexture.set(c.TEXTURE0);var m=r.fbo;if(!m){var g=new e.Texture(l,{width:f,height:f,data:null},c.RGBA);g.bind(c.LINEAR,c.CLAMP_TO_EDGE),(m=r.fbo=l.createFramebuffer(f,f,!0)).colorAttachment.set(g.texture)}l.bindFramebuffer.set(m.framebuffer),l.viewport.set([0,0,f,f]),t.useProgram("hillshadePrepare").draw(l,c.TRIANGLES,i,o,s,Me.disabled,function(t,r,n){var a=r.stride,i=e.create();return e.ortho(i,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(i,i,[0,-e.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[a,a],u_zoom:t.overscaledZ,u_maxzoom:n,u_unpack:r.getUnpackVector()}}(r.tileID,u,a),n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function ln(t,r,n,a,i){var o=a.paint.get("raster-fade-duration");if(o>0){var s=e.browser.now(),l=(s-t.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),f=i.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-f)>Math.abs(t.tileID.overscaledZ-f),h=p&&t.refreshedUponExpiration?1:e.clamp(p?l:1-c,0,1);return t.refreshedUponExpiration&&l>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-h}:{opacity:h,mix:0}}return{opacity:1,mix:0}}var cn=new e.Color(1,0,0,1),un=new e.Color(0,1,0,1),fn=new e.Color(0,0,1,1),pn=new e.Color(1,0,1,1),hn=new e.Color(0,1,1,1);function dn(e,t,r,n){gn(e,0,t+r/2,e.transform.width,r,n)}function mn(e,t,r,n){gn(e,t-r/2,0,r,e.transform.height,n)}function gn(t,r,n,a,i,o){var s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*e.browser.devicePixelRatio,n*e.browser.devicePixelRatio,a*e.browser.devicePixelRatio,i*e.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function yn(t,r,n){var a=t.context,i=a.gl,o=n.posMatrix,s=t.useProgram("debug"),l=Te.disabled,c=Ae.disabled,u=t.colorModeForRenderPass();a.activeTexture.set(i.TEXTURE0),t.emptyTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE),s.draw(a,i.LINE_STRIP,l,c,u,Me.disabled,Nr(o,e.Color.red),"$debug",t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);var f=r.getTileByID(n.key).latestRawTileData,p=f&&f.byteLength||0,h=Math.floor(p/1024),d=r.getTile(n).tileSize,m=512/Math.min(d,512)*(n.overscaledZ/t.transform.zoom)*.5,g=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(g+=" => "+n.overscaledZ),function(e,t){e.initDebugOverlayCanvas();var r=e.debugOverlayCanvas,n=e.context.gl,a=e.debugOverlayCanvas.getContext("2d");a.clearRect(0,0,r.width,r.height),a.shadowColor="white",a.shadowBlur=2,a.lineWidth=1.5,a.strokeStyle="white",a.textBaseline="top",a.font="bold 36px Open Sans, sans-serif",a.fillText(t,5,5),a.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,g+" "+h+"kb"),s.draw(a,i.TRIANGLES,l,c,Se.alphaBlended,Me.disabled,Nr(o,e.Color.transparent,m),"$debug",t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}var vn={symbol:function(t,r,n,a,i){if("translucent"===t.renderPass){var o=Ae.disabled,s=t.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(t,r,n,a,i,o,s){for(var l=r.transform,c="map"===i,u="map"===o,f=0,p=t;f<p.length;f+=1){var h=p[f],d=a.getTile(h),m=d.getBucket(n);if(m&&m.text&&m.text.segments.get().length){var g=m.textSizeData,y=e.evaluateSizeForZoom(g,l.zoom),v=pt(d,1,r.transform.zoom),b=Ke(h.posMatrix,u,c,r.transform,v),x="none"!==n.layout.get("icon-text-fit")&&m.hasIconData();if(y){var _=Math.pow(2,l.zoom-d.tileID.overscaledZ);Qr(m,c,u,s,e.symbolSize,l,b,h.posMatrix,_,y,x)}}}}(a,t,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),i),0!==n.paint.get("icon-opacity").constantOr(1)&&tn(t,r,n,a,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&tn(t,r,n,a,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(Zr(t,r,n,a,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Zr(t,r,n,a,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(t,r,n,a){if("translucent"===t.renderPass){var i=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0!==i.constantOr(1)||0!==o.constantOr(1)&&0!==s.constantOr(1)){for(var c=t.context,u=c.gl,f=t.depthModeForSublayer(0,Te.ReadOnly),p=Ae.disabled,h=t.colorModeForRenderPass(),d=[],m=0;m<a.length;m++){var g=a[m],y=r.getTile(g),v=y.getBucket(n);if(v){var b=v.programConfigurations.get(n.id),x={programConfiguration:b,program:t.useProgram("circle",b),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:Mr(t,g,y,n)};if(l)for(var _=0,w=v.segments.get();_<w.length;_+=1){var k=w[_];d.push({segments:new e.SegmentVector([k]),sortKey:k.sortKey,state:x})}else d.push({segments:v.segments,sortKey:0,state:x})}}l&&d.sort((function(e,t){return e.sortKey-t.sortKey}));for(var D=0,T=d;D<T.length;D+=1){var A=T[D],S=A.state,M=S.programConfiguration,E=S.program,C=S.layoutVertexBuffer,N=S.indexBuffer,O=S.uniformValues,I=A.segments;E.draw(c,u.TRIANGLES,f,p,h,Me.disabled,O,n.id,C,N,I,n.paint,t.transform.zoom,M)}}}},heatmap:function(t,r,n,a){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){var i=t.context,o=i.gl,s=Ae.disabled,l=new Se([o.ONE,o.ONE],e.Color.transparent,[!0,!0,!0,!0]);!function(e,t,r){var n=e.gl;e.activeTexture.set(n.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);var a=r.heatmapFbo;if(a)n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer);else{var i=n.createTexture();n.bindTexture(n.TEXTURE_2D,i),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),a=r.heatmapFbo=e.createFramebuffer(t.width/4,t.height/4,!1),function(e,t,r,n){var a=e.gl,i=e.extRenderToTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:a.UNSIGNED_BYTE;a.texImage2D(a.TEXTURE_2D,0,a.RGBA,t.width/4,t.height/4,0,a.RGBA,i,null),n.colorAttachment.set(r)}(e,t,i,a)}}(i,t,n),i.clear({color:e.Color.transparent});for(var c=0;c<a.length;c++){var u=a[c];if(!r.hasRenderableParent(u)){var f=r.getTile(u),p=f.getBucket(n);if(p){var h=p.programConfigurations.get(n.id),d=t.useProgram("heatmap",h),m=t.transform.zoom;d.draw(i,o.TRIANGLES,Te.disabled,s,l,Me.disabled,Ir(u.posMatrix,f,m,n.paint.get("heatmap-intensity")),n.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,n.paint,t.transform.zoom,h)}}}i.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,r){var n=t.context,a=n.gl,i=r.heatmapFbo;if(i){n.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i.colorAttachment.get()),n.activeTexture.set(a.TEXTURE1);var o=r.colorRampTexture;o||(o=r.colorRampTexture=new e.Texture(n,r.colorRamp,a.RGBA)),o.bind(a.LINEAR,a.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,a.TRIANGLES,Te.disabled,Ae.disabled,t.colorModeForRenderPass(),Me.disabled,function(t,r,n,a){var i=e.create();e.ortho(i,0,t.width,t.height,0,0,1);var o=t.context.gl;return{u_matrix:i,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}}(t,r),r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom)}}(t,n))},line:function(t,r,n,a){if("translucent"===t.renderPass){var i=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0!==i.constantOr(1)&&0!==o.constantOr(1)){var s=t.depthModeForSublayer(0,Te.ReadOnly),l=t.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=n.paint.get("line-pattern"),f=u.constantOr(1),p=n.paint.get("line-gradient"),h=n.getCrossfadeParameters(),d=f?"linePattern":c?"lineSDF":p?"lineGradient":"line",m=t.context,g=m.gl,y=!0;if(p){m.activeTexture.set(g.TEXTURE0);var v=n.gradientTexture;if(!n.gradient)return;v||(v=n.gradientTexture=new e.Texture(m,n.gradient,g.RGBA)),v.bind(g.LINEAR,g.CLAMP_TO_EDGE)}for(var b=0,x=a;b<x.length;b+=1){var _=x[b],w=r.getTile(_);if(!f||w.patternsLoaded()){var k=w.getBucket(n);if(k){var D=k.programConfigurations.get(n.id),T=t.context.program.get(),A=t.useProgram(d,D),S=y||A.program!==T,M=u.constantOr(null);if(M&&w.imageAtlas){var E=w.imageAtlas,C=E.patternPositions[M.to.toString()],N=E.patternPositions[M.from.toString()];C&&N&&D.setConstantPatternPositions(C,N)}var O=f?Fr(t,w,n,h):c?Br(t,w,n,c,h):p?Lr(t,w,n):Rr(t,w,n);f?(m.activeTexture.set(g.TEXTURE0),w.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),D.updatePaintBuffers(h)):c&&(S||t.lineAtlas.dirty)&&(m.activeTexture.set(g.TEXTURE0),t.lineAtlas.bind(m)),A.draw(m,g.TRIANGLES,s,t.stencilModeForClipping(_),l,Me.disabled,O,n.id,k.layoutVertexBuffer,k.indexBuffer,k.segments,n.paint,t.transform.zoom,D),y=!1}}}}}},fill:function(t,r,n,a){var i=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0!==o.constantOr(1)){var s=t.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===i.constantOr(e.Color.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){var u=t.depthModeForSublayer(1,"opaque"===t.renderPass?Te.ReadWrite:Te.ReadOnly);nn(t,r,n,a,u,s,!1)}if("translucent"===t.renderPass&&n.paint.get("fill-antialias")){var f=t.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Te.ReadOnly);nn(t,r,n,a,f,s,!0)}}},"fill-extrusion":function(e,t,r,n){var a=r.paint.get("fill-extrusion-opacity");if(0!==a&&"translucent"===e.renderPass){var i=new Te(e.context.gl.LEQUAL,Te.ReadWrite,e.depthRangeFor3D);if(1!==a||r.paint.get("fill-extrusion-pattern").constantOr(1))an(e,t,r,n,i,Ae.disabled,Se.disabled),an(e,t,r,n,i,e.stencilModeFor3D(),e.colorModeForRenderPass());else{var o=e.colorModeForRenderPass();an(e,t,r,n,i,Ae.disabled,o)}}},hillshade:function(e,t,r,n){if("offscreen"===e.renderPass||"translucent"===e.renderPass){for(var a=e.context,i=t.getSource().maxzoom,o=e.depthModeForSublayer(0,Te.ReadOnly),s=e.colorModeForRenderPass(),l="translucent"===e.renderPass?e.stencilConfigForOverlap(n):[{},n],c=l[0],u=0,f=l[1];u<f.length;u+=1){var p=f[u],h=t.getTile(p);h.needsHillshadePrepare&&"offscreen"===e.renderPass?sn(e,h,r,i,o,Ae.disabled,s):"translucent"===e.renderPass&&on(e,h,r,o,c[p.overscaledZ],s)}a.viewport.set([0,0,e.width,e.height])}},raster:function(e,t,r,n){if("translucent"===e.renderPass&&0!==r.paint.get("raster-opacity")&&n.length)for(var a=e.context,i=a.gl,o=t.getSource(),s=e.useProgram("raster"),l=e.colorModeForRenderPass(),c=o instanceof O?[{},n]:e.stencilConfigForOverlap(n),u=c[0],f=c[1],p=f[f.length-1].overscaledZ,h=!e.options.moving,d=0,m=f;d<m.length;d+=1){var g=m[d],y=e.depthModeForSublayer(g.overscaledZ-p,1===r.paint.get("raster-opacity")?Te.ReadWrite:Te.ReadOnly,i.LESS),v=t.getTile(g),b=e.transform.calculatePosMatrix(g.toUnwrapped(),h);v.registerFadeDuration(r.paint.get("raster-fade-duration"));var x=t.findLoadedParent(g,0),_=ln(v,x,t,r,e.transform),w=void 0,k=void 0,D="nearest"===r.paint.get("raster-resampling")?i.NEAREST:i.LINEAR;a.activeTexture.set(i.TEXTURE0),v.texture.bind(D,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_NEAREST),a.activeTexture.set(i.TEXTURE1),x?(x.texture.bind(D,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,x.tileID.overscaledZ-v.tileID.overscaledZ),k=[v.tileID.canonical.x*w%1,v.tileID.canonical.y*w%1]):v.texture.bind(D,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_NEAREST);var T=Ur(b,k||[0,0],w||1,_,r);o instanceof O?s.draw(a,i.TRIANGLES,y,Ae.disabled,l,Me.disabled,T,r.id,o.boundsBuffer,e.quadTriangleIndexBuffer,o.boundsSegments):s.draw(a,i.TRIANGLES,y,u[g.overscaledZ],l,Me.disabled,T,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}},background:function(e,t,r){var n=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0!==a){var i=e.context,o=i.gl,s=e.transform,l=s.tileSize,c=r.paint.get("background-pattern");if(!e.isPatternMissing(c)){var u=!c&&1===n.a&&1===a&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass===u){var f=Ae.disabled,p=e.depthModeForSublayer(0,"opaque"===u?Te.ReadWrite:Te.ReadOnly),h=e.colorModeForRenderPass(),d=e.useProgram(c?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});c&&(i.activeTexture.set(o.TEXTURE0),e.imageManager.bind(e.context));for(var g=r.getCrossfadeParameters(),y=0,v=m;y<v.length;y+=1){var b=v[y],x=e.transform.calculatePosMatrix(b.toUnwrapped()),_=c?Xr(x,a,e,c,{tileID:b,tileSize:l},g):Gr(x,a,n);d.draw(i,o.TRIANGLES,p,f,h,Me.disabled,_,r.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}}}},debug:function(e,t,r){for(var n=0;n<r.length;n++)yn(e,t,r[n])},custom:function(e,t,r){var n=e.context,a=r.implementation;if("offscreen"===e.renderPass){var i=a.prerender;i&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),i.call(a,n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Ae.disabled);var o="3d"===a.renderingMode?new Te(e.context.gl.LEQUAL,Te.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,Te.ReadOnly);n.setDepthMode(o),a.render(n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}}},bn=function(e,t){this.context=new Ee(e),this.transform=t,this._tileTextures={},this.setup(),this.numSublayers=Ce.maxUnderzooming+Ce.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Bt,this.gpuTimers={}};bn.prototype.resize=function(t,r){if(this.width=t*e.browser.devicePixelRatio,this.height=r*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,a=this.style._order;n<a.length;n+=1){var i=a[n];this.style._layers[i].resize()}},bn.prototype.setup=function(){var t=this.context,r=new e.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(e.EXTENT,0),r.emplaceBack(0,e.EXTENT),r.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(r,qt.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);var n=new e.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(e.EXTENT,0),n.emplaceBack(0,e.EXTENT),n.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=t.createVertexBuffer(n,qt.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);var a=new e.StructArrayLayout4i8;a.emplaceBack(0,0,0,0),a.emplaceBack(e.EXTENT,0,e.EXTENT,0),a.emplaceBack(0,e.EXTENT,0,e.EXTENT),a.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.rasterBoundsBuffer=t.createVertexBuffer(a,N.members),this.rasterBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);var i=new e.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(1,0),i.emplaceBack(0,1),i.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(i,qt.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);var o=new e.StructArrayLayout1ui2;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);var s=new e.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s),this.emptyTexture=new e.Texture(t,{width:1,height:1,data:new Uint8Array([0,0,0,0])},t.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new Ae({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},bn.prototype.clearStencil=function(){var t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=e.create();e.ortho(n,0,this.width,this.height,0,0,1),e.scale(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,r.TRIANGLES,Te.disabled,this.stencilClearMode,Se.disabled,Me.disabled,Or(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},bn.prototype._renderTileClippingMasks=function(e,t){if(this.currentStencilSource!==e.source&&e.isTileClipped()&&t&&t.length){this.currentStencilSource=e.source;var r=this.context,n=r.gl;this.nextStencilID+t.length>256&&this.clearStencil(),r.setColorMode(Se.disabled),r.setDepthMode(Te.disabled);var a=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var i=0,o=t;i<o.length;i+=1){var s=o[i],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;a.draw(r,n.TRIANGLES,Te.disabled,new Ae({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),Se.disabled,Me.disabled,Or(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},bn.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new Ae({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)},bn.prototype.stencilModeForClipping=function(e){var t=this.context.gl;return new Ae({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)},bn.prototype.stencilConfigForOverlap=function(e){var t,r=this.context.gl,n=e.sort((function(e,t){return t.overscaledZ-e.overscaledZ})),a=n[n.length-1].overscaledZ,i=n[0].overscaledZ-a+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();for(var o={},s=0;s<i;s++)o[s+a]=new Ae({func:r.GEQUAL,mask:255},s+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=i,[o,n]}return[(t={},t[a]=Ae.disabled,t),n]},bn.prototype.colorModeForRenderPass=function(){var t=this.context.gl;return this._showOverdrawInspector?new Se([t.CONSTANT_COLOR,t.ONE],new e.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Se.unblended:Se.alphaBlended},bn.prototype.depthModeForSublayer=function(e,t,r){if(!this.opaquePassEnabledForLayer())return Te.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Te(r||this.context.gl.LEQUAL,t,[n,n])},bn.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},bn.prototype.render=function(t,r){var n=this;this.style=t,this.options=r,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.browser.now()),this.imageManager.beginFrame();var a=this.style._order,i=this.style.sourceCaches;for(var o in i){var s=i[o];s.used&&s.prepare(this.context)}var l,c,u={},f={},p={};for(var h in i){var d=i[h];u[h]=d.getVisibleCoordinates(),f[h]=u[h].slice().reverse(),p[h]=d.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<a.length;m++){var g=a[m];if(this.style._layers[g].is3D()){this.opaquePassCutoff=m;break}}this.renderPass="offscreen";for(var y=0,v=a;y<v.length;y+=1){var b=v[y],x=this.style._layers[b];if(x.hasOffscreenPass()&&!x.isHidden(this.transform.zoom)){var _=f[x.source];("custom"===x.type||_.length)&&this.renderLayer(this,i[x.source],x,_)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?e.Color.black:e.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=a.length-1;this.currentLayer>=0;this.currentLayer--){var w=this.style._layers[a[this.currentLayer]],k=i[w.source],D=u[w.source];this._renderTileClippingMasks(w,D),this.renderLayer(this,k,w,D)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<a.length;this.currentLayer++){var T=this.style._layers[a[this.currentLayer]],A=i[T.source],S=("symbol"===T.type?p:f)[T.source];this._renderTileClippingMasks(T,u[T.source]),this.renderLayer(this,A,T,S)}this.options.showTileBoundaries&&(e.values(this.style._layers).forEach((function(e){e.source&&!e.isHidden(n.transform.zoom)&&(e.source!==(c&&c.id)&&(c=n.style.sourceCaches[e.source]),(!l||l.getSource().maxzoom<c.getSource().maxzoom)&&(l=c))})),l&&vn.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(e){var t=e.transform.padding;dn(e,e.transform.height-(t.top||0),3,cn),dn(e,t.bottom||0,3,un),mn(e,t.left||0,3,fn),mn(e,e.transform.width-(t.right||0),3,pn);var r=e.transform.centerPoint;!function(e,t,r,n){gn(e,t-1,r-10,2,20,n),gn(e,t-10,r-1,20,2,n)}(e,r.x,e.transform.height-r.y,hn)}(this),this.context.setDefault()},bn.prototype.renderLayer=function(e,t,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||n.length)&&(this.id=r.id,this.gpuTimingStart(r),vn[r.type](e,t,r,n,this.style.placement.variableOffsets),this.gpuTimingEnd())},bn.prototype.gpuTimingStart=function(e){if(this.options.gpuTiming){var t=this.context.extTimerQuery,r=this.gpuTimers[e.id];r||(r=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:t.createQueryEXT()}),r.calls++,t.beginQueryEXT(t.TIME_ELAPSED_EXT,r.query)}},bn.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}},bn.prototype.collectGpuTimers=function(){var e=this.gpuTimers;return this.gpuTimers={},e},bn.prototype.queryGpuTimers=function(e){var t={};for(var r in e){var n=e[r],a=this.context.extTimerQuery,i=a.getQueryObjectEXT(n.query,a.QUERY_RESULT_EXT)/1e6;a.deleteQueryEXT(n.query),t[r]=i}return t},bn.prototype.translatePosMatrix=function(t,r,n,a,i){if(!n[0]&&!n[1])return t;var o=i?"map"===a?this.transform.angle:0:"viewport"===a?-this.transform.angle:0;if(o){var s=Math.sin(o),l=Math.cos(o);n=[n[0]*l-n[1]*s,n[0]*s+n[1]*l]}var c=[i?n[0]:pt(r,n[0],this.transform.zoom),i?n[1]:pt(r,n[1],this.transform.zoom),0],u=new Float32Array(16);return e.translate(u,t,c),u},bn.prototype.saveTileTexture=function(e){var t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]},bn.prototype.getTileTexture=function(e){var t=this._tileTextures[e];return t&&t.length>0?t.pop():null},bn.prototype.isPatternMissing=function(e){if(!e)return!1;if(!e.from||!e.to)return!0;var t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r},bn.prototype.useProgram=function(e,t){this.cache=this.cache||{};var r=""+e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new xr(this.context,vr[e],t,Yr[e],this._showOverdrawInspector)),this.cache[r]},bn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},bn.prototype.setBaseState=function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)},bn.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var t=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,t.RGBA)}},bn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var xn=function(e,t){this.points=e,this.planes=t};xn.fromInvProjectionMatrix=function(t,r,n){var a=Math.pow(2,n),i=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return e.transformMat4([],r,t)})).map((function(t){return e.scale$1([],t,1/t[3]/r*a)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var r=e.sub([],i[t[0]],i[t[1]]),n=e.sub([],i[t[2]],i[t[1]]),a=e.normalize([],e.cross([],r,n)),o=-e.dot(a,i[t[1]]);return a.concat(o)}));return new xn(i,o)};var _n=function(t,r){this.min=t,this.max=r,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};_n.prototype.quadrant=function(t){for(var r=[t%2==0,t<2],n=e.clone$2(this.min),a=e.clone$2(this.max),i=0;i<r.length;i++)n[i]=r[i]?this.min[i]:this.center[i],a[i]=r[i]?this.center[i]:this.max[i];return a[2]=this.max[2],new _n(n,a)},_n.prototype.distanceX=function(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]},_n.prototype.distanceY=function(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]},_n.prototype.intersects=function(t){for(var r=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,a=0;a<t.planes.length;a++){for(var i=t.planes[a],o=0,s=0;s<r.length;s++)o+=e.dot$1(i,r[s])>=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,f=0;f<t.points.length;f++){var p=t.points[f][l]-this.min[l];c=Math.min(c,p),u=Math.max(u,p)}if(u<0||c>this.max[l]-this.min[l])return 0}return 1};var wn=function(e,t,r,n){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n};wn.prototype.interpolate=function(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.number(t.right,r.right,n)),this},wn.prototype.getCenter=function(t,r){var n=e.clamp((this.left+t-this.right)/2,0,t),a=e.clamp((this.top+r-this.bottom)/2,0,r);return new e.Point(n,a)},wn.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right},wn.prototype.clone=function(){return new wn(this.top,this.bottom,this.left,this.right)},wn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var kn=function(t,r,n,a,i){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===i||i,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==a?60:a,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={}},Dn={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};kn.prototype.clone=function(){var e=new kn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._calcMatrices(),e},Dn.minZoom.get=function(){return this._minZoom},Dn.minZoom.set=function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))},Dn.maxZoom.get=function(){return this._maxZoom},Dn.maxZoom.set=function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))},Dn.minPitch.get=function(){return this._minPitch},Dn.minPitch.set=function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))},Dn.maxPitch.get=function(){return this._maxPitch},Dn.maxPitch.set=function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))},Dn.renderWorldCopies.get=function(){return this._renderWorldCopies},Dn.renderWorldCopies.set=function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e},Dn.worldSize.get=function(){return this.tileSize*this.scale},Dn.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Dn.size.get=function(){return new e.Point(this.width,this.height)},Dn.bearing.get=function(){return-this.angle/Math.PI*180},Dn.bearing.set=function(t){var r=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Dn.pitch.get=function(){return this._pitch/Math.PI*180},Dn.pitch.set=function(t){var r=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Dn.fov.get=function(){return this._fov/Math.PI*180},Dn.fov.set=function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())},Dn.zoom.get=function(){return this._zoom},Dn.zoom.set=function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},Dn.center.get=function(){return this._center},Dn.center.set=function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())},Dn.padding.get=function(){return this._edgeInsets.toJSON()},Dn.padding.set=function(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())},Dn.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},kn.prototype.isPaddingEqual=function(e){return this._edgeInsets.equals(e)},kn.prototype.interpolatePadding=function(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()},kn.prototype.coveringZoomLevel=function(e){var t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)},kn.prototype.getVisibleUnwrappedCoordinates=function(t){var r=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new e.Point(0,0)),a=this.pointCoordinate(new e.Point(this.width,0)),i=this.pointCoordinate(new e.Point(this.width,this.height)),o=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(n.x,a.x,i.x,o.x)),l=Math.floor(Math.max(n.x,a.x,i.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new e.UnwrappedTileID(c,t));return r},kn.prototype.coveringTiles=function(t){var r=this.coveringZoomLevel(t),n=r;if(void 0!==t.minzoom&&r<t.minzoom)return[];void 0!==t.maxzoom&&r>t.maxzoom&&(r=t.maxzoom);var a=e.MercatorCoordinate.fromLngLat(this.center),i=Math.pow(2,r),o=[i*a.x,i*a.y,0],s=xn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(e){return{aabb:new _n([e*i,0,0],[(e+1)*i,i,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}},u=[],f=[],p=r,h=t.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var m=u.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var b=m.aabb.intersects(s);if(0===b)continue;v=2===b}var x=m.aabb.distanceX(o),_=m.aabb.distanceY(o),w=Math.max(Math.abs(x),Math.abs(_)),k=3+(1<<p-m.zoom)-2;if(m.zoom===p||w>k&&m.zoom>=l)f.push({tileID:new e.OverscaledTileID(m.zoom===p?h:m.zoom,m.wrap,m.zoom,g,y),distanceSq:e.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var D=0;D<4;D++){var T=(g<<1)+D%2,A=(y<<1)+(D>>1);u.push({aabb:m.aabb.quadrant(D),zoom:m.zoom+1,x:T,y:A,wrap:m.wrap,fullyVisible:v})}}return f.sort((function(e,t){return e.distanceSq-t.distanceSq})).map((function(e){return e.tileID}))},kn.prototype.resize=function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()},Dn.unmodified.get=function(){return this._unmodified},kn.prototype.zoomScale=function(e){return Math.pow(2,e)},kn.prototype.scaleZoom=function(e){return Math.log(e)/Math.LN2},kn.prototype.project=function(t){var r=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(r)*this.worldSize)},kn.prototype.unproject=function(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},Dn.point.get=function(){return this.project(this.center)},kn.prototype.setLocationAtPoint=function(t,r){var n=this.pointCoordinate(r),a=this.pointCoordinate(this.centerPoint),i=this.locationCoordinate(t),o=new e.MercatorCoordinate(i.x-(n.x-a.x),i.y-(n.y-a.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},kn.prototype.locationPoint=function(e){return this.coordinatePoint(this.locationCoordinate(e))},kn.prototype.pointLocation=function(e){return this.coordinateLocation(this.pointCoordinate(e))},kn.prototype.locationCoordinate=function(t){return e.MercatorCoordinate.fromLngLat(t)},kn.prototype.coordinateLocation=function(e){return e.toLngLat()},kn.prototype.pointCoordinate=function(t){var r=[t.x,t.y,0,1],n=[t.x,t.y,1,1];e.transformMat4(r,r,this.pixelMatrixInverse),e.transformMat4(n,n,this.pixelMatrixInverse);var a=r[3],i=n[3],o=r[0]/a,s=n[0]/i,l=r[1]/a,c=n[1]/i,u=r[2]/a,f=n[2]/i,p=u===f?0:(0-u)/(f-u);return new e.MercatorCoordinate(e.number(o,s,p)/this.worldSize,e.number(l,c,p)/this.worldSize)},kn.prototype.coordinatePoint=function(t){var r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix),new e.Point(r[0]/r[3],r[1]/r[3])},kn.prototype.getBounds=function(){return(new e.LngLatBounds).extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},kn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},kn.prototype.setMaxBounds=function(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},kn.prototype.calculatePosMatrix=function(t,r){void 0===r&&(r=!1);var n=t.key,a=r?this._alignedPosMatrixCache:this._posMatrixCache;if(a[n])return a[n];var i=t.canonical,o=this.worldSize/this.zoomScale(i.z),s=i.x+Math.pow(2,i.z)*t.wrap,l=e.identity(new Float64Array(16));return e.translate(l,l,[s*o,i.y*o,0]),e.scale(l,l,[o/e.EXTENT,o/e.EXTENT,1]),e.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),a[n]=new Float32Array(l),a[n]},kn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},kn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,r,n,a,i=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var f=this.latRange;i=e.mercatorYfromLat(f[1])*this.worldSize,t=(o=e.mercatorYfromLat(f[0])*this.worldSize)-i<c.y?c.y/(o-i):0}if(this.lngRange){var p=this.lngRange;s=e.mercatorXfromLng(p[0])*this.worldSize,r=(l=e.mercatorXfromLng(p[1])*this.worldSize)-s<c.x?c.x/(l-s):0}var h=this.point,d=Math.max(r||0,t||0);if(d)return this.center=this.unproject(new e.Point(r?(l+s)/2:h.x,t?(o+i)/2:h.y)),this.zoom+=this.scaleZoom(d),this._unmodified=u,void(this._constraining=!1);if(this.latRange){var m=h.y,g=c.y/2;m-g<i&&(a=i+g),m+g>o&&(a=o-g)}if(this.lngRange){var y=h.x,v=c.x/2;y-v<s&&(n=s+v),y+v>l&&(n=l-v)}void 0===n&&void 0===a||(this.center=this.unproject(new e.Point(void 0!==n?n:h.x,void 0!==a?a:h.y))),this._unmodified=u,this._constraining=!1}},kn.prototype._calcMatrices=function(){if(this.height){var t=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(t)*this.height;var n=Math.PI/2+this._pitch,a=this._fov*(.5+r.y/this.height),i=Math.sin(a)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-n-a,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),u=this.height/50,f=new Float64Array(16);e.perspective(f,this._fov,this.width/this.height,u,c),f[8]=2*-r.x/this.width,f[9]=2*r.y/this.height,e.scale(f,f,[1,-1,1]),e.translate(f,f,[0,0,-this.cameraToCenterDistance]),e.rotateX(f,f,this._pitch),e.rotateZ(f,f,this.angle),e.translate(f,f,[-s,-l,0]),this.mercatorMatrix=e.scale([],f,[this.worldSize,this.worldSize,this.worldSize]),e.scale(f,f,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=f,this.invProjMatrix=e.invert([],this.projMatrix);var p=this.width%2/2,h=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),g=s-Math.round(s)+d*p+m*h,y=l-Math.round(l)+d*h+m*p,v=new Float64Array(f);if(e.translate(v,v,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=v,f=e.create(),e.scale(f,f,[this.width/2,-this.height/2,1]),e.translate(f,f,[1,-1,0]),this.labelPlaneMatrix=f,f=e.create(),e.scale(f,f,[1,-1,1]),e.translate(f,f,[-1,-1,0]),e.scale(f,f,[2/this.width,2/this.height,1]),this.glCoordMatrix=f,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(f=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=f,this._posMatrixCache={},this._alignedPosMatrixCache={}}},kn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.Point(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},kn.prototype.getCameraPoint=function(){var t=this._pitch,r=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,r))},kn.prototype.getCameraQueryGeometry=function(t){var r=this.getCameraPoint();if(1===t.length)return[t[0],r];for(var n=r.x,a=r.y,i=r.x,o=r.y,s=0,l=t;s<l.length;s+=1){var c=l[s];n=Math.min(n,c.x),a=Math.min(a,c.y),i=Math.max(i,c.x),o=Math.max(o,c.y)}return[new e.Point(n,a),new e.Point(i,a),new e.Point(i,o),new e.Point(n,o),new e.Point(n,a)]},Object.defineProperties(kn.prototype,Dn);var Tn=function(t){var r,n,a,i;this._hashName=t&&encodeURIComponent(t),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(r=this._updateHashUnthrottled.bind(this),300,n=!1,a=null,i=function(){a=null,n&&(r(),a=setTimeout(i,300),n=!1)},function(){return n=!0,a||i(),a})};Tn.prototype.addTo=function(t){return this._map=t,e.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Tn.prototype.remove=function(){return e.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Tn.prototype.getHashString=function(t){var r=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,a=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,a),o=Math.round(r.lng*i)/i,s=Math.round(r.lat*i)/i,l=this._map.getBearing(),c=this._map.getPitch(),u="";if(u+=t?"/"+o+"/"+s+"/"+n:n+"/"+s+"/"+o,(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+="/"+Math.round(c)),this._hashName){var f=this._hashName,p=!1,h=e.window.location.hash.slice(1).split("&").map((function(e){var t=e.split("=")[0];return t===f?(p=!0,t+"="+u):e})).filter((function(e){return e}));return p||h.push(f+"="+u),"#"+h.join("&")}return"#"+u},Tn.prototype._getCurrentHash=function(){var t,r=this,n=e.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(e){return e.split("=")})).forEach((function(e){e[0]===r._hashName&&(t=e)})),(t&&t[1]||"").split("/")):n.split("/")},Tn.prototype._onHashChange=function(){var e=this._getCurrentHash();if(e.length>=3&&!e.some((function(e){return isNaN(e)}))){var t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},Tn.prototype._updateHashUnthrottled=function(){var t=this.getHashString();try{e.window.history.replaceState(e.window.history.state,"",t)}catch(e){}};var An={linearity:.3,easing:e.bezier(0,0,.3,1)},Sn=e.extend({deceleration:2500,maxSpeed:1400},An),Mn=e.extend({deceleration:20,maxSpeed:1400},An),En=e.extend({deceleration:1e3,maxSpeed:360},An),Cn=e.extend({deceleration:1e3,maxSpeed:90},An),Nn=function(e){this._map=e,this.clear()};function On(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function In(t,r,n){var a=n.maxSpeed,i=n.linearity,o=n.deceleration,s=e.clamp(t*i/(r/1e3),-a,a),l=Math.abs(s)/(o*i);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}Nn.prototype.clear=function(){this._inertiaBuffer=[]},Nn.prototype.record=function(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:t})},Nn.prototype._drainInertiaBuffer=function(){for(var t=this._inertiaBuffer,r=e.browser.now();t.length>0&&r-t[0].time>160;)t.shift()},Nn.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},n=0,a=this._inertiaBuffer;n<a.length;n+=1){var i=a[n].settings;r.zoom+=i.zoomDelta||0,r.bearing+=i.bearingDelta||0,r.pitch+=i.pitchDelta||0,i.panDelta&&r.pan._add(i.panDelta),i.around&&(r.around=i.around),i.pinchAround&&(r.pinchAround=i.pinchAround)}var o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(r.pan.mag()){var l=In(r.pan.mag(),o,e.extend({},Sn,t||{}));s.offset=r.pan.mult(l.amount/r.pan.mag()),s.center=this._map.transform.center,On(s,l)}if(r.zoom){var c=In(r.zoom,o,Mn);s.zoom=this._map.transform.zoom+c.amount,On(s,c)}if(r.bearing){var u=In(r.bearing,o,En);s.bearing=this._map.transform.bearing+e.clamp(u.amount,-179,179),On(s,u)}if(r.pitch){var f=In(r.pitch,o,Cn);s.pitch=this._map.transform.pitch+f.amount,On(s,f)}if(s.zoom||s.bearing){var p=void 0===r.pinchAround?r.around:r.pinchAround;s.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),e.extend(s,{noMoveStart:!0})}};var Pn=function(t){function n(n,a,i,o){void 0===o&&(o={});var s=r.mousePos(a.getCanvasContainer(),i),l=a.unproject(s);t.call(this,n,e.extend({point:s,lngLat:l,originalEvent:i},o)),this._defaultPrevented=!1,this.target=a}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var a={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},a.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,a),n}(e.Event),Rn=function(t){function n(n,a,i){var o="touchend"===n?i.changedTouches:i.touches,s=r.touchPos(a.getCanvasContainer(),o),l=s.map((function(e){return a.unproject(e)})),c=s.reduce((function(e,t,r,n){return e.add(t.div(n.length))}),new e.Point(0,0)),u=a.unproject(c);t.call(this,n,{points:s,point:c,lngLats:l,lngLat:u,originalEvent:i}),this._defaultPrevented=!1}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var a={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},a.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,a),n}(e.Event),Ln=function(e){function t(t,r,n){e.call(this,t,{originalEvent:n}),this._defaultPrevented=!1}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={defaultPrevented:{configurable:!0}};return t.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(t.prototype,r),t}(e.Event),Fn=function(e,t){this._map=e,this._clickTolerance=t.clickTolerance};Fn.prototype.reset=function(){delete this._mousedownPos},Fn.prototype.wheel=function(e){return this._firePreventable(new Ln(e.type,this._map,e))},Fn.prototype.mousedown=function(e,t){return this._mousedownPos=t,this._firePreventable(new Pn(e.type,this._map,e))},Fn.prototype.mouseup=function(e){this._map.fire(new Pn(e.type,this._map,e))},Fn.prototype.click=function(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new Pn(e.type,this._map,e))},Fn.prototype.dblclick=function(e){return this._firePreventable(new Pn(e.type,this._map,e))},Fn.prototype.mouseover=function(e){this._map.fire(new Pn(e.type,this._map,e))},Fn.prototype.mouseout=function(e){this._map.fire(new Pn(e.type,this._map,e))},Fn.prototype.touchstart=function(e){return this._firePreventable(new Rn(e.type,this._map,e))},Fn.prototype.touchmove=function(e){this._map.fire(new Rn(e.type,this._map,e))},Fn.prototype.touchend=function(e){this._map.fire(new Rn(e.type,this._map,e))},Fn.prototype.touchcancel=function(e){this._map.fire(new Rn(e.type,this._map,e))},Fn.prototype._firePreventable=function(e){if(this._map.fire(e),e.defaultPrevented)return{}},Fn.prototype.isEnabled=function(){return!0},Fn.prototype.isActive=function(){return!1},Fn.prototype.enable=function(){},Fn.prototype.disable=function(){};var Bn=function(e){this._map=e};Bn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Bn.prototype.mousemove=function(e){this._map.fire(new Pn(e.type,this._map,e))},Bn.prototype.mousedown=function(){this._delayContextMenu=!0},Bn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Pn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Bn.prototype.contextmenu=function(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new Pn(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()},Bn.prototype.isEnabled=function(){return!0},Bn.prototype.isActive=function(){return!1},Bn.prototype.enable=function(){},Bn.prototype.disable=function(){};var zn=function(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1};function jn(e,t){for(var r={},n=0;n<e.length;n++)r[e[n].identifier]=t[n];return r}zn.prototype.isEnabled=function(){return!!this._enabled},zn.prototype.isActive=function(){return!!this._active},zn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},zn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},zn.prototype.mousedown=function(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(r.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)},zn.prototype.mousemoveWindow=function(e,t){if(this._active){var n=t;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var a=this._startPos;this._lastPos=n,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));var i=Math.min(a.x,n.x),o=Math.max(a.x,n.x),s=Math.min(a.y,n.y),l=Math.max(a.y,n.y);r.setTransform(this._box,"translate("+i+"px,"+s+"px)"),this._box.style.width=o-i+"px",this._box.style.height=l-s+"px"}}},zn.prototype.mouseupWindow=function(t,n){var a=this;if(this._active&&0===t.button){var i=this._startPos,o=n;if(this.reset(),r.suppressClick(),i.x!==o.x||i.y!==o.y)return this._map.fire(new e.Event("boxzoomend",{originalEvent:t})),{cameraAnimation:function(e){return e.fitScreenCoordinates(i,o,a._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",t)}},zn.prototype.keydown=function(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))},zn.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},zn.prototype._fireEvent=function(t,r){return this._map.fire(new e.Event(t,{originalEvent:r}))};var Un=function(e){this.reset(),this.numTouches=e.numTouches};Un.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Un.prototype.touchstart=function(t,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){for(var r=new e.Point(0,0),n=0,a=t;n<a.length;n+=1){var i=a[n];r._add(i)}return r.div(t.length)}(r),this.touches=jn(n,r)))},Un.prototype.touchmove=function(e,t,r){if(!this.aborted&&this.centroid){var n=jn(r,t);for(var a in this.touches){var i=this.touches[a],o=n[a];(!o||o.dist(i)>30)&&(this.aborted=!0)}}},Un.prototype.touchend=function(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var $n=function(e){this.singleTap=new Un(e),this.numTaps=e.numTaps,this.reset()};$n.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},$n.prototype.touchstart=function(e,t,r){this.singleTap.touchstart(e,t,r)},$n.prototype.touchmove=function(e,t,r){this.singleTap.touchmove(e,t,r)},$n.prototype.touchend=function(e,t,r){var n=this.singleTap.touchend(e,t,r);if(n){var a=e.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(n)<30;if(a&&i||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Vn=function(){this._zoomIn=new $n({numTouches:1,numTaps:2}),this._zoomOut=new $n({numTouches:2,numTaps:1}),this.reset()};Vn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Vn.prototype.touchstart=function(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)},Vn.prototype.touchmove=function(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)},Vn.prototype.touchend=function(e,t,r){var n=this,a=this._zoomIn.touchend(e,t,r),i=this._zoomOut.touchend(e,t,r);return a?(this._active=!0,e.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(a)},{originalEvent:e})}}):i?(this._active=!0,e.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(i)},{originalEvent:e})}}):void 0},Vn.prototype.touchcancel=function(){this.reset()},Vn.prototype.enable=function(){this._enabled=!0},Vn.prototype.disable=function(){this._enabled=!1,this.reset()},Vn.prototype.isEnabled=function(){return this._enabled},Vn.prototype.isActive=function(){return this._active};var qn=function(e){this.reset(),this._clickTolerance=e.clickTolerance||1};qn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},qn.prototype._correctButton=function(e,t){return!1},qn.prototype._move=function(e,t){return{}},qn.prototype.mousedown=function(e,t){if(!this._lastPoint){var n=r.mouseButton(e);this._correctButton(e,n)&&(this._lastPoint=t,this._eventButton=n)}},qn.prototype.mousemoveWindow=function(e,t){var r=this._lastPoint;if(r&&(e.preventDefault(),this._moved||!(t.dist(r)<this._clickTolerance)))return this._moved=!0,this._lastPoint=t,this._move(r,t)},qn.prototype.mouseupWindow=function(e){r.mouseButton(e)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},qn.prototype.enable=function(){this._enabled=!0},qn.prototype.disable=function(){this._enabled=!1,this.reset()},qn.prototype.isEnabled=function(){return this._enabled},qn.prototype.isActive=function(){return this._active};var Wn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.mousedown=function(t,r){e.prototype.mousedown.call(this,t,r),this._lastPoint&&(this._active=!0)},t.prototype._correctButton=function(e,t){return 0===t&&!e.ctrlKey},t.prototype._move=function(e,t){return{around:t,panDelta:t.sub(e)}},t}(qn),Hn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._correctButton=function(e,t){return 0===t&&e.ctrlKey||2===t},t.prototype._move=function(e,t){var r=.8*(t.x-e.x);if(r)return this._active=!0,{bearingDelta:r}},t.prototype.contextmenu=function(e){e.preventDefault()},t}(qn),Gn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._correctButton=function(e,t){return 0===t&&e.ctrlKey||2===t},t.prototype._move=function(e,t){var r=-.5*(t.y-e.y);if(r)return this._active=!0,{pitchDelta:r}},t.prototype.contextmenu=function(e){e.preventDefault()},t}(qn),Xn=function(e){this._minTouches=1,this._clickTolerance=e.clickTolerance||1,this.reset()};Xn.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new e.Point(0,0)},Xn.prototype.touchstart=function(e,t,r){return this._calculateTransform(e,t,r)},Xn.prototype.touchmove=function(e,t,r){if(this._active)return e.preventDefault(),this._calculateTransform(e,t,r)},Xn.prototype.touchend=function(e,t,r){this._calculateTransform(e,t,r),this._active&&r.length<this._minTouches&&this.reset()},Xn.prototype.touchcancel=function(){this.reset()},Xn.prototype._calculateTransform=function(t,r,n){n.length>0&&(this._active=!0);var a=jn(n,r),i=new e.Point(0,0),o=new e.Point(0,0),s=0;for(var l in a){var c=a[l],u=this._touches[l];u&&(i._add(c),o._add(c.sub(u)),s++,a[l]=c)}if(this._touches=a,!(s<this._minTouches)&&o.mag()){var f=o.div(s);if(this._sum._add(f),!(this._sum.mag()<this._clickTolerance))return{around:i.div(s),panDelta:f}}},Xn.prototype.enable=function(){this._enabled=!0},Xn.prototype.disable=function(){this._enabled=!1,this.reset()},Xn.prototype.isEnabled=function(){return this._enabled},Xn.prototype.isActive=function(){return this._active};var Yn=function(){this.reset()};function Zn(e,t,r){for(var n=0;n<e.length;n++)if(e[n].identifier===r)return t[n]}function Kn(e,t){return Math.log(e/t)/Math.LN2}Yn.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Yn.prototype._start=function(e){},Yn.prototype._move=function(e,t,r){return{}},Yn.prototype.touchstart=function(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))},Yn.prototype.touchmove=function(e,t,r){if(this._firstTwoTouches){e.preventDefault();var n=this._firstTwoTouches,a=n[0],i=n[1],o=Zn(r,t,a),s=Zn(r,t,i);if(o&&s){var l=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],l,e)}}},Yn.prototype.touchend=function(e,t,n){if(this._firstTwoTouches){var a=this._firstTwoTouches,i=a[0],o=a[1],s=Zn(n,t,i),l=Zn(n,t,o);s&&l||(this._active&&r.suppressClick(),this.reset())}},Yn.prototype.touchcancel=function(){this.reset()},Yn.prototype.enable=function(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around},Yn.prototype.disable=function(){this._enabled=!1,this.reset()},Yn.prototype.isEnabled=function(){return this._enabled},Yn.prototype.isActive=function(){return this._active};var Jn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),delete this._distance,delete this._startDistance},t.prototype._start=function(e){this._startDistance=this._distance=e[0].dist(e[1])},t.prototype._move=function(e,t){var r=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Kn(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Kn(this._distance,r),pinchAround:t}},t}(Yn);function Qn(e,t){return 180*e.angleWith(t)/Math.PI}var ea=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},t.prototype._start=function(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])},t.prototype._move=function(e,t){var r=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Qn(this._vector,r),pinchAround:t}},t.prototype._isBelowThreshold=function(e){this._minDiameter=Math.min(this._minDiameter,e.mag());var t=25/(Math.PI*this._minDiameter)*360,r=Qn(e,this._startVector);return Math.abs(r)<t},t}(Yn);function ta(e){return Math.abs(e.y)>Math.abs(e.x)}var ra=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},t.prototype._start=function(e){this._lastPoints=e,ta(e[0].sub(e[1]))&&(this._valid=!1)},t.prototype._move=function(e,t,r){var n=e[0].sub(this._lastPoints[0]),a=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,a,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+a.y)/2*-.5}},t.prototype.gestureBeginsVertically=function(e,t,r){if(void 0!==this._valid)return this._valid;var n=e.mag()>=2,a=t.mag()>=2;if(n||a){if(!n||!a)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var i=e.y>0==t.y>0;return ta(e)&&ta(t)&&i}},t}(Yn),na={panStep:100,bearingStep:15,pitchStep:10},aa=function(){var e=na;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep};function ia(e){return e*(2-e)}aa.prototype.reset=function(){this._active=!1},aa.prototype.keydown=function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var r=0,n=0,a=0,i=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?a=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?a=-1:(e.preventDefault(),o=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ia,zoom:r?Math.round(l)+r*(e.shiftKey?2:1):l,bearing:s.getBearing()+n*t._bearingStep,pitch:s.getPitch()+a*t._pitchStep,offset:[-i*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}},aa.prototype.enable=function(){this._enabled=!0},aa.prototype.disable=function(){this._enabled=!1,this.reset()},aa.prototype.isEnabled=function(){return this._enabled},aa.prototype.isActive=function(){return this._active};var oa=function(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,e.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};oa.prototype.setZoomRate=function(e){this._defaultZoomRate=e},oa.prototype.setWheelZoomRate=function(e){this._wheelZoomRate=e},oa.prototype.isEnabled=function(){return!!this._enabled},oa.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},oa.prototype.isZooming=function(){return!!this._zooming},oa.prototype.enable=function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&"center"===e.around)},oa.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},oa.prototype.wheel=function(t){if(this.isEnabled()){var r=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,n=e.browser.now(),a=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":a>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(a*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}},oa.prototype._onTimeout=function(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},oa.prototype._start=function(t){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},oa.prototype.renderFrame=function(){return this._onScrollFrame()},oa.prototype._onScrollFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,a=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==a&&(a=1/a);var i="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(i*a))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var f=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),p=c(f);o=e.number(l,s,p),f<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},oa.prototype._smoothOutEasing=function(t){var r=e.ease;if(this._prevEase){var n=this._prevEase,a=(e.browser.now()-n.start)/n.duration,i=n.easing(a+.01)-n.easing(a),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.bezier(o,s,.25,1)}return this._prevEase={start:e.browser.now(),duration:t,easing:r},r},oa.prototype.reset=function(){this._active=!1};var sa=function(e,t){this._clickZoom=e,this._tapZoom=t};sa.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},sa.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},sa.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},sa.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var la=function(){this.reset()};la.prototype.reset=function(){this._active=!1},la.prototype.dblclick=function(e,t){return e.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}},la.prototype.enable=function(){this._enabled=!0},la.prototype.disable=function(){this._enabled=!1,this.reset()},la.prototype.isEnabled=function(){return this._enabled},la.prototype.isActive=function(){return this._active};var ca=function(){this._tap=new $n({numTouches:1,numTaps:1}),this.reset()};ca.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ca.prototype.touchstart=function(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))},ca.prototype.touchmove=function(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=t[0],a=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:a/128}}}else this._tap.touchmove(e,t,r)},ca.prototype.touchend=function(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)},ca.prototype.touchcancel=function(){this.reset()},ca.prototype.enable=function(){this._enabled=!0},ca.prototype.disable=function(){this._enabled=!1,this.reset()},ca.prototype.isEnabled=function(){return this._enabled},ca.prototype.isActive=function(){return this._active};var ua=function(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r};ua.prototype.enable=function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},ua.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},ua.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},ua.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var fa=function(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r};fa.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},fa.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},fa.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},fa.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var pa=function(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};pa.prototype.enable=function(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},pa.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},pa.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},pa.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},pa.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},pa.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var ha=function(e){return e.zoom||e.drag||e.pitch||e.rotate},da=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(e.Event);function ma(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var ga=function(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Nn(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),e.bindAll(["handleEvent","handleWindowEvent"],this);var a=this._el;this._listeners=[[a,"touchstart",{passive:!1}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[e.window,"blur",void 0]];for(var i=0,o=this._listeners;i<o.length;i+=1){var s=o[i],l=s[0],c=s[1],u=s[2];r.addEventListener(l,c,l===e.window.document?this.handleWindowEvent:this.handleEvent,u)}};ga.prototype.destroy=function(){for(var t=0,n=this._listeners;t<n.length;t+=1){var a=n[t],i=a[0],o=a[1],s=a[2];r.removeEventListener(i,o,i===e.window.document?this.handleWindowEvent:this.handleEvent,s)}},ga.prototype._addDefaultHandlers=function(e){var t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new Fn(t,e));var n=t.boxZoom=new zn(t,e);this._add("boxZoom",n);var a=new Vn,i=new la;t.doubleClickZoom=new sa(i,a),this._add("tapZoom",a),this._add("clickZoom",i);var o=new ca;this._add("tapDragZoom",o);var s=t.touchPitch=new ra;this._add("touchPitch",s);var l=new Hn(e),c=new Gn(e);t.dragRotate=new fa(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);var u=new Wn(e),f=new Xn(e);t.dragPan=new ua(r,u,f),this._add("mousePan",u),this._add("touchPan",f,["touchZoom","touchRotate"]);var p=new ea,h=new Jn;t.touchZoomRotate=new pa(r,h,p,o),this._add("touchRotate",p,["touchPan","touchZoom"]),this._add("touchZoom",h,["touchPan","touchRotate"]);var d=t.scrollZoom=new oa(t,this);this._add("scrollZoom",d,["mousePan"]);var m=t.keyboard=new aa;this._add("keyboard",m),this._add("blockableMapEvent",new Bn(t));for(var g=0,y=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<y.length;g+=1){var v=y[g];e.interactive&&e[v]&&t[v].enable(e[v])}},ga.prototype._add=function(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t},ga.prototype.stop=function(){if(!this._updatingCamera){for(var e=0,t=this._handlers;e<t.length;e+=1)t[e].handler.reset();this._inertia.clear(),this._fireEvents({},{}),this._changes=[]}},ga.prototype.isActive=function(){for(var e=0,t=this._handlers;e<t.length;e+=1)if(t[e].handler.isActive())return!0;return!1},ga.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},ga.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},ga.prototype.isMoving=function(){return Boolean(ha(this._eventsInProgress))||this.isZooming()},ga.prototype._blockedByActive=function(e,t,r){for(var n in e)if(n!==r&&(!t||t.indexOf(n)<0))return!0;return!1},ga.prototype.handleWindowEvent=function(e){this.handleEvent(e,e.type+"Window")},ga.prototype._getMapTouches=function(e){for(var t=[],r=0,n=e;r<n.length;r+=1){var a=n[r],i=a.target;this._el.contains(i)&&t.push(a)}return t},ga.prototype.handleEvent=function(e,t){if("blur"!==e.type){this._updatingCamera=!0;for(var n="renderFrame"===e.type?void 0:e,a={needsRenderFrame:!1},i={},o={},s=e.touches?this._getMapTouches(e.touches):void 0,l=s?r.touchPos(this._el,s):r.mousePos(this._el,e),c=0,u=this._handlers;c<u.length;c+=1){var f=u[c],p=f.handlerName,h=f.handler,d=f.allowed;if(h.isEnabled()){var m=void 0;this._blockedByActive(o,d,p)?h.reset():h[t||e.type]&&(m=h[t||e.type](e,l,s),this.mergeHandlerResult(a,i,m,p,n),m&&m.needsRenderFrame&&this._triggerRenderFrame()),(m||h.isActive())&&(o[p]=h)}}var g={};for(var y in this._previousActiveHandlers)o[y]||(g[y]=n);this._previousActiveHandlers=o,(Object.keys(g).length||ma(a))&&(this._changes.push([a,i,g]),this._triggerRenderFrame()),(Object.keys(o).length||ma(a))&&this._map._stop(!0),this._updatingCamera=!1;var v=a.cameraAnimation;v&&(this._inertia.clear(),this._fireEvents({},{}),this._changes=[],v(this._map))}else this.stop()},ga.prototype.mergeHandlerResult=function(t,r,n,a,i){if(n){e.extend(t,n);var o={handlerName:a,originalEvent:n.originalEvent||i};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}},ga.prototype._applyChanges=function(){for(var t={},r={},n={},a=0,i=this._changes;a<i.length;a+=1){var o=i[a],s=o[0],l=o[1],c=o[2];s.panDelta&&(t.panDelta=(t.panDelta||new e.Point(0,0))._add(s.panDelta)),s.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(t.around=s.around),void 0!==s.pinchAround&&(t.pinchAround=s.pinchAround),s.noInertia&&(t.noInertia=s.noInertia),e.extend(r,l),e.extend(n,c)}this._updateMapTransform(t,r,n),this._changes=[]},ga.prototype._updateMapTransform=function(e,t,r){var n=this._map,a=n.transform;if(!ma(e))return this._fireEvents(t,r);var i=e.panDelta,o=e.zoomDelta,s=e.bearingDelta,l=e.pitchDelta,c=e.around,u=e.pinchAround;void 0!==u&&(c=u),n._stop(!0),c=c||n.transform.centerPoint;var f=a.pointLocation(i?c.sub(i):c);s&&(a.bearing+=s),l&&(a.pitch+=l),o&&(a.zoom+=o),a.setLocationAtPoint(f,c),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,r)},ga.prototype._fireEvents=function(t,r){var n=this,a=ha(this._eventsInProgress),i=ha(t),o={};for(var s in t){var l=t[s].originalEvent;this._eventsInProgress[s]||(o[s+"start"]=l),this._eventsInProgress[s]=t[s]}for(var c in!a&&i&&this._fireEvent("movestart",i.originalEvent),o)this._fireEvent(c,o[c]);for(var u in t.rotate&&(this._bearingChanged=!0),i&&this._fireEvent("move",i.originalEvent),t){var f=t[u].originalEvent;this._fireEvent(u,f)}var p,h={};for(var d in this._eventsInProgress){var m=this._eventsInProgress[d],g=m.handlerName,y=m.originalEvent;this._handlersById[g].isActive()||(delete this._eventsInProgress[d],p=r[g]||y,h[d+"end"]=p)}for(var v in h)this._fireEvent(v,h[v]);var b=ha(this._eventsInProgress);if((a||i)&&!b){this._updatingCamera=!0;var x=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),_=function(e){return 0!==e&&-n._bearingSnap<e&&e<n._bearingSnap};x?(_(x.bearing||this._map.getBearing())&&(x.bearing=0),this._map.easeTo(x,{originalEvent:p})):(this._map.fire(new e.Event("moveend",{originalEvent:p})),_(this._map.getBearing())&&this._map.resetNorth()),this._bearingChanged=!1,this._updatingCamera=!1}},ga.prototype._fireEvent=function(t,r){this._map.fire(new e.Event(t,r?{originalEvent:r}:{}))},ga.prototype._triggerRenderFrame=function(){var e=this;void 0===this._frameId&&(this._frameId=this._map._requestRenderFrame((function(t){delete e._frameId,e.handleEvent(new da("renderFrame",{timeStamp:t})),e._applyChanges()})))};var ya=function(t){function r(r,n){t.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,e.bindAll(["_renderFrameCallback"],this)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(e,t){return this.jumpTo({center:e},t)},r.prototype.panBy=function(t,r,n){return t=e.Point.convert(t).mult(-1),this.panTo(this.transform.center,e.extend({offset:t},r),n)},r.prototype.panTo=function(t,r,n){return this.easeTo(e.extend({center:t},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(e,t){return this.jumpTo({zoom:e},t),this},r.prototype.zoomTo=function(t,r,n){return this.easeTo(e.extend({zoom:t},r),n)},r.prototype.zoomIn=function(e,t){return this.zoomTo(this.getZoom()+1,e,t),this},r.prototype.zoomOut=function(e,t){return this.zoomTo(this.getZoom()-1,e,t),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(e,t){return this.jumpTo({bearing:e},t),this},r.prototype.getPadding=function(){return this.transform.padding},r.prototype.setPadding=function(e,t){return this.jumpTo({padding:e},t),this},r.prototype.rotateTo=function(t,r,n){return this.easeTo(e.extend({bearing:t},r),n)},r.prototype.resetNorth=function(t,r){return this.rotateTo(0,e.extend({duration:1e3},t),r),this},r.prototype.resetNorthPitch=function(t,r){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},t),r),this},r.prototype.snapToNorth=function(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(e,t){return this.jumpTo({pitch:e},t),this},r.prototype.cameraForBounds=function(t,r){return t=e.LngLatBounds.convert(t),this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),0,r)},r.prototype._cameraForBoxAndBearing=function(t,r,n,a){var i={top:0,bottom:0,right:0,left:0};if("number"==typeof(a=e.extend({padding:i,offset:[0,0],maxZoom:this.transform.maxZoom},a)).padding){var o=a.padding;a.padding={top:o,bottom:o,right:o,left:o}}a.padding=e.extend(i,a.padding);var s=this.transform,l=s.padding,c=s.project(e.LngLat.convert(t)),u=s.project(e.LngLat.convert(r)),f=c.rotate(-n*Math.PI/180),p=u.rotate(-n*Math.PI/180),h=new e.Point(Math.max(f.x,p.x),Math.max(f.y,p.y)),d=new e.Point(Math.min(f.x,p.x),Math.min(f.y,p.y)),m=h.sub(d),g=(s.width-(l.left+l.right+a.padding.left+a.padding.right))/m.x,y=(s.height-(l.top+l.bottom+a.padding.top+a.padding.bottom))/m.y;if(!(y<0||g<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(g,y)),a.maxZoom),b=e.Point.convert(a.offset),x=(a.padding.left-a.padding.right)/2,_=(a.padding.top-a.padding.bottom)/2,w=new e.Point(b.x+x,b.y+_).mult(s.scale/s.zoomScale(v));return{center:s.unproject(c.add(u).div(2).sub(w)),zoom:v,bearing:n}}e.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},r.prototype.fitBounds=function(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)},r.prototype.fitScreenCoordinates=function(t,r,n,a,i){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.Point.convert(t)),this.transform.pointLocation(e.Point.convert(r)),n,a),a,i)},r.prototype._fitInternal=function(t,r,n){return t?(delete(r=e.extend(t,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this},r.prototype.jumpTo=function(t,r){this.stop();var n=this.transform,a=!1,i=!1,o=!1;return"zoom"in t&&n.zoom!==+t.zoom&&(a=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.LngLat.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(i=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(o=!0,n.pitch=+t.pitch),null==t.padding||n.isPaddingEqual(t.padding)||(n.padding=t.padding),this.fire(new e.Event("movestart",r)).fire(new e.Event("move",r)),a&&this.fire(new e.Event("zoomstart",r)).fire(new e.Event("zoom",r)).fire(new e.Event("zoomend",r)),i&&this.fire(new e.Event("rotatestart",r)).fire(new e.Event("rotate",r)).fire(new e.Event("rotateend",r)),o&&this.fire(new e.Event("pitchstart",r)).fire(new e.Event("pitch",r)).fire(new e.Event("pitchend",r)),this.fire(new e.Event("moveend",r))},r.prototype.easeTo=function(t,r){var n=this;this._stop(!1,t.easeId),(!1===(t=e.extend({offset:[0,0],duration:500,easing:e.ease},t)).animate||!t.essential&&e.browser.prefersReducedMotion)&&(t.duration=0);var a=this.transform,i=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="zoom"in t?+t.zoom:i,u="bearing"in t?this._normalizeBearing(t.bearing,o):o,f="pitch"in t?+t.pitch:s,p="padding"in t?t.padding:a.padding,h=e.Point.convert(t.offset),d=a.centerPoint.add(h),m=a.pointLocation(d),g=e.LngLat.convert(t.center||m);this._normalizeCenter(g);var y,v,b=a.project(m),x=a.project(g).sub(b),_=a.zoomScale(c-i);t.around&&(y=e.LngLat.convert(t.around),v=a.locationPoint(y));var w={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||c!==i,this._rotating=this._rotating||o!==u,this._pitching=this._pitching||f!==s,this._padding=!a.isPaddingEqual(p),this._easeId=t.easeId,this._prepareEase(r,t.noMoveStart,w),clearTimeout(this._easeEndTimeoutID),this._ease((function(t){if(n._zooming&&(a.zoom=e.number(i,c,t)),n._rotating&&(a.bearing=e.number(o,u,t)),n._pitching&&(a.pitch=e.number(s,f,t)),n._padding&&(a.interpolatePadding(l,p,t),d=a.centerPoint.add(h)),y)a.setLocationAtPoint(y,v);else{var m=a.zoomScale(a.zoom-i),g=c>i?Math.min(2,_):Math.max(.5,_),w=Math.pow(g,1-t),k=a.unproject(b.add(x.mult(t*w)).mult(m));a.setLocationAtPoint(a.renderWorldCopies?k.wrap():k,d)}n._fireMoveEvents(r)}),(function(e){n._afterEase(r,e)}),t),this},r.prototype._prepareEase=function(t,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.Event("pitchstart",t))},r.prototype._fireMoveEvents=function(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))},r.prototype._afterEase=function(t,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,a=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.Event("zoomend",t)),a&&this.fire(new e.Event("rotateend",t)),i&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}},r.prototype.flyTo=function(t,r){var n=this;if(!t.essential&&e.browser.prefersReducedMotion){var a=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(a,r)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var i=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in t?e.clamp(+t.zoom,i.minZoom,i.maxZoom):o,f="bearing"in t?this._normalizeBearing(t.bearing,s):s,p="pitch"in t?+t.pitch:l,h="padding"in t?t.padding:i.padding,d=i.zoomScale(u-o),m=e.Point.convert(t.offset),g=i.centerPoint.add(m),y=i.pointLocation(g),v=e.LngLat.convert(t.center||y);this._normalizeCenter(v);var b=i.project(y),x=i.project(v).sub(b),_=t.curve,w=Math.max(i.width,i.height),k=w/d,D=x.mag();if("minZoom"in t){var T=e.clamp(Math.min(t.minZoom,o,u),i.minZoom,i.maxZoom),A=w/i.zoomScale(T-o);_=Math.sqrt(A/D*2)}var S=_*_;function M(e){var t=(k*k-w*w+(e?-1:1)*S*S*D*D)/(2*(e?k:w)*S*D);return Math.log(Math.sqrt(t*t+1)-t)}function E(e){return(Math.exp(e)-Math.exp(-e))/2}function C(e){return(Math.exp(e)+Math.exp(-e))/2}var N=M(0),O=function(e){return C(N)/C(N+_*e)},I=function(e){return w*((C(N)*(E(t=N+_*e)/C(t))-E(N))/S)/D;var t},P=(M(1)-N)/_;if(Math.abs(D)<1e-6||!isFinite(P)){if(Math.abs(w-k)<1e-6)return this.easeTo(t,r);var R=k<w?-1:1;P=Math.abs(Math.log(k/w))/_,I=function(){return 0},O=function(e){return Math.exp(R*_*e)}}if("duration"in t)t.duration=+t.duration;else{var L="screenSpeed"in t?+t.screenSpeed/_:+t.speed;t.duration=1e3*P/L}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==f,this._pitching=p!==l,this._padding=!i.isPaddingEqual(h),this._prepareEase(r,!1),this._ease((function(t){var a=t*P,d=1/O(a);i.zoom=1===t?u:o+i.scaleZoom(d),n._rotating&&(i.bearing=e.number(s,f,t)),n._pitching&&(i.pitch=e.number(l,p,t)),n._padding&&(i.interpolatePadding(c,h,t),g=i.centerPoint.add(m));var y=1===t?v:i.unproject(b.add(x.mult(I(a))).mult(d));i.setLocationAtPoint(i.renderWorldCopies?y.wrap():y,g),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),t),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}if(!e){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(t,r,n){!1===n.animate||0===n.duration?(t(1),r()):(this._easeStart=e.browser.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var t=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(t,r){t=e.wrap(t,-180,180);var n=Math.abs(t-r);return Math.abs(t-360-r)<n&&(t-=360),Math.abs(t+360-r)<n&&(t+=360),t},r.prototype._normalizeCenter=function(e){var t=this.transform;if(t.renderWorldCopies&&!t.lngRange){var r=e.lng-t.center.lng;e.lng+=r>180?-360:r<-180?360:0}},r}(e.Evented),va=function(t){void 0===t&&(t={}),this.options=t,e.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};va.prototype.getDefaultPosition=function(){return"bottom-right"},va.prototype.onAdd=function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},va.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},va.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){var n=r.reduce((function(e,t,n){return t.value&&(e+=t.key+"="+t.value+(n<r.length-1?"&":"")),e}),"?");t.href=e.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),t.rel="noopener nofollow"}},va.prototype._updateData=function(e){!e||"metadata"!==e.sourceDataType&&"style"!==e.dataType||(this._updateAttributions(),this._updateEditLink())},va.prototype._updateAttributions=function(){if(this._map.style){var e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map((function(e){return"string"!=typeof e?"":e}))):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){var t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}var r=this._map.style.sourceCaches;for(var n in r){var a=r[n];if(a.used){var i=a.getSource();i.attribution&&e.indexOf(i.attribution)<0&&e.push(i.attribution)}}e.sort((function(e,t){return e.length-t.length}));var o=(e=e.filter((function(t,r){for(var n=r+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,e.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},va.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var ba=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};ba.prototype.onAdd=function(e){this._map=e,this._container=r.create("div","mapboxgl-ctrl");var t=r.create("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ba.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ba.prototype.getDefaultPosition=function(){return"bottom-left"},ba.prototype._updateLogo=function(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},ba.prototype._logoRequired=function(){if(this._map.style){var e=this._map.style.sourceCaches;for(var t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},ba.prototype._updateCompact=function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}};var xa=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};xa.prototype.add=function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t},xa.prototype.remove=function(e){for(var t=this._currentlyRunning,r=0,n=t?this._queue.concat(t):this._queue;r<n.length;r+=1){var a=n[r];if(a.id===e)return void(a.cancelled=!0)}},xa.prototype.run=function(e){void 0===e&&(e=0);var t=this._currentlyRunning=this._queue;this._queue=[];for(var r=0,n=t;r<n.length;r+=1){var a=n[r];if(!a.cancelled&&(a.callback(e),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},xa.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var _a={"FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},wa=e.window.HTMLImageElement,ka=e.window.HTMLElement,Da=e.window.ImageBitmap,Ta={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Aa=function(n){function a(t){var r=this;if(null!=(t=e.extend({},Ta,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var a=new kn(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies);if(n.call(this,a,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new xa,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},_a,t.locale),this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken),"string"==typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error("Container '"+t.container+"' not found.")}else{if(!(t.container instanceof ka))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==e.window&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new ga(this,t);var i="string"==typeof t.hash&&t.hash||void 0;this._hash=t.hash&&new Tn(i).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new va({customAttribution:t.customAttribution})),this.addControl(new ba,t.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(t){r._update("style"===t.dataType),r.fire(new e.Event(t.dataType+"data",t))})),this.on("dataloading",(function(t){r.fire(new e.Event(t.dataType+"dataloading",t))}))}n&&(a.__proto__=n),a.prototype=Object.create(n&&n.prototype),a.prototype.constructor=a;var i={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return a.prototype._getMapId=function(){return this._mapId},a.prototype.addControl=function(t,r){if(void 0===r&&t.getDefaultPosition&&(r=t.getDefaultPosition()),void 0===r&&(r="top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=t.onAdd(this);this._controls.push(t);var a=this._controlPositions[r];return-1!==r.indexOf("bottom")?a.insertBefore(n,a.firstChild):a.appendChild(n),this},a.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this},a.prototype.resize=function(t){var r=this._containerDimensions(),n=r[0],a=r[1];this._resizeCanvas(n,a),this.transform.resize(n,a),this.painter.resize(n,a);var i=!this._moving;return i&&(this.stop(),this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t))),this.fire(new e.Event("resize",t)),i&&this.fire(new e.Event("moveend",t)),this},a.prototype.getBounds=function(){return this.transform.getBounds()},a.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},a.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()},a.prototype.setMinZoom=function(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},a.prototype.getMinZoom=function(){return this.transform.minZoom},a.prototype.setMaxZoom=function(e){if((e=null==e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")},a.prototype.getMaxZoom=function(){return this.transform.maxZoom},a.prototype.setMinPitch=function(e){if((e=null==e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()<e&&this.setPitch(e),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},a.prototype.getMinPitch=function(){return this.transform.minPitch},a.prototype.setMaxPitch=function(e){if((e=null==e?60:e)>60)throw new Error("maxPitch must be less than or equal to 60");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")},a.prototype.getMaxPitch=function(){return this.transform.maxPitch},a.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},a.prototype.setRenderWorldCopies=function(e){return this.transform.renderWorldCopies=e,this._update()},a.prototype.project=function(t){return this.transform.locationPoint(e.LngLat.convert(t))},a.prototype.unproject=function(t){return this.transform.pointLocation(e.Point.convert(t))},a.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},a.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},a.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},a.prototype._createDelegatedListener=function(e,t,r){var n,a=this;if("mouseenter"===e||"mouseover"===e){var i=!1;return{layer:t,listener:r,delegates:{mousemove:function(n){var o=a.getLayer(t)?a.queryRenderedFeatures(n.point,{layers:[t]}):[];o.length?i||(i=!0,r.call(a,new Pn(e,a,n.originalEvent,{features:o}))):i=!1},mouseout:function(){i=!1}}}}if("mouseleave"===e||"mouseout"===e){var o=!1;return{layer:t,listener:r,delegates:{mousemove:function(n){(a.getLayer(t)?a.queryRenderedFeatures(n.point,{layers:[t]}):[]).length?o=!0:o&&(o=!1,r.call(a,new Pn(e,a,n.originalEvent)))},mouseout:function(t){o&&(o=!1,r.call(a,new Pn(e,a,t.originalEvent)))}}}}return{layer:t,listener:r,delegates:(n={},n[e]=function(e){var n=a.getLayer(t)?a.queryRenderedFeatures(e.point,{layers:[t]}):[];n.length&&(e.features=n,r.call(a,e),delete e.features)},n)}},a.prototype.on=function(e,t,r){if(void 0===r)return n.prototype.on.call(this,e,t);var a=this._createDelegatedListener(e,t,r);for(var i in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(a),a.delegates)this.on(i,a.delegates[i]);return this},a.prototype.once=function(e,t,r){if(void 0===r)return n.prototype.once.call(this,e,t);var a=this._createDelegatedListener(e,t,r);for(var i in a.delegates)this.once(i,a.delegates[i]);return this},a.prototype.off=function(e,t,r){var a=this;return void 0===r?n.prototype.off.call(this,e,t):(this._delegatedListeners&&this._delegatedListeners[e]&&function(n){for(var i=n[e],o=0;o<i.length;o++){var s=i[o];if(s.layer===t&&s.listener===r){for(var l in s.delegates)a.off(l,s.delegates[l]);return i.splice(o,1),a}}}(this._delegatedListeners),this)},a.prototype.queryRenderedFeatures=function(t,r){if(!this.style)return[];var n;if(void 0!==r||void 0===t||t instanceof e.Point||Array.isArray(t)||(r=t,t=void 0),r=r||{},(t=t||[[0,0],[this.transform.width,this.transform.height]])instanceof e.Point||"number"==typeof t[0])n=[e.Point.convert(t)];else{var a=e.Point.convert(t[0]),i=e.Point.convert(t[1]);n=[a,new e.Point(i.x,a.y),i,new e.Point(a.x,i.y),a]}return this.style.queryRenderedFeatures(n,r,this.transform)},a.prototype.querySourceFeatures=function(e,t){return this.style.querySourceFeatures(e,t)},a.prototype.setStyle=function(t,r){return!1!==(r=e.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(t,r))},a.prototype._getUIString=function(e){var t=this._locale[e];if(null==t)throw new Error("Missing UI string '"+e+"'");return t},a.prototype._updateStyle=function(e,t){return this.style&&(this.style.setEventedParent(null),this.style._remove()),e?(this.style=new Vt(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e):this.style.loadJSON(e),this):(delete this.style,this)},a.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Vt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},a.prototype._diffStyle=function(t,r){var n=this;if("string"==typeof t){var a=this._requestManager.normalizeStyleURL(t),i=this._requestManager.transformRequest(a,e.ResourceType.Style);e.getJSON(i,(function(t,a){t?n.fire(new e.ErrorEvent(t)):a&&n._updateDiff(a,r)}))}else"object"==typeof t&&this._updateDiff(t,r)},a.prototype._updateDiff=function(t,r){try{this.style.setState(t)&&this._update(!0)}catch(n){e.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+".  Rebuilding the style from scratch."),this._updateStyle(t,r)}},a.prototype.getStyle=function(){if(this.style)return this.style.serialize()},a.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():e.warnOnce("There is no style added to the map.")},a.prototype.addSource=function(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)},a.prototype.isSourceLoaded=function(t){var r=this.style&&this.style.sourceCaches[t];if(void 0!==r)return r.loaded();this.fire(new e.ErrorEvent(new Error("There is no source with ID '"+t+"'")))},a.prototype.areTilesLoaded=function(){var e=this.style&&this.style.sourceCaches;for(var t in e){var r=e[t]._tiles;for(var n in r){var a=r[n];if("loaded"!==a.state&&"errored"!==a.state)return!1}}return!0},a.prototype.addSourceType=function(e,t,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,r)},a.prototype.removeSource=function(e){return this.style.removeSource(e),this._update(!0)},a.prototype.getSource=function(e){return this.style.getSource(e)},a.prototype.addImage=function(t,r,n){void 0===n&&(n={});var a=n.pixelRatio;void 0===a&&(a=1);var i=n.sdf;void 0===i&&(i=!1);var o=n.stretchX,s=n.stretchY,l=n.content;if(this._lazyInitEmptyStyle(),r instanceof wa||Da&&r instanceof Da){var c=e.browser.getImageData(r),u=c.width,f=c.height,p=c.data;this.style.addImage(t,{data:new e.RGBAImage({width:u,height:f},p),pixelRatio:a,stretchX:o,stretchY:s,content:l,sdf:i,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var h=r.width,d=r.height,m=r.data,g=r;this.style.addImage(t,{data:new e.RGBAImage({width:h,height:d},new Uint8Array(m)),pixelRatio:a,stretchX:o,stretchY:s,content:l,sdf:i,version:0,userImage:g}),g.onAdd&&g.onAdd(this,t)}},a.prototype.updateImage=function(t,r){var n=this.style.getImage(t);if(!n)return this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var a=r instanceof wa||Da&&r instanceof Da?e.browser.getImageData(r):r,i=a.width,o=a.height,s=a.data;if(void 0===i||void 0===o)return this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(i!==n.data.width||o!==n.data.height)return this.fire(new e.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var l=!(r instanceof wa||Da&&r instanceof Da);n.data.replace(s,l),this.style.updateImage(t,n)},a.prototype.hasImage=function(t){return t?!!this.style.getImage(t):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)},a.prototype.removeImage=function(e){this.style.removeImage(e)},a.prototype.loadImage=function(t,r){e.getImage(this._requestManager.transformRequest(t,e.ResourceType.Image),r)},a.prototype.listImages=function(){return this.style.listImages()},a.prototype.addLayer=function(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)},a.prototype.moveLayer=function(e,t){return this.style.moveLayer(e,t),this._update(!0)},a.prototype.removeLayer=function(e){return this.style.removeLayer(e),this._update(!0)},a.prototype.getLayer=function(e){return this.style.getLayer(e)},a.prototype.setLayerZoomRange=function(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)},a.prototype.setFilter=function(e,t,r){return void 0===r&&(r={}),this.style.setFilter(e,t,r),this._update(!0)},a.prototype.getFilter=function(e){return this.style.getFilter(e)},a.prototype.setPaintProperty=function(e,t,r,n){return void 0===n&&(n={}),this.style.setPaintProperty(e,t,r,n),this._update(!0)},a.prototype.getPaintProperty=function(e,t){return this.style.getPaintProperty(e,t)},a.prototype.setLayoutProperty=function(e,t,r,n){return void 0===n&&(n={}),this.style.setLayoutProperty(e,t,r,n),this._update(!0)},a.prototype.getLayoutProperty=function(e,t){return this.style.getLayoutProperty(e,t)},a.prototype.setLight=function(e,t){return void 0===t&&(t={}),this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)},a.prototype.getLight=function(){return this.style.getLight()},a.prototype.setFeatureState=function(e,t){return this.style.setFeatureState(e,t),this._update()},a.prototype.removeFeatureState=function(e,t){return this.style.removeFeatureState(e,t),this._update()},a.prototype.getFeatureState=function(e){return this.style.getFeatureState(e)},a.prototype.getContainer=function(){return this._container},a.prototype.getCanvasContainer=function(){return this._canvasContainer},a.prototype.getCanvas=function(){return this._canvas},a.prototype._containerDimensions=function(){var e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]},a.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==e.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},a.prototype._setupContainer=function(){var e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();var t=this._canvasContainer=r.create("div","mapboxgl-canvas-container",e);this._interactive&&t.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var a=this._controlContainer=r.create("div","mapboxgl-control-container",e),i=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(e){i[e]=r.create("div","mapboxgl-ctrl-"+e,a)}))},a.prototype._resizeCanvas=function(t,r){var n=e.browser.devicePixelRatio||1;this._canvas.width=n*t,this._canvas.height=n*r,this._canvas.style.width=t+"px",this._canvas.style.height=r+"px"},a.prototype._setupPainter=function(){var r=e.extend({},t.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);n?(this.painter=new bn(n,this.transform),e.webpSupported.testSupport(n)):this.fire(new e.ErrorEvent(new Error("Failed to initialize WebGL")))},a.prototype._contextLost=function(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.Event("webglcontextlost",{originalEvent:t}))},a.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event("webglcontextrestored",{originalEvent:t}))},a.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},a.prototype._update=function(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this},a.prototype._requestRenderFrame=function(e){return this._update(),this._renderTaskQueue.add(e)},a.prototype._cancelRenderFrame=function(e){this._renderTaskQueue.remove(e)},a.prototype._render=function(t){var r,n=this,a=0,i=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=i.createQueryEXT(),i.beginQueryEXT(i.TIME_ELAPSED_EXT,r),a=e.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),!this._removed){var o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,l=e.browser.now();this.style.zoomHistory.update(s,l);var c=new e.EvaluationParameters(s,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=c.crossFadingFactor();1===u&&u===this._crossFadingFactor||(o=!0,this._crossFadingFactor=u),this.style.update(c)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new e.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new e.Event("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var f=e.browser.now()-a;i.endQueryEXT(i.TIME_ELAPSED_EXT,r),setTimeout((function(){var t=i.getQueryObjectEXT(r,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(r),n.fire(new e.Event("gpu-timing-frame",{cpuTime:f,gpuTime:t}))}),50)}if(this.listens("gpu-timing-layer")){var p=this.painter.collectGpuTimers();setTimeout((function(){var t=n.painter.queryGpuTimers(p);n.fire(new e.Event("gpu-timing-layer",{layerTimes:t}))}),50)}return this._sourcesDirty||this._styleDirty||this._placementDirty||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&(this._fullyLoaded||(this._fullyLoaded=!0),this.fire(new e.Event("idle"))),this}},a.prototype.remove=function(){this._hash&&this._hash.remove();for(var t=0,r=this._controls;t<r.length;t+=1)r[t].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==e.window&&(e.window.removeEventListener("resize",this._onWindowResize,!1),e.window.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext(),Sa(this._canvasContainer),Sa(this._controlContainer),Sa(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new e.Event("remove"))},a.prototype.triggerRepaint=function(){var t=this;this.style&&!this._frame&&(this._frame=e.browser.frame((function(e){t._frame=null,t._render(e)})))},a.prototype._onWindowOnline=function(){this._update()},a.prototype._onWindowResize=function(e){this._trackResize&&this.resize({originalEvent:e})._update()},i.showTileBoundaries.get=function(){return!!this._showTileBoundaries},i.showTileBoundaries.set=function(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())},i.showPadding.get=function(){return!!this._showPadding},i.showPadding.set=function(e){this._showPadding!==e&&(this._showPadding=e,this._update())},i.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},i.showCollisionBoxes.set=function(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())},i.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},i.showOverdrawInspector.set=function(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())},i.repaint.get=function(){return!!this._repaint},i.repaint.set=function(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())},i.vertices.get=function(){return!!this._vertices},i.vertices.set=function(e){this._vertices=e,this._update()},a.prototype._setCacheLimits=function(t,r){e.setCacheLimits(t,r)},i.version.get=function(){return e.version},Object.defineProperties(a.prototype,i),a}(ya);function Sa(e){e.parentNode&&e.parentNode.removeChild(e)}var Ma={showCompass:!0,showZoom:!0,visualizePitch:!1},Ea=function(t){var n=this;this.options=e.extend({},Ma,t),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this.options.showZoom&&(e.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(e){return n._map.zoomIn({},{originalEvent:e})})),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(e){return n._map.zoomOut({},{originalEvent:e})})),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(e.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(e){n.options.visualizePitch?n._map.resetNorthPitch({},{originalEvent:e}):n._map.resetNorth({},{originalEvent:e})})),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Ea.prototype._updateZoomButtons=function(){var e=this._map.getZoom();this._zoomInButton.disabled=e===this._map.getMaxZoom(),this._zoomOutButton.disabled=e===this._map.getMinZoom()},Ea.prototype._rotateCompassArrow=function(){var e=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=e},Ea.prototype.onAdd=function(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Ca(this._map,this._compass,this.options.visualizePitch)),this._container},Ea.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Ea.prototype._createButton=function(e,t){var n=r.create("button",e,this._container);return n.type="button",n.addEventListener("click",t),n},Ea.prototype._setButtonTitle=function(e,t){var r=this._map._getUIString("NavigationControl."+t);e.title=r,e.setAttribute("aria-label",r)};var Ca=function(t,n,a){void 0===a&&(a=!1),this._clickTolerance=10,this.element=n,this.mouseRotate=new Hn({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,a&&(this.mousePitch=new Gn({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(n,"mousedown",this.mousedown),r.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(n,"touchmove",this.touchmove),r.addEventListener(n,"touchend",this.touchend),r.addEventListener(n,"touchcancel",this.reset)};function Na(t,r,n){if(t=new e.LngLat(t.lng,t.lat),r){var a=new e.LngLat(t.lng-360,t.lat),i=new e.LngLat(t.lng+360,t.lat),o=n.locationPoint(t).distSqr(r);n.locationPoint(a).distSqr(r)<o?t=a:n.locationPoint(i).distSqr(r)<o&&(t=i)}for(;Math.abs(t.lng-n.center.lng)>180;){var s=n.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}Ca.prototype.down=function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),r.disableDrag()},Ca.prototype.move=function(e,t){var r=this.map,n=this.mouseRotate.mousemoveWindow(e,t);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var a=this.mousePitch.mousemoveWindow(e,t);a&&a.pitchDelta&&r.setPitch(r.getPitch()+a.pitchDelta)}},Ca.prototype.off=function(){var e=this.element;r.removeEventListener(e,"mousedown",this.mousedown),r.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(e,"touchmove",this.touchmove),r.removeEventListener(e,"touchend",this.touchend),r.removeEventListener(e,"touchcancel",this.reset),this.offTemp()},Ca.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(e.window,"mousemove",this.mousemove),r.removeEventListener(e.window,"mouseup",this.mouseup)},Ca.prototype.mousedown=function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),r.mousePos(this.element,t)),r.addEventListener(e.window,"mousemove",this.mousemove),r.addEventListener(e.window,"mouseup",this.mouseup)},Ca.prototype.mousemove=function(e){this.move(e,r.mousePos(this.element,e))},Ca.prototype.mouseup=function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()},Ca.prototype.touchstart=function(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos))},Ca.prototype.touchmove=function(e){1!==e.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos))},Ca.prototype.touchend=function(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Ca.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Oa={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Ia(e,t,r){var n=e.classList;for(var a in Oa)n.remove("mapboxgl-"+r+"-anchor-"+a);n.add("mapboxgl-"+r+"-anchor-"+t)}var Pa,Ra=function(t){function n(n,a){var i=this;if(t.call(this),(n instanceof e.window.HTMLElement||a)&&(n=e.extend({element:n},a)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._draggable=n&&n.draggable||!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&"auto"!==n.pitchAlignment?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=e.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var o=r.createNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","41px"),o.setAttributeNS(null,"width","27px"),o.setAttributeNS(null,"viewBox","0 0 27 41");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"fill-rule","nonzero");var c=r.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"transform","translate(3.0, 29.0)"),c.setAttributeNS(null,"fill","#000000");for(var u=0,f=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];u<f.length;u+=1){var p=f[u],h=r.createNS("http://www.w3.org/2000/svg","ellipse");h.setAttributeNS(null,"opacity","0.04"),h.setAttributeNS(null,"cx","10.5"),h.setAttributeNS(null,"cy","5.80029008"),h.setAttributeNS(null,"rx",p.rx),h.setAttributeNS(null,"ry",p.ry),c.appendChild(h)}var d=r.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill",this._color);var m=r.createNS("http://www.w3.org/2000/svg","path");m.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),d.appendChild(m);var g=r.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"fill","#000000");var y=r.createNS("http://www.w3.org/2000/svg","path");y.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),g.appendChild(y);var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(6.0, 7.0)"),v.setAttributeNS(null,"fill","#FFFFFF");var b=r.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"transform","translate(8.0, 8.0)");var x=r.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#000000"),x.setAttributeNS(null,"opacity","0.25"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962");var _=r.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#FFFFFF"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962"),b.appendChild(x),b.appendChild(_),l.appendChild(c),l.appendChild(d),l.appendChild(g),l.appendChild(v),l.appendChild(b),o.appendChild(l),this._element.appendChild(o),this._offset=e.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(e){e.preventDefault()})),this._element.addEventListener("mousedown",(function(e){e.preventDefault()})),this._element.addEventListener("focus",(function(){var e=i._map.getContainer();e.scrollTop=0,e.scrollLeft=0})),Ia(this._element,this._anchor,"marker"),this._popup=null}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.prototype.setPopup=function(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){var t=Math.sqrt(Math.pow(13.5,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,-1*(24.6+t)],"bottom-right":[-t,-1*(24.6+t)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},n.prototype._onKeyPress=function(e){var t=e.code,r=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==r&&13!==r||this.togglePopup()},n.prototype._onMapClick=function(e){var t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var e=this._popup;return e?(e.isOpen()?e.remove():e.addTo(this._map),this):this},n.prototype._update=function(e){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Na(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var t="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?t="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(t="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n="rotateX("+this._map.getPitch()+"deg)"),e&&"moveend"!==e.type||(this._pos=this._pos.round()),r.setTransform(this._element,Oa[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+n+" "+t)}},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(t){return this._offset=e.Point.convert(t),this._update(),this},n.prototype._onMove=function(t){this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag"))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(e){this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(e){return this._rotation=e||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(e){return this._rotationAlignment=e||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(e.Evented),La={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Fa=0,Ba=!1,za=function(t){function n(r){t.call(this),this.options=e.extend({},La,r),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(t){var n;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Pa?n(Pa):void 0!==e.window.navigator.permissions?e.window.navigator.permissions.query({name:"geolocation"}).then((function(e){Pa="denied"!==e.state,n(Pa)})):(Pa=!!e.window.navigator.geolocation,n(Pa)),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Fa=0,Ba=!1},n.prototype._isOutOfMapMaxBounds=function(e){var t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitude<t.getWest()||r.longitude>t.getEast()||r.latitude<t.getSouth()||r.latitude>t.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}},n.prototype._updateCamera=function(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,a=this._map.getBearing(),i=e.extend({bearing:a},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),i,{geolocateSource:!0})},n.prototype._updateMarker=function(t){if(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),r=this._map.unproject([1,e]),n=t.distanceTo(r),a=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=a+"px",this._circleElement.style.height=a+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Ba)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(t){var n=this;if(this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{var i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Ra(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ra({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(t){var r=t.originalEvent&&"resize"===t.originalEvent.type;t.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new e.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Fa--,Ba=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Fa>1?(t={maximumAge:6e5,timeout:0},Ba=!0):(t=this.options.positionOptions,Ba=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(e.Evented),ja={maxWidth:100,unit:"metric"},Ua=function(t){this.options=e.extend({},ja,t),e.bindAll(["_onMove","setUnit"],this)};function $a(e,t,r){var n=r&&r.maxWidth||100,a=e._container.clientHeight/2,i=e.unproject([0,a]),o=e.unproject([n,a]),s=i.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Va(t,n,l/5280,e._getUIString("ScaleControl.Miles")):Va(t,n,l,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Va(t,n,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Va(t,n,s/1e3,e._getUIString("ScaleControl.Kilometers")):Va(t,n,s,e._getUIString("ScaleControl.Meters"))}function Va(e,t,r,n){var a,i,o,s=(o=(o=(a=r)/(i=Math.pow(10,(""+Math.floor(a)).length-1)))>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(e){var t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(o),i*o),l=s/r;e.style.width=t*l+"px",e.innerHTML=s+"&nbsp;"+n}Ua.prototype.getDefaultPosition=function(){return"bottom-left"},Ua.prototype._onMove=function(){$a(this._map,this._container,this.options)},Ua.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ua.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ua.prototype.setUnit=function(e){this.options.unit=e,$a(this._map,this._container,this.options)};var qa=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};qa.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},qa.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},qa.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},qa.prototype._setupUI=function(){var t=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden",!0),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},qa.prototype._updateTitle=function(){var e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e},qa.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},qa.prototype._isFullscreen=function(){return this._fullscreen},qa.prototype._changeIcon=function(){(e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},qa.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Wa={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Ha=function(t){function n(r){t.call(this),this.options=e.extend(Object.create(Wa),r),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(t){return this.setDOMContent(e.window.document.createTextNode(t))},n.prototype.setHTML=function(t){var r,n=e.window.document.createDocumentFragment(),a=e.window.document.createElement("body");for(a.innerHTML=t;r=a.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(e){return this.options.maxWidth=e,this._update(),this},n.prototype.setDOMContent=function(e){return this._createContent(),this._content.appendChild(e),this._update(),this},n.prototype.addClassName=function(e){this._container&&this._container.classList.add(e)},n.prototype.removeClassName=function(e){this._container&&this._container.classList.remove(e)},n.prototype.toggleClassName=function(e){if(this._container)return this._container.classList.toggle(e)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(e){this._update(e.point)},n.prototype._onMouseMove=function(e){this._update(e.point)},n.prototype._onDrag=function(e){this._update(e.point)},n.prototype._update=function(t){var n=this,a=this._lngLat||this._trackPointer;if(this._map&&a&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(e){return n._container.classList.add(e)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Na(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var i=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),o=this.options.anchor,s=function t(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new e.Point(0,0),top:new e.Point(0,r),"top-left":new e.Point(n,n),"top-right":new e.Point(-n,n),bottom:new e.Point(0,-r),"bottom-left":new e.Point(n,-n),"bottom-right":new e.Point(-n,-n),left:new e.Point(r,0),right:new e.Point(-r,0)}}if(r instanceof e.Point||Array.isArray(r)){var a=e.Point.convert(r);return{center:a,top:a,"top-left":a,"top-right":a,bottom:a,"bottom-left":a,"bottom-right":a,left:a,right:a}}return{center:e.Point.convert(r.center||[0,0]),top:e.Point.convert(r.top||[0,0]),"top-left":e.Point.convert(r["top-left"]||[0,0]),"top-right":e.Point.convert(r["top-right"]||[0,0]),bottom:e.Point.convert(r.bottom||[0,0]),"bottom-left":e.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(r["bottom-right"]||[0,0]),left:e.Point.convert(r.left||[0,0]),right:e.Point.convert(r.right||[0,0])}}return t(new e.Point(0,0))}(this.options.offset);if(!o){var l,c=this._container.offsetWidth,u=this._container.offsetHeight;l=i.y+s.bottom.y<u?["top"]:i.y>this._map.transform.height-u?["bottom"]:[],i.x<c/2?l.push("left"):i.x>this._map.transform.width-c/2&&l.push("right"),o=0===l.length?"bottom":l.join("-")}var f=i.add(s[o]).round();r.setTransform(this._container,Oa[o]+" translate("+f.x+"px,"+f.y+"px)"),Ia(this._container,o,"popup")}},n.prototype._onClose=function(){this.remove()},n}(e.Evented),Ga={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:Aa,NavigationControl:Ea,GeolocateControl:za,AttributionControl:va,ScaleControl:Ua,FullscreenControl:qa,Popup:Ha,Marker:Ra,Style:Vt,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:function(){Be().acquire(Pe)},clearPrewarmedResources:function(){var e=Le;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(Pe),Le=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return Re.workerCount},set workerCount(e){Re.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){e.clearTileCache(t)},workerUrl:""};return Ga})),r}))},{}],240:[function(e,t,r){"use strict";t.exports=Math.log2||function(e){return Math.log(e)*Math.LOG2E}},{}],241:[function(e,t,r){"use strict";t.exports=function(e,t){t||(t=e,e=window);var r=0,a=0,i=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function c(e,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||c!==a||u!==i||l(s))&&(r=0|e,a=c||0,i=u||0,t&&t(r,a,i,o))}function u(e){c(0,e)}function f(){(r||a||i||o.shift||o.alt||o.meta||o.control)&&(a=i=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function p(e){l(e)&&t&&t(r,a,i,o)}function h(e){0===n.buttons(e)?c(0,e):c(r,e)}function d(e){c(r|n.buttons(e),e)}function m(e){c(r&~n.buttons(e),e)}function g(){s||(s=!0,e.addEventListener("mousemove",h),e.addEventListener("mousedown",d),e.addEventListener("mouseup",m),e.addEventListener("mouseleave",u),e.addEventListener("mouseenter",u),e.addEventListener("mouseout",u),e.addEventListener("mouseover",u),e.addEventListener("blur",f),e.addEventListener("keyup",p),e.addEventListener("keydown",p),e.addEventListener("keypress",p),e!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",p),window.addEventListener("keydown",p),window.addEventListener("keypress",p)))}g();var y={element:e};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(t){t?g():s&&(s=!1,e.removeEventListener("mousemove",h),e.removeEventListener("mousedown",d),e.removeEventListener("mouseup",m),e.removeEventListener("mouseleave",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseout",u),e.removeEventListener("mouseover",u),e.removeEventListener("blur",f),e.removeEventListener("keyup",p),e.removeEventListener("keydown",p),e.removeEventListener("keypress",p),e!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",p),window.removeEventListener("keydown",p),window.removeEventListener("keypress",p)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return a},enumerable:!0},y:{get:function(){return i},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=e("mouse-event")},{"mouse-event":243}],242:[function(e,t,r){var n={left:0,top:0};t.exports=function(e,t,r){t=t||e.currentTarget||e.srcElement,Array.isArray(r)||(r=[0,0]);var a,i=e.clientX||0,o=e.clientY||0,s=(a=t)===window||a===document||a===document.body?n:a.getBoundingClientRect();return r[0]=i-s.left,r[1]=o-s.top,r}},{}],243:[function(e,t,r){"use strict";function n(e){return e.target||e.srcElement||window}r.buttons=function(e){if("object"==typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<<t-1}else if("button"in e){var t;if(1===(t=e.button))return 4;if(2===t)return 2;if(t>=0)return 1<<t}}return 0},r.element=n,r.x=function(e){if("object"==typeof e){if("offsetX"in e)return e.offsetX;var t=n(e).getBoundingClientRect();return e.clientX-t.left}return 0},r.y=function(e){if("object"==typeof e){if("offsetY"in e)return e.offsetY;var t=n(e).getBoundingClientRect();return e.clientY-t.top}return 0}},{}],244:[function(e,t,r){"use strict";var n=e("to-px");t.exports=function(e,t,r){"function"==typeof e&&(r=!!t,t=e,e=window);var a=n("ex",e),i=function(e){r&&e.preventDefault();var n=e.deltaX||0,i=e.deltaY||0,o=e.deltaZ||0,s=1;switch(e.deltaMode){case 1:s=a;break;case 2:s=window.innerHeight}if(i*=s,o*=s,(n*=s)||i||o)return t(n,i,o,e)};return e.addEventListener("wheel",i),i}},{"to-px":314}],245:[function(e,t,n){(function(e,r){(function(){!function(e,r,n){r[e]=r[e]||n(),void 0!==t&&t.exports&&(t.exports=r[e])}("Promise",void 0!==e?e:this,(function(){"use strict";var e,t,n,a=Object.prototype.toString,i=void 0!==r?function(e){return r(e)}:setTimeout;try{Object.defineProperty({},"x",{}),e=function(e,t,r,n){return Object.defineProperty(e,t,{value:r,writable:!0,configurable:!1!==n})}}catch(t){e=function(e,t,r){return e[t]=r,e}}function o(e,r){n.add(e,r),t||(t=i(n.drain))}function s(e){var t,r=typeof e;return null==e||"object"!=r&&"function"!=r||(t=e.then),"function"==typeof t&&t}function l(){for(var e=0;e<this.chain.length;e++)c(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function c(e,t,r){var n,a;try{!1===t?r.reject(e.msg):(n=!0===t?e.msg:t.call(void 0,e.msg))===r.promise?r.reject(TypeError("Promise-chain cycle")):(a=s(n))?a.call(n,r.resolve,r.reject):r.resolve(n)}catch(e){r.reject(e)}}function u(e){var t,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(t=s(e))?o((function(){var n=new h(r);try{t.call(e,(function(){u.apply(n,arguments)}),(function(){f.apply(n,arguments)}))}catch(e){f.call(n,e)}})):(r.msg=e,r.state=1,r.chain.length>0&&o(l,r))}catch(e){f.call(new h(r),e)}}}function f(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&o(l,t))}function p(e,t,r,n){for(var a=0;a<t.length;a++)!function(a){e.resolve(t[a]).then((function(e){r(a,e)}),n)}(a)}function h(e){this.def=e,this.triggered=!1}function d(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function m(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new d(this);this.then=function(e,r){var n={success:"function"!=typeof e||e,failure:"function"==typeof r&&r};return n.promise=new this.constructor((function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");n.resolve=e,n.reject=t})),t.chain.push(n),0!==t.state&&o(l,t),n.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,(function(e){u.call(t,e)}),(function(e){f.call(t,e)}))}catch(e){f.call(t,e)}}n=function(){var e,r,n;function a(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,i){n=new a(t,i),r?r.next=n:e=n,r=n,n=void 0},drain:function(){var n=e;for(e=r=t=void 0;n;)n.fn.call(n.self),n=n.next}}}();var g=e({},"constructor",m,!1);return m.prototype=g,e(g,"__NPO__",0,!1),e(m,"resolve",(function(e){return e&&"object"==typeof e&&1===e.__NPO__?e:new this((function(t,r){if("function"!=typeof t||"function"!=typeof r)throw TypeError("Not a function");t(e)}))})),e(m,"reject",(function(e){return new this((function(t,r){if("function"!=typeof t||"function"!=typeof r)throw TypeError("Not a function");r(e)}))})),e(m,"all",(function(e){var t=this;return"[object Array]"!=a.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");var a=e.length,i=Array(a),o=0;p(t,e,(function(e,t){i[e]=t,++o===a&&r(i)}),n)}))})),e(m,"race",(function(e){var t=this;return"[object Array]"!=a.call(e)?t.reject(TypeError("Not an array")):new t((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");p(t,e,(function(e,t){r(t)}),n)}))})),m}))}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{timers:311}],246:[function(e,t,r){var n=Math.PI,a=c(120);function i(e,t,r,n){return["C",e,t,r,n,r,n]}function o(e,t,r,n,a,i){return["C",e/3+2/3*r,t/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}function s(e,t,r,i,o,c,u,f,p,h){if(h)k=h[0],D=h[1],_=h[2],w=h[3];else{var d=l(e,t,-o);e=d.x,t=d.y;var m=(e-(f=(d=l(f,p,-o)).x))/2,g=(t-(p=d.y))/2,y=m*m/(r*r)+g*g/(i*i);y>1&&(r*=y=Math.sqrt(y),i*=y);var v=r*r,b=i*i,x=(c==u?-1:1)*Math.sqrt(Math.abs((v*b-v*g*g-b*m*m)/(v*g*g+b*m*m)));x==1/0&&(x=1);var _=x*r*g/i+(e+f)/2,w=x*-i*m/r+(t+p)/2,k=Math.asin(((t-w)/i).toFixed(9)),D=Math.asin(((p-w)/i).toFixed(9));(k=e<_?n-k:k)<0&&(k=2*n+k),(D=f<_?n-D:D)<0&&(D=2*n+D),u&&k>D&&(k-=2*n),!u&&D>k&&(D-=2*n)}if(Math.abs(D-k)>a){var T=D,A=f,S=p;D=k+a*(u&&D>k?1:-1);var M=s(f=_+r*Math.cos(D),p=w+i*Math.sin(D),r,i,o,0,u,A,S,[D,T,_,w])}var E=Math.tan((D-k)/4),C=4/3*r*E,N=4/3*i*E,O=[2*e-(e+C*Math.sin(k)),2*t-(t-N*Math.cos(k)),f+C*Math.sin(D),p-N*Math.cos(D),f,p];if(h)return O;M&&(O=O.concat(M));for(var I=0;I<O.length;){var P=l(O[I],O[I+1],o);O[I++]=P.x,O[I++]=P.y}return O}function l(e,t,r){return{x:e*Math.cos(r)-t*Math.sin(r),y:e*Math.sin(r)+t*Math.cos(r)}}function c(e){return e*(n/180)}t.exports=function(e){for(var t,r=[],n=0,a=0,l=0,u=0,f=null,p=null,h=0,d=0,m=0,g=e.length;m<g;m++){var y=e[m],v=y[0];switch(v){case"M":l=y[1],u=y[2];break;case"A":(y=s(h,d,y[1],y[2],c(y[3]),y[4],y[5],y[6],y[7])).unshift("C"),y.length>7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var b=h,x=d;"C"!=t&&"S"!=t||(b+=b-n,x+=x-a),y=["C",b,x,y[1],y[2],y[3],y[4]];break;case"T":"Q"==t||"T"==t?(f=2*h-f,p=2*d-p):(f=h,p=d),y=o(h,d,f,p,y[1],y[2]);break;case"Q":f=y[1],p=y[2],y=o(h,d,y[1],y[2],y[3],y[4]);break;case"L":y=i(h,d,y[1],y[2]);break;case"H":y=i(h,d,y[1],d);break;case"V":y=i(h,d,h,y[1]);break;case"Z":y=i(h,d,l,u)}t=v,h=y[y.length-2],d=y[y.length-1],y.length>4?(n=y[y.length-4],a=y[y.length-3]):(n=h,a=d),r.push(y)}return r}},{}],247:[function(e,t,r){"use strict";var n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}t.exports=function(){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(e){return!1}}()?Object.assign:function(e,t){for(var r,s,l=o(e),c=1;c<arguments.length;c++){for(var u in r=Object(arguments[c]))a.call(r,u)&&(l[u]=r[u]);if(n){s=n(r);for(var f=0;f<s.length;f++)i.call(r,s[f])&&(l[s[f]]=r[s[f]])}}return l}},{}],248:[function(e,t,r){"use strict";function n(e,t){if("string"!=typeof e)return[e];var r=[e];"string"==typeof t||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],a=t.escape||"___",i=!!t.flat;n.forEach((function(e){var t=new RegExp(["\\",e[0],"[^\\",e[0],"\\",e[1],"]*\\",e[1]].join("")),n=[];function i(t,i,o){var s=r.push(t.slice(e[0].length,-e[1].length))-1;return n.push(s),a+s+a}r.forEach((function(e,n){for(var a,o=0;e!=a;)if(a=e,e=e.replace(t,i),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=e})),n=n.reverse(),r=r.map((function(t){return n.forEach((function(r){t=t.replace(new RegExp("(\\"+a+r+"\\"+a+")","g"),e[0]+"$1"+e[1])})),t}))}));var o=new RegExp("\\"+a+"([0-9]+)\\"+a);return i?r:function e(t,r,n){for(var a,i=[],s=0;a=o.exec(t);){if(s++>1e4)throw Error("Circular references in parenthesis");i.push(t.slice(0,a.index)),i.push(e(r[a[1]],r)),t=t.slice(a.index+a[0].length)}return i.push(t),i}(r[0],r)}function a(e,t){if(t&&t.flat){var r,n=t&&t.escape||"___",a=e[0];if(!a)return"";for(var i=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;a!=r;){if(o++>1e4)throw Error("Circular references in "+e);r=a,a=a.replace(i,s)}return a}return e.reduce((function e(t,r){return Array.isArray(r)&&(r=r.reduce(e,"")),t+r}),"");function s(t,r){if(null==e[r])throw Error("Reference "+r+"is undefined");return e[r]}}function i(e,t){return Array.isArray(e)?a(e,t):n(e,t)}i.parse=n,i.stringify=a,t.exports=i},{}],249:[function(e,t,r){"use strict";var n=e("pick-by-alias");t.exports=function(e){var t;return arguments.length>1&&(e=arguments),"string"==typeof e?e=e.split(/\s/).map(parseFloat):"number"==typeof e&&(e=[e]),e.length&&"number"==typeof e[0]?t=1===e.length?{width:e[0],height:e[0],x:0,y:0}:2===e.length?{width:e[0],height:e[1],x:0,y:0}:{x:e[0],y:e[1],width:e[2]-e[0]||0,height:e[3]-e[1]||0}:e&&(t={x:(e=n(e,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:e.top||0},null==e.width?e.right?t.width=e.right-t.x:t.width=0:t.width=e.width,null==e.height?e.bottom?t.height=e.bottom-t.y:t.height=0:t.height=e.height),t}},{"pick-by-alias":253}],250:[function(e,t,r){t.exports=function(e){var t=[];return e.replace(a,(function(e,r,a){var o=r.toLowerCase();for(a=function(e){var t=e.match(i);return t?t.map(Number):[]}(a),"m"==o&&a.length>2&&(t.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),t.push(a);if(a.length<n[o])throw new Error("malformed path data");t.push([r].concat(a.splice(0,n[o])))}})),t};var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},a=/([astvzqmhlc])([^astvzqmhlc]*)/gi,i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},{}],251:[function(e,t,r){t.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},{}],252:[function(e,t,r){(function(e){(function(){(function(){var r,n,a,i,o,s;"undefined"!=typeof performance&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:null!=e&&e.hrtime?(t.exports=function(){return(r()-o)/1e6},n=e.hrtime,i=(r=function(){var e;return 1e9*(e=n())[0]+e[1]})(),s=1e9*e.uptime(),o=i-s):Date.now?(t.exports=function(){return Date.now()-a},a=Date.now()):(t.exports=function(){return(new Date).getTime()-a},a=(new Date).getTime())}).call(this)}).call(this)}).call(this,e("_process"))},{_process:277}],253:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,i,o={};if("string"==typeof t&&(t=a(t)),Array.isArray(t)){var s={};for(i=0;i<t.length;i++)s[t[i]]=!0;t=s}for(n in t)t[n]=a(t[n]);var l={};for(n in t){var c=t[n];if(Array.isArray(c))for(i=0;i<c.length;i++){var u=c[i];if(r&&(l[u]=!0),u in e){if(o[n]=e[u],r)for(var f=i;f<c.length;f++)l[c[f]]=!0;break}}else n in e&&(t[n]&&(o[n]=e[n]),r&&(l[n]=!0))}if(r)for(n in e)l[n]||(o[n]=e[n]);return o};var n={};function a(e){return n[e]?n[e]:("string"==typeof e&&(e=n[e]=e.split(/\s*,\s*|\s+/)),e)}},{}],254:[function(e,t,r){var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),s=e("./lib/segment-chainer"),l=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,f=i();function p(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:l.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:l.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:l.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:l.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:l.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:s(e.segments,f,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,f,e)},union:function(e,t){return p(e,t,n.selectUnion)},intersect:function(e,t){return p(e,t,n.selectIntersect)},difference:function(e,t){return p(e,t,n.selectDifference)},differenceRev:function(e,t){return p(e,t,n.selectDifferenceRev)},xor:function(e,t){return p(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":255,"./lib/epsilon":256,"./lib/geojson":257,"./lib/intersecter":258,"./lib/segment-chainer":260,"./lib/segment-selector":261}],255:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1,"  ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],256:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],s=n[1],l=t[0];return(o-a)*(t[1]-i)-(s-i)*(l-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l<e||l-(i*i+s*s)>-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])<e},pointsSameY:function(t,r){return Math.abs(t[1]-r[1])<e},pointsSame:function(e,r){return t.pointsSameX(e,r)&&t.pointsSameY(e,r)},pointsCompare:function(e,r){return t.pointsSameX(e,r)?t.pointsSameY(e,r)?0:e[1]<r[1]?-1:1:e[0]<r[0]?-1:1},pointsCollinear:function(t,r,n){var a=t[0]-r[0],i=t[1]-r[1],o=r[0]-n[0],s=r[1]-n[1];return Math.abs(a*s-o*i)<e},linesIntersect:function(t,r,n,a){var i=r[0]-t[0],o=r[1]-t[1],s=a[0]-n[0],l=a[1]-n[1],c=i*l-o*s;if(Math.abs(c)<e)return!1;var u=t[0]-n[0],f=t[1]-n[1],p=(s*f-l*u)/c,h=(i*f-o*u)/c,d={alongA:0,alongB:0,pt:[t[0]+p*i,t[1]+p*o]};return d.alongA=p<=-e?-2:p<e?-1:p-1<=-e?0:p-1<e?1:2,d.alongB=h<=-e?-2:h<e?-1:h-1<=-e?0:h-1<e?1:2,d},pointInsideRegion:function(t,r){for(var n=t[0],a=t[1],i=r[r.length-1][0],o=r[r.length-1][1],s=!1,l=0;l<r.length;l++){var c=r[l][0],u=r[l][1];u-a>e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(s=!s),i=c,o=u}return s}};return t}},{}],257:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a<t.length;a++)n=e.selectDifference(e.combine(n,r(t[a])));return n}if("Polygon"===t.type)return e.polygon(r(t.coordinates));if("MultiPolygon"===t.type){for(var n=e.segments({inverted:!1,regions:[]}),a=0;a<t.coordinates.length;a++)n=e.selectUnion(e.combine(n,r(t.coordinates[a])));return e.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(e,t,r){function n(e,r){return t.pointInsideRegion([.5*(e[0][0]+e[1][0]),.5*(e[0][1]+e[1][1])],r)}function a(e){return{region:e,children:[]}}r=e.polygon(e.segments(r));var i=a(null);function o(e,t){for(var r=0;r<e.children.length;r++)if(n(t,(s=e.children[r]).region))return void o(s,t);var i=a(t);for(r=0;r<e.children.length;r++){var s;n((s=e.children[r]).region,t)&&(i.children.push(s),e.children.splice(r,1),r--)}e.children.push(i)}for(var s=0;s<r.regions.length;s++){var l=r.regions[s];l.length<3||o(i,l)}function c(e,t){for(var r=0,n=e[e.length-1][0],a=e[e.length-1][1],i=[],o=0;o<e.length;o++){var s=e[o][0],l=e[o][1];i.push([s,l]),r+=l*n-s*a,n=s,a=l}return r<0!==t&&i.reverse(),i.push([i[0][0],i[0][1]]),i}var u=[];function f(e){var t=[c(e.region,!1)];u.push(t);for(var r=0;r<e.children.length;r++)t.push(p(e.children[r]))}function p(e){for(var t=0;t<e.children.length;t++)f(e.children[t]);return c(e.region,!0)}for(s=0;s<i.children.length;s++)f(i.children[s]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};t.exports=n},{}],258:[function(e,t,r){var n=e("./linked-list");t.exports=function(e,t,r){function a(e,t,n){return{id:r?r.segmentId():-1,start:e,end:t,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var i=n.create();function o(e,r){i.insertBefore(e,(function(n){return function(e,r,n,a,i,o){var s=t.pointsCompare(r,i);return 0!==s?s:t.pointsSame(n,o)?0:e!==a?e?1:-1:t.pointAboveOrOnLine(n,a?i:o,a?o:i)?1:-1}(e.isStart,e.pt,r,n.isStart,n.pt,n.other.pt)<0}))}function s(e,t){var r=function(e,t){var r=n.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null});return o(r,e.end),r}(e,t);return function(e,t,r){var a=n.node({isStart:!1,pt:t.end,seg:t,primary:r,other:e,status:null});e.other=a,o(a,e.pt)}(r,e,t),r}function l(e,t){var n=a(t,e.seg.end,e.seg);return function(e,t){r&&r.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,o(e.other,e.pt)}(e,t),s(n,e.primary)}function c(a,o){var s=n.create();function c(e){return s.findTransition((function(r){var n,a,i,o,s,l;return n=e,a=r.ev,i=n.seg.start,o=n.seg.end,s=a.seg.start,l=a.seg.end,(t.pointsCollinear(i,s,l)?t.pointsCollinear(o,s,l)||t.pointAboveOrOnLine(o,s,l)?1:-1:t.pointAboveOrOnLine(i,s,l)?1:-1)>0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,s=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,s,c,u);if(!1===f){if(!t.pointsCollinear(o,s,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(s,c))return!1;var p=t.pointsSame(o,c),h=t.pointsSame(s,u);if(p&&h)return n;var d=!p&&t.pointBetween(o,c,u),m=!h&&t.pointBetween(s,c,u);if(p)return m?l(n,s):l(e,u),n;d&&(h||(m?l(n,s):l(e,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(e,c):0===f.alongB?l(e,f.pt):1===f.alongB&&l(e,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!i.isEmpty();){var p=i.getHead();if(r&&r.vert(p.pt[0]),p.isStart){r&&r.segmentNew(p.seg,p.primary);var h=c(p),d=h.before?h.before.ev:null,m=h.after?h.after.ev:null;function g(){if(d){var e=u(p,d);if(e)return e}return!!m&&u(p,m)}r&&r.tempStatus(p.seg,!!d&&d.seg,!!m&&m.seg);var y,v,b=g();if(b&&(e?(v=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(b.seg.myFill.above=!b.seg.myFill.above):b.seg.otherFill=p.seg.myFill,r&&r.segmentUpdate(b.seg),p.other.remove(),p.remove()),i.getHead()!==p){r&&r.rewind(p.seg);continue}e?(v=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=m?m.seg.myFill.above:a,p.seg.myFill.above=v?!p.seg.myFill.below:p.seg.myFill.below):null===p.seg.otherFill&&(y=m?p.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:p.primary?o:a,p.seg.otherFill={above:y,below:y}),r&&r.status(p.seg,!!d&&d.seg,!!m&&m.seg),p.other.status=h.insert(n.node({ev:p}))}else{var x=p.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!p.primary){var _=p.seg.myFill;p.seg.myFill=p.seg.otherFill,p.seg.otherFill=_}f.push(p.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],l=0;l<e.length;l++){n=o,o=e[l];var c=t.pointsCompare(n,o);0!==c&&s((a=c<0?n:o,i=c<0?o:n,{id:r?r.segmentId():-1,start:a,end:i,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(e){return c(e,!1)}}:{calculate:function(e,t,r,n){return e.forEach((function(e){s(a(e.start,e.end,e),!0)})),r.forEach((function(e){s(a(e.start,e.end,e),!1)})),c(t,n)}}}},{"./linked-list":259}],259:[function(e,t,r){t.exports={create:function(){var e={root:{root:!0,next:null},exists:function(t){return null!==t&&t!==e.root},isEmpty:function(){return null===e.root.next},getHead:function(){return e.root.next},insertBefore:function(t,r){for(var n=e.root,a=e.root.next;null!==a;){if(r(a))return t.prev=a.prev,t.next=a,a.prev.next=t,void(a.prev=t);n=a,a=a.next}n.next=t,t.prev=n,t.next=null},findTransition:function(t){for(var r=e.root,n=e.root.next;null!==n&&!t(n);)r=n,n=n.next;return{before:r===e.root?null:r,after:n,insert:function(e){return e.prev=r,e.next=n,r.next=e,null!==n&&(n.prev=e),e}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}}},{}],260:[function(e,t,r){t.exports=function(e,t,r){var n=[],a=[];return e.forEach((function(e){var i=e.start,o=e.end;if(t.pointsSame(i,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(e);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},c=s,u=0;u<n.length;u++){var f=(g=n[u])[0],p=(g[1],g[g.length-1]);if(g[g.length-2],t.pointsSame(f,i)){if(D(u,!0,!0))break}else if(t.pointsSame(f,o)){if(D(u,!0,!1))break}else if(t.pointsSame(p,i)){if(D(u,!1,!0))break}else if(t.pointsSame(p,o)&&D(u,!1,!1))break}if(c===s)return n.push([i,o]),void(r&&r.chainNew(i,o));if(c===l){r&&r.chainMatch(s.index);var h=s.index,d=s.matches_pt1?o:i,m=s.matches_head,g=n[h],y=m?g[0]:g[g.length-1],v=m?g[1]:g[g.length-2],b=m?g[g.length-1]:g[0],x=m?g[g.length-2]:g[1];return t.pointsCollinear(v,y,d)&&(m?(r&&r.chainRemoveHead(s.index,d),g.shift()):(r&&r.chainRemoveTail(s.index,d),g.pop()),y=v),t.pointsSame(b,d)?(n.splice(h,1),t.pointsCollinear(x,b,y)&&(m?(r&&r.chainRemoveTail(s.index,y),g.pop()):(r&&r.chainRemoveHead(s.index,y),g.shift())),r&&r.chainClose(s.index),void a.push(g)):void(m?(r&&r.chainAddHead(s.index,d),g.unshift(d)):(r&&r.chainAddTail(s.index,d),g.push(d)))}var _=s.index,w=l.index;r&&r.chainConnect(_,w);var k=n[_].length<n[w].length;s.matches_head?l.matches_head?k?(T(_),A(_,w)):(T(w),A(w,_)):A(w,_):l.matches_head?A(_,w):k?(T(_),A(w,_)):(T(w),A(_,w))}function D(e,t,r){return c.index=e,c.matches_head=t,c.matches_pt1=r,c===s?(c=l,!1):(c=null,!0)}function T(e){r&&r.chainReverse(e),n[e].reverse()}function A(e,a){var i=n[e],o=n[a],s=i[i.length-1],l=i[i.length-2],c=o[0],u=o[1];t.pointsCollinear(l,s,c)&&(r&&r.chainRemoveTail(e,s),i.pop(),s=l),t.pointsCollinear(s,c,u)&&(r&&r.chainRemoveHead(a,c),o.shift()),r&&r.chainJoin(e,a),n[e]=i.concat(o),n.splice(a,1)}})),a}},{}],261:[function(e,t,r){function n(e,t,r){var n=[];return e.forEach((function(e){var a=(e.myFill.above?8:0)+(e.myFill.below?4:0)+(e.otherFill&&e.otherFill.above?2:0)+(e.otherFill&&e.otherFill.below?1:0);0!==t[a]&&n.push({id:r?r.segmentId():-1,start:e.start,end:e.end,myFill:{above:1===t[a],below:2===t[a]},otherFill:null})})),r&&r.selected(n),n}var a={union:function(e,t){return n(e,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],t)},intersect:function(e,t){return n(e,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],t)},difference:function(e,t){return n(e,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],t)},differenceRev:function(e,t){return n(e,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],t)},xor:function(e,t){return n(e,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],t)}};t.exports=a},{}],262:[function(e,t,r){"use strict";var n=e("stream").Transform,a=e("stream-parser");function i(){n.call(this,{readableObjectMode:!0})}function o(e,t,r){Error.call(this),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=e,t&&(this.code=t),r&&(this.statusCode=r)}i.prototype=Object.create(n.prototype),i.prototype.constructor=i,a(i.prototype),r.ParserStream=i,r.sliceEq=function(e,t,r){for(var n=t,a=0;a<r.length;)if(e[n++]!==r[a++])return!1;return!0},r.str2arr=function(e,t){var r=[],n=0;if(t&&"hex"===t)for(;n<e.length;)r.push(parseInt(e.slice(n,n+2),16)),n+=2;else for(;n<e.length;n++)r.push(255&e.charCodeAt(n));return r},r.readUInt16LE=function(e,t){return e[t]|e[t+1]<<8},r.readUInt16BE=function(e,t){return e[t+1]|e[t]<<8},r.readUInt32LE=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|16777216*e[t+3]},r.readUInt32BE=function(e,t){return e[t+3]|e[t+2]<<8|e[t+1]<<16|16777216*e[t]},o.prototype=Object.create(Error.prototype),o.prototype.constructor=o,r.ProbeError=o},{stream:285,"stream-parser":301}],263:[function(e,t,r){"use strict";function n(e,t){var r=new Error(e);return r.code=t,r}function a(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}function i(e,t,r){this.input=e.subarray(t,r),this.start=t;var a=String.fromCharCode.apply(null,this.input.subarray(0,4));if("II*\0"!==a&&"MM\0*"!==a)throw n("invalid TIFF signature","EBADDATA");this.big_endian="M"===a[0]}i.prototype.each=function(e){this.aborted=!1;var t=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:t}];this.ifds_to_read.length>0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},i.prototype.read_uint16=function(e){var t=this.input;if(e+2>t.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*t[e]+t[e+1]:t[e]+256*t[e+1]},i.prototype.read_uint32=function(e){var t=this.input;if(e+4>t.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*t[e]+65536*t[e+1]+256*t[e+2]+t[e+3]:t[e]+256*t[e+1]+65536*t[e+2]+16777216*t[e+3]},i.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},i.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return this.read_uint32(t);case 9:return 0|this.read_uint32(t);default:return null}},i.prototype.scan_ifd=function(e,t,r){var i=this.read_uint16(t);t+=2;for(var o=0;o<i;o++){var s=this.read_uint16(t),l=this.read_uint16(t+2),c=this.read_uint32(t+4),u=this.exif_format_length(l),f=c*u,p=f<=4?t+8:this.read_uint32(t+8),h=!1;if(p+f>this.input.length)throw n("unexpected EOF","EBADDATA");for(var d=[],m=p,g=0;g<c;g++,m+=u){var y=this.exif_format_read(l,m);if(null===y){d=null;break}d.push(y)}if(Array.isArray(d)&&2===l&&(d=a(String.fromCharCode.apply(null,d)))&&"\0"===d[d.length-1]&&(d=d.slice(0,-1)),this.is_subifd_link(e,s)&&Array.isArray(d)&&Number.isInteger(d[0])&&d[0]>0&&(this.ifds_to_read.push({id:s,offset:d[0]}),h=!0),!1===r({is_big_endian:this.big_endian,ifd:e,tag:s,format:l,count:c,entry_offset:t+this.start,data_length:f,data_offset:p+this.start,value:d,is_subifd_link:h}))return void(this.aborted=!0);t+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},t.exports.ExifParser=i,t.exports.get_orientation=function(e){var t=0;try{return new i(e,0,e.length).each((function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch(e){return-1}}},{}],264:[function(e,t,r){"use strict";var n=e("./common").readUInt16BE,a=e("./common").readUInt32BE;function i(e,t){if(e.length<4+t)return null;var r=a(e,t);return e.length<r+t||r<8?null:{boxtype:String.fromCharCode.apply(null,e.slice(t+4,t+8)),data:e.slice(t+8,t+r),end:t+r}}function o(e,t){for(var r=0;;){var n=i(e,r);if(!n)break;switch(n.boxtype){case"ispe":t.sizes.push({width:a(n.data,4),height:a(n.data,8)});break;case"irot":t.transforms.push({type:"irot",value:3&n.data[0]});break;case"imir":t.transforms.push({type:"imir",value:1&n.data[0]})}r=n.end}}function s(e,t,r){for(var n=0,a=0;a<r;a++)n=256*n+(e[t+a]||0);return n}function l(e,t){for(var r=e[4]>>4&15,a=15&e[4],i=e[5]>>4&15,o=n(e,6),l=8,c=0;c<o;c++){var u=n(e,l),f=n(e,l+=2),p=s(e,l+=2,i),h=n(e,l+=i);if(l+=2,0===f&&1===h){var d=s(e,l,r),m=s(e,l+r,a);t.item_loc[u]={length:m,offset:d+p}}l+=h*(r+a)}}function c(e,t){for(var r=n(e,4),a=6,o=0;o<r;o++){var s=i(e,a);if(!s)break;if("infe"===s.boxtype){for(var l=n(s.data,4),c="",u=8;u<s.data.length&&s.data[u];u++)c+=String.fromCharCode(s.data[u]);t.item_inf[c]=l}a=s.end}}function u(e,t){for(var r=0;;){var n=i(e,r);if(!n)break;"ipco"===n.boxtype&&o(n.data,t),r=n.end}}t.exports.unbox=i,t.exports.readSizeFromMeta=function(e){var t={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(function(e,t){for(var r=4;;){var n=i(e,r);if(!n)break;"iprp"===n.boxtype&&u(n.data,t),"iloc"===n.boxtype&&l(n.data,t),"iinf"===n.boxtype&&c(n.data,t),r=n.end}}(e,t),t.sizes.length){var r,n,a,o=(n=(r=t.sizes).reduce((function(e,t){return e.width>t.width||e.width===t.width&&e.height>t.height?e:t})),a=r.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t})),n.width>a.height||n.width===a.height&&n.height>a.width?n:a),s=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(s=0===e.value?r[s]:t[s=t[s=r[s]]]),"irot"===e.type)for(var n=0;n<e.value;n++)s=t[s]}));var f=null;return t.item_inf.Exif&&(f=t.item_loc[t.item_inf.Exif]),{width:o.width,height:o.height,orientation:t.transforms.length?s:null,variants:t.sizes,exif_location:f}}},t.exports.getMimeType=function(e){var t=String.fromCharCode.apply(null,e.slice(0,4)),r={};r[t]=!0;for(var n=8;n<e.length;n+=4)r[String.fromCharCode.apply(null,e.slice(n,n+4))]=!0;if(r.mif1||r.msf1||r.miaf)return"avif"===t||"avis"===t||"avio"===t?{type:"avif",mime:"image/avif"}:"heic"===t||"heix"===t?{type:"heic",mime:"image/heic"}:"hevc"===t||"hevx"===t?{type:"heic",mime:"image/heic-sequence"}:r.avif||r.avis?{type:"avif",mime:"image/avif"}:r.heic||r.heix||r.hevc||r.hevx||r.heis?r.msf1?{type:"heif",mime:"image/heif-sequence"}:{type:"heif",mime:"image/heif"}:{type:"avif",mime:"image/avif"}}},{"./common":262}],265:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt32BE,o=e("../miaf_utils"),s=e("../exif_utils"),l=n("ftyp");t.exports=function(e){if(a(e,4,l)){var t=o.unbox(e,0);if(t){var r=o.getMimeType(t.data);if(r){for(var n,c=t.end;;){var u=o.unbox(e,c);if(!u)break;if(c=u.end,"mdat"===u.boxtype)return;if("meta"===u.boxtype){n=u.data;break}}if(n){var f=o.readSizeFromMeta(n);if(f){var p={width:f.width,height:f.height,type:r.type,mime:r.mime,wUnits:"px",hUnits:"px"};if(f.variants.length>1&&(p.variants=f.variants),f.orientation&&(p.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=e.length){var h=i(e,f.exif_location.offset),d=e.slice(f.exif_location.offset+h+4,f.exif_location.offset+f.exif_location.length),m=s.get_orientation(d);m>0&&(p.orientation=m)}return p}}}}}}},{"../common":262,"../exif_utils":263,"../miaf_utils":264}],266:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=n("BM");t.exports=function(e){if(!(e.length<26)&&a(e,0,o))return{width:i(e,18),height:i(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":262}],267:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=n("GIF87a"),s=n("GIF89a");t.exports=function(e){if(!(e.length<10)&&(a(e,0,o)||a(e,0,s)))return{width:i(e,6),height:i(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":262}],268:[function(e,t,r){"use strict";var n=e("../common").readUInt16LE;t.exports=function(e){var t=n(e,0),r=n(e,2),a=n(e,4);if(0===t&&1===r&&a){for(var i=[],o={width:0,height:0},s=0;s<a;s++){var l=e[6+16*s]||256,c=e[6+16*s+1]||256,u={width:l,height:c};i.push(u),(l>o.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:i,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":262}],269:[function(e,t,r){"use strict";var n=e("../common").readUInt16BE,a=e("../common").str2arr,i=e("../common").sliceEq,o=e("../exif_utils"),s=a("Exif\0\0");t.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1]&&255===e[2])for(var t=2;;){for(;;){if(e.length-t<2)return;if(255===e[t++])break}for(var r,a,l=e[t++];255===l;)l=e[t++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(e.length-t<2)return;r=n(e,t)-2,t+=2}if(217===l||218===l)return;if(225===l&&r>=10&&i(e,t,s)&&(a=o.get_orientation(e.slice(t+6,t+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(e.length-t<r)return;var c={width:n(e,t+3),height:n(e,t+1),type:"jpg",mime:"image/jpeg",wUnits:"px",hUnits:"px"};return a>0&&(c.orientation=a),c}t+=r}}},{"../common":262,"../exif_utils":263}],270:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt32BE,o=n("‰PNG\r\n\n"),s=n("IHDR");t.exports=function(e){if(!(e.length<24)&&a(e,0,o)&&a(e,12,s))return{width:i(e,16),height:i(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":262}],271:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt32BE,o=n("8BPS\0");t.exports=function(e){if(!(e.length<22)&&a(e,0,o))return{width:i(e,18),height:i(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":262}],272:[function(e,t,r){"use strict";function n(e){return"number"==typeof e&&isFinite(e)&&e>0}var a=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(e){return c.test(e)?e.match(c)[0]:"px"}t.exports=function(e){if(function(e){var t,r=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);r<n&&(32===(t=e[r])||9===t||13===t||10===t);)r++;return r!==n&&60===e[r]}(e)){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);var c=(t.match(a)||[""])[0];if(i.test(c)){var f=function(e){var t=e.match(o),r=e.match(s),n=e.match(l);return{width:t&&(t[1]||t[2]),height:r&&(r[1]||r[2]),viewbox:n&&(n[1]||n[2])}}(c),p=parseFloat(f.width),h=parseFloat(f.height);if(f.width&&f.height){if(!n(p)||!n(h))return;return{width:p,height:h,type:"svg",mime:"image/svg+xml",wUnits:u(f.width),hUnits:u(f.height)}}var d=(f.viewbox||"").split(" "),m={width:d[2],height:d[3]},g=parseFloat(m.width),y=parseFloat(m.height);if(n(g)&&n(y)&&u(m.width)===u(m.height)){var v=g/y;if(f.width){if(!n(p))return;return{width:p,height:p/v,type:"svg",mime:"image/svg+xml",wUnits:u(f.width),hUnits:u(f.width)}}if(f.height){if(!n(h))return;return{width:h*v,height:h,type:"svg",mime:"image/svg+xml",wUnits:u(f.height),hUnits:u(f.height)}}return{width:g,height:y,type:"svg",mime:"image/svg+xml",wUnits:u(m.width),hUnits:u(m.height)}}}}}},{}],273:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=e("../common").readUInt16BE,s=e("../common").readUInt32LE,l=e("../common").readUInt32BE,c=n("II*\0"),u=n("MM\0*");function f(e,t,r){return r?o(e,t):i(e,t)}function p(e,t,r){return r?l(e,t):s(e,t)}function h(e,t,r){var n=f(e,t+2,r);return 1!==p(e,t+4,r)||3!==n&&4!==n?null:3===n?f(e,t+8,r):p(e,t+8,r)}t.exports=function(e){if(!(e.length<8)&&(a(e,0,c)||a(e,0,u))){var t=77===e[0],r=p(e,4,t)-8;if(!(r<0)){var n=r+8;if(!(e.length-n<2)){var i=12*f(e,n+0,t);if(!(i<=0||(n+=2,e.length-n<i))){var o,s,l,d;for(o=0;o<i;o+=12)256===(d=f(e,n+o,t))?s=h(e,n+o,t):257===d&&(l=h(e,n+o,t));return s&&l?{width:s,height:l,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}:void 0}}}}}},{"../common":262}],274:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=e("../common").readUInt32LE,s=e("../exif_utils"),l=n("RIFF"),c=n("WEBP");function u(e,t){if(157===e[t+3]&&1===e[t+4]&&42===e[t+5])return{width:16383&i(e,t+6),height:16383&i(e,t+8),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function f(e,t){if(47===e[t]){var r=o(e,t+1);return{width:1+(16383&r),height:1+(r>>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function p(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<<t|e[t+8]<<8|e[t+7]),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}t.exports=function(e){if(!(e.length<16)&&(a(e,0,l)||a(e,8,c))){var t=12,r=null,n=0,i=o(e,4)+8;if(!(i>e.length)){for(;t+8<i;)if(0!==e[t]){var h=String.fromCharCode.apply(null,e.slice(t,t+4)),d=o(e,t+4);"VP8 "===h&&d>=10?r=r||u(e,t+8):"VP8L"===h&&d>=9?r=r||f(e,t+8):"VP8X"===h&&d>=10?r=r||p(e,t+8):"EXIF"===h&&(n=s.get_orientation(e.slice(t+8,t+8+d)),t=1/0),t+=8+d}else t++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":262,"../exif_utils":263}],275:[function(e,t,r){"use strict";t.exports={avif:e("./parse_sync/avif"),bmp:e("./parse_sync/bmp"),gif:e("./parse_sync/gif"),ico:e("./parse_sync/ico"),jpeg:e("./parse_sync/jpeg"),png:e("./parse_sync/png"),psd:e("./parse_sync/psd"),svg:e("./parse_sync/svg"),tiff:e("./parse_sync/tiff"),webp:e("./parse_sync/webp")}},{"./parse_sync/avif":265,"./parse_sync/bmp":266,"./parse_sync/gif":267,"./parse_sync/ico":268,"./parse_sync/jpeg":269,"./parse_sync/png":270,"./parse_sync/psd":271,"./parse_sync/svg":272,"./parse_sync/tiff":273,"./parse_sync/webp":274}],276:[function(e,t,r){"use strict";var n=e("./lib/parsers_sync");t.exports=function(e){return function(e){for(var t=Object.keys(n),r=0;r<t.length;r++){var a=n[t[r]](e);if(a)return a}return null}(e)},t.exports.parsers=n},{"./lib/parsers_sync":275}],277:[function(e,t,r){var n,a,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(e){a=s}}();var c,u=[],f=!1,p=-1;function h(){f&&c&&(f=!1,c.length?u=c.concat(u):p=-1,u.length&&d())}function d(){if(!f){var e=l(h);f=!0;for(var t=u.length;t;){for(c=u,u=[];++p<t;)c&&c[p].run();p=-1,t=u.length}c=null,f=!1,function(e){if(a===clearTimeout)return clearTimeout(e);if((a===s||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(e);try{a(e)}catch(t){try{return a.call(null,e)}catch(t){return a.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function g(){}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];u.push(new m(e,t)),1!==u.length||f||l(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,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}},{}],278:[function(e,t,n){(function(r){(function(){for(var n=e("performance-now"),a="undefined"==typeof window?r:window,i=["moz","webkit"],o="AnimationFrame",s=a["request"+o],l=a["cancel"+o]||a["cancelRequest"+o],c=0;!s&&c<i.length;c++)s=a[i[c]+"Request"+o],l=a[i[c]+"Cancel"+o]||a[i[c]+"CancelRequest"+o];if(!s||!l){var u=0,f=0,p=[];s=function(e){if(0===p.length){var t=n(),r=Math.max(0,1e3/60-(t-u));u=r+t,setTimeout((function(){var e=p.slice(0);p.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(u)}catch(e){setTimeout((function(){throw e}),0)}}),Math.round(r))}return p.push({handle:++f,callback:e,cancelled:!1}),f},l=function(e){for(var t=0;t<p.length;t++)p[t].handle===e&&(p[t].cancelled=!0)}}t.exports=function(e){return s.call(a,e)},t.exports.cancel=function(){l.apply(a,arguments)},t.exports.polyfill=function(e){e||(e=a),e.requestAnimationFrame=s,e.cancelAnimationFrame=l}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"performance-now":252}],279:[function(e,t,r){"use strict";var n=e("array-bounds"),a=e("color-normalize"),i=e("update-diff"),o=e("pick-by-alias"),s=e("object-assign"),l=e("flatten-vertex-data"),c=e("to-float32"),u=c.float32,f=c.fract32;t.exports=function(e,t){if("function"==typeof e?(t||(t={}),t.regl=e):t=e,t.length&&(t.positions=t),!(e=t.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,c,h,d,m,g,y=e._gl,v={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},b=[];return d=e.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),c=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),h=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=e.buffer({usage:"static",type:"float",data:p}),k(t),r=e({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:e.prop("range"),lineWidth:e.prop("lineWidth"),capSize:e.prop("capSize"),opacity:e.prop("opacity"),scale:e.prop("scale"),translate:e.prop("translate"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),viewport:function(e,t){return[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]}},attributes:{color:{buffer:d,offset:function(e,t){return 4*t.offset},divisor:1},position:{buffer:c,offset:function(e,t){return 8*t.offset},divisor:1},positionFract:{buffer:h,offset:function(e,t){return 8*t.offset},divisor:1},error:{buffer:m,offset:function(e,t){return 16*t.offset},divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:e.prop("viewport")},viewport:e.prop("viewport"),stencil:!1,instances:e.prop("count"),count:p.length}),s(x,{update:k,draw:_,destroy:D,regl:e,gl:y,canvas:y.canvas,groups:b}),x;function x(e){e?k(e):null===e&&D(),_()}function _(t){if("number"==typeof t)return w(t);t&&!Array.isArray(t)&&(t=[t]),e._refresh(),b.forEach((function(e,r){e&&(t&&(t[r]?e.draw=!0:e.draw=!1),e.draw?w(r):e.draw=!0)}))}function w(e){"number"==typeof e&&(e=b[e]),null!=e&&e&&e.count&&e.color&&e.opacity&&e.positions&&e.positions.length>1&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],r(e),e.after&&e.after(e))}function k(e){if(e){null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var t=0,r=0;if(x.groups=b=e.map((function(e,c){var u=b[c];return e?("function"==typeof e?e={after:e}:"number"==typeof e[0]&&(e={positions:e}),e=o(e,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(b[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},e=s({},v,e)),i(u,e,[{lineWidth:function(e){return.5*+e},capSize:function(e){return.5*+e},opacity:parseFloat,errors:function(e){return e=l(e),r+=e.length,e},positions:function(e,r){return e=l(e,"float64"),r.count=Math.floor(e.length/2),r.bounds=n(e,2),r.offset=t,t+=r.count,e}},{color:function(e,t){var r=t.count;if(e||(e="transparent"),!Array.isArray(e)||"number"==typeof e[0]){var n=e;e=Array(r);for(var i=0;i<r;i++)e[i]=n}if(e.length<r)throw Error("Not enough colors");for(var o=new Uint8Array(4*r),s=0;s<r;s++){var l=a(e[s],"uint8");o.set(l,4*s)}return o},range:function(e,t,r){var n=t.bounds;return e||(e=n),t.scale=[1/(e[2]-e[0]),1/(e[3]-e[1])],t.translate=[-e[0],-e[1]],t.scaleFract=f(t.scale),t.translateFract=f(t.translate),e},viewport:function(e){var t;return Array.isArray(e)?t={x:e[0],y:e[1],width:e[2]-e[0],height:e[3]-e[1]}:e?(t={x:e.x||e.left||0,y:e.y||e.top||0},e.right?t.width=e.right-t.x:t.width=e.w||e.width||0,e.bottom?t.height=e.bottom-t.y:t.height=e.h||e.height||0):t={x:0,y:0,width:y.drawingBufferWidth,height:y.drawingBufferHeight},t}}]),u):u})),t||r){var p=b.reduce((function(e,t,r){return e+(t?t.count:0)}),0),g=new Float64Array(2*p),_=new Uint8Array(4*p),w=new Float32Array(4*p);b.forEach((function(e,t){if(e){var r=e.positions,n=e.count,a=e.offset,i=e.color,o=e.errors;n&&(_.set(i,4*a),w.set(o,4*a),g.set(r,2*a))}}));var k=u(g);c(k);var D=f(g,k);h(D),d(_),m(w)}}}function D(){c.destroy(),h.destroy(),d.destroy(),m.destroy(),g.destroy()}};var p=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]]},{"array-bounds":71,"color-normalize":89,"flatten-vertex-data":191,"object-assign":247,"pick-by-alias":253,"to-float32":313,"update-diff":329}],280:[function(e,t,r){"use strict";var n=e("color-normalize"),a=e("array-bounds"),i=e("object-assign"),o=e("glslify"),s=e("pick-by-alias"),l=e("flatten-vertex-data"),c=e("earcut"),u=e("array-normalize"),f=e("to-float32"),p=f.float32,h=f.fract32,d=e("es6-weak-map"),m=e("parse-rect"),g=e("array-find-index");function y(e,t){if(!(this instanceof y))return new y(e,t);if("function"==typeof e?(t||(t={}),t.regl=e):t=e,t.length&&(t.positions=t),!(e=t.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=e._gl,this.regl=e,this.passes=[],this.shaders=y.shaders.has(e)?y.shaders.get(e):y.shaders.set(e,y.createShaders(e)).get(e),this.update(t)}t.exports=y,y.dashMult=2,y.maxPatternLength=256,y.precisionThreshold=3e6,y.maxPoints=1e4,y.maxLines=2048,y.shaders=new d,y.createShaders=function(e){var t,r=e.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),n={primitive:"triangle strip",instances:e.prop("count"),count:4,offset:0,uniforms:{miterMode:function(e,t){return"round"===t.join?2:1},miterLimit:e.prop("miterLimit"),scale:e.prop("scale"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),thickness:e.prop("thickness"),dashTexture:e.prop("dashTexture"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),dashLength:e.prop("dashLength"),viewport:function(e,t){return[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]},depth:e.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:function(e,t){return!t.overlay}},stencil:{enable:!1},scissor:{enable:!0,box:e.prop("viewport")},viewport:e.prop("viewport")},a=e(i({vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n       + positionFract * scale + translateFract\n       + position * scaleFract\n       + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform float dashLength, pixelRatio, thickness, opacity, id;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{t=e(i({cull:{enable:!0,face:"back"},vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n  return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n  vec2 adjustedScale;\n  adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n  adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n  vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) <  length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) <  length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position  * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x)  / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x)  / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:e.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(e){t=a}return{fill:e({primitive:"triangle",elements:function(e,t){return t.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n       + positionFract * scale + translateFract\n       + position * scaleFract\n       + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:e.prop("scale"),color:e.prop("fill"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),viewport:function(e,t){return[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]}},attributes:{position:{buffer:e.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:t}},y.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},y.prototype.render=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];t.length&&(e=this).update.apply(e,t),this.draw()},y.prototype.draw=function(){for(var e=this,t=[],r=arguments.length;r--;)t[r]=arguments[r];return(t.length?t:this.passes).forEach((function(t,r){var n;if(t&&Array.isArray(t))return(n=e).draw.apply(n,t);"number"==typeof t&&(t=e.passes[t]),t&&t.count>1&&t.opacity&&(e.regl._refresh(),t.fill&&t.triangles&&t.triangles.length>2&&e.shaders.fill(t),t.thickness&&(t.scale[0]*t.viewport.width>y.precisionThreshold||t.scale[1]*t.viewport.height>y.precisionThreshold||"rect"===t.join||!t.join&&(t.thickness<=2||t.count>=y.maxPoints)?e.shaders.rect(t):e.shaders.miter(t)))})),this},y.prototype.update=function(e){var t=this;if(e){null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var r=this.regl,o=this.gl;if(e.forEach((function(e,f){var d=t.passes[f];if(void 0!==e)if(null!==e){if("number"==typeof e[0]&&(e={positions:e}),e=s(e,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),d||(t.passes[f]=d={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},e=i({},y.defaults,e)),null!=e.thickness&&(d.thickness=parseFloat(e.thickness)),null!=e.opacity&&(d.opacity=parseFloat(e.opacity)),null!=e.miterLimit&&(d.miterLimit=parseFloat(e.miterLimit)),null!=e.overlay&&(d.overlay=!!e.overlay,f<y.maxLines&&(d.depth=2*(y.maxLines-1-f%y.maxLines)/y.maxLines-1)),null!=e.join&&(d.join=e.join),null!=e.hole&&(d.hole=e.hole),null!=e.fill&&(d.fill=e.fill?n(e.fill,"uint8"):null),null!=e.viewport&&(d.viewport=m(e.viewport)),d.viewport||(d.viewport=m([o.drawingBufferWidth,o.drawingBufferHeight])),null!=e.close&&(d.close=e.close),null===e.positions&&(e.positions=[]),e.positions){var v,b;if(e.positions.x&&e.positions.y){var x=e.positions.x,_=e.positions.y;b=d.count=Math.max(x.length,_.length),v=new Float64Array(2*b);for(var w=0;w<b;w++)v[2*w]=x[w],v[2*w+1]=_[w]}else v=l(e.positions,"float64"),b=d.count=Math.floor(v.length/2);var k=d.bounds=a(v,2);if(d.fill){for(var D=[],T={},A=0,S=0,M=0,E=d.count;S<E;S++){var C=v[2*S],N=v[2*S+1];isNaN(C)||isNaN(N)||null==C||null==N?(C=v[2*A],N=v[2*A+1],T[S]=A):A=S,D[M++]=C,D[M++]=N}if(e.splitNull){d.count-1 in T||(T[d.count]=d.count-1);var O=Object.keys(T).map(Number).sort((function(e,t){return e-t})),I=[],P=0,R=null!=d.hole?d.hole[0]:null;if(null!=R){var L=g(O,(function(e){return e>=R}));(O=O.slice(0,L)).push(R)}for(var F=function(e){var t=D.slice(2*P,2*O[e]).concat(R?D.slice(2*R):[]),r=(d.hole||[]).map((function(t){return t-R+(O[e]-P)})),n=c(t,r);n=n.map((function(t){return t+P+(t+P<O[e]?0:R-O[e])})),I.push.apply(I,n),P=O[e]+1},B=0;B<O.length;B++)F(B);for(var z=0,j=I.length;z<j;z++)null!=T[I[z]]&&(I[z]=T[I[z]]);d.triangles=I}else{for(var U=c(D,d.hole||[]),$=0,V=U.length;$<V;$++)null!=T[U[$]]&&(U[$]=T[U[$]]);d.triangles=U}}var q=new Float64Array(v);u(q,2,k);var W=new Float64Array(2*b+6);d.close?v[0]===v[2*b-2]&&v[1]===v[2*b-1]?(W[0]=q[2*b-4],W[1]=q[2*b-3]):(W[0]=q[2*b-2],W[1]=q[2*b-1]):(W[0]=q[0],W[1]=q[1]),W.set(q,2),d.close?v[0]===v[2*b-2]&&v[1]===v[2*b-1]?(W[2*b+2]=q[2],W[2*b+3]=q[3],d.count-=1):(W[2*b+2]=q[0],W[2*b+3]=q[1],W[2*b+4]=q[2],W[2*b+5]=q[3]):(W[2*b+2]=q[2*b-2],W[2*b+3]=q[2*b-1],W[2*b+4]=q[2*b-2],W[2*b+5]=q[2*b-1]);var H=p(W);d.positionBuffer(H);var G=h(W,H);d.positionFractBuffer(G)}if(e.range?d.range=e.range:d.range||(d.range=d.bounds),(e.range||e.positions)&&d.count){var X=d.bounds,Y=X[2]-X[0],Z=X[3]-X[1],K=d.range[2]-d.range[0],J=d.range[3]-d.range[1];d.scale=[Y/K,Z/J],d.translate=[-d.range[0]/K+X[0]/K||0,-d.range[1]/J+X[1]/J||0],d.scaleFract=h(d.scale),d.translateFract=h(d.translate)}if(e.dashes){var Q,ee=0;if(!e.dashes||e.dashes.length<2)ee=1,Q=new Uint8Array([255,255,255,255,255,255,255,255]);else{ee=0;for(var te=0;te<e.dashes.length;++te)ee+=e.dashes[te];Q=new Uint8Array(ee*y.dashMult);for(var re=0,ne=255,ae=0;ae<2;ae++)for(var ie=0;ie<e.dashes.length;++ie){for(var oe=0,se=e.dashes[ie]*y.dashMult*.5;oe<se;++oe)Q[re++]=ne;ne^=255}}d.dashLength=ee,d.dashTexture({channels:1,data:Q,width:Q.length,height:1,mag:"linear",min:"linear"},0,0)}if(e.color){var le=d.count,ce=e.color;ce||(ce="transparent");var ue=new Uint8Array(4*le+4);if(Array.isArray(ce)&&"number"!=typeof ce[0]){for(var fe=0;fe<le;fe++){var pe=n(ce[fe],"uint8");ue.set(pe,4*fe)}ue.set(n(ce[0],"uint8"),4*le)}else for(var he=n(ce,"uint8"),de=0;de<le+1;de++)ue.set(he,4*de);d.colorBuffer({usage:"dynamic",type:"uint8",data:ue})}}else t.passes[f]=null})),e.length<this.passes.length){for(var f=e.length;f<this.passes.length;f++){var d=this.passes[f];d&&(d.colorBuffer.destroy(),d.positionBuffer.destroy(),d.dashTexture.destroy())}this.passes.length=e.length}for(var v=[],b=0;b<this.passes.length;b++)null!==this.passes[b]&&v.push(this.passes[b]);return this.passes=v,this}},y.prototype.destroy=function(){return this.passes.forEach((function(e){e.colorBuffer.destroy(),e.positionBuffer.destroy(),e.dashTexture.destroy()})),this.passes.length=0,this}},{"array-bounds":71,"array-find-index":72,"array-normalize":73,"color-normalize":89,earcut:129,"es6-weak-map":183,"flatten-vertex-data":191,glslify:227,"object-assign":247,"parse-rect":249,"pick-by-alias":253,"to-float32":313}],281:[function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw a}}return i}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var s=e("color-normalize"),l=e("array-bounds"),c=e("color-id"),u=e("@plotly/point-cluster"),f=e("object-assign"),p=e("glslify"),h=e("pick-by-alias"),d=e("update-diff"),m=e("flatten-vertex-data"),g=e("is-iexplorer"),y=e("to-float32"),v=e("parse-rect"),b=x;function x(e,t){var r=this;if(!(this instanceof x))return new x(e,t);"function"==typeof e?(t||(t={}),t.regl=e):(t=e,e=null),t&&t.length&&(t.positions=t);var n,a=(e=t.regl)._gl,i=[];this.tooManyColors=g,n=e.texture({data:new Uint8Array(1020),width:255,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),f(this,{regl:e,gl:a,groups:[],markerCache:[null],markerTextures:[null],palette:i,paletteIds:{},paletteTexture:n,maxColors:255,maxSize:100,canvas:a.canvas}),this.update(t);var o={uniforms:{constPointSize:!!t.constPointSize,opacity:e.prop("opacity"),paletteSize:function(e,t){return[r.tooManyColors?0:255,n.height]},pixelRatio:e.context("pixelRatio"),scale:e.prop("scale"),scaleFract:e.prop("scaleFract"),translate:e.prop("translate"),translateFract:e.prop("translateFract"),markerTexture:e.prop("markerTexture"),paletteTexture:n},attributes:{x:function(e,t){return t.xAttr||{buffer:t.positionBuffer,stride:8,offset:0}},y:function(e,t){return t.yAttr||{buffer:t.positionBuffer,stride:8,offset:4}},xFract:function(e,t){return t.xAttr?{constant:[0,0]}:{buffer:t.positionFractBuffer,stride:8,offset:0}},yFract:function(e,t){return t.yAttr?{constant:[0,0]}:{buffer:t.positionFractBuffer,stride:8,offset:4}},size:function(e,t){return t.size.length?{buffer:t.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(255*t.size/r.maxSize)]}},borderSize:function(e,t){return t.borderSize.length?{buffer:t.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(255*t.borderSize/r.maxSize)]}},colorId:function(e,t){return t.color.length?{buffer:t.colorBuffer,stride:r.tooManyColors?8:4,offset:0}:{constant:r.tooManyColors?i.slice(4*t.color,4*t.color+4):[t.color]}},borderColorId:function(e,t){return t.borderColor.length?{buffer:t.colorBuffer,stride:r.tooManyColors?8:4,offset:r.tooManyColors?4:2}:{constant:r.tooManyColors?i.slice(4*t.borderColor,4*t.borderColor+4):[t.borderColor]}},isActive:function(e,t){return!0===t.activation?{constant:[1]}:t.activation?t.activation:{constant:[0]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:e.prop("viewport")},viewport:e.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:e.prop("elements"),count:e.prop("count"),offset:e.prop("offset"),primitive:"points"},s=f({},o);s.frag=p(["precision highp float;\n#define GLSLIFY 1\n\nuniform float opacity;\nuniform sampler2D markerTexture;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nfloat smoothStep(float x, float y) {\n  return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n  float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth;\n\n  // max-distance alpha\n  if (dist < 0.003) discard;\n\n  // null-border case\n  if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n    float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n    gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity);\n  }\n  else {\n    float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n    float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n    vec4 color = fragBorderColor;\n    color.a *= borderColorAmt;\n    color = mix(color, fragColor, colorAmt);\n    color.a *= opacity;\n\n    gl_FragColor = color;\n  }\n\n}\n"]),s.vert=p(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 scale, scaleFract, translate, translateFract, paletteSize;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n  return isDirect ? id / 255. : texture2D(paletteTexture,\n    vec2(\n      (id.x + .5) / paletteSize.x,\n      (id.y + .5) / paletteSize.y\n    )\n  );\n}\n\nvoid main() {\n  // ignore inactive points\n  if (isActive == 0.) return;\n\n  vec2 position = vec2(x, y);\n  vec2 positionFract = vec2(xFract, yFract);\n\n  vec4 color = getColor(colorId);\n  vec4 borderColor = getColor(borderColorId);\n\n  float size = size * maxSize / 255.;\n  float borderSize = borderSize * maxSize / 255.;\n\n  gl_PointSize = 2. * size * pointSizeScale;\n  fragPointSize = size * pixelRatio;\n\n  vec2 pos = (position + translate) * scale\n      + (positionFract + translateFract) * scale\n      + (position + translate) * scaleFract\n      + (positionFract + translateFract) * scaleFract;\n\n  gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n  fragColor = color;\n  fragBorderColor = borderColor;\n  fragWidth = 1. / gl_PointSize;\n\n  fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n  fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}"]),this.drawMarker=e(s);var l=f({},o);l.frag=p(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nuniform float opacity;\n\nfloat smoothStep(float edge0, float edge1, float x) {\n\tfloat t;\n\tt = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n\treturn t * t * (3.0 - 2.0 * t);\n}\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif (radius > 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=p(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n  return isDirect ? id / 255. : texture2D(paletteTexture,\n    vec2(\n      (id.x + .5) / paletteSize.x,\n      (id.y + .5) / paletteSize.y\n    )\n  );\n}\n\nvoid main() {\n  // ignore inactive points\n  if (isActive == 0.) return;\n\n  vec2 position = vec2(x, y);\n  vec2 positionFract = vec2(xFract, yFract);\n\n  vec4 color = getColor(colorId);\n  vec4 borderColor = getColor(borderColorId);\n\n  float size = size * maxSize / 255.;\n  float borderSize = borderSize * maxSize / 255.;\n\n  gl_PointSize = (size + borderSize) * pointSizeScale;\n\n  vec2 pos = (position + translate) * scale\n      + (positionFract + translateFract) * scale\n      + (position + translate) * scaleFract\n      + (positionFract + translateFract) * scaleFract;\n\n  gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n  fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n  fragColor = color;\n  fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n  fragWidth = 1. / gl_PointSize;\n}\n"]),g&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=e(l)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=this.groups;if(1===r.length&&Array.isArray(r[0])&&(null===r[0][0]||Array.isArray(r[0][0]))&&(r=r[0]),this.regl._refresh(),r.length)for(var i=0;i<r.length;i++)this.drawItem(i,r[i]);else a.forEach((function(t,r){e.drawItem(r)}));return this},x.prototype.drawItem=function(e,t){var r=this.groups,n=r[e];if("number"==typeof t&&(e=t,n=r[t],t=null),n&&n.count&&n.opacity){n.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,n,t));for(var i=[],o=1;o<n.activation.length;o++)n.activation[o]&&(!0===n.activation[o]||n.activation[o].data.length)&&i.push.apply(i,a(this.getMarkerDrawOptions(o,n,t)));i.length&&this.drawMarker(i)}},x.prototype.getMarkerDrawOptions=function(e,t,r){var a=t.range,i=t.tree,o=t.viewport,s=t.activation,l=t.selectionBuffer,c=t.count;if(this.regl,!i)return r?[f({},t,{markerTexture:this.markerTextures[e],activation:s[e],count:r.length,elements:r,offset:0})]:[f({},t,{markerTexture:this.markerTextures[e],activation:s[e],offset:0})];var u=[],p=i.range(a,{lod:!0,px:[(a[2]-a[0])/o.width,(a[3]-a[1])/o.height]});if(r){for(var h=s[e].data,d=new Uint8Array(c),m=0;m<r.length;m++){var g=r[m];d[g]=h?h[g]:1}l.subdata(d)}for(var y=p.length;y--;){var v=n(p[y],2),b=v[0],x=v[1];u.push(f({},t,{markerTexture:this.markerTextures[e],activation:r?l:s[e],offset:b,count:x-b}))}return u},x.prototype.update=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length){1===r.length&&Array.isArray(r[0])&&(r=r[0]);var a=this.groups,i=this.gl,o=this.regl,s=this.maxSize,c=this.maxColors,p=this.palette;this.groups=a=r.map((function(t,r){var n=a[r];if(void 0===t)return n;null===t?t={positions:null}:"function"==typeof t?t={ondraw:t}:"number"==typeof t[0]&&(t={positions:t}),null===(t=h(t,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"})).positions&&(t.positions=[]),null!=t.tooManyColors&&(e.tooManyColors=t.tooManyColors),n||(a[r]=n={id:r,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:o.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},t=f({},x.defaults,t)),t.positions&&!("marker"in t)&&(t.marker=n.marker,delete n.marker),t.marker&&!("positions"in t)&&(t.positions=n.positions,delete n.positions);var g=0,b=0;if(d(n,t,[{snap:!0,size:function(e,t){return null==e&&(e=x.defaults.size),g+=e&&e.length?1:0,e},borderSize:function(e,t){return null==e&&(e=x.defaults.borderSize),g+=e&&e.length?1:0,e},opacity:parseFloat,color:function(t,r){return null==t&&(t=x.defaults.color),t=e.updateColor(t),b++,t},borderColor:function(t,r){return null==t&&(t=x.defaults.borderColor),t=e.updateColor(t),b++,t},bounds:function(e,t,r){return"range"in r||(r.range=null),e},positions:function(e,t,r){var n=t.snap,a=t.positionBuffer,i=t.positionFractBuffer,s=t.selectionBuffer;if(e.x||e.y)return e.x.length?t.xAttr={buffer:o.buffer(e.x),offset:0,stride:4,count:e.x.length}:t.xAttr={buffer:e.x.buffer,offset:4*e.x.offset||0,stride:4*(e.x.stride||1),count:e.x.count},e.y.length?t.yAttr={buffer:o.buffer(e.y),offset:0,stride:4,count:e.y.length}:t.yAttr={buffer:e.y.buffer,offset:4*e.y.offset||0,stride:4*(e.y.stride||1),count:e.y.count},t.count=Math.max(t.xAttr.count,t.yAttr.count),e;e=m(e,"float64");var c=t.count=Math.floor(e.length/2),f=t.bounds=c?l(e,2):null;if(r.range||t.range||(delete t.range,r.range=f),r.marker||t.marker||(delete t.marker,r.marker=null),n&&(!0===n||c>n)?t.tree=u(e,{bounds:f}):n&&n.length&&(t.tree=n),t.tree){var p={primitive:"points",usage:"static",data:t.tree,type:"uint32"};t.elements?t.elements(p):t.elements=o.elements(p)}var h=y.float32(e);return a({data:h,usage:"dynamic"}),i({data:y.fract32(e,h),usage:"dynamic"}),s({data:new Uint8Array(c),type:"uint8",usage:"stream"}),e}},{marker:function(t,r,n){var a=r.activation;if(a.forEach((function(e){return e&&e.destroy&&e.destroy()})),a.length=0,t&&"number"!=typeof t[0]){for(var i=[],s=0,l=Math.min(t.length,r.count);s<l;s++){var c=e.addMarker(t[s]);i[c]||(i[c]=new Uint8Array(r.count)),i[c][s]=1}for(var u=0;u<i.length;u++)if(i[u]){var f={data:i[u],type:"uint8",usage:"static"};a[u]?a[u](f):a[u]=o.buffer(f),a[u].data=i[u]}}else a[e.addMarker(t)]=!0;return t},range:function(e,t,r){var n=t.bounds;if(n)return e||(e=n),t.scale=[1/(e[2]-e[0]),1/(e[3]-e[1])],t.translate=[-e[0],-e[1]],t.scaleFract=y.fract(t.scale),t.translateFract=y.fract(t.translate),e},viewport:function(e){return v(e||[i.drawingBufferWidth,i.drawingBufferHeight])}}]),g){var _=n,w=_.count,k=_.size,D=_.borderSize,T=_.sizeBuffer,A=new Uint8Array(2*w);if(k.length||D.length)for(var S=0;S<w;S++)A[2*S]=Math.round(255*(null==k[S]?k:k[S])/s),A[2*S+1]=Math.round(255*(null==D[S]?D:D[S])/s);T({data:A,usage:"dynamic"})}if(b){var M,E=n,C=E.count,N=E.color,O=E.borderColor,I=E.colorBuffer;if(e.tooManyColors){if(N.length||O.length){M=new Uint8Array(8*C);for(var P=0;P<C;P++){var R=N[P];M[8*P]=p[4*R],M[8*P+1]=p[4*R+1],M[8*P+2]=p[4*R+2],M[8*P+3]=p[4*R+3];var L=O[P];M[8*P+4]=p[4*L],M[8*P+5]=p[4*L+1],M[8*P+6]=p[4*L+2],M[8*P+7]=p[4*L+3]}}}else if(N.length||O.length){M=new Uint8Array(4*C+2);for(var F=0;F<C;F++)null!=N[F]&&(M[4*F]=N[F]%c,M[4*F+1]=Math.floor(N[F]/c)),null!=O[F]&&(M[4*F+2]=O[F]%c,M[4*F+3]=Math.floor(O[F]/c))}I({data:M||new Uint8Array(0),type:"uint8",usage:"dynamic"})}return n}))}},x.prototype.addMarker=function(e){var t,r=this.markerTextures,n=this.regl,a=this.markerCache,i=null==e?0:a.indexOf(e);if(i>=0)return i;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)t=e;else{t=new Uint8Array(e.length);for(var o=0,s=e.length;o<s;o++)t[o]=255*e[o]}var l=Math.floor(Math.sqrt(t.length));return i=r.length,a.push(e),r.push(n.texture({channels:1,data:t,radius:l,mag:"linear",min:"linear"})),i},x.prototype.updateColor=function(e){var t=this.paletteIds,r=this.palette,n=this.maxColors;Array.isArray(e)||(e=[e]);var a=[];if("number"==typeof e[0]){var i=[];if(Array.isArray(e))for(var o=0;o<e.length;o+=4)i.push(e.slice(o,o+4));else for(var l=0;l<e.length;l+=4)i.push(e.subarray(l,l+4));e=i}for(var u=0;u<e.length;u++){var f=e[u];f=s(f,"uint8");var p=c(f,!1);if(null==t[p]){var h=r.length;t[p]=Math.floor(h/4),r[h]=f[0],r[h+1]=f[1],r[h+2]=f[2],r[h+3]=f[3]}a[u]=t[p]}return!this.tooManyColors&&r.length>4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===a.length?a[0]:a},x.prototype.updatePalette=function(e){if(!this.tooManyColors){var t=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*e.length/t);if(n>1)for(var a=.25*(e=e.slice()).length%t;a<n*t;a++)e.push(0,0,0,0);r.height<n&&r.resize(t,n),r.subimage({width:Math.min(.25*e.length,t),height:n,data:e},0,0)}},x.prototype.destroy=function(){return this.groups.forEach((function(e){e.sizeBuffer.destroy(),e.positionBuffer.destroy(),e.positionFractBuffer.destroy(),e.colorBuffer.destroy(),e.activation.forEach((function(e){return e&&e.destroy&&e.destroy()})),e.selectionBuffer.destroy(),e.elements&&e.elements.destroy()})),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach((function(e){return e&&e.destroy&&e.destroy()})),this};var _=e("object-assign");t.exports=function(e,t){var r=new b(e,t),n=r.render.bind(r);return _(n,{render:n,update:r.update.bind(r),draw:r.draw.bind(r),destroy:r.destroy.bind(r),regl:r.regl,gl:r.gl,canvas:r.gl.canvas,groups:r.groups,markers:r.markerCache,palette:r.palette}),n}},{"@plotly/point-cluster":59,"array-bounds":71,"color-id":87,"color-normalize":89,"flatten-vertex-data":191,glslify:227,"is-iexplorer":233,"object-assign":247,"parse-rect":249,"pick-by-alias":253,"to-float32":313,"update-diff":329}],282:[function(e,t,r){"use strict";var n=e("regl-scatter2d"),a=e("pick-by-alias"),i=e("array-bounds"),o=e("raf"),s=e("array-range"),l=e("parse-rect"),c=e("flatten-vertex-data");function u(e,t){if(!(this instanceof u))return new u(e,t);this.traces=[],this.passes={},this.regl=e,this.scatter=n(e),this.canvas=this.scatter.canvas}function f(e,t,r){return(null!=e.id?e.id:e)<<16|(255&t)<<8|255&r}function p(e,t,r){var n,a,i,o,s=e[t],l=e[r];return s.length>2?(s[0],s[2],n=s[1],a=s[3]):s.length?(n=s[0],a=s[1]):(s.x,n=s.y,s.x,s.width,a=s.y+s.height),l.length>2?(i=l[0],o=l[2],l[1],l[3]):l.length?(i=l[0],o=l[1]):(i=l.x,l.y,o=l.x+l.width,l.y,l.height),[i,n,o,a]}function h(e){if("number"==typeof e)return[e,e,e,e];if(2===e.length)return[e[0],e[1],e[0],e[1]];var t=l(e);return[t.x,t.y,t.x+t.width,t.y+t.height]}t.exports=u,u.prototype.render=function(){for(var e,t=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(e=this).update.apply(e,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){t.draw(),t.dirty=!0,t.planned=null}))):(this.draw(),this.dirty=!0,o((function(){t.dirty=!1}))),this)},u.prototype.update=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t.length){for(var n=0;n<t.length;n++)this.updateItem(n,t[n]);this.traces=this.traces.filter(Boolean);for(var a=[],i=0,o=0;o<this.traces.length;o++){for(var s=this.traces[o],l=this.traces[o].passes,c=0;c<l.length;c++)a.push(this.passes[l[c]]);s.passOffset=i,i+=s.passes.length}return(e=this.scatter).update.apply(e,a),this}},u.prototype.updateItem=function(e,t){var r=this.regl;if(null===t)return this.traces[e]=null,this;if(!t)return this;var n,o=a(t,{data:"data items columns rows values dimensions samples x",snap:"snap cluster",size:"sizes size radius",color:"colors color fill fill-color fillColor",opacity:"opacity alpha transparency opaque",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",borderColor:"borderColors borderColor bordercolor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range ranges databox dataBox",viewport:"viewport viewBox viewbox",domain:"domain domains area areas",padding:"pad padding paddings pads margin margins",transpose:"transpose transposed",diagonal:"diagonal diag showDiagonal",upper:"upper up top upperhalf upperHalf showupperhalf showUpper showUpperHalf",lower:"lower low bottom lowerhalf lowerHalf showlowerhalf showLowerHalf showLower"}),s=this.traces[e]||(this.traces[e]={id:e,buffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),color:"black",marker:null,size:12,borderColor:"transparent",borderSize:1,viewport:l([r._gl.drawingBufferWidth,r._gl.drawingBufferHeight]),padding:[0,0,0,0],opacity:1,diagonal:!0,upper:!0,lower:!0});if(null!=o.color&&(s.color=o.color),null!=o.size&&(s.size=o.size),null!=o.marker&&(s.marker=o.marker),null!=o.borderColor&&(s.borderColor=o.borderColor),null!=o.borderSize&&(s.borderSize=o.borderSize),null!=o.opacity&&(s.opacity=o.opacity),o.viewport&&(s.viewport=l(o.viewport)),null!=o.diagonal&&(s.diagonal=o.diagonal),null!=o.upper&&(s.upper=o.upper),null!=o.lower&&(s.lower=o.lower),o.data){s.buffer(c(o.data)),s.columns=o.data.length,s.count=o.data[0].length,s.bounds=[];for(var u=0;u<s.columns;u++)s.bounds[u]=i(o.data[u],1)}o.range&&(s.range=o.range,n=s.range&&"number"!=typeof s.range[0]),o.domain&&(s.domain=o.domain);var d=!1;null!=o.padding&&(Array.isArray(o.padding)&&o.padding.length===s.columns&&"number"==typeof o.padding[o.padding.length-1]?(s.padding=o.padding.map(h),d=!0):s.padding=h(o.padding));var m=s.columns,g=s.count,y=s.viewport.width,v=s.viewport.height,b=s.viewport.x,x=s.viewport.y,_=y/m,w=v/m;s.passes=[];for(var k=0;k<m;k++)for(var D=0;D<m;D++)if((s.diagonal||D!==k)&&(s.upper||!(k>D))&&(s.lower||!(k<D))){var T=f(s.id,k,D),A=this.passes[T]||(this.passes[T]={});if(o.data&&(o.transpose?A.positions={x:{buffer:s.buffer,offset:D,count:g,stride:m},y:{buffer:s.buffer,offset:k,count:g,stride:m}}:A.positions={x:{buffer:s.buffer,offset:D*g,count:g},y:{buffer:s.buffer,offset:k*g,count:g}},A.bounds=p(s.bounds,k,D)),o.domain||o.viewport||o.data){var S=d?p(s.padding,k,D):s.padding;if(s.domain){var M=p(s.domain,k,D),E=M[0],C=M[1],N=M[2],O=M[3];A.viewport=[b+E*y+S[0],x+C*v+S[1],b+N*y-S[2],x+O*v-S[3]]}else A.viewport=[b+D*_+_*S[0],x+k*w+w*S[1],b+(D+1)*_-_*S[2],x+(k+1)*w-w*S[3]]}o.color&&(A.color=s.color),o.size&&(A.size=s.size),o.marker&&(A.marker=s.marker),o.borderSize&&(A.borderSize=s.borderSize),o.borderColor&&(A.borderColor=s.borderColor),o.opacity&&(A.opacity=s.opacity),o.range&&(A.range=n?p(s.range,k,D):s.range||A.bounds),s.passes.push(T)}return this},u.prototype.draw=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t.length){for(var n=[],a=0;a<t.length;a++)if("number"==typeof t[a]){var i=this.traces[t[a]],o=i.passes,l=i.passOffset;n.push.apply(n,s(l,l+o.length))}else if(t[a].length){var c=t[a],u=this.traces[a],f=u.passes,p=u.passOffset;f=f.map((function(e,t){n[p+t]=c}))}(e=this.scatter).draw.apply(e,n)}else this.scatter.draw();return this},u.prototype.destroy=function(){return this.traces.forEach((function(e){e.buffer&&e.buffer.destroy&&e.buffer.destroy()})),this.traces=null,this.passes=null,this.scatter.destroy(),this}},{"array-bounds":71,"array-range":74,"flatten-vertex-data":191,"parse-rect":249,"pick-by-alias":253,raf:278,"regl-scatter2d":281}],283:[function(e,t,r){!function(e,n){"object"==typeof r&&void 0!==t?t.exports=n():e.createREGL=n()}(this,(function(){function e(e,t){this.id=U++,this.type=e,this.data=t}function t(e){return"["+function e(t){if(0===t.length)return[];var r=t.charAt(0),n=t.charAt(t.length-1);if(1<t.length&&r===n&&('"'===r||"'"===r))return['"'+t.substr(1,t.length-2).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];if(r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t))return e(t.substr(0,r.index)).concat(e(r[1])).concat(e(t.substr(r.index+r[0].length)));if(1===(r=t.split(".")).length)return['"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];for(t=[],n=0;n<r.length;++n)t=t.concat(e(r[n]));return t}(e).join("][")+"]"}function r(e){return"string"==typeof e?e.split():e}function n(e){return"string"==typeof e?document.querySelector(e):e}function a(e){var t,a,i,o,s=e||{};e={};var l=[],c=[],u="undefined"==typeof window?1:window.devicePixelRatio,f=!1,p=function(e){},h=function(){};if("string"==typeof s?t=document.querySelector(s):"object"==typeof s&&("string"==typeof s.nodeName&&"function"==typeof s.appendChild&&"function"==typeof s.getBoundingClientRect?t=s:"function"==typeof s.drawArrays||"function"==typeof s.drawElements?i=(o=s).canvas:("gl"in s?o=s.gl:"canvas"in s?i=n(s.canvas):"container"in s&&(a=n(s.container)),"attributes"in s&&(e=s.attributes),"extensions"in s&&(l=r(s.extensions)),"optionalExtensions"in s&&(c=r(s.optionalExtensions)),"onDone"in s&&(p=s.onDone),"profile"in s&&(f=!!s.profile),"pixelRatio"in s&&(u=+s.pixelRatio))),t&&("canvas"===t.nodeName.toLowerCase()?i=t:a=t),!o){if(!i){if(!(t=function(e,t,r){function n(){var t=window.innerWidth,n=window.innerHeight;e!==document.body&&(t=(n=i.getBoundingClientRect()).right-n.left,n=n.bottom-n.top),i.width=r*t,i.height=r*n}var a,i=document.createElement("canvas");return j(i.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),e.appendChild(i),e===document.body&&(i.style.position="absolute",j(e.style,{margin:0,padding:0})),e!==document.body&&"function"==typeof ResizeObserver?(a=new ResizeObserver((function(){setTimeout(n)}))).observe(e):window.addEventListener("resize",n,!1),n(),{canvas:i,onDestroy:function(){a?a.disconnect():window.removeEventListener("resize",n),e.removeChild(i)}}}(a||document.body,0,u)))return null;i=t.canvas,h=t.onDestroy}void 0===e.premultipliedAlpha&&(e.premultipliedAlpha=!0),o=function(e,t){function r(r){try{return e.getContext(r,t)}catch(e){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,e)}return o?{gl:o,canvas:i,container:a,extensions:l,optionalExtensions:c,pixelRatio:u,profile:f,onDone:p,onDestroy:h}:(h(),p("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function i(e,t){for(var r=Array(e),n=0;n<e;++n)r[n]=t(n);return r}function o(e){var t,r;return t=(65535<e)<<4,t|=r=(255<(e>>>=t))<<3,(t|=r=(15<(e>>>=r))<<2)|(r=(3<(e>>>=r))<<1)|e>>>r>>1}function s(){function e(e){e:{for(var t=16;268435456>=t;t*=16)if(e<=t){e=t;break e}e=0}return 0<(t=r[o(e)>>2]).length?t.pop():new ArrayBuffer(e)}function t(e){r[o(e.byteLength)>>2].push(e)}var r=i(8,(function(){return[]}));return{alloc:e,free:t,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(e){t(e.buffer)}}}function l(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||G(e.data))}function c(e,t,r,n,a,i){for(var o=0;o<t;++o)for(var s=e[o],l=0;l<r;++l)for(var c=s[l],u=0;u<n;++u)a[i++]=c[u]}function u(e){return 0|Z[Object.prototype.toString.call(e)]}function f(e,t){for(var r=0;r<t.length;++r)e[r]=t[r]}function p(e,t,r,n,a,i,o){for(var s=0,l=0;l<r;++l)for(var c=0;c<n;++c)e[s++]=t[a*l+i*c+o]}function h(e,t,r,n){function a(t){this.id=c++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,r.profile&&(this.stats={size:0})}function i(t,r,n){t.byteLength=r.byteLength,e.bufferData(t.type,r,n)}function o(e,t,r,n,a,o){if(e.usage=r,Array.isArray(t)){if(e.dtype=n||5126,0<t.length)if(Array.isArray(t[0])){a=ee(t);for(var s=n=1;s<a.length;++s)n*=a[s];e.dimension=n,i(e,t=Q(t,a,e.dtype),r),o?e.persistentData=t:W.freeType(t)}else"number"==typeof t[0]?(e.dimension=a,f(a=W.allocType(e.dtype,t.length),t),i(e,a,r),o?e.persistentData=a:W.freeType(a)):G(t[0])&&(e.dimension=t[0].length,e.dtype=n||u(t[0])||5126,i(e,t=Q(t,[t.length,t[0].length],e.dtype),r),o?e.persistentData=t:W.freeType(t))}else if(G(t))e.dtype=n||u(t),e.dimension=a,i(e,t,r),o&&(e.persistentData=new Uint8Array(new Uint8Array(t.buffer)));else if(l(t)){a=t.shape;var c=t.stride,h=(s=t.offset,0),d=0,m=0,g=0;1===a.length?(h=a[0],d=1,m=c[0],g=0):2===a.length&&(h=a[0],d=a[1],m=c[0],g=c[1]),e.dtype=n||u(t.data)||5126,e.dimension=d,p(a=W.allocType(e.dtype,h*d),t.data,h,d,m,g,s),i(e,a,r),o?e.persistentData=a:W.freeType(a)}else t instanceof ArrayBuffer&&(e.dtype=5121,e.dimension=a,i(e,t,r),o&&(e.persistentData=new Uint8Array(new Uint8Array(t))))}function s(r){t.bufferCount--,n(r),e.deleteBuffer(r.buffer),r.buffer=null,delete h[r.id]}var c=0,h={};a.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},a.prototype.destroy=function(){s(this)};var d=[];return r.profile&&(t.getTotalBufferSize=function(){var e=0;return Object.keys(h).forEach((function(t){e+=h[t].stats.size})),e}),{create:function(n,i,c,d){function m(t){var n=35044,a=null,i=0,s=0,c=1;return Array.isArray(t)||G(t)||l(t)||t instanceof ArrayBuffer?a=t:"number"==typeof t?i=0|t:t&&("data"in t&&(a=t.data),"usage"in t&&(n=J[t.usage]),"type"in t&&(s=K[t.type]),"dimension"in t&&(c=0|t.dimension),"length"in t&&(i=0|t.length)),g.bind(),a?o(g,a,n,s,c,d):(i&&e.bufferData(g.type,i,n),g.dtype=s||5121,g.usage=n,g.dimension=c,g.byteLength=i),r.profile&&(g.stats.size=g.byteLength*te[g.dtype]),m}t.bufferCount++;var g=new a(i);return h[g.id]=g,c||m(n),m._reglType="buffer",m._buffer=g,m.subdata=function(t,r){var n,a=0|(r||0);if(g.bind(),G(t)||t instanceof ArrayBuffer)e.bufferSubData(g.type,a,t);else if(Array.isArray(t)){if(0<t.length)if("number"==typeof t[0]){var i=W.allocType(g.dtype,t.length);f(i,t),e.bufferSubData(g.type,a,i),W.freeType(i)}else(Array.isArray(t[0])||G(t[0]))&&(n=ee(t),i=Q(t,n,g.dtype),e.bufferSubData(g.type,a,i),W.freeType(i))}else if(l(t)){n=t.shape;var o=t.stride,s=i=0,c=0,h=0;1===n.length?(i=n[0],s=1,c=o[0],h=0):2===n.length&&(i=n[0],s=n[1],c=o[0],h=o[1]),n=Array.isArray(t.data)?g.dtype:u(t.data),p(n=W.allocType(n,i*s),t.data,i,s,c,h,t.offset),e.bufferSubData(g.type,a,n),W.freeType(n)}return m},r.profile&&(m.stats=g.stats),m.destroy=function(){s(g)},m},createStream:function(e,t){var r=d.pop();return r||(r=new a(e)),r.bind(),o(r,t,35040,0,1,!1),r},destroyStream:function(e){d.push(e)},clear:function(){X(h).forEach(s),d.forEach(s)},getBuffer:function(e){return e&&e._buffer instanceof a?e._buffer:null},restore:function(){X(h).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:o}}function d(e,t,r,n){function a(e){this.id=c++,s[this.id]=this,this.buffer=e,this.primType=4,this.type=this.vertCount=0}function i(n,a,i,o,s,c,u){var f;if(n.buffer.bind(),a?((f=u)||G(a)&&(!l(a)||G(a.data))||(f=t.oes_element_index_uint?5125:5123),r._initBuffer(n.buffer,a,i,f,3)):(e.bufferData(34963,c,i),n.buffer.dtype=f||5121,n.buffer.usage=i,n.buffer.dimension=3,n.buffer.byteLength=c),f=u,!u){switch(n.buffer.dtype){case 5121:case 5120:f=5121;break;case 5123:case 5122:f=5123;break;case 5125:case 5124:f=5125}n.buffer.dtype=f}n.type=f,0>(a=s)&&(a=n.buffer.byteLength,5123===f?a>>=1:5125===f&&(a>>=2)),n.vertCount=a,a=o,0>o&&(a=4,1===(o=n.buffer.dimension)&&(a=0),2===o&&(a=1),3===o&&(a=4)),n.primType=a}function o(e){n.elementsCount--,delete s[e.id],e.buffer.destroy(),e.buffer=null}var s={},c=0,u={uint8:5121,uint16:5123};t.oes_element_index_uint&&(u.uint32=5125),a.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(e,t){function s(e){if(e)if("number"==typeof e)c(e),f.primType=4,f.vertCount=0|e,f.type=5121;else{var t=null,r=35044,n=-1,a=-1,o=0,p=0;Array.isArray(e)||G(e)||l(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(r=J[e.usage]),"primitive"in e&&(n=re[e.primitive]),"count"in e&&(a=0|e.count),"type"in e&&(p=u[e.type]),"length"in e?o=0|e.length:(o=a,5123===p||5122===p?o*=2:5125!==p&&5124!==p||(o*=4))),i(f,t,r,n,a,o,p)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return s}var c=r.create(null,34963,!0),f=new a(c._buffer);return n.elementsCount++,s(e),s._reglType="elements",s._elements=f,s.subdata=function(e,t){return c.subdata(e,t),s},s.destroy=function(){o(f)},s},createStream:function(e){var t=f.pop();return t||(t=new a(r.create(null,34963,!0,!1)._buffer)),i(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){f.push(e)},getElements:function(e){return"function"==typeof e&&e._elements instanceof a?e._elements:null},clear:function(){X(s).forEach(o)}}}function m(e){for(var t=W.allocType(5123,e.length),r=0;r<e.length;++r)if(isNaN(e[r]))t[r]=65535;else if(1/0===e[r])t[r]=31744;else if(-1/0===e[r])t[r]=64512;else{ne[0]=e[r];var n=(i=ae[0])>>>31<<15,a=(i<<1>>>24)-127,i=i>>13&1023;t[r]=-24>a?n:-14>a?n+(i+1024>>-14-a):15<a?n+31744:n+(a+15<<10)+i}return t}function g(e){return Array.isArray(e)||G(e)}function y(e){return"[object "+e+"]"}function v(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function b(e){return!(!Array.isArray(e)||0===e.length||!g(e[0]))}function x(e){return Object.prototype.toString.call(e)}function _(e){if(!e)return!1;var t=x(e);return 0<=de.indexOf(t)||v(e)||b(e)||l(e)}function w(e,t){36193===e.type?(e.data=m(t),W.freeType(t)):e.data=t}function k(e,t,r,n,a,i){if(e=void 0!==ge[e]?ge[e]:se[e]*me[t],i&&(e*=6),a){for(n=0;1<=r;)n+=e*r*r,r/=2;return n}return e*r*n}function D(e,t,r,n,a,i,o){function s(){this.format=this.internalformat=6408,this.type=5121,this.flipY=this.premultiplyAlpha=this.compressed=!1,this.unpackAlignment=1,this.colorSpace=37444,this.channels=this.height=this.width=0}function c(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function u(e,t){if("object"==typeof t&&t){"premultiplyAlpha"in t&&(e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(e.flipY=t.flipY),"alignment"in t&&(e.unpackAlignment=t.alignment),"colorSpace"in t&&(e.colorSpace=V[t.colorSpace]),"type"in t&&(e.type=q[t.type]);var r=e.width,n=e.height,a=e.channels,i=!1;"shape"in t?(r=t.shape[0],n=t.shape[1],3===t.shape.length&&(a=t.shape[2],i=!0)):("radius"in t&&(r=n=t.radius),"width"in t&&(r=t.width),"height"in t&&(n=t.height),"channels"in t&&(a=t.channels,i=!0)),e.width=0|r,e.height=0|n,e.channels=0|a,r=!1,"format"in t&&(r=t.format,n=e.internalformat=H[r],e.format=de[n],r in q&&!("type"in t)&&(e.type=q[r]),r in K&&(e.compressed=!0),r=!0),!i&&r?e.channels=se[e.format]:i&&!r&&e.channels!==oe[e.format]&&(e.format=e.internalformat=oe[e.channels])}}function f(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function p(){s.call(this),this.yOffset=this.xOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function h(e,t){var r=null;if(_(t)?r=t:t&&(u(e,t),"x"in t&&(e.xOffset=0|t.x),"y"in t&&(e.yOffset=0|t.y),_(t.data)&&(r=t.data)),t.copy){var n=a.viewportWidth,i=a.viewportHeight;e.width=e.width||n-e.xOffset,e.height=e.height||i-e.yOffset,e.needsCopy=!0}else if(r){if(G(r))e.channels=e.channels||4,e.data=r,"type"in t||5121!==e.type||(e.type=0|Z[Object.prototype.toString.call(r)]);else if(v(r)){switch(e.channels=e.channels||4,i=(n=r).length,e.type){case 5121:case 5123:case 5125:case 5126:(i=W.allocType(e.type,i)).set(n),e.data=i;break;case 36193:e.data=m(n)}e.alignment=1,e.needsFree=!0}else if(l(r)){n=r.data,Array.isArray(n)||5121!==e.type||(e.type=0|Z[Object.prototype.toString.call(n)]),i=r.shape;var o,s,c,f,p=r.stride;3===i.length?(c=i[2],f=p[2]):f=c=1,o=i[0],s=i[1],i=p[0],p=p[1],e.alignment=1,e.width=o,e.height=s,e.channels=c,e.format=e.internalformat=oe[c],e.needsFree=!0,o=f,r=r.offset,c=e.width,f=e.height,s=e.channels;for(var h=W.allocType(36193===e.type?5126:e.type,c*f*s),d=0,y=0;y<f;++y)for(var k=0;k<c;++k)for(var D=0;D<s;++D)h[d++]=n[i*k+p*y+o*D+r];w(e,h)}else if(x(r)===le||x(r)===ce||x(r)===ue)x(r)===le||x(r)===ce?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(x(r)===fe)e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(x(r)===pe)e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(x(r)===he)e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(b(r)){for(n=e.width||r[0].length,i=e.height||r.length,p=e.channels,p=g(r[0][0])?p||r[0][0].length:p||1,o=Y.shape(r),c=1,f=0;f<o.length;++f)c*=o[f];c=W.allocType(36193===e.type?5126:e.type,c),Y.flatten(r,o,"",c),w(e,c),e.alignment=1,e.width=n,e.height=i,e.channels=p,e.format=e.internalformat=oe[p],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4}function d(t,r,a,i,o){var s=t.element,l=t.data,c=t.internalformat,u=t.format,p=t.type,h=t.width,d=t.height;f(t),s?e.texSubImage2D(r,o,a,i,u,p,s):t.compressed?e.compressedTexSubImage2D(r,o,a,i,c,h,d,l):t.needsCopy?(n(),e.copyTexSubImage2D(r,o,a,i,t.xOffset,t.yOffset,h,d)):e.texSubImage2D(r,o,a,i,h,d,u,p,l)}function y(){return me.pop()||new p}function D(e){e.needsFree&&W.freeType(e.data),p.call(e),me.push(e)}function T(){s.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function A(e,t,r){var n=e.images[0]=y();e.mipmask=1,n.width=e.width=t,n.height=e.height=r,n.channels=e.channels=4}function S(e,t){var r=null;if(_(t))c(r=e.images[0]=y(),e),h(r,t),e.mipmask=1;else if(u(e,t),Array.isArray(t.mipmap))for(var n=t.mipmap,a=0;a<n.length;++a)c(r=e.images[a]=y(),e),r.width>>=a,r.height>>=a,h(r,n[a]),e.mipmask|=1<<a;else c(r=e.images[0]=y(),e),h(r,t),e.mipmask=1;c(e,e.images[0])}function M(t,r){for(var a=t.images,i=0;i<a.length&&a[i];++i){var o=a[i],s=r,l=i,c=o.element,u=o.data,p=o.internalformat,h=o.format,d=o.type,m=o.width,g=o.height;f(o),c?e.texImage2D(s,l,h,h,d,c):o.compressed?e.compressedTexImage2D(s,l,p,m,g,0,u):o.needsCopy?(n(),e.copyTexImage2D(s,l,h,o.xOffset,o.yOffset,m,g,0)):e.texImage2D(s,l,h,m,g,0,h,d,u||null)}}function E(){var e=ge.pop()||new T;s.call(e);for(var t=e.mipmask=0;16>t;++t)e.images[t]=null;return e}function C(e){for(var t=e.images,r=0;r<t.length;++r)t[r]&&D(t[r]),t[r]=null;ge.push(e)}function N(){this.magFilter=this.minFilter=9728,this.wrapT=this.wrapS=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function O(e,t){"min"in t&&(e.minFilter=$[t.min],0<=ie.indexOf(e.minFilter)&&!("faces"in t)&&(e.genMipmaps=!0)),"mag"in t&&(e.magFilter=U[t.mag]);var r=e.wrapS,n=e.wrapT;if("wrap"in t){var a=t.wrap;"string"==typeof a?r=n=z[a]:Array.isArray(a)&&(r=z[a[0]],n=z[a[1]])}else"wrapS"in t&&(r=z[t.wrapS]),"wrapT"in t&&(n=z[t.wrapT]);if(e.wrapS=r,e.wrapT=n,"anisotropic"in t&&(e.anisotropic=t.anisotropic),"mipmap"in t){switch(r=!1,typeof t.mipmap){case"string":e.mipmapHint=B[t.mipmap],r=e.genMipmaps=!0;break;case"boolean":r=e.genMipmaps=t.mipmap;break;case"object":e.genMipmaps=!1,r=!0}!r||"min"in t||(e.minFilter=9984)}}function I(r,n){e.texParameteri(n,10241,r.minFilter),e.texParameteri(n,10240,r.magFilter),e.texParameteri(n,10242,r.wrapS),e.texParameteri(n,10243,r.wrapT),t.ext_texture_filter_anisotropic&&e.texParameteri(n,34046,r.anisotropic),r.genMipmaps&&(e.hint(33170,r.mipmapHint),e.generateMipmap(n))}function P(t){s.call(this),this.mipmask=0,this.internalformat=6408,this.id=ye++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new N,o.profile&&(this.stats={size:0})}function R(t){e.activeTexture(33984),e.bindTexture(t.target,t.texture)}function L(){var t=xe[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(3553,null)}function F(t){var r=t.texture,n=t.unit,a=t.target;0<=n&&(e.activeTexture(33984+n),e.bindTexture(a,null),xe[n]=null),e.deleteTexture(r),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete ve[t.id],i.textureCount--}var B={"don't care":4352,"dont care":4352,nice:4354,fast:4353},z={repeat:10497,clamp:33071,mirror:33648},U={nearest:9728,linear:9729},$=j({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},U),V={none:0,browser:37444},q={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},H={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},K={};t.ext_srgb&&(H.srgb=35904,H.srgba=35906),t.oes_texture_float&&(q.float32=q.float=5126),t.oes_texture_half_float&&(q.float16=q["half float"]=36193),t.webgl_depth_texture&&(j(H,{depth:6402,"depth stencil":34041}),j(q,{uint16:5123,uint32:5125,"depth stencil":34042})),t.webgl_compressed_texture_s3tc&&j(K,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),t.webgl_compressed_texture_atc&&j(K,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),t.webgl_compressed_texture_pvrtc&&j(K,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),t.webgl_compressed_texture_etc1&&(K["rgb etc1"]=36196);var J=Array.prototype.slice.call(e.getParameter(34467));Object.keys(K).forEach((function(e){var t=K[e];0<=J.indexOf(t)&&(H[e]=t)}));var Q=Object.keys(H);r.textureFormats=Q;var ee=[];Object.keys(H).forEach((function(e){ee[H[e]]=e}));var te=[];Object.keys(q).forEach((function(e){te[q[e]]=e}));var re=[];Object.keys(U).forEach((function(e){re[U[e]]=e}));var ne=[];Object.keys($).forEach((function(e){ne[$[e]]=e}));var ae=[];Object.keys(z).forEach((function(e){ae[z[e]]=e}));var de=Q.reduce((function(e,r){var n=H[r];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n||t.ext_srgb&&(35904===n||35906===n)?e[n]=n:32855===n||0<=r.indexOf("rgba")?e[n]=6408:e[n]=6407,e}),{}),me=[],ge=[],ye=0,ve={},be=r.maxTextureUnits,xe=Array(be).map((function(){return null}));return j(P.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(0>t){for(var r=0;r<be;++r){var n=xe[r];if(n){if(0<n.bindCount)continue;n.unit=-1}xe[r]=this,t=r;break}o.profile&&i.maxTextureUnits<t+1&&(i.maxTextureUnits=t+1),this.unit=t,e.activeTexture(33984+t),e.bindTexture(this.target,this.texture)}return t},unbind:function(){--this.bindCount},decRef:function(){0>=--this.refCount&&F(this)}}),o.profile&&(i.getTotalTextureSize=function(){var e=0;return Object.keys(ve).forEach((function(t){e+=ve[t].stats.size})),e}),{create2D:function(t,r){function n(e,t){var r=a.texInfo;N.call(r);var i=E();return"number"==typeof e?A(i,0|e,"number"==typeof t?0|t:0|e):e?(O(r,e),S(i,e)):A(i,1,1),r.genMipmaps&&(i.mipmask=(i.width<<1)-1),a.mipmask=i.mipmask,c(a,i),a.internalformat=i.internalformat,n.width=i.width,n.height=i.height,R(a),M(i,3553),I(r,3553),L(),C(i),o.profile&&(a.stats.size=k(a.internalformat,a.type,i.width,i.height,r.genMipmaps,!1)),n.format=ee[a.internalformat],n.type=te[a.type],n.mag=re[r.magFilter],n.min=ne[r.minFilter],n.wrapS=ae[r.wrapS],n.wrapT=ae[r.wrapT],n}var a=new P(3553);return ve[a.id]=a,i.textureCount++,n(t,r),n.subimage=function(e,t,r,i){t|=0,r|=0,i|=0;var o=y();return c(o,a),o.width=0,o.height=0,h(o,e),o.width=o.width||(a.width>>i)-t,o.height=o.height||(a.height>>i)-r,R(a),d(o,3553,t,r,i),L(),D(o),n},n.resize=function(t,r){var i=0|t,s=0|r||i;if(i===a.width&&s===a.height)return n;n.width=a.width=i,n.height=a.height=s,R(a);for(var l=0;a.mipmask>>l;++l){var c=i>>l,u=s>>l;if(!c||!u)break;e.texImage2D(3553,l,a.format,c,u,0,a.format,a.type,null)}return L(),o.profile&&(a.stats.size=k(a.internalformat,a.type,i,s,!1,!1)),n},n._reglType="texture2d",n._texture=a,o.profile&&(n.stats=a.stats),n.destroy=function(){a.decRef()},n},createCube:function(t,r,n,a,s,l){function f(e,t,r,n,a,i){var s,l=p.texInfo;for(N.call(l),s=0;6>s;++s)m[s]=E();if("number"!=typeof e&&e){if("object"==typeof e)if(t)S(m[0],e),S(m[1],t),S(m[2],r),S(m[3],n),S(m[4],a),S(m[5],i);else if(O(l,e),u(p,e),"faces"in e)for(e=e.faces,s=0;6>s;++s)c(m[s],p),S(m[s],e[s]);else for(s=0;6>s;++s)S(m[s],e)}else for(e=0|e||1,s=0;6>s;++s)A(m[s],e,e);for(c(p,m[0]),p.mipmask=l.genMipmaps?(m[0].width<<1)-1:m[0].mipmask,p.internalformat=m[0].internalformat,f.width=m[0].width,f.height=m[0].height,R(p),s=0;6>s;++s)M(m[s],34069+s);for(I(l,34067),L(),o.profile&&(p.stats.size=k(p.internalformat,p.type,f.width,f.height,l.genMipmaps,!0)),f.format=ee[p.internalformat],f.type=te[p.type],f.mag=re[l.magFilter],f.min=ne[l.minFilter],f.wrapS=ae[l.wrapS],f.wrapT=ae[l.wrapT],s=0;6>s;++s)C(m[s]);return f}var p=new P(34067);ve[p.id]=p,i.cubeCount++;var m=Array(6);return f(t,r,n,a,s,l),f.subimage=function(e,t,r,n,a){r|=0,n|=0,a|=0;var i=y();return c(i,p),i.width=0,i.height=0,h(i,t),i.width=i.width||(p.width>>a)-r,i.height=i.height||(p.height>>a)-n,R(p),d(i,34069+e,r,n,a),L(),D(i),f},f.resize=function(t){if((t|=0)!==p.width){f.width=p.width=t,f.height=p.height=t,R(p);for(var r=0;6>r;++r)for(var n=0;p.mipmask>>n;++n)e.texImage2D(34069+r,n,p.format,t>>n,t>>n,0,p.format,p.type,null);return L(),o.profile&&(p.stats.size=k(p.internalformat,p.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=p,o.profile&&(f.stats=p.stats),f.destroy=function(){p.decRef()},f},clear:function(){for(var t=0;t<be;++t)e.activeTexture(33984+t),e.bindTexture(3553,null),xe[t]=null;X(ve).forEach(F),i.cubeCount=0,i.textureCount=0},getTexture:function(e){return null},restore:function(){for(var t=0;t<be;++t){var r=xe[t];r&&(r.bindCount=0,r.unit=-1,xe[t]=null)}X(ve).forEach((function(t){t.texture=e.createTexture(),e.bindTexture(t.target,t.texture);for(var r=0;32>r;++r)if(0!=(t.mipmask&1<<r))if(3553===t.target)e.texImage2D(3553,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;6>n;++n)e.texImage2D(34069+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);I(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<be;++t){var r=xe[t];r&&(r.bindCount=0,r.unit=-1,xe[t]=null),e.activeTexture(33984+t),e.bindTexture(3553,null),e.bindTexture(34067,null)}}}}function T(e,t,r,n,a,i){function o(e,t,r){this.target=e,this.texture=t,this.renderbuffer=r;var n=e=0;t?(e=t.width,n=t.height):r&&(e=r.width,n=r.height),this.width=e,this.height=n}function s(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function l(e,t,r){e&&(e.texture?e.texture._texture.refCount+=1:e.renderbuffer._renderbuffer.refCount+=1)}function c(t,r){r&&(r.texture?e.framebufferTexture2D(36160,t,r.target,r.texture._texture.texture,0):e.framebufferRenderbuffer(36160,t,36161,r.renderbuffer._renderbuffer.renderbuffer))}function u(e){var t=3553,r=null,n=null,a=e;return"object"==typeof e&&(a=e.data,"target"in e&&(t=0|e.target)),"texture2d"===(e=a._reglType)||"textureCube"===e?r=a:"renderbuffer"===e&&(n=a,t=36161),new o(t,r,n)}function f(e,t,r,i,s){return r?((e=n.create2D({width:e,height:t,format:i,type:s}))._texture.refCount=0,new o(3553,e,null)):((e=a.create({width:e,height:t,format:i}))._renderbuffer.refCount=0,new o(36161,null,e))}function p(e){return e&&(e.texture||e.renderbuffer)}function h(e,t,r){e&&(e.texture?e.texture.resize(t,r):e.renderbuffer&&e.renderbuffer.resize(t,r),e.width=t,e.height=r)}function d(){this.id=k++,D[this.id]=this,this.framebuffer=e.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(e){e.colorAttachments.forEach(s),s(e.depthAttachment),s(e.stencilAttachment),s(e.depthStencilAttachment)}function g(t){e.deleteFramebuffer(t.framebuffer),t.framebuffer=null,i.framebufferCount--,delete D[t.id]}function y(t){var n;e.bindFramebuffer(36160,t.framebuffer);var a=t.colorAttachments;for(n=0;n<a.length;++n)c(36064+n,a[n]);for(n=a.length;n<r.maxColorAttachments;++n)e.framebufferTexture2D(36160,36064+n,3553,null,0);e.framebufferTexture2D(36160,33306,3553,null,0),e.framebufferTexture2D(36160,36096,3553,null,0),e.framebufferTexture2D(36160,36128,3553,null,0),c(36096,t.depthAttachment),c(36128,t.stencilAttachment),c(33306,t.depthStencilAttachment),e.checkFramebufferStatus(36160),e.isContextLost(),e.bindFramebuffer(36160,b.next?b.next.framebuffer:null),b.cur=b.next,e.getError()}function v(e,t){function r(e,t){var a,i=0,o=0,s=!0,c=!0;a=null;var h=!0,d="rgba",g="uint8",v=1,b=null,w=null,k=null,D=!1;"number"==typeof e?(i=0|e,o=0|t||i):e?("shape"in e?(i=(o=e.shape)[0],o=o[1]):("radius"in e&&(i=o=e.radius),"width"in e&&(i=e.width),"height"in e&&(o=e.height)),("color"in e||"colors"in e)&&(a=e.color||e.colors,Array.isArray(a)),a||("colorCount"in e&&(v=0|e.colorCount),"colorTexture"in e&&(h=!!e.colorTexture,d="rgba4"),"colorType"in e&&(g=e.colorType,!h)&&("half float"===g||"float16"===g?d="rgba16f":"float"!==g&&"float32"!==g||(d="rgba32f")),"colorFormat"in e&&(d=e.colorFormat,0<=x.indexOf(d)?h=!0:0<=_.indexOf(d)&&(h=!1))),("depthTexture"in e||"depthStencilTexture"in e)&&(D=!(!e.depthTexture&&!e.depthStencilTexture)),"depth"in e&&("boolean"==typeof e.depth?s=e.depth:(b=e.depth,c=!1)),"stencil"in e&&("boolean"==typeof e.stencil?c=e.stencil:(w=e.stencil,s=!1)),"depthStencil"in e&&("boolean"==typeof e.depthStencil?s=c=e.depthStencil:(k=e.depthStencil,c=s=!1))):i=o=1;var T=null,A=null,S=null,M=null;if(Array.isArray(a))T=a.map(u);else if(a)T=[u(a)];else for(T=Array(v),a=0;a<v;++a)T[a]=f(i,o,h,d,g);for(i=i||T[0].width,o=o||T[0].height,b?A=u(b):s&&!c&&(A=f(i,o,D,"depth","uint32")),w?S=u(w):c&&!s&&(S=f(i,o,!1,"stencil","uint8")),k?M=u(k):!b&&!w&&c&&s&&(M=f(i,o,D,"depth stencil","depth stencil")),s=null,a=0;a<T.length;++a)l(T[a]),T[a]&&T[a].texture&&(c=be[T[a].texture._texture.format]*xe[T[a].texture._texture.type],null===s&&(s=c));return l(A),l(S),l(M),m(n),n.width=i,n.height=o,n.colorAttachments=T,n.depthAttachment=A,n.stencilAttachment=S,n.depthStencilAttachment=M,r.color=T.map(p),r.depth=p(A),r.stencil=p(S),r.depthStencil=p(M),r.width=n.width,r.height=n.height,y(n),r}var n=new d;return i.framebufferCount++,r(e,t),j(r,{resize:function(e,t){var a=Math.max(0|e,1),i=Math.max(0|t||a,1);if(a===n.width&&i===n.height)return r;for(var o=n.colorAttachments,s=0;s<o.length;++s)h(o[s],a,i);return h(n.depthAttachment,a,i),h(n.stencilAttachment,a,i),h(n.depthStencilAttachment,a,i),n.width=r.width=a,n.height=r.height=i,y(n),r},_reglType:"framebuffer",_framebuffer:n,destroy:function(){g(n),m(n)},use:function(e){b.setFBO({framebuffer:r},e)}})}var b={cur:null,next:null,dirty:!1,setFBO:null},x=["rgba"],_=["rgba4","rgb565","rgb5 a1"];t.ext_srgb&&_.push("srgba"),t.ext_color_buffer_half_float&&_.push("rgba16f","rgb16f"),t.webgl_color_buffer_float&&_.push("rgba32f");var w=["uint8"];t.oes_texture_half_float&&w.push("half float","float16"),t.oes_texture_float&&w.push("float","float32");var k=0,D={};return j(b,{getFramebuffer:function(e){return"function"==typeof e&&"framebuffer"===e._reglType&&(e=e._framebuffer)instanceof d?e:null},create:v,createCube:function(e){function t(e){var a,i={color:null},o=0,s=null;a="rgba";var l="uint8",c=1;if("number"==typeof e?o=0|e:e?("shape"in e?o=e.shape[0]:("radius"in e&&(o=0|e.radius),"width"in e?o=0|e.width:"height"in e&&(o=0|e.height)),("color"in e||"colors"in e)&&(s=e.color||e.colors,Array.isArray(s)),s||("colorCount"in e&&(c=0|e.colorCount),"colorType"in e&&(l=e.colorType),"colorFormat"in e&&(a=e.colorFormat)),"depth"in e&&(i.depth=e.depth),"stencil"in e&&(i.stencil=e.stencil),"depthStencil"in e&&(i.depthStencil=e.depthStencil)):o=1,s)if(Array.isArray(s))for(e=[],a=0;a<s.length;++a)e[a]=s[a];else e=[s];else for(e=Array(c),s={radius:o,format:a,type:l},a=0;a<c;++a)e[a]=n.createCube(s);for(i.color=Array(e.length),a=0;a<e.length;++a)c=e[a],o=o||c.width,i.color[a]={target:34069,data:e[a]};for(a=0;6>a;++a){for(c=0;c<e.length;++c)i.color[c].target=34069+a;0<a&&(i.depth=r[0].depth,i.stencil=r[0].stencil,i.depthStencil=r[0].depthStencil),r[a]?r[a](i):r[a]=v(i)}return j(t,{width:o,height:o,color:e})}var r=Array(6);return t(e),j(t,{faces:r,resize:function(e){var n=0|e;if(n===t.width)return t;var a=t.color;for(e=0;e<a.length;++e)a[e].resize(n);for(e=0;6>e;++e)r[e].resize(n);return t.width=t.height=n,t},_reglType:"framebufferCube",destroy:function(){r.forEach((function(e){e.destroy()}))}})},clear:function(){X(D).forEach(g)},restore:function(){b.cur=null,b.next=null,b.dirty=!0,X(D).forEach((function(t){t.framebuffer=e.createFramebuffer(),y(t)}))}})}function A(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function S(e,t,r,n,a,i,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var e=t.oes_vertex_array_object;this.vao=e?e.createVertexArrayOES():null,p[this.id]=this,this.buffers=[]}var c=r.maxAttributes,u=Array(c);for(r=0;r<c;++r)u[r]=new A;var f=0,p={},h={Record:A,scope:{},state:u,currentVAO:null,targetVAO:null,restore:t.oes_vertex_array_object?function(){t.oes_vertex_array_object&&X(p).forEach((function(e){e.refresh()}))}:function(){},createVAO:function(e){function t(e){var n;Array.isArray(e)?(n=e,r.elements&&r.ownsElements&&r.elements.destroy(),r.elements=null,r.ownsElements=!1,r.offset=0,r.count=0,r.instances=-1,r.primitive=4):(e.elements?(n=e.elements,r.ownsElements?("function"==typeof n&&"elements"===n._reglType?r.elements.destroy():r.elements(n),r.ownsElements=!1):i.getElements(e.elements)?(r.elements=e.elements,r.ownsElements=!1):(r.elements=i.create(e.elements),r.ownsElements=!0)):(r.elements=null,r.ownsElements=!1),n=e.attributes,r.offset=0,r.count=-1,r.instances=-1,r.primitive=4,r.elements&&(r.count=r.elements._elements.vertCount,r.primitive=r.elements._elements.primType),"offset"in e&&(r.offset=0|e.offset),"count"in e&&(r.count=0|e.count),"instances"in e&&(r.instances=0|e.instances),"primitive"in e&&(r.primitive=re[e.primitive])),e={};var o=r.attributes;o.length=n.length;for(var s=0;s<n.length;++s){var c,u=n[s],f=o[s]=new A,p=u.data||u;Array.isArray(p)||G(p)||l(p)?(r.buffers[s]&&(c=r.buffers[s],G(p)&&c._buffer.byteLength>=p.byteLength?c.subdata(p):(c.destroy(),r.buffers[s]=null)),r.buffers[s]||(c=r.buffers[s]=a.create(u,34962,!1,!0)),f.buffer=a.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,e[s]=1):a.getBuffer(u)?(f.buffer=a.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):a.getBuffer(u.buffer)?(f.buffer=a.getBuffer(u.buffer),f.size=0|(+u.size||f.buffer.dimension),f.normalized=!!u.normalized||!1,f.type="type"in u?K[u.type]:f.buffer.dtype,f.offset=0|(u.offset||0),f.stride=0|(u.stride||0),f.divisor=0|(u.divisor||0),f.state=1):"x"in u&&(f.x=+u.x||0,f.y=+u.y||0,f.z=+u.z||0,f.w=+u.w||0,f.state=2)}for(c=0;c<r.buffers.length;++c)!e[c]&&r.buffers[c]&&(r.buffers[c].destroy(),r.buffers[c]=null);return r.refresh(),t}var r=new s;return n.vaoCount+=1,t.destroy=function(){for(var e=0;e<r.buffers.length;++e)r.buffers[e]&&r.buffers[e].destroy();r.buffers.length=0,r.ownsElements&&(r.elements.destroy(),r.elements=null,r.ownsElements=!1),r.destroy()},t._vao=r,t._reglType="vao",t(e)},getVAO:function(e){return"function"==typeof e&&e._vao?e._vao:null},destroyBuffer:function(t){for(var r=0;r<u.length;++r){var n=u[r];n.buffer===t&&(e.disableVertexAttribArray(r),n.buffer=null)}},setVAO:t.oes_vertex_array_object?function(e){if(e!==h.currentVAO){var r=t.oes_vertex_array_object;e?r.bindVertexArrayOES(e.vao):r.bindVertexArrayOES(null),h.currentVAO=e}}:function(r){if(r!==h.currentVAO){if(r)r.bindAttrs();else{for(var n=t.angle_instanced_arrays,a=0;a<u.length;++a){var i=u[a];i.buffer?(e.enableVertexAttribArray(a),i.buffer.bind(),e.vertexAttribPointer(a,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(a,i.divisor)):(e.disableVertexAttribArray(a),e.vertexAttrib4f(a,i.x,i.y,i.z,i.w))}o.elements?e.bindBuffer(34963,o.elements.buffer.buffer):e.bindBuffer(34963,null)}h.currentVAO=r}},clear:t.oes_vertex_array_object?function(){X(p).forEach((function(e){e.destroy()}))}:function(){}};return s.prototype.bindAttrs=function(){for(var r=t.angle_instanced_arrays,n=this.attributes,a=0;a<n.length;++a){var o=n[a];o.buffer?(e.enableVertexAttribArray(a),e.bindBuffer(34962,o.buffer.buffer),e.vertexAttribPointer(a,o.size,o.type,o.normalized,o.stride,o.offset),r&&o.divisor&&r.vertexAttribDivisorANGLE(a,o.divisor)):(e.disableVertexAttribArray(a),e.vertexAttrib4f(a,o.x,o.y,o.z,o.w))}for(r=n.length;r<c;++r)e.disableVertexAttribArray(r);(r=i.getElements(this.elements))?e.bindBuffer(34963,r.buffer.buffer):e.bindBuffer(34963,null)},s.prototype.refresh=function(){var e=t.oes_vertex_array_object;e&&(e.bindVertexArrayOES(this.vao),this.bindAttrs(),h.currentVAO=null,e.bindVertexArrayOES(null))},s.prototype.destroy=function(){if(this.vao){var e=t.oes_vertex_array_object;this===h.currentVAO&&(h.currentVAO=null,e.bindVertexArrayOES(null)),e.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),p[this.id]&&(delete p[this.id],--n.vaoCount)},h}function M(e,t,r,n){function a(e,t,r,n){this.name=e,this.id=t,this.location=r,this.info=n}function i(e,t){for(var r=0;r<e.length;++r)if(e[r].id===t.id)return void(e[r].location=t.location);e.push(t)}function o(r,n,a){if(!(o=(a=35632===r?c:u)[n])){var i=t.str(n),o=e.createShader(r);e.shaderSource(o,i),e.compileShader(o),a[n]=o}return o}function s(e,t){this.id=h++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function l(r,s,l){var c;c=o(35632,r.fragId);var u=o(35633,r.vertId);if(s=r.program=e.createProgram(),e.attachShader(s,c),e.attachShader(s,u),l)for(c=0;c<l.length;++c)u=l[c],e.bindAttribLocation(s,u[0],u[1]);e.linkProgram(s),u=e.getProgramParameter(s,35718),n.profile&&(r.stats.uniformsCount=u);var f=r.uniforms;for(c=0;c<u;++c)if(l=e.getActiveUniform(s,c)){if(1<l.size)for(var p=0;p<l.size;++p){var h=l.name.replace("[0]","["+p+"]");i(f,new a(h,t.id(h),e.getUniformLocation(s,h),l))}p=l.name,1<l.size&&(p=p.replace("[0]","")),i(f,new a(p,t.id(p),e.getUniformLocation(s,p),l))}for(u=e.getProgramParameter(s,35721),n.profile&&(r.stats.attributesCount=u),r=r.attributes,c=0;c<u;++c)(l=e.getActiveAttrib(s,c))&&i(r,new a(l.name,t.id(l.name),e.getAttribLocation(s,l.name),l))}var c={},u={},f={},p=[],h=0;return n.profile&&(r.getMaxUniformsCount=function(){var e=0;return p.forEach((function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)})),e},r.getMaxAttributesCount=function(){var e=0;return p.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var t=e.deleteShader.bind(e);X(c).forEach(t),c={},X(u).forEach(t),u={},p.forEach((function(t){e.deleteProgram(t.program)})),p.length=0,f={},r.shaderCount=0},program:function(t,n,a,i){var o=f[n];o||(o=f[n]={});var h=o[t];if(h&&(h.refCount++,!i))return h;var d=new s(n,t);return r.shaderCount++,l(d,a,i),h||(o[t]=d),p.push(d),j(d,{destroy:function(){if(d.refCount--,0>=d.refCount){e.deleteProgram(d.program);var t=p.indexOf(d);p.splice(t,1),r.shaderCount--}0>=o[d.vertId].refCount&&(e.deleteShader(u[d.vertId]),delete u[d.vertId],delete f[d.fragId][d.vertId]),Object.keys(f[d.fragId]).length||(e.deleteShader(c[d.fragId]),delete c[d.fragId],delete f[d.fragId])}})},restore:function(){c={},u={};for(var e=0;e<p.length;++e)l(p[e],null,p[e].attributes.map((function(e){return[e.location,e.name]})))},shader:o,frag:-1,vert:-1}}function E(e,t,r,n,a,i,o){function s(a){var i;i=null===t.next?5121:t.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,c=n.framebufferHeight,u=null;return G(a)?u=a:a&&(o=0|a.x,s=0|a.y,l=0|(a.width||n.framebufferWidth-o),c=0|(a.height||n.framebufferHeight-s),u=a.data||null),r(),a=l*c*4,u||(5121===i?u=new Uint8Array(a):5126===i&&(u=u||new Float32Array(a))),e.pixelStorei(3333,4),e.readPixels(o,s,l,c,6408,i,u),u}return function(e){return e&&"framebuffer"in e?function(e){var r;return t.setFBO({framebuffer:e.framebuffer},(function(){r=s(e)})),r}(e):s(e)}}function C(e){return Array.prototype.slice.call(e)}function N(e){return C(e).join("")}function O(e){return Array.isArray(e)||G(e)||l(e)}function I(e){return e.sort((function(e,t){return"viewport"===e?-1:"viewport"===t?1:e<t?-1:1}))}function P(e,t,r,n){this.thisDep=e,this.contextDep=t,this.propDep=r,this.append=n}function R(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function L(e){return new P(!1,!1,!1,e)}function F(e,t){var r=e.type;if(0===r)return new P(!0,1<=(r=e.data.length),2<=r,t);if(4===r)return new P((r=e.data).thisDep,r.contextDep,r.propDep,t);if(5===r)return new P(!1,!1,!1,t);if(6===r){for(var n=r=!1,a=!1,i=0;i<e.data.length;++i){var o=e.data[i];1===o.type?a=!0:2===o.type?n=!0:3===o.type?r=!0:0===o.type?(r=!0,1<=(o=o.data)&&(n=!0),2<=o&&(a=!0)):4===o.type&&(r=r||o.data.thisDep,n=n||o.data.contextDep,a=a||o.data.propDep)}return new P(r,n,a,t)}return new P(3===r,2===r,1===r,t)}function B(e,t,r,n,a,o,s,l,c,u,f,p,h,d,m){function y(e){return e.replace(".","_")}function v(e,t,r){var n=y(e);oe.push(e),ie[n]=ae[n]=!!r,se[n]=t}function b(e,t,r){var n=y(e);oe.push(e),Array.isArray(r)?(ae[n]=r.slice(),ie[n]=r.slice()):ae[n]=ie[n]=r,le[n]=t}function x(){var e=function(){function e(){var e=[],t=[];return j((function(){e.push.apply(e,C(arguments))}),{def:function(){var n="v"+r++;return t.push(n),0<arguments.length&&(e.push(n,"="),e.push.apply(e,C(arguments)),e.push(";")),n},toString:function(){return N([0<t.length?"var "+t.join(",")+";":"",N(e)])}})}function t(){function t(e,t){n(e,t,"=",r.def(e,t),";")}var r=e(),n=e(),a=r.toString,i=n.toString;return j((function(){r.apply(r,C(arguments))}),{def:r.def,entry:r,exit:n,save:t,set:function(e,n,a){t(e,n),r(e,n,"=",a,";")},toString:function(){return a()+i()}})}var r=0,n=[],a=[],i=e(),o={};return{global:i,link:function(e){for(var t=0;t<a.length;++t)if(a[t]===e)return n[t];return t="g"+r++,n.push(t),a.push(e),t},block:e,proc:function(e,r){function n(){var e="a"+a.length;return a.push(e),e}var a=[];r=r||0;for(var i=0;i<r;++i)n();var s=(i=t()).toString;return o[e]=j(i,{arg:n,toString:function(){return N(["function(",a.join(),"){",s(),"}"])}})},scope:t,cond:function(){var e=N(arguments),r=t(),n=t(),a=r.toString,i=n.toString;return j(r,{then:function(){return r.apply(r,C(arguments)),this},else:function(){return n.apply(n,C(arguments)),this},toString:function(){var t=i();return t&&(t="else{"+t+"}"),N(["if(",e,"){",a(),"}",t])}})},compile:function(){var e=['"use strict";',i,"return {"];Object.keys(o).forEach((function(t){e.push('"',t,'":',o[t].toString(),",")})),e.push("}");var t=N(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(t)).apply(null,a)}}}(),r=e.link,n=e.global;e.id=fe++,e.batchId="0";var a=r(ce),i=e.shared={props:"a0"};Object.keys(ce).forEach((function(e){i[e]=n.def(a,".",e)}));var o=e.next={},s=e.current={};Object.keys(le).forEach((function(e){Array.isArray(ae[e])&&(o[e]=n.def(i.next,".",e),s[e]=n.def(i.current,".",e))}));var l=e.constants={};Object.keys(ue).forEach((function(e){l[e]=n.def(JSON.stringify(ue[e]))})),e.invoke=function(t,n){switch(n.type){case 0:var a=["this",i.context,i.props,e.batchId];return t.def(r(n.data),".call(",a.slice(0,Math.max(n.data.length+1,4)),")");case 1:return t.def(i.props,n.data);case 2:return t.def(i.context,n.data);case 3:return t.def("this",n.data);case 4:return n.data.append(e,t),n.data.ref;case 5:return n.data.toString();case 6:return n.data.map((function(r){return e.invoke(t,r)}))}},e.attribCache={};var c={};return e.scopeAttrib=function(e){if((e=t.id(e))in c)return c[e];var n=u.scope[e];return n||(n=u.scope[e]=new J),c[e]=r(n)},e}function _(e,t){var r=e.static,n=e.dynamic;if("framebuffer"in r){var a=r.framebuffer;return a?(a=l.getFramebuffer(a),L((function(e,t){var r=e.link(a),n=e.shared;return t.set(n.framebuffer,".next",r),n=n.context,t.set(n,".framebufferWidth",r+".width"),t.set(n,".framebufferHeight",r+".height"),r}))):L((function(e,t){var r=e.shared;return t.set(r.framebuffer,".next","null"),r=r.context,t.set(r,".framebufferWidth",r+".drawingBufferWidth"),t.set(r,".framebufferHeight",r+".drawingBufferHeight"),"null"}))}if("framebuffer"in n){var i=n.framebuffer;return F(i,(function(e,t){var r=e.invoke(t,i),n=e.shared,a=n.framebuffer;return r=t.def(a,".getFramebuffer(",r,")"),t.set(a,".next",r),n=n.context,t.set(n,".framebufferWidth",r+"?"+r+".width:"+n+".drawingBufferWidth"),t.set(n,".framebufferHeight",r+"?"+r+".height:"+n+".drawingBufferHeight"),r}))}return null}function w(e,r,n){function a(e){if(e in i){var r=t.id(i[e]);return(e=L((function(){return r}))).id=r,e}if(e in o){var n=o[e];return F(n,(function(e,t){var r=e.invoke(t,n);return t.def(e.shared.strings,".id(",r,")")}))}return null}var i=e.static,o=e.dynamic,s=a("frag"),l=a("vert"),c=null;return R(s)&&R(l)?(c=f.program(l.id,s.id,null,n),e=L((function(e,t){return e.link(c)}))):e=new P(s&&s.thisDep||l&&l.thisDep,s&&s.contextDep||l&&l.contextDep,s&&s.propDep||l&&l.propDep,(function(e,t){var r,n,a=e.shared.shader;return r=s?s.append(e,t):t.def(a,".","frag"),n=l?l.append(e,t):t.def(a,".","vert"),t.def(a+".program("+n+","+r+")")})),{frag:s,vert:l,progVar:e,program:c}}function k(e,t){function r(e,t){if(e in n){var r=0|n[e];return t?i.offset=r:i.instances=r,L((function(e,n){return t&&(e.OFFSET=r),r}))}if(e in a){var o=a[e];return F(o,(function(e,r){var n=e.invoke(r,o);return t&&(e.OFFSET=n),n}))}if(t){if(c)return L((function(e,t){return e.OFFSET=0}));if(s)return new P(l.thisDep,l.contextDep,l.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.offset:0")}))}else if(s)return new P(l.thisDep,l.contextDep,l.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.instances:-1")}));return null}var n=e.static,a=e.dynamic,i={},s=!1,l=function(){if("vao"in n){var e=n.vao;return null!==e&&null===u.getVAO(e)&&(e=u.createVAO(e)),s=!0,i.vao=e,L((function(t){var r=u.getVAO(e);return r?t.link(r):"null"}))}if("vao"in a){s=!0;var t=a.vao;return F(t,(function(e,r){var n=e.invoke(r,t);return r.def(e.shared.vao+".getVAO("+n+")")}))}return null}(),c=!1,f=function(){if("elements"in n){var e=n.elements;if(i.elements=e,O(e)){var t=i.elements=o.create(e,!0);e=o.getElements(t),c=!0}else e&&(e=o.getElements(e),c=!0);return(t=L((function(t,r){if(e){var n=t.link(e);return t.ELEMENTS=n}return t.ELEMENTS=null}))).value=e,t}if("elements"in a){c=!0;var r=a.elements;return F(r,(function(e,t){var n=(a=e.shared).isBufferArgs,a=a.elements,i=e.invoke(t,r),o=t.def("null");return n=t.def(n,"(",i,")"),i=e.cond(n).then(o,"=",a,".createStream(",i,");").else(o,"=",a,".getElements(",i,");"),t.entry(i),t.exit(e.cond(n).then(a,".destroyStream(",o,");")),e.ELEMENTS=o}))}return s?new P(l.thisDep,l.contextDep,l.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.elements+".getElements("+e.shared.vao+".currentVAO.elements):null")})):null}(),p=r("offset",!0),h=function(){if("primitive"in n){var e=n.primitive;return i.primitive=e,L((function(t,r){return re[e]}))}if("primitive"in a){var t=a.primitive;return F(t,(function(e,r){var n=e.constants.primTypes,a=e.invoke(r,t);return r.def(n,"[",a,"]")}))}return c?R(f)?f.value?L((function(e,t){return t.def(e.ELEMENTS,".primType")})):L((function(){return 4})):new P(f.thisDep,f.contextDep,f.propDep,(function(e,t){var r=e.ELEMENTS;return t.def(r,"?",r,".primType:",4)})):s?new P(l.thisDep,l.contextDep,l.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.primitive:4")})):null}(),d=function(){if("count"in n){var e=0|n.count;return i.count=e,L((function(){return e}))}if("count"in a){var t=a.count;return F(t,(function(e,r){return e.invoke(r,t)}))}return c?R(f)?f?p?new P(p.thisDep,p.contextDep,p.propDep,(function(e,t){return t.def(e.ELEMENTS,".vertCount-",e.OFFSET)})):L((function(e,t){return t.def(e.ELEMENTS,".vertCount")})):L((function(){return-1})):new P(f.thisDep||p.thisDep,f.contextDep||p.contextDep,f.propDep||p.propDep,(function(e,t){var r=e.ELEMENTS;return e.OFFSET?t.def(r,"?",r,".vertCount-",e.OFFSET,":-1"):t.def(r,"?",r,".vertCount:-1")})):s?new P(l.thisDep,l.contextDep,l.propDep,(function(e,t){return t.def(e.shared.vao,".currentVAO?",e.shared.vao,".currentVAO.count:-1")})):null}(),m=r("instances",!1);return{elements:f,primitive:h,count:d,instances:m,offset:p,vao:l,vaoActive:s,elementsActive:c,static:i}}function D(e,r){var n=e.static,i=e.dynamic,o={};return Object.keys(n).forEach((function(e){var r=n[e],i=t.id(e),s=new J;if(O(r))s.state=1,s.buffer=a.getBuffer(a.create(r,34962,!1,!0)),s.type=0;else if(c=a.getBuffer(r))s.state=1,s.buffer=c,s.type=0;else if("constant"in r){var l=r.constant;s.buffer="null",s.state=2,"number"==typeof l?s.x=l:_e.forEach((function(e,t){t<l.length&&(s[e]=l[t])}))}else{var c=O(r.buffer)?a.getBuffer(a.create(r.buffer,34962,!1,!0)):a.getBuffer(r.buffer),u=0|r.offset,f=0|r.stride,p=0|r.size,h=!!r.normalized,d=0;"type"in r&&(d=K[r.type]),r=0|r.divisor,s.buffer=c,s.state=1,s.size=p,s.normalized=h,s.type=d||c.dtype,s.offset=u,s.stride=f,s.divisor=r}o[e]=L((function(e,t){var r=e.attribCache;if(i in r)return r[i];var n={isStream:!1};return Object.keys(s).forEach((function(e){n[e]=s[e]})),s.buffer&&(n.buffer=e.link(s.buffer),n.type=n.type||n.buffer+".dtype"),r[i]=n}))})),Object.keys(i).forEach((function(e){var t=i[e];o[e]=F(t,(function(e,r){function n(e){r(l[e],"=",a,".",e,"|0;")}var a=e.invoke(r,t),i=e.shared,o=e.constants,s=i.isBufferArgs,l=(i=i.buffer,{isStream:r.def(!1)}),c=new J;c.state=1,Object.keys(c).forEach((function(e){l[e]=r.def(""+c[e])}));var u=l.buffer,f=l.type;return r("if(",s,"(",a,")){",l.isStream,"=true;",u,"=",i,".createStream(",34962,",",a,");",f,"=",u,".dtype;","}else{",u,"=",i,".getBuffer(",a,");","if(",u,"){",f,"=",u,".dtype;",'}else if("constant" in ',a,"){",l.state,"=",2,";","if(typeof "+a+'.constant === "number"){',l[_e[0]],"=",a,".constant;",_e.slice(1).map((function(e){return l[e]})).join("="),"=0;","}else{",_e.map((function(e,t){return l[e]+"="+a+".constant.length>"+t+"?"+a+".constant["+t+"]:0;"})).join(""),"}}else{","if(",s,"(",a,".buffer)){",u,"=",i,".createStream(",34962,",",a,".buffer);","}else{",u,"=",i,".getBuffer(",a,".buffer);","}",f,'="type" in ',a,"?",o.glTypes,"[",a,".type]:",u,".dtype;",l.normalized,"=!!",a,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",i,".destroyStream(",u,");","}"),l}))})),o}function T(e,t,n,a,o){function s(e){var t=c[e];t&&(p[e]=t)}var l=function(e,t){if("string"==typeof(r=e.static).frag&&"string"==typeof r.vert){if(0<Object.keys(t.dynamic).length)return null;var r=t.static,n=Object.keys(r);if(0<n.length&&"number"==typeof r[n[0]]){for(var a=[],i=0;i<n.length;++i)a.push([0|r[n[i]],n[i]]);return a}}return null}(e,t),c=function(e,t,r){function n(e){if(e in a){var r=a[e];e=!0;var n,o,s=0|r.x,l=0|r.y;return"width"in r?n=0|r.width:e=!1,"height"in r?o=0|r.height:e=!1,new P(!e&&t&&t.thisDep,!e&&t&&t.contextDep,!e&&t&&t.propDep,(function(e,t){var a=e.shared.context,i=n;"width"in r||(i=t.def(a,".","framebufferWidth","-",s));var c=o;return"height"in r||(c=t.def(a,".","framebufferHeight","-",l)),[s,l,i,c]}))}if(e in i){var c=i[e];return e=F(c,(function(e,t){var r=e.invoke(t,c),n=e.shared.context,a=t.def(r,".x|0"),i=t.def(r,".y|0");return[a,i,t.def('"width" in ',r,"?",r,".width|0:","(",n,".","framebufferWidth","-",a,")"),r=t.def('"height" in ',r,"?",r,".height|0:","(",n,".","framebufferHeight","-",i,")")]})),t&&(e.thisDep=e.thisDep||t.thisDep,e.contextDep=e.contextDep||t.contextDep,e.propDep=e.propDep||t.propDep),e}return t?new P(t.thisDep,t.contextDep,t.propDep,(function(e,t){var r=e.shared.context;return[0,0,t.def(r,".","framebufferWidth"),t.def(r,".","framebufferHeight")]})):null}var a=e.static,i=e.dynamic;if(e=n("viewport")){var o=e;e=new P(e.thisDep,e.contextDep,e.propDep,(function(e,t){var r=o.append(e,t),n=e.shared.context;return t.set(n,".viewportWidth",r[2]),t.set(n,".viewportHeight",r[3]),r}))}return{viewport:e,scissor_box:n("scissor.box")}}(e,d=_(e)),f=k(e),p=function(e,t){var r=e.static,n=e.dynamic,a={};return oe.forEach((function(e){function t(t,i){if(e in r){var s=t(r[e]);a[o]=L((function(){return s}))}else if(e in n){var l=n[e];a[o]=F(l,(function(e,t){return i(e,t,e.invoke(t,l))}))}}var o=y(e);switch(e){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":case"lineWidth":return t((function(e){return e}),(function(e,t,r){return r}));case"depth.func":return t((function(e){return De[e]}),(function(e,t,r){return t.def(e.constants.compareFuncs,"[",r,"]")}));case"depth.range":return t((function(e){return e}),(function(e,t,r){return[t.def("+",r,"[0]"),t=t.def("+",r,"[1]")]}));case"blend.func":return t((function(e){return[ke["srcRGB"in e?e.srcRGB:e.src],ke["dstRGB"in e?e.dstRGB:e.dst],ke["srcAlpha"in e?e.srcAlpha:e.src],ke["dstAlpha"in e?e.dstAlpha:e.dst]]}),(function(e,t,r){function n(e,n){return t.def('"',e,n,'" in ',r,"?",r,".",e,n,":",r,".",e)}e=e.constants.blendFuncs;var a=n("src","RGB"),i=n("dst","RGB"),o=(a=t.def(e,"[",a,"]"),t.def(e,"[",n("src","Alpha"),"]"));return[a,i=t.def(e,"[",i,"]"),o,e=t.def(e,"[",n("dst","Alpha"),"]")]}));case"blend.equation":return t((function(e){return"string"==typeof e?[Q[e],Q[e]]:"object"==typeof e?[Q[e.rgb],Q[e.alpha]]:void 0}),(function(e,t,r){var n=e.constants.blendEquations,a=t.def(),i=t.def();return(e=e.cond("typeof ",r,'==="string"')).then(a,"=",i,"=",n,"[",r,"];"),e.else(a,"=",n,"[",r,".rgb];",i,"=",n,"[",r,".alpha];"),t(e),[a,i]}));case"blend.color":return t((function(e){return i(4,(function(t){return+e[t]}))}),(function(e,t,r){return i(4,(function(e){return t.def("+",r,"[",e,"]")}))}));case"stencil.mask":return t((function(e){return 0|e}),(function(e,t,r){return t.def(r,"|0")}));case"stencil.func":return t((function(e){return[De[e.cmp||"keep"],e.ref||0,"mask"in e?e.mask:-1]}),(function(e,t,r){return[e=t.def('"cmp" in ',r,"?",e.constants.compareFuncs,"[",r,".cmp]",":",7680),t.def(r,".ref|0"),t=t.def('"mask" in ',r,"?",r,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return t((function(t){return["stencil.opBack"===e?1029:1028,Te[t.fail||"keep"],Te[t.zfail||"keep"],Te[t.zpass||"keep"]]}),(function(t,r,n){function a(e){return r.def('"',e,'" in ',n,"?",i,"[",n,".",e,"]:",7680)}var i=t.constants.stencilOps;return["stencil.opBack"===e?1029:1028,a("fail"),a("zfail"),a("zpass")]}));case"polygonOffset.offset":return t((function(e){return[0|e.factor,0|e.units]}),(function(e,t,r){return[t.def(r,".factor|0"),t=t.def(r,".units|0")]}));case"cull.face":return t((function(e){var t=0;return"front"===e?t=1028:"back"===e&&(t=1029),t}),(function(e,t,r){return t.def(r,'==="front"?',1028,":",1029)}));case"frontFace":return t((function(e){return Ae[e]}),(function(e,t,r){return t.def(r+'==="cw"?2304:2305')}));case"colorMask":return t((function(e){return e.map((function(e){return!!e}))}),(function(e,t,r){return i(4,(function(e){return"!!"+r+"["+e+"]"}))}));case"sample.coverage":return t((function(e){return["value"in e?e.value:1,!!e.invert]}),(function(e,t,r){return[t.def('"value" in ',r,"?+",r,".value:1"),t=t.def("!!",r,".invert")]}))}})),a}(e),h=w(e,0,l);s("viewport"),s(y("scissor.box"));var d,m=0<Object.keys(p).length;if((d={framebuffer:d,draw:f,shader:h,state:p,dirty:m,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}}).profile=function(e){var t,r=e.static;if(e=e.dynamic,"profile"in r){var n=!!r.profile;(t=L((function(e,t){return n}))).enable=n}else if("profile"in e){var a=e.profile;t=F(a,(function(e,t){return e.invoke(t,a)}))}return t}(e),d.uniforms=function(e,t){var r=e.static,n=e.dynamic,a={};return Object.keys(r).forEach((function(e){var t,n=r[e];if("number"==typeof n||"boolean"==typeof n)t=L((function(){return n}));else if("function"==typeof n){var o=n._reglType;"texture2d"===o||"textureCube"===o?t=L((function(e){return e.link(n)})):"framebuffer"!==o&&"framebufferCube"!==o||(t=L((function(e){return e.link(n.color[0])})))}else g(n)&&(t=L((function(e){return e.global.def("[",i(n.length,(function(e){return n[e]})),"]")})));t.value=n,a[e]=t})),Object.keys(n).forEach((function(e){var t=n[e];a[e]=F(t,(function(e,r){return e.invoke(r,t)}))})),a}(n),d.drawVAO=d.scopeVAO=f.vao,!d.drawVAO&&h.program&&!l&&r.angle_instanced_arrays&&f.static.elements){var v=!0;if(e=h.program.attributes.map((function(e){return e=t.static[e],v=v&&!!e,e})),v&&0<e.length){var b=u.getVAO(u.createVAO({attributes:e,elements:f.static.elements}));d.drawVAO=new P(null,null,null,(function(e,t){return e.link(b)})),d.useVAO=!0}}return l?d.useVAO=!0:d.attributes=D(t),d.context=function(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r=t[e];n[e]=L((function(e,t){return"number"==typeof r||"boolean"==typeof r?""+r:e.link(r)}))})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=F(t,(function(e,r){return e.invoke(r,t)}))})),n}(a),d}function A(e,t,r){var n=e.shared.context,a=e.scope();Object.keys(r).forEach((function(i){t.save(n,"."+i);var o=r[i].append(e,t);Array.isArray(o)?a(n,".",i,"=[",o.join(),"];"):a(n,".",i,"=",o,";")})),t(a)}function S(e,t,r,n){var a,i=(s=e.shared).gl,o=s.framebuffer;te&&(a=t.def(s.extensions,".webgl_draw_buffers"));var s=(l=e.constants).drawBuffer,l=l.backBuffer;e=r?r.append(e,t):t.def(o,".next"),n||t("if(",e,"!==",o,".cur){"),t("if(",e,"){",i,".bindFramebuffer(",36160,",",e,".framebuffer);"),te&&t(a,".drawBuffersWEBGL(",s,"[",e,".colorAttachments.length]);"),t("}else{",i,".bindFramebuffer(",36160,",null);"),te&&t(a,".drawBuffersWEBGL(",l,");"),t("}",o,".cur=",e,";"),n||t("}")}function M(e,t,r){var n=e.shared,a=n.gl,o=e.current,s=e.next,l=n.current,c=n.next,u=e.cond(l,".dirty");oe.forEach((function(t){var n,f;if(!((t=y(t))in r.state))if(t in s){n=s[t],f=o[t];var p=i(ae[t].length,(function(e){return u.def(n,"[",e,"]")}));u(e.cond(p.map((function(e,t){return e+"!=="+f+"["+t+"]"})).join("||")).then(a,".",le[t],"(",p,");",p.map((function(e,t){return f+"["+t+"]="+e})).join(";"),";"))}else n=u.def(c,".",t),p=e.cond(n,"!==",l,".",t),u(p),t in se?p(e.cond(n).then(a,".enable(",se[t],");").else(a,".disable(",se[t],");"),l,".",t,"=",n,";"):p(a,".",le[t],"(",n,");",l,".",t,"=",n,";")})),0===Object.keys(r.state).length&&u(l,".dirty=false;"),t(u)}function E(e,t,r,n){var a=e.shared,i=e.current,o=a.current,s=a.gl;I(Object.keys(r)).forEach((function(a){var l=r[a];if(!n||n(l)){var c=l.append(e,t);if(se[a]){var u=se[a];R(l)?t(s,c?".enable(":".disable(",u,");"):t(e.cond(c).then(s,".enable(",u,");").else(s,".disable(",u,");")),t(o,".",a,"=",c,";")}else if(g(c)){var f=i[a];t(s,".",le[a],"(",c,");",c.map((function(e,t){return f+"["+t+"]="+e})).join(";"),";")}else t(s,".",le[a],"(",c,");",o,".",a,"=",c,";")}}))}function B(e,t){ee&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function z(e,t,r,n,a){function i(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(e){e(c=t.def(),"=",i(),";"),"string"==typeof a?e(p,".count+=",a,";"):e(p,".count++;"),d&&(n?e(u=t.def(),"=",m,".getNumPendingQueries();"):e(m,".beginQuery(",p,");"))}function s(e){e(p,".cpuTime+=",i(),"-",c,";"),d&&(n?e(m,".pushScopeStats(",u,",",m,".getNumPendingQueries(),",p,");"):e(m,".endQuery();"))}function l(e){var r=t.def(h,".profile");t(h,".profile=",e,";"),t.exit(h,".profile=",r,";")}var c,u,f=e.shared,p=e.stats,h=f.current,m=f.timer;if(r=r.profile){if(R(r))return void(r.enable?(o(t),s(t.exit),l("true")):l("false"));l(r=r.append(e,t))}else r=t.def(h,".profile");o(f=e.block()),t("if(",r,"){",f,"}"),s(e=e.block()),t.exit("if(",r,"){",e,"}")}function U(e,t,r,n,a){function i(r,n,a){function i(){t("if(!",u,".buffer){",l,".enableVertexAttribArray(",c,");}");var r,i=a.type;r=a.size?t.def(a.size,"||",n):n,t("if(",u,".type!==",i,"||",u,".size!==",r,"||",h.map((function(e){return u+"."+e+"!=="+a[e]})).join("||"),"){",l,".bindBuffer(",34962,",",f,".buffer);",l,".vertexAttribPointer(",[c,r,i,a.normalized,a.stride,a.offset],");",u,".type=",i,";",u,".size=",r,";",h.map((function(e){return u+"."+e+"="+a[e]+";"})).join(""),"}"),ee&&(i=a.divisor,t("if(",u,".divisor!==",i,"){",e.instancing,".vertexAttribDivisorANGLE(",[c,i],");",u,".divisor=",i,";}"))}function s(){t("if(",u,".buffer){",l,".disableVertexAttribArray(",c,");",u,".buffer=null;","}if(",_e.map((function(e,t){return u+"."+e+"!=="+p[t]})).join("||"),"){",l,".vertexAttrib4f(",c,",",p,");",_e.map((function(e,t){return u+"."+e+"="+p[t]+";"})).join(""),"}")}var l=o.gl,c=t.def(r,".location"),u=t.def(o.attributes,"[",c,"]");r=a.state;var f=a.buffer,p=[a.x,a.y,a.z,a.w],h=["buffer","normalized","offset","stride"];1===r?i():2===r?s():(t("if(",r,"===",1,"){"),i(),t("}else{"),s(),t("}"))}var o=e.shared;n.forEach((function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!a(l))return;o=l.append(e,t)}else{if(!a(Se))return;var c=e.scopeAttrib(s);o={},Object.keys(new J).forEach((function(e){o[e]=t.def(c,".",e)}))}i(e.link(n),function(e){switch(e){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(n.info.type),o)}))}function V(e,r,n,a,o,s){for(var l,c=e.shared,u=c.gl,f={},p=0;p<a.length;++p){var h=(x=a[p]).name,d=x.info.type,m=x.info.size,y=n.uniforms[h];if(1<m){if(!y)continue;var v=h.replace("[0]","");if(f[v])continue;f[v]=1}var b,x=e.link(x)+".location";if(y){if(!o(y))continue;if(R(y)){if(h=y.value,35678===d||35680===d)r(u,".uniform1i(",x,",",(d=e.link(h._texture||h.color[0]._texture))+".bind());"),r.exit(d,".unbind();");else if(35674===d||35675===d||35676===d)m=e.global.def("new Float32Array(["+Array.prototype.slice.call(h)+"])"),h=2,35675===d?h=3:35676===d&&(h=4),r(u,".uniformMatrix",h,"fv(",x,",false,",m,");");else{switch(d){case 5126:l="1f";break;case 35664:l="2f";break;case 35665:l="3f";break;case 35666:l="4f";break;case 35670:case 5124:l="1i";break;case 35671:case 35667:l="2i";break;case 35672:case 35668:l="3i";break;case 35673:case 35669:l="4i"}1<m?(l+="v",h=e.global.def("["+Array.prototype.slice.call(h)+"]")):h=g(h)?Array.prototype.slice.call(h):h,r(u,".uniform",l,"(",x,",",h,");")}continue}b=y.append(e,r)}else{if(!o(Se))continue;b=r.def(c.uniforms,"[",t.id(h),"]")}switch(35678===d?r("if(",b,"&&",b,'._reglType==="framebuffer"){',b,"=",b,".color[0];","}"):35680===d&&r("if(",b,"&&",b,'._reglType==="framebufferCube"){',b,"=",b,".color[0];","}"),h=1,d){case 35678:case 35680:d=r.def(b,"._texture"),r(u,".uniform1i(",x,",",d,".bind());"),r.exit(d,".unbind();");continue;case 5124:case 35670:l="1i";break;case 35667:case 35671:l="2i",h=2;break;case 35668:case 35672:l="3i",h=3;break;case 35669:case 35673:l="4i",h=4;break;case 5126:l="1f";break;case 35664:l="2f",h=2;break;case 35665:l="3f",h=3;break;case 35666:l="4f",h=4;break;case 35674:l="Matrix2fv";break;case 35675:l="Matrix3fv";break;case 35676:l="Matrix4fv"}if(-1===l.indexOf("Matrix")&&1<m&&(l+="v",h=1),"M"===l.charAt(0)){r(u,".uniform",l,"(",x,","),x=Math.pow(d-35674+2,2);var _=e.global.def("new Float32Array(",x,")");Array.isArray(b)?r("false,(",i(x,(function(e){return _+"["+e+"]="+b[e]})),",",_,")"):r("false,(Array.isArray(",b,")||",b," instanceof Float32Array)?",b,":(",i(x,(function(e){return _+"["+e+"]="+b+"["+e+"]"})),",",_,")"),r(");")}else{if(1<h){d=[];var w=[];for(m=0;m<h;++m)Array.isArray(b)?w.push(b[m]):w.push(r.def(b+"["+m+"]")),s&&d.push(r.def());s&&r("if(!",e.batchId,"||",d.map((function(e,t){return e+"!=="+w[t]})).join("||"),"){",d.map((function(e,t){return e+"="+w[t]+";"})).join("")),r(u,".uniform",l,"(",x,",",w.join(","),");")}else s&&(d=r.def(),r("if(!",e.batchId,"||",d,"!==",b,"){",d,"=",b,";")),r(u,".uniform",l,"(",x,",",b,");");s&&r("}")}}}function q(e,t,r,n){function a(a){var i=p[a];return i?i.contextDep&&n.contextDynamic||i.propDep?i.append(e,r):i.append(e,t):t.def(f,".",a)}function i(){function e(){r(l,".drawElementsInstancedANGLE(",[d,g,y,m+"<<(("+y+"-5121)>>1)",s],");")}function t(){r(l,".drawArraysInstancedANGLE(",[d,m,g,s],");")}h&&"null"!==h?v?e():(r("if(",h,"){"),e(),r("}else{"),t(),r("}")):t()}function o(){function e(){r(u+".drawElements("+[d,g,y,m+"<<(("+y+"-5121)>>1)"]+");")}function t(){r(u+".drawArrays("+[d,m,g]+");")}h&&"null"!==h?v?e():(r("if(",h,"){"),e(),r("}else{"),t(),r("}")):t()}var s,l,c=e.shared,u=c.gl,f=c.draw,p=n.draw,h=function(){var a=p.elements,i=t;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(i=r),a=a.append(e,i),p.elementsActive&&i("if("+a+")"+u+".bindBuffer(34963,"+a+".buffer.buffer);")):(a=i.def(),i(a,"=",f,".","elements",";","if(",a,"){",u,".bindBuffer(",34963,",",a,".buffer.buffer);}","else if(",c.vao,".currentVAO){",a,"=",e.shared.elements+".getElements("+c.vao,".currentVAO.elements);",ne?"":"if("+a+")"+u+".bindBuffer(34963,"+a+".buffer.buffer);","}")),a}(),d=a("primitive"),m=a("offset"),g=function(){var a=p.count,i=t;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(i=r),a=a.append(e,i)):a=i.def(f,".","count"),a}();if("number"==typeof g){if(0===g)return}else r("if(",g,"){"),r.exit("}");ee&&(s=a("instances"),l=e.instancing);var y=h+".type",v=p.elements&&R(p.elements)&&!p.vaoActive;ee&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),i(),r("}else if(",s,"<0){"),o(),r("}")):i():o()}function W(e,t,r,n,a){return a=(t=x()).proc("body",a),ee&&(t.instancing=a.def(t.shared.extensions,".angle_instanced_arrays")),e(t,a,r,n),t.compile().body}function H(e,t,r,n){B(e,t),r.useVAO?r.drawVAO?t(e.shared.vao,".setVAO(",r.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),U(e,t,r,n.attributes,(function(){return!0}))),V(e,t,r,n.uniforms,(function(){return!0}),!1),q(e,t,t,r)}function G(e,t,r,n){function a(){return!0}e.batchId="a1",B(e,t),U(e,t,r,n.attributes,a),V(e,t,r,n.uniforms,a,!1),q(e,t,t,r)}function X(e,t,r,n){function a(e){return e.contextDep&&o||e.propDep}function i(e){return!a(e)}B(e,t);var o=r.contextDep,s=t.def(),l=t.def();e.shared.props=l,e.batchId=s;var c=e.scope(),u=e.scope();t(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&A(e,u,r.context),r.needsFramebuffer&&S(e,u,r.framebuffer),E(e,u,r.state,a),r.profile&&a(r.profile)&&z(e,u,r,!1,!0),n?(r.useVAO?r.drawVAO?a(r.drawVAO)?u(e.shared.vao,".setVAO(",r.drawVAO.append(e,u),");"):c(e.shared.vao,".setVAO(",r.drawVAO.append(e,c),");"):c(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(c(e.shared.vao,".setVAO(null);"),U(e,c,r,n.attributes,i),U(e,u,r,n.attributes,a)),V(e,c,r,n.uniforms,i,!1),V(e,u,r,n.uniforms,a,!0),q(e,c,u,r)):(t=e.global.def("{}"),n=r.shader.progVar.append(e,u),l=u.def(n,".id"),c=u.def(t,"[",l,"]"),u(e.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",t,"[",l,"]=",e.link((function(t){return W(G,e,r,t,2)})),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function Y(e,r){function n(t){var n=r.shader[t];n&&a.set(i.shader,"."+t,n.append(e,a))}var a=e.proc("scope",3);e.batchId="a2";var i=e.shared,o=i.current;A(e,a,r.context),r.framebuffer&&r.framebuffer.append(e,a),I(Object.keys(r.state)).forEach((function(t){var n=r.state[t].append(e,a);g(n)?n.forEach((function(r,n){a.set(e.next[t],"["+n+"]",r)})):a.set(i.next,"."+t,n)})),z(e,a,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(t){var n=r.draw[t];n&&a.set(i.draw,"."+t,""+n.append(e,a))})),Object.keys(r.uniforms).forEach((function(n){var o=r.uniforms[n].append(e,a);Array.isArray(o)&&(o="["+o.join()+"]"),a.set(i.uniforms,"["+t.id(n)+"]",o)})),Object.keys(r.attributes).forEach((function(t){var n=r.attributes[t].append(e,a),i=e.scopeAttrib(t);Object.keys(new J).forEach((function(e){a.set(i,"."+e,n[e])}))})),r.scopeVAO&&a.set(i.vao,".targetVAO",r.scopeVAO.append(e,a)),n("vert"),n("frag"),0<Object.keys(r.state).length&&(a(o,".dirty=true;"),a.exit(o,".dirty=true;")),a("a1(",e.shared.context,",a0,",e.batchId,");")}function Z(e,t,r){var n=t.static[r];if(n&&function(e){if("object"==typeof e&&!g(e)){for(var t=Object.keys(e),r=0;r<t.length;++r)if($.isDynamic(e[t[r]]))return!0;return!1}}(n)){var a=e.global,i=Object.keys(n),o=!1,s=!1,l=!1,c=e.global.def("{}");i.forEach((function(t){var r=n[t];if($.isDynamic(r))"function"==typeof r&&(r=n[t]=$.unbox(r)),t=F(r,null),o=o||t.thisDep,l=l||t.propDep,s=s||t.contextDep;else{switch(a(c,".",t,"="),typeof r){case"number":a(r);break;case"string":a('"',r,'"');break;case"object":Array.isArray(r)&&a("[",r.join(),"]");break;default:a(e.link(r))}a(";")}})),t.dynamic[r]=new $.DynamicVariable(4,{thisDep:o,contextDep:s,propDep:l,ref:c,append:function(e,t){i.forEach((function(r){var a=n[r];$.isDynamic(a)&&(a=e.invoke(t,a),t(c,".",r,"=",a,";"))}))}}),delete t.static[r]}}var J=u.Record,Q={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(Q.min=32775,Q.max=32776);var ee=r.angle_instanced_arrays,te=r.webgl_draw_buffers,ne=r.oes_vertex_array_object,ae={dirty:!0,profile:m.profile},ie={},oe=[],se={},le={};v("dither",3024),v("blend.enable",3042),b("blend.color","blendColor",[0,0,0,0]),b("blend.equation","blendEquationSeparate",[32774,32774]),b("blend.func","blendFuncSeparate",[1,0,1,0]),v("depth.enable",2929,!0),b("depth.func","depthFunc",513),b("depth.range","depthRange",[0,1]),b("depth.mask","depthMask",!0),b("colorMask","colorMask",[!0,!0,!0,!0]),v("cull.enable",2884),b("cull.face","cullFace",1029),b("frontFace","frontFace",2305),b("lineWidth","lineWidth",1),v("polygonOffset.enable",32823),b("polygonOffset.offset","polygonOffset",[0,0]),v("sample.alpha",32926),v("sample.enable",32928),b("sample.coverage","sampleCoverage",[1,!1]),v("stencil.enable",2960),b("stencil.mask","stencilMask",-1),b("stencil.func","stencilFunc",[519,0,-1]),b("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),b("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),v("scissor.enable",3089),b("scissor.box","scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),b("viewport","viewport",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var ce={gl:e,context:h,strings:t,next:ie,current:ae,draw:p,elements:o,buffer:a,shader:f,attributes:u.state,vao:u,uniforms:c,framebuffer:l,extensions:r,timer:d,isBufferArgs:O},ue={primTypes:re,compareFuncs:De,blendFuncs:ke,blendEquations:Q,stencilOps:Te,glTypes:K,orientationType:Ae};te&&(ue.backBuffer=[1029],ue.drawBuffer=i(n.maxDrawbuffers,(function(e){return 0===e?[0]:i(e,(function(e){return 36064+e}))})));var fe=0;return{next:ie,current:ae,procs:function(){var e=x(),t=e.proc("poll"),a=e.proc("refresh"),o=e.block();t(o),a(o);var s,l=e.shared,c=l.gl,u=l.next,f=l.current;o(f,".dirty=false;"),S(e,t),S(e,a,null,!0),ee&&(s=e.link(ee)),r.oes_vertex_array_object&&a(e.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var p=0;p<n.maxAttributes;++p){var h=a.def(l.attributes,"[",p,"]"),d=e.cond(h,".buffer");d.then(c,".enableVertexAttribArray(",p,");",c,".bindBuffer(",34962,",",h,".buffer.buffer);",c,".vertexAttribPointer(",p,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(c,".disableVertexAttribArray(",p,");",c,".vertexAttrib4f(",p,",",h,".x,",h,".y,",h,".z,",h,".w);",h,".buffer=null;"),a(d),ee&&a(s,".vertexAttribDivisorANGLE(",p,",",h,".divisor);")}return a(e.shared.vao,".currentVAO=null;",e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"),Object.keys(se).forEach((function(r){var n=se[r],i=o.def(u,".",r),s=e.block();s("if(",i,"){",c,".enable(",n,")}else{",c,".disable(",n,")}",f,".",r,"=",i,";"),a(s),t("if(",i,"!==",f,".",r,"){",s,"}")})),Object.keys(le).forEach((function(r){var n,s,l=le[r],p=ae[r],h=e.block();h(c,".",l,"("),g(p)?(l=p.length,n=e.global.def(u,".",r),s=e.global.def(f,".",r),h(i(l,(function(e){return n+"["+e+"]"})),");",i(l,(function(e){return s+"["+e+"]="+n+"["+e+"];"})).join("")),t("if(",i(l,(function(e){return n+"["+e+"]!=="+s+"["+e+"]"})).join("||"),"){",h,"}")):(n=o.def(u,".",r),s=o.def(f,".",r),h(n,");",f,".",r,"=",n,";"),t("if(",n,"!==",s,"){",h,"}")),a(h)})),e.compile()}(),compile:function(e,t,r,n,a){var i=x();i.stats=i.link(a),Object.keys(t.static).forEach((function(e){Z(i,t,e)})),we.forEach((function(t){Z(i,e,t)}));var o=T(e,t,r,n);return function(e,t){var r=e.proc("draw",1);B(e,r),A(e,r,t.context),S(e,r,t.framebuffer),M(e,r,t),E(e,r,t.state),z(e,r,t,!1,!0);var n=t.shader.progVar.append(e,r);if(r(e.shared.gl,".useProgram(",n,".program);"),t.shader.program)H(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var a=e.global.def("{}"),i=r.def(n,".id"),o=r.def(a,"[",i,"]");r(e.cond(o).then(o,".call(this,a0);").else(o,"=",a,"[",i,"]=",e.link((function(r){return W(H,e,t,r,1)})),"(",n,");",o,".call(this,a0);"))}0<Object.keys(t.state).length&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}(i,o),Y(i,o),function(e,t){function r(e){return e.contextDep&&a||e.propDep}var n=e.proc("batch",2);e.batchId="0",B(e,n);var a=!1,i=!0;Object.keys(t.context).forEach((function(e){a=a||t.context[e].propDep})),a||(A(e,n,t.context),i=!1);var o=!1;if((s=t.framebuffer)?(s.propDep?a=o=!0:s.contextDep&&a&&(o=!0),o||S(e,n,s)):S(e,n,null),t.state.viewport&&t.state.viewport.propDep&&(a=!0),M(e,n,t),E(e,n,t.state,(function(e){return!r(e)})),t.profile&&r(t.profile)||z(e,n,t,!1,"a1"),t.contextDep=a,t.needsContext=i,t.needsFramebuffer=o,(i=t.shader.progVar).contextDep&&a||i.propDep)X(e,n,t,null);else if(i=i.append(e,n),n(e.shared.gl,".useProgram(",i,".program);"),t.shader.program)X(e,n,t,t.shader.program);else{n(e.shared.vao,".setVAO(null);");var s=e.global.def("{}"),l=(o=n.def(i,".id"),n.def(s,"[",o,"]"));n(e.cond(l).then(l,".call(this,a0,a1);").else(l,"=",s,"[",o,"]=",e.link((function(r){return W(X,e,t,r,2)})),"(",i,");",l,".call(this,a0,a1);"))}0<Object.keys(t.state).length&&n(e.shared.current,".dirty=true;"),e.shared.vao&&n(e.shared.vao,".setVAO(null);")}(i,o),j(i.compile(),{destroy:function(){o.shader.program.destroy()}})}}}function z(e,t){for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}var j=function(e,t){for(var r=Object.keys(t),n=0;n<r.length;++n)e[r[n]]=t[r[n]];return e},U=0,$={DynamicVariable:e,define:function(r,n){return new e(r,t(n+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof e},unbox:function t(r,n){return"function"==typeof r?new e(0,r):"number"==typeof r||"boolean"==typeof r?new e(5,r):Array.isArray(r)?new e(6,r.map((function(e,r){return t(e,n+"["+r+"]")}))):r instanceof e?r:void 0},accessor:t},V={next:"function"==typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"==typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},q="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},W=s();W.zero=s();var H=function(e,t){var r=1;t.ext_texture_filter_anisotropic&&(r=e.getParameter(34047));var n=1,a=1;t.webgl_draw_buffers&&(n=e.getParameter(34852),a=e.getParameter(36063));var i=!!t.oes_texture_float;if(i){i=e.createTexture(),e.bindTexture(3553,i),e.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var o=e.createFramebuffer();if(e.bindFramebuffer(36160,o),e.framebufferTexture2D(36160,36064,3553,i,0),e.bindTexture(3553,null),36053!==e.checkFramebufferStatus(36160))i=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var s=W.allocType(5126,4);e.readPixels(0,0,1,1,6408,5126,s),e.getError()?i=!1:(e.deleteFramebuffer(o),e.deleteTexture(i),i=1===s[0]),W.freeType(s)}}return s=!0,"undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))||(s=e.createTexture(),o=W.allocType(5121,36),e.activeTexture(33984),e.bindTexture(34067,s),e.texImage2D(34069,0,6408,3,3,0,6408,5121,o),W.freeType(o),e.bindTexture(34067,null),e.deleteTexture(s),s=!e.getError()),{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter((function(e){return!!t[e]})),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:a,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:i,npotTextureCube:s}},G=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray},X=function(e){return Object.keys(e).map((function(t){return e[t]}))},Y={shape:function(e){for(var t=[];e.length;e=e[0])t.push(e.length);return t},flatten:function(e,t,r,n){var a=1;if(t.length)for(var i=0;i<t.length;++i)a*=t[i];else a=0;switch(r=n||W.allocType(r,a),t.length){case 0:break;case 1:for(n=t[0],t=0;t<n;++t)r[t]=e[t];break;case 2:for(n=t[0],t=t[1],i=a=0;i<n;++i)for(var o=e[i],s=0;s<t;++s)r[a++]=o[s];break;case 3:c(e,t[0],t[1],t[2],r,0);break;default:!function e(t,r,n,a,i){for(var o=1,s=n+1;s<r.length;++s)o*=r[s];var l=r[n];if(4==r.length-n){var u=r[n+1],f=r[n+2];for(r=r[n+3],s=0;s<l;++s)c(t[s],u,f,r,a,i),i+=o}else for(s=0;s<l;++s)e(t[s],r,n+1,a,i),i+=o}(e,t,0,r,0)}return r}},Z={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},K={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},J={dynamic:35048,stream:35040,static:35044},Q=Y.flatten,ee=Y.shape,te=[];te[5120]=1,te[5122]=2,te[5124]=4,te[5121]=1,te[5123]=2,te[5125]=4,te[5126]=4;var re={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},ne=new Float32Array(1),ae=new Uint32Array(ne.buffer),ie=[9984,9986,9985,9987],oe=[0,6409,6410,6407,6408],se={};se[6409]=se[6406]=se[6402]=1,se[34041]=se[6410]=2,se[6407]=se[35904]=3,se[6408]=se[35906]=4;var le=y("HTMLCanvasElement"),ce=y("OffscreenCanvas"),ue=y("CanvasRenderingContext2D"),fe=y("ImageBitmap"),pe=y("HTMLImageElement"),he=y("HTMLVideoElement"),de=Object.keys(Z).concat([le,ce,ue,fe,pe,he]),me=[];me[5121]=1,me[5126]=4,me[36193]=2,me[5123]=2,me[5125]=4;var ge=[];ge[32854]=2,ge[32855]=2,ge[36194]=2,ge[34041]=4,ge[33776]=.5,ge[33777]=.5,ge[33778]=1,ge[33779]=1,ge[35986]=.5,ge[35987]=1,ge[34798]=1,ge[35840]=.5,ge[35841]=.25,ge[35842]=.5,ge[35843]=.25,ge[36196]=.5;var ye=[];ye[32854]=2,ye[32855]=2,ye[36194]=2,ye[33189]=2,ye[36168]=1,ye[34041]=4,ye[35907]=4,ye[34836]=16,ye[34842]=8,ye[34843]=6;var ve=function(e,t,r,n,a){function i(e){this.id=c++,this.refCount=1,this.renderbuffer=e,this.format=32854,this.height=this.width=0,a.profile&&(this.stats={size:0})}function o(t){var r=t.renderbuffer;e.bindRenderbuffer(36161,null),e.deleteRenderbuffer(r),t.renderbuffer=null,t.refCount=0,delete u[t.id],n.renderbufferCount--}var s={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(s.srgba=35907),t.ext_color_buffer_half_float&&(s.rgba16f=34842,s.rgb16f=34843),t.webgl_color_buffer_float&&(s.rgba32f=34836);var l=[];Object.keys(s).forEach((function(e){l[s[e]]=e}));var c=0,u={};return i.prototype.decRef=function(){0>=--this.refCount&&o(this)},a.profile&&(n.getTotalRenderbufferSize=function(){var e=0;return Object.keys(u).forEach((function(t){e+=u[t].stats.size})),e}),{create:function(t,r){function o(t,r){var n=0,i=0,u=32854;if("object"==typeof t&&t?("shape"in t?(n=0|(i=t.shape)[0],i=0|i[1]):("radius"in t&&(n=i=0|t.radius),"width"in t&&(n=0|t.width),"height"in t&&(i=0|t.height)),"format"in t&&(u=s[t.format])):"number"==typeof t?(n=0|t,i="number"==typeof r?0|r:n):t||(n=i=1),n!==c.width||i!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=i,c.format=u,e.bindRenderbuffer(36161,c.renderbuffer),e.renderbufferStorage(36161,u,n,i),a.profile&&(c.stats.size=ye[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new i(e.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(t,r),o.resize=function(t,r){var n=0|t,i=0|r||n;return n===c.width&&i===c.height||(o.width=c.width=n,o.height=c.height=i,e.bindRenderbuffer(36161,c.renderbuffer),e.renderbufferStorage(36161,c.format,n,i),a.profile&&(c.stats.size=ye[c.format]*c.width*c.height)),o},o._reglType="renderbuffer",o._renderbuffer=c,a.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){X(u).forEach(o)},restore:function(){X(u).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)})),e.bindRenderbuffer(36161,null)}}},be=[];be[6408]=4,be[6407]=3;var xe=[];xe[5121]=1,xe[5126]=4,xe[36193]=2;var _e=["x","y","z","w"],we="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),ke={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},De={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Te={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ae={cw:2304,ccw:2305},Se=new P(!1,!1,!1,(function(){}));return function(e){function t(){if(0===Z.length)w&&w.update(),ee=null;else{ee=V.next(t),f();for(var e=Z.length-1;0<=e;--e){var r=Z[e];r&&r(N,null,0)}g.flush(),w&&w.update()}}function r(){!ee&&0<Z.length&&(ee=V.next(t))}function n(){ee&&(V.cancel(t),ee=null)}function i(e){e.preventDefault(),n(),K.forEach((function(e){e()}))}function o(e){g.getError(),v.restore(),L.restore(),I.restore(),F.restore(),U.restore(),W.restore(),R.restore(),w&&w.restore(),G.procs.refresh(),r(),J.forEach((function(e){e()}))}function s(e){function t(e,t){var r={},n={};return Object.keys(e).forEach((function(a){var i=e[a];if($.isDynamic(i))n[a]=$.unbox(i,a);else{if(t&&Array.isArray(i))for(var o=0;o<i.length;++o)if($.isDynamic(i[o]))return void(n[a]=$.unbox(i,a));r[a]=i}})),{dynamic:n,static:r}}var r=t(e.context||{},!0),n=t(e.uniforms||{},!0),a=t(e.attributes||{},!1);e=t(function(e){function t(e){if(e in r){var t=r[e];delete r[e],Object.keys(t).forEach((function(n){r[e+"."+n]=t[n]}))}}var r=j({},e);return delete r.uniforms,delete r.attributes,delete r.context,delete r.vao,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),t("blend"),t("depth"),t("cull"),t("stencil"),t("polygonOffset"),t("scissor"),t("sample"),"vao"in e&&(r.vao=e.vao),r}(e),!1);var i={gpuTime:0,cpuTime:0,count:0},o=G.compile(e,a,n,r,i),s=o.draw,l=o.batch,c=o.scope,u=[];return j((function(e,t){var r;if("function"==typeof e)return c.call(this,null,e,0);if("function"==typeof t)if("number"==typeof e)for(r=0;r<e;++r)c.call(this,null,t,r);else{if(!Array.isArray(e))return c.call(this,e,t,0);for(r=0;r<e.length;++r)c.call(this,e[r],t,r)}else if("number"==typeof e){if(0<e)return l.call(this,function(e){for(;u.length<e;)u.push(null);return u}(0|e),0|e)}else{if(!Array.isArray(e))return s.call(this,e);if(e.length)return l.call(this,e,e.length)}}),{stats:i,destroy:function(){o.destroy()}})}function l(e,t){var r=0;G.procs.poll();var n=t.color;n&&(g.clearColor(+n[0]||0,+n[1]||0,+n[2]||0,+n[3]||0),r|=16384),"depth"in t&&(g.clearDepth(+t.depth),r|=256),"stencil"in t&&(g.clearStencil(0|t.stencil),r|=1024),g.clear(r)}function c(e){return Z.push(e),r(),{cancel:function(){var t=z(Z,e);Z[t]=function e(){var t=z(Z,e);Z[t]=Z[Z.length-1],--Z.length,0>=Z.length&&n()}}}}function u(){var e=X.viewport,t=X.scissor_box;e[0]=e[1]=t[0]=t[1]=0,N.viewportWidth=N.framebufferWidth=N.drawingBufferWidth=e[2]=t[2]=g.drawingBufferWidth,N.viewportHeight=N.framebufferHeight=N.drawingBufferHeight=e[3]=t[3]=g.drawingBufferHeight}function f(){N.tick+=1,N.time=m(),u(),G.procs.poll()}function p(){F.refresh(),u(),G.procs.refresh(),w&&w.update()}function m(){return(q()-k)/1e3}if(!(e=a(e)))return null;var g=e.gl,y=g.getContextAttributes();g.isContextLost();var v=function(e,t){function r(t){var r;t=t.toLowerCase();try{r=n[t]=e.getExtension(t)}catch(e){}return!!r}for(var n={},a=0;a<t.extensions.length;++a){var i=t.extensions[a];if(!r(i))return t.onDestroy(),t.onDone('"'+i+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return t.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(e){if(n[e]&&!r(e))throw Error("(regl): error restoring extension "+e)}))}}}(g,e);if(!v)return null;var b=function(){var e={"":0},t=[""];return{id:function(r){var n=e[r];return n||(n=e[r]=t.length,t.push(r),n)},str:function(e){return t[e]}}}(),x={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},_=v.extensions,w=function(e,t){function r(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null}function n(e,t,n){var a=o.pop()||new r;a.startQueryIndex=e,a.endQueryIndex=t,a.sum=0,a.stats=n,s.push(a)}if(!t.ext_disjoint_timer_query)return null;var a=[],i=[],o=[],s=[],l=[],c=[];return{beginQuery:function(e){var r=a.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),n(i.length-1,i.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:n,update:function(){var e,r;if(0!==(e=i.length)){c.length=Math.max(c.length,e+1),l.length=Math.max(l.length,e+1),l[0]=0;var n=c[0]=0;for(r=e=0;r<i.length;++r){var u=i[r];t.ext_disjoint_timer_query.getQueryObjectEXT(u,34919)?(n+=t.ext_disjoint_timer_query.getQueryObjectEXT(u,34918),a.push(u)):i[e++]=u,l[r+1]=n,c[r+1]=e}for(i.length=e,r=e=0;r<s.length;++r){var f=(n=s[r]).startQueryIndex;u=n.endQueryIndex,n.sum+=l[u]-l[f],f=c[f],(u=c[u])===f?(n.stats.gpuTime+=n.sum/1e6,o.push(n)):(n.startQueryIndex=f,n.endQueryIndex=u,s[e++]=n)}s.length=e}},getNumPendingQueries:function(){return i.length},clear:function(){a.push.apply(a,i);for(var e=0;e<a.length;e++)t.ext_disjoint_timer_query.deleteQueryEXT(a[e]);i.length=0,a.length=0},restore:function(){i.length=0,a.length=0}}}(0,_),k=q(),A=g.drawingBufferWidth,C=g.drawingBufferHeight,N={tick:0,time:0,viewportWidth:A,viewportHeight:C,framebufferWidth:A,framebufferHeight:C,drawingBufferWidth:A,drawingBufferHeight:C,pixelRatio:e.pixelRatio},O=(A={elements:null,primitive:4,count:-1,offset:0,instances:-1},H(g,_)),I=h(g,x,e,(function(e){return R.destroyBuffer(e)})),P=d(g,_,I,x),R=S(g,_,O,x,I,P,A),L=M(g,b,x,e),F=D(g,_,O,(function(){G.procs.poll()}),N,x,e),U=ve(g,_,0,x,e),W=T(g,_,O,F,U,x),G=B(g,b,_,O,I,P,0,W,{},R,L,A,N,w,e),X=(b=E(g,W,G.procs.poll,N),G.next),Y=g.canvas,Z=[],K=[],J=[],Q=[e.onDestroy],ee=null;Y&&(Y.addEventListener("webglcontextlost",i,!1),Y.addEventListener("webglcontextrestored",o,!1));var te=W.setFBO=s({framebuffer:$.define.call(null,1,"framebuffer")});return p(),y=j(s,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var t=0;6>t;++t)te(j({framebuffer:e.framebuffer.faces[t]},e),l);else te(e,l);else l(0,e)},prop:$.define.bind(null,1),context:$.define.bind(null,2),this:$.define.bind(null,3),draw:s({}),buffer:function(e){return I.create(e,34962,!1,!1)},elements:function(e){return P.create(e,!1)},texture:F.create2D,cube:F.createCube,renderbuffer:U.create,framebuffer:W.create,framebufferCube:W.createCube,vao:R.createVAO,attributes:y,frame:c,on:function(e,t){var r;switch(e){case"frame":return c(t);case"lost":r=K;break;case"restore":r=J;break;case"destroy":r=Q}return r.push(t),{cancel:function(){for(var e=0;e<r.length;++e)if(r[e]===t){r[e]=r[r.length-1],r.pop();break}}}},limits:O,hasExtension:function(e){return 0<=O.extensions.indexOf(e.toLowerCase())},read:b,destroy:function(){Z.length=0,n(),Y&&(Y.removeEventListener("webglcontextlost",i),Y.removeEventListener("webglcontextrestored",o)),L.clear(),W.clear(),U.clear(),R.clear(),F.clear(),P.clear(),I.clear(),w&&w.clear(),Q.forEach((function(e){e()}))},_gl:g,_refresh:p,poll:function(){f(),w&&w.update()},now:m,stats:x}),e.onDone(null,y),y}}))},{}],284:[function(e,t,r){var n=e("buffer"),a=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=n:(i(n,r),r.Buffer=o),o.prototype=Object.create(a.prototype),i(a,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=a(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:85}],285:[function(e,t,r){t.exports=a;var n=e("events").EventEmitter;function a(){n.call(this)}e("inherits")(a,n),a.Readable=e("readable-stream/lib/_stream_readable.js"),a.Writable=e("readable-stream/lib/_stream_writable.js"),a.Duplex=e("readable-stream/lib/_stream_duplex.js"),a.Transform=e("readable-stream/lib/_stream_transform.js"),a.PassThrough=e("readable-stream/lib/_stream_passthrough.js"),a.finished=e("readable-stream/lib/internal/streams/end-of-stream.js"),a.pipeline=e("readable-stream/lib/internal/streams/pipeline.js"),a.Stream=a,a.prototype.pipe=function(e,t){var r=this;function a(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",a),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(u(),0===n.listenerCount(this,"error"))throw e}function u(){r.removeListener("data",a),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("error",c),e.on("error",c),r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e}},{events:84,inherits:231,"readable-stream/lib/_stream_duplex.js":287,"readable-stream/lib/_stream_passthrough.js":288,"readable-stream/lib/_stream_readable.js":289,"readable-stream/lib/_stream_transform.js":290,"readable-stream/lib/_stream_writable.js":291,"readable-stream/lib/internal/streams/end-of-stream.js":295,"readable-stream/lib/internal/streams/pipeline.js":297}],286:[function(e,t,r){"use strict";var n={};function a(e,t,r){r||(r=Error);var a=function(e){var r,n;function a(r,n,a){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,a))||this}return n=e,(r=a).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,a}(r);a.prototype.name=r.name,a.prototype.code=e,n[e]=a}function i(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}a("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),a("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,a,o;if("string"==typeof t&&(a="not ",t.substr(0,a.length)===a)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))o="The ".concat(e," ").concat(n," ").concat(i(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";o='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(i(t,"type"))}return o+". Received type ".concat(typeof r)}),TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],287:[function(e,t,r){(function(r){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var a=e("./_stream_readable"),i=e("./_stream_writable");e("inherits")(c,a);for(var o=n(i.prototype),s=0;s<o.length;s++){var l=o[s];c.prototype[l]||(c.prototype[l]=i.prototype[l])}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),i.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||r.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":289,"./_stream_writable":291,_process:277,inherits:231}],288:[function(e,t,r){"use strict";t.exports=a;var n=e("./_stream_transform");function a(e){if(!(this instanceof a))return new a(e);n.call(this,e)}e("inherits")(a,n),a.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":290,inherits:231}],289:[function(e,t,n){(function(r,n){(function(){"use strict";var a;t.exports=T,T.ReadableState=D,e("events").EventEmitter;var i,o=function(e,t){return e.listeners(t).length},s=e("./internal/streams/stream"),l=e("buffer").Buffer,c=n.Uint8Array||function(){},u=e("util");i=u&&u.debuglog?u.debuglog("stream"):function(){};var f,p,h,d=e("./internal/streams/buffer_list"),m=e("./internal/streams/destroy"),g=e("./internal/streams/state").getHighWaterMark,y=e("../errors").codes,v=y.ERR_INVALID_ARG_TYPE,b=y.ERR_STREAM_PUSH_AFTER_EOF,x=y.ERR_METHOD_NOT_IMPLEMENTED,_=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(T,s);var w=m.errorOrDestroy,k=["error","close","destroy","pause","resume"];function D(t,r,n){a=a||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=r instanceof a),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function T(t){if(a=a||e("./_stream_duplex"),!(this instanceof T))return new T(t);var r=this instanceof a;this._readableState=new D(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function A(e,t,r,n,a){i("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?E(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}}(e,s);else if(a||(o=function(e,t){var r,n;return n=t,l.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],t)),r}(s,t)),o)w(e,o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)s.endEmitted?w(e,new _):S(e,s,t,!0);else if(s.ended)w(e,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?S(e,s,t,!1):N(e,s)):S(e,s,t,!1)}else n||(s.reading=!1,N(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function S(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&E(e)),N(e,t)}function M(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(C,e))}function C(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function N(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(O,e,t))}function O(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function P(e){i("readable nexttick read 0"),e.read(0)}function R(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function B(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(z,t,e))}function z(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function j(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),T.prototype.destroy=m.destroy,T.prototype._undestroy=m.undestroy,T.prototype._destroy=function(e,t){t(e)},T.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=l.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},T.prototype.unshift=function(e){return A(this,e,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(t){f||(f=e("string_decoder/").StringDecoder);var r=new f(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,a="";null!==n;)a+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==a&&this._readableState.buffer.push(a),this._readableState.length=a.length,this},T.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):E(this),null;if(0===(e=M(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,a=t.needReadable;return i("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",a=!0),t.ended||t.reading?i("reading or ended",a=!1):a&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=M(r,t))),null===(n=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&B(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(e){w(this,new x("_read()"))},T.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,i("pipe count=%d opts=%j",a.pipesCount,t);var s=t&&!1===t.end||e===r.stdout||e===r.stderr?m:l;function l(){i("onend"),e.end()}a.endEmitted?r.nextTick(s):n.once("end",s),e.on("unpipe",(function t(r,o){i("onunpipe"),r===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,i("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",t),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",f),u=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}));var c=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,L(e))}}(n);e.on("drain",c);var u=!1;function f(t){i("ondata");var r=e.write(t);i("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==j(a.pipes,e))&&!u&&(i("false write response, pause",a.awaitDrain),a.awaitDrain++),n.pause())}function p(t){i("onerror",t),m(),e.removeListener("error",p),0===o(e,"error")&&w(e,t)}function h(){e.removeListener("finish",d),m()}function d(){i("onfinish"),e.removeListener("close",h),m()}function m(){i("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",h),e.once("finish",d),e.emit("pipe",n),a.flowing||(i("pipe resume"),n.resume()),e},T.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<a;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var o=j(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},T.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t),a=this._readableState;return"data"===e?(a.readableListening=this.listenerCount("readable")>0,!1!==a.flowing&&this.resume()):"readable"===e&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,i("on readable",a.length,a.reading),a.length?E(this):a.reading||r.nextTick(P,this))),n},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(I,this),n},T.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(I,this),t},T.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(R,e,t))}(this,e)),e.paused=!1,this},T.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var a in e.on("end",(function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){i("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a||(r.objectMode||a&&a.length)&&(t.push(a)||(n=!0,e.pause()))})),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var o=0;o<k.length;o++)e.on(k[o],this.emit.bind(this,k[o]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===p&&(p=e("./internal/streams/async_iterator")),p(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),T._fromList=F,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(t,r){return void 0===h&&(h=e("./internal/streams/from")),h(T,t,r)})}).call(this)}).call(this,e("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":286,"./_stream_duplex":287,"./internal/streams/async_iterator":292,"./internal/streams/buffer_list":293,"./internal/streams/destroy":294,"./internal/streams/from":296,"./internal/streams/state":298,"./internal/streams/stream":299,_process:277,buffer:85,events:84,inherits:231,"string_decoder/":300,util:83}],290:[function(e,t,r){"use strict";t.exports=u;var n=e("../errors").codes,a=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,l=e("./_stream_duplex");function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);l.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?p(this,null,null):this._flush((function(t,r){p(e,t,r)}))}function p(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new o;return e.push(null)}e("inherits")(u,l),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,r){r(new a("_transform()"))},u.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var a=this._readableState;(n.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,(function(e){t(e)}))}},{"../errors":286,"./_stream_duplex":287,inherits:231}],291:[function(e,t,n){(function(r,n){(function(){"use strict";function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var a=n.callback;t.pendingcb--,a(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var i;t.exports=T,T.WritableState=D;var o,s={deprecate:e("util-deprecate")},l=e("./internal/streams/stream"),c=e("buffer").Buffer,u=n.Uint8Array||function(){},f=e("./internal/streams/destroy"),p=e("./internal/streams/state").getHighWaterMark,h=e("../errors").codes,d=h.ERR_INVALID_ARG_TYPE,m=h.ERR_METHOD_NOT_IMPLEMENTED,g=h.ERR_MULTIPLE_CALLBACK,y=h.ERR_STREAM_CANNOT_PIPE,v=h.ERR_STREAM_DESTROYED,b=h.ERR_STREAM_NULL_VALUES,x=h.ERR_STREAM_WRITE_AFTER_END,_=h.ERR_UNKNOWN_ENCODING,w=f.errorOrDestroy;function k(){}function D(t,n,o){i=i||e("./_stream_duplex"),t=t||{},"boolean"!=typeof o&&(o=n instanceof i),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=p(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,a=n.sync,i=n.writecb;if("function"!=typeof i)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,a,i){--t.pendingcb,n?(r.nextTick(i,a),r.nextTick(N,e,t),e._writableState.errorEmitted=!0,w(e,a)):(i(a),e._writableState.errorEmitted=!0,w(e,a),N(e,t))}(e,n,a,t,i);else{var o=E(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||M(e,n),a?r.nextTick(S,e,n,o,i):S(e,n,o,i)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function T(t){var r=this instanceof(i=i||e("./_stream_duplex"));if(!r&&!o.call(T,this))return new T(t);this._writableState=new D(t,this,r),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function A(e,t,r,n,a,i,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):r?e._writev(a,t.onwrite):e._write(a,i,t.onwrite),t.sync=!1}function S(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),N(e,t)}function M(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,l=!0;r;)i[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;i.allBuffers=l,A(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,f=r.callback;if(A(e,t,!1,t.objectMode?1:c.length,c,u,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,t){e._final((function(r){t.pendingcb--,r&&w(e,r),t.prefinished=!0,e.emit("prefinish"),N(e,t)}))}function N(e,t){var n=E(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(C,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var a=e._readableState;(!a||a.autoDestroy&&a.endEmitted)&&e.destroy()}return n}e("inherits")(T,l),D.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(D.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(e){return!!o.call(this,e)||this===T&&e&&e._writableState instanceof D}})):o=function(e){return e instanceof this},T.prototype.pipe=function(){w(this,new y)},T.prototype.write=function(e,t,n){var a,i=this._writableState,o=!1,s=!i.objectMode&&(a=e,c.isBuffer(a)||a instanceof u);return s&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=k),i.ending?function(e,t){var n=new x;w(e,n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,a){var i;return null===n?i=new b:"string"==typeof n||t.objectMode||(i=new d("chunk",["string","Buffer"],n)),!i||(w(e,i),r.nextTick(a,i),!1)}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,r,n,a,i){if(!r){var o=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,a);n!==o&&(r=!0,a="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:a,isBuf:r,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,s,n,a,i);return l}(this,i,s,e,t,n)),o},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||M(this,e))},T.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new m("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,n){var a=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||function(e,t,n){t.ending=!0,N(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,a,n),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=f.destroy,T.prototype._undestroy=f.undestroy,T.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":286,"./_stream_duplex":287,"./internal/streams/destroy":294,"./internal/streams/state":298,"./internal/streams/stream":299,_process:277,buffer:85,inherits:231,"util-deprecate":330}],292:[function(e,t,r){(function(r){(function(){"use strict";var n;function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=e("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function h(e,t){return{value:e,done:t}}function d(e){var t=e[o];if(null!==t){var r=e[p].read();null!==r&&(e[u]=null,e[o]=null,e[s]=null,t(h(r,!1)))}}function m(e){r.nextTick(d,e)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((a(n={get stream(){return this[p]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[p].destroyed)return new Promise((function(t,n){r.nextTick((function(){e[l]?n(e[l]):t(h(void 0,!0))}))}));var n,a=this[u];if(a)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(h(void 0,!0)):t[f](r,n)}),n)}}(a,this));else{var i=this[p].read();if(null!==i)return Promise.resolve(h(i,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),g);t.exports=function(e){var t,r=Object.create(y,(a(t={},p,{value:e,writable:!0}),a(t,o,{value:null,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,l,{value:null,writable:!0}),a(t,c,{value:e._readableState.endEmitted,writable:!0}),a(t,f,{value:function(e,t){var n=r[p].read();n?(r[u]=null,r[o]=null,r[s]=null,e(h(n,!1))):(r[o]=e,r[s]=t)},writable:!0}),t));return r[u]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[u]=null,r[o]=null,r[s]=null,t(e)),void(r[l]=e)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[s]=null,n(h(void 0,!0))),r[c]=!0})),e.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":295,_process:277}],293:[function(e,t,r){"use strict";function n(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 a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(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)}}var o=e("buffer").Buffer,s=e("util").inspect,l=s&&s.custom||"inspect";t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,a=o.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=a,n=s,o.prototype.copy.call(t,r,n),s+=i.data.length,i=i.next;return a}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var a=t.data,i=e>a.length?a.length:e;if(i===a.length?n+=a:n+=a.slice(0,e),0==(e-=i)){i===a.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var a=r.data,i=e>a.length?a.length:e;if(a.copy(t,t.length-e,0,i),0==(e-=i)){i===a.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=a.slice(i));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&i(t.prototype,r),e}()},{buffer:85,util:83}],294:[function(e,t,r){(function(e){(function(){"use strict";function r(e,t){a(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}t.exports={destroy:function(t,i){var o=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?(i?i(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(a,this,t)):e.nextTick(a,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!i&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(n,o):(o._writableState.errorEmitted=!0,e.nextTick(r,o,t)):e.nextTick(r,o,t):i?(e.nextTick(n,o),i(t)):e.nextTick(n,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:277}],295:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function a(){}t.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);r||(r={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];e.apply(this,n)}}}(i||a);var o=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,l=function(){t.writable||u()},c=t._writableState&&t._writableState.finished,u=function(){s=!1,c=!0,o||i.call(t)},f=t._readableState&&t._readableState.endEmitted,p=function(){o=!1,f=!0,s||i.call(t)},h=function(e){i.call(t,e)},d=function(){var e;return o&&!f?(t._readableState&&t._readableState.ended||(e=new n),i.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new n),i.call(t,e)):void 0},m=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",d),t.req?m():t.on("request",m)):s&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",p),t.on("finish",u),!1!==r.error&&t.on("error",h),t.on("close",d),function(){t.removeListener("complete",u),t.removeListener("abort",d),t.removeListener("request",m),t.req&&t.req.removeListener("finish",u),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",u),t.removeListener("end",p),t.removeListener("error",h),t.removeListener("close",d)}}},{"../../../errors":286}],296:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],297:[function(e,t,r){"use strict";var n,a=e("../../../errors").codes,i=a.ERR_MISSING_ARGS,o=a.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function l(t,r,a,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var s=!1;t.on("close",(function(){s=!0})),void 0===n&&(n=e("./end-of-stream")),n(t,{readable:r,writable:a},(function(e){if(e)return i(e);s=!0,i()}));var l=!1;return function(e){if(!s&&!l)return l=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void i(e||new o("pipe"))}}function c(e){e()}function u(e,t){return e.pipe(t)}function f(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}t.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,a=f(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new i("streams");var o=t.map((function(e,r){var i=r<t.length-1;return l(e,i,r>0,(function(e){n||(n=e),e&&o.forEach(c),i||(o.forEach(c),a(n))}))}));return t.reduce(u)}},{"../../../errors":286,"./end-of-stream":295}],298:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,a){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(a?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},{"../../../errors":286}],299:[function(e,t,r){t.exports=e("events").EventEmitter},{events:84}],300:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,a=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=p,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var a=o(t[n]);return a>=0?(a>0&&(e.lastNeed=a-1),a):--n<r||-2===a?0:(a=o(t[n]))>=0?(a>0&&(e.lastNeed=a-2),a):--n<r||-2===a?0:(a=o(t[n]))>=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":284}],301:[function(e,t,r){(function(r,n){(function(){var r=e("assert"),a=e("debug")("stream-parser");function i(e){a("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=-1,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function o(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||i(this),a("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=0}function s(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||i(this),a("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=1}function l(e,t){r(!this._parserCallback,'There is already a "callback" set!'),r(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||i(this),a("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=2}function c(e,t,r){this._parserInit||i(this),a("write(%o bytes)",e.length),"function"==typeof t&&(r=t),p(this,e,null,r)}function u(e,t,r){this._parserInit||i(this),a("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),p(this,e,t,r)}function f(e,t,r,i){if(e._parserBytesLeft-=t.length,a("%o bytes left for stream piece",e._parserBytesLeft),0===e._parserState?(e._parserBuffers.push(t),e._parserBuffered+=t.length):2===e._parserState&&r(t),0!==e._parserBytesLeft)return i;var o=e._parserCallback;if(o&&0===e._parserState&&e._parserBuffers.length>1&&(t=n.concat(e._parserBuffers,e._parserBuffered)),0!==e._parserState&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=-1,e._parserBuffers.splice(0),o){var s=[];t&&s.push(t),r&&s.push(r);var l=o.length>s.length;l&&s.push(h(i));var c=o.apply(e,s);if(!l||i===c)return i}}t.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");a("extending Parser into stream"),e._bytes=o,e._skipBytes=s,t&&(e._passthrough=l),t?e._transform=u:e._write=c};var p=h((function e(t,r,n,a){return t._parserBytesLeft<=0?a(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return f(t,r,n,a)}:function(){var i=r.slice(0,t._parserBytesLeft);return f(t,i,n,(function(o){return o?a(o):r.length>i.length?function(){return e(t,r.slice(i.length),n,a)}:void 0}))}}));function h(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:277,assert:75,buffer:85,debug:302}],302:[function(e,t,r){(function(n){(function(){function a(){var e;try{e=r.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(r=t.exports=e("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var a=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(a++,"%c"===e&&(i=a))})),e.splice(i,0,n)}},r.save=function(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(e){}},r.load=a,r.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"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+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(a())}).call(this)}).call(this,e("_process"))},{"./debug":303,_process:277}],303:[function(e,t,r){var n;function a(e){function t(){if(t.enabled){var e=t,a=+new Date,i=a-(n||a);e.diff=i,e.prev=n,e.curr=a,n=a;for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];o[0]=r.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var l=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,(function(t,n){if("%%"===t)return t;l++;var a=r.formatters[n];if("function"==typeof a){var i=o[l];t=a.call(e,i),o.splice(l,1),l--}return t})),r.formatArgs.call(e,o),(t.log||r.log||console.log.bind(console)).apply(e,o)}}return t.namespace=e,t.enabled=r.enabled(e),t.useColors=r.useColors(),t.color=function(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return r.colors[Math.abs(n)%r.colors.length]}(e),"function"==typeof r.init&&r.init(t),t}(r=t.exports=a.debug=a.default=a).coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){r.enable("")},r.enable=function(e){r.save(e),r.names=[],r.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),n=t.length,a=0;a<n;a++)t[a]&&("-"===(e=t[a].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")))},r.enabled=function(e){var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=e("ms"),r.names=[],r.skips=[],r.formatters={}},{ms:304}],304:[function(e,t,r){var n=1e3,a=6e4,i=60*a,o=24*i;function s(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}t.exports=function(e,t){t=t||{};var r,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){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){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===l&&!1===isNaN(e))return t.long?s(r=e,o,"day")||s(r,i,"hour")||s(r,a,"minute")||s(r,n,"second")||r+" ms":function(e){return e>=o?Math.round(e/o)+"d":e>=i?Math.round(e/i)+"h":e>=a?Math.round(e/a)+"m":e>=n?Math.round(e/n)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],305:[function(e,t,r){"use strict";var n=e("parenthesis");t.exports=function(e,t,r){if(null==e)throw Error("First argument should be a string");if(null==t)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(e){return 1===e.length&&(e+=e),e})));var a=n.parse(e,{flat:!0,brackets:r.ignore}),i=a[0].split(t);if(r.escape){for(var o=[],s=0;s<i.length;s++){var l=i[s],c=i[s+1];"\\"===l[l.length-1]&&"\\"!==l[l.length-2]?(o.push(l+t+c),s++):o.push(l)}i=o}for(s=0;s<i.length;s++)a[0]=i[s],i[s]=n.stringify(a,{flat:!0});return i}},{parenthesis:248}],306:[function(e,t,r){"use strict";t.exports=function(e){for(var t=e.length,r=new Array(t),n=new Array(t),a=new Array(t),i=new Array(t),o=new Array(t),s=new Array(t),l=0;l<t;++l)r[l]=-1,n[l]=0,a[l]=!1,i[l]=0,o[l]=-1,s[l]=[];var c,u=0,f=[],p=[];function h(t){var l=[t],c=[t];for(r[t]=n[t]=u,a[t]=!0,u+=1;c.length>0;){t=c[c.length-1];var h=e[t];if(i[t]<h.length){for(var d=i[t];d<h.length;++d){var m=h[d];if(r[m]<0){r[m]=n[m]=u,a[m]=!0,u+=1,l.push(m),c.push(m);break}a[m]&&(n[t]=0|Math.min(n[t],n[m])),o[m]>=0&&s[t].push(o[m])}i[t]=d}else{if(n[t]===r[t]){var g=[],y=[],v=0;for(d=l.length-1;d>=0;--d){var b=l[d];if(a[b]=!1,g.push(b),y.push(s[b]),v+=s[b].length,o[b]=f.length,b===t){l.length=d;break}}f.push(g);var x=new Array(v);for(d=0;d<y.length;d++)for(var _=0;_<y[d].length;_++)x[--v]=y[d][_];p.push(x)}c.pop()}}}for(l=0;l<t;++l)r[l]<0&&h(l);for(l=0;l<p.length;l++){var d=p[l];if(0!==d.length){d.sort((function(e,t){return e-t})),c=[d[0]];for(var m=1;m<d.length;m++)d[m]!==d[m-1]&&c.push(d[m]);p[l]=c}}return{components:f,adjacencyList:p}}},{}],307:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=2*Math.PI,a=function(e,t,r,n,a,i,o){var s=e.x,l=e.y;return{x:n*(s*=t)-a*(l*=r)+i,y:a*s+n*l+o}},i=function(e,t){var r=1.5707963267948966===t?.551915024494:-1.5707963267948966===t?-.551915024494:4/3*Math.tan(t/4),n=Math.cos(e),a=Math.sin(e),i=Math.cos(e+t),o=Math.sin(e+t);return[{x:n-a*r,y:a+n*r},{x:i+o*r,y:o-i*r},{x:i,y:o}]},o=function(e,t,r,n){var a=e*r+t*n;return a>1&&(a=1),a<-1&&(a=-1),(e*n-t*r<0?-1:1)*Math.acos(a)};r.default=function(e){var t=e.px,r=e.py,s=e.cx,l=e.cy,c=e.rx,u=e.ry,f=e.xAxisRotation,p=void 0===f?0:f,h=e.largeArcFlag,d=void 0===h?0:h,m=e.sweepFlag,g=void 0===m?0:m,y=[];if(0===c||0===u)return[];var v=Math.sin(p*n/360),b=Math.cos(p*n/360),x=b*(t-s)/2+v*(r-l)/2,_=-v*(t-s)/2+b*(r-l)/2;if(0===x&&0===_)return[];c=Math.abs(c),u=Math.abs(u);var w=Math.pow(x,2)/Math.pow(c,2)+Math.pow(_,2)/Math.pow(u,2);w>1&&(c*=Math.sqrt(w),u*=Math.sqrt(w));var k=function(e,t,r,a,i,s,l,c,u,f,p,h){var d=Math.pow(i,2),m=Math.pow(s,2),g=Math.pow(p,2),y=Math.pow(h,2),v=d*m-d*y-m*g;v<0&&(v=0),v/=d*y+m*g;var b=(v=Math.sqrt(v)*(l===c?-1:1))*i/s*h,x=v*-s/i*p,_=f*b-u*x+(e+r)/2,w=u*b+f*x+(t+a)/2,k=(p-b)/i,D=(h-x)/s,T=(-p-b)/i,A=(-h-x)/s,S=o(1,0,k,D),M=o(k,D,T,A);return 0===c&&M>0&&(M-=n),1===c&&M<0&&(M+=n),[_,w,S,M]}(t,r,s,l,c,u,d,g,v,b,x,_),D=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,a=!1,i=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(e){a=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(k,4),T=D[0],A=D[1],S=D[2],M=D[3],E=Math.abs(M)/(n/4);Math.abs(1-E)<1e-7&&(E=1);var C=Math.max(Math.ceil(E),1);M/=C;for(var N=0;N<C;N++)y.push(i(S,M)),S+=M;return y.map((function(e){var t=a(e[0],c,u,b,v,T,A),r=t.x,n=t.y,i=a(e[1],c,u,b,v,T,A),o=i.x,s=i.y,l=a(e[2],c,u,b,v,T,A);return{x1:r,y1:n,x2:o,y2:s,x:l.x,y:l.y}}))},t.exports=r.default},{}],308:[function(e,t,r){"use strict";var n=e("parse-svg-path"),a=e("abs-svg-path"),i=e("normalize-svg-path"),o=e("is-svg-path"),s=e("assert");t.exports=function(e){if(Array.isArray(e)&&1===e.length&&"string"==typeof e[0]&&(e=e[0]),"string"==typeof e&&(s(o(e),"String is not an SVG path."),e=n(e)),s(Array.isArray(e),"Argument should be a string or an array of path segments."),e=a(e),!(e=i(e)).length)return[0,0,0,0];for(var t=[1/0,1/0,-1/0,-1/0],r=0,l=e.length;r<l;r++)for(var c=e[r].slice(1),u=0;u<c.length;u+=2)c[u+0]<t[0]&&(t[0]=c[u+0]),c[u+1]<t[1]&&(t[1]=c[u+1]),c[u+0]>t[2]&&(t[2]=c[u+0]),c[u+1]>t[3]&&(t[3]=c[u+1]);return t}},{"abs-svg-path":70,assert:75,"is-svg-path":238,"normalize-svg-path":309,"parse-svg-path":250}],309:[function(e,t,r){"use strict";t.exports=function(e){for(var t,r=[],o=0,s=0,l=0,c=0,u=null,f=null,p=0,h=0,d=0,m=e.length;d<m;d++){var g=e[d],y=g[0];switch(y){case"M":l=g[1],c=g[2];break;case"A":var v=n({px:p,py:h,cx:g[6],cy:g[7],rx:g[1],ry:g[2],xAxisRotation:g[3],largeArcFlag:g[4],sweepFlag:g[5]});if(!v.length)continue;for(var b,x=0;x<v.length;x++)g=["C",(b=v[x]).x1,b.y1,b.x2,b.y2,b.x,b.y],x<v.length-1&&r.push(g);break;case"S":var _=p,w=h;"C"!=t&&"S"!=t||(_+=_-o,w+=w-s),g=["C",_,w,g[1],g[2],g[3],g[4]];break;case"T":"Q"==t||"T"==t?(u=2*p-u,f=2*h-f):(u=p,f=h),g=i(p,h,u,f,g[1],g[2]);break;case"Q":u=g[1],f=g[2],g=i(p,h,g[1],g[2],g[3],g[4]);break;case"L":g=a(p,h,g[1],g[2]);break;case"H":g=a(p,h,g[1],h);break;case"V":g=a(p,h,p,g[1]);break;case"Z":g=a(p,h,l,c)}t=y,p=g[g.length-2],h=g[g.length-1],g.length>4?(o=g[g.length-4],s=g[g.length-3]):(o=p,s=h),r.push(g)}return r};var n=e("svg-arc-to-cubic-bezier");function a(e,t,r,n){return["C",e,t,r,n,r,n]}function i(e,t,r,n,a,i){return["C",e/3+2/3*r,t/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}},{"svg-arc-to-cubic-bezier":307}],310:[function(e,t,r){"use strict";var n,a=e("svg-path-bounds"),i=e("parse-svg-path"),o=e("draw-svg-path"),s=e("is-svg-path"),l=e("bitmap-sdf"),c=document.createElement("canvas"),u=c.getContext("2d");t.exports=function(e,t){if(!s(e))throw Error("Argument should be valid svg path string");var r,f;t||(t={}),t.shape?(r=t.shape[0],f=t.shape[1]):(r=c.width=t.w||t.width||200,f=c.height=t.h||t.height||200);var p=Math.min(r,f),h=t.stroke||0,d=t.viewbox||t.viewBox||a(e),m=[r/(d[2]-d[0]),f/(d[3]-d[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(u.fillStyle="black",u.fillRect(0,0,r,f),u.fillStyle="white",h&&("number"!=typeof h&&(h=1),u.strokeStyle=h>0?"white":"black",u.lineWidth=Math.abs(h)),u.translate(.5*r,.5*f),u.scale(g,g),function(){if(null!=n)return n;var e=document.createElement("canvas").getContext("2d");if(e.canvas.width=e.canvas.height=1,!window.Path2D)return n=!1;var t=new Path2D("M0,0h1v1h-1v-1Z");e.fillStyle="black",e.fill(t);var r=e.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var y=new Path2D(e);u.fill(y),h&&u.stroke(y)}else{var v=i(e);o(u,v),u.fill(),h&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=t.cutoff?t.cutoff:.5,radius:null!=t.radius?t.radius:.5*p})}},{"bitmap-sdf":82,"draw-svg-path":126,"is-svg-path":238,"parse-svg-path":250,"svg-path-bounds":308}],311:[function(e,t,r){(function(t,n){(function(){var a=e("process/browser.js").nextTick,i=Function.prototype.apply,o=Array.prototype.slice,s={},l=0;function c(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new c(i.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(i.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[t]=!0,a((function(){s[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete s[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":277,timers:311}],312:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,s=e.max,l=e.random;function c(t,l){if(l=l||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,l);var u=function(t){var a,i,l,c={r:0,g:0,b:0},u=1,f=null,p=null,h=null,d=!1,m=!1;return"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(S[e])e=S[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=j.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=j.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=j.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=j.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=j.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=j.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=j.hex8.exec(e))?{r:O(t[1]),g:O(t[2]),b:O(t[3]),a:L(t[4]),format:a?"name":"hex8"}:(t=j.hex6.exec(e))?{r:O(t[1]),g:O(t[2]),b:O(t[3]),format:a?"name":"hex"}:(t=j.hex4.exec(e))?{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),a:L(t[4]+""+t[4]),format:a?"name":"hex8"}:!!(t=j.hex3.exec(e))&&{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),format:a?"name":"hex"}}(t)),"object"==typeof t&&(U(t.r)&&U(t.g)&&U(t.b)?(a=t.r,i=t.g,l=t.b,c={r:255*C(a,255),g:255*C(i,255),b:255*C(l,255)},d=!0,m="%"===String(t.r).substr(-1)?"prgb":"rgb"):U(t.h)&&U(t.s)&&U(t.v)?(f=P(t.s),p=P(t.v),c=function(t,r,n){t=6*C(t,360),r=C(r,100),n=C(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),c=a%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(t.h,f,p),d=!0,m="hsv"):U(t.h)&&U(t.s)&&U(t.l)&&(f=P(t.s),h=P(t.l),c=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=C(e,360),t=C(t,100),r=C(r,100),0===t)n=a=i=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),a=o(l,s,e),i=o(l,s,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,f,h),d=!0,m="hsl"),t.hasOwnProperty("a")&&(u=t.a)),u=E(u),{ok:d,format:t.format||m,r:o(255,s(c.r,0)),g:o(255,s(c.g,0)),b:o(255,s(c.b,0)),a:u}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=C(e,255),t=C(t,255),r=C(r,255);var n,a,i=s(e,t,r),l=o(e,t,r),c=(i+l)/2;if(i==l)n=a=0;else{var u=i-l;switch(a=c>.5?u/(2-i-l):u/(i+l),i){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:a,l:c}}function f(e,t,r){e=C(e,255),t=C(t,255),r=C(r,255);var n,a,i=s(e,t,r),l=o(e,t,r),c=i,u=i-l;if(a=0===i?0:u/i,i==l)n=0;else{switch(i){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:a,v:c}}function p(e,t,r,n){var a=[I(i(e).toString(16)),I(i(t).toString(16)),I(i(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function h(e,t,r,n){return[I(R(n)),I(i(e).toString(16)),I(i(t).toString(16)),I(i(r).toString(16))].join("")}function d(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s-=t/100,r.s=N(r.s),c(r)}function m(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s+=t/100,r.s=N(r.s),c(r)}function g(e){return c(e).desaturate(100)}function y(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l+=t/100,r.l=N(r.l),c(r)}function v(e,t){t=0===t?0:t||10;var r=c(e).toRgb();return r.r=s(0,o(255,r.r-i(-t/100*255))),r.g=s(0,o(255,r.g-i(-t/100*255))),r.b=s(0,o(255,r.b-i(-t/100*255))),c(r)}function b(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l-=t/100,r.l=N(r.l),c(r)}function x(e,t){var r=c(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,c(r)}function _(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function w(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+120)%360,s:t.s,l:t.l}),c({h:(r+240)%360,s:t.s,l:t.l})]}function k(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+90)%360,s:t.s,l:t.l}),c({h:(r+180)%360,s:t.s,l:t.l}),c({h:(r+270)%360,s:t.s,l:t.l})]}function D(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+72)%360,s:t.s,l:t.l}),c({h:(r+216)%360,s:t.s,l:t.l})]}function T(e,t,r){t=t||6,r=r||30;var n=c(e).toHsl(),a=360/r,i=[c(e)];for(n.h=(n.h-(a*t>>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=E(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return p(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[I(i(e).toString(16)),I(i(t).toString(16)),I(i(r).toString(16)),I(R(n))];return a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*C(this._r,255))+"%",g:i(100*C(this._g,255))+"%",b:i(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%)":"rgba("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(M[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+h(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+h(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(D,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:P(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;return"AA"!==(t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==t&&(t="AA"),"small"!==(r=(e.size||"small").toLowerCase())&&"large"!==r&&(r="small"),{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;u<t.length;u++)(n=c.readability(e,t[u]))>l&&(l=n,s=c(t[u]));return c.isReadable(e,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var S=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},M=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(S);function E(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function C(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,s(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function N(e){return o(1,s(0,e))}function O(e){return parseInt(e,16)}function I(e){return 1==e.length?"0"+e:""+e}function P(e){return e<=1&&(e=100*e+"%"),e}function R(t){return e.round(255*parseFloat(t)).toString(16)}function L(e){return O(e)/255}var F,B,z,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",z="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+z),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+z),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+z),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(e){return!!j.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],313:[function(e,t,r){"use strict";t.exports=a,t.exports.float32=t.exports.float=a,t.exports.fract32=t.exports.fract=function(e,t){if(e.length){if(e instanceof Float32Array)return new Float32Array(e.length);t instanceof Float32Array||(t=a(e));for(var r=0,n=t.length;r<n;r++)t[r]=e[r]-t[r];return t}return a(e-a(e))};var n=new Float32Array(1);function a(e){return e.length?e instanceof Float32Array?e:new Float32Array(e):(n[0]=e,n[0])}},{}],314:[function(e,t,r){"use strict";var n=e("parse-unit");function a(e,t){var r=n(getComputedStyle(e).getPropertyValue(t));return r[0]*i(r[1],e)}function i(e,t){switch(t=t||document.body,e=(e||"px").trim().toLowerCase(),t!==window&&t!==document||(t=document.body),e){case"%":return t.clientHeight/100;case"ch":case"ex":return function(e,t){var r=document.createElement("div");r.style["font-size"]="128"+e,t.appendChild(r);var n=a(r,"font-size")/128;return t.removeChild(r),n}(e,t);case"em":return a(t,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}t.exports=i},{"parse-unit":251}],315:[function(e,t,r){!function(e,n){!function(e){"use strict";function t(e){return e}function r(e){if(null==e)return t;var r,n,a=e.scale[0],i=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,t){t||(r=n=0);var l=2,c=e.length,u=new Array(c);for(u[0]=(r+=e[0])*a+o,u[1]=(n+=e[1])*i+s;l<c;)u[l]=e[l],++l;return u}}function n(e){var t,n=r(e.transform),a=1/0,i=a,o=-a,s=-a;function l(e){(e=n(e))[0]<a&&(a=e[0]),e[0]>o&&(o=e[0]),e[1]<i&&(i=e[1]),e[1]>s&&(s=e[1])}function c(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"Point":l(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(l)}}for(t in e.arcs.forEach((function(e){for(var t,r=-1,l=e.length;++r<l;)(t=n(e[r],r))[0]<a&&(a=t[0]),t[0]>o&&(o=t[0]),t[1]<i&&(i=t[1]),t[1]>s&&(s=t[1])})),e.objects)c(e.objects[t]);return[a,i,o,s]}function a(e,t){var r=t.id,n=t.bbox,a=null==t.properties?{}:t.properties,o=i(e,t);return null==r&&null==n?{type:"Feature",properties:a,geometry:o}:null==n?{type:"Feature",id:r,properties:a,geometry:o}:{type:"Feature",id:r,bbox:n,properties:a,geometry:o}}function i(e,t){var n=r(e.transform),a=e.arcs;function i(e,t){t.length&&t.pop();for(var r=a[e<0?~e:e],i=0,o=r.length;i<o;++i)t.push(n(r[i],i));e<0&&function(e,t){for(var r,n=e.length,a=n-t;a<--n;)r=e[a],e[a++]=e[n],e[n]=r}(t,o)}function o(e){return n(e)}function s(e){for(var t=[],r=0,n=e.length;r<n;++r)i(e[r],t);return t.length<2&&t.push(t[0]),t}function l(e){for(var t=s(e);t.length<4;)t.push(t[0]);return t}function c(e){return e.map(l)}return function e(t){var r,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(e)};case"Point":r=o(t.coordinates);break;case"MultiPoint":r=t.coordinates.map(o);break;case"LineString":r=s(t.arcs);break;case"MultiLineString":r=t.arcs.map(s);break;case"Polygon":r=c(t.arcs);break;case"MultiPolygon":r=t.arcs.map(c);break;default:return null}return{type:n,coordinates:r}}(t)}function o(e,t){var r={},n={},a={},i=[],o=-1;function s(e,t){for(var n in e){var a=e[n];delete t[a.start],delete a.start,delete a.end,a.forEach((function(e){r[e<0?~e:e]=1})),i.push(a)}}return t.forEach((function(r,n){var a,i=e.arcs[r<0?~r:r];i.length<3&&!i[1][0]&&!i[1][1]&&(a=t[++o],t[o]=r,t[n]=a)})),t.forEach((function(t){var r,i,o=function(t){var r,n=e.arcs[t<0?~t:t],a=n[0];return e.transform?(r=[0,0],n.forEach((function(e){r[0]+=e[0],r[1]+=e[1]}))):r=n[n.length-1],t<0?[r,a]:[a,r]}(t),s=o[0],l=o[1];if(r=a[s])if(delete a[r.end],r.push(t),r.end=l,i=n[l]){delete n[i.start];var c=i===r?r:r.concat(i);n[c.start=r.start]=a[c.end=i.end]=c}else n[r.start]=a[r.end]=r;else if(r=n[l])if(delete n[r.start],r.unshift(t),r.start=s,i=a[s]){delete a[i.end];var u=i===r?r:i.concat(r);n[u.start=i.start]=a[u.end=r.end]=u}else n[r.start]=a[r.end]=r;else n[(r=[t]).start=s]=a[r.end=l]=r})),s(a,n),s(n,a),t.forEach((function(e){r[e<0?~e:e]||i.push([e])})),i}function s(e,t,r){var n,a,i;if(arguments.length>1)n=l(e,t,r);else for(a=0,n=new Array(i=e.arcs.length);a<i;++a)n[a]=a;return{type:"MultiLineString",arcs:o(e,n)}}function l(e,t,r){var n,a=[],i=[];function o(e){var t=e<0?~e:e;(i[t]||(i[t]=[])).push({i:e,g:n})}function s(e){e.forEach(o)}function l(e){e.forEach(s)}return function e(t){switch(n=t,t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":l(t.arcs);break;case"MultiPolygon":!function(e){e.forEach(l)}(t.arcs)}}(t),i.forEach(null==r?function(e){a.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&a.push(e[0].i)}),a}function c(e,t){var r={},n=[],a=[];function s(e){e.forEach((function(t){t.forEach((function(t){(r[t=t<0?~t:t]||(r[t]=[])).push(e)}))})),n.push(e)}function l(t){return function(e){for(var t,r=-1,n=e.length,a=e[n-1],i=0;++r<n;)t=a,a=e[r],i+=t[0]*a[1]-t[1]*a[0];return Math.abs(i)}(i(e,{type:"Polygon",arcs:[t]}).coordinates[0])}return t.forEach((function e(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"Polygon":s(t.arcs);break;case"MultiPolygon":t.arcs.forEach(s)}})),n.forEach((function(e){if(!e._){var t=[],n=[e];for(e._=1,a.push(t);e=n.pop();)t.push(e),e.forEach((function(e){e.forEach((function(e){r[e<0?~e:e].forEach((function(e){e._||(e._=1,n.push(e))}))}))}))}})),n.forEach((function(e){delete e._})),{type:"MultiPolygon",arcs:a.map((function(t){var n,a=[];if(t.forEach((function(e){e.forEach((function(e){e.forEach((function(e){r[e<0?~e:e].length<2&&a.push(e)}))}))})),(n=(a=o(e,a)).length)>1)for(var i,s,c=1,u=l(a[0]);c<n;++c)(i=l(a[c]))>u&&(s=a[0],a[0]=a[c],a[c]=s,u=i);return a})).filter((function(e){return e.length>0}))}}function u(e,t){for(var r=0,n=e.length;r<n;){var a=r+n>>>1;e[a]<t?r=a+1:n=a}return r}function f(e){if(null==e)return t;var r,n,a=e.scale[0],i=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,t){t||(r=n=0);var l=2,c=e.length,u=new Array(c),f=Math.round((e[0]-o)/a),p=Math.round((e[1]-s)/i);for(u[0]=f-r,r=f,u[1]=p-n,n=p;l<c;)u[l]=e[l],++l;return u}}e.bbox=n,e.feature=function(e,t){return"string"==typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return a(e,t)}))}:a(e,t)},e.merge=function(e){return i(e,c.apply(this,arguments))},e.mergeArcs=c,e.mesh=function(e){return i(e,s.apply(this,arguments))},e.meshArcs=s,e.neighbors=function(e){var t={},r=e.map((function(){return[]}));function n(e,r){e.forEach((function(e){e<0&&(e=~e);var n=t[e];n?n.push(r):t[e]=[r]}))}function a(e,t){e.forEach((function(e){n(e,t)}))}var i={LineString:n,MultiLineString:a,Polygon:a,MultiPolygon:function(e,t){e.forEach((function(e){a(e,t)}))}};for(var o in e.forEach((function e(t,r){"GeometryCollection"===t.type?t.geometries.forEach((function(t){e(t,r)})):t.type in i&&i[t.type](t.arcs,r)})),t)for(var s=t[o],l=s.length,c=0;c<l;++c)for(var f=c+1;f<l;++f){var p,h=s[c],d=s[f];(p=r[h])[o=u(p,d)]!==d&&p.splice(o,0,d),(p=r[d])[o=u(p,h)]!==h&&p.splice(o,0,h)}return r},e.quantize=function(e,t){if(e.transform)throw new Error("already quantized");if(t&&t.scale)l=e.bbox;else{if(!((r=Math.floor(t))>=2))throw new Error("n must be ≥2");var r,a=(l=e.bbox||n(e))[0],i=l[1],o=l[2],s=l[3];t={scale:[o-a?(o-a)/(r-1):1,s-i?(s-i)/(r-1):1],translate:[a,i]}}var l,c,u=f(t),p=e.objects,h={};function d(e){return u(e)}function m(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(m)};break;case"Point":t={type:"Point",coordinates:d(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(d)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in p)h[c]=m(p[c]);return{type:"Topology",bbox:l,transform:t,objects:h,arcs:e.arcs.map((function(e){var t,r=0,n=1,a=e.length,i=new Array(a);for(i[0]=u(e[0],0);++r<a;)((t=u(e[r],r))[0]||t[1])&&(i[n++]=t);return 1===n&&(i[n++]=[0,0]),i.length=n,i}))}},e.transform=r,e.untransform=f,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:(e=e||self).topojson=e.topojson||{})}(this)},{}],316:[function(e,t,r){"use strict";var n=e("../prototype/is");t.exports=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!n(e)}},{"../prototype/is":323}],317:[function(e,t,r){"use strict";var n=e("../value/is"),a=e("../object/is"),i=e("../string/coerce"),o=e("./to-short-string"),s=function(e,t){return e.replace("%v",o(t))};t.exports=function(e,t,r){if(!a(r))throw new TypeError(s(t,e));if(!n(e)){if("default"in r)return r.default;if(r.isOptional)return null}var o=i(r.errorMessage);throw n(o)||(o=t),new TypeError(s(o,e))}},{"../object/is":320,"../string/coerce":324,"../value/is":326,"./to-short-string":319}],318:[function(e,t,r){"use strict";t.exports=function(e){try{return e.toString()}catch(t){try{return String(e)}catch(e){return null}}}},{}],319:[function(e,t,r){"use strict";var n=e("./safe-to-string"),a=/[\n\r\u2028\u2029]/g;t.exports=function(e){var t=n(e);return null===t?"<Non-coercible to string value>":(t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(a,(function(e){switch(e){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":318}],320:[function(e,t,r){"use strict";var n=e("../value/is"),a={object:!0,function:!0,undefined:!0};t.exports=function(e){return!!n(e)&&hasOwnProperty.call(a,typeof e)}},{"../value/is":326}],321:[function(e,t,r){"use strict";var n=e("../lib/resolve-exception"),a=e("./is");t.exports=function(e){return a(e)?e:n(e,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":317,"./is":322}],322:[function(e,t,r){"use strict";var n=e("../function/is"),a=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(e){return!!n(e)&&!a.test(i.call(e))}},{"../function/is":316}],323:[function(e,t,r){"use strict";var n=e("../object/is");t.exports=function(e){if(!n(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},{"../object/is":320}],324:[function(e,t,r){"use strict";var n=e("../value/is"),a=e("../object/is"),i=Object.prototype.toString;t.exports=function(e){if(!n(e))return null;if(a(e)){var t=e.toString;if("function"!=typeof t)return null;if(t===i)return null}try{return""+e}catch(e){return null}}},{"../object/is":320,"../value/is":326}],325:[function(e,t,r){"use strict";var n=e("../lib/resolve-exception"),a=e("./is");t.exports=function(e){return a(e)?e:n(e,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":317,"./is":326}],326:[function(e,t,r){"use strict";t.exports=function(e){return null!=e}},{}],327:[function(e,t,n){(function(t){(function(){"use strict";var r=e("bit-twiddle"),a=e("dup"),i=e("buffer").Buffer;t.__TYPEDARRAY_POOL||(t.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),BIGUINT64:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),BIGINT64:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=t.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=a([32,0])),c.BIGUINT64||(c.BIGUINT64=a([32,0])),c.BIGINT64||(c.BIGINT64=a([32,0])),c.BUFFER||(c.BUFFER=a([32,0]));var u=c.DATA,f=c.BUFFER;function p(e){if(e){var t=e.length||e.byteLength,n=r.log2(t);u[n].push(e)}}function h(e){e=r.nextPow2(e);var t=r.log2(e),n=u[t];return n.length>0?n.pop():new ArrayBuffer(e)}function d(e){return new Uint8Array(h(e),0,e)}function m(e){return new Uint16Array(h(2*e),0,e)}function g(e){return new Uint32Array(h(4*e),0,e)}function y(e){return new Int8Array(h(e),0,e)}function v(e){return new Int16Array(h(2*e),0,e)}function b(e){return new Int32Array(h(4*e),0,e)}function x(e){return new Float32Array(h(4*e),0,e)}function _(e){return new Float64Array(h(8*e),0,e)}function w(e){return o?new Uint8ClampedArray(h(e),0,e):d(e)}function k(e){return s?new BigUint64Array(h(8*e),0,e):null}function D(e){return l?new BigInt64Array(h(8*e),0,e):null}function T(e){return new DataView(h(e),0,e)}function A(e){e=r.nextPow2(e);var t=r.log2(e),n=f[t];return n.length>0?n.pop():new i(e)}n.free=function(e){if(i.isBuffer(e))f[r.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,n=0|r.log2(t);u[n].push(e)}},n.freeUint8=n.freeUint16=n.freeUint32=n.freeBigUint64=n.freeInt8=n.freeInt16=n.freeInt32=n.freeBigInt64=n.freeFloat32=n.freeFloat=n.freeFloat64=n.freeDouble=n.freeUint8Clamped=n.freeDataView=function(e){p(e.buffer)},n.freeArrayBuffer=p,n.freeBuffer=function(e){f[r.log2(e.length)].push(e)},n.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return h(e);switch(t){case"uint8":return d(e);case"uint16":return m(e);case"uint32":return g(e);case"int8":return y(e);case"int16":return v(e);case"int32":return b(e);case"float":case"float32":return x(e);case"double":case"float64":return _(e);case"uint8_clamped":return w(e);case"bigint64":return D(e);case"biguint64":return k(e);case"buffer":return A(e);case"data":case"dataview":return T(e);default:return null}return null},n.mallocArrayBuffer=h,n.mallocUint8=d,n.mallocUint16=m,n.mallocUint32=g,n.mallocInt8=y,n.mallocInt16=v,n.mallocInt32=b,n.mallocFloat32=n.mallocFloat=x,n.mallocFloat64=n.mallocDouble=_,n.mallocUint8Clamped=w,n.mallocBigUint64=k,n.mallocBigInt64=D,n.mallocDataView=T,n.mallocBuffer=A,n.clearCache=function(){for(var e=0;e<32;++e)c.UINT8[e].length=0,c.UINT16[e].length=0,c.UINT32[e].length=0,c.INT8[e].length=0,c.INT16[e].length=0,c.INT32[e].length=0,c.FLOAT[e].length=0,c.DOUBLE[e].length=0,c.BIGUINT64[e].length=0,c.BIGINT64[e].length=0,c.UINT8C[e].length=0,u[e].length=0,f[e].length=0}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":81,buffer:85,dup:128}],328:[function(e,t,r){var n=/[\'\"]/;t.exports=function(e){return e?(n.test(e.charAt(0))&&(e=e.substr(1)),n.test(e.charAt(e.length-1))&&(e=e.substr(0,e.length-1)),e):""}},{}],329:[function(e,t,r){"use strict";t.exports=function(e,t,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,a=r.length;n<a;n++){var i=r[n];for(var o in i)if((void 0===t[o]||Array.isArray(t[o])||e[o]!==t[o])&&o in t){var s;if(!0===i[o])s=t[o];else{if(!1===i[o])continue;if("function"==typeof i[o]&&void 0===(s=i[o](t[o],e,t)))continue}e[o]=s}}return e}},{}],330:[function(e,t,n){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],331:[function(e,t,r){var n=e("get-canvas-context");t.exports=function(e){return n("webgl",e)}},{"get-canvas-context":194}],332:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(l);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"闰"===t[0]&&(r=!0,t=t.substring(1)),"月"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t<r?t+1:t:t+1},intercalaryMonth:function(e){return e=this._validateYear(e),f[e-f[0]]>>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),s=p[o-p[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(a=i.newDate(l,c,u)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,s,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),s=this.toChineseMonth(e,t),l=function(e,t,r,n,a){var i,o,s;if("object"==typeof e)o=e,i=t||{};else{var l;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i={}),o={year:e,month:t,day:r,isIntercalary:l}}s=o.day-1;var c,u=f[o.year-f[0]],h=u>>13;c=h&&(o.month>h||o.isIntercalary)?o.month:o.month-1;for(var d=0;d<c;d++)s+=u&1<<12-d?30:29;var m=p[o.year-p[0]],g=new Date(m>>9&4095,(m>>5&15)-1,(31&m)+s);return i.year=g.getFullYear(),i.month=1+g.getMonth(),i.day=g.getDate(),i}(e,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i={}}var o=p[a.year-p[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=p[i.year-p[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);l=Math.round((u-c)/864e5);var h,d=f[i.year-f[0]];for(h=0;h<13;h++){var m=d&1<<12-h?30:29;if(l<m)break;l-=m}var g=d>>13;return!g||h<g?(i.isIntercalary=!1,i.month=1+h):h===g?(i.isIntercalary=!0,i.month=h):(i.isIntercalary=!1,i.month=h),i.day=1+l,i}(t.year(),t.month(),t.day()),n=this.toMonthIndex(r.year,r.month,r.isIntercalary);return this.newDate(r.year,n,r.day)},fromString:function(e){var t=e.match(s),r=this._validateYear(+t[1]),n=+t[2],a=!!t[3],i=this.toMonthIndex(r,n,a),o=+t[4];return this.newDate(r,i,o)},add:function(e,t,r){var n=e.year(),a=e.month(),i=this.isIntercalaryMonth(n,a),s=this.toChineseMonth(n,a),l=Object.getPrototypeOf(o.prototype).add.call(this,e,t,r);if("y"===r){var c=l.year(),u=l.month(),f=this.isIntercalaryMonth(c,s),p=i&&f?this.toMonthIndex(c,s,!0):this.toMonthIndex(c,s,!1);p!==u&&l.month(p)}return l}});var s=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,l=/^\d?\d[iI]?/m,c=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?\u6708/m,u=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?/m;n.calendars.chinese=o;var f=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],p=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904]},{"../main":346,"object-assign":247}],333:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Coptic",jdEpoch:1825029.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.coptic=i},{"../main":346,"object-assign":247}],334:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),13},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),400},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(e,t,r){return(this._validate(e,t,r,n.local.invalidDate).day()+1)%8},weekDay:function(e,t,r){var n=this.dayOfWeek(e,t,r);return n>=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":346,"object-assign":247}],335:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":346,"object-assign":247}],336:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var s=7;s<=this.monthsInYear(e);s++)o+=this.daysInMonth(e,s);for(s=1;s<t;s++)o+=this.daysInMonth(e,s)}else for(s=7;s<t;s++)o+=this.daysInMonth(e,s);return o},_delay1:function(e){var t=Math.floor((235*e-234)/19),r=12084+13753*t,n=29*t+Math.floor(r/25920);return o(3*(n+1),7)<3&&n++,n},_delay2:function(e){var t=this._delay1(e-1),r=this._delay1(e);return this._delay1(e+1)-r==356?2:r-t==382?1:0},fromJD:function(e){e=Math.floor(e)+.5;for(var t=Math.floor(98496*(e-this.jdEpoch)/35975351)-1;e>=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=e<this.toJD(t,1,1)?7:1;e>this.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":346,"object-assign":247}],337:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":346,"object-assign":247}],338:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":346,"object-assign":247}],339:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function s(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r<e.length;r++){var n=parseInt(e[r],10);if(Math.abs(n)>19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o(8+(e-=this.jdEpoch)+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[s(20+(e-=this.jdEpoch),20),s(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":346,"object-assign":247}],340:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),s=1;s<a.month();s++)i+=this.daysPerMonth[s-1];return i+o.toJD(e+1468,3,13)},fromJD:function(e){e=Math.floor(e+.5);for(var t=Math.floor((e-(this.jdEpoch-1))/366);e>=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":346,"object-assign":247}],341:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,s=t,l=e;this._createMissingCalendarData(e);var c=e-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==t&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r<e+2;r++)void 0===this.NEPALI_CALENDAR_DATA[r]&&(this.NEPALI_CALENDAR_DATA[r]=t)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),n.calendars.nepali=i},{"../main":346,"object-assign":247}],342:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Chæharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 682*((t.year()-(t.year()>0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),s=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=e-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=e-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":346,"object-assign":247}],343:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(t.year()),i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(a.year()),i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=this._t2gYear(a.year()),i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":346,"object-assign":247}],344:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(t.year()),i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(a.year()),i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=this._t2gYear(a.year()),i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":346,"object-assign":247}],345:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;i<o.length;i++){if(o[i]>r)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;n<o.length&&!(o[n]>t);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,c=t-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":346,"object-assign":247}],346:[function(e,t,r){var n=e("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function s(){this.shortYearCutoff="+10"}function l(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day(),"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(function(e){for(;o<e.minMonth;)i--,o+=e.monthsInYear(i);for(var t=e.monthsInYear(i);o>t-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth<this.monthsInYear(a)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(a)}return this._validateLevel--,n},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return c.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(e){return this.fromJD(c.instance().fromJSDate(e).toJD())},_validate:function(e,t,r,n){if(e.year){if(0===this._validateLevel&&this.name!==e.calendar().name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,e.calendar().local.name);return e}try{if(this._validateLevel++,1===this._validateLevel&&!this.isValid(e,t,r))throw n.replace(/\{0\}/,this.local.name);var a=this.newDate(e,t,r);return this._validateLevel--,a}catch(e){throw this._validateLevel--,e}}}),l.prototype=new s,n(l.prototype,{name:"Gregorian",jdEpoch:1721425.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Gregorian",epochs:["BCE","CE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==0&&(e%100!=0||e%400==0)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);e=n.year(),t=n.month(),r=n.day(),e<0&&e++,t<3&&(t+=12,e--);var a=Math.floor(e/100),i=2-a+Math.floor(a/4);return Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r+i-1524.5},fromJD:function(e){var t=Math.floor(e+.5),r=Math.floor((t-1867216.25)/36524.25),n=1524+(r=t+1+r-Math.floor(r/4)),a=Math.floor((n-122.1)/365.25),i=Math.floor(365.25*a),o=Math.floor((n-i)/30.6001),s=n-i-Math.floor(30.6001*o),l=o-(o>13.5?13:1),c=a-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":247}],347:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,l=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,u=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;_+n<e.length&&e.charAt(_+n)===t;)n++;return _+=n-1,Math.floor(n/(r||1))>1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length<r;)a="0"+a;return a},d=this,m=function(e){return"function"==typeof c?c.call(d,e,p("m")):v(h("m",e.month(),2))},g=function(e,t){return t?"function"==typeof f?f.call(d,e):f[e.month()-d.minMonth]:"function"==typeof u?u.call(d,e):u[e.month()-d.minMonth]},y=this.local.digits,v=function(e){return r.localNumbers&&y?y(e):e},b="",x=!1,_=0;_<e.length;_++)if(x)"'"!==e.charAt(_)||p("'")?b+=e.charAt(_):x=!1;else switch(e.charAt(_)){case"d":b+=v(h("d",t.day(),2));break;case"D":b+=("D",n=t.dayOfWeek(),i=s,o=l,p("D")?o[n]:i[n]);break;case"o":b+=h("o",t.dayOfYear(),3);break;case"w":b+=h("w",t.weekOfYear(),2);break;case"m":b+=m(t);break;case"M":b+=g(t,p("M"));break;case"y":b+=p("y",2)?t.year():(t.year()%100<10?"0":"")+t.year()%100;break;case"Y":p("Y",2),b+=t.formatYear();break;case"J":b+=t.toJD();break;case"@":b+=(t.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":b+=(t.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":p("'")?b+="'":x=!0;break;default:b+=e.charAt(_)}return b},parseDate:function(e,t,r){if(null==t)throw a.local.invalidArguments||a.regionalOptions[""].invalidArguments;if(""===(t="object"==typeof t?t.toString():t+""))return null;e=e||this.local.dateFormat;var n=(r=r||{}).shortYearCutoff||this.shortYearCutoff;n="string"!=typeof n?n:this.today().year()%100+parseInt(n,10);for(var i=r.dayNamesShort||this.local.dayNamesShort,o=r.dayNames||this.local.dayNames,s=r.parseMonth||this.local.parseMonth,l=r.monthNumbers||this.local.monthNumbers,c=r.monthNamesShort||this.local.monthNamesShort,u=r.monthNames||this.local.monthNames,f=-1,p=-1,h=-1,d=-1,m=-1,g=!1,y=!1,v=function(t,r){for(var n=1;A+n<e.length&&e.charAt(A+n)===t;)n++;return A+=n-1,Math.floor(n/(r||1))>1},b=function(e,r){var n=v(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=t.substring(T).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){v("m");var e=l.call(x,t.substring(T));return T+=e.length,e}return b("m")},w=function(e,r,n,i){for(var o=v(e,i)?n:r,s=0;s<o.length;s++)if(t.substr(T,o[s].length).toLowerCase()===o[s].toLowerCase())return T+=o[s].length,s+x.minMonth;throw(a.local.unknownNameAt||a.regionalOptions[""].unknownNameAt).replace(/\{0\}/,T)},k=function(){if("function"==typeof u){var e=v("M")?u.call(x,t.substring(T)):c.call(x,t.substring(T));return T+=e.length,e}return w("M",c,u)},D=function(){if(t.charAt(T)!==e.charAt(A))throw(a.local.unexpectedLiteralAt||a.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,T);T++},T=0,A=0;A<e.length;A++)if(y)"'"!==e.charAt(A)||v("'")?D():y=!1;else switch(e.charAt(A)){case"d":d=b("d");break;case"D":w("D",i,o);break;case"o":m=b("o");break;case"w":b("w");break;case"m":h=_();break;case"M":h=k();break;case"y":var S=A;g=!v("y",2),A=S,p=b("y",2);break;case"Y":p=b("Y",2);break;case"J":f=b("J")+.5,"."===t.charAt(T)&&(T++,b("J"));break;case"@":f=b("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":f=b("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":T=t.length;break;case"'":v("'")?D():y=!0;break;default:D()}if(T<t.length)throw a.local.unexpectedText||a.regionalOptions[""].unexpectedText;if(-1===p?p=this.today().year():p<100&&g&&(p+=-1===n?1900:this.today().year()-this.today().year()%100-(p<=n?0:100)),"string"==typeof h&&(h=s.call(this,p,h)),m>-1){h=1,d=m;for(var M=this.daysInMonth(p,h);d>M;M=this.daysInMonth(p,h))h++,d-=M}return f>-1?this.fromJD(f):this.newDate(p,h,d)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(e);s;)t.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":346,"object-assign":247}],348:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],349:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects"),t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":472,"../../plot_api/plot_template":543,"../../plots/cartesian/constants":561,"../../plots/font_attributes":585,"./arrow_paths":348}],350:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&s(t,r),"range"===o&&s(t,n)}))}function s(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],s=e["a"+i],l=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],p={x:1,y:-1}[i]*e[i+"shift"],h=3*e.arrowsize*e.arrowwidth||0,d=h+p,m=h-p,g=3*e.startarrowsize*e.arrowwidth||0,y=g+p,v=g-p;if(c===l){var b=a.findExtremes(t,[t.r2c(o)],{ppadplus:d,ppadminus:m}),x=a.findExtremes(t,[t.r2c(s)],{ppadplus:Math.max(u,y),ppadminus:Math.max(f,v)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else y=s?y+s:y,v=s?v-s:v,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,d,y),ppadminus:Math.max(f,m,v)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":503,"../../plots/cartesian/axes":554,"./draw":355}],351:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,l,c,u=e._fullLayout.annotations,f=[],p=[],h=[],d=(t||[]).length;for(r=0;r<u.length;r++)if(i=(a=u[r]).clicktoshow){for(n=0;n<d;n++)if(l=(o=t[n]).xaxis,c=o.yaxis,l._id===a.xref&&c._id===a.yref&&l.d2r(o.x)===s(a._xclick,l)&&c.d2r(o.y)===s(a._yclick,c)){(a.visible?"onout"===i?p:h:f).push(r);break}n===d&&a.visible&&"onout"===i&&p.push(r)}return{on:f,off:p,explicitOff:h}}function s(e,t){return"log"===t.type?t.l2r(e):t.d2r(e)}t.exports={hasClickToShow:function(e,t){var r=o(e,t);return r.on.length>0||r.explicitOff.length>0},onClick:function(e,t){var r,s,l=o(e,t),c=l.on,u=l.off.concat(l.explicitOff),f={},p=e._fullLayout.annotations;if(c.length||u.length){for(r=0;r<c.length;r++)(s=i(e.layout,"annotations",p[c[r]])).modifyItem("visible",!0),n.extendFlat(f,s.getUpdateObj());for(r=0;r<u.length;r++)(s=i(e.layout,"annotations",p[u[r]])).modifyItem("visible",!1),n.extendFlat(f,s.getUpdateObj());return a.call("update",e,{},f)}}}},{"../../lib":503,"../../plot_api/plot_template":543,"../../registry":638}],352:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color");t.exports=function(e,t,r,i){i("opacity");var o=i("bgcolor"),s=i("bordercolor"),l=a.opacity(s);i("borderpad");var c=i("borderwidth"),u=i("showarrow");if(i("text",u?" ":r._dfltTitle.annotation),i("textangle"),n.coerceFont(i,"font",r.font),i("width"),i("align"),i("height")&&i("valign"),u){var f,p,h=i("arrowside");-1!==h.indexOf("end")&&(f=i("arrowhead"),p=i("arrowsize")),-1!==h.indexOf("start")&&(i("startarrowhead",f),i("startarrowsize",p)),i("arrowcolor",l?t.bordercolor:a.defaultLine),i("arrowwidth",2*(l&&c||1)),i("standoff"),i("startstandoff")}var d=i("hovertext"),m=r.hoverlabel||{};if(d){var g=i("hoverlabel.bgcolor",m.bgcolor||(a.opacity(o)?a.rgb(o):a.defaultLine)),y=i("hoverlabel.bordercolor",m.bordercolor||a.contrast(g));n.coerceFont(i,"hoverlabel.font",{family:m.font.family,size:m.font.size,color:m.font.color||y})}i("captureevents",!!d)}},{"../../lib":503,"../color":366}],353:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib/to_log_range");t.exports=function(e,t,r,i){t=t||{};var o="log"===r&&"linear"===t.type,s="linear"===r&&"log"===t.type;if(o||s)for(var l,c,u=e._fullLayout.annotations,f=t._id.charAt(0),p=0;p<u.length;p++)l=u[p],c="annotations["+p+"].",l[f+"ref"]===t._id&&h(f),l["a"+f+"ref"]===t._id&&h("a"+f);function h(e){var r=l[e],s=null;s=o?a(r,t.range):Math.pow(10,r),n(s)||(s=null),i(c+e,s)}}},{"../../lib/to_log_range":531,"fast-isnumeric":190}],354:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("./common_defaults"),s=e("./attributes");function l(e,t,r){function i(r,a){return n.coerce(e,t,s,r,a)}var l=i("visible"),c=i("clicktoshow");if(l||c){o(e,t,r,i);for(var u=t.showarrow,f=["x","y"],p=[-10,-30],h={_fullLayout:r},d=0;d<2;d++){var m=f[d],g=a.coerceRef(e,t,h,m,"","paper");if("paper"!==g&&a.getFromId(h,g)._annIndices.push(t._index),a.coercePosition(t,h,i,g,m,.5),u){var y="a"+m,v=a.coerceRef(e,t,h,y,"pixel",["pixel","paper"]);"pixel"!==v&&v!==g&&(v=t[y]="pixel");var b="pixel"===v?p[d]:.4;a.coercePosition(t,h,i,v,y,b)}i(m+"anchor"),i(m+"shift")}if(n.noneOrAll(e,t,["x","y"]),u&&n.noneOrAll(e,t,["ax","ay"]),c){var x=i("xclick"),_=i("yclick");t._xclick=void 0===x?t.x:a.cleanPosition(x,h,t.xref),t._yclick=void 0===_?t.y:a.cleanPosition(_,h,t.yref)}}}t.exports=function(e,t){i(e,t,{name:"annotations",handleItemDefaults:l})}},{"../../lib":503,"../../plots/array_container_defaults":549,"../../plots/cartesian/axes":554,"./attributes":349,"./common_defaults":352}],355:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../plots/plots"),o=e("../../lib"),s=o.strTranslate,l=e("../../plots/cartesian/axes"),c=e("../color"),u=e("../drawing"),f=e("../fx"),p=e("../../lib/svg_text_utils"),h=e("../../lib/setcursor"),d=e("../dragelement"),m=e("../../plot_api/plot_template").arrayEditor,g=e("./draw_arrow_head");function y(e,t){var r=e._fullLayout.annotations[t]||{},n=l.getFromId(e,r.xref),a=l.getFromId(e,r.yref);n&&n.setScale(),a&&a.setScale(),b(e,r,t,!1,n,a)}function v(e,t,r,n,a){var i=a[r],o=a[r+"ref"],s=-1!==r.indexOf("y"),c="domain"===l.getRefType(o),u=s?n.h:n.w;return e?c?i+(s?-t:t)/e._length:e.p2r(e.r2p(i)+t):i+(s?-t:t)/u}function b(e,t,r,i,y,b){var x,_,w=e._fullLayout,k=e._fullLayout._size,D=e._context.edits;i?(x="annotation-"+i,_=i+".annotations"):(x="annotation",_="annotations");var T=m(e.layout,_,t),A=T.modifyBase,S=T.modifyItem,M=T.getUpdateObj;w._infolayer.selectAll("."+x+'[data-index="'+r+'"]').remove();var E="clip"+w._uid+"_ann"+r;if(t._input&&!1!==t.visible){var C={x:{},y:{}},N=+t.textangle||0,O=w._infolayer.append("g").classed(x,!0).attr("data-index",String(r)).style("opacity",t.opacity),I=O.append("g").classed("annotation-text-g",!0),P=D[t.showarrow?"annotationTail":"annotationPosition"],R=t.captureevents||D.annotationText||P,L=I.append("g").style("pointer-events",R?"all":null).call(h,"pointer").on("click",(function(){e._dragging=!1,e.emit("plotly_clickannotation",H(n.event))}));t.hovertext&&L.on("mouseover",(function(){var r=t.hoverlabel,n=r.font,a=this.getBoundingClientRect(),i=e.getBoundingClientRect();f.loneHover({x0:a.left-i.left,x1:a.right-i.left,y:(a.top+a.bottom)/2-i.top,text:t.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:e})})).on("mouseout",(function(){f.loneUnhover(w._hoverlayer.node())}));var F=t.borderwidth,B=t.borderpad,z=F+B,j=L.append("rect").attr("class","bg").style("stroke-width",F+"px").call(c.stroke,t.bordercolor).call(c.fill,t.bgcolor),U=t.width||t.height,$=w._topclips.selectAll("#"+E).data(U?[0]:[]);$.enter().append("clipPath").classed("annclip",!0).attr("id",E).append("rect"),$.exit().remove();var V=t.font,q=w._meta?o.templateString(t.text,w._meta):t.text,W=L.append("text").classed("annotation-text",!0).text(q);D.annotationText?W.call(p.makeEditable,{delegate:L,gd:e}).call(G).on("edit",(function(r){t.text=r,this.call(G),S("text",r),y&&y.autorange&&A(y._name+".autorange",!0),b&&b.autorange&&A(b._name+".autorange",!0),a.call("_guiRelayout",e,M())})):W.call(G)}else n.selectAll("#"+E).remove();function H(e){var n={index:r,annotation:t._input,fullAnnotation:t,event:e};return i&&(n.subplotId=i),n}function G(r){return r.call(u.font,V).attr({"text-anchor":{left:"start",right:"end"}[t.align]||"middle"}),p.convertToTspans(r,e,X),r}function X(){var r=W.selectAll("a");1===r.size()&&r.text()===W.text()&&L.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(j.node());var n=L.select(".annotation-text-math-group"),f=!n.empty(),m=u.bBox((f?n:W).node()),x=m.width,_=m.height,T=t.width||x,R=t.height||_,B=Math.round(T+2*z),V=Math.round(R+2*z);function q(e,t){return"auto"===t&&(t=e<1/3?"left":e>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var G=!1,X=["x","y"],Y=0;Y<X.length;Y++){var Z,K,J,Q,ee,te=X[Y],re=t[te+"ref"]||te,ne=t["a"+te+"ref"],ae={x:y,y:b}[te],ie=(N+("x"===te?0:-90))*Math.PI/180,oe=B*Math.cos(ie),se=V*Math.sin(ie),le=Math.abs(oe)+Math.abs(se),ce=t[te+"anchor"],ue=t[te+"shift"]*("x"===te?1:-1),fe=C[te],pe=l.getRefType(re);if(ae&&"domain"!==pe){var he=ae.r2fraction(t[te]);(he<0||he>1)&&(ne===re?((he=ae.r2fraction(t["a"+te]))<0||he>1)&&(G=!0):G=!0),Z=ae._offset+ae.r2p(t[te]),Q=.5}else{var de="domain"===pe;"x"===te?(J=t[te],Z=de?ae._offset+ae._length*J:Z=k.l+k.w*J):(J=1-t[te],Z=de?ae._offset+ae._length*J:Z=k.t+k.h*J),Q=t.showarrow?.5:J}if(t.showarrow){fe.head=Z;var me=t["a"+te];if(ee=oe*q(.5,t.xanchor)-se*q(.5,t.yanchor),ne===re){var ge=l.getRefType(ne);"domain"===ge?("y"===te&&(me=1-me),fe.tail=ae._offset+ae._length*me):"paper"===ge?"y"===te?(me=1-me,fe.tail=k.t+k.h*me):fe.tail=k.l+k.w*me:fe.tail=ae._offset+ae.r2p(me),K=ee}else fe.tail=Z+me,K=ee+me;fe.text=fe.tail+ee;var ye=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,ye-1)),"pixel"===ne){var ve=-Math.max(fe.tail-3,fe.text),be=Math.min(fe.tail+3,fe.text)-ye;ve>0?(fe.tail+=ve,fe.text+=ve):be>0&&(fe.tail-=be,fe.text-=be)}fe.tail+=ue,fe.head+=ue}else K=ee=le*q(Q,ce),fe.text=Z+ee;fe.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=le/2+K,t["_"+te+"padminus"]=le/2-K,t["_"+te+"size"]=le,t["_"+te+"shift"]=ee}if(G)L.remove();else{var xe=0,_e=0;if("left"!==t.align&&(xe=(T-x)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(R-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:z+xe-1,y:z+_e}).call(u.setClipUrl,U?E:null,e);else{var we=z+_e-m.top,ke=z+xe-m.left;W.call(p.positionText,ke,we).call(u.setClipUrl,U?E:null,e)}$.select("rect").call(u.setRect,z,z,T,R),j.call(u.setRect,F/2,F/2,B-F,V-F),L.call(u.setTranslate,Math.round(C.x.text-B/2),Math.round(C.y.text-V/2)),I.attr({transform:"rotate("+N+","+C.x.text+","+C.y.text+")"});var De,Te=function(r,n){O.selectAll(".annotation-arrow-g").remove();var l=C.x.head,f=C.y.head,p=C.x.tail+r,h=C.y.tail+n,m=C.x.text+r,x=C.y.text+n,_=o.rotationXYMatrix(N,m,x),w=o.apply2DTransform(_),T=o.apply2DTransform2(_),E=+j.attr("width"),P=+j.attr("height"),R=m-.5*E,F=R+E,B=x-.5*P,z=B+P,U=[[R,B,R,z],[R,z,F,z],[F,z,F,B],[F,B,R,B]].map(T);if(!U.reduce((function(e,t){return e^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){U.forEach((function(e){var t=o.segmentsIntersect(p,h,l,f,e[0],e[1],e[2],e[3]);t&&(p=t.x,h=t.y)}));var $=t.arrowwidth,V=t.arrowcolor,q=t.arrowside,W=O.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),H=W.append("path").attr("d","M"+p+","+h+"L"+l+","+f).style("stroke-width",$+"px").call(c.stroke,c.rgb(V));if(g(H,q,t),D.annotationPosition&&H.node().parentNode&&!i){var G=l,X=f;if(t.standoff){var Y=Math.sqrt(Math.pow(l-p,2)+Math.pow(f-h,2));G+=t.standoff*(p-l)/Y,X+=t.standoff*(h-f)/Y}var Z,K,J=W.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(p-G)+","+(h-X),transform:s(G,X)}).style("stroke-width",$+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");d.init({element:J.node(),gd:e,prepFn:function(){var e=u.getTranslate(L);Z=e.x,K=e.y,y&&y.autorange&&A(y._name+".autorange",!0),b&&b.autorange&&A(b._name+".autorange",!0)},moveFn:function(e,r){var n=w(Z,K),a=n[0]+e,i=n[1]+r;L.call(u.setTranslate,a,i),S("x",v(y,e,"x",k,t)),S("y",v(b,r,"y",k,t)),t.axref===t.xref&&S("ax",v(y,e,"ax",k,t)),t.ayref===t.yref&&S("ay",v(b,r,"ay",k,t)),W.attr("transform",s(e,r)),I.attr({transform:"rotate("+N+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};t.showarrow&&Te(0,0),P&&d.init({element:L.node(),gd:e,prepFn:function(){De=I.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?S("ax",v(y,e,"ax",k,t)):S("ax",t.ax+e),t.ayref===t.yref?S("ay",v(b,r,"ay",k.w,t)):S("ay",t.ay+r),Te(e,r);else{if(i)return;var a,o;if(y)a=v(y,e,"x",k,t);else{var l=t._xsize/k.w,c=t.x+(t._xshift-t.xshift)/k.w-l/2;a=d.align(c+e/k.w,l,0,1,t.xanchor)}if(b)o=v(b,r,"y",k,t);else{var u=t._ysize/k.h,f=t.y-(t._yshift+t.yshift)/k.h-u/2;o=d.align(f-r/k.h,u,0,1,t.yanchor)}S("x",a),S("y",o),y&&b||(n=d.getCursor(y?.5:a,b?.5:o,t.xanchor,t.yanchor))}I.attr({transform:s(e,r)+De}),h(L,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",H(n))},doneFn:function(){h(L),a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r<t.annotations.length;r++)t.annotations[r].visible&&y(e,r);return i.previousPromises(e)},drawOne:y,drawRaw:b}},{"../../lib":503,"../../lib/setcursor":524,"../../lib/svg_text_utils":529,"../../plot_api/plot_template":543,"../../plots/cartesian/axes":554,"../../plots/plots":619,"../../registry":638,"../color":366,"../dragelement":385,"../drawing":388,"../fx":406,"./draw_arrow_head":356,"@plotly/d3":58}],356:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color"),i=e("./arrow_paths"),o=e("../../lib"),s=o.strScale,l=o.strRotate,c=o.strTranslate;t.exports=function(e,t,r){var o,u,f,p,h=e.node(),d=i[r.arrowhead||0],m=i[r.startarrowhead||0],g=(r.arrowwidth||1)*(r.arrowsize||1),y=(r.arrowwidth||1)*(r.startarrowsize||1),v=t.indexOf("start")>=0,b=t.indexOf("end")>=0,x=d.backoff*g+r.standoff,_=m.backoff*y+r.startstandoff;if("line"===h.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,k=o.y-u.y;if(p=(f=Math.atan2(k,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+k*k))return void P();if(x){if(x*x>w*w+k*k)return void P();var D=x*Math.cos(f),T=x*Math.sin(f);u.x+=D,u.y+=T,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+k*k)return void P();var A=_*Math.cos(f),S=_*Math.sin(f);o.x-=A,o.y-=S,e.attr({x1:o.x,y1:o.y})}}else if("path"===h.nodeName){var M=h.getTotalLength(),E="";if(M<x+_)return void P();var C=h.getPointAtLength(0),N=h.getPointAtLength(.1);f=Math.atan2(C.y-N.y,C.x-N.x),o=h.getPointAtLength(Math.min(_,M)),E="0px,"+_+"px,";var O=h.getPointAtLength(M),I=h.getPointAtLength(M-.1);p=Math.atan2(O.y-I.y,O.x-I.x),u=h.getPointAtLength(Math.max(0,M-x)),E+=M-(E?_+x:x)+"px,"+M+"px",e.style("stroke-dasharray",E)}function P(){e.style("stroke-dasharray","0px,100px")}function R(t,i,o,u){t.path&&(t.noRotate&&(o=0),n.select(h.parentNode).append("path").attr({class:e.attr("class"),d:t.path,transform:c(i.x,i.y)+l(180*o/Math.PI)+s(u)}).style({fill:a.rgb(r.arrowcolor),"stroke-width":0}))}v&&R(m,o,f,y),b&&R(d,u,p,g)}},{"../../lib":503,"../color":366,"./arrow_paths":348,"@plotly/d3":58}],357:[function(e,t,r){"use strict";var n=e("./draw"),a=e("./click");t.exports={moduleType:"component",name:"annotations",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("annotations"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:e("./convert_coords")}},{"../../plots/cartesian/include_components":567,"./attributes":349,"./calc_autorange":350,"./click":351,"./convert_coords":353,"./defaults":354,"./draw":355}],358:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../plot_api/edit_types").overrideAll,i=e("../../plot_api/plot_template").templatedArray;t.exports=a(i("annotation",{visible:n.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents}),"calc","from-root")},{"../../plot_api/edit_types":536,"../../plot_api/plot_template":543,"../annotations/attributes":349}],359:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes");function i(e,t){var r=t.fullSceneLayout.domain,i=t.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};e._xa={},n.extendFlat(e._xa,o),a.setConvert(e._xa),e._xa._offset=i.l+r.x[0]*i.w,e._xa.l2p=function(){return.5*(1+e._pdata[0]/e._pdata[3])*i.w*(r.x[1]-r.x[0])},e._ya={},n.extendFlat(e._ya,o),a.setConvert(e._ya),e._ya._offset=i.t+(1-r.y[1])*i.h,e._ya.l2p=function(){return.5*(1-e._pdata[1]/e._pdata[3])*i.h*(r.y[1]-r.y[0])}}t.exports=function(e){for(var t=e.fullSceneLayout.annotations,r=0;r<t.length;r++)i(t[r],e);e.fullLayout._infolayer.selectAll(".annotation-"+e.id).remove()}},{"../../lib":503,"../../plots/cartesian/axes":554}],360:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("../annotations/common_defaults"),s=e("./attributes");function l(e,t,r,i){function l(r,a){return n.coerce(e,t,s,r,a)}function c(e){var n=e+"axis",i={_fullLayout:{}};return i._fullLayout[n]=r[n],a.coercePosition(t,i,l,e,e,.5)}l("visible")&&(o(e,t,i.fullLayout,l),c("x"),c("y"),c("z"),n.noneOrAll(e,t,["x","y","z"]),t.xref="x",t.yref="y",t.zref="z",l("xanchor"),l("yanchor"),l("xshift"),l("yshift"),t.showarrow&&(t.axref="pixel",t.ayref="pixel",l("ax",-10),l("ay",-30),n.noneOrAll(e,t,["ax","ay"])))}t.exports=function(e,t,r){i(e,t,{name:"annotations",handleItemDefaults:l,fullLayout:r.fullLayout})}},{"../../lib":503,"../../plots/array_container_defaults":549,"../../plots/cartesian/axes":554,"../annotations/common_defaults":352,"./attributes":358}],361:[function(e,t,r){"use strict";var n=e("../annotations/draw").drawRaw,a=e("../../plots/gl3d/project"),i=["x","y","z"];t.exports=function(e){for(var t=e.fullSceneLayout,r=e.dataScale,o=t.annotations,s=0;s<o.length;s++){for(var l=o[s],c=!1,u=0;u<3;u++){var f=i[u],p=l[f],h=t[f+"axis"].r2fraction(p);if(h<0||h>1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+s+'"]').remove():(l._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(l.x)*r[0],t.yaxis.r2l(l.y)*r[1],t.zaxis.r2l(l.z)*r[2]]),n(e.graphDiv,l,s,e.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":607,"../annotations/draw":355}],362:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(r)for(var i=r.attrRegex,o=Object.keys(e),s=0;s<o.length;s++){var l=o[s];i.test(l)&&(e[l].annotations||[]).length&&(a.pushUnique(t._basePlotModules,r),a.pushUnique(t._subplots.gl3d,l))}},convert:e("./convert"),draw:e("./draw")}},{"../../lib":503,"../../registry":638,"./attributes":358,"./convert":359,"./defaults":360,"./draw":361}],363:[function(e,t,r){"use strict";t.exports=e("world-calendars/dist/main"),e("world-calendars/dist/plus"),e("world-calendars/dist/calendars/chinese"),e("world-calendars/dist/calendars/coptic"),e("world-calendars/dist/calendars/discworld"),e("world-calendars/dist/calendars/ethiopian"),e("world-calendars/dist/calendars/hebrew"),e("world-calendars/dist/calendars/islamic"),e("world-calendars/dist/calendars/julian"),e("world-calendars/dist/calendars/mayan"),e("world-calendars/dist/calendars/nanakshahi"),e("world-calendars/dist/calendars/nepali"),e("world-calendars/dist/calendars/persian"),e("world-calendars/dist/calendars/taiwan"),e("world-calendars/dist/calendars/thai"),e("world-calendars/dist/calendars/ummalqura")},{"world-calendars/dist/calendars/chinese":332,"world-calendars/dist/calendars/coptic":333,"world-calendars/dist/calendars/discworld":334,"world-calendars/dist/calendars/ethiopian":335,"world-calendars/dist/calendars/hebrew":336,"world-calendars/dist/calendars/islamic":337,"world-calendars/dist/calendars/julian":338,"world-calendars/dist/calendars/mayan":339,"world-calendars/dist/calendars/nanakshahi":340,"world-calendars/dist/calendars/nepali":341,"world-calendars/dist/calendars/persian":342,"world-calendars/dist/calendars/taiwan":343,"world-calendars/dist/calendars/thai":344,"world-calendars/dist/calendars/ummalqura":345,"world-calendars/dist/main":346,"world-calendars/dist/plus":347}],364:[function(e,t,r){"use strict";var n=e("./calendars"),a=e("../../lib"),i=e("../../constants/numerical"),o=i.EPOCHJD,s=i.ONEDAY,l={valType:"enumerated",values:a.sortObjectKeys(n.calendars),editType:"calc",dflt:"gregorian"},c=function(e,t,r,n){var i={};return i[r]=l,a.coerce(e,t,i,r,n)},u={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:"##",w:"##",c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},f={};function p(e){return f[e]||(f[e]=n.instance(e))}function h(e){return a.extendFlat({},l,{description:e})}function d(e){return"Sets the calendar system to use with `"+e+"` date data."}var m={xcalendar:h(d("x"))},g=a.extendFlat({},m,{ycalendar:h(d("y"))}),y=a.extendFlat({},g,{zcalendar:h(d("z"))}),v=h(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));t.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:g,bar:g,box:g,heatmap:g,contour:g,histogram:g,histogram2d:g,histogram2dcontour:g,scatter3d:y,surface:y,mesh3d:y,scattergl:g,ohlc:m,candlestick:m},layout:{calendar:h(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:v},yaxis:{calendar:v},scene:{xaxis:{calendar:v},yaxis:{calendar:v},zaxis:{calendar:v}},polar:{radialaxis:{calendar:v}}},transforms:{filter:{valuecalendar:h(["WARNING: All transforms are deprecated and may be removed from the API in next major version.","Sets the calendar system to use for `value`, if it is a date."].join(" ")),targetcalendar:h(["WARNING: All transforms are deprecated and may be removed from the API in next major version.","Sets the calendar system to use for `target`, if it is an","array of dates. If `target` is a string (eg *x*) we use the","corresponding trace attribute (eg `xcalendar`) if it exists,","even if `targetcalendar` is provided."].join(" "))}}},layoutAttributes:l,handleDefaults:c,handleTraceDefaults:function(e,t,r,n){for(var a=0;a<r.length;a++)c(e,t,r[a]+"calendar",n.calendar)},CANONICAL_SUNDAY:{chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},CANONICAL_TICK:{chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},DFLTRANGE:{chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},getCal:p,worldCalFmt:function(e,t,r){for(var n,a,i,l,c,f=Math.floor((t+.05)/s)+o,h=p(r).fromJD(f),d=0;-1!==(d=e.indexOf("%",d));)"0"===(n=e.charAt(d+1))||"-"===n||"_"===n?(i=3,a=e.charAt(d+2),"_"===n&&(n="-")):(a=n,n="0",i=2),(l=u[a])?(c="##"===l?"##":h.formatDate(l[n]),e=e.substr(0,d)+c+e.substr(d+i),d+=c.length):d+=i;return e}}},{"../../constants/numerical":479,"../../lib":503,"./calendars":363}],365:[function(e,t,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],366:[function(e,t,r){"use strict";var n=e("tinycolor2"),a=e("fast-isnumeric"),i=e("../../lib/array").isTypedArray,o=t.exports={},s=e("./attributes");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var c=o.background=s.background;function u(e){if(a(e)||"string"!=typeof e)return e;var t=e.trim();if("rgb"!==t.substr(0,3))return e;var r=t.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return e;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===t.charAt(3)&&4===n.length;if(!i&&3!==n.length)return e;for(var o=0;o<n.length;o++){if(!n[o].length)return e;if(n[o]=Number(n[o]),!(n[o]>=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):l).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,s=Object.keys(e);for(t=0;t<s.length;t++)if(a=e[n=s[t]],"color"===n.substr(n.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=u(a[r]);else e[n]=u(a);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(a))for(r=0;r<a.length;r++)Array.isArray(a[r])&&(a[r][1]=u(a[r][1]));else if(Array.isArray(a)){var l=a[0];if(!Array.isArray(l)&&l&&"object"==typeof l)for(r=0;r<a.length;r++)o.clean(a[r])}else a&&"object"==typeof a&&!i(a)&&o.clean(a)}}},{"../../lib/array":485,"./attributes":365,"fast-isnumeric":190,tinycolor2:312}],367:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/layout_attributes"),a=e("../../plots/font_attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll;t.exports=o({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:i({},n.ticks,{dflt:""}),ticklabeloverflow:i({},n.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:a({}),tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,minexponent:n.minexponent,showexponent:n.showexponent,title:{text:{valType:"string"},font:a({}),side:{valType:"enumerated",values:["right","top","bottom"]}},_deprecated:{title:{valType:"string"},titlefont:a({}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},"colorbars","from-root")},{"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plots/cartesian/layout_attributes":569,"../../plots/font_attributes":585}],368:[function(e,t,r){"use strict";t.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}},{}],369:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/plot_template"),i=e("../../plots/cartesian/tick_value_defaults"),o=e("../../plots/cartesian/tick_mark_defaults"),s=e("../../plots/cartesian/tick_label_defaults"),l=e("../../plots/cartesian/prefix_suffix_defaults"),c=e("./attributes");t.exports=function(e,t,r){var u=a.newContainer(t,"colorbar"),f=e.colorbar||{};function p(e,t){return n.coerce(f,u,c,e,t)}var h=r.margin||{t:0,b:0,l:0,r:0},d=r.width-h.l-h.r,m=r.height-h.t-h.b,g="v"===p("orientation"),y=p("thicknessmode");p("thickness","fraction"===y?30/(g?d:m):30);var v=p("lenmode");p("len","fraction"===v?1:g?m:d),p("x",g?1.02:.5),p("xanchor",g?"left":"center"),p("xpad"),p("y",g?.5:1.02),p("yanchor",g?"middle":"bottom"),p("ypad"),n.noneOrAll(f,u,["x","y"]),p("outlinecolor"),p("outlinewidth"),p("bordercolor"),p("borderwidth"),p("bgcolor");var b=n.coerce(f,u,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:g?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");p("ticklabeloverflow",-1!==b.indexOf("inside")?"hide past domain":"hide past div"),i(f,u,p,"linear");var x=r.font,_={outerTicks:!1,font:x};-1!==b.indexOf("inside")&&(_.bgColor="black"),l(f,u,p,"linear",_),s(f,u,p,"linear",_),o(f,u,p,"linear",_),p("title.text",r._dfltTitle.colorbar);var w=u.tickfont,k=n.extendFlat({},w,{color:x.color,size:n.bigFont(w.size)});n.coerceFont(p,"title.font",k),p("title.side",g?"top":"right")}},{"../../lib":503,"../../plot_api/plot_template":543,"../../plots/cartesian/prefix_suffix_defaults":573,"../../plots/cartesian/tick_label_defaults":578,"../../plots/cartesian/tick_mark_defaults":579,"../../plots/cartesian/tick_value_defaults":580,"./attributes":367}],370:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("tinycolor2"),i=e("../../plots/plots"),o=e("../../registry"),s=e("../../plots/cartesian/axes"),l=e("../dragelement"),c=e("../../lib"),u=c.strTranslate,f=e("../../lib/extend").extendFlat,p=e("../../lib/setcursor"),h=e("../drawing"),d=e("../color"),m=e("../titles"),g=e("../../lib/svg_text_utils"),y=e("../colorscale/helpers").flipScale,v=e("../../plots/cartesian/axis_defaults"),b=e("../../plots/cartesian/position_defaults"),x=e("../../plots/cartesian/layout_attributes"),_=e("../../constants/alignment"),w=_.LINE_SPACING,k=_.FROM_TL,D=_.FROM_BR,T=e("./constants").cn;t.exports={draw:function(e){var t=e._fullLayout._infolayer.selectAll("g."+T.colorbar).data(function(e){var t,r,n,a,i=e._fullLayout,o=e.calcdata,s=[];function l(e){return f(e,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"==typeof a.calc?a.calc(e,n,t):(t._fillgradient=r.reversescale?y(r.colorscale):r.colorscale,t._zrange=[r[a.min],r[a.max]])}for(var u=0;u<o.length;u++){var p=o[u],h=(n=p[0].trace)._module.colorbar;if(!0===n.visible&&h)for(var d=Array.isArray(h),m=d?h:[h],g=0;g<m.length;g++){var v=(a=m[g]).container;(r=v?n[v]:n)&&r.showscale&&((t=l(r.colorbar))._id="cb"+n.uid+(d&&v?"-"+v:""),t._traceIndex=n.index,t._propPrefix=(v?v+".":"")+"colorbar.",t._meta=n._meta,c(),s.push(t))}}for(var b in i._colorAxes)if((r=i[b]).showscale){var x=i._colorAxes[b];(t=l(r.colorbar))._id="cb"+b,t._propPrefix=b+".colorbar.",t._meta=i._meta,a={min:"cmin",max:"cmax"},"heatmap"!==x[0]&&(n=x[1],a.calc=n._module.colorbar.calc),c(),s.push(t)}return s}(e),(function(e){return e._id}));t.enter().append("g").attr("class",(function(e){return e._id})).classed(T.colorbar,!0),t.each((function(t){var r=n.select(this);c.ensureSingle(r,"rect",T.cbbg),c.ensureSingle(r,"g",T.cbfills),c.ensureSingle(r,"g",T.cblines),c.ensureSingle(r,"g",T.cbaxis,(function(e){e.classed(T.crisp,!0)})),c.ensureSingle(r,"g",T.cbtitleunshift,(function(e){e.append("g").classed(T.cbtitle,!0)})),c.ensureSingle(r,"rect",T.cboutline);var y=function(e,t,r){var o="v"===t.orientation,l=t.len,p=t.lenmode,y=t.thickness,_=t.thicknessmode,A=t.outlinewidth,S=t.borderwidth,M=t.bgcolor,E=t.xanchor,C=t.yanchor,N=t.xpad,O=t.ypad,I=t.x,P=o?t.y:1-t.y,R=r._fullLayout,L=R._size,F=t._fillcolor,B=t._line,z=t.title,j=z.side,U=t._zrange||n.extent(("function"==typeof F?F:B.color).domain()),$="function"==typeof B.color?B.color:function(){return B.color},V="function"==typeof F?F:function(){return F},q=t._levels,W=function(e,t,r){var n,a,i=t._levels,o=[],s=[],l=i.end+i.size/100,c=i.size,u=1.001*r[0]-.001*r[1],f=1.001*r[1]-.001*r[0];for(a=0;a<1e5&&(n=i.start+a*c,!(c>0?n>=l:n<=l));a++)n>u&&n<f&&o.push(n);if(t._fillgradient)s=[0];else if("function"==typeof t._fillcolor){var p=t._filllevels;if(p)for(l=p.end+p.size/100,c=p.size,a=0;a<1e5&&(n=p.start+a*c,!(c>0?n>=l:n<=l));a++)n>r[0]&&n<r[1]&&s.push(n);else(s=o.map((function(e){return e-i.size/2}))).push(s[s.length-1]+i.size)}else t._fillcolor&&"string"==typeof t._fillcolor&&(s=[0]);return i.size<0&&(o.reverse(),s.reverse()),{line:o,fill:s}}(0,t,U),H=W.fill,G=W.line,X=Math.round(y*("fraction"===_?o?L.w:L.h:1)),Y=X/(o?L.w:L.h),Z=Math.round(l*("fraction"===p?o?L.h:L.w:1)),K=Z/(o?L.h:L.w),J=Math.round(o?I*L.w+N:P*L.h+O),Q={center:.5,right:1}[E]||0,ee={top:1,middle:.5}[C]||0,te=o?I-Q*Y:P-ee*Y,re=o?P-ee*K:I-Q*K,ne=Math.round(o?L.h*(1-re):L.w*re);t._lenFrac=K,t._thickFrac=Y,t._uFrac=te,t._vFrac=re;var ae=t._axis=function(e,t,r){var n=e._fullLayout,a="v"===t.orientation,i={type:"linear",range:r,tickmode:t.tickmode,nticks:t.nticks,tick0:t.tick0,dtick:t.dtick,tickvals:t.tickvals,ticktext:t.ticktext,ticks:t.ticks,ticklen:t.ticklen,tickwidth:t.tickwidth,tickcolor:t.tickcolor,showticklabels:t.showticklabels,ticklabelposition:t.ticklabelposition,ticklabeloverflow:t.ticklabeloverflow,tickfont:t.tickfont,tickangle:t.tickangle,tickformat:t.tickformat,exponentformat:t.exponentformat,minexponent:t.minexponent,separatethousands:t.separatethousands,showexponent:t.showexponent,showtickprefix:t.showtickprefix,tickprefix:t.tickprefix,showticksuffix:t.showticksuffix,ticksuffix:t.ticksuffix,title:t.title,showline:!0,anchor:"free",side:a?"right":"bottom",position:1},o=a?"y":"x",s={type:"linear",_id:o+t._id},l={letter:o,font:n.font,noHover:!0,noTickson:!0,noTicklabelmode:!0,calendar:n.calendar};function u(e,t){return c.coerce(i,s,x,e,t)}return v(i,s,u,l,n),b(i,s,u,l),s}(r,t,U);ae.position=Y+(o?I+N/L.w:P+O/L.h);var ie=-1!==["top","bottom"].indexOf(j);if(o&&ie&&(ae.title.side=j,ae.titlex=I+N/L.w,ae.titley=re+("top"===z.side?K-O/L.h:O/L.h)),o||ie||(ae.title.side=j,ae.titley=P+O/L.h,ae.titlex=re+N/L.w),B.color&&"auto"===t.tickmode){ae.tickmode="linear",ae.tick0=q.start;var oe=q.size,se=c.constrain(Z/50,4,15)+1,le=(U[1]-U[0])/((t.nticks||se)*oe);if(le>1){var ce=Math.pow(10,Math.floor(Math.log(le)/Math.LN10));oe*=ce*c.roundUp(le/ce,[2,5,10]),(Math.abs(q.start)/q.size+1e-6)%1<2e-6&&(ae.tick0=0)}ae.dtick=oe}ae.domain=o?[re+O/L.h,re+K-O/L.h]:[re+N/L.w,re+K-N/L.w],ae.setScale(),e.attr("transform",u(Math.round(L.l),Math.round(L.t)));var ue,fe=e.select("."+T.cbtitleunshift).attr("transform",u(-Math.round(L.l),-Math.round(L.t))),pe=ae.ticklabelposition,he=ae.title.font.size,de=e.select("."+T.cbaxis),me=0,ge=0;function ye(n,a){var i={propContainer:ae,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:R._dfltTitle.colorbar,containerGroup:e.select("."+T.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){var e,t;(o&&ie||!o&&!ie)&&("top"===j&&(e=N+L.l+L.w*I,t=O+L.t+L.h*(1-re-K)+3+.75*he),"bottom"===j&&(e=N+L.l+L.w*I,t=O+L.t+L.h*(1-re)-3-.25*he),"right"===j&&(t=O+L.t+L.h*P+3+.75*he,e=N+L.l+L.w*re),ye(ae._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!ie||o&&ie){var i,l=e.select("."+T.cbtitle),f=l.select("text"),p=[-A/2,A/2],d=l.select(".h"+ae._id+"title-math-group").node(),m=15.6;if(f.node()&&(m=parseInt(f.node().style.fontSize,10)*w),d?(i=h.bBox(d),ge=i.width,(me=i.height)>m&&(p[1]-=(me-m)/2)):f.node()&&!f.classed(T.jsPlaceholder)&&(i=h.bBox(f.node()),ge=i.width,me=i.height),o){if(me){if(me+=5,"top"===j)ae.domain[1]-=me/L.h,p[1]*=-1;else{ae.domain[0]+=me/L.h;var y=g.lineCount(f);p[1]+=(1-y)*m}l.attr("transform",u(p[0],p[1])),ae.setScale()}}else ge&&("right"===j&&(ae.domain[0]+=(ge+he/2)/L.w),l.attr("transform",u(p[0],p[1])),ae.setScale())}e.selectAll("."+T.cbfills+",."+T.cblines).attr("transform",o?u(0,Math.round(L.h*(1-ae.domain[1]))):u(Math.round(L.w*ae.domain[0]),0)),de.attr("transform",o?u(0,Math.round(-L.t)):u(Math.round(-L.l),0));var v=e.select("."+T.cbfills).selectAll("rect."+T.cbfill).attr("style","").data(H);v.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),v.exit().remove();var b=U.map(ae.c2p).map(Math.round).sort((function(e,t){return e-t}));v.each((function(e,i){var s=[0===i?U[0]:(H[i]+H[i-1])/2,i===H.length-1?U[1]:(H[i]+H[i+1])/2].map(ae.c2p).map(Math.round);o&&(s[1]=c.constrain(s[1]+(s[1]>s[0])?1:-1,b[0],b[1]));var l=n.select(this).attr(o?"x":"y",J).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(t._fillgradient)h.gradient(l,r,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=V(e).replace("e-","");l.attr("fill",a(u).toHexString())}}));var x=e.select("."+T.cblines).selectAll("path."+T.cbline).data(B.color&&B.width?G:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each((function(e){var t=J,r=Math.round(ae.c2p(e))+B.width/2%1;n.select(this).attr("d","M"+(o?t+","+r:r+","+t)+(o?"h":"v")+X).call(h.lineGroupStyle,B.width,$(e),B.dash)})),de.selectAll("g."+ae._id+"tick,path").remove();var _=J+X+(A||0)/2-("outside"===t.ticks?1:0),k=s.calcTicks(ae),D=s.getTickSigns(ae)[2];return s.drawTicks(r,ae,{vals:"inside"===ae.ticks?s.clipEnds(ae,k):k,layer:de,path:s.makeTickPath(ae,_,D),transFn:s.makeTransTickFn(ae)}),s.drawLabels(r,ae,{vals:k,layer:de,transFn:s.makeTransTickLabelFn(ae),labelFns:s.makeLabelFns(ae,_)})},function(){if(o&&!ie||!o&&ie){var e,a,i=ae.position||0,s=ae._offset+ae._length/2;if("right"===j)a=s,e=L.l+L.w*i+10+he*(ae.showticklabels?1:.5);else if(e=s,"bottom"===j&&(a=L.t+L.h*i+10+(-1===pe.indexOf("inside")?ae.tickfont.size:0)+("intside"!==ae.ticks&&t.ticklen||0)),"top"===j){var l=z.text.split("<br>").length;a=L.t+L.h*i+10-X-w*he*l}ye((o?"h":"v")+ae._id+"title",{avoid:{selection:n.select(r).selectAll("g."+ae._id+"tick"),side:j,offsetTop:o?0:L.t,offsetLeft:o?L.l:0,maxShift:o?R.width:R.height},attributes:{x:e,y:a,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var n,s=X+A/2;-1===pe.indexOf("inside")&&(n=h.bBox(de.node()),s+=o?n.width:n.height),ue=fe.select("text");var c=0,f=o&&"top"===j,m=!o&&"right"===j,g=0;if(ue.node()&&!ue.classed(T.jsPlaceholder)){var v,b=fe.select(".h"+ae._id+"title-math-group").node();b&&(o&&ie||!o&&!ie)?(c=(n=h.bBox(b)).width,v=n.height):(c=(n=h.bBox(fe.node())).right-L.l-(o?J:ne),v=n.bottom-L.t-(o?ne:J),o||"top"!==j||(s+=n.height,g=n.height)),m&&(ue.attr("transform",u(c/2+he/2,0)),c*=2),s=Math.max(s,o?c:v)}var x=2*(o?N:O)+s+S+A/2,w=0;!o&&z.text&&"bottom"===C&&P<=0&&(x+=w=x/2,g+=w),R._hColorbarMoveTitle=w,R._hColorbarMoveCBTitle=g;var F=S+A;e.select("."+T.cbbg).attr("x",(o?J:ne)-F/2-(o?N:0)).attr("y",(o?ne:J)-(o?Z:O+g-w)).attr(o?"width":"height",Math.max(x-w,2)).attr(o?"height":"width",Math.max(Z+F,2)).call(d.fill,M).call(d.stroke,t.bordercolor).style("stroke-width",S);var B=m?Math.max(c-10,0):0;if(e.selectAll("."+T.cboutline).attr("x",(o?J:ne+N)+B).attr("y",(o?ne+O-Z:J)+(f?me:0)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(Z-(o?2*O+me:2*N+B),2)).call(d.stroke,t.outlinecolor).style({fill:"none","stroke-width":A}),e.attr("transform",u(L.l-(o?Q*x:0),L.t-(o?0:(1-ee)*x-g))),!o&&(S||a(M).getAlpha()&&!a.equals(R.paper_bgcolor,M))){var U=de.selectAll("text"),$=U[0].length,V=e.select("."+T.cbbg).node(),q=h.bBox(V),W=h.getTranslate(e);U.each((function(e,t){var r=$-1;if(0===t||t===r){var n,a=h.bBox(this),i=h.getTranslate(this);if(t===r){var o=a.right+i.x;(n=q.right+W.x+ne-S-2+I-o)>0&&(n=0)}else if(0===t){var s=a.left+i.x;(n=q.left+W.x+ne+S+2-s)<0&&(n=0)}n&&($<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var H={},G=k[E],Y=D[E],K=k[C],te=D[C],re=x-X;o?("pixels"===p?(H.y=P,H.t=Z*K,H.b=Z*te):(H.t=H.b=0,H.yt=P+l*K,H.yb=P-l*te),"pixels"===_?(H.x=I,H.l=x*G,H.r=x*Y):(H.l=re*G,H.r=re*Y,H.xl=I-y*G,H.xr=I+y*Y)):("pixels"===p?(H.x=I,H.l=Z*G,H.r=Z*Y):(H.l=H.r=0,H.xl=I+l*G,H.xr=I-l*Y),"pixels"===_?(H.y=1-P,H.t=x*K,H.b=x*te):(H.t=re*K,H.b=re*te,H.yt=P-y*K,H.yb=P+y*te)),i.autoMargin(r,t._id,H)}],r)}(r,t,e);y&&y.then&&(e._promises||[]).push(y),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,s="v"===t.orientation,c=r._fullLayout._size;l.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),p(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=l.align((s?t._uFrac:t._vFrac)+r/c.w,s?t._thickFrac:t._lenFrac,0,1,t.xanchor),i=l.align((s?t._vFrac:1-t._uFrac)-o/c.h,s?t._lenFrac:t._thickFrac,0,1,t.yanchor);var f=l.getCursor(a,i,t.xanchor,t.yanchor);p(e,f)},doneFn:function(){if(p(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":471,"../../lib":503,"../../lib/extend":493,"../../lib/setcursor":524,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"../../plots/cartesian/axis_defaults":556,"../../plots/cartesian/layout_attributes":569,"../../plots/cartesian/position_defaults":572,"../../plots/plots":619,"../../registry":638,"../color":366,"../colorscale/helpers":377,"../dragelement":385,"../drawing":388,"../titles":464,"./constants":368,"@plotly/d3":58,tinycolor2:312}],371:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":503}],372:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":367,"./defaults":369,"./draw":370,"./has_colorbar":371}],373:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;function s(e){return"`"+e+"`"}i(o),t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",l=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",p=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):s(p+(r={z:"z",c:"color"}[i]));var h=i+"auto",d=i+"min",m=i+"max",g=i+"mid",y=(s(p+h),s(p+d),s(p+m),{});y[d]=y[m]=void 0;var v={};v[h]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(b.color.anim=!0)),b[h]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:y},b[d]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},b[m]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},b[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:y},b.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:c,editType:"calc"},b.colorbar=n),t.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":520,"../../lib/sort_object_keys":526,"../colorbar/attributes":367,"./scales.js":381}],374:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,s=e._fullLayout,l=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),p=!1!==f.auto,h=f.min,d=f.max,m=f.mid,g=function(){return a.aggNums(Math.min,null,l)},y=function(){return a.aggNums(Math.max,null,l)};void 0===h?h=g():p&&(h=u._colorAx&&n(h)?Math.min(h,g()):g()),void 0===d?d=y():p&&(d=u._colorAx&&n(d)?Math.max(d,y()):y()),p&&void 0!==m&&(d-m>m-h?h=m-(d-m):d-m<m-h&&(d=m+(m-h))),h===d&&(h-=.5,d+=.5),f._sync("min",h),f._sync("max",d),f.autocolorscale&&(o=h*d<0?s.colorscale.diverging:h>=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":503,"./helpers":377,"fast-isnumeric":190}],375:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s<e.length;s++){var l=e[s],c=l._module.colorbar;if(c)if(Array.isArray(c))for(var u=0;u<c.length;u++)o(l,c[u]);else o(l,c);a(l,"marker.line")&&o(l,{container:"marker.line",min:"cmin",max:"cmax"})}for(var f in t._colorAxes)o(t[f],{min:"cmin",max:"cmax"})}},{"../../lib":503,"./helpers":377}],376:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../colorbar/has_colorbar"),o=e("../colorbar/defaults"),s=e("./scales").isValid,l=e("../../registry").traceIs;function c(e,t){var r=t.slice(0,t.length-1);return t?a.nestedProperty(e,r).get()||{}:e}t.exports=function e(t,r,u,f,p){var h=p.prefix,d=p.cLetter,m="_module"in r,g=c(t,h),y=c(r,h),v=c(r._template||{},h)||{},b=function(){return delete t.coloraxis,delete r.coloraxis,e(t,r,u,f,p)};if(m){var x=u._colorAxes||{},_=f(h+"coloraxis");if(_){var w=l(r,"contour")&&a.nestedProperty(r,"contours.coloring").get()||"heatmap",k=x[_];return void(k?(k[2].push(b),k[0]!==w&&(k[0]=!1,a.warn(["Ignoring coloraxis:",_,"setting","as it is linked to incompatible colorscales."].join(" ")))):x[_]=[w,r,[b]])}}var D=g[d+"min"],T=g[d+"max"],A=n(D)&&n(T)&&D<T;f(h+d+"auto",!A)?f(h+d+"mid"):(f(h+d+"min"),f(h+d+"max"));var S,M,E=g.colorscale,C=v.colorscale;void 0!==E&&(S=!s(E)),void 0!==C&&(S=!s(C)),f(h+"autocolorscale",S),f(h+"colorscale"),f(h+"reversescale"),"marker.line."!==h&&(h&&m&&(M=i(g)),f(h+"showscale",M)&&(h&&v&&(y._template=v),o(g,y,u)))}},{"../../lib":503,"../../registry":638,"../colorbar/defaults":369,"../colorbar/has_colorbar":371,"./scales":381,"fast-isnumeric":190}],377:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("tinycolor2"),i=e("fast-isnumeric"),o=e("../../lib"),s=e("../color"),l=e("./scales").isValid,c=["showscale","autocolorscale","colorscale","reversescale","colorbar"],u=["min","max","mid","auto"];function f(e){var t,r,n,a=e._colorAx,i=a||e,o={};for(r=0;r<c.length;r++)o[n=c[r]]=i[n];if(a)for(t="c",r=0;r<u.length;r++)o[n=u[r]]=i["c"+n];else{var s;for(r=0;r<u.length;r++)((s="c"+(n=u[r]))in i||(s="z"+n)in i)&&(o[n]=i[s]);t=s.charAt(0)}return o._sync=function(e,r){var n=-1!==u.indexOf(e)?t+e:e;i[n]=i["_"+n]=r},o}function p(e){for(var t=f(e),r=t.min,n=t.max,a=t.reversescale?h(t.colorscale):t.colorscale,i=a.length,o=new Array(i),s=new Array(i),l=0;l<i;l++){var c=a[l];o[l]=r+c[0]*(n-r),s[l]=c[1]}return{domain:o,range:s}}function h(e){for(var t=e.length,r=new Array(t),n=t-1,a=0;n>=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function d(e,t){t=t||{};for(var r=e.domain,o=e.range,l=o.length,c=new Array(l),u=0;u<l;u++){var f=a(o[u]).toRgb();c[u]=[f.r,f.g,f.b,f.a]}var p,h=n.scale.linear().domain(r).range(c).clamp(!0),d=t.noNumericCheck,g=t.returnArray;return(p=d&&g?h:d?function(e){return m(h(e))}:g?function(e){return i(e)?h(e):a(e).isValid()?e:s.defaultLine}:function(e){return i(e)?m(h(e)):a(e).isValid()?e:s.defaultLine}).domain=h.domain,p.range=function(){return o},p}function m(e){var t={r:e[0],g:e[1],b:e[2],a:e[3]};return a(t).toRgbString()}t.exports={hasColorscale:function(e,t,r){var n=t?o.nestedProperty(e,t).get()||{}:e,a=n[r||"color"],s=!1;if(o.isArrayOrTypedArray(a))for(var c=0;c<a.length;c++)if(i(a[c])){s=!0;break}return o.isPlainObject(n)&&(s||!0===n.showscale||i(n.cmin)&&i(n.cmax)||l(n.colorscale)||o.isPlainObject(n.colorbar))},extractOpts:f,extractScale:p,flipScale:h,makeColorScaleFunc:d,makeColorScaleFuncFromTrace:function(e,t){return d(p(e),t)}}},{"../../lib":503,"../color":366,"./scales":381,"@plotly/d3":58,"fast-isnumeric":190,tinycolor2:312}],378:[function(e,t,r){"use strict";var n=e("./scales"),a=e("./helpers");t.exports={moduleType:"component",name:"colorscale",attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),handleDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc"),scales:n.scales,defaultScale:n.defaultScale,getScale:n.get,isValidScale:n.isValid,hasColorscale:a.hasColorscale,extractOpts:a.extractOpts,extractScale:a.extractScale,flipScale:a.flipScale,makeColorScaleFunc:a.makeColorScaleFunc,makeColorScaleFuncFromTrace:a.makeColorScaleFuncFromTrace}},{"./attributes":373,"./calc":374,"./cross_trace_defaults":375,"./defaults":376,"./helpers":377,"./layout_attributes":379,"./layout_defaults":380,"./scales":381}],379:[function(e,t,r){"use strict";var n=e("../../lib/extend").extendFlat,a=e("./attributes"),i=e("./scales").scales;t.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:i.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:i.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:i.RdBu,editType:"calc"}},coloraxis:n({_isSubplotObj:!0,editType:"calc"},a("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}},{"../../lib/extend":493,"./attributes":373,"./scales":381}],380:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/plot_template"),i=e("./layout_attributes"),o=e("./defaults");t.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var s,l,c=t._colorAxes;function u(e,t){return n.coerce(s,l,i.coloraxis,e,t)}for(var f in c){var p=c[f];if(p[0])s=e[f]||{},(l=a.newContainer(t,f,"coloraxis"))._name=f,o(s,l,t,u,{prefix:"",cLetter:"c"});else{for(var h=0;h<p[2].length;h++)p[2][h]();delete t._colorAxes[f]}}}},{"../../lib":503,"../../plot_api/plot_template":543,"./defaults":376,"./layout_attributes":379}],381:[function(e,t,r){"use strict";var n=e("tinycolor2"),a={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},i=a.RdBu;function o(e){var t=0;if(!Array.isArray(e)||e.length<2)return!1;if(!e[0]||!e[e.length-1])return!1;if(0!=+e[0][0]||1!=+e[e.length-1][0])return!1;for(var r=0;r<e.length;r++){var a=e[r];if(2!==a.length||+a[0]<t||!n(a[1]).isValid())return!1;t=+a[0]}return!0}t.exports={scales:a,defaultScale:i,get:function(e,t){if(t||(t=i),!e)return t;function r(){try{e=a[e]||JSON.parse(e)}catch(r){e=t}}return"string"==typeof e&&(r(),"string"==typeof e&&r()),o(e)?e:t},isValid:function(e){return void 0!==a[e]||o(e)}}},{tinycolor2:312}],382:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a){var i=(e-r)/(n-r),o=i+t/(n-r),s=(i+o)/2;return"left"===a||"bottom"===a?i:"center"===a||"middle"===a?s:"right"===a||"top"===a?o:i<2/3-s?i:o>4/3-s?o:s}},{}],383:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":503}],384:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],385:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,s=e("../../plots/cartesian/constants"),l=t.exports={};l.align=e("./align"),l.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(e){var t,r,n,c,p,h,d,m,g=e.gd,y=1,v=g._context.doubleClickDelay,b=e.element;g._mouseDownTime||(g._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=e.clampFn||function(e,t,r){return Math.abs(e)<r&&(e=0),Math.abs(t)<r&&(t=0),[e,t]};function _(i){g._dragged=!1,g._dragging=!0;var o=f(i);t=o[0],r=o[1],d=i.target,h=i,m=2===i.buttons||i.ctrlKey,void 0===i.clientX&&void 0===i.clientY&&(i.clientX=t,i.clientY=r),(n=(new Date).getTime())-g._mouseDownTime<v?y+=1:(y=1,g._mouseDownTime=n),e.prepFn&&e.prepFn(i,t,r),a&&!m?(p=u()).style.cursor=window.getComputedStyle(b).cursor:a||(p=document,c=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(b).cursor),document.addEventListener("mouseup",k),document.addEventListener("touchend",k),!1!==e.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var a=f(n),i=e.minDrag||s.MINDRAG,o=x(a[0]-t,a[1]-r,i),c=o[0],u=o[1];(c||u)&&(g._dragged=!0,l.unhover(g,n)),g._dragged&&e.moveFn&&!m&&(g._dragdata={element:b,dx:c,dy:u},e.moveFn(c,u))}function k(t){if(delete g._dragdata,!1!==e.dragmode&&(t.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",k),document.removeEventListener("touchend",k),a?o(p):c&&(p.documentElement.style.cursor=c,c=null),g._dragging){if(g._dragging=!1,(new Date).getTime()-g._mouseDownTime>v&&(y=Math.max(y-1,1)),g._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(y,h),!m){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}d.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=u},{"../../lib":503,"../../plots/cartesian/constants":561,"./align":382,"./cursor":383,"./unhover":386,"has-hover":228,"has-passive-events":229,"mouse-event-offset":242}],386:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),s=t.exports={};s.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),s.raw(e,t,r)},s.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":491,"../../lib/events":492,"../../lib/throttle":530,"../fx/constants":400}],387:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],388:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),s=e("tinycolor2"),l=e("../../registry"),c=e("../color"),u=e("../colorscale"),f=a.strTranslate,p=e("../../lib/svg_text_utils"),h=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,m=e("../../constants/interactions").DESELECTDIM,g=e("../../traces/scatter/subtypes"),y=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,b=t.exports={};b.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},b.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},b.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},b.setRect=function(e,t,r,n,a){e.call(b.setPosition,t,r).call(b.setSize,n,a)},b.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",f(a,i)),!0)},b.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);b.translatePoint(e,a,t,r)}))},b.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},b.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,s=i.ycalendar,c=l.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){b.hideOutsideRangePoint(e,n.select(this),r,a,o,s)}))}))}},b.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},b.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";c.stroke(t,n||i.color),b.dashLine(t,s,o)},b.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(b.dashLine,s,o)}))},b.dashLine=function(e,t,r){r=+r||0,t=b.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},b.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},b.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(c.fill,t)},b.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(c.fill,e[0].trace.fillcolor)}))};var x=e("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(x).forEach((function(e){var t=x[e],r=t.n;b.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),b.symbolNames[r]=e,b.symbolFuncs[r]=t.f,t.needLine&&(b.symbolNeedLines[r]=!0),t.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(b.symbolNoFill[r]=!0)}));var _=b.symbolNames.length;function w(e,t){var r=e%100;return b.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=b.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=_||e>=400?0:Math.floor(Math.max(e,0))};var k={x1:1,x2:0,y1:0,y2:0},D={x1:0,x2:0,y1:1,y2:0},T=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:k},horizontalreversed:{node:"linearGradient",attrs:k,reversed:!0},vertical:{node:"linearGradient",attrs:D},verticalreversed:{node:"linearGradient",attrs:D,reversed:!0}};b.gradient=function(e,t,r,i,o,l){for(var u=o.length,f=A[i],p=new Array(u),h=0;h<u;h++)f.reversed?p[u-1-h]=[T(100*(1-o[h][0])),o[h][1]]:p[h]=[T(100*o[h][0]),o[h][1]];var d=t._fullLayout,m="g"+d._uid+"-"+r,g=d._defs.select(".gradients").selectAll("#"+m).data([i+p.join(";")],a.identity);g.exit().remove(),g.enter().append(f.node).each((function(){var e=n.select(this);f.attrs&&e.attr(f.attrs),e.attr("id",m);var t=e.selectAll("stop").data(p);t.exit().remove(),t.enter().append("stop"),t.each((function(e){var t=s(e[1]);n.select(this).attr({offset:e[0]+"%","stop-color":c.tinyRGB(t),"stop-opacity":t.getAlpha()})}))})),e.style(l,R(m,t)).style(l+"-opacity",null);var y=function(e){return"."+e.attr("class").replace(/\s/g,".")},v=y(n.select(e.node().parentNode))+">"+y(e);d._gradientUrlQueryParts[v]=1},b.pattern=function(e,t,r,i,o,s,l,u,f,p,h,d){var m="legend"===t;u&&("overlay"===f?(p=u,h=c.contrast(p)):(p=void 0,h=u));var g,y,v,b,x,_,w,k,D,T=r._fullLayout,A="p"+T._uid+"-"+i,S={};switch(o){case"/":g=s*Math.sqrt(2),y=s*Math.sqrt(2),_="path",S={d:v="M-"+g/4+","+y/4+"l"+g/2+",-"+y/2+"M0,"+y+"L"+g+",0M"+g/4*3+","+y/4*5+"l"+g/2+",-"+y/2,opacity:d,stroke:h,"stroke-width":(b=l*s)+"px"};break;case"\\":g=s*Math.sqrt(2),y=s*Math.sqrt(2),_="path",S={d:v="M"+g/4*3+",-"+y/4+"l"+g/2+","+y/2+"M0,0L"+g+","+y+"M-"+g/4+","+y/4*3+"l"+g/2+","+y/2,opacity:d,stroke:h,"stroke-width":(b=l*s)+"px"};break;case"x":g=s*Math.sqrt(2),y=s*Math.sqrt(2),v="M-"+g/4+","+y/4+"l"+g/2+",-"+y/2+"M0,"+y+"L"+g+",0M"+g/4*3+","+y/4*5+"l"+g/2+",-"+y/2+"M"+g/4*3+",-"+y/4+"l"+g/2+","+y/2+"M0,0L"+g+","+y+"M-"+g/4+","+y/4*3+"l"+g/2+","+y/2,b=s-s*Math.sqrt(1-l),_="path",S={d:v,opacity:d,stroke:h,"stroke-width":b+"px"};break;case"|":_="path",_="path",S={d:v="M"+(g=s)/2+",0L"+g/2+","+(y=s),opacity:d,stroke:h,"stroke-width":(b=l*s)+"px"};break;case"-":_="path",_="path",S={d:v="M0,"+(y=s)/2+"L"+(g=s)+","+y/2,opacity:d,stroke:h,"stroke-width":(b=l*s)+"px"};break;case"+":_="path",v="M"+(g=s)/2+",0L"+g/2+","+(y=s)+"M0,"+y/2+"L"+g+","+y/2,b=s-s*Math.sqrt(1-l),_="path",S={d:v,opacity:d,stroke:h,"stroke-width":b+"px"};break;case".":g=s,y=s,l<Math.PI/4?x=Math.sqrt(l*s*s/Math.PI):(w=l,k=Math.PI/4,1,x=(D=s/2)+(s/Math.sqrt(2)-D)*(w-k)/(1-k)),_="circle",S={cx:g/2,cy:y/2,r:x,opacity:d,fill:h}}var M=[o||"noSh",p||"noBg",h||"noFg",s,l].join(";"),E=T._defs.select(".patterns").selectAll("#"+A).data([M],a.identity);E.exit().remove(),E.enter().append("pattern").each((function(){var e=n.select(this);if(e.attr({id:A,width:g+"px",height:y+"px",patternUnits:"userSpaceOnUse",patternTransform:m?"scale(0.8)":""}),p){var t=e.selectAll("rect").data([0]);t.exit().remove(),t.enter().append("rect").attr({width:g+"px",height:y+"px",fill:p})}var r=e.selectAll(_).data([0]);r.exit().remove(),r.enter().append(_).attr(S)})),e.style("fill",R(A,r)).style("fill-opacity",null),e.classed("pattern_filled",!0);var C="."+n.select(e.node().parentNode).attr("class").replace(/\s/g,".")+">.pattern_filled";T._patternUrlQueryParts[C]=1},b.initGradients=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},b.initPatterns=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","patterns").selectAll("pattern").remove(),t._patternUrlQueryParts={}},b.getPatternAttr=function(e,t,r){return e&&a.isArrayOrTypedArray(e)?t<e.length?e[t]:r:e},b.pointStyle=function(e,t,r){if(e.size()){var a=b.makePointStyleFns(t);e.each((function(e){b.singlePointStyle(e,n.select(this),t,a,r)}))}},b.singlePointStyle=function(e,t,r,n,i){var o=r.marker,s=o.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?o.opacity:e.mo),n.ms2mrc){var l;l="various"===e.ms||"various"===o.size?3:n.ms2mrc(e.ms),e.mrc=l,n.selectedSizeFn&&(l=e.mrc=n.selectedSizeFn(e));var u=b.symbolNumber(e.mx||o.symbol)||0;e.om=u%200>=100,t.attr("d",w(u,l))}var f,p,h,d=!1;if(e.so)h=s.outlierwidth,p=s.outliercolor,f=o.outliercolor;else{var m=(s||{}).width;h=(e.mlw+1||m+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,p="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,a.isArrayOrTypedArray(o.color)&&(f=c.defaultLine,d=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,f).style({"stroke-width":(h||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:h)+"px");var g=o.gradient,y=e.mgt;y?d=!0:y=g&&g.type,a.isArrayOrTypedArray(y)&&(y=y[0],A[y]||(y=0));var v=o.pattern,x=v&&b.getPatternAttr(v.shape,e.i,"");if(y&&"none"!==y){var _=e.mgc;_?d=!0:_=g.color;var k=r.uid;d&&(k+="-"+e.i),b.gradient(t,i,k,y,[[0,_],[1,f]],"fill")}else if(x){var D=b.getPatternAttr(v.bgcolor,e.i,null),T=b.getPatternAttr(v.fgcolor,e.i,null),S=v.fgopacity,M=b.getPatternAttr(v.size,e.i,8),E=b.getPatternAttr(v.solidity,e.i,.3),C=e.mcc||a.isArrayOrTypedArray(v.shape)||a.isArrayOrTypedArray(v.bgcolor)||a.isArrayOrTypedArray(v.size)||a.isArrayOrTypedArray(v.solidity),N=r.uid;C&&(N+="-"+e.i),b.pattern(t,"point",i,N,x,M,E,e.mcc,v.fillmode,D,T,S)}else c.fill(t,f);h&&c.stroke(t,p)}},b.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=b.tryColorscale(r,""),t.lineScale=b.tryColorscale(r,"line"),l.traceIs(e,"symbols")&&(t.ms2mrc=g.isBubble(e)?y(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,b.makeSelectedPointStyleFns(e)),t},b.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},s=n.marker||{},c=i.opacity,u=o.opacity,f=s.opacity,p=void 0!==u,h=void 0!==f;(a.isArrayOrTypedArray(c)||p||h)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?p?u:t:h?f:m*t});var d=i.color,g=o.color,y=s.color;(g||y)&&(t.selectedColorFn=function(e){var t=e.mcc||d;return e.selected?g||t:y||t});var v=i.size,b=o.size,x=s.size,_=void 0!==b,w=void 0!==x;return l.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||v/2;return e.selected?_?b/2:t:w?x/2:t}),t},b.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,l=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?l||t:u||(l?t:c.addOpacity(t,m))},t},b.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=b.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",w(b.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r<i.length;r++)i[r](t,e)}))}},b.tryColorscale=function(e,t){var r=t?a.nestedProperty(e,t).get():e;if(r){var n=r.color;if((r.colorscale||r._colorAx)&&a.isArrayOrTypedArray(n))return u.makeColorScaleFuncFromTrace(r)}return a.identity};var S={start:1,end:-1,middle:0,bottom:1,top:-1};function M(e,t,r,a,i){var o=n.select(e.node().parentNode),s=-1!==t.indexOf("top")?"top":-1!==t.indexOf("bottom")?"bottom":"middle",l=-1!==t.indexOf("left")?"end":-1!==t.indexOf("right")?"start":"middle",c=a?a/.8+1:0,u=(p.lineCount(e)-1)*d+1,h=S[l]*c,m=.75*r+S[s]*c+(S[s]-1)*u*r/2;e.attr("text-anchor",l),i||o.attr("transform",f(h,m))}function E(e,t){var r=e.ts||t.textfont.size;return o(r)&&r>0?r:0}function C(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],s=r[0]-t[0],l=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(s*s+l*l,.25),f=(u*u*i-c*c*s)*a,p=(u*u*o-c*c*l)*a,h=3*u*(c+u),d=3*c*(c+u);return[[n.round(t[0]+(h&&f/h),2),n.round(t[1]+(h&&p/h),2)],[n.round(t[0]-(d&&f/d),2),n.round(t[1]-(d&&p/d),2)]]}b.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=b.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var s=t.texttemplate,l=r._fullLayout;e.each((function(e){var o=n.select(this),c=s?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(s){var u=t._module.formatLabels,f=u?u(e,t,l):{},h={};v(h,t,e.i);var d=t._meta||{};c=a.texttemplateString(c,f,l._d3locale,h,e,d)}var m=e.tp||t.textposition,g=E(e,t),y=i?i(e):e.tc||t.textfont.color;o.call(b.font,e.tf||t.textfont.family,g,y).text(c).call(p.convertToTspans,r).call(M,m,g,e.mrc)}else o.remove()}))}},b.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=b.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=E(e,t);c.fill(a,i);var u=l.traceIs(t,"bar-like");M(a,o,s,e.mrc2||e.mrc,u)}))}},b.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r<e.length-1;r++)a.push(C(e[r-1],e[r],e[r+1],t));for(n+="Q"+a[0][0]+" "+e[1],r=2;r<e.length-1;r++)n+="C"+a[r-2][1]+" "+a[r-1][0]+" "+e[r];return n+"Q"+a[e.length-3][1]+" "+e[e.length-1]},b.smoothclosed=function(e,t){if(e.length<3)return"M"+e.join("L")+"Z";var r,n="M"+e[0],a=e.length-1,i=[C(e[a],e[0],e[1],t)];for(r=1;r<a;r++)i.push(C(e[r-1],e[r],e[r+1],t));for(i.push(C(e[a-1],e[a],e[0],t)),r=1;r<=a;r++)n+="C"+i[r-1][1]+" "+i[r][0]+" "+e[r];return n+"C"+i[a][1]+" "+i[0][0]+" "+e[0]+"Z"};var N={hv:function(e,t){return"H"+n.round(t[0],2)+"V"+n.round(t[1],2)},vh:function(e,t){return"V"+n.round(t[1],2)+"H"+n.round(t[0],2)},hvh:function(e,t){return"H"+n.round((e[0]+t[0])/2,2)+"V"+n.round(t[1],2)+"H"+n.round(t[0],2)},vhv:function(e,t){return"V"+n.round((e[1]+t[1])/2,2)+"H"+n.round(t[0],2)+"V"+n.round(t[1],2)}},O=function(e,t){return"L"+n.round(t[0],2)+","+n.round(t[1],2)};b.steps=function(e){var t=N[e]||O;return function(e){for(var r="M"+n.round(e[0][0],2)+","+n.round(e[0][1],2),a=1;a<e.length;a++)r+=t(e[a-1],e[a]);return r}},b.makeTester=function(){var e=a.ensureSingleById(n.select("body"),"svg","js-plotly-tester",(function(e){e.attr(h.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})})),t=a.ensureSingle(e,"path","js-reference-point",(function(e){e.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})}));b.tester=e,b.testref=t},b.savedBBoxes={};var I=0;function P(e){var t=e.getAttribute("data-unformatted");if(null!==t)return t+e.getAttribute("data-math")+e.getAttribute("text-anchor")+e.getAttribute("style")}function R(e,t){if(!e)return null;var r=t._context,n=r._exportedPlot?"":r._baseUrl||"";return n?"url('"+n+"#"+e+"')":"url(#"+e+")"}b.bBox=function(e,t,r){var i,o,s;if(r||(r=P(e)),r){if(i=b.savedBBoxes[r])return a.extendFlat({},i)}else if(1===e.childNodes.length){var l=e.childNodes[0];if(r=P(l)){var c=+l.getAttribute("x")||0,u=+l.getAttribute("y")||0,f=l.getAttribute("transform");if(!f){var h=b.bBox(l,!1,r);return c&&(h.left+=c,h.right+=c),u&&(h.top+=u,h.bottom+=u),h}if(r+="~"+c+"~"+u+"~"+f,i=b.savedBBoxes[r])return a.extendFlat({},i)}}t?o=e:(s=b.tester.node(),o=e.cloneNode(!0),s.appendChild(o)),n.select(o).attr("transform",null).call(p.positionText,0,0);var d=o.getBoundingClientRect(),m=b.testref.node().getBoundingClientRect();t||s.removeChild(o);var g={height:d.height,width:d.width,left:d.left-m.left,top:d.top-m.top,right:d.right-m.left,bottom:d.bottom-m.top};return I>=1e4&&(b.savedBBoxes={},I=0),r&&(b.savedBBoxes[r]=g),I++,a.extendFlat({},g)},b.setClipUrl=function(e,t,r){e.attr("clip-path",R(t,r))},b.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},b.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(t,r)).trim(),e[a]("transform",i),i},b.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},b.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var L=/\s*sc.*/;b.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(L,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var F=/translate\([^)]*\)\s*$/;b.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(F);e=1===t&&1===r?[]:[f(o,s),"scale("+t+","+r+")",f(-o,-s)],l&&e.push(l),a.attr("transform",e.join(""))}}))}},{"../../components/fx/helpers":402,"../../constants/alignment":471,"../../constants/interactions":478,"../../constants/xmlns_namespaces":480,"../../lib":503,"../../lib/svg_text_utils":529,"../../registry":638,"../../traces/scatter/make_bubble_size_func":943,"../../traces/scatter/subtypes":951,"../color":366,"../colorscale":378,"./symbol_defs":389,"@plotly/d3":58,"fast-isnumeric":190,tinycolor2:312}],389:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),s=n.round(-t,2),l=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+l+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-down":{n:46,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-left":{n:47,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L-"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L-"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":58}],390:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],391:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),s=e("./compute_error");function l(e,t,r,a){var l=t["error_"+a]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=s(l),f=0;f<e.length;f++){var p=e[f],h=p.i;if(void 0===h)h=f;else if(null===h)continue;var d=p[a];if(n(r.c2l(d))){var m=u(d,h);if(n(m[0])&&n(m[1])){var g=p[a+"s"]=d-m[0],y=p[a+"h"]=d+m[1];c.push(g,y)}}}var v=r._id,b=t._extremes[v],x=i.findExtremes(r,c,o.extendFlat({tozero:b.opts.tozero},{padded:!0}));b.min=b.min.concat(x.min),b.max=b.max.concat(x.max)}}t.exports=function(e){for(var t=e.calcdata,r=0;r<t.length;r++){var n=t[r],o=n[0].trace;if(!0===o.visible&&a.traceIs(o,"errorBarsOK")){var s=i.getFromId(e,o.xaxis),c=i.getFromId(e,o.yaxis);l(n,o,s,"x"),l(n,o,c,"y")}}}},{"../../lib":503,"../../plots/cartesian/axes":554,"../../registry":638,"./compute_error":392,"fast-isnumeric":190}],392:[function(e,t,r){"use strict";function n(e,t){return"percent"===e?function(e){return Math.abs(e*t/100)}:"constant"===e?function(){return Math.abs(t)}:"sqrt"===e?function(e){return Math.sqrt(Math.abs(e))}:void 0}t.exports=function(e){var t=e.type,r=e.symmetric;if("data"===t){var a=e.array||[];if(r)return function(e,t){var r=+a[t];return[r,r]};var i=e.arrayminus||[];return function(e,t){var r=+a[t],n=+i[t];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=n(t,e.value),s=n(t,e.valueminus);return r||void 0===e.valueminus?function(e){var t=o(e);return[t,t]}:function(e){return[s(e),o(e)]}}},{}],393:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../lib"),o=e("../../plot_api/plot_template"),s=e("./attributes");t.exports=function(e,t,r,l){var c="error_"+l.axis,u=o.newContainer(t,c),f=e[c]||{};function p(e,t){return i.coerce(f,u,s,e,t)}if(!1!==p("visible",void 0!==f.array||void 0!==f.value||"sqrt"===f.type)){var h=p("type","array"in f?"data":"percent"),d=!0;"sqrt"!==h&&(d=p("symmetric",!(("data"===h?"arrayminus":"valueminus")in f))),"data"===h?(p("array"),p("traceref"),d||(p("arrayminus"),p("tracerefminus"))):"percent"!==h&&"constant"!==h||(p("value"),d||p("valueminus"));var m="copy_"+l.inherit+"style";l.inherit&&(t["error_"+l.inherit]||{}).visible&&p(m,!(f.color||n(f.thickness)||n(f.width))),l.inherit&&u[m]||(p("color",r),p("thickness"),p("width",a.traceIs(t,"gl3d")?0:4))}}},{"../../lib":503,"../../plot_api/plot_template":543,"../../registry":638,"./attributes":390,"fast-isnumeric":190}],394:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/edit_types").overrideAll,i=e("./attributes"),o={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i)};delete o.error_x.copy_zstyle,delete o.error_y.copy_zstyle,delete o.error_y.copy_ystyle;var s={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i),error_z:n.extendFlat({},i)};delete s.error_x.copy_ystyle,delete s.error_y.copy_ystyle,delete s.error_z.copy_ystyle,delete s.error_z.copy_zstyle,t.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:a(s,"calc","nested"),scattergl:a(o,"calc","nested")}},supplyDefaults:e("./defaults"),calc:e("./calc"),makeComputeError:e("./compute_error"),plot:e("./plot"),style:e("./style"),hoverInfo:function(e,t,r){(t.error_y||{}).visible&&(r.yerr=e.yh-e.y,t.error_y.symmetric||(r.yerrneg=e.y-e.ys)),(t.error_x||{}).visible&&(r.xerr=e.xh-e.x,t.error_x.symmetric||(r.xerrneg=e.x-e.xs))}}},{"../../lib":503,"../../plot_api/edit_types":536,"./attributes":390,"./calc":391,"./compute_error":392,"./defaults":393,"./plot":395,"./style":396}],395:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../drawing"),o=e("../../traces/scatter/subtypes");t.exports=function(e,t,r,s){var l=r.xaxis,c=r.yaxis,u=s&&s.duration>0;t.each((function(t){var f,p=t[0].trace,h=p.error_x||{},d=p.error_y||{};p.ids&&(f=function(e){return e.id});var m=o.hasMarkers(p)&&p.marker.maxdisplayed>0;d.visible||h.visible||(t=[]);var g=n.select(this).selectAll("g.errorbar").data(t,f);if(g.exit().remove(),t.length){h.visible||g.selectAll("path.xerror").remove(),d.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var y=g.enter().append("g").classed("errorbar",!0);u&&y.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(g,r.layerClipId,e),g.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};return void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0))),void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0))),n}(e,l,c);if(!m||e.vis){var i,o=t.select("path.yerror");if(d.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=d.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),o.size()?u&&(o=o.transition().duration(s.duration).ease(s.easing)):o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0),o.attr("d",i)}else o.remove();var p=t.select("path.xerror");if(h.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var g=(h.copy_ystyle?d:h).width;i="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(i+="m0,-"+g+"v"+2*g),p.size()?u&&(p=p.transition().duration(s.duration).ease(s.easing)):p=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0),p.attr("d",i)}else p.remove()}}))}}))}},{"../../traces/scatter/subtypes":951,"../drawing":388,"@plotly/d3":58,"fast-isnumeric":190}],396:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":366,"@plotly/d3":58}],397:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":493,"../../plots/font_attributes":585,"./layout_attributes":407}],398:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var s=0;s<t.length;s++){var l=t[s],c=l[0].trace;if(!a.traceIs(c,"pie-like")){var u=a.traceIs(c,"2dMap")?i:n.fillArray;u(c.hoverinfo,l,"hi",o(c)),c.hovertemplate&&u(c.hovertemplate,l,"ht"),c.hoverlabel&&(u(c.hoverlabel.bgcolor,l,"hbg"),u(c.hoverlabel.bordercolor,l,"hbc"),u(c.hoverlabel.font.size,l,"hts"),u(c.hoverlabel.font.color,l,"htc"),u(c.hoverlabel.font.family,l,"htf"),u(c.hoverlabel.namelength,l,"hnl"),u(c.hoverlabel.align,l,"hta"))}}}},{"../../lib":503,"../../registry":638}],399:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./hover").hover;t.exports=function(e,t,r){var i=n.getComponentMethod("annotations","onClick")(e,e._hoverdata);function o(){e.emit("plotly_click",{points:e._hoverdata,event:t})}void 0!==r&&a(e,t,r,!0),e._hoverdata&&t&&t.target&&(i&&i.then?i.then(o):o(),t.stopImmediatePropagation&&t.stopImmediatePropagation())}},{"../../registry":638,"./hover":403}],400:[function(e,t,r){"use strict";t.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],401:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("./hoverlabel_defaults");t.exports=function(e,t,r,o){var s=n.extendFlat({},o.hoverlabel);t.hovertemplate&&(s.namelength=-1),i(e,t,(function(r,i){return n.coerce(e,t,a,r,i)}),s)}},{"../../lib":503,"./attributes":397,"./hoverlabel_defaults":404}],402:[function(e,t,r){"use strict";var n=e("../../lib");r.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},r.isTraceInSubplots=function(e,t){if("splom"===e.type){for(var n=e.xaxes||[],a=e.yaxes||[],i=0;i<n.length;i++)for(var o=0;o<a.length;o++)if(-1!==t.indexOf(n[i]+a[o]))return!0;return!1}return-1!==t.indexOf(r.getSubplot(e))},r.flat=function(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=t;return r},r.p2c=function(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=e[n].p2c(t);return r},r.getDistanceFunction=function(e,t,n,a){return"closest"===e?a||r.quadrature(t,n):"x"===e.charAt(0)?t:n},r.getClosest=function(e,t,r){if(!1!==r.index)r.index>=0&&r.index<e.length?r.distance=0:r.index=!1;else for(var n=0;n<e.length;n++){var a=t(e[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(e,t,r){return e*t<0||0===e?r:1/0},r.quadrature=function(e,t){return function(r){var n=e(r),a=t(r);return Math.sqrt(n*n+a*a)}},r.makeEventData=function(e,t,n){var a="index"in e?e.index:e.pointNumber,i={data:t._input,fullData:t,curveNumber:t.index,pointNumber:a};if(t._indexToPoints){var o=t._indexToPoints[a];1===o.length?i.pointIndex=o[0]:i.pointIndices=o}else i.pointIndex=a;return t._module.eventData?i=t._module.eventData(i,e,t,n,a):("xVal"in e?i.x=e.xVal:"x"in e&&(i.x=e.x),"yVal"in e?i.y=e.yVal:"y"in e&&(i.y=e.y),e.xa&&(i.xaxis=e.xa),e.ya&&(i.yaxis=e.ya),void 0!==e.zLabelVal&&(i.z=e.zLabelVal)),r.appendArrayPointValue(i,t,a),i},r.appendArrayPointValue=function(e,t,r){var a=t._arrayAttrs;if(a)for(var s=0;s<a.length;s++){var l=a[s],c=i(l);if(void 0===e[c]){var u=o(n.nestedProperty(t,l).get(),r);void 0!==u&&(e[c]=u)}}},r.appendArrayMultiPointValues=function(e,t,r){var a=t._arrayAttrs;if(a)for(var s=0;s<a.length;s++){var l=a[s],c=i(l);if(void 0===e[c]){for(var u=n.nestedProperty(t,l).get(),f=new Array(r.length),p=0;p<r.length;p++)f[p]=o(u,r[p]);e[c]=f}}};var a={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function i(e){return a[e]||e}function o(e,t){return Array.isArray(t)?Array.isArray(e)&&Array.isArray(e[t[0]])?e[t[0]][t[1]]:void 0:e[t]}var s={x:!0,y:!0},l={"x unified":!0,"y unified":!0};r.isUnifiedHover=function(e){return"string"==typeof e&&!!l[e]},r.isXYhover=function(e){return"string"==typeof e&&!!s[e]}},{"../../lib":503}],403:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../lib"),s=o.strTranslate,l=o.strRotate,c=e("../../lib/events"),u=e("../../lib/svg_text_utils"),f=e("../../lib/override_cursor"),p=e("../drawing"),h=e("../color"),d=e("../dragelement"),m=e("../../plots/cartesian/axes"),g=e("../../registry"),y=e("./helpers"),v=e("./constants"),b=e("../legend/defaults"),x=e("../legend/draw"),_=v.YANGLE,w=Math.PI*_/180,k=1/Math.sin(w),D=Math.cos(w),T=Math.sin(w),A=v.HOVERARROWSIZE,S=v.HOVERTEXTPAD,M={box:!0,ohlc:!0,violin:!0,candlestick:!0},E={scatter:!0,scattergl:!0,splom:!0};function C(e){return[e.trace.index,e.index,e.x0,e.y0,e.name,e.attr,e.xa?e.xa._id:"",e.ya?e.ya._id:""].join(",")}r.hover=function(e,t,r,i){e=o.getGraphDiv(e);var s=t.target;o.throttle(e._fullLayout._uid+v.HOVERID,v.HOVERMINTIME,(function(){!function(e,t,r,i,s){r||(r="xy");var l=Array.isArray(r)?r:[r],u=e._fullLayout,p=u._plots||[],m=p[r],v=u._has("cartesian");if(m){var b=m.overlays.map((function(e){return e.id}));l=l.concat(b)}for(var x=l.length,_=new Array(x),w=new Array(x),D=!1,T=0;T<x;T++){var A=l[T];if(p[A])D=!0,_[T]=p[A].xaxis,w[T]=p[A].yaxis;else{if(!u[A]||!u[A]._subplot)return void o.warn("Unrecognized subplot: "+A);var S=u[A]._subplot;_[T]=S.xaxis,w[T]=S.yaxis}}var N=t.hovermode||u.hovermode;if(N&&!D&&(N="closest"),-1===["x","y","closest","x unified","y unified"].indexOf(N)||!e.calcdata||e.querySelector(".zoombox")||e._dragging)return d.unhoverRaw(e,t);var I=u.hoverdistance;-1===I&&(I=1/0);var B=u.spikedistance;-1===B&&(B=1/0);var $,V,q,W,H,G,X,Y,Z,K,J,Q,ee,te=[],re=[],ne={hLinePoint:null,vLinePoint:null},ae=!1;if(Array.isArray(t))for(N="array",q=0;q<t.length;q++)(H=e.calcdata[t[q].curveNumber||0])&&(G=H[0].trace,"skip"!==H[0].trace.hoverinfo&&(re.push(H),"h"===G.orientation&&(ae=!0)));else{for(W=0;W<e.calcdata.length;W++)H=e.calcdata[W],"skip"!==(G=H[0].trace).hoverinfo&&y.isTraceInSubplots(G,l)&&(re.push(H),"h"===G.orientation&&(ae=!0));var ie,oe;if(s){if(!1===c.triggerHandler(e,"plotly_beforehover",t))return;var se=s.getBoundingClientRect();ie=t.clientX-se.left,oe=t.clientY-se.top,u._calcInverseTransform(e);var le=o.apply3DTransform(u._invTransform)(ie,oe);if(ie=le[0],oe=le[1],ie<0||ie>_[0]._length||oe<0||oe>w[0]._length)return d.unhoverRaw(e,t)}else ie="xpx"in t?t.xpx:_[0]._length/2,oe="ypx"in t?t.ypx:w[0]._length/2;if(t.pointerX=ie+_[0]._offset,t.pointerY=oe+w[0]._offset,$="xval"in t?y.flat(l,t.xval):y.p2c(_,ie),V="yval"in t?y.flat(l,t.yval):y.p2c(w,oe),!a($[0])||!a(V[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(W=0;W<re.length;W++)if((H=re[W])&&H[0]&&H[0].trace&&!0===(G=H[0].trace).visible&&0!==G._length&&-1===["carpet","contourcarpet"].indexOf(G._module.name)){if("splom"===G.type?X=l[Y=0]:(X=y.getSubplot(G),Y=l.indexOf(X)),Z=N,y.isUnifiedHover(Z)&&(Z=Z.charAt(0)),Q={cd:H,trace:G,xa:_[Y],ya:w[Y],maxHoverDistance:I,maxSpikeDistance:B,index:!1,distance:Math.min(ce,I),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:h.defaultLine,name:G.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},u[X]&&(Q.subplot=u[X]._subplot),u._splomScenes&&u._splomScenes[G.uid]&&(Q.scene=u._splomScenes[G.uid]),ee=te.length,"array"===Z){var n=t[W];"pointNumber"in n?(Q.index=n.pointNumber,Z="closest"):(Z="","xval"in n&&(K=n.xval,Z="x"),"yval"in n&&(J=n.yval,Z=Z?"closest":"y"))}else void 0!==e&&void 0!==r?(K=e,J=r):(K=$[Y],J=V[Y]);if(0!==I)if(G._module&&G._module.hoverPoints){var i=G._module.hoverPoints(Q,K,J,Z,{finiteRange:!0,hoverLayer:u._hoverlayer});if(i)for(var s,c=0;c<i.length;c++)s=i[c],a(s.x0)&&a(s.y0)&&te.push(R(s,N))}else o.log("Unrecognized trace type in hover:",G);if("closest"===N&&te.length>ee&&(te.splice(0,ee),ce=te[0].distance),v&&0!==B&&0===te.length){Q.distance=B,Q.index=!1;var f=G._module.hoverPoints(Q,K,J,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=B}))),f&&f.length){var p,d=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(d.length){var m=d[0];a(m.x0)&&a(m.y0)&&(p=pe(m),(!ne.vLinePoint||ne.vLinePoint.spikeDistance>p.spikeDistance)&&(ne.vLinePoint=p))}var g=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(g.length){var b=g[0];a(b.x0)&&a(b.y0)&&(p=pe(b),(!ne.hLinePoint||ne.hLinePoint.spikeDistance>p.spikeDistance)&&(ne.hLinePoint=p))}}}}}function fe(e,t,r){for(var n,a=null,i=1/0,o=0;o<e.length;o++)n=e[o].spikeDistance,r&&0===o&&(n=-1/0),n<=i&&n<=t&&(a=e[o],i=n);return a}function pe(e){return e?{xa:e.xa,ya:e.ya,x:void 0!==e.xSpike?e.xSpike:(e.x0+e.x1)/2,y:void 0!==e.ySpike?e.ySpike:(e.y0+e.y1)/2,distance:e.distance,spikeDistance:e.spikeDistance,curveNumber:e.trace.index,color:e.color,pointNumber:e.index}:null}ue();var he={fullLayout:u,container:u._hoverlayer,event:t},de=e._spikepoints,me={vLinePoint:ne.vLinePoint,hLinePoint:ne.hLinePoint};e._spikepoints=me;var ge=function(){te.sort((function(e,t){return e.distance-t.distance})),te=function(e,t){for(var r=t.charAt(0),n=[],a=[],i=[],o=0;o<e.length;o++){var s=e[o];g.traceIs(s.trace,"bar-like")||g.traceIs(s.trace,"box-violin")?i.push(s):s.trace[r+"period"]?a.push(s):n.push(s)}return n.concat(a).concat(i)}(te,N)};ge();var ye=N.charAt(0),ve=("x"===ye||"y"===ye)&&te[0]&&E[te[0].trace.type];if(v&&0!==B&&0!==te.length){var be=fe(te.filter((function(e){return e.ya.showspikes})),B,ve);ne.hLinePoint=pe(be);var xe=fe(te.filter((function(e){return e.xa.showspikes})),B,ve);ne.vLinePoint=pe(xe)}if(0===te.length){var _e=d.unhoverRaw(e,t);return!v||null===ne.hLinePoint&&null===ne.vLinePoint||F(de)&&L(e,ne,he),_e}if(v&&F(de)&&L(e,ne,he),y.isXYhover(Z)&&0!==te[0].length&&"splom"!==te[0].trace.type){var we=te[0],ke=(te=M[we.trace.type]?te.filter((function(e){return e.trace.index===we.trace.index})):[we]).length;ue(z("x",we,u),z("y",we,u));var De,Te=[],Ae={},Se=0,Me=function(e){var t=M[e.trace.type]?C(e):e.trace.index;if(Ae[t]){var r=Ae[t]-1,n=Te[r];r>0&&Math.abs(e.distance)<Math.abs(n.distance)&&(Te[r]=e)}else Se++,Ae[t]=Se,Te.push(e)};for(De=0;De<ke;De++)Me(te[De]);for(De=te.length-1;De>ke-1;De--)Me(te[De]);te=Te,ge()}var Ee=e._hoverdata,Ce=[],Ne=j(e),Oe=U(e);for(q=0;q<te.length;q++){var Ie=te[q],Pe=y.makeEventData(Ie,Ie.trace,Ie.cd);if(!1!==Ie.hovertemplate){var Re=!1;Ie.cd[Ie.index]&&Ie.cd[Ie.index].ht&&(Re=Ie.cd[Ie.index].ht),Ie.hovertemplate=Re||Ie.trace.hovertemplate||!1}if(Ie.xa&&Ie.ya){var Le=Ie.x0+Ie.xa._offset,Fe=Ie.x1+Ie.xa._offset,Be=Ie.y0+Ie.ya._offset,ze=Ie.y1+Ie.ya._offset,je=Math.min(Le,Fe),Ue=Math.max(Le,Fe),$e=Math.min(Be,ze),Ve=Math.max(Be,ze);Pe.bbox={x0:je+Oe,x1:Ue+Oe,y0:$e+Ne,y1:Ve+Ne}}Ie.eventData=[Pe],Ce.push(Pe)}e._hoverdata=Ce;var qe="y"===N&&(re.length>1||te.length>1)||"closest"===N&&ae&&te.length>1,We=h.combine(u.plot_bgcolor||h.background,u.paper_bgcolor),He=O(te,{gd:e,hovermode:N,rotateLabels:qe,bgColor:We,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});if(y.isUnifiedHover(N)||(function(e,t,r){var n,a,i,o,s,l,c,u=0,f=1,p=e.size(),h=new Array(p),d=0;function m(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(s=e.length-1;s>=0;s--)e[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=e.length-1;s>=0;s--)e[s].dp-=i;n=!1}if(n){var c=0;for(o=0;o<e.length;o++)(l=e[o]).pos+l.dp+l.size>t.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(l=e[o]).pos>t.pmax-1&&(l.del=!0,c--);for(o=0;o<e.length&&!(c<=0);o++)if((l=e[o]).pos<t.pmin+1)for(l.del=!0,c--,i=2*l.size,s=e.length-1;s>=0;s--)e[s].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(l=e[o]).pos+l.dp+l.size>t.pmax&&(l.del=!0,c--)}}}for(e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===d&&i&&i[0]>i[1]!==a&&(f=-1),h[d++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?k:1)/2,pmin:0,pmax:a?r.width:r.height}]})),h.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));!n&&u<=p;){for(u++,n=!0,o=0;o<h.length-1;){var g=h[o],y=h[o+1],v=g[g.length-1],b=y[0];if((a=v.pos+v.dp+v.size-b.pos-b.dp+b.size)>.01&&v.pmin===b.pmin&&v.pmax===b.pmax){for(s=y.length-1;s>=0;s--)y[s].dp+=a;for(g.push.apply(g,y),h.splice(o+1,1),c=0,s=g.length-1;s>=0;s--)c+=g[s].dp;for(i=c/g.length,s=g.length-1;s>=0;s--)g[s].dp-=i;n=!1}else o++}h.forEach(m)}for(o=h.length-1;o>=0;o--){var x=h[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(He,qe?"xa":"ya",u),P(He,qe,u._invScaleX,u._invScaleY)),s&&s.tagName){var Ge=g.getComponentMethod("annotations","hasClickToShow")(e,Ce);f(n.select(s),Ge?"pointer":"")}s&&!i&&function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Ee)&&(Ee&&e.emit("plotly_unhover",{event:t,points:Ee}),e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:_,yaxes:w,xvals:$,yvals:V}))}(e,t,r,i,s)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=j(a),o=U(a),s=O(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,s=e._y0||e.y0||e.y||0,l=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),p=Math.min(s,l),d=Math.max(s,l),m=e.trace;if(g.traceIs(m,"gl3d")){var y=a._fullLayout[m.scene]._scene.container,v=y.offsetLeft,b=y.offsetTop;u+=v,f+=v,p+=b,d+=b}c.bbox={x0:u+o,x1:f+o,y0:p+i,y1:d+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||h.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||h.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),l=0,c=0;return s.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5<l?l-n+5:0,l=n+e.by+e.offset,r===t.anchorIndex&&(c=e.offset)})).each((function(e){e.offset-=c})),P(s,!1,a._fullLayout._invScaleX,a._fullLayout._invScaleY),r?s:s.node()};var N=/<extra>([\s\S]*)<\/extra>/;function O(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,d=t.container,m=t.outerContainer,w=t.commonLabelOpts||{};if(0===e.length)return[[]];var k=t.fontFamily||v.HOVERFONT,D=t.fontSize||v.HOVERFONTSIZE,T=e[0],M=T.xa,E=T.ya,N=i.charAt(0),O=T[N+"Label"],P=$(r,m),R=P.top,L=P.width,F=P.height,B=void 0!==O&&T.distance<=t.hoverdistance&&("x"===i||"y"===i);if(B){var z,j,U=!0;for(z=0;z<e.length;z++)if(U&&void 0===e[z].zLabel&&(U=!1),j=e[z].hoverinfo||e[z].trace.hoverinfo){var V=Array.isArray(j)?j:j.split("+");if(-1===V.indexOf("all")&&-1===V.indexOf(i)){B=!1;break}}U&&(B=!1)}var q=d.selectAll("g.axistext").data(B?[0]:[]);if(q.enter().append("g").classed("axistext",!0),q.exit().remove(),q.each((function(){var e=n.select(this),t=o.ensureSingle(e,"path","",(function(e){e.style({"stroke-width":"1px"})})),l=o.ensureSingle(e,"text","",(function(e){e.attr("data-notex",1)})),c=w.bgcolor||h.defaultLine,f=w.bordercolor||h.contrast(c),d=h.contrast(c),m={family:w.font.family||k,size:w.font.size||D,color:w.font.color||d};t.style({fill:c,stroke:f}),l.text(O).call(p.font,m).call(u.positionText,0,0).call(u.convertToTspans,r),e.attr("transform","");var g,y,v=$(r,l.node());if("x"===i){var b="top"===M.side?"-":"";l.attr("text-anchor","middle").call(u.positionText,0,"top"===M.side?R-v.bottom-A-S:R-v.top+A+S),g=M._offset+(T.x0+T.x1)/2,y=E._offset+("top"===M.side?0:E._length);var x=v.width/2+S;g<x?(g=x,t.attr("d","M-"+(x-A)+",0L-"+(x-2*A)+","+b+A+"H"+(S+v.width/2)+"v"+b+(2*S+v.height)+"H-"+x+"V"+b+A+"Z")):g>a.width-x?(g=a.width-x,t.attr("d","M"+(x-A)+",0L"+x+","+b+A+"v"+b+(2*S+v.height)+"H-"+x+"V"+b+A+"H"+(x-2*A)+"Z")):t.attr("d","M0,0L"+A+","+b+A+"H"+(S+v.width/2)+"v"+b+(2*S+v.height)+"H-"+(S+v.width/2)+"V"+b+A+"H-"+A+"Z")}else{var _,C,N;"right"===E.side?(_="start",C=1,N="",g=M._offset+M._length):(_="end",C=-1,N="-",g=M._offset),y=E._offset+(T.y0+T.y1)/2,l.attr("text-anchor",_),t.attr("d","M0,0L"+N+A+","+A+"V"+(S+v.height/2)+"h"+N+(2*S+v.width)+"V-"+(S+v.height/2)+"H"+N+A+"V-"+A+"Z");var I,P=v.height/2,L=R-v.top-P,F="clip"+a._uid+"commonlabel"+E._id;if(g<v.width+2*S+A){I="M-"+(A+S)+"-"+P+"h-"+(v.width-S)+"V"+P+"h"+(v.width-S)+"Z";var B=v.width-g+S;u.positionText(l,B,L),"end"===_&&l.selectAll("tspan").each((function(){var e=n.select(this),t=p.tester.append("text").text(e.text()).call(p.font,m),a=$(r,t.node());Math.round(a.width)<Math.round(v.width)&&e.attr("x",B-a.width),t.remove()}))}else u.positionText(l,C*(S+A),L),I=null;var z=a._topclips.selectAll("#"+F).data(I?[0]:[]);z.enter().append("clipPath").attr("id",F).append("path"),z.exit().remove(),z.select("path").attr("d",I),p.setClipUrl(l,I?F:null,r)}e.attr("transform",s(g,y))})),y.isUnifiedHover(i)){d.selectAll("g.hovertext").remove();var W=e.filter((function(e){return"none"!==e.hoverinfo}));if(0===W.length)return;var H=a.hoverlabel,G=H.font,X={showlegend:!0,legend:{title:{text:O,font:G},font:G,bgcolor:H.bgcolor,bordercolor:H.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:"v"}},Y={font:G};b(X,Y,r._fullData);var Z=Y.legend;Z.entries=[];for(var K=0;K<W.length;K++){var J=W[K];if("none"!==J.hoverinfo){var Q=I(J,!0,i,a,O),ee=Q[0],te=Q[1];J.name=te,J.text=""!==te?te+" : "+ee:ee;var re=J.cd[J.index];re&&(re.mc&&(J.mc=re.mc),re.mcc&&(J.mc=re.mcc),re.mlc&&(J.mlc=re.mlc),re.mlcc&&(J.mlc=re.mlcc),re.mlw&&(J.mlw=re.mlw),re.mrc&&(J.mrc=re.mrc),re.dir&&(J.dir=re.dir)),J._distinct=!0,Z.entries.push([J])}}Z.entries.sort((function(e,t){return e[0].trace.index-t[0].trace.index})),Z.layer=d,Z._inHover=!0,Z._groupTitleFont=H.grouptitlefont,x(r,Z);var ne,ae,ie,oe,se=d.select("g.legend"),le=$(r,se.node()),ce=le.width+2*S,ue=le.height+2*S,fe=W[0],pe=(fe.x0+fe.x1)/2,he=(fe.y0+fe.y1)/2,de=!(g.traceIs(fe.trace,"bar-like")||g.traceIs(fe.trace,"box-violin"));"y"===N?de?(ae=he-S,ne=he+S):(ae=Math.min.apply(null,W.map((function(e){return Math.min(e.y0,e.y1)}))),ne=Math.max.apply(null,W.map((function(e){return Math.max(e.y0,e.y1)})))):ae=ne=o.mean(W.map((function(e){return(e.y0+e.y1)/2})))-ue/2,"x"===N?de?(ie=pe+S,oe=pe-S):(ie=Math.max.apply(null,W.map((function(e){return Math.max(e.x0,e.x1)}))),oe=Math.min.apply(null,W.map((function(e){return Math.min(e.x0,e.x1)})))):ie=oe=o.mean(W.map((function(e){return(e.x0+e.x1)/2})))-ce/2;var me,ge,ye=M._offset,ve=E._offset;return oe+=ye-ce,ae+=ve-ue,me=(ie+=ye)+ce<L&&ie>=0?ie:oe+ce<L&&oe>=0?oe:ye+ce<L?ye:ie-pe<pe-oe+ce?L-ce:0,me+=S,ge=(ne+=ve)+ue<F&&ne>=0?ne:ae+ue<F&&ae>=0?ae:ve+ue<F?ve:ne-he<he-ae+ue?F-ue:0,ge+=S,se.attr("transform",s(me-1,ge-1)),se}var be=d.selectAll("g.hovertext").data(e,(function(e){return C(e)}));return be.enter().append("g").classed("hovertext",!0).each((function(){var e=n.select(this);e.append("rect").call(h.fill,h.addOpacity(f,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(p.font,k,D)})),be.exit().remove(),be.each((function(e){var t=n.select(this).attr("transform",""),o=e.color;Array.isArray(o)&&(o=o[e.eventData[0].pointNumber]);var d=e.bgcolor||o,m=h.combine(h.opacity(d)?d:h.defaultLine,f),g=h.combine(h.opacity(o)?o:h.defaultLine,f),y=e.borderColor||h.contrast(m),v=I(e,B,i,a,O,t),b=v[0],x=v[1],w=t.select("text.nums").call(p.font,e.fontFamily||k,e.fontSize||D,e.fontColor||y).text(b).attr("data-notex",1).call(u.positionText,0,0).call(u.convertToTspans,r),T=t.select("text.name"),M=0,E=0;if(x&&x!==b){T.call(p.font,e.fontFamily||k,e.fontSize||D,g).text(x).attr("data-notex",1).call(u.positionText,0,0).call(u.convertToTspans,r);var C=$(r,T.node());M=C.width+2*S,E=C.height+2*S}else T.remove(),t.select("rect").remove();t.select("path").style({fill:m,stroke:y});var N=e.xa._offset+(e.x0+e.x1)/2,P=e.ya._offset+(e.y0+e.y1)/2,z=Math.abs(e.x1-e.x0),j=Math.abs(e.y1-e.y0),U=$(r,w.node()),V=U.width/a._invScaleX,q=U.height/a._invScaleY;e.ty0=(R-U.top)/a._invScaleY,e.bx=V+2*S,e.by=Math.max(q+2*S,E),e.anchor="start",e.txwidth=V,e.tx2width=M,e.offset=0;var W,H,G=(V+A+S+M)*a._invScaleX;if(c)e.pos=N,W=P+j/2+G<=F,H=P-j/2-G>=0,"top"!==e.idealAlign&&W||!H?W?(P+=j/2,e.anchor="start"):e.anchor="middle":(P-=j/2,e.anchor="end");else if(e.pos=P,W=N+z/2+G<=L,H=N-z/2-G>=0,"left"!==e.idealAlign&&W||!H)if(W)N+=z/2,e.anchor="start";else{e.anchor="middle";var X=G/2,Y=N+X-L,Z=N-X;Y>0&&(N-=Y),Z<0&&(N+=-Z)}else N-=z/2,e.anchor="end";w.attr("text-anchor",e.anchor),M&&T.attr("text-anchor",e.anchor),t.attr("transform",s(N,P)+(c?l(_):""))})),be}function I(e,t,r,n,a,i){var s="",l="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),s=B(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(l+="x: "+e.xLabel+"<br>"),void 0!==e.yLabel&&(l+="y: "+e.yLabel+"<br>"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(l+=(l?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?l=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(l=e.yLabel):l=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(l+=(l?"<br>":"")+e.text),void 0!==e.extraText&&(l+=(l?"<br>":"")+e.extraText),i&&""===l&&!e.hovertemplate&&(""===s&&i.remove(),l=s);var f=e.hovertemplate||!1;if(f){var p=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(p[c+"other"]=p[c+"Val"],p[c+"otherLabel"]=p[c+"Label"]),l=(l=o.hovertemplateString(f,p,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(N,(function(t,r){return s=B(r,e.nameLength),""}))}return[l,s]}function P(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),s=e.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],f=c*(A+S),h=f+c*(e.txwidth+S),d=0,m=e.offset,g="middle"===s;g&&(f-=e.tx2width/2,h+=e.txwidth/2+S),t&&(m*=-T,d=e.offset*D),r.select("path").attr("d",g?"M-"+i(e.bx/2+e.tx2width/2)+","+o(m-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(l*A+d)+","+o(A+m)+"v"+o(e.by/2-A)+"h"+i(l*e.bx)+"v-"+o(e.by)+"H"+i(l*A+d)+"V"+o(m-A)+"Z");var y=d+f,v=m+e.ty0-e.by/2+S,b=e.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(a.attr("text-anchor","start"),y=g?-e.bx/2-e.tx2width/2+S:-e.bx-S):"right"===b&&"end"!==s&&(a.attr("text-anchor","end"),y=g?e.bx/2-e.tx2width/2-S:e.bx+S)),a.call(u.positionText,i(y),o(v)),e.tx2width&&(r.select("text.name").call(u.positionText,i(h+c*S+d),o(m+e.ty0-e.by/2+S)),r.select("rect").call(p.setRect,i(h+(c-1)*e.tx2width/2+d),o(m-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function R(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],s=e.cd[r]||{};function l(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return l(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(s,n,e,t)};function u(t,r,n){var a=c(r,n);l(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=m.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+m.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" ± "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var p=m.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+p+" / -"+m.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" ± "+p,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function L(e,t,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var d=h.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,y,v=t.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(g=c.pointerX,y=c.pointerY):(g=n._offset+v.x,y=a._offset+v.y);var b,x,_=i.readability(v.color,d)<1.5?h.contrast(d):v.color,w=a.spikemode,k=a.spikethickness,D=a.spikecolor||_,T=m.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=T,x=g),-1!==w.indexOf("across")){var A=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),S=Math.max(S,a.position)),b=l.l+A*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:y,y2:y,"stroke-width":k,stroke:D,"stroke-dasharray":p.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:y,y2:y,"stroke-width":k+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==a.side?k:-k),cy:y,r:k,fill:D}).classed("spikeline",!0)}if(f){var M,E,C=t.vLinePoint;n=C&&C.xa,a=C&&C.ya,"cursor"===n.spikesnap?(M=c.pointerX,E=c.pointerY):(M=n._offset+C.x,E=a._offset+C.y);var N,O,I=i.readability(C.color,d)<1.5?h.contrast(d):C.color,P=n.spikemode,R=n.spikethickness,L=n.spikecolor||I,F=m.getPxPosition(e,n);if(-1!==P.indexOf("toaxis")||-1!==P.indexOf("across")){if(-1!==P.indexOf("toaxis")&&(N=F,O=E),-1!==P.indexOf("across")){var B=n._counterDomainMin,z=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),z=Math.max(z,n.position)),N=l.t+(1-z)*l.h,O=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:M,x2:M,y1:N,y2:O,"stroke-width":R,stroke:L,"stroke-dasharray":p.dashStyle(n.spikedash,R)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:M,x2:M,y1:N,y2:O,"stroke-width":R+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==P.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M,cy:F-("top"!==n.side?R:-R),r:R,fill:L}).classed("spikeline",!0)}}}function F(e,t){return!t||t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint}function B(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function z(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var s=t.cd[t.index],l=s[e+"Start"];void 0===l&&(l=s[e]);var c=s[e+"End"];void 0===c&&(c=s[e]);var u=c-l;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function j(e){return e.offsetTop+e.clientTop}function U(e){return e.offsetLeft+e.clientLeft}function $(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,s=a+n.width,l=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(s,l),f=c[0],p=c[1],h=u[0],d=u[1];return{x:f,y:p,width:h-f,height:d-p,top:Math.min(p,d),left:Math.min(f,h),right:Math.max(f,h),bottom:Math.max(p,d)}}},{"../../lib":503,"../../lib/events":492,"../../lib/override_cursor":514,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"../../registry":638,"../color":366,"../dragelement":385,"../drawing":388,"../legend/defaults":418,"../legend/draw":419,"./constants":400,"./helpers":402,"@plotly/d3":58,"fast-isnumeric":190,tinycolor2:312}],404:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){o=o||{};var s=t.legend;function l(e){o.font[e]||(o.font[e]=s?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":503,"../color":366,"./helpers":402}],405:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":503,"./layout_attributes":407}],406:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),s=e("./layout_attributes"),l=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:s},attributes:e("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":503,"../dragelement":385,"./attributes":397,"./calc":398,"./click":399,"./constants":400,"./defaults":401,"./helpers":402,"./hover":403,"./layout_attributes":407,"./layout_defaults":408,"./layout_global_defaults":409,"@plotly/d3":58}],407:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes"),i=a({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:a({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":585,"./constants":400}],408:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=t._has("mapbox"),l=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(t.dragmode="pan"),o(e,t,r),n.coerceFont(r,"hoverlabel.grouptitlefont",t.hoverlabel.font)}},{"../../lib":503,"./hoverlabel_defaults":404,"./hovermode_defaults":405,"./layout_attributes":407}],409:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":503,"./hoverlabel_defaults":404,"./layout_attributes":407}],410:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,s=e("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),s=t("domain."+e);t(e+"side",n);for(var l=new Array(a),c=s[0],u=(s[1]-c)/(a-o),f=u*(1-o),p=0;p<a;p++){var h=c+u*p;l[i?a-1-p:p]=[h,h+f]}return l}function f(e,t,r,n,a){var i,o=new Array(r);function s(e,r){-1!==t.indexOf(r)&&void 0===n[r]?(o[e]=r,n[r]=e):o[e]=""}if(Array.isArray(e))for(i=0;i<r;i++)s(i,e[i]);else for(s(0,a),i=1;i<r;i++)s(i,a+(i+1));return o}t.exports={moduleType:"component",name:"grid",schema:{layout:{grid:l}},layoutAttributes:l,sizeDefaults:function(e,t){var r=e.grid||{},a=c(t,r,"x"),i=c(t,r,"y");if(e.grid||a||i){var o,f,p=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),h=Array.isArray(a),d=Array.isArray(i),m=h&&a!==r.xaxes&&d&&i!==r.yaxes;p?(o=r.subplots.length,f=r.subplots[0].length):(d&&(o=i.length),h&&(f=a.length));var g=s.newContainer(t,"grid"),y=D("rows",o),v=D("columns",f);if(y*v>1){p||h||d||"independent"===D("pattern")&&(p=!0),g._hasSubplotGrid=p;var b,x,_="top to bottom"===D("roworder"),w=p?.2:.1,k=p?.3:.1;m&&t._splomGridDflt&&(b=t._splomGridDflt.xside,x=t._splomGridDflt.yside),g._domains={x:u("x",D,w,b,v),y:u("y",D,k,x,y,_)}}else delete t.grid}function D(e,t){return n.coerce(r,g,l,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,s,l,u,p=e.grid||{},h=t._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(d){var b=p.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n<m;n++){var _=l[n]=new Array(g),w=b[n]||[];for(a=0;a<g;a++)if(y?(s=1===x?"xy":"x"+x+"y"+x,x++):s=w[a],_[a]="",-1!==h.cartesian.indexOf(s)){if(u=s.indexOf("y"),i=s.slice(0,u),o=s.slice(u),void 0!==v[i]&&v[i]!==a||void 0!==v[o]&&v[o]!==n)continue;_[a]=s,v[i]=a,v[o]=n}}}else{var k=c(t,p,"x"),D=c(t,p,"y");r.xaxes=f(k,h.xaxis,g,v,"x"),r.yaxes=f(D,h.yaxis,m,v,"y")}var T=r._anchors={},A="top to bottom"===r.roworder;for(var S in v){var M,E,C,N=S.charAt(0),O=r[N+"side"];if(O.length<8)T[S]="free";else if("x"===N){if("t"===O.charAt(0)===A?(M=0,E=1,C=m):(M=m-1,E=-1,C=-1),d){var I=v[S];for(n=M;n!==C;n+=E)if((s=l[n][I])&&(u=s.indexOf("y"),s.slice(0,u)===S)){T[S]=s.slice(u);break}}else for(n=M;n!==C;n+=E)if(o=r.yaxes[n],-1!==h.cartesian.indexOf(S+o)){T[S]=o;break}}else if("l"===O.charAt(0)?(M=0,E=1,C=g):(M=g-1,E=-1,C=-1),d){var P=v[S];for(n=M;n!==C;n+=E)if((s=l[P][n])&&(u=s.indexOf("y"),s.slice(u)===S)){T[S]=s.slice(0,u);break}}else for(n=M;n!==C;n+=E)if(i=r.xaxes[n],-1!==h.cartesian.indexOf(i+S)){T[S]=i;break}}}}}},{"../../lib":503,"../../lib/regex":520,"../../plot_api/plot_template":543,"../../plots/cartesian/constants":561,"../../plots/domain":584}],411:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/constants"),a=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects"),t.exports=a("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":472,"../../plot_api/plot_template":543,"../../plots/cartesian/constants":561}],412:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib/to_log_range");t.exports=function(e,t,r,i){t=t||{};var o="log"===r&&"linear"===t.type,s="linear"===r&&"log"===t.type;if(o||s)for(var l,c,u=e._fullLayout.images,f=t._id.charAt(0),p=0;p<u.length;p++)if(c="images["+p+"].",(l=u[p])[f+"ref"]===t._id){var h=l[f],d=l["size"+f],m=null,g=null;if(o){m=a(h,t.range);var y=d/Math.pow(10,m)/2;g=2*Math.log(y+Math.sqrt(1+y*y))/Math.LN10}else g=(m=Math.pow(10,h))*(Math.pow(10,d/2)-Math.pow(10,-d/2));n(m)?n(g)||(g=null):(m=null,g=null),i(c+f,m),i(c+"size"+f,g)}}},{"../../lib/to_log_range":531,"fast-isnumeric":190}],413:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("./attributes");function s(e,t,r){function i(r,a){return n.coerce(e,t,o,r,a)}var s=i("source");if(!i("visible",!!s))return t;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var l={_fullLayout:r},c=["x","y"],u=0;u<2;u++){var f=c[u],p=a.coerceRef(e,t,l,f,"paper",void 0);"paper"!==p&&a.getFromId(l,p)._imgIndices.push(t._index),a.coercePosition(t,l,i,p,f,0)}return t}t.exports=function(e,t){i(e,t,{name:"images",handleItemDefaults:s})}},{"../../lib":503,"../../plots/array_container_defaults":549,"../../plots/cartesian/axes":554,"./attributes":411}],414:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../drawing"),i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/axis_ids"),s=e("../../constants/xmlns_namespaces");t.exports=function(e){var t,r,l=e._fullLayout,c=[],u={},f=[];for(r=0;r<l.images.length;r++){var p=l.images[r];if(p.visible)if("below"===p.layer&&"paper"!==p.xref&&"paper"!==p.yref){t=o.ref2id(p.xref)+o.ref2id(p.yref);var h=l._plots[t];if(!h){f.push(p);continue}h.mainplot&&(t=h.mainplot.id),u[t]||(u[t]=[]),u[t].push(p)}else"above"===p.layer?c.push(p):f.push(p)}var d={left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},m={top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}};function g(t){var r=n.select(this);if(this._imgSrc!==t.source)if(r.attr("xmlns",s.svg),t.source&&"data:"===t.source.slice(0,5))r.attr("xlink:href",t.source),this._imgSrc=t.source;else{var a=new Promise(function(e){var n=new Image;function a(){r.remove(),e()}this.img=n,n.setAttribute("crossOrigin","anonymous"),n.onerror=a,n.onload=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height,t.getContext("2d").drawImage(this,0,0);var n=t.toDataURL("image/png");r.attr("xlink:href",n),e()},r.on("error",a),n.src=t.source,this._imgSrc=t.source}.bind(this));e._promises.push(a)}}function y(t){var r,o,s=n.select(this),c=i.getFromId(e,t.xref),u=i.getFromId(e,t.yref),f="domain"===i.getRefType(t.xref),p="domain"===i.getRefType(t.yref),h=l._size;r=void 0!==c?"string"==typeof t.xref&&f?c._length*t.sizex:Math.abs(c.l2p(t.sizex)-c.l2p(0)):t.sizex*h.w,o=void 0!==u?"string"==typeof t.yref&&p?u._length*t.sizey:Math.abs(u.l2p(t.sizey)-u.l2p(0)):t.sizey*h.h;var g,y,v=r*d[t.xanchor].offset,b=o*m[t.yanchor].offset,x=d[t.xanchor].sizing+m[t.yanchor].sizing;switch(g=void 0!==c?"string"==typeof t.xref&&f?c._length*t.x+c._offset:c.r2p(t.x)+c._offset:t.x*h.w+h.l,g+=v,y=void 0!==u?"string"==typeof t.yref&&p?u._length*(1-t.y)+u._offset:u.r2p(t.y)+u._offset:h.h-t.y*h.h+h.t,y+=b,t.sizing){case"fill":x+=" slice";break;case"stretch":x="none"}s.attr({x:g,y,width:r,height:o,preserveAspectRatio:x,opacity:t.opacity});var _=(c&&"domain"!==i.getRefType(t.xref)?c._id:"")+(u&&"domain"!==i.getRefType(t.yref)?u._id:"");a.setClipUrl(s,_?"clip"+l._uid+_:null,e)}var v=l._imageLowerLayer.selectAll("image").data(f),b=l._imageUpperLayer.selectAll("image").data(c);v.enter().append("image"),b.enter().append("image"),v.exit().remove(),b.exit().remove(),v.each((function(e){g.bind(this)(e),y.bind(this)(e)})),b.each((function(e){g.bind(this)(e),y.bind(this)(e)}));var x=Object.keys(l._plots);for(r=0;r<x.length;r++){t=x[r];var _=l._plots[t];if(_.imagelayer){var w=_.imagelayer.selectAll("image").data(u[t]||[]);w.enter().append("image"),w.exit().remove(),w.each((function(e){g.bind(this)(e),y.bind(this)(e)}))}}}},{"../../constants/xmlns_namespaces":480,"../../plots/cartesian/axes":554,"../../plots/cartesian/axis_ids":558,"../drawing":388,"@plotly/d3":58}],415:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"images",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("images"),draw:e("./draw"),convertCoords:e("./convert_coords")}},{"../../plots/cartesian/include_components":567,"./attributes":411,"./convert_coords":412,"./defaults":413,"./draw":414}],416:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes");t.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),grouptitlefont:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",min:-2,max:3,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:n({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left"],editType:"legend"},editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":585,"../color/attributes":365}],417:[function(e,t,r){"use strict";t.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}},{}],418:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plot_api/plot_template"),o=e("../../plots/attributes"),s=e("./attributes"),l=e("../../plots/layout_attributes"),c=e("./helpers");t.exports=function(e,t,r){var u,f=e.legend||{},p=i.newContainer(t,"legend");function h(e,t){return a.coerce(f,p,s,e,t)}for(var d=function(e,t){var r=u._input,n=u;return a.coerce(r,n,o,e,t)},m=t.font||{},g=a.coerceFont(h,"grouptitlefont",a.extendFlat({},m,{size:Math.round(1.1*m.size)})),y=0,v=!1,b="normal",x=0;x<r.length;x++)(u=r[x]).visible&&((u.showlegend||u._dfltShowLegend&&!(u._module&&u._module.attributes&&u._module.attributes.showlegend&&!1===u._module.attributes.showlegend.dflt))&&(y++,u.showlegend&&(v=!0,(n.traceIs(u,"pie-like")||!0===u._input.showlegend)&&y++),a.coerceFont(d,"legendgrouptitle.font",g)),(n.traceIs(u,"bar")&&"stack"===t.barmode||-1!==["tonextx","tonexty"].indexOf(u.fill))&&(b=c.isGrouped({traceorder:b})?"grouped+reversed":"reversed"),void 0!==u.legendgroup&&""!==u.legendgroup&&(b=c.isReversed({traceorder:b})?"reversed+grouped":"grouped"));var _=a.coerce(e,t,l,"showlegend",v&&y>1);if(!1===_&&(t.legend=void 0),(!1!==_||f.uirevision)&&(h("uirevision",t.uirevision),!1!==_)){h("bgcolor",t.paper_bgcolor),h("bordercolor"),h("borderwidth");var w,k,D,T=a.coerceFont(h,"font",t.font),A="h"===h("orientation");if(A?(w=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(k=1.1,D="bottom"):(k=-.1,D="top")):(w=1.02,k=1,D="auto"),h("traceorder",b),c.isGrouped(t.legend)&&h("tracegroupgap"),h("itemsizing"),h("itemwidth"),h("itemclick"),h("itemdoubleclick"),h("groupclick"),h("x",w),h("xanchor"),h("y",k),h("yanchor",D),h("valign"),a.noneOrAll(f,p,["x","y"]),h("title.text")){h("title.side",A?"left":"top");var S=a.extendFlat({},T,{size:a.bigFont(T.size)});a.coerceFont(h,"title.font",S)}}}},{"../../lib":503,"../../plot_api/plot_template":543,"../../plots/attributes":550,"../../plots/layout_attributes":610,"../../registry":638,"./attributes":416,"./helpers":422}],419:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),s=e("../../lib/events"),l=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),p=e("./handle_click"),h=e("./constants"),d=e("../../constants/alignment"),m=d.LINE_SPACING,g=d.FROM_TL,y=d.FROM_BR,v=e("./get_legend_data"),b=e("./style"),x=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(e,"plotly_legendclick",l)&&(1===n?t._clickTimeout=setTimeout((function(){e._fullLayout&&p(r,e,n)}),e._context.doubleClickDelay):2===n&&(t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==s.triggerHandler(e,"plotly_legenddoubleclick",l)&&p(r,e,n)))}function w(e,t,r){var n,i,s=e.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),p=!r._inHover&&t._context.edits.legendText&&!u,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,i=s.groupTitle.font):(i=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=a.templateString(n,l._meta))));var m=a.ensureSingle(e,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(p?k(n,d):n);var g=r.itemwidth+2*h.itemGap;f.positionText(m,g,0),p?m.call(f.makeEditable,{gd:t,text:n}).call(T,e,t,r).on("edit",(function(n){this.text(k(n,d)).call(T,e,t,r);var i=s.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),f=u[u.length-1],p=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");p.set(s.trace._group,n),c=p.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,l.index)})):T(m,e,t,r)}function k(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function D(e,t){var r,i=t._context.doubleClickDelay,o=1,s=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTime<i?o+=1:(o=1,t._legendMouseDownTime=r)})),s.on("mouseup",(function(){if(!t._dragged&&!t._editing){var r=t._fullLayout.legend;(new Date).getTime()-t._legendMouseDownTime>i&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}})))}function T(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(r._inHover||!a||a.trace.showlegend){var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var s,l,u=r.borderwidth,p=(1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font).size*m;if(o){var d=c.bBox(o);s=d.height,l=d.width,1===n?c.setTranslate(i,u,u+.75*s):c.setTranslate(i,0,.25*s)}else{var g=e.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(g),v=g.node();if(s=p*y,l=v?c.bBox(v).width:0,1===n)"left"===r.title.side&&(l+=2*h.itemGap),f.positionText(g,u+h.titlePad,u+p);else{var b=2*h.itemGap+r.itemwidth;a.groupTitle&&(b=h.itemGap,l-=r.itemwidth),f.positionText(g,b,-p*((y-1)/2-.3))}}1===n?(r._titleWidth=l,r._titleHeight=s):(a.lineHeight=p,a.height=Math.max(s,16)+3,a.width=l)}else e.remove()}(t,r,n,a)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function S(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,s,f=e._fullLayout,p="legend"+f._uid,d=t._inHover;if(d?(r=t.layer,p+="-hover"):r=f._infolayer,r){if(e._legendMouseDownTime||(e._legendMouseDownTime=0),d){if(!t.entries)return;s=v(t.entries,t)}else{if(!e.calcdata)return;s=f.showlegend&&v(e.calcdata,t)}var m=f.hiddenlabels||[];if(!(d||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+p).remove(),i.autoMargin(e,"legend");var k=a.ensureSingle(r,"g","legend",(function(e){d||e.attr("pointer-events","all")})),M=a.ensureSingleById(f._topdefs,"clipPath",p,(function(e){e.append("rect")})),E=a.ensureSingle(k,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));E.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(k,"g","scrollbox"),N=t.title;if(t._titleWidth=0,t._titleHeight=0,N.text){var O=a.ensureSingle(C,"text","legendtitletext");O.attr("text-anchor","start").call(c.font,N.font).text(N.text),T(O,C,e,t,1)}else C.selectAll(".legendtitletext").remove();var I=a.ensureSingle(k,"rect","scrollbar",(function(e){e.attr(h.scrollBarEnterAttrs).call(u.fill,h.scrollBarColor)})),P=C.selectAll("g.groups").data(s);P.enter().append("g").attr("class","groups"),P.exit().remove();var R=P.selectAll("g.traces").data(a.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==m.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(b,e,t).each((function(){d||n.select(this).call(D,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),u=a.borderwidth,f=2*u,p=h.itemGap,d=a.itemwidth+2*p,m=2*(u+p),g=S(a),y=a.y<0||0===a.y&&"top"===g,v=a.y>1||1===a.y&&"bottom"===g,b=a.tracegroupgap;a._maxHeight=Math.max(y||v?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(e){var t=0,r=0,n=e.title.side;return n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight)),[t,r]}(a);if(s)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+w[0],u+w[1]+a._height+t/2+p),a._height+=t,a._width=Math.max(a._width,e[0].width)})),_=d+a._width,a._width+=p+d+f,a._height+=m,l&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var k=A(a),D=a.x<0||0===a.x&&"right"===k,T=a.x>1||1===a.x&&"left"===k,M=v||y,E=i.width/2;a._maxWidth=Math.max(D?M&&"left"===k?o.l+o.w:E:T?M&&"right"===k?o.r+o.w:E:o.w,2*d);var C=0,N=0;r.each((function(e){var t=e[0].width+d;C=Math.max(C,t),N+=t})),_=null;var O=0;if(l){var I=0,P=0,R=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].width,a=r[0].height;c.setTranslate(this,w[0],w[1]+u+p+a/2+t),t+=a,e=Math.max(e,d+n)})),I=Math.max(I,t);var r=e+p;P>0&&r+u+P>a._maxWidth&&(O=Math.max(O,P),P=0,R+=I+b,I=t),c.setTranslate(this,P,R),P+=r})),a._width=Math.max(O,P)+u,a._height=R+I+m}else{var L=r.size(),F=N+f+(L-1)*p<a._maxWidth,B=0,z=0,j=0,U=0;r.each((function(e){var t=e[0].height,r=d+e[0].width,n=(F?r:C)+p;n+u+z-p>=a._maxWidth&&(O=Math.max(O,U),z=0,j+=B,a._height+=B,B=0),c.setTranslate(this,w[0]+u+z,w[1]+u+j+t/2+p),U=z+r+p,z+=n,B=Math.max(B,t)})),F?(a._width=z+f,a._height=B+m):(a._width=Math.max(O,U)+f,a._height+=B+m)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(u+h.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(u+h.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var $=e._context.edits,V=$.legendText||$.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?d:_||d+e[0].width;s||(a+=p/2),c.setRect(t,0,-r/2,a,r)}))}(e,P,R,t)},function(){var s,u,m,v,b=f._size,x=t.borderwidth;if(!d){if(function(e){var t=e._fullLayout.legend,r=A(t),n=S(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*g[r],r:t._width*y[r],b:t._effHeight*y[n],t:t._effHeight*g[n]})}(e))return;var w=b.l+b.w*t.x-g[A(t)]*t._width,D=b.t+b.h*(1-t.y)-g[S(t)]*t._effHeight;if(f.margin.autoexpand){var T=w,N=D;w=a.constrain(w,0,f.width-t._width),D=a.constrain(D,0,f.height-t._effHeight),w!==T&&a.log("Constrain legend.x to make legend fit inside graph"),D!==N&&a.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(k,w,D)}if(I.on(".drag",null),k.on("wheel",null),d||t._height<=t._maxHeight||e._context.staticPlot){var O=t._effHeight;d&&(O=t._height),E.attr({width:t._width-x,height:O-x,x:x/2,y:x/2}),c.setTranslate(C,0,0),M.select("rect").attr({width:t._width-2*x,height:O-2*x,x,y:x}),c.setClipUrl(C,p,e),c.setRect(I,0,0,0,0),delete t._scrollY}else{var P,R,L,F=Math.max(h.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),B=t._effHeight-F-2*h.scrollBarMargin,z=t._height-t._effHeight,j=B/z,U=Math.min(t._scrollY||0,z);E.attr({width:t._width-2*x+h.scrollBarWidth+h.scrollBarMargin,height:t._effHeight-x,x:x/2,y:x/2}),M.select("rect").attr({width:t._width-2*x+h.scrollBarWidth+h.scrollBarMargin,height:t._effHeight-2*x,x,y:x+U}),c.setClipUrl(C,p,e),q(U,F,j),k.on("wheel",(function(){q(U=a.constrain(t._scrollY+n.event.deltaY/B*z,0,z),F,j),0!==U&&U!==z&&n.event.preventDefault()}));var $=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;P="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,L=U})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(R="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,q(U=function(e,t,r){var n=(r-t)/j+e;return a.constrain(n,0,z)}(L,P,R),F,j))}));I.call($);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(P=e.changedTouches[0].clientY,L=U)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(R=e.changedTouches[0].clientY,q(U=function(e,t,r){var n=(t-r)/j+e;return a.constrain(n,0,z)}(L,P,R),F,j))}));C.call(V)}function q(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(I,t._width,h.scrollBarMargin+r*a,h.scrollBarWidth,n),M.select("rect").attr("y",x+r)}e._context.edits.legendPosition&&(k.classed("cursor-move",!0),l.init({element:k.node(),gd:e,prepFn:function(){var e=c.getTranslate(k);m=e.x,v=e.y},moveFn:function(e,r){var n=m+e,a=v+r;c.setTranslate(k,n,a),s=l.align(n,0,b.l,b.l+b.w,t.xanchor),u=l.align(a,0,b.t+b.h,b.t,t.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":s,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,k,a,t,n)}}))}],e)}}(e,t)}},{"../../constants/alignment":471,"../../lib":503,"../../lib/events":492,"../../lib/svg_text_utils":529,"../../plots/plots":619,"../../registry":638,"../color":366,"../dragelement":385,"../drawing":388,"./constants":417,"./get_legend_data":420,"./handle_click":421,"./helpers":422,"./style":424,"@plotly/d3":58}],420:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,s=a.isGrouped(t),l=a.isReversed(t),c={},u=[],f=!1,p={},h=0,d=0;function m(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),f=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+h;u.push(n),c[n]=[r],h++}}for(r=0;r<e.length;r++){var g=e[r],y=g[0],v=y.trace,b=v.legendgroup;if(o||v.visible&&v.showlegend)if(n.traceIs(v,"pie-like"))for(p[b]||(p[b]={}),i=0;i<g.length;i++){var x=g[i].label;p[b][x]||(m(b,{label:x,color:g[i].color,i:g[i].i,trace:v,pts:g[i].pts}),p[b][x]=!0,d=Math.max(d,(x||"").length))}else m(b,y),d=Math.max(d,(v.name||"").length)}if(!u.length)return[];var _=!f||!s,w=[];for(r=0;r<u.length;r++){var k=c[u[r]];_?w.push(k[0]):w.push(k)}for(_&&(w=[w]),r=0;r<w.length;r++){var D=1/0;for(i=0;i<w[r].length;i++){var T=w[r][i].trace.legendrank;D>T&&(D=T)}w[r][0]._groupMinRank=D,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;r<w.length;r++){w[r].forEach((function(e,t){e._preSort=t})),w[r].sort(A);var S=w[r][0].trace,M=null;for(i=0;i<w[r].length;i++){var E=w[r][i].trace.legendgrouptitle;if(E&&E.text){M=E,o&&(E.font=t._groupTitleFont);break}}if(l&&w[r].reverse(),M){var C=!1;for(i=0;i<w[r].length;i++)if(n.traceIs(w[r][i].trace,"pie-like")){C=!0;break}w[r].unshift({i:-1,groupTitle:M,noClick:C,trace:{showlegend:S.showlegend,legendgroup:S.legendgroup,visible:"toggleitem"===t.groupclick||S.visible}})}for(i=0;i<w[r].length;i++)w[r][i]=[w[r][i]]}return t._lgroupsLength=w.length,t._maxNameLength=d,w}},{"../../registry":638,"./helpers":422}],421:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=!0;t.exports=function(e,t,r){var o=t._fullLayout;if(!t._dragged&&!t._editing){var s,l=o.legend.itemclick,c=o.legend.itemdoubleclick,u=o.legend.groupclick;if(1===r&&"toggle"===l&&"toggleothers"===c&&i&&t.data&&t._context.showTips?(n.notifier(n._(t,"Double-click on legend to isolate one trace"),"long"),i=!1):i=!1,1===r?s=l:2===r&&(s=c),s){var f="togglegroup"===u,p=o.hiddenlabels?o.hiddenlabels.slice():[],h=e.data()[0][0];if(!h.groupTitle||!h.noClick){var d,m,g,y,v,b=t._fullData,x=h.trace,_=x.legendgroup,w={},k=[],D=[],T=[];if(a.traceIs(x,"pie-like")){var A=h.label,S=p.indexOf(A);"toggle"===s?-1===S?p.push(A):p.splice(S,1):"toggleothers"===s&&(p=[],t.calcdata[0].forEach((function(e){A!==e.label&&p.push(e.label)})),t._fullLayout.hiddenlabels&&t._fullLayout.hiddenlabels.length===p.length&&-1===S&&(p=[])),a.call("_guiRelayout",t,"hiddenlabels",p)}else{var M,E=_&&_.length,C=[];if(E)for(d=0;d<b.length;d++)(M=b[d]).visible&&M.legendgroup===_&&C.push(d);if("toggle"===s){var N;switch(x.visible){case!0:N="legendonly";break;case!1:N=!1;break;case"legendonly":N=!0}if(E)if(f)for(d=0;d<b.length;d++)!1!==b[d].visible&&b[d].legendgroup===_&&j(b[d],N);else j(x,N);else j(x,N)}else if("toggleothers"===s){var O,I,P,R,L=!0;for(d=0;d<b.length;d++)if(O=b[d]===x,P=!0!==b[d].showlegend,!(O||P||(I=E&&b[d].legendgroup===_)||!0!==b[d].visible||a.traceIs(b[d],"notLegendIsolatable"))){L=!1;break}for(d=0;d<b.length;d++)if(!1!==b[d].visible&&!a.traceIs(b[d],"notLegendIsolatable"))switch(x.visible){case"legendonly":j(b[d],!0);break;case!0:R=!!L||"legendonly",O=b[d]===x,P=!0!==b[d].showlegend&&!b[d].legendgroup,I=O||E&&b[d].legendgroup===_,j(b[d],!(!I&&!P)||R)}}for(d=0;d<D.length;d++)if(g=D[d]){var F=g.constructUpdate(),B=Object.keys(F);for(m=0;m<B.length;m++)y=B[m],(w[y]=w[y]||[])[T[d]]=F[y]}for(v=Object.keys(w),d=0;d<v.length;d++)for(y=v[d],m=0;m<k.length;m++)w[y].hasOwnProperty(m)||(w[y][m]=void 0);a.call("_guiRestyle",t,w,k)}}}}function z(e,t,r){var n=k.indexOf(e),a=w[t];return a||(a=w[t]=[]),-1===k.indexOf(e)&&(k.push(e),n=k.length-1),a[n]=r,n}function j(e,t){if(!h.groupTitle||f){var r=e._fullInput;if(a.hasTransform(r,"groupby")){var i=D[r.index];if(!i){var o=a.getTransformIndices(r,"groupby"),s=o[o.length-1];i=n.keyedContainer(r,"transforms["+s+"].styles","target","value.visible"),D[r.index]=i}var l=i.get(e._group);void 0===l&&(l=!0),!1!==l&&i.set(e._group,t),T[r.index]=z(r.index,"visible",!1!==r.visible)}else{var c=!1!==r.visible&&t;z(r.index,"visible",c)}}}}},{"../../lib":503,"../../registry":638}],422:[function(e,t,r){"use strict";r.isGrouped=function(e){return-1!==(e.traceorder||"").indexOf("grouped")},r.isVertical=function(e){return"h"!==e.orientation},r.isReversed=function(e){return-1!==(e.traceorder||"").indexOf("reversed")}},{}],423:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"legend",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),draw:e("./draw"),style:e("./style")}},{"./attributes":416,"./defaults":418,"./draw":419,"./style":424}],424:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.strTranslate,s=e("../drawing"),l=e("../color"),c=e("../colorscale/helpers").extractOpts,u=e("../../traces/scatter/subtypes"),f=e("../../traces/pie/style_one"),p=e("../../traces/pie/helpers").castOption,h=e("./constants");function d(e,t){return(t?"radial":"horizontal")+(e?"":"reversed")}function m(e){var t=e[0].trace,r=t.contours,n=u.hasLines(t),a=u.hasMarkers(t),i=t.visible&&t.fill&&"none"!==t.fill,o=!1,s=!1;if(r){var l=r.coloring;"lines"===l?o=!0:n="none"===l||"heatmap"===l||r.showlines,"constraint"===r.type?i="="!==r._operation:"fill"!==l&&"heatmap"!==l||(s=!0)}return{showMarker:a,showLine:n,showFill:i,showGradientLine:o,showGradientFill:s,anyLine:n||o,anyFill:i||s}}function g(e,t,r){return e&&i.isArrayOrTypedArray(e)?t:e>r?r:e}t.exports=function(e,t,r){var y=t._fullLayout;r||(r=y.legend);var v="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*h.itemGap)/2,_=o(x,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return v?n:Math.min(a,r)};function k(e,i,o){var u=e[0].trace,f=u.marker||{},p=f.line||{},h=o?u.visible&&u.type===o:a.traceIs(u,"bar"),d=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(h?[e]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),d.exit().remove(),d.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var h=i.mcc;if(!r._inHover&&"mc"in i){var d=c(f),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),h=s.tryColorscale(f,"")(m)}var y=h||i.mc||f.color,v=f.pattern,b=v&&s.getPatternAttr(v.shape,0,"");if(b){var x=s.getPatternAttr(v.bgcolor,0,null),_=s.getPatternAttr(v.fgcolor,0,null),k=v.fgopacity,D=g(v.size,8,10),T=g(v.solidity,.5,1),A="legend-"+u.uid;a.call(s.pattern,"legend",t,A,b,D,T,h,v.fillmode,x,_,k)}else a.call(l.fill,y);o&&l.stroke(a,i.mlc||p.color)}))}function D(e,t,r){var o=e[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(l?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,h=w(p(u.width,o.pts),u,5,2),d=i.minExtend(s,{marker:{line:{width:h}}});d.marker.line.color=u.color;var m=i.minExtend(o,{trace:d});f(c,m,d)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var s=r.valign,l=e[0].lineHeight,c=e[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));a.attr("transform",o(0,u))}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,f=n.select(this),p=c(a),h=p.colorscale,m=p.reversescale;if(h){if(!r){var g=h.length;u=0===o?h[m?g-1:0][1]:1===o?h[m?0:g-1][1]:h[Math.floor((g-1)/2)][1]}}else{var y=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(y)?y[o]||y[0]:y}f.attr("d",e[0]),u?f.call(l.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;s.gradient(e,t,n,d(m,"radial"===r),h,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,k(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(e){k(e,this,"funnel")})).each((function(e){k(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,t)}}))})).each((function(e){D(e,this,"funnelarea")})).each((function(e){D(e,this,"pie")})).each((function(e){var r,a,o=m(e),l=o.showFill,f=o.showLine,p=o.showGradientLine,h=o.showGradientFill,g=o.anyFill,y=o.anyLine,v=e[0],x=v.trace,_=c(x),k=_.colorscale,D=_.reversescale,T=u.hasMarkers(x)||!g?"M5,0":y?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(l||h?[e]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",T+"h"+b+"v6h-"+b+"z").call(l?s.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+x.uid;s.gradient(e,t,r,d(D),k,"fill")}}),f||p){var M=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:M}}),r=[i.minExtend(v,{trace:a})]}var E=A.select(".legendlines").selectAll("path").data(f||p?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",T+(p?"l"+b+",0.0001":"h"+b)).call(f?s.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+x.uid;s.lineGroupStyle(e),s.gradient(e,t,r,d(D),k,"stroke")}})})).each((function(e){var r,a,o=m(e),l=o.anyFill,c=o.anyLine,f=o.showLine,p=o.showMarker,h=e[0],d=h.trace,g=!p&&!c&&!l&&u.hasText(d);function y(e,t,r,n){var a=i.nestedProperty(d,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function b(e){return h._distinct&&h.index&&e[h.index]?e[h.index]:e[0]}if(p||g||f){var x={},w={};if(p){x.mc=y("marker.color",b),x.mx=y("marker.symbol",b),x.mo=y("marker.opacity",i.mean,[.2,1]),x.mlc=y("marker.line.color",b),x.mlw=y("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var k=y("marker.size",i.mean,[2,16],12);x.ms=k,w.marker.size=k}f&&(w.line={width:y("line.width",b,[0,10],5)}),g&&(x.tx="Aa",x.tp=y("textposition",b),x.ts=10,x.tc=y("textfont.color",b),x.tf=y("textfont.family",b)),r=[i.minExtend(h,x)],(a=i.minExtend(d,w)).selectedpoints=null,a.texttemplate=null}var D=n.select(this).select("g.legendpoints"),T=D.selectAll("path.scatterpts").data(p?r:[]);T.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),T.exit().remove(),T.call(s.pointStyle,a,t),p&&(r[0].mrc=3);var A=D.selectAll("g.pointtext").data(g?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(s.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(s.dashLine,i.line.dash,o),o&&l.stroke(a,i.line.color)}))}))}},{"../../lib":503,"../../registry":638,"../../traces/pie/helpers":905,"../../traces/pie/style_one":911,"../../traces/scatter/subtypes":951,"../color":366,"../colorscale/helpers":377,"../drawing":388,"./constants":417,"@plotly/d3":58}],425:[function(e,t,r){"use strict";e("./constants"),t.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":427}],426:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),s=e("../shapes/draw").eraseActiveShape,l=e("../../lib"),c=l._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),p=c._cartesianSpikesEnabled;if("zoom"===s){var h,d="in"===l?.5:2,m=(1+d)/2,g=(1-d)/2;for(a=0;a<f.length;a++)if(!(r=f[a]).fixedrange)if(h=r._name,"auto"===l)u[h+".autorange"]=!0;else if("reset"===l){if(void 0===r._rangeInitial)u[h+".autorange"]=!0;else{var y=r._rangeInitial.slice();u[h+".range[0]"]=y[0],u[h+".range[1]"]=y[1]}void 0!==r._showSpikeInitial&&(u[h+".showspikes"]=r._showSpikeInitial,"on"!==p||r._showSpikeInitial||(p="off"))}else{var v=[r.r2l(r.range[0]),r.r2l(r.range[1])],b=[m*v[0]+g*v[1],m*v[1]+g*v[0]];u[h+".range[0]"]=r.l2r(b[0]),u[h+".range[1]"]=r.l2r(b[1])}}else"hovermode"!==s||"x"!==l&&"y"!==l||(l=c._isHoriz?"y":"x",o.setAttribute("data-val",l)),u[s]=l;c._cartesianSpikesEnabled=p,n.call("_guiRelayout",e,u)}function p(e,t){for(var r=t.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=e._fullLayout._subplots.gl3d||[],s={},l=a.split("."),c=0;c<o.length;c++)s[o[c]+"."+l[1]]=i;var u="pan"===i?i:"zoom";s.dragmode=u,n.call("_guiRelayout",e,s)}function h(e,t){for(var r=t.currentTarget.getAttribute("data-attr"),a="resetLastSave"===r,i="resetDefault"===r,o=e._fullLayout,s=o._subplots.gl3d||[],l={},c=0;c<s.length;c++){var u,f=s[c],p=f+".camera",h=f+".aspectratio",d=f+".aspectmode",m=o[f]._scene;a?(l[p+".up"]=m.viewInitial.up,l[p+".eye"]=m.viewInitial.eye,l[p+".center"]=m.viewInitial.center,u=!0):i&&(l[p+".up"]=null,l[p+".eye"]=null,l[p+".center"]=null,u=!0),u&&(l[h+".x"]=m.viewInitial.aspectratio.x,l[h+".y"]=m.viewInitial.aspectratio.y,l[h+".z"]=m.viewInitial.aspectratio.z,l[d]=m.viewInitial.aspectmode)}n.call("_guiRelayout",e,l)}function d(e,t){var r=t.currentTarget,n=r._previousVal,a=e._fullLayout,i=a._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],s={},l={};if(n)l=n,r._previousVal=null;else{for(var c=0;c<i.length;c++){var u=i[c],f=a[u],p=u+".hovermode";s[p]=f.hovermode,l[p]=!1;for(var h=0;h<3;h++){var d=o[h],m=u+"."+d+".showspikes";l[m]=!1,s[m]=f[d].showspikes}}r._previousVal=s}return l}function m(e,t){for(var r=t.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=e._fullLayout,s=o._subplots.geo||[],l=0;l<s.length;l++){var c=s[l],u=o[c];if("zoom"===a){var f=u.projection.scale,p="in"===i?2*f:.5*f;n.call("_guiRelayout",e,c+".projection.scale",p)}}"reset"===a&&b(e,"geo")}function g(e){var t=e._fullLayout;return!t.hovermode&&(t._has("cartesian")?t._isHoriz?"y":"x":"closest")}function y(e){var t=g(e);n.call("_guiRelayout",e,"hovermode",t)}function v(e,t){for(var r=t.currentTarget.getAttribute("data-val"),a=e._fullLayout,i=a._subplots.mapbox||[],o={},s=0;s<i.length;s++){var l=i[s],c=a[l].zoom,u="in"===r?1.05*c:c/1.05;o[l+".zoom"]=u}n.call("_guiRelayout",e,o)}function b(e,t){for(var r=e._fullLayout,a=r._subplots[t]||[],i={},o=0;o<a.length;o++)for(var s=a[o],l=r[s]._subplot.viewInitial,c=Object.keys(l),u=0;u<c.length;u++){var f=c[u];i[s+"."+f]=l[f]}n.call("_guiRelayout",e,i)}u.toImage={name:"toImage",title:function(e){var t=(e._context.toImageButtonOptions||{}).format||"png";return c(e,"png"===t?"Download plot as a png":"Download plot")},icon:o.camera,click:function(e){var t=e._context.toImageButtonOptions,r={format:t.format||"png"};l.notifier(c(e,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&l.isIE()&&(l.notifier(c(e,"IE only supports svg.  Changing format to svg."),"long"),r.format="svg"),["filename","width","height","scale"].forEach((function(e){e in t&&(r[e]=t[e])})),n.call("downloadImage",e,r).then((function(t){l.notifier(c(e,"Snapshot succeeded")+" - "+t,"long")})).catch((function(){l.notifier(c(e,"Sorry, there was a problem downloading your snapshot!"),"long")}))}},u.sendDataToCloud={name:"sendDataToCloud",title:function(e){return c(e,"Edit in Chart Studio")},icon:o.disk,click:function(e){a.sendDataToCloud(e)}},u.editInChartStudio={name:"editInChartStudio",title:function(e){return c(e,"Edit in Chart Studio")},icon:o.pencil,click:function(e){a.sendDataToCloud(e)}},u.zoom2d={name:"zoom2d",_cat:"zoom",title:function(e){return c(e,"Zoom")},attr:"dragmode",val:"zoom",icon:o.zoombox,click:f},u.pan2d={name:"pan2d",_cat:"pan",title:function(e){return c(e,"Pan")},attr:"dragmode",val:"pan",icon:o.pan,click:f},u.select2d={name:"select2d",_cat:"select",title:function(e){return c(e,"Box Select")},attr:"dragmode",val:"select",icon:o.selectbox,click:f},u.lasso2d={name:"lasso2d",_cat:"lasso",title:function(e){return c(e,"Lasso Select")},attr:"dragmode",val:"lasso",icon:o.lasso,click:f},u.drawclosedpath={name:"drawclosedpath",title:function(e){return c(e,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:o.drawclosedpath,click:f},u.drawopenpath={name:"drawopenpath",title:function(e){return c(e,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:o.drawopenpath,click:f},u.drawline={name:"drawline",title:function(e){return c(e,"Draw line")},attr:"dragmode",val:"drawline",icon:o.drawline,click:f},u.drawrect={name:"drawrect",title:function(e){return c(e,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:o.drawrect,click:f},u.drawcircle={name:"drawcircle",title:function(e){return c(e,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:o.drawcircle,click:f},u.eraseshape={name:"eraseshape",title:function(e){return c(e,"Erase active shape")},icon:o.eraseshape,click:s},u.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(e){return c(e,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:f},u.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(e){return c(e,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:f},u.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(e){return c(e,"Autoscale")},attr:"zoom",val:"auto",icon:o.autoscale,click:f},u.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(e){return c(e,"Reset axes")},attr:"zoom",val:"reset",icon:o.home,click:f},u.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(e){return c(e,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:f},u.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(e){return c(e,"Compare data on hover")},attr:"hovermode",val:function(e){return e._fullLayout._isHoriz?"y":"x"},icon:o.tooltip_compare,gravity:"ne",click:f},u.zoom3d={name:"zoom3d",_cat:"zoom",title:function(e){return c(e,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:o.zoombox,click:p},u.pan3d={name:"pan3d",_cat:"pan",title:function(e){return c(e,"Pan")},attr:"scene.dragmode",val:"pan",icon:o.pan,click:p},u.orbitRotation={name:"orbitRotation",title:function(e){return c(e,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:o["3d_rotate"],click:p},u.tableRotation={name:"tableRotation",title:function(e){return c(e,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:o["z-axis"],click:p},u.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(e){return c(e,"Reset camera to default")},attr:"resetDefault",icon:o.home,click:h},u.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(e){return c(e,"Reset camera to last save")},attr:"resetLastSave",icon:o.movie,click:h},u.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(e,t){var r=d(e,t);n.call("_guiRelayout",e,r)}},u.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(e){return c(e,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:m},u.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(e){return c(e,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:m},u.resetGeo={name:"resetGeo",_cat:"reset",title:function(e){return c(e,"Reset")},attr:"reset",val:null,icon:o.autoscale,click:m},u.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:y},u.hoverClosestGl2d={name:"hoverClosestGl2d",_cat:"hoverclosest",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:y},u.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:y},u.resetViewSankey={name:"resetSankeyGroup",title:function(e){return c(e,"Reset view")},icon:o.home,click:function(e){for(var t={"node.groups":[],"node.x":[],"node.y":[]},r=0;r<e._fullData.length;r++){var a=e._fullData[r]._viewInitial;t["node.groups"].push(a.node.groups.slice()),t["node.x"].push(a.node.x.slice()),t["node.y"].push(a.node.y.slice())}n.call("restyle",e,t)}},u.toggleHover={name:"toggleHover",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(e,t){var r=d(e,t);r.hovermode=g(e),n.call("_guiRelayout",e,r)}},u.resetViews={name:"resetViews",title:function(e){return c(e,"Reset views")},icon:o.home,click:function(e,t){var r=t.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),f(e,t),r.setAttribute("data-attr","resetLastSave"),h(e,t),b(e,"geo"),b(e,"mapbox")}},u.toggleSpikelines={name:"toggleSpikelines",title:function(e){return c(e,"Toggle Spike Lines")},icon:o.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(e){var t=e._fullLayout,r=t._cartesianSpikesEnabled;t._cartesianSpikesEnabled="on"===r?"off":"on",n.call("_guiRelayout",e,function(e){for(var t="on"===e._fullLayout._cartesianSpikesEnabled,r=i.list(e,null,!0),n={},a=0;a<r.length;a++){var o=r[a];n[o._name+".showspikes"]=!!t||o._showSpikeInitial}return n}(e))}},u.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(e){return c(e,"Reset view")},attr:"reset",icon:o.home,click:function(e){b(e,"mapbox")}},u.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(e){return c(e,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:v},u.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(e){return c(e,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:v}},{"../../fonts/ploticon":482,"../../lib":503,"../../plots/cartesian/axis_ids":558,"../../plots/plots":619,"../../registry":638,"../shapes/draw":450}],427:[function(e,t,r){"use strict";var n=e("./buttons"),a=Object.keys(n),i=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],o=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(i),s=[];a.forEach((function(e){!function(e){if(-1===o.indexOf(e._cat||e.name)){var t=e.name,r=(e._cat||e.name).toLowerCase();-1===s.indexOf(t)&&s.push(t),-1===s.indexOf(r)&&s.push(r)}}(n[e])})),s.sort(),t.exports={DRAW_MODES:i,backButtons:o,foreButtons:s}},{"./buttons":426}],428:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("../../plot_api/plot_template"),o=e("./attributes");t.exports=function(e,t){var r=e.modebar||{},s=i.newContainer(t,"modebar");function l(e,t){return n.coerce(r,s,o,e,t)}l("orientation"),l("bgcolor",a.addOpacity(t.paper_bgcolor,.5));var c=a.contrast(a.rgb(t.modebar.bgcolor));l("color",a.addOpacity(c,.3)),l("activecolor",a.addOpacity(c,.7)),l("uirevision",t.uirevision),l("add"),l("remove")}},{"../../lib":503,"../../plot_api/plot_template":543,"../color":366,"./attributes":425}],429:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"modebar",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),manage:e("./manage")}},{"./attributes":425,"./defaults":428,"./manage":430}],430:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axis_ids"),a=e("../../traces/scatter/subtypes"),i=e("../../registry"),o=e("../fx/helpers").isUnifiedHover,s=e("./modebar"),l=e("./buttons"),c=e("./constants").DRAW_MODES;t.exports=function(e){var t=e._fullLayout,r=e._context,u=t._modeBar;if(r.displayModeBar||r.watermark){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var f,p=r.modeBarButtons;f=Array.isArray(p)&&p.length?function(e){for(var t=0;t<e.length;t++)for(var r=e[t],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===l[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));e[t][n]=l[a]}}return e}(p):!r.displayModeBar&&r.watermark?[]:function(e){var t=e._fullLayout,r=e._fullData,s=e._context;function u(e,t){if("string"==typeof t){if(t.toLowerCase()===e.toLowerCase())return!0}else{var r=t.name,n=t._cat||t.name;if(r===e||n===e.toLowerCase())return!0}return!1}var f=t.modebar.add;"string"==typeof f&&(f=[f]);var p=t.modebar.remove;"string"==typeof p&&(p=[p]);var h=s.modeBarButtonsToAdd.concat(f.filter((function(e){for(var t=0;t<s.modeBarButtonsToRemove.length;t++)if(u(e,s.modeBarButtonsToRemove[t]))return!1;return!0}))),d=s.modeBarButtonsToRemove.concat(p.filter((function(e){for(var t=0;t<s.modeBarButtonsToAdd.length;t++)if(u(e,s.modeBarButtonsToAdd[t]))return!1;return!0}))),m=t._has("cartesian"),g=t._has("gl3d"),y=t._has("geo"),v=t._has("pie"),b=t._has("funnelarea"),x=t._has("gl2d"),_=t._has("ternary"),w=t._has("mapbox"),k=t._has("polar"),D=t._has("smith"),T=t._has("sankey"),A=function(e){for(var t=n.list({_fullLayout:e},null,!0),r=0;r<t.length;r++)if(!t[r].fixedrange)return!1;return!0}(t),S=o(t.hovermode),M=[];function E(e){if(e.length){for(var t=[],r=0;r<e.length;r++){for(var n=e[r],a=l[n],i=a.name.toLowerCase(),o=(a._cat||a.name).toLowerCase(),s=!1,c=0;c<d.length;c++){var u=d[c].toLowerCase();if(u===i||u===o){s=!0;break}}s||t.push(l[n])}M.push(t)}}var C=["toImage"];s.showEditInChartStudio?C.push("editInChartStudio"):s.showSendToCloud&&C.push("sendDataToCloud"),E(C);var N=[],O=[],I=[],P=[];(m||x||v||b||_)+y+g+w+k+D>1?(O=["toggleHover"],I=["resetViews"]):y?(N=["zoomInGeo","zoomOutGeo"],O=["hoverClosestGeo"],I=["resetGeo"]):g?(O=["hoverClosest3d"],I=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(N=["zoomInMapbox","zoomOutMapbox"],O=["toggleHover"],I=["resetViewMapbox"]):x?O=["hoverClosestGl2d"]:v?O=["hoverClosestPie"]:T?(O=["hoverClosestCartesian","hoverCompareCartesian"],I=["resetViewSankey"]):O=["toggleHover"],m&&(O=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]),(function(e){for(var t=0;t<e.length;t++)if(!i.traceIs(e[t],"noHover"))return!1;return!0}(r)||S)&&(O=[]),!m&&!x||A||(N=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==I[0]&&(I=["resetScale2d"])),g?P=["zoom3d","pan3d","orbitRotation","tableRotation"]:(m||x)&&!A||_?P=["zoom2d","pan2d"]:w||y?P=["pan2d"]:k&&(P=["zoom2d"]),function(e){for(var t=!1,r=0;r<e.length&&!t;r++){var n=e[r];n._module&&n._module.selectPoints&&(i.traceIs(n,"scatter-like")?(a.hasMarkers(n)||a.hasText(n))&&(t=!0):i.traceIs(n,"box-violin")&&"all"!==n.boxpoints&&"all"!==n.points||(t=!0))}return t}(r)&&P.push("select2d","lasso2d");var R=[],L=function(e){-1===R.indexOf(e)&&-1!==O.indexOf(e)&&R.push(e)};if(Array.isArray(h)){for(var F=[],B=0;B<h.length;B++){var z=h[B];"string"==typeof z?(z=z.toLowerCase(),-1!==c.indexOf(z)?(t._has("mapbox")||t._has("cartesian"))&&P.push(z):"togglespikelines"===z?L("toggleSpikelines"):"togglehover"===z?L("toggleHover"):"hovercompare"===z?L("hoverCompareCartesian"):"hoverclosest"===z?(L("hoverClosestCartesian"),L("hoverClosestGeo"),L("hoverClosest3d"),L("hoverClosestGl2d"),L("hoverClosestPie")):"v1hovermode"===z&&(L("toggleHover"),L("hoverClosestCartesian"),L("hoverCompareCartesian"),L("hoverClosestGeo"),L("hoverClosest3d"),L("hoverClosestGl2d"),L("hoverClosestPie"))):F.push(z)}h=F}return E(P),E(N.concat(I)),E(R),function(e,t){if(t.length)if(Array.isArray(t[0]))for(var r=0;r<t.length;r++)e.push(t[r]);else e.push(t);return e}(M,h)}(e),u?u.update(e,f):t._modeBar=s(e,f)}else u&&(u.destroy(),delete t._modeBar)}},{"../../plots/cartesian/axis_ids":558,"../../registry":638,"../../traces/scatter/subtypes":951,"../fx/helpers":402,"./buttons":426,"./constants":427,"./modebar":431}],431:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../fonts/ploticon"),s=new DOMParser;function l(e){this.container=e.container,this.element=document.createElement("div"),this.update(e.graphInfo,e.buttons),this.container.appendChild(this.element)}var c=l.prototype;c.update=function(e,t){this.graphInfo=e;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,a="modebar-"+n._uid;this.element.setAttribute("id",a),this._uid=a,this.element.className="modebar","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",t=t.reverse());var o=n.modebar,s="hover"===r.displayModeBar?".js-plotly-plot .plotly:hover ":"";i.deleteRelatedStyleRule(a),i.addRelatedStyleRule(a,s+"#"+a+" .modebar-group","background-color: "+o.bgcolor),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn .icon path","fill: "+o.color),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn:hover .icon path","fill: "+o.activecolor),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn.active .icon path","fill: "+o.activecolor);var l=!this.hasButtons(t),c=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(l||c||u)&&(this.removeAllButtons(),this.updateButtons(t),r.watermark||r.displaylogo)){var f=this.getLogo();r.watermark&&(f.className=f.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(f,this.element.childNodes[0]):this.element.appendChild(f),this.hasLogo=!0}this.updateActiveButton()},c.updateButtons=function(e){var t=this;this.buttons=e,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach((function(e){var r=t.createGroup();e.forEach((function(e){var n=e.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==t.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");t.buttonsNames.push(n);var a=t.createButton(e);t.buttonElements.push(a),r.appendChild(a)})),t.element.appendChild(r)}))},c.createGroup=function(){var e=document.createElement("div");return e.className="modebar-group",e},c.createButton=function(e){var t=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var a=e.title;void 0===a?a=e.name:"function"==typeof a&&(a=a(this.graphInfo)),(a||0===a)&&r.setAttribute("data-title",a),void 0!==e.attr&&r.setAttribute("data-attr",e.attr);var i=e.val;if(void 0!==i&&("function"==typeof i&&(i=i(this.graphInfo)),r.setAttribute("data-val",i)),"function"!=typeof e.click)throw new Error("must provide button 'click' function in button config");r.addEventListener("click",(function(r){e.click(t.graphInfo,r),t.updateActiveButton(r.currentTarget)})),r.setAttribute("data-toggle",e.toggle||!1),e.toggle&&n.select(r).classed("active",!0);var s=e.icon;return"function"==typeof s?r.appendChild(s()):r.appendChild(this.createIcon(s||o.question)),r.setAttribute("data-gravity",e.gravity||"n"),r},c.createIcon=function(e){var t,r=a(e.height)?Number(e.height):e.ascent-e.descent,n="http://www.w3.org/2000/svg";if(e.path){(t=document.createElementNS(n,"svg")).setAttribute("viewBox",[0,0,e.width,r].join(" ")),t.setAttribute("class","icon");var i=document.createElementNS(n,"path");i.setAttribute("d",e.path),e.transform?i.setAttribute("transform",e.transform):void 0!==e.ascent&&i.setAttribute("transform","matrix(1 0 0 -1 0 "+e.ascent+")"),t.appendChild(i)}return e.svg&&(t=s.parseFromString(e.svg,"application/xml").childNodes[0]),t.setAttribute("height","1em"),t.setAttribute("width","1em"),t},c.updateActiveButton=function(e){var t=this.graphInfo._fullLayout,r=void 0!==e?e.getAttribute("data-attr"):null;this.buttonElements.forEach((function(e){var a=e.getAttribute("data-val")||!0,o=e.getAttribute("data-attr"),s="true"===e.getAttribute("data-toggle"),l=n.select(e);if(s)o===r&&l.classed("active",!l.classed("active"));else{var c=null===o?o:i.nestedProperty(t,o).get();l.classed("active",c===a)}}))},c.hasButtons=function(e){var t=this.buttons;if(!t)return!1;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;n<e[r].length;n++)if(e[r][n].name!==t[r][n].name)return!1}return!0},c.getLogo=function(){var e=this.createGroup(),t=document.createElement("a");return t.href="https://plotly.com/",t.target="_blank",t.setAttribute("data-title",i._(this.graphInfo,"Produced with Plotly")),t.className="modebar-btn plotlyjsicon modebar-btn--logo",t.appendChild(this.createIcon(o.newplotlylogo)),e.appendChild(t),e},c.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},c.destroy=function(){i.removeElement(this.container.querySelector(".modebar")),i.deleteRelatedStyleRule(this._uid)},t.exports=function(e,t){var r=e._fullLayout,a=new l({graphInfo:e,container:r._modebardiv.node(),buttons:t});return r._privateplot&&n.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}},{"../../fonts/ploticon":482,"../../lib":503,"@plotly/d3":58,"fast-isnumeric":190}],432:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=(0,e("../../plot_api/plot_template").templatedArray)("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});t.exports={visible:{valType:"boolean",editType:"plot"},buttons:i,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:n({editType:"plot"}),bgcolor:{valType:"color",dflt:a.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}},{"../../plot_api/plot_template":543,"../../plots/font_attributes":585,"../color/attributes":365}],433:[function(e,t,r){"use strict";t.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],434:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("../../plot_api/plot_template"),o=e("../../plots/array_container_defaults"),s=e("./attributes"),l=e("./constants");function c(e,t,r,a){var i=a.calendar;function o(r,a){return n.coerce(e,t,s.buttons,r,a)}if(o("visible")){var l=o("step");"all"!==l&&(!i||"gregorian"===i||"month"!==l&&"year"!==l?o("stepmode"):t.stepmode="backward",o("count")),o("label")}}t.exports=function(e,t,r,u,f){var p=e.rangeselector||{},h=i.newContainer(t,"rangeselector");function d(e,t){return n.coerce(p,h,s,e,t)}if(d("visible",o(p,h,{name:"buttons",handleItemDefaults:c,calendar:f}).length>0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i<n.length;i++){var o=t[n[i]].domain;o&&(a=Math.max(o[1],a))}return[e.domain[0],a+l.yPad]}(t,r,u);d("x",m[0]),d("y",m[1]),n.noneOrAll(e,t,["x","y"]),d("xanchor"),d("yanchor"),n.coerceFont(d,"font",r.font);var g=d("bgcolor");d("activecolor",a.contrast(g,l.lightAmount,l.darkAmount)),d("bordercolor"),d("borderwidth")}}},{"../../lib":503,"../../plot_api/plot_template":543,"../../plots/array_container_defaults":549,"../color":366,"./attributes":432,"./constants":433}],435:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../plots/plots"),o=e("../color"),s=e("../drawing"),l=e("../../lib"),c=l.strTranslate,u=e("../../lib/svg_text_utils"),f=e("../../plots/cartesian/axis_ids"),p=e("../../constants/alignment"),h=p.LINE_SPACING,d=p.FROM_TL,m=p.FROM_BR,g=e("./constants"),y=e("./get_update_object");function v(e){return e._id}function b(e,t,r){var n=l.ensureSingle(e,"rect","selector-rect",(function(e){e.attr("shape-rendering","crispEdges")}));n.attr({rx:g.rx,ry:g.ry}),n.call(o.stroke,t.bordercolor).call(o.fill,function(e,t){return t._isActive||t._isHovered?e.activecolor:e.bgcolor}(t,r)).style("stroke-width",t.borderwidth+"px")}function x(e,t,r,n){l.ensureSingle(e,"text","selector-text",(function(e){e.attr("text-anchor","middle")})).call(s.font,t.font).text(function(e,t){return e.label?t?l.templateString(e.label,t):e.label:"all"===e.step?"all":e.count+e.step.charAt(0)}(r,n._fullLayout._meta)).call((function(e){u.convertToTspans(e,n)}))}t.exports=function(e){var t=e._fullLayout._infolayer.selectAll(".rangeselector").data(function(e){for(var t=f.list(e,"x",!0),r=[],n=0;n<t.length;n++){var a=t[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}(e),v);t.enter().append("g").classed("rangeselector",!0),t.exit().remove(),t.style({cursor:"pointer","pointer-events":"all"}),t.each((function(t){var r=n.select(this),o=t,f=o.rangeselector,p=r.selectAll("g.button").data(l.filterVisible(f.buttons));p.enter().append("g").classed("button",!0),p.exit().remove(),p.each((function(t){var r=n.select(this),i=y(o,t);t._isActive=function(e,t,r){if("all"===t.step)return!0===e.autorange;var n=Object.keys(r);return e.range[0]===r[n[0]]&&e.range[1]===r[n[1]]}(o,t,i),r.call(b,f,t),r.call(x,f,t,e),r.on("click",(function(){e._dragged||a.call("_guiRelayout",e,i)})),r.on("mouseover",(function(){t._isHovered=!0,r.call(b,f,t)})),r.on("mouseout",(function(){t._isHovered=!1,r.call(b,f,t)}))})),function(e,t,r,a,o){var f=0,p=0,y=r.borderwidth;t.each((function(){var e=n.select(this).select(".selector-text"),t=r.font.size*h,a=Math.max(t*u.lineCount(e),16)+3;p=Math.max(p,a)})),t.each((function(){var e=n.select(this),t=e.select(".selector-rect"),a=e.select(".selector-text"),i=a.node()&&s.bBox(a.node()).width,o=r.font.size*h,l=u.lineCount(a),d=Math.max(i+10,g.minButtonWidth);e.attr("transform",c(y+f,y)),t.attr({x:0,y:0,width:d,height:p}),u.positionText(a,d/2,p/2-(l-1)*o/2+3),f+=d+5}));var v=e._fullLayout._size,b=v.l+v.w*r.x,x=v.t+v.h*(1-r.y),_="left";l.isRightAnchor(r)&&(b-=f,_="right"),l.isCenterAnchor(r)&&(b-=f/2,_="center");var w="top";l.isBottomAnchor(r)&&(x-=p,w="bottom"),l.isMiddleAnchor(r)&&(x-=p/2,w="middle"),f=Math.ceil(f),p=Math.ceil(p),b=Math.round(b),x=Math.round(x),i.autoMargin(e,a+"-range-selector",{x:r.x,y:r.y,l:f*d[_],r:f*m[_],b:p*m[w],t:p*d[w]}),o.attr("transform",c(b,x))}(e,p,f,o._name,r)}))}},{"../../constants/alignment":471,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/cartesian/axis_ids":558,"../../plots/plots":619,"../../registry":638,"../color":366,"../drawing":388,"./constants":433,"./get_update_object":436,"@plotly/d3":58}],436:[function(e,t,r){"use strict";var n=e("d3-time"),a=e("../../lib").titleCase;t.exports=function(e,t){var r=e._name,i={};if("all"===t.step)i[r+".autorange"]=!0;else{var o=function(e,t){var r,i=e.range,o=new Date(e.r2l(i[1])),s=t.step,l=n["utc"+a(s)],c=t.count;switch(t.stepmode){case"backward":r=e.l2r(+l.offset(o,-c));break;case"todate":var u=l.offset(o,-c);r=e.l2r(+l.ceil(u))}return[r,i[1]]}(e,t);i[r+".range[0]"]=o[0],i[r+".range[1]"]=o[1]}return i}},{"../../lib":503,"d3-time":122}],437:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),draw:e("./draw")}},{"./attributes":432,"./defaults":434,"./draw":435}],438:[function(e,t,r){"use strict";var n=e("../color/attributes");t.exports={bgcolor:{valType:"color",dflt:n.background,editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}},{"../color/attributes":365}],439:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axis_ids").list,a=e("../../plots/cartesian/autorange").getAutoRange,i=e("./constants");t.exports=function(e){for(var t=n(e,"x",!0),r=0;r<t.length;r++){var o=t[r],s=o[i.name];s&&s.visible&&s.autorange&&(s._input.autorange=!0,s._input.range=s.range=a(e,o))}}},{"../../plots/cartesian/autorange":553,"../../plots/cartesian/axis_ids":558,"./constants":440}],440:[function(e,t,r){"use strict";t.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],441:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/plot_template"),i=e("../../plots/cartesian/axis_ids"),o=e("./attributes"),s=e("./oppaxis_attributes");t.exports=function(e,t,r){var l=e[r],c=t[r];if(l.rangeslider||t._requestRangeslider[c._id]){n.isPlainObject(l.rangeslider)||(l.rangeslider={});var u,f,p=l.rangeslider,h=a.newContainer(c,"rangeslider");if(_("visible")){_("bgcolor",t.plot_bgcolor),_("bordercolor"),_("borderwidth"),_("thickness"),_("autorange",!c.isValidRange(p.range)),_("range");var d=t._subplots;if(d)for(var m=d.cartesian.filter((function(e){return e.substr(0,e.indexOf("y"))===i.name2id(r)})).map((function(e){return e.substr(e.indexOf("y"),e.length)})),g=n.simpleMap(m,i.id2name),y=0;y<g.length;y++){var v=g[y];u=p[v]||{},f=a.newContainer(h,v,"yaxis");var b,x=t[v];u.range&&x.isValidRange(u.range)&&(b="fixed"),"match"!==w("rangemode",b)&&w("range",x.range.slice())}h._input=p}}function _(e,t){return n.coerce(p,h,o,e,t)}function w(e,t){return n.coerce(u,f,s,e,t)}}},{"../../lib":503,"../../plot_api/plot_template":543,"../../plots/cartesian/axis_ids":558,"./attributes":438,"./oppaxis_attributes":445}],442:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../plots/plots"),o=e("../../lib"),s=o.strTranslate,l=e("../drawing"),c=e("../color"),u=e("../titles"),f=e("../../plots/cartesian"),p=e("../../plots/cartesian/axis_ids"),h=e("../dragelement"),d=e("../../lib/setcursor"),m=e("./constants");function g(e,t,r,n){var a=o.ensureSingle(e,"rect",m.bgClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),i=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,c=-n._offsetShift,u=l.crispRound(t,n.borderwidth);a.attr({width:n._width+i,height:n._height+i,transform:s(c,c),fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":u})}function y(e,t,r,n){var a=t._fullLayout;o.ensureSingleById(a._topdefs,"clipPath",n._clipId,(function(e){e.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function v(e,t,r,a){var s,c=t.calcdata,u=e.selectAll("g."+m.rangePlotClassName).data(r._subplotsWith,o.identity);u.enter().append("g").attr("class",(function(e){return m.rangePlotClassName+" "+e})).call(l.setClipUrl,a._clipId,t),u.order(),u.exit().remove(),u.each((function(e,o){var l=n.select(this),u=0===o,h=p.getFromId(t,e,"y"),d=h._name,m=a[d],g={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:a.range.slice(),calendar:r.calendar},width:a._width,height:a._height,margin:{t:0,b:0,l:0,r:0}},_context:t._context};r.rangebreaks&&(g.layout.xaxis.rangebreaks=r.rangebreaks),g.layout[d]={type:h.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():h.range.slice(),calendar:h.calendar},h.rangebreaks&&(g.layout[d].rangebreaks=h.rangebreaks),i.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[d];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var b={id:e,plotgroup:l,xaxis:y,yaxis:v,isRangePlot:!0};u?s=b:(b.mainplot="xy",b.mainplotinfo=s),f.rangePlot(t,b,function(e,t){for(var r=[],n=0;n<e.length;n++){var a=e[n],i=a[0].trace;i.xaxis+i.yaxis===t&&r.push(a)}return r}(c,e))}))}function b(e,t,r,n,a){o.ensureSingle(e,"rect",m.maskMinClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(c.fill,m.maskColor),o.ensureSingle(e,"rect",m.maskMaxClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(c.fill,m.maskColor),"match"!==a.rangemode&&(o.ensureSingle(e,"rect",m.maskMinOppAxisClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).call(c.fill,m.maskOppAxisColor),o.ensureSingle(e,"rect",m.maskMaxOppAxisClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).style("border-top",m.maskOppBorder).call(c.fill,m.maskOppAxisColor))}function x(e,t,r,n){t._context.staticPlot||o.ensureSingle(e,"rect",m.slideBoxClassName,(function(e){e.attr({y:0,cursor:m.slideBoxCursor,"shape-rendering":"crispEdges"})})).attr({height:n._height,fill:m.slideBoxFill})}function _(e,t,r,n){var a=o.ensureSingle(e,"g",m.grabberMinClassName),i=o.ensureSingle(e,"g",m.grabberMaxClassName),s={x:0,width:m.handleWidth,rx:m.handleRadius,fill:c.background,stroke:c.defaultLine,"stroke-width":m.handleStrokeWidth,"shape-rendering":"crispEdges"},l={y:Math.round(n._height/4),height:Math.round(n._height/2)};o.ensureSingle(a,"rect",m.handleMinClassName,(function(e){e.attr(s)})).attr(l),o.ensureSingle(i,"rect",m.handleMaxClassName,(function(e){e.attr(s)})).attr(l);var u={width:m.grabAreaWidth,x:0,y:0,fill:m.grabAreaFill,cursor:t._context.staticPlot?void 0:m.grabAreaCursor};o.ensureSingle(a,"rect",m.grabAreaMinClassName,(function(e){e.attr(u)})).attr("height",n._height),o.ensureSingle(i,"rect",m.grabAreaMaxClassName,(function(e){e.attr(u)})).attr("height",n._height)}t.exports=function(e){for(var t=e._fullLayout,r=t._rangeSliderData,i=0;i<r.length;i++){var l=r[i][m.name];l._clipId=l._id+"-"+t._uid}var c=t._infolayer.selectAll("g."+m.containerClassName).data(r,(function(e){return e._name}));c.exit().each((function(e){var r=e[m.name];t._topdefs.select("#"+r._clipId).remove()})).remove(),0!==r.length&&(c.enter().append("g").classed(m.containerClassName,!0).attr("pointer-events","all"),c.each((function(r){var i=n.select(this),l=r[m.name],c=t[p.id2name(r.anchor)],f=l[p.id2name(r.anchor)];if(l.range){var w,k=o.simpleMap(l.range,r.r2l),D=o.simpleMap(r.range,r.r2l);w=D[0]<D[1]?[Math.min(k[0],D[0]),Math.max(k[1],D[1])]:[Math.max(k[0],D[0]),Math.min(k[1],D[1])],l.range=l._input.range=o.simpleMap(w,r.l2r)}r.cleanRange("rangeslider.range");var T=t._size,A=r.domain;l._width=T.w*(A[1]-A[0]);var S=Math.round(T.l+T.w*A[0]),M=Math.round(T.t+T.h*(1-r._counterDomainMin)+("bottom"===r.side?r._depth:0)+l._offsetShift+m.extraPad);i.attr("transform",s(S,M)),l._rl=o.simpleMap(l.range,r.r2l);var E=l._rl[0],C=l._rl[1],N=C-E;if(l.p2d=function(e){return e/l._width*N+E},l.d2p=function(e){return(e-E)/N*l._width},r.rangebreaks){var O=r.locateBreaks(E,C);if(O.length){var I,P,R=0;for(I=0;I<O.length;I++)R+=(P=O[I]).max-P.min;var L=l._width/(C-E-R),F=[-L*E];for(I=0;I<O.length;I++)P=O[I],F.push(F[F.length-1]-L*(P.max-P.min));for(l.d2p=function(e){for(var t=F[0],r=0;r<O.length;r++){var n=O[r];if(e>=n.max)t=F[r+1];else if(e<n.min)break}return t+L*e},I=0;I<O.length;I++)(P=O[I]).pmin=l.d2p(P.min),P.pmax=l.d2p(P.max);l.p2d=function(e){for(var t=F[0],r=0;r<O.length;r++){var n=O[r];if(e>=n.pmax)t=F[r+1];else if(e<n.pmin)break}return(e-t)/L}}}if("match"!==f.rangemode){var B=c.r2l(f.range[0]),z=c.r2l(f.range[1])-B;l.d2pOppAxis=function(e){return(e-B)/z*l._height}}i.call(g,e,r,l).call(y,e,r,l).call(v,e,r,l).call(b,e,r,l,f).call(x,e,r,l).call(_,e,r,l),function(e,t,r,i){if(!t._context.staticPlot){var s=e.select("rect."+m.slideBoxClassName).node(),l=e.select("rect."+m.grabAreaMinClassName).node(),c=e.select("rect."+m.grabAreaMaxClassName).node();e.on("mousedown",u),e.on("touchstart",u)}function u(){var u=n.event,f=u.target,p=u.clientX||u.touches[0].clientX,m=p-e.node().getBoundingClientRect().left,g=i.d2p(r._rl[0]),y=i.d2p(r._rl[1]),v=h.coverSlip();function b(e){var u,h,b,x=+(e.clientX||e.touches[0].clientX)-p;switch(f){case s:b="ew-resize",u=g+x,h=y+x;break;case l:b="col-resize",u=g+x,h=y;break;case c:b="col-resize",u=g,h=y+x;break;default:b="ew-resize",u=m,h=m+x}if(h<u){var _=h;h=u,u=_}i._pixelMin=u,i._pixelMax=h,d(n.select(v),b),function(e,t,r,n){function i(e){return r.l2r(o.constrain(e,n._rl[0],n._rl[1]))}var s=i(n.p2d(n._pixelMin)),l=i(n.p2d(n._pixelMax));window.requestAnimationFrame((function(){a.call("_guiRelayout",t,r._name+".range",[s,l])}))}(0,t,r,i)}function x(){v.removeEventListener("mousemove",b),v.removeEventListener("mouseup",x),this.removeEventListener("touchmove",b),this.removeEventListener("touchend",x),o.removeElement(v)}this.addEventListener("touchmove",b),this.addEventListener("touchend",x),v.addEventListener("mousemove",b),v.addEventListener("mouseup",x)}}(i,e,r,l),function(e,t,r,n,a,i){var l=m.handleWidth/2;function c(e){return o.constrain(e,0,n._width)}function u(e){return o.constrain(e,0,n._height)}function f(e){return o.constrain(e,-l,n._width+l)}var p=c(n.d2p(r._rl[0])),h=c(n.d2p(r._rl[1]));if(e.select("rect."+m.slideBoxClassName).attr("x",p).attr("width",h-p),e.select("rect."+m.maskMinClassName).attr("width",p),e.select("rect."+m.maskMaxClassName).attr("x",h).attr("width",n._width-h),"match"!==i.rangemode){var d=n._height-u(n.d2pOppAxis(a._rl[1])),g=n._height-u(n.d2pOppAxis(a._rl[0]));e.select("rect."+m.maskMinOppAxisClassName).attr("x",p).attr("height",d).attr("width",h-p),e.select("rect."+m.maskMaxOppAxisClassName).attr("x",p).attr("y",g).attr("height",n._height-g).attr("width",h-p),e.select("rect."+m.slideBoxClassName).attr("y",d).attr("height",g-d)}var y=Math.round(f(p-l))-.5,v=Math.round(f(h-l))+.5;e.select("g."+m.grabberMinClassName).attr("transform",s(y,.5)),e.select("g."+m.grabberMaxClassName).attr("transform",s(v,.5))}(i,0,r,l,c,f),"bottom"===r.side&&u.draw(e,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:t._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:M+l._height+l._offsetShift+10+1.5*r.title.font.size,"text-anchor":"middle"}})})))}},{"../../lib":503,"../../lib/setcursor":524,"../../plots/cartesian":568,"../../plots/cartesian/axis_ids":558,"../../plots/plots":619,"../../registry":638,"../color":366,"../dragelement":385,"../drawing":388,"../titles":464,"./constants":440,"@plotly/d3":58}],443:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axis_ids"),a=e("../../lib/svg_text_utils"),i=e("./constants"),o=e("../../constants/alignment").LINE_SPACING,s=i.name;function l(e){var t=e&&e[s];return t&&t.visible}r.isVisible=l,r.makeData=function(e){var t=n.list({_fullLayout:e},"x",!0),r=e.margin,a=[];if(!e._has("gl2d"))for(var i=0;i<t.length;i++){var o=t[i];if(l(o)){a.push(o);var c=o[s];c._id=s+o._id,c._height=(e.height-r.b-r.t)*c.thickness,c._offsetShift=Math.floor(c.borderwidth/2)}}e._rangeSliderData=a},r.autoMarginOpts=function(e,t){var r=e._fullLayout,n=t[s],l=t._id.charAt(0),c=0,u=0;return"bottom"===t.side&&(c=t._depth,t.title.text!==r._dfltTitle[l]&&(u=1.5*t.title.font.size+10+n._offsetShift,u+=(t.title.text.match(a.BR_TAG_ALL)||[]).length*t.title.font.size*o)),{x:0,y:t._counterDomainMin,l:0,r:0,t:0,b:n._height+c+Math.max(r.margin.b,u),pad:i.extraPad+2*n._offsetShift}}},{"../../constants/alignment":471,"../../lib/svg_text_utils":529,"../../plots/cartesian/axis_ids":558,"./constants":440}],444:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("./oppaxis_attributes"),o=e("./helpers");t.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},a,{yaxis:i})}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),calcAutorange:e("./calc_autorange"),draw:e("./draw"),isVisible:o.isVisible,makeData:o.makeData,autoMarginOpts:o.autoMarginOpts}},{"../../lib":503,"./attributes":438,"./calc_autorange":439,"./defaults":441,"./draw":442,"./helpers":443,"./oppaxis_attributes":445}],445:[function(e,t,r){"use strict";t.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}},{}],446:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../traces/scatter/attributes").line,i=e("../drawing/attributes").dash,o=e("../../lib/extend").extendFlat,s=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects"),t.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":472,"../../lib/extend":493,"../../plot_api/plot_template":543,"../../traces/scatter/attributes":926,"../annotations/attributes":349,"../drawing/attributes":387}],447:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./constants"),o=e("./helpers");function s(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function l(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,r,a,s,l){var c=e/2,u=l;if("pixel"===t){var f=s?o.extractPathCoords(s,l?i.paramIsY:i.paramIsX):[r,a],p=n.aggNums(Math.max,null,f),h=n.aggNums(Math.min,null,f),d=h<0?Math.abs(h)+c:c,m=p>0?p+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function u(e,t,r,n,a){var s="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[s(t),s(r)];if(n){var l,c,u,f,p=1/0,h=-1/0,d=n.match(i.segmentRE);for("date"===e.type&&(s=o.decodeDate(s)),l=0;l<d.length;l++)void 0!==(c=a[d[l].charAt(0)].drawn)&&(!(u=d[l].substr(1).match(i.paramRE))||u.length<c||((f=s(u[c]))<p&&(p=f),f>h&&(h=f)));return h>=p?[p,h]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o<r.length;o++){var c,f,p=r[o];p._extremes={};var h=a.getRefType(p.xref),d=a.getRefType(p.yref);if("paper"!==p.xref&&"domain"!==h){var m="pixel"===p.xsizemode?p.xanchor:p.x0,g="pixel"===p.xsizemode?p.xanchor:p.x1;(f=u(c=a.getFromId(e,p.xref),m,g,p.path,i.paramIsX))&&(p._extremes[c._id]=a.findExtremes(c,f,s(p)))}if("paper"!==p.yref&&"domain"!==d){var y="pixel"===p.ysizemode?p.yanchor:p.y0,v="pixel"===p.ysizemode?p.yanchor:p.y1;(f=u(c=a.getFromId(e,p.yref),y,v,p.path,i.paramIsY))&&(p._extremes[c._id]=a.findExtremes(c,f,l(p)))}}}},{"../../lib":503,"../../plots/cartesian/axes":554,"./constants":448,"./helpers":457}],448:[function(e,t,r){"use strict";t.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],449:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("./attributes"),s=e("./helpers");function l(e,t,r){function i(r,a){return n.coerce(e,t,o,r,a)}if(i("visible")){var l=i("path"),c=i("type",l?"path":"rect");"path"!==t.type&&delete t.path,i("editable"),i("layer"),i("opacity"),i("fillcolor"),i("fillrule"),i("line.width")&&(i("line.color"),i("line.dash"));for(var u=i("xsizemode"),f=i("ysizemode"),p=["x","y"],h=0;h<2;h++){var d,m,g,y=p[h],v=y+"anchor",b="x"===y?u:f,x={_fullLayout:r},_=a.coerceRef(e,t,x,y,void 0,"paper");if("range"===a.getRefType(_)?((d=a.getFromId(x,_))._shapeIndices.push(t._index),g=s.rangeToShapePosition(d),m=s.shapePositionToRange(d)):m=g=n.identity,"path"!==c){var w=y+"0",k=y+"1",D=e[w],T=e[k];e[w]=m(e[w],!0),e[k]=m(e[k],!0),"pixel"===b?(i(w,0),i(k,10)):(a.coercePosition(t,x,i,_,w,.25),a.coercePosition(t,x,i,_,k,.75)),t[w]=g(t[w]),t[k]=g(t[k]),e[w]=D,e[k]=T}if("pixel"===b){var A=e[v];e[v]=m(e[v],!0),a.coercePosition(t,x,i,_,v,.25),t[v]=g(t[v]),e[v]=A}}"path"===c?i("path"):n.noneOrAll(e,t,["x0","x1","y0","y1"])}}t.exports=function(e,t){i(e,t,{name:"shapes",handleItemDefaults:l})}},{"../../lib":503,"../../plots/array_container_defaults":549,"../../plots/cartesian/axes":554,"./attributes":446,"./helpers":457}],450:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("./draw_newshape/helpers").readPaths,s=e("./draw_newshape/display_outlines"),l=e("../../plots/cartesian/handle_outline").clearOutlineControllers,c=e("../color"),u=e("../drawing"),f=e("../../plot_api/plot_template").arrayEditor,p=e("../dragelement"),h=e("../../lib/setcursor"),d=e("./constants"),m=e("./helpers");function g(e){var t=e._fullLayout;for(var r in t._shapeUpperLayer.selectAll("path").remove(),t._shapeLowerLayer.selectAll("path").remove(),t._plots){var n=t._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var a=0;a<t.shapes.length;a++)t.shapes[a].visible&&b(e,a)}function y(e){return!!e._fullLayout._drawing}function v(e){return!e._context.edits.shapePosition}function b(e,t){e._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+t+'"]').remove();var r=m.makeOptionsAndPlotinfo(e,t),l=r.options,b=r.plotinfo;function D(r){var D=_(e,l),T={"data-index":t,"fill-rule":l.fillrule,d:D},A=l.opacity,S=l.fillcolor,M=l.line.width?l.line.color:"rgba(0,0,0,0)",E=l.line.width,C=l.line.dash;E||!0!==l.editable||(E=5,C="solid");var N="Z"!==D[D.length-1],O=v(e)&&l.editable&&e._fullLayout._activeShapeIndex===t;O&&(S=N?"rgba(0,0,0,0)":e._fullLayout.activeshape.fillcolor,A=e._fullLayout.activeshape.opacity);var I,P=r.append("path").attr(T).style("opacity",A).call(c.stroke,M).call(c.fill,S).call(u.dashLine,C,E);if(x(P,e,l),(O||e._context.edits.shapePosition)&&(I=f(e.layout,"shapes",l)),O){P.style({cursor:"move"});var R={element:P.node(),plotinfo:b,gd:e,editHelpers:I,isActiveShape:!0},L=o(D,e);s(L,P,R)}else e._context.edits.shapePosition?function(e,t,r,o,s,l){var c,f,g,v,b,k,D,T,A,S,M,E,C,N,O,I,P="pixel"===r.xsizemode,R="pixel"===r.ysizemode,L="line"===r.type,F="path"===r.type,B=l.modifyItem,z=i.getFromId(e,r.xref),j=i.getRefType(r.xref),U=i.getFromId(e,r.yref),$=i.getRefType(r.yref),V=m.getDataToPixel(e,z,!1,j),q=m.getDataToPixel(e,U,!0,$),W=m.getPixelToData(e,z,!1,j),H=m.getPixelToData(e,U,!0,$),G=L?function(){var e=Math.max(r.line.width,10),n=s.append("g").attr("data-index",o);n.append("path").attr("d",t.attr("d")).style({cursor:"move","stroke-width":e,"stroke-opacity":"0"});var a={"fill-opacity":"0"},i=Math.max(e/2,10);return n.append("circle").attr({"data-line-point":"start-point",cx:P?V(r.xanchor)+r.x0:V(r.x0),cy:R?q(r.yanchor)-r.y0:q(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:P?V(r.xanchor)+r.x1:V(r.x1),cy:R?q(r.yanchor)-r.y1:q(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():t,X={element:G.node(),gd:e,prepFn:function(n){y(e)||(P&&(b=V(r.xanchor)),R&&(k=q(r.yanchor)),"path"===r.type?O=r.path:(c=P?r.x0:V(r.x0),f=R?r.y0:q(r.y0),g=P?r.x1:V(r.x1),v=R?r.y1:q(r.y1)),c<g?(A=c,C="x0",S=g,N="x1"):(A=g,C="x1",S=c,N="x0"),!R&&f<v||R&&f>v?(D=f,M="y0",T=v,E="y1"):(D=v,M="y1",T=f,E="y0"),Y(n),J(s,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n),"paper"===a||s.autorange||(l+=a),u.setClipUrl(e,l?"clip"+r._fullLayout._uid+l:null,r)}(t,r,e),X.moveFn="move"===I?Z:K,X.altKey=n.altKey)},doneFn:function(){y(e)||(h(t),Q(s),x(t,e,r),n.call("_guiRelayout",e,l.getUpdateObj()))},clickFn:function(){y(e)||Q(s)}};function Y(r){if(y(e))I=null;else if(L)I="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&a>10&&i>10&&!r.shiftKey?p.getCursor(o/a,1-s/i):"move";h(t,l),I=l.split("-")[0]}}function Z(n,a){if("path"===r.type){var i=function(e){return e},o=i,l=i;P?B("xanchor",r.xanchor=W(b+n)):(o=function(e){return W(V(e)+n)},z&&"date"===z.type&&(o=m.encodeDate(o))),R?B("yanchor",r.yanchor=H(k+a)):(l=function(e){return H(q(e)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(O,o,l))}else P?B("xanchor",r.xanchor=W(b+n)):(B("x0",r.x0=W(c+n)),B("x1",r.x1=W(g+n))),R?B("yanchor",r.yanchor=H(k+a)):(B("y0",r.y0=H(f+a)),B("y1",r.y1=H(v+a)));t.attr("d",_(e,r)),J(s,r)}function K(n,a){if(F){var i=function(e){return e},o=i,l=i;P?B("xanchor",r.xanchor=W(b+n)):(o=function(e){return W(V(e)+n)},z&&"date"===z.type&&(o=m.encodeDate(o))),R?B("yanchor",r.yanchor=H(k+a)):(l=function(e){return H(q(e)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(O,o,l))}else if(L){if("resize-over-start-point"===I){var u=c+n,p=R?f-a:f+a;B("x0",r.x0=P?u:W(u)),B("y0",r.y0=R?p:H(p))}else if("resize-over-end-point"===I){var h=g+n,d=R?v-a:v+a;B("x1",r.x1=P?h:W(h)),B("y1",r.y1=R?d:H(d))}}else{var y=function(e){return-1!==I.indexOf(e)},x=y("n"),j=y("s"),$=y("w"),G=y("e"),X=x?D+a:D,Y=j?T+a:T,Z=$?A+n:A,K=G?S+n:S;R&&(x&&(X=D-a),j&&(Y=T-a)),(!R&&Y-X>10||R&&X-Y>10)&&(B(M,r[M]=R?X:H(X)),B(E,r[E]=R?Y:H(Y))),K-Z>10&&(B(C,r[C]=P?Z:W(Z)),B(N,r[N]=P?K:W(K)))}t.attr("d",_(e,r)),J(s,r)}function J(e,t){(P||R)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(P?t.xanchor:a.midRange(r?[t.x0,t.x1]:m.extractPathCoords(t.path,d.paramIsX))),o=q(R?t.yanchor:a.midRange(r?[t.y0,t.y1]:m.extractPathCoords(t.path,d.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),P&&R){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(P){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function Q(e){e.selectAll(".visual-cue").remove()}p.init(X),G.node().onmousemove=Y}(e,P,l,t,r,I):!0===l.editable&&P.style("pointer-events",N||c.opacity(S)*A<=.5?"stroke":"all");P.node().addEventListener("click",(function(){return function(e,t){if(v(e)){var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void k(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=k,g(e)}}}(e,P)}))}l._input&&!1!==l.visible&&("below"!==l.layer?D(e._fullLayout._shapeUpperLayer):"paper"===l.xref||"paper"===l.yref?D(e._fullLayout._shapeLowerLayer):b._hadPlotinfo?D((b.mainplotinfo||b).shapelayer):D(e._fullLayout._shapeLowerLayer))}function x(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,s,l,c,u,f,p=t.type,h=i.getRefType(t.xref),g=i.getRefType(t.yref),y=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),b=e._fullLayout._size;if(y?"domain"===h?n=function(e){return y._offset+y._length*e}:(r=m.shapePositionToRange(y),n=function(e){return y._offset+y.r2p(r(e,!0))}):n=function(e){return b.l+b.w*e},v?"domain"===g?s=function(e){return v._offset+v._length*(1-e)}:(o=m.shapePositionToRange(v),s=function(e){return v._offset+v.r2p(o(e,!0))}):s=function(e){return b.t+b.h*(1-e)},"path"===p)return y&&"date"===y.type&&(n=m.decodeDate(n)),v&&"date"===v.type&&(s=m.decodeDate(s)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,s=e.xanchor,l=e.yanchor;return n.replace(d.segmentRE,(function(e){var n=0,c=e.charAt(0),u=d.paramIsX[c],f=d.paramIsY[c],p=d.numParams[c],h=e.substr(1).replace(d.paramRE,(function(e){return u[n]?e="pixel"===i?t(s)+Number(e):t(e):f[n]&&(e="pixel"===o?r(l)-Number(e):r(e)),++n>p&&(e="X"),e}));return n>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+h}))}(t,n,s);if("pixel"===t.xsizemode){var x=n(t.xanchor);l=x+t.x0,c=x+t.x1}else l=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var _=s(t.yanchor);u=_-t.y0,f=_-t.y1}else u=s(t.y0),f=s(t.y1);if("line"===p)return"M"+l+","+u+"L"+c+","+f;if("rect"===p)return"M"+l+","+u+"H"+c+"V"+f+"H"+l+"Z";var w=(l+c)/2,k=(u+f)/2,D=Math.abs(w-l),T=Math.abs(k-u),A="A"+D+","+T,S=w+D+","+k;return"M"+S+A+" 0 1,1 "+w+","+(k-T)+A+" 0 0,1 "+S+"Z"}function w(e,t,r){return e.replace(d.segmentRE,(function(e){var n=0,a=e.charAt(0),i=d.paramIsX[a],o=d.paramIsY[a],s=d.numParams[a];return a+e.substr(1).replace(d.paramRE,(function(e){return n>=s||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function k(e){v(e)&&e._fullLayout._activeShapeIndex>=0&&(l(e),delete e._fullLayout._activeShapeIndex,g(e))}t.exports={draw:g,drawOne:b,eraseActiveShape:function(e){if(v(e)){l(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t<r.length){for(var a=[],i=0;i<r.length;i++)i!==t&&a.push(r[i]);delete e._fullLayout._activeShapeIndex,n.call("_guiRelayout",e,{shapes:a})}}}}},{"../../lib":503,"../../lib/setcursor":524,"../../plot_api/plot_template":543,"../../plots/cartesian/axes":554,"../../plots/cartesian/handle_outline":565,"../../registry":638,"../color":366,"../dragelement":385,"../drawing":388,"./constants":448,"./draw_newshape/display_outlines":454,"./draw_newshape/helpers":455,"./helpers":457}],451:[function(e,t,r){"use strict";var n=e("../../drawing/attributes").dash,a=e("../../../lib/extend").extendFlat;t.exports={newshape:{line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:0,dflt:4,editType:"none"},dash:a({},n,{dflt:"solid",editType:"none"}),editType:"none"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"none"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"none"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal",editType:"none"},editType:"none"},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":493,"../../drawing/attributes":387}],452:[function(e,t,r){"use strict";t.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}},{}],453:[function(e,t,r){"use strict";var n=e("../../color");t.exports=function(e,t,r){if(r("newshape.drawdirection"),r("newshape.layer"),r("newshape.fillcolor"),r("newshape.fillrule"),r("newshape.opacity"),r("newshape.line.width")){var a=(e||{}).plot_bgcolor||"#FFF";r("newshape.line.color",n.contrast(a)),r("newshape.line.dash")}r("activeshape.fillcolor"),r("activeshape.opacity")}},{"../../color":366}],454:[function(e,t,r){"use strict";var n=e("../../dragelement"),a=e("../../dragelement/helpers").drawMode,i=e("../../../registry"),o=e("./constants"),s=o.i000,l=o.i090,c=o.i180,u=o.i270,f=e("../../../plots/cartesian/handle_outline").clearOutlineControllers,p=e("./helpers"),h=p.pointsShapeRectangle,d=p.pointsShapeEllipse,m=p.writePaths,g=e("./newshapes");t.exports=function e(t,r,o,p){p||(p=0);var y=o.gd;function v(){e(t,r,o,p++),d(t[0])&&b({redrawing:!0})}function b(e){o.isActiveShape=!1;var t=g(r,o);Object.keys(t).length&&i.call((e||{}).redrawing?"relayout":"_guiRelayout",y,t)}var x,_,w,k,D,T=o.isActiveShape,A=y._fullLayout._zoomlayer,S=o.dragmode;function M(e){w=+e.srcElement.getAttribute("data-i"),k=+e.srcElement.getAttribute("data-j"),x[w][k].moveFn=E}function E(e,r){if(t.length){var n=D[w][k][1],a=D[w][k][2],i=t[w],o=i.length;if(h(i)){for(var s=0;s<o;s++)if(s!==k){var l=i[s];l[1]===i[k][1]&&(l[1]=n+e),l[2]===i[k][2]&&(l[2]=a+r)}if(i[k][1]=n+e,i[k][2]=a+r,!h(i))for(var c=0;c<o;c++)for(var u=0;u<i[c].length;u++)i[c][u]=D[w][c][u]}else i[k][1]=n+e,i[k][2]=a+r;v()}}function C(){b()}function N(e,r){if(2===e){w=+r.srcElement.getAttribute("data-i"),k=+r.srcElement.getAttribute("data-j");var n=t[w];h(n)||d(n)||function(){if(t.length&&t[w]&&t[w].length){for(var e=[],r=0;r<t[w].length;r++)r!==k&&e.push(t[w][r]);e.length>1&&(2!==e.length||"Z"!==e[1][0])&&(0===k&&(e[0][0]="M"),t[w]=e,v(),b())}}()}}function O(e,r){!function(e,r){if(t.length)for(var n=0;n<t.length;n++)for(var a=0;a<t[n].length;a++)for(var i=0;i+2<t[n][a].length;i+=2)t[n][a][i+1]=D[n][a][i+1]+e,t[n][a][i+2]=D[n][a][i+2]+r}(e,r),v()}a(S)?y._fullLayout._drawing=!0:y._fullLayout._activeShapeIndex>=0&&f(y),r.attr("d",m(t)),T&&!p&&(D=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];e[r]=[];for(var a=0;a<n.length;a++){e[r][a]=[];for(var i=0;i<n[a].length;i++)e[r][a][i]=n[a][i]}}return e}([],t),function(e){x=[];for(var r=0;r<t.length;r++){var a=t[r],i=!h(a)&&d(a);x[r]=[];for(var o=0;o<a.length;o++)if("Z"!==a[o][0]&&(!i||o===s||o===l||o===c||o===u)){var f=a[o][1],p=a[o][2],m=e.append("circle").classed("cursor-grab",!0).attr("data-i",r).attr("data-j",o).attr("cx",f).attr("cy",p).attr("r",4).style({"mix-blend-mode":"luminosity",fill:"black",stroke:"white","stroke-width":1});x[r][o]={element:m.node(),gd:y,prepFn:M,doneFn:C,clickFn:N},n.init(x[r][o])}}}(A.append("g").attr("class","outline-controllers")),_=[],t.length&&(_[0]={element:r[0][0],gd:y,prepFn:function(e){(w=+e.srcElement.getAttribute("data-i"))||(w=0),_[w].moveFn=O},doneFn:function(){b()}},n.init(_[0])))}},{"../../../plots/cartesian/handle_outline":565,"../../../registry":638,"../../dragelement":385,"../../dragelement/helpers":384,"./constants":452,"./helpers":455,"./newshapes":456}],455:[function(e,t,r){"use strict";var n=e("parse-svg-path"),a=e("./constants"),i=a.CIRCLE_SIDES,o=a.SQRT2,s=e("../../../plots/cartesian/helpers"),l=s.p2r,c=s.r2p,u=[0,3,4,5,6,1,2],f=[0,3,4,1,2];function p(e,t){return Math.abs(e-t)<=1e-6}function h(e,t){var r=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+n*n)}r.writePaths=function(e){var t=e.length;if(!t)return"M0,0Z";for(var r="",n=0;n<t;n++)for(var a=e[n].length,i=0;i<a;i++){var o=e[n][i][0];if("Z"===o)r+="Z";else for(var s=e[n][i].length,l=0;l<s;l++){var c=l;"Q"===o||"S"===o?c=f[l]:"C"===o&&(c=u[l]),r+=e[n][i][c],l>0&&l<s-1&&(r+=",")}}return r},r.readPaths=function(e,t,r,a){var o,s,u,f=n(e),p=[],h=-1,d=0,m=0,g=function(){s=d,u=m};g();for(var y=0;y<f.length;y++){var v,b,x,_,w=[],k=f[y][0],D=k;switch(k){case"M":p[++h]=[],d=+f[y][1],m=+f[y][2],w.push([D,d,m]),g();break;case"Q":case"S":v=+f[y][1],x=+f[y][2],d=+f[y][3],m=+f[y][4],w.push([D,d,m,v,x]);break;case"C":v=+f[y][1],x=+f[y][2],b=+f[y][3],_=+f[y][4],d=+f[y][5],m=+f[y][6],w.push([D,d,m,v,x,b,_]);break;case"T":case"L":d=+f[y][1],m=+f[y][2],w.push([D,d,m]);break;case"H":D="L",d=+f[y][1],w.push([D,d,m]);break;case"V":D="L",m=+f[y][1],w.push([D,d,m]);break;case"A":D="L";var T=+f[y][1],A=+f[y][2];+f[y][4]||(T=-T,A=-A);var S=d-T,M=m;for(o=1;o<=i/2;o++){var E=2*Math.PI*o/i;w.push([D,S+T*Math.cos(E),M+A*Math.sin(E)])}break;case"Z":d===s&&m===u||(d=s,m=u,w.push([D,d,m]))}for(var C=(r||{}).domain,N=t._fullLayout._size,O=r&&"pixel"===r.xsizemode,I=r&&"pixel"===r.ysizemode,P=!1===a,R=0;R<w.length;R++){for(o=0;o+2<7;o+=2){var L=w[R][o+1],F=w[R][o+2];void 0!==L&&void 0!==F&&(d=L,m=F,r&&(r.xaxis&&r.xaxis.p2r?(P&&(L-=r.xaxis._offset),L=O?c(r.xaxis,r.xanchor)+L:l(r.xaxis,L)):(P&&(L-=N.l),C?L=C.x[0]+L/N.w:L/=N.w),r.yaxis&&r.yaxis.p2r?(P&&(F-=r.yaxis._offset),F=I?c(r.yaxis,r.yanchor)-F:l(r.yaxis,F)):(P&&(F-=N.t),F=C?C.y[1]-F/N.h:1-F/N.h)),w[R][o+1]=L,w[R][o+2]=F)}p[h].push(w[R].slice())}}return p},r.pointsShapeRectangle=function(e){if(5!==e.length)return!1;for(var t=1;t<3;t++){if(!p(e[0][t]-e[1][t],e[3][t]-e[2][t]))return!1;if(!p(e[0][t]-e[3][t],e[1][t]-e[2][t]))return!1}return!(!p(e[0][1],e[1][1])&&!p(e[0][1],e[3][1])||!(h(e[0],e[1])*h(e[0],e[3])))},r.pointsShapeEllipse=function(e){var t=e.length;if(t!==i+1)return!1;t=i;for(var r=0;r<t;r++){var n=(2*t-r)%t,a=(t/2+n)%t,o=(t/2+r)%t;if(!p(h(e[r],e[o]),h(e[n],e[a])))return!1}return!0},r.handleEllipse=function(e,t,n){if(!e)return[t,n];var a=r.ellipseOver({x0:t[0],y0:t[1],x1:n[0],y1:n[1]}),s=(a.x1+a.x0)/2,l=(a.y1+a.y0)/2,c=(a.x1-a.x0)/2,u=(a.y1-a.y0)/2;c||(c=u/=o),u||(u=c/=o);for(var f=[],p=0;p<i;p++){var h=2*p*Math.PI/i;f.push([s+c*Math.cos(h),l+u*Math.sin(h)])}return f},r.ellipseOver=function(e){var t=e.x0,r=e.y0,n=e.x1,a=e.y1,i=n-t,s=a-r,l=((t-=i)+n)/2,c=((r-=s)+a)/2;return{x0:l-(i*=o),y0:c-(s*=o),x1:l+i,y1:c+s}}},{"../../../plots/cartesian/helpers":566,"./constants":452,"parse-svg-path":250}],456:[function(e,t,r){"use strict";var n=e("../../dragelement/helpers"),a=n.drawMode,i=n.openMode,o=e("./constants"),s=o.i000,l=o.i090,c=o.i180,u=o.i270,f=o.cos45,p=o.sin45,h=e("../../../plots/cartesian/helpers"),d=h.p2r,m=h.r2p,g=e("../../../plots/cartesian/handle_outline").clearSelect,y=e("./helpers"),v=y.readPaths,b=y.writePaths,x=y.ellipseOver;t.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var n=r.getAttribute("d"),o=t.gd,h=o._fullLayout.newshape,y=t.plotinfo,_=y.xaxis,w=y.yaxis,k=!!y.domain||!y.xaxis,D=!!y.domain||!y.yaxis,T=t.isActiveShape,A=t.dragmode,S=(o.layout||{}).shapes||[];if(!a(A)&&void 0!==T){var M=o._fullLayout._activeShapeIndex;if(M<S.length)switch(o._fullLayout.shapes[M].type){case"rect":A="drawrect";break;case"circle":A="drawcircle";break;case"line":A="drawline";break;case"path":var E=S[M].path||"";A="Z"===E[E.length-1]?"drawclosedpath":"drawopenpath"}}var C,N=i(A),O=v(n,o,y,T),I={editable:!0,xref:k?"paper":_._id,yref:D?"paper":w._id,layer:h.layer,opacity:h.opacity,line:{color:h.line.color,width:h.line.width,dash:h.line.dash}};if(N||(I.fillcolor=h.fillcolor,I.fillrule=h.fillrule),1===O.length&&(C=O[0]),C&&"drawrect"===A)I.type="rect",I.x0=C[0][1],I.y0=C[0][2],I.x1=C[2][1],I.y1=C[2][2];else if(C&&"drawline"===A)I.type="line",I.x0=C[0][1],I.y0=C[0][2],I.x1=C[1][1],I.y1=C[1][2];else if(C&&"drawcircle"===A){I.type="circle";var P=C[s][1],R=C[l][1],L=C[c][1],F=C[u][1],B=C[s][2],z=C[l][2],j=C[c][2],U=C[u][2],$=y.xaxis&&("date"===y.xaxis.type||"log"===y.xaxis.type),V=y.yaxis&&("date"===y.yaxis.type||"log"===y.yaxis.type);$&&(P=m(y.xaxis,P),R=m(y.xaxis,R),L=m(y.xaxis,L),F=m(y.xaxis,F)),V&&(B=m(y.yaxis,B),z=m(y.yaxis,z),j=m(y.yaxis,j),U=m(y.yaxis,U));var q=(R+F)/2,W=(B+j)/2,H=x({x0:q,y0:W,x1:q+(F-R+L-P)/2*f,y1:W+(U-z+j-B)/2*p});$&&(H.x0=d(y.xaxis,H.x0),H.x1=d(y.xaxis,H.x1)),V&&(H.y0=d(y.yaxis,H.y0),H.y1=d(y.yaxis,H.y1)),I.x0=H.x0,I.y0=H.y0,I.x1=H.x1,I.y1=H.y1}else I.type="path",_&&w&&function(e,t,r){var n="date"===t.type,a="date"===r.type;if(!n&&!a)return e;for(var i=0;i<e.length;i++)for(var o=0;o<e[i].length;o++)for(var s=0;s+2<e[i][o].length;s+=2)n&&(e[i][o][s+1]=e[i][o][s+1].replace(" ","_")),a&&(e[i][o][s+2]=e[i][o][s+2].replace(" ","_"))}(O,_,w),I.path=b(O),C=null;g(o);for(var G=t.editHelpers,X=(G||{}).modifyItem,Y=[],Z=0;Z<S.length;Z++){var K=o._fullLayout.shapes[Z];if(Y[Z]=K._input,void 0!==T&&Z===o._fullLayout._activeShapeIndex){var J=I;switch(K.type){case"line":case"rect":case"circle":X("x0",J.x0),X("x1",J.x1),X("y0",J.y0),X("y1",J.y1);break;case"path":X("path",J.path)}}}return void 0===T?(Y.push(I),Y):G?G.getUpdateObj():{}}}}},{"../../../plots/cartesian/handle_outline":565,"../../../plots/cartesian/helpers":566,"../../dragelement/helpers":384,"./constants":452,"./helpers":455}],457:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../lib");r.rangeToShapePosition=function(e){return"log"===e.type?e.r2d:function(e){return e}},r.shapePositionToRange=function(e){return"log"===e.type?e.d2r:function(e){return e}},r.decodeDate=function(e){return function(t){return t.replace&&(t=t.replace("_"," ")),e(t)}},r.encodeDate=function(e){return function(t){return e(t).replace(" ","_")}},r.extractPathCoords=function(e,t){var r=[];return e.match(n.segmentRE).forEach((function(e){var i=t[e.charAt(0)].drawn;if(void 0!==i){var o=e.substr(1).match(n.paramRE);!o||o.length<i||r.push(a.cleanNumber(o[i]))}})),r},r.getDataToPixel=function(e,t,n,a){var i,o=e._fullLayout._size;if(t)if("domain"===a)i=function(e){return t._length*(n?1-e:e)+t._offset};else{var s=r.shapePositionToRange(t);i=function(e){return t._offset+t.r2p(s(e,!0))},"date"===t.type&&(i=r.decodeDate(i))}else i=n?function(e){return o.t+o.h*(1-e)}:function(e){return o.l+o.w*e};return i},r.getPixelToData=function(e,t,n,a){var i,o=e._fullLayout._size;if(t)if("domain"===a)i=function(e){var r=(e-t._offset)/t._length;return n?1-r:r};else{var s=r.rangeToShapePosition(t);i=function(e){return s(t.p2r(e-t._offset))}}else i=n?function(e){return 1-(e-o.t)/o.h}:function(e){return(e-o.l)/o.w};return i},r.roundPositionForSharpStrokeRendering=function(e,t){var r=1===Math.round(t%2),n=Math.round(e);return r?n+.5:n},r.makeOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.shapes[t]||{},n=e._fullLayout._plots[r.xref+r.yref];return n?n._hadPlotinfo=!0:(n={},r.xref&&"paper"!==r.xref&&(n.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&"paper"!==r.yref&&(n.yaxis=e._fullLayout[r.yref+"axis"])),n.xsizemode=r.xsizemode,n.ysizemode=r.ysizemode,n.xanchor=r.xanchor,n.yanchor=r.yanchor,{options:r,plotinfo:n}}},{"../../lib":503,"./constants":448}],458:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),supplyDrawNewShapeDefaults:e("./draw_newshape/defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":567,"./attributes":446,"./calc_autorange":447,"./defaults":449,"./draw":450,"./draw_newshape/defaults":453}],459:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/pad_attributes"),i=e("../../lib/extend").extendDeepAll,o=e("../../plot_api/edit_types").overrideAll,s=e("../../plots/animation_attributes"),l=e("../../plot_api/plot_template").templatedArray,c=e("./constants"),u=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});t.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plot_api/plot_template":543,"../../plots/animation_attributes":548,"../../plots/font_attributes":585,"../../plots/pad_attributes":618,"./constants":460}],460:[function(e,t,r){"use strict";t.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],461:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,s=i.steps;function l(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}for(var s=a(e,t,{name:"steps",handleItemDefaults:c}),l=0,u=0;u<s.length;u++)s[u].visible&&l++;if(l<2?t.visible=!1:o("visible")){t._stepCount=l;var f=t._visibleSteps=n.filterVisible(s);(s[o("active")]||{}).visible||(t.active=f[0]._index),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("len"),o("lenmode"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("currentvalue.visible")&&(o("currentvalue.xanchor"),o("currentvalue.prefix"),o("currentvalue.suffix"),o("currentvalue.offset"),n.coerceFont(o,"currentvalue.font",t.font)),o("transition.duration"),o("transition.easing"),o("bgcolor"),o("activebgcolor"),o("bordercolor"),o("borderwidth"),o("ticklen"),o("tickwidth"),o("tickcolor"),o("minorticklen")}}function c(e,t){function r(r,a){return n.coerce(e,t,s,r,a)}if("skip"===e.method||Array.isArray(e.args)?r("visible"):t.visible=!1){r("method"),r("args");var a=r("label","step-"+t._index);r("value",a),r("execute")}}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:l})}},{"../../lib":503,"../../plots/array_container_defaults":549,"./attributes":459,"./constants":460}],462:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),s=e("../../lib"),l=s.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../plot_api/plot_template").arrayEditor,f=e("./constants"),p=e("../../constants/alignment"),h=p.LINE_SPACING,d=p.FROM_TL,m=p.FROM_BR;function g(e){return f.autoMarginIdRoot+e._index}function y(e){return e._index}function v(e,t){var r=o.tester.selectAll("g."+f.labelGroupClass).data(t._visibleSteps);r.enter().append("g").classed(f.labelGroupClass,!0);var i=0,l=0;r.each((function(e){var r=_(n.select(this),{step:e},t).node();if(r){var a=o.bBox(r);l=Math.max(l,a.height),i=Math.max(i,a.width)}})),r.remove();var u=t._dims={};u.inputAreaWidth=Math.max(f.railWidth,f.gripHeight);var p=e._fullLayout._size;u.lx=p.l+p.w*t.x,u.ly=p.t+p.h*(1-t.y),"fraction"===t.lenmode?u.outerLength=Math.round(p.w*t.len):u.outerLength=t.len,u.inputAreaStart=0,u.inputAreaLength=Math.round(u.outerLength-t.pad.l-t.pad.r);var h=(u.inputAreaLength-2*f.stepInset)/(t._stepCount-1),y=i+f.labelPadding;if(u.labelStride=Math.max(1,Math.ceil(y/h)),u.labelHeight=l,u.currentValueMaxWidth=0,u.currentValueHeight=0,u.currentValueTotalHeight=0,u.currentValueMaxLines=1,t.currentvalue.visible){var v=o.tester.append("g");r.each((function(e){var r=b(v,t,e.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},a=c.lineCount(r);u.currentValueMaxWidth=Math.max(u.currentValueMaxWidth,Math.ceil(n.width)),u.currentValueHeight=Math.max(u.currentValueHeight,Math.ceil(n.height)),u.currentValueMaxLines=Math.max(u.currentValueMaxLines,a)})),u.currentValueTotalHeight=u.currentValueHeight+t.currentvalue.offset,v.remove()}u.height=u.currentValueTotalHeight+f.tickOffset+t.ticklen+f.labelOffset+u.labelHeight+t.pad.t+t.pad.b;var x="left";s.isRightAnchor(t)&&(u.lx-=u.outerLength,x="right"),s.isCenterAnchor(t)&&(u.lx-=u.outerLength/2,x="center");var w="top";s.isBottomAnchor(t)&&(u.ly-=u.height,w="bottom"),s.isMiddleAnchor(t)&&(u.ly-=u.height/2,w="middle"),u.outerLength=Math.ceil(u.outerLength),u.height=Math.ceil(u.height),u.lx=Math.round(u.lx),u.ly=Math.round(u.ly);var k={y:t.y,b:u.height*m[w],t:u.height*d[w]};"fraction"===t.lenmode?(k.l=0,k.xl=t.x-t.len*d[x],k.r=0,k.xr=t.x+t.len*m[x]):(k.x=t.x,k.l=u.outerLength*d[x],k.r=u.outerLength*m[x]),a.autoMargin(e,g(t),k)}function b(e,t,r){if(t.currentvalue.visible){var n,a,i=t._dims;switch(t.currentvalue.xanchor){case"right":n=i.inputAreaLength-f.currentValueInset-i.currentValueMaxWidth,a="left";break;case"center":n=.5*i.inputAreaLength,a="middle";break;default:n=f.currentValueInset,a="left"}var l=s.ensureSingle(e,"text",f.labelClass,(function(e){e.attr({"text-anchor":a,"data-notex":1})})),u=t.currentvalue.prefix?t.currentvalue.prefix:"";if("string"==typeof r)u+=r;else{var p=t.steps[t.active].label,d=t._gd._fullLayout._meta;d&&(p=s.templateString(p,d)),u+=p}t.currentvalue.suffix&&(u+=t.currentvalue.suffix),l.call(o.font,t.currentvalue.font).text(u).call(c.convertToTspans,t._gd);var m=c.lineCount(l),g=(i.currentValueMaxLines+1-m)*t.currentvalue.font.size*h;return c.positionText(l,n,g),l}}function x(e,t,r){s.ensureSingle(e,"rect",f.gripRectClass,(function(n){n.call(T,t,e,r).style("pointer-events","all")})).attr({width:f.gripWidth,height:f.gripHeight,rx:f.gripRadius,ry:f.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function _(e,t,r){var n=s.ensureSingle(e,"text",f.labelClass,(function(e){e.attr({"text-anchor":"middle","data-notex":1})})),a=t.step.label,i=r._gd._fullLayout._meta;return i&&(a=s.templateString(a,i)),n.call(o.font,r.font).text(a).call(c.convertToTspans,r._gd),n}function w(e,t){var r=s.ensureSingle(e,"g",f.labelsClass),a=t._dims,i=r.selectAll("g."+f.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(f.labelGroupClass,!0),i.exit().remove(),i.each((function(e){var r=n.select(this);r.call(_,e,t),o.setTranslate(r,M(t,e.fraction),f.tickOffset+t.ticklen+t.font.size*h+f.labelOffset+a.currentValueTotalHeight)}))}function k(e,t,r,n,a){var i=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[i]._index;o!==r.active&&D(e,t,r,o,!0,a)}function D(e,t,r,n,i,o){var s=r.active;r.active=n,u(e.layout,f.name,r).applyUpdate("active",n);var l=r.steps[r.active];t.call(S,r,o),t.call(b,r),e.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:s}),l&&l.method&&i&&(t._nextMethod?(t._nextMethod.step=l,t._nextMethod.doCallback=i,t._nextMethod.doTransition=o):(t._nextMethod={step:l,doCallback:i,doTransition:o},t._nextMethodRaf=window.requestAnimationFrame((function(){var r=t._nextMethod.step;r.method&&(r.execute&&a.executeAPICommand(e,r.method,r.args),t._nextMethod=null,t._nextMethodRaf=null)}))))}function T(e,t,r){var a=r.node(),o=n.select(t);function s(){return r.data()[0]}function l(){var e=s();t.emit("plotly_sliderstart",{slider:e});var l=r.select("."+f.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),l.call(i.fill,e.activebgcolor);var c=E(e,n.mouse(a)[0]);function u(){var e=s(),i=E(e,n.mouse(a)[0]);k(t,r,e,i,!1)}function p(){var e=s();e._dragging=!1,l.call(i.fill,e.bgcolor),o.on("mouseup",null),o.on("mousemove",null),o.on("touchend",null),o.on("touchmove",null),t.emit("plotly_sliderend",{slider:e,step:e.steps[e.active]})}k(t,r,e,c,!0),e._dragging=!0,o.on("mousemove",u),o.on("touchmove",u),o.on("mouseup",p),o.on("touchend",p)}e.on("mousedown",l),e.on("touchstart",l)}function A(e,t){var r=e.selectAll("rect."+f.tickRectClass).data(t._visibleSteps),a=t._dims;r.enter().append("rect").classed(f.tickRectClass,!0),r.exit().remove(),r.attr({width:t.tickwidth+"px","shape-rendering":"crispEdges"}),r.each((function(e,r){var s=r%a.labelStride==0,l=n.select(this);l.attr({height:s?t.ticklen:t.minorticklen}).call(i.fill,t.tickcolor),o.setTranslate(l,M(t,r/(t._stepCount-1))-.5*t.tickwidth,(s?f.tickOffset:f.minorTickOffset)+a.currentValueTotalHeight)}))}function S(e,t,r){for(var n=e.select("rect."+f.gripRectClass),a=0,i=0;i<t._stepCount;i++)if(t._visibleSteps[i]._index===t.active){a=i;break}var o=M(t,a/(t._stepCount-1));if(!t._invokingCommand){var s=n;r&&t.transition.duration>0&&(s=s.transition().duration(t.transition.duration).ease(t.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function M(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function E(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=s.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(T,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function N(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=s.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.name],n=[],a=0;a<r.length;a++){var i=r[a];i.visible&&(i._gd=t,n.push(i))}return n}(t,e),i=t._infolayer.selectAll("g."+f.containerClassName).data(r.length>0?[0]:[]);function s(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+f.groupClassName).data(r,y);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c<r.length;c++){var u=r[c];v(e,u)}l.each((function(t){var r=n.select(this);!function(e){var t=e._dims;t.labelSteps=[];for(var r=e._stepCount,n=0;n<r;n+=t.labelStride)t.labelSteps.push({fraction:n/(r-1),step:e._visibleSteps[n]})}(t),a.manageCommandObserver(e,t,t._visibleSteps,(function(t){var n=r.data()[0];n.active!==t.index&&(n._dragging||D(e,r,n,t.index,!1,!0))})),function(e,t,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index),t.call(b,r).call(N,r).call(w,r).call(A,r).call(C,e,r).call(x,e,r);var n=r._dims;o.setTranslate(t,n.lx+r.pad.l,n.ly+r.pad.t),t.call(S,r,!1),t.call(b,r)}(e,n.select(this),t)}))}}},{"../../constants/alignment":471,"../../lib":503,"../../lib/svg_text_utils":529,"../../plot_api/plot_template":543,"../../plots/plots":619,"../color":366,"../drawing":388,"./constants":460,"@plotly/d3":58}],463:[function(e,t,r){"use strict";var n=e("./constants");t.exports={moduleType:"component",name:n.name,layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),draw:e("./draw")}},{"./attributes":459,"./constants":460,"./defaults":461,"./draw":462}],464:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),s=e("../../lib"),l=s.strTranslate,c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),p=e("../../constants/interactions"),h=e("../../constants/alignment").OPPOSITE_SIDE,d=/ [XY][0-9]* /;t.exports={draw:function(e,t,r){var m,g=r.propContainer,y=r.propName,v=r.placeholder,b=r.traceIndex,x=r.avoid||{},_=r.attributes,w=r.transform,k=r.containerGroup,D=e._fullLayout,T=1,A=!1,S=g.title,M=(S&&S.text?S.text:"").trim(),E=S&&S.font?S.font:{},C=E.family,N=E.size,O=E.color;"title.text"===y?m="titleText":-1!==y.indexOf("axis")?m="axisTitleText":y.indexOf(!0)&&(m="colorbarTitleText");var I=e._context.edits[m];""===M?T=0:M.replace(d," % ")===v.replace(d," % ")&&(T=.2,A=!0,I||(M="")),r._meta?M=s.templateString(M,r._meta):D._meta&&(M=s.templateString(M,D._meta));var P,R=M||I;k||(k=s.ensureSingle(D._infolayer,"g","g-"+t),P=D._hColorbarMoveTitle);var L=k.selectAll("text").data(R?[0]:[]);if(L.enter().append("text"),L.text(M).attr("class",t),L.exit().remove(),!R)return k;function F(e){s.syncOrAsync([B,z],e)}function B(t){var r;return!w&&P&&(w={}),w?(r="",w.rotate&&(r+="rotate("+[w.rotate,_.x,_.y]+")"),(w.offset||P)&&(r+=l(0,(w.offset||0)-(P||0)))):r=null,t.attr("transform",r),t.style({"font-family":C,"font-size":n.round(N,2)+"px",fill:u.rgb(O),opacity:T*u.opacity(O),"font-weight":i.fontWeight}).attr(_).call(f.convertToTspans,e),i.previousPromises(e)}function z(e){var t=n.select(e.node().parentNode);if(x&&x.selection&&x.side&&M){t.attr("transform",null);var r=h[x.side],i="left"===x.side||"top"===x.side?-1:1,o=a(x.pad)?x.pad:2,u=c.bBox(t.node()),f={left:0,top:0,right:D.width,bottom:D.height},p=x.maxShift||i*(f[x.side]-u[x.side]),d=0;if(p<0)d=p;else{var m=x.offsetLeft||0,g=x.offsetTop||0;u.left-=m,u.right-=m,u.top-=g,u.bottom-=g,x.selection.each((function(){var e=c.bBox(this);s.bBoxIntersect(u,e,o)&&(d=Math.max(d,i*(e[x.side]-u[r])+o))})),d=Math.min(p,d)}if(d>0||p<0){var y={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[x.side];t.attr("transform",l(y[0],y[1]))}}}return L.call(F),I&&(M?L.on(".opacity",null):(T=0,A=!0,L.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(p.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(p.HIDE_PLACEHOLDER).style("opacity",0)}))),L.call(f.makeEditable,{gd:e}).on("edit",(function(t){void 0!==b?o.call("_guiRestyle",e,y,t,b):o.call("_guiRelayout",e,y,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),L.classed("js-placeholder",A),k}}},{"../../constants/alignment":471,"../../constants/interactions":478,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/plots":619,"../../registry":638,"../color":366,"../drawing":388,"@plotly/d3":58,"fast-isnumeric":190}],465:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,s=e("../../plots/pad_attributes"),l=e("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plot_api/plot_template":543,"../../plots/font_attributes":585,"../../plots/pad_attributes":618,"../color/attributes":365}],466:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:"  "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}},{}],467:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,s=i.buttons;function l(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,s,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:l})}},{"../../lib":503,"../../plots/array_container_defaults":549,"./attributes":465,"./constants":466}],468:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),s=e("../../lib"),l=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),p=e("./scrollbox");function h(e){return e._index}function d(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function m(e,t,r,n,a,i,o,s){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?y(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),g(e,n,a,i,t),s||y(e,n,a,i,t))}function g(e,t,r,n,a){var i=s.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),l=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,p={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},h={width:l.headerWidth,height:l.headerHeight};i.call(v,a,u,e).call(A,a,p,h),s.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+a.pad.l,y:l.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(S,String(d(r,a)?-1:a._index)),y(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(k,a)})),o.setTranslate(t,l.lx,l.ly)}function y(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var l=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(s.filterVisible(l)),p=u.enter().append("g").classed(c,!0),h=u.exit();"dropdown"===o.type?(p.attr("opacity","0").transition().attr("opacity","1"),h.transition().attr("opacity","0").remove()):h.remove();var d=0,g=0,y=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?g=y.headerHeight+f.gapButtonHeader:d=y.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-y.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-y.openWidth);var x={x:y.lx+d+o.pad.l,y:y.ly+g+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},D={l:x.x+o.borderwidth,t:x.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(v,o,s,e).call(A,o,x),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(e,o,0,t,r,i,-1),a.executeAPICommand(e,s.method,s.args2)):(m(e,o,0,t,r,i,l),a.executeAPICommand(e,s.method,s.args))),e.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(k,o),u.call(_,o)}))})),u.call(_,o),b?(D.w=Math.max(y.openWidth,y.headerWidth),D.h=x.y-D.t):(D.w=x.x-D.l,D.h=Math.max(y.openHeight,y.headerHeight)),D.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,s,l,c=a.direction,u="up"===c||"down"===c,p=a._dims,h=a.active;if(u)for(s=0,l=0;l<h;l++)s+=p.heights[l]+f.gapButton;else for(o=0,l=0;l<h;l++)o+=p.widths[l]+f.gapButton;n.enable(i,o,s),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1"),n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,i,o,D):function(e){var t=!!e.hbar,r=!!e.vbar;t&&e.hbar.transition().attr("opacity","0").each("end",(function(){t=!1,r||e.disable()})),r&&e.vbar.transition().attr("opacity","0").each("end",(function(){r=!1,t||e.disable()}))}(i))}function v(e,t,r,n){e.call(b,t).call(x,t,r,n)}function b(e,t){s.ensureSingle(e,"rect",f.itemRectClassName,(function(e){e.attr({rx:f.rx,ry:f.ry,"shape-rendering":"crispEdges"})})).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px")}function x(e,t,r,n){var a=s.ensureSingle(e,"text",f.itemTextClassName,(function(e){e.attr({"text-anchor":"start","data-notex":1})})),i=r.label,c=n._fullLayout._meta;c&&(i=s.templateString(i,c)),a.call(o.font,t.font).text(i).call(l.convertToTspans,n)}function _(e,t){var r=t.active;e.each((function(e,a){var o=n.select(this);a===r&&t.showactive&&o.select("rect."+f.itemRectClassName).call(i.fill,f.activeColor)}))}function w(e){e.select("rect."+f.itemRectClassName).call(i.fill,f.hoverColor)}function k(e,t){e.select("rect."+f.itemRectClassName).call(i.fill,t.bgcolor)}function D(e,t){var r=t._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},i=o.tester.selectAll("g."+f.dropdownButtonClassName).data(s.filterVisible(t.buttons));i.enter().append("g").classed(f.dropdownButtonClassName,!0);var c=-1!==["up","down"].indexOf(t.direction);i.each((function(a,i){var s=n.select(this);s.call(v,t,a,e);var p=s.select("."+f.itemTextClassName),h=p.node()&&o.bBox(p.node()).width,d=Math.max(h+f.textPadX,f.minWidth),m=t.font.size*u,g=l.lineCount(p),y=Math.max(m*g,f.minHeight)+f.textOffsetY;y=Math.ceil(y),d=Math.ceil(d),r.widths[i]=d,r.heights[i]=y,r.height1=Math.max(r.height1,y),r.width1=Math.max(r.width1,d),c?(r.totalWidth=Math.max(r.totalWidth,d),r.openWidth=r.totalWidth,r.totalHeight+=y+f.gapButton,r.openHeight+=y+f.gapButton):(r.totalWidth+=d+f.gapButton,r.openWidth+=d+f.gapButton,r.totalHeight=Math.max(r.totalHeight,y),r.openHeight=r.totalHeight)})),c?r.totalHeight-=f.gapButton:r.totalWidth-=f.gapButton,r.headerWidth=r.width1+f.arrowPadX,r.headerHeight=r.height1,"dropdown"===t.type&&(c?(r.width1+=f.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=f.arrowPadX),i.remove();var p=r.totalWidth+t.pad.l+t.pad.r,h=r.totalHeight+t.pad.t+t.pad.b,d=e._fullLayout._size;r.lx=d.l+d.w*t.x,r.ly=d.t+d.h*(1-t.y);var m="left";s.isRightAnchor(t)&&(r.lx-=p,m="right"),s.isCenterAnchor(t)&&(r.lx-=p/2,m="center");var g="top";s.isBottomAnchor(t)&&(r.ly-=h,g="bottom"),s.isMiddleAnchor(t)&&(r.ly-=h/2,g="middle"),r.totalWidth=Math.ceil(r.totalWidth),r.totalHeight=Math.ceil(r.totalHeight),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),a.autoMargin(e,T(t),{x:t.x,y:t.y,l:p*({right:1,center:.5}[m]||0),r:p*({left:1,center:.5}[m]||0),b:h*({top:1,middle:.5}[g]||0),t:h*({bottom:1,middle:.5}[g]||0)})}function T(e){return f.autoMarginIdRoot+e._index}function A(e,t,r,n){n=n||{};var a=e.select("."+f.itemRectClassName),i=e.select("."+f.itemTextClassName),s=t.borderwidth,c=r.index,p=t._dims;o.setTranslate(e,s+r.x,s+r.y);var h=-1!==["up","down"].indexOf(t.direction),d=n.height||(h?p.heights[c]:p.height1);a.attr({x:0,y:0,width:n.width||(h?p.width1:p.widths[c]),height:d});var m=t.font.size*u,g=(l.lineCount(i)-1)*m/2;l.positionText(i,f.textOffsetX,d/2-g+f.textOffsetY),h?r.y+=p.heights[c]+r.yPad:r.x+=p.widths[c]+r.xPad,r.index++}function S(e,t){e.attr(f.menuIndexAttrName,t||"-1").selectAll("g."+f.dropdownButtonClassName).remove()}t.exports=function(e){var t=e._fullLayout,r=s.filterVisible(t[f.name]);function i(t){a.autoMargin(e,T(t))}var o=t._menulayer.selectAll("g."+f.containerClassName).data(r.length>0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,h);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;u<r.length;u++){var v=r[u];D(e,v)}var b="updatemenus"+t._uid,x=new p(e,c,b);l.enter().size()&&(c.node().parentNode.appendChild(c.node()),c.call(S)),l.exit().each((function(e){c.call(S),i(e)})).remove(),l.each((function(t){var r=n.select(this),i="dropdown"===t.type?c:null;a.manageCommandObserver(e,t,t.buttons,(function(n){m(e,t,t.buttons[n.index],r,i,x,n.index,!0)})),"dropdown"===t.type?(g(e,r,c,x,t),d(c,t)&&y(e,r,c,x,t)):y(e,r,null,null,t)}))}}},{"../../constants/alignment":471,"../../lib":503,"../../lib/svg_text_utils":529,"../../plot_api/plot_template":543,"../../plots/plots":619,"../color":366,"../drawing":388,"./constants":466,"./scrollbox":470,"@plotly/d3":58}],469:[function(e,t,r){arguments[4][463][0].apply(r,arguments)},{"./attributes":465,"./constants":466,"./defaults":467,"./draw":468,dup:463}],470:[function(e,t,r){"use strict";t.exports=s;var n=e("@plotly/d3"),a=e("../color"),i=e("../drawing"),o=e("../../lib");function s(e,t,r){this.gd=e,this.container=t,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}s.barWidth=2,s.barLength=20,s.barRadius=2,s.barPad=1,s.barColor="#808BA4",s.prototype.enable=function(e,t,r){var o=this.gd._fullLayout,l=o.width,c=o.height;this.position=e;var u,f,p,h,d=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,b="down"===v,x="left"===v,_="up"===v,w=m,k=y;b||x||"right"===v||_||(this.position.direction="down",b=!0),b||_?(f=(u=d)+w,b?(p=g,k=(h=Math.min(p+k,c))-p):k=(h=g+k)-(p=Math.max(h-k,0))):(h=(p=g)+k,x?w=(f=d+w)-(u=Math.max(f-w,0)):(u=d,w=(f=Math.min(u+w,l))-u)),this._box={l:u,t:p,w,h:k};var D=m>w,T=s.barLength+2*s.barPad,A=s.barWidth+2*s.barPad,S=d,M=g+y;M+A>c&&(M=c-A);var E=this.container.selectAll("rect.scrollbar-horizontal").data(D?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),D?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:M,width:T,height:A}),this._hbarXMin=S+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=y>k,N=s.barWidth+2*s.barPad,O=s.barLength+2*s.barPad,I=d+m,P=g;I+N>l&&(I=l-N);var R=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),C?(this.vbar=R.attr({rx:s.barRadius,ry:s.barRadius,x:I,y:P,width:N,height:O}),this._vbarYMin=P+O/2,this._vbarTranslateMax=k-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var L=this.id,F=u-.5,B=C?f+N+.5:f+.5,z=p-.5,j=D?h+A+.5:h+.5,U=o._topdefs.selectAll("#"+L).data(D||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",L).append("rect"),D||C?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(z),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(z)}),this.container.call(i.setClipUrl,L,this.gd),this.bg.attr({x:d,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),D||C){var $=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call($);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));D&&this.hbar.on(".drag",null).call(V),C&&this.vbar.on(".drag",null).call(V)}this.setTranslate(t,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},s.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},s.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,s=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},s.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var s=t/n;this.vbar.call(i.setTranslate,e,t+s*this._vbarTranslateMax)}}},{"../../lib":503,"../color":366,"../drawing":388,"@plotly/d3":58}],471:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],472:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],473:[function(e,t,r){"use strict";t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}},{}],474:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],475:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],476:[function(e,t,r){"use strict";t.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],477:[function(e,t,r){"use strict";t.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}},{}],478:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],479:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"−"}},{}],480:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],481:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),s=0;s<o.length;s++){var l=o[s];"_"!==l.charAt(0)&&(r[l]=i[l]),a({moduleType:"apiMethod",name:l,fn:i[l]})}a(e("./traces/scatter")),a([e("./components/legend"),e("./components/fx"),e("./components/annotations"),e("./components/annotations3d"),e("./components/shapes"),e("./components/images"),e("./components/updatemenus"),e("./components/sliders"),e("./components/rangeslider"),e("./components/rangeselector"),e("./components/grid"),e("./components/errorbars"),e("./components/colorscale"),e("./components/colorbar"),e("./components/modebar")]),a([e("./locale-en"),e("./locale-en-us")]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(a(window.PlotlyLocales),delete window.PlotlyLocales),r.Icons=e("./fonts/ploticon");var c=e("./components/fx"),u=e("./plots/plots");r.Plots={resize:u.resize,graphJson:u.graphJson,sendDataToCloud:u.sendDataToCloud},r.Fx={hover:c.hover,unhover:c.unhover,loneHover:c.loneHover,loneUnhover:c.loneUnhover},r.Snapshot=e("./snapshot"),r.PlotSchema=e("./plot_api/plot_schema")},{"../build/plotcss":1,"./components/annotations":357,"./components/annotations3d":362,"./components/colorbar":372,"./components/colorscale":378,"./components/errorbars":394,"./components/fx":406,"./components/grid":410,"./components/images":415,"./components/legend":423,"./components/modebar":429,"./components/rangeselector":437,"./components/rangeslider":444,"./components/shapes":458,"./components/sliders":463,"./components/updatemenus":469,"./fonts/ploticon":482,"./locale-en":534,"./locale-en-us":533,"./plot_api":538,"./plot_api/plot_schema":542,"./plots/plots":619,"./registry":638,"./snapshot":643,"./traces/scatter":938,"./version":1119,"native-promise-only":245}],482:[function(e,t,r){"use strict";t.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'><defs><style>.cls-1 {fill: #3f4f75;} .cls-2 {fill: #80cfbe;} .cls-3 {fill: #fff;}</style></defs><title>plotly-logomark</title><g id='symbol'><rect class='cls-1' width='132' height='132' rx='6' ry='6'/><circle class='cls-2' cx='78' cy='54' r='6'/><circle class='cls-2' cx='102' cy='30' r='6'/><circle class='cls-2' cx='78' cy='30' r='6'/><circle class='cls-2' cx='54' cy='30' r='6'/><circle class='cls-2' cx='30' cy='30' r='6'/><circle class='cls-2' cx='30' cy='54' r='6'/><path class='cls-3' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/><path class='cls-3' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/><path class='cls-3' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/><path class='cls-3' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/></g></svg>"}}},{}],483:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],484:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(e){return Math.abs(e[1]-e[0])>s-1e-14}function c(e,t){return i(t-e,s)}function u(e,t){if(l(t))return!0;var r,n;t[0]<t[1]?(r=t[0],n=t[1]):(r=t[1],n=t[0]),(r=a(r,s))>(n=a(n,s))&&(n+=s);var i=a(e,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,p,h,d,m=l([r,n]);function g(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}m?(u=0,f=o,p=s):r<n?(u=r,p=n):(u=n,p=r),e<t?(h=e,d=t):(h=t,d=e);var y,v=Math.abs(p-u)<=o?0:1;function b(e,t,r){return"A"+[e,e]+" "+[0,v,r]+" "+g(e,t)}return m?y=null===h?"M"+g(d,u)+b(d,f,0)+b(d,p,0)+"Z":"M"+g(h,u)+b(h,f,0)+b(h,p,0)+"ZM"+g(d,u)+b(d,f,1)+b(d,p,1)+"Z":null===h?(y="M"+g(d,u)+b(d,p,0),c&&(y+="L0,0Z")):y="M"+g(h,u)+"L"+g(d,u)+b(d,p,0)+"L"+g(h,p)+b(h,u,1)+"Z",y}t.exports={deg2rad:function(e){return e/180*o},rad2deg:function(e){return e/o*180},angleDelta:c,angleDist:function(e,t){return Math.abs(c(e,t))},isFullCircle:l,isAngleInsideSector:u,isPtInsideSector:function(e,t,r,n){return!!u(t,n)&&(r[0]<r[1]?(a=r[0],i=r[1]):(a=r[1],i=r[0]),e>=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":510}],485:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function s(e){return n(e)||o(e)}function l(e,t,r){if(s(e)){if(s(e[0])){for(var n=r,a=0;a<e.length;a++)n=t(n,e[a].length);return n}return e.length}return 0}r.isTypedArray=o,r.isArrayOrTypedArray=s,r.isArray1D=function(e){return!s(e[0])},r.ensureArray=function(e,t){return n(e)||(e=[]),e.length=t,e},r.concat=function(){var e,t,r,a,i,o,s,l,c=[],u=!0,f=0;for(r=0;r<arguments.length;r++)(o=(a=arguments[r]).length)&&(t?c.push(a):(t=a,i=o),n(a)?e=!1:(u=!1,f?e!==a.constructor&&(e=!1):e=a.constructor),f+=o);if(!f)return[];if(!c.length)return t;if(u)return t.concat.apply(t,c);if(e){for((s=new e(f)).set(t),r=0;r<c.length;r++)a=c[r],s.set(a,i),i+=a.length;return s}for(s=new Array(f),l=0;l<t.length;l++)s[l]=t[l];for(r=0;r<c.length;r++){for(a=c[r],l=0;l<a.length;l++)s[i+l]=a[l];i+=l}return s},r.maxRowLength=function(e){return l(e,Math.max,0)},r.minRowLength=function(e){return l(e,Math.min,1/0)}},{}],486:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;t.exports=function(e){return"string"==typeof e&&(e=e.replace(i,"")),n(e)?Number(e):a}},{"../constants/numerical":479,"fast-isnumeric":190}],487:[function(e,t,r){"use strict";t.exports=function(e){var t=e._fullLayout;t._glcanvas&&t._glcanvas.size()&&t._glcanvas.each((function(e){e.regl&&e.regl.clear({color:!0,depth:!0})}))}},{}],488:[function(e,t,r){"use strict";t.exports=function(e){e._responsiveChartHandler&&(window.removeEventListener("resize",e._responsiveChartHandler),delete e._responsiveChartHandler)}},{}],489:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("tinycolor2"),i=e("../plots/attributes"),o=e("../components/colorscale/scales"),s=e("../components/color"),l=e("../constants/interactions").DESELECTDIM,c=e("./nested_property"),u=e("./regex").counter,f=e("./mod").modHalf,p=e("./array").isArrayOrTypedArray;function h(e,t){var n=r.valObjectMeta[t.valType];if(t.arrayOk&&p(e))return!0;if(n.validateFunction)return n.validateFunction(e,t);var a={},i=a,o={set:function(e){i=e}};return n.coerceFunction(e,o,a,t),i!==a}r.valObjectMeta={data_array:{coerceFunction:function(e,t,r){p(e)?t.set(e):void 0!==r&&t.set(r)}},enumerated:{coerceFunction:function(e,t,r,n){n.coerceNumber&&(e=+e),-1===n.values.indexOf(e)?t.set(r):t.set(e)},validateFunction:function(e,t){t.coerceNumber&&(e=+e);for(var r=t.values,n=0;n<r.length;n++){var a=String(r[n]);if("/"===a.charAt(0)&&"/"===a.charAt(a.length-1)){if(new RegExp(a.substr(1,a.length-2)).test(e))return!0}else if(e===r[n])return!0}return!1}},boolean:{coerceFunction:function(e,t,r){!0===e||!1===e?t.set(e):t.set(r)}},number:{coerceFunction:function(e,t,r,a){!n(e)||void 0!==a.min&&e<a.min||void 0!==a.max&&e>a.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&e<a.min||void 0!==a.max&&e>a.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i<a.length;){var o=a[i];-1===n.flags.indexOf(o)||a.indexOf(o)<i?a.splice(i,1):i++}a.length?t.set(a.join("+")):t.set(r)}else t.set(e);else t.set(r)}},any:{coerceFunction:function(e,t,r){void 0===e?t.set(r):t.set(e)}},info_array:{coerceFunction:function(e,t,n,a){function i(e,t,n){var a,i={set:function(e){a=e}};return void 0===n&&(n=t.dflt),r.valObjectMeta[t.valType].coerceFunction(e,i,n,t),a}var o=2===a.dimensions||"1-2"===a.dimensions&&Array.isArray(e)&&Array.isArray(e[0]);if(Array.isArray(e)){var s,l,c,u,f,p,h=a.items,d=[],m=Array.isArray(h),g=m&&o&&Array.isArray(h[0]),y=o&&m&&!g,v=m&&!y?h.length:e.length;if(n=Array.isArray(n)?n:[],o)for(s=0;s<v;s++)for(d[s]=[],c=Array.isArray(e[s])?e[s]:[],f=y?h.length:m?h[s].length:c.length,l=0;l<f;l++)u=y?h[l]:m?h[s][l]:h,void 0!==(p=i(c[l],u,(n[s]||[])[l]))&&(d[s][l]=p);else for(s=0;s<v;s++)void 0!==(p=i(e[s],m?h[s]:h,n[s]))&&(d[s]=p);t.set(d)}else t.set(n)},validateFunction:function(e,t){if(!Array.isArray(e))return!1;var r=t.items,n=Array.isArray(r),a=2===t.dimensions;if(!t.freeLength&&e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(a){if(!Array.isArray(e[i])||!t.freeLength&&e[i].length!==r[i].length)return!1;for(var o=0;o<e[i].length;o++)if(!h(e[i][o],n?r[i][o]:r))return!1}else if(!h(e[i],n?r[i]:r))return!1;return!0}}},r.coerce=function(e,t,n,a,i){var o=c(n,a).get(),s=c(e,a),l=c(t,a),u=s.get(),f=t._template;if(void 0===u&&f&&(u=c(f,a).get(),f=0),void 0===i&&(i=o.dflt),o.arrayOk&&p(u))return l.set(u),u;var d=r.valObjectMeta[o.valType].coerceFunction;d(u,l,i,o);var m=l.get();return f&&m===i&&!h(u,o)&&(d(u=c(f,a).get(),l,i,o),m=l.get()),m},r.coerce2=function(e,t,n,a,i){var o=c(e,a),s=r.coerce(e,t,n,a,i);return null!=o.get()&&s},r.coerceFont=function(e,t,r){var n={};return r=r||{},n.family=e(t+".family",r.family),n.size=e(t+".size",r.size),n.color=e(t+".color",r.color),n},r.coercePattern=function(e,t,r,n){if(e(t+".shape")){e(t+".solidity"),e(t+".size");var a="overlay"===e(t+".fillmode");if(!n){var i=e(t+".bgcolor",a?r:void 0);e(t+".fgcolor",a?s.contrast(i):r)}e(t+".fgopacity",a?.5:1)}},r.coerceHoverinfo=function(e,t,n){var a,o=t._module.attributes,s=o.hoverinfo?o:i,l=s.hoverinfo;if(1===n._dataLength){var c="all"===l.dflt?l.flags.slice():l.dflt.split("+");c.splice(c.indexOf("name"),1),a=c.join("+")}return r.coerce(e,t,s,"hoverinfo",a)},r.coerceSelectionMarkerOpacity=function(e,t){if(e.marker){var r,n,a=e.marker.opacity;void 0!==a&&(p(a)||e.selected||e.unselected||(r=a,n=l*a),t("selected.marker.opacity",r),t("unselected.marker.opacity",n))}},r.validate=h},{"../components/color":366,"../components/colorscale/scales":381,"../constants/interactions":478,"../plots/attributes":550,"./array":485,"./mod":510,"./nested_property":511,"./regex":520,"fast-isnumeric":190,tinycolor2:312}],490:[function(e,t,r){"use strict";var n,a,i=e("d3-time-format").timeFormat,o=e("fast-isnumeric"),s=e("./loggers"),l=e("./mod").mod,c=e("../constants/numerical"),u=c.BADNUM,f=c.ONEDAY,p=c.ONEHOUR,h=c.ONEMIN,d=c.ONESEC,m=c.EPOCHJD,g=e("../registry"),y=e("d3-time-format").utcFormat,v=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,b=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,x=(new Date).getFullYear()-70;function _(e){return e&&g.componentsRegistry.calendars&&"string"==typeof e&&"gregorian"!==e}function w(e,t){return String(e+Math.pow(10,t)).substr(1)}r.dateTick0=function(e,t){var n=function(e,t){return _(e)?t?g.getComponentMethod("calendars","CANONICAL_SUNDAY")[e]:g.getComponentMethod("calendars","CANONICAL_TICK")[e]:t?"2000-01-02":"2000-01-01"}(e,!!t);if(t<2)return n;var a=r.dateTime2ms(n,e);return a+=f*(t-1),r.ms2DateTime(a,0,e)},r.dfltRange=function(e){return _(e)?g.getComponentMethod("calendars","DFLTRANGE")[e]:["2000-01-01","2001-01-01"]},r.isJSDate=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.getTime},r.dateTime2ms=function(e,t){if(r.isJSDate(e)){var i=e.getTimezoneOffset()*h,o=(e.getUTCMinutes()-e.getMinutes())*h+(e.getUTCSeconds()-e.getSeconds())*d+(e.getUTCMilliseconds()-e.getMilliseconds());if(o){var s=3*h;i=i-s/2+l(o-i+s/2,s)}return(e=Number(e)-i)>=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),y=e.charAt(0);!c||"G"!==y&&"g"!==y||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),k=e.match(w?b:v);if(!k)return u;var D=k[1],T=k[3]||"1",A=Number(k[5]||1),S=Number(k[7]||0),M=Number(k[9]||0),E=Number(k[11]||0);if(c){if(2===D.length)return u;var C;D=Number(D);try{var N=g.getComponentMethod("calendars","getCal")(t);if(w){var O="i"===T.charAt(T.length-1);T=parseInt(T,10),C=N.newDate(D,N.toMonthIndex(D,T,O),A)}else C=N.newDate(D,Number(T),A)}catch(e){return u}return C?(C.toJD()-m)*f+S*p+M*h+E*d:u}D=2===D.length?(Number(D)+2e3-x)%100+x:Number(D),T-=1;var I=new Date(Date.UTC(2e3,T,A,S,M));return I.setUTCFullYear(D),I.getUTCMonth()!==T||I.getUTCDate()!==A?u:I.getTime()+E*d},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var k=90*f,D=3*p,T=5*h;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,s,c,v,b,x=Math.floor(10*l(e+.05,1)),w=Math.round(e-x/10);if(_(r)){var S=Math.floor(w/f)+m,M=Math.floor(l(e,f));try{i=g.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(e){i=y("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t<k?Math.floor(M/p):0,s=t<k?Math.floor(M%p/h):0,c=t<D?Math.floor(M%h/d):0,v=t<T?M%d*10+x:0}else b=new Date(w),i=y("%Y-%m-%d")(b),o=t<k?b.getUTCHours():0,s=t<k?b.getUTCMinutes():0,c=t<D?b.getUTCSeconds():0,v=t<T?10*b.getUTCMilliseconds()+x:0;return A(i,o,s,c,v)},r.ms2DateTimeLocal=function(e){if(!(e>=n+f&&e<=a-f))return u;var t=Math.floor(10*l(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return s.error("unrecognized date",e),t;return e};var S=/%\d?f/g,M=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function C(e,t,r,n){e=e.replace(S,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(M,(function(){return E[r("%q")(a)]})),_(n))try{e=g.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var N=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=l(e+.05,f),n=w(Math.floor(r/p),2)+":"+w(l(Math.floor(r/h),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(l(e/d,60),N[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+C(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return C(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=l(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+m,i=g.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-m)*f+n}catch(t){s.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,s=0,l=0,c=_(t)&&g.getComponentMethod("calendars","getCal")(t),u=0;u<e.length;u++)if(n=e[u],o(n)){if(!(n%f))if(c)try{1===(r=c.fromJD(n/f+m)).day()?1===r.month()?a++:i++:s++}catch(e){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:i++:s++}else l++;s+=i+=a;var p=e.length-l;return{exactYears:a/p,exactMonths:i/p,exactDays:s/p}}},{"../constants/numerical":479,"../registry":638,"./loggers":507,"./mod":510,"d3-time-format":120,"fast-isnumeric":190}],491:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./loggers"),i=e("./matrix"),o=e("gl-mat4");function s(e){var t=e&&e.parentNode;t&&t.removeChild(e)}function l(e,t,r){var n="plotly.js-style-"+e,i=document.getElementById(n);i||((i=document.createElement("style")).setAttribute("id",n),i.appendChild(document.createTextNode("")),document.head.appendChild(i));var o=i.sheet;o.insertRule?o.insertRule(t+"{"+r+"}",0):o.addRule?o.addRule(t,r,0):a.warn("addStyleRule failed")}function c(e){var t=window.getComputedStyle(e,null),r=t.getPropertyValue("-webkit-transform")||t.getPropertyValue("-moz-transform")||t.getPropertyValue("-ms-transform")||t.getPropertyValue("-o-transform")||t.getPropertyValue("transform");return"none"===r?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map((function(e){return+e}))}function u(e){for(var t=[];f(e);)t.push(e),e=e.parentNode;return t}function f(e){return e&&(e instanceof Element||e instanceof HTMLElement)}t.exports={getGraphDiv:function(e){var t;if("string"==typeof e){if(null===(t=document.getElementById(e)))throw new Error("No DOM element with id '"+e+"' exists on the page.");return t}if(null==e)throw new Error("DOM element provided is null or undefined");return e},isPlotDiv:function(e){var t=n.select(e);return t.node()instanceof HTMLElement&&t.size()&&t.classed("js-plotly-plot")},removeElement:s,addStyleRule:function(e,t){l("global",e,t)},addRelatedStyleRule:l,deleteRelatedStyleRule:function(e){var t="plotly.js-style-"+e,r=document.getElementById(t);r&&s(r)},getFullTransformMatrix:function(e){var t=u(e),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return t.forEach((function(e){var t=c(e);if(t){var n=i.convertCssMatrix(t);r=o.multiply(r,r,n)}})),r},getElementTransformMatrix:c,getElementAndAncestors:u,equalDomRects:function(e,t){return e&&t&&e.x===t.x&&e.y===t.y&&e.top===t.top&&e.left===t.left&&e.right===t.right&&e.bottom===t.bottom}}},{"./loggers":507,"./matrix":509,"@plotly/d3":58,"gl-mat4":210}],492:[function(e,t,r){"use strict";var n=e("events").EventEmitter,a={init:function(e){if(e._ev instanceof n)return e;var t=new n,r=new n;return e._ev=t,e._internalEv=r,e.on=t.on.bind(t),e.once=t.once.bind(t),e.removeListener=t.removeListener.bind(t),e.removeAllListeners=t.removeAllListeners.bind(t),e._internalOn=r.on.bind(r),e._internalOnce=r.once.bind(r),e._removeInternalListener=r.removeListener.bind(r),e._removeAllInternalListeners=r.removeAllListeners.bind(r),e.emit=function(n,a){"undefined"!=typeof jQuery&&jQuery(e).trigger(n,a),t.emit(n,a),r.emit(n,a)},e},triggerHandler:function(e,t,r){var n,a;"undefined"!=typeof jQuery&&(n=jQuery(e).triggerHandler(t,r));var i=e._ev;if(!i)return n;var o,s=i._events[t];if(!s)return n;function l(e){return e.listener?(i.removeListener(t,e.listener),e.fired?void 0:(e.fired=!0,e.listener.apply(i,[r]))):e.apply(i,[r])}for(s=Array.isArray(s)?s:[s],o=0;o<s.length-1;o++)l(s[o]);return a=l(s[o]),void 0!==n?n:a},purge:function(e){return delete e._ev,delete e.on,delete e.once,delete e.removeListener,delete e.removeAllListeners,delete e.emit,delete e._ev,delete e._internalEv,delete e._internalOn,delete e._internalOnce,delete e._removeInternalListener,delete e._removeAllInternalListeners,e}};t.exports=a},{events:84}],493:[function(e,t,r){"use strict";var n=e("./is_plain_object.js"),a=Array.isArray;function i(e,t,r,o){var s,l,c,u,f,p,h=e[0],d=e.length;if(2===d&&a(h)&&a(e[1])&&0===h.length){if(function(e,t){var r,n;for(r=0;r<e.length;r++){if(null!==(n=e[r])&&"object"==typeof n)return!1;void 0!==n&&(t[r]=n)}return!0}(e[1],h))return h;h.splice(0,h.length)}for(var m=1;m<d;m++)for(l in s=e[m])c=h[l],u=s[l],o&&a(u)?h[l]=u:t&&u&&(n(u)||(f=a(u)))?(f?(f=!1,p=c&&a(c)?c:[]):p=c&&n(c)?c:{},h[l]=i([p,u],t,r,o)):(void 0!==u||r)&&(h[l]=u);return h}r.extendFlat=function(){return i(arguments,!1,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)}},{"./is_plain_object.js":504}],494:[function(e,t,r){"use strict";t.exports=function(e){for(var t={},r=[],n=0,a=0;a<e.length;a++){var i=e[a];1!==t[i]&&(t[i]=1,r[n++]=i)}return r}},{}],495:[function(e,t,r){"use strict";function n(e){return!0===e.visible}function a(e){var t=e[0].trace;return!0===t.visible&&0!==t._length}t.exports=function(e){for(var t,r=(t=e,Array.isArray(t)&&Array.isArray(t[0])&&t[0][0]&&t[0][0].trace?a:n),i=[],o=0;o<e.length;o++){var s=e[o];r(s)&&i.push(s)}return i}},{}],496:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("country-regex"),i=e("@turf/area"),o=e("@turf/centroid"),s=e("@turf/bbox"),l=e("./identity"),c=e("./loggers"),u=e("./is_plain_object"),f=e("./nested_property"),p=e("./polygon"),h=Object.keys(a),d={"ISO-3":l,"USA-states":l,"country names":function(e){for(var t=0;t<h.length;t++){var r=h[t];if(new RegExp(a[r]).test(e.trim().toLowerCase()))return r}return c.log("Unrecognized country name: "+e+"."),!1}};function m(e){var t=e.geojson,r=window.PlotlyGeoAssets||{},n="string"==typeof t?r[t]:t;return u(n)?n:(c.error("Oops ... something went wrong when fetching "+t),!1)}t.exports={locationToFeature:function(e,t,r){if(!t||"string"!=typeof t)return!1;var n,a,i,o=d[e](t);if(o){if("USA-states"===e)for(n=[],i=0;i<r.length;i++)(a=r[i]).properties&&a.properties.gu&&"USA"===a.properties.gu&&n.push(a);else n=r;for(i=0;i<n.length;i++)if((a=n[i]).id===o)return a;c.log(["Location with id",o,"does not have a matching topojson feature at this resolution."].join(" "))}return!1},feature2polygons:function(e){var t,r,n,a,i=e.geometry,o=i.coordinates,s=e.id,l=[];function c(e){for(var t=0;t<e.length-1;t++)if(e[t][0]>0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===s||"FJI"===s?function(e){var t;if(null===c(e))t=e;else for(t=new Array(e.length),a=0;a<e.length;a++)t[a]=[e[a][0]<0?e[a][0]+360:e[a][0],e[a][1]];l.push(p.tester(t))}:"ATA"===s?function(e){var t=c(e);if(null===t)return l.push(p.tester(e));var r=new Array(e.length+1),n=0;for(a=0;a<e.length;a++)a>t?r[n++]=[e[a][0]+360,e[a][1]]:a===t?(r[n++]=e[a],r[n++]=[e[a][0],-90]):r[n++]=e[a];var i=p.tester(r);i.pts.pop(),l.push(i)}:function(e){l.push(p.tester(e))},i.type){case"MultiPolygon":for(r=0;r<o.length;r++)for(n=0;n<o[r].length;n++)t(o[r][n]);break;case"Polygon":for(r=0;r<o.length;r++)t(o[r])}return l},getTraceGeojson:m,extractTraceFeature:function(e){var t=e[0].trace,r=m(t);if(!r)return!1;var n,a={},s=[];for(n=0;n<t._length;n++){var l=e[n];(l.loc||0===l.loc)&&(a[l.loc]=l)}function u(e){var r=f(e,t.featureidkey||"id").get(),n=a[r];if(n){var l=e.geometry;if("Polygon"===l.type||"MultiPolygon"===l.type){var u={type:"Feature",id:r,geometry:l,properties:{}};u.properties.ct=function(e){var t,r=e.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,a=0,s=0;s<n.length;s++){var l={type:"Polygon",coordinates:n[s]},c=i.default(l);c>a&&(a=c,t=l)}else t=r;return o.default(t).geometry.coordinates}(u),n.fIn=e,n.fOut=u,s.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var p=r.features;for(n=0;n<p.length;n++)u(p[n]);break;case"Feature":u(r);break;default:return c.warn(["Invalid GeoJSON type",(r.type||"none")+".","Traces with locationmode *geojson-id* only support","*FeatureCollection* and *Feature* types."].join(" ")),!1}for(var h in a)c.log(["Location *"+h+"*","does not have a matching feature with id-key","*"+t.featureidkey+"*."].join(" "));return s},fetchTraceGeoData:function(e){var t=window.PlotlyGeoAssets||{},r=[];function a(e){return new Promise((function(r,a){n.json(e,(function(n,i){if(n){delete t[e];var o=404===n.status?'GeoJSON at URL "'+e+'" does not exist.':"Unexpected error while fetching from "+e;return a(new Error(o))}return t[e]=i,r(i)}))}))}function i(e){return new Promise((function(r,n){var a=0,i=setInterval((function(){return t[e]&&"pending"!==t[e]?(clearInterval(i),r(t[e])):a>100?(clearInterval(i),n("Unexpected error while fetching from "+e)):void a++}),50)}))}for(var o=0;o<e.length;o++){var s=e[o][0].trace.geojson;"string"==typeof s&&(t[s]?"pending"===t[s]&&r.push(i(s)):(t[s]="pending",r.push(a(s))))}return r},computeBbox:function(e){return s.default(e)}}},{"./identity":501,"./is_plain_object":504,"./loggers":507,"./nested_property":511,"./polygon":515,"@plotly/d3":58,"@turf/area":61,"@turf/bbox":64,"@turf/centroid":67,"country-regex":94}],497:[function(e,t,r){"use strict";var n=e("../constants/numerical").BADNUM;r.calcTraceToLineCoords=function(e){for(var t=e[0].trace.connectgaps,r=[],a=[],i=0;i<e.length;i++){var o=e[i].lonlat;o[0]!==n?a.push(o):!t&&a.length>0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},r.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=[e[r]];return{type:"MultiPolygon",coordinates:t}},r.makeBlank=function(){return{type:"Point",coordinates:[]}}},{"../constants/numerical":479}],498:[function(e,t,r){"use strict";var n,a,i,o=e("./mod").mod;function s(e,t,r,n,a,i,o,s){var l=r-e,c=a-e,u=o-a,f=n-t,p=i-t,h=s-i,d=l*h-u*f;if(0===d)return null;var m=(c*h-u*p)/d,g=(c*f-l*p)/d;return g<0||g>1||m<0||m>1?null:{x:e+l*m,y:t+f*m}}function l(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,s=a-t;return o*o+s*s}var l=n*t-a*e;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(s(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,p=o-a,h=c-i,d=u*u+f*f,m=p*p+h*h,g=Math.min(l(u,f,d,a-e,i-t),l(u,f,d,o-e,c-t),l(p,h,m,e-a,t-i),l(p,h,m,r-a,n-i));return Math.sqrt(g)},r.getTextLocation=function(e,t,r,s){if(e===a&&s===i||(n={},a=e,i=s),n[r])return n[r];var l=e.getPointAtLength(o(r-s/2,t)),c=e.getPointAtLength(o(r+s/2,t)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=e.getPointAtLength(o(r,t)),p={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=p,p},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,s=t.top,l=t.bottom,c=0,u=e.getTotalLength(),f=u;function p(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.x<i?i-r.x:r.x>o?r.x-o:0,f=r.y<s?s-r.y:r.y>l?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var h=p(c);h;){if((c+=h+r)>f)return;h=p(c)}for(h=p(f);h;){if(c>(f-=h+r))return;h=p(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,s=(n=n||{}).pathLength||e.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(s)[r]?-1:1,f=0,p=0,h=s;f<c;){if(a=(p+h)/2,o=(i=e.getPointAtLength(a))[r]-t,Math.abs(o)<l)return i;u*o>0?h=a:p=a,f++}return i}},{"./mod":510}],499:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("tinycolor2"),i=e("color-normalize"),o=e("../components/colorscale"),s=e("../components/color/attributes").defaultLine,l=e("./array").isArrayOrTypedArray,c=i(s);function u(e,t){var r=e;return r[3]*=t,r}function f(e){if(n(e))return c;var t=i(e);return t.length?t:c}function p(e){return n(e)?e:1}t.exports={formatColor:function(e,t,r){var n,a,s,h,d,m=e.color,g=l(m),y=l(t),v=o.extractOpts(e),b=[];if(n=void 0!==v.colorscale?o.makeColorScaleFuncFromTrace(e):f,a=g?function(e,t){return void 0===e[t]?c:i(n(e[t]))}:f,s=y?function(e,t){return void 0===e[t]?1:p(e[t])}:p,g||y)for(var x=0;x<r;x++)h=a(m,x),d=s(t,x),b[x]=u(h,d);else b=u(i(m),t);return b},parseColorScale:function(e){var t=o.extractOpts(e),r=t.colorscale;return t.reversescale&&(r=o.flipScale(t.colorscale)),r.map((function(e){var t=e[0],r=a(e[1]).toRgb();return{index:t,rgb:[r.r,r.g,r.b,r.a]}}))}}},{"../components/color/attributes":365,"../components/colorscale":378,"./array":485,"color-normalize":89,"fast-isnumeric":190,tinycolor2:312}],500:[function(e,t,r){"use strict";var n=e("./identity");function a(e){return[e]}t.exports={keyFun:function(e){return e.key},repeat:a,descend:n,wrap:a,unwrap:function(e){return e[0]}}},{"./identity":501}],501:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],502:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],503:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),s=e("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,f=t.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var p={};f.warnBadFormat=function(e){var t=String(e);p[t]||(p[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=i(f.adjustFormat(e))}catch(t){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=e("./nested_property"),f.keyedContainer=e("./keyed_container"),f.relativeAttr=e("./relative_attr"),f.isPlainObject=e("./is_plain_object"),f.toLogRange=e("./to_log_range"),f.relinkPrivateKeys=e("./relink_private");var h=e("./array");f.isTypedArray=h.isTypedArray,f.isArrayOrTypedArray=h.isArrayOrTypedArray,f.isArray1D=h.isArray1D,f.ensureArray=h.ensureArray,f.concat=h.concat,f.maxRowLength=h.maxRowLength,f.minRowLength=h.minRowLength;var d=e("./mod");f.mod=d.mod,f.modHalf=d.modHalf;var m=e("./coerce");f.valObjectMeta=m.valObjectMeta,f.coerce=m.coerce,f.coerce2=m.coerce2,f.coerceFont=m.coerceFont,f.coercePattern=m.coercePattern,f.coerceHoverinfo=m.coerceHoverinfo,f.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,f.validate=m.validate;var g=e("./dates");f.dateTime2ms=g.dateTime2ms,f.isDateTime=g.isDateTime,f.ms2DateTime=g.ms2DateTime,f.ms2DateTimeLocal=g.ms2DateTimeLocal,f.cleanDate=g.cleanDate,f.isJSDate=g.isJSDate,f.formatDate=g.formatDate,f.incrementMonth=g.incrementMonth,f.dateTick0=g.dateTick0,f.dfltRange=g.dfltRange,f.findExactDates=g.findExactDates,f.MIN_MS=g.MIN_MS,f.MAX_MS=g.MAX_MS;var y=e("./search");f.findBin=y.findBin,f.sorterAsc=y.sorterAsc,f.sorterDes=y.sorterDes,f.distinctVals=y.distinctVals,f.roundUp=y.roundUp,f.sort=y.sort,f.findIndexOfMin=y.findIndexOfMin,f.sortObjectKeys=e("./sort_object_keys");var v=e("./stats");f.aggNums=v.aggNums,f.len=v.len,f.mean=v.mean,f.median=v.median,f.midRange=v.midRange,f.variance=v.variance,f.stdev=v.stdev,f.interp=v.interp;var b=e("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=e("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=e("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var k=e("./extend");f.extendFlat=k.extendFlat,f.extendDeep=k.extendDeep,f.extendDeepAll=k.extendDeepAll,f.extendDeepNoArrays=k.extendDeepNoArrays;var D=e("./loggers");f.log=D.log,f.warn=D.warn,f.error=D.error;var T=e("./regex");f.counterRegex=T.counter;var A=e("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var S=e("./dom");function M(e){var t={};for(var r in e)for(var n=e[r],a=0;a<n.length;a++)t[n[a]]=+r;return t}f.getGraphDiv=S.getGraphDiv,f.isPlotDiv=S.isPlotDiv,f.removeElement=S.removeElement,f.addStyleRule=S.addStyleRule,f.addRelatedStyleRule=S.addRelatedStyleRule,f.deleteRelatedStyleRule=S.deleteRelatedStyleRule,f.getFullTransformMatrix=S.getFullTransformMatrix,f.getElementTransformMatrix=S.getElementTransformMatrix,f.getElementAndAncestors=S.getElementAndAncestors,f.equalDomRects=S.equalDomRects,f.clearResponsive=e("./clear_responsive"),f.preserveDrawingBuffer=e("./preserve_drawing_buffer"),f.makeTraceGroups=e("./make_trace_groups"),f._=e("./localize"),f.notifier=e("./notifier"),f.filterUnique=e("./filter_unique"),f.filterVisible=e("./filter_visible"),f.pushUnique=e("./push_unique"),f.increment=e("./increment"),f.cleanNumber=e("./clean_number"),f.ensureNumber=function(e){return o(e)?(e=Number(e))>l||e<c?u:e:u},f.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&o(e)&&e>=0&&e%1==0},f.noop=e("./noop"),f.identity=e("./identity"),f.repeat=function(e,t){for(var r=new Array(t),n=0;n<t;n++)r[n]=e;return r},f.swapAttrs=function(e,t,r,n){r||(r="x"),n||(n="y");for(var a=0;a<t.length;a++){var i=t[a],o=f.nestedProperty(e,i.replace("?",r)),s=f.nestedProperty(e,i.replace("?",n)),l=o.get();o.set(s.get()),s.set(l)}},f.raiseToTop=function(e){e.parentNode.appendChild(e)},f.cancelTransition=function(e){return e.transition().duration(0)},f.constrain=function(e,t,r){return t>r?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),s=0;s<i;s++)o[s]=t(e[s],r,n,a);return o},f.randstr=function e(t,r,n,a){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,o,s=Math.log(Math.pow(2,r))/Math.log(n),l="";for(i=2;s===1/0;i*=2)s=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var c=s-Math.floor(s);for(i=0;i<Math.floor(s);i++)l=Math.floor(Math.random()*n).toString(n)+l;c&&(o=Math.pow(n,c),l=Math.floor(Math.random()*o).toString(n)+l);var u=parseInt(l,n);return t&&t[l]||u!==1/0&&u>=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),l):e(t,r,n,(a||0)+1):l},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,s=2*o,l=2*t-1,c=new Array(l),u=new Array(o);for(r=0;r<l;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/t))/(2*t);for(r=0;r<o;r++){for(i=0,n=0;n<l;n++)(a=r+n+1-t)<-o?a-=s*Math.round(a/s):a>=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=e[a]*c[n];u[r]=i}return u},f.syncOrAsync=function(e,t,r){var n;function a(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n<r.length;n++)null!=e[r[n]]?a=!0:i=!1;if(a&&!i)for(n=0;n<r.length;n++)e[r[n]]=t[r[n]]}},f.mergeArray=function(e,t,r,n){var a="function"==typeof n;if(f.isArrayOrTypedArray(e))for(var i=Math.min(e.length,t.length),o=0;o<i;o++){var s=e[o];t[o][r]=a?n(s):s}},f.mergeArrayCastPositive=function(e,t,r){return f.mergeArray(e,t,r,(function(e){var t=+e;return isFinite(t)&&t>0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var a=0;a<t.length;a++)t[a][r]=n(e[a])},f.castOption=function(e,t,r,n){n=n||f.identity;var a=f.nestedProperty(e,r).get();return f.isArrayOrTypedArray(a)?Array.isArray(t)&&f.isArrayOrTypedArray(a[t[0]])?n(a[t[0]][t[1]]):n(a[t]):a},f.extractOption=function(e,t,r,n){if(r in e)return e[r];var a=f.nestedProperty(t,n).get();return Array.isArray(a)?void 0:a},f.tagSelected=function(e,t,r){var n,a,i=t.selectedpoints,o=t._indexToPoints;o&&(n=M(o));for(var s=0;s<i.length;s++){var l=i[s];if(f.isIndex(l)||f.isArrayOrTypedArray(l)&&f.isIndex(l[0])&&f.isIndex(l[1])){var c=n?n[l]:l,u=r?r[c]:c;void 0!==(a=u)&&a<e.length&&(e[u].selected=1)}}},f.selIndices2selPoints=function(e){var t=e.selectedpoints,r=e._indexToPoints;if(r){for(var n=M(r),a=[],i=0;i<t.length;i++){var o=t[i];if(f.isIndex(o)){var s=n[o];f.isIndex(s)&&a.push(s)}}return a}return t},f.getTargetArray=function(e,t){var r=t.target;if("string"==typeof r&&r){var n=f.nestedProperty(e,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},f.minExtend=function(e,t){var r={};"object"!=typeof t&&(t={});var n,a,i,o=Object.keys(e);for(n=0;n<o.length;n++)i=e[a=o[n]],"_"!==a.charAt(0)&&"function"!=typeof i&&("module"===a?r[a]=i:Array.isArray(i)?r[a]="colorscale"===a?i.slice():i.slice(0,3):f.isTypedArray(i)?r[a]=i.subarray(0,3):r[a]=i&&"object"==typeof i?f.minExtend(e[a],t[a]):i);for(o=Object.keys(t),n=0;n<o.length;n++)"object"==typeof(i=t[a=o[n]])&&a in r&&"object"==typeof r[a]||(r[a]=i);return r},f.titleCase=function(e){return e.charAt(0).toUpperCase()+e.substr(1)},f.containsAny=function(e,t){for(var r=0;r<t.length;r++)if(-1!==e.indexOf(t[r]))return!0;return!1},f.isIE=function(){return void 0!==window.navigator.msSaveBlob};var E=/Version\/[\d\.]+.*Safari/;f.isSafari=function(){return E.test(window.navigator.userAgent)};var C=/iPad|iPhone|iPod/;f.isIOS=function(){return C.test(window.navigator.userAgent)};var N=/Firefox\/(\d+)\.\d+/;f.getFirefoxVersion=function(){var e=N.exec(window.navigator.userAgent);if(e&&2===e.length){var t=parseInt(e[1]);if(!isNaN(t))return t}return null},f.isD3Selection=function(e){return e instanceof n.selection},f.ensureSingle=function(e,t,r,n){var a=e.select(t+(r?"."+r:""));if(a.size())return a;var i=e.append(t);return r&&i.classed(r,!0),n&&i.call(n),i},f.ensureSingleById=function(e,t,r,n){var a=e.select(t+"#"+r);if(a.size())return a;var i=e.append(t).attr("id",r);return n&&i.call(n),i},f.objectFromPath=function(e,t){for(var r,n=e.split("."),a=r={},i=0;i<n.length;i++){var o=n[i],s=null,l=n[i].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[2],r=r[o]=[],i===n.length-1?r[s]=t:r[s]={},r=r[s]):(i===n.length-1?r[o]=t:r[o]={},r=r[o])}return a};var O=/^([^\[\.]+)\.(.+)?/,I=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;f.expandObjectPaths=function(e){var t,r,n,a,i,o,s;if("object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&((t=r.match(O))?(a=e[r],n=t[1],delete e[r],e[n]=f.extendDeepNoArrays(e[n]||{},f.objectFromPath(r,f.expandObjectPaths(a))[n])):(t=r.match(I))?(a=e[r],n=t[1],i=parseInt(t[2]),delete e[r],e[n]=e[n]||[],"."===t[3]?(s=t[4],o=e[n][i]=e[n][i]||{},f.extendDeepNoArrays(o,f.objectFromPath(s,f.expandObjectPaths(a)))):e[n][i]=f.expandObjectPaths(a)):e[r]=f.expandObjectPaths(e[r]));return e},f.numSeparate=function(e,t,r){if(r||(r=!1),"string"!=typeof t||0===t.length)throw new Error("Separator string required for formatting!");"number"==typeof e&&(e=String(e));var n=/(\d+)(\d{3})/,a=t.charAt(0),i=t.charAt(1),o=e.split("."),s=o[0],l=o.length>1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var P=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var a;return P.test(n)?a=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var R={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return B.apply(R,arguments)};var L={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return B.apply(L,arguments)};var F=/^[:|\|]/;function B(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,s,l){var c,u,p,h="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,g="xother"===s||"yother"===s||h||m||d,y=s;if((h||d)&&(y=y.substring(1)),(m||d)&&(y=y.substring(0,y.length-1)),g){if(void 0===(c=t[y]))return""}else for(p=3;p<i.length;p++)if(u=i[p]){if(u.hasOwnProperty(y)){c=u[y];break}if(P.test(y)||(c=f.nestedProperty(u,y).get(),(c=o[y]||f.nestedProperty(u,y).get())&&(o[y]=c)),void 0!==c)break}if(void 0===c&&n)return n.count<n.max&&(f.warn("Variable '"+y+"' in "+n.name+" could not be found!"),c=e),n.count===n.max&&f.warn("Too many "+n.name+" warnings - additional warnings will be suppressed"),n.count++,e;if(l){var v;if(":"===l[0]&&(c=(v=r?r.numberFormat:f.numberFormat)(l.replace(F,""))(c)),"|"===l[0]){v=r?r.timeFormat:a;var b=f.dateTime2ms(c);c=f.formatDate(b,l.replace(F,""),!1,v)}}else{var x=y+"Label";t.hasOwnProperty(x)&&(c=t[x])}return g&&(c="("+c+")",(h||d)&&(c=" "+c),(m||d)&&(c+=" ")),c}))}f.subplotSort=function(e,t){for(var r=Math.min(e.length,t.length)+1,n=0,a=0,i=0;i<r;i++){var o=e.charCodeAt(i)||0,s=t.charCodeAt(i)||0,l=o>=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(a=10*a+s-48),!l||!c){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var z=2e9;f.seedPseudoRandom=function(){z=2e9},f.pseudoRandom=function(){var e=z;return z=(69069*z+1)%4294967296,Math.abs(z-e)<429496729?f.pseudoRandom():z/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(e,t,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n<t;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},f.isHidden=function(e){var t=window.getComputedStyle(e).display;return!t||"none"===t},f.strTranslate=function(e,t){return e||t?"translate("+e+","+t+")":""},f.strRotate=function(e){return e?"rotate("+e+")":""},f.strScale=function(e){return 1!==e?"scale("+e+")":""},f.getTextTransform=function(e){var t=e.noCenter,r=e.textX,n=e.textY,a=e.targetX,i=e.targetY,o=e.anchorX||0,s=e.anchorY||0,l=e.rotate,c=e.scale;return c?c>1&&(c=1):c=0,f.strTranslate(a-c*(r+o),i-c*(n+s))+f.strScale(c)+(l?"rotate("+l+(t?"":" "+r+" "+n)+")":"")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":479,"./anchor_utils":483,"./angles":484,"./array":485,"./clean_number":486,"./clear_responsive":488,"./coerce":489,"./dates":490,"./dom":491,"./extend":493,"./filter_unique":494,"./filter_visible":495,"./geometry2d":498,"./identity":501,"./increment":502,"./is_plain_object":504,"./keyed_container":505,"./localize":506,"./loggers":507,"./make_trace_groups":508,"./matrix":509,"./mod":510,"./nested_property":511,"./noop":512,"./notifier":513,"./preserve_drawing_buffer":517,"./push_unique":518,"./regex":520,"./relative_attr":521,"./relink_private":522,"./search":523,"./sort_object_keys":526,"./stats":527,"./throttle":530,"./to_log_range":531,"@plotly/d3":58,"d3-format":112,"d3-time-format":120,"fast-isnumeric":190}],504:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],505:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,s,l;r=r||"name",i=i||"value";var c={};t&&t.length?(l=n(e,t),s=l.get()):s=e,t=t||"";var u={};if(s)for(o=0;o<s.length;o++)u[s[o][r]]=o;var f=a.test(i),p={set:function(e,t){var a=null===t?4:0;if(!s){if(!l||4===a)return;s=[],l.set(s)}var o=u[e];if(void 0===o){if(4===a)return;a|=3,o=s.length,u[e]=o}else t!==(f?s[o][i]:n(s[o],i).get())&&(a|=2);var h=s[o]=s[o]||{};return h[r]=e,f?h[i]=t:n(h,i).set(t),null!==t&&(a&=-5),c[o]=c[o]|a,p},get:function(e){if(s){var t=u[e];return void 0===t?void 0:f?s[t][i]:n(s[t],i).get()}},rename:function(e,t){var n=u[e];return void 0===n||(c[n]=1|c[n],u[t]=n,delete u[e],s[n][r]=t),p},remove:function(e){var t=u[e];if(void 0===t)return p;var a=s[t];if(Object.keys(a).length>2)return c[t]=2|c[t],p.set(e,null);if(f){for(o=t;o<s.length;o++)c[o]=3|c[o];for(o=t;o<s.length;o++)u[s[o][r]]--;s.splice(t,1),delete u[e]}else n(a,i).set(null),c[t]=6|c[t];return p},constructUpdate:function(){for(var e,a,o={},l=Object.keys(c),u=0;u<l.length;u++)a=l[u],e=t+"["+a+"]",s[a]?(1&c[a]&&(o[e+"."+r]=s[a][r]),2&c[a]&&(o[e+"."+i]=f?4&c[a]?null:s[a][i]:4&c[a]?null:n(s[a],i).get())):o[e]=null;return o}};return p}},{"./nested_property":511}],506:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e,t){for(var r=e._context.locale,a=0;a<2;a++){for(var i=e._context.locales,o=0;o<2;o++){var s=(i[r]||{}).dictionary;if(s){var l=s[t];if(l)return l}i=n.localeRegistry}var c=r.split("-")[0];if(c===r)break;r=c}return t}},{"../registry":638}],507:[function(e,t,r){"use strict";var n=e("../plot_api/plot_config").dfltConfig,a=e("./notifier"),i=t.exports={};i.log=function(){var e;if(n.logging>1){var t=["LOG:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace.apply(console,t)}if(n.notifyOnLogging>1){var r=[];for(e=0;e<arguments.length;e++)r.push(arguments[e]);a(r.join("<br>"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace.apply(console,t)}if(n.notifyOnLogging>0){var r=[];for(e=0;e<arguments.length;e++)r.push(arguments[e]);a(r.join("<br>"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.error.apply(console,t)}if(n.notifyOnLogging>0){var r=[];for(e=0;e<arguments.length;e++)r.push(arguments[e]);a(r.join("<br>"),"stick")}}},{"../plot_api/plot_config":541,"./notifier":513}],508:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":58}],509:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;n<e;n++)r[n]=new Array(t);return r},r.transposeRagged=function(e){var t,r,n=0,a=e.length;for(t=0;t<a;t++)n=Math.max(n,e[t].length);var i=new Array(n);for(t=0;t<n;t++)for(i[t]=new Array(a),r=0;r<a;r++)i[t][r]=e[r][t];return i},r.dot=function(e,t){if(!e.length||!t.length||e.length!==t.length)return null;var n,a,i=e.length;if(e[0].length)for(n=new Array(i),a=0;a<i;a++)n[a]=r.dot(e[a],t);else if(t[0].length){var o=r.transposeRagged(t);for(n=new Array(o.length),a=0;a<o.length;a++)n[a]=r.dot(e,o[a])}else for(n=0,a=0;a<i;a++)n+=e[a]*t[a];return n},r.translationMatrix=function(e,t){return[[1,0,e],[0,1,t],[0,0,1]]},r.rotationMatrix=function(e){var t=e*Math.PI/180;return[[Math.cos(t),-Math.sin(t),0],[Math.sin(t),Math.cos(t),0],[0,0,1]]},r.rotationXYMatrix=function(e,t,n){return r.dot(r.dot(r.translationMatrix(t,n),r.rotationMatrix(e)),r.translationMatrix(-t,-n))},r.apply3DTransform=function(e){return function(){var t=arguments,n=1===arguments.length?t[0]:[t[0],t[1],t[2]||0];return r.dot(e,[n[0],n[1],n[2],1]).slice(0,3)}},r.apply2DTransform=function(e){return function(){var t=arguments;3===t.length&&(t=t[0]);var n=1===arguments.length?t[0]:[t[0],t[1]];return r.dot(e,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(e){var t=r.apply2DTransform(e);return function(e){return t(e.slice(0,2)).concat(t(e.slice(2,4)))}},r.convertCssMatrix=function(e){if(e){var t=e.length;if(16===t)return e;if(6===t)return[e[0],e[1],0,0,e[2],e[3],0,0,0,0,1,0,e[4],e[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},r.inverseTransformMatrix=function(e){var t=[];return n.invert(t,e),[[t[0],t[1],t[2],t[3]],[t[4],t[5],t[6],t[7]],[t[8],t[9],t[10],t[11]],[t[12],t[13],t[14],t[15]]]}},{"gl-mat4":210}],510:[function(e,t,r){"use strict";t.exports={mod:function(e,t){var r=e%t;return r<0?r+t:r},modHalf:function(e,t){return Math.abs(e)>t/2?e-Math.round(e/t)*t:e}}},{}],511:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,s,l,c=e;for(s=0;s<t.length-1;s++){if(-1===(r=t[s])){for(n=!0,o=[],l=0;l<c.length;l++)o[l]=i(c[l],t.slice(s+1))(),o[l]!==o[0]&&(n=!1);return n?o[0]:o}if("number"==typeof r&&!a(c))return;if("object"!=typeof(c=c[r])||null===c)return}if("object"==typeof c&&null!==c&&null!==(o=c[t[s]]))return o}}t.exports=function(e,t){if(n(t))t=String(t);else if("string"!=typeof t||"[-1]"===t.substr(t.length-4))throw"bad property string";for(var r,a,o,s=0,c=t.split(".");s<c.length;){if(r=String(c[s]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])c[s]=r[1];else{if(0!==s)throw"bad property string";c.splice(0,1)}for(a=r[2].substr(1,r[2].length-2).split("]["),o=0;o<a.length;o++)s++,c.splice(s,0,Number(a[o]))}s++}return"object"!=typeof e?function(e,t,r){return{set:function(){throw"bad container"},get:function(){},astr:t,parts:r,obj:e}}(e,t,c):{set:l(e,c,t),get:i(e,c),astr:t,parts:c,obj:e}};var o=/(^|\.)args\[/;function s(e,t){return void 0===e||null===e&&!t.match(o)}function l(e,t,r){return function(n){var i,o,l=e,p="",h=[[e,p]],d=s(n,r);for(o=0;o<t.length-1;o++){if("number"==typeof(i=t[o])&&!a(l))throw"array index but container is not an array";if(-1===i){if(d=!u(l,t.slice(o+1),n,r))break;return}if(!f(l,i,t[o+1],d))break;if("object"!=typeof(l=l[i])||null===l)throw"container is not an object";p=c(p,i),h.push([l,p])}if(d){if(o===t.length-1&&(delete l[t[o]],Array.isArray(l)&&+t[o]==l.length-1))for(;l.length&&void 0===l[l.length-1];)l.pop()}else l[t[o]]=n}}function c(e,t){var r=t;return n(t)?r="["+t+"]":e&&(r="."+t),e+r}function u(e,t,r,n){var i,o=a(r),c=!0,u=r,p=n.replace("-1",0),h=!o&&s(r,p),d=t[0];for(i=0;i<e.length;i++)p=n.replace("-1",i),o&&(h=s(u=r[i%r.length],p)),h&&(c=!1),f(e,i,d,h)&&l(e[i],t,n.replace("-1",i))(u);return c}function f(e,t,r,n){if(void 0===e[t]){if(n)return!1;e[t]="number"==typeof r?[]:{}}return!0}},{"./array":485,"fast-isnumeric":190}],512:[function(e,t,r){"use strict";t.exports=function(){}},{}],513:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=[];t.exports=function(e,t){if(-1===i.indexOf(e)){i.push(e);var r=1e3;a(t)?r=t:"long"===t&&(r=3e3);var o=n.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(i).enter().append("div").classed("notifier-note",!0).style("opacity",0).each((function(e){var a=n.select(this);a.append("button").classed("notifier-close",!0).html("&times;").on("click",(function(){a.transition().call(s)}));for(var i=a.append("p"),o=e.split(/<br\s*\/?>/g),l=0;l<o.length;l++)l&&i.append("br"),i.append("span").text(o[l]);"stick"===t?a.transition().duration(350).style("opacity",1):a.transition().duration(700).style("opacity",1).transition().delay(r).call(s)}))}function s(e){e.duration(700).style("opacity",0).each("end",(function(e){var t=i.indexOf(e);-1!==t&&i.splice(t,1),n.select(this).remove()}))}}},{"@plotly/d3":58,"fast-isnumeric":190}],514:[function(e,t,r){"use strict";var n=e("./setcursor"),a="data-savedcursor";t.exports=function(e,t){var r=e.attr(a);if(t){if(!r){for(var i=(e.attr("class")||"").split(" "),o=0;o<i.length;o++){var s=i[o];0===s.indexOf("cursor-")&&e.attr(a,s.substr(7)).classed(s,!1)}e.attr(a)||e.attr(a,"!!")}n(e,t)}else r&&(e.attr(a,null),"!!"===r?n(e):n(e,r))}},{"./setcursor":524}],515:[function(e,t,r){"use strict";var n=e("./matrix").dot,a=e("../constants/numerical").BADNUM,i=t.exports={};i.tester=function(e){var t,r=e.slice(),n=r[0][0],i=n,o=r[0][1],s=o;for(r.push(r[0]),t=1;t<r.length;t++)n=Math.min(n,r[t][0]),i=Math.max(i,r[t][0]),o=Math.min(o,r[t][1]),s=Math.max(s,r[t][1]);var l,c=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(c=!0,l=function(e){return e[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(c=!0,l=function(e){return e[1]===r[0][1]}));var u=!0,f=r[0];for(t=1;t<r.length;t++)if(f[0]!==r[t][0]||f[1]!==r[t][1]){u=!1;break}return{xmin:n,xmax:i,ymin:o,ymax:s,pts:r,contains:c?function(e,t){var r=e[0],c=e[1];return!(r===a||r<n||r>i||c===a||c<o||c>s||t&&l(e))}:function(e,t){var l=e[0],c=e[1];if(l===a||l<n||l>i||c===a||c<o||c>s)return!1;var u,f,p,h,d,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;u<m;u++)if(f=g,p=y,g=r[u][0],y=r[u][1],!(l<(h=Math.min(f,g))||l>Math.max(f,g)||c>Math.max(p,y)))if(c<Math.min(p,y))l!==h&&v++;else{if(c===(d=g===f?c:p+(l-f)*(y-p)/(g-f)))return 1!==u||!t;c<=d&&l!==h&&v++}return v%2==1},isRect:c,degenerate:u}},i.isSegmentBent=function(e,t,r,a){var i,o,s,l=e[t],c=[e[r][0]-l[0],e[r][1]-l[1]],u=n(c,c),f=Math.sqrt(u),p=[-c[1]/f,c[0]/f];for(i=t+1;i<r;i++)if(o=[e[i][0]-l[0],e[i][1]-l[1]],(s=n(o,c))<0||s>u||Math.abs(n(o,p))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var s=r.length,l=n;r.splice(a+1);for(var c=l+1;c<e.length;c++)(c===e.length-1||i.isSegmentBent(e,l,c+1,t))&&(r.push(e[c]),r.length<s-2&&(n=c,a=r.length-1),l=c)}return e.length>1&&o(e.pop()),{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":479,"./matrix":509}],516:[function(e,t,n){(function(r){(function(){"use strict";var n=e("./show_no_webgl_msg"),a=e("regl");t.exports=function(e,t){var i=e._fullLayout,o=!0;return i._glcanvas.each((function(n){if(!n.regl&&(!n.pick||i._has("parcoords"))){try{n.regl=a({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||r.devicePixelRatio,extensions:t||[]})}catch(e){o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(t){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:t,layer:n.key})}),!1)}})),o||n({container:i._glcontainer.node()}),o}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":525,regl:283}],517:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;return"undefined"!=typeof navigator&&(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o<i.length;o++)if(-1!==i[o].indexOf("Safari"))for(var s=o-1;s>-1;s--){var l=i[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}return r}},{"fast-isnumeric":190,"is-mobile":234}],518:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;n<e.length;n++)if(e[n]instanceof RegExp&&e[n].toString()===r)return e;e.push(t)}else!t&&0!==t||-1!==e.indexOf(t)||e.push(t);return e}},{}],519:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plot_api/plot_config").dfltConfig,i={add:function(e,t,r,n,i){var o,s;e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},s=e.undoQueue.index,e.autoplay?e.undoQueue.inSequence||(e.autoplay=!1):(!e.undoQueue.sequence||e.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},e.undoQueue.queue.splice(s,e.undoQueue.queue.length-s,o),e.undoQueue.index+=1):o=e.undoQueue.queue[s-1],e.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(t),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(i)),e.undoQueue.queue.length>a.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r<t.undo.calls.length;r++)i.plotDo(e,t.undo.calls[r],t.undo.args[r]);e.undoQueue.inSequence=!1,e.autoplay=!1}},redo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index>=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r<t.redo.calls.length;r++)i.plotDo(e,t.redo.calls[r],t.redo.args[r]);e.undoQueue.inSequence=!1,e.autoplay=!1,e.undoQueue.index++}},plotDo:function(e,t,r){e.autoplay=!0,r=function(e,t){for(var r,a=[],i=0;i<t.length;i++)r=t[i],a[i]=r===e?r:"object"==typeof r?Array.isArray(r)?n.extendDeep([],r):n.extendDeepAll({},r):r;return a}(e,r),t.apply(null,r)}};t.exports=i},{"../lib":503,"../plot_api/plot_config":541}],520:[function(e,t,r){"use strict";r.counter=function(e,t,r,n){var a=(t||"")+(r?"":"$"),i=!1===n?"":"^";return"xy"===e?new RegExp(i+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+a):new RegExp(i+e+"([2-9]|[1-9][0-9]+)?"+a)}},{}],521:[function(e,t,r){"use strict";var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,a=/^[^\.\[\]]+$/;t.exports=function(e,t){for(;t;){var r=e.match(n);if(r)e=r[1];else{if(!e.match(a))throw new Error("bad relativeAttr call:"+[e,t]);e=""}if("^"!==t.charAt(0))break;t=t.slice(1)}return e&&"["!==t.charAt(0)?e+"."+t:e+t}},{}],522:[function(e,t,r){"use strict";var n=e("./array").isArrayOrTypedArray,a=e("./is_plain_object");t.exports=function e(t,r){for(var i in r){var o=r[i],s=t[i];if(s!==o)if("_"===i.charAt(0)||"function"==typeof o){if(i in t)continue;t[i]=o}else if(n(o)&&n(s)&&a(o[0])){if("customdata"===i||"ids"===i)continue;for(var l=Math.min(o.length,s.length),c=0;c<l;c++)s[c]!==o[c]&&a(o[c])&&a(s[c])&&e(s[c],o[c])}else a(o)&&a(s)&&(e(s,o),Object.keys(s).length||delete t[i])}}},{"./array":485,"./is_plain_object":504}],523:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./loggers"),i=e("./identity"),o=e("../constants/numerical").BADNUM;function s(e,t){return e<t}function l(e,t){return e<=t}function c(e,t){return e>t}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,p=t.length,h=0,d=p>1?(t[p-1]-t[0])/(p-1):1;for(o=d>=0?r?s:l:r?u:c,e+=1e-9*d*(r?-1:1)*(d>=0?1:-1);f<p&&h++<100;)o(t[i=Math.floor((f+p)/2)],e)?f=i+1:p=i;return h>90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,s=i/(t||1)/1e4,l=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(l.push(u),a=u):f>s&&(i=Math.min(i,f),l.push(u),a=u)}return{vals:l,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;a<i&&o++<100;)t[n=c((a+i)/2)]<=e?a=n+s:i=n-l;return t[a]},r.sort=function(e,t){for(var r=0,n=0,a=1;a<e.length;a++){var i=t(e[a],e[a-1]);if(i<0?r=1:i>0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;a<e.length;a++){var o=t(e[a]);o<n&&(n=o,r=a)}return r}},{"../constants/numerical":479,"./identity":501,"./loggers":507,"fast-isnumeric":190}],524:[function(e,t,r){"use strict";t.exports=function(e,t){(e.attr("class")||"").split(" ").forEach((function(t){0===t.indexOf("cursor-")&&e.classed(t,!1)})),t&&e.classed("cursor-"+t,!0)}},{}],525:[function(e,t,r){"use strict";var n=e("../components/color"),a=function(){};t.exports=function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=a);e.destroy=function(){e.container.parentNode.removeChild(e.container)};var r=document.createElement("div");r.className="no-webgl",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],r.style.position="absolute",r.style.left=r.style.top="0px",r.style.width=r.style.height="100%",r.style["background-color"]=n.lightLine,r.style["z-index"]=30;var i=document.createElement("p");return i.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",i.style.position="relative",i.style.top="50%",i.style.left="50%",i.style.height="30%",i.style.width="50%",i.style.margin="-15% 0 0 -25%",r.appendChild(i),e.container.appendChild(r),e.container.style.background="#FFFFFF",e.container.onclick=function(){window.open("https://get.webgl.org")},!1}},{"../components/color":366}],526:[function(e,t,r){"use strict";t.exports=function(e){return Object.keys(e).sort()}},{}],527:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;r.aggNums=function(e,t,i,o){var s,l;if((!o||o>i.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(l=new Array(o),s=0;s<o;s++)l[s]=r.aggNums(e,t,i[s]);i=l}for(s=0;s<o;s++)n(t)?n(i[s])&&(t=e(+t,+i[s])):t=i[s];return t},r.len=function(e){return r.aggNums((function(e){return e+1}),0,e)},r.mean=function(e,t){return t||(t=r.len(e)),r.aggNums((function(e,t){return e+t}),0,e)/t},r.midRange=function(e){if(void 0!==e&&0!==e.length)return(r.aggNums(Math.max,null,e)+r.aggNums(Math.min,null,e))/2},r.variance=function(e,t,a){return t||(t=r.len(e)),n(a)||(a=r.mean(e,t)),r.aggNums((function(e,t){return e+Math.pow(t-a,2)}),0,e)/t},r.stdev=function(e,t,n){return Math.sqrt(r.variance(e,t,n))},r.median=function(e){var t=e.slice().sort();return r.interp(t,.5)},r.interp=function(e,t){if(!n(t))throw"n should be a finite number";if((t=t*e.length-.5)<0)return e[0];if(t>e.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":485,"fast-isnumeric":190}],528:[function(e,t,r){"use strict";var n=e("color-normalize");t.exports=function(e){return e?n(e):[0,0,0,1]}},{"color-normalize":89}],529:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),s=e("../constants/alignment").LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,d){var T=e.text(),A=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&T.match(l),E=n.select(e.node().parentNode);if(!E.empty()){var C=e.attr("class")?e.attr("class").split(" ")[0]:"text";return C+="-math",E.selectAll("svg."+C).remove(),E.selectAll("g."+C+"-group").remove(),e.style("display",null).attr({"data-unformatted":T,"data-math":"N"}),A?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),t,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(A[2],o,(function(n,a,o){E.selectAll("svg."+C).remove(),E.selectAll("g."+C+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return N(),void t();var l=E.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":T,"data-math":"Y"});l.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild);var c=o.width,u=o.height;s.attr({class:C,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=e.node().style.fill||"black",p=s.select("g");p.attr({fill:f,stroke:f});var h=p.node().getBoundingClientRect(),m=h.width,g=h.height;(m>c||g>u)&&(s.style("overflow","hidden"),m=(h=s.node().getBoundingClientRect()).width,g=h.height);var y=+e.attr("x"),v=+e.attr("y"),b=-(r||e.node().getBoundingClientRect().height)/4;if("y"===C[0])l.attr({transform:"rotate("+[-90,y,v]+")"+i(-m/2,b-g/2)});else if("l"===C[0])v=b-g/2;else if("a"===C[0]&&0!==C.indexOf("atitle"))y=0,v=b;else{var x=e.attr("text-anchor");y-=m*("middle"===x?.5:"end"===x?1:0),v=v+b-g/2}s.attr({x:y,y:v}),d&&d.call(e,l),t(l)}))}))):N(),e}function N(){E.empty()||(C=e.attr("class")+"-math",E.select("svg."+C).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(m," ");var r,i=!1,l=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*s+"em"}),e.appendChild(t),r=t;var a=l;if(l=[{node:t}],a.length>1)for(var i=1;i<a.length;i++)d(a[i])}function d(e){var t,a=e.type,i={};if("a"===a){t="a";var s=e.target,c=e.href,u=e.popup;c&&(i={"xlink:xlink:show":"_blank"===s||"_"!==s.charAt(0)?"new":"replace",target:s,"xlink:xlink:href":c},u&&(i.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");return false;'))}else t="tspan";e.style&&(i.style=e.style);var f=document.createElementNS(o.svg,t);if("sup"===a||"sub"===a){T(r,"​"),r.appendChild(f);var d=document.createElementNS(o.svg,"tspan");T(d,"​"),n.select(d).attr("dy",h[a]),i.dy=p[a],r.appendChild(f),r.appendChild(d)}else r.appendChild(f);n.select(f).attr(i),r=e.node=f,l.push(e)}function T(e,t){e.appendChild(document.createTextNode(t))}function A(e){if(1!==l.length){var n=l.pop();e!==n.type&&a.log("Start tag <"+n.type+"> doesnt match end tag <"+e+">. Pretending it did match.",t),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag </"+e+">.",t)}v.test(t)?u():(r=e,l=[{node:e}]);for(var E=t.split(g),C=0;C<E.length;C++){var N=E[C],O=N.match(y),I=O&&O[2].toLowerCase(),P=f[I];if("br"===I)u();else if(void 0===P)T(r,S(N));else if(O[1])A(I);else{var R=O[4],L={type:I},F=k(R,b);if(F?(F=F.replace(D,"$1 fill:"),P&&(F+=";"+P)):P&&(F=P),F&&(L.style=F),"a"===I){i=!0;var B=k(R,x);if(B){var z=M(B);z&&(L.href=z,L.target=k(R,_)||"_blank",L.popup=k(R,w))}}d(L)}}return i}(e.node(),T)&&e.style("pointer-events","all"),r.positionText(e),d&&d.call(e)}};var c=/(<|&lt;|&#60;)/g,u=/(>|&gt;|&#62;)/g,f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},d=["http:","https:","mailto:","",void 0,":"],m=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,v=/<br(\s+.*)?>/i;r.BR_TAG_ALL=/<br(\s+.*)?>/gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,x=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var D=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(g),o=[],s="",l=0,c=0;c<i.length;c++){var u=i[c],f=u.match(y),p=f&&f[2].toLowerCase();if(p)-1!==n.indexOf(p)&&(o.push(u),s=p);else{var h=u.length;if(l+h<r)o.push(u),l+=h;else if(l<r){var d=r-l;s&&("br"!==s||d<=a||h<=a)&&o.pop(),r>a?o.push(u.substr(0,d-a)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var T={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},A=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(e){return e.replace(A,(function(e,t){return("#"===t.charAt(0)?function(e){if(!(e>1114111)){var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):T[t])||e}))}function M(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==d.indexOf(a)&&-1!==d.indexOf(i)?t:""}function E(e,t,r){var n,i,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return i="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var e=o()-u.left,t=i()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=a.apply3DTransform(s._fullLayout._invTransform)(e,t);e=l[0],t=l[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(m," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(g),o=0;o<i.length;o++){var s=i[o],l=s.match(y),c=l&&l[2].toLowerCase();if(c in f)if(l[1])a.length&&(r=a.pop());else{var u=l[4],p=k(u,b),h=p?{style:p}:{};if("a"===c){var d=k(u,x);if(d){var v=M(d);if(v){h.href=v;var w=k(u,_);w&&(h.target=w)}}}var D=document.createElement(c);r.appendChild(D),n.select(D).attr(h),r=D,a.push(D)}else r.appendChild(document.createTextNode(S(s)))}return t.innerHTML},r.lineCount=function(e){return e.selectAll("tspan.line").size()||1},r.positionText=function(e,t,r){return e.each((function(){var e=n.select(this);function a(t,r){return void 0===r?null===(r=e.attr(t))&&(e.attr(t,0),r=0):e.attr(t,r),r}var i=a("x",t),o=a("y",r);"text"===this.nodeName&&e.selectAll("tspan.line").attr({x:i,y:o})}))},r.makeTextShadow=function(e){var t="1px ",r="1px ",n="1px ";return t+r+n+e+", -"+t+"-"+r+n+e+", "+t+"-"+r+n+e+", -"+t+r+n+e},r.makeEditable=function(e,t){var r=t.gd,a=t.delegate,i=n.dispatch("edit","input","cancel"),o=a||e;if(e.style({"pointer-events":a?"none":"all"}),1!==e.size())throw new Error("boo");function s(){!function(){var a=n.select(r).select(".svg-container"),o=a.append("div"),s=e.node().style,c=parseFloat(s.fontSize||12),u=t.text;void 0===u&&(u=e.attr("data-unformatted")),o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":c,color:t.fill||s.fill||"black",opacity:1,"background-color":t.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(u).call(E(e,a,t)).on("blur",(function(){r._editing=!1,e.text(this.textContent).style({opacity:1});var t,a=n.select(this).attr("class");(t=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(e.node().parentNode).select(t).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),i.edit.call(e,o)})).on("focus",(function(){var e=this;r._editing=!0,n.select(document).on("mouseup",(function(){if(n.event.target===e)return!1;document.activeElement===o.node()&&o.node().blur()}))})).on("keyup",(function(){27===n.event.which?(r._editing=!1,e.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",(function(){return!1})).transition().remove(),i.cancel.call(e,this.textContent)):(i.input.call(e,this.textContent),n.select(this).call(E(e,a,t)))})).on("keydown",(function(){13===n.event.which&&this.blur()})).call(l)}(),e.style({opacity:0});var a,s=o.attr("class");(a=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(e.node().parentNode).select(a).style({opacity:0})}function l(e){var t=e.node(),r=document.createRange();r.selectNodeContents(t);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),t.focus()}return t.immediate?s():o.on("click",s),n.rebind(e,i,"on")}},{"../constants/alignment":471,"../constants/xmlns_namespaces":480,"../lib":503,"@plotly/d3":58}],530:[function(e,t,r){"use strict";var n={};function a(e){e&&null!==e.timer&&(clearTimeout(e.timer),e.timer=null)}r.throttle=function(e,t,r){var i=n[e],o=Date.now();if(!i){for(var s in n)n[s].ts<o-6e4&&delete n[s];i=n[e]={ts:0,timer:null}}function l(){r(),i.ts=Date.now(),i.onDone&&(i.onDone(),i.onDone=null)}a(i),o>i.ts+t?l():i.timer=setTimeout((function(){l(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],531:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":190}],532:[function(e,t,r){"use strict";var n=t.exports={},a=e("../plots/geo/constants").locationmodeToLayer,i=e("topojson-client").feature;n.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(e,t){return e+t+".json"},n.getTopojsonFeatures=function(e,t){var r=a[e.locationmode],n=t.objects[r];return i(t,n).features}},{"../plots/geo/constants":587,"topojson-client":315}],533:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],534:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],535:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],s=0;s<i.length;s++)if((r=e.match(i[s]))&&0===r.index){t=r[0];break}if(t||(t=a[a.indexOf(o)]),!t)return!1;var l=e.substr(t.length);return l?!!(r=l.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:t,index:Number(r[1]),property:r[3]||""}:{array:t,index:"",property:""}}},{"../registry":638}],536:[function(e,t,r){"use strict";var n=e("../lib"),a=n.extendFlat,i=n.isPlainObject,o={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},s={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},l=o.flags.slice().concat(["fullReplot"]),c=s.flags.slice().concat("layoutReplot");function u(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!1;return t}function f(e,t,r){var n=a({},e);for(var o in n){var s=n[o];i(s)&&(n[o]=p(s,t,0,o))}return"from-root"===r&&(n.editType=t),n}function p(e,t,r,n){if(e.valType){var i=a({},e);if(i.editType=t,Array.isArray(e.items)){i.items=new Array(e.items.length);for(var o=0;o<e.items.length;o++)i.items[o]=p(e.items[o],t)}return i}return f(e,t,"_"===n.charAt(0)?"nested":"from-root")}t.exports={traces:o,layout:s,traceFlags:function(){return u(l)},layoutFlags:function(){return u(c)},update:function(e,t){var r=t.editType;if(r&&"none"!==r)for(var n=r.split("+"),a=0;a<n.length;a++)e[n[a]]=!0},overrideAll:f}},{"../lib":503}],537:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("gl-mat4/fromQuat"),i=e("../registry"),o=e("../lib"),s=e("../plots/plots"),l=e("../plots/cartesian/axis_ids"),c=e("../components/color"),u=l.cleanId,f=l.getFromTrace,p=i.traceIs;function h(e,t){var r=e[t],n=t.charAt(0);r&&"paper"!==r&&(e[t]=u(r,n,!0))}function d(e){function t(t,r){var n=e[t],a=e.title&&e.title[r];n&&!a&&(e.title||(e.title={}),e.title[r]=e[t],delete e[t])}e&&("string"!=typeof e.title&&"number"!=typeof e.title||(e.title={text:e.title}),t("titlefont","font"),t("titleposition","position"),t("titleside","side"),t("titleoffset","offset"))}function m(e){if(!o.isPlainObject(e))return!1;var t=e.name;return delete e.name,delete e.showlegend,("string"==typeof t||"number"==typeof t)&&String(t)}function g(e,t,r,n){if(r&&!n)return e;if(n&&!r)return t;if(!e.trim())return t;if(!t.trim())return e;var a,i=Math.min(e.length,t.length);for(a=0;a<i&&e.charAt(a)===t.charAt(a);a++);return e.substr(0,a).trim()}function y(e){var t="middle",r="center";return"string"==typeof e&&(-1!==e.indexOf("top")?t="top":-1!==e.indexOf("bottom")&&(t="bottom"),-1!==e.indexOf("left")?r="left":-1!==e.indexOf("right")&&(r="right")),t+" "+r}function v(e,t){return t in e&&"object"==typeof e[t]&&0===Object.keys(e[t]).length}r.clearPromiseQueue=function(e){Array.isArray(e._promises)&&e._promises.length>0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,p=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(e);for(t=0;t<m.length;t++){var g=m[t];if(i&&i.test(g)){var y=e[g];y.anchor&&"free"!==y.anchor&&(y.anchor=u(y.anchor)),y.overlaying&&(y.overlaying=u(y.overlaying)),y.type||(y.isdate?y.type="date":y.islog?y.type="log":!1===y.isdate&&!1===y.islog&&(y.type="linear")),"withzero"!==y.autorange&&"tozero"!==y.autorange||(y.autorange=!0,y.rangemode="tozero"),delete y.islog,delete y.isdate,delete y.categories,v(y,"domain")&&delete y.domain,void 0!==y.autotick&&(void 0===y.tickmode&&(y.tickmode=y.autotick?"auto":"linear"),delete y.autotick),d(y)}else if(l&&l.test(g))d(e[g].radialaxis);else if(f&&f.test(g)){var b=e[g];d(b.aaxis),d(b.baxis),d(b.caxis)}else if(p&&p.test(g)){var x=e[g],_=x.cameraposition;if(Array.isArray(_)&&4===_[0].length){var w=_[0],k=_[1],D=_[2],T=a([],w),A=[];for(n=0;n<3;++n)A[n]=k[n]+D*T[2+4*n];x.camera={eye:{x:A[0],y:A[1],z:A[2]},center:{x:k[0],y:k[1],z:k[2]},up:{x:0,y:0,z:1}},delete x.cameraposition}d(x.xaxis),d(x.yaxis),d(x.zaxis)}}var S=Array.isArray(e.annotations)?e.annotations.length:0;for(t=0;t<S;t++){var M=e.annotations[t];o.isPlainObject(M)&&(M.ref&&("paper"===M.ref?(M.xref="paper",M.yref="paper"):"data"===M.ref&&(M.xref="x",M.yref="y"),delete M.ref),h(M,"xref"),h(M,"yref"))}var E=Array.isArray(e.shapes)?e.shapes.length:0;for(t=0;t<E;t++){var C=e.shapes[t];o.isPlainObject(C)&&(h(C,"xref"),h(C,"yref"))}var N=Array.isArray(e.images)?e.images.length:0;for(t=0;t<N;t++){var O=e.images[t];o.isPlainObject(O)&&(h(O,"xref"),h(O,"yref"))}var I=e.legend;return I&&(I.x>3?(I.x=1.02,I.xanchor="left"):I.x<-2&&(I.x=-.02,I.xanchor="right"),I.y>3?(I.y=1.02,I.yanchor="bottom"):I.y<-2&&(I.y=-.02,I.yanchor="top")),d(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t<e.length;t++){var n,a=e[t];if("histogramy"===a.type&&"xbins"in a&&!("ybins"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&"opacity"in a.error_y){var l=c.defaults,f=a.error_y.color||(p(a,"bar")?c.defaultLine:l[t%l.length]);a.error_y.color=c.addOpacity(c.rgb(f),c.opacity(f)*a.error_y.opacity),delete a.error_y.opacity}if("bardir"in a&&("h"!==a.bardir||!p(a,"bar")&&"histogram"!==a.type.substr(0,9)||(a.orientation="h",r.swapXYData(a)),delete a.bardir),"histogramy"===a.type&&r.swapXYData(a),"histogramx"!==a.type&&"histogramy"!==a.type||(a.type="histogram"),"scl"in a&&!("colorscale"in a)&&(a.colorscale=a.scl,delete a.scl),"reversescl"in a&&!("reversescale"in a)&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=u(a.xaxis,"x")),a.yaxis&&(a.yaxis=u(a.yaxis,"y")),p(a,"gl3d")&&a.scene&&(a.scene=s.subplotsRegistry.gl3d.cleanId(a.scene)),!p(a,"pie-like")&&!p(a,"bar-like"))if(Array.isArray(a.textposition))for(n=0;n<a.textposition.length;n++)a.textposition[n]=y(a.textposition[n]);else a.textposition&&(a.textposition=y(a.textposition));var h=i.getModule(a);if(h&&h.colorbar){var b=h.colorbar.container,x=b?a[b]:a;x&&x.colorscale&&("YIGnBu"===x.colorscale&&(x.colorscale="YlGnBu"),"YIOrRd"===x.colorscale&&(x.colorscale="YlOrRd"))}if("surface"===a.type&&o.isPlainObject(a.contours)){var _=["x","y","z"];for(n=0;n<_.length;n++){var w=a.contours[_[n]];o.isPlainObject(w)&&(w.highlightColor&&(w.highlightcolor=w.highlightColor,delete w.highlightColor),w.highlightWidth&&(w.highlightwidth=w.highlightWidth,delete w.highlightWidth))}}if("candlestick"===a.type||"ohlc"===a.type){var k=!1!==(a.increasing||{}).showlegend,D=!1!==(a.decreasing||{}).showlegend,T=m(a.increasing),A=m(a.decreasing);if(!1!==T&&!1!==A){var S=g(T,A,k,D);S&&(a.name=S)}else!T&&!A||a.name||(a.name=T||A)}if(Array.isArray(a.transforms)){var M=a.transforms;for(n=0;n<M.length;n++){var E=M[n];if(o.isPlainObject(E))switch(E.type){case"filter":E.filtersrc&&(E.target=E.filtersrc,delete E.filtersrc),E.calendar&&(E.valuecalendar||(E.valuecalendar=E.calendar),delete E.calendar);break;case"groupby":if(E.styles=E.styles||E.style,E.styles&&!Array.isArray(E.styles)){var C=E.styles,N=Object.keys(C);E.styles=[];for(var O=0;O<N.length;O++)E.styles.push({target:N[O],value:C[N[O]]})}}}}v(a,"line")&&delete a.line,"marker"in a&&(v(a.marker,"line")&&delete a.marker.line,v(a,"marker")&&delete a.marker),c.clean(a),a.autobinx&&(delete a.autobinx,delete a.xbins),a.autobiny&&(delete a.autobiny,delete a.ybins),d(a),a.colorbar&&d(a.colorbar),a.marker&&a.marker.colorbar&&d(a.marker.colorbar),a.line&&a.line.colorbar&&d(a.line.colorbar),a.aaxis&&d(a.aaxis),a.baxis&&d(a.baxis)}},r.swapXYData=function(e){var t;if(o.swapAttrs(e,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(e.z)&&Array.isArray(e.z[0])&&(e.transpose?delete e.transpose:e.transpose=!0),e.error_x&&e.error_y){var r=e.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);o.swapAttrs(e,["error_?.copy_ystyle"]),n&&o.swapAttrs(e,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof e.hoverinfo){var a=e.hoverinfo.split("+");for(t=0;t<a.length;t++)"x"===a[t]?a[t]="y":"y"===a[t]&&(a[t]="x");e.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(e,t){if(n(t))return[t];if(!Array.isArray(t)||!t.length)return e.data.map((function(e,t){return t}));if(Array.isArray(t)){for(var r=[],a=0;a<t.length;a++)o.isIndex(t[a],e.data.length)?r.push(t[a]):o.warn("trace index (",t[a],") is not a number or is out of bounds");return r}return t},r.manageArrayContainers=function(e,t,r){var a=e.obj,i=e.parts,s=i.length,l=i[s-1],c=n(l);if(c&&null===t){var u=i.slice(0,s-1).join(".");o.nestedProperty(a,u).get().splice(l,1)}else c&&void 0===e.get()?(void 0===e.get()&&(r[e.astr]=null),e.set(t)):e.set(t)};var b=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function x(e){var t=e.search(b);if(t>0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=x(t);r;){if(r in e)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n<t.length;n++)for(var a=e._fullData[n],i=0;i<3;i++){var s=f(e,a,_[i]);if(s&&"log"!==s.type){var l=s._name,c=s._id.substr(1);if("scene"===c.substr(0,5)){if(void 0!==r[c])continue;l=c+"."+l}var u=l+".type";void 0===r[l]&&void 0===r[u]&&o.nestedProperty(e.layout,u).set(null)}}}},{"../components/color":366,"../lib":503,"../plots/cartesian/axis_ids":558,"../plots/plots":619,"../registry":638,"fast-isnumeric":190,"gl-mat4/fromQuat":200}],538:[function(e,t,r){"use strict";var n=e("./plot_api");r._doPlot=n._doPlot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r._guiRestyle=n._guiRestyle,r._guiRelayout=n._guiRelayout,r._guiUpdate=n._guiUpdate,r._storeDirectGUIEdit=n._storeDirectGUIEdit,r.react=n.react,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.setPlotConfig=n.setPlotConfig,r.toImage=e("./to_image"),r.validate=e("./validate"),r.downloadImage=e("../snapshot/download");var a=e("./template_api");r.makeTemplate=a.makeTemplate,r.validateTemplate=a.validateTemplate},{"../snapshot/download":640,"./plot_api":540,"./template_api":545,"./to_image":546,"./validate":547}],539:[function(e,t,r){"use strict";var n=e("../lib/is_plain_object"),a=e("../lib/noop"),i=e("../lib/loggers"),o=e("../lib/search").sorterAsc,s=e("../registry");r.containerArrayMatch=e("./container_array_match");var l=r.isAddVal=function(e){return"add"===e||n(e)},c=r.isRemoveVal=function(e){return null===e||"remove"===e};r.applyContainerArrayChanges=function(e,t,r,n,u){var f=t.astr,p=s.getComponentMethod(f,"supplyLayoutDefaults"),h=s.getComponentMethod(f,"draw"),d=s.getComponentMethod(f,"drawOne"),m=n.replot||n.recalc||p===a||h===a,g=e.layout,y=e._fullLayout;if(r[""]){Object.keys(r).length>1&&i.warn("Full array edits are incompatible with other edits",f);var v=r[""][""];if(c(v))t.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",f,v),!0;t.set(v)}return!m&&(p(g,y),h(e),!0)}var b,x,_,w,k,D,T,A,S=Object.keys(r).map(Number).sort(o),M=t.get(),E=M||[],C=u(y,f).get(),N=[],O=-1,I=E.length;for(b=0;b<S.length;b++)if(w=r[_=S[b]],k=Object.keys(w),D=w[""],T=l(D),_<0||_>E.length-(T?0:1))i.warn("index out of range",f,_);else if(void 0!==D)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(D)?N.push(_):T?("add"===D&&(D={}),E.splice(_,0,D),C&&C.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,D),-1===O&&(O=_);else for(x=0;x<k.length;x++)A=f+"["+_+"].",u(E[_],k[x],A).set(w[k[x]]);for(b=N.length-1;b>=0;b--)E.splice(N[b],1),C&&C.splice(N[b],1);if(E.length?M||t.set(E):t.set(null),m)return!1;if(p(g,y),d!==a){var P;if(-1===O)P=S;else{for(I=Math.max(E.length,I),P=[],b=0;b<S.length&&!((_=S[b])>=O);b++)P.push(_);for(b=O;b<I;b++)P.push(b)}for(b=0;b<P.length;b++)d(e,P[b])}else h(e);return!0}},{"../lib/is_plain_object":504,"../lib/loggers":507,"../lib/noop":512,"../lib/search":523,"../registry":638,"./container_array_match":535}],540:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("has-hover"),o=e("../lib"),s=o.nestedProperty,l=e("../lib/events"),c=e("../lib/queue"),u=e("../registry"),f=e("./plot_schema"),p=e("../plots/plots"),h=e("../plots/cartesian/axes"),d=e("../components/drawing"),m=e("../components/color"),g=e("../plots/cartesian/graph_interact").initInteractions,y=e("../constants/xmlns_namespaces"),v=e("../plots/cartesian/select").clearSelect,b=e("./plot_config").dfltConfig,x=e("./manage_arrays"),_=e("./helpers"),w=e("./subroutines"),k=e("./edit_types"),D=e("../plots/cartesian/constants").AX_NAME_PATTERN,T=0;function A(e){var t=e._fullLayout;t._redrawFromAutoMarginCount?t._redrawFromAutoMarginCount--:e.emit("plotly_afterplot")}function S(e,t){try{e._fullLayout._paper.style("background",t)}catch(e){o.error(e)}}function M(e,t){S(e,m.combine(t,"white"))}function E(e,t){if(!e._context){e._context=o.extendDeep({},b);var r=n.select("base");e._context._baseUrl=r.size()&&r.attr("href")?window.location.href.split("#")[0]:""}var a,s,l,c=e._context;if(t){for(s=Object.keys(t),a=0;a<s.length;a++)"editable"!==(l=s[a])&&"edits"!==l&&l in c&&("setBackground"===l&&"opaque"===t[l]?c[l]=M:c[l]=t[l]);t.plot3dPixelRatio&&!c.plotGlPixelRatio&&(c.plotGlPixelRatio=c.plot3dPixelRatio);var u=t.editable;if(void 0!==u)for(c.editable=u,s=Object.keys(c.edits),a=0;a<s.length;a++)c.edits[s[a]]=u;if(t.edits)for(s=Object.keys(t.edits),a=0;a<s.length;a++)(l=s[a])in c.edits&&(c.edits[l]=t.edits[l]);c._exportedPlot=t._exportedPlot}c.staticPlot&&(c.editable=!1,c.edits={},c.autosizable=!1,c.scrollZoom=!1,c.doubleClick=!1,c.showTips=!1,c.showLink=!1,c.displayModeBar=!1),"hover"!==c.displayModeBar||i||(c.displayModeBar=!0),"transparent"!==c.setBackground&&"function"==typeof c.setBackground||(c.setBackground=S),c._hasZeroHeight=c._hasZeroHeight||0===e.clientHeight,c._hasZeroWidth=c._hasZeroWidth||0===e.clientWidth;var f=c.scrollZoom,p=c._scrollZoom={};if(!0===f)p.cartesian=1,p.gl3d=1,p.geo=1,p.mapbox=1;else if("string"==typeof f){var h=f.split("+");for(a=0;a<h.length;a++)p[h[a]]=1}else!1!==f&&(p.gl3d=1,p.geo=1,p.mapbox=1)}function C(e,t){var r,n,a=t+1,i=[];for(r=0;r<e.length;r++)(n=e[r])<0?i.push(a+n):i.push(n);return i}function N(e,t,r){var n,a;for(n=0;n<t.length;n++){if((a=t[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),N(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&N(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in N(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var l=function(e,t,r,n){var i,l,c,u,f,p=o.isPlainObject(n),h=[];for(var d in Array.isArray(r)||(r=[r]),r=C(r,e.data.length-1),t)for(var m=0;m<r.length;m++){if(i=e.data[r[m]],l=(c=s(i,d)).get(),u=t[d][m],!o.isArrayOrTypedArray(u))throw new Error("attribute: "+d+" index: "+m+" must be an array");if(!o.isArrayOrTypedArray(l))throw new Error("cannot extend missing or non-array attribute: "+d);if(l.constructor!==u.constructor)throw new Error("cannot extend array with an array of a different type: "+d);f=p?n[d][m]:n,a(f)||(f=-1),h.push({prop:c,target:l,insert:u,maxp:Math.floor(f)})}return h}(e,t,r,n),c={},u={},f=0;f<l.length;f++){var p=l[f].prop,h=l[f].maxp,d=i(l[f].target,l[f].insert,h);p.set(d[0]),Array.isArray(c[p.astr])||(c[p.astr]=[]),c[p.astr].push(d[1]),Array.isArray(u[p.astr])||(u[p.astr]=[]),u[p.astr].push(l[f].target.length)}return{update:c,maxPoints:u}}function P(e,t){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}function R(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var i={};if("string"==typeof t)i[t]=n;else{if(!o.isPlainObject(t))return o.warn("Restyle fail.",t,n,a),Promise.reject();i=o.extendFlat({},t),void 0===a&&(a=n)}Object.keys(i).length&&(e.changed=!0);var s=_.coerceTraceIndices(e,a),l=z(e,i,s),u=l.flags;u.calc&&(e.calcdata=void 0),u.clearAxisTypes&&_.clearAxisTypes(e,s,{});var f=[];u.fullReplot?f.push(r._doPlot):(f.push(p.previousPromises),p.supplyDefaults(e),u.markerSize&&(p.doCalcdata(e),V(f)),u.style&&f.push(w.doTraceStyle),u.colorbars&&f.push(w.doColorBars),f.push(A)),f.push(p.rehover,p.redrag),c.add(e,R,[e,l.undoit,l.traces],R,[e,l.redoit,l.traces]);var h=o.syncOrAsync(f,e);return h&&h.then||(h=Promise.resolve()),h.then((function(){return e.emit("plotly_restyle",l.eventData),e}))}function L(e){return void 0===e?null:e}function F(e,t){return t?function(t,r,n){var a=s(t,r),i=a.set;return a.set=function(t){B((n||"")+r,a.get(),t,e),i(t)},a}:s}function B(e,t,r,n){if(Array.isArray(t)||Array.isArray(r))for(var a=Array.isArray(t)?t:[],i=Array.isArray(r)?r:[],s=Math.max(a.length,i.length),l=0;l<s;l++)B(e+"["+l+"]",a[l],i[l],n);else if(o.isPlainObject(t)||o.isPlainObject(r)){var c=o.isPlainObject(t)?t:{},u=o.isPlainObject(r)?r:{},f=o.extendFlat({},c,u);for(var p in f)B(e+"."+p,c[p],u[p],n)}else void 0===n[e]&&(n[e]=L(t))}function z(e,t,r){var n,a=e._fullLayout,i=e._fullData,l=e.data,c=a._guiEditing,d=F(a._preGUI,c),m=o.extendDeepAll({},t);j(t);var g,y=k.traceFlags(),v={},b={};function x(){return r.map((function(){}))}function w(e){var t=h.id2name(e);-1===g.indexOf(t)&&g.push(t)}function D(e){return"LAYOUT"+e+".autorange"}function T(e){return"LAYOUT"+e+".range"}function A(e){for(var t=e;t<i.length;t++)if(i[t]._input===l[e])return i[t]}function S(n,i,o){if(Array.isArray(n))n.forEach((function(e){S(e,i,o)}));else if(!(n in t)&&!_.hasParent(t,n)){var s;if("LAYOUT"===n.substr(0,6))s=d(e.layout,n.replace("LAYOUT",""));else{var u=r[o];s=F(a._tracePreGUI[A(u)._fullInput.uid],c)(l[u],n)}n in b||(b[n]=x()),void 0===b[n][o]&&(b[n][o]=L(s.get())),void 0!==i&&s.set(i)}}function M(e){return function(t){return i[t][e]}}function E(e){return function(t,n){return!1===t?i[r[n]][e]:null}}for(var C in t){if(_.hasParent(t,C))throw new Error("cannot set "+C+" and a parent attribute simultaneously");var N,O,I,P,R,B,z=t[C];if("autobinx"!==C&&"autobiny"!==C||(C=C.charAt(C.length-1)+"bins",z=Array.isArray(z)?z.map(E(C)):!1===z?r.map(M(C)):null),v[C]=z,"LAYOUT"!==C.substr(0,6)){for(b[C]=x(),n=0;n<r.length;n++)if(N=l[r[n]],O=A(r[n]),P=(I=F(a._tracePreGUI[O._fullInput.uid],c)(N,C)).get(),void 0!==(R=Array.isArray(z)?z[n%z.length]:z)){var U=I.parts[I.parts.length-1],$=C.substr(0,C.length-U.length-1),V=$?$+".":"",q=$?s(O,$).get():O;if((B=f.getTraceValObject(O,I.parts))&&B.impliedEdits&&null!==R)for(var W in B.impliedEdits)S(o.relativeAttr(C,W),B.impliedEdits[W],n);else if("thicknessmode"!==U&&"lenmode"!==U||P===R||"fraction"!==R&&"pixels"!==R||!q){if("type"===C&&("pie"===R!=("pie"===P)||"funnelarea"===R!=("funnelarea"===P))){var H="x",G="y";"bar"!==R&&"bar"!==P||"h"!==N.orientation||(H="y",G="x"),o.swapAttrs(N,["?","?src"],"labels",H),o.swapAttrs(N,["d?","?0"],"label",H),o.swapAttrs(N,["?","?src"],"values",G),"pie"===P||"funnelarea"===P?(s(N,"marker.color").set(s(N,"marker.colors").get()),a._pielayer.selectAll("g.trace").remove()):u.traceIs(N,"cartesian")&&s(N,"marker.colors").set(s(N,"marker.color").get())}}else{var X=a._size,Y=q.orient,Z="top"===Y||"bottom"===Y;if("thicknessmode"===U){var K=Z?X.h:X.w;S(V+"thickness",q.thickness*("fraction"===R?1/K:K),n)}else{var J=Z?X.w:X.h;S(V+"len",q.len*("fraction"===R?1/J:J),n)}}if(b[C][n]=L(P),-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(C)){if("orientation"===C){I.set(R);var Q=N.x&&!N.y?"h":"v";if((I.get()||Q)===O.orientation)continue}else"orientationaxes"===C&&(N.orientation={v:"h",h:"v"}[O.orientation]);_.swapXYData(N),y.calc=y.clearAxisTypes=!0}else-1!==p.dataArrayContainers.indexOf(I.parts[0])?(_.manageArrayContainers(I,R,b),y.calc=!0):(B?B.arrayOk&&!u.traceIs(O,"regl")&&(o.isArrayOrTypedArray(R)||o.isArrayOrTypedArray(P))?y.calc=!0:k.update(y,B):y.calc=!0,I.set(R))}if(-1!==["swapxyaxes","orientationaxes"].indexOf(C)&&h.swap(e,r),"orientationaxes"===C){var ee=s(e.layout,"hovermode"),te=ee.get();"x"===te?ee.set("y"):"y"===te?ee.set("x"):"x unified"===te?ee.set("y unified"):"y unified"===te&&ee.set("x unified")}if(-1!==["orientation","type"].indexOf(C)){for(g=[],n=0;n<r.length;n++){var re=l[r[n]];u.traceIs(re,"cartesian")&&(w(re.xaxis||"x"),w(re.yaxis||"y"))}S(g.map(D),!0,0),S(g.map(T),[0,1],0)}}else I=d(e.layout,C.replace("LAYOUT","")),b[C]=[L(I.get())],I.set(Array.isArray(z)?z[0]:z),y.calc=!0}return(y.calc||y.plot)&&(y.fullReplot=!0),{flags:y,undoit:b,redoit:v,traces:r,eventData:o.extendDeepNoArrays([],[m,r])}}function j(e){var t,r,n,a=o.counterRegex("axis",".title",!1,!1),i=/colorbar\.title$/,s=Object.keys(e);for(t=0;t<s.length;t++)r=s[t],n=e[r],"title"!==r&&!a.test(r)&&!i.test(r)||"string"!=typeof n&&"number"!=typeof n?r.indexOf("titlefont")>-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(t,r){e[r]=e[t],delete e[t]}}function U(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=G(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var s=[p.previousPromises];i.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&($(e,i,a)||p.supplyDefaults(e),i.legend&&s.push(w.doLegend),i.layoutstyle&&s.push(w.layoutStyles),i.axrange&&V(s,a.rangesAltered),i.ticks&&s.push(w.doTicksRelayout),i.modebar&&s.push(w.doModeBar),i.camera&&s.push(w.doCamera),i.colorbars&&s.push(w.doColorBars),s.push(A)),s.push(p.rehover,p.redrag),c.add(e,U,[e,a.undoit],U,[e,a.redoit]);var l=o.syncOrAsync(s,e);return l&&l.then||(l=Promise.resolve(e)),l.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function $(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),s=e.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function V(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,W=/^[xyz]axis[0-9]*\.autorange$/,H=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function G(e,t){var r,n,a,i=e.layout,l=e._fullLayout,c=l._guiEditing,p=F(l._preGUI,c),d=Object.keys(t),m=h.list(e),g=o.extendDeepAll({},t),y={};for(j(t),d=Object.keys(t),n=0;n<d.length;n++)if(0===d[n].indexOf("allaxes")){for(a=0;a<m.length;a++){var v=m[a]._id.substr(1),b=-1!==v.indexOf("scene")?v+".":"",w=d[n].replace("allaxes",b+m[a]._name);t[w]||(t[w]=t[d[n]])}delete t[d[n]]}var T=k.layoutFlags(),A={},S={};function M(e,r){if(Array.isArray(e))e.forEach((function(e){M(e,r)}));else if(!(e in t)&&!_.hasParent(t,e)){var n=p(i,e);e in S||(S[e]=L(n.get())),void 0!==r&&n.set(r)}}var E,C={};function N(e){var t=h.name2id(e.split(".")[0]);return C[t]=1,t}for(var O in t){if(_.hasParent(t,O))throw new Error("cannot set "+O+" and a parent attribute simultaneously");for(var I=p(i,O),P=t[O],R=I.parts.length-1;R>0&&"string"!=typeof I.parts[R];)R--;var B=I.parts[R],z=I.parts[R-1]+"."+B,U=I.parts.slice(0,R).join("."),$=s(e.layout,U).get(),V=s(l,U).get(),G=I.get();if(void 0!==P){A[O]=P,S[O]="reverse"===B?P:L(G);var Y=f.getLayoutValObject(l,I.parts);if(Y&&Y.impliedEdits&&null!==P)for(var Z in Y.impliedEdits)M(o.relativeAttr(O,Z),Y.impliedEdits[Z]);if(-1!==["width","height"].indexOf(O))if(P){M("autosize",null);var K="height"===O?"width":"height";M(K,l[K])}else l[O]=e._initialAutoSize[O];else if("autosize"===O)M("width",P?null:l.width),M("height",P?null:l.height);else if(z.match(q))N(z),s(l,U+"._inputRange").set(null);else if(z.match(W)){N(z),s(l,U+"._inputRange").set(null);var J=s(l,U).get();J._inputDomain&&(J._input.domain=J._inputDomain.slice())}else z.match(H)&&s(l,U+"._inputDomain").set(null);if("type"===B){E=$;var Q="linear"===V.type&&"log"===P,ee="log"===V.type&&"linear"===P;if(Q||ee){if(E&&E.range)if(V.autorange)Q&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var te=E.range[0],re=E.range[1];Q?(te<=0&&re<=0&&M(U+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),M(U+".range[0]",Math.log(te)/Math.LN10),M(U+".range[1]",Math.log(re)/Math.LN10)):(M(U+".range[0]",Math.pow(10,te)),M(U+".range[1]",Math.pow(10,re)))}else M(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete l[I.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,V,P,M),u.getComponentMethod("images","convertCoords")(e,V,P,M)}else M(U+".autorange",!0),M(U+".range",null);s(l,U+"._inputRange").set(null)}else if(B.match(D)){var ne=s(l,O).get(),ae=(P||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,M),u.getComponentMethod("images","convertCoords")(e,ne,ae,M)}var ie=x.containerArrayMatch(O);if(ie){r=ie.array,n=ie.index;var oe=ie.property,se=Y||{editType:"calc"};""!==n&&""===oe&&(x.isAddVal(P)?S[O]=null:x.isRemoveVal(P)?S[O]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),k.update(T,se),y[r]||(y[r]={});var le=y[r][n];le||(le=y[r][n]={}),le[oe]=P,delete t[O]}else"reverse"===B?($.range?$.range.reverse():(M(U+".autorange",!0),$.range=[1,0]),V.autorange?T.calc=!0:T.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===O&&("lasso"===P||"select"===P)&&"lasso"!==G&&"select"!==G||l._has("gl2d")?T.plot=!0:Y?k.update(T,Y):T.calc=!0,I.set(P))}}for(r in y)x.applyContainerArrayChanges(e,p(i,r),y[r],T,p)||(T.plot=!0);for(var ce in C){var ue=(E=h.getFromId(e,ce))&&E._constraintGroup;if(ue)for(var fe in T.calc=!0,ue)C[fe]||(h.getFromId(e,fe)._constraintShrinkable=!0)}return(X(e)||t.height||t.width)&&(T.plot=!0),(T.plot||T.calc)&&(T.layoutReplot=!0),{flags:T,rangesAltered:C,undoit:S,redoit:A,eventData:g}}function X(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&p.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function Y(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),s=z(e,o.extendFlat({},t),i),l=s.flags,u=G(e,o.extendFlat({},n)),f=u.flags;(l.calc||f.calc)&&(e.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(e,i,n);var h=[];f.layoutReplot?h.push(w.layoutReplot):l.fullReplot?h.push(r._doPlot):(h.push(p.previousPromises),$(e,f,u)||p.supplyDefaults(e),l.style&&h.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&h.push(w.doColorBars),f.legend&&h.push(w.doLegend),f.layoutstyle&&h.push(w.layoutStyles),f.axrange&&V(h,u.rangesAltered),f.ticks&&h.push(w.doTicksRelayout),f.modebar&&h.push(w.doModeBar),f.camera&&h.push(w.doCamera),h.push(A)),h.push(p.rehover,p.redrag),c.add(e,Y,[e,s.undoit,u.undoit,s.traces],Y,[e,s.redoit,u.redoit,s.traces]);var d=o.syncOrAsync(h,e);return d&&d.then||(d=Promise.resolve(e)),d.then((function(){return e.emit("plotly_update",{data:s.eventData,layout:u.eventData}),e}))}function Z(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],J=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function Q(e,t){for(var r=0;r<t.length;r++){var n=t[r],a=e.match(n.pattern);if(a){var i=a[1]||"";return{head:i,tail:e.substr(i.length+1),attr:n.attr}}}}function ee(e,t){var r=s(t,e).get();if(void 0!==r)return r;var n=e.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=s(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r<t.length;r++)if(t[r]._fullInput.uid===e)return r;return-1}function re(e,t,r){for(var n=0;n<t.length;n++)if(t[n].uid===e)return n;return!t[r]||t[r].uid?-1:r}function ne(e,t){var r=o.isPlainObject(e),n=Array.isArray(e);return r||n?(r&&o.isPlainObject(t)||n&&Array.isArray(t))&&JSON.stringify(e)===JSON.stringify(t):e===t}function ae(e,t,r,n){var a,i,l,c=n.getValObject,u=n.flags,f=n.immutable,p=n.inArray,h=n.arrayIndex;function d(){var e=a.editType;p&&-1!==e.indexOf("arraydraw")?o.pushUnique(u.arrays[p],h):(k.update(u,a),"none"!==e&&u.nChanges++,n.transition&&a.anim&&u.nChangesAnim++,(q.test(l)||W.test(l))&&(u.rangesAltered[r[0]]=1),H.test(l)&&s(t,"_inputDomain").set(null),"datarevision"===i&&(u.newDataRevision=1))}function m(e){return"data_array"===e.valType||e.arrayOk}for(i in e){if(u.calc&&!n.transition)return;var g=e[i],y=t[i],v=r.concat(i);if(l=v.join("."),"_"!==i.charAt(0)&&"function"!=typeof g&&g!==y){if(("tick0"===i||"dtick"===i)&&"geo"!==r[0]){var b=t.tickmode;if("auto"===b||"array"===b||!b)continue}if(("range"!==i||!t.autorange)&&("zmin"!==i&&"zmax"!==i||"contourcarpet"!==t.type)&&(a=c(v))&&(!a._compareAsJSON||JSON.stringify(g)!==JSON.stringify(y))){var x,_=a.valType,w=m(a),D=Array.isArray(g),T=Array.isArray(y);if(D&&T){var A="_input_"+i,S=e[A],M=t[A];if(Array.isArray(S)&&S===M)continue}if(void 0===y)w&&D?u.calc=!0:d();else if(a._isLinkedToArray){var E=[],C=!1;p||(u.arrays[i]=E);var N=Math.min(g.length,y.length),O=Math.max(g.length,y.length);if(N!==O){if("arraydraw"!==a.editType){d();continue}C=!0}for(x=0;x<N;x++)ae(g[x],y[x],v.concat(x),o.extendFlat({inArray:i,arrayIndex:x},n));if(C)for(x=N;x<O;x++)E.push(x)}else!_&&o.isPlainObject(g)?ae(g,y,v,n):w?D&&T?(f&&(u.calc=!0),(f||n.newDataRevision)&&d()):D!==T?u.calc=!0:d():D&&T&&g.length===y.length&&String(g)===String(y)||d()}}}for(i in t)if(!(i in e)&&"_"!==i.charAt(0)&&"function"!=typeof t[i]){if(m(a=c(r.concat(i)))&&Array.isArray(t[i]))return void(u.calc=!0);d()}}function ie(e){var t=e._fullLayout,r=e.getBoundingClientRect();if(!o.equalDomRects(r,t._lastBBox)){var n=t._invTransform=o.inverseTransformMatrix(o.getFullTransformMatrix(e));t._invScaleX=Math.sqrt(n[0][0]*n[0][0]+n[0][1]*n[0][1]+n[0][2]*n[0][2]),t._invScaleY=Math.sqrt(n[1][0]*n[1][0]+n[1][1]*n[1][1]+n[1][2]*n[1][2]),t._lastBBox=r}}r.animate=function(e,t,r){if(e=o.getGraphDiv(e),!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var n=e._transitionData;n._frameQueue||(n._frameQueue=[]);var a=(r=p.supplyAnimationDefaults(r)).transition,i=r.frame;function s(e){return Array.isArray(a)?e>=a.length?a[0]:a[e]:a}function l(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,p.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};t()}var h,d,m=0;function g(e){return Array.isArray(a)?m>=a.length?e.transitionOpts=a[m]:e.transitionOpts=a[0]:e.transitionOpts=a,m++,e}var y=[],v=null==t,b=Array.isArray(t);if(v||b||!o.isPlainObject(t)){if(v||-1!==["string","number"].indexOf(typeof t))for(h=0;h<n._frames.length;h++)(d=n._frames[h])&&(v||String(d.group)===String(t))&&y.push({type:"byname",name:String(d.name),data:g({name:d.name})});else if(b)for(h=0;h<t.length;h++){var x=t[h];-1!==["number","string"].indexOf(typeof x)?(x=String(x),y.push({type:"byname",name:x,data:g({name:x})})):o.isPlainObject(x)&&y.push({type:"object",data:g(o.extendFlat({},x))})}}else y.push({type:"object",data:g(o.extendFlat({},t))});for(h=0;h<y.length;h++)if("byname"===(d=y[h]).type&&!n._frameHash[d.data.name])return o.warn('animate failure: frame not found: "'+d.data.name+'"'),void u();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var t=n._frameQueue.pop();t.onInterrupt&&t.onInterrupt()}e.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&y.reverse();var w=e._fullLayout._currentFrame;if(w&&r.fromcurrent){var k=-1;for(h=0;h<y.length;h++)if("byname"===(d=y[h]).type&&d.name===w){k=h;break}if(k>0&&k<y.length-1){var D=[];for(h=0;h<y.length;h++)d=y[h],("byname"!==y[h].type||h>k)&&D.push(d);y=D}}y.length>0?function(t){if(0!==t.length){for(var a=0;a<t.length;a++){var o;o="byname"===t[a].type?p.computeFrame(e,t[a].name):t[a].data;var h=l(a),d=s(a);d.duration=Math.min(d.duration,h.duration);var m={frame:o,name:t[a].name,frameOpts:h,transitionOpts:d};a===t.length-1&&(m.onComplete=c(i,2),m.onInterrupt=u),n._frameQueue.push(m)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||f()}}(y):(e.emit("plotly_animated"),i())}))},r.addFrames=function(e,t,r){if(e=o.getGraphDiv(e),null==t)return Promise.resolve();if(!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,a,i,s,l=e._transitionData._frames,u=e._transitionData._frameHash;if(!Array.isArray(t))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+t);var f=l.length+2*t.length,h=[],d={};for(n=t.length-1;n>=0;n--)if(o.isPlainObject(t[n])){var m=t[n].name,g=(u[m]||d[m]||{}).name,y=t[n].name,v=u[g]||d[g];g&&y&&"number"==typeof y&&v&&T<5&&(T++,o.warn('addFrames: overwriting frame "'+(u[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===T&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},h.push({frame:p.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}h.sort((function(e,t){return e.index>t.index?-1:e.index<t.index?1:0}));var b=[],x=[],_=l.length;for(n=h.length-1;n>=0;n--){if("number"==typeof(a=h[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i<l.length&&(l[i]||{}).name!==a.name;i++);b.push({type:"replace",index:i,value:a}),x.unshift({type:"replace",index:i,value:l[i]})}else s=Math.max(0,Math.min(h[n].index,_)),b.push({type:"insert",index:s,value:a}),x.unshift({type:"delete",index:s}),_++}var w=p.modifyFrames,k=p.modifyFrames,D=[e,x],A=[e,b];return c&&c.add(e,w,D,k,A),p.modifyFrames(e,b)},r.deleteFrames=function(e,t){if(e=o.getGraphDiv(e),!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e);var r,n,a=e._transitionData._frames,i=[],s=[];if(!t)for(t=[],r=0;r<a.length;r++)t.push(r);for((t=t.slice()).sort(),r=t.length-1;r>=0;r--)n=t[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=p.modifyFrames,u=p.modifyFrames,f=[e,s],h=[e,i];return c&&c.add(e,l,f,u,h),p.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,s,l=[],u=r.deleteTraces,f=e,p=[t,l],h=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n<t.length;n++)if("object"!=typeof(a=t[n])||Array.isArray(a)||null===a)throw new Error("all values in traces array must be non-array objects");if(void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&r.length!==t.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(t,n,a),Array.isArray(n)||(n=[n]),n=n.map((function(e){return o.extendFlat({},e)})),_.cleanData(n),i=0;i<n.length;i++)t.data.push(n[i]);for(i=0;i<n.length;i++)l.push(-n.length+i);if(void 0===a)return s=r.redraw(t),c.add(t,u,p,f,h),s;Array.isArray(a)||(a=[a]);try{O(t,l,a)}catch(e){throw t.data.splice(t.data.length-n.length,n.length),e}return c.startSequence(t),c.add(t,u,p,f,h),s=r.moveTraces(t,l,a),c.stopSequence(t),s},r.deleteTraces=function e(t,n){t=o.getGraphDiv(t);var a,i,s=[],l=r.addTraces,u=e,f=[t,s,n],p=[t,n];if(void 0===n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),N(t,n,"indices"),(n=C(n,t.data.length-1)).sort(o.sorterDes),a=0;a<n.length;a+=1)i=t.data.splice(n[a],1)[0],s.push(i);var h=r.redraw(t);return c.add(t,l,f,u,p),h},r.extendTraces=function e(t,n,a,i){function s(e,t,r){var n,a;if(o.isTypedArray(e))if(r<0){var i=new e.constructor(0),s=P(e,t);r<0?(n=s,a=i):(n=i,a=s)}else if(n=new e.constructor(r),a=new e.constructor(e.length+t.length-r),r===t.length)n.set(t),a.set(e);else if(r<t.length){var l=t.length-r;n.set(t.subarray(l)),a.set(e),a.set(t.subarray(0,l),e.length)}else{var c=r-t.length,u=e.length-c;n.set(e.subarray(u)),n.set(t,c),a.set(e.subarray(0,u))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]}var l=I(t=o.getGraphDiv(t),n,a,i,s),u=r.redraw(t),f=[t,l.update,a,l.maxPoints];return c.add(t,r.prependTraces,f,e,arguments),u},r.moveTraces=function e(t,n,a){var i,s=[],l=[],u=e,f=e,p=[t=o.getGraphDiv(t),a,n],h=[t,n,a];if(O(t,n,a),n=Array.isArray(n)?n:[n],void 0===a)for(a=[],i=0;i<n.length;i++)a.push(-n.length+i);for(a=Array.isArray(a)?a:[a],n=C(n,t.data.length-1),a=C(a,t.data.length-1),i=0;i<t.data.length;i++)-1===n.indexOf(i)&&s.push(t.data[i]);for(i=0;i<n.length;i++)l.push({newIndex:a[i],trace:t.data[n[i]]});for(l.sort((function(e,t){return e.newIndex-t.newIndex})),i=0;i<l.length;i+=1)s.splice(l[i].newIndex,0,l[i].trace);t.data=s;var d=r.redraw(t);return c.add(t,u,p,f,h),d},r.prependTraces=function e(t,n,a,i){function s(e,t,r){var n,a;if(o.isTypedArray(e))if(r<=0){var i=new e.constructor(0),s=P(t,e);r<0?(n=s,a=i):(n=i,a=s)}else if(n=new e.constructor(r),a=new e.constructor(e.length+t.length-r),r===t.length)n.set(t),a.set(e);else if(r<t.length){var l=t.length-r;n.set(t.subarray(0,l)),a.set(t.subarray(l)),a.set(e,l)}else{var c=r-t.length;n.set(t),n.set(e.subarray(0,c),t.length),a.set(e.subarray(c))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]}var l=I(t=o.getGraphDiv(t),n,a,i,s),u=r.redraw(t),f=[t,l.update,a,l.maxPoints];return c.add(t,r.extendTraces,f,e,arguments),u},r.newPlot=function(e,t,n,a){return e=o.getGraphDiv(e),p.cleanPlot([],{},e._fullData||[],e._fullLayout||{}),p.purge(e),r._doPlot(e,t,n,a)},r._doPlot=function(e,t,a,i){var s;if(e=o.getGraphDiv(e),l.init(e),o.isPlainObject(t)){var c=t;t=c.data,a=c.layout,i=c.config,s=c.frames}if(!1===l.triggerHandler(e,"plotly_beforeplot",[t,a,i]))return Promise.reject();t||a||o.isPlotDiv(e)||o.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",e),E(e,i),a||(a={}),n.select(e).classed("js-plotly-plot",!0),d.makeTester(),Array.isArray(e._promises)||(e._promises=[]);var f=0===(e.data||[]).length&&Array.isArray(t);Array.isArray(t)&&(_.cleanData(t),f?e.data=t:e.data.push.apply(e.data,t),e.empty=!1),e.layout&&!f||(e.layout=_.cleanLayout(a)),p.supplyDefaults(e);var m=e._fullLayout,v=m._has("cartesian");m._replotting=!0,(f||m._shouldCreateBgLayer)&&(function(e){var t=n.select(e),r=e._fullLayout;if(r._calcInverseTransform=ie,r._calcInverseTransform(e),r._container=t.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([{}]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paperdiv.select(".modebar-container").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),r._modebardiv=r._paperdiv.append("div"),delete r._modeBar,r._hoverpaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var a={};n.selectAll("defs").each((function(){this.id&&(a[this.id.split("-")[1]]=1)})),r._uid=o.randstr(a)}r._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._clips=r._defs.append("g").classed("clips",!0),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._topclips=r._topdefs.append("g").classed("clips",!0),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._polarlayer=r._paper.append("g").classed("polarlayer",!0),r._smithlayer=r._paper.append("g").classed("smithlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0),r._funnelarealayer=r._paper.append("g").classed("funnelarealayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._iciclelayer=r._paper.append("g").classed("iciclelayer",!0),r._treemaplayer=r._paper.append("g").classed("treemaplayer",!0),r._sunburstlayer=r._paper.append("g").classed("sunburstlayer",!0),r._indicatorlayer=r._toppaper.append("g").classed("indicatorlayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0);var s=r._toppaper.append("g").classed("layer-above",!0);r._imageUpperLayer=s.append("g").classed("imagelayer",!0),r._shapeUpperLayer=s.append("g").classed("shapelayer",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._menulayer=r._toppaper.append("g").classed("menulayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._hoverpaper.append("g").classed("hoverlayer",!0),r._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),e.emit("plotly_framework")}(e),m._shouldCreateBgLayer&&delete m._shouldCreateBgLayer),d.initGradients(e),d.initPatterns(e),f&&h.saveShowSpikeInitial(e);var b=!e.calcdata||e.calcdata.length!==(e._fullData||[]).length;b&&p.doCalcdata(e);for(var x=0;x<e.calcdata.length;x++)e.calcdata[x][0].trace=e._fullData[x];e._context.responsive?e._responsiveChartHandler||(e._responsiveChartHandler=function(){o.isHidden(e)||p.resize(e)},window.addEventListener("resize",e._responsiveChartHandler)):o.clearResponsive(e);var k=o.extendFlat({},m._size),D=0;function T(){if(p.clearAutoMarginIds(e),w.drawMarginPushers(e),h.allowAutoMargin(e),m._has("pie"))for(var t=e._fullData,r=0;r<t.length;r++){var n=t[r];"pie"===n.type&&n.automargin&&p.allowAutoMargin(e,"pie."+n.uid+".automargin")}return p.doAutoMargin(e),p.previousPromises(e)}function S(){e._transitioning||(w.doAutoRangeAndConstraints(e),f&&h.saveRangeInitial(e),u.getComponentMethod("rangeslider","calcAutorange")(e))}var M=[p.previousPromises,function(){if(s)return r.addFrames(e,s)},function t(){for(var r=m._basePlotModules,n=0;n<r.length;n++)r[n].drawFramework&&r[n].drawFramework(e);!m._glcanvas&&m._has("gl")&&(m._glcanvas=m._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],(function(e){return e.key})),m._glcanvas.enter().append("canvas").attr("class",(function(e){return"gl-canvas gl-canvas-"+e.key.replace("Layer","")})).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"}));var a=e._context.plotGlPixelRatio;if(m._glcanvas){m._glcanvas.attr("width",m.width*a).attr("height",m.height*a).style("width",m.width+"px").style("height",m.height+"px");var i=m._glcanvas.data()[0].regl;if(i&&(Math.floor(m.width*a)!==i._gl.drawingBufferWidth||Math.floor(m.height*a)!==i._gl.drawingBufferHeight)){var s="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!D)return o.log(s+" Clearing graph and plotting again."),p.cleanPlot([],{},e._fullData,m),p.supplyDefaults(e),m=e._fullLayout,p.doCalcdata(e),D++,t();o.error(s)}}return"h"===m.modebar.orientation?m._modebardiv.style("height",null).style("width","100%"):m._modebardiv.style("width",null).style("height",m.height+"px"),p.previousPromises(e)},T,function(){if(p.didMarginChange(k,m._size))return o.syncOrAsync([T,w.layoutStyles],e)}];v&&M.push((function(){if(b)return o.syncOrAsync([u.getComponentMethod("shapes","calcAutorange"),u.getComponentMethod("annotations","calcAutorange"),S],e);S()})),M.push(w.layoutStyles),v&&M.push((function(){return h.draw(e,f?"":"redraw")}),(function(e){e._fullLayout._insideTickLabelsAutorange&&U(e,e._fullLayout._insideTickLabelsAutorange).then((function(){e._fullLayout._insideTickLabelsAutorange=void 0}))})),M.push(w.drawData,w.finalDraw,g,p.addLinks,p.rehover,p.redrag,p.doAutoMargin,(function(e){e._fullLayout._insideTickLabelsAutorange&&f&&h.saveRangeInitial(e,!0)}),p.previousPromises);var C=o.syncOrAsync(M,e);return C&&C.then||(C=Promise.resolve()),C.then((function(){return A(e),e}))},r.purge=function(e){var t=(e=o.getGraphDiv(e))._fullLayout||{},r=e._fullData||[];return p.cleanPlot([],{},r,t),p.purge(e),l.purge(e),t._container&&t._container.remove(),delete e._context,e},r.react=function(e,t,n,a){var i,l;e=o.getGraphDiv(e),_.clearPromiseQueue(e);var c=e._fullData,h=e._fullLayout;if(o.isPlotDiv(e)&&c&&h){if(o.isPlainObject(t)){var d=t;t=d.data,n=d.layout,a=d.config,i=d.frames}var m=!1;if(a){var g=o.extendDeep({},e._context);e._context=void 0,E(e,a),m=function e(t,r){var n;for(n in t)if("_"!==n.charAt(0)){var a=t[n],i=r[n];if(a!==i)if(o.isPlainObject(a)&&o.isPlainObject(i)){if(e(a,i))return!0}else{if(!Array.isArray(a)||!Array.isArray(i))return!0;if(a.length!==i.length)return!0;for(var s=0;s<a.length;s++)if(a[s]!==i[s]){if(!o.isPlainObject(a[s])||!o.isPlainObject(i[s]))return!0;if(e(a[s],i[s]))return!0}}}}(g,e._context)}e.data=t||[],_.cleanData(e.data),e.layout=n||{},_.cleanLayout(e.layout),function(e,t,r,n){var a,i,l,c,u,f,p,h,d,m,g=n._preGUI,y=[],v={},b={};for(a in g){if(u=Q(a,K)){if(d=u.head,m=u.tail,i=u.attr||d+".uirevision",(c=(l=s(n,i).get())&&ee(i,t))&&c===l){if(null===(f=g[a])&&(f=void 0),ne(h=(p=s(t,a)).get(),f)){void 0===h&&"autorange"===m&&y.push(d),p.set(L(s(n,a).get()));continue}if("autorange"===m||"range["===m.substr(0,6)){var x=g[d+".range[0]"],_=g[d+".range[1]"],w=g[d+".autorange"];if(w||null===w&&null===x&&null===_){if(!(d in v)){var k=s(t,d).get();v[d]=k&&(k.autorange||!1!==k.autorange&&(!k.range||2!==k.range.length))}if(v[d]){p.set(L(s(n,a).get()));continue}}}}}else o.warn("unrecognized GUI edit: "+a);delete g[a],u&&"range["===u.tail.substr(0,6)&&(b[u.head]=1)}for(var D=0;D<y.length;D++){var T=y[D];if(b[T]){var A=s(t,T).get();A&&delete A.autorange}}var S=n._tracePreGUI;for(var M in S){var E,C=S[M],N=null;for(a in C){if(!N){var O=te(M,r);if(O<0){delete S[M];break}var I=re(M,e,(E=r[O]._fullInput).index);if(I<0){delete S[M];break}N=e[I]}if(u=Q(a,J)){if(u.attr?c=(l=s(n,u.attr).get())&&ee(u.attr,t):(l=E.uirevision,void 0===(c=N.uirevision)&&(c=t.uirevision)),c&&c===l&&(null===(f=C[a])&&(f=void 0),ne(h=(p=s(N,a)).get(),f))){p.set(L(s(E,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a+" in trace uid "+M);delete C[a]}}}(e.data,e.layout,c,h),p.supplyDefaults(e,{skipUpdateCalc:!0});var y=e._fullData,v=e._fullLayout,b=void 0===v.datarevision,x=v.transition,D=function(e,t,r,n,a){var i=k.layoutFlags();return i.arrays={},i.rangesAltered={},i.nChanges=0,i.nChangesAnim=0,ae(t,r,[],{getValObject:function(e){return f.getLayoutValObject(r,e)},flags:i,immutable:n,transition:a,gd:e}),(i.plot||i.calc)&&(i.layoutReplot=!0),a&&i.nChanges&&i.nChangesAnim&&(i.anim=i.nChanges===i.nChangesAnim?"all":"some"),i}(e,h,v,b,x),T=D.newDataRevision,S=function(e,t,r,n,a,i){var o=t.length===r.length;if(!a&&!o)return{fullReplot:!0,calc:!0};var s,l,c=k.traceFlags();c.arrays={},c.nChanges=0,c.nChangesAnim=0;var u={getValObject:function(e){var t=f.getTraceValObject(l,e);return!l._module.animatable&&t.anim&&(t.anim=!1),t},flags:c,immutable:n,transition:a,newDataRevision:i,gd:e},h={};for(s=0;s<t.length;s++)if(r[s]){if(l=r[s]._fullInput,p.hasMakesDataTransform(l)&&(l=r[s]),h[l.uid])continue;h[l.uid]=1,ae(t[s]._fullInput,l,[],u)}return(c.calc||c.plot)&&(c.fullReplot=!0),a&&c.nChanges&&c.nChangesAnim&&(c.anim=c.nChanges===c.nChangesAnim&&o?"all":"some"),c}(e,c,y,b,x,T);if(X(e)&&(D.layoutReplot=!0),S.calc||D.calc){e.calcdata=void 0;for(var M=Object.getOwnPropertyNames(v),C=0;C<M.length;C++){var N=M[C],O=N.substring(0,5);if("xaxis"===O||"yaxis"===O){var I=v[N]._emptyCategories;I&&I()}}}else p.supplyDefaultsUpdateCalc(e.calcdata,y);var P=[];if(i&&(e._transitionData={},p.createTransitionData(e),P.push((function(){return r.addFrames(e,i)}))),v.transition&&!m&&(S.anim||D.anim))D.ticks&&P.push(w.doTicksRelayout),p.doCalcdata(e),w.doAutoRangeAndConstraints(e),P.push((function(){return p.transitionFromReact(e,S,D,h)}));else if(S.fullReplot||D.layoutReplot||m)e._fullLayout._skipDefaults=!0,P.push(r._doPlot);else{for(var R in D.arrays){var F=D.arrays[R];if(F.length){var B=u.getComponentMethod(R,"drawOne");if(B!==o.noop)for(var z=0;z<F.length;z++)B(e,F[z]);else{var j=u.getComponentMethod(R,"draw");if(j===o.noop)throw new Error("cannot draw components: "+R);j(e)}}}P.push(p.previousPromises),S.style&&P.push(w.doTraceStyle),(S.colorbars||D.colorbars)&&P.push(w.doColorBars),D.legend&&P.push(w.doLegend),D.layoutstyle&&P.push(w.layoutStyles),D.axrange&&V(P),D.ticks&&P.push(w.doTicksRelayout),D.modebar&&P.push(w.doModeBar),D.camera&&P.push(w.doCamera),P.push(A)}P.push(p.rehover,p.redrag),(l=o.syncOrAsync(P,e))&&l.then||(l=Promise.resolve(e))}else l=r.newPlot(e,t,n,a);return l.then((function(){return e.emit("plotly_react",{data:t,layout:n}),e}))},r.redraw=function(e){if(e=o.getGraphDiv(e),!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e);return _.cleanData(e.data),_.cleanLayout(e.layout),e.calcdata=void 0,r._doPlot(e).then((function(){return e.emit("plotly_redraw"),e}))},r.relayout=U,r.restyle=R,r.setPlotConfig=function(e){return o.extendFlat(b,e)},r.update=Y,r._guiRelayout=Z(U),r._guiRestyle=Z(R),r._guiUpdate=Z(Y),r._storeDirectGUIEdit=function(e,t,r){for(var n in r)B(n,s(e,n).get(),r[n],t)}},{"../components/color":366,"../components/drawing":388,"../constants/xmlns_namespaces":480,"../lib":503,"../lib/events":492,"../lib/queue":519,"../plots/cartesian/axes":554,"../plots/cartesian/constants":561,"../plots/cartesian/graph_interact":564,"../plots/cartesian/select":575,"../plots/plots":619,"../registry":638,"./edit_types":536,"./helpers":537,"./manage_arrays":539,"./plot_config":541,"./plot_schema":542,"./subroutines":544,"@plotly/d3":58,"fast-isnumeric":190,"has-hover":228}],541:[function(e,t,r){"use strict";var n={staticPlot:{valType:"boolean",dflt:!1},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox"],extras:[!0,!1],dflt:"gl3d+geo+mapbox"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},globalTransforms:{valType:"any",dflt:[]},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},a={};!function e(t,r){for(var n in t){var a=t[n];a.valType?r[n]=a.dflt:(r[n]||(r[n]={}),e(a,r[n]))}}(n,a),t.exports={configAttributes:n,dfltConfig:a}},{}],542:[function(e,t,r){"use strict";var n=e("../registry"),a=e("../lib"),i=e("../plots/attributes"),o=e("../plots/layout_attributes"),s=e("../plots/frame_attributes"),l=e("../plots/animation_attributes"),c=e("./plot_config").configAttributes,u=e("./edit_types"),f=a.extendDeepAll,p=a.isPlainObject,h=a.isArrayOrTypedArray,d=a.nestedProperty,m=a.valObjectMeta,g=["_isSubplotObj","_isLinkedToArray","_arrayAttrRegexps","_deprecated"];function y(e,t,r){if(!e)return!1;if(e._isLinkedToArray)if(v(t[r]))r++;else if(r<t.length)return!1;for(;r<t.length;r++){var n=e[t[r]];if(!p(n))break;if(e=n,r===t.length-1)break;if(e._isLinkedToArray){if(!v(t[++r]))return!1}else if("info_array"===e.valType){var a=t[++r];if(!v(a))return!1;var i=e.items;if(Array.isArray(i)){if(a>=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!v(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function v(e){return e===Math.round(e)&&e>=0}function b(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry)if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a<t.attr.length;a++)w(r,t,t.attr[a]);else w(r,t,"subplot"===t.attr?t.name:t.attr);for(e in n.componentsRegistry){var i=(t=n.componentsRegistry[e]).schema;if(i&&(i.subplots||i.layout)){var s=i.subplots;if(s&&s.xaxis&&!s.yaxis)for(var l in s.xaxis)delete r.yaxis[l]}else"colorscale"===t.name?f(r,t.layoutAttributes):t.layoutAttributes&&k(r,t.layoutAttributes,t.name)}return{layoutAttributes:_(r)}}function x(){var e={frames:f({},s)};return _(e),e.frames}function _(e){return function(e){r.crawl(e,(function(e,t,n){r.isValObject(e)?!0!==e.arrayOk&&"data_array"!==e.valType||(n[t+"src"]={valType:"string",editType:"none"}):p(e)&&(e.role="object")}))}(e),function(e){r.crawl(e,(function(e,t,r){if(e){var n=e._isLinkedToArray;n&&(delete e._isLinkedToArray,r[t]={items:{}},r[t].items[n]=e,r[t].role="object")}}))}(e),function(e){!function e(t){for(var r in t)if(p(t[r]))e(t[r]);else if(Array.isArray(t[r]))for(var n=0;n<t[r].length;n++)e(t[r][n]);else t[r]instanceof RegExp&&(t[r]=t[r].toString())}(e)}(e),e}function w(e,t,r){var n=d(e,r),a=f({},t.layoutAttributes);a._isSubplotObj=!0,n.set(a)}function k(e,t,r){var n=d(e,r);n.set(f(n.get()||{},t))}r.IS_SUBPLOT_OBJ="_isSubplotObj",r.IS_LINKED_TO_ARRAY="_isLinkedToArray",r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=g,r.get=function(){var e={};n.allTypes.forEach((function(t){e[t]=function(e){var t,a;a=(t=n.modules[e]._module).basePlotModule;var o={type:null},s=f({},i),l=f({},t.attributes);r.crawl(l,(function(e,t,r,n,a){d(s,a).set(void 0),void 0===e&&d(l,a).set(void 0)})),f(o,s),n.traceIs(e,"noOpacity")&&delete o.opacity,n.traceIs(e,"showLegend")||(delete o.showlegend,delete o.legendgroup),n.traceIs(e,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel),t.selectPoints||delete o.selectedpoints,f(o,l),a.attributes&&f(o,a.attributes),o.type=e;var c={meta:t.meta||{},categories:t.categories||{},animatable:Boolean(t.animatable),type:e,attributes:_(o)};if(t.layoutAttributes){var u={};f(u,t.layoutAttributes),c.layoutAttributes=_(u)}return t.animatable||r.crawl(c,(function(e){r.isValObject(e)&&"anim"in e&&delete e.anim})),c}(t)}));var t={};return Object.keys(n.transformsRegistry).forEach((function(e){t[e]=function(e){var t=n.transformsRegistry[e],r=f({},t.attributes);return Object.keys(n.componentsRegistry).forEach((function(t){var a=n.componentsRegistry[t];a.schema&&a.schema.transforms&&a.schema.transforms[e]&&Object.keys(a.schema.transforms[e]).forEach((function(t){k(r,a.schema.transforms[e][t],t)}))})),{attributes:_(r)}}(e)})),{defs:{valObjects:m,metaKeys:g.concat(["description","role","editType","impliedEdits"]),editType:{traces:u.traces,layout:u.layout},impliedEdits:{}},traces:e,layout:b(),transforms:t,frames:x(),animation:_(l),config:_(c)}},r.crawl=function(e,t,n,a){var i=n||0;a=a||"",Object.keys(e).forEach((function(n){var o=e[n];if(-1===g.indexOf(n)){var s=(a?a+".":"")+n;t(o,n,e,i,s),r.isValObject(o)||p(o)&&"impliedEdits"!==n&&r.crawl(o,t,i+1,s)}}))},r.isValObject=function(e){return e&&void 0!==e.valType},r.findArrayAttributes=function(e){var t,n,a=[],o=[],s=[];function l(e,r,i,l){o=o.slice(0,l).concat([r]),s=s.slice(0,l).concat([e&&e._isLinkedToArray]),e&&("data_array"===e.valType||!0===e.arrayOk)&&("colorbar"!==o[l-1]||"ticktext"!==r&&"tickvals"!==r)&&function e(t,r,i){var l=t[o[r]],c=i+o[r];if(r===o.length-1)h(l)&&a.push(n+c);else if(s[r]){if(Array.isArray(l))for(var u=0;u<l.length;u++)p(l[u])&&e(l[u],r+1,c+"["+u+"].")}else p(l)&&e(l,r+1,c+".")}(t,0,"")}t=e,n="",r.crawl(i,l),e._module&&e._module.attributes&&r.crawl(e._module.attributes,l);var c=e.transforms;if(c)for(var u=0;u<c.length;u++){var f=c[u],d=f._module;d&&(n="transforms["+u+"].",t=f,r.crawl(d.attributes,l))}return a},r.getTraceValObject=function(e,t){var r,a,o=t[0],s=1;if("transforms"===o){if(1===t.length)return i.transforms;var l=e.transforms;if(!Array.isArray(l)||!l.length)return!1;var c=t[1];if(!v(c)||c>=l.length)return!1;a=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[t[2]],s=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return y(a,t,s)},r.getLayoutValObject=function(e,t){return y(function(e,t){var r,a,i,s,l=e._basePlotModules;if(l){var c;for(r=0;r<l.length;r++){if((i=l[r]).attrRegex&&i.attrRegex.test(t)){if(i.layoutAttrOverrides)return i.layoutAttrOverrides;!c&&i.layoutAttributes&&(c=i.layoutAttributes)}var u=i.baseLayoutAttrOverrides;if(u&&t in u)return u[t]}if(c)return c}var f=e._modules;if(f)for(r=0;r<f.length;r++)if((s=f[r].layoutAttributes)&&t in s)return s[t];for(a in n.componentsRegistry){if("colorscale"===(i=n.componentsRegistry[a]).name&&0===t.indexOf("coloraxis"))return i.layoutAttributes[t];if(!i.schema&&t===i.name)return i.layoutAttributes}return t in o&&o[t]}(e,t[0]),t,1)}},{"../lib":503,"../plots/animation_attributes":548,"../plots/attributes":550,"../plots/frame_attributes":586,"../plots/layout_attributes":610,"../registry":638,"./edit_types":536,"./plot_config":541}],543:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/attributes"),i={name:{valType:"string",editType:"none"}};function o(e){return e&&"string"==typeof e}function s(e){var t=e.length-1;return"s"!==e.charAt(t)&&n.warn("bad argument to arrayDefaultKey: "+e),e.substr(0,e.length-1)+"defaults"}i.templateitemname={valType:"string",editType:"calc"},r.templatedArray=function(e,t){return t._isLinkedToArray=e,t.name=i.name,t.templateitemname=i.templateitemname,t},r.traceTemplater=function(e){var t,r,i={};for(t in e)r=e[t],Array.isArray(r)&&r.length&&(i[t]=0);return{newTrace:function(o){var s={type:t=n.coerce(o,{},a,"type"),_template:null};if(t in i){r=e[t];var l=i[t]%r.length;i[t]++,s._template=r[l]}return s}}},r.newContainer=function(e,t,r){var a=e._template,i=a&&(a[t]||r&&a[r]);return n.isPlainObject(i)||(i=null),e[t]={_template:i}},r.arrayTemplater=function(e,t,r){var n=e._template,a=n&&n[s(t)],i=n&&n[t];Array.isArray(i)&&i.length||(i=[]);var l={};return{newItem:function(e){var t={name:e.name,_input:e},n=t.templateitemname=e.templateitemname;if(!o(n))return t._template=a,t;for(var s=0;s<i.length;s++){var c=i[s];if(c.name===n)return l[n]=1,t._template=c,t}return t[r]=e[r]||!1,t._template=!1,t},defaultItems:function(){for(var e=[],t=0;t<i.length;t++){var r=i[t],n=r.name;if(o(n)&&!l[n]){var a={_template:r,name:n,_input:{_templateitemname:n}};a.templateitemname=r.templateitemname,e.push(a),l[n]=1}}return e}}},r.arrayDefaultKey=s,r.arrayEditor=function(e,t,r){var a=(n.nestedProperty(e,t).get()||[]).length,i=r._index,o=i>=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=t+"["+i+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(e,t){o?n.nestedProperty(s[l],e).set(t):s[l+"."+e]=t}function f(){var e=s;return c(),e}return c(),{modifyBase:function(e,t){s[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":503,"../plots/attributes":550}],544:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),s=e("../lib/clear_gl_canvases"),l=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),p=e("../plots/cartesian/axes"),h=e("../constants/alignment"),d=e("../plots/cartesian/constraints"),m=d.enforce,g=d.clean,y=e("../plots/cartesian/autorange").doAutoRange;function v(e,t,r){for(var n=0;n<r.length;n++){var a=r[n][0],i=r[n][1];if(!(a[0]>=e[1]||a[1]<=e[0])&&i[0]<t[1]&&i[1]>t[0])return!0}return!1}function b(e){var t,a,s,u,d,m,g=e._fullLayout,y=g._size,b=y.p,_=p.list(e,"",!0);if(g._paperdiv.style({width:e._context.responsive&&g.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":g.width+"px",height:e._context.responsive&&g.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),e._context.setBackground(e,g.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!g._has("cartesian"))return i.previousPromises(e);function k(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-b-n:t._offset+t._length+b+n:y.t+y.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+b+n:t._offset-b-n:y.l+y.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var D=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=k(u,D,u.side),u._mainMirrorPosition=u.mirror&&D?k(u,D,h.OPPOSITE_SIDE[u.side]):null}var T=[],A=[],S=[],M=1===l.opacity(g.paper_bgcolor)&&1===l.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(a in g._plots)if((s=g._plots[a]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var E=s.xaxis.domain,C=s.yaxis.domain,N=s.plotgroup;if(v(E,C,S)){var O=N.node(),I=s.bg=o.ensureSingle(N,"rect","bg");O.insertBefore(I.node(),O.childNodes[0]),A.push(a)}else N.select("rect.bg").remove(),S.push([E,C]),M||(T.push(a),A.push(a))}var P,R,L,F,B,z,j,U,$,V,q,W,H,G=g._bgLayer.selectAll(".bg").data(T);for(G.enter().append("rect").classed("bg",!0),G.exit().remove(),G.each((function(e){g._plots[e].bg=n.select(this)})),t=0;t<A.length;t++)s=g._plots[A[t]],d=s.xaxis,m=s.yaxis,s.bg&&void 0!==d._offset&&void 0!==m._offset&&s.bg.call(c.setRect,d._offset-b,m._offset-b,d._length+2*b,m._length+2*b).call(l.fill,g.plot_bgcolor).style("stroke-width",0);if(!g._hasOnlyLargeSploms)for(a in g._plots){s=g._plots[a],d=s.xaxis,m=s.yaxis;var X,Y,Z=s.clipId="clip"+g._uid+a+"plot",K=o.ensureSingleById(g._clips,"clipPath",Z,(function(e){e.classed("plotclip",!0).append("rect")}));s.clipRect=K.select("rect").attr({width:d._length,height:m._length}),c.setTranslate(s.plot,d._offset,m._offset),s._hasClipOnAxisFalse?(X=null,Y=Z):(X=Z,Y=null),c.setClipUrl(s.plot,X,e),s.layerClipId=Y}function J(e){return"M"+P+","+e+"H"+R}function Q(e){return"M"+d._offset+","+e+"h"+d._length}function ee(e){return"M"+e+","+U+"V"+j}function te(e){return"M"+e+","+m._offset+"v"+m._length}function re(e,t,r){if(!e.showline||a!==e._mainSubplot)return"";if(!e._anchorAxis)return r(e._mainLinePosition);var n=t(e._mainLinePosition);return e.mirror&&(n+=t(e._mainMirrorPosition)),n}for(a in g._plots){s=g._plots[a],d=s.xaxis,m=s.yaxis;var ne="M0,0";x(d,a)&&(B=w(d,"left",m,_),P=d._offset-(B?b+B:0),z=w(d,"right",m,_),R=d._offset+d._length+(z?b+z:0),L=k(d,m,"bottom"),F=k(d,m,"top"),!(H=!d._anchorAxis||a!==d._mainSubplot)||"allticks"!==d.mirror&&"all"!==d.mirror||(d._linepositions[a]=[L,F]),ne=re(d,J,Q),H&&d.showline&&("all"===d.mirror||"allticks"===d.mirror)&&(ne+=J(L)+J(F)),s.xlines.style("stroke-width",d._lw+"px").call(l.stroke,d.showline?d.linecolor:"rgba(0,0,0,0)")),s.xlines.attr("d",ne);var ae="M0,0";x(m,a)&&(q=w(m,"bottom",d,_),j=m._offset+m._length+(q?b:0),W=w(m,"top",d,_),U=m._offset-(W?b:0),$=k(m,d,"left"),V=k(m,d,"right"),!(H=!m._anchorAxis||a!==m._mainSubplot)||"allticks"!==m.mirror&&"all"!==m.mirror||(m._linepositions[a]=[$,V]),ae=re(m,ee,te),H&&m.showline&&("all"===m.mirror||"allticks"===m.mirror)&&(ae+=ee($)+ee(V)),s.ylines.style("stroke-width",m._lw+"px").call(l.stroke,m.showline?m.linecolor:"rgba(0,0,0,0)")),s.ylines.attr("d",ae)}return p.makeClipPaths(e),i.previousPromises(e)}function x(e,t){return(e.ticks||e.showline)&&(t===e._mainSubplot||"all"===e.mirror||"allticks"===e.mirror)}function _(e,t,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var a=h.FROM_BL[t];return r.side===t?n.domain[a]===e.domain[a]:r.mirror&&n.domain[1-a]===e.domain[1-a]}function w(e,t,r,n){if(_(e,t,r))return r._lw;for(var a=0;a<n.length;a++){var i=n[a];if(i._mainAxis===r._mainAxis&&_(e,t,i))return i._lw}return 0}function k(e,t){var r=e.title,n=e._size,a=0;return"paper"===("start"===t?a=r.pad.l:"end"===t&&(a=-r.pad.r),r.xref)?n.l+n.w*r.x+a:e.width*r.x+a}function D(e,t){var r=e.title,n=e._size,a=0;return"0em"!==t&&t?t===h.CAP_SHIFT+"em"&&(a=r.pad.t):a=-r.pad.b,"auto"===r.y?n.t/2:"paper"===r.yref?n.t+n.h-n.h*r.y+a:e.height-e.height*r.y+a}r.layoutStyles=function(e){return o.syncOrAsync([i.doAutoMargin,b],e)},r.drawMainTitle=function(e){var t=e._fullLayout,r=function(e){var t=e.title,r="middle";return o.isRightAnchor(t)?r="end":o.isLeftAnchor(t)&&(r="start"),r}(t),n=function(e){var t=e.title,r="0em";return o.isTopAnchor(t)?r=h.CAP_SHIFT+"em":o.isMiddleAnchor(t)&&(r=h.MID_SHIFT+"em"),r}(t);u.draw(e,"gtitle",{propContainer:t,propName:"title.text",placeholder:t._dfltTitle.plot,attributes:{x:k(t,r),y:D(t,n),"text-anchor":r,dy:n}})},r.doTraceStyle=function(e){var t,n=e.calcdata,o=[];for(t=0;t<n.length;t++){var l=n[t],c=l[0]||{},u=c.trace||{},f=u._module||{},p=f.arraysToCalcdata;p&&p(l,u);var h=f.editStyle;h&&o.push({fn:h,cd0:c})}if(o.length){for(t=0;t<o.length;t++){var d=o[t];d.fn(e,d.cd0)}s(e),r.redrawReglTraces(e)}return i.style(e),a.getComponentMethod("legend","draw")(e),i.previousPromises(e)},r.doColorBars=function(e){return a.getComponentMethod("colorbar","draw")(e),i.previousPromises(e)},r.layoutReplot=function(e){var t=e.layout;return e.layout=void 0,a.call("_doPlot",e,"",t)},r.doLegend=function(e){return a.getComponentMethod("legend","draw")(e),i.previousPromises(e)},r.doTicksRelayout=function(e){return p.draw(e,"redraw"),e._fullLayout._hasOnlyLargeSploms&&(a.subplotsRegistry.splom.updateGrid(e),s(e),r.redrawReglTraces(e)),r.drawMainTitle(e),i.previousPromises(e)},r.doModeBar=function(e){var t=e._fullLayout;f.manage(e);for(var r=0;r<t._basePlotModules.length;r++){var n=t._basePlotModules[r].updateFx;n&&n(e)}return i.previousPromises(e)},r.doCamera=function(e){for(var t=e._fullLayout,r=t._subplots.gl3d,n=0;n<r.length;n++){var a=t[r[n]];a._scene.setViewport(a)}},r.drawData=function(e){var t=e._fullLayout;s(e);for(var n=t._basePlotModules,o=0;o<n.length;o++)n[o].plot(e);return r.redrawReglTraces(e),i.style(e),a.getComponentMethod("shapes","draw")(e),a.getComponentMethod("annotations","draw")(e),a.getComponentMethod("images","draw")(e),t._replotting=!1,i.previousPromises(e)},r.redrawReglTraces=function(e){var t=e._fullLayout;if(t._has("regl")){var r,n,a=e._fullData,i=[],s=[];for(t._hasOnlyLargeSploms&&t._splomGrid.draw(),r=0;r<a.length;r++){var l=a[r];!0===l.visible&&0!==l._length&&("splom"===l.type?t._splomScenes[l.uid].draw():"scattergl"===l.type?o.pushUnique(i,l.xaxis+l.yaxis):"scatterpolargl"===l.type&&o.pushUnique(s,l.subplot))}for(r=0;r<i.length;r++)(n=t._plots[i[r]])._scene&&n._scene.draw();for(r=0;r<s.length;r++)(n=t[s[r]]._subplot)._scene&&n._scene.draw()}},r.doAutoRangeAndConstraints=function(e){for(var t,r=p.list(e,"",!0),n={},a=0;a<r.length;a++)if(!n[(t=r[a])._id]){n[t._id]=1,g(e,t),y(e,t);var i=t._matchGroup;if(i)for(var o in i){var s=p.getFromId(e,o);y(e,s,t.range),n[o]=1}}m(e)},r.finalDraw=function(e){a.getComponentMethod("rangeslider","draw")(e),a.getComponentMethod("rangeselector","draw")(e)},r.drawMarginPushers=function(e){a.getComponentMethod("legend","draw")(e),a.getComponentMethod("rangeselector","draw")(e),a.getComponentMethod("sliders","draw")(e),a.getComponentMethod("updatemenus","draw")(e),a.getComponentMethod("colorbar","draw")(e)}},{"../components/color":366,"../components/drawing":388,"../components/modebar":429,"../components/titles":464,"../constants/alignment":471,"../lib":503,"../lib/clear_gl_canvases":487,"../plots/cartesian/autorange":553,"../plots/cartesian/axes":554,"../plots/cartesian/constraints":562,"../plots/plots":619,"../registry":638,"@plotly/d3":58}],545:[function(e,t,r){"use strict";var n=e("../lib"),a=n.isPlainObject,i=e("./plot_schema"),o=e("../plots/plots"),s=e("../plots/attributes"),l=e("./plot_template"),c=e("./plot_config").dfltConfig;function u(e,t){e=n.extendDeep({},e);var r,i,o=Object.keys(e).sort();function s(t,r,n){if(a(r)&&a(t))u(t,r);else if(Array.isArray(r)&&Array.isArray(t)){var o=l.arrayTemplater({_template:e},n);for(i=0;i<r.length;i++){var s=r[i],c=o.newItem(s)._template;c&&u(c,s)}var f=o.defaultItems();for(i=0;i<f.length;i++)r.push(f[i]._template);for(i=0;i<r.length;i++)delete r[i].templateitemname}}for(r=0;r<o.length;r++){var c=o[r],p=e[c];if(c in t?s(p,t[c],c):t[c]=p,f(c)===c)for(var h in t){var d=f(h);h===d||d!==c||h in e||s(p,t[h],c)}}}function f(e){return e.replace(/[0-9]+$/,"")}function p(e,t,r,i,o){var s=o&&r(o);for(var c in e){var u=e[c],h=m(e,c,i),d=m(e,c,o),g=r(d);if(!g){var y=f(c);y!==c&&(g=r(d=m(e,y,o)))}if(!(s&&s===g||!g||g._noTemplating||"data_array"===g.valType||g.arrayOk&&Array.isArray(u)))if(!g.valType&&a(u))p(u,t,r,h,d);else if(g._isLinkedToArray&&Array.isArray(u))for(var v=!1,b=0,x={},_=0;_<u.length;_++){var w=u[_];if(a(w)){var k=w.name;if(k)x[k]||(p(w,t,r,m(u,b,h),m(u,b,d)),b++,x[k]=1);else if(!v){var D=m(e,l.arrayDefaultKey(c),i),T=m(u,b,h);p(w,t,r,T,m(u,b,d));var A=n.nestedProperty(t,T);n.nestedProperty(t,D).set(A.get()),A.set(null),v=!0}}}else n.nestedProperty(t,h).set(u)}}function h(e,t){return i.getLayoutValObject(e,n.nestedProperty({},t).parts)}function d(e,t){return i.getTraceValObject(e,n.nestedProperty({},t).parts)}function m(e,t,r){return r?Array.isArray(e)?r+"["+t+"]":r+"."+t:t}function g(e){for(var t=0;t<e.length;t++)if(a(e[t]))return!0}function y(e){var t;switch(e.code){case"data":t="The template has no key data.";break;case"layout":t="The template has no key layout.";break;case"missing":t=e.path?"There are no templates for item "+e.path+" with name "+e.templateitemname:"There are no templates for trace "+e.index+", of type "+e.traceType+".";break;case"unused":t=e.path?"The template item at "+e.path+" was not used in constructing the plot.":e.dataCount?"Some of the templates of type "+e.traceType+" were not used. The template has "+e.templateCount+" traces, the data only has "+e.dataCount+" of this type.":"The template has "+e.templateCount+" traces of type "+e.traceType+" but there are none in the data.";break;case"reused":t="Some of the templates of type "+e.traceType+" were used more than once. The template has "+e.templateCount+" traces, the data has "+e.dataCount+" of this type."}return e.msg=t,e}r.makeTemplate=function(e){e=n.isPlainObject(e)?e:n.getGraphDiv(e),e=n.extendDeep({_context:c},{data:e.data,layout:e.layout}),o.supplyDefaults(e);var t=e.data||[],r=e.layout||{};r._basePlotModules=e._fullLayout._basePlotModules,r._modules=e._fullLayout._modules;var i={data:{},layout:{}};t.forEach((function(e){var t={};p(e,t,d.bind(null,e));var r=n.coerce(e,{},s,"type"),a=i.data[r];a||(a=i.data[r]=[]),a.push(t)})),p(r,i.layout,h.bind(null,r)),delete i.layout.template;var l=r.template;if(a(l)){var f,m,g,y,v,b,x=l.layout;a(x)&&u(x,i.layout);var _=l.data;if(a(_)){for(m in i.data)if(g=_[m],Array.isArray(g)){for(b=(v=i.data[m]).length,y=g.length,f=0;f<b;f++)u(g[f%y],v[f]);for(f=b;f<y;f++)v.push(n.extendDeep({},g[f]))}for(m in _)m in i.data||(i.data[m]=n.extendDeep([],_[m]))}}return i},r.validateTemplate=function(e,t){var r=n.extendDeep({},{_context:c,data:e.data,layout:e.layout}),i=r.layout||{};a(t)||(t=i.template||{});var s=t.layout,l=t.data,u=[];r.layout=i,r.layout.template=t,o.supplyDefaults(r);var p=r._fullLayout,h=r._fullData,d={};if(a(s)?(function e(t,r){for(var n in t)if("_"!==n.charAt(0)&&a(t[n])){var i,o=f(n),s=[];for(i=0;i<r.length;i++)s.push(m(t,n,r[i])),o!==n&&s.push(m(t,o,r[i]));for(i=0;i<s.length;i++)d[s[i]]=1;e(t[n],s)}}(p,["layout"]),function e(t,r){for(var n in t)if(-1===n.indexOf("defaults")&&a(t[n])){var i=m(t,n,r);d[i]?e(t[n],i):u.push({code:"unused",path:i})}}(s,"layout")):u.push({code:"layout"}),a(l)){for(var v,b={},x=0;x<h.length;x++){var _=h[x];b[v=_.type]=(b[v]||0)+1,_._fullInput._template||u.push({code:"missing",index:_._fullInput.index,traceType:v})}for(v in l){var w=l[v].length,k=b[v]||0;w>k?u.push({code:"unused",traceType:v,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:v,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=m(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&g(i)&&e(i,o)}}({data:h,layout:p},""),u.length)return u.map(y)}},{"../lib":503,"../plots/attributes":550,"../plots/plots":619,"./plot_config":541,"./plot_schema":542,"./plot_template":543}],546:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),s=e("../snapshot/helpers"),l=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,p,h,d;function m(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],p=e.layout||{},h=e.config||{},d={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),p=o.extendDeep({},e.layout),h=e._context,d=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var g={};function y(e,r){return o.coerce(t,g,f,e,r)}var v=y("format"),b=y("width"),x=y("height"),_=y("scale"),w=y("setBackground"),k=y("imageDataOnly"),D=document.createElement("div");D.style.position="absolute",D.style.left="-5000px",document.body.appendChild(D);var T=o.extendFlat({},p);b?T.width=b:null===t.width&&n(d.width)&&(T.width=d.width),x?T.height=x:null===t.height&&n(d.height)&&(T.height=d.height);var A=o.extendFlat({},h,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(D);function M(){return new Promise((function(e){setTimeout(e,s.getDelay(D._fullLayout))}))}function E(){return new Promise((function(e,t){var r=l(D,v,_),n=D._fullLayout.width,f=D._fullLayout.height;function p(){a.purge(D),document.body.removeChild(D)}if("full-json"===v){var h=i.graphJson(D,!1,"keepdata","object",!0,!0);return h.version=u,h=JSON.stringify(h),p(),e(k?h:s.encodeJSON(h))}if(p(),"svg"===v)return e(k?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),c({format:v,width:n,height:f,scale:_,canvas:d,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(D,r,T,A).then(S).then(M).then(E).then((function(t){e(function(e){return k?e.replace(s.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":503,"../plots/plots":619,"../snapshot/helpers":642,"../snapshot/svgtoimg":644,"../snapshot/tosvg":646,"../version":1119,"./plot_api":540,"fast-isnumeric":190}],547:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),p=0;p<f.length;p++){var h=f[p];if("transforms"!==h){var y=o.slice();y.push(h);var v=e[h],b=t[h],x=g(r,h),_=(x||{}).valType,w="info_array"===_,k="colorscale"===_,D=(x||{}).items;if(m(r,h))if(s(v)&&s(b)&&"any"!==_)u(v,b,x,a,i,y);else if(w&&l(v)){v.length>b.length&&a.push(d("unused",i,y.concat(b.length)));var T,A,S,M,E,C=b.length,N=Array.isArray(D);if(N&&(C=Math.min(C,D.length)),2===x.dimensions)for(A=0;A<C;A++)if(l(v[A])){v[A].length>b[A].length&&a.push(d("unused",i,y.concat(A,b[A].length)));var O=b[A].length;for(T=0;T<(N?Math.min(O,D[A].length):O);T++)S=N?D[A][T]:D,M=v[A][T],E=b[A][T],n.validate(M,S)?E!==M&&E!==+M&&a.push(d("dynamic",i,y.concat(A,T),M,E)):a.push(d("value",i,y.concat(A,T),M))}else a.push(d("array",i,y.concat(A),v[A]));else for(A=0;A<C;A++)S=N?D[A]:D,M=v[A],E=b[A],n.validate(M,S)?E!==M&&E!==+M&&a.push(d("dynamic",i,y.concat(A),M,E)):a.push(d("value",i,y.concat(A),M))}else if(x.items&&!w&&l(v)){var I,P,R=D[Object.keys(D)[0]],L=[];for(I=0;I<b.length;I++){var F=b[I]._index||I;if((P=y.slice()).push(F),s(v[F])&&s(b[I])){L.push(F);var B=v[F],z=b[I];s(B)&&!1!==B.visible&&!1===z.visible?a.push(d("invisible",i,P)):u(B,z,R,a,i,P)}}for(I=0;I<v.length;I++)(P=y.slice()).push(I),s(v[I])?-1===L.indexOf(I)&&a.push(d("unused",i,P)):a.push(d("object",i,P,v[I]))}else!s(v)&&s(b)?a.push(d("object",i,y,v)):c(v)||!c(b)||w||k?h in t?n.validate(v,x)?"enumerated"===x.valType&&(x.coerceNumber&&v!==+b||v!==b)&&a.push(d("dynamic",i,y,v,b)):a.push(d("value",i,y,v)):a.push(d("unused",i,y,v)):a.push(d("array",i,y,v));else a.push(d("schema",i,y))}}return a}function f(e,t){for(var r=e.layout.layoutAttributes,a=0;a<t.length;a++){var i=t[a],o=e.traces[i.type],s=o.layoutAttributes;s&&(i.subplot?n.extendFlat(r[o.attributes.subplot.dflt],s):n.extendFlat(r,s))}return r}t.exports=function(e,t){void 0===e&&(e=[]),void 0===t&&(t={});var r,c,p=i.get(),h=[],m={_context:n.extendFlat({},o)};l(e)?(m.data=n.extendDeep([],e),r=e):(m.data=[],r=[],h.push(d("array","data"))),s(t)?(m.layout=n.extendDeep({},t),c=t):(m.layout={},c={},arguments.length>1&&h.push(d("object","layout"))),a.supplyDefaults(m);for(var g=m._fullData,y=r.length,v=0;v<y;v++){var b=r[v],x=["data",v];if(s(b)){var _=g[v],w=_.type,k=p.traces[w].attributes;k.type={valType:"enumerated",values:[w]},!1===_.visible&&!1!==b.visible&&h.push(d("invisible",x)),u(b,_,k,h,x);var D=b.transforms,T=_.transforms;if(D){l(D)||h.push(d("array",x,["transforms"])),x.push("transforms");for(var A=0;A<D.length;A++){var S=["transforms",A],M=D[A].type;if(s(D[A])){var E=p.transforms[M]?p.transforms[M].attributes:{};E.type={valType:"enumerated",values:Object.keys(p.transforms)},u(D[A],T[A],E,h,x,S)}else h.push(d("object",x,S))}}}else h.push(d("object",x))}return u(c,m._fullLayout,f(p,g),h,"layout"),0===h.length?void 0:h};var p={object:function(e,t){return("layout"===e&&""===t?"The layout argument":"data"===e[0]&&""===t?"Trace "+e[1]+" in the data argument":h(e)+"key "+t)+" must be linked to an object container"},array:function(e,t){return("data"===e?"The data argument":h(e)+"key "+t)+" must be linked to an array container"},schema:function(e,t){return h(e)+"key "+t+" is not part of the schema"},unused:function(e,t,r){var n=s(r)?"container":"key";return h(e)+n+" "+t+" did not get coerced"},dynamic:function(e,t,r,n){return[h(e)+"key",t,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(e,t){return(t?h(e)+"item "+t:"Trace "+e[1])+" got defaulted to be not visible"},value:function(e,t,r){return[h(e)+"key "+t,"is set to an invalid value ("+r+")"].join(" ")}};function h(e){return l(e)?"In data trace "+e[1]+", ":"In "+e+", "}function d(e,t,r,a,i){var o,s;r=r||"",l(t)?(o=t[0],s=t[1]):(o=t,s=null);var c=function(e){if(!l(e))return String(e);for(var t="",r=0;r<e.length;r++){var n=e[r];"number"==typeof n?t=t.substr(0,t.length-1)+"["+n+"]":t+=n,r<e.length-1&&(t+=".")}return t}(r),u=p[e](t,c,a,i);return n.log(u),{code:e,container:o,trace:s,path:r,astr:c,msg:u}}function m(e,t){var r=v(t),n=r.keyMinusId,a=r.id;return!!(n in e&&e[n]._isSubplotObj&&a)||t in e}function g(e,t){return t in e?e[t]:e[v(t).keyMinusId]}var y=n.counterRegex("([a-z]+)");function v(e){var t=e.match(y);return{keyMinusId:t&&t[1],id:t&&t[2]}}},{"../lib":503,"../plots/plots":619,"./plot_config":541,"./plot_schema":542}],548:[function(e,t,r){"use strict";t.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}},{}],549:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plot_api/plot_template");t.exports=function(e,t,r){var i,o,s=r.name,l=r.inclusionAttr||"visible",c=t[s],u=n.isArrayOrTypedArray(e[s])?e[s]:[],f=t[s]=[],p=a.arrayTemplater(t,s,l);for(i=0;i<u.length;i++){var h=u[i];n.isPlainObject(h)?o=p.newItem(h):(o=p.newItem({}))[l]=!1,o._index=i,!1!==o[l]&&r.handleItemDefaults(h,o,t,r),f.push(o)}var d=p.defaultItems();for(i=0;i<d.length;i++)(o=d[i])._index=f.length,r.handleItemDefaults({},o,t,r,{}),f.push(o);if(n.isArrayOrTypedArray(c)){var m=Math.min(c.length,f.length);for(i=0;i<m;i++)n.relinkPrivateKeys(f[i],c[i])}return f}},{"../lib":503,"../plot_api/plot_template":543}],550:[function(e,t,r){"use strict";var n=e("./font_attributes"),a=e("../components/fx/attributes");t.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:n({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:a.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc"},uirevision:{valType:"any",editType:"none"}}},{"../components/fx/attributes":397,"./font_attributes":585}],551:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=a.dateTime2ms,o=a.incrementMonth,s=e("../../constants/numerical").ONEAVGMONTH;t.exports=function(e,t,r,a){if("date"!==t.type)return{vals:a};var l=e[r+"periodalignment"];if(!l)return{vals:a};var c,u=e[r+"period"];if(n(u)){if((u=+u)<=0)return{vals:a}}else if("string"==typeof u&&"M"===u.charAt(0)){var f=+u.substring(1);if(!(f>0&&Math.round(f)===f))return{vals:a};c=f}for(var p=t.calendar,h="start"===l,d="end"===l,m=e[r+"period0"],g=i(m,p)||0,y=[],v=[],b=[],x=a.length,_=0;_<x;_++){var w,k,D,T=a[_];if(c){for(w=Math.round((T-g)/(c*s)),D=o(g,c*w,p);D>T;)D=o(D,-c,p);for(;D<=T;)D=o(D,c,p);k=o(D,-c,p)}else{for(D=g+(w=Math.round((T-g)/u))*u;D>T;)D-=u;for(;D<=T;)D+=u;k=D-u}y[_]=h?k:d?D:(k+D)/2,v[_]=k,b[_]=D}return{vals:y,starts:v,ends:b}}},{"../../constants/numerical":479,"../../lib":503,"fast-isnumeric":190}],552:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],553:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,s=e("../../registry"),l=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,f=c.isLinked;function p(e,t){var r,n,a=[],o=e._fullLayout,s=d(o,t,0),l=d(o,t,1),c=m(e,t),u=c.min,f=c.max;if(0===u.length||0===f.length)return i.simpleMap(t.range,t.r2l);var p=u[0].val,g=f[0].val;for(r=1;r<u.length&&p===g;r++)p=Math.min(p,u[r].val);for(r=1;r<f.length&&p===g;r++)g=Math.max(g,f[r].val);var y=!1;if(t.range){var v=i.simpleMap(t.range,t.r2l);y=v[1]<v[0]}"reversed"===t.autorange&&(y=!0,t.autorange=!0);var b,x,_,w,k,D,T=t.rangemode,A="tozero"===T,S="nonnegative"===T,M=t._length,E=M/10,C=0;for(r=0;r<u.length;r++)for(b=u[r],n=0;n<f.length;n++)(D=(x=f[n]).val-b.val-h(t,b.val,x.val))>0&&((k=M-s(b)-l(x))>E?D/k>C&&(_=b,w=x,C=D/k):D/M>C&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},C=D/M));if(p===g){var N=p-1,O=p+1;if(A)if(0===p)a=[0,1];else{var I=(p>0?f:u).reduce((function(e,t){return Math.max(e,l(t))}),0),P=p/(1-Math.min(.5,I/M));a=p>0?[0,P]:[P,0]}else a=S?[Math.max(0,N),Math.max(1,O)]:[N,O]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-C*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-h(t,b.val,x.val))/(M-s(_)-l(w)),a=[_.val-C*s(_),w.val+C*l(w)];return y&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function h(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i<a.length;i++){var o=a[i];n+=o.max-o.min}return n}function d(e,t,r){var a=.05*t._length,o=t._anchorAxis||{};if(-1!==(t.ticklabelposition||"").indexOf("inside")||-1!==(o.ticklabelposition||"").indexOf("inside")){var s="reversed"===t.autorange;if(!s){var c=i.simpleMap(t.range,t.r2l);s=c[1]<c[0]}s&&(r=!r)}var u=0;return f(e,t._id)||(u=function(e,t,r){var a=0,o="x"===t._id.charAt(0);for(var s in e._plots){var c=e._plots[s];if(t._id===c.xaxis._id||t._id===c.yaxis._id){var u=(o?c.yaxis:c.xaxis)||{};if(-1!==(u.ticklabelposition||"").indexOf("inside")&&(!r&&("left"===u.side||"bottom"===u.side)||r&&("top"===u.side||"right"===u.side))){if(u._vals){var f=i.deg2rad(u._tickAngles[u._id+"tick"]||0),p=Math.abs(Math.cos(f)),h=Math.abs(Math.sin(f));if(!u._vals[0].bb){var d=u._id+"tick";u._selections[d].each((function(e){var t=n.select(this);t.select(".text-math-group").empty()&&(e.bb=l.bBox(t.node()))}))}for(var m=0;m<u._vals.length;m++){var g=u._vals[m].bb;if(g){var y=6+g.width,v=6+g.height;a=Math.max(a,o?Math.max(y*p,v*h):Math.max(v*p,y*h))}}}"inside"===u.ticks&&"inside"===u.ticklabelposition&&(a+=u.ticklen||0)}}}return a}(e,t,r)),a=Math.max(u,a),"domain"===t.constrain&&t._inputDomain&&(a*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(e){return e.nopad?0:e.pad+(e.extrapad?a:u)}}function m(e,t,r){var n,a,i,o=t._id,s=e._fullData,l=e._fullLayout,c=[],f=[];function p(e,t){for(n=0;n<t.length;n++){var r=e[t[n]],s=(r._extremes||{})[o];if(!0===r.visible&&s){for(a=0;a<s.min.length;a++)i=s.min[a],g(c,i.val,i.pad,{extrapad:i.extrapad});for(a=0;a<s.max.length;a++)i=s.max[a],y(f,i.val,i.pad,{extrapad:i.extrapad})}}}if(p(s,t._traceIndices),p(l.annotations||[],t._annIndices||[]),p(l.shapes||[],t._shapeIndices||[]),t._matchGroup&&!r)for(var h in t._matchGroup)if(h!==t._id){var d=u(e,h),v=m(e,d,!0),b=t._length/d._length;for(a=0;a<v.min.length;a++)i=v.min[a],g(c,i.val,i.pad*b,{extrapad:i.extrapad});for(a=0;a<v.max.length;a++)i=v.max[a],y(f,i.val,i.pad*b,{extrapad:i.extrapad})}return{min:c,max:f}}function g(e,t,r,n){v(e,t,r,n,x)}function y(e,t,r,n){v(e,t,r,n,_)}function v(e,t,r,n,a){for(var i=n.tozero,o=n.extrapad,s=!0,l=0;l<e.length&&s;l++){var c=e[l];if(a(c.val,t)&&c.pad>=r&&(c.extrapad||!o)){s=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(l,1),l--)}if(s){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function b(e){return a(e)&&Math.abs(e)<o}function x(e,t){return e<=t}function _(e,t){return e>=t}t.exports={getAutoRange:p,makePadFn:d,doAutoRange:function(e,t,r){if(t.setScale(),t.autorange){t.range=r?r.slice():p(e,t),t._r=t.range.slice(),t._rl=i.simpleMap(t._r,t.r2l);var n=t._input,a={};a[t._attr+".range"]=t.range,a[t._attr+".autorange"]=t.autorange,s.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,a),n.range=t.range.slice(),n.autorange=t.autorange}var o=t._anchorAxis;if(o&&o.rangeslider){var l=o.rangeslider[t._name];l&&"auto"===l.rangemode&&(l.range=p(e,t)),o._input.rangeslider[t._name]=i.extendFlat({},l)}},findExtremes:function(e,t,r){r||(r={}),e._m||e.setScale();var n,i,s,l,c,u,f,p,h,d=[],m=[],v=t.length,x=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,k=!1,D=r.vpadLinearized||!1;function T(e){if(Array.isArray(e))return k=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=T((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=T((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),M=T(r.vpadplus||r.vpad),E=T(r.vpadminus||r.vpad);if(!k){if(p=1/0,h=-1/0,w)for(n=0;n<v;n++)(i=t[n])<p&&i>0&&(p=i),i>h&&i<o&&(h=i);else for(n=0;n<v;n++)(i=t[n])<p&&i>-o&&(p=i),i>h&&i<o&&(h=i);t=[p,h],v=2}var C={tozero:_,extrapad:x};function N(r){s=t[r],a(s)&&(u=A(r),f=S(r),D?(l=e.c2l(s)-E(r),c=e.c2l(s)+M(r)):(p=s-E(r),h=s+M(r),w&&p<h/10&&(p=h/10),l=e.c2l(p),c=e.c2l(h)),_&&(l=Math.min(0,l),c=Math.max(0,c)),b(l)&&g(d,l,f,C),b(c)&&y(m,c,u,C))}var O=Math.min(6,v);for(n=0;n<O;n++)N(n);for(n=v-1;n>=O;n--)N(n);return{min:d,max:m,opts:r}},concatExtremes:m}},{"../../components/drawing":388,"../../constants/numerical":479,"../../lib":503,"../../registry":638,"./axis_ids":558,"@plotly/d3":58,"fast-isnumeric":190}],554:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),s=e("../../lib"),l=s.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),p=e("../../components/drawing"),h=e("./layout_attributes"),d=e("./clean_ticks"),m=e("../../constants/numerical"),g=m.ONEMAXYEAR,y=m.ONEAVGYEAR,v=m.ONEMINYEAR,b=m.ONEMAXQUARTER,x=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,k=m.ONEAVGMONTH,D=m.ONEMINMONTH,T=m.ONEWEEK,A=m.ONEDAY,S=A/2,M=m.ONEHOUR,E=m.ONEMIN,C=m.ONESEC,N=m.MINUS_SIGN,O=m.BADNUM,I={K:"zeroline"},P={K:"gridline",L:"path"},R={K:"tick",L:"path"},L={K:"tick",L:"text"},F=e("../../constants/alignment"),B=F.MID_SHIFT,z=F.CAP_SHIFT,j=F.LINE_SPACING,U=F.OPPOSITE_SIDE,$=t.exports={};$.setConvert=e("./set_convert");var V=e("./axis_autotype"),q=e("./axis_ids"),W=q.idSort,H=q.isLinked;$.id2name=q.id2name,$.name2id=q.name2id,$.cleanId=q.cleanId,$.list=q.list,$.listIds=q.listIds,$.getFromId=q.getFromId,$.getFromTrace=q.getFromTrace;var G=e("./autorange");function X(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}$.getAutoRange=G.getAutoRange,$.findExtremes=G.findExtremes,$.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=l[0]||("string"==typeof i?i:i[0])),i||(i=a),l=l.concat(l.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:l.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},s.coerce(e,t,u,c)},$.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},$.coercePosition=function(e,t,r,n,a,i){var o,l;if("range"!==$.getRefType(n))o=s.ensureNumber,l=r(a,i);else{var c=$.getFromId(t,n);l=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(l)},$.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?s.ensureNumber:$.getFromId(t,r).cleanPos)(e)},$.redrawComponents=function(e,t){t=t||$.listIds(e);var r=e._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),c={},u=0;u<t.length;u++)for(var f=r[$.id2name(t[u])][i],p=0;p<f.length;p++){var h=f[p];if(!c[h]&&(l(e,h),c[h]=1,s))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0)};var Y=$.getDataConversions=function(e,t,r,n){var a,i="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(i)){if(a={type:V(n,void 0,{autotypenumbers:e._fullLayout.autotypenumbers}),_categories:[]},$.setConvert(a),"category"===a.type)for(var o=0;o<n.length;o++)a.d2c(n[o])}else a=$.getFromTrace(e,t,i);return a?{d2c:a.d2c,c2d:a.c2d}:"ids"===i?{d2c:K,c2d:K}:{d2c:Z,c2d:Z}};function Z(e){return+e}function K(e){return String(e)}function J(e){return+e.substring(1)}$.getDataToCoordFunc=function(e,t,r,n){return Y(e,t,r,n).d2c},$.counterLetter=function(e){var t=e.charAt(0);return"x"===t?"y":"y"===t?"x":void 0},$.minDtick=function(e,t,r,n){-1===["log","category","multicategory"].indexOf(e.type)&&n?void 0===e._minDtick?(e._minDtick=t,e._forceTick0=r):e._minDtick&&((e._minDtick/t+1e-6)%1<2e-6&&((r-e._forceTick0)/t%1+1.000001)%1<2e-6?(e._minDtick=t,e._forceTick0=r):((t/e._minDtick+1e-6)%1>2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},$.saveRangeInitial=function(e,t){for(var r=$.list(e,"",!0),n=!1,a=0;a<r.length;a++){var i=r[a],o=void 0===i._rangeInitial,s=o||!(i.range[0]===i._rangeInitial[0]&&i.range[1]===i._rangeInitial[1]);(o&&!1===i.autorange||t&&s)&&(i._rangeInitial=i.range.slice(),n=!0)}return n},$.saveShowSpikeInitial=function(e,t){for(var r=$.list(e,"",!0),n=!1,a="on",i=0;i<r.length;i++){var o=r[i],s=void 0===o._showSpikeInitial,l=s||!(o.showspikes===o._showspikes);(s||t&&l)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==a||o.showspikes||(a="off")}return e._fullLayout._cartesianSpikesEnabled=a,n},$.autoBin=function(e,t,r,n,i,o){var l,c=s.aggNums(Math.min,null,e),u=s.aggNums(Math.max,null,e);if("category"===t.type||"multicategory"===t.type)return{start:c-.5,end:u+.5,size:Math.max(1,Math.round(o)||1),_dataSpan:u-c};if(i||(i=t.calendar),l="log"===t.type?{type:"linear",range:[c,u]}:{type:t.type,range:s.simpleMap([c,u],t.c2r,0,i),calendar:i},$.setConvert(l),o=o&&d.dtick(o,l.type))l.dtick=o,l.tick0=d.tick0(void 0,l.type,i);else{var f;if(r)f=(u-c)/r;else{var p=s.distinctVals(e),h=Math.pow(10,Math.floor(Math.log(p.minDiff)/Math.LN10)),m=h*s.roundUp(p.minDiff/h,[.9,1.9,4.9,9.9],!0);f=Math.max(m,2*s.stdev(e)/Math.pow(e.length,n?.25:.4)),a(f)||(f=1)}$.autoTicks(l,f)}var g,y=l.dtick,v=$.tickIncrement($.tickFirst(l),y,"reverse",i);if("number"==typeof y)g=(v=function(e,t,r,n,i){var o=0,s=0,l=0,c=0;function u(t){return(1+100*(t-e)/r.dtick)%100<2}for(var f=0;f<t.length;f++)t[f]%1==0?l++:a(t[f])||c++,u(t[f])&&o++,u(t[f]+r.dtick/2)&&s++;var p=t.length-c;if(l===p&&"date"!==r.type)r.dtick<1?e=n-.5*r.dtick:(e-=.5)+r.dtick<n&&(e+=r.dtick);else if(s<.1*p&&(o>.3*p||u(n)||u(i))){var h=r.dtick/2;e+=e+h<n?h:-h}return e}(v,e,l,c,u))+(1+Math.floor((u-v)/y))*y;else for("M"===l.dtick.charAt(0)&&(v=function(e,t,r,n,a){var i=s.findExactDates(t,a);if(i.exactDays>.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=$.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=$.tickIncrement(e,"M1","reverse")+15.5*A:e-=S;var l=$.tickIncrement(e,r);if(l<=n)return l}return e}(v,e,y,c,i)),g=v;g<=u;)g=$.tickIncrement(g,y,!1,i);return{start:t.c2r(v,0,i),end:t.c2r(g,0,i),size:y,_dataSpan:u-c}},$.prepTicks=function(e,t){var r=s.simpleMap(e.range,e.r2l,void 0,void 0,t);if(e._dtickInit=e.dtick,e._tick0Init=e.tick0,"auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?s.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=s.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,$.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=$.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=M,o&&!n&&e.dtick<M&&(e.dtick=M)):/%p/.test(i)?(t=S,o&&!n&&e.dtick<S&&(e.dtick=S)):/%[Aadejuwx]/.test(i)?(t=A,o&&!n&&e.dtick<A&&(e.dtick=A)):/%[UVW]/.test(i)?(t=T,o&&!n&&e.dtick<T&&(e.dtick=T)):/%[Bbm]/.test(i)?(t=k,o&&(n?J(e.dtick)<1:e.dtick<D)&&(e.dtick="M1")):/%[q]/.test(i)?(t=x,o&&(n?J(e.dtick)<3:e.dtick<_)&&(e.dtick="M3")):/%[Yy]/.test(i)&&(t=y,o&&(n?J(e.dtick)<12:e.dtick<v)&&(e.dtick="M12")))}(n=r())&&e.tick0===e._dowTick0&&(e.tick0=e._rawTick0),e._definedDelta=t}(e),e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),se(e)},$.calcTicks=function(e,t){$.prepTicks(e,t);var r=s.simpleMap(e.range,e.r2l,void 0,void 0,t);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=X(s.simpleMap(e.range,e.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),l=0;Array.isArray(r)||(r=[]);var c="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var u=0;u<t.length;u++){var f=c(t[u]);f>i&&f<o&&(void 0===r[u]?n[l]=$.tickText(e,f):n[l]=le(e,f,String(r[u])),l++)}return l<t.length&&n.splice(l,t.length-l),e.rangebreaks&&(n=n.filter((function(t){return e.maskBreaks(t.x)!==O}))),n}(e);var n=X(r),i=n[0],o=n[1],l=r[1]<r[0],c=Math.min(r[0],r[1]),u=Math.max(r[0],r[1]),f="log"===e.type&&!(a(e.dtick)||"L"===e.dtick.charAt(0)),p="period"===e.ticklabelmode;if(e._tmin=$.tickFirst(e,t),e._tmin<i!==l)return[];"category"!==e.type&&"multicategory"!==e.type||(o=l?Math.max(-.5,o):Math.min(e._categories.length-.5,o));var h=e._tmin;e.rangebreaks&&e._tick0Init!==e.tick0&&(h=Ae(h,e),l||(h=$.tickIncrement(h,e.dtick,!l,e.calendar))),p&&(h=$.tickIncrement(h,e.dtick,!l,e.calendar));for(var d,m=Math.max(1e3,e._length||0),E=[],C=null;l?h>=o:h<=o;h=$.tickIncrement(h,e.dtick,l,e.calendar)){if(e.rangebreaks&&!l){if(h<i)continue;if(e.maskBreaks(h)===O&&Ae(h,e)>=u)break}if(E.length>m||h===C)break;C=h;var N=!1;f&&h!==(0|h)&&(N=!0),E.push({minor:N,value:h})}if(p&&function(e,t,r){for(var n=0;n<e.length;n++){var a=e[n].value,i=n,o=n+1;n<e.length-1?(i=n,o=n+1):n>0?(i=n-1,o=n):(i=n,o=n);var s,l=e[i].value,c=e[o].value,u=Math.abs(c-l),f=r||u,p=0;f>=v?p=u>=v&&u<=g?u:y:r===x&&f>=_?p=u>=_&&u<=b?u:x:f>=D?p=u>=D&&u<=w?u:k:r===T&&f>=T?p=T:f>=A?p=A:r===S&&f>=S?p=S:r===M&&f>=M&&(p=M),p>=u&&(p=u,s=!0);var h=a+p;if(t.rangebreaks&&p>0){for(var d=0,m=0;m<84;m++){var E=(m+.5)/84;t.maskBreaks(a*(1-E)+E*h)!==O&&d++}(p*=d/84)||(e[n].drop=!0),s&&u>T&&(p=u)}(p>0||0===n)&&(e[n].periodX=a+p/2)}}(E,e,e._definedDelta),e.rangebreaks){var I="y"===e._id.charAt(0),P=1;"auto"===e.tickmode&&(P=e.tickfont?e.tickfont.size:12);var R=NaN;for(d=E.length-1;d>-1;d--)if(E[d].drop)E.splice(d,1);else{E[d].value=Ae(E[d].value,e);var L=e.c2p(E[d].value);(I?R>L-P:R<L+P)?E.splice(l?d+1:d,1):R=L}}Te(e)&&360===Math.abs(r[1]-r[0])&&E.pop(),e._tmax=(E[E.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;var F,B,z=[];for(d=0;d<E.length;d++){var j=E[d].minor,U=E[d].value;F=$.tickText(e,U,!1,j),void 0!==(B=E[d].periodX)&&(F.periodX=B,(B>u||B<c)&&(B>u&&(F.periodX=u),B<c&&(F.periodX=c),F.text=" ",e._prevDateHead="")),z.push(F)}return e._inCalcTicks=!1,z};var Q=[2,5,10],ee=[1,2,3,6,12],te=[1,2,5,10,15,30],re=[1,2,3,7,14],ne=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],ae=[-.301,0,.301,.699,1],ie=[15,30,45,90,180];function oe(e,t,r){return t*s.roundUp(e/t,r)}function se(e){var t=e.dtick;if(e._tickexponent=0,a(t)||"string"==typeof t||(t=1),"category"!==e.type&&"multicategory"!==e.type||(e._tickround=null),"date"===e.type){var r=e.r2l(e.tick0),n=e.l2r(r).replace(/(^-|i)/g,""),i=n.length;if("M"===String(t).charAt(0))i>10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=E&&i<=16||t>=M)e._tickround="M";else if(t>=C&&i<=19||t>=E)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var s=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ue(e.exponentformat)&&!fe(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function le(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}$.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=s.dateTick0(e.calendar,0);var i=2*t;if(i>y)t/=y,r=n(10),e.dtick="M"+12*oe(t,r,Q);else if(i>k)t/=k,e.dtick="M"+oe(t,1,ee);else if(i>A){e.dtick=oe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:re);var o=$.getTickFormat(e),l="period"===e.ticklabelmode;l&&(e._rawTick0=e.tick0),/%[uVW]/.test(o)?e.tick0=s.dateTick0(e.calendar,2):e.tick0=s.dateTick0(e.calendar,1),l&&(e._dowTick0=e.tick0)}else i>M?e.dtick=oe(t,M,ee):i>E?e.dtick=oe(t,E,te):i>C?e.dtick=oe(t,C,te):(r=n(10),e.dtick=oe(t,r,Q))}else if("log"===e.type){e.tick0=0;var c=s.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),e.dtick="L"+oe(t,r,Q)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Te(e)?(e.tick0=0,r=1,e.dtick=oe(t,r,ie)):(e.tick0=0,r=n(10),e.dtick=oe(t,r,Q));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var f=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(f)}},$.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return s.increment(e,o*t);var l=t.charAt(0),c=o*Number(t.substr(1));if("M"===l)return s.incrementMonth(e,c,i);if("L"===l)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===l){var u="D2"===t?ae:ne,f=e+.01*o,p=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,p),1))/Math.LN10}throw"unrecognized dtick "+String(t)},$.tickFirst=function(e,t){var r=e.r2l||Number,i=s.simpleMap(e.range,r,void 0,void 0,t),o=i[1]<i[0],l=o?Math.floor:Math.ceil,c=X(i)[0],u=e.dtick,f=r(e.tick0);if(a(u)){var p=l((c-f)/u)*u+f;return"category"!==e.type&&"multicategory"!==e.type||(p=s.constrain(p,0,e._categories.length-1)),p}var h=u.charAt(0),d=Number(u.substr(1));if("M"===h){for(var m,g,y,v=0,b=f;v<10;){if(((m=$.tickIncrement(b,u,o,e.calendar))-c)*(b-c)<=0)return o?Math.min(b,m):Math.max(b,m);g=(c-(b+m)/2)/(m-b),y=h+(Math.abs(Math.round(g))||1)*d,b=$.tickIncrement(b,y,g<0?!o:o,e.calendar),v++}return s.error("tickFirst did not converge",e),b}if("L"===h)return Math.log(l((Math.pow(10,c)-f)/d)*d+f)/Math.LN10;if("D"===h){var x="D2"===u?ae:ne,_=s.roundUp(s.mod(c,1),x,o);return Math.floor(c)+Math.log(n.round(Math.pow(10,_),1))/Math.LN10}throw"unrecognized dtick "+String(u)},$.tickText=function(e,t,r,n){var i,o=le(e,t),l="array"===e.tickmode,c=r||l,u=e.type,f="category"===u?e.d2l_noadd:e.d2l;if(l&&Array.isArray(e.ticktext)){var p=s.simpleMap(e.range,e.r2l),h=(Math.abs(p[1]-p[0])-(e._lBreaks||0))/1e4;for(i=0;i<e.ticktext.length&&!(Math.abs(t-f(e.tickvals[i]))<h);i++);if(i<e.ticktext.length)return o.text=String(e.ticktext[i]),o}function d(n){if(void 0===n)return!0;if(r)return"none"===n;var a={first:e._tmin,last:e._tmax}[n];return"all"!==n&&t!==a}var m=r?"never":"none"!==e.exponentformat&&d(e.showexponent)?"hide":"";if("date"===u?function(e,t,r,n){var i=e._tickround,o=r&&e.hoverformat||$.getTickFormat(e);n&&(i=a(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var l,c=s.formatDate(t.x,o,i,e._dateFormat,e.calendar,e._extraFormat),u=c.indexOf("\n");if(-1!==u&&(l=c.substr(u+1),c=c.substr(0,u)),n&&("00:00:00"===c||"00:00"===c?(c=l,l=""):8===c.length&&(c=c.replace(/:00$/,""))),l)if(r)"d"===i?c+=", "+l:c=l+(c?", "+c:"");else if(e._inCalcTicks&&e._prevDateHead===l){var f=Se(e),p=e._trueSide||e.side;(!f&&"top"===p||f&&"bottom"===p)&&(c+="<br> ")}else e._prevDateHead=l,c+="<br>"+l;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,l=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);if("never"===i&&(i=""),n&&"L"!==u&&(o="L3",u="L"),c||"L"===u)t.text=pe(Math.pow(10,l),e,i,n);else if(a(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),p=Math.abs(f),h=e.exponentformat;"power"===h||ue(h)&&fe(f)?(t.text=0===f?1:1===f?"10":"10<sup>"+(f>1?"":N)+p+"</sup>",t.fontSize*=1.25):("e"===h||"E"===h)&&p>2?t.text="1"+h+(f>0?"+":N)+p:(t.text=pe(Math.pow(10,l),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,s.mod(l,1)))),t.fontSize*=.75}if("D1"===e.dtick){var d=String(t.text).charAt(0);"0"!==d&&"1"!==d||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(l<0?.5:.25)))}}(e,o,0,c,m):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r=""),t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):Te(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=pe(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=pe(s.deg2rad(t.x),e,a,n);else{var l=t.x<0;1===o[1]?1===o[0]?t.text="π":t.text=o[0]+"π":t.text=["<sup>",o[0],"</sup>","⁄","<sub>",o[1],"</sub>","π"].join(""),l&&(t.text=N+t.text)}}}}(e,o,r,c,m):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide"),t.text=pe(t.x,e,a,n)}(e,o,0,c,m),n||(e.tickprefix&&!d(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!d(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var g=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[g(o.x-.5),g(o.x+e.dtick-.5)]}return o},$.hoverLabelText=function(e,t,r){r&&(e=s.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return $.hoverLabelText(e,n,r)+" - "+$.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=$.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":N+o:o};var ce=["f","p","n","μ","m","","k","M","G","T"];function ue(e){return"SI"===e||"B"===e}function fe(e){return e>14||e<-15}function pe(e,t,r,n){var i=e<0,o=t._tickround,l=r||t.exponentformat||"B",c=t._tickexponent,u=$.getTickFormat(t),f=t.separatethousands;if(n){var p={exponentformat:l,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};se(p),o=(Number(p._tickround)||0)+4,c=p._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,N);var h,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(e=Math.abs(e))<d)e="0",i=!1;else{if(e+=d,c&&(e*=Math.pow(10,-c),o+=c),0===o)e=String(Math.floor(e));else if(o<0){e=(e=String(Math.round(e))).substr(0,e.length+o);for(var m=o;m<0;m++)e+="0"}else{var g=(e=String(e)).indexOf(".")+1;g&&(e=e.substr(0,g+o).replace(/\.?0+$/,""))}e=s.numSeparate(e,t._separators,f)}return c&&"hide"!==l&&(ue(l)&&fe(c)&&(l="power"),h=c<0?N+-c:"power"!==l?"+"+c:String(c),"e"===l||"E"===l?e+=l+h:"power"===l?e+="×10<sup>"+h+"</sup>":"B"===l&&9===c?e+="B":ue(l)&&(e+=ce[c/3+5])),i?N+e:e}function he(e,t){for(var r=[],n={},a=0;a<t.length;a++){var i=t[a];n[i.text2]?n[i.text2].push(i.x):n[i.text2]=[i.x]}for(var o in n)r.push(le(e,s.interp(n[o],.5),o));return r}function de(e){return void 0!==e.periodX?e.periodX:e.x}function me(e){return[e.text,e.x,e.axInfo,e.font,e.fontSize,e.fontColor].join("_")}function ge(e){var t=e.title.font.size,r=(e.title.text.match(c.BR_TAG_ALL)||[]).length;return e.title.hasOwnProperty("standoff")?r?t*(z+r*j):t*z:r?t*(r+1)*j:t}function ye(e,t){var r=e.l2p(t);return r>1&&r<e._length-1}function ve(e){var t=n.select(e),r=t.select(".text-math-group");return r.empty()?t.select("text"):r}function be(e){return e._id+".automargin"}function xe(e){return be(e)+".mirror"}function _e(e){return e._id+".rangeslider"}function we(e,t){for(var r=0;r<t.length;r++)-1===e.indexOf(t[r])&&e.push(t[r])}function ke(e,t,r){var n,a,i=[],o=[],l=e.layout;for(n=0;n<t.length;n++)i.push($.getFromId(e,t[n]));for(n=0;n<r.length;n++)o.push($.getFromId(e,r[n]));var c=Object.keys(h),u=["anchor","domain","overlaying","position","side","tickangle","editType"],f=["linear","log"];for(n=0;n<c.length;n++){var p=c[n],d=i[0][p],m=o[0][p],g=!0,y=!1,v=!1;if("_"!==p.charAt(0)&&"function"!=typeof d&&-1===u.indexOf(p)){for(a=1;a<i.length&&g;a++){var b=i[a][p];"type"===p&&-1!==f.indexOf(d)&&-1!==f.indexOf(b)&&d!==b?y=!0:b!==d&&(g=!1)}for(a=1;a<o.length&&g;a++){var x=o[a][p];"type"===p&&-1!==f.indexOf(m)&&-1!==f.indexOf(x)&&m!==x?v=!0:o[a][p]!==m&&(g=!1)}g&&(y&&(l[i[0]._name].type="linear"),v&&(l[o[0]._name].type="linear"),De(l,p,i,o,e._fullLayout._dfltTitle))}}for(n=0;n<e._fullLayout.annotations.length;n++){var _=e._fullLayout.annotations[n];-1!==t.indexOf(_.xref)&&-1!==r.indexOf(_.yref)&&s.swapAttrs(l.annotations[n],["?"])}}function De(e,t,r,n,a){var i,o=s.nestedProperty,l=o(e[r[0]._name],t).get(),c=o(e[n[0]._name],t).get();for("title"===t&&(l&&l.text===a.x&&(l.text=a.y),c&&c.text===a.y&&(c.text=a.x)),i=0;i<r.length;i++)o(e,r[i]._name+"."+t).set(c);for(i=0;i<n.length;i++)o(e,n[i]._name+"."+t).set(l)}function Te(e){return"angularaxis"===e._id}function Ae(e,t){for(var r=t._rangebreaks.length,n=0;n<r;n++){var a=t._rangebreaks[n];if(e>=a.min&&e<a.max)return a.max}return e}function Se(e){return-1!==(e.ticklabelposition||"").indexOf("inside")}function Me(e,t){Se(e._anchorAxis||{})&&e._hideCounterAxisInsideTickLabels&&e._hideCounterAxisInsideTickLabels(t)}$.getTickFormat=function(e){var t,r,n,a,i,o,s,l;function c(e){return"string"!=typeof e?e:Number(e.replace("M",""))*k}function u(e,t){var r=["L","D"];if(typeof e==typeof t){if("number"==typeof e)return e-t;var n=r.indexOf(e.charAt(0)),a=r.indexOf(t.charAt(0));return n===a?Number(e.replace(/(L|D)/g,""))-Number(t.replace(/(L|D)/g,"")):n-a}return"number"==typeof e?1:-1}function f(e,t){var r=null===t[0],n=null===t[1],a=u(e,t[0])>=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t<e.tickformatstops.length;t++)if((n=e.tickformatstops[t]).enabled&&(a=e.dtick,o=void 0,void 0,void 0,o=c||function(e){return e},s=(i=n.dtickrange)[0],l=i[1],(!s&&"number"!=typeof s||o(s)<=o(a))&&(!l&&"number"!=typeof l||o(l)>=o(a)))){r=n;break}break;case"log":for(t=0;t<e.tickformatstops.length;t++)if((n=e.tickformatstops[t]).enabled&&f(e.dtick,n.dtickrange)){r=n;break}}return r?r.value:e.tickformat},$.getSubplots=function(e,t){var r=e._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),a=t?$.findSubplotsWithAxis(n,t):n;return a.sort((function(e,t){var r=e.substr(1).split("y"),n=t.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]})),a},$.findSubplotsWithAxis=function(e,t){for(var r=new RegExp("x"===t._id.charAt(0)?"^"+t._id+"y":t._id+"$"),n=[],a=0;a<e.length;a++){var i=e[a];r.test(i)&&n.push(i)}return n},$.makeClipPaths=function(e){var t=e._fullLayout;if(!t._hasOnlyLargeSploms){var r,a,i={_offset:0,_length:t.width,_id:""},o={_offset:0,_length:t.height,_id:""},s=$.list(e,"x",!0),l=$.list(e,"y",!0),c=[];for(r=0;r<s.length;r++)for(c.push({x:s[r],y:o}),a=0;a<l.length;a++)0===r&&c.push({x:i,y:l[a]}),c.push({x:s[r],y:l[a]});var u=t._clips.selectAll(".axesclip").data(c,(function(e){return e.x._id+e.y._id}));u.enter().append("clipPath").classed("axesclip",!0).attr("id",(function(e){return"clip"+t._uid+e.x._id+e.y._id})).append("rect"),u.exit().remove(),u.each((function(e){n.select(this).select("rect").attr({x:e.x._offset||0,y:e.y._offset||0,width:e.x._length||1,height:e.y._length||1})}))}},$.draw=function(e,t,r){var n=e._fullLayout;"redraw"===t&&n._paper.selectAll("g.subplot").each((function(e){var t=e[0],r=n._plots[t];if(r){var a=r.xaxis,i=r.yaxis;r.xaxislayer.selectAll("."+a._id+"tick").remove(),r.yaxislayer.selectAll("."+i._id+"tick").remove(),r.xaxislayer.selectAll("."+a._id+"tick2").remove(),r.yaxislayer.selectAll("."+i._id+"tick2").remove(),r.xaxislayer.selectAll("."+a._id+"divider").remove(),r.yaxislayer.selectAll("."+i._id+"divider").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),n._infolayer.select(".g-"+a._id+"title").remove(),n._infolayer.select(".g-"+i._id+"title").remove()}}));var a=t&&"redraw"!==t?t:$.listIds(e);return s.syncOrAsync(a.map((function(t){return function(){if(t){var n=$.getFromId(e,t),a=$.drawOne(e,n,r);return n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),a}}})))},$.drawOne=function(e,t,r){var n,a,l;r=r||{},t.setScale();var c=e._fullLayout,h=t._id,d=h.charAt(0),m=$.counterLetter(h),g=c._plots[t._mainSubplot];if(g){var y=g[d+"axislayer"],v=t._mainLinePosition,b=t._mainMirrorPosition,x=t._vals=$.calcTicks(t),_=[t.mirror,v,b].join("_");for(n=0;n<x.length;n++)x[n].axInfo=_;t._selections={},t._tickAngles&&(t._prevTickAngles=t._tickAngles),t._tickAngles={},t._depth=null;var w={};if(t.visible){var k,D,T=$.makeTransTickFn(t),A=$.makeTransTickLabelFn(t),S="inside"===t.ticks,M="outside"===t.ticks;if("boundaries"===t.tickson){var E=function(e,t){var r,n=[],a=function(e,t){var r=e.xbnd[t];null!==r&&n.push(s.extendFlat({},e,{x:r}))};if(t.length){for(r=0;r<t.length;r++)a(t[r],0);a(t[r-1],1)}return n}(0,x);D=$.clipEnds(t,E),k=S?D:E}else D=$.clipEnds(t,x),k=S&&"period"!==t.ticklabelmode?D:x;var C=t._gridVals=D,N=function(e,t){var r,n,a=[],i=t.length&&t[t.length-1].x<t[0].x,o=function(e,t){var r=e.xbnd[t];null!==r&&a.push(s.extendFlat({},e,{x:r}))};if(e.showdividers&&t.length){for(r=0;r<t.length;r++){var l=t[r];l.text2!==n&&o(l,i?1:0),n=l.text2}o(t[r-1],i?0:1)}return a}(t,x);if(!c._hasOnlyLargeSploms){var O=t._subplotsWith,I={};for(n=0;n<O.length;n++){a=O[n];var P=(l=c._plots[a])[m+"axis"],R=P._mainAxis._id;if(!I[R]){I[R]=1;var L="x"===d?"M0,"+P._offset+"v"+P._length:"M"+P._offset+",0h"+P._length;$.drawGrid(e,t,{vals:C,counterAxis:P,layer:l.gridlayer.select("."+h),path:L,transFn:T}),$.drawZeroLine(e,t,{counterAxis:P,layer:l.zerolinelayer,path:L,transFn:T})}}}var F=$.getTickSigns(t),B=[];if(t.ticks){var z,V,q,W=$.makeTickPath(t,v,F[2]);if(t._anchorAxis&&t.mirror&&!0!==t.mirror?(z=$.makeTickPath(t,b,F[3]),V=W+z):(z="",V=W),t.showdividers&&M&&"boundaries"===t.tickson){var H={};for(n=0;n<N.length;n++)H[N[n].x]=1;q=function(e){return H[e.x]?z:V}}else q=V;$.drawTicks(e,t,{vals:k,layer:y,path:q,transFn:T}),"allticks"===t.mirror&&(B=Object.keys(t._linepositions||{}))}for(n=0;n<B.length;n++){a=B[n],l=c._plots[a];var G=t._linepositions[a]||[],X=$.makeTickPath(t,G[0],F[0])+$.makeTickPath(t,G[1],F[1]);$.drawTicks(e,t,{vals:k,layer:l[d+"axislayer"],path:X,transFn:T})}var Y=[];if(Y.push((function(){return $.drawLabels(e,t,{vals:x,layer:y,plotinfo:l,transFn:A,labelFns:$.makeLabelFns(t,v)})})),"multicategory"===t.type){var Z={x:2,y:10}[d];Y.push((function(){var r={x:"height",y:"width"}[d],n=J()[r]+Z+(t._tickAngles[h+"tick"]?t.tickfont.size*j:0);return $.drawLabels(e,t,{vals:he(t,x),layer:y,cls:h+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:T,labelFns:$.makeLabelFns(t,v+n*F[4])})})),Y.push((function(){return t._depth=F[4]*(J("tick2")[t.side]-v),function(e,t,r){var n=t._id+"divider",a=r.vals,i=r.layer.selectAll("path."+n).data(a,me);i.exit().remove(),i.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(f.stroke,t.dividercolor).style("stroke-width",p.crispRound(e,t.dividerwidth,1)+"px"),i.attr("transform",r.transFn).attr("d",r.path)}(e,t,{vals:N,layer:y,path:$.makeTickPath(t,v,F[4],t._depth),transFn:T})}))}else t.title.hasOwnProperty("standoff")&&Y.push((function(){t._depth=F[4]*(J()[t.side]-v)}));var K=o.getComponentMethod("rangeslider","isVisible")(t);return Y.push((function(){var r,n,a,s,l=t.side.charAt(0),u=U[t.side].charAt(0),f=$.getPxPosition(e,t),p=M?t.ticklen:0;if((t.automargin||K)&&("multicategory"===t.type?r=J("tick2"):(r=J(),"x"===d&&"b"===l&&(t._depth=Math.max(r.width>0?r.bottom-f:0,p)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var h=[0,1];if("x"===d){if("b"===l?n[l]=t._depth:(n[l]=t._depth=Math.max(r.width>0?f-r.top:0,p),h.reverse()),r.width>0){var g=r.right-(t._offset+t._length);g>0&&(n.xr=1,n.r=g);var y=t._offset-r.left;y>0&&(n.xl=0,n.l=y)}}else if("l"===l?n[l]=t._depth=Math.max(r.height>0?f-r.left:0,p):(n[l]=t._depth=Math.max(r.height>0?r.right-f:0,p),h.reverse()),r.height>0){var v=r.bottom-(t._offset+t._length);v>0&&(n.yb=0,n.b=v);var b=t._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[h[0]],t.title.text!==c._dfltTitle[d]&&(n[l]+=ge(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=p),!0===t.mirror||"ticks"===t.mirror?a[m]=t._anchorAxis.domain[h[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[m]=[t._counterDomainMin,t._counterDomainMax][h[1]]))}K&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,be(t),n),i.autoMargin(e,xe(t),a),i.autoMargin(e,_e(t),s)})),r.skipTitle||K&&"bottom"===t.side||Y.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+ge(t);else{var s=Se(t);if("multicategory"===t.type)r=t._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===t.ticks&&(l+=t.ticklen)),r=10+l+(t.linewidth?t.linewidth-1:0)}s||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,f,h,d,m=$.getPxPosition(e,t);if("x"===i?(f=t._offset+t._length/2,h="top"===t.side?m-r:m+r):(h=t._offset+t._length/2,f="right"===t.side?m+r:m-r,c={rotate:"-90",offset:0}),"multicategory"!==t.type){var g=t._selections[t._id+"tick"];if(d={selection:g,side:t.side},g&&g.node()&&g.node().parentNode){var y=p.getTranslate(g.node().parentNode);d.offsetLeft=y.x,d.offsetTop=y.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:c,attributes:{x:f,y:h,"text-anchor":"middle"}})}(e,t)})),s.syncOrAsync(Y)}}function J(e){var r=h+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;return e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ve(this),t=p.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0),{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},$.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},$.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return l(e._offset+e.l2p(t.x),0)}:function(t){return l(0,e._offset+e.l2p(t.x))}},$.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),s=r("inside"),l=o||a||n||i;if(!l&&!s)return[0,0];var c=e.side,u=l?(e.tickwidth||0)/2:0,f=3,p=e.tickfont?e.tickfont.size:12;return(o||n)&&(u+=p*z,f+=(e.linewidth||0)/2),(a||i)&&(u+=(e.linewidth||0)/2,f+=3),s&&"top"===c&&(f-=p*(1-z)),(a||n)&&(u=-u),"bottom"!==c&&"right"!==c||(f=-f),[l?u:0,s?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return l(r+e._offset+e.l2p(de(t)),n)}:function(t){return l(n,r+e._offset+e.l2p(de(t)))}},$.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},$.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),l=i("left"),c=i("right"),u=i("bottom")||l||o||c,f=i("inside"),p="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,h=0,d=0,m=p?e.ticklen:0;if(f?m*=-1:u&&(m=0),p&&(h+=m,r)){var g=s.deg2rad(r);h=m*Math.cos(g)+1,d=m*Math.sin(g)}e.showticklabels&&(p||e.showline)&&(h+=.2*e.tickfont.size);var y,v,b,x,_,w={labelStandoff:h+=(e.linewidth||1)/2*(f?-1:1),labelShift:d},k=0,D=e.side,T=e._id.charAt(0),A=e.tickangle;if("x"===T)x=(_=!f&&"bottom"===D||f&&"top"===D)?1:-1,f&&(x*=-1),y=d*x,v=t+h*x,b=_?1:-.2,90===Math.abs(A)&&(f?b+=B:b=-90===A&&"bottom"===D?z:90===A&&"top"===D?B:.5,k=B/2*(A/90)),w.xFn=function(e){return e.dx+y+k*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*b},w.anchorFn=function(e,t){if(u){if(l)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*x<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===T){if(x=(_=!f&&"left"===D||f&&"right"===D)?1:-1,f&&(x*=-1),y=h,v=d*x,b=0,f||90!==Math.abs(A)||(b=-90===A&&"left"===D||90===A&&"right"===D?z:.5),f){var S=a(A)?+A:0;if(0!==S){var M=s.deg2rad(S);k=Math.abs(Math.sin(M))*z*x,b=0}}w.xFn=function(e){return e.dx+t-(y+e.fontSize*b)*x+k*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*B},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},$.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.vals;"period"===t.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(t.ticks?a:[],me);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,t.tickcolor).style("stroke-width",p.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path).style("display",null),Me(t,[R]),i.attr("transform",r.transFn)},$.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&$.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,s=0;s<a.length;s++){var l=a[s].x;if(o?!l:Math.abs(l)<t.dtick/100){if(a=a.slice(0,s).concat(a.slice(s+1)),!o)break;s--}}var c=r.layer.selectAll("path."+n).data(a,me);c.exit().remove(),c.enter().append("path").classed(n,1).classed("crisp",!1!==r.crisp),t._gw=p.crispRound(e,t.gridwidth,1),c.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,t.gridcolor||"#ddd").style("stroke-width",t._gw+"px").style("display",null),Me(t,[P]),"function"==typeof r.path&&c.attr("d",r.path)},$.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=$.shouldShowZeroLine(e,t,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:t._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return W(e.id,t.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,t.zerolinecolor||f.defaultLine).style("stroke-width",p.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Me(t,[I])},$.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,u=o.charAt(0),f=r.cls||o+"tick",h=r.vals,d=r.labelFns,m=r.secondary?0:t.tickangle,g=(t._prevTickAngles||{})[f],y=r.layer.selectAll("g."+f).data(t.showticklabels?h:[],me),v=[];function b(e,i){e.each((function(e){var o=n.select(this),s=o.select(".text-math-group"),u=d.anchorFn(e,i),f=r.transFn.call(o.node(),e)+(a(i)&&0!=+i?" rotate("+i+","+d.xFn(e)+","+(d.yFn(e)-e.fontSize/2)+")":""),h=c.lineCount(o),m=j*e.fontSize,g=d.heightFn(e,a(i)?+i:0,(h-1)*m);if(g&&(f+=l(0,g)),s.empty()){var y=o.select("text");y.attr({transform:f,"text-anchor":u}),y.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var v=p.bBox(s.node()).width*{end:-.5,start:.5}[u];s.attr("transform",f+l(v,0))}}))}y.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),a=e._promises.length;r.call(c.positionText,d.xFn(t),d.yFn(t)).call(p.font,t.font,t.fontSize,t.fontColor).text(t.text).call(c.convertToTspans,e),e._promises[a]?v.push(e._promises.pop().then((function(){b(r,m)}))):b(r,m)})),Me(t,[L]),y.exit().remove(),r.repositionOnUpdate&&y.each((function(e){n.select(this).select("text").call(c.positionText,d.xFn(e),d.yFn(e))})),t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(r&&"allow"!==r){var a=-1!==r.indexOf("hide"),o="x"===t._id.charAt(0),l=0,c=o?e._fullLayout.width:e._fullLayout.height;if(-1!==r.indexOf("domain")){var u=s.simpleMap(t.range,t.r2l);l=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var f=Math.min(l,c),h=Math.max(l,c),d=t.side,m=1/0,g=-1/0;for(var v in y.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=p.bBox(r.node()),s=0;o?(i.right>h||i.left<f)&&(s=1):(i.bottom>h||i.top+(t.tickangle?0:e.fontSize/4)<f)&&(s=1);var l=r.select("text");s?a&&l.style("opacity",0):(l.style("opacity",1),m="bottom"===d||"right"===d?Math.min(m,o?i.top:i.left):-1/0,g="top"===d||"left"===d?Math.max(g,o?i.bottom:i.right):1/0)}})),i._plots){var b=i._plots[v];if(t._id===b.xaxis._id||t._id===b.yaxis._id){var x=o?b.yaxis:b.xaxis;x&&(x["_visibleLabelMin_"+t._id]=m,x["_visibleLabelMax_"+t._id]=g)}}}},t._hideCounterAxisInsideTickLabels=function(e){var r="x"===t._id.charAt(0),a=[];for(var o in i._plots){var s=i._plots[o];t._id!==s.xaxis._id&&t._id!==s.yaxis._id||a.push(r?s.yaxis:s.xaxis)}a.forEach((function(r,a){r&&Se(r)&&(e||[I,P,R,L]).forEach((function(e){var o="tick"===e.K&&"text"===e.L&&"period"===t.ticklabelmode,s=i._plots[t._mainSubplot];(e.K===I.K?s.zerolinelayer.selectAll("."+t._id+"zl"):e.K===P.K?s.gridlayer.selectAll("."+t._id):s[t._id.charAt(0)+"axislayer"]).each((function(){var i=n.select(this);e.L&&(i=i.selectAll(e.L)),i.each((function(i){var s=t.l2p(o?de(i):i.x)+t._offset,l=n.select(this);s<t["_visibleLabelMax_"+r._id]&&s>t["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==e.K||a||l.style("display",null)}))}))}))}))},b(y,g+1?g:m);var x=null;t._selections&&(t._selections[f]=y);var _=[function(){return v.length&&Promise.all(v)}];t.automargin&&i._redrawFromAutoMarginCount&&90===g?(x=90,_.push((function(){b(y,g)}))):_.push((function(){if(b(y,m),h.length&&"x"===u&&!a(m)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){x=0;var e,n=0,i=[];if(y.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=ve(this),o=p.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=h.length,l=Math.abs((h[o-1].x-h[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},d=f("top"),g=f("left"),v=f("right"),_=f("bottom")||g||d||v?(t.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===t.type||"realaxis"===t._name;for(e=0;e<i.length-1;e++)if(s.bBoxIntersect(i[e],i[e+1],_)){x=w?90:30;break}}else{var k=2;for(t.ticks&&(k+=t.tickwidth/2),e=0;e<i.length;e++){var D=h[e].xbnd,T=i[e];if(null!==D[0]&&T.left-t.l2p(D[0])<k||null!==D[1]&&t.l2p(D[1])-T.right<k){x=90;break}}}x&&b(y,x)}})),t._tickAngles&&_.push((function(){t._tickAngles[f]=null===x?a(m)?m:0:x}));var w=t._anchorAxis;w&&w.autorange&&Se(t)&&!H(i,t._id)&&(i._insideTickLabelsAutorange||(i._insideTickLabelsAutorange={}),i._insideTickLabelsAutorange[w._name+".autorange"]=w.autorange,_.push((function(){y.each((function(e,r){var n=ve(this);n.select(".text-math-group").empty()&&(t._vals[r].bb=p.bBox(n.node()))}))})));var k=s.syncOrAsync(_);return k&&k.then&&e._promises.push(k),k},$.getPxPosition=function(e,t){var r,n=e._fullLayout._size,a=t._id.charAt(0),i=t.side;return"free"!==t.anchor?r=t._anchorAxis:"x"===a?r={_offset:n.t+(1-(t.position||0))*n.h,_length:0}:"y"===a&&(r={_offset:n.l+(t.position||0)*n.w,_length:0}),"top"===i||"left"===i?r._offset:"bottom"===i||"right"===i?r._offset+r._length:void 0},$.shouldShowZeroLine=function(e,t,r){var n=s.simpleMap(t.range,t.r2l);return n[0]*n[1]<=0&&t.zeroline&&("linear"===t.type||"-"===t.type)&&!(t.rangebreaks&&t.maskBreaks(0)===O)&&(ye(t,0)||!function(e,t,r,n){var a=r._mainAxis;if(a){var i=e._fullLayout,o=t._id.charAt(0),s=$.counterLetter(t._id),l=t._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:t._length),c=i._plots[r._mainSubplot];if(!(c.mainplotinfo||c).overlays.length)return h(r);for(var u=$.list(e,s),f=0;f<u.length;f++){var p=u[f];if(p._mainAxis===a&&h(p))return!0}}function h(e){if(!e.showline||!e.linewidth)return!1;var r=Math.max((e.linewidth+t.zerolinewidth)/2,1);function n(e){return"number"==typeof e&&Math.abs(e-l)<r}if(n(e._mainLinePosition)||n(e._mainMirrorPosition))return!0;var a=e._linepositions||{};for(var i in a)if(n(a[i][0])||n(a[i][1]))return!0}}(e,t,r,n)||function(e,t){for(var r=e._fullData,n=t._mainSubplot,a=t._id.charAt(0),i=0;i<r.length;i++){var s=r[i];if(!0===s.visible&&s.xaxis+s.yaxis===n){if(o.traceIs(s,"bar-like")&&s.orientation==={x:"h",y:"v"}[a])return!0;if(s.fill&&s.fill.charAt(s.fill.length-1)===a)return!0}}return!1}(e,t))},$.clipEnds=function(e,t){return t.filter((function(t){return ye(e,t.x)}))},$.allowAutoMargin=function(e){for(var t=$.list(e,"",!0),r=0;r<t.length;r++){var n=t[r];n.automargin&&(i.allowAutoMargin(e,be(n)),n.mirror&&i.allowAutoMargin(e,xe(n))),o.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(e,_e(n))}},$.swap=function(e,t){for(var r=function(e,t){var r,n,a=[];for(r=0;r<t.length;r++){var i=[],o=e._fullData[t[r]].xaxis,s=e._fullData[t[r]].yaxis;if(o&&s){for(n=0;n<a.length;n++)-1===a[n].x.indexOf(o)&&-1===a[n].y.indexOf(s)||i.push(n);if(i.length){var l,c=a[i[0]];if(i.length>1)for(n=1;n<i.length;n++)l=a[i[n]],we(c.x,l.x),we(c.y,l.y);we(c.x,[o]),we(c.y,[s])}else a.push({x:[o],y:[s]})}}return a}(e,t),n=0;n<r.length;n++)ke(e,r[n].x,r[n].y)}},{"../../components/color":366,"../../components/drawing":388,"../../components/titles":464,"../../constants/alignment":471,"../../constants/numerical":479,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/plots":619,"../../registry":638,"./autorange":553,"./axis_autotype":555,"./axis_ids":558,"./clean_ticks":560,"./layout_attributes":569,"./set_convert":576,"@plotly/d3":58,"fast-isnumeric":190}],555:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM,o=a.isArrayOrTypedArray,s=a.isDateTime,l=a.cleanNumber,c=Math.round;function u(e,t){return t?n(e):"number"==typeof e}function f(e){return Math.max(1,(e-1)/1e3)}t.exports=function(e,t,r){var a=e,p=r.noMultiCategory;if(o(a)&&!a.length)return"-";if(!p&&function(e){return o(e[0])&&o(e[1])}(a))return"multicategory";if(p&&Array.isArray(a[0])){for(var h=[],d=0;d<a.length;d++)if(o(a[d]))for(var m=0;m<a[d].length;m++)h.push(a[d][m]);a=h}if(function(e,t){for(var r=e.length,a=f(r),i=0,o=0,l={},u=0;u<r;u+=a){var p=e[c(u)],h=String(p);l[h]||(l[h]=1,s(p,t)&&i++,n(p)&&o++)}return i>2*o}(a,t))return"date";var g="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,s={},u=0;u<r;u+=n){var p=e[c(u)],h=String(p);if(!s[h]){s[h]=1;var d=typeof p;"boolean"===d?o++:(t?l(p)!==i:"number"===d)?a++:"string"===d&&o++}}return o>2*a}(a,g)?"category":function(e,t){for(var r=e.length,n=0;n<r;n++)if(u(e[n],t))return!0;return!1}(a,g)?"linear":"-"}},{"../../constants/numerical":479,"../../lib":503,"fast-isnumeric":190}],556:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../lib"),o=e("../array_container_defaults"),s=e("./layout_attributes"),l=e("./tick_value_defaults"),c=e("./tick_mark_defaults"),u=e("./tick_label_defaults"),f=e("./prefix_suffix_defaults"),p=e("./category_order_defaults"),h=e("./line_grid_defaults"),d=e("./set_convert"),m=e("./constants").WEEKDAY_PATTERN,g=e("./constants").HOUR_PATTERN;function y(e,t,r){function a(r,n){return i.coerce(e,t,s.rangebreaks,r,n)}if(a("enabled")){var o=a("bounds");if(o&&o.length>=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=b(o[l])){u=m;break}var f=a("pattern",u);if(f===m)for(l=0;l<2;l++)(c=b(o[l]))&&(t.bounds[l]=o[l]=c-1);if(f)for(l=0;l<2;l++)switch(c=o[l],f){case m:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===r.autorange){var p=r.range;if(p[0]<p[1]){if(o[0]<p[0]&&o[1]>p[1])return void(t.enabled=!1)}else if(o[0]>p[0]&&o[1]<p[1])return void(t.enabled=!1)}}else{var h=a("values");if(!h||!h.length)return void(t.enabled=!1);a("dvalue")}}}t.exports=function(e,t,r,n,g){var v,b=n.letter,x=n.font||{},_=n.splomStash||{},w=r("visible",!n.visibleDflt),k=t._template||{},D=t.type||k.type||"-";"date"===D&&(a.getComponentMethod("calendars","handleDefaults")(e,t,"calendar",n.calendar),n.noTicklabelmode||(v=r("ticklabelmode")));var T="";n.noTicklabelposition&&"multicategory"!==D||(T=i.coerce(e,t,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:"period"===v?["outside","inside"]:"x"===b?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),n.noTicklabeloverflow||r("ticklabeloverflow",-1!==T.indexOf("inside")?"hide past domain":"category"===D||"multicategory"===D?"allow":"hide past div"),d(t,g);var A=!t.isValidRange(e.range);A&&n.reverseDflt&&(A="reversed"),!r("autorange",A)||"linear"!==D&&"-"!==D||r("rangemode"),r("range"),t.cleanRange(),p(e,t,r,n),"category"===D||n.noHover||r("hoverformat");var S=r("color"),M=S!==s.color.dflt?S:x.color,E=_.label||g._dfltTitle[b];if(f(e,t,r,D,n),!w)return t;r("title.text",E),i.coerceFont(r,"title.font",{family:x.family,size:i.bigFont(x.size),color:M}),l(e,t,r,D),u(e,t,r,D,n),c(e,t,r,n),h(e,t,r,{dfltColor:S,bgColor:n.bgColor,showGrid:n.showGrid,attributes:s}),(t.showline||t.ticks)&&r("mirror"),n.automargin&&r("automargin");var C,N="multicategory"===D;if(n.noTickson||"category"!==D&&!N||!t.ticks&&!t.showgrid||(N&&(C="boundaries"),"boundaries"===r("tickson",C)&&delete t.ticklabelposition),N&&r("showdividers")&&(r("dividercolor"),r("dividerwidth")),"date"===D)if(o(e,t,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:y}),t.rangebreaks.length){for(var O=0;O<t.rangebreaks.length;O++)if(t.rangebreaks[O].pattern===m){t._hasDayOfWeekBreaks=!0;break}if(d(t,g),g._has("scattergl")||g._has("splom"))for(var I=0;I<n.data.length;I++){var P=n.data[I];"scattergl"!==P.type&&"splom"!==P.type||(P.visible=!1,i.warn(P.type+" traces do not work on axes with rangebreaks. Setting trace "+P.index+" to `visible: false`."))}}else delete t.rangebreaks;return t};var v={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function b(e){if("string"==typeof e)return v[e.substr(0,3).toLowerCase()]}},{"../../lib":503,"../../registry":638,"../array_container_defaults":549,"./category_order_defaults":559,"./constants":561,"./layout_attributes":569,"./line_grid_defaults":571,"./prefix_suffix_defaults":573,"./set_convert":576,"./tick_label_defaults":578,"./tick_mark_defaults":579,"./tick_value_defaults":580,"fast-isnumeric":190}],557:[function(e,t,r){"use strict";var n=e("../../constants/docs"),a=n.FORMAT_LINK,i=n.DATE_FORMAT_LINK;function o(e,t){return["Sets the "+e+" formatting rule"+(t?"for `"+t+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+a+"."].join(" ")}function s(e,t){return o(e,t)+[" And for dates see: "+i+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}t.exports={axisHoverFormat:function(e,t){return{valType:"string",dflt:"",editType:"none",description:(t?o:s)("hover text",e)+["By default the values are formatted using "+(t?"generic number format":"`"+e+"axis.hoverformat`")+"."].join(" ")}},descriptionOnlyNumbers:o,descriptionWithDates:s}},{"../../constants/docs":474}],558:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./constants");function i(e,t){if(t&&t.length)for(var r=0;r<t.length;r++)if(t[r][e])return!0;return!1}r.id2name=function(e){if("string"==typeof e&&e.match(a.AX_ID_PATTERN)){var t=e.split(" ")[0].substr(1);return"1"===t&&(t=""),e.charAt(0)+"axis"+t}},r.name2id=function(e){if(e.match(a.AX_NAME_PATTERN)){var t=e.substr(5);return"1"===t&&(t=""),e.charAt(0)+t}},r.cleanId=function(e,t,r){var n=/( domain)$/.test(e);if("string"==typeof e&&e.match(a.AX_ID_PATTERN)&&(!t||e.charAt(0)===t)&&(!n||r)){var i=e.split(" ")[0].substr(1).replace(/^0+/,"");return"1"===i&&(i=""),e.charAt(0)+i+(n&&r?" domain":"")}},r.list=function(e,t,n){var a=e._fullLayout;if(!a)return[];var i,o=r.listIds(e,t),s=new Array(o.length);for(i=0;i<o.length;i++){var l=o[i];s[i]=a[l.charAt(0)+"axis"+l.substr(1)]}if(!n){var c=a._subplots.gl3d||[];for(i=0;i<c.length;i++){var u=a[c[i]];t?s.push(u[t+"axis"]):s.push(u.xaxis,u.yaxis,u.zaxis)}}return s},r.listIds=function(e,t){var r=e._fullLayout;if(!r)return[];var n=r._subplots;return t?n[t+"axis"]:n.xaxis.concat(n.yaxis)},r.getFromId=function(e,t,n){var a=e._fullLayout;return t=void 0===t||"string"!=typeof t?t:t.replace(" domain",""),"x"===n?t=t.replace(/y[0-9]*/,""):"y"===n&&(t=t.replace(/x[0-9]*/,"")),a[r.id2name(t)]},r.getFromTrace=function(e,t,a){var i=e._fullLayout,o=null;if(n.traceIs(t,"gl3d")){var s=t.scene;"scene"===s.substr(0,5)&&(o=i[s][a+"axis"])}else o=r.getFromId(e,t[a+"axis"]||a);return o},r.idSort=function(e,t){var r=e.charAt(0),n=t.charAt(0);return r!==n?r>n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":638,"./constants":561}],559:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=t.categoryorder="trace"),"trace"===l?t._initialCategories=[]:"array"===l?t._initialCategories=s.slice():(s=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;n<t.data.length;n++){var s=t.data[n];s[i+"axis"]===e._id&&r.push(s)}for(n=0;n<r.length;n++){var l=r[n][i];for(a=0;a<l.length;a++){var c=l[a];null!=c&&(o[c]=1)}}return Object.keys(o)}(t,n).sort(),"category ascending"===l?t._initialCategories=s:"category descending"===l&&(t._initialCategories=s.reverse()))}}},{}],560:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical"),o=i.ONEDAY,s=i.ONEWEEK;r.dtick=function(e,t){var r="log"===t,a="date"===t,i="category"===t,s=a?o:1;if(!e)return s;if(n(e))return(e=Number(e))<=0?s:i?Math.max(1,Math.round(e)):a?Math.max(.1,e):e;if("string"!=typeof e||!a&&!r)return s;var l=e.charAt(0),c=e.substr(1);return(c=n(c)?Number(c):0)<=0||!(a&&"M"===l&&c===Math.round(c)||r&&"L"===l||r&&"D"===l&&(1===c||2===c))?s:e},r.tick0=function(e,t,r,i){return"date"===t?a.cleanDate(e,a.dateTick0(r,i%s==0?1:0)):"D1"!==i&&"D2"!==i?n(e)?Number(e):0:void 0}},{"../../constants/numerical":479,"../../lib":503,"fast-isnumeric":190}],561:[function(e,t,r){"use strict";var n=e("../../lib/regex").counter;t.exports={idRegex:{x:n("x","( domain)?"),y:n("y","( domain)?")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib/regex":520}],562:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./autorange"),i=e("./axis_ids").id2name,o=e("./layout_attributes"),s=e("./scale_zoom"),l=e("./set_convert"),c=e("../../constants/numerical").ALMOST_EQUAL,u=e("../../constants/alignment").FROM_BL;function f(e,t,r){var a=r.axIds,s=r.layoutOut,l=r.hasImage,c=s._axisConstraintGroups,u=s._axisMatchGroups,f=t._id,m=f.charAt(0),g=((s._splomAxes||{})[m]||{})[f]||{},y=t._id,v="x"===y.charAt(0);function b(r,a){return n.coerce(e,t,o,r,a)}t._matchGroup=null,t._constraintGroup=null,b("constrain",l?"domain":"range"),n.coerce(e,t,{constraintoward:{valType:"enumerated",values:v?["left","center","right"]:["bottom","middle","top"],dflt:v?"center":"middle"}},"constraintoward");var x,_,w=t.type,k=[];for(x=0;x<a.length;x++)(_=a[x])!==y&&s[i(_)].type===w&&k.push(_);var D=h(c,y);if(D){var T=[];for(x=0;x<k.length;x++)D[_=k[x]]||T.push(_);k=T}var A,S,M=k.length;M&&(e.matches||g.matches)&&(A=n.coerce(e,t,{matches:{valType:"enumerated",values:k,dflt:-1!==k.indexOf(g.matches)?g.matches:void 0}},"matches"));var E=l&&!v?t.anchor:void 0;if(M&&!A&&(e.scaleanchor||E)&&(S=n.coerce(e,t,{scaleanchor:{valType:"enumerated",values:k}},"scaleanchor",E)),A){t._matchGroup=d(u,y,A,1);var C=s[i(A)],N=p(s,t)/p(s,C);v!==("x"===A.charAt(0))&&(N=(v?"x":"y")+N),d(c,y,A,N)}else e.matches&&-1!==a.indexOf(e.matches)&&n.warn("ignored "+t._name+'.matches: "'+e.matches+'" to avoid an infinite loop');if(S){var O=b("scaleratio");O||(O=t.scaleratio=1),d(c,y,S,O)}else e.scaleanchor&&-1!==a.indexOf(e.scaleanchor)&&n.warn("ignored "+t._name+'.scaleanchor: "'+e.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function p(e,t){var r=t.domain;return r||(r=e[i(t.overlaying)].domain),r[1]-r[0]}function h(e,t){for(var r=0;r<e.length;r++)if(e[r][t])return e[r];return null}function d(e,t,r,n){var a,i,o,s,l,c=h(e,t);null===c?((c={})[t]=1,l=e.length,e.push(c)):l=e.indexOf(c);var u=Object.keys(c);for(a=0;a<e.length;a++)if(o=e[a],a!==l&&o[r]){var f=o[r];for(i=0;i<u.length;i++)o[s=u[i]]=m(f,m(n,c[s]));return void e.splice(l,1)}if(1!==n)for(i=0;i<u.length;i++){var p=u[i];c[p]=m(n,c[p])}c[r]=1}function m(e,t){var r,n,a="",i="";"string"==typeof e&&(r=(a=e.match(/^[xy]*/)[0]).length,e=+e.substr(r)),"string"==typeof t&&(n=(i=t.match(/^[xy]*/)[0]).length,t=+t.substr(n));var o=e*t;return r||n?r&&n&&a.charAt(0)!==i.charAt(0)?r===n?o:(r>n?a.substr(n):i.substr(r))+o:a+i+e*t:o}function g(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;o<i.length;o++){var s=i[o],l=e[s];if("string"==typeof l){var c=l.match(/^[xy]*/)[0],u=c.length;l=+l.substr(u);for(var f="y"===c.charAt(0)?n:1/n,p=0;p<u;p++)l*=f}a[s]=l}return a}function y(e,t){var r=e._inputDomain,n=u[e.constraintoward],a=r[0]+(r[1]-r[0])*n;e.domain=e._input.domain=[a+(r[0]-a)/t,a+(r[1]-a)/t],e.setScale()}r.handleDefaults=function(e,t,r){var a,o,s,c,u,p,h,d,m=r.axIds,g=r.axHasImage,y=t._axisConstraintGroups=[],v=t._axisMatchGroups=[];for(a=0;a<m.length;a++)f(u=e[c=i(m[a])],p=t[c],{axIds:m,layoutOut:t,hasImage:g[c]});function b(e,r){for(a=0;a<e.length;a++)for(s in o=e[a])t[i(s)][r]=o}for(b(v,"_matchGroup"),a=0;a<y.length;a++)for(s in o=y[a])if((p=t[i(s)]).fixedrange){for(var x in o){var _=i(x);!1===(e[_]||{}).fixedrange&&n.warn("fixedrange was specified as false for axis "+_+" but was overridden because another axis in its constraint group has fixedrange true"),t[_].fixedrange=!0}break}for(a=0;a<y.length;){for(s in o=y[a]){(p=t[i(s)])._matchGroup&&Object.keys(p._matchGroup).length===Object.keys(o).length&&(y.splice(a,1),a--);break}a++}b(y,"_constraintGroup");var w=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],k=!1,D=!1;function T(){d=p[h],"rangebreaks"===h&&(D=p._hasDayOfWeekBreaks)}for(a=0;a<v.length;a++){o=v[a];for(var A=0;A<w.length;A++){var S;for(s in h=w[A],d=null,o)if(u=e[c=i(s)],p=t[c],h in p){if(!p.matches&&(S=p,h in u)){T();break}null===d&&h in u&&T()}if("range"===h&&d&&(k=!0),"autorange"===h&&null===d&&k&&(d=!1),null===d&&h in S&&(d=S[h]),null!==d)for(s in o)(p=t[i(s)])[h]="range"===h?d.slice():d,"rangebreaks"===h&&(p._hasDayOfWeekBreaks=D,l(p,t))}}},r.enforce=function(e){var t,r,n,o,l,u,f,p,h=e._fullLayout,d=h._axisConstraintGroups||[];for(t=0;t<d.length;t++){n=g(d[t],h);var m=Object.keys(n),v=1/0,b=0,x=1/0,_={},w={},k=!1;for(r=0;r<m.length;r++)w[o=m[r]]=l=h[i(o)],l._inputDomain?l.domain=l._inputDomain.slice():l._inputDomain=l.domain.slice(),l._inputRange||(l._inputRange=l.range.slice()),l.setScale(),_[o]=u=Math.abs(l._m)/n[o],v=Math.min(v,u),"domain"!==l.constrain&&l._constraintShrinkable||(x=Math.min(x,u)),delete l._constraintShrinkable,b=Math.max(b,u),"domain"===l.constrain&&(k=!0);if(!(v>c*b)||k)for(r=0;r<m.length;r++)if(u=_[o=m[r]],f=(l=w[o]).constrain,u!==x||"domain"===f)if(p=u/x,"range"===f)s(l,p);else{var D=l._inputDomain,T=(l.domain[1]-l.domain[0])/(D[1]-D[0]),A=(l.r2l(l.range[1])-l.r2l(l.range[0]))/(l.r2l(l._inputRange[1])-l.r2l(l._inputRange[0]));if((p/=T)*A<1){l.domain=l._input.domain=D.slice(),s(l,p);continue}if(A<1&&(l.range=l._input.range=l._inputRange.slice(),p*=A),l.autorange){var S=l.r2l(l.range[0]),M=l.r2l(l.range[1]),E=(S+M)/2,C=E,N=E,O=Math.abs(M-E),I=E-O*p*1.0001,P=E+O*p*1.0001,R=a.makePadFn(h,l,0),L=a.makePadFn(h,l,1);y(l,p);var F,B,z=Math.abs(l._m),j=a.concatExtremes(e,l),U=j.min,$=j.max;for(B=0;B<U.length;B++)(F=U[B].val-R(U[B])/z)>I&&F<C&&(C=F);for(B=0;B<$.length;B++)(F=$[B].val+L($[B])/z)<P&&F>N&&(N=F);p/=(N-C)/(2*O),C=l.l2r(C),N=l.l2r(N),l.range=l._input.range=S<M?[C,N]:[N,C]}y(l,p)}}},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n<r.length;n++)if(r[n][t])return"g"+n;return t},r.clean=function(e,t){if(t._inputDomain){for(var r=!1,n=t._id,a=e._fullLayout._axisConstraintGroups,i=0;i<a.length;i++)if(a[i][n]){r=!0;break}r&&"domain"===t.constrain||(t._input.domain=t.domain=t._inputDomain,delete t._inputDomain)}}},{"../../constants/alignment":471,"../../constants/numerical":479,"../../lib":503,"./autorange":553,"./axis_ids":558,"./layout_attributes":569,"./scale_zoom":574,"./set_convert":576}],563:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("tinycolor2"),s=e("has-passive-events"),l=e("../../registry"),c=a.strTranslate,u=e("../../lib/svg_text_utils"),f=e("../../components/color"),p=e("../../components/drawing"),h=e("../../components/fx"),d=e("./axes"),m=e("../../lib/setcursor"),g=e("../../components/dragelement"),y=e("../../components/dragelement/helpers"),v=y.selectingOrDrawing,b=y.freeMode,x=e("../../constants/alignment").FROM_TL,_=e("../../lib/clear_gl_canvases"),w=e("../../plot_api/subroutines").redrawReglTraces,k=e("../plots"),D=e("./axis_ids").getFromId,T=e("./select").prepSelect,A=e("./select").clearSelect,S=e("./select").selectOnClick,M=e("./scale_zoom"),E=e("./constants"),C=E.MINDRAG,N=E.MINZOOM,O=!0;function I(e,t,r,n){var i=a.ensureSingle(e.draglayer,t,r,(function(t){t.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",e.id)}));return i.call(m,n),i.node()}function P(e,t,r,a,i,o,s){var l=I(e,"rect",t,r);return n.select(l).call(p.setRect,a,i,o,s),l}function R(e,t){for(var r=0;r<e.length;r++)if(!e[r].fixedrange)return t;return""}function L(e,t,r,n,a){for(var i=0;i<e.length;i++){var o=e[i];if(!o.fixedrange)if(o.rangebreaks){var s="y"===o._id.charAt(0),l=s?1-t:t,c=s?1-r:r;n[o._name+".range[0]"]=o.l2r(o.p2l(l*o._length)),n[o._name+".range[1]"]=o.l2r(o.p2l(c*o._length))}else{var u=o._rl[0],f=o._rl[1]-u;n[o._name+".range[0]"]=o.l2r(u+f*t),n[o._name+".range[1]"]=o.l2r(u+f*r)}}if(a&&a.length){var p=(t+(1-r))/2;L(a,p,1-p,n,[])}}function F(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n.fixedrange)if(n.rangebreaks){var a=n._length,i=(n.p2l(0+t)-n.p2l(0)+(n.p2l(a+t)-n.p2l(a)))/2;n.range=[n.l2r(n._rl[0]-i),n.l2r(n._rl[1]-i)]}else n.range=[n.l2r(n._rl[0]-t/n._m),n.l2r(n._rl[1]-t/n._m)]}}function B(e){return 1-(e>=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function z(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function j(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function U(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),$(e,t,a,i)}function $(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function V(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(e){O&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),O=!1)}function W(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,N)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function H(e,t,r,n,i){for(var o,s,l,c,u=!1,f={},p={},h=(i||{}).xaHash,d=(i||{}).yaHash,m=0;m<t.length;m++){var g=t[m];for(o in r)if(g[o]){for(l in g)i&&(h[l]||d[l])||("x"===l.charAt(0)?r:n)[l]||(f[l]=o);for(s in n)i&&(h[s]||d[s])||!g[s]||(u=!0)}for(s in n)if(g[s])for(c in g)i&&(h[c]||d[c])||("x"===c.charAt(0)?r:n)[c]||(p[c]=s)}u&&(a.extendFlat(f,p),p={});var y={},v=[];for(l in f){var b=D(e,l);v.push(b),y[b._id]=b}var x={},_=[];for(c in p){var w=D(e,c);_.push(w),x[w._id]=w}return{xaHash:y,yaHash:x,xaxes:v,yaxes:_,xLinks:f,yLinks:p,isSubplotConstrained:u}}function G(e,t){if(s){var r=void 0!==e.onwheel?"wheel":"mousewheel";e._onwheel&&e.removeEventListener(r,e._onwheel),e._onwheel=t,e.addEventListener(r,t,{passive:!1})}else void 0!==e.onwheel?e.onwheel=t:void 0!==e.onmousewheel?e.onmousewheel=t:e.isAddedWheelEvent||(e.isAddedWheelEvent=!0,e.addEventListener("wheel",t,{passive:!1}))}function X(e){var t=[];for(var r in e)t.push(e[r]);return t}t.exports={makeDragBox:function(e,t,r,s,c,f,m,y){var O,I,$,Y,Z,K,J,Q,ee,te,re,ne,ae,ie,oe,se,le,ce,ue,fe,pe,he,de,me=e._fullLayout._zoomlayer,ge=m+y==="nsew",ye=1===(m+y).length;function ve(){if(O=t.xaxis,I=t.yaxis,ee=O._length,te=I._length,J=O._offset,Q=I._offset,($={})[O._id]=O,(Y={})[I._id]=I,m&&y)for(var r=t.overlays,n=0;n<r.length;n++){var a=r[n].xaxis;$[a._id]=a;var i=r[n].yaxis;Y[i._id]=i}Z=X($),K=X(Y),ae=R(Z,y),ie=R(K,m),oe=!ie&&!ae,ne=H(e,e._fullLayout._axisMatchGroups,$,Y);var o=(re=H(e,e._fullLayout._axisConstraintGroups,$,Y,ne)).isSubplotConstrained||ne.isSubplotConstrained;se=y||o,le=m||o;var s=e._fullLayout;ce=s._has("scattergl"),ue=s._has("splom"),fe=s._has("svg")}ve();var be=function(e,t,r){return e?"nsew"===e?r?"":"pan"===t?"move":"crosshair":e.toLowerCase()+"-resize":"pointer"}(ie+ae,e._fullLayout.dragmode,ge),xe=P(t,m+y+"drag",be,r,s,c,f);if(oe&&!ge)return xe.onmousedown=null,xe.style.pointerEvents="none",xe;var _e,we,ke,De,Te,Ae,Se,Me,Ee,Ce,Ne={element:xe,gd:e,plotinfo:t};function Oe(){Ne.plotinfo.selection=!1,A(e)}function Ie(e,r){var a=Ne.gd;if(a._fullLayout._activeShapeIndex>=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==e||ye||qe(),ge)o.indexOf("select")>-1&&S(r,a,Z,K,t.id,Ne),o.indexOf("event")>-1&&h.click(a,r,t.id);else if(1===e&&ye){var s=m?I:O,c="s"===m||"w"===y?0:1,f=s._name+".range["+c+"]",p=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(s,c),d="left",g="middle";if(s.fixedrange)return;m?(g="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===y&&(d="right"),a._context.showAxisRangeEntryBoxes&&n.select(xe).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(p),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:g}).on("edit",(function(e){var t=s.d2r(e);void 0!==t&&l.call("_guiRelayout",a,f,t)}))}}}function Pe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,he*t+_e)),a=Math.max(0,Math.min(te,de*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function s(){Se="",ke.r=ke.l,ke.t=ke.b,Ee.attr("d","M0,0Z")}if(ke.l=Math.min(_e,n),ke.r=Math.max(_e,n),ke.t=Math.min(we,a),ke.b=Math.max(we,a),re.isSubplotConstrained)i>N||o>N?(Se="xy",i/ee>o/te?(o=i*te/ee,we>a?ke.t=we-o:ke.b=we+o):(i=o*ee/te,_e>n?ke.l=_e-i:ke.r=_e+i),Ee.attr("d",W(ke))):s();else if(ne.isSubplotConstrained)if(i>N||o>N){Se="xy";var l=Math.min(ke.l/ee,(te-ke.b)/te),c=Math.max(ke.r/ee,(te-ke.t)/te);ke.l=l*ee,ke.r=c*ee,ke.b=(1-l)*te,ke.t=(1-c)*te,Ee.attr("d",W(ke))}else s();else!ie||o<Math.min(Math.max(.6*i,C),N)?i<C||!ae?s():(ke.t=0,ke.b=te,Se="x",Ee.attr("d",function(e,t){return"M"+(e.l-.5)+","+(t-N-.5)+"h-3v"+(2*N+1)+"h3ZM"+(e.r+.5)+","+(t-N-.5)+"h3v"+(2*N+1)+"h-3Z"}(ke,we))):!ae||i<Math.min(.6*o,N)?(ke.l=0,ke.r=ee,Se="y",Ee.attr("d",function(e,t){return"M"+(t-N-.5)+","+(e.t-.5)+"v-3h"+(2*N+1)+"v3ZM"+(t-N-.5)+","+(e.b+.5)+"v3h"+(2*N+1)+"v-3Z"}(ke,_e))):(Se="xy",Ee.attr("d",W(ke)));ke.w=ke.r-ke.l,ke.h=ke.b-ke.t,Se&&(Ce=!0),e._dragged=Ce,U(Me,Ee,ke,Te,Ae,De),Re(),e.emit("plotly_relayouting",pe),Ae=!0}function Re(){pe={},"xy"!==Se&&"x"!==Se||(L(Z,ke.l/ee,ke.r/ee,pe,re.xaxes),$e("x",pe)),"xy"!==Se&&"y"!==Se||(L(K,(te-ke.b)/te,(te-ke.t)/te,pe,re.yaxes),$e("y",pe))}function Le(){Re(),V(e),We(),q(e)}Ne.prepFn=function(t,r,n){var i=Ne.dragmode,s=e._fullLayout.dragmode;s!==i&&(Ne.dragmode=s),ve(),he=e._fullLayout._invScaleX,de=e._fullLayout._invScaleY,oe||(ge?t.shiftKey?"pan"===s?s="zoom":v(s)||(s="pan"):t.ctrlKey&&(s="pan"):s="pan"),b(s)?Ne.minDrag=1:Ne.minDrag=void 0,v(s)?(Ne.xaxes=Z,Ne.yaxes=K,T(t,r,n,Ne,s)):(Ne.clickFn=Ie,v(i)&&Oe(),oe||("zoom"===s?(Ne.moveFn=Pe,Ne.doneFn=Le,Ne.minDrag=1,function(t,r,n){var i=xe.getBoundingClientRect();_e=r-i.left,we=n-i.top,e._fullLayout._calcInverseTransform(e);var s=a.apply3DTransform(e._fullLayout._invTransform)(_e,we);_e=s[0],we=s[1],ke={l:_e,r:_e,w:0,t:we,b:we,h:0},De=e._hmpixcount?e._hmlumcount/e._hmpixcount:o(e._fullLayout.plot_bgcolor).getLuminance(),Ae=!1,Se="xy",Ce=!1,Me=z(me,De,J,Q,Te="M0,0H"+ee+"V"+te+"H0V0"),Ee=j(me,J,Q)}(0,r,n)):"pan"===s&&(Ne.moveFn=Ue,Ne.doneFn=We))),e._fullLayout._redrag=function(){var t=e._dragdata;if(t&&t.element===xe){var r=e._fullLayout.dragmode;v(r)||(ve(),He([0,0,ee,te]),Ne.moveFn(t.dx,t.dy))}}},g.init(Ne);var Fe=[0,0,ee,te],Be=null,ze=E.REDRAWDELAY,je=t.mainplot?e._fullLayout._plots[t.mainplot]:t;function Ue(t,r){if(t*=he,r*=de,!e._transitioningWithDuration){if(e._fullLayout._replotting=!0,"ew"===ae||"ns"===ie){var n=ae?-t:0,a=ie?-r:0;if(ne.isSubplotConstrained){if(ae&&ie){var i=(t/ee-r/te)/2;n=-(t=i*ee),a=-(r=-i*te)}ie?n=-a*ee/te:a=-n*te/ee}return ae&&(F(Z,t),$e("x")),ie&&(F(K,r),$e("y")),He([n,a,ee,te]),Ve(),void e.emit("plotly_relayouting",pe)}var o,s,l="w"===ae==("n"===ie)?1:-1;if(ae&&ie&&(re.isSubplotConstrained||ne.isSubplotConstrained)){var c=(t/ee+l*r/te)/2;t=c*ee,r=l*c*te}if("w"===ae?t=h(Z,0,t):"e"===ae?t=h(Z,1,-t):ae||(t=0),"n"===ie?r=h(K,1,r):"s"===ie?r=h(K,0,-r):ie||(r=0),o="w"===ae?t:0,s="n"===ie?r:0,re.isSubplotConstrained&&!ne.isSubplotConstrained||ne.isSubplotConstrained&&ae&&ie&&l>0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;u<Z.length;u++)Z[u].range=Z[u]._r.slice(),M(Z[u],1-r/te);o=(t=r*ee/te)/2}if(ne.isSubplotConstrained||!ie&&1===ae.length){for(u=0;u<K.length;u++)K[u].range=K[u]._r.slice(),M(K[u],1-t/ee);s=(r=t*te/ee)/2}}ne.isSubplotConstrained&&ie||$e("x"),ne.isSubplotConstrained&&ae||$e("y");var f=ee-t,p=te-r;!ne.isSubplotConstrained||ae&&ie||(ae?(s=o?0:t*te/ee,p=f*te/ee):(o=s?0:r*ee/te,f=p*ee/te)),He([o,s,f,p]),Ve(),e.emit("plotly_relayouting",pe)}function h(e,t,r){for(var n,a,i=1-t,o=0;o<e.length;o++){var s=e[o];if(!s.fixedrange){n=s,a=s._rl[i]+(s._rl[t]-s._rl[i])/B(r/s._length);var l=s.l2r(a);!1!==l&&void 0!==l&&(s.range[t]=l)}}return n._length*(n._rl[t]-a)/(n._rl[t]-n._rl[i])}}function $e(e,t){for(var r=ne.isSubplotConstrained?{x:K,y:Z}[e]:ne[e+"axes"],n=ne.isSubplotConstrained?{x:Z,y:K}[e]:[],a=0;a<r.length;a++){var i=r[a],o=i._id,s=ne.xLinks[o]||ne.yLinks[o],l=n[0]||$[s]||Y[s];l&&(t?(t[i._name+".range[0]"]=t[l._name+".range[0]"],t[i._name+".range[1]"]=t[l._name+".range[1]"]):i.range=l.range.slice())}}function Ve(){var t,r=[];function n(e){for(t=0;t<e.length;t++)e[t].fixedrange||r.push(e[t]._id)}for(se&&(n(Z),n(re.xaxes),n(ne.xaxes)),le&&(n(K),n(re.yaxes),n(ne.yaxes)),pe={},t=0;t<r.length;t++){var a=r[t],i=D(e,a);d.drawOne(e,i,{skipTitle:!0}),pe[i._name+".range[0]"]=i.range[0],pe[i._name+".range[1]"]=i.range[1]}d.redrawComponents(e,r)}function qe(){if(!e._transitioningWithDuration){var t=e._context.doubleClick,r=[];ae&&(r=r.concat(Z)),ie&&(r=r.concat(K)),ne.xaxes&&(r=r.concat(ne.xaxes)),ne.yaxes&&(r=r.concat(ne.yaxes));var n,a,i,o={};if("reset+autosize"===t)for(t="autosize",a=0;a<r.length;a++)if((n=r[a])._rangeInitial&&(n.range[0]!==n._rangeInitial[0]||n.range[1]!==n._rangeInitial[1])||!n._rangeInitial&&!n.autorange){t="reset";break}if("autosize"===t)for(a=0;a<r.length;a++)(n=r[a]).fixedrange||(o[n._name+".autorange"]=!0);else if("reset"===t)for((ae||re.isSubplotConstrained)&&(r=r.concat(re.xaxes)),ie&&!re.isSubplotConstrained&&(r=r.concat(re.yaxes)),re.isSubplotConstrained&&(ae?ie||(r=r.concat(K)):r=r.concat(Z)),a=0;a<r.length;a++)(n=r[a]).fixedrange||(n._rangeInitial?(i=n._rangeInitial,o[n._name+".range[0]"]=i[0],o[n._name+".range[1]"]=i[1]):o[n._name+".autorange"]=!0);e.emit("plotly_doubleclick",null),l.call("_guiRelayout",e,o)}}function We(){He([0,0,ee,te]),a.syncOrAsync([k.previousPromises,function(){e._fullLayout._replotting=!1,l.call("_guiRelayout",e,pe)}],e)}function He(t){var r,n,i,o,s=e._fullLayout,c=s._plots,u=s._subplots.cartesian;if(ue&&l.subplotsRegistry.splom.drag(e),ce)for(r=0;r<u.length;r++)if(i=(n=c[u[r]]).xaxis,o=n.yaxis,n._scene){var f=a.simpleMap(i.range,i.r2l),h=a.simpleMap(o.range,o.r2l);n._scene.update({range:[f[0],h[0],f[1],h[1]]})}if((ue||ce)&&(_(e),w(e)),fe){var d=t[2]/O._length,g=t[3]/I._length;for(r=0;r<u.length;r++){i=(n=c[u[r]]).xaxis,o=n.yaxis;var v,b,x,k,D=(se||ne.isSubplotConstrained)&&!i.fixedrange&&$[i._id],T=(le||ne.isSubplotConstrained)&&!o.fixedrange&&Y[o._id];if(D?(v=d,x=y||ne.isSubplotConstrained?t[0]:Ye(i,v)):ne.xaHash[i._id]?(v=d,x=t[0]*i._length/O._length):ne.yaHash[i._id]?(v=g,x="ns"===ie?-t[1]*i._length/I._length:Ye(i,v,{n:"top",s:"bottom"}[ie])):x=Xe(i,v=Ge(i,d,g)),T?(b=g,k=m||ne.isSubplotConstrained?t[1]:Ye(o,b)):ne.yaHash[o._id]?(b=g,k=t[1]*o._length/I._length):ne.xaHash[o._id]?(b=d,k="ew"===ae?-t[0]*o._length/O._length:Ye(o,b,{e:"right",w:"left"}[ae])):k=Xe(o,b=Ge(o,d,g)),v||b){v||(v=1),b||(b=1);var A=i._offset-x/v,S=o._offset-k/b;n.clipRect.call(p.setTranslate,x,k).call(p.setScale,v,b),n.plot.call(p.setTranslate,A,S).call(p.setScale,1/v,1/b),v===n.xScaleFactor&&b===n.yScaleFactor||(p.setPointGroupScale(n.zoomScalePts,v,b),p.setTextPointsScale(n.zoomScaleTxt,v,b)),p.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),n.xScaleFactor=v,n.yScaleFactor=b}}}}function Ge(e,t,r){return e.fixedrange?0:se&&re.xaHash[e._id]?t:le&&(re.isSubplotConstrained?re.xaHash:re.yaHash)[e._id]?r:0}function Xe(e,t){return t?(e.range=e._r.slice(),M(e,t),Ye(e,t)):0}function Ye(e,t,r){return e._length*(1-t)*x[r||e.constraintoward||"middle"]}return m.length*y.length!=1&&G(xe,(function(t){if(e._context._scrollZoom.cartesian||e._fullLayout._enablescrollzoom){if(Oe(),e._transitioningWithDuration)return t.preventDefault(),void t.stopPropagation();ve(),clearTimeout(Be);var r=-t.deltaY;if(isFinite(r)||(r=t.wheelDelta/10),isFinite(r)){var n,i=Math.exp(-Math.min(Math.max(r,-20),20)/200),o=je.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(t.clientX-o.left)/o.width,l=(o.bottom-t.clientY)/o.height;if(se){for(y||(s=.5),n=0;n<Z.length;n++)c(Z[n],s,i);$e("x"),Fe[2]*=i,Fe[0]+=Fe[2]*s*(1/i-1)}if(le){for(m||(l=.5),n=0;n<K.length;n++)c(K[n],l,i);$e("y"),Fe[3]*=i,Fe[1]+=Fe[3]*(1-l)*(1/i-1)}He(Fe),Ve(),e.emit("plotly_relayouting",pe),Be=setTimeout((function(){e._fullLayout&&(Fe=[0,0,ee,te],We())}),ze),t.preventDefault()}else a.log("Did not find wheel motion attributes: ",t)}function c(e,t,r){if(!e.fixedrange){var n=a.simpleMap(e.range,e.r2l),i=n[0]+(n[1]-n[0])*t;e.range=n.map((function(t){return e.l2r(i+(t-i)*r)}))}}})),xe},makeDragger:I,makeRectDragger:P,makeZoombox:z,makeCorners:j,updateZoombox:U,xyCorners:W,transitionZoombox:$,removeZoombox:V,showDoubleClickNotifier:q,attachWheelEventHandler:G}},{"../../components/color":366,"../../components/dragelement":385,"../../components/dragelement/helpers":384,"../../components/drawing":388,"../../components/fx":406,"../../constants/alignment":471,"../../lib":503,"../../lib/clear_gl_canvases":487,"../../lib/setcursor":524,"../../lib/svg_text_utils":529,"../../plot_api/subroutines":544,"../../registry":638,"../plots":619,"./axes":554,"./axis_ids":558,"./constants":561,"./scale_zoom":574,"./select":575,"@plotly/d3":58,"has-passive-events":229,tinycolor2:312}],564:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/fx"),i=e("../../components/dragelement"),o=e("../../lib/setcursor"),s=e("./dragbox").makeDragBox,l=e("./constants").DRAGGERSIZE;r.initInteractions=function(e){var t=e._fullLayout;if(e._context.staticPlot)n.select(e).selectAll(".drag").remove();else if(t._has("cartesian")||t._has("splom")){Object.keys(t._plots||{}).sort((function(e,r){if((t._plots[e].mainplot&&!0)===(t._plots[r].mainplot&&!0)){var n=e.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return t._plots[e].mainplot?1:-1})).forEach((function(r){var n=t._plots[r],o=n.xaxis,c=n.yaxis;if(!n.mainplot){var u=s(e,n,o._offset,c._offset,o._length,c._length,"ns","ew");u.onmousemove=function(t){e._fullLayout._rehover=function(){e._fullLayout._hoversubplot===r&&e._fullLayout._plots[r]&&a.hover(e,t,r)},a.hover(e,t,r),e._fullLayout._lasthover=u,e._fullLayout._hoversubplot=r},u.onmouseout=function(t){e._dragging||(e._fullLayout._hoversubplot=null,i.unhover(e,t))},e._context.showAxisDragHandles&&(s(e,n,o._offset-l,c._offset-l,l,l,"n","w"),s(e,n,o._offset+o._length,c._offset-l,l,l,"n","e"),s(e,n,o._offset-l,c._offset+c._length,l,l,"s","w"),s(e,n,o._offset+o._length,c._offset+c._length,l,l,"s","e"))}if(e._context.showAxisDragHandles){if(r===o._mainSubplot){var f=o._mainLinePosition;"top"===o.side&&(f-=l),s(e,n,o._offset+.1*o._length,f,.8*o._length,l,"","ew"),s(e,n,o._offset,f,.1*o._length,l,"","w"),s(e,n,o._offset+.9*o._length,f,.1*o._length,l,"","e")}if(r===c._mainSubplot){var p=c._mainLinePosition;"right"!==c.side&&(p-=l),s(e,n,p,c._offset+.1*c._length,l,.8*c._length,"ns",""),s(e,n,p,c._offset+.9*c._length,l,.1*c._length,"s",""),s(e,n,p,c._offset,l,.1*c._length,"n","")}}}));var o=t._hoverlayer.node();o.onmousemove=function(r){r.target=e._fullLayout._lasthover,a.hover(e,r,t._hoversubplot)},o.onclick=function(t){t.target=e._fullLayout._lasthover,a.click(e,t)},o.onmousedown=function(t){e._fullLayout._lasthover.onmousedown(t)},r.updateFx(e)}},r.updateFx=function(e){var t=e._fullLayout,r="pan"===t.dragmode?"move":"crosshair";o(t._draggers,r)}},{"../../components/dragelement":385,"../../components/fx":406,"../../lib/setcursor":524,"./constants":561,"./dragbox":563,"@plotly/d3":58}],565:[function(e,t,r){"use strict";t.exports={clearOutlineControllers:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".outline-controllers").remove()},clearSelect:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".select-outline").remove(),e._fullLayout._drawing=!1}}},{}],566:[function(e,t,r){"use strict";var n=e("../../lib").strTranslate;function a(e,t){switch(e.type){case"log":return e.p2d(t);case"date":return e.p2r(t,0,e.calendar);default:return e.p2r(t)}}t.exports={p2r:a,r2p:function(e,t){switch(e.type){case"log":return e.d2p(t);case"date":return e.r2p(t,0,e.calendar);default:return e.r2p(t)}},axValue:function(e){var t="y"===e._id.charAt(0)?1:0;return function(r){return a(e,r[t])}},getTransform:function(e){return n(e.xaxis._offset,e.yaxis._offset)}}},{"../../lib":503}],567:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("./axis_ids");t.exports=function(e){return function(t,r){var o=t[e];if(Array.isArray(o))for(var s=n.subplotsRegistry.cartesian,l=s.idRegex,c=r._subplots,u=c.xaxis,f=c.yaxis,p=c.cartesian,h=r._has("cartesian")||r._has("gl2d"),d=0;d<o.length;d++){var m=o[d];if(a.isPlainObject(m)){var g=i.cleanId(m.xref,"x",!1),y=i.cleanId(m.yref,"y",!1),v=l.x.test(g),b=l.y.test(y);if(v||b){h||a.pushUnique(r._basePlotModules,s);var x=!1;v&&-1===u.indexOf(g)&&(u.push(g),x=!0),b&&-1===f.indexOf(y)&&(f.push(y),x=!0),x&&v&&b&&p.push(g+y)}}}}}},{"../../lib":503,"../../registry":638,"./axis_ids":558}],568:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=e("../plots"),s=e("../../components/drawing"),l=e("../get_data").getModuleCalcData,c=e("./axis_ids"),u=e("./constants"),f=e("../../constants/xmlns_namespaces"),p=i.ensureSingle;function h(e,t,r){return i.ensureSingle(e,t,r,(function(e){e.datum(r)}))}function d(e,t,r,i,o){for(var c,f,p,h=u.traceLayerClasses,d=e._fullLayout,m=d._modules,g=[],y=[],v=0;v<m.length;v++){var b=(c=m[v]).name,x=a.modules[b].categories;if(x.svg){var _=c.layerName||b+"layer",w=c.plot;p=(f=l(r,w))[0],r=f[1],p.length&&g.push({i:h.indexOf(_),className:_,plotMethod:w,cdModule:p}),x.zoomScale&&y.push("."+_)}}g.sort((function(e,t){return e.i-t.i}));var k=t.plot.selectAll("g.mlayer").data(g,(function(e){return e.className}));if(k.enter().append("g").attr("class",(function(e){return e.className})).classed("mlayer",!0).classed("rangeplot",t.isRangePlot),k.exit().remove(),k.order(),k.each((function(r){var a=n.select(this),l=r.className;r.plotMethod(e,t,r.cdModule,a,i,o),-1===u.clipOnAxisFalseQuery.indexOf("."+l)&&s.setClipUrl(a,t.layerClipId,e)})),d._has("scattergl")&&(c=a.getModule("scattergl"),p=l(r,c)[0],c.plot(e,t,p)),!e._context.staticPlot&&(t._hasClipOnAxisFalse&&(t.clipOnAxisFalseTraces=t.plot.selectAll(u.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),y.length)){var D=t.plot.selectAll(y.join(",")).selectAll(".trace");t.zoomScalePts=D.selectAll("path.point"),t.zoomScaleTxt=D.selectAll(".textpoint")}}function m(e,t){var r=t.plotgroup,n=t.id,a=u.layerValue2layerClass[t.xaxis.layer],i=u.layerValue2layerClass[t.yaxis.layer],o=e._fullLayout._hasOnlyLargeSploms;if(t.mainplot){var s=t.mainplotinfo,l=s.plotgroup,f=n+"-x",d=n+"-y";t.gridlayer=s.gridlayer,t.zerolinelayer=s.zerolinelayer,p(s.overlinesBelow,"path",f),p(s.overlinesBelow,"path",d),p(s.overaxesBelow,"g",f),p(s.overaxesBelow,"g",d),t.plot=p(s.overplot,"g",n),p(s.overlinesAbove,"path",f),p(s.overlinesAbove,"path",d),p(s.overaxesAbove,"g",f),p(s.overaxesAbove,"g",d),t.xlines=l.select(".overlines-"+a).select("."+f),t.ylines=l.select(".overlines-"+i).select("."+d),t.xaxislayer=l.select(".overaxes-"+a).select("."+f),t.yaxislayer=l.select(".overaxes-"+i).select("."+d)}else if(o)t.xlines=p(r,"path","xlines-above"),t.ylines=p(r,"path","ylines-above"),t.xaxislayer=p(r,"g","xaxislayer-above"),t.yaxislayer=p(r,"g","yaxislayer-above");else{var m=p(r,"g","layer-subplot");t.shapelayer=p(m,"g","shapelayer"),t.imagelayer=p(m,"g","imagelayer"),t.gridlayer=p(r,"g","gridlayer"),t.zerolinelayer=p(r,"g","zerolinelayer"),p(r,"path","xlines-below"),p(r,"path","ylines-below"),t.overlinesBelow=p(r,"g","overlines-below"),p(r,"g","xaxislayer-below"),p(r,"g","yaxislayer-below"),t.overaxesBelow=p(r,"g","overaxes-below"),t.plot=p(r,"g","plot"),t.overplot=p(r,"g","overplot"),t.xlines=p(r,"path","xlines-above"),t.ylines=p(r,"path","ylines-above"),t.overlinesAbove=p(r,"g","overlines-above"),p(r,"g","xaxislayer-above"),p(r,"g","yaxislayer-above"),t.overaxesAbove=p(r,"g","overaxes-above"),t.xlines=r.select(".xlines-"+a),t.ylines=r.select(".ylines-"+i),t.xaxislayer=r.select(".xaxislayer-"+a),t.yaxislayer=r.select(".yaxislayer-"+i)}o||(h(t.gridlayer,"g",t.xaxis._id),h(t.gridlayer,"g",t.yaxis._id),t.gridlayer.selectAll("g").map((function(e){return e[0]})).sort(c.idSort)),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0)}function g(e,t){if(e){var r={};for(var a in e.each((function(e){var a=e[0];n.select(this).remove(),y(a,t),r[a]=!0})),t._plots)for(var i=t._plots[a].overlays||[],o=0;o<i.length;o++){var s=i[o];r[s.id]&&s.plot.selectAll(".trace").remove()}}}function y(e,t){t._draggers.selectAll("g."+e).remove(),t._defs.select("#clip"+t._uid+e+"plot").remove()}r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=u.idRegex,r.attrRegex=u.attrRegex,r.attributes=e("./attributes"),r.layoutAttributes=e("./layout_attributes"),r.supplyLayoutDefaults=e("./layout_defaults"),r.transitionAxes=e("./transition_axes"),r.finalizeSubplots=function(e,t){var r,n,a,o=t._subplots,s=o.xaxis,l=o.yaxis,f=o.cartesian,p=f.concat(o.gl2d||[]),h={},d={};for(r=0;r<p.length;r++){var m=p[r].split("y");h[m[0]]=1,d["y"+m[1]]=1}for(r=0;r<s.length;r++)h[n=s[r]]||(a=(e[c.id2name(n)]||{}).anchor,u.idRegex.y.test(a)||(a="y"),f.push(n+a),p.push(n+a),d[a]||(d[a]=1,i.pushUnique(l,a)));for(r=0;r<l.length;r++)d[a=l[r]]||(n=(e[c.id2name(a)]||{}).anchor,u.idRegex.x.test(n)||(n="x"),f.push(n+a),p.push(n+a),h[n]||(h[n]=1,i.pushUnique(s,n)));if(!p.length){for(var g in n="",a="",e)u.attrRegex.test(g)&&("x"===g.charAt(0)?(!n||+g.substr(5)<+n.substr(5))&&(n=g):(!a||+g.substr(5)<+a.substr(5))&&(a=g));n=n?c.name2id(n):"x",a=a?c.name2id(a):"y",s.push(n),l.push(a),f.push(n+a)}},r.plot=function(e,t,r,n){var a,i=e._fullLayout,o=i._subplots.cartesian,s=e.calcdata;if(!Array.isArray(t))for(t=[],a=0;a<s.length;a++)t.push(a);for(a=0;a<o.length;a++){for(var l,c=o[a],u=i._plots[c],f=[],p=0;p<s.length;p++){var h=s[p],m=h[0].trace;m.xaxis+m.yaxis===c&&((-1!==t.indexOf(m.index)||m.carpet)&&(l&&l[0].trace.xaxis+l[0].trace.yaxis===c&&-1!==["tonextx","tonexty","tonext"].indexOf(m.fill)&&-1===f.indexOf(l)&&f.push(l),f.push(h)),l=h)}d(e,u,f,r,n)}},r.clean=function(e,t,r,n){var a,i,o,s=n._plots||{},l=t._plots||{},u=n._subplots||{};if(n._hasOnlyLargeSploms&&!t._hasOnlyLargeSploms)for(o in s)(a=s[o]).plotgroup&&a.plotgroup.remove();var f=n._has&&n._has("gl"),p=t._has&&t._has("gl");if(f&&!p)for(o in s)(a=s[o])._scene&&a._scene.destroy();if(u.xaxis&&u.yaxis){var h=c.listIds({_fullLayout:n});for(i=0;i<h.length;i++){var d=h[i];t[c.id2name(d)]||n._infolayer.selectAll(".g-"+d+"title").remove()}}var m=n._has&&n._has("cartesian"),v=t._has&&t._has("cartesian");if(m&&!v)g(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups,delete n._axisMatchGroups;else if(u.cartesian)for(i=0;i<u.cartesian.length;i++){var b=u.cartesian[i];if(!l[b]){var x="."+b+",."+b+"-x,."+b+"-y";n._cartesianlayer.selectAll(x).remove(),y(b,n)}}},r.drawFramework=function(e){var t=e._fullLayout,r=function(e){var t,r,n,a,i,o,s=e._fullLayout,l=s._subplots.cartesian,c=l.length,u=[],f=[];for(t=0;t<c;t++){n=l[t],i=(a=s._plots[n]).xaxis,o=a.yaxis;var p=i._mainAxis,h=o._mainAxis,d=p._id+h._id,m=s._plots[d];a.overlays=[],d!==n&&m?(a.mainplot=d,a.mainplotinfo=m,f.push(n)):(a.mainplot=void 0,a.mainplotinfo=void 0,u.push(n))}for(t=0;t<f.length;t++)n=f[t],(a=s._plots[n]).mainplotinfo.overlays.push(a);var g=u.concat(f),y=new Array(c);for(t=0;t<c;t++){n=g[t],i=(a=s._plots[n]).xaxis,o=a.yaxis;var v=[n,i.layer,o.layer,i.overlaying||"",o.overlaying||""];for(r=0;r<a.overlays.length;r++)v.push(a.overlays[r].id);y[t]=v}return y}(e),a=t._cartesianlayer.selectAll(".subplot").data(r,String);a.enter().append("g").attr("class",(function(e){return"subplot "+e[0]})),a.order(),a.exit().call(g,t),a.each((function(r){var a=r[0],i=t._plots[a];i.plotgroup=n.select(this),m(e,i),i.draglayer=p(t._draggers,"g",a)}))},r.rangePlot=function(e,t,r){m(e,t),d(e,t,r),o.style(e)},r.toSVG=function(e){var t=e._fullLayout._glimages,r=n.select(e).selectAll(".svg-container");r.filter((function(e,t){return t===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this.toDataURL("image/png");t.append("svg:image").attr({xmlns:f.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})}))},r.updateFx=e("./graph_interact").updateFx},{"../../components/drawing":388,"../../constants/xmlns_namespaces":480,"../../lib":503,"../../registry":638,"../get_data":593,"../plots":619,"./attributes":552,"./axis_ids":558,"./constants":561,"./graph_interact":564,"./layout_attributes":569,"./layout_defaults":570,"./transition_axes":581,"@plotly/d3":58}],569:[function(e,t,r){"use strict";var n=e("../font_attributes"),a=e("../../components/color/attributes"),i=e("../../components/drawing/attributes").dash,o=e("../../lib/extend").extendFlat,s=e("../../plot_api/plot_template").templatedArray,l=e("../../plots/cartesian/axis_format_attributes").descriptionWithDates,c=e("../../constants/numerical").ONEDAY,u=e("./constants"),f=u.HOUR_PATTERN,p=u.WEEKDAY_PATTERN;t.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:a.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:n({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},scaleanchor:{valType:"enumerated",values:[u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"calc"},rangebreaks:s("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[p,f,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:c},editType:"calc"}),tickmode:{valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},nticks:{valType:"integer",min:0,dflt:0,editType:"ticks"},tick0:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},dtick:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},tickvals:{valType:"data_array",editType:"ticks"},ticktext:{valType:"data_array",editType:"ticks"},ticks:{valType:"enumerated",values:["outside","inside",""],editType:"ticks"},tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:{valType:"number",min:0,dflt:5,editType:"ticks"},tickwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},tickcolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},automargin:{valType:"boolean",dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:o({},i,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:n({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:l("tick label")},tickformatstops:s("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:l("hover text")},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:a.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:{valType:"boolean",editType:"ticks"},gridcolor:{valType:"color",dflt:a.lightLine,editType:"ticks"},gridwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc",_deprecated:{autotick:{valType:"boolean",editType:"ticks"},title:{valType:"string",editType:"ticks"},titlefont:n({editType:"ticks"})}}},{"../../components/color/attributes":365,"../../components/drawing/attributes":387,"../../constants/numerical":479,"../../lib/extend":493,"../../plot_api/plot_template":543,"../../plots/cartesian/axis_format_attributes":557,"../font_attributes":585,"./constants":561}],570:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../../components/fx/helpers").isUnifiedHover,o=e("../../components/fx/hovermode_defaults"),s=e("../../plot_api/plot_template"),l=e("../layout_attributes"),c=e("./layout_attributes"),u=e("./type_defaults"),f=e("./axis_defaults"),p=e("./constraints"),h=e("./position_defaults"),d=e("./axis_ids"),m=d.id2name,g=d.name2id,y=e("./constants").AX_ID_PATTERN,v=e("../../registry"),b=v.traceIs,x=v.getComponentMethod;function _(e,t,r){Array.isArray(e[t])?e[t].push(r):e[t]=[r]}t.exports=function(e,t,r){var v,w,k=t.autotypenumbers,D={},T={},A={},S={},M={},E={},C={},N={},O={},I={};for(v=0;v<r.length;v++){var P=r[v];if(b(P,"cartesian")||b(P,"gl2d")){var R,L;if(P.xaxis)R=m(P.xaxis),_(D,R,P);else if(P.xaxes)for(w=0;w<P.xaxes.length;w++)_(D,m(P.xaxes[w]),P);if(P.yaxis)L=m(P.yaxis),_(D,L,P);else if(P.yaxes)for(w=0;w<P.yaxes.length;w++)_(D,m(P.yaxes[w]),P);"funnel"===P.type?"h"===P.orientation?(R&&(T[R]=!0),L&&(C[L]=!0)):L&&(A[L]=!0):"image"===P.type?(L&&(N[L]=!0),R&&(N[R]=!0)):(L&&(M[L]=!0,E[L]=!0),b(P,"carpet")&&("carpet"!==P.type||P._cheater)||R&&(S[R]=!0)),"carpet"===P.type&&P._cheater&&R&&(T[R]=!0),b(P,"2dMap")&&(O[R]=!0,O[L]=!0),b(P,"oriented")&&(I["h"===P.orientation?L:R]=!0)}}var F=t._subplots,B=F.xaxis,z=F.yaxis,j=n.simpleMap(B,m),U=n.simpleMap(z,m),$=j.concat(U),V=a.background;B.length&&z.length&&(V=n.coerce(e,t,l,"plot_bgcolor"));var q,W,H,G,X,Y=a.combine(V,t.paper_bgcolor);function Z(){var e=D[q]||[];X._traceIndices=e.map((function(e){return e._expandedIndex})),X._annIndices=[],X._shapeIndices=[],X._imgIndices=[],X._subplotsWith=[],X._counterAxes=[],X._name=X._attr=q,X._id=W}function K(e,t){return n.coerce(G,X,c,e,t)}function J(e,t){return n.coerce2(G,X,c,e,t)}function Q(e){return"x"===e?z:B}function ee(t,r){for(var n="x"===t?j:U,a=[],i=0;i<n.length;i++){var o=n[i];o===r||(e[o]||{}).overlaying||a.push(g(o))}return a}var te={x:Q("x"),y:Q("y")},re=te.x.concat(te.y),ne={},ae=[];function ie(){var e=G.matches;y.test(e)&&-1===re.indexOf(e)&&(ne[e]=G.type,ae=Object.keys(ne))}var oe=o(e,t),se=i(oe);for(v=0;v<$.length;v++){q=$[v],W=g(q),H=q.charAt(0),n.isPlainObject(e[q])||(e[q]={}),G=e[q],X=s.newContainer(t,q,H+"axis"),Z();var le="x"===H&&!S[q]&&T[q]||"y"===H&&!M[q]&&A[q],ce="y"===H&&(!E[q]&&C[q]||N[q]),ue={letter:H,font:t.font,outerTicks:O[q],showGrid:!I[q],data:D[q]||[],bgColor:Y,calendar:t.calendar,automargin:!0,visibleDflt:le,reverseDflt:ce,autotypenumbersDflt:k,splomStash:((t._splomAxes||{})[H]||{})[W]};K("uirevision",t.uirevision),u(G,X,K,ue),f(G,X,K,ue,t);var fe=se&&H===oe.charAt(0),pe=J("spikecolor",se?X.color:void 0),he=J("spikethickness",se?1.5:void 0),de=J("spikedash",se?"dot":void 0),me=J("spikemode",se?"across":void 0),ge=J("spikesnap");K("showspikes",!!(fe||pe||he||de||me||ge))||(delete X.spikecolor,delete X.spikethickness,delete X.spikedash,delete X.spikemode,delete X.spikesnap),h(G,X,K,{letter:H,counterAxes:te[H],overlayableAxes:ee(H,q),grid:t.grid}),K("title.standoff"),ie(),X._input=G}for(v=0;v<ae.length;){W=ae[v++],H=(q=m(W)).charAt(0),n.isPlainObject(e[q])||(e[q]={}),G=e[q],X=s.newContainer(t,q,H+"axis"),Z();var ye={letter:H,font:t.font,outerTicks:O[q],showGrid:!I[q],data:[],bgColor:Y,calendar:t.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:k,splomStash:((t._splomAxes||{})[H]||{})[W]};K("uirevision",t.uirevision),X.type=ne[W]||"linear",f(G,X,K,ye,t),h(G,X,K,{letter:H,counterAxes:te[H],overlayableAxes:ee(H,q),grid:t.grid}),K("fixedrange"),ie(),X._input=G}var ve=x("rangeslider","handleDefaults"),be=x("rangeselector","handleDefaults");for(v=0;v<j.length;v++)q=j[v],G=e[q],X=t[q],ve(e,t,q),"date"===X.type&&be(G,X,t,U,X.calendar),K("fixedrange");for(v=0;v<U.length;v++){q=U[v],G=e[q],X=t[q];var xe=t[m(X.anchor)];K("fixedrange",x("rangeslider","isVisible")(xe))}p.handleDefaults(e,t,{axIds:re.concat(ae).sort(d.idSort),axHasImage:N})}},{"../../components/color":366,"../../components/fx/helpers":402,"../../components/fx/hovermode_defaults":405,"../../lib":503,"../../plot_api/plot_template":543,"../../registry":638,"../layout_attributes":610,"./axis_defaults":556,"./axis_ids":558,"./constants":561,"./constraints":562,"./layout_attributes":569,"./position_defaults":572,"./type_defaults":582}],571:[function(e,t,r){"use strict";var n=e("tinycolor2").mix,a=e("../../components/color/attributes").lightFraction,i=e("../../lib");t.exports=function(e,t,r,o){var s=(o=o||{}).dfltColor;function l(r,n){return i.coerce2(e,t,o.attributes,r,n)}var c=l("linecolor",s),u=l("linewidth");r("showline",o.showLine||!!c||!!u)||(delete t.linecolor,delete t.linewidth);var f=l("gridcolor",n(s,o.bgColor,o.blend||a).toRgbString()),p=l("gridwidth");if(r("showgrid",o.showGrid||!!f||!!p)||(delete t.gridcolor,delete t.gridwidth),!o.noZeroLine){var h=l("zerolinecolor",s),d=l("zerolinewidth");r("zeroline",o.showGrid||!!h||!!d)||(delete t.zerolinecolor,delete t.zerolinewidth)}}},{"../../components/color/attributes":365,"../../lib":503,tinycolor2:312}],572:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib");t.exports=function(e,t,r,i){var o,s,l,c,u=i.counterAxes||[],f=i.overlayableAxes||[],p=i.letter,h=i.grid;h&&(s=h._domains[p][h._axisMap[t._id]],o=h._anchors[t._id],s&&(l=h[p+"side"].split(" ")[0],c=h.domain[p]["right"===l||"top"===l?1:0])),s=s||[0,1],o=o||(n(e.position)?"free":u[0]||"free"),l=l||("x"===p?"bottom":"left"),c=c||0,"free"===a.coerce(e,t,{anchor:{valType:"enumerated",values:["free"].concat(u),dflt:o}},"anchor")&&r("position",c),a.coerce(e,t,{side:{valType:"enumerated",values:"x"===p?["bottom","top"]:["left","right"],dflt:l}},"side");var d=!1;if(f.length&&(d=a.coerce(e,t,{overlaying:{valType:"enumerated",values:[!1].concat(f),dflt:!1}},"overlaying")),!d){var m=r("domain",s);m[0]>m[1]-1/4096&&(t.domain=s),a.noneOrAll(e.domain,t.domain,s)}return r("layer"),t}},{"../../lib":503,"fast-isnumeric":190}],573:[function(e,t,r){"use strict";var n=e("./show_dflt");t.exports=function(e,t,r,a,i){i||(i={});var o=i.tickSuffixDflt,s=n(e);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},{"./show_dflt":577}],574:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":471}],575:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),s=e("../../components/fx"),l=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,p=c.drawMode,h=c.openMode,d=c.selectMode,m=e("../../components/shapes/draw_newshape/display_outlines"),g=e("../../components/shapes/draw_newshape/helpers").handleEllipse,y=e("../../components/shapes/draw_newshape/newshapes"),v=e("../../lib"),b=e("../../lib/polygon"),x=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),k=e("../../plot_api/subroutines").redrawReglTraces,D=e("./constants"),T=D.MINSELECT,A=b.filter,S=b.tester,M=e("./handle_outline").clearSelect,E=e("./helpers"),C=E.p2r,N=E.axValue,O=E.getTransform;function I(e,t,r,n,a,i,o){var s,l,c,u,f,p,d,g,y,v=t._hoverdata,b=t._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n<t.length;n++)if(r=t[n],a.fullData._expandedIndex===r.cd[0].trace._expandedIndex){if(!0===a.hoverOnBox)break;void 0!==a.pointNumber?i=a.pointNumber:void 0!==a.binNumber&&(i=a.binNumber,o=a.pointNumbers);break}return{pointNumber:i,pointNumbers:o,searchInfo:r}}(v,s=z(t,r,n,a));if(_.pointNumbers.length>0?function(e,t){var r,n,a,i=[];for(a=0;a<e.length;a++)(r=e[a]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a<t.pointNumbers.length;a++)if(n.selectedpoints.indexOf(t.pointNumbers[a])<0)return!1;return!0}return!1}(s,_):function(e){var t,r,n=0;for(r=0;r<e.length;r++)if((t=e[r].cd[0].trace).selectedpoints){if(t.selectedpoints.length>1)return!1;if((n+=t.selectedpoints.length)>1)return!1}return 1===n}(s)&&(p=j(_))){for(o&&o.remove(),y=0;y<s.length;y++)(l=s[y])._module.selectPoints(l,!1);U(t,s),B(i),b&&t.emit("plotly_deselect",null)}else{for(d=e.shiftKey&&(void 0!==p?p:j(_)),c=function(e,t,r){return{pointNumber:e,searchInfo:t,subtract:r}}(_.pointNumber,_.searchInfo,d),u=L(i.selectionDefs.concat([c])),y=0;y<s.length;y++)if(f=$(s[y]._module.selectPoints(s[y],u),s[y]),x.length)for(var w=0;w<f.length;w++)x.push(f[w]);else x=f;if(U(t,s,g={points:x}),c&&i&&i.selectionDefs.push(c),o){var k=i.mergedPolygons,D=h(i.dragmode);m(V(k,D),o,i)}b&&t.emit("plotly_selected",g)}}}function P(e){return"pointNumber"in e&&"searchInfo"in e}function R(e){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(t,r,n,a){var i=e.searchInfo.cd[0].trace._expandedIndex;return a.cd[0].trace._expandedIndex===i&&n===e.pointNumber},isRect:!1,degenerate:!1,subtract:e.subtract}}function L(e){for(var t=[],r=P(e[0])?0:e[0][0][0],n=r,a=P(e[0])?0:e[0][0][1],i=a,o=0;o<e.length;o++)if(P(e[o]))t.push(R(e[o]));else{var s=b.tester(e[o]);s.subtract=e[o].subtract,t.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),a=Math.min(a,s.ymin),i=Math.max(i,s.ymax)}return{xmin:r,xmax:n,ymin:a,ymax:i,pts:[],contains:function(e,r,n,a){for(var i=!1,o=0;o<t.length;o++)t[o].contains(e,r,n,a)&&(i=!1===t[o].subtract);return i},isRect:!1,degenerate:!1}}function F(e,t,r){t._fullLayout._drawing=!1;var n=t._fullLayout,a=r.plotinfo,i=r.dragmode,o=n._lastSelectedSubplot&&n._lastSelectedSubplot===a.id,s=(e.shiftKey||e.altKey)&&!(p(i)&&h(i));o&&s&&a.selection&&a.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=a.selection.selectionDefs,r.mergedPolygons=a.selection.mergedPolygons):s&&a.selection||B(r),o||(M(t),n._lastSelectedSubplot=a.id)}function B(e){var t=e.dragmode,r=e.plotinfo,n=e.gd;if(n._fullLayout._activeShapeIndex>=0&&n._fullLayout._deactivateShape(n),p(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=y(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function z(e,t,r,n){var a,i,o,s=[],l=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o<e.calcdata.length;o++)if(!0===(i=(a=e.calcdata[o])[0].trace).visible&&i._module&&i._module.selectPoints)if(!n||i.subplot!==n&&i.geo!==n)if("splom"===i.type&&i._xaxes[l[0]]&&i._yaxes[c[0]]){var u=p(i._module,a,t[0],r[0]);u.scene=e._fullLayout._splomScenes[i.uid],s.push(u)}else if("sankey"===i.type){var f=p(i._module,a,t[0],r[0]);s.push(f)}else{if(-1===l.indexOf(i.xaxis))continue;if(-1===c.indexOf(i.yaxis))continue;s.push(p(i._module,a,_(e,i.xaxis),_(e,i.yaxis)))}else s.push(p(i._module,a,t[0],r[0]));return s;function p(e,t,r,n){return{_module:e,cd:t,xaxis:r,yaxis:n}}}function j(e){var t=e.searchInfo.cd[0].trace,r=e.pointNumber,n=e.pointNumbers,a=n.length>0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function U(e,t,r){var n,i,o,s;for(n=0;n<t.length;n++){var l=t[n].cd[0].trace._fullInput,c=e._fullLayout._tracePreGUI[l.uid]||{};void 0===c.selectedpoints&&(c.selectedpoints=l._input.selectedpoints||null)}if(r){var u=r.points||[];for(n=0;n<t.length;n++)(s=t[n].cd[0].trace)._input.selectedpoints=s._fullInput.selectedpoints=[],s._fullInput!==s&&(s.selectedpoints=[]);for(n=0;n<u.length;n++){var f=u[n],p=f.data,h=f.fullData;f.pointIndices?([].push.apply(p.selectedpoints,f.pointIndices),s._fullInput!==s&&[].push.apply(h.selectedpoints,f.pointIndices)):(p.selectedpoints.push(f.pointIndex),s._fullInput!==s&&h.selectedpoints.push(f.pointIndex))}}else for(n=0;n<t.length;n++)delete(s=t[n].cd[0].trace).selectedpoints,delete s._input.selectedpoints,s._fullInput!==s&&delete s._fullInput.selectedpoints;var d=!1;for(n=0;n<t.length;n++){s=(o=(i=t[n]).cd)[0].trace,a.traceIs(s,"regl")&&(d=!0);var m=i._module,g=m.styleOnSelect||m.style;g&&(g(e,o,o[0].node3),o[0].nodeRangePlot3&&g(e,o,o[0].nodeRangePlot3))}d&&(w(e),k(e))}function $(e,t){if(Array.isArray(e))for(var r=t.cd,n=t.cd[0].trace,a=0;a<e.length;a++)e[a]=l(e[a],n,r);return e}function V(e,t){for(var r=[],n=0;n<e.length;n++){r[n]=[];for(var a=0;a<e[n].length;a++){r[n][a]=[],r[n][a][0]=a?"L":"M";for(var i=0;i<e[n][a].length;i++)r[n][a].push(e[n][a][i])}t||r[n].push(["Z",r[n][0][1],r[n][0][2]])}return r}t.exports={prepSelect:function(e,t,r,a,l){var c=u(l),y=f(l),b=h(l),_=p(l),w=d(l),k="drawcircle"===l,M="drawline"===l||k,E=a.gd,P=E._fullLayout,R=P._zoomlayer,j=a.element.getBoundingClientRect(),q=a.plotinfo,W=O(q),H=t-j.left,G=r-j.top;P._calcInverseTransform(E);var X=v.apply3DTransform(P._invTransform)(H,G);H=X[0],G=X[1];var Y,Z,K,J,Q,ee,te,re=P._invScaleX,ne=P._invScaleY,ae=H,ie=G,oe="M"+H+","+G,se=a.xaxes[0]._length,le=a.yaxes[0]._length,ce=a.xaxes.concat(a.yaxes),ue=e.altKey&&!(p(l)&&b);F(e,E,a),c&&(Y=A([[H,G]],D.BENDPX));var fe=R.selectAll("path.select-outline-"+q.id).data(_?[0]:[1,2]),pe=P.newshape;fe.enter().append("path").attr("class",(function(e){return"select-outline select-outline-"+e+" select-outline-"+q.id})).style(_?{opacity:pe.opacity/2,fill:b?void 0:pe.fillcolor,stroke:pe.line.color,"stroke-dasharray":i(pe.line.dash,pe.line.width),"stroke-width":pe.line.width+"px"}:{}).attr("fill-rule",pe.fillrule).classed("cursor-move",!!_).attr("transform",W).attr("d",oe+"Z");var he,de=R.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform",W).attr("d","M0,0Z"),me=P._uid+D.SELECTID,ge=[],ye=z(E,a.xaxes,a.yaxes,a.subplot);function ve(e,t){return e-t}he=q.fillRangeItems?q.fillRangeItems:y?function(e,t){var r=e.range={};for(Q=0;Q<ce.length;Q++){var n=ce[Q],a=n._id.charAt(0);r[n._id]=[C(n,t[a+"min"]),C(n,t[a+"max"])].sort(ve)}}:function(e,t,r){var n=e.lassoPoints={};for(Q=0;Q<ce.length;Q++){var a=ce[Q];n[a._id]=r.filtered.map(N(a))}},a.moveFn=function(e,t){ae=Math.max(0,Math.min(se,re*e+H)),ie=Math.max(0,Math.min(le,ne*t+G));var r=Math.abs(ae-H),i=Math.abs(ie-G);if(y){var o,s,l;if(w){var u=P.selectdirection;switch(o="any"===u?i<Math.min(.6*r,T)?"h":r<Math.min(.6*i,T)?"v":"d":u){case"h":s=k?le/2:0,l=le;break;case"v":s=k?se/2:0,l=se}}if(_)switch(P.newshape.drawdirection){case"vertical":o="h",s=k?le/2:0,l=le;break;case"horizontal":o="v",s=k?se/2:0,l=se;break;case"ortho":r<i?(o="h",s=G,l=ie):(o="v",s=H,l=ae);break;default:o="d"}"h"===o?((J=M?g(k,[ae,s],[ae,l]):[[H,s],[H,l],[ae,l],[ae,s]]).xmin=M?ae:Math.min(H,ae),J.xmax=M?ae:Math.max(H,ae),J.ymin=Math.min(s,l),J.ymax=Math.max(s,l),de.attr("d","M"+J.xmin+","+(G-T)+"h-4v"+2*T+"h4ZM"+(J.xmax-1)+","+(G-T)+"h4v"+2*T+"h-4Z")):"v"===o?((J=M?g(k,[s,ie],[l,ie]):[[s,G],[s,ie],[l,ie],[l,G]]).xmin=Math.min(s,l),J.xmax=Math.max(s,l),J.ymin=M?ie:Math.min(G,ie),J.ymax=M?ie:Math.max(G,ie),de.attr("d","M"+(H-T)+","+J.ymin+"v-4h"+2*T+"v4ZM"+(H-T)+","+(J.ymax-1)+"v4h"+2*T+"v-4Z")):"d"===o&&((J=M?g(k,[H,G],[ae,ie]):[[H,G],[H,ie],[ae,ie],[ae,G]]).xmin=Math.min(H,ae),J.xmax=Math.max(H,ae),J.ymin=Math.min(G,ie),J.ymax=Math.max(G,ie),de.attr("d","M0,0Z"))}else c&&(Y.addPt([ae,ie]),J=Y.filtered);a.selectionDefs&&a.selectionDefs.length?(K=function(e,t,r){return r?n.difference({regions:e,inverted:!1},{regions:[t],inverted:!1}).regions:n.union({regions:e,inverted:!1},{regions:[t],inverted:!1}).regions}(a.mergedPolygons,J,ue),J.subtract=ue,Z=L(a.selectionDefs.concat([J]))):(K=[J],Z=S(J)),m(V(K,b),fe,a),w&&x.throttle(me,D.SELECTDELAY,(function(){var e;ge=[];var t,r=[];for(Q=0;Q<ye.length;Q++)if(t=(ee=ye[Q])._module.selectPoints(ee,Z),r.push(t),e=$(t,ee),ge.length)for(var n=0;n<e.length;n++)ge.push(e[n]);else ge=e;U(E,ye,te={points:ge}),he(te,J,Y),a.gd.emit("plotly_selecting",te)}))},a.clickFn=function(e,t){if(de.remove(),E._fullLayout._activeShapeIndex>=0)E._fullLayout._deactivateShape(E);else if(!_){var r=P.clickmode;x.done(me).then((function(){if(x.clear(me),2===e){for(fe.remove(),Q=0;Q<ye.length;Q++)(ee=ye[Q])._module.selectPoints(ee,!1);U(E,ye),B(a),E.emit("plotly_deselect",null)}else r.indexOf("select")>-1&&I(t,E,a.xaxes,a.yaxes,a.subplot,a,fe),"event"===r&&E.emit("plotly_selected",void 0);s.click(E,t)})).catch(v.error)}},a.doneFn=function(){de.remove(),x.done(me).then((function(){x.clear(me),a.gd.emit("plotly_selected",te),J&&a.selectionDefs&&(J.subtract=ue,a.selectionDefs.push(J),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,K)),a.doneFnCompleted&&a.doneFnCompleted(ge)})).catch(v.error),_&&B(a)}},clearSelect:M,clearSelectionsCache:B,selectOnClick:I}},{"../../components/color":366,"../../components/dragelement/helpers":384,"../../components/drawing":388,"../../components/fx":406,"../../components/fx/helpers":402,"../../components/shapes/draw_newshape/display_outlines":454,"../../components/shapes/draw_newshape/helpers":455,"../../components/shapes/draw_newshape/newshapes":456,"../../lib":503,"../../lib/clear_gl_canvases":487,"../../lib/polygon":515,"../../lib/throttle":530,"../../plot_api/subroutines":544,"../../registry":638,"./axis_ids":558,"./constants":561,"./handle_outline":565,"./helpers":566,polybooljs:254}],576:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,s=e("fast-isnumeric"),l=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,f=i.ensureNumber,p=i.isArrayOrTypedArray,h=e("../../constants/numerical"),d=h.FP_SAFE,m=h.BADNUM,g=h.LOG_CLIP,y=h.ONEWEEK,v=h.ONEDAY,b=h.ONEHOUR,x=h.ONEMIN,_=h.ONESEC,w=e("./axis_ids"),k=e("./constants"),D=k.HOUR_PATTERN,T=k.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function S(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",h=r.charAt(0);function M(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*g*Math.abs(n-a))}return m}function E(t,r,n,a){if((a||{}).msUTC&&s(t))return+t;var o=u(t,n||e.calendar);if(o===m){if(!s(t))return m;t=+t;var l=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-l/10);o=u(new Date(c))+l/10}return o}function C(t,r,n){return c(t,r,n||e.calendar)}function N(t){return e._categories[Math.round(t)]}function O(t){if(S(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return m}function I(t){if(e._categoriesMap)return e._categoriesMap[t]}function P(e){var t=I(e);return void 0!==t?t:s(e)?+e:void 0}function R(e){return s(e)?+e:I(e)}function L(e,t,r){return n.round(r+t*e,2)}function F(e,t,r){return(e-r)/t}var B=function(t){return s(t)?L(t,e._m,e._b):m},z=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var j="y"===h;B=function(t){if(!s(t))return m;var r=e._rangebreaks.length;if(!r)return L(t,e._m,e._b);var n=j;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,l=0;l<r;l++){var c=a*e._rangebreaks[l].min,u=a*e._rangebreaks[l].max;if(i<c)break;if(!(i>u)){o=i<(c+u)/2?l:l+1;break}o=l+1}var f=e._B[o]||0;return isFinite(f)?L(t,e._m2,f):0},z=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,a=0;a<r&&!(t<e._rangebreaks[a].pmin);a++)t>e._rangebreaks[a].pmax&&(n=a+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?M:f,e.l2c="log"===e.type?A:f,e.l2p=B,e.p2l=z,e.c2p="log"===e.type?function(e,t){return B(M(e,t))}:B,e.p2c="log"===e.type?function(e){return A(z(e))}:z,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=l,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(l(t))},e.p2d=e.p2r=z,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return M(l(e),t)},e.r2d=e.r2c=function(e){return A(l(e))},e.d2c=e.r2l=l,e.c2d=e.l2r=f,e.c2r=M,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(z(e))},e.r2p=function(t){return e.l2p(l(t))},e.p2r=z,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=E,e.c2d=e.c2r=e.l2d=e.l2r=C,e.d2p=e.r2p=function(t,r,n){return e.l2p(E(t,0,n))},e.p2d=e.p2r=function(e,t,r){return C(z(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=O,e.r2d=e.c2d=e.l2d=N,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return N(z(e))},e.r2p=e.d2p,e.p2r=z,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=N,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=I,e.l2r=e.c2r=f,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return N(z(e))},e.r2p=e.d2p,e.p2r=z,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var a,o,s=e._traceIndices,l=e._matchGroup;if(l&&0===e._categories.length)for(var c in l)if(c!==r){var u=t[w.id2name(c)];s=s.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],d=[];for(a=0;a<s.length;a++){var m=n[s[a]];if(h in m){var g=m[h],y=m._length||i.minRowLength(g);if(p(g[0])&&p(g[1]))for(o=0;o<y;o++){var v=g[0][o],b=g[1][o];S(v)&&S(b)&&(d.push([v,b]),v in f[0][1]||(f[0][1][v]=f[0][0]++),b in f[1][1]||(f[1][1][b]=f[1][0]++))}}}for(d.sort((function(e,t){var r=f[0][1],n=r[e[0]]-r[t[0]];if(n)return n;var a=f[1][1];return a[e[1]]-a[t[1]]})),a=0;a<d.length;a++)O(d[a])}),e.fraction2r=function(t){var r=e.r2l(e.range[0]),n=e.r2l(e.range[1]);return e.l2r(r+t*(n-r))},e.r2fraction=function(t){var r=e.r2l(e.range[0]),n=e.r2l(e.range[1]);return(e.r2l(t)-r)/(n-r)},e.cleanRange=function(t,r){r||(r={}),t||(t="range");var n,a,o=i.nestedProperty(e,t).get();if(a=(a="date"===e.type?i.dfltRange(e.calendar):"y"===h?k.DFLTRANGEY:"realaxis"===e._name?[0,1]:r.dfltRange||k.DFLTRANGEX).slice(),"tozero"!==e.rangemode&&"nonnegative"!==e.rangemode||(a[0]=0),o&&2===o.length)for("date"!==e.type||e.autorange||(o[0]=i.cleanDate(o[0],m,e.calendar),o[1]=i.cleanDate(o[1],m,e.calendar)),n=0;n<2;n++)if("date"===e.type){if(!i.isDateTime(o[n],e.calendar)){e[t]=a;break}if(e.r2l(o[0])===e.r2l(o[1])){var l=i.constrain(e.r2l(o[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);o[0]=e.l2r(l-1e3),o[1]=e.l2r(l+1e3);break}}else{if(!s(o[n])){if(!s(o[1-n])){e[t]=a;break}o[n]=o[1-n]*(n?10:.1)}if(o[n]<-d?o[n]=-d:o[n]>d&&(o[n]=d),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var s,l,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),f="y"===h;if(f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(s=0;s<e._rangebreaks.length;s++)l=e._rangebreaks[s],e._lBreaks+=Math.abs(l.max-l.min);var p=f;c>u&&(p=!p),p&&e._rangebreaks.reverse();var d=p?-1:1;for(e._m2=d*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(f?u:c)),s=0;s<e._rangebreaks.length;s++)l=e._rangebreaks[s],e._B.push(e._B[e._B.length-1]-d*e._m2*(l.max-l.min));for(s=0;s<e._rangebreaks.length;s++)(l=e._rangebreaks[s]).pmin=B(l.min),l.pmax=B(l.max)}if(!isFinite(e._m)||!isFinite(e._b)||e._length<0)throw t._replotting=!1,new Error("Something went wrong with axis scaling")},e.maskBreaks=function(t){var r,n,a,o,s,c=e.rangebreaks||[];c._cachedPatterns||(c._cachedPatterns=c.map((function(t){return t.enabled&&t.bounds?i.simpleMap(t.bounds,t.pattern?l:e.d2c):null}))),c._cachedValues||(c._cachedValues=c.map((function(t){return t.enabled&&t.values?i.simpleMap(t.values,e.d2c).sort(i.sorterAsc):null})));for(var u=0;u<c.length;u++){var f=c[u];if(f.enabled)if(f.bounds){var p=f.pattern;switch(n=(r=c._cachedPatterns[u])[0],a=r[1],p){case T:o=(s=new Date(t)).getUTCDay(),n>a&&(a+=7,o<n&&(o+=7));break;case D:o=(s=new Date(t)).getUTCHours()+(s.getUTCMinutes()/60+s.getUTCSeconds()/3600+s.getUTCMilliseconds()/36e5),n>a&&(a+=24,o<n&&(o+=24));break;case"":o=t}if(o>=n&&o<a)return m}else for(var h=c._cachedValues[u],d=0;d<h.length;d++)if(a=(n=h[d])+f.dvalue,t>=n&&t<a)return m}return t},e.locateBreaks=function(t,r){var n,a,o,s,c=[];if(!e.rangebreaks)return c;var u=e.rangebreaks.slice().sort((function(e,t){return e.pattern===T&&t.pattern===D?-1:t.pattern===T&&e.pattern===D?1:0})),f=function(e,n){if((e=i.constrain(e,t,r))!==(n=i.constrain(n,t,r))){for(var a=!0,o=0;o<c.length;o++){var s=c[o];e<s.max&&n>=s.min&&(e<s.min&&(s.min=e),n>s.max&&(s.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;n<u.length;n++){var p=u[n];if(p.enabled)if(p.bounds){var h=t,d=r;p.pattern&&(h=Math.floor(h)),o=(a=i.simpleMap(p.bounds,p.pattern?l:e.r2l))[0],s=a[1];var m,g,w=new Date(h);switch(p.pattern){case T:g=y,m=(s-o+(s<o?7:0))*v,h+=o*v-(w.getUTCDay()*v+w.getUTCHours()*b+w.getUTCMinutes()*x+w.getUTCSeconds()*_+w.getUTCMilliseconds());break;case D:g=v,m=(s-o+(s<o?24:0))*b,h+=o*b-(w.getUTCHours()*b+w.getUTCMinutes()*x+w.getUTCSeconds()*_+w.getUTCMilliseconds());break;default:h=Math.min(a[0],a[1]),m=g=(d=Math.max(a[0],a[1]))-h}for(var k=h;k<d;k+=g)f(k,k+m)}else for(var A=i.simpleMap(p.values,e.d2c),S=0;S<A.length;S++)f(o=A[S],s=o+p.dvalue)}return c.sort((function(e,t){return e.min-t.min})),c},e.makeCalcdata=function(t,r,n){var a,o,s,l,c=e.type,u="date"===c&&t[r+"calendar"];if(r in t){if(a=t[r],l=t._length||i.minRowLength(a),i.isTypedArray(a)&&("linear"===c||"log"===c)){if(l===a.length)return a;if(a.subarray)return a.subarray(0,l)}if("multicategory"===c)return function(e,t){for(var r=new Array(t),n=0;n<t;n++){var a=(e[0]||[])[n],i=(e[1]||[])[n];r[n]=I([a,i])}return r}(a,l);for(o=new Array(l),s=0;s<l;s++)o[s]=e.d2c(a[s],0,u,n)}else{var f=r+"0"in t?e.d2c(t[r+"0"],0,u):0,p=t["d"+r]?Number(t["d"+r]):1;for(a=t[{x:"y",y:"x"}[r]],l=t._length||a.length,o=new Array(l),s=0;s<l;s++)o[s]=f+s*p}if(e.rangebreaks)for(s=0;s<l;s++)o[s]=e.maskBreaks(o[s]);return o},e.isValidRange=function(t){return Array.isArray(t)&&2===t.length&&s(e.r2l(t[0]))&&s(e.r2l(t[1]))},e.isPtWithinRange=function(t,r){var n=e.c2l(t[h],null,r),a=e.r2l(e.range[0]),i=e.r2l(e.range[1]);return a<i?a<=n&&n<=i:i<=n&&n<=a},e._emptyCategories=function(){e._categories=[],e._categoriesMap={}},e.clearCalc=function(){var r=e._matchGroup;if(r){var n=null,a=null;for(var i in r){var o=t[w.id2name(i)];if(o._categories){n=o._categories,a=o._categoriesMap;break}}n&&a?(e._categories=n,e._categoriesMap=a):e._emptyCategories()}else e._emptyCategories();if(e._initialCategories)for(var s=0;s<e._initialCategories.length;s++)O(e._initialCategories[s])},e.sortByInitialCategories=function(){var n=[];if(e._emptyCategories(),e._initialCategories)for(var a=0;a<e._initialCategories.length;a++)O(e._initialCategories[a]);n=n.concat(e._traceIndices);var i=e._matchGroup;for(var o in i)if(r!==o){var s=t[w.id2name(o)];s._categories=e._categories,s._categoriesMap=e._categoriesMap,n=n.concat(s._traceIndices)}return n};var U=t._d3locale;"date"===e.type&&(e._dateFormat=U?U.timeFormat:a,e._extraFormat=t._extraFormat),e._separators=t.separators,e._numFormat=U?U.numberFormat:o,delete e._minDtick,delete e._forceTick0}},{"../../constants/numerical":479,"../../lib":503,"./axis_ids":558,"./constants":561,"@plotly/d3":58,"d3-time-format":120,"fast-isnumeric":190}],577:[function(e,t,r){"use strict";t.exports=function(e){var t=["showexponent","showtickprefix","showticksuffix"].filter((function(t){return void 0!==e[t]}));if(t.every((function(r){return e[r]===e[t[0]]}))||1===t.length)return e[t[0]]}},{}],578:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color").contrast,i=e("./layout_attributes"),o=e("./show_dflt"),s=e("../array_container_defaults");function l(e,t){function r(r,a){return n.coerce(e,t,i.tickformatstops,r,a)}r("enabled")&&(r("dtickrange"),r("value"))}t.exports=function(e,t,r,c,u){u||(u={});var f=o(e);if(r("showticklabels")){var p=u.font||{},h=t.color,d=-1!==(t.ticklabelposition||"").indexOf("inside")?a(u.bgColor):h&&h!==i.color.dflt?h:p.color;if(n.coerceFont(r,"tickfont",{family:p.family,size:p.size,color:d}),u.noAng||r("tickangle"),"category"!==c){var m=r("tickformat");s(e,t,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:l}),t.tickformatstops.length||delete t.tickformatstops,u.noExp||m||"date"===c||(r("showexponent",f),r("exponentformat"),r("minexponent"),r("separatethousands"))}}}},{"../../components/color":366,"../../lib":503,"../array_container_defaults":549,"./layout_attributes":569,"./show_dflt":577}],579:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r,i){var o=n.coerce2(e,t,a,"ticklen"),s=n.coerce2(e,t,a,"tickwidth"),l=n.coerce2(e,t,a,"tickcolor",t.color);r("ticks",i.outerTicks||o||s||l?"outside":"")||(delete t.ticklen,delete t.tickwidth,delete t.tickcolor)}},{"../../lib":503,"./layout_attributes":569}],580:[function(e,t,r){"use strict";var n=e("./clean_ticks"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i){function o(r){var n=e[r];return void 0!==n?n:(t._template||{})[r]}var s=o("tick0"),l=o("dtick"),c=o("tickvals"),u=r("tickmode",a(c)?"array":l?"linear":"auto");if("auto"===u)r("nticks");else if("linear"===u){var f=t.dtick=n.dtick(l,i);t.tick0=n.tick0(s,i,t.calendar,f)}else"multicategory"!==i&&(void 0===r("tickvals")?t.tickmode="auto":r("ticktext"))}},{"../../lib":503,"./clean_ticks":560}],581:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=e("../../components/drawing"),s=e("./axes");t.exports=function(e,t,r,l){var c=e._fullLayout;if(0!==t.length){var u,f,p,h;l&&(u=l());var d=n.ease(r.easing);return e._transitionData._interruptCallbacks.push((function(){return window.cancelAnimationFrame(h),h=null,function(){for(var r={},n=0;n<t.length;n++){var i=t[n],o=i.plotinfo.xaxis,s=i.plotinfo.yaxis;i.xr0&&(r[o._name+".range"]=i.xr0.slice()),i.yr0&&(r[s._name+".range"]=i.yr0.slice())}return a.call("relayout",e,r).then((function(){for(var e=0;e<t.length;e++)m(t[e].plotinfo)}))}()})),f=Date.now(),h=window.requestAnimationFrame((function n(){p=Date.now();for(var i=Math.min(1,(p-f)/r.duration),o=d(i),s=0;s<t.length;s++)g(t[s],o);p-f>r.duration?(function(){for(var r={},n=0;n<t.length;n++){var i=t[n],o=i.plotinfo.xaxis,s=i.plotinfo.yaxis;i.xr1&&(r[o._name+".range"]=i.xr1.slice()),i.yr1&&(r[s._name+".range"]=i.yr1.slice())}u&&u(),a.call("relayout",e,r).then((function(){for(var e=0;e<t.length;e++)m(t[e].plotinfo)}))}(),h=window.cancelAnimationFrame(n)):h=window.requestAnimationFrame(n)})),Promise.resolve()}function m(e){var t=e.xaxis,r=e.yaxis;c._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function g(t,r){var n=t.plotinfo,a=n.xaxis,l=n.yaxis,c=a._length,u=l._length,f=!!t.xr1,p=!!t.yr1,h=[];if(f){var d=i.simpleMap(t.xr0,a.r2l),m=i.simpleMap(t.xr1,a.r2l),g=d[1]-d[0],y=m[1]-m[0];h[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,h[2]=c*(1-r+r*y/g),a.range[0]=a.l2r(d[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(d[1]*(1-r)+r*m[1])}else h[0]=0,h[2]=c;if(p){var v=i.simpleMap(t.yr0,l.r2l),b=i.simpleMap(t.yr1,l.r2l),x=v[1]-v[0],_=b[1]-b[0];h[1]=(v[1]*(1-r)+r*b[1]-v[1])/(v[0]-v[1])*u,h[3]=u*(1-r+r*_/x),l.range[0]=a.l2r(v[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*b[1])}else h[1]=0,h[3]=u;s.drawOne(e,a,{skipTitle:!0}),s.drawOne(e,l,{skipTitle:!0}),s.redrawComponents(e,[a._id,l._id]);var w=f?c/h[2]:1,k=p?u/h[3]:1,D=f?h[0]:0,T=p?h[1]:0,A=f?h[0]/h[2]*c:0,S=p?h[1]/h[3]*u:0,M=a._offset-A,E=l._offset-S;n.clipRect.call(o.setTranslate,D,T).call(o.setScale,1/w,1/k),n.plot.call(o.setTranslate,M,E).call(o.setScale,w,k),o.setPointGroupScale(n.zoomScalePts,1/w,1/k),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}s.redrawComponents(e)}},{"../../components/drawing":388,"../../lib":503,"../../registry":638,"./axes":554,"@plotly/d3":58}],582:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(function(e,t){if("-"===e.type){var r,s=e._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(e,t,r){for(var n=0;n<e.length;n++){var a=e[n];if("splom"===a.type&&a._length>0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,s,l);if(c)if("histogram"!==c.type||l!=={v:"y",h:"x"}[c.orientation||"v"]){var u=l+"calendar",f=c[u],p={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(p.noMultiCategory=!0),p.autotypenumbers=e.autotypenumbers,o(c,l)){var h=i(c),d=[];for(r=0;r<t.length;r++){var m=t[r];n(m,"box-violin")&&(m[l+"axis"]||l)===s&&(void 0!==m[h]?d.push(m[h][0]):void 0!==m.name?d.push(m.name):d.push("text"),m[u]!==f&&(f=void 0))}e.type=a(d,f,p)}else if("splom"===c.type){var g=c.dimensions[c._axesDim[s]];g.visible&&(e.type=a(g.values,f,p))}else e.type=a(c[l]||[c[l+"0"]],f,p)}else e.type="linear"}}(t,s.data),"-"===t.type?t.type="linear":e.type=t.type)}},{"../../registry":638,"./axis_autotype":555}],583:[function(e,t,r){"use strict";var n=e("../registry"),a=e("../lib");function i(e,t,r){var n,i,o,s=!1;if("data"===t.type)n=e._fullData[null!==t.traces?t.traces[0]:0];else{if("layout"!==t.type)return!1;n=e._fullLayout}return i=a.nestedProperty(n,t.prop).get(),(o=r[t.type]=r[t.type]||{}).hasOwnProperty(t.prop)&&o[t.prop]!==i&&(s=!0),o[t.prop]=i,{changed:s,value:i}}function o(e,t){var r=[],n=t[0],i={};if("string"==typeof n)i[n]=t[1];else{if(!a.isPlainObject(n))return r;i=n}return l(i,(function(e,t,n){r.push({type:"layout",prop:e,value:n})}),"",0),r}function s(e,t){var r,n,i,o,s=[];if(n=t[0],i=t[1],r=t[2],o={},"string"==typeof n)o[n]=i;else{if(!a.isPlainObject(n))return s;o=n,void 0===r&&(r=i)}return void 0===r&&(r=null),l(o,(function(t,n,a){var i,o;if(Array.isArray(a)){o=a.slice();var l=Math.min(o.length,e.data.length);r&&(l=Math.min(l,r.length)),i=[];for(var c=0;c<l;c++)i[c]=r?r[c]:c}else o=a,i=r?r.slice():null;if(null===i)Array.isArray(o)&&(o=o[0]);else if(Array.isArray(i)){if(!Array.isArray(o)){var u=o;o=[];for(var f=0;f<i.length;f++)o[f]=u}o.length=Math.min(i.length,o.length)}s.push({type:"data",prop:t,traces:i,value:o})}),"",0),s}function l(e,t,r,n){Object.keys(e).forEach((function(i){var o=e[i];if("_"!==i[0]){var s=r+(n>0?".":"")+i;a.isPlainObject(o)?l(o,t,s,n+1):t(s,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var s={},l=!0;t&&t._commandObserver&&(s=t._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,s.lookupTable);if(t&&t._commandObserver){if(c)return s;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,s}if(c){i(e,c,s.cache),s.check=function(){if(l){var t=i(e,c,s.cache);return t.changed&&o&&void 0!==s.lookupTable[t.value]&&(s.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[t.value]})).then(s.enable,s.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)e._internalOn(u[f],s.check);s.remove=function(){for(var t=0;t<u.length;t++)e._removeInternalListener(u[t],s.check)}}else a.log("Unable to automatically bind plot updates to API command"),s.lookupTable={},s.remove=function(){};return s.disable=function(){l=!1},s.enable=function(){l=!0},t&&(t._commandObserver=s),s},r.hasSimpleAPICommandBindings=function(e,t,n){var a,i,o=t.length;for(a=0;a<o;a++){var s,l=t[a],c=l.method,u=l.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(e,c,u);if(1!==f.length)return!1;if(i){if((s=f[0]).type!==i.type)return!1;if(s.prop!==i.prop)return!1;if(Array.isArray(i.traces)){if(!Array.isArray(s.traces))return!1;s.traces.sort();for(var p=0;p<i.traces.length;p++)if(i.traces[p]!==s.traces[p])return!1}else if(s.prop!==i.prop)return!1}else i=f[0],Array.isArray(i.traces)&&i.traces.sort();var h=(s=f[0]).value;if(Array.isArray(h)){if(1!==h.length)return!1;h=h[0]}n&&(n[h]=a)}return i},r.executeAPICommand=function(e,t,r){if("skip"===t)return Promise.resolve();var i=n.apiMethodRegistry[t],o=[e];Array.isArray(r)||(r=[]);for(var s=0;s<r.length;s++)o.push(r[s]);return i.apply(null,o).catch((function(e){return a.warn("API call to Plotly."+t+" rejected.",e),Promise.reject(e)}))},r.computeAPICommandBindings=function(e,t,r){var n;switch(Array.isArray(r)||(r=[]),t){case"restyle":n=s(e,r);break;case"relayout":n=o(0,r);break;case"update":n=s(e,[r[0],r[2]]).concat(o(0,[r[1]]));break;case"animate":n=function(e,t){return Array.isArray(t[0])&&1===t[0].length&&-1!==["string","number"].indexOf(typeof t[0][0])?[{type:"layout",prop:"_currentFrame",value:t[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}},{"../lib":503,"../registry":638}],584:[function(e,t,r){"use strict";var n=e("../lib/extend").extendFlat;r.attributes=function(e,t){t=t||{};var r={valType:"info_array",editType:(e=e||{}).editType,items:[{valType:"number",min:0,max:1,editType:e.editType},{valType:"number",min:0,max:1,editType:e.editType}],dflt:[0,1]},a=(e.name&&e.name,e.trace,t.description&&t.description,{x:n({},r,{}),y:n({},r,{}),editType:e.editType});return e.noGridCell||(a.row={valType:"integer",min:0,dflt:0,editType:e.editType},a.column={valType:"integer",min:0,dflt:0,editType:e.editType}),a},r.defaults=function(e,t,r,n){var a=n&&n.x||[0,1],i=n&&n.y||[0,1],o=t.grid;if(o){var s=r("domain.column");void 0!==s&&(s<o.columns?a=o._domains.x[s]:delete e.domain.column);var l=r("domain.row");void 0!==l&&(l<o.rows?i=o._domains.y[l]:delete e.domain.row)}var c=r("domain.x",a),u=r("domain.y",i);c[0]<c[1]||(e.domain.x=a.slice()),u[0]<u[1]||(e.domain.y=i.slice())}},{"../lib/extend":493}],585:[function(e,t,r){"use strict";t.exports=function(e){var t=e.editType,r=e.colorEditType;void 0===r&&(r=t);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:t},size:{valType:"number",min:1,editType:t},color:{valType:"color",editType:r},editType:t};return e.autoSize&&(n.size.dflt="auto"),e.autoColor&&(n.color.dflt="auto"),e.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],586:[function(e,t,r){"use strict";t.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],587:[function(e,t,r){"use strict";r.projNames={airy:"airy",aitoff:"aitoff","albers usa":"albersUsa",albers:"albers",august:"august","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant",baker:"baker",bertin1953:"bertin1953",boggs:"boggs",bonne:"bonne",bottomley:"bottomley",bromley:"bromley",collignon:"collignon","conic conformal":"conicConformal","conic equal area":"conicEqualArea","conic equidistant":"conicEquidistant",craig:"craig",craster:"craster","cylindrical equal area":"cylindricalEqualArea","cylindrical stereographic":"cylindricalStereographic",eckert1:"eckert1",eckert2:"eckert2",eckert3:"eckert3",eckert4:"eckert4",eckert5:"eckert5",eckert6:"eckert6",eisenlohr:"eisenlohr",equirectangular:"equirectangular",fahey:"fahey","foucaut sinusoidal":"foucautSinusoidal",foucaut:"foucaut",ginzburg4:"ginzburg4",ginzburg5:"ginzburg5",ginzburg6:"ginzburg6",ginzburg8:"ginzburg8",ginzburg9:"ginzburg9",gnomonic:"gnomonic","gringorten quincuncial":"gringortenQuincuncial",gringorten:"gringorten",guyou:"guyou",hammer:"hammer",hill:"hill",homolosine:"homolosine",hufnagel:"hufnagel",hyperelliptical:"hyperelliptical",kavrayskiy7:"kavrayskiy7",lagrange:"lagrange",larrivee:"larrivee",laskowski:"laskowski",loximuthal:"loximuthal",mercator:"mercator",miller:"miller",mollweide:"mollweide","mt flat polar parabolic":"mtFlatPolarParabolic","mt flat polar quartic":"mtFlatPolarQuartic","mt flat polar sinusoidal":"mtFlatPolarSinusoidal","natural earth":"naturalEarth","natural earth1":"naturalEarth1","natural earth2":"naturalEarth2","nell hammer":"nellHammer",nicolosi:"nicolosi",orthographic:"orthographic",patterson:"patterson","peirce quincuncial":"peirceQuincuncial",polyconic:"polyconic","rectangular polyconic":"rectangularPolyconic",robinson:"robinson",satellite:"satellite","sinu mollweide":"sinuMollweide",sinusoidal:"sinusoidal",stereographic:"stereographic",times:"times","transverse mercator":"transverseMercator","van der grinten":"vanDerGrinten","van der grinten2":"vanDerGrinten2","van der grinten3":"vanDerGrinten3","van der grinten4":"vanDerGrinten4",wagner4:"wagner4",wagner6:"wagner6",wiechel:"wiechel","winkel tripel":"winkel3",winkel3:"winkel3"},r.axesNames=["lonaxis","lataxis"],r.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},r.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},r.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},r.clipPad=.001,r.precision=.1,r.landColor="#F0DC82",r.waterColor="#3399FF",r.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},r.sphereSVG={type:"Sphere"},r.fillLayers={ocean:1,land:1,lakes:1},r.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},r.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],r.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],r.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}},{}],588:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-geo"),i=a.geoPath,o=a.geoDistance,s=e("d3-geo-projection"),l=e("../../registry"),c=e("../../lib"),u=c.strTranslate,f=e("../../components/color"),p=e("../../components/drawing"),h=e("../../components/fx"),d=e("../plots"),m=e("../cartesian/axes"),g=e("../cartesian/autorange").getAutoRange,y=e("../../components/dragelement"),v=e("../cartesian/select").prepSelect,b=e("../cartesian/select").clearSelect,x=e("../cartesian/select").selectOnClick,_=e("./zoom"),w=e("./constants"),k=e("../../lib/geo_location_utils"),D=e("../../lib/topojson_utils"),T=e("topojson-client").feature;function A(e){this.id=e.id,this.graphDiv=e.graphDiv,this.container=e.container,this.topojsonURL=e.topojsonURL,this.isStatic=e.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}var S=A.prototype;function M(e,t){var r=w.clipPad,n=e[0]+r,a=e[1]-r,i=t[0]+r,o=t[1]-r;n>0&&a<0&&(a+=360);var s=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[a,o],[a,i],[a-s,i],[a-2*s,i],[a-3*s,i],[n,i]]]}}t.exports=function(e){return new A(e)},S.plot=function(e,t,r){var n=this,a=t[this.id],i=[],o=!1;for(var s in w.layerNameToAdjective)if("frame"!==s&&a["show"+s]){o=!0;break}for(var l=0;l<e.length;l++)if(e[0][0].trace.locationmode){o=!0;break}if(o){var c=D.getTopojsonName(a);null!==n.topojson&&c===n.topojsonName||(n.topojsonName=c,void 0===PlotlyGeoAssets.topojson[n.topojsonName]&&i.push(n.fetchTopojson()))}i=i.concat(k.fetchTraceGeoData(e)),r.push(new Promise((function(r,a){Promise.all(i).then((function(){n.topojson=PlotlyGeoAssets.topojson[n.topojsonName],n.update(e,t),r()})).catch(a)})))},S.fetchTopojson=function(){var e=this,t=D.getTopojsonPath(e.topojsonURL,e.topojsonName);return new Promise((function(r,a){n.json(t,(function(n,i){if(n)return 404===n.status?a(new Error(["plotly.js could not find topojson file at",t,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" "))):a(new Error(["unexpected error while fetching topojson file at",t].join(" ")));PlotlyGeoAssets.topojson[e.topojsonName]=i,r()}))}))},S.update=function(e,t){var r=t[this.id];this.hasChoropleth=!1;for(var n=0;n<e.length;n++){var a=e[n],i=a[0].trace;"choropleth"===i.type&&(this.hasChoropleth=!0),!0===i.visible&&i._length>0&&i._module.calcGeoJSON(a,t)}if(!this.updateProjection(e,t)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(t,r),this.updateDims(t,r),this.updateFx(t,r),d.generalUpdatePerTraceModule(this.graphDiv,this,e,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var s=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=s.selectAll("path"),this.render()}},S.updateProjection=function(e,t){var r=this.graphDiv,n=t[this.id],l=t._size,u=n.domain,f=n.projection,p=n.lonaxis,h=n.lataxis,d=p._ax,m=h._ax,y=this.projection=function(e){var t=e.projection,r=t.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var l=(a[n]||s[n])(),u=e._isSatellite?180*Math.acos(1/t.distance)/Math.PI:e._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],p=function(e){return e?l:[]},h=0;h<f.length;h++){var d=f[h];"function"!=typeof l[d]&&(l[d]=p)}return l.isLonLatOverEdges=function(e){if(null===l(e))return!0;if(u){var t=l.rotate();return o(e,[-t[0],-t[1]])>u*Math.PI/180}return!1},l.getPath=function(){return i().projection(l)},l.getBounds=function(e){return l.getPath().bounds(e)},l.precision(w.precision),e._isSatellite&&l.tilt(t.tilt).distance(t.distance),u&&l.clipAngle(u-w.clipPad),l}(n),v=[[l.l+l.w*u.x[0],l.t+l.h*(1-u.y[1])],[l.l+l.w*u.x[1],l.t+l.h*(1-u.y[0])]],b=n.center||{},x=f.rotation||{},_=p.range||[],k=h.range||[];if(n.fitbounds){d._length=v[1][0]-v[0][0],m._length=v[1][1]-v[0][1],d.range=g(r,d),m.range=g(r,m);var D=(d.range[0]+d.range[1])/2,T=(m.range[0]+m.range[1])/2;if(n._isScoped)b={lon:D,lat:T};else if(n._isClipped){b={lon:D,lat:T},x={lon:D,lat:T,roll:x.roll};var A=f.type,S=w.lonaxisSpan[A]/2||180,E=w.lataxisSpan[A]/2||90;_=[D-S,D+S],k=[T-E,T+E]}else b={lon:D,lat:T},x={lon:D,lat:x.lat,roll:x.roll}}y.center([b.lon-x.lon,b.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(f.parallels);var C=M(_,k);y.fitExtent(v,C);var N=this.bounds=y.getBounds(C),O=this.fitScale=y.scale(),I=y.translate();if(n.fitbounds){var P=y.getBounds(M(d.range,m.range)),R=Math.min((N[1][0]-N[0][0])/(P[1][0]-P[0][0]),(N[1][1]-N[0][1])/(P[1][1]-P[0][1]));isFinite(R)?y.scale(R*O):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(f.scale*O);var L=this.midPt=[(N[0][0]+N[1][0])/2,(N[0][1]+N[1][1])/2];if(y.translate([I[0]+(L[0]-I[0]),I[1]+(L[1]-I[1])]).clipExtent(N),n._isAlbersUsa){var F=y([b.lon,b.lat]),B=y.translate();y.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},S.updateBaseLayers=function(e,t){var r=this,a=r.topojson,i=r.layers,o=r.basePaths;function s(e){return"lonaxis"===e||"lataxis"===e}function l(e){return Boolean(w.lineLayers[e])}function c(e){return Boolean(w.fillLayers[e])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(e){return l(e)||c(e)?t["show"+e]:!s(e)||t[e].showgrid})),h=r.framework.selectAll(".layer").data(u,String);h.exit().each((function(e){delete i[e],delete o[e],n.select(this).remove()})),h.enter().append("g").attr("class",(function(e){return"layer "+e})).each((function(e){var t=i[e]=n.select(this);"bg"===e?r.bgRect=t.append("rect").style("pointer-events","all"):s(e)?o[e]=t.append("path").style("fill","none"):"backplot"===e?t.append("g").classed("choroplethlayer",!0):"frontplot"===e?t.append("g").classed("scatterlayer",!0):l(e)?o[e]=t.append("path").style("fill","none").style("stroke-miterlimit",2):c(e)&&(o[e]=t.append("path").style("stroke","none"))})),h.order(),h.each((function(r){var n=o[r],i=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(T(a,a.objects[r])):s(r)&&n.datum(function(e,t,r){var n,a,i,o=t[e],s=w.scopeDefaults[t.scope];"lonaxis"===e?(n=s.lonaxisRange,a=s.lataxisRange,i=function(e,t){return[e,t]}):"lataxis"===e&&(n=s.lataxisRange,a=s.lonaxisRange,i=function(e,t){return[t,e]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};m.setConvert(l,r);var c=m.calcTicks(l);t.isScoped||"lonaxis"!==e||c.pop();for(var u=c.length,f=new Array(u),p=0;p<u;p++)for(var h=c[p].x,d=f[p]=[],g=a[0];g<a[1]+2.5;g+=2.5)d.push(i(h,g));return{type:"MultiLineString",coordinates:f}}(r,t,e)).call(f.stroke,t[r].gridcolor).call(p.dashLine,"",t[r].gridwidth),l(r)?n.call(f.stroke,t[i+"color"]).call(p.dashLine,"",t[i+"width"]):c(r)&&n.call(f.fill,t[i+"color"])}))},S.updateDims=function(e,t){var r=this.bounds,n=(t.framewidth||0)/2,a=r[0][0]-n,i=r[0][1]-n,o=r[1][0]-a+n,s=r[1][1]-i+n;p.setRect(this.clipRect,a,i,o,s),this.bgRect.call(p.setRect,a,i,o,s).call(f.fill,t.bgcolor),this.xaxis._offset=a,this.xaxis._length=o,this.yaxis._offset=i,this.yaxis._length=s},S.updateFx=function(e,t){var r=this,a=r.graphDiv,i=r.bgRect,o=e.dragmode,s=e.clickmode;if(!r.isStatic){var u;"select"===o?u=function(e,t){(e.range={})[r.id]=[p([t.xmin,t.ymin]),p([t.xmax,t.ymax])]}:"lasso"===o&&(u=function(e,t,n){(e.lassoPoints={})[r.id]=n.filtered.map(p)});var f={element:r.bgRect.node(),gd:a,plotinfo:{id:r.id,xaxis:r.xaxis,yaxis:r.yaxis,fillRangeItems:u},xaxes:[r.xaxis],yaxes:[r.yaxis],subplot:r.id,clickFn:function(e){2===e&&b(a)}};"pan"===o?(i.node().onmousedown=null,i.call(_(r,t)),i.on("dblclick.zoom",(function(){var e=r.viewInitial,t={};for(var n in e)t[r.id+"."+n]=e[n];l.call("_guiRelayout",a,t),a.emit("plotly_doubleclick",null)})),a._context._scrollZoom.geo||i.on("wheel.zoom",null)):"select"!==o&&"lasso"!==o||(i.on(".zoom",null),f.prepFn=function(e,t,r){v(e,t,r,f,o)},y.init(f)),i.on("mousemove",(function(){var e=r.projection.invert(c.getPositionFromD3Event());if(!e)return y.unhover(a,n.event);r.xaxis.p2c=function(){return e[0]},r.yaxis.p2c=function(){return e[1]},h.hover(a,n.event,r.id)})),i.on("mouseout",(function(){a._dragging||y.unhover(a,n.event)})),i.on("click",(function(){"select"!==o&&"lasso"!==o&&(s.indexOf("select")>-1&&x(n.event,a,[r.xaxis],[r.yaxis],r.id,f),s.indexOf("event")>-1&&h.click(a,n.event))}))}function p(e){return r.projection.invert([e[0]+r.xaxis._offset,e[1]+r.yaxis._offset])}},S.makeFramework=function(){var e=this,t=e.graphDiv,r=t._fullLayout,a="clip"+r._uid+e.id;e.clipDef=r._clips.append("clipPath").attr("id",a),e.clipRect=e.clipDef.append("rect"),e.framework=n.select(e.container).append("g").attr("class","geo "+e.id).call(p.setClipUrl,a,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(e.mockAxis,r)},S.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,a=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":a.lon},c.extendFlat(this.viewInitial,t)},S.render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?u(r[0],r[1]):null}function a(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",a).attr("transform",n)}},{"../../components/color":366,"../../components/dragelement":385,"../../components/drawing":388,"../../components/fx":406,"../../lib":503,"../../lib/geo_location_utils":496,"../../lib/topojson_utils":532,"../../registry":638,"../cartesian/autorange":553,"../cartesian/axes":554,"../cartesian/select":575,"../plots":619,"./constants":587,"./zoom":592,"@plotly/d3":58,"d3-geo":114,"d3-geo-projection":113,"topojson-client":315}],589:[function(e,t,r){"use strict";var n=e("../../plots/get_data").getSubplotCalcData,a=e("../../lib").counterRegex,i=e("./geo"),o="geo",s=a(o),l={};l.geo={valType:"subplotid",dflt:o,editType:"calc"},t.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots.geo,s=0;s<a.length;s++){var l=a[s],c=n(r,o,l),u=t[l]._subplot;u||(u=i({id:l,graphDiv:e,container:t._geolayer.node(),topojsonURL:e._context.topojsonURL,staticPlot:e._context.staticPlot}),t[l]._subplot=u),u.plot(c,t,e._promises)}},updateFx:function(e){for(var t=e._fullLayout,r=t._subplots.geo,n=0;n<r.length;n++){var a=t[r[n]];a._subplot.updateFx(t,a)}},clean:function(e,t,r,n){for(var a=n._subplots.geo||[],i=0;i<a.length;i++){var o=a[i],s=n[o]._subplot;!t[o]&&s&&(s.framework.remove(),s.clipDef.remove())}}}},{"../../lib":503,"../../plots/get_data":593,"./geo":588,"./layout_attributes":590,"./layout_defaults":591}],590:[function(e,t,r){"use strict";var n=e("../../components/color/attributes"),a=e("../domain").attributes,i=e("./constants"),o=e("../../plot_api/edit_types").overrideAll,s=e("../../lib/sort_object_keys"),l={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};(t.exports=o({domain:a({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:s(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:s(i.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:l,lataxis:l},"plot","from-root")).uirevision={valType:"any",editType:"none"}},{"../../components/color/attributes":365,"../../lib/sort_object_keys":526,"../../plot_api/edit_types":536,"../domain":584,"./constants":587}],591:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../subplot_defaults"),i=e("../get_data").getSubplotData,o=e("./constants"),s=e("./layout_attributes"),l=o.axesNames;function c(e,t,r,a){var s=i(a.fullData,"geo",a.id).map((function(e){return e._expandedIndex})),c=r("resolution"),u=r("scope"),f=o.scopeDefaults[u],p=r("projection.type",f.projType),h=t._isAlbersUsa="albers usa"===p;h&&(u=t.scope="usa");var d=t._isScoped="world"!==u,m=t._isSatellite="satellite"===p,g=t._isConic=-1!==p.indexOf("conic")||"albers"===p,y=t._isClipped=!!o.lonaxisSpan[p];if(!1===e.visible){var v=n.extendDeep({},t._template);v.showcoastlines=!1,v.showcountries=!1,v.showframe=!1,v.showlakes=!1,v.showland=!1,v.showocean=!1,v.showrivers=!1,v.showsubunits=!1,v.lonaxis&&(v.lonaxis.showgrid=!1),v.lataxis&&(v.lataxis.showgrid=!1),t._template=v}for(var b=r("visible"),x=0;x<l.length;x++){var _,w=l[x],k=[30,10][x];if(d)_=f[w+"Range"];else{var D=o[w+"Span"],T=(D[p]||D["*"])/2,A=r("projection.rotation."+w.substr(0,3),f.projRotate[x]);_=[A-T,A+T]}var S=r(w+".range",_);r(w+".tick0"),r(w+".dtick",k),r(w+".showgrid",!!b&&void 0)&&(r(w+".gridcolor"),r(w+".gridwidth")),t[w]._ax={type:"linear",_id:w.slice(0,3),_traceIndices:s,setScale:n.identity,c2l:n.identity,r2l:n.identity,autorange:!0,range:S.slice(),_m:1,_input:{}}}var M=t.lonaxis.range,E=t.lataxis.range,C=M[0],N=M[1];C>0&&N<0&&(N+=360);var O,I,P,R=(C+N)/2;if(!h){var L=d?f.projRotate:[R,0,0];O=r("projection.rotation.lon",L[0]),r("projection.rotation.lat",L[1]),r("projection.rotation.roll",L[2]),r("showcoastlines",!d&&b)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!b&&void 0)&&r("oceancolor")}h?(I=-96.6,P=38.7):(I=d?R:O,P=(E[0]+E[1])/2),r("center.lon",I),r("center.lat",P),m&&(r("projection.tilt"),r("projection.distance")),g&&r("projection.parallels",f.projParallels||[0,60]),r("projection.scale"),r("showland",!!b&&void 0)&&r("landcolor"),r("showlakes",!!b&&void 0)&&r("lakecolor"),r("showrivers",!!b&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==u&&b)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",b),r("subunitcolor"),r("subunitwidth")),d||r("showframe",b)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete t.projection.scale,d?(delete t.center.lon,delete t.center.lat):y?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}t.exports=function(e,t,r){a(e,t,r,{type:"geo",attributes:s,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":503,"../get_data":593,"../subplot_defaults":632,"./constants":587,"./layout_attributes":590}],592:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},c={cursor:"auto"};function u(e,t){return n.behavior.zoom().translate(t.translate()).scale(t.scale())}function f(e,t,r){var n=e.id,o=e.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],f={},p={};function h(e,t){f[n+"."+e]=a.nestedProperty(l,e).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,f);var r=a.nestedProperty(u,e);r.get()!==t&&(r.set(t),a.nestedProperty(l,e).set(t),p[n+"."+e]=t)}r(h),h("projection.scale",t.scale()/e.fitScale),h("fitbounds",!1),o.emit("plotly_relayout",p)}function p(e,t){var r=u(0,t);function a(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){t.scale(n.event.scale).translate(n.event.translate),e.render();var r=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(e,t,a)})),r}function h(e,t){var r,a,i,o,s,p,h,d,m,g=u(0,t);function y(e){return t.invert(e)}function v(r){var n=t.rotate(),a=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return g.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),a=t.rotate(),i=t.translate(),o=a,s=y(r)})).on("zoom",(function(){if(p=n.mouse(this),function(e){var r=y(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>2||Math.abs(n[1]-e[1])>2}(r))return g.scale(t.scale()),void g.translate(t.translate());t.scale(n.event.scale),t.translate([i[0],n.event.translate[1]]),s?y(p)&&(d=y(p),h=[o[0]+(d[0]-s[0]),a[1],a[2]],t.rotate(h),o=h):s=y(r=p),m=!0,e.render();var l=t.rotate(),c=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(c),m&&f(e,t,v)})),g}function d(e,t){var r,a={r:t.rotate(),k:t.scale()},i=u(0,t),o=function(e){for(var t=0,r=arguments.length,a=[];++t<r;)a.push(arguments[t]);var i=n.dispatch.apply(null,a);return i.of=function(t,r){return function(a){var o;try{o=a.sourceEvent=n.event,a.target=e,n.event=a,i[a.type].apply(t,r)}finally{n.event=o}}},i}(i,"zoomstart","zoom","zoomend"),s=0,p=i.on;function h(e){s++||e({type:"zoomstart"})}function d(e){e({type:"zoom"})}function x(e){--s||e({type:"zoomend"})}function _(e){var r=t.rotate();e("projection.rotation.lon",-r[0]),e("projection.rotation.lat",-r[1])}return i.on("zoomstart",(function(){n.select(this).style(l);var e=n.mouse(this),s=t.rotate(),c=s,u=t.translate(),f=g(s);r=m(t,e),p.call(i,"zoom",(function(){var i=n.mouse(this);if(t.scale(a.k=n.event.scale),r){if(m(t,i)){t.rotate(s).translate(u);var l=m(t,i),p=v(r,l),h=k(y(f,p)),g=a.r=b(h,r,c);isFinite(g[0])&&isFinite(g[1])&&isFinite(g[2])||(g=c),t.rotate(g),c=g}}else r=m(t,e=i);d(o.of(this,arguments))})),h(o.of(this,arguments))})).on("zoomend",(function(){n.select(this).style(c),p.call(i,"zoom",null),x(o.of(this,arguments)),f(e,t,_)})).on("zoom.redraw",(function(){e.render();var r=t.rotate();e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})})),n.rebind(i,o,"on")}function m(e,t){var r=e.invert(t);return r&&isFinite(r[0])&&isFinite(r[1])&&function(e){var t=e[0]*o,r=e[1]*o,n=Math.cos(r);return[n*Math.cos(t),n*Math.sin(t),Math.sin(r)]}(r)}function g(e){var t=.5*e[0]*o,r=.5*e[1]*o,n=.5*e[2]*o,a=Math.sin(t),i=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(n),u=Math.cos(n);return[i*l*u+a*s*c,a*l*u-i*s*c,i*s*u+a*l*c,i*l*c-a*s*u]}function y(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=t[0],s=t[1],l=t[2],c=t[3];return[r*o-n*s-a*l-i*c,r*s+n*o+a*c-i*l,r*l-n*c+a*o+i*s,r*c+n*l-a*s+i*o]}function v(e,t){if(e&&t){var r=function(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]]}(e,t),n=Math.sqrt(D(r,r)),a=.5*Math.acos(Math.max(-1,Math.min(1,D(e,t)))),i=Math.sin(a)/n;return n&&[Math.cos(a),r[2]*i,-r[1]*i,r[0]*i]}}function b(e,t,r){var n=w(t,2,e[0]);n=w(n,1,e[1]),n=w(n,0,e[2]-r[2]);var a,i,o=t[0],l=t[1],c=t[2],u=n[0],f=n[1],p=n[2],h=Math.atan2(l,o)*s,d=Math.sqrt(o*o+l*l);Math.abs(f)>d?(i=(f>0?90:-90)-h,a=0):(i=Math.asin(f/d)*s-h,a=Math.sqrt(d*d-f*f));var m=180-i-2*h,g=(Math.atan2(p,u)-Math.atan2(c,a))*s,y=(Math.atan2(p,u)-Math.atan2(c,-a))*s;return x(r[0],r[1],i,g)<=x(r[0],r[1],m,y)?[i,g,r[2]]:[m,y,r[2]]}function x(e,t,r,n){var a=_(r-e),i=_(n-t);return Math.sqrt(a*a+i*i)}function _(e){return(e%360+540)%360-180}function w(e,t,r){var n=r*o,a=e.slice(),i=0===t?1:0,s=2===t?1:2,l=Math.cos(n),c=Math.sin(n);return a[i]=e[i]*l-e[s]*c,a[s]=e[s]*l+e[i]*c,a}function k(e){return[Math.atan2(2*(e[0]*e[1]+e[2]*e[3]),1-2*(e[1]*e[1]+e[2]*e[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(e[0]*e[2]-e[3]*e[1]))))*s,Math.atan2(2*(e[0]*e[3]+e[1]*e[2]),1-2*(e[2]*e[2]+e[3]*e[3]))*s]}function D(e,t){for(var r=0,n=0,a=e.length;n<a;++n)r+=e[n]*t[n];return r}t.exports=function(e,t){var r=e.projection;return(t._isScoped?p:t._isClipped?d:h)(e,r)}},{"../../lib":503,"../../registry":638,"@plotly/d3":58}],593:[function(e,t,r){"use strict";var n=e("../registry"),a=e("./cartesian/constants").SUBPLOT_PATTERN;r.getSubplotCalcData=function(e,t,r){var a=n.subplotsRegistry[t];if(!a)return[];for(var i=a.attr,o=[],s=0;s<e.length;s++){var l=e[s];l[0].trace[i]===r&&o.push(l)}return o},r.getModuleCalcData=function(e,t){var r,a=[],i=[];if(!(r="string"==typeof t?n.getModule(t).plot:"function"==typeof t?t:t.plot))return[a,e];for(var o=0;o<e.length;o++){var s=e[o],l=s[0].trace;!0===l.visible&&0!==l._length&&(l._module.plot===r?a.push(s):i.push(s))}return[a,i]},r.getSubplotData=function(e,t,r){if(!n.subplotsRegistry[t])return[];var i,o,s,l=n.subplotsRegistry[t].attr,c=[];if("gl2d"===t){var u=r.match(a);o="x"+u[1],s="y"+u[2]}for(var f=0;f<e.length;f++)i=e[f],"gl2d"===t&&n.traceIs(i,"gl2d")?i[l[0]]===o&&i[l[1]]===s&&c.push(i):i[l]===r&&c.push(i);return c}},{"../registry":638,"./cartesian/constants":561}],594:[function(e,t,r){"use strict";var n=e("mouse-change"),a=e("mouse-wheel"),i=e("mouse-event-offset"),o=e("../cartesian/constants"),s=e("has-passive-events");function l(e,t){this.element=e,this.plot=t,this.mouseListener=null,this.wheelListener=null,this.lastInputTime=Date.now(),this.lastPos=[0,0],this.boxEnabled=!1,this.boxInited=!1,this.boxStart=[0,0],this.boxEnd=[0,0],this.dragStart=[0,0]}t.exports=function(e){var t=e.mouseContainer,r=e.glplot,c=new l(t,r);function u(){e.xaxis.autorange=!1,e.yaxis.autorange=!1}function f(t,n,a){var i,s,l=e.calcDataBox(),f=r.viewBox,p=c.lastPos[0],h=c.lastPos[1],d=o.MINDRAG*r.pixelRatio,m=o.MINZOOM*r.pixelRatio;function g(t,r,n){var a=Math.min(r,n),i=Math.max(r,n);a!==i?(l[t]=a,l[t+2]=i,c.dataBox=l,e.setRanges(l)):(e.selectBox.selectBox=[0,0,1,1],e.glplot.setDirty())}switch(n*=r.pixelRatio,a*=r.pixelRatio,a=f[3]-f[1]-a,e.fullLayout.dragmode){case"zoom":if(t){var y=n/(f[2]-f[0])*(l[2]-l[0])+l[0],v=a/(f[3]-f[1])*(l[3]-l[1])+l[1];c.boxInited||(c.boxStart[0]=y,c.boxStart[1]=v,c.dragStart[0]=n,c.dragStart[1]=a),c.boxEnd[0]=y,c.boxEnd[1]=v,c.boxInited=!0,c.boxEnabled||c.boxStart[0]===c.boxEnd[0]&&c.boxStart[1]===c.boxEnd[1]||(c.boxEnabled=!0);var b=Math.abs(c.dragStart[0]-n)<m,x=Math.abs(c.dragStart[1]-a)<m;if(!function(){for(var t=e.graphDiv._fullLayout._axisConstraintGroups,r=e.xaxis._id,n=e.yaxis._id,a=0;a<t.length;a++)if(-1!==t[a][r]){if(-1!==t[a][n])return!0;break}return!1}()||b&&x)b&&(c.boxEnd[0]=c.boxStart[0]),x&&(c.boxEnd[1]=c.boxStart[1]);else{i=c.boxEnd[0]-c.boxStart[0],s=c.boxEnd[1]-c.boxStart[1];var _=(l[3]-l[1])/(l[2]-l[0]);Math.abs(i*_)>Math.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(i)*_*(s>=0?1:-1),c.boxEnd[1]<l[1]?(c.boxEnd[1]=l[1],c.boxEnd[0]=c.boxStart[0]+(l[1]-c.boxStart[1])/Math.abs(_)):c.boxEnd[1]>l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(i>=0?1:-1),c.boxEnd[0]<l[0]?(c.boxEnd[0]=l[0],c.boxEnd[1]=c.boxStart[1]+(l[0]-c.boxStart[0])*Math.abs(_)):c.boxEnd[0]>l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(i=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],i||s?(i&&(g(0,c.boxStart[0],c.boxEnd[0]),e.xaxis.autorange=!1),s&&(g(1,c.boxStart[1],c.boxEnd[1]),e.yaxis.autorange=!1),e.relayoutCallback()):e.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,t?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=a),Math.abs(c.dragStart[0]-n)<d&&(n=c.dragStart[0]),Math.abs(c.dragStart[1]-a)<d&&(a=c.dragStart[1]),i=(p-n)*(l[2]-l[0])/(r.viewBox[2]-r.viewBox[0]),s=(h-a)*(l[3]-l[1])/(r.viewBox[3]-r.viewBox[1]),l[0]+=i,l[2]+=i,l[1]+=s,l[3]+=s,e.setRanges(l),c.panning=!0,c.lastInputTime=Date.now(),u(),e.cameraChanged(),e.handleAnnotations()):c.panning&&(c.panning=!1,e.relayoutCallback())}c.lastPos[0]=n,c.lastPos[1]=a}return c.mouseListener=n(t,f),t.addEventListener("touchstart",(function(e){var r=i(e.changedTouches[0],t);f(0,r[0],r[1]),f(1,r[0],r[1]),e.preventDefault()}),!!s&&{passive:!1}),t.addEventListener("touchmove",(function(e){e.preventDefault();var r=i(e.changedTouches[0],t);f(1,r[0],r[1]),e.preventDefault()}),!!s&&{passive:!1}),t.addEventListener("touchend",(function(e){f(0,c.lastPos[0],c.lastPos[1]),e.preventDefault()}),!!s&&{passive:!1}),c.wheelListener=a(t,(function(t,n){if(!e.scrollZoom)return!1;var a=e.calcDataBox(),i=r.viewBox,o=c.lastPos[0],s=c.lastPos[1],l=Math.exp(5*n/(i[3]-i[1])),f=o/(i[2]-i[0])*(a[2]-a[0])+a[0],p=s/(i[3]-i[1])*(a[3]-a[1])+a[1];return a[0]=(a[0]-f)*l+f,a[2]=(a[2]-f)*l+f,a[1]=(a[1]-p)*l+p,a[3]=(a[3]-p)*l+p,e.setRanges(a),c.lastInputTime=Date.now(),u(),e.cameraChanged(),e.handleAnnotations(),e.relayoutCallback(),!0}),!0),c}},{"../cartesian/constants":561,"has-passive-events":229,"mouse-change":241,"mouse-event-offset":242,"mouse-wheel":244}],595:[function(e,t,r){"use strict";var n=e("../cartesian/axes"),a=e("../../lib/str2rgbarray");function i(e){this.scene=e,this.gl=e.gl,this.pixelRatio=e.pixelRatio,this.screenBox=[0,0,1,1],this.viewBox=[0,0,1,1],this.dataBox=[-1,-1,1,1],this.borderLineEnable=[!1,!1,!1,!1],this.borderLineWidth=[1,1,1,1],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.ticks=[[],[]],this.tickEnable=[!0,!0,!1,!1],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labels=["x","y"],this.labelEnable=[!0,!0,!1,!1],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelPad=[15,15,15,15],this.labelSize=[12,12],this.labelFont=["sans-serif","sans-serif"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.title="",this.titleEnable=!0,this.titleCenter=[0,0,0,0],this.titleAngle=0,this.titleColor=[0,0,0,1],this.titleFont="sans-serif",this.titleSize=18,this.gridLineEnable=[!0,!0],this.gridLineColor=[[0,0,0,.5],[0,0,0,.5]],this.gridLineWidth=[1,1],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[1,1],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.static=this.scene.staticPlot}var o=i.prototype,s=["xaxis","yaxis"];o.merge=function(e){var t,r,n,i,o,l,c,u,f,p,h;for(this.titleEnable=!1,this.backgroundColor=a(e.plot_bgcolor),p=0;p<2;++p){var d=(t=s[p]).charAt(0);for(n=(r=e[this.scene[t]._name]).title.text===this.scene.fullLayout._dfltTitle[d]?"":r.title.text,h=0;h<=2;h+=2)this.labelEnable[p+h]=!1,this.labels[p+h]=n,this.labelColor[p+h]=a(r.title.font.color),this.labelFont[p+h]=r.title.font.family,this.labelSize[p+h]=r.title.font.size,this.labelPad[p+h]=this.getLabelPad(t,r),this.tickEnable[p+h]=!1,this.tickColor[p+h]=a((r.tickfont||{}).color),this.tickAngle[p+h]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[p+h]=this.getTickPad(r),this.tickMarkLength[p+h]=0,this.tickMarkWidth[p+h]=r.tickwidth||0,this.tickMarkColor[p+h]=a(r.tickcolor),this.borderLineEnable[p+h]=!1,this.borderLineColor[p+h]=a(r.linecolor),this.borderLineWidth[p+h]=r.linewidth||0;c=this.hasSharedAxis(r),o=this.hasAxisInDfltPos(t,r)&&!c,l=this.hasAxisInAltrPos(t,r)&&!c,i=r.mirror||!1,u=c?-1!==String(i).indexOf("all"):!!i,f=c?"allticks"===i:-1!==String(i).indexOf("ticks"),o?this.labelEnable[p]=!0:l&&(this.labelEnable[p+2]=!0),o?this.tickEnable[p]=r.showticklabels:l&&(this.tickEnable[p+2]=r.showticklabels),(o||u)&&(this.borderLineEnable[p]=r.showline),(l||u)&&(this.borderLineEnable[p+2]=r.showline),(o||f)&&(this.tickMarkLength[p]=this.getTickMarkLength(r)),(l||f)&&(this.tickMarkLength[p+2]=this.getTickMarkLength(r)),this.gridLineEnable[p]=r.showgrid,this.gridLineColor[p]=a(r.gridcolor),this.gridLineWidth[p]=r.gridwidth,this.zeroLineEnable[p]=r.zeroline,this.zeroLineColor[p]=a(r.zerolinecolor),this.zeroLineWidth[p]=r.zerolinewidth}},o.hasSharedAxis=function(e){var t=this.scene,r=t.fullLayout._subplots.gl2d;return 0!==n.findSubplotsWithAxis(r,e).indexOf(t.id)},o.hasAxisInDfltPos=function(e,t){var r=t.side;return"xaxis"===e?"bottom"===r:"yaxis"===e?"left"===r:void 0},o.hasAxisInAltrPos=function(e,t){var r=t.side;return"xaxis"===e?"top"===r:"yaxis"===e?"right"===r:void 0},o.getLabelPad=function(e,t){var r=t.title.font.size,n=t.showticklabels;return"xaxis"===e?"top"===t.side?r*(1.5+(n?1:0))-10:r*(1.5+(n?.5:0))-10:"yaxis"===e?"right"===t.side?10+r*(1.5+(n?1:.5)):10+r*(1.5+(n?.5:0)):void 0},o.getTickPad=function(e){return"outside"===e.ticks?10+e.ticklen:15},o.getTickMarkLength=function(e){if(!e.ticks)return 0;var t=e.ticklen;return"inside"===e.ticks?-t:t},t.exports=function(e){return new i(e)}},{"../../lib/str2rgbarray":528,"../cartesian/axes":554}],596:[function(e,t,r){"use strict";var n=e("../../plot_api/edit_types").overrideAll,a=e("./scene2d"),i=e("../layout_attributes"),o=e("../../constants/xmlns_namespaces"),s=e("../cartesian/constants"),l=e("../cartesian"),c=e("../../components/fx/layout_attributes"),u=e("../get_data").getSubplotData;r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=s.idRegex,r.attrRegex=s.attrRegex,r.attributes=e("../cartesian/attributes"),r.supplyLayoutDefaults=function(e,t,r){t._has("cartesian")||l.supplyLayoutDefaults(e,t,r)},r.layoutAttrOverrides=n(l.layoutAttributes,"plot","from-root"),r.baseLayoutAttrOverrides=n({plot_bgcolor:i.plot_bgcolor,hoverlabel:c.hoverlabel},"plot","nested"),r.plot=function(e){for(var t=e._fullLayout,r=e._fullData,n=t._subplots.gl2d,i=0;i<n.length;i++){var o=n[i],s=t._plots[o],l=u(r,"gl2d",o),c=s._scene2d;void 0===c&&(c=new a({id:o,graphDiv:e,container:e.querySelector(".gl-container"),staticPlot:e._context.staticPlot,plotGlPixelRatio:e._context.plotGlPixelRatio},t),s._scene2d=c),c.plot(l,e.calcdata,t,e.layout)}},r.clean=function(e,t,r,n){for(var a=n._subplots.gl2d||[],i=0;i<a.length;i++){var o=a[i],s=n._plots[o];s._scene2d&&0===u(e,"gl2d",o).length&&(s._scene2d.destroy(),delete n._plots[o])}l.clean.apply(this,arguments)},r.drawFramework=function(e){e._context.staticPlot||l.drawFramework(e)},r.toSVG=function(e){for(var t=e._fullLayout,r=t._subplots.gl2d,n=0;n<r.length;n++){var a=t._plots[r[n]]._scene2d,i=a.toImage("png");t._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":i,x:0,y:0,width:"100%",height:"100%",preserveAspectRatio:"none"}),a.destroy()}},r.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots.gl2d,n=0;n<r.length;n++)t._plots[r[n]]._scene2d.updateFx(t.dragmode)}},{"../../components/fx/layout_attributes":407,"../../constants/xmlns_namespaces":480,"../../plot_api/edit_types":536,"../cartesian":568,"../cartesian/attributes":552,"../cartesian/constants":561,"../get_data":593,"../layout_attributes":610,"./scene2d":597}],597:[function(e,t,r){"use strict";var n,a,i=e("../../registry"),o=e("../../plots/cartesian/axes"),s=e("../../components/fx"),l=e("../../../stackgl_modules").gl_plot2d,c=e("../../../stackgl_modules").gl_spikes2d,u=e("../../../stackgl_modules").gl_select_box,f=e("webgl-context"),p=e("./convert"),h=e("./camera"),d=e("../../lib/show_no_webgl_msg"),m=e("../cartesian/constraints"),g=m.enforce,y=m.clean,v=e("../cartesian/autorange").doAutoRange,b=e("../../components/dragelement/helpers"),x=b.drawMode,_=b.selectMode,w=["xaxis","yaxis"],k=e("../cartesian/constants").SUBPLOT_PATTERN;function D(e,t){this.container=e.container,this.graphDiv=e.graphDiv,this.pixelRatio=e.plotGlPixelRatio||window.devicePixelRatio,this.id=e.id,this.staticPlot=!!e.staticPlot,this.scrollZoom=this.graphDiv._context._scrollZoom.cartesian,this.fullData=null,this.updateRefs(t),this.makeFramework(),this.stopped||(this.glplotOptions=p(this),this.glplotOptions.merge(t),this.glplot=l(this.glplotOptions),this.camera=h(this),this.traces={},this.spikes=c(this.glplot),this.selectBox=u(this.glplot,{innerFill:!1,outerFill:!0}),this.lastButtonState=0,this.pickResult=null,this.isMouseOver=!0,this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw())}t.exports=D;var T=D.prototype;T.makeFramework=function(){if(this.staticPlot){if(!(a||(n=document.createElement("canvas"),a=f({canvas:n,preserveDrawingBuffer:!1,premultipliedAlpha:!0,antialias:!0}))))throw new Error("Error creating static canvas/context for image server");this.canvas=n,this.gl=a}else{var e=this.container.querySelector(".gl-canvas-focus"),t=f({canvas:e,preserveDrawingBuffer:!0,premultipliedAlpha:!0});if(!t)return d(this),void(this.stopped=!0);this.canvas=e,this.gl=t}var r=this.canvas;r.style.width="100%",r.style.height="100%",r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style["pointer-events"]="none",this.updateSize(r);var i=this.svgContainer=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none";var o=this.mouseContainer=document.createElement("div");o.style.position="absolute",o.style["pointer-events"]="auto",this.pickCanvas=this.container.querySelector(".gl-canvas-pick");var s=this.container;s.appendChild(i),s.appendChild(o);var l=this;o.addEventListener("mouseout",(function(){l.isMouseOver=!1,l.unhover()})),o.addEventListener("mouseover",(function(){l.isMouseOver=!0}))},T.toImage=function(e){e||(e="png"),this.stopped=!0,this.staticPlot&&this.container.appendChild(n),this.updateSize(this.canvas);var t=this.glplot.gl,r=t.drawingBufferWidth,a=t.drawingBufferHeight;t.clearColor(1,1,1,0),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.glplot.setDirty(),this.glplot.draw(),t.bindFramebuffer(t.FRAMEBUFFER,null);var i=new Uint8Array(r*a*4);t.readPixels(0,0,r,a,t.RGBA,t.UNSIGNED_BYTE,i);for(var o=0,s=a-1;o<s;++o,--s)for(var l=0;l<r;++l)for(var c=0;c<4;++c){var u=i[4*(r*o+l)+c];i[4*(r*o+l)+c]=i[4*(r*s+l)+c],i[4*(r*s+l)+c]=u}var f=document.createElement("canvas");f.width=r,f.height=a;var p,h=f.getContext("2d"),d=h.createImageData(r,a);switch(d.data.set(i),h.putImageData(d,0,0),e){case"jpeg":p=f.toDataURL("image/jpeg");break;case"webp":p=f.toDataURL("image/webp");break;default:p=f.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(n),p},T.updateSize=function(e){e||(e=this.canvas);var t=this.pixelRatio,r=this.fullLayout,n=r.width,a=r.height,i=0|Math.ceil(t*n),o=0|Math.ceil(t*a);return e.width===i&&e.height===o||(e.width=i,e.height=o),e},T.computeTickMarks=function(){this.xaxis.setScale(),this.yaxis.setScale();for(var e=[o.calcTicks(this.xaxis),o.calcTicks(this.yaxis)],t=0;t<2;++t)for(var r=0;r<e[t].length;++r)e[t][r].text=e[t][r].text+"";return e},T.updateRefs=function(e){this.fullLayout=e;var t=this.id.match(k),r="xaxis"+t[1],n="yaxis"+t[2];this.xaxis=this.fullLayout[r],this.yaxis=this.fullLayout[n]},T.relayoutCallback=function(){var e=this.graphDiv,t=this.xaxis,r=this.yaxis,n=e.layout,a={},o=a[t._name+".range"]=t.range.slice(),s=a[r._name+".range"]=r.range.slice();a[t._name+".autorange"]=t.autorange,a[r._name+".autorange"]=r.autorange,i.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,a);var l=n[t._name];l.range=o,l.autorange=t.autorange;var c=n[r._name];c.range=s,c.autorange=r.autorange,a.lastInputTime=this.camera.lastInputTime,e.emit("plotly_relayout",a)},T.cameraChanged=function(){var e=this.camera;this.glplot.setDataBox(this.calcDataBox());var t=this.computeTickMarks();(function(e,t){for(var r=0;r<2;++r){var n=e[r],a=t[r];if(n.length!==a.length)return!0;for(var i=0;i<n.length;++i)if(n[i].x!==a[i].x)return!0}return!1})(t,this.glplotOptions.ticks)&&(this.glplotOptions.ticks=t,this.glplotOptions.dataBox=e.dataBox,this.glplot.update(this.glplotOptions),this.handleAnnotations())},T.handleAnnotations=function(){for(var e=this.graphDiv,t=this.fullLayout.annotations,r=0;r<t.length;r++){var n=t[r];n.xref===this.xaxis._id&&n.yref===this.yaxis._id&&i.getComponentMethod("annotations","drawOne")(e,r)}},T.destroy=function(){if(this.glplot){var e=this.traces;e&&Object.keys(e).map((function(t){e[t].dispose(),delete e[t]})),this.glplot.dispose(),this.container.removeChild(this.svgContainer),this.container.removeChild(this.mouseContainer),this.fullData=null,this.glplot=null,this.stopped=!0,this.camera.mouseListener.enabled=!1,this.mouseContainer.removeEventListener("wheel",this.camera.wheelListener),this.camera=null}},T.plot=function(e,t,r){var n=this.glplot;this.updateRefs(r),this.xaxis.clearCalc(),this.yaxis.clearCalc(),this.updateTraces(e,t),this.updateFx(r.dragmode);var a=r.width,i=r.height;this.updateSize(this.canvas);var o=this.glplotOptions;o.merge(r),o.screenBox=[0,0,a,i];var s={_fullLayout:{_axisConstraintGroups:r._axisConstraintGroups,xaxis:this.xaxis,yaxis:this.yaxis,_size:r._size}};y(s,this.xaxis),y(s,this.yaxis);var l,c,u=r._size,f=this.xaxis.domain,p=this.yaxis.domain;for(o.viewBox=[u.l+f[0]*u.w,u.b+p[0]*u.h,a-u.r-(1-f[1])*u.w,i-u.t-(1-p[1])*u.h],this.mouseContainer.style.width=u.w*(f[1]-f[0])+"px",this.mouseContainer.style.height=u.h*(p[1]-p[0])+"px",this.mouseContainer.height=u.h*(p[1]-p[0]),this.mouseContainer.style.left=u.l+f[0]*u.w+"px",this.mouseContainer.style.top=u.t+(1-p[1])*u.h+"px",c=0;c<2;++c)(l=this[w[c]])._length=o.viewBox[c+2]-o.viewBox[c],v(this.graphDiv,l),l.setScale();g(s),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},T.calcDataBox=function(){var e=this.xaxis,t=this.yaxis,r=e.range,n=t.range,a=e.r2l,i=t.r2l;return[a(r[0]),i(n[0]),a(r[1]),i(n[1])]},T.setRanges=function(e){var t=this.xaxis,r=this.yaxis,n=t.l2r,a=r.l2r;t.range=[n(e[0]),n(e[2])],r.range=[a(e[1]),a(e[3])]},T.updateTraces=function(e,t){var r,n,a,i=Object.keys(this.traces);this.fullData=e;e:for(r=0;r<i.length;r++){var o=i[r],s=this.traces[o];for(n=0;n<e.length;n++)if((a=e[n]).uid===o&&a.type===s.type)continue e;s.dispose(),delete this.traces[o]}for(r=0;r<e.length;r++){a=e[r];var l=t[r],c=this.traces[a.uid];c?c.update(a,l):(c=a._module.plot(this,a,l),this.traces[a.uid]=c)}this.glplot.objects.sort((function(e,t){return e._trace.index-t._trace.index}))},T.updateFx=function(e){_(e)||x(e)?(this.pickCanvas.style["pointer-events"]="none",this.mouseContainer.style["pointer-events"]="none"):(this.pickCanvas.style["pointer-events"]="auto",this.mouseContainer.style["pointer-events"]="auto"),this.mouseContainer.style.cursor="pan"===e?"move":"zoom"===e?"crosshair":null},T.emitPointAction=function(e,t){for(var r,n=e.trace.uid,a=e.pointIndex,i=0;i<this.fullData.length;i++)this.fullData[i].uid===n&&(r=this.fullData[i]);var o={x:e.traceCoord[0],y:e.traceCoord[1],curveNumber:r.index,pointNumber:a,data:r._input,fullData:this.fullData,xaxis:this.xaxis,yaxis:this.yaxis};s.appendArrayPointValue(o,r,a),this.graphDiv.emit(t,{points:[o]})},T.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var e=this.glplot,t=this.camera,r=t.mouseListener,n=1===this.lastButtonState&&0===r.buttons,a=this.fullLayout;this.lastButtonState=r.buttons,this.cameraChanged();var i,o=r.x*e.pixelRatio,l=this.canvas.height-e.pixelRatio*r.y;if(t.boxEnabled&&"zoom"===a.dragmode){this.selectBox.enabled=!0;for(var c=this.selectBox.selectBox=[Math.min(t.boxStart[0],t.boxEnd[0]),Math.min(t.boxStart[1],t.boxEnd[1]),Math.max(t.boxStart[0],t.boxEnd[0]),Math.max(t.boxStart[1],t.boxEnd[1])],u=0;u<2;u++)t.boxStart[u]===t.boxEnd[u]&&(c[u]=e.dataBox[u],c[u+2]=e.dataBox[u+2]);e.setDirty()}else if(!t.panning&&this.isMouseOver){this.selectBox.enabled=!1;var f=a._size,p=this.xaxis.domain,h=this.yaxis.domain,d=(i=e.pick(o/e.pixelRatio+f.l+p[0]*f.w,l/e.pixelRatio-(f.t+(1-h[1])*f.h)))&&i.object._trace.handlePick(i);if(d&&n&&this.emitPointAction(d,"plotly_click"),i&&"skip"!==i.object._trace.hoverinfo&&a.hovermode&&d&&(!this.lastPickResult||this.lastPickResult.traceUid!==d.trace.uid||this.lastPickResult.dataCoord[0]!==d.dataCoord[0]||this.lastPickResult.dataCoord[1]!==d.dataCoord[1])){var m=d;this.lastPickResult={traceUid:d.trace?d.trace.uid:null,dataCoord:d.dataCoord.slice()},this.spikes.update({center:i.dataCoord}),m.screenCoord=[((e.viewBox[2]-e.viewBox[0])*(i.dataCoord[0]-e.dataBox[0])/(e.dataBox[2]-e.dataBox[0])+e.viewBox[0])/e.pixelRatio,(this.canvas.height-(e.viewBox[3]-e.viewBox[1])*(i.dataCoord[1]-e.dataBox[1])/(e.dataBox[3]-e.dataBox[1])-e.viewBox[1])/e.pixelRatio],this.emitPointAction(d,"plotly_hover");var g=this.fullData[m.trace.index]||{},y=m.pointIndex,v=s.castHoverinfo(g,a,y);if(v&&"all"!==v){var b=v.split("+");-1===b.indexOf("x")&&(m.traceCoord[0]=void 0),-1===b.indexOf("y")&&(m.traceCoord[1]=void 0),-1===b.indexOf("z")&&(m.traceCoord[2]=void 0),-1===b.indexOf("text")&&(m.textLabel=void 0),-1===b.indexOf("name")&&(m.name=void 0)}s.loneHover({x:m.screenCoord[0],y:m.screenCoord[1],xLabel:this.hoverFormatter("xaxis",m.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",m.traceCoord[1]),zLabel:m.traceCoord[2],text:m.textLabel,name:m.name,color:s.castHoverOption(g,y,"bgcolor")||m.color,borderColor:s.castHoverOption(g,y,"bordercolor"),fontFamily:s.castHoverOption(g,y,"font.family"),fontSize:s.castHoverOption(g,y,"font.size"),fontColor:s.castHoverOption(g,y,"font.color"),nameLength:s.castHoverOption(g,y,"namelength"),textAlign:s.castHoverOption(g,y,"align")},{container:this.svgContainer,gd:this.graphDiv})}}i||this.unhover(),e.draw()}},T.unhover=function(){this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,this.graphDiv.emit("plotly_unhover"),s.loneUnhover(this.svgContainer))},T.hoverFormatter=function(e,t){if(void 0!==t){var r=this[e];return o.tickText(r,r.c2l(t),"hover").text}}},{"../../../stackgl_modules":1120,"../../components/dragelement/helpers":384,"../../components/fx":406,"../../lib/show_no_webgl_msg":525,"../../plots/cartesian/axes":554,"../../registry":638,"../cartesian/autorange":553,"../cartesian/constants":561,"../cartesian/constraints":562,"./camera":594,"./convert":595,"webgl-context":331}],598:[function(e,t,r){"use strict";var n=e("../../plot_api/edit_types").overrideAll,a=e("../../components/fx/layout_attributes"),i=e("./scene"),o=e("../get_data").getSubplotData,s=e("../../lib"),l=e("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=e("./layout/attributes"),r.layoutAttributes=e("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:a.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=e("./layout/defaults"),r.plot=function(e){for(var t=e._fullLayout,r=e._fullData,n=t._subplots.gl3d,a=0;a<n.length;a++){var s=n[a],l=o(r,"gl3d",s),c=t[s],u=c.camera,f=c._scene;f||(f=new i({id:s,graphDiv:e,container:e.querySelector(".gl-container"),staticPlot:e._context.staticPlot,plotGlPixelRatio:e._context.plotGlPixelRatio,camera:u},t),c._scene=f),f.viewInitial||(f.viewInitial={up:{x:u.up.x,y:u.up.y,z:u.up.z},eye:{x:u.eye.x,y:u.eye.y,z:u.eye.z},center:{x:u.center.x,y:u.center.y,z:u.center.z}}),f.plot(l,t,e.layout)}},r.clean=function(e,t,r,n){for(var a=n._subplots.gl3d||[],i=0;i<a.length;i++){var o=a[i];!t[o]&&n[o]._scene&&(n[o]._scene.destroy(),n._infolayer&&n._infolayer.selectAll(".annotation-"+o).remove())}},r.toSVG=function(e){for(var t=e._fullLayout,r=t._subplots.gl3d,n=t._size,a=0;a<r.length;a++){var i=t[r[a]],o=i.domain,s=i._scene,c=s.toImage("png");t._glimages.append("svg:image").attr({xmlns:l.svg,"xlink:href":c,x:n.l+n.w*o.x[0],y:n.t+n.h*(1-o.y[1]),width:n.w*(o.x[1]-o.x[0]),height:n.h*(o.y[1]-o.y[0]),preserveAspectRatio:"none"}),s.destroy()}},r.cleanId=function(e){if(e.match(/^scene[0-9]*$/)){var t=e.substr(5);return"1"===t&&(t=""),"scene"+t}},r.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots.gl3d,n=0;n<r.length;n++)t[r[n]]._scene.updateFx(t.dragmode,t.hovermode)}},{"../../components/fx/layout_attributes":407,"../../constants/xmlns_namespaces":480,"../../lib":503,"../../plot_api/edit_types":536,"../get_data":593,"./layout/attributes":599,"./layout/defaults":603,"./layout/layout_attributes":604,"./scene":608}],599:[function(e,t,r){"use strict";t.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}},{}],600:[function(e,t,r){"use strict";var n=e("../../../components/color"),a=e("../../cartesian/layout_attributes"),i=e("../../../lib/extend").extendFlat,o=e("../../../plot_api/edit_types").overrideAll;t.exports=o({visible:a.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:n.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:a.color,categoryorder:a.categoryorder,categoryarray:a.categoryarray,title:{text:a.title.text,font:a.title.font},type:i({},a.type,{values:["-","linear","log","date","category"]}),autotypenumbers:a.autotypenumbers,autorange:a.autorange,rangemode:a.rangemode,range:i({},a.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:a.tickmode,nticks:a.nticks,tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:a.ticks,mirror:a.mirror,ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,showticklabels:a.showticklabels,tickfont:a.tickfont,tickangle:a.tickangle,tickprefix:a.tickprefix,showtickprefix:a.showtickprefix,ticksuffix:a.ticksuffix,showticksuffix:a.showticksuffix,showexponent:a.showexponent,exponentformat:a.exponentformat,minexponent:a.minexponent,separatethousands:a.separatethousands,tickformat:a.tickformat,tickformatstops:a.tickformatstops,hoverformat:a.hoverformat,showline:a.showline,linecolor:a.linecolor,linewidth:a.linewidth,showgrid:a.showgrid,gridcolor:i({},a.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:a.gridwidth,zeroline:a.zeroline,zerolinecolor:a.zerolinecolor,zerolinewidth:a.zerolinewidth,_deprecated:{title:a._deprecated.title,titlefont:a._deprecated.titlefont}},"plot","from-root")},{"../../../components/color":366,"../../../lib/extend":493,"../../../plot_api/edit_types":536,"../../cartesian/layout_attributes":569}],601:[function(e,t,r){"use strict";var n=e("tinycolor2").mix,a=e("../../../lib"),i=e("../../../plot_api/plot_template"),o=e("./axis_attributes"),s=e("../../cartesian/type_defaults"),l=e("../../cartesian/axis_defaults"),c=["xaxis","yaxis","zaxis"];t.exports=function(e,t,r){var u,f;function p(e,t){return a.coerce(u,f,o,e,t)}for(var h=0;h<c.length;h++){var d=c[h];u=e[d]||{},(f=i.newContainer(t,d))._id=d[0]+r.scene,f._name=d,s(u,f,p,r),l(u,f,p,{font:r.font,letter:d[0],data:r.data,showGrid:!0,noTickson:!0,noTicklabelmode:!0,noTicklabelposition:!0,noTicklabeloverflow:!0,bgColor:r.bgColor,calendar:r.calendar},r.fullLayout),p("gridcolor",n(f.color,r.bgColor,13600/187).toRgbString()),p("title.text",d[0]),f.setScale=a.noop,p("showspikes")&&(p("spikesides"),p("spikethickness"),p("spikecolor",f.color)),p("showaxeslabels"),p("showbackground")&&p("backgroundcolor")}}},{"../../../lib":503,"../../../plot_api/plot_template":543,"../../cartesian/axis_defaults":556,"../../cartesian/type_defaults":582,"./axis_attributes":600,tinycolor2:312}],602:[function(e,t,r){"use strict";var n=e("../../../lib/str2rgbarray"),a=e("../../../lib"),i=["xaxis","yaxis","zaxis"];function o(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}o.prototype.merge=function(e,t){for(var r=0;r<3;++r){var o=t[i[r]];o.visible?(this.labels[r]=e._meta?a.templateString(o.title.text,e._meta):o.title.text,"font"in o.title&&(o.title.font.color&&(this.labelColor[r]=n(o.title.font.color)),o.title.font.family&&(this.labelFont[r]=o.title.font.family),o.title.font.size&&(this.labelSize[r]=o.title.font.size)),"showline"in o&&(this.lineEnable[r]=o.showline),"linecolor"in o&&(this.lineColor[r]=n(o.linecolor)),"linewidth"in o&&(this.lineWidth[r]=o.linewidth),"showgrid"in o&&(this.gridEnable[r]=o.showgrid),"gridcolor"in o&&(this.gridColor[r]=n(o.gridcolor)),"gridwidth"in o&&(this.gridWidth[r]=o.gridwidth),"log"===o.type?this.zeroEnable[r]=!1:"zeroline"in o&&(this.zeroEnable[r]=o.zeroline),"zerolinecolor"in o&&(this.zeroLineColor[r]=n(o.zerolinecolor)),"zerolinewidth"in o&&(this.zeroLineWidth[r]=o.zerolinewidth),"ticks"in o&&o.ticks?this.lineTickEnable[r]=!0:this.lineTickEnable[r]=!1,"ticklen"in o&&(this.lineTickLength[r]=this._defaultLineTickLength[r]=o.ticklen),"tickcolor"in o&&(this.lineTickColor[r]=n(o.tickcolor)),"tickwidth"in o&&(this.lineTickWidth[r]=o.tickwidth),"tickangle"in o&&(this.tickAngle[r]="auto"===o.tickangle?-3600:Math.PI*-o.tickangle/180),"showticklabels"in o&&(this.tickEnable[r]=o.showticklabels),"tickfont"in o&&(o.tickfont.color&&(this.tickColor[r]=n(o.tickfont.color)),o.tickfont.family&&(this.tickFont[r]=o.tickfont.family),o.tickfont.size&&(this.tickSize[r]=o.tickfont.size)),"mirror"in o?-1!==["ticks","all","allticks"].indexOf(o.mirror)?(this.lineTickMirror[r]=!0,this.lineMirror[r]=!0):!0===o.mirror?(this.lineTickMirror[r]=!1,this.lineMirror[r]=!0):(this.lineTickMirror[r]=!1,this.lineMirror[r]=!1):this.lineMirror[r]=!1,"showbackground"in o&&!1!==o.showbackground?(this.backgroundEnable[r]=!0,this.backgroundColor[r]=n(o.backgroundcolor)):this.backgroundEnable[r]=!1):(this.tickEnable[r]=!1,this.labelEnable[r]=!1,this.lineEnable[r]=!1,this.lineTickEnable[r]=!1,this.gridEnable[r]=!1,this.zeroEnable[r]=!1,this.backgroundEnable[r]=!1)}},t.exports=function(e,t){var r=new o;return r.merge(e,t),r}},{"../../../lib":503,"../../../lib/str2rgbarray":528}],603:[function(e,t,r){"use strict";var n=e("../../../lib"),a=e("../../../components/color"),i=e("../../../registry"),o=e("../../subplot_defaults"),s=e("./axis_defaults"),l=e("./layout_attributes"),c=e("../../get_data").getSubplotData;function u(e,t,r,n){for(var o=r("bgcolor"),l=a.combine(o,n.paper_bgcolor),u=["up","center","eye"],f=0;f<u.length;f++)r("camera."+u[f]+".x"),r("camera."+u[f]+".y"),r("camera."+u[f]+".z");r("camera.projection.type");var p=!!r("aspectratio.x")&&!!r("aspectratio.y")&&!!r("aspectratio.z"),h=r("aspectmode",p?"manual":"auto");p||(e.aspectratio=t.aspectratio={x:1,y:1,z:1},"manual"===h&&(t.aspectmode="auto"),e.aspectmode=t.aspectmode);var d=c(n.fullData,"gl3d",n.id);s(e,t,{font:n.font,scene:n.id,data:d,bgColor:l,calendar:n.calendar,autotypenumbersDflt:n.autotypenumbersDflt,fullLayout:n.fullLayout}),i.getComponentMethod("annotations3d","handleDefaults")(e,t,n);var m=n.getDfltFromLayout("dragmode");if(!1!==m&&!m)if(m="orbit",e.camera&&e.camera.up){var g=e.camera.up.x,y=e.camera.up.y,v=e.camera.up.z;0!==v&&(g&&y&&v?v/Math.sqrt(g*g+y*y+v*v)>.999&&(m="turntable"):m="turntable")}else m="turntable";r("dragmode",m),r("hovermode",n.getDfltFromLayout("hovermode"))}t.exports=function(e,t,r){var a=t._basePlotModules.length>1;o(e,t,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:t,font:t.font,fullData:r,getDfltFromLayout:function(t){if(!a)return n.validate(e[t],l[t])?e[t]:void 0},autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,calendar:t.calendar})}},{"../../../components/color":366,"../../../lib":503,"../../../registry":638,"../../get_data":593,"../../subplot_defaults":632,"./axis_defaults":601,"./layout_attributes":604}],604:[function(e,t,r){"use strict";var n=e("./axis_attributes"),a=e("../../domain").attributes,i=e("../../../lib/extend").extendFlat,o=e("../../../lib").counterRegex;function s(e,t,r){return{x:{valType:"number",dflt:e,editType:"camera"},y:{valType:"number",dflt:t,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}t.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(s(0,0,1),{}),center:i(s(0,0,0),{}),eye:i(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:a({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":503,"../../../lib/extend":493,"../../domain":584,"./axis_attributes":600}],605:[function(e,t,r){"use strict";var n=e("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];function i(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}i.prototype.merge=function(e){for(var t=0;t<3;++t){var r=e[a[t]];r.visible?(this.enabled[t]=r.showspikes,this.colors[t]=n(r.spikecolor),this.drawSides[t]=r.spikesides,this.lineWidth[t]=r.spikethickness):(this.enabled[t]=!1,this.drawSides[t]=!1)}},t.exports=function(e){var t=new i;return t.merge(e),t}},{"../../../lib/str2rgbarray":528}],606:[function(e,t,r){"use strict";t.exports=function(e){for(var t=e.axesOptions,r=e.glplot.axesPixels,s=e.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[i[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/e.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/e.dataScale[c],u.range[1]=r[c].hi/e.dataScale[c],u._m=1/(e.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var f=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var p=u.nticks||a.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/p)}for(var h=n.calcTicks(u,{msUTC:!0}),d=0;d<h.length;++d)h[d].x=h[d].x*e.dataScale[c],"date"===u.type&&(h[d].text=h[d].text.replace(/\<br\>/g," "));l[c]=h,u.tickmode=f}}for(t.ticks=l,c=0;c<3;++c)for(o[c]=.5*(e.glplot.bounds[0][c]+e.glplot.bounds[1][c]),d=0;d<2;++d)t.bounds[d][c]=e.glplot.bounds[d][c];e.contourLevels=function(e){for(var t=new Array(3),r=0;r<3;++r){for(var n=e[r],a=new Array(n.length),i=0;i<n.length;++i)a[i]=n[i].x;t[r]=a}return t}(l)};var n=e("../../cartesian/axes"),a=e("../../../lib"),i=["xaxis","yaxis","zaxis"],o=[0,0,0]},{"../../../lib":503,"../../cartesian/axes":554}],607:[function(e,t,r){"use strict";function n(e,t){var r,n,a=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)a[n]+=e[4*r+n]*t[r];return a}t.exports=function(e,t){return n(e.projection,n(e.view,n(e.model,[t[0],t[1],t[2],1])))}},{}],608:[function(e,t,r){"use strict";var n,a,i=e("../../../stackgl_modules").gl_plot3d,o=i.createCamera,s=i.createScene,l=e("webgl-context"),c=e("has-passive-events"),u=e("../../registry"),f=e("../../lib"),p=f.preserveDrawingBuffer(),h=e("../../plots/cartesian/axes"),d=e("../../components/fx"),m=e("../../lib/str2rgbarray"),g=e("../../lib/show_no_webgl_msg"),y=e("./project"),v=e("./layout/convert"),b=e("./layout/spikes"),x=e("./layout/tick_marks");function _(e,t){var r=document.createElement("div"),n=e.container;this.graphDiv=e.graphDiv;var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.position="absolute",a.style.top=a.style.left="0px",a.style.width=a.style.height="100%",a.style["z-index"]=20,a.style["pointer-events"]="none",r.appendChild(a),this.svgContainer=a,r.id=e.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=t,this.id=e.id||"scene",this.fullSceneLayout=t[this.id],this.plotArgs=[[],{},{}],this.axesOptions=v(t,t[this.id]),this.spikeOptions=b(t[this.id]),this.container=r,this.staticMode=!!e.staticPlot,this.pixelRatio=this.pixelRatio||e.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=u.getComponentMethod("annotations3d","convert"),this.drawAnnotations=u.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var w=_.prototype;w.prepareOptions=function(){var e={canvas:this.canvas,gl:this.gl,glOptions:{preserveDrawingBuffer:p,premultipliedAlpha:!0,antialias:!0},container:this.container,axes:this.axesOptions,spikes:this.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:this.camera,pixelRatio:this.pixelRatio};if(this.staticMode){if(!(a||(n=document.createElement("canvas"),a=l({canvas:n,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}))))throw new Error("error creating static canvas/context for image server");e.gl=a,e.canvas=n}return e};var k=!0;w.tryCreatePlot=function(){var e=this.prepareOptions(),t=!0;try{this.glplot=s(e)}catch(r){if(this.staticMode||!k||p)t=!1;else{f.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{p=e.glOptions.preserveDrawingBuffer=!0,this.glplot=s(e)}catch(r){p=e.glOptions.preserveDrawingBuffer=!1,t=!1}}}return k=!1,t},w.initializeGLCamera=function(){var e=this.fullSceneLayout.camera,t="orthographic"===e.projection.type;this.camera=o(this.container,{center:[e.center.x,e.center.y,e.center.z],eye:[e.eye.x,e.eye.y,e.eye.z],up:[e.up.x,e.up.y,e.up.z],_ortho:t,zoomMin:.01,zoomMax:100,mode:"orbit"})},w.initializeGLPlot=function(){var e=this;if(e.initializeGLCamera(),!e.tryCreatePlot())return g(e);e.traces={},e.make4thDimension();var t=e.graphDiv,r=t.layout,n=function(){var t={};return e.isCameraChanged(r)&&(t[e.id+".camera"]=e.getCamera()),e.isAspectChanged(r)&&(t[e.id+".aspectratio"]=e.glplot.getAspectratio(),"manual"!==r[e.id].aspectmode&&(e.fullSceneLayout.aspectmode=r[e.id].aspectmode=t[e.id+".aspectmode"]="manual")),t},a=function(e){if(!1!==e.fullSceneLayout.dragmode){var t=n();e.saveLayout(r),e.graphDiv.emit("plotly_relayout",t)}};return e.glplot.canvas&&(e.glplot.canvas.addEventListener("mouseup",(function(){a(e)})),e.glplot.canvas.addEventListener("wheel",(function(r){if(t._context._scrollZoom.gl3d){if(e.camera._ortho){var n=r.deltaX>r.deltaY?1.1:1/1.1,i=e.glplot.getAspectratio();e.glplot.setAspectratio({x:n*i.x,y:n*i.y,z:n*i.z})}a(e)}}),!!c&&{passive:!1}),e.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==e.fullSceneLayout.dragmode&&0!==e.camera.mouseListener.buttons){var t=n();e.graphDiv.emit("plotly_relayouting",t)}})),e.staticMode||e.glplot.canvas.addEventListener("webglcontextlost",(function(r){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:r,layer:e.id})}),!1)),e.glplot.oncontextloss=function(){e.recoverContext()},e.glplot.onrender=function(){e.render()},!0},w.render=function(){var e,t=this,r=t.graphDiv,n=t.svgContainer,a=t.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var i=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=a.width*i,l=a.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(t),t.glplot.axes.update(t.axesOptions);for(var c=Object.keys(t.traces),u=null,p=t.glplot.selection,m=0;m<c.length;++m)"skip"!==(e=t.traces[c[m]]).data.hoverinfo&&e.handlePick(p)&&(u=e),e.setContourLevels&&e.setContourLevels();function g(e,r,n){var a=t.fullSceneLayout[e+"axis"];return"log"!==a.type&&(r=a.d2l(r)),h.hoverLabelText(a,r,n)}if(null!==u){var v=y(t.glplot.cameraParams,p.dataCoordinate);e=u.data;var b,_=r._fullData[e.index],w=p.index,k={xLabel:g("x",p.traceCoordinate[0],e.xhoverformat),yLabel:g("y",p.traceCoordinate[1],e.yhoverformat),zLabel:g("z",p.traceCoordinate[2],e.zhoverformat)},D=d.castHoverinfo(_,t.fullLayout,w),T=(D||"").split("+"),A=D&&"all"===D;_.hovertemplate||A||(-1===T.indexOf("x")&&(k.xLabel=void 0),-1===T.indexOf("y")&&(k.yLabel=void 0),-1===T.indexOf("z")&&(k.zLabel=void 0),-1===T.indexOf("text")&&(p.textLabel=void 0),-1===T.indexOf("name")&&(u.name=void 0));var S=[];"cone"===e.type||"streamtube"===e.type?(k.uLabel=g("x",p.traceCoordinate[3],e.uhoverformat),(A||-1!==T.indexOf("u"))&&S.push("u: "+k.uLabel),k.vLabel=g("y",p.traceCoordinate[4],e.vhoverformat),(A||-1!==T.indexOf("v"))&&S.push("v: "+k.vLabel),k.wLabel=g("z",p.traceCoordinate[5],e.whoverformat),(A||-1!==T.indexOf("w"))&&S.push("w: "+k.wLabel),k.normLabel=p.traceCoordinate[6].toPrecision(3),(A||-1!==T.indexOf("norm"))&&S.push("norm: "+k.normLabel),"streamtube"===e.type&&(k.divergenceLabel=p.traceCoordinate[7].toPrecision(3),(A||-1!==T.indexOf("divergence"))&&S.push("divergence: "+k.divergenceLabel)),p.textLabel&&S.push(p.textLabel),b=S.join("<br>")):"isosurface"===e.type||"volume"===e.type?(k.valueLabel=h.hoverLabelText(t._mockAxis,t._mockAxis.d2l(p.traceCoordinate[3]),e.valuehoverformat),S.push("value: "+k.valueLabel),p.textLabel&&S.push(p.textLabel),b=S.join("<br>")):b=p.textLabel;var M={x:p.traceCoordinate[0],y:p.traceCoordinate[1],z:p.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:w};d.appendArrayPointValue(M,_,w),e._module.eventData&&(M=_._module.eventData(M,p,_,{},w));var E={points:[M]};if(t.fullSceneLayout.hovermode){var C=[];d.loneHover({trace:_,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:k.xLabel,yLabel:k.yLabel,zLabel:k.zLabel,text:b,name:u.name,color:d.castHoverOption(_,w,"bgcolor")||u.color,borderColor:d.castHoverOption(_,w,"bordercolor"),fontFamily:d.castHoverOption(_,w,"font.family"),fontSize:d.castHoverOption(_,w,"font.size"),fontColor:d.castHoverOption(_,w,"font.color"),nameLength:d.castHoverOption(_,w,"namelength"),textAlign:d.castHoverOption(_,w,"align"),hovertemplate:f.castOption(_,w,"hovertemplate"),hovertemplateLabels:f.extendFlat({},M,k),eventData:[M]},{container:n,gd:r,inOut_bbox:C}),M.bbox=C[0]}p.buttons&&p.distance<5?r.emit("plotly_click",E):r.emit("plotly_hover",E),this.oldEventData=E}else d.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;t.drawAnnotations(t)},w.recoverContext=function(){var e=this;e.glplot.dispose();var t=function(){e.glplot.gl.isContextLost()?requestAnimationFrame(t):e.initializeGLPlot()?e.plot.apply(e,e.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(t)};var D=["xaxis","yaxis","zaxis"];function T(e,t,r){for(var n=e.fullSceneLayout,a=0;a<3;a++){var i=D[a],o=i.charAt(0),s=n[i],l=t[o],c=t[o+"calendar"],u=t["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var p,h=0;h<(u||l.length);h++)if(f.isArrayOrTypedArray(l[h]))for(var d=0;d<l[h].length;++d)p=s.d2l(l[h][d],0,c),!isNaN(p)&&isFinite(p)&&(r[0][a]=Math.min(r[0][a],p),r[1][a]=Math.max(r[1][a],p));else p=s.d2l(l[h],0,c),!isNaN(p)&&isFinite(p)&&(r[0][a]=Math.min(r[0][a],p),r[1][a]=Math.max(r[1][a],p));else r[0][a]=Math.min(r[0][a],0),r[1][a]=Math.max(r[1][a],u-1)}}w.plot=function(e,t,r){if(this.plotArgs=[e,t,r],!this.glplot.contextLost){var n,a,i,o,s,l,c=t[this.id],u=r[this.id];this.fullLayout=t,this.fullSceneLayout=c,this.axesOptions.merge(t,c),this.spikeOptions.merge(c),this.setViewport(c),this.updateFx(c.dragmode,c.hovermode),this.camera.enableWheel=this.graphDiv._context._scrollZoom.gl3d,this.glplot.setClearColor(m(c.bgcolor)),this.setConvert(s),e?Array.isArray(e)||(e=[e]):e=[];var f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(i=0;i<e.length;++i)!0===(n=e[i]).visible&&0!==n._length&&T(this,n,f);!function(e,t){for(var r=e.fullSceneLayout,n=r.annotations||[],a=0;a<3;a++)for(var i=D[a],o=i.charAt(0),s=r[i],l=0;l<n.length;l++){var c=n[l];if(c.visible){var u=s.r2l(c[o]);!isNaN(u)&&isFinite(u)&&(t[0][a]=Math.min(t[0][a],u),t[1][a]=Math.max(t[1][a],u))}}}(this,f);var p=[1,1,1];for(o=0;o<3;++o)f[1][o]===f[0][o]?p[o]=1:p[o]=1/(f[1][o]-f[0][o]);for(this.dataScale=p,this.convertAnnotations(this),i=0;i<e.length;++i)!0===(n=e[i]).visible&&0!==n._length&&((a=this.traces[n.uid])?a.data.type===n.type?a.update(n):(a.dispose(),a=n._module.plot(this,n),this.traces[n.uid]=a):(a=n._module.plot(this,n),this.traces[n.uid]=a),a.name=n.name);var h=Object.keys(this.traces);e:for(i=0;i<h.length;++i){for(o=0;o<e.length;++o)if(e[o].uid===h[i]&&!0===e[o].visible&&0!==e[o]._length)continue e;(a=this.traces[h[i]]).dispose(),delete this.traces[h[i]]}this.glplot.objects.sort((function(e,t){return e._trace.data.index-t._trace.data.index}));var d,g=[[0,0,0],[0,0,0]],y=[],v={};for(i=0;i<3;++i){if((l=(s=c[D[i]]).type)in v?(v[l].acc*=p[i],v[l].count+=1):v[l]={acc:p[i],count:1},s.autorange){g[0][i]=1/0,g[1][i]=-1/0;var b=this.glplot.objects,x=this.fullSceneLayout.annotations||[],_=s._name.charAt(0);for(o=0;o<b.length;o++){var w=b[o],k=w.bounds,A=w._trace.data._pad||0;"ErrorBars"===w.constructor.name&&s._lowerLogErrorBound?g[0][i]=Math.min(g[0][i],s._lowerLogErrorBound):g[0][i]=Math.min(g[0][i],k[0][i]/p[i]-A),g[1][i]=Math.max(g[1][i],k[1][i]/p[i]+A)}for(o=0;o<x.length;o++){var S=x[o];if(S.visible){var M=s.r2l(S[_]);g[0][i]=Math.min(g[0][i],M),g[1][i]=Math.max(g[1][i],M)}}if("rangemode"in s&&"tozero"===s.rangemode&&(g[0][i]=Math.min(g[0][i],0),g[1][i]=Math.max(g[1][i],0)),g[0][i]>g[1][i])g[0][i]=-1,g[1][i]=1;else{var E=g[1][i]-g[0][i];g[0][i]-=E/32,g[1][i]+=E/32}if("reversed"===s.autorange){var C=g[0][i];g[0][i]=g[1][i],g[1][i]=C}}else{var N=s.range;g[0][i]=s.r2l(N[0]),g[1][i]=s.r2l(N[1])}g[0][i]===g[1][i]&&(g[0][i]-=1,g[1][i]+=1),y[i]=g[1][i]-g[0][i],this.glplot.setBounds(i,{min:g[0][i]*p[i],max:g[1][i]*p[i]})}var O=c.aspectmode;if("cube"===O)d=[1,1,1];else if("manual"===O){var I=c.aspectratio;d=[I.x,I.y,I.z]}else{if("auto"!==O&&"data"!==O)throw new Error("scene.js aspectRatio was not one of the enumerated types");var P=[1,1,1];for(i=0;i<3;++i){var R=v[l=(s=c[D[i]]).type];P[i]=Math.pow(R.acc,1/R.count)/p[i]}d="data"===O||Math.max.apply(null,P)/Math.min.apply(null,P)<=4?P:[1,1,1]}c.aspectratio.x=u.aspectratio.x=d[0],c.aspectratio.y=u.aspectratio.y=d[1],c.aspectratio.z=u.aspectratio.z=d[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var L=c.domain||null,F=t._size||null;if(L&&F){var B=this.container.style;B.position="absolute",B.left=F.l+L.x[0]*F.w+"px",B.top=F.t+(1-L.y[1])*F.h+"px",B.width=F.w*(L.x[1]-L.x[0])+"px",B.height=F.h*(L.y[1]-L.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var e;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(e=this.camera).up[0],y:e.up[1],z:e.up[2]},center:{x:e.center[0],y:e.center[1],z:e.center[2]},eye:{x:e.eye[0],y:e.eye[1],z:e.eye[2]},projection:{type:!0===e._ortho?"orthographic":"perspective"}}},w.setViewport=function(e){var t,r=e.camera;this.camera.lookAt.apply(this,[[(t=r).eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]),this.glplot.setAspectratio(e.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(e){var t=this.getCamera(),r=f.nestedProperty(e,this.id+".camera").get();function n(e,t,r,n){var a=["up","center","eye"],i=["x","y","z"];return t[a[r]]&&e[a[r]][i[n]]===t[a[r]][i[n]]}var a=!1;if(void 0===r)a=!0;else{for(var i=0;i<3;i++)for(var o=0;o<3;o++)if(!n(t,r,i,o)){a=!0;break}(!r.projection||t.projection&&t.projection.type!==r.projection.type)&&(a=!0)}return a},w.isAspectChanged=function(e){var t=this.glplot.getAspectratio(),r=f.nestedProperty(e,this.id+".aspectratio").get();return void 0===r||r.x!==t.x||r.y!==t.y||r.z!==t.z},w.saveLayout=function(e){var t,r,n,a,i,o,s=this.fullLayout,l=this.isCameraChanged(e),c=this.isAspectChanged(e),p=l||c;if(p){var h={};l&&(t=this.getCamera(),n=(r=f.nestedProperty(e,this.id+".camera")).get(),h[this.id+".camera"]=n),c&&(a=this.glplot.getAspectratio(),o=(i=f.nestedProperty(e,this.id+".aspectratio")).get(),h[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",e,s._preGUI,h),l&&(r.set(t),f.nestedProperty(s,this.id+".camera").set(t)),c&&(i.set(a),f.nestedProperty(s,this.id+".aspectratio").set(a),this.glplot.redraw())}return p},w.updateFx=function(e,t){var r=this.camera;if(r)if("orbit"===e)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===e){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,a=n._fullLayout,i=this.fullSceneLayout.camera,o=i.up.x,s=i.up.y,l=i.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",p={x:0,y:0,z:1},h={};h[c]=p;var d=n.layout;u.call("_storeDirectGUIEdit",d,a._preGUI,h),i.up=p,f.nestedProperty(d,c).set(p)}}else r.keyBindingMode=e;this.fullSceneLayout.hovermode=t},w.toImage=function(e){e||(e="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var t=this.glplot.gl,r=t.drawingBufferWidth,a=t.drawingBufferHeight;t.bindFramebuffer(t.FRAMEBUFFER,null);var i=new Uint8Array(r*a*4);t.readPixels(0,0,r,a,t.RGBA,t.UNSIGNED_BYTE,i),function(e,t,r){for(var n=0,a=r-1;n<a;++n,--a)for(var i=0;i<t;++i)for(var o=0;o<4;++o){var s=4*(t*n+i)+o,l=4*(t*a+i)+o,c=e[s];e[s]=e[l],e[l]=c}}(i,r,a),function(e,t,r){for(var n=0;n<r;++n)for(var a=0;a<t;++a){var i=4*(t*n+a),o=e[i+3];if(o>0)for(var s=255/o,l=0;l<3;++l)e[i+l]=Math.min(s*e[i+l],255)}}(i,r,a);var o=document.createElement("canvas");o.width=r,o.height=a;var s,l=o.getContext("2d"),c=l.createImageData(r,a);switch(c.data.set(i),l.putImageData(c,0,0),e){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var e=0;e<3;e++){var t=this.fullSceneLayout[D[e]];h.setConvert(t,this.fullLayout),t.setScale=f.noop}},w.make4thDimension=function(){var e=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},h.setConvert(this._mockAxis,e)},t.exports=_},{"../../../stackgl_modules":1120,"../../components/fx":406,"../../lib":503,"../../lib/show_no_webgl_msg":525,"../../lib/str2rgbarray":528,"../../plots/cartesian/axes":554,"../../registry":638,"./layout/convert":602,"./layout/spikes":605,"./layout/tick_marks":606,"./project":607,"has-passive-events":229,"webgl-context":331}],609:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){n=n||e.length;for(var a=new Array(n),i=0;i<n;i++)a[i]=[e[i],t[i],r[i]];return a}},{}],610:[function(e,t,r){"use strict";var n=e("./font_attributes"),a=e("./animation_attributes"),i=e("../components/color/attributes"),o=e("../components/shapes/draw_newshape/attributes"),s=e("./pad_attributes"),l=e("../lib/extend").extendFlat,c=n({editType:"calc"});c.family.dflt='"Open Sans", verdana, arial, sans-serif',c.size.dflt=12,c.color.dflt=i.defaultLine,t.exports={font:c,title:{text:{valType:"string",editType:"layoutstyle"},font:n({editType:"layoutstyle"}),xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:l(s({editType:"layoutstyle"}),{}),editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:i.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:i.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:i.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:o.newshape,activeshape:o.activeshape,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:l({},a.transition,{editType:"none"}),_deprecated:{title:{valType:"string",editType:"layoutstyle"},titlefont:n({editType:"layoutstyle"})}}},{"../components/color/attributes":365,"../components/shapes/draw_newshape/attributes":451,"../lib/extend":493,"./animation_attributes":548,"./font_attributes":585,"./pad_attributes":618}],611:[function(e,t,r){"use strict";var n=e("../../lib/sort_object_keys"),a='© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',i=['© <a target="_blank" href="https://carto.com/">Carto</a>',a].join(" "),o=['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://www.openstreetmap.org/copyright">ODbL</a>'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:a,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);t.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:","  Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":526}],612:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){var r=e.split(" "),a=r[0],i=r[1],o=n.isArrayOrTypedArray(t)?n.mean(t):t,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(a){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(i){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":503}],613:[function(e,t,r){"use strict";var n=e("mapbox-gl/dist/mapbox-gl-unminified"),a=e("../../lib"),i=a.strTranslate,o=a.strScale,s=e("../../plots/get_data").getSubplotCalcData,l=e("../../constants/xmlns_namespaces"),c=e("@plotly/d3"),u=e("../../components/drawing"),f=e("../../lib/svg_text_utils"),p=e("./mapbox"),h=r.constants=e("./constants");function d(e){return"string"==typeof e&&(-1!==h.styleValuesMapbox.indexOf(e)||0===e.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=a.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=e("./layout_attributes"),r.supplyLayoutDefaults=e("./layout_defaults"),r.plot=function(e){var t=e._fullLayout,r=e.calcdata,i=t._subplots.mapbox;if(n.version!==h.requiredVersion)throw new Error(h.wrongVersionErrorMsg);var o=function(e,t){var r=e._fullLayout;if(""===e._context.mapboxAccessToken)return"";for(var n=[],i=[],o=!1,s=!1,l=0;l<t.length;l++){var c=r[t[l]],u=c.accesstoken;d(c.style)&&(u?a.pushUnique(n,u):(d(c._input.style)&&(a.error("Uses Mapbox map style, but did not set an access token."),o=!0),s=!0)),u&&a.pushUnique(i,u)}if(s){var f=o?h.noAccessTokenErrorMsg:h.missingStyleErrorMsg;throw a.error(f),new Error(f)}return n.length?(n.length>1&&a.warn(h.multipleTokensErrorMsg),n[0]):(i.length&&a.log(["Listed mapbox access token(s)",i.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(e,i);n.accessToken=o;for(var l=0;l<i.length;l++){var c=i[l],u=s(r,"mapbox",c),f=t[c],m=f._subplot;m||(m=new p(e,c),t[c]._subplot=m),m.viewInitial||(m.viewInitial={center:a.extendFlat({},f.center),zoom:f.zoom,bearing:f.bearing,pitch:f.pitch}),m.plot(u,t,e._promises)}},r.clean=function(e,t,r,n){for(var a=n._subplots.mapbox||[],i=0;i<a.length;i++){var o=a[i];!t[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},r.toSVG=function(e){for(var t=e._fullLayout,r=t._subplots.mapbox,n=t._size,a=0;a<r.length;a++){var s=t[r[a]],p=s.domain,d=s._subplot.toImage("png");t._glimages.append("svg:image").attr({xmlns:l.svg,"xlink:href":d,x:n.l+n.w*p.x[0],y:n.t+n.h*(1-p.y[1]),width:n.w*(p.x[1]-p.x[0]),height:n.h*(p.y[1]-p.y[0]),preserveAspectRatio:"none"});var m=c.select(s._subplot.div);if(null!==m.select(".mapboxgl-ctrl-logo").node().offsetParent){var g=t._glimages.append("g");g.attr("transform",i(n.l+n.w*p.x[0]+10,n.t+n.h*(1-p.y[0])-31)),g.append("path").attr("d",h.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),g.append("path").attr("d",h.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),g.append("path").attr("d",h.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),g.append("polygon").attr("points",h.mapboxLogo.polygon).style({opacity:.9,fill:"#ffffff","enable-background":"new"})}var y=m.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),v=t._glimages.append("g"),b=v.append("text");b.text(y).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":y});var x=u.bBox(b.node()),_=n.w*(p.x[1]-p.x[0]);if(x.width>_/2){var w=y.split("|").join("<br>");b.text(w).attr("data-unformatted",w).call(f.convertToTspans,e),x=u.bBox(b.node())}b.attr("transform",i(-3,8-x.height)),v.insert("rect",".static-attribution").attr({x:-x.width-6,y:-x.height-3,width:x.width+6,height:x.height+3,fill:"rgba(255, 255, 255, 0.75)"});var k=1;x.width+6>_&&(k=_/(x.width+6));var D=[n.l+n.w*p.x[1],n.t+n.h*(1-p.y[0])];v.attr("transform",i(D[0],D[1])+o(k))}},r.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots.mapbox,n=0;n<r.length;n++)t[r[n]]._subplot.updateFx(t)}},{"../../components/drawing":388,"../../constants/xmlns_namespaces":480,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/get_data":593,"./constants":611,"./layout_attributes":615,"./layout_defaults":616,"./mapbox":617,"@plotly/d3":58,"mapbox-gl/dist/mapbox-gl-unminified":239}],614:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/svg_text_utils").sanitizeHTML,i=e("./convert_text_opts"),o=e("./constants");function s(e,t){this.subplot=e,this.uid=e.uid+"-"+t,this.index=t,this.idSource="source-"+this.uid,this.idLayer=o.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var l=s.prototype;function c(e){if(!e.visible)return!1;var t=e.source;if(Array.isArray(t)&&t.length>0){for(var r=0;r<t.length;r++)if("string"!=typeof t[r]||0===t[r].length)return!1;return!0}return n.isPlainObject(t)||"string"==typeof t&&t.length>0}function u(e){var t={},r={};switch(e.type){case"circle":n.extendFlat(r,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":n.extendFlat(r,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case"symbol":var a=e.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(t,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":e.color,"text-color":a.textfont.color,"text-opacity":e.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:r}}l.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=c(e)},l.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},l.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},l.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapboxLayerId(this.lookupBelow());null!==t&&this.subplot.map.moveLayer(this.idLayer,t)},l.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,c(e)){var r=function(e){var t,r=e.sourcetype,n=e.source,i={type:r};return"geojson"===r?t="data":"vector"===r?t="string"==typeof n?"url":"tiles":"raster"===r?(t="tiles",i.tileSize=256):"image"===r&&(t="url",i.coordinates=e.coordinates),i[t]=n,e.sourceattribution&&(i.attribution=a(e.sourceattribution)),i}(e);t.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r<t.length;r++){var n=t[r].id;if("string"==typeof n&&0===n.indexOf(o.traceLayerPrefix)){e=n;break}}return e},l.updateLayer=function(e){var t=this.subplot,r=u(e),n=this.lookupBelow(),a=this.findFollowingMapboxLayerId(n);this.removeLayer(),c(e)&&t.addLayer({id:this.idLayer,source:this.idSource,"source-layer":e.sourcelayer||"",type:e.type,minzoom:e.minzoom,maxzoom:e.maxzoom,layout:r.layout,paint:r.paint},a),this.layerType=e.type,this.below=n},l.updateStyle=function(e){if(c(e)){var t=u(e);this.subplot.setOptions(this.idLayer,"setLayoutProperty",t.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",t.paint)}},l.removeLayer=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer)},l.dispose=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),e.getSource(this.idSource)&&e.removeSource(this.idSource)},t.exports=function(e,t,r){var n=new s(e,t);return n.update(r),n}},{"../../lib":503,"../../lib/svg_text_utils":529,"./constants":611,"./convert_text_opts":612}],615:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color").defaultLine,i=e("../domain").attributes,o=e("../font_attributes"),s=e("../../traces/scatter/attributes").textposition,l=e("../../plot_api/edit_types").overrideAll,c=e("../../plot_api/plot_template").templatedArray,u=e("./constants"),f=o({});f.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(t.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:i({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:u.styleValuesMapbox.concat(u.styleValuesNonMapbox),dflt:u.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:c("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:a},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:a}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:f,textposition:n.extendFlat({},s,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}},{"../../components/color":366,"../../lib":503,"../../plot_api/edit_types":536,"../../plot_api/plot_template":543,"../../traces/scatter/attributes":926,"../domain":584,"../font_attributes":585,"./constants":611}],616:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../subplot_defaults"),i=e("../array_container_defaults"),o=e("./layout_attributes");function s(e,t,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),i(e,t,{name:"layers",handleItemDefaults:l}),t._input=e}function l(e,t){function r(r,a){return n.coerce(e,t,o.layers,r,a)}if(r("visible")){var a,i=r("sourcetype"),s="raster"===i||"image"===i;r("source"),r("sourceattribution"),"vector"===i&&r("sourcelayer"),"image"===i&&r("coordinates"),s&&(a="raster");var l=r("type",a);s&&"raster"!==l&&(l=t.type="raster",n.log("Source types *raster* and *image* must drawn *raster* layer type.")),r("below"),r("color"),r("opacity"),r("minzoom"),r("maxzoom"),"circle"===l&&r("circle.radius"),"line"===l&&(r("line.width"),r("line.dash")),"fill"===l&&r("fill.outlinecolor"),"symbol"===l&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),n.coerceFont(r,"symbol.textfont"),r("symbol.textposition"),r("symbol.placement"))}}t.exports=function(e,t,r){a(e,t,r,{type:"mapbox",attributes:o,handleDefaults:s,partition:"y",accessToken:t._mapboxAccessToken})}},{"../../lib":503,"../array_container_defaults":549,"../subplot_defaults":632,"./layout_attributes":615}],617:[function(e,t,r){"use strict";var n=e("mapbox-gl/dist/mapbox-gl-unminified"),a=e("../../lib"),i=e("../../lib/geo_location_utils"),o=e("../../registry"),s=e("../cartesian/axes"),l=e("../../components/dragelement"),c=e("../../components/fx"),u=e("../../components/dragelement/helpers"),f=u.rectMode,p=u.drawMode,h=u.selectMode,d=e("../cartesian/select").prepSelect,m=e("../cartesian/select").clearSelect,g=e("../cartesian/select").clearSelectionsCache,y=e("../cartesian/select").selectOnClick,v=e("./constants"),b=e("./layers");function x(e,t){this.id=t,this.gd=e;var r=e._fullLayout,n=e._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var _=x.prototype;_.plot=function(e,t,r){var n,a=this,i=t[a.id];a.map&&i.accesstoken!==a.accessToken&&(a.map.remove(),a.map=null,a.styleObj=null,a.traceHash={},a.layerList=[]),n=a.map?new Promise((function(r,n){a.updateMap(e,t,r,n)})):new Promise((function(r,n){a.createMap(e,t,r,n)})),r.push(n)},_.createMap=function(e,t,r,a){var o=this,s=t[o.id],l=o.styleObj=k(s.style);o.accessToken=s.accesstoken;var c=o.map=new n.Map({container:o.div,style:l.style,center:T(s.center),zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,interactive:!o.isStatic,preserveDrawingBuffer:o.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new n.AttributionControl({compact:!0}));c._canvas.style.left="0px",c._canvas.style.top="0px",o.rejectOnError(a),o.isStatic||o.initFx(e,t);var u=[];u.push(new Promise((function(e){c.once("load",e)}))),u=u.concat(i.fetchTraceGeoData(e)),Promise.all(u).then((function(){o.fillBelowLookup(e,t),o.updateData(e),o.updateLayout(t),o.resolveOnRender(r)})).catch(a)},_.updateMap=function(e,t,r,n){var a=this,o=a.map,s=t[this.id];a.rejectOnError(n);var l=[],c=k(s.style);JSON.stringify(a.styleObj)!==JSON.stringify(c)&&(a.styleObj=c,o.setStyle(c.style),a.traceHash={},l.push(new Promise((function(e){o.once("styledata",e)})))),l=l.concat(i.fetchTraceGeoData(e)),Promise.all(l).then((function(){a.fillBelowLookup(e,t),a.updateData(e),a.updateLayout(t),a.resolveOnRender(r)})).catch(n)},_.fillBelowLookup=function(e,t){var r,n,a=t[this.id].layers,i=this.belowLookup={},o=!1;for(r=0;r<e.length;r++){var s=e[r][0].trace,l=s._module;"string"==typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),i["trace-"+s.uid]=n||""}for(r=0;r<a.length;r++){var c=a[r];n="string"==typeof c.below?c.below:o?"traces":"",i["layout-"+r]=n}var u,f,p={};for(u in i)p[n=i[u]]?p[n].push(u):p[n]=[u];for(n in p){var h=p[n];if(h.length>1)for(r=0;r<h.length;r++)0===(u=h[r]).indexOf("trace-")?(f=u.split("trace-")[1],this.traceHash[f]&&(this.traceHash[f].below=null)):0===u.indexOf("layout-")&&(f=u.split("layout-")[1],this.layerList[f]&&(this.layerList[f].below=null))}};var w={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};function k(e){var t={};return a.isPlainObject(e)?(t.id=e.id,t.style=e):"string"==typeof e?(t.id=e,-1!==v.styleValuesMapbox.indexOf(e)?t.style=D(e):v.stylesNonMapbox[e]?t.style=v.stylesNonMapbox[e]:t.style=e):(t.id=v.styleValueDflt,t.style=D(v.styleValueDflt)),t.transition={duration:0,delay:0},t}function D(e){return v.styleUrlPrefix+e+"-"+v.styleUrlSuffix}function T(e){return[e.lon,e.lat]}_.updateData=function(e){var t,r,n,a,i=this.traceHash,o=e.slice().sort((function(e,t){return w[e[0].trace.type]-w[t[0].trace.type]}));for(n=0;n<o.length;n++){var s=o[n],l=!1;(t=i[(r=s[0].trace).uid])&&(t.type===r.type?(t.update(s),l=!0):t.dispose()),!l&&r._module&&(i[r.uid]=r._module.plot(this,s))}var c=Object.keys(i);e:for(n=0;n<c.length;n++){var u=c[n];for(a=0;a<e.length;a++)if(u===(r=e[a][0].trace).uid)continue e;(t=i[u]).dispose(),delete i[u]}},_.updateLayout=function(e){var t=this.map,r=e[this.id];this.dragging||this.wheeling||(t.setCenter(T(r.center)),t.setZoom(r.zoom),t.setBearing(r.bearing),t.setPitch(r.pitch)),this.updateLayers(e),this.updateFramework(e),this.updateFx(e),this.map.resize(),this.gd._context._scrollZoom.mapbox?t.scrollZoom.enable():t.scrollZoom.disable()},_.resolveOnRender=function(e){var t=this.map;t.on("render",(function r(){t.loaded()&&(t.off("render",r),setTimeout(e,10))}))},_.rejectOnError=function(e){var t=this.map;function r(){e(new Error(v.mapOnErrorMsg))}t.once("error",r),t.once("style.error",r),t.once("source.error",r),t.once("tile.error",r),t.once("layer.error",r)},_.createFramework=function(e){var t=this,r=t.div=document.createElement("div");r.id=t.uid,r.style.position="absolute",t.container.appendChild(r),t.xaxis={_id:"x",c2p:function(e){return t.project(e).x}},t.yaxis={_id:"y",c2p:function(e){return t.project(e).y}},t.updateFramework(e),t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},s.setConvert(t.mockAxis,e)},_.initFx=function(e,t){var r=this,n=r.gd,a=r.map;function i(){c.loneUnhover(t._hoverlayer)}function s(){var e=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(e))}a.on("moveend",(function(e){if(r.map){var t=n._fullLayout;if(e.originalEvent||r.wheeling){var a=t[r.id];o.call("_storeDirectGUIEdit",n.layout,t._preGUI,r.getViewEdits(a));var i=r.getView();a._input.center=a.center=i.center,a._input.zoom=a.zoom=i.zoom,a._input.bearing=a.bearing=i.bearing,a._input.pitch=a.pitch=i.pitch,n.emit("plotly_relayout",r.getViewEditsWithDerived(i))}e.originalEvent&&"mouseup"===e.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),t._rehover&&t._rehover()}})),a.on("wheel",(function(){r.wheeling=!0})),a.on("mousemove",(function(e){var t=r.div.getBoundingClientRect(),i=[e.originalEvent.offsetX,e.originalEvent.offsetY];e.target.getBoundingClientRect=function(){return t},r.xaxis.p2c=function(){return a.unproject(i).lng},r.yaxis.p2c=function(){return a.unproject(i).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&c.hover(n,e,r.id)},c.hover(n,e,r.id),n._fullLayout._hoversubplot=r.id})),a.on("dragstart",(function(){r.dragging=!0,i()})),a.on("zoomstart",i),a.on("mouseout",(function(){n._fullLayout._hoversubplot=null})),a.on("drag",s),a.on("zoom",s),a.on("dblclick",(function(){var e=n._fullLayout[r.id];o.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(e));var t=r.viewInitial;a.setCenter(T(t.center)),a.setZoom(t.zoom),a.setBearing(t.bearing),a.setPitch(t.pitch);var i=r.getView();e._input.center=e.center=i.center,e._input.zoom=e.zoom=i.zoom,e._input.bearing=e.bearing=i.bearing,e._input.pitch=e.pitch=i.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(i))})),r.clearSelect=function(){g(r.dragOptions),m(r.dragOptions.gd)},r.onClickInPanFn=function(e){return function(t){var a=n._fullLayout.clickmode;a.indexOf("select")>-1&&y(t.originalEvent,n,[r.xaxis],[r.yaxis],r.id,e),a.indexOf("event")>-1&&c.click(n,t.originalEvent)}}},_.updateFx=function(e){var t=this,r=t.map,n=t.gd;if(!t.isStatic){var i,o=e.dragmode;i=f(o)?function(e,r){(e.range={})[t.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]}:function(e,r,n){(e.lassoPoints={})[t.id]=n.filtered.map(c)};var s=t.dragOptions;t.dragOptions=a.extendDeep(s||{},{dragmode:e.dragmode,element:t.div,gd:n,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:i},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),h(o)||p(o)?(r.dragPan.disable(),r.on("zoomstart",t.clearSelect),t.dragOptions.prepFn=function(e,r,n){d(e,r,n,t.dragOptions,o)},l.init(t.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",t.clearSelect),t.div.onmousedown=null,t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),r.on("click",t.onClickInPanHandler))}function c(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},_.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},_.updateLayers=function(e){var t,r=e[this.id].layers,n=this.layerList;if(r.length!==n.length){for(t=0;t<n.length;t++)n[t].dispose();for(n=this.layerList=[],t=0;t<r.length;t++)n.push(b(this,t,r[t]))}else for(t=0;t<r.length;t++)n[t].update(r[t])},_.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},_.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},_.setOptions=function(e,t,r){for(var n in r)this.map[t](e,n,r[n])},_.getMapLayers=function(){return this.map.getStyle().layers},_.addLayer=function(e,t){var r=this.map;if("string"==typeof t){if(""===t)return void r.addLayer(e,t);for(var n=this.getMapLayers(),i=0;i<n.length;i++)if(t===n[i].id)return void r.addLayer(e,t);a.warn(["Trying to add layer with *below* value",t,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(e)},_.project=function(e){return this.map.project(new n.LngLat(e[0],e[1]))},_.getView=function(){var e=this.map,t=e.getCenter(),r={lon:t.lng,lat:t.lat},n=e.getCanvas(),a=parseInt(n.style.width),i=parseInt(n.style.height);return{center:r,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch(),_derived:{coordinates:[e.unproject([0,0]).toArray(),e.unproject([a,0]).toArray(),e.unproject([a,i]).toArray(),e.unproject([0,i]).toArray()]}}},_.getViewEdits=function(e){for(var t=this.id,r=["center","zoom","bearing","pitch"],n={},a=0;a<r.length;a++){var i=r[a];n[t+"."+i]=e[i]}return n},_.getViewEditsWithDerived=function(e){var t=this.id,r=this.getViewEdits(e);return r[t+"._derived"]=e._derived,r},t.exports=x},{"../../components/dragelement":385,"../../components/dragelement/helpers":384,"../../components/fx":406,"../../lib":503,"../../lib/geo_location_utils":496,"../../registry":638,"../cartesian/axes":554,"../cartesian/select":575,"./constants":611,"./layers":614,"mapbox-gl/dist/mapbox-gl-unminified":239}],618:[function(e,t,r){"use strict";t.exports=function(e){var t=e.editType;return{t:{valType:"number",dflt:0,editType:t},r:{valType:"number",dflt:0,editType:t},b:{valType:"number",dflt:0,editType:t},l:{valType:"number",dflt:0,editType:t},editType:t}}},{}],619:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").timeFormatLocale,i=e("d3-format").formatLocale,o=e("fast-isnumeric"),s=e("../registry"),l=e("../plot_api/plot_schema"),c=e("../plot_api/plot_template"),u=e("../lib"),f=e("../components/color"),p=e("../constants/numerical").BADNUM,h=e("./cartesian/axis_ids"),d=e("./cartesian/handle_outline").clearSelect,m=e("./animation_attributes"),g=e("./frame_attributes"),y=e("../plots/get_data").getModuleCalcData,v=u.relinkPrivateKeys,b=u._,x=t.exports={};u.extendFlat(x,s),x.attributes=e("./attributes"),x.attributes.type.values=x.allTypes,x.fontAttrs=e("./font_attributes"),x.layoutAttributes=e("./layout_attributes"),x.fontWeight="normal";var _=x.transformsRegistry,w=e("./command");x.executeAPICommand=w.executeAPICommand,x.computeAPICommandBindings=w.computeAPICommandBindings,x.manageCommandObserver=w.manageCommandObserver,x.hasSimpleAPICommandBindings=w.hasSimpleAPICommandBindings,x.redrawText=function(e){return e=u.getGraphDiv(e),new Promise((function(t){setTimeout((function(){e._fullLayout&&(s.getComponentMethod("annotations","draw")(e),s.getComponentMethod("legend","draw")(e),s.getComponentMethod("colorbar","draw")(e),t(x.previousPromises(e)))}),300)}))},x.resize=function(e){var t;e=u.getGraphDiv(e);var r=new Promise((function(r,n){e&&!u.isHidden(e)||n(new Error("Resize must be passed a displayed plot div element.")),e._redrawTimer&&clearTimeout(e._redrawTimer),e._resolveResize&&(t=e._resolveResize),e._resolveResize=r,e._redrawTimer=setTimeout((function(){if(!e.layout||e.layout.width&&e.layout.height||u.isHidden(e))r(e);else{delete e.layout.width,delete e.layout.height;var t=e.changed;e.autoplay=!0,s.call("relayout",e,{autosize:!0}).then((function(){e.changed=t,e._resolveResize===r&&(delete e._resolveResize,r(e))}))}}),100)}));return t&&t(r),r},x.previousPromises=function(e){if((e._promises||[]).length)return Promise.all(e._promises).then((function(){e._promises=[]}))},x.addLinks=function(e){if(e._context.showLink||e._context.showSources){var t=e._fullLayout,r=u.ensureSingle(t._paper,"text","js-plot-link-container",(function(e){e.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:f.defaultLine,"pointer-events":"all"}).each((function(){var e=n.select(this);e.append("tspan").classed("js-link-to-tool",!0),e.append("tspan").classed("js-link-spacer",!0),e.append("tspan").classed("js-sourcelinks",!0)}))})),a=r.node(),i={y:t._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){x.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),s.text(o.text()&&l.text()?" - ":"")}},x.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var k=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],D=["year","month","dayMonth","dayMonthYear"];function T(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i<t.length;i++){var o=t[i];a[o]||(e[o]?a[o]=e[o]:r=!1)}r&&(n=!0)}for(var o=0;o<2;o++){for(var l=e._context.locales,c=0;c<2;c++){var u=(l[r]||{}).format;if(u&&(i(u),n))break;l=s.localeRegistry}var f=r.split("-")[0];if(n||f===r)break;r=f}return n||i(s.localeRegistry.en.format),a}function A(e,t){var r={_fullLayout:t},n="x"===e._id.charAt(0),a=e._mainAxis._anchorAxis,i="",o="",s="";if(a&&(s=a._mainAxis._id,i=n?e._id+s:s+e._id),!i||!t._plots[i]){i="";for(var l=e._counterAxes,c=0;c<l.length;c++){var u=l[c],f=n?e._id+u:u+e._id;o||(o=f);var p=h.getFromId(r,u);if(s&&p.overlaying===s){i=f;break}}}return i||o}function S(e){var t=e.transforms;if(Array.isArray(t)&&t.length)for(var r=0;r<t.length;r++){var n=t[r],a=n._module||_[n.type];if(a&&a.makesData)return!0}return!1}function M(e,t,r,n){for(var a=e.transforms,i=[e],o=0;o<a.length;o++){var s=a[o],l=_[s.type];l&&l.transform&&(i=l.transform(i,{transform:s,fullTrace:e,fullData:t,layout:r,fullLayout:n,transformIndex:o}))}return i}function E(e){return"string"==typeof e&&"px"===e.substr(e.length-2)&&parseFloat(e)}function C(e){var t=e.margin;if(!e._size){var r=e._size={l:Math.round(t.l),r:Math.round(t.r),t:Math.round(t.t),b:Math.round(t.b),p:Math.round(t.pad)};r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b}e._pushmargin||(e._pushmargin={}),e._pushmarginIds||(e._pushmarginIds={})}x.supplyDefaults=function(e,t){var r=t&&t.skipUpdateCalc,n=e._fullLayout||{};if(n._skipDefaults)delete n._skipDefaults;else{var o,l=e._fullLayout={},c=e.layout||{},f=e._fullData||[],p=e._fullData=[],h=e.data||[],m=e.calcdata||[],g=e._context||{};e._transitionData||x.createTransitionData(e),l._dfltTitle={plot:b(e,"Click to enter Plot title"),x:b(e,"Click to enter X axis title"),y:b(e,"Click to enter Y axis title"),colorbar:b(e,"Click to enter Colorscale title"),annotation:b(e,"new text")},l._traceWord=b(e,"trace");var y=T(e,k);if(l._mapboxAccessToken=g.mapboxAccessToken,n._initialAutoSizeIsDone){var _=n.width,w=n.height;x.supplyLayoutGlobalDefaults(c,l,y),c.width||(l.width=_),c.height||(l.height=w),x.sanitizeMargins(l)}else{x.supplyLayoutGlobalDefaults(c,l,y);var A=!c.width||!c.height,S=l.autosize,M=g.autosizable;A&&(S||M)?x.plotAutoSize(e,c,l):A&&x.sanitizeMargins(l),!S&&A&&(c.width=l.width,c.height=l.height)}l._d3locale=function(e,t){return e.decimal=t.charAt(0),e.thousands=t.charAt(1),{numberFormat:function(t){try{t=i(e).format(u.adjustFormat(t))}catch(e){return u.warnBadFormat(t),u.noFormat}return t},timeFormat:a(e).utcFormat}}(y,l.separators),l._extraFormat=T(e,D),l._initialAutoSizeIsDone=!0,l._dataLength=h.length,l._modules=[],l._visibleModules=[],l._basePlotModules=[];var E=l._subplots=function(){var e,t,r=s.collectableSubplotTypes,n={};if(!r){r=[];var a=s.subplotsRegistry;for(var i in a){var o=a[i].attr;if(o&&(r.push(i),Array.isArray(o)))for(t=0;t<o.length;t++)u.pushUnique(r,o[t])}}for(e=0;e<r.length;e++)n[r[e]]=[];return n}(),N=l._splomAxes={x:{},y:{}},O=l._splomSubplots={};l._splomGridDflt={},l._scatterStackOpts={},l._firstScatter={},l._alignmentOpts={},l._colorAxes={},l._requestRangeslider={},l._traceUids=function(e,t){var r,n,a=t.length,i=[];for(r=0;r<e.length;r++){var o=e[r]._fullInput;o!==n&&i.push(o),n=o}var s=i.length,l=new Array(a),c={};function f(e,t){l[t]=e,c[e]=1}function p(e,t){if(e&&"string"==typeof e&&!c[e])return f(e,t),!0}for(r=0;r<a;r++){var h=t[r].uid;"number"==typeof h&&(h=String(h)),p(h,r)||r<s&&p(i[r].uid,r)||f(u.randstr(c),r)}return l}(f,h),l._globalTransforms=(e._context||{}).globalTransforms,x.supplyDataDefaults(h,p,c,l);var I=Object.keys(N.x),P=Object.keys(N.y);if(I.length>1&&P.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o<I.length;o++)u.pushUnique(E.xaxis,I[o]);for(o=0;o<P.length;o++)u.pushUnique(E.yaxis,P[o]);for(var R in O)u.pushUnique(E.cartesian,R)}if(l._has=x._hasPlotType.bind(l),f.length===p.length)for(o=0;o<p.length;o++)v(p[o],f[o]);x.supplyLayoutModuleDefaults(c,l,p,e._transitionData);var L=l._visibleModules,F=[];for(o=0;o<L.length;o++){var B=L[o].crossTraceDefaults;B&&u.pushUnique(F,B)}for(o=0;o<F.length;o++)F[o](p,l);l._hasOnlyLargeSploms=1===l._basePlotModules.length&&"splom"===l._basePlotModules[0].name&&I.length>15&&P.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(p,l,f,n),x.cleanPlot(p,l,f,n);var z=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||z,$=!(!l._has||!l._has("cartesian"))||j;U&&!$?n._bgLayer.remove():$&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&d({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a<e.length;a++){var i=e[a];i.meta?n[i.index]=i._meta={meta:i.meta}:t.meta&&(i._meta={meta:t.meta}),t.meta&&(i._meta.layout={meta:t.meta})}n.length&&(r||(r=t._meta={}),r.data=n)}(p,l),v(l,n),s.getComponentMethod("colorscale","crossTraceDefaults")(p,l),l._preGUI||(l._preGUI={}),l._tracePreGUI||(l._tracePreGUI={});var V,q=l._tracePreGUI,W={};for(V in q)W[V]="old";for(o=0;o<p.length;o++)W[V=p[o]._fullInput.uid]||(q[V]={}),W[V]="new";for(V in W)"old"===W[V]&&delete q[V];C(l),s.getComponentMethod("rangeslider","makeData")(l),r||m.length!==p.length||x.supplyDefaultsUpdateCalc(m,p)}},x.supplyDefaultsUpdateCalc=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],a=(e[r]||[])[0];if(a&&a.trace){var i=a.trace;if(i._hasCalcTransform){var o,s,l,c=i._arrayAttrs;for(o=0;o<c.length;o++)s=c[o],l=u.nestedProperty(i,s).get().slice(),u.nestedProperty(n,s).set(l)}a.trace=n}}},x.createTransitionData=function(e){e._transitionData||(e._transitionData={}),e._transitionData._frames||(e._transitionData._frames=[]),e._transitionData._frameHash||(e._transitionData._frameHash={}),e._transitionData._counter||(e._transitionData._counter=0),e._transitionData._interruptCallbacks||(e._transitionData._interruptCallbacks=[])},x._hasPlotType=function(e){var t,r=this._basePlotModules||[];for(t=0;t<r.length;t++)if(r[t].name===e)return!0;var n=this._modules||[];for(t=0;t<n.length;t++){var a=n[t].name;if(a===e)return!0;var i=s.modules[a];if(i&&i.categories[e])return!0}return!1},x.cleanPlot=function(e,t,r,n){var a,i,o=n._basePlotModules||[];for(a=0;a<o.length;a++){var s=o[a];s.clean&&s.clean(e,t,r,n)}var l=n._has&&n._has("gl"),c=t._has&&t._has("gl");l&&!c&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var u=!!n._infolayer;e:for(a=0;a<r.length;a++){var f=r[a].uid;for(i=0;i<e.length;i++)if(f===e[i].uid)continue e;u&&n._infolayer.select(".cb"+f).remove()}},x.linkSubplots=function(e,t,r,n){var a,i,o=n._plots||{},l=t._plots={},c=t._subplots,f={_fullData:e,_fullLayout:t},p=c.cartesian.concat(c.gl2d||[]);for(a=0;a<p.length;a++){var d,m=p[a],g=o[m],y=h.getFromId(f,m,"x"),v=h.getFromId(f,m,"y");for(g?d=l[m]=g:(d=l[m]={}).id=m,y._counterAxes.push(v._id),v._counterAxes.push(y._id),y._subplotsWith.push(m),v._subplotsWith.push(m),d.xaxis=y,d.yaxis=v,d._hasClipOnAxisFalse=!1,i=0;i<e.length;i++){var b=e[i];if(b.xaxis===d.xaxis._id&&b.yaxis===d.yaxis._id&&!1===b.cliponaxis){d._hasClipOnAxisFalse=!0;break}}}var x,_=h.list(f,null,!0);for(a=0;a<_.length;a++){var w=null;(x=_[a]).overlaying&&(w=h.getFromId(f,x.overlaying))&&w.overlaying&&(x.overlaying=!1,w=null),x._mainAxis=w||x,w&&(x.domain=w.domain.slice()),x._anchorAxis="free"===x.anchor?null:h.getFromId(f,x.anchor)}for(a=0;a<_.length;a++)if((x=_[a])._counterAxes.sort(h.idSort),x._subplotsWith.sort(u.subplotSort),x._mainSubplot=A(x,t),x._counterAxes.length&&(x.spikemode&&-1!==x.spikemode.indexOf("across")||x.automargin&&x.mirror&&"free"!==x.anchor||s.getComponentMethod("rangeslider","isVisible")(x))){var k=1,D=0;for(i=0;i<x._counterAxes.length;i++){var T=h.getFromId(f,x._counterAxes[i]);k=Math.min(k,T.domain[0]),D=Math.max(D,T.domain[1])}k<D&&(x._counterDomainMin=k,x._counterDomainMax=D)}},x.clearExpandedTraceDefaultColors=function(e){var t,r,n;for(r=[],(t=e._module._colorAttrs)||(e._module._colorAttrs=t=[],l.crawl(e._module.attributes,(function(e,n,a,i){r[i]=n,r.length=i+1,"color"===e.valType&&void 0===e.dflt&&t.push(r.join("."))}))),n=0;n<t.length;n++)u.nestedProperty(e,"_input."+t[n]).get()||u.nestedProperty(e,t[n]).set(null)},x.supplyDataDefaults=function(e,t,r,n){var a,i,o,l=n._modules,f=n._visibleModules,p=n._basePlotModules,h=0,d=0;function m(e){t.push(e);var r=e._module;r&&(u.pushUnique(l,r),!0===e.visible&&u.pushUnique(f,r),u.pushUnique(p,e._module.basePlotModule),h++,!1!==e._input.visible&&d++)}n._transformModules=[];var g={},y=[],b=(r.template||{}).data||{},_=c.traceTemplater(b);for(a=0;a<e.length;a++){if(o=e[a],(i=_.newTrace(o)).uid=n._traceUids[a],x.supplyTraceDefaults(o,i,d,n,a),i.index=a,i._input=o,i._expandedIndex=h,i.transforms&&i.transforms.length)for(var w=!1!==o.visible&&!1===i.visible,k=M(i,t,r,n),D=0;D<k.length;D++){var T=k[D],A={_template:i._template,type:i.type,uid:i.uid+D};w&&!1===T.visible&&delete T.visible,x.supplyTraceDefaults(T,A,h,n,a),v(A,T),A.index=a,A._input=o,A._fullInput=i,A._expandedIndex=h,A._expandedInput=T,m(A)}else i._fullInput=i,i._expandedInput=i,m(i);s.traceIs(i,"carpetAxis")&&(g[i.carpet]=i),s.traceIs(i,"carpetDependent")&&y.push(a)}for(a=0;a<y.length;a++)if((i=t[y[a]]).visible){var S=g[i.carpet];i._carpet=S,S&&S.visible?(i.xaxis=S.xaxis,i.yaxis=S.yaxis):i.visible=!1}},x.supplyAnimationDefaults=function(e){var t;e=e||{};var r={};function n(t,n){return u.coerce(e||{},r,m,t,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(e.frame))for(r.frame=[],t=0;t<e.frame.length;t++)r.frame[t]=x.supplyAnimationFrameDefaults(e.frame[t]||{});else r.frame=x.supplyAnimationFrameDefaults(e.frame||{});if(Array.isArray(e.transition))for(r.transition=[],t=0;t<e.transition.length;t++)r.transition[t]=x.supplyAnimationTransitionDefaults(e.transition[t]||{});else r.transition=x.supplyAnimationTransitionDefaults(e.transition||{});return r},x.supplyAnimationFrameDefaults=function(e){var t={};function r(r,n){return u.coerce(e||{},t,m.frame,r,n)}return r("duration"),r("redraw"),t},x.supplyAnimationTransitionDefaults=function(e){var t={};function r(r,n){return u.coerce(e||{},t,m.transition,r,n)}return r("duration"),r("easing"),t},x.supplyFrameDefaults=function(e){var t={};function r(r,n){return u.coerce(e,t,g,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),t},x.supplyTraceDefaults=function(e,t,r,n,a){var i,o=n.colorway||f.defaults,l=o[r%o.length];function c(r,n){return u.coerce(e,t,x.attributes,r,n)}var p=c("visible");c("type"),c("name",n._traceWord+" "+a),c("uirevision",n.uirevision);var h=x.getModule(t);if(t._module=h,h){var d=h.basePlotModule,m=d.attr,g=d.attributes;if(m&&g){var y=n._subplots,v="";if(p||"gl2d"!==d.name){if(Array.isArray(m))for(i=0;i<m.length;i++){var b=m[i],_=u.coerce(e,t,g,b);y[b]&&u.pushUnique(y[b],_),v+=_}else v=u.coerce(e,t,g,m);y[d.name]&&u.pushUnique(y[d.name],v)}}}return p&&(c("customdata"),c("ids"),c("meta"),s.traceIs(t,"showLegend")?(u.coerce(e,t,h.attributes.showlegend?h.attributes:x.attributes,"showlegend"),c("legendgroup"),c("legendgrouptitle.text"),c("legendrank"),t._dfltShowLegend=!0):t._dfltShowLegend=!1,h&&h.supplyDefaults(e,t,l,n),s.traceIs(t,"noOpacity")||c("opacity"),s.traceIs(t,"notLegendIsolatable")&&(t.visible=!!t.visible),s.traceIs(t,"noHover")||(t.hovertemplate||u.coerceHoverinfo(e,t,n),"parcats"!==t.type&&s.getComponentMethod("fx","supplyDefaults")(e,t,l,n)),h&&h.selectPoints&&c("selectedpoints"),x.supplyTransformDefaults(e,t,n)),t},x.hasMakesDataTransform=S,x.supplyTransformDefaults=function(e,t,r){if(t._length||S(e)){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(e.transforms)||0!==n.length)for(var i=e.transforms||[],o=n.concat(i),s=t.transforms=[],l=0;l<o.length;l++){var c,f=o[l],p=f.type,h=_[p],d=!(f._module&&f._module===h),m=h&&"function"==typeof h.transform;h||u.warn("Unrecognized transform type "+p+"."),h&&h.supplyDefaults&&(d||m)?((c=h.supplyDefaults(f,t,r,e)).type=p,c._module=h,u.pushUnique(a,h)):c=u.extendFlat({},f),s.push(c)}}},x.supplyLayoutGlobalDefaults=function(e,t,r){function n(r,n){return u.coerce(e,t,x.layoutAttributes,r,n)}var a=e.template;u.isPlainObject(a)&&(t.template=a,t._template=a.layout,t._dataTemplate=a.data),n("autotypenumbers");var i=u.coerceFont(n,"font"),o=i.size;u.coerceFont(n,"title.font",u.extendFlat({},i,{size:Math.round(1.4*o)})),n("title.text",t._dfltTitle.plot),n("title.xref"),n("title.yref"),n("title.x"),n("title.y"),n("title.xanchor"),n("title.yanchor"),n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l"),n("uniformtext.mode")&&n("uniformtext.minsize"),n("autosize",!(e.width&&e.height)),n("width"),n("height"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),e.width&&e.height&&x.sanitizeMargins(t),s.getComponentMethod("grid","sizeDefaults")(e,t),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var l=n("uirevision");n("editrevision",l),n("selectionrevision",l),s.getComponentMethod("modebar","supplyLayoutDefaults")(e,t),s.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(e,t,n),n("meta"),u.isPlainObject(e.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),s.getComponentMethod("calendars","handleDefaults")(e,t,"calendar"),s.getComponentMethod("fx","supplyLayoutGlobalDefaults")(e,t,n)},x.plotAutoSize=function(e,t,r){var n,a,i=e._context||{},s=i.frameMargins,l=u.isPlotDiv(e);if(l&&e.emit("plotly_autosize"),i.fillFrame)n=window.innerWidth,a=window.innerHeight,document.body.style.overflow="hidden";else{var c=l?window.getComputedStyle(e):{};if(n=E(c.width)||E(c.maxWidth)||r.width,a=E(c.height)||E(c.maxHeight)||r.height,o(s)&&s>0){var f=1-2*s;n=Math.round(f*n),a=Math.round(f*a)}}var p=x.layoutAttributes.width.min,h=x.layoutAttributes.height.min;n<p&&(n=p),a<h&&(a=h);var d=!t.width&&Math.abs(r.width-n)>1,m=!t.height&&Math.abs(r.height-a)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,l=s.componentsRegistry,c=t._basePlotModules,f=s.subplotsRegistry.cartesian;for(a in l)(o=l[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var p in c.length||c.push(f),t._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[p].sort(u.subplotSort);for(i=0;i<c.length;i++)(o=c[i]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r);var h=t._modules;for(i=0;i<h.length;i++)(o=h[i]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r);var d=t._transformModules;for(i=0;i<d.length;i++)(o=d[i]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r,n);for(a in l)(o=l[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r)},x.purge=function(e){var t=e._fullLayout||{};void 0!==t._glcontainer&&(t._glcontainer.selectAll(".gl-canvas").remove(),t._glcontainer.remove(),t._glcanvas=null),t._modeBar&&t._modeBar.destroy(),e._transitionData&&(e._transitionData._interruptCallbacks&&(e._transitionData._interruptCallbacks.length=0),e._transitionData._animationRaf&&window.cancelAnimationFrame(e._transitionData._animationRaf)),u.clearThrottle(),u.clearResponsive(e),delete e.data,delete e.layout,delete e._fullData,delete e._fullLayout,delete e.calcdata,delete e.empty,delete e.fid,delete e.undoqueue,delete e.undonum,delete e.autoplay,delete e.changed,delete e._promises,delete e._redrawTimer,delete e._hmlumcount,delete e._hmpixcount,delete e._transitionData,delete e._transitioning,delete e._initialAutoSize,delete e._transitioningWithDuration,delete e._dragging,delete e._dragged,delete e._dragdata,delete e._hoverdata,delete e._snapshotInProgress,delete e._editing,delete e._mouseDownTime,delete e._legendMouseDownTime,e.removeAllListeners&&e.removeAllListeners()},x.style=function(e){var t,r=e._fullLayout._visibleModules,n=[];for(t=0;t<r.length;t++){var a=r[t];a.style&&u.pushUnique(n,a.style)}for(t=0;t<n.length;t++)n[t](e)},x.sanitizeMargins=function(e){if(e&&e.margin){var t,r=e.width,n=e.height,a=e.margin,i=r-(a.l+a.r),o=n-(a.t+a.b);i<0&&(t=(r-1)/(a.l+a.r),a.l=Math.floor(t*a.l),a.r=Math.floor(t*a.r)),o<0&&(t=(n-1)/(a.t+a.b),a.t=Math.floor(t*a.t),a.b=Math.floor(t*a.b))}},x.clearAutoMarginIds=function(e){e._fullLayout._pushmarginIds={}},x.allowAutoMargin=function(e,t){e._fullLayout._pushmarginIds[t]=1},x.autoMargin=function(e,t,r){var n=e._fullLayout,a=n.width,i=n.height,o=n.margin,s=u.constrain(a-o.l-o.r,2,64),l=u.constrain(i-o.t-o.b,2,64),c=Math.max(0,a-s),f=Math.max(0,i-l),p=n._pushmargin,h=n._pushmarginIds;if(!1!==o.autoexpand){if(r){var d=r.pad;if(void 0===d&&(d=Math.min(12,o.l,o.r,o.t,o.b)),c){var m=(r.l+r.r)/c;m>1&&(r.l/=m,r.r/=m)}if(f){var g=(r.t+r.b)/f;g>1&&(r.t/=g,r.b/=g)}var y=void 0!==r.xl?r.xl:r.x,v=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;p[t]={l:{val:y,size:r.l+d},r:{val:v,size:r.r+d},b:{val:_,size:r.b+d},t:{val:b,size:r.t+d}},h[t]=1}else delete p[t],delete h[t];if(!n._replotting)return x.doAutoMargin(e)}},x.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),C(t);var a=t._size,i=t.margin,l=u.extendFlat({},a),c=i.l,f=i.r,p=i.t,d=i.b,m=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var y in m)g[y]||delete m[y];for(var v in m.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:p},b:{val:0,size:d}},m){var b=m[v].l||{},_=m[v].b||{},w=b.val,k=b.size,D=_.val,T=_.size;for(var A in m){if(o(k)&&m[A].r){var S=m[A].r.val,M=m[A].r.size;if(S>w){var E=(k*S+(M-r)*w)/(S-w),N=(M*(1-w)+(k-r)*(1-S))/(S-w);E+N>c+f&&(c=E,f=N)}}if(o(T)&&m[A].t){var O=m[A].t.val,I=m[A].t.size;if(O>D){var P=(T*O+(I-n)*D)/(O-D),R=(I*(1-D)+(T-n)*(1-O))/(O-D);P+R>d+p&&(d=P,p=R)}}}}}var L=u.constrain(r-i.l-i.r,2,64),F=u.constrain(n-i.t-i.b,2,64),B=Math.max(0,r-L),z=Math.max(0,n-F);if(B){var j=(c+f)/B;j>1&&(c/=j,f/=j)}if(z){var U=(d+p)/z;U>1&&(d/=U,p/=U)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(p),a.b=Math.round(d),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&x.didMarginChange(l,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var $=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount<$)return s.call("_doPlot",e);t._size=l,u.warn("Too many auto-margin redraws.")}!function(e){var t=h.list(e,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach((function(e){for(var r=0;r<t.length;r++){var n=t[r][e];n&&n()}}))}(e)};var N=["l","r","t","b","p","w","h"];function O(e,t,r){var n=!1,a=[x.previousPromises,function(){if(e._transitionData)return e._transitioning=!1,function(e){var t=Promise.resolve();if(!e)return t;for(;e.length;)t=t.then(e.shift());return t}(e._transitionData._interruptCallbacks)},r.prepareFn,x.rehover,function(){return e.emit("plotly_transitioning",[]),new Promise((function(a){e._transitioning=!0,t.duration>0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return s.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function l(){return i++,function(){o++,n||o!==i||function(t){e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t))}(a)}}r.runFn(l),setTimeout(l())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}x.didMarginChange=function(e,t){for(var r=0;r<N.length;r++){var n=N[r],a=e[n],i=t[n];if(!o(a)||Math.abs(i-a)>1)return!0}return!1},x.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&x.supplyDefaults(e);var o=a?e._fullData:e.data,s=a?e._fullLayout:e.layout,l=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=c(s),a)){var p=s._size;f.layout.computed={margin:{b:p.b,l:p.l,r:p.r,t:p.t}}}return l&&(f.frames=c(l)),i&&(f.config=c(e._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r<t.length;r++)switch((n=t[r]).type){case"replace":a=n.value;var s=(i[n.index]||{}).name,l=a.name;i[n.index]=o[l]=a,l!==s&&(delete o[s],o[l]=a);break;case"insert":o[(a=n.value).name]=a,i.splice(n.index,0,a);break;case"delete":delete o[(a=i[n.index]).name],i.splice(n.index,1)}return Promise.resolve()},x.computeFrame=function(e,t){var r,n,a,i,o=e._transitionData._frameHash;if(!t)throw new Error("computeFrame must be given a string frame name");var s=o[t.toString()];if(!s)return!1;for(var l=[s],c=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===c.indexOf(s.name);)l.push(s),c.push(s.name);for(var u={};s=l.pop();)if(s.layout&&(u.layout=x.extendLayout(u.layout,s.layout)),s.data){if(u.data||(u.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<s.data.length;r++)null!=(a=n[r])&&(-1===(i=u.traces.indexOf(a))&&(i=u.data.length,u.traces[i]=a),u.data[i]=x.extendTrace(u.data[i],s.data[r]))}return u},x.recomputeFrameHash=function(e){for(var t=e._transitionData._frameHash={},r=e._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(t[a.name]=a)}},x.extendObjectWithContainers=function(e,t,r){var n,a,i,o,s,l,c,f=u.extendDeepNoArrays({},t||{}),p=u.expandObjectPaths(f),h={};if(r&&r.length)for(i=0;i<r.length;i++)void 0===(a=(n=u.nestedProperty(p,r[i])).get())?u.nestedProperty(h,r[i]).set(null):(n.set(null),u.nestedProperty(h,r[i]).set(a));if(e=u.extendDeepNoArrays(e||{},p),r&&r.length)for(i=0;i<r.length;i++)if(l=u.nestedProperty(h,r[i]).get()){for(c=(s=u.nestedProperty(e,r[i])).get(),Array.isArray(c)||(c=[],s.set(c)),o=0;o<l.length;o++){var d=l[o];c[o]=null===d?null:x.extendObjectWithContainers(c[o],d)}s.set(c)}return e},x.dataArrayContainers=["transforms","dimensions"],x.layoutArrayContainers=s.layoutArrayContainers,x.extendTrace=function(e,t){return x.extendObjectWithContainers(e,t,x.dataArrayContainers)},x.extendLayout=function(e,t){return x.extendObjectWithContainers(e,t,x.layoutArrayContainers)},x.transition=function(e,t,r,n,a,i){var o={redraw:a.redraw},s={},l=[];return o.prepareFn=function(){for(var a=Array.isArray(t)?t.length:0,i=n.slice(0,a),o=0;o<i.length;o++){var c=i[o],f=e._fullData[c]._module;if(f){if(f.animatable){var p=f.basePlotModule.name;s[p]||(s[p]=[]),s[p].push(c)}e.data[i[o]]=x.extendTrace(e.data[i[o]],t[o])}}var h=u.expandObjectPaths(u.extendDeepNoArrays({},r)),d=/^[xy]axis[0-9]*$/;for(var m in h)d.test(m)&&delete h[m].range;x.extendLayout(e.layout,h),delete e.calcdata,x.supplyDefaults(e),x.doCalcdata(e);var g=u.expandObjectPaths(r);if(g){var y=e._fullLayout._plots;for(var v in y){var b=y[v],_=b.xaxis,w=b.yaxis,k=_.range.slice(),D=w.range.slice(),T=null,A=null,S=null,M=null;Array.isArray(g[_._name+".range"])?T=g[_._name+".range"].slice():Array.isArray((g[_._name]||{}).range)&&(T=g[_._name].range.slice()),Array.isArray(g[w._name+".range"])?A=g[w._name+".range"].slice():Array.isArray((g[w._name]||{}).range)&&(A=g[w._name].range.slice()),k&&T&&(_.r2l(k[0])!==_.r2l(T[0])||_.r2l(k[1])!==_.r2l(T[1]))&&(S={xr0:k,xr1:T}),D&&A&&(w.r2l(D[0])!==w.r2l(A[0])||w.r2l(D[1])!==w.r2l(A[1]))&&(M={yr0:D,yr1:A}),(S||M)&&l.push(u.extendFlat({plotinfo:b},S,M))}}return Promise.resolve()},o.runFn=function(t){var n,a,o=e._fullLayout._basePlotModules,c=l.length;if(r)for(a=0;a<o.length;a++)o[a].transitionAxes&&o[a].transitionAxes(e,l,i,t);for(var f in c?((n=u.extendFlat({},i)).duration=0,delete s.cartesian):n=i,s){var p=s[f];e._fullData[p[0]]._module.basePlotModule.plot(e,p,n,t)}},O(e,i,o)},x.transitionFromReact=function(e,t,r,n){var a=e._fullLayout,i=a.transition,o={},s=[];return o.prepareFn=function(){var e=a._plots;for(var i in o.redraw=!1,"some"===t.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),e){var l=e[i],c=l.xaxis,f=l.yaxis,p=n[c._name].range.slice(),h=n[f._name].range.slice(),d=c.range.slice(),m=f.range.slice();c.setScale(),f.setScale();var g=null,y=null;c.r2l(p[0])===c.r2l(d[0])&&c.r2l(p[1])===c.r2l(d[1])||(g={xr0:p,xr1:d}),f.r2l(h[0])===f.r2l(m[0])&&f.r2l(h[1])===f.r2l(m[1])||(y={yr0:h,yr1:m}),(g||y)&&s.push(u.extendFlat({plotinfo:l},g,y))}return Promise.resolve()},o.runFn=function(r){for(var n,a,o,l=e._fullData,c=e._fullLayout._basePlotModules,f=[],p=0;p<l.length;p++)f.push(p);function h(){if(e._fullLayout)for(var t=0;t<c.length;t++)c[t].transitionAxes&&c[t].transitionAxes(e,s,n,r)}function d(){if(e._fullLayout)for(var t=0;t<c.length;t++)c[t].plot(e,o,a,r)}s.length&&t.anim?"traces first"===i.ordering?(n=u.extendFlat({},i,{duration:0}),o=f,a=i,setTimeout(h,i.duration),d()):(n=i,o=null,a=u.extendFlat({},i,{duration:0}),setTimeout(d,n.duration),h()):s.length?(n=i,h()):t.anim&&(o=f,a=i,d())},O(e,i,o)},x.doCalcdata=function(e,t){var r,n,a,i,o=h.list(e),c=e._fullData,f=e._fullLayout,d=new Array(c.length),m=(e.calcdata||[]).slice();for(e.calcdata=d,f._numBoxes=0,f._numViolins=0,f._violinScaleGroupStats={},e._hmpixcount=0,e._hmlumcount=0,f._piecolormap={},f._sunburstcolormap={},f._treemapcolormap={},f._iciclecolormap={},f._funnelareacolormap={},a=0;a<c.length;a++)Array.isArray(t)&&-1===t.indexOf(a)&&(d[a]=m[a]);for(a=0;a<c.length;a++)(r=c[a])._arrayAttrs=l.findArrayAttributes(r),r._extremes={};var g=f._subplots.polar||[];for(a=0;a<g.length;a++)o.push(f[g[a]].radialaxis,f[g[a]].angularaxis);for(var y in f._colorAxes){var v=f[y];!1!==v.cauto&&(delete v.cmin,delete v.cmax)}var b=!1;function x(t){if(r=c[t],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var a=n.calc(e,r);a[0]&&a[0].t&&a[0].t._scene&&delete a[0].t._scene.dirty}for(i=0;i<r.transforms.length;i++){var o=r.transforms[i];(n=_[o.type])&&n.calcTransform&&(r._hasCalcTransform=!0,b=!0,n.calcTransform(e,r,o))}}}function w(t,a){if(r=c[t],!!(n=r._module).isContainer===a){var o=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var s=r.transforms||[];for(i=s.length-1;i>=0;i--)if(s[i].enabled){r._indexToPoints=s[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:p,y:p}]),o[0].t||(o[0].t={}),o[0].trace=r,d[t]=o}}for(P(o,c,f),a=0;a<c.length;a++)w(a,!0);for(a=0;a<c.length;a++)x(a);for(b&&P(o,c,f),a=0;a<c.length;a++)w(a,!0);for(a=0;a<c.length;a++)w(a,!1);R(e);var k=function(e,t){var r,n,a,i,o,l=[];function c(e,r,n){var a=r._id.charAt(0);if("histogram2dcontour"===e){var i=r._counterAxes[0],o=h.getFromId(t,i),s="x"===a||"x"===i&&"category"===o.type,l="y"===a||"y"===i&&"category"===o.type;return function(e,t){return 0===e||0===t||s&&e===n[t].length-1||l&&t===n.length-1?-1:("y"===a?t:e)-1}}return function(e,t){return"y"===a?t:e}}var f={min:function(e){return u.aggNums(Math.min,null,e)},max:function(e){return u.aggNums(Math.max,null,e)},sum:function(e){return u.aggNums((function(e,t){return e+t}),null,e)},total:function(e){return u.aggNums((function(e,t){return e+t}),null,e)},mean:function(e){return u.mean(e)},median:function(e){return u.median(e)}};for(r=0;r<e.length;r++){var p=e[r];if("category"===p.type){var d=p.categoryorder.match(I);if(d){var m=d[1],g=d[2],y=p._id.charAt(0),v="x"===y,b=[];for(n=0;n<p._categories.length;n++)b.push([p._categories[n],[]]);for(n=0;n<p._traceIndices.length;n++){var x=p._traceIndices[n],_=t._fullData[x];if(!0===_.visible){var w=_.type;s.traceIs(_,"histogram")&&(delete _._xautoBinFinished,delete _._yautoBinFinished);var k="splom"===w,D="scattergl"===w,T=t.calcdata[x];for(a=0;a<T.length;a++){var A,S,M=T[a];if(k){var E=_._axesDim[p._id];if(!v){var C=_._diag[E][0];C&&(p=t._fullLayout[h.id2name(C)])}var N=M.trace.dimensions[E].values;for(i=0;i<N.length;i++)for(A=p._categoriesMap[N[i]],o=0;o<M.trace.dimensions.length;o++)if(o!==E){var O=M.trace.dimensions[o];b[A][1].push(O.values[i])}}else if(D){for(i=0;i<M.t.x.length;i++)v?(A=M.t.x[i],S=M.t.y[i]):(A=M.t.y[i],S=M.t.x[i]),b[A][1].push(S);M.t&&M.t._scene&&delete M.t._scene.dirty}else if(M.hasOwnProperty("z")){S=M.z;var P=c(_.type,p,S);for(i=0;i<S.length;i++)for(o=0;o<S[i].length;o++)(A=P(o,i))+1&&b[A][1].push(S[i][o])}else for(void 0===(A=M.p)&&(A=M[y]),void 0===(S=M.s)&&(S=M.v),void 0===S&&(S=v?M.y:M.x),Array.isArray(S)||(S=void 0===S?[]:[S]),i=0;i<S.length;i++)b[A][1].push(S[i])}}}p._categoriesValue=b;var R=[];for(n=0;n<b.length;n++)R.push([b[n][0],f[m](b[n][1])]);R.sort((function(e,t){return e[1]-t[1]})),p._categoriesAggregatedValue=R,p._initialCategories=R.map((function(e){return e[0]})),"descending"===g&&p._initialCategories.reverse(),l=l.concat(p.sortByInitialCategories())}}}return l}(o,e);if(k.length){for(f._numBoxes=0,f._numViolins=0,a=0;a<k.length;a++)w(k[a],!0);for(a=0;a<k.length;a++)w(k[a],!1);R(e)}s.getComponentMethod("fx","calc")(e),s.getComponentMethod("errorbars","calc")(e)};var I=/(total|sum|min|max|mean|median) (ascending|descending)/;function P(e,t,r){var n={};function a(e){e.clearCalc(),"multicategory"===e.type&&e.setupMultiCategory(t),n[e._id]=1}u.simpleMap(e,a);for(var i=r._axisMatchGroups||[],o=0;o<i.length;o++)for(var s in i[o])n[s]||a(r[h.id2name(s)])}function R(e){var t,r,n,a=e._fullLayout,i=a._visibleModules,o={};for(r=0;r<i.length;r++){var s=i[r],l=s.crossTraceCalc;if(l){var c=s.basePlotModule.name;o[c]?u.pushUnique(o[c],l):o[c]=[l]}}for(n in o){var f=o[n],p=a._subplots[n];if(Array.isArray(p))for(t=0;t<p.length;t++){var h=p[t],d="cartesian"===n?a._plots[h]:a[h];for(r=0;r<f.length;r++)f[r](e,d,h)}else for(r=0;r<f.length;r++)f[r](e)}}x.rehover=function(e){e._fullLayout._rehover&&e._fullLayout._rehover()},x.redrag=function(e){e._fullLayout._redrag&&e._fullLayout._redrag()},x.generalUpdatePerTraceModule=function(e,t,r,n){var a,i=t.traceHash,o={};for(a=0;a<r.length;a++){var s=r[a],l=s[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(s))}for(var c in i)if(!o[c]){var f=i[c][0];f[0].trace.visible=!1,o[c]=[f]}for(var p in o){var h=o[p];h[0][0].trace._module.plot(e,t,u.filterVisible(h),n)}t.traceHash=o},x.plotBasePlot=function(e,t,r,n,a){var i=s.getModule(e),o=y(t.calcdata,i)[0];i.plot(t,o,n,a)},x.cleanBasePlot=function(e,t,r,n,a){var i=a._has&&a._has(e),o=r._has&&r._has(e);i&&!o&&a["_"+e+"layer"].selectAll("g.trace").remove()}},{"../components/color":366,"../constants/numerical":479,"../lib":503,"../plot_api/plot_schema":542,"../plot_api/plot_template":543,"../plots/get_data":593,"../registry":638,"./animation_attributes":548,"./attributes":550,"./cartesian/axis_ids":558,"./cartesian/handle_outline":565,"./command":583,"./font_attributes":585,"./frame_attributes":586,"./layout_attributes":610,"@plotly/d3":58,"d3-format":112,"d3-time-format":120,"fast-isnumeric":190}],620:[function(e,t,r){"use strict";t.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}},{}],621:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/polygon").tester,i=n.findIndexOfMin,o=n.isAngleInsideSector,s=n.angleDelta,l=n.angleDist;function c(e,t,r,n){var a,i,o=n[0],s=n[1],l=f(Math.sin(t)-Math.sin(e)),c=f(Math.cos(t)-Math.cos(e)),u=Math.tan(r),p=f(1/u),h=l/c,d=s-h*o;return p?l&&c?i=u*(a=d/(u-h)):c?(a=s*p,i=s):(a=o,i=o*u):l&&c?(a=0,i=d):c?(a=0,i=s):a=i=NaN,[a,i]}function u(e,t,r,a){return n.isFullCircle([t,r])?function(e,t){var r,n=t.length,a=new Array(n+1);for(r=0;r<n;r++){var i=t[r];a[r]=[e*Math.cos(i),e*Math.sin(i)]}return a[r]=a[0].slice(),a}(e,a):function(e,t,r,a){var s,u,f=a.length,p=[];function h(t){return[e*Math.cos(t),e*Math.sin(t)]}function d(e,t,r){return c(e,t,r,h(e))}function m(e){return n.mod(e,f)}function g(e){return o(e,[t,r])}var y=i(a,(function(e){return g(e)?l(e,t):1/0})),v=d(a[y],a[m(y-1)],t);for(p.push(v),s=y,u=0;u<f;s++,u++){var b=a[m(s)];if(!g(b))break;p.push(h(b))}var x=i(a,(function(e){return g(e)?l(e,r):1/0})),_=d(a[x],a[m(x+1)],r);return p.push(_),p.push([0,0]),p.push(p[0].slice()),p}(e,t,r,a)}function f(e){return Math.abs(e)>1e-10?e:0}function p(e,t,r){t=t||0,r=r||0;for(var n=e.length,a=new Array(n),i=0;i<n;i++){var o=e[i];a[i]=[t+o[0],r-o[1]]}return a}t.exports={isPtInsidePolygon:function(e,t,r,n,i){if(!o(t,n))return!1;var s,l;r[0]<r[1]?(s=r[0],l=r[1]):(s=r[1],l=r[0]);var c=a(u(s,n[0],n[1],i)),f=a(u(l,n[0],n[1],i)),p=[e*Math.cos(t),e*Math.sin(t)];return f.contains(p)&&!c.contains(p)},findPolygonOffset:function(e,t,r,n){for(var a=1/0,i=1/0,o=u(e,t,r,n),s=0;s<o.length;s++){var l=o[s];a=Math.min(a,l[0]),i=Math.min(i,-l[1])}return[a,i]},findEnclosingVertexAngles:function(e,t){var r=i(t,(function(t){var r=s(t,e);return r>0?r:1/0})),a=n.mod(r+1,t.length);return[t[r],t[a]]},findIntersectionXY:c,findXYatLength:function(e,t,r,n){var a=-t*r,i=t*t+1,o=2*(t*a-r),s=a*a+r*r-e*e,l=Math.sqrt(o*o-4*i*s),c=(-o+l)/(2*i),u=(-o-l)/(2*i);return[[c,t*c+a+n],[u,t*u+a+n]]},clampTiny:f,pathPolygon:function(e,t,r,n,a,i){return"M"+p(u(e,t,r,n),a,i).join("L")},pathPolygonAnnulus:function(e,t,r,n,a,i,o){var s,l;e<t?(s=e,l=t):(s=t,l=e);var c=p(u(s,r,n,a),i,o);return"M"+p(u(l,r,n,a),i,o).reverse().join("L")+"M"+c.join("L")}}},{"../../lib":503,"../../lib/polygon":515}],622:[function(e,t,r){"use strict";var n=e("../get_data").getSubplotCalcData,a=e("../../lib").counterRegex,i=e("./polar"),o=e("./constants"),s=o.attr,l=o.name,c=a(l),u={};u[s]={valType:"subplotid",dflt:l,editType:"calc"},t.exports={attr:s,name:l,idRoot:l,idRegex:c,attrRegex:c,attributes:u,layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots[l],o=0;o<a.length;o++){var s=a[o],c=n(r,l,s),u=t[s]._subplot;u||(u=i(e,s),t[s]._subplot=u),u.plot(c,t,e._promises)}},clean:function(e,t,r,n){for(var a=n._subplots[l]||[],i=n._has&&n._has("gl"),o=t._has&&t._has("gl"),s=i&&!o,c=0;c<a.length;c++){var u=a[c],f=n[u]._subplot;if(!t[u]&&f)for(var p in f.framework.remove(),f.layers["radial-axis-title"].remove(),f.clipPaths)f.clipPaths[p].remove();s&&f._scene&&(f._scene.destroy(),f._scene=null)}},toSVG:e("../cartesian").toSVG}},{"../../lib":503,"../cartesian":568,"../get_data":593,"./constants":620,"./layout_attributes":623,"./layout_defaults":624,"./polar":625}],623:[function(e,t,r){"use strict";var n=e("../../components/color/attributes"),a=e("../cartesian/layout_attributes"),i=e("../domain").attributes,o=e("../../lib").extendFlat,s=e("../../plot_api/edit_types").overrideAll,l=s({color:a.color,showline:o({},a.showline,{dflt:!0}),linecolor:a.linecolor,linewidth:a.linewidth,showgrid:o({},a.showgrid,{dflt:!0}),gridcolor:a.gridcolor,gridwidth:a.gridwidth},"plot","from-root"),c=s({tickmode:a.tickmode,nticks:a.nticks,tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:a.ticks,ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,showticklabels:a.showticklabels,showtickprefix:a.showtickprefix,tickprefix:a.tickprefix,showticksuffix:a.showticksuffix,ticksuffix:a.ticksuffix,showexponent:a.showexponent,exponentformat:a.exponentformat,minexponent:a.minexponent,separatethousands:a.separatethousands,tickfont:a.tickfont,tickangle:a.tickangle,tickformat:a.tickformat,tickformatstops:a.tickformatstops,layer:a.layer},"plot","from-root"),u={visible:o({},a.visible,{dflt:!0}),type:o({},a.type,{values:["-","linear","log","date","category"]}),autotypenumbers:a.autotypenumbers,autorange:o({},a.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},range:o({},a.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:a.categoryorder,categoryarray:a.categoryarray,angle:{valType:"angle",editType:"plot"},side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:o({},a.title.text,{editType:"plot",dflt:""}),font:o({},a.title.font,{editType:"plot"}),editType:"plot"},hoverformat:a.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc",_deprecated:{title:a._deprecated.title,titlefont:a._deprecated.titlefont}};o(u,l,c);var f={visible:o({},a.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:a.autotypenumbers,categoryorder:a.categoryorder,categoryarray:a.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:a.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};o(f,l,c),t.exports={domain:i({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:n.background},radialaxis:u,angularaxis:f,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}},{"../../components/color/attributes":365,"../../lib":503,"../../plot_api/edit_types":536,"../cartesian/layout_attributes":569,"../domain":584}],624:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../../plot_api/plot_template"),o=e("../subplot_defaults"),s=e("../get_data").getSubplotData,l=e("../cartesian/tick_value_defaults"),c=e("../cartesian/tick_mark_defaults"),u=e("../cartesian/tick_label_defaults"),f=e("../cartesian/prefix_suffix_defaults"),p=e("../cartesian/category_order_defaults"),h=e("../cartesian/line_grid_defaults"),d=e("../cartesian/axis_autotype"),m=e("./layout_attributes"),g=e("./set_convert"),y=e("./constants"),v=y.axisNames;function b(e,t,r,o){var d=r("bgcolor");o.bgColor=a.combine(d,o.paper_bgcolor);var b=r("sector");r("hole");var _,w=s(o.fullData,y.name,o.id),k=o.layoutOut;function D(e,t){return r(_+"."+e,t)}for(var T=0;T<v.length;T++){_=v[T],n.isPlainObject(e[_])||(e[_]={});var A=e[_],S=i.newContainer(t,_);S._id=S._name=_,S._attr=o.id+"."+_,S._traceIndices=w.map((function(e){return e._expandedIndex}));var M=y.axisName2dataArray[_],E=x(A,S,D,w,M,o);p(A,S,D,{axData:w,dataAttr:M});var C=D("visible");switch(g(S,t,k),D("uirevision",t.uirevision),S._m=1,_){case"radialaxis":var N=D("autorange",!S.isValidRange(A.range));A.autorange=N,!N||"linear"!==E&&"-"!==E||D("rangemode"),"reversed"===N&&(S._m=-1),D("range"),S.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if("date"===E){n.log("Polar plots do not support date angular axes yet.");for(var O=0;O<w.length;O++)w[O].visible=!1;E=A.type=S.type="linear"}D("linear"===E?"thetaunit":"period");var I=D("direction");D("rotation",{counterclockwise:0,clockwise:90}[I])}if(f(A,S,D,S.type,{tickSuffixDflt:"degrees"===S.thetaunit?"°":void 0}),C){var P,R,L,F,B=o.font||{};R=(P=D("color"))===A.color?P:B.color,L=B.size,F=B.family,l(A,S,D,S.type),u(A,S,D,S.type,{font:{color:R,size:L,family:F}}),c(A,S,D,{outerTicks:!0}),h(A,S,D,{dfltColor:P,bgColor:o.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:m[_]}),D("layer"),"radialaxis"===_&&(D("side"),D("angle",b[0]),D("title.text"),n.coerceFont(D,"title.font",{color:R,size:n.bigFont(L),family:F}))}"category"!==E&&D("hoverformat"),S._input=A}"category"===t.angularaxis.type&&r("gridshape")}function x(e,t,r,n,a,i){var o=r("autotypenumbers",i.autotypenumbersDflt);if("-"===r("type")){for(var s,l=0;l<n.length;l++)if(n[l].visible){s=n[l];break}s&&s[a]&&(t.type=d(s[a],"gregorian",{noMultiCategory:!0,autotypenumbers:o})),"-"===t.type?t.type="linear":e.type=t.type}return t.type}t.exports=function(e,t,r){o(e,t,r,{type:y.name,attributes:m,handleDefaults:b,font:t.font,autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,fullData:r,layoutOut:t})}},{"../../components/color":366,"../../lib":503,"../../plot_api/plot_template":543,"../cartesian/axis_autotype":555,"../cartesian/category_order_defaults":559,"../cartesian/line_grid_defaults":571,"../cartesian/prefix_suffix_defaults":573,"../cartesian/tick_label_defaults":578,"../cartesian/tick_mark_defaults":579,"../cartesian/tick_value_defaults":580,"../get_data":593,"../subplot_defaults":632,"./constants":620,"./layout_attributes":623,"./set_convert":626}],625:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("tinycolor2"),i=e("../../registry"),o=e("../../lib"),s=o.strRotate,l=o.strTranslate,c=e("../../components/color"),u=e("../../components/drawing"),f=e("../plots"),p=e("../../plots/cartesian/axes"),h=e("../cartesian/set_convert"),d=e("./set_convert"),m=e("../cartesian/autorange").doAutoRange,g=e("../cartesian/dragbox"),y=e("../../components/dragelement"),v=e("../../components/fx"),b=e("../../components/titles"),x=e("../cartesian/select").prepSelect,_=e("../cartesian/select").selectOnClick,w=e("../cartesian/select").clearSelect,k=e("../../lib/setcursor"),D=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,A=e("../../constants/alignment").MID_SHIFT,S=e("./constants"),M=e("./helpers"),E=e("../smith/helpers"),C=E.smith,N=E.reactanceArc,O=E.resistanceArc,I=E.smithTransform,P=o._,R=o.mod,L=o.deg2rad,F=o.rad2deg;function B(e,t,r){this.isSmith=r||!1,this.id=t,this.gd=e,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var n=e._fullLayout,a="clip"+n._uid+t;this.clipIds.forTraces=a+"-for-traces",this.clipPaths.forTraces=n._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=n["_"+(r?"smith":"polar")+"layer"].append("g").attr("class",t),this.getHole=function(e){return this.isSmith?0:e.hole},this.getSector=function(e){return this.isSmith?[0,360]:e.sector},this.getRadial=function(e){return this.isSmith?e.realaxis:e.radialaxis},this.getAngular=function(e){return this.isSmith?e.imaginaryaxis:e.angularaxis},r||(this.radialTickLayout=null,this.angularTickLayout=null)}var z=B.prototype;function j(e){var t=e.ticks+String(e.ticklen)+String(e.showticklabels);return"side"in e&&(t+=e.side),t}function U(e,t){return t[o.findIndexOfMin(t,(function(t){return o.angleDist(e,t)}))]}function $(e,t,r){return t?(e.attr("display",null),e.attr(r)):e&&e.attr("display","none"),e}t.exports=function(e,t,r){return new B(e,t,r)},z.plot=function(e,t){for(var r=t[this.id],n=!1,a=0;a<e.length;a++)if(!1===e[a][0].trace.cliponaxis){n=!0;break}this._hasClipOnAxisFalse=n,this.updateLayers(t,r),this.updateLayout(t,r),f.generalUpdatePerTraceModule(this.gd,this,e,r),this.updateFx(t,r),this.isSmith&&(delete r.realaxis.range,delete r.imaginaryaxis.range)},z.updateLayers=function(e,t){var r=this.isSmith,a=this.layers,i=this.getRadial(t),o=this.getAngular(t),s=S.layerNames,l=s.indexOf("frontplot"),c=s.slice(0,l),u="below traces"===o.layer,f="below traces"===i.layer;u&&c.push("angular-line"),f&&c.push("radial-line"),u&&c.push("angular-axis"),f&&c.push("radial-axis"),c.push("frontplot"),u||c.push("angular-line"),f||c.push("radial-line"),u||c.push("angular-axis"),f||c.push("radial-axis");var p=(r?"smith":"polar")+"sublayer",h=this.framework.selectAll("."+p).data(c,String);h.enter().append("g").attr("class",(function(e){return p+" "+e})).each((function(e){var t=a[e]=n.select(this);switch(e){case"frontplot":r||t.append("g").classed("barlayer",!0),t.append("g").classed("scatterlayer",!0);break;case"backplot":t.append("g").classed("maplayer",!0);break;case"plotbg":a.bg=t.append("path");break;case"radial-grid":case"angular-grid":t.style("fill","none");break;case"radial-line":t.append("line").style("fill","none");break;case"angular-line":t.append("path").style("fill","none")}})),h.order()},z.updateLayout=function(e,t){var r=this.layers,n=e._size,a=this.getRadial(t),i=this.getAngular(t),o=t.domain.x,s=t.domain.y;this.xOffset=n.l+n.w*o[0],this.yOffset=n.t+n.h*(1-s[1]);var f=this.xLength=n.w*(o[1]-o[0]),p=this.yLength=n.h*(s[1]-s[0]),h=this.getSector(t);this.sectorInRad=h.map(L);var d,m,g,y,v,b=this.sectorBBox=function(e){var t,r=e[0],n=e[1]-r,a=R(r,360),i=a+n,o=Math.cos(L(a)),s=Math.sin(L(a)),l=Math.cos(L(i)),c=Math.sin(L(i));return t=a<=90&&i>=90||a>90&&i>=450?1:s<=0&&c<=0?0:Math.max(s,c),[a<=180&&i>=180||a>180&&i>=540?-1:o>=0&&l>=0?0:Math.min(o,l),a<=270&&i>=270||a>270&&i>=630?-1:s>=0&&c>=0?0:Math.min(s,c),i>=360?1:o<=0&&l<=0?0:Math.max(o,l),t]}(h),x=b[2]-b[0],_=b[3]-b[1],w=p/f,k=Math.abs(_/x);w>k?(d=f,v=(p-(m=f*k))/n.h/2,g=[o[0],o[1]],y=[s[0]+v,s[1]-v]):(m=p,v=(f-(d=p/k))/n.w/2,g=[o[0]+v,o[1]-v],y=[s[0],s[1]]),this.xLength2=d,this.yLength2=m,this.xDomain2=g,this.yDomain2=y;var D,T=this.xOffset2=n.l+n.w*g[0],A=this.yOffset2=n.t+n.h*(1-y[1]),S=this.radius=d/x,M=this.innerRadius=this.getHole(t)*S,E=this.cx=T-S*b[0],C=this.cy=A+S*b[3],N=this.cxx=E-T,O=this.cyy=C-A,I=a.side;"counterclockwise"===I?(D=I,I="top"):"clockwise"===I&&(D=I,I="bottom"),this.radialAxis=this.mockAxis(e,t,a,{_id:"x",side:I,_trueSide:D,domain:[M/n.w,S/n.w]}),this.angularAxis=this.mockAxis(e,t,i,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(e,t),this.updateAngularAxis(e,t),this.updateRadialAxis(e,t),this.updateRadialAxisTitle(e,t),this.xaxis=this.mockCartesianAxis(e,t,{_id:"x",domain:g}),this.yaxis=this.mockCartesianAxis(e,t,{_id:"y",domain:y});var P=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",P).attr("transform",l(N,O)),r.frontplot.attr("transform",l(T,A)).call(u.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",P).attr("transform",l(E,C)).call(c.fill,t.bgcolor)},z.mockAxis=function(e,t,r,n){var a=o.extendFlat({},r,n);return d(a,t,e),a},z.mockCartesianAxis=function(e,t,r){var n=this,a=n.isSmith,i=r._id,s=o.extendFlat({type:"linear"},r);h(s,e);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var e=n.sectorBBox,r=l[i],a=n.radialAxis._rl,o=(a[1]-a[0])/(1-n.getHole(t));s.range=[e[r[0]]*o,e[r[1]]*o]},s.isPtWithinRange="x"!==i||a?function(){return!0}:function(e){return n.isPtInside(e)},s.setRange(),s.setScale(),s},z.doAutoRange=function(e,t){var r=this.gd,n=this.radialAxis,a=this.getRadial(t);m(r,n);var i=n.range;a.range=i.slice(),a._input.range=i.slice(),n._rl=[n.r2l(i[0],null,"gregorian"),n.r2l(i[1],null,"gregorian")]},z.updateRadialAxis=function(e,t){var r=this,n=r.gd,a=r.layers,i=r.radius,u=r.innerRadius,f=r.cx,h=r.cy,d=r.getRadial(t),m=R(r.getSector(t)[0],360),g=r.radialAxis,y=u<i,v=r.isSmith;v||(r.fillViewInitialKey("radialaxis.angle",d.angle),r.fillViewInitialKey("radialaxis.range",g.range.slice()),g.setGeometry()),"auto"===g.tickangle&&m>90&&m<=270&&(g.tickangle=180);var b=v?function(e){var t=I(r,C([e.x,0]));return l(t[0]-f,t[1]-h)}:function(e){return l(g.l2p(e.x)+u,0)},x=v?function(e){return O(r,e.x,-1/0,1/0)}:function(e){return r.pathArc(g.r2p(e.x)+u)},_=j(d);if(r.radialTickLayout!==_&&(a["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),y){g.setScale();var w=0,k=v?(g.tickvals||[]).filter((function(e){return e>=0})).map((function(e){return p.tickText(g,e,!0,!1)})):p.calcTicks(g),D=v?k:p.clipEnds(g,k),T=p.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(T=-T),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),p.drawTicks(n,g,{vals:k,layer:a["radial-axis"],path:p.makeTickPath(g,0,T),transFn:b,crisp:!1}),p.drawGrid(n,g,{vals:D,layer:a["radial-grid"],path:x,transFn:o.noop,crisp:!1}),p.drawLabels(n,g,{vals:k,layer:a["radial-axis"],transFn:b,labelFns:p.makeLabelFns(g,w)})}var A=r.radialAxisAngle=r.vangles?F(U(L(d.angle),r.vangles)):d.angle,S=l(f,h),M=S+s(-A);$(a["radial-axis"],y&&(d.showticklabels||d.ticks),{transform:M}),$(a["radial-grid"],y&&d.showgrid,{transform:v?"":S}),$(a["radial-line"].select("line"),y&&d.showline,{x1:v?-i:u,y1:0,x2:i,y2:0,transform:M}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},z.updateRadialAxisTitle=function(e,t,r){if(!this.isSmith){var n=this.gd,a=this.radius,i=this.cx,o=this.cy,s=this.getRadial(t),l=this.id+"title",c=0;if(s.title){var f=u.bBox(this.layers["radial-axis"].node()).height,p=s.title.font.size,h=s.side;c="top"===h?p:"counterclockwise"===h?-(f+.4*p):f+.8*p}var d=void 0!==r?r:this.radialAxisAngle,m=L(d),g=Math.cos(m),y=Math.sin(m),v=i+a/2*g+c*y,x=o-a/2*y+c*g;this.layers["radial-axis-title"]=b.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:P(n,"Click to enter radial axis title"),attributes:{x:v,y:x,"text-anchor":"middle"},transform:{rotate:-d}})}},z.updateAngularAxis=function(e,t){var r=this,n=r.gd,a=r.layers,i=r.radius,u=r.innerRadius,f=r.cx,h=r.cy,d=r.getAngular(t),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale());var y=g?function(e){var t=I(r,C([0,e.x]));return Math.atan2(t[0]-f,t[1]-h)-Math.PI/2}:function(e){return m.t2g(e.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=F(m.tick0),m.dtick=F(m.dtick));var v=function(e){return l(f+i*Math.cos(e),h-i*Math.sin(e))},b=g?function(e){var t=I(r,C([0,e.x]));return l(t[0],t[1])}:function(e){return v(y(e))},x=g?function(e){var t=I(r,C([0,e.x])),n=Math.atan2(t[0]-f,t[1]-h)-Math.PI/2;return l(t[0],t[1])+s(-F(n))}:function(e){var t=y(e);return v(t)+s(-F(t))},_=g?function(e){return N(r,e.x,0,1/0)}:function(e){var t=y(e),r=Math.cos(t),n=Math.sin(t);return"M"+[f+u*r,h-u*n]+"L"+[f+i*r,h-i*n]},w=p.makeLabelFns(m,0).labelStandoff,k={xFn:function(e){var t=y(e);return Math.cos(t)*w},yFn:function(e){var t=y(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(w+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*A)},anchorFn:function(e){var t=y(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(e,t,r){var n=y(e);return-.5*(1+Math.sin(n))*r}},D=j(d);r.angularTickLayout!==D&&(a["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=D);var T,S=g?[1/0].concat(m.tickvals||[]).map((function(e){return p.tickText(m,e,!0,!1)})):p.calcTicks(m);if(g&&(S[0].text="∞",S[0].fontSize*=1.75),"linear"===t.gridshape?(T=S.map(y),o.angleDelta(T[0],T[1])<0&&(T=T.slice().reverse())):T=null,r.vangles=T,"category"===m.type&&(S=S.filter((function(e){return o.isAngleInsideSector(y(e),r.sectorInRad)}))),m.visible){var M="inside"===m.ticks?-1:1,E=(m.linewidth||1)/2;p.drawTicks(n,m,{vals:S,layer:a["angular-axis"],path:"M"+M*E+",0h"+M*m.ticklen,transFn:x,crisp:!1}),p.drawGrid(n,m,{vals:S,layer:a["angular-grid"],path:_,transFn:o.noop,crisp:!1}),p.drawLabels(n,m,{vals:S,layer:a["angular-axis"],repositionOnUpdate:!0,transFn:b,labelFns:k})}$(a["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:l(f,h)}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},z.updateFx=function(e,t){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(e),this.updateRadialDrag(e,t,0),this.updateRadialDrag(e,t,1)),this.updateHoverAndMainDrag(e))},z.updateHoverAndMainDrag=function(e){var t,r,s=this,c=s.isSmith,u=s.gd,f=s.layers,p=e._zoomlayer,h=S.MINZOOM,d=S.OFFEDGE,m=s.radius,b=s.innerRadius,k=s.cx,D=s.cy,T=s.cxx,A=s.cyy,E=s.sectorInRad,C=s.vangles,N=s.radialAxis,O=M.clampTiny,I=M.findXYatLength,P=M.findEnclosingVertexAngles,R=S.cornerHalfWidth,L=S.cornerLen/2,F=g.makeDragger(f,"path","maindrag","crosshair");n.select(F).attr("d",s.pathSubplot()).attr("transform",l(k,D)),F.onmousemove=function(e){v.hover(u,e,s.id),u._fullLayout._lasthover=F,u._fullLayout._hoversubplot=s.id},F.onmouseout=function(e){u._dragging||y.unhover(u,e)};var B,z,j,U,$,V,q,W,H,G={element:F,gd:u,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function X(e,t){return Math.sqrt(e*e+t*t)}function Y(e,t){return X(e-T,t-A)}function Z(e,t){return Math.atan2(A-t,e-T)}function K(e,t){return[e*Math.cos(t),e*Math.sin(-t)]}function J(e,t){if(0===e)return s.pathSector(2*R);var r=L/e,n=t-r,a=t+r,i=Math.max(0,Math.min(e,m)),o=i-R,l=i+R;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,a)+"L"+K(l,a)+"A"+[l,l]+" 0,0,1 "+K(l,n)+"Z"}function Q(e,t,r){if(0===e)return s.pathSector(2*R);var n,a,i=K(e,t),o=K(e,r),l=O((i[0]+o[0])/2),c=O((i[1]+o[1])/2);if(l&&c){var u=c/l,f=-1/u,p=I(R,u,l,c);n=I(L,f,p[0][0],p[0][1]),a=I(L,f,p[1][0],p[1][1])}else{var h,d;c?(h=L,d=R):(h=R,d=L),n=[[l-h,c-d],[l+h,c-d]],a=[[l-h,c+d],[l+h,c+d]]}return"M"+n.join("L")+"L"+a.reverse().join("L")+"Z"}function ee(e,t){return t=Math.max(Math.min(t,m),b),e<d?e=0:m-e<d?e=m:t<d?t=0:m-t<d&&(t=m),Math.abs(t-e)>h?(e<t?(j=e,U=t):(j=t,U=e),!0):(j=null,U=null,!1)}function te(e,t){e=e||$,t=t||"M0,0Z",W.attr("d",e),H.attr("d",t),g.transitionZoombox(W,H,V,q),V=!0;var r={};oe(r),u.emit("plotly_relayouting",r)}function re(e,n){var a,i,o=B+(e*=t),l=z+(n*=r),c=Y(B,z),u=Math.min(Y(o,l),m),f=Z(B,z);ee(c,u)&&(a=$+s.pathSector(U),j&&(a+=s.pathSector(j)),i=J(j,f)+J(U,f)),te(a,i)}function ne(e,t,r,n){var a=M.findIntersectionXY(r,n,r,[e-T,A-t]);return X(a[0],a[1])}function ae(e,t){var r,n,a=B+e,i=z+t,o=Z(B,z),l=Z(a,i),c=P(o,C),u=P(l,C);ee(ne(B,z,c[0],c[1]),Math.min(ne(a,i,u[0],u[1]),m))&&(r=$+s.pathSector(U),j&&(r+=s.pathSector(j)),n=[Q(j,c[0],c[1]),Q(U,c[0],c[1])].join(" ")),te(r,n)}function ie(){if(g.removeZoombox(u),null!==j&&null!==U){var e={};oe(e),g.showDoubleClickNotifier(u),i.call("_guiRelayout",u,e)}}function oe(e){var t=N._rl,r=(t[1]-t[0])/(1-b/m)/m,n=[t[0]+(j-b)*r,t[0]+(U-b)*r];e[s.id+".radialaxis.range"]=n}function se(e,t){var r=u._fullLayout.clickmode;if(g.removeZoombox(u),2===e){var n={};for(var a in s.viewInitial)n[s.id+"."+a]=s.viewInitial[a];u.emit("plotly_doubleclick",null),i.call("_guiRelayout",u,n)}r.indexOf("select")>-1&&1===e&&_(t,u,[s.xaxis],[s.yaxis],s.id,G),r.indexOf("event")>-1&&v.click(u,t,s.id)}G.prepFn=function(e,n,i){var l=u._fullLayout.dragmode,f=F.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var h=u._fullLayout._invTransform;t=u._fullLayout._invScaleX,r=u._fullLayout._invScaleY;var d=o.apply3DTransform(h)(n-f.left,i-f.top);if(B=d[0],z=d[1],C){var y=M.findPolygonOffset(m,E[0],E[1],C);B+=T+y[0],z+=A+y[1]}switch(l){case"zoom":G.clickFn=se,c||(G.moveFn=C?ae:re,G.doneFn=ie,function(){j=null,U=null,$=s.pathSubplot(),V=!1;var e=u._fullLayout[s.id];q=a(e.bgcolor).getLuminance(),(W=g.makeZoombox(p,q,k,D,$)).attr("fill-rule","evenodd"),H=g.makeCorners(p,k,D),w(u)}());break;case"select":case"lasso":x(e,n,i,G,l)}},y.init(G)},z.updateRadialDrag=function(e,t,r){var a=this,c=a.gd,u=a.layers,f=a.radius,p=a.innerRadius,h=a.cx,d=a.cy,m=a.radialAxis,v=S.radialDragBoxSize,b=v/2;if(m.visible){var x,_,k,A=L(a.radialAxisAngle),M=m._rl,E=M[0],C=M[1],N=M[r],O=.75*(M[1]-M[0])/(1-a.getHole(t))/f;r?(x=h+(f+b)*Math.cos(A),_=d-(f+b)*Math.sin(A),k="radialdrag"):(x=h+(p-b)*Math.cos(A),_=d-(p-b)*Math.sin(A),k="radialdrag-inner");var I,P,R,B=g.makeRectDragger(u,k,"crosshair",-b,-b,v,v),z={element:B,gd:c};$(n.select(B),m.visible&&p<f,{transform:l(x,_)}),z.prepFn=function(){I=null,P=null,R=null,z.moveFn=j,z.doneFn=V,w(c)},z.clampFn=function(e,t){return Math.sqrt(e*e+t*t)<S.MINDRAG&&(e=0,t=0),[e,t]},y.init(z)}function j(e,t){if(I)I(e,t);else{var n=[e,-t],i=[Math.cos(A),Math.sin(A)],s=Math.abs(o.dot(n,i)/Math.sqrt(o.dot(n,n)));isNaN(s)||(I=s<.5?q:W)}var l={};!function(e){null!==P?e[a.id+".radialaxis.angle"]=P:null!==R&&(e[a.id+".radialaxis.range["+r+"]"]=R)}(l),c.emit("plotly_relayouting",l)}function V(){null!==P?i.call("_guiRelayout",c,a.id+".radialaxis.angle",P):null!==R&&i.call("_guiRelayout",c,a.id+".radialaxis.range["+r+"]",R)}function q(e,t){if(0!==r){var n=x+e,i=_+t;P=Math.atan2(d-i,n-h),a.vangles&&(P=U(P,a.vangles)),P=F(P);var o=l(h,d)+s(-P);u["radial-axis"].attr("transform",o),u["radial-line"].select("line").attr("transform",o);var c=a.gd._fullLayout,f=c[a.id];a.updateRadialAxisTitle(c,f,P)}}function W(e,t){var n=o.dot([e,-t],[Math.cos(A),Math.sin(A)]);if(R=N-O*n,O>0==(r?R>E:R<C)){var s=c._fullLayout,l=s[a.id];m.range[r]=R,m._rl[r]=R,a.updateRadialAxis(s,l),a.xaxis.setRange(),a.xaxis.setScale(),a.yaxis.setRange(),a.yaxis.setScale();var u=!1;for(var f in a.traceHash){var p=a.traceHash[f],h=o.filterVisible(p);p[0][0].trace._module.plot(c,a,h,l),i.traceIs(f,"gl")&&h.length&&(u=!0)}u&&(D(c),T(c))}else R=null}},z.updateAngularDrag=function(e){var t=this,r=t.gd,a=t.layers,c=t.radius,f=t.angularAxis,p=t.cx,h=t.cy,d=t.cxx,m=t.cyy,v=S.angularDragBoxSize,b=g.makeDragger(a,"path","angulardrag","move"),x={element:b,gd:r};function _(e,t){return Math.atan2(m+v-t,e-d-v)}n.select(b).attr("d",t.pathAnnulus(c,c+v)).attr("transform",l(p,h)).call(k,"move");var A,M,E,C,N,O,I=a.frontplot.select(".scatterlayer").selectAll(".trace"),P=I.selectAll(".point"),R=I.selectAll(".textpoint");function L(c,g){var y=t.gd._fullLayout,v=y[t.id],b=_(A+c*e._invScaleX,M+g*e._invScaleY),x=F(b-O);if(C=E+x,a.frontplot.attr("transform",l(t.xOffset2,t.yOffset2)+s([-x,d,m])),t.vangles){N=t.radialAxisAngle+x;var w=l(p,h)+s(-x),k=l(p,h)+s(-N);a.bg.attr("transform",w),a["radial-grid"].attr("transform",w),a["radial-axis"].attr("transform",k),a["radial-line"].select("line").attr("transform",k),t.updateRadialAxisTitle(y,v,N)}else t.clipPaths.forTraces.select("path").attr("transform",l(d,m)+s(x));P.each((function(){var e=n.select(this),t=u.getTranslate(e);e.attr("transform",l(t.x,t.y)+s([x]))})),R.each((function(){var e=n.select(this),t=e.select("text"),r=u.getTranslate(e);e.attr("transform",s([x,t.attr("x"),t.attr("y")])+l(r.x,r.y))})),f.rotation=o.modHalf(C,360),t.updateAngularAxis(y,v),t._hasClipOnAxisFalse&&!o.isFullCircle(t.sectorInRad)&&I.call(u.hideOutsideRangePoints,t);var S=!1;for(var L in t.traceHash)if(i.traceIs(L,"gl")){var z=t.traceHash[L],j=o.filterVisible(z);z[0][0].trace._module.plot(r,t,j,v),j.length&&(S=!0)}S&&(D(r),T(r));var U={};B(U),r.emit("plotly_relayouting",U)}function B(e){e[t.id+".angularaxis.rotation"]=C,t.vangles&&(e[t.id+".radialaxis.angle"]=N)}function z(){R.select("text").attr("transform",null);var e={};B(e),i.call("_guiRelayout",r,e)}x.prepFn=function(n,a,i){var s=e[t.id];E=s.angularaxis.rotation;var l=b.getBoundingClientRect();A=a-l.left,M=i-l.top,r._fullLayout._calcInverseTransform(r);var c=o.apply3DTransform(e._invTransform)(A,M);A=c[0],M=c[1],O=_(A,M),x.moveFn=L,x.doneFn=z,w(r)},t.vangles&&!o.isFullCircle(t.sectorInRad)&&(x.prepFn=o.noop,k(n.select(b),null)),y.init(x)},z.isPtInside=function(e){if(this.isSmith)return!0;var t=this.sectorInRad,r=this.vangles,n=this.angularAxis.c2g(e.theta),a=this.radialAxis,i=a.c2l(e.r),s=a._rl;return(r?M.isPtInsidePolygon:o.isPtInsideSector)(i,n,s,t,r)},z.pathArc=function(e){var t=this.sectorInRad,r=this.vangles;return(r?M.pathPolygon:o.pathArc)(e,t[0],t[1],r)},z.pathSector=function(e){var t=this.sectorInRad,r=this.vangles;return(r?M.pathPolygon:o.pathSector)(e,t[0],t[1],r)},z.pathAnnulus=function(e,t){var r=this.sectorInRad,n=this.vangles;return(n?M.pathPolygonAnnulus:o.pathAnnulus)(e,t,r[0],r[1],n)},z.pathSubplot=function(){var e=this.innerRadius,t=this.radius;return e?this.pathAnnulus(e,t):this.pathSector(t)},z.fillViewInitialKey=function(e,t){e in this.viewInitial||(this.viewInitial[e]=t)}},{"../../components/color":366,"../../components/dragelement":385,"../../components/drawing":388,"../../components/fx":406,"../../components/titles":464,"../../constants/alignment":471,"../../lib":503,"../../lib/clear_gl_canvases":487,"../../lib/setcursor":524,"../../plot_api/subroutines":544,"../../plots/cartesian/axes":554,"../../registry":638,"../cartesian/autorange":553,"../cartesian/dragbox":563,"../cartesian/select":575,"../cartesian/set_convert":576,"../plots":619,"../smith/helpers":628,"./constants":620,"./helpers":621,"./set_convert":626,"@plotly/d3":58,tinycolor2:312}],626:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../cartesian/set_convert"),i=n.deg2rad,o=n.rad2deg;t.exports=function(e,t,r){switch(a(e,r),e._id){case"x":case"radialaxis":!function(e,t){var r=t._subplot;e.setGeometry=function(){var t=e._rl[0],n=e._rl[1],a=r.innerRadius,i=(r.radius-a)/(n-t),o=a/i,s=t>n?function(e){return e<=0}:function(e){return e>=0};e.c2g=function(r){var n=e.c2l(r)-t;return(s(n)?n:0)+o},e.g2c=function(r){return e.l2c(r+t-o)},e.g2p=function(e){return e*i},e.c2p=function(t){return e.g2p(e.c2g(t))}}}(e,t);break;case"angularaxis":!function(e,t){var r=e.type;if("linear"===r){var a=e.d2c,s=e.c2d;e.d2c=function(e,t){return function(e,t){return"degrees"===t?i(e):e}(a(e),t)},e.c2d=function(e,t){return s(function(e,t){return"degrees"===t?o(e):e}(e,t))}}e.makeCalcdata=function(t,a){var i,o,s=t[a],l=t._length,c=function(r){return e.d2c(r,t.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(i=new Array(l),o=0;o<l;o++)i[o]=c(s[o])}else{var u=a+"0",f="d"+a,p=u in t?c(t[u]):0,h=t[f]?c(t[f]):(e.period||2*Math.PI)/l;for(i=new Array(l),o=0;o<l;o++)i[o]=p+o*h}return i},e.setGeometry=function(){var a,s,l,c,u=t.sector,f=u.map(i),p={clockwise:-1,counterclockwise:1}[e.direction],h=i(e.rotation),d=function(e){return p*e+h},m=function(e){return(e-h)/p};switch(r){case"linear":s=a=n.identity,c=i,l=o,e.range=n.isFullCircle(f)?[u[0],u[0]+360]:f.map(m).map(o);break;case"category":var g=e._categories.length,y=e.period?Math.max(e.period,g):g;0===y&&(y=1),s=c=function(e){return 2*e*Math.PI/y},a=l=function(e){return e*y/Math.PI/2},e.range=[0,y]}e.c2g=function(e){return d(s(e))},e.g2c=function(e){return a(m(e))},e.t2g=function(e){return d(c(e))},e.g2t=function(e){return l(m(e))}}}(e,t)}}},{"../../lib":503,"../cartesian/set_convert":576}],627:[function(e,t,r){"use strict";t.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}},{}],628:[function(e,t,r){"use strict";function n(e){return e<0?-1:e>0?1:0}function a(e){var t=e[0],r=e[1];if(!isFinite(t)||!isFinite(r))return[1,0];var n=(t+1)*(t+1)+r*r;return[(t*t+r*r-1)/n,2*r/n]}function i(e,t){var r=t[0],n=t[1];return[r*e.radius+e.cx,-n*e.radius+e.cy]}function o(e,t){return t*e.radius}t.exports={smith:a,reactanceArc:function(e,t,r,n){var s=i(e,a([r,t])),l=s[0],c=s[1],u=i(e,a([n,t])),f=u[0],p=u[1];if(0===t)return["M"+l+","+c,"L"+f+","+p].join(" ");var h=o(e,1/Math.abs(t));return["M"+l+","+c,"A"+h+","+h+" 0 0,"+(t<0?1:0)+" "+f+","+p].join(" ")},resistanceArc:function(e,t,r,s){var l=o(e,1/(t+1)),c=i(e,a([t,r])),u=c[0],f=c[1],p=i(e,a([t,s])),h=p[0],d=p[1];if(n(r)!==n(s)){var m=i(e,a([t,0]));return["M"+u+","+f,"A"+l+","+l+" 0 0,"+(0<r?0:1)+" "+m[0]+","+m[1],"A"+l+","+l+" 0 0,"+(s<0?0:1)+h+","+d].join(" ")}return["M"+u+","+f,"A"+l+","+l+" 0 0,"+(s<r?0:1)+" "+h+","+d].join(" ")},smithTransform:i}},{}],629:[function(e,t,r){"use strict";var n=e("../get_data").getSubplotCalcData,a=e("../../lib").counterRegex,i=e("../polar/polar"),o=e("./constants"),s=o.attr,l=o.name,c=a(l),u={};u[s]={valType:"subplotid",dflt:l,editType:"calc"},t.exports={attr:s,name:l,idRoot:l,idRegex:c,attrRegex:c,attributes:u,layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots[l],o=0;o<a.length;o++){var s=a[o],c=n(r,l,s),u=t[s]._subplot;u||(u=i(e,s,!0),t[s]._subplot=u),u.plot(c,t,e._promises)}},clean:function(e,t,r,n){for(var a=n._subplots[l]||[],i=0;i<a.length;i++){var o=a[i],s=n[o]._subplot;if(!t[o]&&s)for(var c in s.framework.remove(),s.clipPaths)s.clipPaths[c].remove()}},toSVG:e("../cartesian").toSVG}},{"../../lib":503,"../cartesian":568,"../get_data":593,"../polar/polar":625,"./constants":627,"./layout_attributes":630,"./layout_defaults":631}],630:[function(e,t,r){"use strict";var n=e("../../components/color/attributes"),a=e("../cartesian/layout_attributes"),i=e("../domain").attributes,o=e("../../lib").extendFlat,s=e("../../plot_api/edit_types").overrideAll,l=s({color:a.color,showline:o({},a.showline,{dflt:!0}),linecolor:a.linecolor,linewidth:a.linewidth,showgrid:o({},a.showgrid,{dflt:!0}),gridcolor:a.gridcolor,gridwidth:a.gridwidth},"plot","from-root"),c=s({ticklen:a.ticklen,tickwidth:o({},a.tickwidth,{dflt:2}),tickcolor:a.tickcolor,showticklabels:a.showticklabels,showtickprefix:a.showtickprefix,tickprefix:a.tickprefix,showticksuffix:a.showticksuffix,ticksuffix:a.ticksuffix,tickfont:a.tickfont,tickformat:a.tickformat,hoverformat:a.hoverformat,layer:a.layer},"plot","from-root"),u=o({visible:o({},a.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:o({},a.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},l,c),f=o({visible:o({},a.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:a.ticks,editType:"calc"},l,c);t.exports={domain:i({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:n.background},realaxis:u,imaginaryaxis:f,editType:"calc"}},{"../../components/color/attributes":365,"../../lib":503,"../../plot_api/edit_types":536,"../cartesian/layout_attributes":569,"../domain":584}],631:[function(e,t,r){"use strict";var n,a,i,o=e("../../lib"),s=e("../../components/color"),l=e("../../plot_api/plot_template"),c=e("../subplot_defaults"),u=e("../get_data").getSubplotData,f=e("../cartesian/prefix_suffix_defaults"),p=e("../cartesian/tick_label_defaults"),h=e("../cartesian/line_grid_defaults"),d=e("../cartesian/set_convert"),m=e("./layout_attributes"),g=e("./constants"),y=g.axisNames,v=(n=function(e){return e.slice().reverse().map((function(e){return-e})).concat([0]).concat(e)},a=String,i={},function(e){var t=a?a(e):e;if(t in i)return i[t];var r=n(e);return i[t]=r,r});function b(e,t,r,n){var a=r("bgcolor");n.bgColor=s.combine(a,n.paper_bgcolor);var i,c=u(n.fullData,g.name,n.id),b=n.layoutOut;function x(e,t){return r(i+"."+e,t)}for(var _=0;_<y.length;_++){i=y[_],o.isPlainObject(e[i])||(e[i]={});var w=e[i],k=l.newContainer(t,i);k._id=k._name=i,k._attr=n.id+"."+i,k._traceIndices=c.map((function(e){return e._expandedIndex}));var D=x("visible");if(k.type="linear",d(k,b),f(w,k,x,k.type),D){var T,A,S,M,E="realaxis"===i;E&&x("side"),E?x("tickvals"):x("tickvals",v(t.realaxis.tickvals||m.realaxis.tickvals.dflt));var C=n.font||{};D&&(A=(T=x("color"))===w.color?T:C.color,S=C.size,M=C.family),p(w,k,x,k.type,{noAng:!E,noExp:!0,font:{color:A,size:S,family:M}}),o.coerce2(e,t,m,i+".ticklen"),o.coerce2(e,t,m,i+".tickwidth"),o.coerce2(e,t,m,i+".tickcolor",t.color),x("ticks")||(delete t[i].ticklen,delete t[i].tickwidth,delete t[i].tickcolor),h(w,k,x,{dfltColor:T,bgColor:n.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:m[i]}),x("layer")}x("hoverformat"),delete k.type,k._input=w}}t.exports=function(e,t,r){c(e,t,r,{noUirevision:!0,type:g.name,attributes:m,handleDefaults:b,font:t.font,paper_bgcolor:t.paper_bgcolor,fullData:r,layoutOut:t})}},{"../../components/color":366,"../../lib":503,"../../plot_api/plot_template":543,"../cartesian/line_grid_defaults":571,"../cartesian/prefix_suffix_defaults":573,"../cartesian/set_convert":576,"../cartesian/tick_label_defaults":578,"../get_data":593,"../subplot_defaults":632,"./constants":627,"./layout_attributes":630}],632:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plot_api/plot_template"),i=e("./domain").defaults;t.exports=function(e,t,r,o){var s,l,c=o.type,u=o.attributes,f=o.handleDefaults,p=o.partition||"x",h=t._subplots[c],d=h.length,m=d&&h[0].replace(/\d+$/,"");function g(e,t){return n.coerce(s,l,u,e,t)}for(var y=0;y<d;y++){var v=h[y];s=e[v]?e[v]:e[v]={},l=a.newContainer(t,v,m),o.noUirevision||g("uirevision",t.uirevision);var b={};b[p]=[y/d,(y+1)/d],i(l,t,g,b),o.id=v,f(s,l,g,o)}}},{"../lib":503,"../plot_api/plot_template":543,"./domain":584}],633:[function(e,t,r){"use strict";var n=e("../constants/docs");function a(e){var t=e.description?" "+e.description:"",r=e.keys||[];if(r.length>0){for(var n=[],a=0;a<r.length;a++)n[a]="`"+r[a]+"`";t+="Finally, the template string has access to ",t=1===r.length?"variable "+n[0]:"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return t}n.FORMAT_LINK,n.DATE_FORMAT_LINK,r.hovertemplateAttrs=function(e,t){e=e||{},a(t=t||{});var r={valType:"string",dflt:"",editType:e.editType||"none"};return!1!==e.arrayOk&&(r.arrayOk=!0),r},r.texttemplateAttrs=function(e,t){e=e||{},a(t=t||{});var r={valType:"string",dflt:"",editType:e.editType||"calc"};return!1!==e.arrayOk&&(r.arrayOk=!0),r}},{"../constants/docs":474}],634:[function(e,t,r){"use strict";var n=e("./ternary"),a=e("../../plots/get_data").getSubplotCalcData,i=e("../../lib").counterRegex;r.name="ternary";var o=r.attr="subplot";r.idRoot="ternary",r.idRegex=r.attrRegex=i("ternary"),(r.attributes={})[o]={valType:"subplotid",dflt:"ternary",editType:"calc"},r.layoutAttributes=e("./layout_attributes"),r.supplyLayoutDefaults=e("./layout_defaults"),r.plot=function(e){for(var t=e._fullLayout,r=e.calcdata,i=t._subplots.ternary,o=0;o<i.length;o++){var s=i[o],l=a(r,"ternary",s),c=t[s]._subplot;c||(c=new n({id:s,graphDiv:e,container:t._ternarylayer.node()},t),t[s]._subplot=c),c.plot(l,t,e._promises)}},r.clean=function(e,t,r,n){for(var a=n._subplots.ternary||[],i=0;i<a.length;i++){var o=a[i],s=n[o]._subplot;!t[o]&&s&&(s.plotContainer.remove(),s.clipDef.remove(),s.clipDefRelative.remove(),s.layers["a-title"].remove(),s.layers["b-title"].remove(),s.layers["c-title"].remove())}}},{"../../lib":503,"../../plots/get_data":593,"./layout_attributes":635,"./layout_defaults":636,"./ternary":637}],635:[function(e,t,r){"use strict";var n=e("../../components/color/attributes"),a=e("../domain").attributes,i=e("../cartesian/layout_attributes"),o=e("../../plot_api/edit_types").overrideAll,s=e("../../lib/extend").extendFlat,l={title:{text:i.title.text,font:i.title.font},color:i.color,tickmode:i.tickmode,nticks:s({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:s({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:s({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,layer:i.layer,min:{valType:"number",dflt:0,min:0},_deprecated:{title:i._deprecated.title,titlefont:i._deprecated.titlefont}},c=t.exports=o({domain:a({name:"ternary"}),bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:l,baxis:l,caxis:l},"plot","from-root");c.uirevision={valType:"any",editType:"none"},c.aaxis.uirevision=c.baxis.uirevision=c.caxis.uirevision={valType:"any",editType:"none"}},{"../../components/color/attributes":365,"../../lib/extend":493,"../../plot_api/edit_types":536,"../cartesian/layout_attributes":569,"../domain":584}],636:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../plot_api/plot_template"),i=e("../../lib"),o=e("../subplot_defaults"),s=e("../cartesian/tick_label_defaults"),l=e("../cartesian/prefix_suffix_defaults"),c=e("../cartesian/tick_mark_defaults"),u=e("../cartesian/tick_value_defaults"),f=e("../cartesian/line_grid_defaults"),p=e("./layout_attributes"),h=["aaxis","baxis","caxis"];function d(e,t,r,i){var o,s,l,c=r("bgcolor"),u=r("sum");i.bgColor=n.combine(c,i.paper_bgcolor);for(var f=0;f<h.length;f++)s=e[o=h[f]]||{},(l=a.newContainer(t,o))._name=o,m(s,l,i,t);var p=t.aaxis,d=t.baxis,g=t.caxis;p.min+d.min+g.min>=u&&(p.min=0,d.min=0,g.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function m(e,t,r,n){var a=p[t._name];function o(r,n){return i.coerce(e,t,a,r,n)}o("uirevision",n.uirevision),t.type="linear";var h=o("color"),d=h!==a.color.dflt?h:r.font.color,m=t._name.charAt(0).toUpperCase(),g="Component "+m,y=o("title.text",g);t._hovertitle=y===g?y:m,i.coerceFont(o,"title.font",{family:r.font.family,size:i.bigFont(r.font.size),color:d}),o("min"),u(e,t,o,"linear"),l(e,t,o,"linear"),s(e,t,o,"linear"),c(e,t,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:d}),o("tickangle"),o("tickformat")),f(e,t,o,{dfltColor:h,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}t.exports=function(e,t,r){o(e,t,r,{type:"ternary",attributes:p,handleDefaults:d,font:t.font,paper_bgcolor:t.paper_bgcolor})}},{"../../components/color":366,"../../lib":503,"../../plot_api/plot_template":543,"../cartesian/line_grid_defaults":571,"../cartesian/prefix_suffix_defaults":573,"../cartesian/tick_label_defaults":578,"../cartesian/tick_mark_defaults":579,"../cartesian/tick_value_defaults":580,"../subplot_defaults":632,"./layout_attributes":635}],637:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("tinycolor2"),i=e("../../registry"),o=e("../../lib"),s=o.strTranslate,l=o._,c=e("../../components/color"),u=e("../../components/drawing"),f=e("../cartesian/set_convert"),p=e("../../lib/extend").extendFlat,h=e("../plots"),d=e("../cartesian/axes"),m=e("../../components/dragelement"),g=e("../../components/fx"),y=e("../../components/dragelement/helpers"),v=y.freeMode,b=y.rectMode,x=e("../../components/titles"),_=e("../cartesian/select").prepSelect,w=e("../cartesian/select").selectOnClick,k=e("../cartesian/select").clearSelect,D=e("../cartesian/select").clearSelectionsCache,T=e("../cartesian/constants");function A(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}t.exports=A;var S=A.prototype;S.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},S.plot=function(e,t){var r=t[this.id],n=t._size;this._hasClipOnAxisFalse=!1;for(var a=0;a<e.length;a++)if(!1===e[a][0].trace.cliponaxis){this._hasClipOnAxisFalse=!0;break}this.updateLayers(r),this.adjustLayout(r,n),h.generalUpdatePerTraceModule(this.graphDiv,this,e,r),this.layers.plotbg.select("path").call(c.fill,r.bgcolor)},S.makeFramework=function(e){var t=this.graphDiv,r=e[this.id],n=this.clipId="clip"+this.layoutId+this.id,a=this.clipIdRelative="clip-relative"+this.layoutId+this.id;this.clipDef=o.ensureSingleById(e._clips,"clipPath",n,(function(e){e.append("path").attr("d","M0,0Z")})),this.clipDefRelative=o.ensureSingleById(e._clips,"clipPath",a,(function(e){e.append("path").attr("d","M0,0Z")})),this.plotContainer=o.ensureSingle(this.container,"g",this.id),this.updateLayers(r),u.setClipUrl(this.layers.backplot,n,t),u.setClipUrl(this.layers.grids,n,t)},S.updateLayers=function(e){var t=this.layers,r=["draglayer","plotbg","backplot","grids"];"below traces"===e.aaxis.layer&&r.push("aaxis","aline"),"below traces"===e.baxis.layer&&r.push("baxis","bline"),"below traces"===e.caxis.layer&&r.push("caxis","cline"),r.push("frontplot"),"above traces"===e.aaxis.layer&&r.push("aaxis","aline"),"above traces"===e.baxis.layer&&r.push("baxis","bline"),"above traces"===e.caxis.layer&&r.push("caxis","cline");var a=this.plotContainer.selectAll("g.toplevel").data(r,String),i=["agrid","bgrid","cgrid"];a.enter().append("g").attr("class",(function(e){return"toplevel "+e})).each((function(e){var r=n.select(this);t[e]=r,"frontplot"===e?r.append("g").classed("scatterlayer",!0):"backplot"===e?r.append("g").classed("maplayer",!0):"plotbg"===e?r.append("path").attr("d","M0,0Z"):"aline"===e||"bline"===e||"cline"===e?r.append("path"):"grids"===e&&i.forEach((function(e){t[e]=r.append("g").classed("grid "+e,!0)}))})),a.order()};var M=Math.sqrt(4/3);S.adjustLayout=function(e,t){var r,n,a,i,o,l,h=this,d=e.domain,m=(d.x[0]+d.x[1])/2,g=(d.y[0]+d.y[1])/2,y=d.x[1]-d.x[0],v=d.y[1]-d.y[0],b=y*t.w,x=v*t.h,_=e.sum,w=e.aaxis.min,k=e.baxis.min,D=e.caxis.min;b>M*x?a=(i=x)*M:i=(a=b)/M,o=y*a/b,l=v*i/x,r=t.l+t.w*m-a/2,n=t.t+t.h*(1-g)-i/2,h.x0=r,h.y0=n,h.w=a,h.h=i,h.sum=_,h.xaxis={type:"linear",range:[w+2*D-_,_-w-2*k],domain:[m-o/2,m+o/2],_id:"x"},f(h.xaxis,h.graphDiv._fullLayout),h.xaxis.setScale(),h.xaxis.isPtWithinRange=function(e){return e.a>=h.aaxis.range[0]&&e.a<=h.aaxis.range[1]&&e.b>=h.baxis.range[1]&&e.b<=h.baxis.range[0]&&e.c>=h.caxis.range[1]&&e.c<=h.caxis.range[0]},h.yaxis={type:"linear",range:[w,_-k-D],domain:[g-l/2,g+l/2],_id:"y"},f(h.yaxis,h.graphDiv._fullLayout),h.yaxis.setScale(),h.yaxis.isPtWithinRange=function(){return!0};var T=h.yaxis.domain[0],A=h.aaxis=p({},e.aaxis,{range:[w,_-k-D],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[T,T+l*M],anchor:"free",position:0,_id:"y",_length:a});f(A,h.graphDiv._fullLayout),A.setScale();var S=h.baxis=p({},e.baxis,{range:[_-w-D,k],side:"bottom",domain:h.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});f(S,h.graphDiv._fullLayout),S.setScale();var E=h.caxis=p({},e.caxis,{range:[_-w-k,D],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[T,T+l*M],anchor:"free",position:0,_id:"y",_length:a});f(E,h.graphDiv._fullLayout),E.setScale();var C="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";h.clipDef.select("path").attr("d",C),h.layers.plotbg.select("path").attr("d",C);var N="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";h.clipDefRelative.select("path").attr("d",N);var O=s(r,n);h.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",O),h.clipDefRelative.select("path").attr("transform",null);var I=s(r-S._offset,n+i);h.layers.baxis.attr("transform",I),h.layers.bgrid.attr("transform",I);var P=s(r+a/2,n)+"rotate(30)"+s(0,-A._offset);h.layers.aaxis.attr("transform",P),h.layers.agrid.attr("transform",P);var R=s(r+a/2,n)+"rotate(-30)"+s(0,-E._offset);h.layers.caxis.attr("transform",R),h.layers.cgrid.attr("transform",R),h.drawAxes(!0),h.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),h.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(c.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),h.layers.cline.select("path").attr("d",E.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(c.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),h.graphDiv._context.staticPlot||h.initInteractions(),u.setClipUrl(h.layers.frontplot,h._hasClipOnAxisFalse?null:h.clipId,h.graphDiv)},S.drawAxes=function(e){var t=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,a=this.aaxis,i=this.baxis,o=this.caxis;if(this.drawAx(a),this.drawAx(i),this.drawAx(o),e){var s=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;n["a-title"]=x.draw(t,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:l(t,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=x.draw(t,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:l(t,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*i.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=x.draw(t,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(t,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},S.drawAx=function(e){var t,r=this.graphDiv,n=e._name,a=n.charAt(0),i=e._id,s=this.layers[n],l=a+"tickLayout",c=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);this[l]!==c&&(s.selectAll("."+i+"tick").remove(),this[l]=c),e.setScale();var u=d.calcTicks(e),f=d.clipEnds(e,u),p=d.makeTransTickFn(e),h=d.getTickSigns(e)[2],m=o.deg2rad(30),g=h*(e.linewidth||1)/2,y=h*e.ticklen,v=this.w,b=this.h,x="b"===a?"M0,"+g+"l"+Math.sin(m)*y+","+Math.cos(m)*y:"M"+g+",0l"+Math.cos(m)*y+","+-Math.sin(m)*y,_={a:"M0,0l"+b+",-"+v/2,b:"M0,0l-"+v/2+",-"+b,c:"M0,0l-"+b+","+v/2}[a];d.drawTicks(r,e,{vals:"inside"===e.ticks?f:u,layer:s,path:x,transFn:p,crisp:!1}),d.drawGrid(r,e,{vals:f,layer:this.layers[a+"grid"],path:_,transFn:p,crisp:!1}),d.drawLabels(r,e,{vals:u,layer:s,transFn:p,labelFns:d.makeLabelFns(e,0,30)})};var E=T.MINZOOM/2+.87,C="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(.87*E+4.5)+"l2.6,1.5l-"+E/2+","+.87*E+"Z",N="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-2.6,1.5l"+E/2+","+.87*E+"Z",O="m0,1l"+E/2+","+.87*E+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-"+(E/2+2.6)+","+(.87*E+4.5)+"l2.6,1.5l"+E/2+",-"+.87*E+"Z",I=!0;function P(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearSelect=function(){D(this.dragOptions),k(this.dragOptions.gd)},S.initInteractions=function(){var e,t,r,n,f,p,h,d,y,x,k,D,A=this,S=A.layers.plotbg.select("path").node(),E=A.graphDiv,R=E._fullLayout._zoomlayer;function L(e){var t={};return t[A.id+".aaxis.min"]=e.a,t[A.id+".baxis.min"]=e.b,t[A.id+".caxis.min"]=e.c,t}function F(e,t){var r=E._fullLayout.clickmode;P(E),2===e&&(E.emit("plotly_doubleclick",null),i.call("_guiRelayout",E,L({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&w(t,E,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&g.click(E,t,A.id)}function B(e,t){return 1-t/A.h}function z(e,t){return 1-(e+(A.h-t)/Math.sqrt(3))/A.w}function j(e,t){return(e-(A.h-t)/Math.sqrt(3))/A.w}function U(a,i){var o=r+a*e,s=n+i*t,l=Math.max(0,Math.min(1,B(0,n),B(0,s))),c=Math.max(0,Math.min(1,z(r,n),z(o,s))),u=Math.max(0,Math.min(1,j(r,n),j(o,s))),m=(l/2+u)*A.w,g=(1-l/2-c)*A.w,v=(m+g)/2,b=g-m,_=(1-l)*A.h,w=_-b/M;b<T.MINZOOM?(h=f,k.attr("d",y),D.attr("d","M0,0Z")):(h={a:f.a+l*p,b:f.b+c*p,c:f.c+u*p},k.attr("d",y+"M"+m+","+_+"H"+g+"L"+v+","+w+"L"+m+","+_+"Z"),D.attr("d","M"+r+","+n+"m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2ZM"+m+","+_+C+"M"+g+","+_+N+"M"+v+","+w+O)),x||(k.transition().style("fill",d>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),D.transition().style("opacity",1).duration(200),x=!0),E.emit("plotly_relayouting",L(h))}function $(){P(E),h!==f&&(i.call("_guiRelayout",E,L(h)),I&&E.data&&E._context.showTips&&(o.notifier(l(E,"Double-click to zoom back out"),"long"),I=!1))}function V(e,t){var r=e/A.xaxis._m,n=t/A.yaxis._m,a=[(h={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,h.b,h.c].sort(o.sorterAsc),i=a.indexOf(h.a),l=a.indexOf(h.b),c=a.indexOf(h.c);a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),h={a:a[i],b:a[l],c:a[c]},t=(f.a-h.a)*A.yaxis._m,e=(f.c-h.c-f.b+h.b)*A.xaxis._m);var p=s(A.x0+e,A.y0+t);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",p);var d=s(-e,-t);A.clipDefRelative.select("path").attr("transform",d),A.aaxis.range=[h.a,A.sum-h.b-h.c],A.baxis.range=[A.sum-h.a-h.c,h.b],A.caxis.range=[A.sum-h.a-h.b,h.c],A.drawAxes(!1),A._hasClipOnAxisFalse&&A.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,A),E.emit("plotly_relayouting",L(h))}function q(){i.call("_guiRelayout",E,L(h))}this.dragOptions={element:S,gd:E,plotinfo:{id:A.id,domain:E._fullLayout[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis},subplot:A.id,prepFn:function(i,l,u){A.dragOptions.xaxes=[A.xaxis],A.dragOptions.yaxes=[A.yaxis],e=E._fullLayout._invScaleX,t=E._fullLayout._invScaleY;var m=A.dragOptions.dragmode=E._fullLayout.dragmode;v(m)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===m?(A.dragOptions.moveFn=U,A.dragOptions.clickFn=F,A.dragOptions.doneFn=$,function(e,t,i){var l=S.getBoundingClientRect();r=t-l.left,n=i-l.top,E._fullLayout._calcInverseTransform(E);var u=E._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[1],f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},h=f,p=A.aaxis.range[1]-f.a,d=a(A.graphDiv._fullLayout[A.id].bgcolor).getLuminance(),y="M0,"+A.h+"L"+A.w/2+", 0L"+A.w+","+A.h+"Z",x=!1,k=R.append("path").attr("class","zoombox").attr("transform",s(A.x0,A.y0)).style({fill:d>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",y),D=R.append("path").attr("class","zoombox-corners").attr("transform",s(A.x0,A.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),A.clearSelect(E)}(0,l,u)):"pan"===m?(A.dragOptions.moveFn=V,A.dragOptions.clickFn=F,A.dragOptions.doneFn=q,f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},h=f,A.clearSelect(E)):(b(m)||v(m))&&_(i,l,u,A.dragOptions,m)}},S.onmousemove=function(e){g.hover(E,e,A.id),E._fullLayout._lasthover=S,E._fullLayout._hoversubplot=A.id},S.onmouseout=function(e){E._dragging||m.unhover(E,e)},m.init(this.dragOptions)}},{"../../components/color":366,"../../components/dragelement":385,"../../components/dragelement/helpers":384,"../../components/drawing":388,"../../components/fx":406,"../../components/titles":464,"../../lib":503,"../../lib/extend":493,"../../registry":638,"../cartesian/axes":554,"../cartesian/constants":561,"../cartesian/select":575,"../cartesian/set_convert":576,"../plots":619,"@plotly/d3":58,tinycolor2:312}],638:[function(e,t,r){"use strict";var n=e("./lib/loggers"),a=e("./lib/noop"),i=e("./lib/push_unique"),o=e("./lib/is_plain_object"),s=e("./lib/dom").addStyleRule,l=e("./lib/extend"),c=e("./plots/attributes"),u=e("./plots/layout_attributes"),f=l.extendFlat,p=l.extendDeepAll;function h(e){var t=e.name,a=e.categories,i=e.meta;if(r.modules[t])n.log("Type "+t+" already registered");else{r.subplotsRegistry[e.basePlotModule.name]||function(e){var t=e.name;if(r.subplotsRegistry[t])n.log("Plot type "+t+" already registered.");else for(var a in y(e),r.subplotsRegistry[t]=e,r.componentsRegistry)x(a,e.name)}(e.basePlotModule);for(var o={},l=0;l<a.length;l++)o[a[l]]=!0,r.allCategories[a[l]]=!0;for(var c in r.modules[t]={_module:e,categories:o},i&&Object.keys(i).length&&(r.modules[t].meta=i),r.allTypes.push(t),r.componentsRegistry)v(c,t);e.layoutAttributes&&f(r.traceLayoutAttributes,e.layoutAttributes);var u=e.basePlotModule,p=u.name;if("mapbox"===p){var h=u.constants.styleRules;for(var d in h)s(".js-plotly-plot .plotly .mapboxgl-"+d,h[d])}"geo"!==p&&"mapbox"!==p||void 0===typeof window||void 0!==window.PlotlyGeoAssets||(window.PlotlyGeoAssets={topojson:{}})}}function d(e){if("string"!=typeof e.name)throw new Error("Component module *name* must be a string.");var t=e.name;for(var n in r.componentsRegistry[t]=e,e.layoutAttributes&&(e.layoutAttributes._isLinkedToArray&&i(r.layoutArrayContainers,t),y(e)),r.modules)v(t,n);for(var a in r.subplotsRegistry)x(t,a);for(var o in r.transformsRegistry)b(t,o);e.schema&&e.schema.layout&&p(u,e.schema.layout)}function m(e){if("string"!=typeof e.name)throw new Error("Transform module *name* must be a string.");var t="Transform module "+e.name,a="function"==typeof e.transform,i="function"==typeof e.calcTransform;if(!a&&!i)throw new Error(t+" is missing a *transform* or *calcTransform* method.");for(var s in a&&i&&n.log([t+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),o(e.attributes)||n.log(t+" registered without an *attributes* object."),"function"!=typeof e.supplyDefaults&&n.log(t+" registered without a *supplyDefaults* method."),r.transformsRegistry[e.name]=e,r.componentsRegistry)b(s,e.name)}function g(e){var t=e.name,n=t.split("-")[0],a=e.dictionary,i=e.format,o=a&&Object.keys(a).length,s=i&&Object.keys(i).length,l=r.localeRegistry,c=l[t];if(c||(l[t]=c={}),n!==t){var u=l[n];u||(l[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=a),s&&u.format===c.format&&(u.format=i)}o&&(c.dictionary=a),s&&(c.format=i)}function y(e){if(e.layoutAttributes){var t=e.layoutAttributes._arrayAttrRegexps;if(t)for(var n=0;n<t.length;n++)i(r.layoutArrayRegexes,t[n])}}function v(e,t){var n=r.componentsRegistry[e].schema;if(n&&n.traces){var a=n.traces[t];a&&p(r.modules[t]._module.attributes,a)}}function b(e,t){var n=r.componentsRegistry[e].schema;if(n&&n.transforms){var a=n.transforms[t];a&&p(r.transformsRegistry[t].attributes,a)}}function x(e,t){var n=r.componentsRegistry[e].schema;if(n&&n.subplots){var a=r.subplotsRegistry[t],i=a.layoutAttributes,o="subplot"===a.attr?a.name:a.attr;Array.isArray(o)&&(o=o[0]);var s=n.subplots[o];i&&s&&p(i,s)}}function _(e){return"object"==typeof e&&(e=e.type),e}r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.traceLayoutAttributes={},r.localeRegistry={},r.apiMethodRegistry={},r.collectableSubplotTypes=null,r.register=function(e){if(r.collectableSubplotTypes=null,!e)throw new Error("No argument passed to Plotly.register.");e&&!Array.isArray(e)&&(e=[e]);for(var t=0;t<e.length;t++){var n=e[t];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":h(n);break;case"transform":m(n);break;case"component":d(n);break;case"locale":g(n);break;case"apiMethod":var a=n.name;r.apiMethodRegistry[a]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},r.getModule=function(e){var t=r.modules[_(e)];return!!t&&t._module},r.traceIs=function(e,t){if("various"===(e=_(e)))return!1;var a=r.modules[e];return a||(e&&n.log("Unrecognized trace type "+e+"."),a=r.modules[c.type.dflt]),!!a.categories[t]},r.getTransformIndices=function(e,t){for(var r=[],n=e.transforms||[],a=0;a<n.length;a++)n[a].type===t&&r.push(a);return r},r.hasTransform=function(e,t){for(var r=e.transforms||[],n=0;n<r.length;n++)if(r[n].type===t)return!0;return!1},r.getComponentMethod=function(e,t){var n=r.componentsRegistry[e];return n&&n[t]||a},r.call=function(){var e=arguments[0],t=[].slice.call(arguments,1);return r.apiMethodRegistry[e].apply(null,t)}},{"./lib/dom":491,"./lib/extend":493,"./lib/is_plain_object":504,"./lib/loggers":507,"./lib/noop":512,"./lib/push_unique":518,"./plots/attributes":550,"./plots/layout_attributes":610}],639:[function(e,t,r){"use strict";var n=e("../registry"),a=e("../lib"),i=a.extendFlat,o=a.extendDeep;function s(e){var t;switch(e){case"themes__thumb":t={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":t={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:t={}}return t}t.exports=function(e,t){var r,a,l=e.data,c=e.layout,u=o([],l),f=o({},c,s(t.tileClass)),p=e._context||{};if(t.width&&(f.width=t.width),t.height&&(f.height=t.height),"thumbnail"===t.tileClass||"themes__thumb"===t.tileClass){f.annotations=[];var h=Object.keys(f);for(r=0;r<h.length;r++)a=h[r],["xaxis","yaxis","zaxis"].indexOf(a.slice(0,5))>-1&&(f[h[r]].title={text:""});for(r=0;r<u.length;r++){var d=u[r];d.showscale=!1,d.marker&&(d.marker.showscale=!1),n.traceIs(d,"pie-like")&&(d.textposition="none")}}if(Array.isArray(t.annotations))for(r=0;r<t.annotations.length;r++)f.annotations.push(t.annotations[r]);var m=Object.keys(f).filter((function(e){return e.match(/^scene\d*$/)}));if(m.length){var g={};for("thumbnail"===t.tileClass&&(g={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<m.length;r++){var y=f[m[r]];y.xaxis||(y.xaxis={}),y.yaxis||(y.yaxis={}),y.zaxis||(y.zaxis={}),i(y.xaxis,g),i(y.yaxis,g),i(y.zaxis,g),y._scene=null}}var v=document.createElement("div");t.tileClass&&(v.className=t.tileClass);var b={gd:v,td:v,layout:f,data:u,config:{staticPlot:void 0===t.staticPlot||t.staticPlot,plotGlPixelRatio:void 0===t.plotGlPixelRatio?2:t.plotGlPixelRatio,displaylogo:t.displaylogo||!1,showLink:t.showLink||!1,showTips:t.showTips||!1,mapboxAccessToken:p.mapboxAccessToken}};return"transparent"!==t.setBackground&&(b.config.setBackground=t.setBackground||"opaque"),b.gd.defaultLayout=s(t.tileClass),b}},{"../lib":503,"../registry":638}],640:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plot_api/to_image"),i=e("./filesaver"),o=e("./helpers");t.exports=function(e,t){var r;return n.isPlainObject(e)||(r=n.getGraphDiv(e)),(t=t||{}).format=t.format||"png",t.width=t.width||null,t.height=t.height||null,t.imageDataOnly=!0,new Promise((function(s,l){r&&r._snapshotInProgress&&l(new Error("Snapshotting already in progress.")),n.isIE()&&"svg"!==t.format&&l(new Error(o.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var c=a(e,t),u=t.filename||e.fn||"newplot";u+="."+t.format.replace("-","."),c.then((function(e){return r&&(r._snapshotInProgress=!1),i(e,u,t.format)})).then((function(e){s(e)})).catch((function(e){r&&(r._snapshotInProgress=!1),l(e)}))}))}},{"../lib":503,"../plot_api/to_image":546,"./filesaver":641,"./helpers":642}],641:[function(e,t,r){"use strict";var n=e("../lib"),a=e("./helpers");t.exports=function(e,t,r){var i=document.createElement("a"),o="download"in i;return new Promise((function(s,l){var c,u;if(n.isIE())return c=a.createBlob(e,"svg"),window.navigator.msSaveBlob(c,t),c=null,s(t);if(o)return c=a.createBlob(e,r),u=a.createObjectURL(c),i.href=u,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),a.revokeObjectURL(u),c=null,s(t);if(n.isSafari()){var f="svg"===r?",":";base64,";return a.octetStream(f+encodeURIComponent(e)),s(t)}l(new Error("download error"))}))}},{"../lib":503,"./helpers":642}],642:[function(e,t,r){"use strict";var n=e("../registry");r.getDelay=function(e){return e._has&&(e._has("gl3d")||e._has("gl2d")||e._has("mapbox"))?500:0},r.getRedrawFunc=function(e){return function(){n.getComponentMethod("colorbar","draw")(e)}},r.encodeSVG=function(e){return"data:image/svg+xml,"+encodeURIComponent(e)},r.encodeJSON=function(e){return"data:application/json,"+encodeURIComponent(e)};var a=window.URL||window.webkitURL;r.createObjectURL=function(e){return a.createObjectURL(e)},r.revokeObjectURL=function(e){return a.revokeObjectURL(e)},r.createBlob=function(e,t){if("svg"===t)return new window.Blob([e],{type:"image/svg+xml;charset=utf-8"});if("full-json"===t)return new window.Blob([e],{type:"application/json;charset=utf-8"});var r=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),a=0;a<t;a++)n[a]=e.charCodeAt(a);return r}(window.atob(e));return new window.Blob([r],{type:"image/"+t})},r.octetStream=function(e){document.location.href="data:application/octet-stream"+e},r.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/,r.MSG_IE_BAD_FORMAT="Sorry IE does not support downloading from canvas. Try {format:'svg'} instead."},{"../registry":638}],643:[function(e,t,r){"use strict";var n=e("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:e("./cloneplot"),toSVG:e("./tosvg"),svgToImg:e("./svgtoimg"),toImage:e("./toimage"),downloadImage:e("./download")};t.exports=a},{"./cloneplot":639,"./download":640,"./helpers":642,"./svgtoimg":644,"./toimage":645,"./tosvg":646}],644:[function(e,t,r){"use strict";var n=e("../lib"),a=e("events").EventEmitter,i=e("./helpers");t.exports=function(e){var t=e.emitter||new a,r=new Promise((function(a,o){var s=window.Image,l=e.svg,c=e.format||"png";if(n.isIE()&&"svg"!==c){var u=new Error(i.MSG_IE_BAD_FORMAT);return o(u),e.promise?r:t.emit("error",u)}var f,p,h=e.canvas,d=e.scale||1,m=e.width||300,g=e.height||150,y=d*m,v=d*g,b=h.getContext("2d"),x=new s;"svg"===c||n.isSafari()?p=i.encodeSVG(l):(f=i.createBlob(l,"svg"),p=i.createObjectURL(f)),h.width=y,h.height=v,x.onload=function(){var r;switch(f=null,i.revokeObjectURL(p),"svg"!==c&&b.drawImage(x,0,0,y,v),c){case"jpeg":r=h.toDataURL("image/jpeg");break;case"png":r=h.toDataURL("image/png");break;case"webp":r=h.toDataURL("image/webp");break;case"svg":r=p;break;default:var n="Image format is not jpeg, png, svg or webp.";if(o(new Error(n)),!e.promise)return t.emit("error",n)}a(r),e.promise||t.emit("success",r)},x.onerror=function(r){if(f=null,i.revokeObjectURL(p),o(r),!e.promise)return t.emit("error",r)},x.src=p}));return e.promise?r:t}},{"../lib":503,"./helpers":642,events:84}],645:[function(e,t,r){"use strict";var n=e("events").EventEmitter,a=e("../registry"),i=e("../lib"),o=e("./helpers"),s=e("./cloneplot"),l=e("./tosvg"),c=e("./svgtoimg");t.exports=function(e,t){var r=new n,u=s(e,{format:"png"}),f=u.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var p=o.getRedrawFunc(f);return a.call("_doPlot",f,u.data,u.layout,u.config).then(p).then((function(){var e=o.getDelay(f._fullLayout);setTimeout((function(){var e=l(f),n=document.createElement("canvas");n.id=i.randstr(),(r=c({format:t.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:n,emitter:r,svg:e})).clean=function(){f&&document.body.removeChild(f)}}),e)})).catch((function(e){r.emit("error",e)})),r}},{"../lib":503,"../registry":638,"./cloneplot":639,"./helpers":642,"./svgtoimg":644,"./tosvg":646,events:84}],646:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=e("../components/drawing"),o=e("../components/color"),s=e("../constants/xmlns_namespaces"),l=/"/g,c=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");t.exports=function(e,t,r){var u,f,p=e._fullLayout,h=p._paper,d=p._toppaper,m=p.width,g=p.height;h.insert("rect",":first-child").call(i.setRect,0,0,m,g).call(o.fill,p.paper_bgcolor);var y=p._basePlotModules||[];for(u=0;u<y.length;u++){var v=y[u];v.toSVG&&v.toSVG(e)}if(d){var b=d.node().childNodes,x=Array.prototype.slice.call(b);for(u=0;u<x.length;u++){var _=x[u];_.childNodes.length&&h.node().appendChild(_)}}p._draggers&&p._draggers.remove(),h.node().style.background="",h.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each((function(){var e=n.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){e.style({visibility:null,display:null});var t=this.style.fontFamily;t&&-1!==t.indexOf('"')&&e.style("font-family",t.replace(l,"TOBESTRIPPED"))}else e.remove()}));var w=[];if(p._gradientUrlQueryParts)for(f in p._gradientUrlQueryParts)w.push(f);if(p._patternUrlQueryParts)for(f in p._patternUrlQueryParts)w.push(f);w.length&&h.selectAll(w.join(",")).each((function(){var e=n.select(this),t=this.style.fill;t&&-1!==t.indexOf("url(")&&e.style("fill",t.replace(l,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&e.style("stroke",r.replace(l,"TOBESTRIPPED"))})),"pdf"!==t&&"eps"!==t||h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),h.node().setAttributeNS(s.xmlns,"xmlns",s.svg),h.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink),"svg"===t&&r&&(h.attr("width",r*m),h.attr("height",r*g),h.attr("viewBox","0 0 "+m+" "+g));var k=(new window.XMLSerializer).serializeToString(h.node());return k=function(e){var t=n.select("body").append("div").style({display:"none"}).html(""),r=e.replace(/(&[^;]*;)/gi,(function(e){return"&lt;"===e?"&#60;":"&rt;"===e?"&#62;":-1!==e.indexOf("<")||-1!==e.indexOf(">")?"":t.html(e).text()}));return t.remove(),r}(k),k=(k=k.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")).replace(c,"'"),a.isIE()&&(k=(k=(k=k.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),k}},{"../components/color":366,"../components/drawing":388,"../constants/xmlns_namespaces":480,"../lib":503,"@plotly/d3":58}],647:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r<e.length;r++)e[r].i=r;n.mergeArray(t.text,e,"tx"),n.mergeArray(t.hovertext,e,"htx");var a=t.marker;if(a){n.mergeArray(a.opacity,e,"mo",!0),n.mergeArray(a.color,e,"mc");var i=a.line;i&&(n.mergeArray(i.color,e,"mlc"),n.mergeArrayCastPositive(i.width,e,"mlw"))}}},{"../../lib":503}],648:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../../plots/template_attributes").texttemplateAttrs,s=e("../../components/colorscale/attributes"),l=e("../../plots/font_attributes"),c=e("./constants"),u=e("../../components/drawing/attributes").pattern,f=e("../../lib/extend").extendFlat,p=l({editType:"calc",arrayOk:!0,colorEditType:"style"}),h=f({},n.marker.line.width,{dflt:0}),d=f({width:h,editType:"calc"},s("marker.line")),m=f({line:d,editType:"calc"},s("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:u});t.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),text:n.text,texttemplate:o({editType:"plot"},{keys:c.eventDataKeys}),hovertext:n.hovertext,hovertemplate:i({},{keys:c.eventDataKeys}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:f({},p,{}),insidetextfont:f({},p,{}),outsidetextfont:f({},p,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:f({},n.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:m,offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,color:n.selected.marker.color,editType:"style"},textfont:n.selected.textfont,editType:"style"},unselected:{marker:{opacity:n.unselected.marker.opacity,color:n.unselected.marker.color,editType:"style"},textfont:n.unselected.textfont,editType:"style"},_deprecated:{bardir:{valType:"enumerated",editType:"calc",values:["v","h"]}}}},{"../../components/colorscale/attributes":373,"../../components/drawing/attributes":387,"../../lib/extend":493,"../../plots/cartesian/axis_format_attributes":557,"../../plots/font_attributes":585,"../../plots/template_attributes":633,"../scatter/attributes":926,"./constants":650}],649:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../plots/cartesian/align_period"),i=e("../../components/colorscale/helpers").hasColorscale,o=e("../../components/colorscale/calc"),s=e("./arrays_to_calcdata"),l=e("../scatter/calc_selection");t.exports=function(e,t){var r,c,u,f,p,h,d=n.getFromId(e,t.xaxis||"x"),m=n.getFromId(e,t.yaxis||"y"),g={msUTC:!(!t.base&&0!==t.base)};"h"===t.orientation?(r=d.makeCalcdata(t,"x",g),u=m.makeCalcdata(t,"y"),f=a(t,m,"y",u),p=!!t.yperiodalignment,h="y"):(r=m.makeCalcdata(t,"y",g),u=d.makeCalcdata(t,"x"),f=a(t,d,"x",u),p=!!t.xperiodalignment,h="x"),c=f.vals;for(var y=Math.min(c.length,r.length),v=new Array(y),b=0;b<y;b++)v[b]={p:c[b],s:r[b]},p&&(v[b].orig_p=u[b],v[b][h+"End"]=f.ends[b],v[b][h+"Start"]=f.starts[b]),t.ids&&(v[b].id=String(t.ids[b]));return i(t,"marker")&&o(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),i(t,"marker.line")&&o(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}),s(v,t),l(v,t),v}},{"../../components/colorscale/calc":374,"../../components/colorscale/helpers":377,"../../plots/cartesian/align_period":551,"../../plots/cartesian/axes":554,"../scatter/calc_selection":928,"./arrays_to_calcdata":647}],650:[function(e,t,r){"use strict";t.exports={TEXTPAD:3,eventDataKeys:["value","label"]}},{}],651:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib").isArrayOrTypedArray,i=e("../../constants/numerical").BADNUM,o=e("../../registry"),s=e("../../plots/cartesian/axes"),l=e("../../plots/cartesian/constraints").getAxisGroup,c=e("./sieve.js");function u(e,t,r,o,u){if(o.length){var x,_,w,k;switch(function(e,t){var r,i;for(r=0;r<t.length;r++){var o,s=t[r],l=s[0].trace,c="funnel"===l.type?l._base:l.base,u="h"===l.orientation?l.xcalendar:l.ycalendar,f="category"===e.type||"multicategory"===e.type?function(){return null}:e.d2c;if(a(c)){for(i=0;i<Math.min(c.length,s.length);i++)o=f(c[i],0,u),n(o)?(s[i].b=+o,s[i].hasB=1):s[i].b=0;for(;i<s.length;i++)s[i].b=0}else{o=f(c,0,u);var p=n(o);for(o=p?o:0,i=0;i<s.length;i++)s[i].b=o,p&&(s[i].hasB=1)}}}(r,o),u.mode){case"overlay":f(t,r,o,u);break;case"group":for(x=[],_=[],w=0;w<o.length;w++)void 0===(k=o[w])[0].trace.offset?_.push(k):x.push(k);_.length&&function(e,t,r,n,a){var o=new c(n,{posAxis:t,sepNegVal:!1,overlapNoMerge:!a.norm});(function(e,t,r,n){for(var a=e._fullLayout,i=r.positions,o=r.distinctPositions,s=r.minDiff,c=r.traces,u=c.length,f=i.length!==o.length,p=s*(1-n.gap),g=l(a,t._id)+c[0][0].trace.orientation,y=a._alignmentOpts[g]||{},v=0;v<u;v++){var b,x,_=c[v],w=_[0].trace,k=y[w.alignmentgroup]||{},D=Object.keys(k.offsetGroups||{}).length,T=(b=D?p/D:f?p/u:p)*(1-(n.groupgap||0));x=D?((2*w._offsetIndex+1-D)*b-T)/2:f?((2*v+1-u)*b-T)/2:-T/2;var A=_[0].t;A.barwidth=T,A.poffset=x,A.bargroupwidth=p,A.bardelta=s}r.binWidth=c[0][0].t.barwidth/100,h(r),d(t,r),m(t,r,f)})(e,t,o,a),function(e,t){for(var r=e.traces,n=0;n<r.length;n++){var a=r[n];if(void 0===a[0].trace.base)for(var o=new c([a],{posAxis:t,sepNegVal:!0,overlapNoMerge:!0}),s=0;s<a.length;s++){var l=a[s];if(l.p!==i){var u=o.put(l.p,l.b+l.s);u&&(l.b=u)}}}}(o,t),a.norm?(y(o),v(r,o,a)):g(r,o)}(e,t,r,_,u),x.length&&f(t,r,x,u);break;case"stack":case"relative":for(x=[],_=[],w=0;w<o.length;w++)void 0===(k=o[w])[0].trace.base?_.push(k):x.push(k);_.length&&function(e,t,r,n,a){var o=new c(n,{posAxis:t,sepNegVal:"relative"===a.mode,overlapNoMerge:!(a.norm||"stack"===a.mode||"relative"===a.mode)});p(t,o,a),function(e,t,r){var n,a,o,l,c,u,f=b(e),p=t.traces;for(l=0;l<p.length;l++)if("funnel"===(a=(n=p[l])[0].trace).type)for(c=0;c<n.length;c++)(u=n[c]).s!==i&&t.put(u.p,-.5*u.s);for(l=0;l<p.length;l++){o="funnel"===(a=(n=p[l])[0].trace).type;var h=[];for(c=0;c<n.length;c++)if((u=n[c]).s!==i){var d;d=o?u.s:u.s+u.b;var m=t.put(u.p,d),g=m+d;u.b=m,u[f]=g,r.norm||(h.push(g),u.hasB&&h.push(m))}r.norm||(a._extremes[e._id]=s.findExtremes(e,h,{tozero:!0,padded:!0}))}}(r,o,a);for(var l=0;l<n.length;l++)for(var u=n[l],f=0;f<u.length;f++){var h=u[f];h.s!==i&&h.b+h.s===o.get(h.p,h.s)&&(h._outmost=!0)}a.norm&&v(r,o,a)}(0,t,r,_,u),x.length&&f(t,r,x,u)}!function(e,t){var r,a,i,o=b(t),s={},l=1/0,c=-1/0;for(r=0;r<e.length;r++)for(i=e[r],a=0;a<i.length;a++){var u=i[a].p;n(u)&&(l=Math.min(l,u),c=Math.max(c,u))}var f=1e4/(c-l),p=s.round=function(e){return String(Math.round(f*(e-l)))};for(r=0;r<e.length;r++){(i=e[r])[0].t.extents=s;var h=i[0].t.poffset,d=Array.isArray(h);for(a=0;a<i.length;a++){var m=i[a],g=m[o]-m.w/2;if(n(g)){var y=m[o]+m.w/2,v=p(m.p);s[v]?s[v]=[Math.min(g,s[v][0]),Math.max(y,s[v][1])]:s[v]=[g,y]}m.p0=m.p+(d?h[a]:h),m.p1=m.p0+m.w,m.s0=m.b,m.s1=m.s0+m.s}}}(o,t)}}function f(e,t,r,n){for(var a=0;a<r.length;a++){var i=r[a],o=new c([i],{posAxis:e,sepNegVal:!1,overlapNoMerge:!n.norm});p(e,o,n),n.norm?(y(o),v(t,o,n)):g(t,o)}}function p(e,t,r){for(var n=t.minDiff,a=t.traces,i=n*(1-r.gap),o=i*(1-(r.groupgap||0)),s=-o/2,l=0;l<a.length;l++){var c=a[l][0].t;c.barwidth=o,c.poffset=s,c.bargroupwidth=i,c.bardelta=n}t.binWidth=a[0][0].t.barwidth/100,h(t),d(e,t),m(e,t)}function h(e){var t,r,i=e.traces;for(t=0;t<i.length;t++){var o,s=i[t],l=s[0],c=l.trace,u=l.t,f=c._offset||c.offset,p=u.poffset;if(a(f)){for(o=Array.prototype.slice.call(f,0,s.length),r=0;r<o.length;r++)n(o[r])||(o[r]=p);for(r=o.length;r<s.length;r++)o.push(p);u.poffset=o}else void 0!==f&&(u.poffset=f);var h=c._width||c.width,d=u.barwidth;if(a(h)){var m=Array.prototype.slice.call(h,0,s.length);for(r=0;r<m.length;r++)n(m[r])||(m[r]=d);for(r=m.length;r<s.length;r++)m.push(d);if(u.barwidth=m,void 0===f){for(o=[],r=0;r<s.length;r++)o.push(p+(d-m[r])/2);u.poffset=o}}else void 0!==h&&(u.barwidth=h,void 0===f&&(u.poffset=p+(d-h)/2))}}function d(e,t){for(var r=t.traces,n=b(e),a=0;a<r.length;a++)for(var i=r[a],o=i[0].t,s=o.poffset,l=Array.isArray(s),c=o.barwidth,u=Array.isArray(c),f=0;f<i.length;f++){var p=i[f],h=p.w=u?c[f]:c;p[n]=p.p+(l?s[f]:s)+h/2}}function m(e,t,r){var n=t.traces,a=t.minDiff/2;s.minDtick(e,t.minDiff,t.distinctPositions[0],r);for(var i=0;i<n.length;i++){var o,l,c,u,f=n[i],p=f[0],h=p.trace,d=[];for(u=0;u<f.length;u++)l=(o=f[u]).p-a,c=o.p+a,d.push(l,c);if(h.width||h.offset){var m=p.t,g=m.poffset,y=m.barwidth,v=Array.isArray(g),b=Array.isArray(y);for(u=0;u<f.length;u++){o=f[u];var x=v?g[u]:g,_=b?y[u]:y;c=(l=o.p+x)+_,d.push(l,c)}}h._extremes[e._id]=s.findExtremes(e,d,{padded:!1})}}function g(e,t){for(var r=t.traces,n=b(e),a=0;a<r.length;a++){for(var i=r[a],o=i[0].trace,l=[],c=!1,u=0;u<i.length;u++){var f=i[u],p=f.b,h=p+f.s;f[n]=h,l.push(h),f.hasB&&l.push(p),f.hasB&&f.b||(c=!0)}o._extremes[e._id]=s.findExtremes(e,l,{tozero:c,padded:!0})}}function y(e){for(var t=e.traces,r=0;r<t.length;r++)for(var n=t[r],a=0;a<n.length;a++){var o=n[a];o.s!==i&&e.put(o.p,o.b+o.s)}}function v(e,t,r){var a=t.traces,o=b(e),l="fraction"===r.norm?1:100,c=l/1e9,u=e.l2c(e.c2l(0)),f="stack"===r.mode?l:u;function p(t){return n(e.c2l(t))&&(t<u-c||t>f+c||!n(u))}for(var h=0;h<a.length;h++){for(var d=a[h],m=d[0].trace,g=[],y=!1,v=!1,x=0;x<d.length;x++){var _=d[x];if(_.s!==i){var w=Math.abs(l/t.get(_.p,_.s));_.b*=w,_.s*=w;var k=_.b,D=k+_.s;_[o]=D,g.push(D),v=v||p(D),_.hasB&&(g.push(k),v=v||p(k)),_.hasB&&_.b||(y=!0)}}m._extremes[e._id]=s.findExtremes(e,g,{tozero:y,padded:v})}}function b(e){return e._id.charAt(0)}t.exports={crossTraceCalc:function(e,t){for(var r=t.xaxis,n=t.yaxis,a=e._fullLayout,i=e._fullData,s=e.calcdata,l=[],c=[],f=0;f<i.length;f++){var p=i[f];if(!0===p.visible&&o.traceIs(p,"bar")&&p.xaxis===r._id&&p.yaxis===n._id&&("h"===p.orientation?l.push(s[f]):c.push(s[f]),p._computePh))for(var h=e.calcdata[f],d=0;d<h.length;d++)"function"==typeof h[d].ph0&&(h[d].ph0=h[d].ph0()),"function"==typeof h[d].ph1&&(h[d].ph1=h[d].ph1())}var m={xCat:"category"===r.type||"multicategory"===r.type,yCat:"category"===n.type||"multicategory"===n.type,mode:a.barmode,norm:a.barnorm,gap:a.bargap,groupgap:a.bargroupgap};u(e,r,n,c,m),u(e,n,r,l,m)},setGroupPositions:u}},{"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/axes":554,"../../plots/cartesian/constraints":562,"../../registry":638,"./sieve.js":661,"fast-isnumeric":190}],652:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../../registry"),o=e("../scatter/xy_defaults"),s=e("../scatter/period_defaults"),l=e("./style_defaults"),c=e("../../plots/cartesian/constraints").getAxisGroup,u=e("./attributes"),f=n.coerceFont;function p(e,t,r,n){var a=t.orientation,i=t[{v:"x",h:"y"}[a]+"axis"],o=c(r,i)+a,s=r._alignmentOpts||{},l=n("alignmentgroup"),u=s[o];u||(u=s[o]={});var f=u[l];f?f.traces.push(t):f=u[l]={traces:[t],alignmentIndex:Object.keys(u).length,offsetGroups:{}};var p=n("offsetgroup"),h=f.offsetGroups,d=h[p];p&&(d||(d=h[p]={offsetIndex:Object.keys(h).length}),t._offsetIndex=d.offsetIndex)}function h(e,t,r,a,i,o){var s=!(!1===(o=o||{}).moduleHasSelected),l=!(!1===o.moduleHasUnselected),c=!(!1===o.moduleHasConstrain),u=!(!1===o.moduleHasCliponaxis),p=!(!1===o.moduleHasTextangle),h=!(!1===o.moduleHasInsideanchor),d=!!o.hasPathbar,m=Array.isArray(i)||"auto"===i,g=m||"inside"===i,y=m||"outside"===i;if(g||y){var v=f(a,"textfont",r.font),b=n.extendFlat({},v),x=!(e.textfont&&e.textfont.color);if(x&&delete b.color,f(a,"insidetextfont",b),d){var _=n.extendFlat({},v);x&&delete _.color,f(a,"pathbar.textfont",_)}y&&f(a,"outsidetextfont",v),s&&a("selected.textfont.color"),l&&a("unselected.textfont.color"),c&&a("constraintext"),u&&a("cliponaxis"),p&&a("textangle"),a("texttemplate")}g&&h&&a("insidetextanchor")}t.exports={supplyDefaults:function(e,t,r,c){function f(r,a){return n.coerce(e,t,u,r,a)}if(o(e,t,c,f)){s(e,t,c,f),f("xhoverformat"),f("yhoverformat"),f("orientation",t.x&&!t.y?"h":"v"),f("base"),f("offset"),f("width"),f("text"),f("hovertext"),f("hovertemplate");var p=f("textposition");h(e,0,c,f,p,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(e,t,f,r,c);var d=(t.marker.line||{}).color,m=i.getComponentMethod("errorbars","supplyDefaults");m(e,t,d||a.defaultLine,{axis:"y"}),m(e,t,d||a.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(t,f)}else t.visible=!1},crossTraceDefaults:function(e,t){var r;function a(e){return n.coerce(r._input,r,u,e)}if("group"===t.barmode)for(var i=0;i<e.length;i++)"bar"===(r=e[i]).type&&(r._input,p(0,r,t,a))},handleGroupingDefaults:p,handleText:h}},{"../../components/color":366,"../../lib":503,"../../plots/cartesian/constraints":562,"../../registry":638,"../scatter/period_defaults":946,"../scatter/xy_defaults":953,"./attributes":648,"./style_defaults":663}],653:[function(e,t,r){"use strict";t.exports=function(e,t,r){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),"h"===r.orientation?(e.label=e.y,e.value=e.x):(e.label=e.x,e.value=e.y),e}},{}],654:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("tinycolor2"),i=e("../../lib").isArrayOrTypedArray;r.coerceString=function(e,t,r){if("string"==typeof t){if(t||!e.noBlank)return t}else if(("number"==typeof t||!0===t)&&!e.strict)return String(t);return void 0!==r?r:e.dflt},r.coerceNumber=function(e,t,r){if(n(t)){t=+t;var a=e.min,i=e.max;if(!(void 0!==a&&t<a||void 0!==i&&t>i))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t<e.length&&(r=e[t]):r=e,r},r.getLineWidth=function(e,t){return 0<t.mlw?t.mlw:i(e.marker.line.width)?0:e.marker.line.width}},{"../../lib":503,"fast-isnumeric":190,tinycolor2:312}],655:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../registry"),i=e("../../components/color"),o=e("../../lib").fillText,s=e("./helpers").getLineWidth,l=e("../../plots/cartesian/axes").hoverLabelText,c=e("../../constants/numerical").BADNUM;function u(e,t,r,a,i){var s,u,f,p,h,d,m,g=e.cd,y=g[0].trace,v=g[0].t,b="closest"===a,x="waterfall"===y.type,_=e.maxHoverDistance,w=e.maxSpikeDistance;"h"===y.orientation?(s=r,u=t,f="y",p="x",h=P,d=O):(s=t,u=r,f="x",p="y",d=P,h=O);var k=y[f+"period"],D=b||k;function T(e){return S(e,-1)}function A(e){return S(e,1)}function S(e,t){var r=e.w;return e[f]+t*r/2}function M(e){return e[f+"End"]-e[f+"Start"]}var E=b?T:k?function(e){return e.p-M(e)/2}:function(e){return Math.min(T(e),e.p-v.bardelta/2)},C=b?A:k?function(e){return e.p+M(e)/2}:function(e){return Math.max(A(e),e.p+v.bardelta/2)};function N(e,t,r){return i.finiteRange&&(r=0),n.inbox(e-s,t-s,r+Math.min(1,Math.abs(t-e)/m)-1)}function O(e){return N(E(e),C(e),_)}function I(e){var t=e[p];if(x){var r=Math.abs(e.rawS)||0;u>0?t+=r:u<0&&(t-=r)}return t}function P(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var R=e[f+"a"],L=e[p+"a"];m=Math.abs(R.r2c(R.range[1])-R.r2c(R.range[0]));var F=n.getDistanceFunction(a,h,d,(function(e){return(h(e)+d(e))/2}));if(n.getClosest(g,F,e),!1!==e.index&&g[e.index].p!==c){D||(E=function(e){return Math.min(T(e),e.p-v.bargroupwidth/2)},C=function(e){return Math.max(A(e),e.p+v.bargroupwidth/2)});var B=g[e.index],z=y.base?B.b+B.s:B.s;e[p+"0"]=e[p+"1"]=L.c2p(B[p],!0),e[p+"LabelVal"]=z;var j=v.extents[v.extents.round(B.p)];e[f+"0"]=R.c2p(b?E(B):j[0],!0),e[f+"1"]=R.c2p(b?C(B):j[1],!0);var U=void 0!==B.orig_p;return e[f+"LabelVal"]=U?B.orig_p:B.p,e.labelLabel=l(R,e[f+"LabelVal"],y[f+"hoverformat"]),e.valueLabel=l(L,e[p+"LabelVal"],y[p+"hoverformat"]),e.baseLabel=l(L,B.b,y[p+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(B)+function(e){return N(T(e),A(e),w)}(B))/2,e[f+"Spike"]=R.c2p(B.p,!0),o(B,y,e),e.hovertemplate=y.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=s(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var s=o.cd,l=s[0].trace,c=s[o.index];return o.color=f(l,c),a.getComponentMethod("errorbars","hoverInfo")(c,l,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":366,"../../components/fx":406,"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/axes":554,"../../registry":638,"./helpers":654}],656:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":568,"../scatter/marker_colorbar":944,"./arrays_to_calcdata":647,"./attributes":648,"./calc":649,"./cross_trace_calc":651,"./defaults":652,"./event_data":653,"./hover":655,"./layout_attributes":657,"./layout_defaults":658,"./plot":659,"./select":660,"./style":662}],657:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],658:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function s(r,n){return i.coerce(e,t,o,r,n)}for(var l=!1,c=!1,u=!1,f={},p=s("barmode"),h=0;h<r.length;h++){var d=r[h];if(n.traceIs(d,"bar")&&d.visible){if(l=!0,"group"===p){var m=d.xaxis+d.yaxis;f[m]&&(u=!0),f[m]=!0}d.visible&&"histogram"===d.type&&"category"!==a.getFromId({_fullLayout:t},d["v"===d.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}l?("overlay"!==p&&s("barnorm"),s("bargap",c&&!u?0:.2),s("bargroupgap")):delete t.barmode}},{"../../lib":503,"../../plots/cartesian/axes":554,"../../registry":638,"./layout_attributes":657}],659:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../lib/svg_text_utils"),s=e("../../components/color"),l=e("../../components/drawing"),c=e("../../registry"),u=e("../../plots/cartesian/axes").tickText,f=e("./uniform_text"),p=f.recordMinTextSize,h=f.clearMinTextSize,d=e("./style"),m=e("./helpers"),g=e("./constants"),y=e("./attributes"),v=y.text,b=y.textposition,x=e("../../components/fx/helpers").appendArrayPointValue,_=g.TEXTPAD;function w(e){return e.id}function k(e){if(e.ids)return w}function D(e,t){return e<t?1:-1}function T(e,t,r,n){var a;return!t.uniformtext.mode&&A(r)?(n&&(a=n()),e.transition().duration(r.duration).ease(r.easing).each("end",(function(){a&&a()})).each("interrupt",(function(){a&&a()}))):e}function A(e){return e&&e.duration>0}function S(e){return"auto"===e?0:e}function M(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function E(e,t,r,n,a,i){var o=!!i.isHorizontal,s=!!i.constrained,l=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,p=((i.leftToRight||0)+1)/2,h=1-p,d=a.width,m=a.height,g=Math.abs(t-e),y=Math.abs(n-r),v=g>2*_&&y>2*_?_:0;g-=2*v,y-=2*v;var b=S(l);"auto"!==l||d<=g&&m<=y||!(d>g||m>y)||(d>y||m>g)&&d<m==g<y||(b+=90);var x=M(a,b),w=1;s&&(w=Math.min(1,g/x.x,y/x.y));var k=a.left*h+a.right*p,T=(a.top+a.bottom)/2,A=(e+_)*h+(t-_)*p,E=(r+n)/2,C=0,N=0;if(f||u){var O=(o?x.x:x.y)/2,I=o?D(e,t):D(r,n);o?f?(A=e+I*v,C=-I*O):(A=t-I*v,C=I*O):f?(E=r+I*v,N=-I*O):(E=n-I*v,N=I*O)}return{textX:k,textY:T,targetX:A,targetY:E,anchorX:C,anchorY:N,scale:w,rotate:b}}t.exports={plot:function(e,t,r,f,g,y){var w=t.xaxis,C=t.yaxis,N=e._fullLayout;g||(g={mode:N.barmode,norm:N.barmode,gap:N.bargap,groupgap:N.bargroupgap},h("bar",N));var O=i.makeTraceGroups(f,r,"trace bars").each((function(r){var c=n.select(this),f=r[0].trace,h="waterfall"===f.type,O="funnel"===f.type,I="bar"===f.type||O,P=0;h&&f.connector.visible&&"between"===f.connector.mode&&(P=f.connector.line.width/2);var R="h"===f.orientation,L=A(g),F=i.ensureSingle(c,"g","points"),B=k(f),z=F.selectAll("g.point").data(i.identity,B);z.enter().append("g").classed("point",!0),z.exit().remove(),z.each((function(c,h){var k,A,O=n.select(this),F=function(e,t,r,n){var a=[],i=[],o=n?t:r,s=n?r:t;return a[0]=o.c2p(e.s0,!0),i[0]=s.c2p(e.p0,!0),a[1]=o.c2p(e.s1,!0),i[1]=s.c2p(e.p1,!0),n?[a,i]:[i,a]}(c,w,C,R),B=F[0][0],z=F[0][1],j=F[1][0],U=F[1][1],$=0==(R?z-B:U-j);if($&&I&&m.getLineWidth(f,c)&&($=!1),$||($=!(a(B)&&a(z)&&a(j)&&a(U))),c.isBlank=$,$&&(R?z=B:U=j),P&&!$&&(R?(B-=D(B,z)*P,z+=D(B,z)*P):(j-=D(j,U)*P,U+=D(j,U)*P)),"waterfall"===f.type){if(!$){var V=f[c.dir].marker;k=V.line.width,A=V.color}}else k=m.getLineWidth(f,c),A=c.mc||f.marker.color;function q(e){var t=n.round(k/2%1,2);return 0===g.gap&&0===g.groupgap?n.round(Math.round(e)-t,2):e}if(!e._context.staticPlot){var W=s.opacity(A)<1||k>.01?q:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?q(e):e>t?Math.ceil(e):Math.floor(e)};B=W(B,z,R),z=W(z,B,R),j=W(j,U,!R),U=W(U,j,!R)}var H=T(i.ensureSingle(O,"path"),N,g,y);if(H.style("vector-effect","non-scaling-stroke").attr("d",isNaN((z-B)*(U-j))||$&&e._context.staticPlot?"M0,0Z":"M"+B+","+j+"V"+U+"H"+z+"V"+j+"Z").call(l.setClipUrl,t.layerClipId,e),!N.uniformtext.mode&&L){var G=l.makePointStyleFns(f);l.singlePointStyle(c,H,f,G,e)}!function(e,t,r,n,a,s,c,f,h,g,y){var w,k=t.xaxis,A=t.yaxis,C=e._fullLayout;function N(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,e)}var O=n[0].trace,I="h"===O.orientation,P=function(e,t,r,n,a){var o,s=t[0].trace;return o=s.texttemplate?function(e,t,r,n,a){var o=t[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,c,f,p,h="histogram"===o.type,d="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;function y(e){return u(p,p.c2l(e),!0).text}g?(l="y",c=a,f="x",p=n):(l="x",c=n,f="y",p=a);var v,b=t[r],_={};_.label=b.p,_.labelLabel=_[l+"Label"]=(v=b.p,u(c,c.c2l(v),!0).text);var w=i.castOption(o,b.i,"text");(0===w||w)&&(_.text=w),_.value=b.s,_.valueLabel=_[f+"Label"]=y(b.s);var k={};x(k,o,b.i),(h||void 0===k.x)&&(k.x=g?_.value:_.label),(h||void 0===k.y)&&(k.y=g?_.label:_.value),(h||void 0===k.xLabel)&&(k.xLabel=g?_.valueLabel:_.labelLabel),(h||void 0===k.yLabel)&&(k.yLabel=g?_.labelLabel:_.valueLabel),d&&(_.delta=+b.rawS||b.s,_.deltaLabel=y(_.delta),_.final=b.v,_.finalLabel=y(_.final),_.initial=_.final-_.delta,_.initialLabel=y(_.initial)),m&&(_.value=b.s,_.valueLabel=y(_.value),_.percentInitial=b.begR,_.percentInitialLabel=i.formatPercent(b.begR),_.percentPrevious=b.difR,_.percentPreviousLabel=i.formatPercent(b.difR),_.percentTotal=b.sumR,_.percenTotalLabel=i.formatPercent(b.sumR));var D=i.castOption(o,b.i,"customdata");return D&&(_.customdata=D),i.texttemplateString(s,_,e._d3locale,k,_,o._meta||{})}(e,t,r,n,a):s.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,p,h=a.textinfo,d=e[t],m=h.split("+"),g=[],y=function(e){return-1!==m.indexOf(e)};if(y("label")&&g.push((p=e[t].p,u(o?n:r,p,!0).text)),y("text")&&(0===(f=i.castOption(a,d.i,"text"))||f)&&g.push(f),s){var v=+d.rawS||d.s,b=d.v,x=b-v;y("initial")&&g.push(c(x)),y("delta")&&g.push(c(v)),y("final")&&g.push(c(b))}if(l){y("value")&&g.push(c(d.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(f=i.formatPercent(d.begR),w&&(f+=" of initial"),g.push(f)),y("percent previous")&&(f=i.formatPercent(d.difR),w&&(f+=" of previous"),g.push(f)),y("percent total")&&(f=i.formatPercent(d.sumR),w&&(f+=" of total"),g.push(f))}return g.join("<br>")}(t,r,n,a):m.getValue(s.text,r),m.coerceString(v,o)}(C,n,a,k,A);w=function(e,t){var r=m.getValue(e.textposition,t);return m.coerceEnumerated(b,r)}(O,a);var R="stack"===g.mode||"relative"===g.mode,L=n[a],F=!R||L._outmost;if(P&&"none"!==w&&(!L.isBlank&&s!==c&&f!==h||"auto"!==w&&"inside"!==w)){var B=C.font,z=d.getBarColor(n[a],O),j=d.getInsideTextFont(O,a,B,z),U=d.getOutsideTextFont(O,a,B),$=r.datum();I?"log"===k.type&&$.s0<=0&&(s=k.range[0]<k.range[1]?0:k._length):"log"===A.type&&$.s0<=0&&(f=A.range[0]<A.range[1]?A._length:0);var V,q,W,H,G,X=Math.abs(c-s)-2*_,Y=Math.abs(h-f)-2*_;if("outside"===w&&(F||L.hasB||(w="inside")),"auto"===w&&(F?(w="inside",V=N(r,P,G=i.ensureUniformFontSize(e,j)),W=(q=l.bBox(V.node())).width,H=q.height,W>0&&H>0&&(W<=X&&H<=Y||W<=Y&&H<=X||(I?X>=W*(Y/H):Y>=H*(X/W)))?w="inside":(w="outside",V.remove(),V=null)):w="inside"),!V){var Z=(V=N(r,P,G=i.ensureUniformFontSize(e,"outside"===w?U:j))).attr("transform");if(V.attr("transform",""),W=(q=l.bBox(V.node())).width,H=q.height,V.attr("transform",Z),W<=0||H<=0)return void V.remove()}var K,J=O.textangle;K="outside"===w?function(e,t,r,n,a,i){var o,s=!!i.isHorizontal,l=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,p=Math.abs(t-e),h=Math.abs(n-r);o=s?h>2*_?_:0:p>2*_?_:0;var d=1;l&&(d=s?Math.min(1,h/f):Math.min(1,p/u));var m=S(c),g=M(a,m),y=(s?g.x:g.y)/2,v=(a.left+a.right)/2,b=(a.top+a.bottom)/2,x=(e+t)/2,w=(r+n)/2,k=0,T=0,A=s?D(t,e):D(r,n);return s?(x=t-A*o,k=A*y):(w=n+A*o,T=-A*y),{textX:v,textY:b,targetX:x,targetY:w,anchorX:k,anchorY:T,scale:d,rotate:m}}(s,c,f,h,q,{isHorizontal:I,constrained:"both"===O.constraintext||"outside"===O.constraintext,angle:J}):E(s,c,f,h,q,{isHorizontal:I,constrained:"both"===O.constraintext||"inside"===O.constraintext,angle:J,anchor:O.insidetextanchor}),K.fontSize=G.size,p("histogram"===O.type?"bar":O.type,K,C),L.transform=K,T(V,C,g,y).attr("transform",i.getTextTransform(K))}else r.select("text").remove()}(e,t,O,r,h,B,z,j,U,g,y),t.layerClipId&&l.hideOutsideRangePoint(c,O.select("text"),w,C,f.xcalendar,f.ycalendar)}));var j=!1===f.cliponaxis;l.setClipUrl(c,j?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,O,t,g)},toMoveInsideBar:E}},{"../../components/color":366,"../../components/drawing":388,"../../components/fx/helpers":402,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"../../registry":638,"./attributes":648,"./constants":650,"./helpers":654,"./style":662,"./uniform_text":664,"@plotly/d3":58,"fast-isnumeric":190}],660:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),s=r.c2p(n?e.p0:e.s0,!0),l=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(i+o)/2,l]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,s=a[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===t)for(r=0;r<a.length;r++)a[r].selected=0;else for(r=0;r<a.length;r++){var f=a[r],p="ct"in f?f.ct:n(f,i,o,c,l);t.contains(p,!1,r,e)?(u.push({pointNumber:r,x:i.c2d(f.x),y:o.c2d(f.y)}),f.selected=1):f.selected=0}return u}},{}],661:[function(e,t,r){"use strict";t.exports=i;var n=e("../../lib").distinctVals,a=e("../../constants/numerical").BADNUM;function i(e,t){this.traces=e,this.sepNegVal=t.sepNegVal,this.overlapNoMerge=t.overlapNoMerge;for(var r=1/0,i=[],o=0;o<e.length;o++){for(var s=e[o],l=0;l<s.length;l++){var c=s[l];c.p!==a&&i.push(c.p)}s[0]&&s[0].width1&&(r=Math.min(s[0].width1,r))}this.positions=i;var u=n(i);this.distinctPositions=u.vals,1===u.vals.length&&r!==1/0?this.minDiff=r:this.minDiff=Math.min(u.minDiff,r);var f=(t.posAxis||{}).type;"category"!==f&&"multicategory"!==f||(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}i.prototype.put=function(e,t){var r=this.getLabel(e,t),n=this.bins[r]||0;return this.bins[r]=n+t,n},i.prototype.get=function(e,t){var r=this.getLabel(e,t);return this.bins[r]||0},i.prototype.getLabel=function(e,t){return(t<0&&this.sepNegVal?"v":"^")+(this.overlapNoMerge?e:Math.round(e/this.binWidth))}},{"../../constants/numerical":479,"../../lib":503}],662:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/color"),i=e("../../components/drawing"),o=e("../../lib"),s=e("../../registry"),l=e("./uniform_text").resizeText,c=e("./attributes"),u=c.textfont,f=c.insidetextfont,p=c.outsidetextfont,h=e("./helpers");function d(e,t,r){i.pointStyle(e.selectAll("path"),t,r),m(e,t,r)}function m(e,t,r){e.selectAll("text").each((function(e){var a=n.select(this),s=o.ensureUniformFontSize(r,g(a,e,t,r));i.font(a,s)}))}function g(e,t,r,n){var a=n._fullLayout.font,i=r.textfont;if(e.classed("bartext-inside")){var o=_(t,r);i=v(r,t.i,a,o)}else e.classed("bartext-outside")&&(i=b(r,t.i,a));return i}function y(e,t,r){return x(u,e.textfont,t,r)}function v(e,t,r,n){var i=y(e,t,r);return(void 0===e._input.textfont||void 0===e._input.textfont.color||Array.isArray(e.textfont.color)&&void 0===e.textfont.color[t])&&(i={color:a.contrast(n),family:i.family,size:i.size}),x(f,e.insidetextfont,t,i)}function b(e,t,r){var n=y(e,t,r);return x(p,e.outsidetextfont,t,n)}function x(e,t,r,n){t=t||{};var a=h.getValue(t.family,r),i=h.getValue(t.size,r),o=h.getValue(t.color,r);return{family:h.coerceString(e.family,a,n.family),size:h.coerceNumber(e.size,i,n.size),color:h.coerceColor(e.color,o,n.color)}}function _(e,t){return"waterfall"===t.type?t[e.dir].marker.color:e.mcc||e.mc||t.marker.color}t.exports={style:function(e){var t=n.select(e).selectAll("g.barlayer").selectAll("g.trace");l(e,t,"bar");var r=t.size(),a=e._fullLayout;t.style("opacity",(function(e){return e[0].trace.opacity})).each((function(e){("stack"===a.barmode&&r>1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){d(n.select(this),t[0].trace,e)})),s.getComponentMethod("errorbars","style")(t)},styleTextPoints:m,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,s=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,g(s,e,t,r));var l=t.selected.textfont&&t.selected.textfont.color;l&&(a.color=l),i.font(s,a)}else i.selectedTextStyle(s,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(d(r,a,e),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:v,getOutsideTextFont:b,getBarColor:_,resizeText:l}},{"../../components/color":366,"../../components/drawing":388,"../../lib":503,"../../registry":638,"./attributes":648,"./helpers":654,"./uniform_text":664,"@plotly/d3":58}],663:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,s,l){var c=r("marker.color",s),u=a(e,"marker");u&&i(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":366,"../../components/colorscale/defaults":376,"../../components/colorscale/helpers":377,"../../lib":503}],664:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o<a,r[n]=r[n]||1/0,t.hide||(r[n]=Math.min(r[n],Math.max(o,a)))}},clearMinTextSize:function(e,t){t[i(e)]=void 0},resizeText:function(e,t,r){var i=e._fullLayout,o=i["_"+r+"Text_minsize"];if(o){var s,l="hide"===i.uniformtext.mode;switch(r){case"funnelarea":case"pie":case"sunburst":s="g.slice";break;case"treemap":case"icicle":s="g.slice, g.pathbar";break;default:s="g.points > g.point"}t.selectAll(s).each((function(e){var t=e.transform;t&&(t.scale=l&&t.hide?0:o/t.fontSize,n.select(this).select("text").attr("transform",a.getTextTransform(t)))}))}}}},{"../../lib":503,"@plotly/d3":58}],665:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../../lib/extend").extendFlat,i=e("../scatterpolar/attributes"),o=e("../bar/attributes");t.exports={r:i.r,theta:i.theta,r0:i.r0,dr:i.dr,theta0:i.theta0,dtheta:i.dtheta,thetaunit:i.thetaunit,base:a({},o.base,{}),offset:a({},o.offset,{}),width:a({},o.width,{}),text:a({},o.text,{}),hovertext:a({},o.hovertext,{}),marker:o.marker,hoverinfo:i.hoverinfo,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},{"../../lib/extend":493,"../../plots/template_attributes":633,"../bar/attributes":648,"../scatterpolar/attributes":1e3}],666:[function(e,t,r){"use strict";var n=e("../../components/colorscale/helpers").hasColorscale,a=e("../../components/colorscale/calc"),i=e("../bar/arrays_to_calcdata"),o=e("../bar/cross_trace_calc").setGroupPositions,s=e("../scatter/calc_selection"),l=e("../../registry").traceIs,c=e("../../lib").extendFlat;t.exports={calc:function(e,t){for(var r=e._fullLayout,o=t.subplot,l=r[o].radialaxis,c=r[o].angularaxis,u=l.makeCalcdata(t,"r"),f=c.makeCalcdata(t,"theta"),p=t._length,h=new Array(p),d=u,m=f,g=0;g<p;g++)h[g]={p:m[g],s:d[g]};function y(e){var r=t[e];void 0!==r&&(t["_"+e]=Array.isArray(r)?c.makeCalcdata(t,e):c.d2c(r,t.thetaunit))}return"linear"===c.type&&(y("width"),y("offset")),n(t,"marker")&&a(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),n(t,"marker.line")&&a(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}),i(h,t),s(h,t),h},crossTraceCalc:function(e,t,r){for(var n=e.calcdata,a=[],i=0;i<n.length;i++){var s=n[i],u=s[0].trace;!0===u.visible&&l(u,"bar")&&u.subplot===r&&a.push(s)}var f=c({},t.radialaxis,{_id:"x"}),p=t.angularaxis;o(e,p,f,a,{mode:t.barmode,norm:t.barnorm,gap:t.bargap,groupgap:t.bargroupgap})}}},{"../../components/colorscale/calc":374,"../../components/colorscale/helpers":377,"../../lib":503,"../../registry":638,"../bar/arrays_to_calcdata":647,"../bar/cross_trace_calc":651,"../scatter/calc_selection":928}],667:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../scatterpolar/defaults").handleRThetaDefaults,i=e("../bar/style_defaults"),o=e("./attributes");t.exports=function(e,t,r,s){function l(r,a){return n.coerce(e,t,o,r,a)}a(e,t,s,l)?(l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),i(e,t,l,r,s),n.coerceSelectionMarkerOpacity(t,l)):t.visible=!1}},{"../../lib":503,"../bar/style_defaults":663,"../scatterpolar/defaults":1002,"./attributes":665}],668:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../lib"),i=e("../bar/hover").getTraceColor,o=a.fillText,s=e("../scatterpolar/hover").makeHoverPointText,l=e("../../plots/polar/helpers").isPtInsidePolygon;t.exports=function(e,t,r){var c=e.cd,u=c[0].trace,f=e.subplot,p=f.radialAxis,h=f.angularAxis,d=f.vangles,m=d?l:a.isPtInsideSector,g=e.maxHoverDistance,y=h._period||2*Math.PI,v=Math.abs(p.g2p(Math.sqrt(t*t+r*r))),b=Math.atan2(r,t);if(p.range[0]>p.range[1]&&(b+=Math.PI),n.getClosest(c,(function(e){return m(v,b,[e.rp0,e.rp1],[e.thetag0,e.thetag1],d)?g+Math.min(1,Math.abs(e.thetag1-e.thetag0)/y)-1+(e.rp1-v)/(e.rp1-e.rp0)-1:1/0}),e),!1!==e.index){var x=c[e.index];e.x0=e.x1=x.ct[0],e.y0=e.y1=x.ct[1];var _=a.extendFlat({},x,{r:x.s,theta:x.p});return o(x,u,e),s(_,u,f,e),e.hovertemplate=u.hovertemplate,e.color=i(u,x),e.xLabelVal=e.yLabelVal=void 0,x.s<0&&(e.idealAlign="left"),[e]}}},{"../../components/fx":406,"../../lib":503,"../../plots/polar/helpers":621,"../bar/hover":655,"../scatterpolar/hover":1004}],669:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"barpolar",basePlotModule:e("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("../scatterpolar/format_labels"),style:e("../bar/style").style,styleOnSelect:e("../bar/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../bar/select"),meta:{}}},{"../../plots/polar":622,"../bar/select":660,"../bar/style":662,"../scatter/marker_colorbar":944,"../scatterpolar/format_labels":1003,"./attributes":665,"./calc":666,"./defaults":667,"./hover":668,"./layout_attributes":670,"./layout_defaults":671,"./plot":672}],670:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],671:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i,o={};function s(r,o){return n.coerce(e[i]||{},t[i],a,r,o)}for(var l=0;l<r.length;l++){var c=r[l];"barpolar"===c.type&&!0===c.visible&&(o[i=c.subplot]||(s("barmode"),s("bargap"),o[i]=1))}}},{"../../lib":503,"./layout_attributes":670}],672:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../components/drawing"),s=e("../../plots/polar/helpers");t.exports=function(e,t,r){var l=t.xaxis,c=t.yaxis,u=t.radialAxis,f=t.angularAxis,p=function(e){var t=e.cxx,r=e.cyy;return e.vangles?function(n,a,o,l){var c,u;i.angleDelta(o,l)>0?(c=o,u=l):(c=l,u=o);var f=[s.findEnclosingVertexAngles(c,e.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,e.vangles)[1]];return s.pathPolygonAnnulus(n,a,c,u,f,t,r)}:function(e,n,a,o){return i.pathAnnulus(e,n,a,o,t,r)}}(t),h=t.layers.frontplot.select("g.barlayer");i.makeTraceGroups(h,r,"trace bars").each((function(){var r=n.select(this),s=i.ensureSingle(r,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(e){var t,r=n.select(this),o=e.rp0=u.c2p(e.s0),s=e.rp1=u.c2p(e.s1),h=e.thetag0=f.c2g(e.p0),d=e.thetag1=f.c2g(e.p1);if(a(o)&&a(s)&&a(h)&&a(d)&&o!==s&&h!==d){var m=u.c2g(e.s1),g=(h+d)/2;e.ct=[l.c2p(m*Math.cos(g)),c.c2p(m*Math.sin(g))],t=p(o,s,h,d)}else t="M0,0Z";i.ensureSingle(r,"path").attr("d",t)})),o.setClipUrl(r,t._hasClipOnAxisFalse?t.clipIds.forTraces:null,e)}))}},{"../../components/drawing":388,"../../lib":503,"../../plots/polar/helpers":621,"@plotly/d3":58,"fast-isnumeric":190}],673:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../bar/attributes"),i=e("../../components/color/attributes"),o=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../lib/extend").extendFlat,c=n.marker,u=c.line;t.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":365,"../../lib/extend":493,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../bar/attributes":648,"../scatter/attributes":926}],674:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../plots/cartesian/axes"),i=e("../../plots/cartesian/align_period"),o=e("../../lib"),s=e("../../constants/numerical").BADNUM,l=o._;t.exports=function(e,t){var r,c,v,b,x,_,w,k=e._fullLayout,D=a.getFromId(e,t.xaxis||"x"),T=a.getFromId(e,t.yaxis||"y"),A=[],S="violin"===t.type?"_numViolins":"_numBoxes";"h"===t.orientation?(v=D,b="x",x=T,_="y",w=!!t.yperiodalignment):(v=T,b="y",x=D,_="x",w=!!t.xperiodalignment);var M,E,C,N,O,I,P=function(e,t,r,a){var s,l=t+"0"in e;if(t in e||l&&"d"+t in e){var c=r.makeCalcdata(e,t);return[i(e,r,t,c).vals,c]}s=l?e[t+"0"]:"name"in e&&("category"===r.type||n(e.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(e.name)&&"date"===r.type)?e.name:a;for(var u="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,e[t+"calendar"]),f=e._length,p=new Array(f),h=0;h<f;h++)p[h]=u;return[p]}(t,_,x,k[S]),R=P[0],L=P[1],F=o.distinctVals(R,x),B=F.vals,z=F.minDiff/2,j="all"===(t.boxpoints||t.points)?o.identity:function(e){return e.v<M.lf||e.v>M.uf};if(t._hasPreCompStats){var U=t[b],$=function(e){return v.d2c((t[e]||[])[r])},V=1/0,q=-1/0;for(r=0;r<t._length;r++){var W=R[r];if(n(W)){if((M={}).pos=M[_]=W,w&&L&&(M.orig_p=L[r]),M.q1=$("q1"),M.med=$("median"),M.q3=$("q3"),E=[],U&&o.isArrayOrTypedArray(U[r]))for(c=0;c<U[r].length;c++)(I=v.d2c(U[r][c]))!==s&&(u(O={v:I,i:[r,c]},t,[r,c]),E.push(O));if(M.pts=E.sort(f),N=(C=M[b]=E.map(p)).length,M.med!==s&&M.q1!==s&&M.q3!==s&&M.med>=M.q1&&M.q3>=M.med){var H=$("lowerfence");M.lf=H!==s&&H<=M.q1?H:h(M,C,N);var G=$("upperfence");M.uf=G!==s&&G>=M.q3?G:d(M,C,N);var X=$("mean");M.mean=X!==s?X:N?o.mean(C,N):(M.q1+M.q3)/2;var Y=$("sd");M.sd=X!==s&&Y>=0?Y:N?o.stdev(C,N,M.mean):M.q3-M.q1,M.lo=m(M),M.uo=g(M);var Z=$("notchspan");Z=Z!==s&&Z>0?Z:y(M,N),M.ln=M.med-Z,M.un=M.med+Z;var K=M.lf,J=M.uf;t.boxpoints&&C.length&&(K=Math.min(K,C[0]),J=Math.max(J,C[N-1])),t.notched&&(K=Math.min(K,M.ln),J=Math.max(J,M.un)),M.min=K,M.max=J}else{var Q;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+M.q1,"median = "+M.med,"q3 = "+M.q3].join("\n")),Q=M.med!==s?M.med:M.q1!==s?M.q3!==s?(M.q1+M.q3)/2:M.q1:M.q3!==s?M.q3:0,M.med=Q,M.q1=M.q3=Q,M.lf=M.uf=Q,M.mean=M.sd=Q,M.ln=M.un=Q,M.min=M.max=Q}V=Math.min(V,M.min),q=Math.max(q,M.max),M.pts2=E.filter(j),A.push(M)}}t._extremes[v._id]=a.findExtremes(v,[V,q],{padded:!0})}else{var ee=v.makeCalcdata(t,b),te=function(e,t){for(var r=e.length,n=new Array(r+1),a=0;a<r;a++)n[a]=e[a]-t;return n[r]=e[r-1]+t,n}(B,z),re=B.length,ne=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=[];return t}(re);for(r=0;r<t._length;r++)if(I=ee[r],n(I)){var ae=o.findBin(R[r],te);ae>=0&&ae<re&&(u(O={v:I,i:r},t,r),ne[ae].push(O))}var ie=1/0,oe=-1/0,se=t.quartilemethod,le="exclusive"===se,ce="inclusive"===se;for(r=0;r<re;r++)if(ne[r].length>0){var ue,fe;(M={}).pos=M[_]=B[r],E=M.pts=ne[r].sort(f),N=(C=M[b]=E.map(p)).length,M.min=C[0],M.max=C[N-1],M.mean=o.mean(C,N),M.sd=o.stdev(C,N,M.mean),M.med=o.interp(C,.5),N%2&&(le||ce)?(le?(ue=C.slice(0,N/2),fe=C.slice(N/2+1)):ce&&(ue=C.slice(0,N/2+1),fe=C.slice(N/2)),M.q1=o.interp(ue,.5),M.q3=o.interp(fe,.5)):(M.q1=o.interp(C,.25),M.q3=o.interp(C,.75)),M.lf=h(M,C,N),M.uf=d(M,C,N),M.lo=m(M),M.uo=g(M);var pe=y(M,N);M.ln=M.med-pe,M.un=M.med+pe,ie=Math.min(ie,M.ln),oe=Math.max(oe,M.un),M.pts2=E.filter(j),A.push(M)}t._extremes[v._id]=a.findExtremes(v,t.notched?ee.concat([ie,oe]):ee,{padded:!0})}return function(e,t){if(o.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r<e.length;r++){for(var n=e[r].pts||[],a={},i=0;i<n.length;i++)a[n[i].i]=i;o.tagSelected(n,t,a)}}(A,t),A.length>0?(A[0].t={num:k[S],dPos:z,posLetter:_,valLetter:b,labels:{med:l(e,"median:"),min:l(e,"min:"),q1:l(e,"q1:"),q3:l(e,"q3:"),max:l(e,"max:"),mean:"sd"===t.boxmean?l(e,"mean ± σ:"):l(e,"mean:"),lf:l(e,"lower fence:"),uf:l(e,"upper fence:")}},k[S]++,A):[{t:{empty:!0}}]};var c={text:"tx",hovertext:"htx"};function u(e,t,r){for(var n in c)o.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(t[n][r[0]])&&(e[c[n]]=t[n][r[0]][r[1]]):e[c[n]]=t[n][r])}function f(e,t){return e.v-t.v}function p(e){return e.v}function h(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(o.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function d(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(o.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function m(e){return 4*e.q1-3*e.q3}function g(e){return 4*e.q3-3*e.q1}function y(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}},{"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/align_period":551,"../../plots/cartesian/axes":554,"fast-isnumeric":190}],675:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib"),i=e("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function s(e,t,r,o){var s,l,c,u=t.calcdata,f=t._fullLayout,p=o._id,h=p.charAt(0),d=[],m=0;for(s=0;s<r.length;s++)for(c=u[r[s]],l=0;l<c.length;l++)d.push(o.c2l(c[l].pos,!0)),m+=(c[l].pts2||[]).length;if(d.length){var g=a.distinctVals(d);"category"!==o.type&&"multicategory"!==o.type||(g.minDiff=1);var y=g.minDiff/2;n.minDtick(o,g.minDiff,g.vals[0],!0);var v=f["violin"===e?"_numViolins":"_numBoxes"],b="group"===f[e+"mode"]&&v>1,x=1-f[e+"gap"],_=1-f[e+"groupgap"];for(s=0;s<r.length;s++){var w,k,D,T,A,S,M=(c=u[r[s]])[0].trace,E=c[0].t,C=M.width,N=M.side;if(C)w=k=T=C/2,D=0;else if(w=y,b){var O=i(f,o._id)+M.orientation,I=(f._alignmentOpts[O]||{})[M.alignmentgroup]||{},P=Object.keys(I.offsetGroups||{}).length,R=P||v;k=w*x*_/R,D=2*w*(((P?M._offsetIndex:E.num)+.5)/R-.5)*x,T=w*x/R}else k=w*x*_,D=0,T=w;E.dPos=w,E.bPos=D,E.bdPos=k,E.wHover=T;var L,F,B,z,j,U,$=D+k,V=Boolean(C);if("positive"===N?(A=w*(C?1:.5),L=$,S=L=D):"negative"===N?(A=L=D,S=w*(C?1:.5),F=$):(A=S=w,L=F=$),(M.boxpoints||M.points)&&m>0){var q=M.pointpos,W=M.jitter,H=M.marker.size/2,G=0;q+W>=0&&((G=$*(q+W))>A?(V=!0,j=H,B=G):G>L&&(j=H,B=A)),G<=A&&(B=A);var X=0;q-W<=0&&((X=-$*(q-W))>S?(V=!0,U=H,z=X):X>F&&(U=H,z=S)),X<=S&&(z=S)}else B=A,z=S;var Y=new Array(c.length);for(l=0;l<c.length;l++)Y[l]=c[l].pos;M._extremes[p]=n.findExtremes(o,Y,{padded:V,vpadminus:z,vpadplus:B,vpadLinearized:!0,ppadminus:{x:U,y:j}[h],ppadplus:{x:j,y:U}[h]})}}}t.exports={crossTraceCalc:function(e,t){for(var r=e.calcdata,n=t.xaxis,a=t.yaxis,i=0;i<o.length;i++){for(var l=o[i],c="h"===l?a:n,u=[],f=0;f<r.length;f++){var p=r[f],h=p[0].t,d=p[0].trace;!0!==d.visible||"box"!==d.type&&"candlestick"!==d.type||h.empty||(d.orientation||"v")!==l||d.xaxis!==n._id||d.yaxis!==a._id||u.push(f)}s("box",e,u,c)}},setPositionOffset:s}},{"../../lib":503,"../../plots/cartesian/axes":554,"../../plots/cartesian/constraints":562}],676:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../components/color"),o=e("../scatter/period_defaults"),s=e("../bar/defaults").handleGroupingDefaults,l=e("../../plots/cartesian/axis_autotype"),c=e("./attributes");function u(e,t,r,i){function o(e){var t=0;return e&&e.length&&(t+=1,n.isArrayOrTypedArray(e[0])&&e[0].length&&(t+=1)),t}function s(t){return n.validate(e[t],c[t])}var u,f=r("y"),p=r("x");if("box"===t.type){var h=r("q1"),d=r("median"),m=r("q3");t._hasPreCompStats=h&&h.length&&d&&d.length&&m&&m.length,u=Math.min(n.minRowLength(h),n.minRowLength(d),n.minRowLength(m))}var g,y,v=o(f),b=o(p),x=v&&n.minRowLength(f),_=b&&n.minRowLength(p),w=i.calendar,k={autotypenumbers:i.autotypenumbers};if(t._hasPreCompStats)switch(String(b)+String(v)){case"00":var D=s("x0")||s("dx");g=!s("y0")&&!s("dy")||D?"v":"h",y=u;break;case"10":g="v",y=Math.min(u,_);break;case"20":g="h",y=Math.min(u,p.length);break;case"01":g="h",y=Math.min(u,x);break;case"02":g="v",y=Math.min(u,f.length);break;case"12":g="v",y=Math.min(u,_,f.length);break;case"21":g="h",y=Math.min(u,p.length,x);break;case"11":y=0;break;case"22":var T,A=!1;for(T=0;T<p.length;T++)if("category"===l(p[T],w,k)){A=!0;break}if(A)g="v",y=Math.min(u,_,f.length);else{for(T=0;T<f.length;T++)if("category"===l(f[T],w,k)){A=!0;break}A?(g="h",y=Math.min(u,p.length,x)):(g="v",y=Math.min(u,_,f.length))}}else v>0?(g="v",y=b>0?Math.min(_,x):Math.min(x)):b>0?(g="h",y=Math.min(_)):y=0;if(y){t._length=y;var S=r("orientation",g);t._hasPreCompStats?"v"===S&&0===b?(r("x0",0),r("dx",1)):"h"===S&&0===v&&(r("y0",0),r("dy",1)):"v"===S&&0===b?r("x0"):"h"===S&&0===v&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],i)}else t.visible=!1}function f(e,t,r,a){var i=a.prefix,o=n.coerce2(e,t,c,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";t._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var u=r(i+"points",l);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",t.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",t.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete t.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(t,r)}t.exports={supplyDefaults:function(e,t,r,a){function s(r,a){return n.coerce(e,t,c,r,a)}if(u(e,t,s,a),!1!==t.visible){o(e,t,a,s),s("xhoverformat"),s("yhoverformat");var l=t._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(e.marker||{}).color||r),s("line.width"),s("fillcolor",i.addOpacity(t.line.color,.5));var p=!1;if(l){var h=s("mean"),d=s("sd");h&&h.length&&(p=!0,d&&d.length&&(p="sd"))}s("boxmean",p),s("whiskerwidth"),s("width"),s("quartilemethod");var m=!1;if(l){var g=s("notchspan");g&&g.length&&(m=!0)}else n.validate(e.notchwidth,c.notchwidth)&&(m=!0);s("notched",m)&&s("notchwidth"),f(e,t,s,{prefix:"box"})}},crossTraceDefaults:function(e,t){var r,a;function i(e){return n.coerce(a._input,a,c,e)}for(var o=0;o<e.length;o++){var l=(a=e[o]).type;"box"!==l&&"violin"!==l||(r=a._input,"group"===t[l+"mode"]&&s(r,a,t,i))}},handleSampleDefaults:u,handlePointsDefaults:f}},{"../../components/color":366,"../../lib":503,"../../plots/cartesian/axis_autotype":555,"../../registry":638,"../bar/defaults":652,"../scatter/period_defaults":946,"./attributes":673}],677:[function(e,t,r){"use strict";t.exports=function(e,t){return t.hoverOnBox&&(e.hoverOnBox=t.hoverOnBox),"xVal"in t&&(e.x=t.xVal),"yVal"in t&&(e.y=t.yVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}},{}],678:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib"),i=e("../../components/fx"),o=e("../../components/color"),s=a.fillText;function l(e,t,r,s){var l,c,u,f,p,h,d,m,g,y,v,b,x,_,w=e.cd,k=e.xa,D=e.ya,T=w[0].trace,A=w[0].t,S="violin"===T.type,M=[],E=A.bdPos,C=A.wHover,N=function(e){return u.c2l(e.pos)+A.bPos-u.c2l(h)};S&&"both"!==T.side?("positive"===T.side&&(g=function(e){var t=N(e);return i.inbox(t,t+C,y)},b=E,x=0),"negative"===T.side&&(g=function(e){var t=N(e);return i.inbox(t-C,t,y)},b=0,x=E)):(g=function(e){var t=N(e);return i.inbox(t-C,t+C,y)},b=x=E),_=S?function(e){return i.inbox(e.span[0]-p,e.span[1]-p,y)}:function(e){return i.inbox(e.min-p,e.max-p,y)},"h"===T.orientation?(p=t,h=r,d=_,m=g,l="y",u=D,c="x",f=k):(p=r,h=t,d=g,m=_,l="x",u=k,c="y",f=D);var O=Math.min(1,E/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function I(e){return(d(e)+m(e))/2}y=e.maxHoverDistance-O,v=e.maxSpikeDistance-O;var P=i.getDistanceFunction(s,d,m,I);if(i.getClosest(w,P,e),!1===e.index)return[];var R=w[e.index],L=T.line.color,F=(T.marker||{}).color;o.opacity(L)&&T.line.width?e.color=L:o.opacity(F)&&T.boxpoints?e.color=F:e.color=T.fillcolor,e[l+"0"]=u.c2p(R.pos+A.bPos-x,!0),e[l+"1"]=u.c2p(R.pos+A.bPos+b,!0),e[l+"LabelVal"]=void 0!==R.orig_p?R.orig_p:R.pos;var B=l+"Spike";e.spikeDistance=I(R)*v/y,e[B]=u.c2p(R.pos,!0);var z={},j=["med","q1","q3","min","max"];(T.boxmean||(T.meanline||{}).visible)&&j.push("mean"),(T.boxpoints||T.points)&&j.push("lf","uf");for(var U=0;U<j.length;U++){var $=j[U];if($ in R&&!(R[$]in z)){z[R[$]]=!0;var V=R[$],q=f.c2p(V,!0),W=a.extendFlat({},e);W.attr=$,W[c+"0"]=W[c+"1"]=q,W[c+"LabelVal"]=V,W[c+"Label"]=(A.labels?A.labels[$]+" ":"")+n.hoverLabelText(f,V,T[c+"hoverformat"]),W.hoverOnBox=!0,"mean"===$&&"sd"in R&&"sd"===T.boxmean&&(W[c+"err"]=R.sd),e.name="",e.spikeDistance=void 0,e[B]=void 0,W.hovertemplate=!1,M.push(W)}}return M}function c(e,t,r){for(var n,o,l,c=e.cd,u=e.xa,f=e.ya,p=c[0].trace,h=u.c2p(t),d=f.c2p(r),m=i.quadrature((function(e){var t=Math.max(3,e.mrc||0);return Math.max(Math.abs(u.c2p(e.x)-h)-t,1-3/t)}),(function(e){var t=Math.max(3,e.mrc||0);return Math.max(Math.abs(f.c2p(e.y)-d)-t,1-3/t)})),g=!1,y=0;y<c.length;y++){o=c[y];for(var v=0;v<(o.pts||[]).length;v++){var b=m(l=o.pts[v]);b<=e.distance&&(e.distance=b,g=[y,v])}}if(!g)return!1;l=(o=c[g[0]]).pts[g[1]];var x=u.c2p(l.x,!0),_=f.c2p(l.y,!0),w=l.mrc||1;n=a.extendFlat({},e,{index:l.i,color:(p.marker||{}).color,name:p.name,x0:x-w,x1:x+w,y0:_-w,y1:_+w,spikeDistance:e.distance,hovertemplate:p.hovertemplate});var k,D=o.orig_p,T=void 0!==D?D:o.pos;return"h"===p.orientation?(k=f,n.xLabelVal=l.x,n.yLabelVal=T):(k=u,n.xLabelVal=T,n.yLabelVal=l.y),n[k._id.charAt(0)+"Spike"]=k.c2p(o.pos,!0),s(l,p,n),n}t.exports={hoverPoints:function(e,t,r,n){var a,i=e.cd[0].trace.hoveron,o=[];return-1!==i.indexOf("boxes")&&(o=o.concat(l(e,t,r,n))),-1!==i.indexOf("points")&&(a=c(e,t,r)),"closest"===n?a?[a]:o:a?(o.push(a),o):o},hoverOnBoxes:l,hoverOnPoints:c}},{"../../components/color":366,"../../components/fx":406,"../../lib":503,"../../plots/cartesian/axes":554}],679:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults").supplyLayoutDefaults,calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"box",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":568,"./attributes":673,"./calc":674,"./cross_trace_calc":675,"./defaults":676,"./event_data":677,"./hover":678,"./layout_attributes":680,"./layout_defaults":681,"./plot":682,"./select":683,"./style":684}],680:[function(e,t,r){"use strict";t.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}},{}],681:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("./layout_attributes");function o(e,t,r,a,i){for(var o=i+"Layout",s=!1,l=0;l<r.length;l++){var c=r[l];if(n.traceIs(c,o)){s=!0;break}}s&&(a(i+"mode"),a(i+"gap"),a(i+"groupgap"))}t.exports={supplyLayoutDefaults:function(e,t,r){o(0,0,r,(function(r,n){return a.coerce(e,t,i,r,n)}),"box")},_supply:o}},{"../../lib":503,"../../registry":638,"./layout_attributes":680}],682:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../components/drawing");function o(e,t,r,i){var o,s,l="h"===r.orientation,c=t.val,u=t.pos,f=!!u.rangebreaks,p=i.bPos,h=i.wdPos||0,d=i.bPosPxOffset||0,m=r.whiskerwidth||0,g=r.notched||!1,y=g?1-2*r.notchwidth:1;Array.isArray(i.bdPos)?(o=i.bdPos[0],s=i.bdPos[1]):(o=i.bdPos,s=i.bdPos);var v=e.selectAll("path.box").data("violin"!==r.type||r.box.visible?a.identity:[]);v.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box"),v.exit().remove(),v.each((function(e){if(e.empty)return"M0,0Z";var t=u.c2l(e.pos+p,!0),i=u.l2p(t-o)+d,v=u.l2p(t+s)+d,b=f?(i+v)/2:u.l2p(t)+d,x=r.whiskerwidth,_=f?i*x+(1-x)*b:u.l2p(t-h)+d,w=f?v*x+(1-x)*b:u.l2p(t+h)+d,k=u.l2p(t-o*y)+d,D=u.l2p(t+s*y)+d,T=c.c2p(e.q1,!0),A=c.c2p(e.q3,!0),S=a.constrain(c.c2p(e.med,!0),Math.min(T,A)+1,Math.max(T,A)-1),M=void 0===e.lf||!1===r.boxpoints,E=c.c2p(M?e.min:e.lf,!0),C=c.c2p(M?e.max:e.uf,!0),N=c.c2p(e.ln,!0),O=c.c2p(e.un,!0);l?n.select(this).attr("d","M"+S+","+k+"V"+D+"M"+T+","+i+"V"+v+(g?"H"+N+"L"+S+","+D+"L"+O+","+v:"")+"H"+A+"V"+i+(g?"H"+O+"L"+S+","+k+"L"+N+","+i:"")+"ZM"+T+","+b+"H"+E+"M"+A+","+b+"H"+C+(0===m?"":"M"+E+","+_+"V"+w+"M"+C+","+_+"V"+w)):n.select(this).attr("d","M"+k+","+S+"H"+D+"M"+i+","+T+"H"+v+(g?"V"+N+"L"+D+","+S+"L"+v+","+O:"")+"V"+A+"H"+i+(g?"V"+O+"L"+k+","+S+"L"+i+","+N:"")+"ZM"+b+","+T+"V"+E+"M"+b+","+A+"V"+C+(0===m?"":"M"+_+","+E+"H"+w+"M"+_+","+C+"H"+w))}))}function s(e,t,r,n){var o=t.x,s=t.y,l=n.bdPos,c=n.bPos,u=r.boxpoints||r.points;a.seedPseudoRandom();var f=e.selectAll("g.points").data(u?function(e){return e.forEach((function(e){e.t=n,e.trace=r})),e}:[]);f.enter().append("g").attr("class","points"),f.exit().remove();var p=f.selectAll("path").data((function(e){var t,n,i=e.pts2,o=Math.max((e.max-e.min)/10,e.q3-e.q1),s=1e-9*o,f=.01*o,p=[],h=0;if(r.jitter){if(0===o)for(h=1,p=new Array(i.length),t=0;t<i.length;t++)p[t]=1;else for(t=0;t<i.length;t++){var d=Math.max(0,t-5),m=i[d].v,g=Math.min(i.length-1,t+5),y=i[g].v;"all"!==u&&(i[t].v<e.lf?y=Math.min(y,e.lf):m=Math.max(m,e.uf));var v=Math.sqrt(f*(g-d)/(y-m+s))||0;v=a.constrain(Math.abs(v),0,1),p.push(v),h=Math.max(v,h)}n=2*r.jitter/(h||1)}for(t=0;t<i.length;t++){var b=i[t],x=b.v,_=r.jitter?n*p[t]*(a.pseudoRandom()-.5):0,w=e.pos+c+l*(r.pointpos+_);"h"===r.orientation?(b.y=w,b.x=x):(b.x=w,b.y=x),"suspectedoutliers"===u&&x<e.uo&&x>e.lo&&(b.so=!0)}return i}));p.enter().append("path").classed("point",!0),p.exit().remove(),p.call(i.translatePoints,o,s)}function l(e,t,r,i){var o,s,l=t.val,c=t.pos,u=!!c.rangebreaks,f=i.bPos,p=i.bPosPxOffset||0,h=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],s=i.bdPos[1]):(o=i.bdPos,s=i.bdPos);var d=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(e){var t=c.c2l(e.pos+f,!0),a=c.l2p(t-o)+p,i=c.l2p(t+s)+p,d=u?(a+i)/2:c.l2p(t)+p,m=l.c2p(e.mean,!0),g=l.c2p(e.mean-e.sd,!0),y=l.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+a+"V"+i+("sd"===h?"m0,0L"+g+","+d+"L"+m+","+a+"L"+y+","+d+"Z":"")):n.select(this).attr("d","M"+a+","+m+"H"+i+("sd"===h?"m0,0L"+d+","+g+"L"+a+","+m+"L"+d+","+y+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],f=i.t,p=i.trace;f.wdPos=f.bdPos*p.whiskerwidth,!0!==p.visible||f.empty?a.remove():("h"===p.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},p,f),s(a,{x:c,y:u},p,f),l(a,{pos:t,val:r},p,f))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":388,"../../lib":503,"@plotly/d3":58}],683:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,a=e.cd,i=e.xaxis,o=e.yaxis,s=[];if(!1===t)for(r=0;r<a.length;r++)for(n=0;n<(a[r].pts||[]).length;n++)a[r].pts[n].selected=0;else for(r=0;r<a.length;r++)for(n=0;n<(a[r].pts||[]).length;n++){var l=a[r].pts[n],c=i.c2p(l.x),u=o.c2p(l.y);t.contains([c,u],null,l.i,e)?(s.push({pointNumber:l.i,x:i.c2d(l.x),y:o.c2d(l.y)}),l.selected=1):l.selected=0}return s}},{}],684:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/color"),i=e("../../components/drawing");t.exports={style:function(e,t,r){var o=r||n.select(e).selectAll("g.trace.boxes");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(t){var r=n.select(this),o=t[0].trace,s=o.line.width;function l(e,t,r,n){e.style("stroke-width",t+"px").call(a.stroke,r).call(a.fill,n)}var c=r.selectAll("path.box");if("candlestick"===o.type)c.each((function(e){if(!e.empty){var t=n.select(this),r=o[e.dir];l(t,r.line.width,r.line.color,r.fillcolor),t.style("opacity",o.selectedpoints&&!e.selected?.3:1)}}));else{l(c,s,o.line.color,o.fillcolor),r.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(a.stroke,o.line.color);var u=r.selectAll("path.point");i.pointStyle(u,o,e)}}))},styleOnSelect:function(e,t,r){var n=t[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,e)}}},{"../../components/color":366,"../../components/drawing":388,"@plotly/d3":58}],685:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../ohlc/attributes"),o=e("../box/attributes");function s(e){return{line:{color:n({},o.line.color,{dflt:e}),width:o.line.width,editType:"style"},fillcolor:o.fillcolor,editType:"style"}}t.exports={xperiod:i.xperiod,xperiod0:i.xperiod0,xperiodalignment:i.xperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:n({},o.line.width,{}),editType:"style"},increasing:s(i.increasing.line.color.dflt),decreasing:s(i.decreasing.line.color.dflt),text:i.text,hovertext:i.hovertext,whiskerwidth:n({},o.whiskerwidth,{dflt:0}),hoverlabel:i.hoverlabel}},{"../../lib":503,"../../plots/cartesian/axis_format_attributes":557,"../box/attributes":673,"../ohlc/attributes":872}],686:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/cartesian/align_period"),o=e("../ohlc/calc").calcCommon;function s(e,t,r,n){return{min:r,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:t}}t.exports=function(e,t){var r=e._fullLayout,l=a.getFromId(e,t.xaxis),c=a.getFromId(e,t.yaxis),u=l.makeCalcdata(t,"x"),f=i(t,l,"x",u).vals,p=o(e,t,u,f,c,s);return p.length?(n.extendFlat(p[0].t,{num:r._numBoxes,dPos:n.distinctVals(f).minDiff/2,posLetter:"x",valLetter:"y"}),r._numBoxes++,p):[{t:{empty:!0}}]}},{"../../lib":503,"../../plots/cartesian/align_period":551,"../../plots/cartesian/axes":554,"../ohlc/calc":873}],687:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../ohlc/ohlc_defaults"),o=e("../scatter/period_defaults"),s=e("./attributes");function l(e,t,r,n){var i=r(n+".line.color");r(n+".line.width",t.line.width),r(n+".fillcolor",a.addOpacity(i,.5))}t.exports=function(e,t,r,a){function c(r,a){return n.coerce(e,t,s,r,a)}i(e,t,c,a)?(o(e,t,a,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),l(0,t,c,"increasing"),l(0,t,c,"decreasing"),c("text"),c("hovertext"),c("whiskerwidth"),a._requestRangeslider[t.xaxis]=!0):t.visible=!1}},{"../../components/color":366,"../../lib":503,"../ohlc/ohlc_defaults":877,"../scatter/period_defaults":946,"./attributes":685}],688:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"candlestick",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:e("./attributes"),layoutAttributes:e("../box/layout_attributes"),supplyLayoutDefaults:e("../box/layout_defaults").supplyLayoutDefaults,crossTraceCalc:e("../box/cross_trace_calc").crossTraceCalc,supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("../box/plot").plot,layerName:"boxlayer",style:e("../box/style").style,hoverPoints:e("../ohlc/hover").hoverPoints,selectPoints:e("../ohlc/select")}},{"../../plots/cartesian":568,"../box/cross_trace_calc":675,"../box/layout_attributes":680,"../box/layout_defaults":681,"../box/plot":682,"../box/style":684,"../ohlc/hover":875,"../ohlc/select":879,"./attributes":685,"./calc":686,"./defaults":687}],689:[function(e,t,r){"use strict";var n=e("./axis_defaults"),a=e("../../plot_api/plot_template");t.exports=function(e,t,r,i,o){i("a")||(i("da"),i("a0")),i("b")||(i("db"),i("b0")),function(e,t,r,i){["aaxis","baxis"].forEach((function(o){var s=o.charAt(0),l=e[o]||{},c=a.newContainer(t,o),u={tickfont:"x",id:s+"axis",letter:s,font:t.font,name:o,data:e[s],calendar:t.calendar,dfltColor:i,bgColor:r.paper_bgcolor,autotypenumbersDflt:r.autotypenumbers,fullLayout:r};n(l,c,u),c._categories=c._categories||[],e[o]||"-"===l.type||(e[o]={type:l.type})}))}(e,t,r,o)}},{"../../plot_api/plot_template":543,"./axis_defaults":694}],690:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray;t.exports=function(e){return function e(t,r){if(!n(t)||r>=10)return null;for(var a=1/0,i=-1/0,o=t.length,s=0;s<o;s++){var l=t[s];if(n(l)){var c=e(l,r+1);c&&(a=Math.min(c[0],a),i=Math.max(c[1],i))}else a=Math.min(l,a),i=Math.max(l,i)}return[a,i]}(e,0)}},{"../../lib":503}],691:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./axis_attributes"),i=e("../../components/color/attributes"),o=n({editType:"calc"});o.family.dflt='"Open Sans", verdana, arial, sans-serif',o.size.dflt=12,o.color.dflt=i.defaultLine,t.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:a,baxis:a,font:o,color:{valType:"color",dflt:i.defaultLine,editType:"plot"},transforms:void 0}},{"../../components/color/attributes":365,"../../plots/font_attributes":585,"./axis_attributes":693}],692:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,a){var i,o,s,l,c,u,f,p,h,d,m,g,y,v=n(r)?"a":"b",b=("a"===v?e.aaxis:e.baxis).smoothing,x="a"===v?e.a2i:e.b2j,_="a"===v?r:a,w="a"===v?a:r,k="a"===v?t.a.length:t.b.length,D="a"===v?t.b.length:t.a.length,T=Math.floor("a"===v?e.b2j(w):e.a2i(w)),A="a"===v?function(t){return e.evalxy([],t,T)}:function(t){return e.evalxy([],T,t)};b&&(s=Math.max(0,Math.min(D-2,T)),l=T-s,o="a"===v?function(t,r){return e.dxydi([],t,s,r,l)}:function(t,r){return e.dxydj([],s,t,l,r)});var S=x(_[0]),M=x(_[1]),E=S<M?1:-1,C=1e-8*(M-S),N=E>0?Math.floor:Math.ceil,O=E>0?Math.ceil:Math.floor,I=E>0?Math.min:Math.max,P=E>0?Math.max:Math.min,R=N(S+C),L=O(M-C),F=[[f=A(S)]];for(i=R;i*E<L*E;i+=E)c=[],m=P(S,i),y=(g=I(M,i+E))-m,u=Math.max(0,Math.min(k-2,Math.floor(.5*(m+g)))),p=A(g),b&&(h=o(u,m-u),d=o(u,g-u),c.push([f[0]+h[0]/3*y,f[1]+h[1]/3*y]),c.push([p[0]-d[0]/3*y,p[1]-d[1]/3*y])),c.push(p),F.push(c),f=p;return F}},{"../../lib":503}],693:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../components/color/attributes"),i=e("../../plots/cartesian/layout_attributes"),o=e("../../plots/cartesian/axis_format_attributes").descriptionWithDates,s=e("../../plot_api/edit_types").overrideAll;t.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:n({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:i.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},tickfont:n({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:o("tick label")},tickformatstops:s(i.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:a.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgridcolor:{valType:"color",dflt:a.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},_deprecated:{title:{valType:"string",editType:"calc"},titlefont:n({editType:"calc"}),titleoffset:{valType:"number",dflt:10,editType:"calc"}},editType:"calc"}},{"../../components/color/attributes":365,"../../plot_api/edit_types":536,"../../plots/cartesian/axis_format_attributes":557,"../../plots/cartesian/layout_attributes":569,"../../plots/font_attributes":585}],694:[function(e,t,r){"use strict";var n=e("./attributes"),a=e("../../components/color").addOpacity,i=e("../../registry"),o=e("../../lib"),s=e("../../plots/cartesian/tick_value_defaults"),l=e("../../plots/cartesian/tick_label_defaults"),c=e("../../plots/cartesian/prefix_suffix_defaults"),u=e("../../plots/cartesian/category_order_defaults"),f=e("../../plots/cartesian/set_convert"),p=e("../../plots/cartesian/axis_autotype");t.exports=function(e,t,r){var h=r.letter,d=r.font||{},m=n[h+"axis"];function g(r,n){return o.coerce(e,t,m,r,n)}function y(r,n){return o.coerce2(e,t,m,r,n)}r.name&&(t._name=r.name,t._id=r.name),g("autotypenumbers",r.autotypenumbersDflt);var v=g("type");"-"===v&&(r.data&&function(e,t){if("-"===e.type){var r=e._id.charAt(0),n=e[r+"calendar"];e.type=p(t,n,{autotypenumbers:e.autotypenumbers})}}(t,r.data),"-"===t.type?t.type="linear":v=e.type=t.type),g("smoothing"),g("cheatertype"),g("showticklabels"),g("labelprefix",h+" = "),g("labelsuffix"),g("showtickprefix"),g("showticksuffix"),g("separatethousands"),g("tickformat"),g("exponentformat"),g("minexponent"),g("showexponent"),g("categoryorder"),g("tickmode"),g("tickvals"),g("ticktext"),g("tick0"),g("dtick"),"array"===t.tickmode&&(g("arraytick0"),g("arraydtick")),g("labelpadding"),t._hovertitle=h,"date"===v&&i.getComponentMethod("calendars","handleDefaults")(e,t,"calendar",r.calendar),f(t,r.fullLayout),t.c2p=o.identity;var b=g("color",r.dfltColor),x=b===e.color?b:d.color;g("title.text")&&(o.coerceFont(g,"title.font",{family:d.family,size:o.bigFont(d.size),color:x}),g("title.offset")),g("tickangle"),g("autorange",!t.isValidRange(e.range))&&g("rangemode"),g("range"),t.cleanRange(),g("fixedrange"),s(e,t,g,v),c(e,t,g,v,r),l(e,t,g,v,r),u(e,t,g,{data:r.data,dataAttr:h});var _=y("gridcolor",a(b,.3)),w=y("gridwidth"),k=g("showgrid");k||(delete t.gridcolor,delete t.gridwidth);var D=y("startlinecolor",b),T=y("startlinewidth",w);g("startline",t.showgrid||!!D||!!T)||(delete t.startlinecolor,delete t.startlinewidth);var A=y("endlinecolor",b),S=y("endlinewidth",w);return g("endline",t.showgrid||!!A||!!S)||(delete t.endlinecolor,delete t.endlinewidth),k?(g("minorgridcount"),g("minorgridwidth",w),g("minorgridcolor",a(_,.06)),t.minorgridcount||(delete t.minorgridwidth,delete t.minorgridcolor)):(delete t.gridcolor,delete t.gridWidth),"none"===t.showticklabels&&(delete t.tickfont,delete t.tickangle,delete t.showexponent,delete t.exponentformat,delete t.minexponent,delete t.tickformat,delete t.showticksuffix,delete t.showtickprefix),t.showticksuffix||delete t.ticksuffix,t.showtickprefix||delete t.tickprefix,g("tickmode"),t}},{"../../components/color":366,"../../lib":503,"../../plots/cartesian/axis_autotype":555,"../../plots/cartesian/category_order_defaults":559,"../../plots/cartesian/prefix_suffix_defaults":573,"../../plots/cartesian/set_convert":576,"../../plots/cartesian/tick_label_defaults":578,"../../plots/cartesian/tick_value_defaults":580,"../../registry":638,"./attributes":691}],695:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib").isArray1D,i=e("./cheater_basis"),o=e("./array_minmax"),s=e("./calc_gridlines"),l=e("./calc_labels"),c=e("./calc_clippath"),u=e("../heatmap/clean_2d_array"),f=e("./smooth_fill_2d_array"),p=e("../heatmap/convert_column_xyz"),h=e("./set_convert");t.exports=function(e,t){var r=n.getFromId(e,t.xaxis),d=n.getFromId(e,t.yaxis),m=t.aaxis,g=t.baxis,y=t.x,v=t.y,b=[];y&&a(y)&&b.push("x"),v&&a(v)&&b.push("y"),b.length&&p(t,m,g,"a","b",b);var x=t._a=t._a||t.a,_=t._b=t._b||t.b;y=t._x||t.x,v=t._y||t.y;var w={};if(t._cheater){var k="index"===m.cheatertype?x.length:x,D="index"===g.cheatertype?_.length:_;y=i(k,D,t.cheaterslope)}t._x=y=u(y),t._y=v=u(v),f(y,x,_),f(v,x,_),h(t),t.setScale();var T=o(y),A=o(v),S=.5*(T[1]-T[0]),M=.5*(T[1]+T[0]),E=.5*(A[1]-A[0]),C=.5*(A[1]+A[0]);return T=[M-1.3*S,M+1.3*S],A=[C-1.3*E,C+1.3*E],t._extremes[r._id]=n.findExtremes(r,T,{padded:!0}),t._extremes[d._id]=n.findExtremes(d,A,{padded:!0}),s(t,"a","b"),s(t,"b","a"),l(t,m),l(t,g),w.clipsegments=c(t._xctrl,t._yctrl,m,g),w.x=y,w.y=v,w.a=x,w.b=_,[w]}},{"../../lib":503,"../../plots/cartesian/axes":554,"../heatmap/clean_2d_array":794,"../heatmap/convert_column_xyz":796,"./array_minmax":690,"./calc_clippath":696,"./calc_gridlines":697,"./calc_labels":698,"./cheater_basis":700,"./set_convert":713,"./smooth_fill_2d_array":714}],696:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var a,i,o,s=[],l=!!r.smoothing,c=!!n.smoothing,u=e[0].length-1,f=e.length-1;for(a=0,i=[],o=[];a<=u;a++)i[a]=e[0][a],o[a]=t[0][a];for(s.push({x:i,y:o,bicubic:l}),a=0,i=[],o=[];a<=f;a++)i[a]=e[a][u],o[a]=t[a][u];for(s.push({x:i,y:o,bicubic:c}),a=u,i=[],o=[];a>=0;a--)i[u-a]=e[f][a],o[u-a]=t[f][a];for(s.push({x:i,y:o,bicubic:l}),a=f,i=[],o=[];a>=0;a--)i[f-a]=e[a][0],o[f-a]=t[a][0];return s.push({x:i,y:o,bicubic:c}),s}},{}],697:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib/extend").extendFlat;t.exports=function(e,t,r){var i,o,s,l,c,u,f,p,h,d,m,g,y,v,b=e["_"+t],x=e[t+"axis"],_=x._gridlines=[],w=x._minorgridlines=[],k=x._boundarylines=[],D=e["_"+r],T=e[r+"axis"];"array"===x.tickmode&&(x.tickvals=b.slice());var A=e._xctrl,S=e._yctrl,M=A[0].length,E=A.length,C=e._a.length,N=e._b.length;n.prepTicks(x),"array"===x.tickmode&&delete x.tickvals;var O=x.smoothing?3:1;function I(n){var a,i,o,s,l,c,u,f,h,d,m,g,y=[],v=[],b={};if("b"===t)for(i=e.b2j(n),o=Math.floor(Math.max(0,Math.min(N-2,i))),s=i-o,b.length=N,b.crossLength=C,b.xy=function(t){return e.evalxy([],t,i)},b.dxy=function(t,r){return e.dxydi([],t,o,r,s)},a=0;a<C;a++)c=Math.min(C-2,a),u=a-c,f=e.evalxy([],a,i),T.smoothing&&a>0&&(h=e.dxydi([],a-1,o,0,s),y.push(l[0]+h[0]/3),v.push(l[1]+h[1]/3),d=e.dxydi([],a-1,o,1,s),y.push(f[0]-d[0]/3),v.push(f[1]-d[1]/3)),y.push(f[0]),v.push(f[1]),l=f;else for(a=e.a2i(n),c=Math.floor(Math.max(0,Math.min(C-2,a))),u=a-c,b.length=C,b.crossLength=N,b.xy=function(t){return e.evalxy([],a,t)},b.dxy=function(t,r){return e.dxydj([],c,t,u,r)},i=0;i<N;i++)o=Math.min(N-2,i),s=i-o,f=e.evalxy([],a,i),T.smoothing&&i>0&&(m=e.dxydj([],c,i-1,u,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=e.dxydj([],c,i-1,u,1),y.push(f[0]-g[0]/3),v.push(f[1]-g[1]/3)),y.push(f[0]),v.push(f[1]),l=f;return b.axisLetter=t,b.axis=x,b.crossAxis=T,b.value=n,b.constvar=r,b.index=p,b.x=y,b.y=v,b.smoothing=T.smoothing,b}function P(n){var a,i,o,s,l,c=[],u=[],f={};if(f.length=b.length,f.crossLength=D.length,"b"===t)for(o=Math.max(0,Math.min(N-2,n)),l=Math.min(1,Math.max(0,n-o)),f.xy=function(t){return e.evalxy([],t,n)},f.dxy=function(t,r){return e.dxydi([],t,o,r,l)},a=0;a<M;a++)c[a]=A[n*O][a],u[a]=S[n*O][a];else for(i=Math.max(0,Math.min(C-2,n)),s=Math.min(1,Math.max(0,n-i)),f.xy=function(t){return e.evalxy([],n,t)},f.dxy=function(t,r){return e.dxydj([],i,t,s,r)},a=0;a<E;a++)c[a]=A[a][n*O],u[a]=S[a][n*O];return f.axisLetter=t,f.axis=x,f.crossAxis=T,f.value=b[n],f.constvar=r,f.index=n,f.x=c,f.y=u,f.smoothing=T.smoothing,f}if("array"===x.tickmode){for(l=5e-15,u=(c=[Math.floor((b.length-1-x.arraytick0)/x.arraydtick*(1+l)),Math.ceil(-x.arraytick0/x.arraydtick/(1+l))].sort((function(e,t){return e-t})))[0]-1,f=c[1]+1,p=u;p<f;p++)(o=x.arraytick0+x.arraydtick*p)<0||o>b.length-1||_.push(a(P(o),{color:x.gridcolor,width:x.gridwidth}));for(p=u;p<f;p++)if(s=x.arraytick0+x.arraydtick*p,m=Math.min(s+x.arraydtick,b.length-1),!(s<0||s>b.length-1||m<0||m>b.length-1))for(g=b[s],y=b[m],i=0;i<x.minorgridcount;i++)(v=m-s)<=0||(d=g+(y-g)*(i+1)/(x.minorgridcount+1)*(x.arraydtick/v))<b[0]||d>b[b.length-1]||w.push(a(I(d),{color:x.minorgridcolor,width:x.minorgridwidth}));x.startline&&k.push(a(P(0),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&k.push(a(P(b.length-1),{color:x.endlinecolor,width:x.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((b[b.length-1]-x.tick0)/x.dtick*(1+l)),Math.ceil((b[0]-x.tick0)/x.dtick/(1+l))].sort((function(e,t){return e-t})))[0],f=c[1],p=u;p<=f;p++)h=x.tick0+x.dtick*p,_.push(a(I(h),{color:x.gridcolor,width:x.gridwidth}));for(p=u-1;p<f+1;p++)for(h=x.tick0+x.dtick*p,i=0;i<x.minorgridcount;i++)(d=h+x.dtick*(i+1)/(x.minorgridcount+1))<b[0]||d>b[b.length-1]||w.push(a(I(d),{color:x.minorgridcolor,width:x.minorgridwidth}));x.startline&&k.push(a(I(b[0]),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&k.push(a(I(b[b.length-1]),{color:x.endlinecolor,width:x.endlinewidth}))}}},{"../../lib/extend":493,"../../plots/cartesian/axes":554}],698:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib/extend").extendFlat;t.exports=function(e,t){var r,i,o,s=t._labels=[],l=t._gridlines;for(r=0;r<l.length;r++)o=l[r],-1!==["start","both"].indexOf(t.showticklabels)&&(i=n.tickText(t,o.value),a(i,{prefix:void 0,suffix:void 0,endAnchor:!0,xy:o.xy(0),dxy:o.dxy(0,0),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===r,isLast:r===l.length-1}),s.push(i)),-1!==["end","both"].indexOf(t.showticklabels)&&(i=n.tickText(t,o.value),a(i,{endAnchor:!1,xy:o.xy(o.crossLength-1),dxy:o.dxy(o.crossLength-2,1),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===r,isLast:r===l.length-1}),s.push(i))}},{"../../lib/extend":493,"../../plots/cartesian/axes":554}],699:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var a=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],l=Math.pow(a*a+i*i,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*a-l*l*o)*n,f=(c*c*i-l*l*s)*n,p=c*(l+c)*3,h=l*(l+c)*3;return[[t[0]+(p&&u/p),t[1]+(p&&f/p)],[t[0]-(h&&u/h),t[1]-(h&&f/h)]]}},{}],700:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r){var a,i,o,s,l,c,u=[],f=n(e)?e.length:e,p=n(t)?t.length:t,h=n(e)?e:null,d=n(t)?t:null;h&&(o=(h.length-1)/(h[h.length-1]-h[0])/(f-1)),d&&(s=(d.length-1)/(d[d.length-1]-d[0])/(p-1));var m=1/0,g=-1/0;for(i=0;i<p;i++)for(u[i]=[],l=d?(d[i]-d[0])*s:i/(p-1),a=0;a<f;a++)c=(h?(h[a]-h[0])*o:a/(f-1))-l*r,m=Math.min(c,m),g=Math.max(c,g),u[i][a]=c;var y=1/(g-m),v=-m*y;for(i=0;i<p;i++)for(a=0;a<f;a++)u[i][a]=y*u[i][a]+v;return u}},{"../../lib":503}],701:[function(e,t,r){"use strict";var n=e("./catmull_rom"),a=e("../../lib").ensureArray;function i(e,t,r){var n=-.5*r[0]+1.5*t[0],a=-.5*r[1]+1.5*t[1];return[(2*n+e[0])/3,(2*a+e[1])/3]}t.exports=function(e,t,r,o,s,l){var c,u,f,p,h,d,m,g,y,v,b=r[0].length,x=r.length,_=s?3*b-2:b,w=l?3*x-2:x;for(e=a(e,w),t=a(t,w),f=0;f<w;f++)e[f]=a(e[f],_),t[f]=a(t[f],_);for(u=0,p=0;u<x;u++,p+=l?3:1)for(h=e[p],d=t[p],m=r[u],g=o[u],c=0,f=0;c<b;c++,f+=s?3:1)h[f]=m[c],d[f]=g[c];if(s)for(u=0,p=0;u<x;u++,p+=l?3:1){for(c=1,f=3;c<b-1;c++,f+=3)y=n([r[u][c-1],o[u][c-1]],[r[u][c],o[u][c]],[r[u][c+1],o[u][c+1]],s),e[p][f-1]=y[0][0],t[p][f-1]=y[0][1],e[p][f+1]=y[1][0],t[p][f+1]=y[1][1];v=i([e[p][0],t[p][0]],[e[p][2],t[p][2]],[e[p][3],t[p][3]]),e[p][1]=v[0],t[p][1]=v[1],v=i([e[p][_-1],t[p][_-1]],[e[p][_-3],t[p][_-3]],[e[p][_-4],t[p][_-4]]),e[p][_-2]=v[0],t[p][_-2]=v[1]}if(l)for(f=0;f<_;f++){for(p=3;p<w-3;p+=3)y=n([e[p-3][f],t[p-3][f]],[e[p][f],t[p][f]],[e[p+3][f],t[p+3][f]],l),e[p-1][f]=y[0][0],t[p-1][f]=y[0][1],e[p+1][f]=y[1][0],t[p+1][f]=y[1][1];v=i([e[0][f],t[0][f]],[e[2][f],t[2][f]],[e[3][f],t[3][f]]),e[1][f]=v[0],t[1][f]=v[1],v=i([e[w-1][f],t[w-1][f]],[e[w-3][f],t[w-3][f]],[e[w-4][f],t[w-4][f]]),e[w-2][f]=v[0],t[w-2][f]=v[1]}if(s&&l)for(p=1;p<w;p+=(p+1)%3==0?2:1){for(f=3;f<_-3;f+=3)y=n([e[p][f-3],t[p][f-3]],[e[p][f],t[p][f]],[e[p][f+3],t[p][f+3]],s),e[p][f-1]=.5*(e[p][f-1]+y[0][0]),t[p][f-1]=.5*(t[p][f-1]+y[0][1]),e[p][f+1]=.5*(e[p][f+1]+y[1][0]),t[p][f+1]=.5*(t[p][f+1]+y[1][1]);v=i([e[p][0],t[p][0]],[e[p][2],t[p][2]],[e[p][3],t[p][3]]),e[p][1]=.5*(e[p][1]+v[0]),t[p][1]=.5*(t[p][1]+v[1]),v=i([e[p][_-1],t[p][_-1]],[e[p][_-3],t[p][_-3]],[e[p][_-4],t[p][_-4]]),e[p][_-2]=.5*(e[p][_-2]+v[0]),t[p][_-2]=.5*(t[p][_-2]+v[1])}return[e,t]}},{"../../lib":503,"./catmull_rom":699}],702:[function(e,t,r){"use strict";t.exports={RELATIVE_CULL_TOLERANCE:1e-6}},{}],703:[function(e,t,r){"use strict";t.exports=function(e,t,r){return t&&r?function(t,r,n,a,i){var o,s,l,c,u,f;t||(t=[]),r*=3,n*=3;var p=a*a,h=1-a,d=h*h,m=h*a*2,g=-3*d,y=3*(d-m),v=3*(m-p),b=3*p,x=i*i,_=x*i,w=1-i,k=w*w,D=k*w;for(f=0;f<e.length;f++)o=g*(u=e[f])[n][r]+y*u[n][r+1]+v*u[n][r+2]+b*u[n][r+3],s=g*u[n+1][r]+y*u[n+1][r+1]+v*u[n+1][r+2]+b*u[n+1][r+3],l=g*u[n+2][r]+y*u[n+2][r+1]+v*u[n+2][r+2]+b*u[n+2][r+3],c=g*u[n+3][r]+y*u[n+3][r+1]+v*u[n+3][r+2]+b*u[n+3][r+3],t[f]=D*o+3*(k*i*s+w*x*l)+_*c;return t}:t?function(t,r,n,a,i){var o,s,l,c;t||(t=[]),r*=3;var u=a*a,f=1-a,p=f*f,h=f*a*2,d=-3*p,m=3*(p-h),g=3*(h-u),y=3*u,v=1-i;for(l=0;l<e.length;l++)o=d*(c=e[l])[n][r]+m*c[n][r+1]+g*c[n][r+2]+y*c[n][r+3],s=d*c[n+1][r]+m*c[n+1][r+1]+g*c[n+1][r+2]+y*c[n+1][r+3],t[l]=v*o+i*s;return t}:r?function(t,r,n,a,i){var o,s,l,c,u,f;t||(t=[]),n*=3;var p=i*i,h=p*i,d=1-i,m=d*d,g=m*d;for(u=0;u<e.length;u++)o=(f=e[u])[n][r+1]-f[n][r],s=f[n+1][r+1]-f[n+1][r],l=f[n+2][r+1]-f[n+2][r],c=f[n+3][r+1]-f[n+3][r],t[u]=g*o+3*(m*i*s+d*p*l)+h*c;return t}:function(t,r,n,a,i){var o,s,l,c;t||(t=[]);var u=1-i;for(l=0;l<e.length;l++)o=(c=e[l])[n][r+1]-c[n][r],s=c[n+1][r+1]-c[n+1][r],t[l]=u*o+i*s;return t}}},{}],704:[function(e,t,r){"use strict";t.exports=function(e,t,r){return t&&r?function(t,r,n,a,i){var o,s,l,c,u,f;t||(t=[]),r*=3,n*=3;var p=a*a,h=p*a,d=1-a,m=d*d,g=m*d,y=i*i,v=1-i,b=v*v,x=v*i*2,_=-3*b,w=3*(b-x),k=3*(x-y),D=3*y;for(f=0;f<e.length;f++)o=_*(u=e[f])[n][r]+w*u[n+1][r]+k*u[n+2][r]+D*u[n+3][r],s=_*u[n][r+1]+w*u[n+1][r+1]+k*u[n+2][r+1]+D*u[n+3][r+1],l=_*u[n][r+2]+w*u[n+1][r+2]+k*u[n+2][r+2]+D*u[n+3][r+2],c=_*u[n][r+3]+w*u[n+1][r+3]+k*u[n+2][r+3]+D*u[n+3][r+3],t[f]=g*o+3*(m*a*s+d*p*l)+h*c;return t}:t?function(t,r,n,a,i){var o,s,l,c,u,f;t||(t=[]),r*=3;var p=i*i,h=p*i,d=1-i,m=d*d,g=m*d;for(u=0;u<e.length;u++)o=(f=e[u])[n+1][r]-f[n][r],s=f[n+1][r+1]-f[n][r+1],l=f[n+1][r+2]-f[n][r+2],c=f[n+1][r+3]-f[n][r+3],t[u]=g*o+3*(m*i*s+d*p*l)+h*c;return t}:r?function(t,r,n,a,i){var o,s,l,c;t||(t=[]),n*=3;var u=1-a,f=i*i,p=1-i,h=p*p,d=p*i*2,m=-3*h,g=3*(h-d),y=3*(d-f),v=3*f;for(l=0;l<e.length;l++)o=m*(c=e[l])[n][r]+g*c[n+1][r]+y*c[n+2][r]+v*c[n+3][r],s=m*c[n][r+1]+g*c[n+1][r+1]+y*c[n+2][r+1]+v*c[n+3][r+1],t[l]=u*o+a*s;return t}:function(t,r,n,a,i){var o,s,l,c;t||(t=[]);var u=1-a;for(l=0;l<e.length;l++)o=(c=e[l])[n+1][r]-c[n][r],s=c[n+1][r+1]-c[n][r+1],t[l]=u*o+a*s;return t}}},{}],705:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a){var i=t-2,o=r-2;return n&&a?function(t,r,n){var a,s,l,c,u,f;t||(t=[]);var p=Math.max(0,Math.min(Math.floor(r),i)),h=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-p)),m=Math.max(0,Math.min(1,n-h));p*=3,h*=3;var g=d*d,y=g*d,v=1-d,b=v*v,x=b*v,_=m*m,w=_*m,k=1-m,D=k*k,T=D*k;for(f=0;f<e.length;f++)a=x*(u=e[f])[h][p]+3*(b*d*u[h][p+1]+v*g*u[h][p+2])+y*u[h][p+3],s=x*u[h+1][p]+3*(b*d*u[h+1][p+1]+v*g*u[h+1][p+2])+y*u[h+1][p+3],l=x*u[h+2][p]+3*(b*d*u[h+2][p+1]+v*g*u[h+2][p+2])+y*u[h+2][p+3],c=x*u[h+3][p]+3*(b*d*u[h+3][p+1]+v*g*u[h+3][p+2])+y*u[h+3][p+3],t[f]=T*a+3*(D*m*s+k*_*l)+w*c;return t}:n?function(t,r,n){t||(t=[]);var a,s,l,c,u,f,p=Math.max(0,Math.min(Math.floor(r),i)),h=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-p)),m=Math.max(0,Math.min(1,n-h));p*=3;var g=d*d,y=g*d,v=1-d,b=v*v,x=b*v,_=1-m;for(u=0;u<e.length;u++)a=_*(f=e[u])[h][p]+m*f[h+1][p],s=_*f[h][p+1]+m*f[h+1][p+1],l=_*f[h][p+2]+m*f[h+1][p+1],c=_*f[h][p+3]+m*f[h+1][p+1],t[u]=x*a+3*(b*d*s+v*g*l)+y*c;return t}:a?function(t,r,n){t||(t=[]);var a,s,l,c,u,f,p=Math.max(0,Math.min(Math.floor(r),i)),h=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-p)),m=Math.max(0,Math.min(1,n-h));h*=3;var g=m*m,y=g*m,v=1-m,b=v*v,x=b*v,_=1-d;for(u=0;u<e.length;u++)a=_*(f=e[u])[h][p]+d*f[h][p+1],s=_*f[h+1][p]+d*f[h+1][p+1],l=_*f[h+2][p]+d*f[h+2][p+1],c=_*f[h+3][p]+d*f[h+3][p+1],t[u]=x*a+3*(b*m*s+v*g*l)+y*c;return t}:function(t,r,n){t||(t=[]);var a,s,l,c,u=Math.max(0,Math.min(Math.floor(r),i)),f=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-u)),h=Math.max(0,Math.min(1,n-f)),d=1-h,m=1-p;for(l=0;l<e.length;l++)a=m*(c=e[l])[f][u]+p*c[f][u+1],s=m*c[f+1][u]+p*c[f+1][u+1],t[l]=d*a+h*s;return t}}},{}],706:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./xy_defaults"),i=e("./ab_defaults"),o=e("./attributes"),s=e("../../components/color/attributes");t.exports=function(e,t,r,l){function c(r,a){return n.coerce(e,t,o,r,a)}t._clipPathId="clip"+t.uid+"carpet";var u=c("color",s.defaultLine);n.coerceFont(c,"font"),c("carpet"),i(e,t,l,c,u),t.a&&t.b?(t.a.length<3&&(t.aaxis.smoothing=0),t.b.length<3&&(t.baxis.smoothing=0),a(e,t,c)||(t.visible=!1),t._cheater&&c("cheaterslope")):t.visible=!1}},{"../../components/color/attributes":365,"../../lib":503,"./ab_defaults":689,"./attributes":691,"./xy_defaults":715}],707:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),plot:e("./plot"),calc:e("./calc"),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":568,"./attributes":691,"./calc":695,"./defaults":706,"./plot":712}],708:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r,n=e._fullData.length,a=0;a<n;a++){var i=e._fullData[a];if(i.index!==t.index&&"carpet"===i.type&&(r||(r=i),i.carpet===t.carpet))return i}return r}},{}],709:[function(e,t,r){"use strict";t.exports=function(e,t,r){if(0===e.length)return"";var n,a=[],i=r?3:1;for(n=0;n<e.length;n+=i)a.push(e[n]+","+t[n]),r&&n<e.length-i&&(a.push("C"),a.push([e[n+1]+","+t[n+1],e[n+2]+","+t[n+2]+" "].join(" ")));return a.join(r?"":"L")}},{}],710:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r){var a;for(n(e)?e.length>t.length&&(e=e.slice(0,t.length)):e=[],a=0;a<t.length;a++)e[a]=r(t[a]);return e}},{"../../lib":503}],711:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a,i){var o=a[0]*e.dpdx(t),s=a[1]*e.dpdy(r),l=1,c=1;if(i){var u=Math.sqrt(a[0]*a[0]+a[1]*a[1]),f=Math.sqrt(i[0]*i[0]+i[1]*i[1]),p=(a[0]*i[0]+a[1]*i[1])/u/f;c=Math.max(0,p)}var h=180*Math.atan2(s,o)/Math.PI;return h<-90?(h+=180,l=-l):h>90&&(h-=180,l=-l),{angle:h,flip:l,p:e.c2p(n,t,r),offsetMultplier:c}}},{}],712:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("./map_1d_array"),o=e("./makepath"),s=e("./orient_text"),l=e("../../lib/svg_text_utils"),c=e("../../lib"),u=c.strRotate,f=c.strTranslate,p=e("../../constants/alignment");function h(e,t,r,a,s,l){var c="const-"+s+"-lines",u=r.selectAll("."+c).data(l);u.enter().append("path").classed(c,!0).style("vector-effect","non-scaling-stroke"),u.each((function(r){var a=r,s=a.x,l=a.y,c=i([],s,e.c2p),u=i([],l,t.c2p),f="M"+o(c,u,a.smoothing);n.select(this).attr("d",f).style("stroke-width",a.width).style("stroke",a.color).style("fill","none")})),u.exit().remove()}function d(e,t,r,i,o,c,p,h){var d=c.selectAll("text."+h).data(p);d.enter().append("text").classed(h,!0);var m=0,g={};return d.each((function(o,c){var p;if("auto"===o.axis.tickangle)p=s(i,t,r,o.xy,o.dxy);else{var h=(o.axis.tickangle+180)*Math.PI/180;p=s(i,t,r,o.xy,[Math.cos(h),Math.sin(h)])}c||(g={angle:p.angle,flip:p.flip});var d=(o.endAnchor?-1:1)*p.flip,y=n.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(a.font,o.font).text(o.text).call(l.convertToTspans,e),v=a.bBox(this);y.attr("transform",f(p.p[0],p.p[1])+u(p.angle)+f(o.axis.labelpadding*d,.3*v.height)),m=Math.max(m,v.width+o.axis.labelpadding)})),d.exit().remove(),g.maxExtent=m,g}t.exports=function(e,t,r,a){var l=t.xaxis,u=t.yaxis,f=e._fullLayout._clips;c.makeTraceGroups(a,r,"trace").each((function(t){var r=n.select(this),a=t[0],p=a.trace,m=p.aaxis,g=p.baxis,v=c.ensureSingle(r,"g","minorlayer"),b=c.ensureSingle(r,"g","majorlayer"),x=c.ensureSingle(r,"g","boundarylayer"),_=c.ensureSingle(r,"g","labellayer");r.style("opacity",p.opacity),h(l,u,b,0,"a",m._gridlines),h(l,u,b,0,"b",g._gridlines),h(l,u,v,0,"a",m._minorgridlines),h(l,u,v,0,"b",g._minorgridlines),h(l,u,x,0,"a-boundary",m._boundarylines),h(l,u,x,0,"b-boundary",g._boundarylines);var w=d(e,l,u,p,0,_,m._labels,"a-label"),k=d(e,l,u,p,0,_,g._labels,"b-label");!function(e,t,r,n,a,i,o,l){var u,f,p,h,d=c.aggNums(Math.min,null,r.a),m=c.aggNums(Math.max,null,r.a),g=c.aggNums(Math.min,null,r.b),v=c.aggNums(Math.max,null,r.b);u=.5*(d+m),f=g,p=r.ab2xy(u,f,!0),h=r.dxyda_rough(u,f),void 0===o.angle&&c.extendFlat(o,s(r,a,i,p,r.dxydb_rough(u,f))),y(e,t,r,0,p,h,r.aaxis,a,i,o,"a-title"),u=d,f=.5*(g+v),p=r.ab2xy(u,f,!0),h=r.dxydb_rough(u,f),void 0===l.angle&&c.extendFlat(l,s(r,a,i,p,r.dxyda_rough(u,f))),y(e,t,r,0,p,h,r.baxis,a,i,l,"b-title")}(e,_,p,0,l,u,w,k),function(e,t,r,n,a){var s,l,u,f,p=r.select("#"+e._clipPathId);p.size()||(p=r.append("clipPath").classed("carpetclip",!0));var h=c.ensureSingle(p,"path","carpetboundary"),d=t.clipsegments,m=[];for(f=0;f<d.length;f++)s=d[f],l=i([],s.x,n.c2p),u=i([],s.y,a.c2p),m.push(o(l,u,s.bicubic));var g="M"+m.join("L")+"Z";p.attr("id",e._clipPathId),h.attr("d",g)}(p,a,f,l,u)}))};var m=p.LINE_SPACING,g=(1-p.MID_SHIFT)/m+1;function y(e,t,r,i,o,c,p,h,d,y,v){var b=[];p.title.text&&b.push(p.title.text);var x=t.selectAll("text."+v).data(b),_=y.maxExtent;x.enter().append("text").classed(v,!0),x.each((function(){var t=s(r,h,d,o,c);-1===["start","both"].indexOf(p.showticklabels)&&(_=0);var i=p.title.font.size;_+=i+p.title.offset;var v=(y.angle+(y.flip<0?180:0)-t.angle+450)%360,b=v>90&&v<270,x=n.select(this);x.text(p.title.text).call(l.convertToTspans,e),b&&(_=(-l.lineCount(x)+g)*m*i-_),x.attr("transform",f(t.p[0],t.p[1])+u(t.angle)+f(0,_)).attr("text-anchor","middle").call(a.font,p.title.font)})),x.exit().remove()}},{"../../components/drawing":388,"../../constants/alignment":471,"../../lib":503,"../../lib/svg_text_utils":529,"./makepath":709,"./map_1d_array":710,"./orient_text":711,"@plotly/d3":58}],713:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../lib/search").findBin,i=e("./compute_control_points"),o=e("./create_spline_evaluator"),s=e("./create_i_derivative_evaluator"),l=e("./create_j_derivative_evaluator");t.exports=function(e){var t=e._a,r=e._b,c=t.length,u=r.length,f=e.aaxis,p=e.baxis,h=t[0],d=t[c-1],m=r[0],g=r[u-1],y=t[t.length-1]-t[0],v=r[r.length-1]-r[0],b=y*n.RELATIVE_CULL_TOLERANCE,x=v*n.RELATIVE_CULL_TOLERANCE;h-=b,d+=b,m-=x,g+=x,e.isVisible=function(e,t){return e>h&&e<d&&t>m&&t<g},e.isOccluded=function(e,t){return e<h||e>d||t<m||t>g},e.setScale=function(){var t=e._x,r=e._y,n=i(e._xctrl,e._yctrl,t,r,f.smoothing,p.smoothing);e._xctrl=n[0],e._yctrl=n[1],e.evalxy=o([e._xctrl,e._yctrl],c,u,f.smoothing,p.smoothing),e.dxydi=s([e._xctrl,e._yctrl],f.smoothing,p.smoothing),e.dxydj=l([e._xctrl,e._yctrl],f.smoothing,p.smoothing)},e.i2a=function(e){var r=Math.max(0,Math.floor(e[0]),c-2),n=e[0]-r;return(1-n)*t[r]+n*t[r+1]},e.j2b=function(e){var t=Math.max(0,Math.floor(e[1]),c-2),n=e[1]-t;return(1-n)*r[t]+n*r[t+1]},e.ij2ab=function(t){return[e.i2a(t[0]),e.j2b(t[1])]},e.a2i=function(e){var r=Math.max(0,Math.min(a(e,t),c-2)),n=t[r],i=t[r+1];return Math.max(0,Math.min(c-1,r+(e-n)/(i-n)))},e.b2j=function(e){var t=Math.max(0,Math.min(a(e,r),u-2)),n=r[t],i=r[t+1];return Math.max(0,Math.min(u-1,t+(e-n)/(i-n)))},e.ab2ij=function(t){return[e.a2i(t[0]),e.b2j(t[1])]},e.i2c=function(t,r){return e.evalxy([],t,r)},e.ab2xy=function(n,a,i){if(!i&&(n<t[0]||n>t[c-1]|a<r[0]||a>r[u-1]))return[!1,!1];var o=e.a2i(n),s=e.b2j(a),l=e.evalxy([],o,s);if(i){var f,p,h,d,m=0,g=0,y=[];n<t[0]?(f=0,p=0,m=(n-t[0])/(t[1]-t[0])):n>t[c-1]?(f=c-2,p=1,m=(n-t[c-1])/(t[c-1]-t[c-2])):p=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),a<r[0]?(h=0,d=0,g=(a-r[0])/(r[1]-r[0])):a>r[u-1]?(h=u-2,d=1,g=(a-r[u-1])/(r[u-1]-r[u-2])):d=s-(h=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(e.dxydi(y,f,h,p,d),l[0]+=y[0]*m,l[1]+=y[1]*m),g&&(e.dxydj(y,f,h,p,d),l[0]+=y[0]*g,l[1]+=y[1]*g)}return l},e.c2p=function(e,t,r){return[t.c2p(e[0]),r.c2p(e[1])]},e.p2x=function(e,t,r){return[t.p2c(e[0]),r.p2c(e[1])]},e.dadi=function(e){var r=Math.max(0,Math.min(t.length-2,e));return t[r+1]-t[r]},e.dbdj=function(e){var t=Math.max(0,Math.min(r.length-2,e));return r[t+1]-r[t]},e.dxyda=function(t,r,n,a){var i=e.dxydi(null,t,r,n,a),o=e.dadi(t,n);return[i[0]/o,i[1]/o]},e.dxydb=function(t,r,n,a){var i=e.dxydj(null,t,r,n,a),o=e.dbdj(r,a);return[i[0]/o,i[1]/o]},e.dxyda_rough=function(t,r,n){var a=y*(n||.1),i=e.ab2xy(t+a,r,!0),o=e.ab2xy(t-a,r,!0);return[.5*(i[0]-o[0])/a,.5*(i[1]-o[1])/a]},e.dxydb_rough=function(t,r,n){var a=v*(n||.1),i=e.ab2xy(t,r+a,!0),o=e.ab2xy(t,r-a,!0);return[.5*(i[0]-o[0])/a,.5*(i[1]-o[1])/a]},e.dpdx=function(e){return e._m},e.dpdy=function(e){return e._m}}},{"../../lib/search":523,"./compute_control_points":701,"./constants":702,"./create_i_derivative_evaluator":703,"./create_j_derivative_evaluator":704,"./create_spline_evaluator":705}],714:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t,r){var a,i,o,s=[],l=[],c=e[0].length,u=e.length;function f(t,r){var n,a=0,i=0;return t>0&&void 0!==(n=e[r][t-1])&&(i++,a+=n),t<c-1&&void 0!==(n=e[r][t+1])&&(i++,a+=n),r>0&&void 0!==(n=e[r-1][t])&&(i++,a+=n),r<u-1&&void 0!==(n=e[r+1][t])&&(i++,a+=n),a/Math.max(1,i)}var p,h,d,m,g,y,v,b,x,_,w,k=0;for(a=0;a<c;a++)for(i=0;i<u;i++)void 0===e[i][a]&&(s.push(a),l.push(i),e[i][a]=f(a,i)),k=Math.max(k,Math.abs(e[i][a]));if(!s.length)return e;var D=0,T=0,A=s.length;do{for(D=0,o=0;o<A;o++){a=s[o],i=l[o];var S,M,E,C,N,O,I=0,P=0;0===a?(E=t[N=Math.min(c-1,2)],C=t[1],S=e[i][N],P+=(M=e[i][1])+(M-S)*(t[0]-C)/(C-E),I++):a===c-1&&(E=t[N=Math.max(0,c-3)],C=t[c-2],S=e[i][N],P+=(M=e[i][c-2])+(M-S)*(t[c-1]-C)/(C-E),I++),(0===a||a===c-1)&&i>0&&i<u-1&&(p=r[i+1]-r[i],P+=((h=r[i]-r[i-1])*e[i+1][a]+p*e[i-1][a])/(h+p),I++),0===i?(E=r[O=Math.min(u-1,2)],C=r[1],S=e[O][a],P+=(M=e[1][a])+(M-S)*(r[0]-C)/(C-E),I++):i===u-1&&(E=r[O=Math.max(0,u-3)],C=r[u-2],S=e[O][a],P+=(M=e[u-2][a])+(M-S)*(r[u-1]-C)/(C-E),I++),(0===i||i===u-1)&&a>0&&a<c-1&&(p=t[a+1]-t[a],P+=((h=t[a]-t[a-1])*e[i][a+1]+p*e[i][a-1])/(h+p),I++),I?P/=I:(d=t[a+1]-t[a],m=t[a]-t[a-1],b=(g=r[i+1]-r[i])*(y=r[i]-r[i-1])*(g+y),P=((v=d*m*(d+m))*(y*e[i+1][a]+g*e[i-1][a])+b*(m*e[i][a+1]+d*e[i][a-1]))/(b*(m+d)+v*(y+g))),D+=(_=(x=P-e[i][a])/k)*_,w=I?0:.85,e[i][a]+=x*(1+w)}D=Math.sqrt(D)}while(T++<100&&D>1e-5);return n.log("Smoother converged to",D,"after",T,"iterations"),e}},{"../../lib":503}],715:[function(e,t,r){"use strict";var n=e("../../lib").isArray1D;t.exports=function(e,t,r){var a=r("x"),i=a&&a.length,o=r("y"),s=o&&o.length;if(!i&&!s)return!1;if(t._cheater=!a,i&&!n(a)||s&&!n(o))t._length=null;else{var l=i?a.length:1/0;s&&(l=Math.min(l,o.length)),t.a&&t.a.length&&(l=Math.min(l,t.a.length)),t.b&&t.b.length&&(l=Math.min(l,t.b.length)),t._length=l}return!0}},{"../../lib":503}],716:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../scattergeo/attributes"),i=e("../../components/colorscale/attributes"),o=e("../../plots/attributes"),s=e("../../components/color/attributes").defaultLine,l=e("../../lib/extend").extendFlat,c=a.marker.line;t.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},a.geojson,{}),featureidkey:a.featureidkey,text:l({},a.text,{}),hovertext:l({},a.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":365,"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/template_attributes":633,"../scattergeo/attributes":968}],717:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,i=e("../../components/colorscale/calc"),o=e("../scatter/arrays_to_calcdata"),s=e("../scatter/calc_selection");function l(e){return e&&"string"==typeof e}t.exports=function(e,t){var r,c=t._length,u=new Array(c);r=t.geojson?function(e){return l(e)||n(e)}:l;for(var f=0;f<c;f++){var p=u[f]={},h=t.locations[f],d=t.z[f];r(h)&&n(d)?(p.loc=h,p.z=d):(p.loc=null,p.z=a),p.index=f}return o(u,t),i(e,t,{vals:t.z,containerStr:"",cLetter:"z"}),s(u,t),u}},{"../../components/colorscale/calc":374,"../../constants/numerical":479,"../scatter/arrays_to_calcdata":925,"../scatter/calc_selection":928,"fast-isnumeric":190}],718:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/colorscale/defaults"),i=e("./attributes");t.exports=function(e,t,r,o){function s(r,a){return n.coerce(e,t,i,r,a)}var l=s("locations"),c=s("z");if(l&&l.length&&n.isArrayOrTypedArray(c)&&c.length){t._length=Math.min(l.length,c.length);var u,f=s("geojson");("string"==typeof f&&""!==f||n.isPlainObject(f))&&(u="geojson-id"),"geojson-id"===s("locationmode",u)&&s("featureidkey"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),a(e,t,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(t,s)}else t.visible=!1}},{"../../components/colorscale/defaults":376,"../../lib":503,"./attributes":716}],719:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a){e.location=t.location,e.z=t.z;var i=n[a];return i.fIn&&i.fIn.properties&&(e.properties=i.fIn.properties),e.ct=i.ct,e}},{}],720:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("./attributes"),i=e("../../lib").fillText;t.exports=function(e,t,r){var o,s,l,c,u=e.cd,f=u[0].trace,p=e.subplot,h=[t,r],d=[t+360,r];for(s=0;s<u.length;s++)if(c=!1,(o=u[s])._polygons){for(l=0;l<o._polygons.length;l++)o._polygons[l].contains(h)&&(c=!c),o._polygons[l].contains(d)&&(c=!c);if(c)break}if(c&&o)return e.x0=e.x1=e.xa.c2p(o.ct),e.y0=e.y1=e.ya.c2p(o.ct),e.index=o.index,e.location=o.loc,e.z=o.z,e.zLabel=n.tickText(p.mockAxis,p.mockAxis.c2l(o.z),"hover").text,e.hovertemplate=o.hovertemplate,function(e,t,r){if(!t.hovertemplate){var n=r.hi||t.hoverinfo,o=String(r.loc),s="all"===n?a.hoverinfo.flags:n.split("+"),l=-1!==s.indexOf("name"),c=-1!==s.indexOf("location"),u=-1!==s.indexOf("z"),f=-1!==s.indexOf("text"),p=[];!l&&c?e.nameOverride=o:(l&&(e.nameOverride=t.name),c&&p.push(o)),u&&p.push(e.zLabel),f&&i(r,t,p),e.extraText=p.join("<br>")}}(e,f,o),[e]}},{"../../lib":503,"../../plots/cartesian/axes":554,"./attributes":716}],721:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"choropleth",basePlotModule:e("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":589,"../heatmap/colorbar":795,"./attributes":716,"./calc":717,"./defaults":718,"./event_data":719,"./hover":720,"./plot":722,"./select":723,"./style":724}],722:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../lib/geo_location_utils"),o=e("../../lib/topojson_utils").getTopojsonFeatures,s=e("../../plots/cartesian/autorange").findExtremes,l=e("./style").style;t.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],a=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?i.extractTraceFeature(e):o(r,a.topojson),f=[],p=[],h=0;h<c;h++){var d=e[h],m="geojson-id"===l?d.fOut:i.locationToFeature(l,d.loc,u);if(m){d.geojson=m,d.ct=m.properties.ct,d._polygons=i.feature2polygons(m);var g=i.computeBbox(m);f.push(g[0],g[2]),p.push(g[1],g[3])}else d.geojson=null}if("geojson"===n.fitbounds&&"geojson-id"===l){var y=i.computeBbox(i.getTraceGeojson(r));f=[y[0],y[2]],p=[y[1],y[3]]}var v={padded:!0};r._extremes.lon=s(n.lonaxis._ax,f,v),r._extremes.lat=s(n.lataxis._ax,p,v)},plot:function(e,t,r){var i=t.layers.backplot.select(".choroplethlayer");a.makeTraceGroups(i,r,"trace choropleth").each((function(t){var r=n.select(this).selectAll("path.choroplethlocation").data(a.identity);r.enter().append("path").classed("choroplethlocation",!0),r.exit().remove(),l(e,t)}))}}},{"../../lib":503,"../../lib/geo_location_utils":496,"../../lib/topojson_utils":532,"../../plots/cartesian/autorange":553,"./style":724,"@plotly/d3":58}],723:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,a,i,o,s=e.cd,l=e.xaxis,c=e.yaxis,u=[];if(!1===t)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)(a=(n=s[r]).ct)&&(i=l.c2p(a),o=c.c2p(a),t.contains([i,o],null,r,e)?(u.push({pointNumber:r,lon:a[0],lat:a[1]}),n.selected=1):n.selected=0);return u}},{}],724:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/color"),i=e("../../components/drawing"),o=e("../../components/colorscale");function s(e,t){var r=t[0].trace,s=t[0].node3.selectAll(".choroplethlocation"),l=r.marker||{},c=l.line||{},u=o.makeColorScaleFuncFromTrace(r);s.each((function(e){n.select(this).attr("fill",u(e.z)).call(a.stroke,e.mlc||c.color).call(i.dashLine,"",e.mlw||c.width||0).style("opacity",l.opacity)})),i.selectedPointStyle(s,r,e)}t.exports={style:function(e,t){t&&s(e,t)},styleOnSelect:function(e,t){var r=t[0].node3,n=t[0].trace;n.selectedpoints?i.selectedPointStyle(r.selectAll(".choroplethlocation"),n,e):s(e,t)}}},{"../../components/color":366,"../../components/colorscale":378,"../../components/drawing":388,"@plotly/d3":58}],725:[function(e,t,r){"use strict";var n=e("../choropleth/attributes"),a=e("../../components/colorscale/attributes"),i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../../plots/attributes"),s=e("../../lib/extend").extendFlat;t.exports=s({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:s({},n.featureidkey,{}),below:{valType:"string",editType:"plot"},text:n.text,hovertext:n.hovertext,marker:{line:{color:s({},n.marker.line.color,{editType:"plot"}),width:s({},n.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:s({},n.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:s({},n.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:s({},n.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:n.hoverinfo,hovertemplate:i({},{keys:["properties"]}),showlegend:s({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/template_attributes":633,"../choropleth/attributes":716}],726:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../components/colorscale"),o=e("../../components/drawing"),s=e("../../lib/geojson_utils").makeBlank,l=e("../../lib/geo_location_utils");function c(e){var t,r=e[0].trace,n=r._opts;if(r.selectedpoints){for(var i=o.makeSelectedPointStyleFns(r),s=0;s<e.length;s++){var l=e[s];l.fOut&&(l.fOut.properties.mo2=i.selectedOpacityFn(l))}t={type:"identity",property:"mo2"}}else t=a.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return a.extendFlat(n.fill.paint,{"fill-opacity":t}),a.extendFlat(n.line.paint,{"line-opacity":t}),n}t.exports={convert:function(e){var t=e[0].trace,r=!0===t.visible&&0!==t._length,o={layout:{visibility:"none"},paint:{}},u={layout:{visibility:"none"},paint:{}},f=t._opts={fill:o,line:u,geojson:s()};if(!r)return f;var p=l.extractTraceFeature(e);if(!p)return f;var h,d,m,g=i.makeColorScaleFuncFromTrace(t),y=t.marker,v=y.line||{};a.isArrayOrTypedArray(y.opacity)&&(h=function(e){var t=e.mo;return n(t)?+a.constrain(t,0,1):0}),a.isArrayOrTypedArray(v.color)&&(d=function(e){return e.mlc}),a.isArrayOrTypedArray(v.width)&&(m=function(e){return e.mlw});for(var b=0;b<e.length;b++){var x=e[b],_=x.fOut;if(_){var w=_.properties;w.fc=g(x.z),h&&(w.mo=h(x)),d&&(w.mlc=d(x)),m&&(w.mlw=m(x)),x.ct=w.ct,x._polygons=l.feature2polygons(_)}}var k=h?{type:"identity",property:"mo"}:y.opacity;return a.extendFlat(o.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":k}),a.extendFlat(u.paint,{"line-color":d?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":k}),o.layout.visibility="visible",u.layout.visibility="visible",f.geojson={type:"FeatureCollection",features:p},c(e),f},convertOnSelect:c}},{"../../components/colorscale":378,"../../components/drawing":388,"../../lib":503,"../../lib/geo_location_utils":496,"../../lib/geojson_utils":497,"fast-isnumeric":190}],727:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/colorscale/defaults"),i=e("./attributes");t.exports=function(e,t,r,o){function s(r,a){return n.coerce(e,t,i,r,a)}var l=s("locations"),c=s("z"),u=s("geojson");n.isArrayOrTypedArray(l)&&l.length&&n.isArrayOrTypedArray(c)&&c.length&&("string"==typeof u&&""!==u||n.isPlainObject(u))?(s("featureidkey"),t._length=Math.min(l.length,c.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),a(e,t,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(t,s)):t.visible=!1}},{"../../components/colorscale/defaults":376,"../../lib":503,"./attributes":725}],728:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),calc:e("../choropleth/calc"),plot:e("./plot"),hoverPoints:e("../choropleth/hover"),eventData:e("../choropleth/event_data"),selectPoints:e("../choropleth/select"),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.updateOnSelect(t)},getBelow:function(e,t){for(var r=t.getMapLayers(),n=r.length-2;n>=0;n--){var a=r[n].id;if("string"==typeof a&&0===a.indexOf("water"))for(var i=n+1;i<r.length;i++)if("string"==typeof(a=r[i].id)&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:e("../../plots/mapbox"),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}},{"../../plots/mapbox":613,"../choropleth/calc":717,"../choropleth/event_data":719,"../choropleth/hover":720,"../choropleth/select":723,"../heatmap/colorbar":795,"./attributes":725,"./defaults":727,"./plot":729}],729:[function(e,t,r){"use strict";var n=e("./convert").convert,a=e("./convert").convertOnSelect,i=e("../../plots/mapbox/constants").traceLayerPrefix;function o(e,t){this.type="choroplethmapbox",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["fill",i+t+"-fill"],["line",i+t+"-line"]],this.below=null}var s=o.prototype;s.update=function(e){this._update(n(e))},s.updateOnSelect=function(e){this._update(a(e))},s._update=function(e){var t=this.subplot,r=this.layerList,n=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(e.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(e,n),this.below=n);for(var a=0;a<r.length;a++){var i=r[a],o=i[0],s=i[1],l=e[o];t.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&t.setOptions(s,"setPaintProperty",l.paint)}},s._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,a=this.sourceId,i=0;i<n.length;i++){var o=n[i],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:a,layout:l.layout,paint:l.paint},t)}},s._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},s.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var r=t[0].trace,a=new o(e,r.uid),i=a.sourceId,s=n(t),l=a.below=e.belowLookup["trace-"+r.uid];return e.map.addSource(i,{type:"geojson",data:s.geojson}),a._addLayers(s,l),t[0].trace._glTrace=a,a}},{"../../plots/mapbox/constants":611,"./convert":726}],730:[function(e,t,r){"use strict";var n=e("../../components/colorscale/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../mesh3d/attributes"),s=e("../../plots/attributes"),l=e("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["norm"]}),uhoverformat:a("u",1),vhoverformat:a("v",1),whoverformat:a("w",1),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(e){c[e]=o[e]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,t.exports=c},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../mesh3d/attributes":867}],731:[function(e,t,r){"use strict";var n=e("../../components/colorscale/calc");t.exports=function(e,t){for(var r=t.u,a=t.v,i=t.w,o=Math.min(t.x.length,t.y.length,t.z.length,r.length,a.length,i.length),s=-1/0,l=1/0,c=0;c<o;c++){var u=r[c],f=a[c],p=i[c],h=Math.sqrt(u*u+f*f+p*p);s=Math.max(s,h),l=Math.min(l,h)}t._len=o,t._normMax=s,n(e,t,{vals:[l,s],containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":374}],732:[function(e,t,r){"use strict";var n=e("../../../stackgl_modules").gl_cone3d,a=e("../../../stackgl_modules").gl_cone3d.createConeMesh,i=e("../../lib").simpleMap,o=e("../../lib/gl_format_color").parseColorScale,s=e("../../components/colorscale").extractOpts,l=e("../../plots/gl3d/zip3");function c(e,t){this.scene=e,this.uid=t,this.mesh=null,this.data=null}var u=c.prototype;u.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index,r=this.data.x[t],n=this.data.y[t],a=this.data.z[t],i=this.data.u[t],o=this.data.v[t],s=this.data.w[t];e.traceCoordinate=[r,n,a,i,o,s,Math.sqrt(i*i+o*o+s*s)];var l=this.data.hovertext||this.data.text;return Array.isArray(l)&&void 0!==l[t]?e.textLabel=l[t]:l&&(e.textLabel=l),!0}};var f={xaxis:0,yaxis:1,zaxis:2},p={tip:1,tail:0,cm:.25,center:.5},h={tip:1,tail:1,cm:.75,center:.5};function d(e,t){var r=e.fullSceneLayout,a=e.dataScale,c={};function u(e,t){var n=r[t],o=a[f[t]];return i(e,(function(e){return n.d2l(e)*o}))}c.vectors=l(u(t.u,"xaxis"),u(t.v,"yaxis"),u(t.w,"zaxis"),t._len),c.positions=l(u(t.x,"xaxis"),u(t.y,"yaxis"),u(t.z,"zaxis"),t._len);var d=s(t);c.colormap=o(t),c.vertexIntensityBounds=[d.min/t._normMax,d.max/t._normMax],c.coneOffset=p[t.anchor],"scaled"===t.sizemode?c.coneSize=t.sizeref||.5:c.coneSize=t.sizeref&&t._normMax?t.sizeref/t._normMax:.5;var m=n(c),g=t.lightposition;return m.lightPosition=[g.x,g.y,g.z],m.ambient=t.lighting.ambient,m.diffuse=t.lighting.diffuse,m.specular=t.lighting.specular,m.roughness=t.lighting.roughness,m.fresnel=t.lighting.fresnel,m.opacity=t.opacity,t._pad=h[t.anchor]*m.vectorScale*m.coneScale*t._normMax,m}u.update=function(e){this.data=e;var t=d(this.scene,e);this.mesh.update(t)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var r=e.glplot.gl,n=d(e,t),i=a(r,n),o=new c(e,t.uid);return o.mesh=i,o.data=t,i._trace=o,e.glplot.add(i),o}},{"../../../stackgl_modules":1120,"../../components/colorscale":378,"../../lib":503,"../../lib/gl_format_color":499,"../../plots/gl3d/zip3":609}],733:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/colorscale/defaults"),i=e("./attributes");t.exports=function(e,t,r,o){function s(r,a){return n.coerce(e,t,i,r,a)}var l=s("u"),c=s("v"),u=s("w"),f=s("x"),p=s("y"),h=s("z");l&&l.length&&c&&c.length&&u&&u.length&&f&&f.length&&p&&p.length&&h&&h.length?(s("sizeref"),s("sizemode"),s("anchor"),s("lighting.ambient"),s("lighting.diffuse"),s("lighting.specular"),s("lighting.roughness"),s("lighting.fresnel"),s("lightposition.x"),s("lightposition.y"),s("lightposition.z"),a(e,t,o,s,{prefix:"",cLetter:"c"}),s("text"),s("hovertext"),s("hovertemplate"),s("uhoverformat"),s("vhoverformat"),s("whoverformat"),s("xhoverformat"),s("yhoverformat"),s("zhoverformat"),t._length=null):t.visible=!1}},{"../../components/colorscale/defaults":376,"../../lib":503,"./attributes":730}],734:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"cone",basePlotModule:e("../../plots/gl3d"),categories:["gl3d","showLegend"],attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:{min:"cmin",max:"cmax"},calc:e("./calc"),plot:e("./convert"),eventData:function(e,t){return e.norm=t.traceCoordinate[6],e},meta:{}}},{"../../plots/gl3d":598,"./attributes":730,"./calc":731,"./convert":732,"./defaults":733}],735:[function(e,t,r){"use strict";var n=e("../heatmap/attributes"),a=e("../scatter/attributes"),i=e("../../plots/cartesian/axis_format_attributes"),o=i.axisHoverFormat,s=i.descriptionOnlyNumbers,l=e("../../components/colorscale/attributes"),c=e("../../components/drawing/attributes").dash,u=e("../../plots/font_attributes"),f=e("../../lib/extend").extendFlat,p=e("../../constants/filter_ops"),h=p.COMPARISON_OPS2,d=p.INTERVAL_OPS,m=a.line;t.exports=f({z:n.z,x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,text:n.text,hovertext:n.hovertext,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:n.hovertemplate,texttemplate:f({},n.texttemplate,{}),textfont:f({},n.textfont,{}),hoverongaps:n.hoverongaps,connectgaps:f({},n.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:u({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:s("contour label")},operation:{valType:"enumerated",values:[].concat(h).concat(d),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:f({},m.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:c,smoothing:f({},m.smoothing,{}),editType:"plot"}},l("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":373,"../../components/drawing/attributes":387,"../../constants/filter_ops":475,"../../lib/extend":493,"../../plots/cartesian/axis_format_attributes":557,"../../plots/font_attributes":585,"../heatmap/attributes":792,"../scatter/attributes":926}],736:[function(e,t,r){"use strict";var n=e("../../components/colorscale"),a=e("../heatmap/calc"),i=e("./set_contours"),o=e("./end_plus");t.exports=function(e,t){var r=a(e,t),s=r[0].z;i(t,s);var l,c=t.contours,u=n.extractOpts(t);if("heatmap"===c.coloring&&u.auto&&!1===t.autocontour){var f=c.start,p=o(c),h=c.size||1,d=Math.floor((p-f)/h)+1;isFinite(h)||(h=1,d=1);var m=f-h/2;l=[m,m+d*h]}else l=s;return n.calc(e,t,{vals:l,cLetter:"z"}),r}},{"../../components/colorscale":378,"../heatmap/calc":793,"./end_plus":746,"./set_contours":754}],737:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n=e[0],a=n.z;switch(t.type){case"levels":var i=Math.min(a[0][0],a[0][1]);for(r=0;r<e.length;r++){var o=e[r];o.prefixBoundary=!o.edgepaths.length&&(i>o.level||o.starts.length&&i===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r<l;r++)u=Math.min(u,a[r][0]),u=Math.min(u,a[r][s-1]),c=Math.max(c,a[r][0]),c=Math.max(c,a[r][s-1]);for(r=1;r<s-1;r++)u=Math.min(u,a[0][r]),u=Math.min(u,a[l-1][r]),c=Math.max(c,a[0][r]),c=Math.max(c,a[l-1][r]);var f,p,h=t.value;switch(t._operation){case">":h>c&&(n.prefixBoundary=!0);break;case"<":(h<u||n.starts.length&&h===u)&&(n.prefixBoundary=!0);break;case"[]":f=Math.min(h[0],h[1]),((p=Math.max(h[0],h[1]))<u||f>c||n.starts.length&&p===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(h[0],h[1]),p=Math.max(h[0],h[1]),f<u&&p>c&&(n.prefixBoundary=!0)}}}},{}],738:[function(e,t,r){"use strict";var n=e("../../components/colorscale"),a=e("./make_color_map"),i=e("./end_plus");t.exports={min:"zmin",max:"zmax",calc:function(e,t,r){var o=t.contours,s=t.line,l=o.size||1,c=o.coloring,u=a(t,{isColorbar:!0});if("heatmap"===c){var f=n.extractOpts(t);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:i(o),size:l}}}},{"../../components/colorscale":378,"./end_plus":746,"./make_color_map":751}],739:[function(e,t,r){"use strict";t.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],740:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./label_defaults"),i=e("../../components/color"),o=i.addOpacity,s=i.opacity,l=e("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;t.exports=function(e,t,r,i,l,f){var p,h,d,m=t.contours,g=r("contours.operation");m._operation=c[g],function(e,t){var r;-1===u.indexOf(t.operation)?(e("contours.value",[0,1]),Array.isArray(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e("contours.value",0),n(t.value)||(Array.isArray(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(r,m),"="===g?p=m.showlines=!0:(p=r("contours.showlines"),d=r("fillcolor",o((e.line||{}).color||l,.5))),p&&(h=r("line.color",d&&s(d)?o(t.fillcolor,1):l),r("line.width",2),r("line.dash")),r("line.smoothing"),a(r,i,h,f)}},{"../../components/color":366,"../../constants/filter_ops":475,"./label_defaults":750,"fast-isnumeric":190}],741:[function(e,t,r){"use strict";var n=e("../../constants/filter_ops"),a=e("fast-isnumeric");function i(e,t){var r,i=Array.isArray(t);function o(e){return a(e)?+e:null}return-1!==n.COMPARISON_OPS2.indexOf(e)?r=o(i?t[0]:t):-1!==n.INTERVAL_OPS.indexOf(e)?r=i?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==n.SET_OPS.indexOf(e)&&(r=i?t.map(o):[o(t)]),r}function o(e){return function(t){t=i(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function s(e){return function(t){return{start:t=i(e,t),end:1/0,size:1/0}}}t.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":475,"fast-isnumeric":190}],742:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,s=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],743:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}t.exports=function(e,t){var r,i,o,s=function(e){return e.reverse()},l=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&n.warn("Contour data invalid for the specified inequality operation."),i=e[0],r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=s(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=s(i.paths[r]);for(r=0;r<i.starts.length;r++)i.starts[r]=s(i.starts[r]);return e;case"][":var c=s;s=l,l=c;case"[]":for(2!==e.length&&n.warn("Contour data invalid for the specified inequality range operation."),i=a(e[0]),o=a(e[1]),r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=s(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=s(i.paths[r]);for(r=0;r<i.starts.length;r++)i.starts[r]=s(i.starts[r]);for(;o.edgepaths.length;)i.edgepaths.push(l(o.edgepaths.shift()));for(;o.paths.length;)i.paths.push(l(o.paths.shift()));for(;o.starts.length;)i.starts.push(l(o.starts.shift()));return[i]}}},{"../../lib":503}],744:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../heatmap/xyz_defaults"),i=e("../scatter/period_defaults"),o=e("./constraint_defaults"),s=e("./contours_defaults"),l=e("./style_defaults"),c=e("../heatmap/label_defaults"),u=e("./attributes");t.exports=function(e,t,r,f){function p(r,a){return n.coerce(e,t,u,r,a)}if(a(e,t,p,f)){i(e,t,f,p),p("xhoverformat"),p("yhoverformat"),p("text"),p("hovertext"),p("hoverongaps"),p("hovertemplate");var h="constraint"===p("contours.type");p("connectgaps",n.isArray1D(t.z)),h?o(e,t,p,f,r):(s(e,t,p,(function(r){return n.coerce2(e,t,u,r)})),l(e,t,p,f)),t.contours&&"heatmap"===t.contours.coloring&&c(p,f)}else t.visible=!1}},{"../../lib":503,"../heatmap/label_defaults":802,"../heatmap/xyz_defaults":807,"../scatter/period_defaults":946,"./attributes":735,"./constraint_defaults":740,"./contours_defaults":742,"./style_defaults":756}],745:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./constraint_mapping"),i=e("./end_plus");t.exports=function(e,t,r){for(var o="constraint"===e.type?a[e._operation](e.value):e,s=o.size,l=[],c=i(o),u=r.trace._carpetTrace,f=u?{xaxis:u.aaxis,yaxis:u.baxis,x:r.a,y:r.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:r.x,y:r.y},p=o.start;p<c;p+=s)if(l.push(n.extendFlat({level:p,crossings:{},starts:[],edgepaths:[],paths:[],z:r.z,smoothing:r.trace.line.smoothing},f)),l.length>1e3){n.warn("Too many contours, clipping at 1000",e);break}return l}},{"../../lib":503,"./constraint_mapping":741,"./end_plus":746}],746:[function(e,t,r){"use strict";t.exports=function(e){return e.end+e.size/1e6}},{}],747:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./constants");function i(e,t,r,n){return Math.abs(e[0]-t[0])<r&&Math.abs(e[1]-t[1])<n}function o(e,t,r,o,l){var c,u=t.join(","),f=e.crossings[u],p=function(e,t,r){var n=0,i=0;return e>20&&t?208===e||1114===e?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(e)?i=1:-1!==a.LEFTSTART.indexOf(e)?n=1:-1!==a.TOPSTART.indexOf(e)?i=-1:n=-1,[n,i]}(f,r,t),h=[s(e,t,[-p[0],-p[1]])],d=e.z.length,m=e.z[0].length,g=t.slice(),y=p.slice();for(c=0;c<1e4;c++){if(f>20?(f=a.CHOOSESADDLE[f][(p[0]||p[1])<0?0:1],e.crossings[u]=a.SADDLEREMAINDER[f]):delete e.crossings[u],!(p=a.NEWDELTA[f])){n.log("Found bad marching index:",f,t,e.level);break}h.push(s(e,t,p)),t[0]+=p[0],t[1]+=p[1],u=t.join(","),i(h[h.length-1],h[h.length-2],o,l)&&h.pop();var v=p[0]&&(t[0]<0||t[0]>m-2)||p[1]&&(t[1]<0||t[1]>d-2);if(t[0]===g[0]&&t[1]===g[1]&&p[0]===y[0]&&p[1]===y[1]||r&&v)break;f=e.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var b,x,_,w,k,D,T,A,S,M,E,C,N,O,I,P=i(h[0],h[h.length-1],o,l),R=0,L=.2*e.smoothing,F=[],B=0;for(c=1;c<h.length;c++)C=h[c],N=h[c-1],void 0,void 0,O=C[2]-N[2],I=C[3]-N[3],R+=T=Math.sqrt(O*O+I*I),F.push(T);var z=R/F.length*L;function j(e){return h[e%h.length]}for(c=h.length-2;c>=B;c--)if((b=F[c])<z){for(_=0,x=c-1;x>=B&&b+F[x]<z;x--)b+=F[x];if(P&&c===h.length-2)for(_=0;_<x&&b+F[_]<z;_++)b+=F[_];k=c-x+_+1,D=Math.floor((c+x+_+2)/2),w=P||c!==h.length-2?P||-1!==x?k%2?j(D):[(j(D)[0]+j(D+1)[0])/2,(j(D)[1]+j(D+1)[1])/2]:h[0]:h[h.length-1],h.splice(x+1,c-x+1,w),c=x+1,_&&(B=_),P&&(c===h.length-2?h[_]=h[h.length-1]:0===c&&(h[h.length-1]=h[0]))}for(h.splice(0,B),c=0;c<h.length;c++)h[c].length=2;if(!(h.length<2))if(P)h.pop(),e.paths.push(h);else{r||n.log("Unclosed interior contour?",e.level,g.join(","),h.join("L"));var U=!1;for(A=0;A<e.edgepaths.length;A++)if(M=e.edgepaths[A],!U&&i(M[0],h[h.length-1],o,l)){h.pop(),U=!0;var $=!1;for(S=0;S<e.edgepaths.length;S++)if(i((E=e.edgepaths[S])[E.length-1],h[0],o,l)){$=!0,h.shift(),e.edgepaths.splice(A,1),S===A?e.paths.push(h.concat(E)):(S>A&&S--,e.edgepaths[S]=E.concat(h,M));break}$||(e.edgepaths[A]=h.concat(M))}for(A=0;A<e.edgepaths.length&&!U;A++)i((M=e.edgepaths[A])[M.length-1],h[0],o,l)&&(h.shift(),e.edgepaths[A]=M.concat(h),U=!0);U||e.edgepaths.push(h)}}function s(e,t,r){var n=t[0]+Math.max(r[0],0),a=t[1]+Math.max(r[1],0),i=e.z[a][n],o=e.xaxis,s=e.yaxis;if(r[1]){var l=(e.level-i)/(e.z[a][n+1]-i),c=(1!==l?(1-l)*o.c2l(e.x[n]):0)+(0!==l?l*o.c2l(e.x[n+1]):0);return[o.c2p(o.l2c(c),!0),s.c2p(e.y[a],!0),n+l,a]}var u=(e.level-i)/(e.z[a+1][n]-i),f=(1!==u?(1-u)*s.c2l(e.y[a]):0)+(0!==u?u*s.c2l(e.y[a+1]):0);return[o.c2p(e.x[n],!0),s.c2p(s.l2c(f),!0),n,a+u]}t.exports=function(e,t,r){var a,i,s,l;for(t=t||.01,r=r||.01,i=0;i<e.length;i++){for(s=e[i],l=0;l<s.starts.length;l++)o(s,s.starts[l],"edge",t,r);for(a=0;Object.keys(s.crossings).length&&a<1e4;)a++,o(s,Object.keys(s.crossings)[0].split(",").map(Number),void 0,t,r);1e4===a&&n.log("Infinite loop in contour?")}}},{"../../lib":503,"./constants":739}],748:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../heatmap/hover");t.exports=function(e,t,r,i,o){o||(o={}),o.isContour=!0;var s=a(e,t,r,i,o);return s&&s.forEach((function(e){var t=e.trace;"constraint"===t.contours.type&&(t.fillcolor&&n.opacity(t.fillcolor)?e.color=n.addOpacity(t.fillcolor,1):t.contours.showlines&&n.opacity(t.line.color)&&(e.color=n.addOpacity(t.line.color,1)))})),s}},{"../../components/color":366,"../heatmap/hover":799}],749:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot").plot,style:e("./style"),colorbar:e("./colorbar"),hoverPoints:e("./hover"),moduleType:"trace",name:"contour",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}},{"../../plots/cartesian":568,"./attributes":735,"./calc":736,"./colorbar":738,"./defaults":744,"./hover":748,"./plot":753,"./style":755}],750:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t,r,a){if(a||(a={}),e("contours.showlabels")){var i=t.font;n.coerceFont(e,"contours.labelfont",{family:i.family,size:i.size,color:r}),e("contours.labelformat")}!1!==a.hasHover&&e("zhoverformat")}},{"../../lib":503}],751:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/colorscale"),i=e("./end_plus");t.exports=function(e){var t=e.contours,r=t.start,o=i(t),s=t.size||1,l=Math.floor((o-r)/s)+1,c="lines"===t.coloring?0:1,u=a.extractOpts(e);isFinite(s)||(s=1,l=1);var f,p,h=u.reversescale?a.flipScale(u.colorscale):u.colorscale,d=h.length,m=new Array(d),g=new Array(d);if("heatmap"===t.coloring){var y=u.min,v=u.max;for(p=0;p<d;p++)f=h[p],m[p]=f[0]*(v-y)+y,g[p]=f[1];var b=n.extent([y,v,t.start,t.start+s*(l-1)]),x=b[y<v?0:1],_=b[y<v?1:0];x!==y&&(m.splice(0,0,x),g.splice(0,0,g[0])),_!==v&&(m.push(_),g.push(g[g.length-1]))}else for(p=0;p<d;p++)f=h[p],m[p]=(f[0]*(l+c-1)-c/2)*s+r,g[p]=f[1];return a.makeColorScaleFunc({domain:m,range:g},{noNumericCheck:!0})}},{"../../components/colorscale":378,"./end_plus":746,"@plotly/d3":58}],752:[function(e,t,r){"use strict";var n=e("./constants");function a(e,t){var r=(t[0][0]>e?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}t.exports=function(e){var t,r,i,o,s,l,c,u,f,p=e[0].z,h=p.length,d=p[0].length,m=2===h||2===d;for(r=0;r<h-1;r++)for(o=[],0===r&&(o=o.concat(n.BOTTOMSTART)),r===h-2&&(o=o.concat(n.TOPSTART)),t=0;t<d-1;t++)for(i=o.slice(),0===t&&(i=i.concat(n.LEFTSTART)),t===d-2&&(i=i.concat(n.RIGHTSTART)),s=t+","+r,l=[[p[r][t],p[r][t+1]],[p[r+1][t],p[r+1][t+1]]],f=0;f<e.length;f++)(c=a((u=e[f]).level,l))&&(u.crossings[s]=c,-1!==i.indexOf(c)&&(u.starts.push([t,r]),m&&-1!==i.indexOf(c,i.indexOf(c)+1)&&u.starts.push([t,r])))}},{"./constants":739}],753:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../../components/colorscale"),s=e("../../lib/svg_text_utils"),l=e("../../plots/cartesian/axes"),c=e("../../plots/cartesian/set_convert"),u=e("../heatmap/plot"),f=e("./make_crossings"),p=e("./find_all_paths"),h=e("./empty_pathinfo"),d=e("./convert_to_constraints"),m=e("./close_boundaries"),g=e("./constants"),y=g.LABELOPTIMIZER;function v(e,t){var r,n,o,s,l,c,u,f="",p=0,h=e.edgepaths.map((function(e,t){return t})),d=!0;function m(e){return Math.abs(e[1]-t[2][1])<.01}function g(e){return Math.abs(e[0]-t[0][0])<.01}function y(e){return Math.abs(e[0]-t[2][0])<.01}for(;h.length;){for(c=i.smoothopen(e.edgepaths[p],e.smoothing),f+=d?c:c.replace(/^M/,"L"),h.splice(h.indexOf(p),1),r=e.edgepaths[p][e.edgepaths[p].length-1],s=-1,o=0;o<4;o++){if(!r){a.log("Missing end?",p,e);break}for(u=r,Math.abs(u[1]-t[0][1])<.01&&!y(r)?n=t[1]:g(r)?n=t[0]:m(r)?n=t[3]:y(r)&&(n=t[2]),l=0;l<e.edgepaths.length;l++){var v=e.edgepaths[l][0];Math.abs(r[0]-n[0])<.01?Math.abs(r[0]-v[0])<.01&&(v[1]-r[1])*(n[1]-v[1])>=0&&(n=v,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-v[1])<.01&&(v[0]-r[0])*(n[0]-v[0])>=0&&(n=v,s=l):a.log("endpt to newendpt is not vert. or horz.",r,n,v)}if(r=n,s>=0)break;f+="L"+n}if(s===e.edgepaths.length){a.log("unclosed perimeter path");break}p=s,(d=-1===h.indexOf(p))&&(p=h[0],f+="Z")}for(p=0;p<e.paths.length;p++)f+=i.smoothclosed(e.paths[p],e.smoothing);return f}function b(e,t,r,n){var i=t.width/2,o=t.height/2,s=e.x,l=e.y,c=e.theta,u=Math.cos(c)*i,f=Math.sin(c)*i,p=(s>n.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),h=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*o);if(p<1||h<1)return 1/0;var d=y.EDGECOST*(1/(p-1)+1/(h-1));d+=y.ANGLECOST*c*c;for(var m=s-u,g=l-f,v=s+u,b=l+f,x=0;x<r.length;x++){var _=r[x],w=Math.cos(_.theta)*_.width/2,k=Math.sin(_.theta)*_.width/2,D=2*a.segmentDistance(m,g,v,b,_.x-w,_.y-k,_.x+w,_.y+k)/(t.height+_.height),T=_.level===t.level,A=T?y.SAMELEVELDISTANCE:1;if(D<=A)return 1/0;d+=y.NEIGHBORCOST*(T?y.SAMELEVELFACTOR:1)/(D-A)}return d}function x(e){var t,r,n=e.trace._emptypoints,a=[],i=e.z.length,o=e.z[0].length,s=[];for(t=0;t<o;t++)s.push(1);for(t=0;t<i;t++)a.push(s.slice());for(t=0;t<n.length;t++)a[(r=n[t])[0]][r[1]]=0;return e.zmask=a,a}r.plot=function(e,t,o,s){var l=t.xaxis,c=t.yaxis;a.makeTraceGroups(s,o,"contour").each((function(o){var s=n.select(this),y=o[0],b=y.trace,_=y.x,w=y.y,k=b.contours,D=h(k,t,y),T=a.ensureSingle(s,"g","heatmapcoloring"),A=[];"heatmap"===k.coloring&&(A=[o]),u(e,t,A,T),f(D),p(D);var S=l.c2p(_[0],!0),M=l.c2p(_[_.length-1],!0),E=c.c2p(w[0],!0),C=c.c2p(w[w.length-1],!0),N=[[S,C],[M,C],[M,E],[S,E]],O=D;"constraint"===k.type&&(O=d(D,k._operation)),function(e,t,r){var n=a.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"===r.coloring?[0]:[]);n.enter().append("path"),n.exit().remove(),n.attr("d","M"+t.join("L")+"Z").style("stroke","none")}(s,N,k),function(e,t,r,i){var o="fill"===i.coloring||"constraint"===i.type&&"="!==i._operation,s="M"+r.join("L")+"Z";o&&m(t,i);var l=a.ensureSingle(e,"g","contourfill").selectAll("path").data(o?t:[]);l.enter().append("path"),l.exit().remove(),l.each((function(e){var t=(e.prefixBoundary?s:"")+v(e,r);t?n.select(this).attr("d",t).style("stroke","none"):n.select(this).remove()}))}(s,O,N,k),function(e,t,o,s,l){var c=a.ensureSingle(e,"g","contourlines"),u=!1!==l.showlines,f=l.showlabels,p=u&&f,h=r.createLines(c,u||f,t),d=r.createLineClip(c,p,o,s.trace.uid),m=e.selectAll("g.contourlabels").data(f?[0]:[]);if(m.exit().remove(),m.enter().append("g").classed("contourlabels",!0),f){var y=[],v=[];a.clearLocationCache();var b=r.labelFormatter(o,s),x=i.tester.append("text").attr("data-notex",1).call(i.font,l.labelfont),_=t[0].xaxis,w=t[0].yaxis,k=_._length,D=w._length,T=_.range,A=w.range,S=a.aggNums(Math.min,null,s.x),M=a.aggNums(Math.max,null,s.x),E=a.aggNums(Math.min,null,s.y),C=a.aggNums(Math.max,null,s.y),N=Math.max(_.c2p(S,!0),0),O=Math.min(_.c2p(M,!0),k),I=Math.max(w.c2p(C,!0),0),P=Math.min(w.c2p(E,!0),D),R={};T[0]<T[1]?(R.left=N,R.right=O):(R.left=O,R.right=N),A[0]<A[1]?(R.top=I,R.bottom=P):(R.top=P,R.bottom=I),R.middle=(R.top+R.bottom)/2,R.center=(R.left+R.right)/2,y.push([[R.left,R.top],[R.right,R.top],[R.right,R.bottom],[R.left,R.bottom]]);var L=Math.sqrt(k*k+D*D),F=g.LABELDISTANCE*L/Math.max(1,t.length/g.LABELINCREASE);h.each((function(e){var t=r.calcTextOpts(e.level,b,x,o);n.select(this).selectAll("path").each((function(){var e=a.getVisibleSegment(this,R,t.height/2);if(e&&!(e.len<(t.width+t.height)*g.LABELMIN))for(var n=Math.min(Math.ceil(e.len/F),g.LABELMAX),i=0;i<n;i++){var o=r.findBestTextLocation(this,e,t,v,R);if(!o)break;r.addLabelData(o,t,v,y)}}))})),x.remove(),r.drawLabels(m,v,o,d,p?y:null)}f&&!u&&h.remove()}(s,D,e,y,k),function(e,t,r,n,o){var s=n.trace,l=r._fullLayout._clips,c="clip"+s.uid,u=l.selectAll("#"+c).data(s.connectgaps?[]:[0]);if(u.enter().append("clipPath").classed("contourclip",!0).attr("id",c),u.exit().remove(),!1===s.connectgaps){var h={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:t.xaxis,yaxis:t.yaxis,x:n.x,y:n.y,z:x(n),smoothing:0};f([h]),p([h]),m([h],{type:"levels"}),a.ensureSingle(u,"path","").attr("d",(h.prefixBoundary?"M"+o.join("L")+"Z":"")+v(h,o))}else c=null;i.setClipUrl(e,c,r)}(s,t,e,y,N)}))},r.createLines=function(e,t,r){var n=r[0].smoothing,a=e.selectAll("g.contourlevel").data(t?r:[]);if(a.exit().remove(),a.enter().append("g").classed("contourlevel",!0),t){var o=a.selectAll("path.openline").data((function(e){return e.pedgepaths||e.edgepaths}));o.exit().remove(),o.enter().append("path").classed("openline",!0),o.attr("d",(function(e){return i.smoothopen(e,n)})).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke");var s=a.selectAll("path.closedline").data((function(e){return e.ppaths||e.paths}));s.exit().remove(),s.enter().append("path").classed("closedline",!0),s.attr("d",(function(e){return i.smoothclosed(e,n)})).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke")}return a},r.createLineClip=function(e,t,r,n){var a=t?"clipline"+n:null,o=r._fullLayout._clips.selectAll("#"+a).data(t?[0]:[]);return o.exit().remove(),o.enter().append("clipPath").classed("contourlineclip",!0).attr("id",a),i.setClipUrl(e,a,r),o},r.labelFormatter=function(e,t){var r=e._fullLayout,n=t.trace,a=n.contours,i={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"};if(a.labelformat)i.tickformat=a.labelformat,c(i,r);else{var s=o.extractOpts(n);if(s&&s.colorbar&&s.colorbar._axis)i=s.colorbar._axis;else{if("constraint"===a.type){var u=a.value;Array.isArray(u)?i.range=[u[0],u[u.length-1]]:i.range=[u,u]}else i.range=[a.start,a.end],i.nticks=(a.end-a.start)/a.size;i.range[0]===i.range[1]&&(i.range[1]+=i.range[0]||1),i.nticks||(i.nticks=1e3),c(i,r),l.prepTicks(i),i._tmin=null,i._tmax=null}}return function(e){return l.tickText(i,e).text}},r.calcTextOpts=function(e,t,r,n){var a=t(e);r.text(a).call(s.convertToTspans,n);var o=r.node(),l=i.bBox(o,!0);return{text:a,width:l.width,height:l.height,fontSize:+o.style["font-size"].replace("px",""),level:e,dy:(l.top+l.bottom)/2}},r.findBestTextLocation=function(e,t,r,n,i){var o,s,l,c,u,f=r.width;t.isClosed?(s=t.len/y.INITIALSEARCHPOINTS,o=t.min+s/2,l=t.max):(s=(t.len-f)/(y.INITIALSEARCHPOINTS+1),o=t.min+s+f/2,l=t.max-(s+f)/2);for(var p=1/0,h=0;h<y.ITERATIONS;h++){for(var d=o;d<l;d+=s){var m=a.getTextLocation(e,t.total,d,f),g=b(m,r,n,i);g<p&&(p=g,u=m,c=d)}if(p>2*y.MAXCOST)break;h&&(s/=2),l=(o=c-s/2)+1.5*s}if(p<=y.MAXCOST)return u},r.addLabelData=function(e,t,r,n){var a=t.fontSize,i=t.width+a/3,o=Math.max(0,t.height-a/3),s=e.x,l=e.y,c=e.theta,u=Math.sin(c),f=Math.cos(c),p=function(e,t){return[s+e*f-t*u,l+e*u+t*f]},h=[p(-i/2,-o/2),p(-i/2,o/2),p(i/2,o/2),p(i/2,-o/2)];r.push({text:t.text,x:s,y:l,dy:t.dy,theta:c,level:t.level,width:i,height:o}),n.push(h)},r.drawLabels=function(e,t,r,i,o){var l=e.selectAll("text").data(t,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var t=e.x+Math.sin(e.theta)*e.dy,a=e.y-Math.cos(e.theta)*e.dy;n.select(this).text(e.text).attr({x:t,y:a,transform:"rotate("+180*e.theta/Math.PI+" "+t+" "+a+")"}).call(s.convertToTspans,r)})),o){for(var c="",u=0;u<o.length;u++)c+="M"+o[u].join("L")+"Z";a.ensureSingle(i,"path","").attr("d",c)}}},{"../../components/colorscale":378,"../../components/drawing":388,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"../../plots/cartesian/set_convert":576,"../heatmap/plot":804,"./close_boundaries":737,"./constants":739,"./convert_to_constraints":743,"./empty_pathinfo":745,"./find_all_paths":747,"./make_crossings":752,"@plotly/d3":58}],754:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib");function i(e,t,r){var a={type:"linear",range:[e,t]};return n.autoTicks(a,(t-e)/(r||15)),a}t.exports=function(e,t){var r=e.contours;if(e.autocontour){var o=e.zmin,s=e.zmax;(e.zauto||void 0===o)&&(o=a.aggNums(Math.min,null,t)),(e.zauto||void 0===s)&&(s=a.aggNums(Math.max,null,t));var l=i(o,s,e.ncontours);r.size=l.dtick,r.start=n.tickFirst(l),l.range.reverse(),r.end=n.tickFirst(l),r.start===o&&(r.start+=r.size),r.end===s&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),a.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,f=r.end,p=e._input.contours;u>f&&(r.start=p.start=f,f=r.end=p.end=u,u=r.start),r.size>0||(c=u===f?1:i(u,f,e.ncontours).dtick,p.size=r.size=c)}}},{"../../lib":503,"../../plots/cartesian/axes":554}],755:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../heatmap/style"),o=e("./make_color_map");t.exports=function(e){var t=n.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=n.select(this),r=e[0].trace,i=r.contours,s=r.line,l=i.size||1,c=i.start,u="constraint"===i.type,f=!u&&"lines"===i.coloring,p=!u&&"fill"===i.coloring,h=f||p?o(r):null;t.selectAll("g.contourlevel").each((function(e){n.select(this).selectAll("path").call(a.lineGroupStyle,s.width,f?h(e.level):s.color,s.dash)}));var d=i.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){a.font(n.select(this),{family:d.family,size:d.size,color:d.color||(f?h(e.level):s.color)})})),u)t.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(p){var m;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===m&&(m=e.level),h(e.level+.5*l)})),void 0===m&&(m=c),t.selectAll("g.contourbg path").style("fill",h(m-.5*l))}})),i(e)}},{"../../components/drawing":388,"../heatmap/style":805,"./make_color_map":751,"@plotly/d3":58}],756:[function(e,t,r){"use strict";var n=e("../../components/colorscale/defaults"),a=e("./label_defaults");t.exports=function(e,t,r,i,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":376,"./label_defaults":750}],757:[function(e,t,r){"use strict";var n=e("../heatmap/attributes"),a=e("../contour/attributes"),i=e("../../components/colorscale/attributes"),o=e("../../lib/extend").extendFlat,s=a.contours;t.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:a.fillcolor,autocontour:a.autocontour,ncontours:a.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:a.line.color,width:a.line.width,dash:a.line.dash,smoothing:a.line.smoothing,editType:"plot"},transforms:void 0},i("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../contour/attributes":735,"../heatmap/attributes":792}],758:[function(e,t,r){"use strict";var n=e("../../components/colorscale/calc"),a=e("../../lib"),i=e("../heatmap/convert_column_xyz"),o=e("../heatmap/clean_2d_array"),s=e("../heatmap/interp2d"),l=e("../heatmap/find_empties"),c=e("../heatmap/make_bound_array"),u=e("./defaults"),f=e("../carpet/lookup_carpetid"),p=e("../contour/set_contours");t.exports=function(e,t){var r=t._carpetTrace=f(e,t);if(r&&r.visible&&"legendonly"!==r.visible){if(!t.a||!t.b){var h=e.data[r.index],d=e.data[t.index];d.a||(d.a=h.a),d.b||(d.b=h.b),u(d,t,t._defaultColor,e._fullLayout)}var m=function(e,t){var r,u,f,p,h,d,m,g=t._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,a.isArray1D(t.z)&&i(t,y,v,"a","b",["z"]),r=t._a=t._a||t.a,p=t._b=t._b||t.b,r=r?y.makeCalcdata(t,"_a"):[],p=p?v.makeCalcdata(t,"_b"):[],u=t.a0||0,f=t.da||1,h=t.b0||0,d=t.db||1,m=t._z=o(t._z||t.z,t.transpose),t._emptypoints=l(m),s(m,t._emptypoints);var b=a.maxRowLength(m),x="scaled"===t.xtype?"":r,_=c(t,x,u,f,b,y),w="scaled"===t.ytype?"":p,k={a:_,b:c(t,w,h,d,m.length,v),z:m};return"levels"===t.contours.type&&"none"!==t.contours.coloring&&n(e,t,{vals:m,containerStr:"",cLetter:"z"}),[k]}(e,t);return p(t,t._z),m}}},{"../../components/colorscale/calc":374,"../../lib":503,"../carpet/lookup_carpetid":708,"../contour/set_contours":754,"../heatmap/clean_2d_array":794,"../heatmap/convert_column_xyz":796,"../heatmap/find_empties":798,"../heatmap/interp2d":801,"../heatmap/make_bound_array":803,"./defaults":759}],759:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../heatmap/xyz_defaults"),i=e("./attributes"),o=e("../contour/constraint_defaults"),s=e("../contour/contours_defaults"),l=e("../contour/style_defaults");t.exports=function(e,t,r,c){function u(r,a){return n.coerce(e,t,i,r,a)}if(u("carpet"),e.a&&e.b){if(!a(e,t,u,c,"a","b"))return void(t.visible=!1);u("text"),"constraint"===u("contours.type")?o(e,t,u,c,r,{hasHover:!1}):(s(e,t,u,(function(r){return n.coerce2(e,t,i,r)})),l(e,t,u,c,{hasHover:!1}))}else t._defaultColor=r,t._length=null}},{"../../lib":503,"../contour/constraint_defaults":740,"../contour/contours_defaults":742,"../contour/style_defaults":756,"../heatmap/xyz_defaults":807,"./attributes":757}],760:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../contour/colorbar"),calc:e("./calc"),plot:e("./plot"),style:e("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":568,"../contour/colorbar":738,"../contour/style":755,"./attributes":757,"./calc":758,"./defaults":759,"./plot":761}],761:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../carpet/map_1d_array"),i=e("../carpet/makepath"),o=e("../../components/drawing"),s=e("../../lib"),l=e("../contour/make_crossings"),c=e("../contour/find_all_paths"),u=e("../contour/plot"),f=e("../contour/constants"),p=e("../contour/convert_to_constraints"),h=e("../contour/empty_pathinfo"),d=e("../contour/close_boundaries"),m=e("../carpet/lookup_carpetid"),g=e("../carpet/axis_aligned_line");function y(e,t,r){var n=e.getPointAtLength(t),a=e.getPointAtLength(r),i=a.x-n.x,o=a.y-n.y,s=Math.sqrt(i*i+o*o);return[i/s,o/s]}function v(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}function b(e,t){var r=Math.abs(e[0]*t[0]+e[1]*t[1]);return Math.sqrt(1-r*r)/r}t.exports=function(e,t,r,x){var _=t.xaxis,w=t.yaxis;s.makeTraceGroups(x,r,"contour").each((function(r){var x=n.select(this),k=r[0],D=k.trace,T=D._carpetTrace=m(e,D),A=e.calcdata[T.index][0];if(T.visible&&"legendonly"!==T.visible){var S=k.a,M=k.b,E=D.contours,C=h(E,t,k),N="constraint"===E.type,O=E._operation,I=N?"="===O?"lines":"fill":E.coloring,P=[[S[0],M[M.length-1]],[S[S.length-1],M[M.length-1]],[S[S.length-1],M[0]],[S[0],M[0]]];l(C);var R=1e-8*(S[S.length-1]-S[0]),L=1e-8*(M[M.length-1]-M[0]);c(C,R,L);var F,B,z,j,U=C;"constraint"===E.type&&(U=p(C,O)),function(e,t){var r,n,a,i,o,s,l,c,u;for(r=0;r<e.length;r++){for(o=(i=e[r]).pedgepaths=[],s=i.ppaths=[],n=0;n<i.edgepaths.length;n++){for(u=i.edgepaths[n],l=[],a=0;a<u.length;a++)l[a]=t(u[a]);o.push(l)}for(n=0;n<i.paths.length;n++){for(u=i.paths[n],c=[],a=0;a<u.length;a++)c[a]=t(u[a]);s.push(c)}}}(C,q);var $=[];for(j=A.clipsegments.length-1;j>=0;j--)F=A.clipsegments[j],B=a([],F.x,_.c2p),z=a([],F.y,w.c2p),B.reverse(),z.reverse(),$.push(i(B,z,F.bicubic));var V="M"+$.join("L")+"Z";!function(e,t,r,n,o,l){var c,u,f,p,h=s.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);h.enter().append("path"),h.exit().remove();var d=[];for(p=0;p<t.length;p++)c=t[p],u=a([],c.x,r.c2p),f=a([],c.y,n.c2p),d.push(i(u,f,c.bicubic));h.attr("d","M"+d.join("L")+"Z").style("stroke","none")}(x,A.clipsegments,_,w,N,I),function(e,t,r,a,i,l,c,u,f,p,h){var m="fill"===p;m&&d(i,e.contours);var y=s.ensureSingle(t,"g","contourfill").selectAll("path").data(m?i:[]);y.enter().append("path"),y.exit().remove(),y.each((function(e){var t=(e.prefixBoundary?h:"")+function(e,t,r,n,a,i,l,c){var u,f,p,h,d,m,y,v="",b=t.edgepaths.map((function(e,t){return t})),x=!0,_=1e-4*Math.abs(r[0][0]-r[2][0]),w=1e-4*Math.abs(r[0][1]-r[2][1]);function k(e){return Math.abs(e[1]-r[0][1])<w}function D(e){return Math.abs(e[1]-r[2][1])<w}function T(e){return Math.abs(e[0]-r[0][0])<_}function A(e){return Math.abs(e[0]-r[2][0])<_}function S(e,t){var r,n,o,s,u="";for(k(e)&&!A(e)||D(e)&&!T(e)?(s=a.aaxis,o=g(a,i,[e[0],t[0]],.5*(e[1]+t[1]))):(s=a.baxis,o=g(a,i,.5*(e[0]+t[0]),[e[1],t[1]])),r=1;r<o.length;r++)for(u+=s.smoothing?"C":"L",n=0;n<o[r].length;n++){var f=o[r][n];u+=[l.c2p(f[0]),c.c2p(f[1])]+" "}return u}for(u=0,f=null;b.length;){var M=t.edgepaths[u][0];for(f&&(v+=S(f,M)),y=o.smoothopen(t.edgepaths[u].map(n),t.smoothing),v+=x?y:y.replace(/^M/,"L"),b.splice(b.indexOf(u),1),f=t.edgepaths[u][t.edgepaths[u].length-1],d=-1,h=0;h<4;h++){if(!f){s.log("Missing end?",u,t);break}for(k(f)&&!A(f)?p=r[1]:T(f)?p=r[0]:D(f)?p=r[3]:A(f)&&(p=r[2]),m=0;m<t.edgepaths.length;m++){var E=t.edgepaths[m][0];Math.abs(f[0]-p[0])<_?Math.abs(f[0]-E[0])<_&&(E[1]-f[1])*(p[1]-E[1])>=0&&(p=E,d=m):Math.abs(f[1]-p[1])<w?Math.abs(f[1]-E[1])<w&&(E[0]-f[0])*(p[0]-E[0])>=0&&(p=E,d=m):s.log("endpt to newendpt is not vert. or horz.",f,p,E)}if(d>=0)break;v+=S(f,p),f=p}if(d===t.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(x=-1===b.indexOf(u))&&(u=b[0],v+=S(f,p)+"Z",f=null)}for(u=0;u<t.paths.length;u++)v+=o.smoothclosed(t.paths[u].map(n),t.smoothing);return v}(0,e,l,c,u,f,r,a);t?n.select(this).attr("d",t).style("stroke","none"):n.select(this).remove()}))}(D,x,_,w,U,P,q,T,A,I,V),function(e,t,r,a,i,l,c){var p=s.ensureSingle(e,"g","contourlines"),h=!1!==i.showlines,d=i.showlabels,m=h&&d,g=u.createLines(p,h||d,t),x=u.createLineClip(p,m,r,a.trace.uid),_=e.selectAll("g.contourlabels").data(d?[0]:[]);if(_.exit().remove(),_.enter().append("g").classed("contourlabels",!0),d){var w=l.xaxis,k=l.yaxis,D=w._length,T=k._length,A=[[[0,0],[D,0],[D,T],[0,T]]],S=[];s.clearLocationCache();var M=u.labelFormatter(r,a),E=o.tester.append("text").attr("data-notex",1).call(o.font,i.labelfont),C={left:0,right:D,center:D/2,top:0,bottom:T,middle:T/2},N=Math.sqrt(D*D+T*T),O=f.LABELDISTANCE*N/Math.max(1,t.length/f.LABELINCREASE);g.each((function(e){var t=u.calcTextOpts(e.level,M,E,r);n.select(this).selectAll("path").each((function(r){var n=s.getVisibleSegment(this,C,t.height/2);if(n&&(function(e,t,r,n,a,i){for(var o,s=0;s<r.pedgepaths.length;s++)t===r.pedgepaths[s]&&(o=r.edgepaths[s]);if(o){var l=a.a[0],c=a.a[a.a.length-1],u=a.b[0],f=a.b[a.b.length-1],p=y(e,0,1),h=y(e,n.total,n.total-1),d=g(o[0],p),m=n.total-g(o[o.length-1],h);n.min<d&&(n.min=d),n.max>m&&(n.max=m),n.len=n.max-n.min}function g(e,t){var r,n=0;return(Math.abs(e[0]-l)<.1||Math.abs(e[0]-c)<.1)&&(r=v(a.dxydb_rough(e[0],e[1],.1)),n=Math.max(n,i*b(t,r)/2)),(Math.abs(e[1]-u)<.1||Math.abs(e[1]-f)<.1)&&(r=v(a.dxyda_rough(e[0],e[1],.1)),n=Math.max(n,i*b(t,r)/2)),n}}(this,r,e,n,c,t.height),!(n.len<(t.width+t.height)*f.LABELMIN)))for(var a=Math.min(Math.ceil(n.len/O),f.LABELMAX),i=0;i<a;i++){var o=u.findBestTextLocation(this,n,t,S,C);if(!o)break;u.addLabelData(o,t,S,A)}}))})),E.remove(),u.drawLabels(_,S,r,x,m?A:null)}d&&!h&&g.remove()}(x,C,e,k,E,t,T),o.setClipUrl(x,T._clipPathId,e)}function q(e){var t=T.ab2xy(e[0],e[1],!0);return[_.c2p(t[0]),w.c2p(t[1])]}}))}},{"../../components/drawing":388,"../../lib":503,"../carpet/axis_aligned_line":692,"../carpet/lookup_carpetid":708,"../carpet/makepath":709,"../carpet/map_1d_array":710,"../contour/close_boundaries":737,"../contour/constants":739,"../contour/convert_to_constraints":743,"../contour/empty_pathinfo":745,"../contour/find_all_paths":747,"../contour/make_crossings":752,"../contour/plot":753,"@plotly/d3":58}],762:[function(e,t,r){"use strict";var n=e("../../components/colorscale/attributes"),a=e("../../plots/template_attributes").hovertemplateAttrs,i=e("../../plots/attributes"),o=e("../scattermapbox/attributes"),s=e("../../lib/extend").extendFlat;t.exports=s({lon:o.lon,lat:o.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:o.text,hovertext:o.hovertext,hoverinfo:s({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:a(),showlegend:s({},i.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/template_attributes":633,"../scattermapbox/attributes":991}],763:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib").isArrayOrTypedArray,i=e("../../constants/numerical").BADNUM,o=e("../../components/colorscale/calc"),s=e("../../lib")._;t.exports=function(e,t){for(var r=t._length,l=new Array(r),c=t.z,u=a(c)&&c.length,f=0;f<r;f++){var p=l[f]={},h=t.lon[f],d=t.lat[f];if(p.lonlat=n(h)&&n(d)?[+h,+d]:[i,i],u){var m=c[f];p.z=n(m)?m:i}}return o(e,t,{vals:u?c:[0,1],containerStr:"",cLetter:"z"}),r&&(l[0].t={labels:{lat:s(e,"lat:")+" ",lon:s(e,"lon:")+" "}}),l}},{"../../components/colorscale/calc":374,"../../constants/numerical":479,"../../lib":503,"fast-isnumeric":190}],764:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../components/color"),o=e("../../components/colorscale"),s=e("../../constants/numerical").BADNUM,l=e("../../lib/geojson_utils").makeBlank;t.exports=function(e){var t=e[0].trace,r=!0===t.visible&&0!==t._length,c=t._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:l()};if(!r)return c;var u,f=[],p=t.z,h=t.radius,d=a.isArrayOrTypedArray(p)&&p.length,m=a.isArrayOrTypedArray(h);for(u=0;u<e.length;u++){var g=e[u],y=g.lonlat;if(y[0]!==s){var v={};if(d){var b=g.z;v.z=b!==s?b:0}m&&(v.r=n(h[u])&&h[u]>0?+h[u]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var x=o.extractOpts(t),_=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=_[0][1],k=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<_.length;u++)k.push(_[u][0],_[u][1]);var D=["interpolate",["linear"],["get","z"],x.min,0,x.max,1];return a.extendFlat(c.heatmap.paint,{"heatmap-weight":d?D:1/(x.max-x.min),"heatmap-color":k,"heatmap-radius":m?{type:"identity",property:"r"}:t.radius,"heatmap-opacity":t.opacity}),c.geojson={type:"FeatureCollection",features:f},c.heatmap.layout.visibility="visible",c}},{"../../components/color":366,"../../components/colorscale":378,"../../constants/numerical":479,"../../lib":503,"../../lib/geojson_utils":497,"fast-isnumeric":190}],765:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/colorscale/defaults"),i=e("./attributes");t.exports=function(e,t,r,o){function s(r,a){return n.coerce(e,t,i,r,a)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(t._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),a(e,t,o,s,{prefix:"",cLetter:"z"})):t.visible=!1}},{"../../components/colorscale/defaults":376,"../../lib":503,"./attributes":762}],766:[function(e,t,r){"use strict";t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}},{}],767:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../scattermapbox/hover").hoverPoints,i=e("../scattermapbox/hover").getExtraText;t.exports=function(e,t,r){var o=a(e,t,r);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var f=s.subplot.mockAxis;s.z=u.z,s.zLabel=n.tickText(f,f.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}},{"../../plots/cartesian/axes":554,"../scattermapbox/hover":996}],768:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),formatLabels:e("../scattermapbox/format_labels"),calc:e("./calc"),plot:e("./plot"),hoverPoints:e("./hover"),eventData:e("./event_data"),getBelow:function(e,t){for(var r=t.getMapLayers(),n=0;n<r.length;n++){var a=r[n],i=a.id;if("symbol"===a.type&&"string"==typeof i&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"densitymapbox",basePlotModule:e("../../plots/mapbox"),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}},{"../../plots/mapbox":613,"../heatmap/colorbar":795,"../scattermapbox/format_labels":995,"./attributes":762,"./calc":763,"./defaults":765,"./event_data":766,"./hover":767,"./plot":769}],769:[function(e,t,r){"use strict";var n=e("./convert"),a=e("../../plots/mapbox/constants").traceLayerPrefix;function i(e,t){this.type="densitymapbox",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",a+t+"-heatmap"]],this.below=null}var o=i.prototype;o.update=function(e){var t=this.subplot,r=this.layerList,a=n(e),i=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(a.geojson),i!==this.below&&(this._removeLayers(),this._addLayers(a,i),this.below=i);for(var o=0;o<r.length;o++){var s=r[o],l=s[0],c=s[1],u=a[l];t.setOptions(c,"setLayoutProperty",u.layout),"visible"===u.layout.visibility&&t.setOptions(c,"setPaintProperty",u.paint)}},o._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,a=this.sourceId,i=0;i<n.length;i++){var o=n[i],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:a,layout:l.layout,paint:l.paint},t)}},o._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var r=t[0].trace,a=new i(e,r.uid),o=a.sourceId,s=n(t),l=a.below=e.belowLookup["trace-"+r.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}},{"../../plots/mapbox/constants":611,"./convert":764}],770:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r<e.length;r++)e[r].i=r;n.mergeArray(t.text,e,"tx"),n.mergeArray(t.hovertext,e,"htx");var a=t.marker;if(a){n.mergeArray(a.opacity,e,"mo"),n.mergeArray(a.color,e,"mc");var i=a.line;i&&(n.mergeArray(i.color,e,"mlc"),n.mergeArrayCastPositive(i.width,e,"mlw"))}}},{"../../lib":503}],771:[function(e,t,r){"use strict";var n,a=e("../bar/attributes"),i=e("../scatter/attributes").line,o=e("../../plots/attributes"),s=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,l=e("../../plots/template_attributes").hovertemplateAttrs,c=e("../../plots/template_attributes").texttemplateAttrs,u=e("./constants"),f=e("../../lib/extend").extendFlat,p=e("../../components/color");t.exports={x:a.x,x0:a.x0,dx:a.dx,y:a.y,y0:a.y0,dy:a.dy,xperiod:a.xperiod,yperiod:a.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:a.xperiodalignment,yperiodalignment:a.yperiodalignment,xhoverformat:s("x"),yhoverformat:s("y"),hovertext:a.hovertext,hovertemplate:l({},{keys:u.eventDataKeys}),hoverinfo:f({},o.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:c({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),text:a.text,textposition:a.textposition,insidetextanchor:f({},a.insidetextanchor,{dflt:"middle"}),textangle:f({},a.textangle,{dflt:0}),textfont:a.textfont,insidetextfont:a.insidetextfont,outsidetextfont:a.outsidetextfont,constraintext:a.constraintext,cliponaxis:a.cliponaxis,orientation:f({},a.orientation,{}),offset:f({},a.offset,{arrayOk:!1}),width:f({},a.width,{arrayOk:!1}),marker:(n=f({},a.marker),delete n.pattern,n),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:f({},i.color,{dflt:p.defaultLine}),width:f({},i.width,{dflt:0,editType:"plot"}),dash:i.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup}},{"../../components/color":366,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../bar/attributes":648,"../scatter/attributes":926,"./constants":773}],772:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../plots/cartesian/align_period"),i=e("./arrays_to_calcdata"),o=e("../scatter/calc_selection"),s=e("../../constants/numerical").BADNUM;function l(e){return e===s?0:e}t.exports=function(e,t){var r,c,u,f,p,h,d,m,g=n.getFromId(e,t.xaxis||"x"),y=n.getFromId(e,t.yaxis||"y");"h"===t.orientation?(r=g.makeCalcdata(t,"x"),u=y.makeCalcdata(t,"y"),f=a(t,y,"y",u),p=!!t.yperiodalignment,h="y"):(r=y.makeCalcdata(t,"y"),u=g.makeCalcdata(t,"x"),f=a(t,g,"x",u),p=!!t.xperiodalignment,h="x"),c=f.vals;var v,b=Math.min(c.length,r.length),x=new Array(b);for(t._base=[],d=0;d<b;d++){r[d]<0&&(r[d]=s);var _=!1;r[d]!==s&&d+1<b&&r[d+1]!==s&&(_=!0),m=x[d]={p:c[d],s:r[d],cNext:_},t._base[d]=-.5*m.s,p&&(x[d].orig_p=u[d],x[d][h+"End"]=f.ends[d],x[d][h+"Start"]=f.starts[d]),t.ids&&(m.id=String(t.ids[d])),0===d&&(x[0].vTotal=0),x[0].vTotal+=l(m.s),m.begR=l(m.s)/l(x[0].s)}for(d=0;d<b;d++)(m=x[d]).s!==s&&(m.sumR=m.s/x[0].vTotal,m.difR=void 0!==v?m.s/v:1,v=m.s);return i(x,t),o(x,t),x}},{"../../constants/numerical":479,"../../plots/cartesian/align_period":551,"../../plots/cartesian/axes":554,"../scatter/calc_selection":928,"./arrays_to_calcdata":770}],773:[function(e,t,r){"use strict";t.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}},{}],774:[function(e,t,r){"use strict";var n=e("../bar/cross_trace_calc").setGroupPositions;t.exports=function(e,t){var r,a,i=e._fullLayout,o=e._fullData,s=e.calcdata,l=t.xaxis,c=t.yaxis,u=[],f=[],p=[];for(a=0;a<o.length;a++){var h=o[a],d="h"===h.orientation;!0===h.visible&&h.xaxis===l._id&&h.yaxis===c._id&&"funnel"===h.type&&(r=s[a],d?p.push(r):f.push(r),u.push(r))}var m={mode:i.funnelmode,norm:i.funnelnorm,gap:i.funnelgap,groupgap:i.funnelgroupgap};for(n(e,l,c,f,m),n(e,c,l,p,m),a=0;a<u.length;a++){r=u[a];for(var g=0;g<r.length;g++)g+1<r.length&&(r[g].nextP0=r[g+1].p0,r[g].nextS0=r[g+1].s0,r[g].nextP1=r[g+1].p1,r[g].nextS1=r[g+1].s1)}}},{"../bar/cross_trace_calc":651}],775:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../bar/defaults").handleGroupingDefaults,i=e("../bar/defaults").handleText,o=e("../scatter/xy_defaults"),s=e("../scatter/period_defaults"),l=e("./attributes"),c=e("../../components/color");t.exports={supplyDefaults:function(e,t,r,a){function u(r,a){return n.coerce(e,t,l,r,a)}if(o(e,t,a,u)){s(e,t,a,u),u("xhoverformat"),u("yhoverformat"),u("orientation",t.y&&!t.x?"v":"h"),u("offset"),u("width");var f=u("text");u("hovertext"),u("hovertemplate");var p=u("textposition");i(e,t,a,u,p,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"===t.textposition||t.texttemplate||u("textinfo",Array.isArray(f)?"text+value":"value");var h=u("marker.color",r);u("marker.line.color",c.defaultLine),u("marker.line.width"),u("connector.visible")&&(u("connector.fillcolor",function(e){var t=n.isArrayOrTypedArray(e)?"#000":e;return c.addOpacity(t,.5*c.opacity(t))}(h)),u("connector.line.width")&&(u("connector.line.color"),u("connector.line.dash")))}else t.visible=!1},crossTraceDefaults:function(e,t){var r,i;function o(e){return n.coerce(i._input,i,l,e)}if("group"===t.funnelmode)for(var s=0;s<e.length;s++)r=(i=e[s])._input,a(r,i,t,o)}}},{"../../components/color":366,"../../lib":503,"../bar/defaults":652,"../scatter/period_defaults":946,"../scatter/xy_defaults":953,"./attributes":771}],776:[function(e,t,r){"use strict";t.exports=function(e,t){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"percentInitial"in t&&(e.percentInitial=t.percentInitial),"percentPrevious"in t&&(e.percentPrevious=t.percentPrevious),"percentTotal"in t&&(e.percentTotal=t.percentTotal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}},{}],777:[function(e,t,r){"use strict";var n=e("../../components/color").opacity,a=e("../bar/hover").hoverOnBars,i=e("../../lib").formatPercent;t.exports=function(e,t,r,o,s){var l=a(e,t,r,o,s);if(l){var c=l.cd,u=c[0].trace,f="h"===u.orientation,p=c[l.index];l[(f?"x":"y")+"LabelVal"]=p.s,l.percentInitial=p.begR,l.percentInitialLabel=i(p.begR,1),l.percentPrevious=p.difR,l.percentPreviousLabel=i(p.difR,1),l.percentTotal=p.sumR,l.percentTotalLabel=i(p.sumR,1);var h=p.hi||u.hoverinfo,d=[];if(h&&"none"!==h&&"skip"!==h){var m="all"===h,g=h.split("+"),y=function(e){return m||-1!==g.indexOf(e)};y("percent initial")&&d.push(l.percentInitialLabel+" of initial"),y("percent previous")&&d.push(l.percentPreviousLabel+" of previous"),y("percent total")&&d.push(l.percentTotalLabel+" of total")}return l.extraText=d.join("<br>"),l.color=function(e,t){var r=e.marker,a=t.mc||r.color,i=t.mlc||r.line.color,o=t.mlw||r.line.width;return n(a)?a:n(i)&&o?i:void 0}(u,p),[l]}}},{"../../components/color":366,"../../lib":503,"../bar/hover":655}],778:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":568,"../bar/select":660,"./attributes":771,"./calc":772,"./cross_trace_calc":774,"./defaults":775,"./event_data":776,"./hover":777,"./layout_attributes":779,"./layout_defaults":780,"./plot":781,"./style":782}],779:[function(e,t,r){"use strict";t.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],780:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var s=0;s<r.length;s++){var l=r[s];if(l.visible&&"funnel"===l.type){i=!0;break}}i&&(o("funnelmode"),o("funnelgap",.2),o("funnelgroupgap"))}},{"../../lib":503,"./layout_attributes":779}],781:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../../constants/numerical").BADNUM,s=e("../bar/plot"),l=e("../bar/uniform_text").clearMinTextSize;function c(e,t,r,n){var a=[],i=[],o=n?t:r,s=n?r:t;return a[0]=o.c2p(e.s0,!0),i[0]=s.c2p(e.p0,!0),a[1]=o.c2p(e.s1,!0),i[1]=s.c2p(e.p1,!0),a[2]=o.c2p(e.nextS0,!0),i[2]=s.c2p(e.nextP0,!0),a[3]=o.c2p(e.nextS1,!0),i[3]=s.c2p(e.nextP1,!0),n?[a,i]:[i,a]}t.exports=function(e,t,r,u){var f=e._fullLayout;l("funnel",f),function(e,t,r,s){var l=t.xaxis,u=t.yaxis;a.makeTraceGroups(s,r,"trace bars").each((function(r){var s=n.select(this),f=r[0].trace,p=a.ensureSingle(s,"g","regions");if(f.connector&&f.connector.visible){var h="h"===f.orientation,d=p.selectAll("g.region").data(a.identity);d.enter().append("g").classed("region",!0),d.exit().remove();var m=d.size();d.each((function(r,s){if(s===m-1||r.cNext){var f=c(r,l,u,h),p=f[0],d=f[1],g="";p[0]!==o&&d[0]!==o&&p[1]!==o&&d[1]!==o&&p[2]!==o&&d[2]!==o&&p[3]!==o&&d[3]!==o&&(g+=h?"M"+p[0]+","+d[1]+"L"+p[2]+","+d[2]+"H"+p[3]+"L"+p[1]+","+d[1]+"Z":"M"+p[1]+","+d[1]+"L"+p[2]+","+d[3]+"V"+d[2]+"L"+p[1]+","+d[0]+"Z"),""===g&&(g="M0,0Z"),a.ensureSingle(n.select(this),"path").attr("d",g).call(i.setClipUrl,t.layerClipId,e)}}))}else p.remove()}))}(e,t,r,u),function(e,t,r,o){var s=t.xaxis,l=t.yaxis;a.makeTraceGroups(o,r,"trace bars").each((function(r){var o=n.select(this),u=r[0].trace,f=a.ensureSingle(o,"g","lines");if(u.connector&&u.connector.visible&&u.connector.line.width){var p="h"===u.orientation,h=f.selectAll("g.line").data(a.identity);h.enter().append("g").classed("line",!0),h.exit().remove();var d=h.size();h.each((function(r,o){if(o===d-1||r.cNext){var u=c(r,s,l,p),f=u[0],h=u[1],m="";void 0!==f[3]&&void 0!==h[3]&&(p?(m+="M"+f[0]+","+h[1]+"L"+f[2]+","+h[2],m+="M"+f[1]+","+h[1]+"L"+f[3]+","+h[2]):(m+="M"+f[1]+","+h[1]+"L"+f[2]+","+h[3],m+="M"+f[1]+","+h[0]+"L"+f[2]+","+h[2])),""===m&&(m="M0,0Z"),a.ensureSingle(n.select(this),"path").attr("d",m).call(i.setClipUrl,t.layerClipId,e)}}))}else f.remove()}))}(e,t,r,u),s.plot(e,t,r,u,{mode:f.funnelmode,norm:f.funnelmode,gap:f.funnelgap,groupgap:f.funnelgroupgap})}},{"../../components/drawing":388,"../../constants/numerical":479,"../../lib":503,"../bar/plot":659,"../bar/uniform_text":664,"@plotly/d3":58}],782:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../../components/color"),o=e("../../constants/interactions").DESELECTDIM,s=e("../bar/style"),l=e("../bar/uniform_text").resizeText,c=s.styleTextPoints;t.exports={style:function(e,t,r){var s=r||n.select(e).selectAll("g.funnellayer").selectAll("g.trace");l(e,s,"funnel"),s.style("opacity",(function(e){return e[0].trace.opacity})),s.each((function(t){var r=n.select(this),s=t[0].trace;r.selectAll(".point > path").each((function(e){if(!e.isBlank){var t=s.marker;n.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(a.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",s.selectedpoints&&!e.selected?o:1)}})),c(r,s,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=s.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":366,"../../components/drawing":388,"../../constants/interactions":478,"../bar/style":662,"../bar/uniform_text":664,"@plotly/d3":58}],783:[function(e,t,r){"use strict";var n=e("../pie/attributes"),a=e("../../plots/attributes"),i=e("../../plots/domain").attributes,o=e("../../plots/template_attributes").hovertemplateAttrs,s=e("../../plots/template_attributes").texttemplateAttrs,l=e("../../lib/extend").extendFlat;t.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":493,"../../plots/attributes":550,"../../plots/domain":584,"../../plots/template_attributes":633,"../pie/attributes":900}],784:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="funnelarea",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":619}],785:[function(e,t,r){"use strict";var n=e("../pie/calc");t.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},{"../pie/calc":902}],786:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults,o=e("../bar/defaults").handleText,s=e("../pie/defaults").handleLabelsAndValues;t.exports=function(e,t,r,l){function c(r,i){return n.coerce(e,t,a,r,i)}var u=c("labels"),f=c("values"),p=s(u,f),h=p.len;if(t._hasLabels=p.hasLabels,t._hasValues=p.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),h){t._length=h,c("marker.line.width")&&c("marker.line.color",l.paper_bgcolor),c("marker.colors"),c("scalegroup");var d,m=c("text"),g=c("texttemplate");if(g||(d=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),g||d&&"none"!==d){var y=c("textposition");o(e,t,l,c,y,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(t,l,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",l.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},{"../../lib":503,"../../plots/domain":584,"../bar/defaults":652,"../pie/defaults":903,"./attributes":783}],787:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:e("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style"),styleOne:e("../pie/style_one"),meta:{}}},{"../pie/style_one":911,"./attributes":783,"./base_plot":784,"./calc":785,"./defaults":786,"./layout_attributes":788,"./layout_defaults":789,"./plot":790,"./style":791}],788:[function(e,t,r){"use strict";var n=e("../pie/layout_attributes").hiddenlabels;t.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":907}],789:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},{"../../lib":503,"./layout_attributes":788}],790:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../../lib"),o=i.strScale,s=i.strTranslate,l=e("../../lib/svg_text_utils"),c=e("../bar/plot").toMoveInsideBar,u=e("../bar/uniform_text"),f=u.recordMinTextSize,p=u.clearMinTextSize,h=e("../pie/helpers"),d=e("../pie/plot"),m=d.attachFxHandlers,g=d.determineInsideTextFont,y=d.layoutAreas,v=d.prerenderTitles,b=d.positionTitleOutside,x=d.formatSliceLabel;function _(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}t.exports=function(e,t){var r=e._fullLayout;p("funnelarea",r),v(t,e),y(t,r._size),i.makeTraceGroups(r._funnelarealayer,t,"trace").each((function(t){var u=n.select(this),p=t[0],d=p.trace;!function(e){if(e.length){var t=e[0],r=t.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o,s,l=Math.pow(a,2),c=t.vTotal,u=c,f=c*l/(1-l)/c,p=[];for(p.push(M()),o=e.length-1;o>-1;o--)if(!(s=e[o]).hidden){var h=s.v/u;f+=h,p.push(M())}var d=1/0,m=-1/0;for(o=0;o<p.length;o++)i=p[o],d=Math.min(d,i[1]),m=Math.max(m,i[1]);for(o=0;o<p.length;o++)p[o][1]-=(m+d)/2;var g=p[p.length-1][0],y=t.r,v=(m-d)/2,b=y/g,x=y/v*n;for(t.r=x*v,o=0;o<p.length;o++)p[o][0]*=b,p[o][1]*=x;var _,w,k=[-(i=p[0])[0],i[1]],D=[i[0],i[1]],T=0;for(o=e.length-1;o>-1;o--)if(!(s=e[o]).hidden){var A=p[T+=1][0],S=p[T][1];s.TL=[-A,S],s.TR=[A,S],s.BL=k,s.BR=D,s.pxmid=(_=s.TR,w=s.BR,[.5*(_[0]+w[0]),.5*(_[1]+w[1])]),k=s.TL,D=s.TR}}function M(){var e,t={x:e=Math.sqrt(f),y:-e};return[t.x,t.y]}}(t),u.each((function(){var u=n.select(this).selectAll("g.slice").data(t);u.enter().append("g").classed("slice",!0),u.exit().remove(),u.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=d.index;var u=p.cx,y=p.cy,v=n.select(this),b=v.selectAll("path.surface").data([o]);b.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),v.call(m,e,t);var w="M"+(u+o.TR[0])+","+(y+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";b.attr("d",w),x(e,o,p);var k=h.castOption(d.textposition,o.pts),D=v.selectAll("g.slicetext").data(o.text&&"none"!==k?[0]:[]);D.enter().append("g").classed("slicetext",!0),D.exit().remove(),D.each((function(){var p=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),h=i.ensureUniformFontSize(e,g(d,o,r.font));p.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,h).call(l.convertToTspans,e);var m,v,b,x=a.bBox(p.node()),_=Math.min(o.BL[1],o.BR[1])+y,w=Math.max(o.TL[1],o.TR[1])+y;v=Math.max(o.TL[0],o.BL[0])+u,b=Math.min(o.TR[0],o.BR[0])+u,(m=c(v,b,_,w,x,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=h.size,f(d.type,m,r),t[s].transform=m,p.attr("transform",i.getTextTransform(m))}))}}));var y=n.select(this).selectAll("g.titletext").data(d.title.text?[0]:[]);y.enter().append("g").classed("titletext",!0),y.exit().remove(),y.each((function(){var t=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),c=d.title.text;d._meta&&(c=i.templateString(c,d._meta)),t.text(c).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,d.title.font).call(l.convertToTspans,e);var u=b(p,r._size);t.attr("transform",s(u.x,u.y)+o(Math.min(1,u.scale))+s(u.tx,u.ty))}))}))}))}},{"../../components/drawing":388,"../../lib":503,"../../lib/svg_text_utils":529,"../bar/plot":659,"../bar/uniform_text":664,"../pie/helpers":905,"../pie/plot":909,"@plotly/d3":58}],791:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../pie/style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");i(e,t,"funnelarea"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":664,"../pie/style_one":911,"@plotly/d3":58}],792:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../plots/attributes"),i=e("../../plots/font_attributes"),o=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,c=e("../../components/colorscale/attributes"),u=e("../../lib/extend").extendFlat;t.exports=u({z:{valType:"data_array",editType:"calc"},x:u({},n.x,{impliedEdits:{xtype:"array"}}),x0:u({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:u({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:u({},n.y,{impliedEdits:{ytype:"array"}}),y0:u({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:u({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:u({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:u({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:u({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:u({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:u({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:u({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:i({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:u({},a.showlegend,{dflt:!1})},{transforms:void 0},c("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/font_attributes":585,"../../plots/template_attributes":633,"../scatter/attributes":926}],793:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),s=e("../histogram2d/calc"),l=e("../../components/colorscale/calc"),c=e("./convert_column_xyz"),u=e("./clean_2d_array"),f=e("./interp2d"),p=e("./find_empties"),h=e("./make_bound_array"),d=e("../../constants/numerical").BADNUM;function m(e){for(var t=[],r=e.length,n=0;n<r;n++){var a=e[n];a!==d&&t.push(a)}return t}t.exports=function(e,t){var r,g,y,v,b,x,_,w,k,D,T,A=i.getFromId(e,t.xaxis||"x"),S=i.getFromId(e,t.yaxis||"y"),M=n.traceIs(t,"contour"),E=n.traceIs(t,"histogram"),C=n.traceIs(t,"gl2d"),N=M?"best":t.zsmooth;if(A._minDtick=0,S._minDtick=0,E)v=(T=s(e,t)).orig_x,r=T.x,g=T.x0,y=T.dx,w=T.orig_y,b=T.y,x=T.y0,_=T.dy,k=T.z;else{var O=t.z;a.isArray1D(O)?(c(t,A,S,"x","y",["z"]),r=t._x,b=t._y,O=t._z):(v=t.x?A.makeCalcdata(t,"x"):[],w=t.y?S.makeCalcdata(t,"y"):[],r=o(t,A,"x",v).vals,b=o(t,S,"y",w).vals,t._x=r,t._y=b),g=t.x0,y=t.dx,x=t.y0,_=t.dy,k=u(O,t,A,S)}function I(e){N=t._input.zsmooth=t.zsmooth=!1,a.warn('cannot use zsmooth: "fast": '+e)}if((A.rangebreaks||S.rangebreaks)&&(k=function(e,t,r){for(var n=[],a=-1,i=0;i<r.length;i++)if(t[i]!==d){n[++a]=[];for(var o=0;o<r[i].length;o++)e[o]!==d&&n[a].push(r[i][o])}return n}(r,b,k),E||(r=m(r),b=m(b),t._x=r,t._y=b)),E||!M&&!t.connectgaps||(t._emptypoints=p(k),f(k,t._emptypoints)),"fast"===N)if("log"===A.type||"log"===S.type)I("log axis found");else if(!E){if(r.length){var P=(r[r.length-1]-r[0])/(r.length-1),R=Math.abs(P/100);for(D=0;D<r.length-1;D++)if(Math.abs(r[D+1]-r[D]-P)>R){I("x scale is not linear");break}}if(b.length&&"fast"===N){var L=(b[b.length-1]-b[0])/(b.length-1),F=Math.abs(L/100);for(D=0;D<b.length-1;D++)if(Math.abs(b[D+1]-b[D]-L)>F){I("y scale is not linear");break}}}var B=a.maxRowLength(k),z="scaled"===t.xtype?"":r,j=h(t,z,g,y,B,A),U="scaled"===t.ytype?"":b,$=h(t,U,x,_,k.length,S);C||(t._extremes[A._id]=i.findExtremes(A,j),t._extremes[S._id]=i.findExtremes(S,$));var V={x:j,y:$,z:k,text:t._text||t.text,hovertext:t._hovertext||t.hovertext};if(t.xperiodalignment&&v&&(V.orig_x=v),t.yperiodalignment&&w&&(V.orig_y=w),z&&z.length===j.length-1&&(V.xCenter=z),U&&U.length===$.length-1&&(V.yCenter=U),E&&(V.xRanges=T.xRanges,V.yRanges=T.yRanges,V.pts=T.pts),M||l(e,t,{vals:k,cLetter:"z"}),M&&t.contours&&"heatmap"===t.contours.coloring){var q={type:"contour"===t.type?"heatmap":"histogram2d",xcalendar:t.xcalendar,ycalendar:t.ycalendar};V.xfill=h(q,z,g,y,B,A),V.yfill=h(q,U,x,_,k.length,S)}return[V]}},{"../../components/colorscale/calc":374,"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/align_period":551,"../../plots/cartesian/axes":554,"../../registry":638,"../histogram2d/calc":826,"./clean_2d_array":794,"./convert_column_xyz":796,"./find_empties":798,"./interp2d":801,"./make_bound_array":803}],794:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM;t.exports=function(e,t,r,o){var s,l,c,u,f,p;function h(e){if(n(e))return+e}if(t&&t.transpose){for(s=0,f=0;f<e.length;f++)s=Math.max(s,e[f].length);if(0===s)return!1;c=function(e){return e.length},u=function(e,t,r){return(e[r]||[])[t]}}else s=e.length,c=function(e,t){return e[t].length},u=function(e,t,r){return(e[t]||[])[r]};var d=function(e,t,r){return t===i||r===i?i:u(e,t,r)};function m(e){if(t&&"carpet"!==t.type&&"contourcarpet"!==t.type&&e&&"category"===e.type&&t["_"+e._id.charAt(0)].length){var r=e._id.charAt(0),n={},o=t["_"+r+"CategoryMap"]||t[r];for(f=0;f<o.length;f++)n[o[f]]=f;return function(t){var r=n[e._categories[t]];return r+1?r:i}}return a.identity}var g=m(r),y=m(o);o&&"category"===o.type&&(s=o._categories.length);var v=new Array(s);for(f=0;f<s;f++)for(l=r&&"category"===r.type?r._categories.length:c(e,f),v[f]=new Array(l),p=0;p<l;p++)v[f][p]=h(d(e,y(f),g(p)));return v}},{"../../constants/numerical":479,"../../lib":503,"fast-isnumeric":190}],795:[function(e,t,r){"use strict";t.exports={min:"zmin",max:"zmax"}},{}],796:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../constants/numerical").BADNUM,i=e("../../plots/cartesian/align_period");t.exports=function(e,t,r,o,s,l){var c=e._length,u=t.makeCalcdata(e,o),f=r.makeCalcdata(e,s);u=i(e,t,o,u).vals,f=i(e,r,s,f).vals;var p,h,d,m,g=e.text,y=void 0!==g&&n.isArray1D(g),v=e.hovertext,b=void 0!==v&&n.isArray1D(v),x=n.distinctVals(u),_=x.vals,w=n.distinctVals(f),k=w.vals,D=[],T=k.length,A=_.length;for(p=0;p<l.length;p++)D[p]=n.init2dArray(T,A);y&&(d=n.init2dArray(T,A)),b&&(m=n.init2dArray(T,A));var S=n.init2dArray(T,A);for(p=0;p<c;p++)if(u[p]!==a&&f[p]!==a){var M=n.findBin(u[p]+x.minDiff/2,_),E=n.findBin(f[p]+w.minDiff/2,k);for(h=0;h<l.length;h++){var C=e[l[h]];D[h][E][M]=C[p],S[E][M]=p}y&&(d[E][M]=g[p]),b&&(m[E][M]=v[p])}for(e["_"+o]=_,e["_"+s]=k,h=0;h<l.length;h++)e["_"+l[h]]=D[h];y&&(e._text=d),b&&(e._hovertext=m),t&&"category"===t.type&&(e["_"+o+"CategoryMap"]=_.map((function(e){return t._categories[e]}))),r&&"category"===r.type&&(e["_"+s+"CategoryMap"]=k.map((function(e){return r._categories[e]}))),e._after2before=S}},{"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/align_period":551}],797:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./xyz_defaults"),i=e("./label_defaults"),o=e("../scatter/period_defaults"),s=e("./style_defaults"),l=e("../../components/colorscale/defaults"),c=e("./attributes");t.exports=function(e,t,r,u){function f(r,a){return n.coerce(e,t,c,r,a)}a(e,t,f,u)?(o(e,t,u,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hovertemplate"),i(f,u),s(e,t,f,u),f("hoverongaps"),f("connectgaps",n.isArray1D(t.z)&&!1!==t.zsmooth),l(e,t,u,f,{prefix:"",cLetter:"z"})):t.visible=!1}},{"../../components/colorscale/defaults":376,"../../lib":503,"../scatter/period_defaults":946,"./attributes":792,"./label_defaults":802,"./style_defaults":806,"./xyz_defaults":807}],798:[function(e,t,r){"use strict";var n=e("../../lib").maxRowLength;t.exports=function(e){var t,r,a,i,o,s,l,c,u=[],f={},p=[],h=e[0],d=[],m=[0,0,0],g=n(e);for(r=0;r<e.length;r++)for(t=d,d=h,h=e[r+1]||[],a=0;a<g;a++)void 0===d[a]&&((s=(void 0!==d[a-1]?1:0)+(void 0!==d[a+1]?1:0)+(void 0!==t[a]?1:0)+(void 0!==h[a]?1:0))?(0===r&&s++,0===a&&s++,r===e.length-1&&s++,a===d.length-1&&s++,s<4&&(f[[r,a]]=[r,a,s]),u.push([r,a,s])):p.push([r,a]));for(;p.length;){for(l={},c=!1,o=p.length-1;o>=0;o--)(s=((f[[(r=(i=p[o])[0])-1,a=i[1]]]||m)[2]+(f[[r+1,a]]||m)[2]+(f[[r,a-1]]||m)[2]+(f[[r,a+1]]||m)[2])/20)&&(l[i]=[r,a,s],p.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in l)f[i]=l[i],u.push(l[i])}return u.sort((function(e,t){return t[2]-e[2]}))}},{"../../lib":503}],799:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../components/colorscale").extractOpts;t.exports=function(e,t,r,s,l){l||(l={});var c,u,f,p,h=l.isContour,d=e.cd[0],m=d.trace,g=e.xa,y=e.ya,v=d.x,b=d.y,x=d.z,_=d.xCenter,w=d.yCenter,k=d.zmask,D=m.zhoverformat,T=v,A=b;if(!1!==e.index){try{f=Math.round(e.index[1]),p=Math.round(e.index[0])}catch(t){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(f<0||f>=x[0].length||p<0||p>x.length)return}else{if(n.inbox(t-v[0],t-v[v.length-1],0)>0||n.inbox(r-b[0],r-b[b.length-1],0)>0)return;if(h){var S;for(T=[2*v[0]-v[1]],S=1;S<v.length;S++)T.push((v[S]+v[S-1])/2);for(T.push([2*v[v.length-1]-v[v.length-2]]),A=[2*b[0]-b[1]],S=1;S<b.length;S++)A.push((b[S]+b[S-1])/2);A.push([2*b[b.length-1]-b[b.length-2]])}f=Math.max(0,Math.min(T.length-2,a.findBin(t,T))),p=Math.max(0,Math.min(A.length-2,a.findBin(r,A)))}var M,E,C=g.c2p(v[f]),N=g.c2p(v[f+1]),O=y.c2p(b[p]),I=y.c2p(b[p+1]);h?(M=d.orig_x||v,E=d.orig_y||b,N=C,c=M[f],I=O,u=E[p]):(M=d.orig_x||_||v,E=d.orig_y||w||b,c=_?M[f]:(M[f]+M[f+1])/2,u=w?E[p]:(E[p]+E[p+1])/2,g&&"category"===g.type&&(c=v[f]),y&&"category"===y.type&&(u=b[p]),m.zsmooth&&(C=N=g.c2p(c),O=I=y.c2p(u)));var P=x[p][f];if(k&&!k[p][f]&&(P=void 0),void 0!==P||m.hoverongaps){var R;Array.isArray(d.hovertext)&&Array.isArray(d.hovertext[p])?R=d.hovertext[p][f]:Array.isArray(d.text)&&Array.isArray(d.text[p])&&(R=d.text[p][f]);var L=o(m),F={type:"linear",range:[L.min,L.max],hoverformat:D,_separators:g._separators,_numFormat:g._numFormat},B=i.tickText(F,P,"hover").text;return[a.extendFlat(e,{index:m._after2before?m._after2before[p][f]:[p,f],distance:e.maxHoverDistance,spikeDistance:e.maxSpikeDistance,x0:C,x1:N,y0:O,y1:I,xLabelVal:c,yLabelVal:u,zLabelVal:P,zLabel:B,text:R})]}}},{"../../components/colorscale":378,"../../components/fx":406,"../../lib":503,"../../plots/cartesian/axes":554}],800:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),colorbar:e("./colorbar"),style:e("./style"),hoverPoints:e("./hover"),moduleType:"trace",name:"heatmap",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}},{"../../plots/cartesian":568,"./attributes":792,"./calc":793,"./colorbar":795,"./defaults":797,"./hover":799,"./plot":804,"./style":805}],801:[function(e,t,r){"use strict";var n=e("../../lib"),a=[[-1,0],[1,0],[0,-1],[0,1]];function i(e){return.5-.25*Math.min(1,.5*e)}function o(e,t,r){var n,i,o,s,l,c,u,f,p,h,d,m,g,y=0;for(s=0;s<t.length;s++){for(i=(n=t[s])[0],o=n[1],d=e[i][o],h=0,p=0,l=0;l<4;l++)(u=e[i+(c=a[l])[0]])&&void 0!==(f=u[o+c[1]])&&(0===h?m=g=f:(m=Math.min(m,f),g=Math.max(g,f)),p++,h+=f);if(0===p)throw"iterateInterp2d order is wrong: no defined neighbors";e[i][o]=h/p,void 0===d?p<4&&(y=1):(e[i][o]=(1+r)*e[i][o]-r*d,g>m&&(y=Math.max(y,Math.abs(e[i][o]-d)/(g-m))))}return y}t.exports=function(e,t){var r,a=1;for(o(e,t),r=0;r<t.length&&!(t[r][2]<4);r++);for(t=t.slice(r),r=0;r<100&&a>.01;r++)a=o(e,t,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),e}},{"../../lib":503}],802:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){e("texttemplate");var r=n.extendFlat({},t.font,{color:"auto",size:"auto"});n.coerceFont(e,"textfont",r)}},{"../../lib":503}],803:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i,o,s){var l,c,u,f=[],p=n.traceIs(e,"contour"),h=n.traceIs(e,"histogram"),d=n.traceIs(e,"gl2d");if(a(t)&&t.length>1&&!h&&"category"!==s.type){var m=t.length;if(!(m<=o))return p?t.slice(0,o):t.slice(0,o+1);if(p||d)f=t.slice(0,o);else if(1===o)f=[t[0]-.5,t[0]+.5];else{for(f=[1.5*t[0]-.5*t[1]],u=1;u<m;u++)f.push(.5*(t[u-1]+t[u]));f.push(1.5*t[m-1]-.5*t[m-2])}if(m<o){var g=f[f.length-1],y=g-f[f.length-2];for(u=m;u<o;u++)g+=y,f.push(g)}}else{var v=e[s._id.charAt(0)+"calendar"];for(l=h?s.r2c(r,0,v):a(t)&&1===t.length?t[0]:void 0===r?0:("log"===s.type?s.d2c:s.r2c)(r,0,v),c=i||1,u=p||d?0:-.5;u<o;u++)f.push(l+c*u)}return f}},{"../../lib":503,"../../registry":638}],804:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("tinycolor2"),i=e("../../registry"),o=e("../../components/drawing"),s=e("../../plots/cartesian/axes"),l=e("../../lib"),c=e("../../lib/svg_text_utils"),u=e("../scatter/format_labels"),f=e("../../components/color"),p=e("../../components/colorscale").extractOpts,h=e("../../components/colorscale").makeColorScaleFuncFromTrace,d=e("../../constants/xmlns_namespaces"),m=e("../../constants/alignment").LINE_SPACING;function g(e){return e.selectAll("g.heatmap-label")}function y(e){g(e).remove()}function v(e,t){var r=t.length-2,n=l.constrain(l.findBin(e,t),0,r),a=t[n],i=t[n+1],o=l.constrain(n+(e-a)/(i-a)-.5,0,r),s=Math.round(o),c=Math.abs(o-s);return o&&o!==r&&c?{bin0:s,frac:c,bin1:Math.round(s+c/(o-s))}:{bin0:s,bin1:s,frac:0}}function b(e,t){var r=t.length-1,n=l.constrain(l.findBin(e,t),0,r),a=t[n],i=(e-a)/(t[n+1]-a)||0;return i<=0?{bin0:n,bin1:n,frac:0}:i<.5?{bin0:n,bin1:n+1,frac:i}:{bin0:n+1,bin1:n,frac:1-i}}function x(e,t,r){e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=Math.round(255*r[3])}t.exports=function(e,t,r,_){var w=t.xaxis,k=t.yaxis;l.makeTraceGroups(_,r,"hm").each((function(t){var r,_,D,T,A,S,M,E,C=n.select(this),N=t[0],O=N.trace,I=O.xgap||0,P=O.ygap||0,R=N.z,L=N.x,F=N.y,B=N.xCenter,z=N.yCenter,j=i.traceIs(O,"contour"),U=j?"best":O.zsmooth,$=R.length,V=l.maxRowLength(R),q=!1,W=!1;for(S=0;void 0===r&&S<L.length-1;)r=w.c2p(L[S]),S++;for(S=L.length-1;void 0===_&&S>0;)_=w.c2p(L[S]),S--;for(_<r&&(D=_,_=r,r=D,q=!0),S=0;void 0===T&&S<F.length-1;)T=k.c2p(F[S]),S++;for(S=F.length-1;void 0===A&&S>0;)A=k.c2p(F[S]),S--;if(A<T&&(D=T,T=A,A=D,W=!0),j&&(B=L,z=F,L=N.xfill,F=N.yfill),"fast"!==U){var H="best"===U?0:.5;r=Math.max(-H*w._length,r),_=Math.min((1+H)*w._length,_),T=Math.max(-H*k._length,T),A=Math.min((1+H)*k._length,A)}var G,X,Y=Math.round(_-r),Z=Math.round(A-T);if(Y<=0||Z<=0)return C.selectAll("image").data([]).exit().remove(),void y(C);"fast"===U?(G=V,X=$):(G=Y,X=Z);var K=document.createElement("canvas");K.width=G,K.height=X;var J,Q,ee=K.getContext("2d"),te=h(O,{noNumericCheck:!0,returnArray:!0});"fast"===U?(J=q?function(e){return V-1-e}:l.identity,Q=W?function(e){return $-1-e}:l.identity):(J=function(e){return l.constrain(Math.round(w.c2p(L[e])-r),0,Y)},Q=function(e){return l.constrain(Math.round(k.c2p(F[e])-T),0,Z)});var re,ne,ae,ie,oe=Q(0),se=[oe,oe],le=q?0:1,ce=W?0:1,ue=0,fe=0,pe=0,he=0;function de(e,t){if(void 0!==e){var r=te(e);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),ue+=t,fe+=r[0]*t,pe+=r[1]*t,he+=r[2]*t,r}return[0,0,0,0]}function me(e,t,r,n){var a=e[r.bin0];if(void 0===a)return de(void 0,1);var i,o=e[r.bin1],s=t[r.bin0],l=t[r.bin1],c=o-a||0,u=s-a||0;return i=void 0===o?void 0===l?0:void 0===s?2*(l-a):2*(2*l-s-a)/3:void 0===l?void 0===s?0:2*(2*a-o-s)/3:void 0===s?2*(2*l-o-a)/3:l+a-o-s,de(a+r.frac*c+n.frac*(u+r.frac*i))}if(U){var ge,ye=0;try{ge=new Uint8Array(Y*Z*4)}catch(e){ge=new Array(Y*Z*4)}if("best"===U){var ve,be,xe,_e=B||L,we=z||F,ke=new Array(_e.length),De=new Array(we.length),Te=new Array(Y),Ae=B?b:v,Se=z?b:v;for(S=0;S<_e.length;S++)ke[S]=Math.round(w.c2p(_e[S])-r);for(S=0;S<we.length;S++)De[S]=Math.round(k.c2p(we[S])-T);for(S=0;S<Y;S++)Te[S]=Ae(S,ke);for(M=0;M<Z;M++)for(be=R[(ve=Se(M,De)).bin0],xe=R[ve.bin1],S=0;S<Y;S++,ye+=4)x(ge,ye,ie=me(be,xe,Te[S],ve))}else for(M=0;M<$;M++)for(ae=R[M],se=Q(M),S=0;S<Y;S++)ie=de(ae[S],1),x(ge,ye=4*(se*Y+J(S)),ie);var Me=ee.createImageData(Y,Z);try{Me.data.set(ge)}catch(e){var Ee=Me.data,Ce=Ee.length;for(M=0;M<Ce;M++)Ee[M]=ge[M]}ee.putImageData(Me,0,0)}else{var Ne=Math.floor(I/2),Oe=Math.floor(P/2);for(M=0;M<$;M++)if(ae=R[M],se.reverse(),se[ce]=Q(M+1),se[0]!==se[1]&&void 0!==se[0]&&void 0!==se[1])for(re=[ne=J(0),ne],S=0;S<V;S++)re.reverse(),re[le]=J(S+1),re[0]!==re[1]&&void 0!==re[0]&&void 0!==re[1]&&(ie=de(ae[S],(re[1]-re[0])*(se[1]-se[0])),ee.fillStyle="rgba("+ie.join(",")+")",ee.fillRect(re[0]+Ne,se[0]+Oe,re[1]-re[0]-I,se[1]-se[0]-P))}fe=Math.round(fe/ue),pe=Math.round(pe/ue),he=Math.round(he/ue);var Ie=a("rgb("+fe+","+pe+","+he+")");e._hmpixcount=(e._hmpixcount||0)+ue,e._hmlumcount=(e._hmlumcount||0)+ue*Ie.getLuminance();var Pe=C.selectAll("image").data(t);Pe.enter().append("svg:image").attr({xmlns:d.svg,preserveAspectRatio:"none"}),Pe.attr({height:Z,width:Y,x:r,y:T,"xlink:href":K.toDataURL("image/png")}),y(C);var Re=O.texttemplate;if(Re){var Le=p(O),Fe={type:"linear",range:[Le.min,Le.max],_separators:w._separators,_numFormat:w._numFormat},Be="histogram2dcontour"===O.type,ze="contour"===O.type,je=ze?$-1:$,Ue=ze?1:0,$e=ze?V-1:V,Ve=[];for(S=ze?1:0;S<je;S++){var qe;if(ze)qe=N.y[S];else if(Be){if(0===S||S===$-1)continue;qe=N.y[S]}else if(N.yCenter)qe=N.yCenter[S];else{if(S+1===$&&void 0===N.y[S+1])continue;qe=(N.y[S]+N.y[S+1])/2}var We=Math.round(k.c2p(qe));if(!(0>We||We>k._length))for(M=Ue;M<$e;M++){var He;if(ze)He=N.x[M];else if(Be){if(0===M||M===V-1)continue;He=N.x[M]}else if(N.xCenter)He=N.xCenter[M];else{if(M+1===V&&void 0===N.x[M+1])continue;He=(N.x[M]+N.x[M+1])/2}var Ge=Math.round(w.c2p(He));if(!(0>Ge||Ge>w._length)){var Xe=u({x:He,y:qe},O,e._fullLayout);Xe.x=He,Xe.y=qe;var Ye=N.z[S][M];void 0===Ye?(Xe.z="",Xe.zLabel=""):(Xe.z=Ye,Xe.zLabel=s.tickText(Fe,Ye,"hover").text);var Ze=N.text&&N.text[S]&&N.text[S][M];void 0!==Ze&&!1!==Ze||(Ze=""),Xe.text=Ze;var Ke=l.texttemplateString(Re,Xe,e._fullLayout._d3locale,Xe,O._meta||{});if(Ke){var Je=Ke.split("<br>"),Qe=Je.length,et=0;for(E=0;E<Qe;E++)et=Math.max(et,Je[E].length);Ve.push({l:Qe,c:et,t:Ke,x:Ge,y:We,z:Ye})}}}}var tt=O.textfont,rt=tt.family,nt=tt.size,at=e._fullLayout.font.size;if(!nt||"auto"===nt){var it=1/0,ot=1/0,st=0,lt=0;for(E=0;E<Ve.length;E++){var ct=Ve[E];if(st=Math.max(st,ct.l),lt=Math.max(lt,ct.c),E<Ve.length-1){var ut=Ve[E+1],ft=Math.abs(ut.x-ct.x),pt=Math.abs(ut.y-ct.y);ft&&(it=Math.min(it,ft)),pt&&(ot=Math.min(ot,pt))}}isFinite(it)&&isFinite(ot)?(it-=I,ot-=P,it/=lt,ot/=st,it/=m/2,ot/=m,nt=Math.min(Math.floor(it),Math.floor(ot),at)):nt=at}if(nt<=0||!isFinite(nt))return;g(C).data(Ve).enter().append("g").classed("heatmap-label",1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),a=tt.color;a&&"auto"!==a||(a=f.contrast("rgba("+te(t.z).join()+")")),r.attr("data-notex",1).call(c.positionText,function(e){return e.x}(t),function(e){return e.y-nt*(e.l*m/2-1)}(t)).call(o.font,rt,nt,a).text(t.t).call(c.convertToTspans,e)}))}}))}},{"../../components/color":366,"../../components/colorscale":378,"../../components/drawing":388,"../../constants/alignment":471,"../../constants/xmlns_namespaces":480,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"../../registry":638,"../scatter/format_labels":935,"@plotly/d3":58,tinycolor2:312}],805:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e){n.select(e).selectAll(".hm image").style("opacity",(function(e){return e.trace.opacity}))}},{"@plotly/d3":58}],806:[function(e,t,r){"use strict";t.exports=function(e,t,r){!1===r("zsmooth")&&(r("xgap"),r("ygap")),r("zhoverformat")}},{}],807:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../registry");function o(e,t){var r=t(e);return"scaled"===(r?t(e+"type","array"):"scaled")&&(t(e+"0"),t("d"+e)),r}t.exports=function(e,t,r,s,l,c){var u,f,p=r("z");if(l=l||"x",c=c||"y",void 0===p||!p.length)return 0;if(a.isArray1D(e.z)){u=r(l),f=r(c);var h=a.minRowLength(u),d=a.minRowLength(f);if(0===h||0===d)return 0;t._length=Math.min(h,d,p.length)}else{if(u=o(l,r),f=o(c,r),!function(e){for(var t,r=!0,i=!1,o=!1,s=0;s<e.length;s++){if(t=e[s],!a.isArrayOrTypedArray(t)){r=!1;break}t.length>0&&(i=!0);for(var l=0;l<t.length;l++)if(n(t[l])){o=!0;break}}return r&&i&&o}(p))return 0;r("transpose"),t._length=null}return"heatmapgl"===e.type||i.getComponentMethod("calendars","handleTraceDefaults")(e,t,[l,c],s),!0}},{"../../lib":503,"../../registry":638,"fast-isnumeric":190}],808:[function(e,t,r){"use strict";for(var n=e("../heatmap/attributes"),a=e("../../components/colorscale/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,s=["z","x","x0","dx","y","y0","dy","text","transpose","xtype","ytype"],l={},c=0;c<s.length;c++){var u=s[c];l[u]=n[u]}l.zsmooth={valType:"enumerated",values:["fast",!1],dflt:"fast",editType:"calc"},i(l,a("",{cLetter:"z",autoColorDflt:!1})),t.exports=o(l,"calc","nested")},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plot_api/edit_types":536,"../heatmap/attributes":792}],809:[function(e,t,r){"use strict";var n=e("../../../stackgl_modules").gl_heatmap2d,a=e("../../plots/cartesian/axes"),i=e("../../lib/str2rgbarray");function o(e,t){this.scene=e,this.uid=t,this.type="heatmapgl",this.name="",this.hoverinfo="all",this.xData=[],this.yData=[],this.zData=[],this.textLabels=[],this.idToIndex=[],this.bounds=[0,0,0,0],this.options={zsmooth:"fast",z:[],x:[],y:[],shape:[0,0],colorLevels:[0],colorValues:[0,0,0,1]},this.heatmap=n(e.glplot,this.options),this.heatmap._trace=this}var s=o.prototype;s.handlePick=function(e){var t=this.options,r=t.shape,n=e.pointId,a=n%r[0],i=Math.floor(n/r[0]),o=n;return{trace:this,dataCoord:e.dataCoord,traceCoord:[t.x[a],t.y[i],t.z[o]],textLabel:this.textLabels[n],name:this.name,pointIndex:[i,a],hoverinfo:this.hoverinfo}},s.update=function(e,t){var r=t[0];this.index=e.index,this.name=e.name,this.hoverinfo=e.hoverinfo;var n=r.z;this.options.z=[].concat.apply([],n);var o=n[0].length,s=n.length;this.options.shape=[o,s],this.options.x=r.x,this.options.y=r.y,this.options.zsmooth=e.zsmooth;var l=function(e){for(var t=e.colorscale,r=e.zmin,n=e.zmax,a=t.length,o=new Array(a),s=new Array(4*a),l=0;l<a;l++){var c=t[l],u=i(c[1]);o[l]=r+c[0]*(n-r);for(var f=0;f<4;f++)s[4*l+f]=u[f]}return{colorLevels:o,colorValues:s}}(e);this.options.colorLevels=l.colorLevels,this.options.colorValues=l.colorValues,this.textLabels=[].concat.apply([],e.text),this.heatmap.update(this.options);var c,u,f=this.scene.xaxis,p=this.scene.yaxis;!1===e.zsmooth&&(c={ppad:r.x[1]-r.x[0]},u={ppad:r.y[1]-r.y[0]}),e._extremes[f._id]=a.findExtremes(f,r.x,c),e._extremes[p._id]=a.findExtremes(p,r.y,u)},s.dispose=function(){this.heatmap.dispose()},t.exports=function(e,t,r){var n=new o(e,t.uid);return n.update(t,r),n}},{"../../../stackgl_modules":1120,"../../lib/str2rgbarray":528,"../../plots/cartesian/axes":554}],810:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../heatmap/xyz_defaults"),i=e("../../components/colorscale/defaults"),o=e("./attributes");t.exports=function(e,t,r,s){function l(r,a){return n.coerce(e,t,o,r,a)}a(e,t,l,s)?(l("text"),l("zsmooth"),i(e,t,s,l,{prefix:"",cLetter:"z"})):t.visible=!1}},{"../../components/colorscale/defaults":376,"../../lib":503,"../heatmap/xyz_defaults":807,"./attributes":808}],811:[function(e,t,r){"use strict";["*heatmapgl* trace is deprecated!","Please consider switching to the *heatmap* or *image* trace types.","Alternatively you could contribute/sponsor rewriting this trace type","based on cartesian features and using regl framework."].join(" "),t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),calc:e("../heatmap/calc"),plot:e("./convert"),moduleType:"trace",name:"heatmapgl",basePlotModule:e("../../plots/gl2d"),categories:["gl","gl2d","2dMap"],meta:{}}},{"../../plots/gl2d":596,"../heatmap/calc":793,"../heatmap/colorbar":795,"./attributes":808,"./convert":809,"./defaults":810}],812:[function(e,t,r){"use strict";var n=e("../bar/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../../plots/template_attributes").texttemplateAttrs,s=e("../../plots/font_attributes"),l=e("./bin_attributes"),c=e("./constants"),u=e("../../lib/extend").extendFlat;t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:a("x"),yhoverformat:a("y"),text:u({},n.text,{}),hovertext:u({},n.hovertext,{}),orientation:n.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:l("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:l("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({},{keys:c.eventDataKeys}),texttemplate:o({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),textposition:u({},n.textposition,{arrayOk:!1}),textfont:s({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:s({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:s({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:n.insidetextanchor,textangle:n.textangle,cliponaxis:n.cliponaxis,constraintext:n.constraintext,marker:n.marker,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,_deprecated:{bardir:n._deprecated.bardir}}},{"../../lib/extend":493,"../../plots/cartesian/axis_format_attributes":557,"../../plots/font_attributes":585,"../../plots/template_attributes":633,"../bar/attributes":648,"./bin_attributes":814,"./constants":818}],813:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=e.length,n=0,a=0;a<r;a++)t[a]?(e[a]/=t[a],n+=e[a]):e[a]=null;return n}},{}],814:[function(e,t,r){"use strict";t.exports=function(e,t){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}},{}],815:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports={count:function(e,t,r){return r[e]++,1},sum:function(e,t,r,a){var i=a[t];return n(i)?(i=Number(i),r[e]+=i,i):0},avg:function(e,t,r,a,i){var o=a[t];return n(o)&&(o=Number(o),r[e]+=o,i[e]++),0},min:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]>i){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]<i){var o=i-r[e];return r[e]=i,o}}return 0}}},{"fast-isnumeric":190}],816:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.ONEAVGYEAR,i=n.ONEAVGMONTH,o=n.ONEDAY,s=n.ONEHOUR,l=n.ONEMIN,c=n.ONESEC,u=e("../../plots/cartesian/axes").tickIncrement;function f(e,t,r,n){if(e*t<=0)return 1/0;for(var a=Math.abs(t-e),i="date"===r.type,o=p(a,i),s=0;s<10;s++){var l=p(80*o,i);if(o===l)break;if(!h(l,e,t,i,r,n))break;o=l}return o}function p(e,t){return t&&e>c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>s?s:e>l?l:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function h(e,t,r,n,i,s){if(n&&e>o){var l=d(t,i,s),c=d(r,i,s),u=e===a?0:1;return l[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function d(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var s,l,c=-1.1*t,p=-.1*t,h=e-p,d=r[0],m=r[1],g=Math.min(f(d+p,d+h,n,i),f(m+p,m+h,n,i)),y=Math.min(f(d+c,d+p,n,i),f(m+c,m+p,n,i));if(g>y&&y<Math.abs(m-d)/4e3?(s=g,l=!1):(s=Math.min(g,y),l=!0),"date"===n.type&&s>o){var v=s===a?1:6,b=s===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),s=o.indexOf("-",v);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,i);if(c<t){var f=u(c,b,!1,i);(c+f)/2<t+e&&(c=f)}return r&&l?u(c,b,!0,i):c}}return function(t,r){var n=s*Math.round(t/s);return n+s/10<t&&n+.9*s<t+e&&(n+=s),r&&l&&(n-=s),n}}},{"../../constants/numerical":479,"../../plots/cartesian/axes":554}],817:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../registry"),o=e("../../plots/cartesian/axes"),s=e("../bar/arrays_to_calcdata"),l=e("./bin_functions"),c=e("./norm_functions"),u=e("./average"),f=e("./bin_label_vals");function p(e,t,r,s,l){var c,u,f,h,d,m,g,y=s+"bins",v=e._fullLayout,b=t["_"+s+"bingroup"],x=v._histogramBinOpts[b],_="overlay"===v.barmode,w=function(e){return r.r2c(e,0,h)},k=function(e){return r.c2r(e,0,h)},D="date"===r.type?function(e){return e||0===e?a.cleanDate(e,null,h):null}:function(e){return n(e)?Number(e):null};function T(e,t,r){t[e+"Found"]?(t[e]=D(t[e]),null===t[e]&&(t[e]=r[e])):(m[e]=t[e]=r[e],a.nestedProperty(u[0],y+"."+e).set(r[e]))}if(t["_"+s+"autoBinFinished"])delete t["_"+s+"autoBinFinished"];else{u=x.traces;var A=[],S=!0,M=!1,E=!1;for(c=0;c<u.length;c++)if((f=u[c]).visible){var C=x.dirs[c];d=f["_"+C+"pos0"]=r.makeCalcdata(f,C),A=a.concat(A,d),delete f["_"+s+"autoBinFinished"],!0===t.visible&&(S?S=!1:(delete f._autoBin,f["_"+s+"autoBinFinished"]=1),i.traceIs(f,"2dMap")&&(M=!0),"histogram2dcontour"===f.type&&(E=!0))}h=u[0][s+"calendar"];var N=o.autoBin(A,r,x.nbins,M,h,x.sizeFound&&x.size),O=u[0]._autoBin={};if(m=O[x.dirs[0]]={},E&&(x.size||(N.start=k(o.tickIncrement(w(N.start),N.size,!0,h))),void 0===x.end&&(N.end=k(o.tickIncrement(w(N.end),N.size,!1,h)))),_&&!i.traceIs(t,"2dMap")&&0===N._dataSpan&&"category"!==r.type&&"multicategory"!==r.type){if(l)return[N,d,!0];N=function(e,t,r,n,i){var o,s,l,c=e._fullLayout,u=function(e,t){for(var r=t.xaxis,n=t.yaxis,a=t.orientation,i=[],o=e._fullData,s=0;s<o.length;s++){var l=o[s];"histogram"===l.type&&!0===l.visible&&l.orientation===a&&l.xaxis===r&&l.yaxis===n&&i.push(l)}return i}(e,t),f=!1,h=1/0,d=[t];for(o=0;o<u.length;o++)if((s=u[o])===t)f=!0;else if(f){var m=p(e,s,r,n,!0),g=m[0],y=m[2];s["_"+n+"autoBinFinished"]=1,s["_"+n+"pos0"]=m[1],y?d.push(s):h=Math.min(h,g.size)}else l=c._histogramBinOpts[s["_"+n+"bingroup"]],h=Math.min(h,l.size||s[i].size);var v=new Array(d.length);for(o=0;o<d.length;o++)for(var b=d[o]["_"+n+"pos0"],x=0;x<b.length;x++)if(void 0!==b[x]){v[o]=b[x];break}for(isFinite(h)||(h=a.distinctVals(v).minDiff),o=0;o<d.length;o++){var _=(s=d[o])[n+"calendar"],w={start:r.c2r(v[o]-h/2,0,_),end:r.c2r(v[o]+h/2,0,_),size:h};s._input[i]=s[i]=w,(l=c._histogramBinOpts[s["_"+n+"bingroup"]])&&a.extendFlat(l,w)}return t[i]}(e,t,r,s,y)}(g=f.cumulative||{}).enabled&&"include"!==g.currentbin&&("decreasing"===g.direction?N.start=k(o.tickIncrement(w(N.start),N.size,!0,h)):N.end=k(o.tickIncrement(w(N.end),N.size,!1,h))),x.size=N.size,x.sizeFound||(m.size=N.size,a.nestedProperty(u[0],y+".size").set(N.size)),T("start",x,N),T("end",x,N)}d=t["_"+s+"pos0"],delete t["_"+s+"pos0"];var I=t._input[y]||{},P=a.extendFlat({},x),R=x.start,L=r.r2l(I.start),F=void 0!==L;if((x.startFound||F)&&L!==r.r2l(R)){var B=F?L:a.aggNums(Math.min,null,d),z={type:"category"===r.type||"multicategory"===r.type?"linear":r.type,r2l:r.r2l,dtick:x.size,tick0:R,calendar:h,range:[B,o.tickIncrement(B,x.size,!1,h)].map(r.l2r)},j=o.tickFirst(z);j>r.r2l(B)&&(j=o.tickIncrement(j,x.size,!0,h)),P.start=r.l2r(j),F||a.nestedProperty(t,y+".start").set(P.start)}var U=x.end,$=r.r2l(I.end),V=void 0!==$;if((x.endFound||V)&&$!==r.r2l(U)){var q=V?$:a.aggNums(Math.max,null,d);P.end=r.l2r(q),V||a.nestedProperty(t,y+".start").set(P.end)}var W="autobin"+s;return!1===t._input[W]&&(t._input[y]=a.extendFlat({},t[y]||{}),delete t._input[W],delete t[W]),[P,d]}t.exports={calc:function(e,t){var r,i,h,d,m=[],g=[],y="h"===t.orientation,v=o.getFromId(e,y?t.yaxis:t.xaxis),b=y?"y":"x",x={x:"y",y:"x"}[b],_=t[b+"calendar"],w=t.cumulative,k=p(e,t,v,b),D=k[0],T=k[1],A="string"==typeof D.size,S=[],M=A?S:D,E=[],C=[],N=[],O=0,I=t.histnorm,P=t.histfunc,R=-1!==I.indexOf("density");w.enabled&&R&&(I=I.replace(/ ?density$/,""),R=!1);var L,F="max"===P||"min"===P?null:0,B=l.count,z=c[I],j=!1,U=function(e){return v.r2c(e,0,_)};for(a.isArrayOrTypedArray(t[x])&&"count"!==P&&(L=t[x],j="avg"===P,B=l[P]),r=U(D.start),h=U(D.end)+(r-o.tickIncrement(r,D.size,!1,_))/1e6;r<h&&m.length<1e6&&(i=o.tickIncrement(r,D.size,!1,_),m.push((r+i)/2),g.push(F),N.push([]),S.push(r),R&&E.push(1/(i-r)),j&&C.push(0),!(i<=r));)r=i;S.push(r),A||"date"!==v.type||(M={start:U(M.start),end:U(M.end),size:M.size}),e._fullLayout._roundFnOpts||(e._fullLayout._roundFnOpts={});var $=t["_"+b+"bingroup"],V={leftGap:1/0,rightGap:1/0};$&&(e._fullLayout._roundFnOpts[$]||(e._fullLayout._roundFnOpts[$]=V),V=e._fullLayout._roundFnOpts[$]);var q,W=g.length,H=!0,G=V.leftGap,X=V.rightGap,Y={};for(r=0;r<T.length;r++){var Z=T[r];(d=a.findBin(Z,M))>=0&&d<W&&(O+=B(d,r,g,L,C),H&&N[d].length&&Z!==T[N[d][0]]&&(H=!1),N[d].push(r),Y[r]=d,G=Math.min(G,Z-S[d]),X=Math.min(X,S[d+1]-Z))}V.leftGap=G,V.rightGap=X,H||(q=function(t,r){return function(){var n=e._fullLayout._roundFnOpts[$];return f(n.leftGap,n.rightGap,S,v,_)(t,r)}}),j&&(O=u(g,C)),z&&z(g,O,E),w.enabled&&function(e,t,r){var n,a,i;function o(t){i=e[t],e[t]/=2}function s(t){a=e[t],e[t]=i+a/2,i+=a}if("half"===r)if("increasing"===t)for(o(0),n=1;n<e.length;n++)s(n);else for(o(e.length-1),n=e.length-2;n>=0;n--)s(n);else if("increasing"===t){for(n=1;n<e.length;n++)e[n]+=e[n-1];"exclude"===r&&(e.unshift(0),e.pop())}else{for(n=e.length-2;n>=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(g,w.direction,w.currentbin);var K=Math.min(m.length,g.length),J=[],Q=0,ee=K-1;for(r=0;r<K;r++)if(g[r]){Q=r;break}for(r=K-1;r>=Q;r--)if(g[r]){ee=r;break}for(r=Q;r<=ee;r++)if(n(m[r])&&n(g[r])){var te={p:m[r],s:g[r],b:0};w.enabled||(te.pts=N[r],H?te.ph0=te.ph1=N[r].length?T[N[r][0]]:m[r]:(t._computePh=!0,te.ph0=q(S[r]),te.ph1=q(S[r+1],!0))),J.push(te)}return 1===J.length&&(J[0].width1=o.tickIncrement(J[0].p,D.size,!1,_)-J[0].p),s(J,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected(J,t,Y),J},calcAllAutoBins:p}},{"../../lib":503,"../../plots/cartesian/axes":554,"../../registry":638,"../bar/arrays_to_calcdata":647,"./average":813,"./bin_functions":815,"./bin_label_vals":816,"./norm_functions":824,"fast-isnumeric":190}],818:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],819:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=e("../../plots/cartesian/constraints").getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];t.exports=function(e,t){var r,f,p,h,d,m,g,y=t._histogramBinOpts={},v=[],b={},x=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function k(e,r,i){var o=e.uid+"__"+i;r||(r=o);var s=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),l=e[i+"calendar"]||"",c=y[r],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,s!==c.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(y[r]={traces:[e],dirs:[i],axType:s,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(d=0;d<e.length;d++)r=e[d],i(r,"histogram")&&(v.push(r),delete r._xautoBinFinished,delete r._yautoBinFinished,i(r,"2dMap")||o(r._input,r,t,_));var D=t._alignmentOpts||{};for(d=0;d<v.length;d++){if(r=v[d],p="",!i(r,"2dMap")){if(h=w(r),"group"===t.barmode&&r.alignmentgroup){var T=r[h+"axis"],A=l(t,T)+r.orientation;(D[A]||{})[r.alignmentgroup]&&(p=A)}p||"overlay"===t.barmode||(p=l(t,r.xaxis)+l(t,r.yaxis)+w(r))}p?(b[p]||(b[p]=[]),b[p].push(r)):x.push(r)}for(p in b)if(1!==(f=b[p]).length){var S=!1;for(f.length&&(r=f[0],S=_("bingroup")),p=S||p,d=0;d<f.length;d++){var M=(r=f[d])._input.bingroup;M&&M!==p&&n.warn(["Trace",r.index,"must match","within bingroup",p+".","Ignoring its bingroup:",M,"setting."].join(" ")),r.bingroup=p,k(r,p,w(r))}}else x.push(f[0]);for(d=0;d<x.length;d++){r=x[d];var E=_("bingroup");if(i(r,"2dMap"))for(g=0;g<2;g++){var C=_((h=u[g])+"bingroup",E?E+"__"+h:null);k(r,C,h)}else k(r,E,w(r))}for(p in y){var N=y[p];for(f=N.traces,m=0;m<c.length;m++){var O,I,P=c[m],R=P.name;if("nbins"!==R||!N.sizeFound){for(d=0;d<f.length;d++){if(r=f[d],h=N.dirs[d],O=P.aStr[h],void 0!==s(r._input,O).get()){N[R]=_(O),N[R+"Found"]=!0;break}(I=(r._autoBin||{})[h]||{})[R]&&s(r,O).set(I[R])}if("start"===R||"end"===R)for(;d<f.length;d++)(r=f[d])["_"+h+"bingroup"]&&_(O,(I=(r._autoBin||{})[h]||{})[R]);"nbins"!==R||N.sizeFound||N.nbinsFound||(r=f[0],N[R]=_(O))}}}}},{"../../lib":503,"../../plots/cartesian/axis_ids":558,"../../plots/cartesian/constraints":562,"../../registry":638,"../bar/defaults":652}],820:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../components/color"),o=e("../bar/defaults").handleText,s=e("../bar/style_defaults"),l=e("./attributes");t.exports=function(e,t,r,c){function u(r,n){return a.coerce(e,t,l,r,n)}var f=u("x"),p=u("y");u("cumulative.enabled")&&(u("cumulative.direction"),u("cumulative.currentbin")),u("text");var h=u("textposition");o(e,t,c,u,h,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),u("hovertext"),u("hovertemplate"),u("xhoverformat"),u("yhoverformat");var d=u("orientation",p&&!f?"h":"v"),m="v"===d?"x":"y",g="v"===d?"y":"x",y=f&&p?Math.min(a.minRowLength(f)&&a.minRowLength(p)):a.minRowLength(t[m]||[]);if(y){t._length=y,n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],c),t[g]&&u("histfunc"),u("histnorm"),u("autobin"+m),s(e,t,u,r,c),a.coerceSelectionMarkerOpacity(t,u);var v=(t.marker.line||{}).color,b=n.getComponentMethod("errorbars","supplyDefaults");b(e,t,v||i.defaultLine,{axis:"y"}),b(e,t,v||i.defaultLine,{axis:"x",inherit:"y"})}else t.visible=!1}},{"../../components/color":366,"../../lib":503,"../../registry":638,"../bar/defaults":652,"../bar/style_defaults":663,"./attributes":812}],821:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a){if(e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"zLabelVal"in t&&(e.z=t.zLabelVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),!(r.cumulative||{}).enabled){var i,o=Array.isArray(a)?n[0].pts[a[0]][a[1]]:n[a].pts;if(e.pointNumbers=o,e.binNumber=e.pointNumber,delete e.pointNumber,delete e.pointIndex,r._indexToPoints){i=[];for(var s=0;s<o.length;s++)i=i.concat(r._indexToPoints[o[s]])}else i=o;e.pointIndices=i}return e}},{}],822:[function(e,t,r){"use strict";var n=e("../bar/hover").hoverPoints,a=e("../../plots/cartesian/axes").hoverLabelText;t.exports=function(e,t,r,i,o){var s=n(e,t,r,i,o);if(s){var l=(e=s[0]).cd[e.index],c=e.cd[0].trace;if(!c.cumulative.enabled){var u="h"===c.orientation?"y":"x";e[u+"Label"]=a(e[u+"a"],[l.ph0,l.ph1],c[u+"hoverformat"])}return s}}},{"../../plots/cartesian/axes":554,"../bar/hover":655}],823:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("../bar/layout_attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),supplyLayoutDefaults:e("../bar/layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("../bar/cross_trace_calc").crossTraceCalc,plot:e("../bar/plot").plot,layerName:"barlayer",style:e("../bar/style").style,styleOnSelect:e("../bar/style").styleOnSelect,colorbar:e("../scatter/marker_colorbar"),hoverPoints:e("./hover"),selectPoints:e("../bar/select"),eventData:e("./event_data"),moduleType:"trace",name:"histogram",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}},{"../../plots/cartesian":568,"../bar/cross_trace_calc":651,"../bar/layout_attributes":657,"../bar/layout_defaults":658,"../bar/plot":659,"../bar/select":660,"../bar/style":662,"../scatter/marker_colorbar":944,"./attributes":812,"./calc":817,"./cross_trace_defaults":819,"./defaults":820,"./event_data":821,"./hover":822}],824:[function(e,t,r){"use strict";t.exports={percent:function(e,t){for(var r=e.length,n=100/t,a=0;a<r;a++)e[a]*=n},probability:function(e,t){for(var r=e.length,n=0;n<r;n++)e[n]/=t},density:function(e,t,r,n){var a=e.length;n=n||1;for(var i=0;i<a;i++)e[i]*=r[i]*n},"probability density":function(e,t,r,n){var a=e.length;n&&(t/=n);for(var i=0;i<a;i++)e[i]*=r[i]/t}}},{}],825:[function(e,t,r){"use strict";var n=e("../histogram/attributes"),a=e("../histogram/bin_attributes"),i=e("../heatmap/attributes"),o=e("../../plots/attributes"),s=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,l=e("../../plots/template_attributes").hovertemplateAttrs,c=e("../../plots/template_attributes").texttemplateAttrs,u=e("../../components/colorscale/attributes"),f=e("../../lib/extend").extendFlat;t.exports=f({x:n.x,y:n.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:n.histnorm,histfunc:n.histfunc,nbinsx:n.nbinsx,xbins:a("x"),nbinsy:n.nbinsy,ybins:a("y"),autobinx:n.autobinx,autobiny:n.autobiny,bingroup:f({},n.bingroup,{}),xbingroup:f({},n.bingroup,{}),ybingroup:f({},n.bingroup,{}),xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth,xhoverformat:s("x"),yhoverformat:s("y"),zhoverformat:s("z",1),hovertemplate:l({},{keys:"z"}),texttemplate:c({arrayOk:!1,editType:"plot"},{keys:"z"}),textfont:i.textfont,showlegend:f({},o.showlegend,{dflt:!1})},u("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../heatmap/attributes":792,"../histogram/attributes":812,"../histogram/bin_attributes":814}],826:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../histogram/bin_functions"),o=e("../histogram/norm_functions"),s=e("../histogram/average"),l=e("../histogram/bin_label_vals"),c=e("../histogram/calc").calcAllAutoBins;function u(e,t,r,n){var a,i=new Array(e);if(n)for(a=0;a<e;a++)i[a]=1/(t[a+1]-t[a]);else{var o=1/r;for(a=0;a<e;a++)i[a]=o}return i}function f(e,t){return{start:e(t.start),end:e(t.end),size:t.size}}function p(e,t,r,n,a,i){var o,s=e.length-1,c=new Array(s),u=l(r,n,e,a,i);for(o=0;o<s;o++){var f=(t||[])[o];c[o]=void 0===f?[u(e[o]),u(e[o+1],!0)]:[f,f]}return c}t.exports=function(e,t){var r,l,h,d,m=a.getFromId(e,t.xaxis),g=a.getFromId(e,t.yaxis),y=t.xcalendar,v=t.ycalendar,b=function(e){return m.r2c(e,0,y)},x=function(e){return g.r2c(e,0,v)},_=c(e,t,m,"x"),w=_[0],k=_[1],D=c(e,t,g,"y"),T=D[0],A=D[1],S=t._length;k.length>S&&k.splice(S,k.length-S),A.length>S&&A.splice(S,A.length-S);var M=[],E=[],C=[],N="string"==typeof w.size,O="string"==typeof T.size,I=[],P=[],R=N?I:w,L=O?P:T,F=0,B=[],z=[],j=t.histnorm,U=t.histfunc,$=-1!==j.indexOf("density"),V="max"===U||"min"===U?null:0,q=i.count,W=o[j],H=!1,G=[],X=[],Y="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";Y&&"count"!==U&&(H="avg"===U,q=i[U]);var Z=w.size,K=b(w.start),J=b(w.end)+(K-a.tickIncrement(K,Z,!1,y))/1e6;for(r=K;r<J;r=a.tickIncrement(r,Z,!1,y))E.push(V),I.push(r),H&&C.push(0);I.push(r);var Q,ee=E.length,te=(r-K)/ee,re=(Q=K+te/2,m.c2r(Q,0,y)),ne=T.size,ae=x(T.start),ie=x(T.end)+(ae-a.tickIncrement(ae,ne,!1,v))/1e6;for(r=ae;r<ie;r=a.tickIncrement(r,ne,!1,v)){M.push(E.slice()),P.push(r);var oe=new Array(ee);for(l=0;l<ee;l++)oe[l]=[];z.push(oe),H&&B.push(C.slice())}P.push(r);var se=M.length,le=(r-ae)/se,ce=function(e){return g.c2r(e,0,v)}(ae+le/2);$&&(G=u(E.length,R,te,N),X=u(M.length,L,le,O)),N||"date"!==m.type||(R=f(b,R)),O||"date"!==g.type||(L=f(x,L));var ue=!0,fe=!0,pe=new Array(ee),he=new Array(se),de=1/0,me=1/0,ge=1/0,ye=1/0;for(r=0;r<S;r++){var ve=k[r],be=A[r];h=n.findBin(ve,R),d=n.findBin(be,L),h>=0&&h<ee&&d>=0&&d<se&&(F+=q(h,r,M[d],Y,B[d]),z[d][h].push(r),ue&&(void 0===pe[h]?pe[h]=ve:pe[h]!==ve&&(ue=!1)),fe&&(void 0===he[d]?he[d]=be:he[d]!==be&&(fe=!1)),de=Math.min(de,ve-I[h]),me=Math.min(me,I[h+1]-ve),ge=Math.min(ge,be-P[d]),ye=Math.min(ye,P[d+1]-be))}if(H)for(d=0;d<se;d++)F+=s(M[d],B[d]);if(W)for(d=0;d<se;d++)W(M[d],F,G,X[d]);return{x:k,xRanges:p(I,ue&&pe,de,me,m,y),x0:re,dx:te,y:A,yRanges:p(P,fe&&he,ge,ye,g,v),y0:ce,dy:le,z:M,pts:z}}},{"../../lib":503,"../../plots/cartesian/axes":554,"../histogram/average":813,"../histogram/bin_functions":815,"../histogram/bin_label_vals":816,"../histogram/calc":817,"../histogram/norm_functions":824}],827:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./sample_defaults"),i=e("../heatmap/style_defaults"),o=e("../../components/colorscale/defaults"),s=e("../heatmap/label_defaults"),l=e("./attributes");t.exports=function(e,t,r,c){function u(r,a){return n.coerce(e,t,l,r,a)}a(e,t,u,c),!1!==t.visible&&(i(e,t,u,c),o(e,t,c,u,{prefix:"",cLetter:"z"}),u("hovertemplate"),s(u,c),u("xhoverformat"),u("yhoverformat"))}},{"../../components/colorscale/defaults":376,"../../lib":503,"../heatmap/label_defaults":802,"../heatmap/style_defaults":806,"./attributes":825,"./sample_defaults":830}],828:[function(e,t,r){"use strict";var n=e("../heatmap/hover"),a=e("../../plots/cartesian/axes").hoverLabelText;t.exports=function(e,t,r,i,o){var s=n(e,t,r,i,o);if(s){var l=(e=s[0]).index,c=l[0],u=l[1],f=e.cd[0],p=f.trace,h=f.xRanges[u],d=f.yRanges[c];return e.xLabel=a(e.xa,[h[0],h[1]],p.xhoverformat),e.yLabel=a(e.ya,[d[0],d[1]],p.yhoverformat),s}}},{"../../plots/cartesian/axes":554,"../heatmap/hover":799}],829:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("../histogram/cross_trace_defaults"),calc:e("../heatmap/calc"),plot:e("../heatmap/plot"),layerName:"heatmaplayer",colorbar:e("../heatmap/colorbar"),style:e("../heatmap/style"),hoverPoints:e("./hover"),eventData:e("../histogram/event_data"),moduleType:"trace",name:"histogram2d",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}},{"../../plots/cartesian":568,"../heatmap/calc":793,"../heatmap/colorbar":795,"../heatmap/plot":804,"../heatmap/style":805,"../histogram/cross_trace_defaults":819,"../histogram/event_data":821,"./attributes":825,"./defaults":827,"./hover":828}],830:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports=function(e,t,r,i){var o=r("x"),s=r("y"),l=a.minRowLength(o),c=a.minRowLength(s);l&&c?(t._length=Math.min(l,c),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],i),(r("z")||r("marker.color"))&&r("histfunc"),r("histnorm"),r("autobinx"),r("autobiny")):t.visible=!1}},{"../../lib":503,"../../registry":638}],831:[function(e,t,r){"use strict";var n=e("../histogram2d/attributes"),a=e("../contour/attributes"),i=e("../../components/colorscale/attributes"),o=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=e("../../lib/extend").extendFlat;t.exports=s({x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,nbinsx:n.nbinsx,xbins:n.xbins,nbinsy:n.nbinsy,ybins:n.ybins,autobinx:n.autobinx,autobiny:n.autobiny,bingroup:n.bingroup,xbingroup:n.xbingroup,ybingroup:n.ybingroup,autocontour:a.autocontour,ncontours:a.ncontours,contours:a.contours,line:{color:a.line.color,width:s({},a.line.width,{dflt:.5}),dash:a.line.dash,smoothing:a.line.smoothing,editType:"plot"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:n.hovertemplate,texttemplate:a.texttemplate,textfont:a.textfont},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/cartesian/axis_format_attributes":557,"../contour/attributes":735,"../histogram2d/attributes":825}],832:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../histogram2d/sample_defaults"),i=e("../contour/contours_defaults"),o=e("../contour/style_defaults"),s=e("../heatmap/label_defaults"),l=e("./attributes");t.exports=function(e,t,r,c){function u(r,a){return n.coerce(e,t,l,r,a)}a(e,t,u,c),!1!==t.visible&&(i(e,t,u,(function(r){return n.coerce2(e,t,l,r)})),o(e,t,u,c),u("xhoverformat"),u("yhoverformat"),u("hovertemplate"),t.contours&&"heatmap"===t.contours.coloring&&s(u,c))}},{"../../lib":503,"../contour/contours_defaults":742,"../contour/style_defaults":756,"../heatmap/label_defaults":802,"../histogram2d/sample_defaults":830,"./attributes":831}],833:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("../histogram/cross_trace_defaults"),calc:e("../contour/calc"),plot:e("../contour/plot").plot,layerName:"contourlayer",style:e("../contour/style"),colorbar:e("../contour/colorbar"),hoverPoints:e("../contour/hover"),moduleType:"trace",name:"histogram2dcontour",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}},{"../../plots/cartesian":568,"../contour/calc":736,"../contour/colorbar":738,"../contour/hover":748,"../contour/plot":753,"../contour/style":755,"../histogram/cross_trace_defaults":819,"./attributes":831,"./defaults":832}],834:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../../plots/template_attributes").texttemplateAttrs,i=e("../../components/colorscale/attributes"),o=e("../../plots/domain").attributes,s=e("../pie/attributes"),l=e("../sunburst/attributes"),c=e("../treemap/attributes"),u=e("../treemap/constants"),f=e("../../lib/extend").extendFlat;t.exports={labels:l.labels,parents:l.parents,values:l.values,branchvalues:l.branchvalues,count:l.count,level:l.level,maxdepth:l.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:c.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:f({colors:l.marker.colors,line:l.marker.line,editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),leaf:l.leaf,pathbar:c.pathbar,text:s.text,textinfo:l.textinfo,texttemplate:a({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:u.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:c.outsidetextfont,textposition:c.textposition,sort:s.sort,root:l.root,domain:o({name:"icicle",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/domain":584,"../../plots/template_attributes":633,"../pie/attributes":900,"../sunburst/attributes":1045,"../treemap/attributes":1071,"../treemap/constants":1074}],835:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="icicle",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":619}],836:[function(e,t,r){"use strict";var n=e("../sunburst/calc");r.calc=function(e,t){return n.calc(e,t)},r.crossTraceCalc=function(e){return n._runCrossTraceCalc("icicle",e)}},{"../sunburst/calc":1047}],837:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../components/color"),o=e("../../plots/domain").defaults,s=e("../bar/defaults").handleText,l=e("../bar/constants").TEXTPAD,c=e("../../components/colorscale"),u=c.hasColorscale,f=c.handleDefaults;t.exports=function(e,t,r,c){function p(r,i){return n.coerce(e,t,a,r,i)}var h=p("labels"),d=p("parents");if(h&&h.length&&d&&d.length){var m=p("values");m&&m.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),p("tiling.orientation"),p("tiling.flip"),p("tiling.pad");var g=p("text");p("texttemplate"),t.texttemplate||p("textinfo",Array.isArray(g)?"text+label":"label"),p("hovertext"),p("hovertemplate");var y=p("pathbar.visible");s(e,t,c,p,"auto",{hasPathbar:y,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition"),p("marker.line.width")&&p("marker.line.color",c.paper_bgcolor),p("marker.colors");var v=t._hasColorscale=u(e,"marker","colors")||(e.marker||{}).coloraxis;v&&f(e,t,c,p,{prefix:"marker.",cLetter:"c"}),p("leaf.opacity",v?1:.7),t._hovered={marker:{line:{width:2,color:i.contrast(c.paper_bgcolor)}}},y&&(p("pathbar.thickness",t.pathbar.textfont.size+2*l),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),o(t,c,p),t._length=null}else t.visible=!1}},{"../../components/color":366,"../../components/colorscale":378,"../../lib":503,"../../plots/domain":584,"../bar/constants":650,"../bar/defaults":652,"./attributes":834}],838:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../../lib/svg_text_utils"),s=e("./partition"),l=e("./style").styleOne,c=e("../treemap/constants"),u=e("../sunburst/helpers"),f=e("../sunburst/fx"),p=e("../sunburst/plot").formatSliceLabel;t.exports=function(e,t,r,h,d){var m=d.width,g=d.height,y=d.viewX,v=d.viewY,b=d.pathSlice,x=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,k=d.handleSlicesExit,D=d.makeUpdateSliceInterpolator,T=d.makeUpdateTextInterpolator,A=d.prevEntry,S=e._fullLayout,M=t[0].trace,E=-1!==M.textposition.indexOf("left"),C=-1!==M.textposition.indexOf("right"),N=-1!==M.textposition.indexOf("bottom"),O=s(r,[m,g],{flipX:M.tiling.flip.indexOf("x")>-1,flipY:M.tiling.flip.indexOf("y")>-1,orientation:M.tiling.orientation,pad:{inner:M.tiling.pad},maxDepth:M._maxDepth}).descendants(),I=1/0,P=-1/0;O.forEach((function(e){var t=e.depth;t>=M._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(I=Math.min(I,t),P=Math.max(P,t))})),h=h.data(O,u.getPtId),M._maxVisibleLayers=isFinite(P)?P-I+1:0,h.enter().append("g").classed("slice",!0),k(h,!1,{},[m,g],b),h.order();var R=null;if(w&&A){var L=u.getPtId(A);h.each((function(e){null===R&&u.getPtId(e)===L&&(R={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var F=function(){return R||{x0:0,x1:m,y0:0,y1:g}},B=h;return w&&(B=B.transition().each("end",(function(){var t=n.select(this);u.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),B.each((function(s){s._x0=y(s.x0),s._x1=y(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=y(s.x1-M.tiling.pad),s._hoverY=v(N?s.y1-M.tiling.pad/2:s.y0+M.tiling.pad/2);var h=n.select(this),d=a.ensureSingle(h,"path","surface",(function(e){e.style("pointer-events","all")}));w?d.transition().attrTween("d",(function(e){var t=D(e,!1,F(),[m,g],{orientation:M.tiling.orientation,flipX:M.tiling.flip.indexOf("x")>-1,flipY:M.tiling.flip.indexOf("y")>-1});return function(e){return b(t(e))}})):d.attr("d",b),h.call(f,r,e,t,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,e,{isTransitioning:e._transitioning}),d.call(l,s,M,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=p(s,r,M,t,S)||"";var k=a.ensureSingle(h,"g","slicetext"),A=a.ensureSingle(k,"text","",(function(e){e.attr("data-notex",1)})),O=a.ensureUniformFontSize(e,u.determineTextFont(M,s,S.font));A.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":E?"start":"middle").call(i.font,O).call(o.convertToTspans,e),s.textBB=i.bBox(A.node()),s.transform=x(s,{fontSize:O.size}),s.transform.fontSize=O.size,w?A.transition().attrTween("transform",(function(e){var t=T(e,!1,F(),[m,g]);return function(e){return _(t(e))}})):A.attr("transform",_(s))})),R}},{"../../components/drawing":388,"../../lib":503,"../../lib/svg_text_utils":529,"../sunburst/fx":1050,"../sunburst/helpers":1051,"../sunburst/plot":1055,"../treemap/constants":1074,"./partition":842,"./style":844,"@plotly/d3":58}],839:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"icicle",basePlotModule:e("./base_plot"),categories:[],animatable:!0,attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style").style,colorbar:e("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":944,"./attributes":834,"./base_plot":835,"./calc":836,"./defaults":837,"./layout_attributes":840,"./layout_defaults":841,"./plot":843,"./style":844}],840:[function(e,t,r){"use strict";t.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],841:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("iciclecolorway",t.colorway),r("extendiciclecolors")}},{"../../lib":503,"./layout_attributes":840}],842:[function(e,t,r){"use strict";var n=e("d3-hierarchy"),a=e("../treemap/flip_tree");t.exports=function(e,t,r){var i=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,c=t[0],u=t[1];l&&(c=(e.height+1)*t[0]/Math.min(e.height+1,l),u=(e.height+1)*t[1]/Math.min(e.height+1,l));var f=n.partition().padding(r.pad.inner).size(s?[t[1],c]:[t[0],u])(e);return(s||i||o)&&a(f,t,{swapXY:s,flipX:i,flipY:o}),f}},{"../treemap/flip_tree":1079,"d3-hierarchy":115}],843:[function(e,t,r){"use strict";var n=e("../treemap/draw"),a=e("./draw_descendants");t.exports=function(e,t,r,i){return n(e,t,r,i,{type:"icicle",drawDescendants:a})}},{"../treemap/draw":1076,"./draw_descendants":838}],844:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/color"),i=e("../../lib"),o=e("../bar/uniform_text").resizeText;function s(e,t,r){var n=t.data.data,o=!t.children,s=n.i,l=i.castOption(r,s,"marker.line.color")||a.defaultLine,c=i.castOption(r,s,"marker.line.width")||0;e.style("stroke-width",c).call(a.fill,n.color).call(a.stroke,l).style("opacity",o?r.leaf.opacity:null)}t.exports={style:function(e){var t=e._fullLayout._iciclelayer.selectAll(".trace");o(e,t,"icicle"),t.each((function(e){var t=n.select(this),r=e[0].trace;t.style("opacity",r.opacity),t.selectAll("path.surface").each((function(e){n.select(this).call(s,e,r)}))}))},styleOne:s}},{"../../components/color":366,"../../lib":503,"../bar/uniform_text":664,"@plotly/d3":58}],845:[function(e,t,r){"use strict";for(var n=e("../../plots/attributes"),a=e("../../plots/template_attributes").hovertemplateAttrs,i=e("../../lib/extend").extendFlat,o=e("./constants").colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],c=[],u=0;u<s.length;u++){var f=o[s[u]];l.push("For the `"+s[u]+"` colormodel, it is ["+(f.zminDflt||f.min).join(", ")+"]."),c.push("For the `"+s[u]+"` colormodel, it is ["+(f.zmaxDflt||f.max).join(", ")+"].")}t.exports=i({source:{valType:"string",editType:"calc"},z:{valType:"data_array",editType:"calc"},colormodel:{valType:"enumerated",values:s,editType:"calc"},zsmooth:{valType:"enumerated",values:["fast",!1],dflt:!1,editType:"plot"},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dx:{valType:"number",dflt:1,editType:"calc"},dy:{valType:"number",dflt:1,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"data_array",editType:"plot"},hoverinfo:i({},n.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:a({},{keys:["z","color","colormodel"]}),transforms:void 0})},{"../../lib/extend":493,"../../plots/attributes":550,"../../plots/template_attributes":633,"./constants":847}],846:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./constants"),i=e("fast-isnumeric"),o=e("../../plots/cartesian/axes"),s=e("../../lib").maxRowLength,l=e("./helpers").getImageSize;function c(e,t,r,a){return function(i){return n.constrain((i-e)*t,r,a)}}function u(e,t){return function(r){return n.constrain(r,e,t)}}t.exports=function(e,t){var r,n;if(t._hasZ)r=t.z.length,n=s(t.z);else if(t._hasSource){var f=l(t.source);r=f.height,n=f.width}var p,h=o.getFromId(e,t.xaxis||"x"),d=o.getFromId(e,t.yaxis||"y"),m=h.d2c(t.x0)-t.dx/2,g=d.d2c(t.y0)-t.dy/2,y=[m,m+n*t.dx],v=[g,g+r*t.dy];if(h&&"log"===h.type)for(p=0;p<n;p++)y.push(m+p*t.dx);if(d&&"log"===d.type)for(p=0;p<r;p++)v.push(g+p*t.dy);return t._extremes[h._id]=o.findExtremes(h,y),t._extremes[d._id]=o.findExtremes(d,v),t._scaler=function(e){var t=a.colormodel[e.colormodel],r=(t.colormodel||e.colormodel).length;e._sArray=[];for(var n=0;n<r;n++)t.min[n]!==e.zmin[n]||t.max[n]!==e.zmax[n]?e._sArray.push(c(e.zmin[n],(t.max[n]-t.min[n])/(e.zmax[n]-e.zmin[n]),t.min[n],t.max[n])):e._sArray.push(u(t.min[n],t.max[n]));return function(t){for(var n=t.slice(0,r),a=0;a<r;a++){var o=n[a];if(!i(o))return!1;n[a]=e._sArray[a](o)}return n}}(t),[{x0:m,y0:g,z:t.z,w:n,h:r}]}},{"../../lib":503,"../../plots/cartesian/axes":554,"./constants":847,"./helpers":850,"fast-isnumeric":190}],847:[function(e,t,r){"use strict";t.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(e){return e.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(e){return e.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(e){return e.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(e){var t=e.slice(0,3);return t[1]=t[1]+"%",t[2]=t[2]+"%",t},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(e){var t=e.slice(0,4);return t[1]=t[1]+"%",t[2]=t[2]+"%",t},suffix:["°","%","%",""]}},pixelatedStyle:["image-rendering: optimizeSpeed","image-rendering: -moz-crisp-edges","image-rendering: -o-crisp-edges","image-rendering: -webkit-optimize-contrast","image-rendering: optimize-contrast","image-rendering: crisp-edges","image-rendering: pixelated",""].join("; ")}},{}],848:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("./constants"),o=e("../../snapshot/helpers").IMAGE_URL_PREFIX;t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("source"),t.source&&!t.source.match(o)&&delete t.source,t._hasSource=!!t.source;var s,l=r("z");t._hasZ=!(void 0===l||!l.length||!l[0]||!l[0].length),t._hasZ||t._hasSource?(r("x0"),r("y0"),r("dx"),r("dy"),t._hasZ?(r("colormodel","rgb"),r("zmin",(s=i.colormodel[t.colormodel]).zminDflt||s.min),r("zmax",s.zmaxDflt||s.max)):t._hasSource&&(t.colormodel="rgba256",s=i.colormodel[t.colormodel],t.zmin=s.zminDflt,t.zmax=s.zmaxDflt),r("zsmooth"),r("text"),r("hovertext"),r("hovertemplate"),t._length=null):t.visible=!1}},{"../../lib":503,"../../snapshot/helpers":642,"./attributes":845,"./constants":847}],849:[function(e,t,r){"use strict";t.exports=function(e,t){return"xVal"in t&&(e.x=t.xVal),"yVal"in t&&(e.y=t.yVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e.color=t.color,e.colormodel=t.trace.colormodel,e.z||(e.z=t.color),e}},{}],850:[function(e,t,r){"use strict";var n=e("probe-image-size/sync"),a=e("../../snapshot/helpers").IMAGE_URL_PREFIX,i=e("buffer/").Buffer;r.getImageSize=function(e){var t=e.replace(a,""),r=new i(t,"base64");return n(r)}},{"../../snapshot/helpers":642,"buffer/":85,"probe-image-size/sync":276}],851:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../lib"),i=e("./constants");t.exports=function(e,t,r){var o=e.cd[0],s=o.trace,l=e.xa,c=e.ya;if(!(n.inbox(t-o.x0,t-(o.x0+o.w*s.dx),0)>0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u,f=Math.floor((t-o.x0)/s.dx),p=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?u=o.z[p][f]:s._hasSource&&(u=s._canvas.el.getContext("2d").getImageData(f,p,1,1).data),u){var h,d=o.hi||s.hoverinfo;if(d){var m=d.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(h=!0)}var g,y=i.colormodel[s.colormodel],v=y.colormodel||s.colormodel,b=v.length,x=s._scaler(u),_=y.suffix,w=[];(s.hovertemplate||h)&&(w.push("["+[x[0]+_[0],x[1]+_[1],x[2]+_[2]].join(", ")),4===b&&w.push(", "+x[3]+_[3]),w.push("]"),w=w.join(""),e.extraText=v.toUpperCase()+": "+w),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[p])?g=s.hovertext[p][f]:Array.isArray(s.text)&&Array.isArray(s.text[p])&&(g=s.text[p][f]);var k=c.c2p(o.y0+(p+.5)*s.dy),D=o.x0+(f+.5)*s.dx,T=o.y0+(p+.5)*s.dy,A="["+u.slice(0,s.colormodel.length).join(", ")+"]";return[a.extendFlat(e,{index:[p,f],x0:l.c2p(o.x0+f*s.dx),x1:l.c2p(o.x0+(f+1)*s.dx),y0:k,y1:k,color:x,xVal:D,xLabelVal:D,yVal:T,yLabelVal:T,zLabelVal:A,text:g,hovertemplateLabels:{zLabel:A,colorLabel:w,"color[0]Label":x[0]+_[0],"color[1]Label":x[1]+_[1],"color[2]Label":x[2]+_[2],"color[3]Label":x[3]+_[3]}})]}}}},{"../../components/fx":406,"../../lib":503,"./constants":847}],852:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover"),eventData:e("./event_data"),moduleType:"trace",name:"image",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":568,"./attributes":845,"./calc":846,"./defaults":848,"./event_data":849,"./hover":851,"./plot":853,"./style":854}],853:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.strTranslate,o=e("../../constants/xmlns_namespaces"),s=e("./constants"),l=a.isIOS()||a.isSafari()||a.isIE();t.exports=function(e,t,r,c){var u=t.xaxis,f=t.yaxis,p=!(l||e._context._exportedPlot);a.makeTraceGroups(c,r,"im").each((function(t){var r=n.select(this),l=t[0],c=l.trace,h=("fast"===c.zsmooth||!1===c.zsmooth&&p)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._realImage=h;var d,m,g,y,v,b,x=l.z,_=l.x0,w=l.y0,k=l.w,D=l.h,T=c.dx,A=c.dy;for(b=0;void 0===d&&b<k;)d=u.c2p(_+b*T),b++;for(b=k;void 0===m&&b>0;)m=u.c2p(_+b*T),b--;for(b=0;void 0===y&&b<D;)y=f.c2p(w+b*A),b++;for(b=D;void 0===v&&b>0;)v=f.c2p(w+b*A),b--;m<d&&(g=m,m=d,d=g),v<y&&(g=y,y=v,v=g),h||(d=Math.max(-.5*u._length,d),m=Math.min(1.5*u._length,m),y=Math.max(-.5*f._length,y),v=Math.min(1.5*f._length,v));var S=Math.round(m-d),M=Math.round(v-y);if(S<=0||M<=0)r.selectAll("image").data([]).exit().remove();else{var E=r.selectAll("image").data([t]);E.enter().append("svg:image").attr({xmlns:o.svg,preserveAspectRatio:"none"}),E.exit().remove();var C=!1===c.zsmooth?s.pixelatedStyle:"";if(h){var N=a.simpleMap(u.range,u.r2l),O=a.simpleMap(f.range,f.r2l),I=N[1]<N[0],P=O[1]>O[0];if(I||P){var R=d+S/2,L=y+M/2;C+="transform:"+i(R+"px",L+"px")+"scale("+(I?-1:1)+","+(P?-1:1)+")"+i(-R+"px",-L+"px")+";"}}E.attr("style",C);var F=new Promise((function(e){if(c._hasZ)e();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===k&&c._canvas.el.height===D&&c._canvas.source===c.source)e();else{var t=document.createElement("canvas");t.width=k,t.height=D;var r=t.getContext("2d");c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:t,source:c.source},e()},n.setAttribute("src",c.source)}})).then((function(){var e;if(c._hasZ)e=B((function(e,t){return x[t][e]})).toDataURL("image/png");else if(c._hasSource)if(h)e=c.source;else{var t=c._canvas.el.getContext("2d").getImageData(0,0,k,D).data;e=B((function(e,r){var n=4*(r*k+e);return[t[n],t[n+1],t[n+2],t[n+3]]})).toDataURL("image/png")}E.attr({"xlink:href":e,height:M,width:S,x:d,y})}));e._promises.push(F)}function B(e){var t=document.createElement("canvas");t.width=S,t.height=M;var r,n=t.getContext("2d"),i=function(e){return a.constrain(Math.round(u.c2p(_+e*T)-d),0,S)},o=function(e){return a.constrain(Math.round(f.c2p(w+e*A)-y),0,M)},p=s.colormodel[c.colormodel],h=p.colormodel||c.colormodel,m=p.fmt;for(b=0;b<l.w;b++){var g=i(b),v=i(b+1);if(v!==g&&!isNaN(v)&&!isNaN(g))for(var x=0;x<l.h;x++){var k=o(x),D=o(x+1);D===k||isNaN(D)||isNaN(k)||!e(b,x)||(r=c._scaler(e(b,x)),n.fillStyle=r?h+"("+m(r).join(",")+")":"rgba(0,0,0,0)",n.fillRect(g,k,v-g,D-k))}}return t}}))}},{"../../constants/xmlns_namespaces":480,"../../lib":503,"./constants":847,"@plotly/d3":58}],854:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e){n.select(e).selectAll(".im image").style("opacity",(function(e){return e[0].trace.opacity}))}},{"@plotly/d3":58}],855:[function(e,t,r){"use strict";var n=e("../../lib/extend").extendFlat,a=e("../../lib/extend").extendDeep,i=e("../../plot_api/edit_types").overrideAll,o=e("../../plots/font_attributes"),s=e("../../components/color/attributes"),l=e("../../plots/domain").attributes,c=e("../../plots/cartesian/layout_attributes"),u=e("../../plot_api/plot_template").templatedArray,f=e("../../constants/delta.js"),p=e("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers,h=o({editType:"plot",colorEditType:"plot"}),d={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:s.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},m={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},g=u("step",a({},d,{range:m}));t.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:l({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:n({},h,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:p("value")},font:n({},h,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:p("value")},increasing:{symbol:{valType:"string",dflt:f.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:f.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:f.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:f.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:n({},h,{}),editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:a({},d,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:s.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:i({range:m,visible:n({},c.visible,{dflt:!0}),tickmode:c.tickmode,nticks:c.nticks,tick0:c.tick0,dtick:c.dtick,tickvals:c.tickvals,ticktext:c.ticktext,ticks:n({},c.ticks,{dflt:"outside"}),ticklen:c.ticklen,tickwidth:c.tickwidth,tickcolor:c.tickcolor,showticklabels:c.showticklabels,tickfont:o({}),tickangle:c.tickangle,tickformat:c.tickformat,tickformatstops:c.tickformatstops,tickprefix:c.tickprefix,showtickprefix:c.showtickprefix,ticksuffix:c.ticksuffix,showticksuffix:c.showticksuffix,separatethousands:c.separatethousands,exponentformat:c.exponentformat,minexponent:c.minexponent,showexponent:c.showexponent,editType:"plot"},"plot"),steps:g,threshold:{line:{color:n({},d.line.color,{}),width:n({},d.line.width,{dflt:1}),editType:"plot"},thickness:n({},d.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}},{"../../components/color/attributes":365,"../../constants/delta.js":473,"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plot_api/plot_template":543,"../../plots/cartesian/axis_format_attributes":557,"../../plots/cartesian/layout_attributes":569,"../../plots/domain":584,"../../plots/font_attributes":585}],856:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="indicator",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":619}],857:[function(e,t,r){"use strict";t.exports={calc:function(e,t){var r=[],n=t.value;"number"!=typeof t._lastValue&&(t._lastValue=t.value);var a=t._lastValue,i=a;return t._hasDelta&&"number"==typeof t.delta.reference&&(i=t.delta.reference),r[0]={y:n,lastY:a,delta:n-i,relativeDelta:(n-i)/i},r}}},{}],858:[function(e,t,r){"use strict";t.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}},{}],859:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults,o=e("../../plot_api/plot_template"),s=e("../../plots/array_container_defaults"),l=e("./constants.js"),c=e("../../plots/cartesian/tick_value_defaults"),u=e("../../plots/cartesian/tick_mark_defaults"),f=e("../../plots/cartesian/tick_label_defaults"),p=e("../../plots/cartesian/prefix_suffix_defaults");function h(e,t){function r(r,i){return n.coerce(e,t,a.gauge.steps,r,i)}r("color"),r("line.color"),r("line.width"),r("range"),r("thickness")}t.exports={supplyDefaults:function(e,t,r,d){function m(r,i){return n.coerce(e,t,a,r,i)}i(t,d,m),m("mode"),t._hasNumber=-1!==t.mode.indexOf("number"),t._hasDelta=-1!==t.mode.indexOf("delta"),t._hasGauge=-1!==t.mode.indexOf("gauge");var g=m("value");t._range=[0,"number"==typeof g?1.5*g:1];var y,v,b,x,_,w,k=new Array(2);function D(e,t){return n.coerce(b,x,a.gauge,e,t)}function T(e,t){return n.coerce(_,w,a.gauge.axis,e,t)}if(t._hasNumber&&(m("number.valueformat"),m("number.font.color",d.font.color),m("number.font.family",d.font.family),m("number.font.size"),void 0===t.number.font.size&&(t.number.font.size=l.defaultNumberFontSize,k[0]=!0),m("number.prefix"),m("number.suffix"),y=t.number.font.size),t._hasDelta&&(m("delta.font.color",d.font.color),m("delta.font.family",d.font.family),m("delta.font.size"),void 0===t.delta.font.size&&(t.delta.font.size=(t._hasNumber?.5:1)*(y||l.defaultNumberFontSize),k[1]=!0),m("delta.reference",t.value),m("delta.relative"),m("delta.valueformat",t.delta.relative?"2%":""),m("delta.increasing.symbol"),m("delta.increasing.color"),m("delta.decreasing.symbol"),m("delta.decreasing.color"),m("delta.position"),v=t.delta.font.size),t._scaleNumbers=(!t._hasNumber||k[0])&&(!t._hasDelta||k[1])||!1,m("title.font.color",d.font.color),m("title.font.family",d.font.family),m("title.font.size",.25*(y||v||l.defaultNumberFontSize)),m("title.text"),t._hasGauge){(b=e.gauge)||(b={}),x=o.newContainer(t,"gauge"),D("shape"),(t._isBullet="bullet"===t.gauge.shape)||m("title.align","center"),(t._isAngular="angular"===t.gauge.shape)||m("align","center"),D("bgcolor",d.paper_bgcolor),D("borderwidth"),D("bordercolor"),D("bar.color"),D("bar.line.color"),D("bar.line.width"),D("bar.thickness",l.valueThickness*("bullet"===t.gauge.shape?.5:1)),s(b,x,{name:"steps",handleItemDefaults:h}),D("threshold.value"),D("threshold.thickness"),D("threshold.line.width"),D("threshold.line.color"),_={},b&&(_=b.axis||{}),w=o.newContainer(x,"axis"),T("visible"),t._range=T("range",t._range);var A={outerTicks:!0};c(_,w,T,"linear"),p(_,w,T,"linear",A),f(_,w,T,"linear",A),u(_,w,T,A)}else m("title.align","center"),m("align","center"),t._isAngular=t._isBullet=!1;t._length=null}}},{"../../lib":503,"../../plot_api/plot_template":543,"../../plots/array_container_defaults":549,"../../plots/cartesian/prefix_suffix_defaults":573,"../../plots/cartesian/tick_label_defaults":578,"../../plots/cartesian/tick_mark_defaults":579,"../../plots/cartesian/tick_value_defaults":580,"../../plots/domain":584,"./attributes":855,"./constants.js":858}],860:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"indicator",basePlotModule:e("./base_plot"),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:e("./attributes"),supplyDefaults:e("./defaults").supplyDefaults,calc:e("./calc").calc,plot:e("./plot"),meta:{}}},{"./attributes":855,"./base_plot":856,"./calc":857,"./defaults":859,"./plot":861}],861:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-interpolate").interpolate,i=e("d3-interpolate").interpolateNumber,o=e("../../lib"),s=o.strScale,l=o.strTranslate,c=o.rad2deg,u=e("../../constants/alignment").MID_SHIFT,f=e("../../components/drawing"),p=e("./constants"),h=e("../../lib/svg_text_utils"),d=e("../../plots/cartesian/axes"),m=e("../../plots/cartesian/axis_defaults"),g=e("../../plots/cartesian/position_defaults"),y=e("../../plots/cartesian/layout_attributes"),v=e("../../components/color"),b={left:"start",center:"middle",right:"end"},x={left:0,center:.5,right:1},_=/[yzafpn\xb5mkMGTPEZY]/;function w(e){return e&&e.duration>0}function k(e){e.each((function(e){v.stroke(n.select(this),e.line.color)})).each((function(e){v.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function D(e,t,r){var n=e._fullLayout,a=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),i={type:"linear",_id:"x"+t._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(e,t){return o.coerce(a,i,y,e,t)}return m(a,i,l,s,n),g(a,i,l,s),i}function T(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function A(e,t,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(h.convertToTspans,a).call(f.font,t),f.bBox(o.node())}function S(e,t,r,n,a,i){var s="_cache"+t;e[s]&&e[s].key===a||(e[s]={key:a,value:r});var l=o.aggNums(i,null,[e[s].value,n],2);return e[s].value=l,l}t.exports=function(e,t,r,m){var g,y=e._fullLayout;w(r)&&m&&(g=m()),o.makeTraceGroups(y._indicatorlayer,t,"trace").each((function(t){var m,M,E,C,N,O=t[0].trace,I=n.select(this),P=O._hasGauge,R=O._isAngular,L=O._isBullet,F=O.domain,B={w:y._size.w*(F.x[1]-F.x[0]),h:y._size.h*(F.y[1]-F.y[0]),l:y._size.l+y._size.w*F.x[0],r:y._size.r+y._size.w*(1-F.x[1]),t:y._size.t+y._size.h*(1-F.y[1]),b:y._size.b+y._size.h*F.y[0]},z=B.l+B.w/2,j=B.t+B.h/2,U=Math.min(B.w/2,B.h),$=p.innerRadius*U,V=O.align||"center";if(M=j,P){if(R&&(m=z,M=j+U/2,E=function(e){return function(e,t){return[t/Math.sqrt(e.width/2*(e.width/2)+e.height*e.height),e,t]}(e,.9*$)}),L){var q=p.bulletPadding,W=1-p.bulletNumberDomainSize+q;m=B.l+(W+(1-W)*x[V])*B.w,E=function(e){return T(e,(p.bulletNumberDomainSize-q)*B.w,B.h)}}}else m=B.l+x[V]*B.w,E=function(e){return T(e,B.w,B.h)};!function(e,t,r,a){var c,u,p,m=r[0].trace,g=a.numbersX,y=a.numbersY,k=m.align||"center",T=b[k],M=a.transitionOpts,E=a.onComplete,C=o.ensureSingle(t,"g","numbers"),N=[];m._hasNumber&&N.push("number"),m._hasDelta&&(N.push("delta"),"left"===m.delta.position&&N.reverse());var O=C.selectAll("text").data(N);function I(t,r,n,a){if(!t.match("s")||n>=0==a>=0||r(n).slice(-1).match(_)||r(a).slice(-1).match(_))return r;var i=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=D(e,{tickformat:i});return function(e){return Math.abs(e)<1?d.tickText(o,e).text:r(e)}}O.enter().append("text"),O.attr("text-anchor",(function(){return T})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),O.exit().remove();var P,R=m.mode+m.align;if(m._hasDelta&&(P=function(){var t=D(e,{tickformat:m.delta.valueformat},m._range);t.setScale(),d.prepTicks(t);var a=function(e){return d.tickText(t,e).text},o=function(e){return m.delta.relative?e.relativeDelta:e.delta},s=function(e,t){return 0===e||"number"!=typeof e||isNaN(e)?"-":(e>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+t(e)},l=function(e){return e.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=o(r[0]));var c=C.select("text.delta");function p(){c.text(s(o(r[0]),a)).call(v.fill,l(r[0])).call(h.convertToTspans,e)}return c.call(f.font,m.delta.font).call(v.fill,l({delta:m._deltaLastValue})),w(M)?c.transition().duration(M.duration).ease(M.easing).tween("text",(function(){var e=n.select(this),t=o(r[0]),c=m._deltaLastValue,u=I(m.delta.valueformat,a,c,t),f=i(c,t);return m._deltaLastValue=t,function(t){e.text(s(f(t),u)),e.call(v.fill,l({delta:f(t)}))}})).each("end",(function(){p(),E&&E()})).each("interrupt",(function(){p(),E&&E()})):p(),u=A(s(o(r[0]),a),m.delta.font,T,e),c}(),R+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,R+=m.delta.increasing.symbol+m.delta.decreasing.symbol,p=u),m._hasNumber&&(function(){var t=D(e,{tickformat:m.number.valueformat},m._range);t.setScale(),d.prepTicks(t);var a=function(e){return d.tickText(t,e).text},o=m.number.suffix,s=m.number.prefix,l=C.select("text.number");function u(){var t="number"==typeof r[0].y?s+a(r[0].y)+o:"-";l.text(t).call(f.font,m.number.font).call(h.convertToTspans,e)}w(M)?l.transition().duration(M.duration).ease(M.easing).each("end",(function(){u(),E&&E()})).each("interrupt",(function(){u(),E&&E()})).attrTween("text",(function(){var e=n.select(this),t=i(r[0].lastY,r[0].y);m._lastValue=r[0].y;var l=I(m.number.valueformat,a,r[0].lastY,r[0].y);return function(r){e.text(s+l(t(r))+o)}})):u(),c=A(s+a(r[0].y)+o,m.number.font,T,e)}(),R+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,p=c),m._hasDelta&&m._hasNumber){var L,F,B=[(c.left+c.right)/2,(c.top+c.bottom)/2],z=[(u.left+u.right)/2,(u.top+u.bottom)/2],j=.75*m.delta.font.size;"left"===m.delta.position&&(L=S(m,"deltaPos",0,-1*(c.width*x[m.align]+u.width*(1-x[m.align])+j),R,Math.min),F=B[1]-z[1],p={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:u.left+L,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(L=S(m,"deltaPos",0,c.width*(1-x[m.align])+u.width*x[m.align]+j,R,Math.max),F=B[1]-z[1],p={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:c.left,right:u.right+L,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(L=null,F=u.height,p={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(L=null,F=c.top,p={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),P.attr({dx:L,dy:F})}(m._hasNumber||m._hasDelta)&&C.attr("transform",(function(){var e=a.numbersScaler(p);R+=e[2];var t,r=S(m,"numbersScale",1,e[0],R,Math.min);m._scaleNumbers||(r=1),t=m._isAngular?y-r*p.bottom:y-r*(p.top+p.bottom)/2,m._numbersTop=r*p.top+t;var n=p[k];"center"===k&&(n=(p.left+p.right)/2);var i=g-r*n;return i=S(m,"numbersTranslate",0,i,R,Math.max),l(i,t)+s(r)}))}(e,I,t,{numbersX:m,numbersY:M,numbersScaler:E,transitionOpts:r,onComplete:g}),P&&(C={range:O.gauge.axis.range,color:O.gauge.bgcolor,line:{color:O.gauge.bordercolor,width:0},thickness:1},N={range:O.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:O.gauge.bordercolor,width:O.gauge.borderwidth},thickness:1});var H=I.selectAll("g.angular").data(R?t:[]);H.exit().remove();var G=I.selectAll("g.angularaxis").data(R?t:[]);G.exit().remove(),R&&function(e,t,r,i){var o,s,f,p,h=r[0].trace,m=i.size,g=i.radius,y=i.innerRadius,v=i.gaugeBg,b=i.gaugeOutline,x=[m.l+m.w/2,m.t+m.h/2+g/2],_=i.gauge,T=i.layer,A=i.transitionOpts,S=i.onComplete,M=Math.PI/2;function E(e){var t=h.gauge.axis.range[0],r=(e-t)/(h.gauge.axis.range[1]-t)*Math.PI-M;return r<-M?-M:r>M?M:r}function C(e){return n.svg.arc().innerRadius((y+g)/2-e/2*(g-y)).outerRadius((y+g)/2+e/2*(g-y)).startAngle(-M)}function N(e){e.attr("d",(function(e){return C(e.thickness).startAngle(E(e.range[0])).endAngle(E(e.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",l(x[0],x[1])),T.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),T.selectAll("g.xangularaxistick,path,text").remove(),(o=D(e,h.gauge.axis)).type="linear",o.range=h.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var O=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},I={},P=d.makeLabelFns(o,0).labelStandoff;I.xFn=function(e){var t=O(e);return Math.cos(t)*P},I.yFn=function(e){var t=O(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(P+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*u)},I.anchorFn=function(e){var t=O(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},I.heightFn=function(e,t,r){var n=O(e);return-.5*(1+Math.sin(n))*r};var R=function(e){return l(x[0]+g*Math.cos(e),x[1]-g*Math.sin(e))};if(f=function(e){return R(O(e))},s=d.calcTicks(o),p=d.getTickSigns(o)[2],o.visible){p="inside"===o.ticks?-1:1;var L=(o.linewidth||1)/2;d.drawTicks(e,o,{vals:s,layer:T,path:"M"+p*L+",0h"+p*o.ticklen,transFn:function(e){var t=O(e);return R(t)+"rotate("+-c(t)+")"}}),d.drawLabels(e,o,{vals:s,layer:T,transFn:f,labelFns:I})}var F=[v].concat(h.gauge.steps),B=_.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(N).call(k),B.exit().remove();var z=C(h.gauge.bar.thickness),j=_.selectAll("g.value-arc").data([h.gauge.bar]);j.enter().append("g").classed("value-arc",!0).append("path");var U,$,V,q=j.select("path");w(A)?(q.transition().duration(A.duration).ease(A.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",(U=z,$=E(r[0].lastY),V=E(r[0].y),function(){var e=a($,V);return function(t){return U.endAngle(e(t))()}})),h._lastValue=r[0].y):q.attr("d","number"==typeof r[0].y?z.endAngle(E(r[0].y)):"M0,0Z"),q.call(k),j.exit().remove(),F=[];var W=h.gauge.threshold.value;(W||0===W)&&F.push({range:[W,W],color:h.gauge.threshold.color,line:{color:h.gauge.threshold.line.color,width:h.gauge.threshold.line.width},thickness:h.gauge.threshold.thickness});var H=_.selectAll("g.threshold-arc").data(F);H.enter().append("g").classed("threshold-arc",!0).append("path"),H.select("path").call(N).call(k),H.exit().remove();var G=_.selectAll("g.gauge-outline").data([b]);G.enter().append("g").classed("gauge-outline",!0).append("path"),G.select("path").call(N).call(k),G.exit().remove()}(e,0,t,{radius:U,innerRadius:$,gauge:H,layer:G,size:B,gaugeBg:C,gaugeOutline:N,transitionOpts:r,onComplete:g});var X=I.selectAll("g.bullet").data(L?t:[]);X.exit().remove();var Y=I.selectAll("g.bulletaxis").data(L?t:[]);Y.exit().remove(),L&&function(e,t,r,n){var a,i,o,s,c,u=r[0].trace,f=n.gauge,h=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,b=u.domain,x=n.transitionOpts,_=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",l(y.l,y.t)),h.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),h.selectAll("g.xbulletaxistick,path,text").remove();var T=y.h,A=u.gauge.bar.thickness*T,S=b.x[0],M=b.x[0]+(b.x[1]-b.x[0])*(u._hasNumber||u._hasDelta?1-p.bulletNumberDomainSize:1);function E(e){e.attr("width",(function(e){return Math.max(0,a.c2p(e.range[1])-a.c2p(e.range[0]))})).attr("x",(function(e){return a.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*T})).attr("height",(function(e){return e.thickness*T}))}(a=D(e,u.gauge.axis))._id="xbulletaxis",a.domain=[S,M],a.setScale(),i=d.calcTicks(a),o=d.makeTransTickFn(a),s=d.getTickSigns(a)[2],c=y.t+y.h,a.visible&&(d.drawTicks(e,a,{vals:"inside"===a.ticks?d.clipEnds(a,i):i,layer:h,path:d.makeTickPath(a,c,s),transFn:o}),d.drawLabels(e,a,{vals:i,layer:h,transFn:o,labelFns:d.makeLabelFns(a,c)}));var C=[m].concat(u.gauge.steps),N=f.selectAll("g.bg-bullet").data(C);N.enter().append("g").classed("bg-bullet",!0).append("rect"),N.select("rect").call(E).call(k),N.exit().remove();var O=f.selectAll("g.value-bullet").data([u.gauge.bar]);O.enter().append("g").classed("value-bullet",!0).append("rect"),O.select("rect").attr("height",A).attr("y",(T-A)/2).call(k),w(x)?O.select("rect").transition().duration(x.duration).ease(x.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):O.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0),O.exit().remove();var I=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),P=f.selectAll("g.threshold-bullet").data(I);P.enter().append("g").classed("threshold-bullet",!0).append("line"),P.select("line").attr("x1",a.c2p(u.gauge.threshold.value)).attr("x2",a.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*T).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*T).call(v.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),P.exit().remove();var R=f.selectAll("g.gauge-outline").data([g]);R.enter().append("g").classed("gauge-outline",!0).append("rect"),R.select("rect").call(E).call(k),R.exit().remove()}(e,0,t,{gauge:X,layer:Y,size:B,gaugeBg:C,gaugeOutline:N,transitionOpts:r,onComplete:g});var Z=I.selectAll("text.title").data(t);Z.exit().remove(),Z.enter().append("text").classed("title",!0),Z.attr("text-anchor",(function(){return L?b.right:b[O.title.align]})).text(O.title.text).call(f.font,O.title.font).call(h.convertToTspans,e),Z.attr("transform",(function(){var e,t=B.l+B.w*x[O.title.align],r=p.titlePadding,n=f.bBox(Z.node());return P?(R&&(e=O.gauge.axis.visible?f.bBox(G.node()).top-r-n.bottom:B.t+B.h/2-U/2-n.bottom-r),L&&(e=M-(n.top+n.bottom)/2,t=B.l-p.bulletPadding*B.w)):e=O._numbersTop-r-n.bottom,l(t,e)}))}))}},{"../../components/color":366,"../../components/drawing":388,"../../constants/alignment":471,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"../../plots/cartesian/axis_defaults":556,"../../plots/cartesian/layout_attributes":569,"../../plots/cartesian/position_defaults":572,"./constants":858,"@plotly/d3":58,"d3-interpolate":116}],862:[function(e,t,r){"use strict";var n=e("../../components/colorscale/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../mesh3d/attributes"),s=e("../../plots/attributes"),l=e("../../lib/extend").extendFlat,c=e("../../plot_api/edit_types").overrideAll,u=t.exports=c(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:i(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),valuehoverformat:a("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../mesh3d/attributes":867}],863:[function(e,t,r){"use strict";var n=e("../../components/colorscale/calc"),a=e("../streamtube/calc").processGrid,i=e("../streamtube/calc").filter;t.exports=function(e,t){t._len=Math.min(t.x.length,t.y.length,t.z.length,t.value.length),t._x=i(t.x,t._len),t._y=i(t.y,t._len),t._z=i(t.z,t._len),t._value=i(t.value,t._len);var r=a(t);t._gridFill=r.fill,t._Xs=r.Xs,t._Ys=r.Ys,t._Zs=r.Zs,t._len=r.len;for(var o=1/0,s=-1/0,l=0;l<t._len;l++){var c=t._value[l];o=Math.min(o,c),s=Math.max(s,c)}t._minValues=o,t._maxValues=s,t._vMin=void 0===t.isomin||null===t.isomin?o:t.isomin,t._vMax=void 0===t.isomax||null===t.isomin?s:t.isomax,n(e,t,{vals:[t._vMin,t._vMax],containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":374,"../streamtube/calc":1041}],864:[function(e,t,r){"use strict";var n=e("../../../stackgl_modules").gl_mesh3d,a=e("../../lib/gl_format_color").parseColorScale,i=e("../../lib/str2rgbarray"),o=e("../../components/colorscale").extractOpts,s=e("../../plots/gl3d/zip3"),l=function(e,t){for(var r=t.length-1;r>0;r--){var n=Math.min(t[r],t[r-1]),a=Math.max(t[r],t[r-1]);if(a>n&&n<e&&e<=a)return{id:r,distRatio:(a-e)/(a-n)}}return{id:0,distRatio:0}};function c(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.data=null,this.showContour=!1}var u=c.prototype;u.handlePick=function(e){if(e.object===this.mesh){var t=e.data.index,r=this.data._meshX[t],n=this.data._meshY[t],a=this.data._meshZ[t],i=this.data._Ys.length,o=this.data._Zs.length,s=l(r,this.data._Xs).id,c=l(n,this.data._Ys).id,u=l(a,this.data._Zs).id,f=e.index=u+o*c+o*i*s;e.traceCoordinate=[this.data._meshX[f],this.data._meshY[f],this.data._meshZ[f],this.data._value[f]];var p=this.data.hovertext||this.data.text;return Array.isArray(p)&&void 0!==p[f]?e.textLabel=p[f]:p&&(e.textLabel=p),!0}},u.update=function(e){var t=this.scene,r=t.fullSceneLayout;function n(e,t,r,n){return t.map((function(t){return e.d2l(t,0,n)*r}))}this.data=p(e);var l={positions:s(n(r.xaxis,e._meshX,t.dataScale[0],e.xcalendar),n(r.yaxis,e._meshY,t.dataScale[1],e.ycalendar),n(r.zaxis,e._meshZ,t.dataScale[2],e.zcalendar)),cells:s(e._meshI,e._meshJ,e._meshK),lightPosition:[e.lightposition.x,e.lightposition.y,e.lightposition.z],ambient:e.lighting.ambient,diffuse:e.lighting.diffuse,specular:e.lighting.specular,roughness:e.lighting.roughness,fresnel:e.lighting.fresnel,vertexNormalsEpsilon:e.lighting.vertexnormalsepsilon,faceNormalsEpsilon:e.lighting.facenormalsepsilon,opacity:e.opacity,contourEnable:e.contour.show,contourColor:i(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading},c=o(e);l.vertexIntensity=e._meshIntensity,l.vertexIntensityBounds=[c.min,c.max],l.colormap=a(e),this.mesh.update(l)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};var f=["xyz","xzy","yxz","yzx","zxy","zyx"];function p(e){e._meshI=[],e._meshJ=[],e._meshK=[];var t,r,n,a,i,o,s,c=e.surface.show,u=e.spaceframe.show,p=e.surface.fill,h=e.spaceframe.fill,d=!1,m=!1,g=0,y=e._Xs,v=e._Ys,b=e._Zs,x=y.length,_=v.length,w=b.length,k=f.indexOf(e._gridFill.replace(/-/g,"").replace(/\+/g,"")),D=function(e,t,r){switch(k){case 5:return r+w*t+w*_*e;case 4:return r+w*e+w*x*t;case 3:return t+_*r+_*w*e;case 2:return t+_*e+_*x*r;case 1:return e+x*r+x*w*t;default:return e+x*t+x*_*r}},T=e._minValues,A=e._maxValues,S=e._vMin,M=e._vMax;function E(e,t,s){for(var l=o.length,c=r;c<l;c++)if(e===n[c]&&t===a[c]&&s===i[c])return c;return-1}function C(){r=t}function N(){n=[],a=[],i=[],o=[],t=0,C()}function O(e,r,s,l){return n.push(e),a.push(r),i.push(s),o.push(l),++t-1}function I(e,t,r){for(var n=[],a=0;a<e.length;a++)n[a]=e[a]*(1-r)+r*t[a];return n}function P(e){s=e}function R(e,t){return"all"===e||null===e||e.indexOf(t)>-1}function L(e,t){return null===e?t:e}function F(t,r,n){C();var a,i,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(e,t){var r=e[0],n=e[1],a=e[2],i=function(e,t,r){for(var n=[],a=0;a<e.length;a++)n[a]=(e[a]+t[a]+r[a])/3;return n}(r,n,a),o=Math.sqrt(1-s),l=I(i,r,o),c=I(i,n,o),u=I(i,a,o),f=t[0],p=t[1],h=t[2];return{xyzv:[[r,n,c],[c,l,r],[n,a,u],[u,c,n],[a,r,l],[l,u,a]],abc:[[f,p,-1],[-1,-1,f],[p,h,-1],[-1,-1,p],[h,f,-1],[-1,-1,h]]}}(r,n);l=u.xyzv,c=u.abc}for(var f=0;f<l.length;f++){r=l[f],n=c[f];for(var p=[],h=0;h<3;h++){var d=r[h][0],m=r[h][1],y=r[h][2],v=r[h][3],b=n[h]>-1?n[h]:E(d,m,y);p[h]=b>-1?b:O(d,m,y,L(t,v))}a=p[0],i=p[1],o=p[2],e._meshI.push(a),e._meshJ.push(i),e._meshK.push(o),++g}}function B(e,t,r,n){var a=e[3];a<r&&(a=r),a>n&&(a=n);for(var i=(e[3]-a)/(e[3]-t[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-i)*e[s]+i*t[s];return o}function z(e,t,r){return e>=t&&e<=r}function j(e){var t=.001*(M-S);return e>=S-t&&e<=M+t}function U(t){for(var r=[],n=0;n<4;n++){var a=t[n];r.push([e._x[a],e._y[a],e._z[a],e._value[a]])}return r}function $(e,t,r,n,a,i){i||(i=1),r=[-1,-1,-1];var o=!1,s=[z(t[0][3],n,a),z(t[1][3],n,a),z(t[2][3],n,a)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(e,t,r){return j(t[0][3])&&j(t[1][3])&&j(t[2][3])?(F(e,t,r),!0):i<3&&$(e,t,r,S,M,++i)};if(s[0]&&s[1]&&s[2])return l(e,t,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(i){if(s[i[0]]&&s[i[1]]&&!s[i[2]]){var u=t[i[0]],f=t[i[1]],p=t[i[2]],h=B(p,u,n,a),d=B(p,f,n,a);o=l(e,[d,h,u],[-1,-1,r[i[0]]])||o,o=l(e,[u,f,d],[r[i[0]],r[i[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(i){if(s[i[0]]&&!s[i[1]]&&!s[i[2]]){var u=t[i[0]],f=t[i[1]],p=t[i[2]],h=B(f,u,n,a),d=B(p,u,n,a);o=l(e,[d,h,u],[-1,-1,r[i[0]]])||o,c=!0}})),o}function V(e,t,r,n){var a=!1,i=U(t),o=[z(i[0][3],r,n),z(i[1][3],r,n),z(i[2][3],r,n),z(i[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return a;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(a=function(e,t,r){var n=function(n,a,i){F(e,[t[n],t[a],t[i]],[r[n],r[a],r[i]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(e,i,t)||a),a;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=i[l[0]],u=i[l[1]],f=i[l[2]],p=i[l[3]];if(m)a=F(e,[c,u,f],[t[l[0]],t[l[1]],t[l[2]]])||a;else{var h=B(p,c,r,n),d=B(p,u,r,n),g=B(p,f,r,n);a=F(null,[h,d,g],[-1,-1,-1])||a}s=!0}})),s||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=i[l[0]],u=i[l[1]],f=i[l[2]],p=i[l[3]],h=B(f,c,r,n),d=B(f,u,r,n),g=B(p,u,r,n),y=B(p,c,r,n);m?(a=F(e,[c,y,h],[t[l[0]],-1,-1])||a,a=F(e,[u,d,g],[t[l[1]],-1,-1])||a):a=function(e,t,r){var n=function(e,n,a){F(null,[t[e],t[n],t[a]],[r[e],r[n],r[a]])};n(0,1,2),n(2,3,0)}(0,[h,d,g,y],[-1,-1,-1,-1])||a,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=i[l[0]],u=i[l[1]],f=i[l[2]],p=i[l[3]],h=B(u,c,r,n),d=B(f,c,r,n),g=B(p,c,r,n);m?(a=F(e,[c,h,d],[t[l[0]],-1,-1])||a,a=F(e,[c,d,g],[t[l[0]],-1,-1])||a,a=F(e,[c,g,h],[t[l[0]],-1,-1])||a):a=F(null,[h,d,g],[-1,-1,-1])||a,s=!0}}))),a}function q(e,t,r,n,a,i,o,s,l,c,u){var f=!1;return d&&(R(e,"A")&&(f=V(null,[t,r,n,i],c,u)||f),R(e,"B")&&(f=V(null,[r,n,a,l],c,u)||f),R(e,"C")&&(f=V(null,[r,i,o,l],c,u)||f),R(e,"D")&&(f=V(null,[n,i,s,l],c,u)||f),R(e,"E")&&(f=V(null,[r,n,i,l],c,u)||f)),m&&(f=V(e,[r,n,i,l],c,u)||f),f}function W(e,t,r,n,a,i,o,s){return[!0===s[0]||$(e,U([t,r,n]),[t,r,n],i,o),!0===s[1]||$(e,U([n,a,t]),[n,a,t],i,o)]}function H(e,t,r,n,a,i,o,s,l){return s?W(e,t,r,a,n,i,o,l):W(e,r,a,n,t,i,o,l)}function G(e,t,r,n,a,i,o){var s,l,c,u,f=!1,p=function(){f=$(e,[s,l,c],[-1,-1,-1],a,i)||f,f=$(e,[c,u,s],[-1,-1,-1],a,i)||f},h=o[0],d=o[1],m=o[2];return h&&(s=I(U([D(t,r-0,n-0)])[0],U([D(t-1,r-0,n-0)])[0],h),l=I(U([D(t,r-0,n-1)])[0],U([D(t-1,r-0,n-1)])[0],h),c=I(U([D(t,r-1,n-1)])[0],U([D(t-1,r-1,n-1)])[0],h),u=I(U([D(t,r-1,n-0)])[0],U([D(t-1,r-1,n-0)])[0],h),p()),d&&(s=I(U([D(t-0,r,n-0)])[0],U([D(t-0,r-1,n-0)])[0],d),l=I(U([D(t-0,r,n-1)])[0],U([D(t-0,r-1,n-1)])[0],d),c=I(U([D(t-1,r,n-1)])[0],U([D(t-1,r-1,n-1)])[0],d),u=I(U([D(t-1,r,n-0)])[0],U([D(t-1,r-1,n-0)])[0],d),p()),m&&(s=I(U([D(t-0,r-0,n)])[0],U([D(t-0,r-0,n-1)])[0],m),l=I(U([D(t-0,r-1,n)])[0],U([D(t-0,r-1,n-1)])[0],m),c=I(U([D(t-1,r-1,n)])[0],U([D(t-1,r-1,n-1)])[0],m),u=I(U([D(t-1,r-0,n)])[0],U([D(t-1,r-0,n-1)])[0],m),p()),f}function X(e,t,r,n,a,i,o,s,l,c,u,f){var p=e;return f?(d&&"even"===e&&(p=null),q(p,t,r,n,a,i,o,s,l,c,u)):(d&&"odd"===e&&(p=null),q(p,l,s,o,i,a,n,r,t,c,u))}function Y(e,t,r,n,a){for(var i=[],o=0,s=0;s<t.length;s++)for(var l=t[s],c=1;c<w;c++)for(var u=1;u<_;u++)i.push(H(e,D(l,u-1,c-1),D(l,u-1,c),D(l,u,c-1),D(l,u,c),r,n,(l+u+c)%2,a&&a[o]?a[o]:[])),o++;return i}function Z(e,t,r,n,a){for(var i=[],o=0,s=0;s<t.length;s++)for(var l=t[s],c=1;c<x;c++)for(var u=1;u<w;u++)i.push(H(e,D(c-1,l,u-1),D(c,l,u-1),D(c-1,l,u),D(c,l,u),r,n,(c+l+u)%2,a&&a[o]?a[o]:[])),o++;return i}function K(e,t,r,n,a){for(var i=[],o=0,s=0;s<t.length;s++)for(var l=t[s],c=1;c<_;c++)for(var u=1;u<x;u++)i.push(H(e,D(u-1,c-1,l),D(u-1,c,l),D(u,c-1,l),D(u,c,l),r,n,(u+c+l)%2,a&&a[o]?a[o]:[])),o++;return i}function J(e,t,r){for(var n=1;n<w;n++)for(var a=1;a<_;a++)for(var i=1;i<x;i++)X(e,D(i-1,a-1,n-1),D(i-1,a-1,n),D(i-1,a,n-1),D(i-1,a,n),D(i,a-1,n-1),D(i,a-1,n),D(i,a,n-1),D(i,a,n),t,r,(i+a+n)%2)}function Q(e,t,r){d=!0,J(e,t,r),d=!1}function ee(e,t,r,n,a,i){for(var o=[],s=0,l=0;l<t.length;l++)for(var c=t[l],u=1;u<w;u++)for(var f=1;f<_;f++)o.push(G(e,c,f,u,r,n,a[l],i&&i[s]&&i[s])),s++;return o}function te(e,t,r,n,a,i){for(var o=[],s=0,l=0;l<t.length;l++)for(var c=t[l],u=1;u<x;u++)for(var f=1;f<w;f++)o.push(G(e,u,c,f,r,n,a[l],i&&i[s]&&i[s])),s++;return o}function re(e,t,r,n,a,i){for(var o=[],s=0,l=0;l<t.length;l++)for(var c=t[l],u=1;u<_;u++)for(var f=1;f<x;f++)o.push(G(e,f,u,c,r,n,a[l],i&&i[s]&&i[s])),s++;return o}function ne(e,t){for(var r=[],n=e;n<t;n++)r.push(n);return r}return function(){if(N(),function(){for(var t=0;t<x;t++)for(var r=0;r<_;r++)for(var n=0;n<w;n++){var a=D(t,r,n);O(e._x[a],e._y[a],e._z[a],e._value[a])}}(),u&&h&&(P(h),m=!0,J(null,S,M),m=!1),c&&p){P(p);for(var t=e.surface.pattern,r=e.surface.count,s=0;s<r;s++){var f=1===r?.5:s/(r-1),d=(1-f)*S+f*M,k=Math.abs(d-T)>Math.abs(d-A)?[T,d]:[d,A];Q(t,k[0],k[1])}}var E=[[Math.min(S,A),Math.max(S,A)],[Math.min(T,M),Math.max(T,M)]];["x","y","z"].forEach((function(t){for(var r=[],n=0;n<E.length;n++){var a=0,i=E[n][0],o=E[n][1],s=e.slices[t];if(s.show&&s.fill){P(s.fill);var c=[],u=[],f=[];if(s.locations.length)for(var p=0;p<s.locations.length;p++){var h=l(s.locations[p],"x"===t?y:"y"===t?v:b);0===h.distRatio?c.push(h.id):h.id>0&&(u.push(h.id),"x"===t?f.push([h.distRatio,0,0]):"y"===t?f.push([0,h.distRatio,0]):f.push([0,0,h.distRatio]))}else c=ne(1,"x"===t?x-1:"y"===t?_-1:w-1);u.length>0&&(r[a]="x"===t?ee(null,u,i,o,f,r[a]):"y"===t?te(null,u,i,o,f,r[a]):re(null,u,i,o,f,r[a]),a++),c.length>0&&(r[a]="x"===t?Y(null,c,i,o,r[a]):"y"===t?Z(null,c,i,o,r[a]):K(null,c,i,o,r[a]),a++)}var d=e.caps[t];d.show&&d.fill&&(P(d.fill),r[a]="x"===t?Y(null,[0,x-1],i,o,r[a]):"y"===t?Z(null,[0,_-1],i,o,r[a]):K(null,[0,w-1],i,o,r[a]),a++)}})),0===g&&N(),e._meshX=n,e._meshY=a,e._meshZ=i,e._meshIntensity=o,e._Xs=y,e._Ys=v,e._Zs=b}(),e}t.exports={findNearestOnAxis:l,generateIsoMeshes:p,createIsosurfaceTrace:function(e,t){var r=e.glplot.gl,a=n({gl:r}),i=new c(e,a,t.uid);return a._trace=i,i.update(t),e.glplot.add(a),i}}},{"../../../stackgl_modules":1120,"../../components/colorscale":378,"../../lib/gl_format_color":499,"../../lib/str2rgbarray":528,"../../plots/gl3d/zip3":609}],865:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("../../components/colorscale/defaults");function s(e,t,r,n,i){var s=i("isomin"),l=i("isomax");null!=l&&null!=s&&s>l&&(t.isomin=null,t.isomax=null);var c=i("x"),u=i("y"),f=i("z"),p=i("value");c&&c.length&&u&&u.length&&f&&f.length&&p&&p.length?(a.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],n),i("valuehoverformat"),["x","y","z"].forEach((function(e){i(e+"hoverformat");var t="caps."+e;i(t+".show")&&i(t+".fill");var r="slices."+e;i(r+".show")&&(i(r+".fill"),i(r+".locations"))})),i("spaceframe.show")&&i("spaceframe.fill"),i("surface.show")&&(i("surface.count"),i("surface.fill"),i("surface.pattern")),i("contour.show")&&(i("contour.color"),i("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(e){i(e)})),o(e,t,n,i,{prefix:"",cLetter:"c"}),t._length=null):t.visible=!1}t.exports={supplyDefaults:function(e,t,r,a){s(e,t,0,a,(function(r,a){return n.coerce(e,t,i,r,a)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":376,"../../lib":503,"../../registry":638,"./attributes":862}],866:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults").supplyDefaults,calc:e("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:e("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:e("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":598,"./attributes":862,"./calc":863,"./convert":864,"./defaults":865}],867:[function(e,t,r){"use strict";var n=e("../../components/colorscale/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../surface/attributes"),s=e("../../plots/attributes"),l=e("../../lib/extend").extendFlat;t.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"}),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../surface/attributes":1057}],868:[function(e,t,r){"use strict";var n=e("../../components/colorscale/calc");t.exports=function(e,t){t.intensity&&n(e,t,{vals:t.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":374}],869:[function(e,t,r){"use strict";var n=e("../../../stackgl_modules").gl_mesh3d,a=e("../../../stackgl_modules").delaunay_triangulate,i=e("../../../stackgl_modules").alpha_shape,o=e("../../../stackgl_modules").convex_hull,s=e("../../lib/gl_format_color").parseColorScale,l=e("../../lib/str2rgbarray"),c=e("../../components/colorscale").extractOpts,u=e("../../plots/gl3d/zip3");function f(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var p=f.prototype;function h(e){for(var t=[],r=e.length,n=0;n<r;n++)t[n]=l(e[n]);return t}function d(e,t,r,n){for(var a=[],i=t.length,o=0;o<i;o++)a[o]=e.d2l(t[o],0,n)*r;return a}function m(e){for(var t=[],r=e.length,n=0;n<r;n++)t[n]=Math.round(e[n]);return t}function g(e,t){for(var r=e.length,n=0;n<r;n++)if(e[n]<=-.5||e[n]>=t-.5)return!1;return!0}p.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index;e.data._cellCenter?e.traceCoordinate=e.data.dataCoordinate:e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[t]?e.textLabel=r[t]:r&&(e.textLabel=r),!0}},p.update=function(e){var t=this.scene,r=t.fullSceneLayout;this.data=e;var n,f=e.x.length,p=u(d(r.xaxis,e.x,t.dataScale[0],e.xcalendar),d(r.yaxis,e.y,t.dataScale[1],e.ycalendar),d(r.zaxis,e.z,t.dataScale[2],e.zcalendar));if(e.i&&e.j&&e.k){if(e.i.length!==e.j.length||e.j.length!==e.k.length||!g(e.i,f)||!g(e.j,f)||!g(e.k,f))return;n=u(m(e.i),m(e.j),m(e.k))}else n=0===e.alphahull?o(p):e.alphahull>0?i(e.alphahull,p):function(e,t){for(var r=["x","y","z"].indexOf(e),n=[],i=t.length,o=0;o<i;o++)n[o]=[t[o][(r+1)%3],t[o][(r+2)%3]];return a(n)}(e.delaunayaxis,p);var y={positions:p,cells:n,lightPosition:[e.lightposition.x,e.lightposition.y,e.lightposition.z],ambient:e.lighting.ambient,diffuse:e.lighting.diffuse,specular:e.lighting.specular,roughness:e.lighting.roughness,fresnel:e.lighting.fresnel,vertexNormalsEpsilon:e.lighting.vertexnormalsepsilon,faceNormalsEpsilon:e.lighting.facenormalsepsilon,opacity:e.opacity,contourEnable:e.contour.show,contourColor:l(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading};if(e.intensity){var v=c(e);this.color="#fff";var b=e.intensitymode;y[b+"Intensity"]=e.intensity,y[b+"IntensityBounds"]=[v.min,v.max],y.colormap=s(e)}else e.vertexcolor?(this.color=e.vertexcolor[0],y.vertexColors=h(e.vertexcolor)):e.facecolor?(this.color=e.facecolor[0],y.cellColors=h(e.facecolor)):(this.color=e.color,y.meshColor=l(e.color));this.mesh.update(y)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var r=e.glplot.gl,a=n({gl:r}),i=new f(e,a,t.uid);return a._trace=i,i.update(t),e.glplot.add(a),i}},{"../../../stackgl_modules":1120,"../../components/colorscale":378,"../../lib/gl_format_color":499,"../../lib/str2rgbarray":528,"../../plots/gl3d/zip3":609}],870:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../components/colorscale/defaults"),o=e("./attributes");t.exports=function(e,t,r,s){function l(r,n){return a.coerce(e,t,o,r,n)}function c(e){var t=e.map((function(e){var t=l(e);return t&&a.isArrayOrTypedArray(t)?t:null}));return t.every((function(e){return e&&e.length===t[0].length}))&&t}c(["x","y","z"])?(c(["i","j","k"]),(!t.i||t.j&&t.k)&&(!t.j||t.k&&t.i)&&(!t.k||t.i&&t.j)?(n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach((function(e){l(e)})),l("contour.show")&&(l("contour.color"),l("contour.width")),"intensity"in e?(l("intensity"),l("intensitymode"),i(e,t,s,l,{prefix:"",cLetter:"c"})):(t.showscale=!1,"facecolor"in e?l("facecolor"):"vertexcolor"in e?l("vertexcolor"):l("color",r)),l("text"),l("hovertext"),l("hovertemplate"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),t._length=null):t.visible=!1):t.visible=!1}},{"../../components/colorscale/defaults":376,"../../lib":503,"../../registry":638,"./attributes":867}],871:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:e("./convert"),moduleType:"trace",name:"mesh3d",basePlotModule:e("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":598,"./attributes":867,"./calc":868,"./convert":869,"./defaults":870}],872:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../scatter/attributes"),i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=e("../../components/drawing/attributes").dash,s=e("../../components/fx/attributes"),l=e("../../constants/delta.js"),c=l.INCREASING.COLOR,u=l.DECREASING.COLOR,f=a.line;function p(e){return{line:{color:n({},f.color,{dflt:e}),width:f.width,dash:o,editType:"style"},editType:"style"}}t.exports={xperiod:a.xperiod,xperiod0:a.xperiod0,xperiodalignment:a.xperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:n({},f.width,{}),dash:n({},o,{}),editType:"style"},increasing:p(c),decreasing:p(u),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:n({},s.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}})}},{"../../components/drawing/attributes":387,"../../components/fx/attributes":397,"../../constants/delta.js":473,"../../lib":503,"../../plots/cartesian/axis_format_attributes":557,"../scatter/attributes":926}],873:[function(e,t,r){"use strict";var n=e("../../lib"),a=n._,i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),s=e("../../constants/numerical").BADNUM;function l(e,t,r,n){return{o:e,h:t,l:r,c:n}}function c(e,t,r,o,l,c){for(var u=l.makeCalcdata(t,"open"),f=l.makeCalcdata(t,"high"),p=l.makeCalcdata(t,"low"),h=l.makeCalcdata(t,"close"),d=Array.isArray(t.text),m=Array.isArray(t.hovertext),g=!0,y=null,v=!!t.xperiodalignment,b=[],x=0;x<o.length;x++){var _=o[x],w=u[x],k=f[x],D=p[x],T=h[x];if(_!==s&&w!==s&&k!==s&&D!==s&&T!==s){T===w?null!==y&&T!==y&&(g=T>y):g=T>w,y=T;var A=c(w,k,D,T);A.pos=_,A.yc=(w+T)/2,A.i=x,A.dir=g?"increasing":"decreasing",A.x=A.pos,A.y=[D,k],v&&(A.orig_p=r[x]),d&&(A.tx=t.text[x]),m&&(A.htx=t.hovertext[x]),b.push(A)}else b.push({pos:_,empty:!0})}return t._extremes[l._id]=i.findExtremes(l,n.concat(p,f),{padded:!0}),b.length&&(b[0].t={labels:{open:a(e,"open:")+" ",high:a(e,"high:")+" ",low:a(e,"low:")+" ",close:a(e,"close:")+" "}}),b}t.exports={calc:function(e,t){var r=i.getFromId(e,t.xaxis),a=i.getFromId(e,t.yaxis),s=function(e,t,r){var a=r._minDiff;if(!a){var i,s=e._fullData,l=[];for(a=1/0,i=0;i<s.length;i++){var c=s[i];if("ohlc"===c.type&&!0===c.visible&&c.xaxis===t._id){l.push(c);var u=t.makeCalcdata(c,"x");c._origX=u;var f=o(r,t,"x",u).vals;c._xcalc=f;var p=n.distinctVals(f).minDiff;p&&isFinite(p)&&(a=Math.min(a,p))}}for(a===1/0&&(a=1),i=0;i<l.length;i++)l[i]._minDiff=a}return a*r.tickwidth}(e,r,t),u=t._minDiff;t._minDiff=null;var f=t._origX;t._origX=null;var p=t._xcalc;t._xcalc=null;var h=c(e,t,f,p,a,l);return t._extremes[r._id]=i.findExtremes(r,p,{vpad:u/2}),h.length?(n.extendFlat(h[0].t,{wHover:u/2,tickLen:s}),h):[{t:{empty:!0}}]},calcCommon:c}},{"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/align_period":551,"../../plots/cartesian/axes":554}],874:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./ohlc_defaults"),i=e("../scatter/period_defaults"),o=e("./attributes");function s(e,t,r,n){r(n+".line.color"),r(n+".line.width",t.line.width),r(n+".line.dash",t.line.dash)}t.exports=function(e,t,r,l){function c(r,a){return n.coerce(e,t,o,r,a)}a(e,t,c,l)?(i(e,t,l,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),c("line.dash"),s(0,t,c,"increasing"),s(0,t,c,"decreasing"),c("text"),c("hovertext"),c("tickwidth"),l._requestRangeslider[t.xaxis]=!0):t.visible=!1}},{"../../lib":503,"../scatter/period_defaults":946,"./attributes":872,"./ohlc_defaults":877}],875:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib"),i=e("../../components/fx"),o=e("../../components/color"),s=e("../../lib").fillText,l=e("../../constants/delta.js"),c={increasing:l.INCREASING.SYMBOL,decreasing:l.DECREASING.SYMBOL};function u(e,t,r,n){var a,s,l=e.cd,c=e.xa,u=l[0].trace,f=l[0].t,p=u.type,h="ohlc"===p?"l":"min",d="ohlc"===p?"h":"max",m=f.bPos||0,g=f.bdPos||f.tickLen,y=f.wHover,v=Math.min(1,g/Math.abs(c.r2c(c.range[1])-c.r2c(c.range[0])));function b(e){var r=function(e){return e.pos+m-t}(e);return i.inbox(r-y,r+y,a)}function x(e){var t=e[h],n=e[d];return t===n||i.inbox(t-r,n-r,a)}function _(e){return(b(e)+x(e))/2}a=e.maxHoverDistance-v,s=e.maxSpikeDistance-v;var w=i.getDistanceFunction(n,b,x,_);if(i.getClosest(l,w,e),!1===e.index)return null;var k=l[e.index];if(k.empty)return null;var D=u[k.dir],T=D.line.color;return o.opacity(T)&&D.line.width?e.color=T:e.color=D.fillcolor,e.x0=c.c2p(k.pos+m-g,!0),e.x1=c.c2p(k.pos+m+g,!0),e.xLabelVal=void 0!==k.orig_p?k.orig_p:k.pos,e.spikeDistance=_(k)*s/a,e.xSpike=c.c2p(k.pos,!0),e}function f(e,t,r,i){var o=e.cd,s=e.ya,l=o[0].trace,c=o[0].t,f=[],p=u(e,t,r,i);if(!p)return[];var h=o[p.index].hi||l.hoverinfo,d=h.split("+");if("all"!==h&&-1===d.indexOf("y"))return[];for(var m=["high","open","close","low"],g={},y=0;y<m.length;y++){var v,b=m[y],x=l[b][p.index],_=s.c2p(x,!0);x in g?(v=g[x]).yLabel+="<br>"+c.labels[b]+n.hoverLabelText(s,x,l.yhoverformat):((v=a.extendFlat({},p)).y0=v.y1=_,v.yLabelVal=x,v.yLabel=c.labels[b]+n.hoverLabelText(s,x,l.yhoverformat),v.name="",f.push(v),g[x]=v)}return f}function p(e,t,r,a){var i=e.cd,o=e.ya,l=i[0].trace,f=i[0].t,p=u(e,t,r,a);if(!p)return[];var h=i[p.index],d=p.index=h.i,m=h.dir;function g(e){return f.labels[e]+n.hoverLabelText(o,l[e][d],l.yhoverformat)}var y=h.hi||l.hoverinfo,v=y.split("+"),b="all"===y,x=b||-1!==v.indexOf("y"),_=b||-1!==v.indexOf("text"),w=x?[g("open"),g("high"),g("low"),g("close")+"  "+c[m]]:[];return _&&s(h,l,w),p.extraText=w.join("<br>"),p.y0=p.y1=o.c2p(h.yc,!0),[p]}t.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?f(e,t,r,n):p(e,t,r,n)},hoverSplit:f,hoverOnPoints:p}},{"../../components/color":366,"../../components/fx":406,"../../constants/delta.js":473,"../../lib":503,"../../plots/cartesian/axes":554}],876:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"ohlc",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc").calc,plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("./select")}},{"../../plots/cartesian":568,"./attributes":872,"./calc":873,"./defaults":874,"./hover":875,"./plot":878,"./select":879,"./style":880}],877:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports=function(e,t,r,i){var o=r("x"),s=r("open"),l=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],i),s&&l&&c&&u){var f=Math.min(s.length,l.length,c.length,u.length);return o&&(f=Math.min(f,a.minRowLength(o))),t._length=f,f}}},{"../../lib":503,"../../registry":638}],878:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");t.exports=function(e,t,r,i){var o=t.yaxis,s=t.xaxis,l=!!s.rangebreaks;a.makeTraceGroups(i,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],i=r.t;if(!0!==r.trace.visible||i.empty)t.remove();else{var c=i.tickLen,u=t.selectAll("path").data(a.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=s.c2p(e.pos-c,!0),r=s.c2p(e.pos+c,!0),n=l?(t+r)/2:s.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}},{"../../lib":503,"@plotly/d3":58}],879:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n=e.cd,a=e.xaxis,i=e.yaxis,o=[],s=n[0].t.bPos||0;if(!1===t)for(r=0;r<n.length;r++)n[r].selected=0;else for(r=0;r<n.length;r++){var l=n[r];t.contains([a.c2p(l.pos+s),i.c2p(l.yc)],null,l.i,e)?(o.push({pointNumber:l.i,x:a.c2d(l.pos),y:i.c2d(l.yc)}),l.selected=1):l.selected=0}return o}},{}],880:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../../components/color");t.exports=function(e,t,r){var o=r||n.select(e).selectAll("g.ohlclayer").selectAll("g.trace");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(e){var t=e[0].trace;n.select(this).selectAll("path").each((function(e){if(!e.empty){var r=t[e.dir].line;n.select(this).style("fill","none").call(i.stroke,r.color).call(a.dashLine,r.dash,r.width).style("opacity",t.selectedpoints&&!e.selected?.3:1)}}))}))}},{"../../components/color":366,"../../components/drawing":388,"@plotly/d3":58}],881:[function(e,t,r){"use strict";var n=e("../../lib/extend").extendFlat,a=e("../../plots/attributes"),i=e("../../plots/font_attributes"),o=e("../../components/colorscale/attributes"),s=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/domain").attributes,c=n({editType:"calc"},o("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:s({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});t.exports={domain:l({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:n({},a.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:s({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:i({editType:"calc"}),tickfont:i({editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:c,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/domain":584,"../../plots/font_attributes":585,"../../plots/template_attributes":633}],882:[function(e,t,r){"use strict";var n=e("../../plots/get_data").getModuleCalcData,a=e("./plot");r.name="parcats",r.plot=function(e,t,r,i){var o=n(e.calcdata,"parcats");if(o.length){var s=o[0];a(e,s,r,i)}},r.clean=function(e,t,r,n){var a=n._has&&n._has("parcats"),i=t._has&&t._has("parcats");a&&!i&&n._paperdiv.selectAll(".parcats").remove()}},{"../../plots/get_data":593,"./plot":887}],883:[function(e,t,r){"use strict";var n=e("../../lib/gup").wrap,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/calc"),o=e("../../lib/filter_unique.js"),s=e("../../components/drawing"),l=e("../../lib"),c=e("fast-isnumeric");function u(e,t,r){e.valueInds.push(t),e.count+=r}function f(e,t,r){return{categoryInds:e,color:t,rawColor:r,valueInds:[],count:0}}function p(e,t,r){e.valueInds.push(t),e.count+=r}t.exports=function(e,t){var r=l.filterVisible(t.dimensions);if(0===r.length)return[];var h,d,m,g=r.map((function(e){var t;if("trace"===e.categoryorder)t=null;else if("array"===e.categoryorder)t=e.categoryarray;else{t=o(e.values);for(var r=!0,n=0;n<t.length;n++)if(!c(t[n])){r=!1;break}t.sort(r?l.sorterAsc:void 0),"category descending"===e.categoryorder&&(t=t.reverse())}return function(e,t){t=null==t?[]:t.map((function(e){return e}));var r={},n={},a=[];t.forEach((function(e,t){r[e]=0,n[e]=t}));for(var i=0;i<e.length;i++){var o,s=e[i];void 0===r[s]?(r[s]=1,o=t.push(s)-1,n[s]=o):(r[s]++,o=n[s]),a.push(o)}var l=t.map((function(e){return r[e]}));return{uniqueValues:t,uniqueCounts:l,inds:a}}(e.values,t)}));h=l.isArrayOrTypedArray(t.counts)?t.counts:[t.counts],function(e){var t;if(function(e){for(var t=new Array(e.length),r=0;r<e.length;r++){if(e[r]<0||e[r]>=e.length)return!1;if(void 0!==t[e[r]])return!1;t[e[r]]=!0}return!0}(e.map((function(e){return e.displayindex}))))for(t=0;t<e.length;t++)e[t]._displayindex=e[t].displayindex;else for(t=0;t<e.length;t++)e[t]._displayindex=t}(r),r.forEach((function(e,t){!function(e,t){e._categoryarray=t.uniqueValues,null===e.ticktext||void 0===e.ticktext?e._ticktext=[]:e._ticktext=e.ticktext.slice();for(var r=e._ticktext.length;r<t.uniqueValues.length;r++)e._ticktext.push(t.uniqueValues[r])}(e,g[t])}));var y,v=t.line;v?(a(t,"line")&&i(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),y=s.tryColorscale(v)):y=l.identity;var b,x,_,w,k,D=r[0].values.length,T={},A=g.map((function(e){return e.inds}));for(m=0,b=0;b<D;b++){var S=[];for(x=0;x<A.length;x++)S.push(A[x][b]);d=h[b%h.length],m+=d;var M=(_=b,w=void 0,k=void 0,l.isArrayOrTypedArray(v.color)?k=w=v.color[_%v.color.length]:w=v.color,{color:y(w),rawColor:k}),E=S+"-"+M.rawColor;void 0===T[E]&&(T[E]=f(S,M.color,M.rawColor)),p(T[E],b,d)}var C,N=r.map((function(e,t){return function(e,t,r,n,a){return{dimensionInd:e,containerInd:t,displayInd:r,dimensionLabel:n,count:a,categories:[],dragX:null}}(t,e._index,e._displayindex,e.label,m)}));for(b=0;b<D;b++)for(d=h[b%h.length],x=0;x<N.length;x++){var O=N[x].containerInd,I=g[x].inds[b],P=N[x].categories;if(void 0===P[I]){var R=t.dimensions[O]._categoryarray[I],L=t.dimensions[O]._ticktext[I];P[I]={dimensionInd:x,categoryInd:C=I,categoryValue:R,displayInd:C,categoryLabel:L,valueInds:[],count:0,dragY:null}}u(P[I],b,d)}return n(function(e,t,r){var n=e.map((function(e){return e.categories.length})).reduce((function(e,t){return Math.max(e,t)}));return{dimensions:e,paths:t,trace:void 0,maxCats:n,count:r}}(N,T,m))}},{"../../components/colorscale/calc":374,"../../components/colorscale/helpers":377,"../../components/drawing":388,"../../lib":503,"../../lib/filter_unique.js":494,"../../lib/gup":500,"fast-isnumeric":190}],884:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../plots/domain").defaults,s=e("../../plots/array_container_defaults"),l=e("./attributes"),c=e("../parcoords/merge_length");function u(e,t){function r(r,a){return n.coerce(e,t,l.dimensions,r,a)}var a=r("values"),i=r("visible");if(a&&a.length||(i=t.visible=!1),i){r("label"),r("displayindex",t._index);var o,s=e.categoryarray,c=Array.isArray(s)&&s.length>0;c&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete e.categoryarray,delete e.ticktext),c||"array"!==u||(t.categoryorder="trace")}}t.exports=function(e,t,r,f){function p(r,a){return n.coerce(e,t,l,r,a)}var h=s(e,t,{name:"dimensions",handleItemDefaults:u}),d=function(e,t,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(a(e,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=r}return 1/0}(e,t,r,f,p);o(t,f,p),Array.isArray(h)&&h.length||(t.visible=!1),c(t,h,"values",d),p("hoveron"),p("hovertemplate"),p("arrangement"),p("bundlecolors"),p("sortpaths"),p("counts");var m={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(p,"labelfont",m);var g={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(p,"tickfont",g)}},{"../../components/colorscale/defaults":376,"../../components/colorscale/helpers":377,"../../lib":503,"../../plots/array_container_defaults":549,"../../plots/domain":584,"../parcoords/merge_length":897,"./attributes":881}],885:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:e("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":881,"./base_plot":882,"./calc":883,"./defaults":884,"./plot":887}],886:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-interpolate").interpolateNumber,i=e("../../plot_api/plot_api"),o=e("../../components/fx"),s=e("../../lib"),l=s.strTranslate,c=e("../../components/drawing"),u=e("tinycolor2"),f=e("../../lib/svg_text_utils");function p(e,t,r,a){var i=e.map(F.bind(0,t,r)),o=a.selectAll("g.parcatslayer").data([null]);o.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var u=o.selectAll("g.trace.parcats").data(i,h),p=u.enter().append("g").attr("class","trace parcats");u.attr("transform",(function(e){return l(e.x,e.y)})),p.append("g").attr("class","paths");var v=u.select("g.paths").selectAll("path.path").data((function(e){return e.paths}),h);v.attr("fill",(function(e){return e.model.color}));var b=v.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(e){return e.model.color})).attr("fill-opacity",0);_(b),v.attr("d",(function(e){return e.svgD})),b.empty()||v.sort(m),v.exit().remove(),v.on("mouseover",g).on("mouseout",y).on("click",x),p.append("g").attr("class","dimensions");var w=u.select("g.dimensions").selectAll("g.dimension").data((function(e){return e.dimensions}),h);w.enter().append("g").attr("class","dimension"),w.attr("transform",(function(e){return l(e.x,0)})),w.exit().remove();var T=w.selectAll("g.category").data((function(e){return e.categories}),h),A=T.enter().append("g").attr("class","category");T.attr("transform",(function(e){return l(0,e.y)})),A.append("rect").attr("class","catrect").attr("pointer-events","none"),T.select("rect.catrect").attr("fill","none").attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})),k(A);var S=T.selectAll("rect.bandrect").data((function(e){return e.bands}),h);S.each((function(){s.raiseToTop(this)})),S.attr("fill",(function(e){return e.color}));var M=S.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(e){return e.color})).attr("fill-opacity",0);S.attr("fill",(function(e){return e.color})).attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).attr("y",(function(e){return e.y})).attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"perpendicular"===e.parcatsViewModel.arrangement?"ns-resize":"move"})),D(M),S.exit().remove(),A.append("text").attr("class","catlabel").attr("pointer-events","none");var P=t._fullLayout.paper_bgcolor;T.select("text.catlabel").attr("text-anchor",(function(e){return d(e)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",f.makeTextShadow(P)).style("fill","rgb(0, 0, 0)").attr("x",(function(e){return d(e)?e.width+5:-5})).attr("y",(function(e){return e.height/2})).text((function(e){return e.model.categoryLabel})).each((function(e){c.font(n.select(this),e.parcatsViewModel.categorylabelfont),f.convertToTspans(n.select(this),t)})),A.append("text").attr("class","dimlabel"),T.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(e){return e.width/2})).attr("y",-5).text((function(e,t){return 0===t?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null})).each((function(e){c.font(n.select(this),e.parcatsViewModel.labelfont)})),T.selectAll("rect.bandrect").on("mouseover",E).on("mouseout",C),T.exit().remove(),w.call(n.behavior.drag().origin((function(e){return{x:e.x,y:0}})).on("dragstart",N).on("drag",O).on("dragend",I)),u.each((function(e){e.traceSelection=n.select(this),e.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),e.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),u.exit().remove()}function h(e){return e.key}function d(e){var t=e.parcatsViewModel.dimensions.length,r=e.parcatsViewModel.dimensions[t-1].model.dimensionInd;return e.model.dimensionInd===r}function m(e,t){return e.model.rawColor>t.model.rawColor?1:e.model.rawColor<t.model.rawColor?-1:0}function g(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){s.raiseToTop(this),w(n.select(this));var t=v(e),r=b(e);if(e.parcatsViewModel.graphDiv.emit("plotly_hover",{points:t,event:n.event,constraints:r}),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none")){var a,i,l,c=n.mouse(this)[0],f=e.parcatsViewModel.graphDiv,p=e.parcatsViewModel.trace,h=f._fullLayout,d=h._paperdiv.node().getBoundingClientRect(),m=e.parcatsViewModel.graphDiv.getBoundingClientRect();for(l=0;l<e.leftXs.length-1;l++)if(e.leftXs[l]+e.dimWidths[l]-2<=c&&c<=e.leftXs[l+1]+2){var g=e.parcatsViewModel.dimensions[l],y=e.parcatsViewModel.dimensions[l+1];a=(g.x+g.width+y.x)/2,i=(e.topYs[l]+e.topYs[l+1]+e.height)/2;break}var x=e.parcatsViewModel.x+a,_=e.parcatsViewModel.y+i,k=u.mostReadable(e.model.color,["black","white"]),D=e.model.count,T=D/e.parcatsViewModel.model.count,A={countLabel:D,probabilityLabel:T.toFixed(3)},S=[];-1!==e.parcatsViewModel.hoverinfoItems.indexOf("count")&&S.push(["Count:",A.countLabel].join(" ")),-1!==e.parcatsViewModel.hoverinfoItems.indexOf("probability")&&S.push(["P:",A.probabilityLabel].join(" "));var M=S.join("<br>"),E=n.mouse(f)[0];o.loneHover({trace:p,x:x-d.left+m.left,y:_-d.top+m.top,text:M,color:e.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:k,idealAlign:E<x?"right":"left",hovertemplate:(p.line||{}).hovertemplate,hovertemplateLabels:A,eventData:[{data:p._input,fullData:p,count:D,probability:T}]},{container:h._hoverlayer.node(),outerContainer:h._paper.node(),gd:f})}}}function y(e){if(!e.parcatsViewModel.dragDimension&&(_(n.select(this)),o.loneUnhover(e.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),e.parcatsViewModel.pathSelection.sort(m),-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip"))){var t=v(e),r=b(e);e.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:t,event:n.event,constraints:r})}}function v(e){for(var t=[],r=P(e.parcatsViewModel),n=0;n<e.model.valueInds.length;n++){var a=e.model.valueInds[n];t.push({curveNumber:r,pointNumber:a})}return t}function b(e){for(var t={},r=e.parcatsViewModel.model.dimensions,n=0;n<r.length;n++){var a=r[n],i=a.categories[e.model.categoryInds[n]];t[a.containerInd]=i.categoryValue}return void 0!==e.model.rawColor&&(t.color=e.model.rawColor),t}function x(e){if(-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){var t=v(e),r=b(e);e.parcatsViewModel.graphDiv.emit("plotly_click",{points:t,event:n.event,constraints:r})}}function _(e){e.attr("fill",(function(e){return e.model.color})).attr("fill-opacity",.6).attr("stroke","lightgray").attr("stroke-width",.2).attr("stroke-opacity",1)}function w(e){e.attr("fill-opacity",.8).attr("stroke",(function(e){return u.mostReadable(e.model.color,["black","white"])})).attr("stroke-width",.3)}function k(e){e.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function D(e){e.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function T(e){var t=e.parcatsViewModel.pathSelection,r=e.categoryViewModel.model.dimensionInd,n=e.categoryViewModel.model.categoryInd;return t.filter((function(t){return t.model.categoryInds[r]===n&&t.model.color===e.color}))}function A(e,t,r){var a=n.select(e).datum(),i=a.categoryViewModel.model,o=a.parcatsViewModel.graphDiv,s=n.select(e.parentNode).selectAll("rect.bandrect"),l=[];s.each((function(e){T(e).each((function(e){Array.prototype.push.apply(l,v(e))}))}));var c={};c[i.dimensionInd]=i.categoryValue,o.emit(t,{points:l,event:r,constraints:c})}function S(e,t,r){var a=n.select(e).datum(),i=a.categoryViewModel.model,o=a.parcatsViewModel.graphDiv,s=T(a),l=[];s.each((function(e){Array.prototype.push.apply(l,v(e))}));var c={};c[i.dimensionInd]=i.categoryValue,void 0!==a.rawColor&&(c.color=a.rawColor),o.emit(t,{points:l,event:r,constraints:c})}function M(e,t,r){e._fullLayout._calcInverseTransform(e);var a,i,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=n.select(r.parentNode).select("rect.catrect"),c=l.node().getBoundingClientRect(),u=l.datum(),f=u.parcatsViewModel,p=f.model.dimensions[u.model.dimensionInd],h=f.trace,d=c.top+c.height/2;f.dimensions.length>1&&p.displayInd===f.dimensions.length-1?(a=c.left,i="left"):(a=c.left+c.width,i="right");var m=u.model.count,g=u.model.categoryLabel,y=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},b=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&b.push(["Count:",v.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&b.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var x=b.join("<br>");return{trace:h,x:o*(a-t.left),y:s*(d-t.top),text:x,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:i,hovertemplate:h.hovertemplate,hovertemplateLabels:v,eventData:[{data:h._input,fullData:h,count:m,category:g,probability:y}]}}function E(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var t,r=e.parcatsViewModel.graphDiv,a=r._fullLayout,i=a._paperdiv.node().getBoundingClientRect(),l=e.parcatsViewModel.hoveron;"color"===l?(function(e){var t=n.select(e).datum(),r=T(t);w(r),r.each((function(){s.raiseToTop(this)})),n.select(e.parentNode).selectAll("rect.bandrect").filter((function(e){return e.color===t.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),S(this,"plotly_hover",n.event)):(function(e){n.select(e.parentNode).selectAll("rect.bandrect").each((function(e){var t=T(e);w(t),t.each((function(){s.raiseToTop(this)}))})),n.select(e.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),A(this,"plotly_hover",n.event)),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?t=M(r,i,this):"color"===l?t=function(e,t,r){e._fullLayout._calcInverseTransform(e);var a,i,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=r.getBoundingClientRect(),c=n.select(r).datum(),f=c.categoryViewModel,p=f.parcatsViewModel,h=p.model.dimensions[f.model.dimensionInd],d=p.trace,m=l.y+l.height/2;p.dimensions.length>1&&h.displayInd===p.dimensions.length-1?(a=l.left,i="left"):(a=l.left+l.width,i="right");var g=f.model.categoryLabel,y=c.parcatsViewModel.model.count,v=0;c.categoryViewModel.bands.forEach((function(e){e.color===c.color&&(v+=e.count)}));var b=f.model.count,x=0;p.pathSelection.each((function(e){e.model.color===c.color&&(x+=e.model.count)}));var _=v/y,w=v/x,k=v/b,D={countLabel:y,categoryLabel:g,probabilityLabel:_.toFixed(3)},T=[];-1!==f.parcatsViewModel.hoverinfoItems.indexOf("count")&&T.push(["Count:",D.countLabel].join(" ")),-1!==f.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(T.push("P(color ∩ "+g+"): "+D.probabilityLabel),T.push("P("+g+" | color): "+w.toFixed(3)),T.push("P(color | "+g+"): "+k.toFixed(3)));var A=T.join("<br>"),S=u.mostReadable(c.color,["black","white"]);return{trace:d,x:o*(a-t.left),y:s*(m-t.top),text:A,color:c.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:i,hovertemplate:d.hovertemplate,hovertemplateLabels:D,eventData:[{data:d._input,fullData:d,category:g,count:y,probability:_,categorycount:b,colorcount:x,bandcolorcount:v}]}}(r,i,this):"dimension"===l&&(t=function(e,t,r){var a=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){a.push(M(e,t,this))})),a}(r,i,this)),t&&o.loneHover(t,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r}))}}function C(e){var t=e.parcatsViewModel;t.dragDimension||(_(t.pathSelection),k(t.dimensionSelection.selectAll("g.category")),D(t.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(t.graphDiv._fullLayout._hoverlayer.node()),t.pathSelection.sort(m),-1!==t.hoverinfoItems.indexOf("skip"))||("color"===e.parcatsViewModel.hoveron?S(this,"plotly_unhover",n.event):A(this,"plotly_unhover",n.event))}function N(e){"fixed"!==e.parcatsViewModel.arrangement&&(e.dragDimensionDisplayInd=e.model.displayInd,e.initialDragDimensionDisplayInds=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),e.dragHasMoved=!1,e.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(t){var r=n.mouse(this)[0],a=n.mouse(this)[1];-2<=r&&r<=t.width+2&&-2<=a&&a<=t.height+2&&(e.dragCategoryDisplayInd=t.model.displayInd,e.initialDragCategoryDisplayInds=e.model.categories.map((function(e){return e.displayInd})),t.model.dragY=t.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(t){t.y<a&&a<=t.y+t.height&&(e.potentialClickBand=this)})))})),e.parcatsViewModel.dragDimension=e,o.loneUnhover(e.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()))}function O(e){if("fixed"!==e.parcatsViewModel.arrangement&&(e.dragHasMoved=!0,null!==e.dragDimensionDisplayInd)){var t=e.dragDimensionDisplayInd,r=t-1,a=t+1,i=e.parcatsViewModel.dimensions[t];if(null!==e.dragCategoryDisplayInd){var o=i.categories[e.dragCategoryDisplayInd];o.model.dragY+=n.event.dy;var s=o.model.dragY,l=o.model.displayInd,c=i.categories,u=c[l-1],f=c[l+1];void 0!==u&&s<u.y+u.height/2&&(o.model.displayInd=u.model.displayInd,u.model.displayInd=l),void 0!==f&&s+o.height>f.y+f.height/2&&(o.model.displayInd=f.model.displayInd,f.model.displayInd=l),e.dragCategoryDisplayInd=o.model.displayInd}if(null===e.dragCategoryDisplayInd||"freeform"===e.parcatsViewModel.arrangement){i.model.dragX=n.event.x;var p=e.parcatsViewModel.dimensions[r],h=e.parcatsViewModel.dimensions[a];void 0!==p&&i.model.dragX<p.x+p.width&&(i.model.displayInd=p.model.displayInd,p.model.displayInd=t),void 0!==h&&i.model.dragX+i.width>h.x&&(i.model.displayInd=h.model.displayInd,h.model.displayInd=e.dragDimensionDisplayInd),e.dragDimensionDisplayInd=i.model.displayInd}j(e.parcatsViewModel),z(e.parcatsViewModel),L(e.parcatsViewModel),R(e.parcatsViewModel)}}function I(e){if("fixed"!==e.parcatsViewModel.arrangement&&null!==e.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var t={},r=P(e.parcatsViewModel),a=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),o=e.initialDragDimensionDisplayInds.some((function(e,t){return e!==a[t]}));o&&a.forEach((function(r,n){var a=e.parcatsViewModel.model.dimensions[n].containerInd;t["dimensions["+a+"].displayindex"]=r}));var s=!1;if(null!==e.dragCategoryDisplayInd){var l=e.model.categories.map((function(e){return e.displayInd}));if(s=e.initialDragCategoryDisplayInds.some((function(e,t){return e!==l[t]}))){var c=e.model.categories.slice().sort((function(e,t){return e.displayInd-t.displayInd})),u=c.map((function(e){return e.categoryValue})),f=c.map((function(e){return e.categoryLabel}));t["dimensions["+e.model.containerInd+"].categoryarray"]=[u],t["dimensions["+e.model.containerInd+"].ticktext"]=[f],t["dimensions["+e.model.containerInd+"].categoryorder"]="array"}}-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!e.dragHasMoved&&e.potentialClickBand&&("color"===e.parcatsViewModel.hoveron?S(e.potentialClickBand,"plotly_click",n.event.sourceEvent):A(e.potentialClickBand,"plotly_click",n.event.sourceEvent)),e.model.dragX=null,null!==e.dragCategoryDisplayInd&&(e.parcatsViewModel.dimensions[e.dragDimensionDisplayInd].categories[e.dragCategoryDisplayInd].model.dragY=null,e.dragCategoryDisplayInd=null),e.dragDimensionDisplayInd=null,e.parcatsViewModel.dragDimension=null,e.dragHasMoved=null,e.potentialClickBand=null,j(e.parcatsViewModel),z(e.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){L(e.parcatsViewModel,!0),R(e.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&i.restyle(e.parcatsViewModel.graphDiv,t,[r])}))}}function P(e){for(var t,r=e.graphDiv._fullData,n=0;n<r.length;n++)if(e.key===r[n].uid){t=n;break}return t}function R(e,t){var r;void 0===t&&(t=!1),e.pathSelection.data((function(e){return e.paths}),h),(r=e.pathSelection,t?r.transition():r).attr("d",(function(e){return e.svgD}))}function L(e,t){function r(e){return t?e.transition():e}void 0===t&&(t=!1),e.dimensionSelection.data((function(e){return e.dimensions}),h);var a=e.dimensionSelection.selectAll("g.category").data((function(e){return e.categories}),h);r(e.dimensionSelection).attr("transform",(function(e){return l(e.x,0)})),r(a).attr("transform",(function(e){return l(0,e.y)})),a.select(".dimlabel").text((function(e,t){return 0===t?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null})),a.select(".catlabel").attr("text-anchor",(function(e){return d(e)?"start":"end"})).attr("x",(function(e){return d(e)?e.width+5:-5})).each((function(e){var t,r;d(e)?(t=e.width+5,r="start"):(t=-5,r="end"),n.select(this).selectAll("tspan").attr("x",t).attr("text-anchor",r)}));var i=a.selectAll("rect.bandrect").data((function(e){return e.bands}),h),o=i.enter().append("rect").attr("class","bandrect").attr("cursor","move").attr("stroke-opacity",0).attr("fill",(function(e){return e.color})).attr("fill-opacity",0);i.attr("fill",(function(e){return e.color})).attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).attr("y",(function(e){return e.y})),D(o),i.each((function(){s.raiseToTop(this)})),i.exit().remove()}function F(e,t,r){var n,a=r[0],i=t.margin||{l:80,r:80,t:100,b:80},o=a.trace,s=o.domain,l=t.width,c=t.height,u=Math.floor(l*(s.x[1]-s.x[0])),f=Math.floor(c*(s.y[1]-s.y[0])),p=s.x[0]*l+i.l,h=t.height-s.y[1]*t.height+i.t,d=o.line.shape;n="all"===o.hoverinfo?["count","probability"]:(o.hoverinfo||"").split("+");var m={trace:o,key:o.uid,model:a,x:p,y:h,width:u,height:f,hoveron:o.hoveron,hoverinfoItems:n,arrangement:o.arrangement,bundlecolors:o.bundlecolors,sortpaths:o.sortpaths,labelfont:o.labelfont,categorylabelfont:o.tickfont,pathShape:d,dragDimension:null,margin:i,paths:[],dimensions:[],graphDiv:e,traceSelection:null,pathSelection:null,dimensionSelection:null};return a.dimensions&&(j(m),z(m)),m}function B(e,t,r,n,i){var o,s,l=[],c=[];for(s=0;s<r.length-1;s++)o=a(r[s]+e[s],e[s+1]),l.push(o(i)),c.push(o(1-i));var u="M "+e[0]+","+t[0];for(u+="l"+r[0]+",0 ",s=1;s<r.length;s++)u+="C"+l[s-1]+","+t[s-1]+" "+c[s-1]+","+t[s]+" "+e[s]+","+t[s],u+="l"+r[s]+",0 ";for(u+="l0,"+n+" ",u+="l -"+r[r.length-1]+",0 ",s=r.length-2;s>=0;s--)u+="C"+c[s]+","+(t[s+1]+n)+" "+l[s]+","+(t[s]+n)+" "+(e[s]+r[s])+","+(t[s]+n),u+="l-"+r[s]+",0 ";return u+"Z"}function z(e){var t=e.dimensions,r=e.model,n=t.map((function(e){return e.categories.map((function(e){return e.y}))})),a=e.model.dimensions.map((function(e){return e.categories.map((function(e){return e.displayInd}))})),i=e.model.dimensions.map((function(e){return e.displayInd})),o=e.dimensions.map((function(e){return e.model.dimensionInd})),s=t.map((function(e){return e.x})),l=t.map((function(e){return e.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function f(e){var t=e.categoryInds.map((function(e,t){return a[t][e]}));return o.map((function(e){return t[e]}))}c.sort((function(t,r){var n=f(t),a=f(r);return"backward"===e.sortpaths&&(n.reverse(),a.reverse()),n.push(t.valueInds[0]),a.push(r.valueInds[0]),e.bundlecolors&&(n.unshift(t.rawColor),a.unshift(r.rawColor)),n<a?-1:n>a?1:0}));for(var p=new Array(c.length),h=t[0].model.count,d=t[0].categories.map((function(e){return e.height})).reduce((function(e,t){return e+t})),m=0;m<c.length;m++){var g,y=c[m];g=h>0?d*(y.count/h):0;for(var v,b=new Array(n.length),x=0;x<y.categoryInds.length;x++){var _=y.categoryInds[x],w=a[x][_],k=i[x];b[k]=n[k][w],n[k][w]+=g;var D=e.dimensions[k].categories[w],T=D.bands.length,A=D.bands[T-1];if(void 0===A||y.rawColor!==A.rawColor){var S=void 0===A?0:A.y+A.height;D.bands.push({key:S,color:y.color,rawColor:y.rawColor,height:g,width:D.width,count:y.count,y:S,categoryViewModel:D,parcatsViewModel:e})}else{var M=D.bands[T-1];M.height+=g,M.count+=y.count}}v="hspline"===e.pathShape?B(s,b,l,g,.5):B(s,b,l,g,0),p[m]={key:y.valueInds[0],model:y,height:g,leftXs:s,topYs:b,dimWidths:l,svgD:v,parcatsViewModel:e}}e.paths=p}function j(e){var t=e.model.dimensions.map((function(e){return{displayInd:e.displayInd,dimensionInd:e.dimensionInd}}));t.sort((function(e,t){return e.displayInd-t.displayInd}));var r=[];for(var n in t){var a=t[n].dimensionInd,i=e.model.dimensions[a];r.push(U(e,i))}e.dimensions=r}function U(e,t){var r,n=e.model.dimensions.length,a=t.displayInd;r=40+(n>1?(e.width-80-16)/(n-1):0)*a;var i,o,s,l,c,u=[],f=e.model.maxCats,p=t.categories.length,h=t.count,d=e.height-8*(f-1),m=8*(f-p)/2,g=t.categories.map((function(e){return{displayInd:e.displayInd,categoryInd:e.categoryInd}}));for(g.sort((function(e,t){return e.displayInd-t.displayInd})),c=0;c<p;c++)l=g[c].categoryInd,o=t.categories[l],i=h>0?o.count/h*d:0,s={key:o.valueInds[0],model:o,width:16,height:i,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:e},m=m+i+8,u.push(s);return{key:t.dimensionInd,x:null!==t.dragX?t.dragX:r,y:0,width:16,model:t,categories:u,parcatsViewModel:e,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}t.exports=function(e,t,r,n){p(r,e,n,t)}},{"../../components/drawing":388,"../../components/fx":406,"../../lib":503,"../../lib/svg_text_utils":529,"../../plot_api/plot_api":540,"@plotly/d3":58,"d3-interpolate":116,tinycolor2:312}],887:[function(e,t,r){"use strict";var n=e("./parcats");t.exports=function(e,t,r,a){var i=e._fullLayout,o=i._paper,s=i._size;n(e,o,t,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,a)}},{"./parcats":886}],888:[function(e,t,r){"use strict";var n=e("../../components/colorscale/attributes"),a=e("../../plots/cartesian/layout_attributes"),i=e("../../plots/font_attributes"),o=e("../../plots/domain").attributes,s=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray;t.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:i({editType:"plot"}),tickfont:i({editType:"plot"}),rangefont:i({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},a.tickvals,{editType:"plot"}),ticktext:s({},a.ticktext,{editType:"plot"}),tickformat:s({},a.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"}))}},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plot_api/plot_template":543,"../../plots/cartesian/layout_attributes":569,"../../plots/domain":584,"../../plots/font_attributes":585}],889:[function(e,t,r){"use strict";var n=e("./constants"),a=e("@plotly/d3"),i=e("../../lib/gup").keyFun,o=e("../../lib/gup").repeat,s=e("../../lib").sorterAsc,l=e("../../lib").strTranslate,c=n.bar.snapRatio;function u(e,t){return e*(1-c)+t*c}var f=n.bar.snapClose;function p(e,t){return e*(1-f)+t*f}function h(e,t,r,n){if(function(e,t){for(var r=0;r<t.length;r++)if(e>=t[r][0]&&e<=t[r][1])return!0;return!1}(r,n))return r;var a=e?-1:1,i=0,o=t.length-1;if(a<0){var s=i;i=o,o=s}for(var l=t[i],c=l,f=i;a*f<a*o;f+=a){var h=f+a,d=t[h];if(a*r<a*p(l,d))return u(l,c);if(a*r<a*d||h===o)return u(d,l);c=l,l=d}}function d(e){e.attr("x",-n.bar.captureWidth/2).attr("width",n.bar.captureWidth)}function m(e){e.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function g(e){if(!e.brush.filterSpecified)return"0,"+e.height;for(var t,r,n,a=y(e.brush.filter.getConsolidated(),e.height),i=[0],o=a.length?a[0][0]:null,s=0;s<a.length;s++)r=(t=a[s])[1]-t[0],i.push(o),i.push(r),(n=s+1)<a.length&&(o=a[n][0]-t[1]);return i.push(e.height),i}function y(e,t){return e.map((function(e){return e.map((function(e){return Math.max(0,e*t)})).sort(s)}))}function v(){a.select(document.body).style("cursor",null)}function b(e){e.attr("stroke-dasharray",g)}function x(e,t){var r=a.select(e).selectAll(".highlight, .highlight-shadow");b(t?r.transition().duration(n.bar.snapDuration).each("end",t):r)}function _(e,t){var r,a=e.brush,i=NaN,o={};if(a.filterSpecified){var s=e.height,l=a.filter.getConsolidated(),c=y(l,s),u=NaN,f=NaN,p=NaN;for(r=0;r<=c.length;r++){var h=c[r];if(h&&h[0]<=t&&t<=h[1]){u=r;break}if(f=r?r-1:NaN,h&&h[0]>t){p=r;break}}if(i=u,isNaN(i)&&(i=isNaN(f)||isNaN(p)?isNaN(f)?p:f:t-c[f][1]<c[p][0]-t?f:p),!isNaN(i)){var d=c[i],m=function(e,t){var r=n.bar.handleHeight;if(!(t>e[1]+r||t<e[0]-r))return t>=.9*e[1]+.1*e[0]?"n":t<=.9*e[0]+.1*e[1]?"s":"ns"}(d,t);m&&(o.interval=l[i],o.intervalPix=d,o.region=m)}}if(e.ordinal&&!o.region){var g=e.unitTickvals,v=e.unitToPaddedPx.invert(t);for(r=0;r<g.length;r++){var b=[.25*g[Math.max(r-1,0)]+.75*g[r],.25*g[Math.min(r+1,g.length-1)]+.75*g[r]];if(v>=b[0]&&v<=b[1]){o.clickableOrdinalRange=b;break}}}return o}function w(e,t){a.event.sourceEvent.stopPropagation();var r=t.height-a.mouse(e)[1]-2*n.verticalPadding,i=t.brush.svgBrush;i.wasDragged=!0,i._dragging=!0,i.grabbingBar?i.newExtent=[r-i.grabPoint,r+i.barLength-i.grabPoint].map(t.unitToPaddedPx.invert):i.newExtent=[i.startExtent,t.unitToPaddedPx.invert(r)].sort(s),t.brush.filterSpecified=!0,i.extent=i.stayingIntervals.concat([i.newExtent]),i.brushCallback(t),x(e.parentNode)}function k(e,t){var r=_(t,t.height-a.mouse(e)[1]-2*n.verticalPadding),i="crosshair";r.clickableOrdinalRange?i="pointer":r.region&&(i=r.region+"-resize"),a.select(document.body).style("cursor",i)}function D(e){e.on("mousemove",(function(e){a.event.preventDefault(),e.parent.inBrushDrag||k(this,e)})).on("mouseleave",(function(e){e.parent.inBrushDrag||v()})).call(a.behavior.drag().on("dragstart",(function(e){!function(e,t){a.event.sourceEvent.stopPropagation();var r=t.height-a.mouse(e)[1]-2*n.verticalPadding,i=t.unitToPaddedPx.invert(r),o=t.brush,s=_(t,r),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(t.unitToPaddedPx);c.grabPoint=r-u[0]-n.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=t.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(e){return e[0]!==l[0]&&e[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:i,t.parent.inBrushDrag=!0,c.brushStartCallback()}(this,e)})).on("drag",(function(e){w(this,e)})).on("dragend",(function(e){!function(e,t){var r=t.brush,n=r.filter,i=r.svgBrush;i._dragging||(k(e,t),w(e,t),t.brush.svgBrush.wasDragged=!1),i._dragging=!1,a.event.sourceEvent.stopPropagation();var o=i.grabbingBar;if(i.grabbingBar=!1,i.grabLocation=void 0,t.parent.inBrushDrag=!1,v(),!i.wasDragged)return i.wasDragged=void 0,i.clickableOrdinalRange?r.filterSpecified&&t.multiselect?i.extent.push(i.clickableOrdinalRange):(i.extent=[i.clickableOrdinalRange],r.filterSpecified=!0):o?(i.extent=i.stayingIntervals,0===i.extent.length&&A(r)):A(r),i.brushCallback(t),x(e.parentNode),void i.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(t.ordinal){var l=t.unitTickvals;l[l.length-1]<l[0]&&l.reverse(),i.newExtent=[h(0,l,i.newExtent[0],i.stayingIntervals),h(1,l,i.newExtent[1],i.stayingIntervals)];var c=i.newExtent[1]>i.newExtent[0];i.extent=i.stayingIntervals.concat(c?[i.newExtent]:[]),i.extent.length||A(r),i.brushCallback(t),c?x(e.parentNode,s):(s(),x(e.parentNode))}else s();i.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,e)})))}function T(e,t){return e[0]-t[0]}function A(e){e.filterSpecified=!1,e.svgBrush.extent=[[-1/0,1/0]]}function S(e){for(var t,r=e.slice(),n=[],a=r.shift();a;){for(t=a.slice();(a=r.shift())&&a[0]<=t[1];)t[1]=Math.max(t[1],a[1]);n.push(t)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}t.exports={makeBrush:function(e,t,r,n,a,i){var o,l=function(){var e,t,r=[];return{set:function(n){1===(r=n.map((function(e){return e.slice().sort(s)})).sort(T)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),e=S(r),t=r.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return e},getBounds:function(){return t}}}();return l.set(r),{filter:l,filterSpecified:t,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=a,function(e){var t=e.brush,r=function(e){return e.svgBrush.extent.map((function(e){return e.slice()}))}(t).slice();t.filter.set(r),o()}),brushEndCallback:i}}},ensureAxisBrush:function(e,t){var r=e.selectAll("."+n.cn.axisBrush).data(o,i);r.enter().append("g").classed(n.cn.axisBrush,!0),function(e,t){var r=e.selectAll(".background").data(o);r.enter().append("rect").classed("background",!0).call(d).call(m).style("pointer-events","auto").attr("transform",l(0,n.verticalPadding)),r.call(D).attr("height",(function(e){return e.height-n.verticalPadding}));var a=e.selectAll(".highlight-shadow").data(o);a.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",t).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),a.attr("y1",(function(e){return e.height})).call(b);var i=e.selectAll(".highlight").data(o);i.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),i.attr("y1",(function(e){return e.height})).call(b)}(r,t)},cleanRanges:function(e,t){if(Array.isArray(e[0])?(e=e.map((function(e){return e.sort(s)})),e=t.multiselect?S(e.sort(T)):[e[0]]):e=[e.sort(s)],t.tickvals){var r=t.tickvals.slice().sort(s);if(!(e=e.map((function(e){var t=[h(0,r,e[0],[]),h(1,r,e[1],[])];if(t[1]>t[0])return t})).filter((function(e){return e}))).length)return}return e.length>1?e:e[0]}}},{"../../lib":503,"../../lib/gup":500,"./constants":892,"@plotly/d3":58}],890:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/get_data").getModuleCalcData,i=e("./plot"),o=e("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(e){var t=a(e.calcdata,"parcoords")[0];t.length&&i(e,t)},r.clean=function(e,t,r,n){var a=n._has&&n._has("parcoords"),i=t._has&&t._has("parcoords");a&&!i&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(e){var t=e._fullLayout._glimages,r=n.select(e).selectAll(".svg-container");r.filter((function(e,t){return t===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this.toDataURL("image/png");t.append("svg:image").attr({xmlns:o.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":480,"../../plots/get_data":593,"./plot":899,"@plotly/d3":58}],891:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale"),i=e("../../lib/gup").wrap;t.exports=function(e,t){var r,o;return a.hasColorscale(t,"line")&&n(t.line.color)?(r=t.line.color,o=a.extractOpts(t.line).colorscale,a.calc(e,t,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=.5;return t}(t._length),o=[[0,t.line.color],[1,t.line.color]]),i({lineColor:r,cscale:o})}},{"../../components/colorscale":378,"../../lib":503,"../../lib/gup":500}],892:[function(e,t,r){"use strict";t.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,deselectedLineColor:"#777",bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}},{}],893:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../plots/domain").defaults,s=e("../../plots/array_container_defaults"),l=e("../../plots/cartesian/axes"),c=e("./attributes"),u=e("./axisbrush"),f=e("./constants").maxDimensionCount,p=e("./merge_length");function h(e,t,r,a){function i(r,a){return n.coerce(e,t,c.dimensions,r,a)}var o=i("values"),s=i("visible");if(o&&o.length||(s=t.visible=!1),s){i("label"),i("tickvals"),i("ticktext"),i("tickformat");var f=i("range");t._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:f},l.setConvert(t._ax,a.layout),i("multiselect");var p=i("constraintrange");p&&(t.constraintrange=u.cleanRanges(p,t))}}t.exports=function(e,t,r,l){function u(r,a){return n.coerce(e,t,c,r,a)}var d=e.dimensions;Array.isArray(d)&&d.length>f&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),d.splice(f));var m=s(e,t,{name:"dimensions",layout:l,handleItemDefaults:h}),g=function(e,t,r,o,s){var l=s("line.color",r);if(a(e,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=r}return 1/0}(e,t,r,l,u);o(t,l,u),Array.isArray(m)&&m.length||(t.visible=!1),p(t,m,"values",g);var y={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",y),n.coerceFont(u,"tickfont",y),n.coerceFont(u,"rangefont",y),u("labelangle"),u("labelside")}},{"../../components/colorscale/defaults":376,"../../components/colorscale/helpers":377,"../../lib":503,"../../plots/array_container_defaults":549,"../../plots/cartesian/axes":554,"../../plots/domain":584,"./attributes":888,"./axisbrush":889,"./constants":892,"./merge_length":897}],894:[function(e,t,r){"use strict";var n=e("../../lib").isTypedArray;r.convertTypedArray=function(e){return n(e)?Array.prototype.slice.call(e):e},r.isOrdinal=function(e){return!!e.tickvals},r.isVisible=function(e){return e.visible||!("visible"in e)}},{"../../lib":503}],895:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:e("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":888,"./base_plot":890,"./calc":891,"./defaults":893,"./plot":899}],896:[function(e,t,r){"use strict";var n=e("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n               p17_20, p21_24, p25_28, p29_32,\n               p33_36, p37_40, p41_44, p45_48,\n               p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n             loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick    = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n    return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n    float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n    float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n    return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n    return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n    return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n    return (\n        fOutside(p[0], lo[0], hi[0]) ||\n        fOutside(p[1], lo[1], hi[1]) ||\n        fOutside(p[2], lo[2], hi[2]) ||\n        fOutside(p[3], lo[3], hi[3])\n    );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n    return (\n        vOutside(p[0], lo[0], hi[0]) ||\n        vOutside(p[1], lo[1], hi[1]) ||\n        vOutside(p[2], lo[2], hi[2]) ||\n        vOutside(p[3], lo[3], hi[3])\n    );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n    return mOutside(A, loA, hiA) ||\n           mOutside(B, loB, hiB) ||\n           mOutside(C, loC, hiC) ||\n           mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n    mat4 pnts[4];\n    pnts[0] = A;\n    pnts[1] = B;\n    pnts[2] = C;\n    pnts[3] = D;\n\n    for(int i = 0; i < 4; ++i) {\n        for(int j = 0; j < 4; ++j) {\n            for(int k = 0; k < 4; ++k) {\n                if(0 == iMod(\n                    int(255.0 * texture2D(maskTexture,\n                        vec2(\n                            (float(i * 2 + j / 2) + 0.5) / 8.0,\n                            (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n                        ))[3]\n                    ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n                    2\n                )) return true;\n            }\n        }\n    }\n    return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n    float x = 0.5 * sign(v) + 0.5;\n    float y = axisY(x, A, B, C, D);\n    float z = 1.0 - abs(v);\n\n    z += isContext ? 0.0 : 2.0 * float(\n        outsideBoundingBox(A, B, C, D) ||\n        outsideRasterMask(A, B, C, D)\n    );\n\n    return vec4(\n        2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n        z,\n        1.0\n    );\n}\n\nvoid main() {\n    mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n    mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n    mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n    mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n    float v = colors[3];\n\n    gl_Position = position(isContext, v, A, B, C, D);\n\n    fragColor =\n        isContext ? vec4(contextColor) :\n        isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n    gl_FragColor = fragColor;\n}\n"]),o=e("./constants").maxDimensionCount,s=e("../../lib"),l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(e,t,r,n,a){var i=e._gl;i.enable(i.SCISSOR_TEST),i.scissor(t,r,n,a),e.clear({color:[0,0,0,0],depth:1})}function p(e,t,r,n,a,i){var o=i.key;r.drawCompleted||(function(e){e.read({x:0,y:0,width:1,height:1,data:l})}(e),r.drawCompleted=!0),function s(l){var c=Math.min(n,a-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(e,i.scissorX,i.scissorY,i.scissorWidth,i.viewBoxSize[1])),r.clearOnly||(i.count=2*c,i.offset=2*l*n,t(i),l*n+c<a&&(r.currentRafs[o]=window.requestAnimationFrame((function(){s(l+1)}))),r.drawCompleted=!1)}(0)}function h(e,t){for(var r=new Array(256),n=0;n<256;n++)r[n]=e(n/255).concat(t);return r}function d(e,t){return(e>>>8*t)%256/255}function m(e,t,r){for(var n=new Array(8*t),a=0,i=0;i<t;i++)for(var o=0;o<2;o++)for(var s=0;s<4;s++){var l=4*e+s,c=r[64*i+l];63===l&&0===o&&(c*=-1),n[a++]=c}return n}function g(e){var t="0"+e;return t.substr(t.length-2)}function y(e){return e<o?"p"+g(e+1)+"_"+g(e+4):"colors"}function v(e,t,r,n,a,i,o,l,c,u,f,p,h,d){for(var m=[[],[]],g=0;g<64;g++)m[0][g]=g===a?1:0,m[1][g]=g===i?1:0;o*=d,l*=d,c*=d,u*=d;var y=e.lines.canvasOverdrag*d,v=e.domain,b=e.canvasWidth*d,x=e.canvasHeight*d,_=e.pad.l*d,w=e.pad.b*d,k=e.layoutHeight*d,D=e.layoutWidth*d,T=e.deselectedLines.color;return s.extendFlat({key:f,resolution:[b,x],viewBoxPos:[o+y,l],viewBoxSize:[c,u],i0:a,i1:i,dim0A:m[0].slice(0,16),dim0B:m[0].slice(16,32),dim0C:m[0].slice(32,48),dim0D:m[0].slice(48,64),dim1A:m[1].slice(0,16),dim1B:m[1].slice(16,32),dim1C:m[1].slice(32,48),dim1D:m[1].slice(48,64),drwLayer:p,contextColor:[T[0]/255,T[1]/255,T[2]/255,T[3]<1?T[3]:Math.max(1/255,Math.pow(1/e.lines.color.length,1/3))],scissorX:(n===t?0:o+y)+(_-y)+D*v.x[0],scissorWidth:(n===r?b-o+y:c+.5)+(n===t?o+y:0),scissorY:l+w+k*v.y[0],scissorHeight:u,viewportX:_-y+D*v.x[0],viewportY:w+k*v.y[0],viewportWidth:b,viewportHeight:x},h)}function b(e){var t=Math.max(0,Math.floor(2047*e[0]),0),r=Math.min(2047,Math.ceil(2047*e[1]),2047);return[Math.min(t,r),Math.max(t,r)]}t.exports=function(e,t){var r,n,l,g,x,_=t.context,w=t.pick,k=t.regl,D=k._gl,T=D.getParameter(D.ALIASED_LINE_WIDTH_RANGE),A=Math.max(T[0],Math.min(T[1],t.viewModel.plotGlPixelRatio)),S={currentRafs:{},drawCompleted:!0,clearOnly:!1},M=function(e){for(var t={},r=0;r<=o;r+=4)t[y(r)]=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return t}(k),E=k.texture(u),C=[];O(t);var N=k({profile:!1,blend:{enable:_,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!_,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:k.prop("scissorX"),y:k.prop("scissorY"),width:k.prop("scissorWidth"),height:k.prop("scissorHeight")}},viewport:{x:k.prop("viewportX"),y:k.prop("viewportY"),width:k.prop("viewportWidth"),height:k.prop("viewportHeight")},dither:!1,vert:a,frag:i,primitive:"lines",lineWidth:A,attributes:M,uniforms:{resolution:k.prop("resolution"),viewBoxPos:k.prop("viewBoxPos"),viewBoxSize:k.prop("viewBoxSize"),dim0A:k.prop("dim0A"),dim1A:k.prop("dim1A"),dim0B:k.prop("dim0B"),dim1B:k.prop("dim1B"),dim0C:k.prop("dim0C"),dim1C:k.prop("dim1C"),dim0D:k.prop("dim0D"),dim1D:k.prop("dim1D"),loA:k.prop("loA"),hiA:k.prop("hiA"),loB:k.prop("loB"),hiB:k.prop("hiB"),loC:k.prop("loC"),hiC:k.prop("hiC"),loD:k.prop("loD"),hiD:k.prop("hiD"),palette:E,contextColor:k.prop("contextColor"),maskTexture:k.prop("maskTexture"),drwLayer:k.prop("drwLayer"),maskHeight:k.prop("maskHeight")},offset:k.prop("offset"),count:k.prop("count")});function O(e){r=e.model,n=e.viewModel,l=n.dimensions.slice(),g=l[0]?l[0].values.length:0;var t=r.lines,a=w?t.color.map((function(e,r){return r/t.color.length})):t.color,i=function(e,t,r){for(var n,a=new Array(e*(o+4)),i=0,s=0;s<e;s++){for(var l=0;l<o;l++)a[i++]=l<t.length?t[l].paddedUnitValues[s]:.5;a[i++]=d(s,2),a[i++]=d(s,1),a[i++]=d(s,0),a[i++]=(n=r[s],Math.max(1e-6,Math.min(.999999,n)))}return a}(g,l,a);!function(e,t,r){for(var n=0;n<=o;n+=4)e[y(n)](m(n/4,t,r))}(M,g,i),_||w||(E=k.texture(s.extendFlat({data:h(r.unitToColor,255)},u)))}return{render:function(e,t,n){var a,i,o,s=e.length,c=1/0,u=-1/0;for(a=0;a<s;a++)e[a].dim0.canvasX<c&&(c=e[a].dim0.canvasX,i=a),e[a].dim1.canvasX>u&&(u=e[a].dim1.canvasX,o=a);0===s&&f(k,0,0,r.canvasWidth,r.canvasHeight);var h=function(e){var t,r,n,a=[[],[]];for(n=0;n<64;n++){var i=!e&&n<l.length?l[n].brush.filter.getBounds():[-1/0,1/0];a[0][n]=i[0],a[1][n]=i[1]}var o=new Array(16384);for(t=0;t<16384;t++)o[t]=255;if(!e)for(t=0;t<l.length;t++){var s=t%8,c=(t-s)/8,u=Math.pow(2,s),f=l[t].brush.filter.get();if(!(f.length<2)){var p=b(f[0])[1];for(r=1;r<f.length;r++){var h=b(f[r]);for(n=p+1;n<h[0];n++)o[8*n+c]&=~u;p=Math.max(p,h[1])}}}var d={shape:[8,2048],format:"alpha",type:"uint8",mag:"nearest",min:"nearest",data:o};return x?x(d):x=k.texture(d),{maskTexture:x,maskHeight:2048,loA:a[0].slice(0,16),loB:a[0].slice(16,32),loC:a[0].slice(32,48),loD:a[0].slice(48,64),hiA:a[1].slice(0,16),hiB:a[1].slice(16,32),hiC:a[1].slice(32,48),hiD:a[1].slice(48,64)}}(_);for(a=0;a<s;a++){var d=e[a],m=d.dim0.crossfilterDimensionIndex,y=d.dim1.crossfilterDimensionIndex,D=d.canvasX,T=d.canvasY,A=D+d.panelSizeX,M=d.plotGlPixelRatio;if(t||!C[m]||C[m][0]!==D||C[m][1]!==A){C[m]=[D,A];var E=v(r,i,o,a,m,y,D,T,d.panelSizeX,d.panelSizeY,d.dim0.crossfilterDimensionIndex,_?0:w?2:1,h,M);S.clearOnly=n;var O=t?r.lines.blockLineCount:g;p(k,N,S,O,g,E)}}},readPixel:function(e,t){return k.read({x:e,y:t,width:1,height:1,data:c}),c},readPixels:function(e,t,r,n){var a=new Uint8Array(4*r*n);return k.read({x:e,y:t,width:r,height:n,data:a}),a},destroy:function(){for(var t in e.style["pointer-events"]="none",E.destroy(),x&&x.destroy(),M)M[t].destroy()},update:O}}},{"../../lib":503,"./constants":892,glslify:227}],897:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var a,i;for(n||(n=1/0),a=0;a<t.length;a++)(i=t[a]).visible&&(n=Math.min(n,i[r].length));for(n===1/0&&(n=0),e._length=n,a=0;a<t.length;a++)(i=t[a]).visible&&(i._length=n);return n}},{}],898:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("color-rgba"),s=e("../../plots/cartesian/axes"),l=a.strRotate,c=a.strTranslate,u=e("../../lib/svg_text_utils"),f=e("../../components/drawing"),p=e("../../components/colorscale"),h=e("../../lib/gup"),d=h.keyFun,m=h.repeat,g=h.unwrap,y=e("./helpers"),v=e("./constants"),b=e("./axisbrush"),x=e("./lines");function _(e,t,r){return a.aggNums(e,null,t,r)}function w(e,t){return D(_(Math.min,e,t),_(Math.max,e,t))}function k(e){var t=e.range;return t?D(t[0],t[1]):w(e.values,e._length)}function D(e,t){return!isNaN(e)&&isFinite(e)||(e=0),!isNaN(t)&&isFinite(t)||(t=0),e===t&&(0===e?(e-=1,t+=1):(e*=.9,t*=1.1)),[e,t]}function T(e,t,r,a,o){var s,l,c=k(r);return a?n.scale.ordinal().domain(a.map((s=i(r.tickformat),l=o,l?function(e,t){var r=l[t];return null==r?s(e):r}:s))).range(a.map((function(r){var n=(r-c[0])/(c[1]-c[0]);return e-t+n*(2*t-e)}))):n.scale.linear().domain(c).range([e-t,t])}function A(e){if(e.tickvals){var t=k(e);return n.scale.ordinal().domain(e.tickvals).range(e.tickvals.map((function(e){return(e-t[0])/(t[1]-t[0])})))}}function S(e){var t=e.map((function(e){return e[0]})),r=e.map((function(e){var t=o(e[1]);return n.rgb("rgb("+t[0]+","+t[1]+","+t[2]+")")})),a="rgb".split("").map((function(e){return n.scale.linear().clamp(!0).domain(t).range(r.map((a=e,function(e){return e[a]})));var a}));return function(e){return a.map((function(t){return t(e)}))}}function M(e){return e.dimensions.some((function(e){return e.brush.filterSpecified}))}function E(e,t,r){var i=g(t),s=i.trace,l=y.convertTypedArray(i.lineColor),c=s.line,u={color:o(v.deselectedLineColor)},f=p.extractOpts(c),h=f.reversescale?p.flipScale(i.cscale):i.cscale,d=s.domain,m=s.dimensions,b=e.width,x=s.labelangle,_=s.labelside,w=s.labelfont,D=s.tickfont,T=s.rangefont,A=a.extendDeepNoArrays({},c,{color:l.map(n.scale.linear().domain(k({values:l,range:[f.min,f.max],_length:s._length}))),blockLineCount:v.blockLineCount,canvasOverdrag:v.overdrag*v.canvasPixelRatio}),M=Math.floor(b*(d.x[1]-d.x[0])),E=Math.floor(e.height*(d.y[1]-d.y[0])),C=e.margin||{l:80,r:80,t:100,b:80},N=M,O=E;return{key:r,colCount:m.filter(y.isVisible).length,dimensions:m,tickDistance:v.tickDistance,unitToColor:S(h),lines:A,deselectedLines:u,labelAngle:x,labelSide:_,labelFont:w,tickFont:D,rangeFont:T,layoutWidth:b,layoutHeight:e.height,domain:d,translateX:d.x[0]*b,translateY:e.height-d.y[1]*e.height,pad:C,canvasWidth:N*v.canvasPixelRatio+2*A.canvasOverdrag,canvasHeight:O*v.canvasPixelRatio,width:N,height:O,canvasPixelRatio:v.canvasPixelRatio}}function C(e,t,r){var o=r.width,s=r.height,l=r.dimensions,c=r.canvasPixelRatio,u=function(e){return o*e/Math.max(1,r.colCount-1)},f=v.verticalPadding/s,p=function(e,t){return n.scale.linear().range([t,e-t])}(s,v.verticalPadding),h={key:r.key,xScale:u,model:r,inBrushDrag:!1},d={};return h.dimensions=l.filter(y.isVisible).map((function(o,l){var m=function(e,t){return n.scale.linear().domain(k(e)).range([t,1-t])}(o,f),g=d[o.label];d[o.label]=(g||0)+1;var x=o.label+(g?"__"+g:""),_=o.constraintrange,w=_&&_.length;w&&!Array.isArray(_[0])&&(_=[_]);var D=w?_.map((function(e){return e.map(m)})):[[-1/0,1/0]],S=o.values;S.length>o._length&&(S=S.slice(0,o._length));var E,C=o.tickvals;function N(e,t){return{val:e,text:E[t]}}function O(e,t){return e.val-t.val}if(Array.isArray(C)&&C.length){E=o.ticktext,Array.isArray(E)&&E.length?E.length>C.length?E=E.slice(0,C.length):C.length>E.length&&(C=C.slice(0,E.length)):E=C.map(i(o.tickformat));for(var I=1;I<C.length;I++)if(C[I]<C[I-1]){for(var P=C.map(N).sort(O),R=0;R<C.length;R++)C[R]=P[R].val,E[R]=P[R].text;break}}else C=void 0;return S=y.convertTypedArray(S),{key:x,label:o.label,tickFormat:o.tickformat,tickvals:C,ticktext:E,ordinal:y.isOrdinal(o),multiselect:o.multiselect,xIndex:l,crossfilterDimensionIndex:l,visibleIndex:o._index,height:s,values:S,paddedUnitValues:S.map(m),unitTickvals:C&&C.map(m),xScale:u,x:u(l),canvasX:u(l)*c,unitToPaddedPx:p,domainScale:T(s,v.verticalPadding,o,C,E),ordinalScale:A(o),parent:h,model:r,brush:b.makeBrush(e,w,D,(function(){e.linePickActive(!1)}),(function(){var t=h;t.focusLayer&&t.focusLayer.render(t.panels,!0);var r=M(t);!e.contextShown()&&r?(t.contextLayer&&t.contextLayer.render(t.panels,!0),e.contextShown(!0)):e.contextShown()&&!r&&(t.contextLayer&&t.contextLayer.render(t.panels,!0,!0),e.contextShown(!1))}),(function(r){if(h.focusLayer.render(h.panels,!0),h.pickLayer&&h.pickLayer.render(h.panels,!0),e.linePickActive(!0),t&&t.filterChanged){var n=m.invert,i=r.map((function(e){return e.map(n).sort(a.sorterAsc)})).sort((function(e,t){return e[0]-t[0]}));t.filterChanged(h.key,o._index,i)}}))}})),h}function N(e){e.classed(v.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default")}function O(e,t){var r="top"===t?1:-1,n=e*Math.PI/180;return{dir:r,dx:Math.sin(n),dy:Math.cos(n),degrees:e}}function I(e,t,r){for(var n=t.panels||(t.panels=[]),a=e.data(),i=0;i<a.length-1;i++){var o=n[i]||(n[i]={}),s=a[i],l=a[i+1];o.dim0=s,o.dim1=l,o.canvasX=s.canvasX,o.panelSizeX=l.canvasX-s.canvasX,o.panelSizeY=t.model.canvasHeight,o.y=0,o.canvasY=0,o.plotGlPixelRatio=r}}function P(e,t){return s.tickText(e._ax,t,!1).text}function R(e,t){if(e.ordinal)return"";var r=e.domainScale.domain(),n=r[t?r.length-1:0];return P(e.model.dimensions[e.visibleIndex],n)}t.exports=function(e,t,r,i){var o=e._fullLayout,p=o._toppaper,h=o._glcontainer,_=e._context.plotGlPixelRatio,k=e._fullLayout.paper_bgcolor;!function(e){for(var t=0;t<e.length;t++)for(var r=0;r<e[t].length;r++)for(var n=e[t][r].trace,a=n.dimensions,i=0;i<a.length;i++){var o=a[i].values,l=a[i]._ax;l&&(l.range?l.range=D(l.range[0],l.range[1]):l.range=w(o,n._length),l.dtick||(l.dtick=.01*(Math.abs(l.range[1]-l.range[0])||1)),l.tickformat=a[i].tickformat,s.calcTicks(l),l.cleanRange())}}(t);var T,A,S=(T=!0,A=!1,{linePickActive:function(e){return arguments.length?T=!!e:T},contextShown:function(e){return arguments.length?A=!!e:A}}),L=t.filter((function(e){return g(e).trace.visible})).map(E.bind(0,r)).map(C.bind(0,S,i));h.each((function(e,t){return a.extendFlat(e,L[t])}));var F=h.selectAll(".gl-canvas").each((function(e){e.viewModel=L[0],e.viewModel.plotGlPixelRatio=_,e.viewModel.paperColor=k,e.model=e.viewModel?e.viewModel.model:null})),B=null;F.filter((function(e){return e.pick})).style("pointer-events","auto").on("mousemove",(function(e){if(S.linePickActive()&&e.lineLayer&&i&&i.hover){var t=n.event,r=this.width,a=this.height,o=n.mouse(this),s=o[0],l=o[1];if(s<0||l<0||s>=r||l>=a)return;var c=e.lineLayer.readPixel(s,a-1-l),u=0!==c[3],f=u?c[2]+256*(c[1]+256*c[0]):null,p={x:s,y:l,clientX:t.clientX,clientY:t.clientY,dataIndex:e.model.key,curveNumber:f};f!==B&&(u?i.hover(p):i.unhover&&i.unhover(p),B=f)}})),F.style("opacity",(function(e){return e.pick?0:1})),p.style("background","rgba(255, 255, 255, 0)");var z=p.selectAll("."+v.cn.parcoords).data(L,d);z.exit().remove(),z.enter().append("g").classed(v.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),z.attr("transform",(function(e){return c(e.model.translateX,e.model.translateY)}));var j=z.selectAll("."+v.cn.parcoordsControlView).data(m,d);j.enter().append("g").classed(v.cn.parcoordsControlView,!0),j.attr("transform",(function(e){return c(e.model.pad.l,e.model.pad.t)}));var U=j.selectAll("."+v.cn.yAxis).data((function(e){return e.dimensions}),d);U.enter().append("g").classed(v.cn.yAxis,!0),j.each((function(e){I(U,e,_)})),F.each((function(e){if(e.viewModel){!e.lineLayer||i?e.lineLayer=x(this,e):e.lineLayer.update(e),(e.key||0===e.key)&&(e.viewModel[e.key]=e.lineLayer);var t=!e.context||i;e.lineLayer.render(e.viewModel.panels,t)}})),U.attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),U.call(n.behavior.drag().origin((function(e){return e})).on("drag",(function(e){var t=e.parent;S.linePickActive(!1),e.x=Math.max(-v.overdrag,Math.min(e.model.width+v.overdrag,n.event.x)),e.canvasX=e.x*e.model.canvasPixelRatio,U.sort((function(e,t){return e.x-t.x})).each((function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio})),I(U,t,_),U.filter((function(t){return 0!==Math.abs(e.xIndex-t.xIndex)})).attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),n.select(this).attr("transform",c(e.x,0)),U.each((function(r,n,a){a===e.parent.key&&(t.dimensions[n]=r)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!M(t)),t.focusLayer.render&&t.focusLayer.render(t.panels)})).on("dragend",(function(e){var t=e.parent;e.x=e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio,I(U,t,_),n.select(this).attr("transform",(function(e){return c(e.x,0)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!M(t)),t.focusLayer&&t.focusLayer.render(t.panels),t.pickLayer&&t.pickLayer.render(t.panels,!0),S.linePickActive(!0),i&&i.axesMoved&&i.axesMoved(t.key,t.dimensions.map((function(e){return e.crossfilterDimensionIndex})))}))),U.exit().remove();var $=U.selectAll("."+v.cn.axisOverlays).data(m,d);$.enter().append("g").classed(v.cn.axisOverlays,!0),$.selectAll("."+v.cn.axis).remove();var V=$.selectAll("."+v.cn.axis).data(m,d);V.enter().append("g").classed(v.cn.axis,!0),V.each((function(e){var t=e.model.height/e.model.tickDistance,r=e.domainScale,a=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(t,e.tickFormat).tickValues(e.ordinal?a:null).tickFormat((function(t){return y.isOrdinal(e)?t:P(e.model.dimensions[e.visibleIndex],t)})).scale(r)),f.font(V.selectAll("text"),e.model.tickFont)})),V.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),V.selectAll("text").style("text-shadow",u.makeTextShadow(k)).style("cursor","default");var q=$.selectAll("."+v.cn.axisHeading).data(m,d);q.enter().append("g").classed(v.cn.axisHeading,!0);var W=q.selectAll("."+v.cn.axisTitle).data(m,d);W.enter().append("text").classed(v.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events","auto"),W.text((function(e){return e.label})).each((function(t){var r=n.select(this);f.font(r,t.model.labelFont),u.convertToTspans(r,e)})).attr("transform",(function(e){var t=O(e.model.labelAngle,e.model.labelSide),r=v.axisTitleOffset;return(t.dir>0?"":c(0,2*r+e.model.height))+l(t.degrees)+c(-r*t.dx,-r*t.dy)})).attr("text-anchor",(function(e){var t=O(e.model.labelAngle,e.model.labelSide);return 2*Math.abs(t.dx)>Math.abs(t.dy)?t.dir*t.dx<0?"start":"end":"middle"}));var H=$.selectAll("."+v.cn.axisExtent).data(m,d);H.enter().append("g").classed(v.cn.axisExtent,!0);var G=H.selectAll("."+v.cn.axisExtentTop).data(m,d);G.enter().append("g").classed(v.cn.axisExtentTop,!0),G.attr("transform",c(0,-v.axisExtentOffset));var X=G.selectAll("."+v.cn.axisExtentTopText).data(m,d);X.enter().append("text").classed(v.cn.axisExtentTopText,!0).call(N),X.text((function(e){return R(e,!0)})).each((function(e){f.font(n.select(this),e.model.rangeFont)}));var Y=H.selectAll("."+v.cn.axisExtentBottom).data(m,d);Y.enter().append("g").classed(v.cn.axisExtentBottom,!0),Y.attr("transform",(function(e){return c(0,e.model.height+v.axisExtentOffset)}));var Z=Y.selectAll("."+v.cn.axisExtentBottomText).data(m,d);Z.enter().append("text").classed(v.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(N),Z.text((function(e){return R(e,!1)})).each((function(e){f.font(n.select(this),e.model.rangeFont)})),b.ensureAxisBrush($,k)}},{"../../components/colorscale":378,"../../components/drawing":388,"../../lib":503,"../../lib/gup":500,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"./axisbrush":889,"./constants":892,"./helpers":894,"./lines":896,"@plotly/d3":58,"color-rgba":91}],899:[function(e,t,r){"use strict";var n=e("./parcoords"),a=e("../../lib/prepare_regl"),i=e("./helpers").isVisible;function o(e,t,r){var n=t.indexOf(r),a=e.indexOf(n);return-1===a&&(a+=t.length),a}t.exports=function(e,t){var r=e._fullLayout;if(a(e)){var s={},l={},c={},u={},f=r._size;t.forEach((function(t,r){var n=t[0].trace;c[r]=n.index;var a=u[r]=n._fullInput.index;s[r]=e.data[a].dimensions,l[r]=e.data[a].dimensions.slice()})),n(e,t,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(t,n,a){var i=l[t][n],o=a.map((function(e){return e.slice()})),s="dimensions["+n+"].constraintrange",f=r._tracePreGUI[e._fullData[c[t]]._fullInput.uid];if(void 0===f[s]){var p=i.constraintrange;f[s]=p||null}var h=e._fullData[c[t]].dimensions[n];o.length?(1===o.length&&(o=o[0]),i.constraintrange=o,h.constraintrange=o.slice(),o=[o]):(delete i.constraintrange,delete h.constraintrange,o=null);var d={};d[s]=o,e.emit("plotly_restyle",[d,[u[t]]])},hover:function(t){e.emit("plotly_hover",t)},unhover:function(t){e.emit("plotly_unhover",t)},axesMoved:function(t,r){var n=function(e,t){return function(r,n){return o(e,t,r)-o(e,t,n)}}(r,l[t].filter(i));s[t].sort(n),l[t].filter((function(e){return!i(e)})).sort((function(e){return l[t].indexOf(e)})).forEach((function(e){s[t].splice(s[t].indexOf(e),1),s[t].splice(l[t].indexOf(e),0,e)})),e.emit("plotly_restyle",[{dimensions:[s[t]]},[u[t]]])}})}}},{"../../lib/prepare_regl":516,"./helpers":894,"./parcoords":898}],900:[function(e,t,r){"use strict";var n=e("../../plots/attributes"),a=e("../../plots/domain").attributes,i=e("../../plots/font_attributes"),o=e("../../components/color/attributes"),s=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,c=e("../../lib/extend").extendFlat,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});t.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:c({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:c({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:c({},u,{}),outsidetextfont:c({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:c({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:a({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:c({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":365,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/domain":584,"../../plots/font_attributes":585,"../../plots/template_attributes":633}],901:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="pie",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":619}],902:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("tinycolor2"),i=e("../../components/color"),o={};function s(e){return function(t,r){return!!t&&!!(t=a(t)).isValid()&&(t=i.addOpacity(t,t.getAlpha()),e[r]||(e[r]=t),t)}}function l(e,t){var r,n=JSON.stringify(e),i=t[n];if(!i){for(i=e.slice(),r=0;r<e.length;r++)i.push(a(e[r]).lighten(20).toHexString());for(r=0;r<e.length;r++)i.push(a(e[r]).darken(20).toHexString());t[n]=i}return i}t.exports={calc:function(e,t){var r,a,i=[],o=e._fullLayout,l=o.hiddenlabels||[],c=t.labels,u=t.marker.colors||[],f=t.values,p=t._length,h=t._hasValues&&p;if(t.dlabel)for(c=new Array(p),r=0;r<p;r++)c[r]=String(t.label0+r*t.dlabel);var d={},m=s(o["_"+t.type+"colormap"]),g=0,y=!1;for(r=0;r<p;r++){var v,b,x;if(h){if(v=f[r],!n(v))continue;v=+v}else v=1;void 0!==(b=c[r])&&""!==b||(b=r);var _=d[b=String(b)];void 0===_?(d[b]=i.length,(x=-1!==l.indexOf(b))||(g+=v),i.push({v,label:b,color:m(u[r],b),i:r,pts:[r],hidden:x})):(y=!0,(a=i[_]).v+=v,a.pts.push(r),a.hidden||(g+=v),!1===a.color&&u[r]&&(a.color=m(u[r],b)))}return i=i.filter((function(e){return e.v>=0})),("funnelarea"===t.type?y:t.sort)&&i.sort((function(e,t){return t.v-e.v})),i[0]&&(i[0].vTotal=g),i},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,a=e.calcdata,i=n[r+"colorway"],s=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(i=l(i,o));for(var c=0,u=0;u<a.length;u++){var f=a[u];if(f[0].trace.type===r)for(var p=0;p<f.length;p++){var h=f[p];!1===h.color&&(s[h.label]?h.color=s[h.label]:(s[h.label]=h.color=i[c%i.length],c++))}}},makePullColorFn:s,generateExtendedColors:l}},{"../../components/color":366,"fast-isnumeric":190,tinycolor2:312}],903:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./attributes"),o=e("../../plots/domain").defaults,s=e("../bar/defaults").handleText;function l(e,t){var r=Array.isArray(e),i=a.isArrayOrTypedArray(t),o=Math.min(r?e.length:1/0,i?t.length:1/0);if(isFinite(o)||(o=0),o&&i){for(var s,l=0;l<o;l++){var c=t[l];if(n(c)&&c>0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:l,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=l(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var p,h=c("text"),d=c("texttemplate");if(d||(p=c("textinfo",Array.isArray(h)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),d||p&&"none"!==p){var m=c("textposition");s(e,t,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(t,n,c);var g=c("hole");if(c("title.text")){var y=c("title.position",g?"middle center":"top center");g||"middle center"!==y||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":503,"../../plots/domain":584,"../bar/defaults":652,"./attributes":900,"fast-isnumeric":190}],904:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":402}],905:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r<t.length;r++){var n=e[t[r]];if(n||0===n||""===n)return n}},r.castOption=function(e,t){return Array.isArray(e)?r.getFirstFilled(e,t):e||void 0},r.getRotationAngle=function(e){return("auto"===e?0:e)*Math.PI/180}},{"../../lib":503}],906:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults").supplyDefaults,supplyLayoutDefaults:e("./layout_defaults"),layoutAttributes:e("./layout_attributes"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot").plot,style:e("./style"),styleOne:e("./style_one"),moduleType:"trace",name:"pie",basePlotModule:e("./base_plot"),categories:["pie-like","pie","showLegend"],meta:{}}},{"./attributes":900,"./base_plot":901,"./calc":902,"./defaults":903,"./layout_attributes":907,"./layout_defaults":908,"./plot":909,"./style":910,"./style_one":911}],907:[function(e,t,r){"use strict";t.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],908:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("hiddenlabels"),r("piecolorway",t.colorway),r("extendpiecolors")}},{"../../lib":503,"./layout_attributes":907}],909:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../../components/fx"),o=e("../../components/color"),s=e("../../components/drawing"),l=e("../../lib"),c=l.strScale,u=l.strTranslate,f=e("../../lib/svg_text_utils"),p=e("../bar/uniform_text"),h=p.recordMinTextSize,d=p.clearMinTextSize,m=e("../bar/constants").TEXTPAD,g=e("./helpers"),y=e("./event_data"),v=e("../../lib").isValidTextValue;function b(e,t,r){var a=r[0],o=a.cx,s=a.cy,c=a.trace,u="funnelarea"===c.type;"_hasHoverLabel"in c||(c._hasHoverLabel=!1),"_hasHoverEvent"in c||(c._hasHoverEvent=!1),e.on("mouseover",(function(e){var r=t._fullLayout,f=t._fullData[c.index];if(!t._dragging&&!1!==r.hovermode){var p=f.hoverinfo;if(Array.isArray(p)&&(p=i.castHoverinfo({hoverinfo:[g.castOption(p,e.pts)],_module:c._module},r,0)),"all"===p&&(p="label+text+value+percent+name"),f.hovertemplate||"none"!==p&&"skip"!==p&&p){var h=e.rInscribed||0,d=o+e.pxmid[0]*(1-h),m=s+e.pxmid[1]*(1-h),v=r.separators,b=[];if(p&&-1!==p.indexOf("label")&&b.push(e.label),e.text=g.castOption(f.hovertext||f.text,e.pts),p&&-1!==p.indexOf("text")){var x=e.text;l.isValidTextValue(x)&&b.push(x)}e.value=e.v,e.valueLabel=g.formatPieValue(e.v,v),p&&-1!==p.indexOf("value")&&b.push(e.valueLabel),e.percent=e.v/a.vTotal,e.percentLabel=g.formatPiePercent(e.percent,v),p&&-1!==p.indexOf("percent")&&b.push(e.percentLabel);var _=f.hoverlabel,w=_.font,k=[];i.loneHover({trace:c,x0:d-h*a.r,x1:d+h*a.r,y:m,_x0:u?o+e.TL[0]:d-h*a.r,_x1:u?o+e.TR[0]:d+h*a.r,_y0:u?s+e.TL[1]:m-h*a.r,_y1:u?s+e.BL[1]:m+h*a.r,text:b.join("<br>"),name:f.hovertemplate||-1!==p.indexOf("name")?f.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:g.castOption(_.bgcolor,e.pts)||e.color,borderColor:g.castOption(_.bordercolor,e.pts),fontFamily:g.castOption(w.family,e.pts),fontSize:g.castOption(w.size,e.pts),fontColor:g.castOption(w.color,e.pts),nameLength:g.castOption(_.namelength,e.pts),textAlign:g.castOption(_.align,e.pts),hovertemplate:g.castOption(f.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[y(e,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:k}),e.bbox=k[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[y(e,f)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[y(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[y(e,a)],i.click(t,n.event))}))}function x(e,t,r){var n=g.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=g.castOption(e._input.textfont.color,t.pts));var a=g.castOption(e.insidetextfont.family,t.pts)||g.castOption(e.textfont.family,t.pts)||r.family,i=g.castOption(e.insidetextfont.size,t.pts)||g.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;a<e.length;a++)if((n=(r=e[a][0]).trace).title.text){var i=n.title.text;n._meta&&(i=l.templateString(i,n._meta));var o=s.tester.append("text").attr("data-notex",1).text(i).call(s.font,n.title.font).call(f.convertToTspans,t),c=s.bBox(o.node(),!0);r.titleBox={width:c.width,height:c.height},o.remove()}}function w(e,t,r){var n=r.r||t.rpx1,a=t.rInscribed;if(t.startangle===t.stopangle)return{rCenter:1-a,scale:0,rotate:0,textPosAngle:0};var i,o=t.ring,s=1===o&&Math.abs(t.startangle-t.stopangle)===2*Math.PI,l=t.halfangle,c=t.midangle,u=r.trace.insidetextorientation,f="horizontal"===u,p="tangential"===u,h="radial"===u,d="auto"===u,m=[];if(!d){var g,y=function(r,a){if(function(e,t){var r=e.startangle,n=e.stopangle;return r>t&&t>n||r<t&&t<n}(t,r)){var s=Math.abs(r-t.startangle),l=Math.abs(r-t.stopangle),c=s<l?s:l;(i="tan"===a?D(e,n,o,c,0):k(e,n,o,c,Math.PI/2)).textPosAngle=r,m.push(i)}};if(f||p){for(g=4;g>=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(f||h){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||d||f){var v=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/v,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;m.push(i)}(d||h)&&((i=k(e,n,o,l,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i)),(d||p)&&((i=D(e,n,o,l,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i));for(var b=0,x=0,_=0;_<m.length;_++){var w=m[_].scale;if(x<w&&(x=w,b=_),!d&&x>=1)break}return m[b]}function k(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.width/e.height,o=S(i,n,t,r);return{scale:2*o/e.height,rCenter:T(i,o/t),rotate:A(a)}}function D(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.height/e.width,o=S(i,n,t,r);return{scale:2*o/e.width,rCenter:T(i,o/t),rotate:A(a+Math.PI/2)}}function T(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function S(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function M(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function E(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function C(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},s={tx:0,ty:0};s.ty+=i.title.font.size,a=O(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,s.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var l,c=e.r/(void 0===(l=e.trace.aspectratio)?1:l),u=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(u+=c,o.x-=(1+a)*c,s.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?u*=2:-1!==i.title.position.indexOf("right")&&(u+=c,o.x+=(1+a)*c,s.tx-=e.titleBox.width/2),r=u/e.titleBox.width,n=N(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function N(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function O(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;t<e.pull.length;t++)e.pull[t]>r&&(r=e.pull[t]);return r}function I(e,t){for(var r=[],n=0;n<e.length;n++){var a=e[n][0],i=a.trace,o=i.domain,s=t.w*(o.x[1]-o.x[0]),l=t.h*(o.y[1]-o.y[0]);i.title.text&&"middle center"!==i.title.position&&(l-=N(a,t));var c=s/2,u=l/2;"funnelarea"!==i.type||i.scalegroup||(u/=i.aspectratio),a.r=Math.min(c,u)/(1+O(i)),a.cx=t.l+t.w*(i.domain.x[1]+i.domain.x[0])/2,a.cy=t.t+t.h*(1-i.domain.y[0])-l/2,i.title.text&&-1!==i.title.position.indexOf("bottom")&&(a.cy-=N(a,t)),i.scalegroup&&-1===r.indexOf(i.scalegroup)&&r.push(i.scalegroup)}!function(e,t){for(var r,n,a,i=0;i<t.length;i++){var o=1/0,s=t[i];for(n=0;n<e.length;n++)if((a=(r=e[n][0]).trace).scalegroup===s){var l;if("pie"===a.type)l=r.r*r.r;else if("funnelarea"===a.type){var c,u;a.aspectratio>1?u=(c=r.r)/a.aspectratio:c=(u=r.r)*a.aspectratio,l=(c*=(1+a.baseratio)/2)*u}o=Math.min(o,l/r.vTotal)}for(n=0;n<e.length;n++)if((a=(r=e[n][0]).trace).scalegroup===s){var f=o*r.vTotal;"funnelarea"===a.type&&(f/=(1+a.baseratio)/2,f/=a.aspectratio),r.r=Math.sqrt(f)}}}(e,r)}function P(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}function R(e,t,r){var n=e._fullLayout,a=r.trace,i=a.texttemplate,o=a.textinfo;if(!i&&o&&"none"!==o){var s,c=o.split("+"),u=function(e){return-1!==c.indexOf(e)},f=u("label"),p=u("text"),h=u("value"),d=u("percent"),m=n.separators;if(s=f?[t.label]:[],p){var y=g.getFirstFilled(a.text,t.pts);v(y)&&s.push(y)}h&&s.push(g.formatPieValue(t.v,m)),d&&s.push(g.formatPiePercent(t.v/r.vTotal,m)),t.text=s.join("<br>")}if(i){var b=l.castOption(a,t.i,"texttemplate");if(b){var x=function(e){return{label:e.label,value:e.v,valueLabel:g.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:g.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:l.castOption(a,e.i,"customdata")}}(t),_=g.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(x.text=_),t.text=l.texttemplateString(b,x,e._fullLayout._d3locale,x,a._meta||{})}else t.text=""}}function L(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;d("pie",r),_(t,e),I(t,i);var p=l.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var p=n.select(this),d=t[0],m=d.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,s=g.getRotationAngle(o.rotation),l=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;t<e.length&&e[t].hidden;t++);if(t===e.length)return;s+=l*e[t].v,l*=-1,c="px1",u="px0"}for(n=P(i,s),t=0;t<e.length;t++)(r=e[t]).hidden||(r[c]=n,r.startangle=s,s+=l*r.v/2,r.pxmid=P(i,s),r.midangle=s,n=P(i,s+=l*r.v/2),r.stopangle=s,r[u]=n,r.largeArc=r.v>a.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=M(r,a))}(t),p.attr("stroke-linejoin","round"),p.each((function(){var y=n.select(this).selectAll("g.slice").data(t);y.enter().append("g").classed("slice",!0),y.exit().remove();var v=[[[],[]],[[],[]]],_=!1;y.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=m.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=d.cx,c=d.cy,u=n.select(this),p=u.selectAll("path.surface").data([a]);if(p.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(b,e,t),m.pull){var y=+g.castOption(m.pull,a.pts)||0;y>0&&(o+=y*a.pxmid[0],c+=y*a.pxmid[1])}a.cxFinal=o,a.cyFinal=c;var k=m.hole;if(a.v===d.vTotal){var D="M"+(o+a.px0[0])+","+(c+a.px0[1])+C(a.px0,a.pxmid,!0,1)+C(a.pxmid,a.px0,!0,1)+"Z";k?p.attr("d","M"+(o+k*a.px0[0])+","+(c+k*a.px0[1])+C(a.px0,a.pxmid,!1,k)+C(a.pxmid,a.px0,!1,k)+"Z"+D):p.attr("d",D)}else{var T=C(a.px0,a.px1,!0,1);if(k){var A=1-k;p.attr("d","M"+(o+k*a.px1[0])+","+(c+k*a.px1[1])+C(a.px1,a.px0,!1,k)+"l"+A*a.px0[0]+","+A*a.px0[1]+T+"Z")}else p.attr("d","M"+o+","+c+"l"+a.px0[0]+","+a.px0[1]+T+"Z")}R(e,a,d);var S=g.castOption(m.textposition,a.pts),M=u.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);M.enter().append("g").classed("slicetext",!0),M.exit().remove(),M.each((function(){var u=l.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),p=l.ensureUniformFontSize(e,"outside"===S?function(e,t,r){return{color:g.castOption(e.outsidetextfont.color,t.pts)||g.castOption(e.textfont.color,t.pts)||r.color,family:g.castOption(e.outsidetextfont.family,t.pts)||g.castOption(e.textfont.family,t.pts)||r.family,size:g.castOption(e.outsidetextfont.size,t.pts)||g.castOption(e.textfont.size,t.pts)||r.size}}(m,a,r.font):x(m,a,r.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,p).call(f.convertToTspans,e);var y,v=s.bBox(u.node());if("outside"===S)y=E(v,a);else if(y=w(v,a,d),"auto"===S&&y.scale<1){var b=l.ensureUniformFontSize(e,m.outsidetextfont);u.call(s.font,b),y=E(v=s.bBox(u.node()),a)}var k=y.textPosAngle,D=void 0===k?a.pxmid:P(d.r,k);if(y.targetX=o+D[0]*y.rCenter+(y.x||0),y.targetY=c+D[1]*y.rCenter+(y.y||0),L(y,v),y.outside){var T=y.targetY;a.yLabelMin=T-v.height/2,a.yLabelMid=T,a.yLabelMax=T+v.height/2,a.labelExtraX=0,a.labelExtraY=0,_=!0}y.fontSize=p.size,h(m.type,y,r),t[i].transform=y,u.attr("transform",l.getTextTransform(y))}))}function C(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*d.r+","+n*d.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var k=n.select(this).selectAll("g.titletext").data(m.title.text?[0]:[]);if(k.enter().append("g").classed("titletext",!0),k.exit().remove(),k.each((function(){var t,r=l.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=m.title.text;m._meta&&(a=l.templateString(a,m._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,m.title.font).call(f.convertToTspans,e),t="middle center"===m.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(d):C(d,i),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),_&&function(e,t){var r,n,a,i,o,s,l,c,u,f,p,h,d;function m(e,t){return e.pxmid[1]-t.pxmid[1]}function y(e,t){return t.pxmid[1]-e.pxmid[1]}function v(e,r){r||(r={});var a,c,u,p,h=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?e.yLabelMin:e.yLabelMax,m=n?e.yLabelMax:e.yLabelMin,y=e.cyFinal+o(e.px0[1],e.px1[1]),v=h-d;if(v*l>0&&(e.labelExtraY=v),Array.isArray(t.pull))for(c=0;c<f.length;c++)(u=f[c])===e||(g.castOption(t.pull,e.pts)||0)>=(g.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*l>0?(v=u.cyFinal+o(u.px0[1],u.px1[1])-d-e.labelExtraY)*l>0&&(e.labelExtraY+=v):(m+e.labelExtraY-y)*l>0&&(a=3*s*Math.abs(c-f.indexOf(e)),(p=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*s>0&&(e.labelExtraX+=p)))}for(n=0;n<2;n++)for(a=n?m:y,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,s=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),h=[],p=0;p<c.length;p++)void 0!==c[p].yLabelMid&&h.push(c[p]);for(d=!1,p=0;n&&p<u.length;p++)if(void 0!==u[p].yLabelMid){d=u[p];break}for(p=0;p<h.length;p++){var b=p&&h[p-1];d&&!p&&(b=d),v(h[p],b)}}}(v,m),function(e,t){e.each((function(e){var r=n.select(this);if(e.labelExtraX||e.labelExtraY){var a=r.select("g.slicetext text");e.transform.targetX+=e.labelExtraX,e.transform.targetY+=e.labelExtraY,a.attr("transform",l.getTextTransform(e.transform));var i=e.cxFinal+e.pxmid[0],s="M"+i+","+(e.cyFinal+e.pxmid[1]),c=(e.yLabelMax-e.yLabelMin)*(e.pxmid[0]<0?-1:1)/4;if(e.labelExtraX){var u=e.labelExtraX*e.pxmid[1]/e.pxmid[0],f=e.yLabelMid+e.labelExtraY-(e.cyFinal+e.pxmid[1]);Math.abs(u)>Math.abs(f)?s+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):s+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else s+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;l.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(y,m),_&&m.automargin){var D=s.bBox(p.node()),T=m.domain,A=i.w*(T.x[1]-T.x[0]),S=i.h*(T.y[1]-T.y[0]),M=(.5*A-d.r)/i.w,N=(.5*S-d.r)/i.h;a.autoMargin(e,"pie."+m.uid+".automargin",{xl:T.x[0]-M,xr:T.x[1]+M,yb:T.y[0]-N,yt:T.y[1]+N,l:Math.max(d.cx-d.r-D.left,0),r:Math.max(D.right-(d.cx+d.r),0),b:Math.max(D.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-D.top,0),pad:5})}}))}));setTimeout((function(){p.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:R,transformInsideText:w,determineInsideTextFont:x,positionTitleOutside:C,prerenderTitles:_,layoutAreas:I,attachFxHandlers:b,computeTransform:L}},{"../../components/color":366,"../../components/drawing":388,"../../components/fx":406,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/plots":619,"../bar/constants":650,"../bar/uniform_text":664,"./event_data":904,"./helpers":905,"@plotly/d3":58}],910:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":664,"./style_one":911,"@plotly/d3":58}],911:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,s=a(i.width,t.pts)||0;e.style("stroke-width",s).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":366,"./helpers":905}],912:[function(e,t,r){"use strict";var n=e("../scatter/attributes");t.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":926}],913:[function(e,t,r){"use strict";var n=e("../../../stackgl_modules").gl_pointcloud2d,a=e("../../lib/str2rgbarray"),i=e("../../plots/cartesian/autorange").findExtremes,o=e("../scatter/get_trace_color");function s(e,t){this.scene=e,this.uid=t,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(e.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(e){var t=this.idToIndex[e.pointId];return{trace:this,dataCoord:e.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*t],this.pickXYData[2*t+1]]:[this.pickXData[t],this.pickYData[t]],textLabel:Array.isArray(this.textLabels)?this.textLabels[t]:this.textLabels,color:this.color,name:this.name,pointIndex:t,hoverinfo:this.hoverinfo}},l.update=function(e){this.index=e.index,this.textLabels=e.text,this.name=e.name,this.hoverinfo=e.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(e),this.color=o(e,{})},l.updateFast=function(e){var t,r,n,o,s,l,c=this.xData=this.pickXData=e.x,u=this.yData=this.pickYData=e.y,f=this.pickXYData=e.xy,p=e.xbounds&&e.ybounds,h=e.indices,d=this.bounds;if(f){if(n=f,t=f.length>>>1,p)d[0]=e.xbounds[0],d[2]=e.xbounds[1],d[1]=e.ybounds[0],d[3]=e.ybounds[1];else for(l=0;l<t;l++)o=n[2*l],s=n[2*l+1],o<d[0]&&(d[0]=o),o>d[2]&&(d[2]=o),s<d[1]&&(d[1]=s),s>d[3]&&(d[3]=s);if(h)r=h;else for(r=new Int32Array(t),l=0;l<t;l++)r[l]=l}else for(t=c.length,n=new Float32Array(2*t),r=new Int32Array(t),l=0;l<t;l++)o=c[l],s=u[l],r[l]=l,n[2*l]=o,n[2*l+1]=s,o<d[0]&&(d[0]=o),o>d[2]&&(d[2]=o),s<d[1]&&(d[1]=s),s>d[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var m=a(e.marker.color),g=a(e.marker.border.color),y=e.opacity*e.marker.opacity;m[3]*=y,this.pointcloudOptions.color=m;var v=e.marker.blend;null===v&&(v=c.length<100||u.length<100),this.pointcloudOptions.blend=v,g[3]*=y,this.pointcloudOptions.borderColor=g;var b=e.marker.sizemin,x=Math.max(e.marker.sizemax,e.marker.sizemin);this.pointcloudOptions.sizeMin=b,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=e.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,k=x/2||.5;e._extremes[_._id]=i(_,[d[0],d[2]],{ppad:k}),e._extremes[w._id]=i(w,[d[1],d[3]],{ppad:k})},l.dispose=function(){this.pointcloud.dispose()},t.exports=function(e,t){var r=new s(e,t.uid);return r.update(t),r}},{"../../../stackgl_modules":1120,"../../lib/str2rgbarray":528,"../../plots/cartesian/autorange":553,"../scatter/get_trace_color":936}],914:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes");t.exports=function(e,t,r){function i(r,i){return n.coerce(e,t,a,r,i)}i("x"),i("y"),i("xbounds"),i("ybounds"),e.xy&&e.xy instanceof Float32Array&&(t.xy=e.xy),e.indices&&e.indices instanceof Int32Array&&(t.indices=e.indices),i("text"),i("marker.color",r),i("marker.opacity"),i("marker.blend"),i("marker.sizemin"),i("marker.sizemax"),i("marker.border.color",r),i("marker.border.arearatio"),t._length=null}},{"../../lib":503,"./attributes":912}],915:[function(e,t,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" "),t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("../scatter3d/calc"),plot:e("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:e("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":596,"../scatter3d/calc":955,"./attributes":912,"./convert":913,"./defaults":914}],916:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/attributes"),i=e("../../components/color/attributes"),o=e("../../components/fx/attributes"),s=e("../../plots/domain").attributes,l=e("../../plots/template_attributes").hovertemplateAttrs,c=e("../../components/colorscale/attributes"),u=e("../../plot_api/plot_template").templatedArray,f=e("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers,p=e("../../lib/extend").extendFlat,h=e("../../plot_api/edit_types").overrideAll;(t.exports=h({hoverinfo:p({},a.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:f("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:p(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":365,"../../components/colorscale/attributes":373,"../../components/fx/attributes":397,"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plot_api/plot_template":543,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/domain":584,"../../plots/font_attributes":585,"../../plots/template_attributes":633}],917:[function(e,t,r){"use strict";var n=e("../../plot_api/edit_types").overrideAll,a=e("../../plots/get_data").getModuleCalcData,i=e("./plot"),o=e("../../components/fx/layout_attributes"),s=e("../../lib/setcursor"),l=e("../../components/dragelement"),c=e("../../plots/cartesian/select").prepSelect,u=e("../../lib"),f=e("../../registry");function p(e,t){var r=e._fullData[t],n=e._fullLayout,a=n.dragmode,i="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if("pan"!==a&&"zoom"!==a){s(o,i);var p={_id:"x",c2p:u.identity,_offset:r._sankey.translateX,_length:r._sankey.width},h={_id:"y",c2p:u.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:e,element:o.node(),plotinfo:{id:t,xaxis:p,yaxis:h,fillRangeItems:u.noop},subplot:t,xaxes:[p],yaxes:[h],doneFnCompleted:function(r){var n,a=e._fullData[t],i=a.node.groups.slice(),o=[];function s(e){for(var t=a._sankey.graph.nodes,r=0;r<t.length;r++)if(t[r].pointNumber===e)return t[r]}for(var l=0;l<r.length;l++){var c=s(r[l].pointNumber);if(c)if(c.group){for(var u=0;u<c.childrenNodes.length;u++)o.push(c.childrenNodes[u].pointNumber);i[c.pointNumber-a.node._count]=!1}else o.push(c.pointNumber)}n=i.filter(Boolean).concat([o]),f.call("_guiRestyle",e,{"node.groups":[n]},t)},prepFn:function(e,t,r){c(e,t,r,d,a)}};l.init(d)}}r.name="sankey",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(e){var t=a(e.calcdata,"sankey")[0];i(e,t),r.updateFx(e)},r.clean=function(e,t,r,n){var a=n._has&&n._has("sankey"),i=t._has&&t._has("sankey");a&&!i&&(n._paperdiv.selectAll(".sankey").remove(),n._paperdiv.selectAll(".bgsankey").remove())},r.updateFx=function(e){for(var t=0;t<e._fullData.length;t++)p(e,t)}},{"../../components/dragelement":385,"../../components/fx/layout_attributes":407,"../../lib":503,"../../lib/setcursor":524,"../../plot_api/edit_types":536,"../../plots/cartesian/select":575,"../../plots/get_data":593,"../../registry":638,"./plot":922}],918:[function(e,t,r){"use strict";var n=e("strongly-connected-components"),a=e("../../lib"),i=e("../../lib/gup").wrap,o=a.isArrayOrTypedArray,s=a.isIndex,l=e("../../components/colorscale");t.exports=function(e,t){var r=function(e){var t,r=e.node,i=e.link,c=[],u=o(i.color),f=o(i.customdata),p={},h={},d=i.colorscales.length;for(t=0;t<d;t++){var m=i.colorscales[t],g=l.extractScale(m,{cLetter:"c"}),y=l.makeColorScaleFunc(g);h[m.label]=y}var v=0;for(t=0;t<i.value.length;t++)i.source[t]>v&&(v=i.source[t]),i.target[t]>v&&(v=i.target[t]);var b,x=v+1;e.node._count=x;var _=e.node.groups,w={};for(t=0;t<_.length;t++){var k=_[t];for(b=0;b<k.length;b++){var D=k[b],T=x+t;w.hasOwnProperty(D)?a.warn("Node "+D+" is already part of a group."):w[D]=T}}var A={source:[],target:[]};for(t=0;t<i.value.length;t++){var S=i.value[t],M=i.source[t],E=i.target[t];if(S>0&&s(M,x)&&s(E,x)&&(!w.hasOwnProperty(M)||!w.hasOwnProperty(E)||w[M]!==w[E])){w.hasOwnProperty(E)&&(E=w[E]),w.hasOwnProperty(M)&&(M=w[M]),E=+E,p[M=+M]=p[E]=!0;var C="";i.label&&i.label[t]&&(C=i.label[t]);var N=null;C&&h.hasOwnProperty(C)&&(N=h[C]),c.push({pointNumber:t,label:C,color:u?i.color[t]:i.color,customdata:f?i.customdata[t]:i.customdata,concentrationscale:N,source:M,target:E,value:+S}),A.source.push(M),A.target.push(E)}}var O=x+_.length,I=o(r.color),P=o(r.customdata),R=[];for(t=0;t<O;t++)if(p[t]){var L=r.label[t];R.push({group:t>x-1,childrenNodes:[],pointNumber:t,label:L,color:I?r.color[t]:r.color,customdata:P?r.customdata[t]:r.customdata})}var F=!1;return function(e,t,r){for(var i=a.init2dArray(e,0),o=0;o<Math.min(t.length,r.length);o++)if(a.isIndex(t[o],e)&&a.isIndex(r[o],e)){if(t[o]===r[o])return!0;i[t[o]].push(r[o])}return n(i).components.some((function(e){return e.length>1}))}(O,A.source,A.target)&&(F=!0),{circular:F,links:c,nodes:R,groups:_,groupLookup:w}}(t);return i({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":378,"../../lib":503,"../../lib/gup":500,"strongly-connected-components":306}],919:[function(e,t,r){"use strict";t.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},{}],920:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../components/color"),o=e("tinycolor2"),s=e("../../plots/domain").defaults,l=e("../../components/fx/hoverlabel_defaults"),c=e("../../plot_api/plot_template"),u=e("../../plots/array_container_defaults");function f(e,t){function r(r,i){return n.coerce(e,t,a.link.colorscales,r,i)}r("label"),r("cmin"),r("cmax"),r("colorscale")}t.exports=function(e,t,r,p){function h(r,i){return n.coerce(e,t,a,r,i)}var d=n.extendDeep(p.hoverlabel,e.hoverlabel),m=e.node,g=c.newContainer(t,"node");function y(e,t){return n.coerce(m,g,a.node,e,t)}y("label"),y("groups"),y("x"),y("y"),y("pad"),y("thickness"),y("line.color"),y("line.width"),y("hoverinfo",e.hoverinfo),l(m,g,y,d),y("hovertemplate");var v=p.colorway;y("color",g.label.map((function(e,t){return i.addOpacity(function(e){return v[e%v.length]}(t),.8)}))),y("customdata");var b=e.link||{},x=c.newContainer(t,"link");function _(e,t){return n.coerce(b,x,a.link,e,t)}_("label"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",e.hoverinfo),l(b,x,_,d),_("hovertemplate");var w,k=o(p.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(k,x.value.length)),_("customdata"),u(b,x,{name:"colorscales",handleItemDefaults:f}),s(t,p,h),h("orientation"),h("valueformat"),h("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),h("arrangement",w),n.coerceFont(h,"textfont",n.extendFlat({},p.font)),t._length=null}},{"../../components/color":366,"../../components/fx/hoverlabel_defaults":404,"../../lib":503,"../../plot_api/plot_template":543,"../../plots/array_container_defaults":549,"../../plots/domain":584,"./attributes":916,tinycolor2:312}],921:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),moduleType:"trace",name:"sankey",basePlotModule:e("./base_plot"),selectPoints:e("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":916,"./base_plot":917,"./calc":918,"./defaults":920,"./plot":922,"./select.js":924}],922:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("./render"),s=e("../../components/fx"),l=e("../../components/color"),c=e("./constants").cn,u=a._;function f(e){return""!==e}function p(e,t){return e.filter((function(e){return e.key===t.traceId}))}function h(e,t){n.select(e).select("path").style("fill-opacity",t),n.select(e).select("rect").style("fill-opacity",t)}function d(e){n.select(e).select("text.name").style("fill","black")}function m(e){return function(t){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function g(e){return function(t){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function y(e,t,r){t&&r&&p(r,t).selectAll("."+c.sankeyLink).filter(m(t)).call(b.bind(0,t,r,!1))}function v(e,t,r){t&&r&&p(r,t).selectAll("."+c.sankeyLink).filter(m(t)).call(x.bind(0,t,r,!1))}function b(e,t,r,n){var a=n.datum().link.label;n.style("fill-opacity",(function(e){if(!e.link.concentrationscale)return.4})),a&&p(t,e).selectAll("."+c.sankeyLink).filter((function(e){return e.link.label===a})).style("fill-opacity",(function(e){if(!e.link.concentrationscale)return.4})),r&&p(t,e).selectAll("."+c.sankeyNode).filter(g(e)).call(y)}function x(e,t,r,n){var a=n.datum().link.label;n.style("fill-opacity",(function(e){return e.tinyColorAlpha})),a&&p(t,e).selectAll("."+c.sankeyLink).filter((function(e){return e.link.label===a})).style("fill-opacity",(function(e){return e.tinyColorAlpha})),r&&p(t,e).selectAll(c.sankeyNode).filter(g(e)).call(v)}function _(e,t){var r=e.hoverlabel||{},n=a.nestedProperty(r,t).get();return!Array.isArray(n)&&n}t.exports=function(e,t){for(var r=e._fullLayout,a=r._paper,p=r._size,m=0;m<e._fullData.length;m++)if(e._fullData[m].visible&&e._fullData[m].type===c.sankey&&!e._fullData[m]._viewInitial){var g=e._fullData[m].node;e._fullData[m]._viewInitial={node:{groups:g.groups.slice(),x:g.x.slice(),y:g.y.slice()}}}var w=u(e,"source:")+" ",k=u(e,"target:")+" ",D=u(e,"concentration:")+" ",T=u(e,"incoming flow count:")+" ",A=u(e,"outgoing flow count:")+" ";o(e,a,t,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{linkEvents:{hover:function(t,r,a){!1!==e._fullLayout.hovermode&&(n.select(t).call(b.bind(0,r,a,!0)),"skip"!==r.link.trace.link.hoverinfo&&(r.link.fullData=r.link.trace,e.emit("plotly_hover",{event:n.event,points:[r.link]})))},follow:function(t,a){if(!1!==e._fullLayout.hovermode){var o=a.link.trace.link;if("none"!==o.hoverinfo&&"skip"!==o.hoverinfo){for(var c=[],u=0,p=0;p<a.flow.links.length;p++){var m=a.flow.links[p];if("closest"!==e._fullLayout.hovermode||a.link.pointNumber===m.pointNumber){a.link.pointNumber===m.pointNumber&&(u=p),m.fullData=m.trace,o=a.link.trace.link;var g=v(m),y={valueLabel:i(a.valueFormat)(m.value)+a.valueSuffix};c.push({x:g[0],y:g[1],name:y.valueLabel,text:[m.label||"",w+m.source.label,k+m.target.label,m.concentrationscale?D+i("%0.2f")(m.flow.labelConcentration):""].filter(f).join("<br>"),color:_(o,"bgcolor")||l.addOpacity(m.color,1),borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:n.event.x<g[0]?"right":"left",hovertemplate:o.hovertemplate,hovertemplateLabels:y,eventData:[m]})}}s.loneHover(c,{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e,anchorIndex:u}).each((function(){a.link.concentrationscale||h(this,.65),d(this)}))}}function v(e){var t,r;e.circular?(t=(e.circularPathData.leftInnerExtent+e.circularPathData.rightInnerExtent)/2,r=e.circularPathData.verticalFullExtent):(t=(e.source.x1+e.target.x0)/2,r=(e.y0+e.y1)/2);var n=[t,r];return"v"===e.trace.orientation&&n.reverse(),n[0]+=a.parent.translateX,n[1]+=a.parent.translateY,n}},unhover:function(t,a,i){!1!==e._fullLayout.hovermode&&(n.select(t).call(x.bind(0,a,i,!0)),"skip"!==a.link.trace.link.hoverinfo&&(a.link.fullData=a.link.trace,e.emit("plotly_unhover",{event:n.event,points:[a.link]})),s.loneUnhover(r._hoverlayer.node()))},select:function(t,r){var a=r.link;a.originalEvent=n.event,e._hoverdata=[a],s.click(e,{target:!0})}},nodeEvents:{hover:function(t,r,a){!1!==e._fullLayout.hovermode&&(n.select(t).call(y,r,a),"skip"!==r.node.trace.node.hoverinfo&&(r.node.fullData=r.node.trace,e.emit("plotly_hover",{event:n.event,points:[r.node]})))},follow:function(t,a){if(!1!==e._fullLayout.hovermode){var o=a.node.trace.node;if("none"!==o.hoverinfo&&"skip"!==o.hoverinfo){var l=n.select(t).select("."+c.nodeRect),u=e._fullLayout._paperdiv.node().getBoundingClientRect(),p=l.node().getBoundingClientRect(),m=p.left-2-u.left,g=p.right+2-u.left,y=p.top+p.height/4-u.top,v={valueLabel:i(a.valueFormat)(a.node.value)+a.valueSuffix};a.node.fullData=a.node.trace,e._fullLayout._calcInverseTransform(e);var b=e._fullLayout._invScaleX,x=e._fullLayout._invScaleY,w=s.loneHover({x0:b*m,x1:b*g,y:x*y,name:i(a.valueFormat)(a.node.value)+a.valueSuffix,text:[a.node.label,T+a.node.targetLinks.length,A+a.node.sourceLinks.length].filter(f).join("<br>"),color:_(o,"bgcolor")||a.tinyColorHue,borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e});h(w,.85),d(w)}}},unhover:function(t,a,i){!1!==e._fullLayout.hovermode&&(n.select(t).call(v,a,i),"skip"!==a.node.trace.node.hoverinfo&&(a.node.fullData=a.node.trace,e.emit("plotly_unhover",{event:n.event,points:[a.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(t,r,a){var i=r.node;i.originalEvent=n.event,e._hoverdata=[i],n.select(t).call(v,r,a),s.click(e,{target:!0})}}})}},{"../../components/color":366,"../../components/fx":406,"../../lib":503,"./constants":919,"./render":923,"@plotly/d3":58}],923:[function(e,t,r){"use strict";var n=e("d3-force"),a=e("d3-interpolate").interpolateNumber,i=e("@plotly/d3"),o=e("@plotly/d3-sankey"),s=e("@plotly/d3-sankey-circular"),l=e("./constants"),c=e("tinycolor2"),u=e("../../components/color"),f=e("../../components/drawing"),p=e("../../lib"),h=p.strTranslate,d=p.strRotate,m=e("../../lib/gup"),g=m.keyFun,y=m.repeat,v=m.unwrap,b=e("../../lib/svg_text_utils"),x=e("../../registry"),_=e("../../constants/alignment"),w=_.CAP_SHIFT,k=_.LINE_SPACING;function D(e,t,r){var n,a=v(t),i=a.trace,u=i.domain,f="h"===i.orientation,h=i.node.pad,d=i.node.thickness,m=e.width*(u.x[1]-u.x[0]),g=e.height*(u.y[1]-u.y[0]),y=a._nodes,b=a._links,x=a.circular;(n=x?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(f?[m,g]:[g,m]).nodeWidth(d).nodePadding(h).nodeId((function(e){return e.pointNumber})).nodes(y).links(b);var _,w,k,D=n();for(var T in n.nodePadding()<h&&p.warn("node.pad was reduced to ",n.nodePadding()," to fit within the figure."),a._groupLookup){var A,S=parseInt(a._groupLookup[T]);for(_=0;_<D.nodes.length;_++)if(D.nodes[_].pointNumber===S){A=D.nodes[_];break}if(A){var M={pointNumber:parseInt(T),x0:A.x0,x1:A.x1,y0:A.y0,y1:A.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};D.nodes.unshift(M),A.childrenNodes.unshift(M)}}if(function(){for(_=0;_<D.nodes.length;_++){var e,t,r=D.nodes[_],n={};for(w=0;w<r.targetLinks.length;w++)e=(t=r.targetLinks[w]).source.pointNumber+":"+t.target.pointNumber,n.hasOwnProperty(e)||(n[e]=[]),n[e].push(t);var a=Object.keys(n);for(w=0;w<a.length;w++){var i=n[e=a[w]],o=0,s={};for(k=0;k<i.length;k++)s[(t=i[k]).label]||(s[t.label]=0),s[t.label]+=t.value,o+=t.value;for(k=0;k<i.length;k++)(t=i[k]).flow={value:o,labelConcentration:s[t.label]/o,concentration:t.value/o,links:i},t.concentrationscale&&(t.color=c(t.concentrationscale(t.flow.labelConcentration)))}var l=0;for(w=0;w<r.sourceLinks.length;w++)l+=r.sourceLinks[w].value;for(w=0;w<r.sourceLinks.length;w++)(t=r.sourceLinks[w]).concentrationOut=t.value/l;var u=0;for(w=0;w<r.targetLinks.length;w++)u+=r.targetLinks[w].value;for(w=0;w<r.targetLinks.length;w++)(t=r.targetLinks[w]).concenrationIn=t.value/u}}(),i.node.x.length&&i.node.y.length){for(_=0;_<Math.min(i.node.x.length,i.node.y.length,D.nodes.length);_++)if(i.node.x[_]&&i.node.y[_]){var E=[i.node.x[_]*m,i.node.y[_]*g];D.nodes[_].x0=E[0]-d/2,D.nodes[_].x1=E[0]+d/2;var C=D.nodes[_].y1-D.nodes[_].y0;D.nodes[_].y0=E[1]-C/2,D.nodes[_].y1=E[1]+C/2}"snap"===i.arrangement&&function(e){e.forEach((function(e){var t,r,n,a=0,i=e.length;for(e.sort((function(e,t){return e.y0-t.y0})),n=0;n<i;++n)(t=e[n]).y0>=a||(r=a-t.y0)>1e-6&&(t.y0+=r,t.y1+=r),a=t.y1+h}))}(function(e){var t,r,n=e.map((function(e,t){return{x0:e.x0,index:t}})).sort((function(e,t){return e.x0-t.x0})),a=[],i=-1,o=-1/0;for(_=0;_<n.length;_++){var s=e[n[_].index];s.x0>o+d&&(i+=1,t=s.x0),o=s.x0,a[i]||(a[i]=[]),a[i].push(s),r=t-s.x0,s.x0+=r,s.x1+=r}return a}(y=D.nodes)),n.update(D)}return{circular:x,key:r,trace:i,guid:p.randstr(),horizontal:f,width:m,height:g,nodePad:i.node.pad,nodeLineColor:i.node.line.color,nodeLineWidth:i.node.line.width,linkLineColor:i.link.line.color,linkLineWidth:i.link.line.width,valueFormat:i.valueformat,valueSuffix:i.valuesuffix,textFont:i.textfont,translateX:u.x[0]*e.width+e.margin.l,translateY:e.height-u.y[1]*e.height+e.margin.t,dragParallel:f?g:m,dragPerpendicular:f?m:g,arrangement:i.arrangement,sankey:n,graph:D,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function T(e,t,r){var n=c(t.color),a=t.source.label+"|"+t.target.label+"__"+r;return t.trace=e.trace,t.curveNumber=e.trace.index,{circular:e.circular,key:a,traceId:e.key,pointNumber:t.pointNumber,link:t,tinyColorHue:u.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:A,linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,parent:e,interactionState:e.interactionState,flow:t.flow}}function A(){return function(e){if(e.link.circular)return r=(t=e.link).width/2,n=t.circularPathData,"top"===t.circularLinkType?"M "+n.targetX+" "+(n.targetY+r)+" L"+n.rightInnerExtent+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.targetY-r)+"L"+n.targetX+" "+(n.targetY-r)+"Z":"M "+n.targetX+" "+(n.targetY-r)+" L"+n.rightInnerExtent+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.targetY+r)+"L"+n.targetX+" "+(n.targetY+r)+"Z";var t,r,n,i=e.link.source.x1,o=e.link.target.x0,s=a(i,o),l=s(.5),c=s(.5),u=e.link.y0-e.link.width/2,f=e.link.y0+e.link.width/2,p=e.link.y1-e.link.width/2,h=e.link.y1+e.link.width/2;return"M"+i+","+u+"C"+l+","+u+" "+c+","+p+" "+o+","+p+"L"+o+","+h+"C"+c+","+h+" "+l+","+f+" "+i+","+f+"Z"}}function S(e,t){var r=c(t.color),n=l.nodePadAcross,a=e.nodePad/2;t.dx=t.x1-t.x0,t.dy=t.y1-t.y0;var i=t.dx,o=Math.max(.5,t.dy),s="node_"+t.pointNumber;return t.group&&(s=p.randstr()),t.trace=e.trace,t.curveNumber=e.trace.index,{index:t.pointNumber,key:s,partOfGroup:t.partOfGroup||!1,group:t.group,traceId:e.key,trace:e.trace,node:t,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(i),visibleHeight:o,zoneX:-n,zoneY:-a,zoneWidth:i+2*n,zoneHeight:o+2*a,labelY:e.horizontal?t.dy/2+1:t.dx/2+1,left:1===t.originalLayer,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:u.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,graph:e.graph,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,s].join("_"),interactionState:e.interactionState,figure:e}}function M(e){e.attr("transform",(function(e){return h(e.node.x0.toFixed(3),e.node.y0.toFixed(3))}))}function E(e){e.call(M)}function C(e,t){e.call(E),t.attr("d",A())}function N(e){e.attr("width",(function(e){return e.node.x1-e.node.x0})).attr("height",(function(e){return e.visibleHeight}))}function O(e){return e.link.width>1||e.linkLineWidth>0}function I(e){return h(e.translateX,e.translateY)+(e.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function P(e,t,r){e.on(".basic",null).on("mouseover.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.hover(this,e,t),e.interactionState.hovered=[this,e])})).on("mousemove.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.follow(this,e),e.interactionState.hovered=[this,e])})).on("mouseout.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.unhover(this,e,t),e.interactionState.hovered=!1)})).on("click.basic",(function(e){e.interactionState.hovered&&(r.unhover(this,e,t),e.interactionState.hovered=!1),e.interactionState.dragInProgress||e.partOfGroup||r.select(this,e,t)}))}function R(e,t,r,a){var o=i.behavior.drag().origin((function(e){return{x:e.node.x0+e.visibleWidth/2,y:e.node.y0+e.visibleHeight/2}})).on("dragstart",(function(i){if("fixed"!==i.arrangement&&(p.ensureSingle(a._fullLayout._infolayer,"g","dragcover",(function(e){a._fullLayout._dragCover=e})),p.raiseToTop(this),i.interactionState.dragInProgress=i.node,F(i.node),i.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var o=i.traceId+"|"+i.key;i.forceLayouts[o]?i.forceLayouts[o].alpha(1):function(e,t,r,a){!function(e){for(var t=0;t<e.length;t++)e[t].y=(e[t].y0+e[t].y1)/2,e[t].x=(e[t].x0+e[t].x1)/2}(r.graph.nodes);var i=r.graph.nodes.filter((function(e){return e.originalX===r.node.originalX})).filter((function(e){return!e.partOfGroup}));r.forceLayouts[t]=n.forceSimulation(i).alphaDecay(0).force("collide",n.forceCollide().radius((function(e){return e.dy/2+r.nodePad/2})).strength(1).iterations(l.forceIterations)).force("constrain",function(e,t,r,n){return function(){for(var e=0,a=0;a<r.length;a++){var i=r[a];i===n.interactionState.dragInProgress?(i.x=i.lastDraggedX,i.y=i.lastDraggedY):(i.vx=(i.originalX-i.x)/l.forceTicksPerFrame,i.y=Math.min(n.size-i.dy/2,Math.max(i.dy/2,i.y))),e=Math.max(e,Math.abs(i.vx),Math.abs(i.vy))}!n.interactionState.dragInProgress&&e<.1&&n.forceLayouts[t].alpha()>0&&n.forceLayouts[t].alpha(0)}}(0,t,i,r)).stop()}(0,o,i),function(e,t,r,n,a){window.requestAnimationFrame((function i(){var o;for(o=0;o<l.forceTicksPerFrame;o++)r.forceLayouts[n].tick();if(function(e){for(var t=0;t<e.length;t++)e[t].y0=e[t].y-e[t].dy/2,e[t].y1=e[t].y0+e[t].dy,e[t].x0=e[t].x-e[t].dx/2,e[t].x1=e[t].x0+e[t].dx}(r.graph.nodes),r.sankey.update(r.graph),C(e.filter(B(r)),t),r.forceLayouts[n].alpha()>0)window.requestAnimationFrame(i);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,L(r,a)}}))}(e,t,i,o,a)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a)),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),C(e.filter(B(r)),t))}})).on("dragend",(function(e){if("fixed"!==e.arrangement){e.interactionState.dragInProgress=!1;for(var t=0;t<e.node.childrenNodes.length;t++)e.node.childrenNodes[t].x=e.node.x,e.node.childrenNodes[t].y=e.node.y;"snap"!==e.arrangement&&L(e,a)}}));e.on(".drag",null).call(o)}function L(e,t){for(var r=[],n=[],a=0;a<e.graph.nodes.length;a++){var i=(e.graph.nodes[a].x0+e.graph.nodes[a].x1)/2,o=(e.graph.nodes[a].y0+e.graph.nodes[a].y1)/2;r.push(i/e.figure.width),n.push(o/e.figure.height)}x.call("_guiRestyle",t,{"node.x":[r],"node.y":[n]},e.trace.index).then((function(){t._fullLayout._dragCover&&t._fullLayout._dragCover.remove()}))}function F(e){e.lastDraggedX=e.x0+e.dx/2,e.lastDraggedY=e.y0+e.dy/2}function B(e){return function(t){return t.node.originalX===e.node.originalX}}t.exports=function(e,t,r,n,a){var o=!1;p.ensureSingle(e._fullLayout._infolayer,"g","first-render",(function(){o=!0}));var s=e._fullLayout._dragCover,m=r.filter((function(e){return v(e).trace.visible})).map(D.bind(null,n)),x=t.selectAll("."+l.cn.sankey).data(m,g);x.exit().remove(),x.enter().append("g").classed(l.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events","auto").attr("transform",I),x.each((function(t,r){e._fullData[r]._sankey=t;var n="bgsankey-"+t.trace.uid+"-"+r;p.ensureSingle(e._fullLayout._draggers,"rect",n),e._fullData[r]._bgRect=i.select("."+n),e._fullData[r]._bgRect.style("pointer-events","all").attr("width",t.width).attr("height",t.height).attr("x",t.translateX).attr("y",t.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})})),x.transition().ease(l.ease).duration(l.duration).attr("transform",I);var _=x.selectAll("."+l.cn.sankeyLinks).data(y,g);_.enter().append("g").classed(l.cn.sankeyLinks,!0).style("fill","none");var E=_.selectAll("."+l.cn.sankeyLink).data((function(e){return e.graph.links.filter((function(e){return e.value})).map(T.bind(null,e))}),g);E.enter().append("path").classed(l.cn.sankeyLink,!0).call(P,x,a.linkEvents),E.style("stroke",(function(e){return O(e)?u.tinyRGB(c(e.linkLineColor)):e.tinyColorHue})).style("stroke-opacity",(function(e){return O(e)?u.opacity(e.linkLineColor):e.tinyColorAlpha})).style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha})).style("stroke-width",(function(e){return O(e)?e.linkLineWidth:1})).attr("d",A()),E.style("opacity",(function(){return e._context.staticPlot||o||s?1:0})).transition().ease(l.ease).duration(l.duration).style("opacity",1),E.exit().transition().ease(l.ease).duration(l.duration).style("opacity",0).remove();var C=x.selectAll("."+l.cn.sankeyNodeSet).data(y,g);C.enter().append("g").classed(l.cn.sankeyNodeSet,!0),C.style("cursor",(function(e){switch(e.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}}));var L=C.selectAll("."+l.cn.sankeyNode).data((function(e){var t=e.graph.nodes;return function(e){var t,r=[];for(t=0;t<e.length;t++)e[t].originalX=(e[t].x0+e[t].x1)/2,e[t].originalY=(e[t].y0+e[t].y1)/2,-1===r.indexOf(e[t].originalX)&&r.push(e[t].originalX);for(r.sort((function(e,t){return e-t})),t=0;t<e.length;t++)e[t].originalLayerIndex=r.indexOf(e[t].originalX),e[t].originalLayer=e[t].originalLayerIndex/(r.length-1)}(t),t.map(S.bind(null,e))}),g);L.enter().append("g").classed(l.cn.sankeyNode,!0).call(M).style("opacity",(function(t){return!e._context.staticPlot&&!o||t.partOfGroup?0:1})),L.call(P,x,a.nodeEvents).call(R,E,a,e),L.transition().ease(l.ease).duration(l.duration).call(M).style("opacity",(function(e){return e.partOfGroup?0:1})),L.exit().transition().ease(l.ease).duration(l.duration).style("opacity",0).remove();var F=L.selectAll("."+l.cn.nodeRect).data(y);F.enter().append("rect").classed(l.cn.nodeRect,!0).call(N),F.style("stroke-width",(function(e){return e.nodeLineWidth})).style("stroke",(function(e){return u.tinyRGB(c(e.nodeLineColor))})).style("stroke-opacity",(function(e){return u.opacity(e.nodeLineColor)})).style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha})),F.transition().ease(l.ease).duration(l.duration).call(N);var B=L.selectAll("."+l.cn.nodeLabel).data(y);B.enter().append("text").classed(l.cn.nodeLabel,!0).style("cursor","default"),B.attr("data-notex",1).text((function(e){return e.node.label})).each((function(t){var r=i.select(this);f.font(r,t.textFont),b.convertToTspans(r,e)})).style("text-shadow",b.makeTextShadow(e._fullLayout.paper_bgcolor)).attr("text-anchor",(function(e){return e.horizontal&&e.left?"end":"start"})).attr("transform",(function(e){var t=i.select(this),r=b.lineCount(t),n=e.textFont.size*((r-1)*k-w),a=e.nodeLineWidth/2+3,o=((e.horizontal?e.visibleHeight:e.visibleWidth)-n)/2;e.horizontal&&(e.left?a=-a:a+=e.visibleWidth);var s=e.horizontal?"":"scale(-1,1)"+d(90);return h(e.horizontal?a:o,e.horizontal?o:a)+s})),B.transition().ease(l.ease).duration(l.duration)}},{"../../components/color":366,"../../components/drawing":388,"../../constants/alignment":471,"../../lib":503,"../../lib/gup":500,"../../lib/svg_text_utils":529,"../../registry":638,"./constants":919,"@plotly/d3":58,"@plotly/d3-sankey":57,"@plotly/d3-sankey-circular":56,"d3-force":111,"d3-interpolate":116,tinycolor2:312}],924:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=[],n=e.cd[0].trace,a=n._sankey.graph.nodes,i=0;i<a.length;i++){var o=a[i];if(!o.partOfGroup){var s=[(o.x0+o.x1)/2,(o.y0+o.y1)/2];"v"===n.orientation&&s.reverse(),t&&t.contains(s,!1,i,e)&&r.push({pointNumber:o.pointNumber})}}return r}},{}],925:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r<e.length;r++)e[r].i=r;n.mergeArray(t.text,e,"tx"),n.mergeArray(t.texttemplate,e,"txt"),n.mergeArray(t.hovertext,e,"htx"),n.mergeArray(t.customdata,e,"data"),n.mergeArray(t.textposition,e,"tp"),t.textfont&&(n.mergeArrayCastPositive(t.textfont.size,e,"ts"),n.mergeArray(t.textfont.color,e,"tc"),n.mergeArray(t.textfont.family,e,"tf"));var a=t.marker;if(a){n.mergeArrayCastPositive(a.size,e,"ms"),n.mergeArrayCastPositive(a.opacity,e,"mo"),n.mergeArray(a.symbol,e,"mx"),n.mergeArray(a.color,e,"mc");var i=a.line;a.line&&(n.mergeArray(i.color,e,"mlc"),n.mergeArrayCastPositive(i.width,e,"mlw"));var o=a.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,e,"mgt"),n.mergeArray(o.color,e,"mgc"))}}},{"../../lib":503}],926:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=e("../../plots/template_attributes").texttemplateAttrs,i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../../components/colorscale/attributes"),s=e("../../plots/font_attributes"),l=e("../../components/drawing/attributes").dash,c=e("../../components/drawing"),u=e("./constants"),f=e("../../lib/extend").extendFlat;t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},xhoverformat:n("x"),yhoverformat:n("y"),stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:a({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:i({},{keys:u.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:f({},l,{editType:"style"}),simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:{valType:"color",editType:"style",anim:!0},marker:f({symbol:{valType:"enumerated",values:c.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:f({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},o("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},o("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:s({editType:"calc",colorEditType:"style",arrayOk:!0})}},{"../../components/colorscale/attributes":373,"../../components/drawing":388,"../../components/drawing/attributes":387,"../../lib/extend":493,"../../plots/cartesian/axis_format_attributes":557,"../../plots/font_attributes":585,"../../plots/template_attributes":633,"./constants":930}],927:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),s=e("../../constants/numerical").BADNUM,l=e("./subtypes"),c=e("./colorscale_calc"),u=e("./arrays_to_calcdata"),f=e("./calc_selection");function p(e,t,r,n,a,o,s){var c=t._length,u=e._fullLayout,f=r._id,p=n._id,h=u._firstScatter[m(t)]===t.uid,d=(g(t,u,r,n)||{}).orientation,y=t.fill;r._minDtick=0,n._minDtick=0;var v={padded:!0},b={padded:!0};s&&(v.ppad=b.ppad=s);var x=c<2||a[0]!==a[c-1]||o[0]!==o[c-1];x&&("tozerox"===y||"tonextx"===y&&(h||"h"===d))?v.tozero=!0:(t.error_y||{}).visible||"tonexty"!==y&&"tozeroy"!==y&&(l.hasMarkers(t)||l.hasText(t))||(v.padded=!1,v.ppad=0),x&&("tozeroy"===y||"tonexty"===y&&(h||"v"===d))?b.tozero=!0:"tonextx"!==y&&"tozerox"!==y||(b.padded=!1),f&&(t._extremes[f]=i.findExtremes(r,a,v)),p&&(t._extremes[p]=i.findExtremes(n,o,b))}function h(e,t){if(l.hasMarkers(e)){var r,n=e.marker,o=1.6*(e.marker.sizeref||1);if(r="area"===e.marker.sizemode?function(e){return Math.max(Math.sqrt((e||0)/o),3)}:function(e){return Math.max((e||0)/o,3)},a.isArrayOrTypedArray(n.size)){var s={type:"linear"};i.setConvert(s);for(var c=s.makeCalcdata(e.marker,"size"),u=new Array(t),f=0;f<t;f++)u[f]=r(c[f]);return u}return r(n.size)}}function d(e,t){var r=m(t),n=e._firstScatter;n[r]||(n[r]=t.uid)}function m(e){var t=e.stackgroup;return e.xaxis+e.yaxis+e.type+(t?"-"+t:"")}function g(e,t,r,n){var a=e.stackgroup;if(a){var i=t._scatterStackOpts[r._id+n._id][a],o="v"===i.orientation?n:r;return"linear"===o.type||"log"===o.type?i:void 0}}t.exports={calc:function(e,t){var r,l,m,y,v,b,x=e._fullLayout,_=i.getFromId(e,t.xaxis||"x"),w=i.getFromId(e,t.yaxis||"y"),k=_.makeCalcdata(t,"x"),D=w.makeCalcdata(t,"y"),T=o(t,_,"x",k),A=o(t,w,"y",D),S=T.vals,M=A.vals,E=t._length,C=new Array(E),N=t.ids,O=g(t,x,_,w),I=!1;d(x,t);var P,R="x",L="y";O?(a.pushUnique(O.traceIndices,t._expandedIndex),(r="v"===O.orientation)?(L="s",P="x"):(R="s",P="y"),v="interpolate"===O.stackgaps):p(e,t,_,w,S,M,h(t,E));var F=!!t.xperiodalignment,B=!!t.yperiodalignment;for(l=0;l<E;l++){var z=C[l]={},j=n(S[l]),U=n(M[l]);j&&U?(z[R]=S[l],z[L]=M[l],F&&(z.orig_x=k[l],z.xEnd=T.ends[l],z.xStart=T.starts[l]),B&&(z.orig_y=D[l],z.yEnd=A.ends[l],z.yStart=A.starts[l])):O&&(r?j:U)?(z[P]=r?S[l]:M[l],z.gap=!0,v?(z.s=s,I=!0):z.s=0):z[R]=z[L]=s,N&&(z.id=String(N[l]))}if(u(C,t),c(e,t),f(C,t),O){for(l=0;l<C.length;)C[l][P]===s?C.splice(l,1):l++;if(a.sort(C,(function(e,t){return e[P]-t[P]||e.i-t.i})),I){for(l=0;l<C.length-1&&C[l].gap;)l++;for((b=C[l].s)||(b=C[l].s=0),m=0;m<l;m++)C[m].s=b;for(y=C.length-1;y>l&&C[y].gap;)y--;for(b=C[y].s,m=C.length-1;m>y;m--)C[m].s=b;for(;l<y;)if(C[++l].gap){for(m=l+1;C[m].gap;)m++;for(var $=C[l-1][P],V=C[l-1].s,q=(C[m].s-V)/(C[m][P]-$);l<m;)C[l].s=V+(C[l][P]-$)*q,l++}}}return C},calcMarkerSize:h,calcAxisExpansion:p,setFirstScatter:d,getStackOpts:g}},{"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/align_period":551,"../../plots/cartesian/axes":554,"./arrays_to_calcdata":925,"./calc_selection":928,"./colorscale_calc":929,"./subtypes":951,"fast-isnumeric":190}],928:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){n.isArrayOrTypedArray(t.selectedpoints)&&n.tagSelected(e,t)}},{"../../lib":503}],929:[function(e,t,r){"use strict";var n=e("../../components/colorscale/helpers").hasColorscale,a=e("../../components/colorscale/calc"),i=e("./subtypes");t.exports=function(e,t){i.hasLines(t)&&n(t,"line")&&a(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(t)&&(n(t,"marker")&&a(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),n(t,"marker.line")&&a(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}},{"../../components/colorscale/calc":374,"../../components/colorscale/helpers":377,"./subtypes":951}],930:[function(e,t,r){"use strict";t.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},{}],931:[function(e,t,r){"use strict";var n=e("./calc");function a(e,t,r,n,a,i,o){a[n]=!0;var s={i:null,gap:!0,s:0};if(s[o]=r,e.splice(t,0,s),t&&r===e[t-1][o]){var l=e[t-1];s.s=l.s,s.i=l.i,s.gap=l.gap}else i&&(s.s=function(e,t,r,n){var a=e[t-1],i=e[t+1];return i?a?a.s+(i.s-a.s)*(r-a[n])/(i[n]-a[n]):i.s:a.s}(e,t,r,o));t||(e[0].t=e[1].t,e[0].trace=e[1].trace,delete e[1].t,delete e[1].trace)}t.exports=function(e,t){var r=t.xaxis,i=t.yaxis,o=r._id+i._id,s=e._fullLayout._scatterStackOpts[o];if(s){var l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,k=e.calcdata;for(var D in s){var T=(y=s[D]).traceIndices;if(T.length){for(v="interpolate"===y.stackgaps,b=y.groupnorm,"v"===y.orientation?(x="x",_="y"):(x="y",_="x"),w=new Array(T.length),l=0;l<w.length;l++)w[l]=!1;h=k[T[0]];var A=new Array(h.length);for(l=0;l<h.length;l++)A[l]=h[l][x];for(l=1;l<T.length;l++){for(p=k[T[l]],c=u=0;c<p.length;c++){for(d=p[c][x];d>A[u]&&u<A.length;u++)a(p,c,A[u],l,w,v,x),c++;if(d!==A[u]){for(f=0;f<l;f++)a(k[T[f]],u,d,f,w,v,x);A.splice(u,0,d)}u++}for(;u<A.length;u++)a(p,c,A[u],l,w,v,x),c++}var S=A.length;for(c=0;c<h.length;c++){for(m=h[c][_]=h[c].s,l=1;l<T.length;l++)(p=k[T[l]])[0].trace._rawLength=p[0].trace._length,p[0].trace._length=S,m+=p[c].s,p[c][_]=m;if(b)for(g=("fraction"===b?m:m/100)||1,l=0;l<T.length;l++){var M=k[T[l]][c];M[_]/=g,M.sNorm=M.s/g}}for(l=0;l<T.length;l++){var E=(p=k[T[l]])[0].trace,C=n.calcMarkerSize(E,E._rawLength),N=Array.isArray(C);if(C&&w[l]||N){var O=C;for(C=new Array(S),c=0;c<S;c++)C[c]=p[c].gap?0:N?O[p[c].i]:O}var I=new Array(S),P=new Array(S);for(c=0;c<S;c++)I[c]=p[c].x,P[c]=p[c].y;n.calcAxisExpansion(e,E,r,i,I,P,C),p[0].t.orientation=y.orientation}}}}}},{"./calc":927}],932:[function(e,t,r){"use strict";t.exports=function(e){for(var t=0;t<e.length;t++){var r=e[t];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var a=t-1;a>=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],933:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),s=e("./subtypes"),l=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),p=e("./line_defaults"),h=e("./line_shape_defaults"),d=e("./text_defaults"),m=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function y(r,a){return n.coerce(e,t,i,r,a)}var v=l(e,t,g,y);if(v||(t.visible=!1),t.visible){c(e,t,g,y),y("xhoverformat"),y("yhoverformat");var b=u(e,t,g,y),x=!b&&v<o.PTS_LINESONLY?"lines+markers":"lines";y("text"),y("hovertext"),y("mode",x),s.hasLines(t)&&(p(e,t,r,g,y),h(e,t,y),y("connectgaps"),y("line.simplify")),s.hasMarkers(t)&&f(e,t,r,g,y,{gradient:!0}),s.hasText(t)&&(y("texttemplate"),d(e,t,g,y));var _=[];(s.hasMarkers(t)||s.hasText(t))&&(y("cliponaxis"),y("marker.maxdisplayed"),_.push("points")),y("fill",b?b.fillDflt:"none"),"none"!==t.fill&&(m(e,t,r,y),s.hasLines(t)||h(e,t,y));var w=(t.line||{}).color,k=(t.marker||{}).color;"tonext"!==t.fill&&"toself"!==t.fill||_.push("fills"),y("hoveron",_.join("+")||"points"),"fills"!==t.hoveron&&y("hovertemplate");var D=a.getComponentMethod("errorbars","supplyDefaults");D(e,t,w||k||r,{axis:"y"}),D(e,t,w||k||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(t,y)}}},{"../../lib":503,"../../registry":638,"./attributes":926,"./constants":930,"./fillcolor_defaults":934,"./line_defaults":939,"./line_shape_defaults":941,"./marker_defaults":945,"./period_defaults":946,"./stack_defaults":949,"./subtypes":951,"./text_defaults":952,"./xy_defaults":953}],934:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i){var o=!1;if(t.marker){var s=t.marker.color,l=(t.marker.line||{}).color;s&&!a(s)?o=s:l&&!a(l)&&(o=l)}i("fillcolor",n.addOpacity((t.line||{}).color||o||r,.5))}},{"../../components/color":366,"../../lib":503}],935:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes");t.exports=function(e,t,r){var a={},i={_fullLayout:r},o=n.getFromTrace(i,t,"x"),s=n.getFromTrace(i,t,"y");return a.xLabel=n.tickText(o,o.c2l(e.x),!0).text,a.yLabel=n.tickText(s,s.c2l(e.y),!0).text,a}},{"../../plots/cartesian/axes":554}],936:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./subtypes");t.exports=function(e,t){var r,i;if("lines"===e.mode)return(r=e.line.color)&&n.opacity(r)?r:e.fillcolor;if("none"===e.mode)return e.fill?e.fillcolor:"";var o=t.mcc||(e.marker||{}).color,s=t.mlcc||((e.marker||{}).line||{}).color;return(i=o&&n.opacity(o)?o:s&&n.opacity(s)&&(t.mlw||((e.marker||{}).line||{}).width)?s:"")?n.opacity(i)<.3?n.addOpacity(i,.3):i:(r=(e.line||{}).color)&&n.opacity(r)&&a.hasLines(e)&&e.line.width?r:e.fillcolor}},{"../../components/color":366,"./subtypes":951}],937:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/fx"),i=e("../../registry"),o=e("./get_trace_color"),s=e("../../components/color"),l=n.fillText;t.exports=function(e,t,r,c){var u=e.cd,f=u[0].trace,p=e.xa,h=e.ya,d=p.c2p(t),m=h.c2p(r),g=[d,m],y=f.hoveron||"",v=-1!==f.mode.indexOf("markers")?3:.5,b=!!f.xperiodalignment,x=!!f.yperiodalignment;if(-1!==y.indexOf("points")){var _=function(e){var t=Math.max(v,e.mrc||0),r=p.c2p(e.x)-d,n=h.c2p(e.y)-m;return Math.max(Math.sqrt(r*r+n*n)-t,1-v/t)},w=a.getDistanceFunction(c,(function(e){if(b){var t=p.c2p(e.xStart),r=p.c2p(e.xEnd);return d>=Math.min(t,r)&&d<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.x)-d);return i<n?a*i/n:i-n+a}),(function(e){if(x){var t=h.c2p(e.yStart),r=h.c2p(e.yEnd);return m>=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(h.c2p(e.y)-m);return i<n?a*i/n:i-n+a}),_);if(a.getClosest(u,w,e),!1!==e.index){var k=u[e.index],D=p.c2p(k.x,!0),T=h.c2p(k.y,!0),A=k.mrc||1;e.index=k.i;var S=u[0].t.orientation,M=S&&(k.sNorm||k.s),E="h"===S?M:void 0!==k.orig_x?k.orig_x:k.x,C="v"===S?M:void 0!==k.orig_y?k.orig_y:k.y;return n.extendFlat(e,{color:o(f,k),x0:D-A,x1:D+A,xLabelVal:E,y0:T-A,y1:T+A,yLabelVal:C,spikeDistance:_(k),hovertemplate:f.hovertemplate}),l(k,f,e),i.getComponentMethod("errorbars","hoverInfo")(k,f,e),[e]}}if(-1!==y.indexOf("fills")&&f._polygons){var N,O,I,P,R,L,F,B,z,j=f._polygons,U=[],$=!1,V=1/0,q=-1/0,W=1/0,H=-1/0;for(N=0;N<j.length;N++)(I=j[N]).contains(g)&&($=!$,U.push(I),W=Math.min(W,I.ymin),H=Math.max(H,I.ymax));if($){var G=((W=Math.max(W,0))+(H=Math.min(H,h._length)))/2;for(N=0;N<U.length;N++)for(P=U[N].pts,O=1;O<P.length;O++)(B=P[O-1][1])>G!=(z=P[O][1])>=G&&(L=P[O-1][0],F=P[O][0],z-B&&(R=L+(F-L)*(G-B)/(z-B),V=Math.min(V,R),q=Math.max(q,R)));V=Math.max(V,0),q=Math.min(q,p._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:V,x1:q,y0:G,y1:G,color:X,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":366,"../../components/fx":406,"../../lib":503,"../../registry":638,"./get_trace_color":936}],938:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":568,"./arrays_to_calcdata":925,"./attributes":926,"./calc":927,"./cross_trace_calc":931,"./cross_trace_defaults":932,"./defaults":933,"./format_labels":935,"./hover":937,"./marker_colorbar":944,"./plot":947,"./select":948,"./style":950,"./subtypes":951}],939:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,s,l){var c=(e.marker||{}).color;s("line.color",r),a(e,"line")?i(e,t,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r),s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":376,"../../components/colorscale/helpers":377,"../../lib":503}],940:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=e("../../lib"),c=l.segmentsIntersect,u=l.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,p,h,d,m,g,y,v,b,x,_,w,k,D,T,A,S=t.xaxis,M=t.yaxis,E="log"===S.type,C="log"===M.type,N=S._length,O=M._length,I=t.connectGaps,P=t.baseTolerance,R=t.shape,L="linear"===R,F=t.fill&&"none"!==t.fill,B=[],z=f.minTolerance,j=e.length,U=new Array(j),$=0;function V(r){var n=e[r];if(!n)return!1;var i=t.linearized?S.l2p(n.x):S.c2p(n.x),l=t.linearized?M.l2p(n.y):M.c2p(n.y);if(i===a){if(E&&(i=S.c2p(n.x,!0)),i===a)return!1;C&&l===a&&(i*=Math.abs(S._m*O*(S._m>0?o:s)/(M._m*N*(M._m>0?o:s)))),i*=1e3}if(l===a){if(C&&(l=M.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function q(e,t,r,n){var a=r-e,i=n-t,o=.5-e,s=.5-t,l=a*a+i*i,c=a*o+i*s;if(c>0&&c<l){var u=o*i-s*a;if(u*u<l)return!0}}function W(e,t){var r=e[0]/N,n=e[1]/O,a=Math.max(0,-r,r-1,-n,n-1);return a&&void 0!==T&&q(r,n,T,A)&&(a=0),a&&t&&q(r,n,t[0]/N,t[1]/O)&&(a=0),(1+f.toleranceGrowth*a)*P}function H(e,t){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}var G,X,Y,Z,K,J,Q,ee=f.maxScreensAway,te=-N*ee,re=N*(1+ee),ne=-O*ee,ae=O*(1+ee),ie=[[te,ne,re,ne],[re,ne,re,ae],[re,ae,te,ae],[te,ae,te,ne]];function oe(e){if(e[0]<te||e[0]>re||e[1]<ne||e[1]>ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function se(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0}function le(e,t,r){return function(n,a){var i=oe(n),o=oe(a),s=[];if(i&&o&&se(i,o))return s;i&&s.push(i),o&&s.push(o);var c=2*l.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);return c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c),s}}function ce(e){var t=e[0],r=e[1],n=t===U[$-1][0],a=r===U[$-1][1];if(!n||!a)if($>1){var i=t===U[$-2][0],o=r===U[$-2][1];n&&(t===te||t===re)&&i?o?$--:U[$-1]=e:a&&(r===ne||r===ae)&&o?i?$--:U[$-1]=e:U[$++]=e}else U[$++]=e}function ue(e){U[$-1][0]!==e[0]&&U[$-1][1]!==e[1]&&ce([Y,Z]),ce(e),K=null,Y=Z=0}function fe(e){if(T=e[0]/N,A=e[1]/O,G=e[0]<te?te:e[0]>re?re:0,X=e[1]<ne?ne:e[1]>ae?ae:0,G||X){if($)if(K){var t=Q(K,e);t.length>1&&(ue(t[0]),U[$++]=t[1])}else J=Q(U[$-1],e)[0],U[$++]=J;else U[$++]=[G||e[0],X||e[1]];var r=U[$-1];G&&X&&(r[0]!==G||r[1]!==X)?(K&&(Y!==G&&Z!==X?ce(Y&&Z?(n=K,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[Y||G,Z||X]):Y&&Z&&ce([Y,Z])),ce([G,X])):Y-G&&Z-X&&ce([G||Y,X||Z]),K=e,Y=G,Z=X}else K&&ue(Q(K,e)[0]),U[$++]=e;var n,a,i,o}for("linear"===R||"spline"===R?Q=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&H(o,e)<H(r[0],e)?r.unshift(o):r.push(o),n++)}return r}:"hv"===R||"vh"===R?Q=function(e,t){var r=[],n=oe(e),a=oe(t);return n&&a&&se(n,a)||(n&&r.push(n),a&&r.push(a)),r}:"hvh"===R?Q=le(0,te,re):"vhv"===R&&(Q=le(1,ne,ae)),r=0;r<j;r++)if(n=V(r)){for($=0,K=null,fe(n),r++;r<j;r++){if(!(p=V(r))){if(I)continue;break}if(L&&t.simplify){var pe=V(r+1);if(v=H(p,n),F&&(0===$||$===j-1)||!(v<W(p,pe)*z)){for(g=[(p[0]-n[0])/v,(p[1]-n[1])/v],h=n,b=v,x=w=k=0,m=!1,i=p,r++;r<e.length;r++){if(d=pe,pe=V(r+1),!d){if(I)continue;break}if(D=(y=[d[0]-n[0],d[1]-n[1]])[0]*g[1]-y[1]*g[0],w=Math.min(w,D),(k=Math.max(k,D))-w>W(d,pe))break;i=d,(_=y[0]*g[0]+y[1]*g[1])>b?(b=_,p=d,m=!1):_<x&&(x=_,h=d,m=!0)}if(m?(fe(p),i!==h&&fe(h)):(h!==n&&fe(h),i!==p&&fe(p)),fe(i),r>=e.length||!d)break;fe(d),n=d}}else fe(p)}K&&ce([Y||K[0],Z||K[1]]),B.push(U.slice(0,$))}return B}},{"../../constants/numerical":479,"../../lib":503,"./constants":930}],941:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],942:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,s,l,c={},u=!1,f=-1,p=0,h=-1;for(i=0;i<r.length;i++)(o=(a=r[i][0].trace).stackgroup||"")?o in c?l=c[o]:(l=c[o]=p,p++):a.fill in n&&h>=0?l=h:(l=h=p,p++),l<f&&(u=!0),a._groupIndex=f=l;var d=r.slice();u&&d.sort((function(e,t){var r=e[0].trace,n=t[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index}));var m={};for(i=0;i<d.length;i++)o=(a=d[i][0].trace).stackgroup||"",!0===a.visible?(a._nexttrace=null,a.fill in n&&(s=m[o],a._prevtrace=s||null,s&&(s._nexttrace=a)),a._ownfill=a.fill&&("tozero"===a.fill.substr(0,6)||"toself"===a.fill||"to"===a.fill.substr(0,2)&&!a._prevtrace),m[o]=a):a._prevtrace=a._nexttrace=a._ownfill=null;return d}},{}],943:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){t||(t=2);var r=e.marker,a=r.sizeref||1,i=r.sizemin||0,o="area"===r.sizemode?function(e){return Math.sqrt(e/a)}:function(e){return e/a};return function(e){var r=o(e/t);return n(r)&&r>0?Math.max(r,i):0}}},{"fast-isnumeric":190}],944:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],945:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,s,l,c){var u=o.isBubble(e),f=(e.line||{}).color;c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),a(e,"marker")&&i(e,t,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}},{"../../components/color":366,"../../components/colorscale/defaults":376,"../../components/colorscale/helpers":377,"./subtypes":951}],946:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":479,"../../lib":503}],947:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,s=i.identity,l=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),p=e("../../lib/polygon").tester;function h(e,t,r,f,h,d,m){var g;!function(e,t,r,a,o){var s=r.xaxis,l=r.yaxis,u=n.extent(i.simpleMap(s.range,s.r2c)),f=n.extent(i.simpleMap(l.range,l.r2c)),p=a[0].trace;if(c.hasMarkers(p)){var h=p.marker.maxdisplayed;if(0!==h){var d=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),m=Math.ceil(d.length/h),g=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<t&&g++}));var y=Math.round(g*m/3+Math.floor(g/3)*m/7.1);a.forEach((function(e){delete e.vis})),d.forEach((function(e,t){0===Math.round((t+y)%m)&&(e.vis=!0)}))}}}(0,t,r,f,h);var y=!!m&&m.duration>0;function v(e){return y?e.transition():e}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,k=n.select(d),D=o(k,"g","errorbars"),T=o(k,"g","lines"),A=o(k,"g","points"),S=o(k,"g","text");if(a.getComponentMethod("errorbars","plot")(e,D,r,m),!0===_.visible){var M,E;v(k).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=k;var N,O,I="",P=[],R=_._prevtrace;R&&(I=R._prevRevpath||"",E=R._nextFill,P=R._polygons);var L,F,B,z,j,U,$,V="",q="",W=[],H=i.noop;if(M=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(E&&E.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(L=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):L=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?l.smoothclosed(e.slice(1),w.smoothing):l.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},B=function(e){return F(e.reverse())},W=u(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),$=_._polygons=new Array(W.length),g=0;g<W.length;g++)_._polygons[g]=p(W[g]);W.length&&(z=W[0][0],U=(j=W[W.length-1])[j.length-1]),H=function(e){return function(t){if(N=L(t),O=B(t),V?C?(V+="L"+N.substr(1),q=O+"L"+q.substr(1)):(V+="Z"+N,q=O+"Z"+q):(V=N,q=O),c.hasLines(_)&&t.length>1){var r=n.select(this);if(r.datum(f),e)v(r.style("opacity",0).attr("d",N).call(l.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",N),l.singleLineStyle(f,a)}}}}}var G=T.selectAll(".js-line").data(W);v(G.exit()).style("opacity",0).remove(),G.each(H(!1)),G.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(H(!0)),l.setClipUrl(G,r.layerClipId,e),W.length?(M?(M.datum(f),z&&U&&(C?("y"===C?z[1]=U[1]=x.c2p(0,!0):"x"===C&&(z[0]=U[0]=b.c2p(0,!0)),v(M).attr("d","M"+U+"L"+z+"L"+V.substr(1)).call(l.singleFillStyle)):v(M).attr("d",V+"Z").call(l.singleFillStyle))):E&&("tonext"===_.fill.substr(0,6)&&V&&I?("tonext"===_.fill?v(E).attr("d",V+"Z"+I+"Z").call(l.singleFillStyle):v(E).attr("d",V+"L"+I.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(P)):(Y(E),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=$):(M?Y(M):E&&Y(E),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),S.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),p=c.hasText(u),h=function(e){if(e.ids)return Q}(u),d=ee,m=ee;if(f||p){var g=s,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?K:Z:_&&!w&&(g=J),f&&(d=g),p&&(m=g)}var k,D=(o=t.selectAll("path.point").data(d,h)).enter().append("path").classed("point",!0);y&&D.call(l.pointStyle,u,e).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(k=l.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=v(a);l.translatePoint(t,i,b,x)?(l.singlePointStyle(t,i,u,k,e),r.layerClipId&&l.hideOutsideRangePoint(t,i,b,x,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),y?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,h)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=v(t.select("text"));l.translatePoint(e,a,b,x)?r.layerClipId&&l.hideOutsideRangePoint(e,t,b,x,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(l.textPointStyle,u,e).each((function(e){var t=b.c2p(e.x),r=x.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,S,f);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(A,X,e),l.setClipUrl(S,X,e)}function Y(e){v(e).attr("d","M0,0Z")}function Z(e){return e.filter((function(e){return!e.gap&&e.vis}))}function K(e){return e.filter((function(e){return e.vis}))}function J(e){return e.filter((function(e){return!e.gap}))}function Q(e){return e.id}function ee(){return!1}}t.exports=function(e,t,r,a,i,c){var u,p,d=!i,m=!!i&&i.duration>0,g=f(e,t,r);(u=a.selectAll("g.trace").data(g,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),m?(c&&(p=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){p&&p()})).each("interrupt",(function(){p&&p()})).each((function(){a.selectAll("g.trace").each((function(r,n){h(e,n,t,r,g,this,i)}))}))):u.each((function(r,n){h(e,n,t,r,g,this,i)})),d&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":388,"../../lib":503,"../../lib/polygon":515,"../../registry":638,"./line_points":940,"./link_traces":942,"./subtypes":951,"@plotly/d3":58}],948:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,s=e.cd,l=e.xaxis,c=e.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)a=s[r],i=l.c2p(a.x),o=c.c2p(a.y),null!==a.i&&t.contains([i,o],!1,r,e)?(u.push({pointNumber:a.i,x:l.c2d(a.x),y:c.c2d(a.y)}),a.selected=1):a.selected=0;return u}},{"./subtypes":951}],949:[function(e,t,r){"use strict";var n=["orientation","groupnorm","stackgaps"];t.exports=function(e,t,r,a){var i=r._scatterStackOpts,o=a("stackgroup");if(o){var s=t.xaxis+t.yaxis,l=i[s];l||(l=i[s]={});var c=l[o],u=!1;c?c.traces.push(t):(c=l[o]={traceIndices:[],traces:[t]},u=!0);for(var f={orientation:t.x&&!t.y?"h":"v"},p=0;p<n.length;p++){var h=n[p],d=h+"Found";if(!c[d]){var m=void 0!==e[h],g="orientation"===h;if((m||u)&&(c[h]=a(h,f[h]),g&&(c.fillDflt="h"===c[h]?"tonextx":"tonexty"),m&&(c[d]=!0,!u&&(delete c.traces[0][h],g))))for(var y=0;y<c.traces.length-1;y++){var v=c.traces[y];v._input.fill!==v.fill&&(v.fill=c.fillDflt)}}}return c}}},{}],950:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../../registry");function o(e,t,r){a.pointStyle(e.selectAll("path.point"),t,r)}function s(e,t,r){a.textPointStyle(e.selectAll("text"),t,r)}t.exports={style:function(e){var t=n.select(e).selectAll("g.trace.scatter");t.style("opacity",(function(e){return e[0].trace.opacity})),t.selectAll("g.points").each((function(t){o(n.select(this),t.trace||t[0].trace,e)})),t.selectAll("g.text").each((function(t){s(n.select(this),t.trace||t[0].trace,e)})),t.selectAll("g.trace path.js-line").call(a.lineGroupStyle),t.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),i.getComponentMethod("errorbars","style")(t)},stylePoints:o,styleText:s,styleOnSelect:function(e,t,r){var n=t[0].trace;n.selectedpoints?(a.selectedPointStyle(r.selectAll("path.point"),n),a.selectedTextStyle(r.selectAll("text"),n)):(o(r,n,e),s(r,n,e))}}},{"../../components/drawing":388,"../../registry":638,"@plotly/d3":58}],951:[function(e,t,r){"use strict";var n=e("../../lib");t.exports={hasLines:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("lines")},hasMarkers:function(e){return e.visible&&(e.mode&&-1!==e.mode.indexOf("markers")||"splom"===e.type)},hasText:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("text")},isBubble:function(e){return n.isPlainObject(e.marker)&&n.isArrayOrTypedArray(e.marker.size)}}},{"../../lib":503}],952:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t,r,a,i){i=i||{},a("textposition"),n.coerceFont(a,"textfont",r.font),i.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))}},{"../../lib":503}],953:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");t.exports=function(e,t,r,i){var o,s=i("x"),l=i("y");if(a.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],r),s){var c=n.minRowLength(s);l?o=Math.min(c,n.minRowLength(l)):(o=c,i("y0"),i("dy"))}else{if(!l)return 0;o=n.minRowLength(l),i("x0"),i("dx")}return t._length=o,o}},{"../../lib":503,"../../registry":638}],954:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../components/colorscale/attributes"),i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=e("../../plots/template_attributes").hovertemplateAttrs,s=e("../../plots/template_attributes").texttemplateAttrs,l=e("../../plots/attributes"),c=e("../../constants/gl3d_dashes"),u=e("../../constants/gl3d_markers"),f=e("../../lib/extend").extendFlat,p=e("../../plot_api/edit_types").overrideAll,h=e("../../lib/sort_object_keys"),d=n.line,m=n.marker,g=m.line,y=f({width:d.width,dash:{valType:"enumerated",values:h(c),dflt:"solid"}},a("line")),v=t.exports=p({x:n.x,y:n.y,z:{valType:"data_array"},text:f({},n.text,{}),texttemplate:s({},{}),hovertext:f({},n.hovertext,{}),hovertemplate:o(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),mode:f({},n.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},y:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},z:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}},connectgaps:n.connectgaps,line:y,marker:f({symbol:{valType:"enumerated",values:h(u),dflt:"circle",arrayOk:!0},size:f({},m.size,{dflt:8}),sizeref:m.sizeref,sizemin:m.sizemin,sizemode:m.sizemode,opacity:f({},m.opacity,{arrayOk:!1}),colorbar:m.colorbar,line:f({width:f({},g.width,{arrayOk:!1})},a("marker.line"))},a("marker")),textposition:f({},n.textposition,{dflt:"top center"}),textfont:{color:n.textfont.color,size:n.textfont.size,family:f({},n.textfont.family,{arrayOk:!1})},opacity:l.opacity,hoverinfo:f({},l.hoverinfo)},"calc","nested");v.x.editType=v.y.editType=v.z.editType="calc+clearAxisTypes"},{"../../components/colorscale/attributes":373,"../../constants/gl3d_dashes":476,"../../constants/gl3d_markers":477,"../../lib/extend":493,"../../lib/sort_object_keys":526,"../../plot_api/edit_types":536,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../scatter/attributes":926}],955:[function(e,t,r){"use strict";var n=e("../scatter/arrays_to_calcdata"),a=e("../scatter/colorscale_calc");t.exports=function(e,t){var r=[{x:!1,y:!1,trace:t,t:{}}];return n(r,t),a(e,t),r}},{"../scatter/arrays_to_calcdata":925,"../scatter/colorscale_calc":929}],956:[function(e,t,r){"use strict";var n=e("../../registry");function a(e,t,r,a){if(!t||!t.visible)return null;for(var i=n.getComponentMethod("errorbars","makeComputeError")(t),o=new Array(e.length),s=0;s<e.length;s++){var l=i(+e[s],s);if("log"===a.type){var c=a.c2l(e[s]),u=e[s]-l[0],f=e[s]+l[1];if(o[s]=[(a.c2l(u,!0)-c)*r,(a.c2l(f,!0)-c)*r],u>0){var p=a.c2l(u);a._lowerLogErrorBound||(a._lowerLogErrorBound=p),a._lowerErrorBound=Math.min(a._lowerLogErrorBound,p)}}else o[s]=[-l[0]*r,l[1]*r]}return o}t.exports=function(e,t,r){var n=[a(e.x,e.error_x,t[0],r.xaxis),a(e.y,e.error_y,t[1],r.yaxis),a(e.z,e.error_z,t[2],r.zaxis)],i=function(e){for(var t=0;t<e.length;t++)if(e[t])return e[t].length;return 0}(n);if(0===i)return null;for(var o=new Array(i),s=0;s<i;s++){for(var l=[[0,0,0],[0,0,0]],c=0;c<3;c++)if(n[c])for(var u=0;u<2;u++)l[u][c]=n[c][s][u];o[s]=l}return o}},{"../../registry":638}],957:[function(e,t,r){"use strict";var n=e("../../../stackgl_modules").gl_line3d,a=e("../../../stackgl_modules").gl_scatter3d,i=e("../../../stackgl_modules").gl_error3d,o=e("../../../stackgl_modules").gl_mesh3d,s=e("../../../stackgl_modules").delaunay_triangulate,l=e("../../lib"),c=e("../../lib/str2rgbarray"),u=e("../../lib/gl_format_color").formatColor,f=e("../scatter/make_bubble_size_func"),p=e("../../constants/gl3d_dashes"),h=e("../../constants/gl3d_markers"),d=e("../../plots/cartesian/axes"),m=e("../../components/fx/helpers").appendArrayPointValue,g=e("./calc_errors");function y(e,t){this.scene=e,this.uid=t,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var v=y.prototype;function b(e){return null==e?0:e.indexOf("left")>-1?-1:e.indexOf("right")>-1?1:0}function x(e){return null==e?0:e.indexOf("top")>-1?-1:e.indexOf("bottom")>-1?1:0}function _(e,t){return t(4*e)}function w(e){return h[e]}function k(e,t,r,n,a){var i=null;if(l.isArrayOrTypedArray(e)){i=[];for(var o=0;o<t;o++)void 0===e[o]?i[o]=n:i[o]=r(e[o],a)}else i=r(e,l.identity);return i}function D(e,t){var r,n,a,i,o,s,p=[],h=e.fullSceneLayout,y=e.dataScale,v=h.xaxis,D=h.yaxis,T=h.zaxis,A=t.marker,S=t.line,M=t.x||[],E=t.y||[],C=t.z||[],N=M.length,O=t.xcalendar,I=t.ycalendar,P=t.zcalendar;for(o=0;o<N;o++)r=v.d2l(M[o],0,O)*y[0],n=D.d2l(E[o],0,I)*y[1],a=T.d2l(C[o],0,P)*y[2],p[o]=[r,n,a];if(Array.isArray(t.text))s=t.text;else if(void 0!==t.text)for(s=new Array(N),o=0;o<N;o++)s[o]=t.text;function R(e,t){var r=h[e];return d.tickText(r,r.d2l(t),!0).text}var L=t.texttemplate;if(L){var F=e.fullLayout._d3locale,B=Array.isArray(L),z=B?Math.min(L.length,N):N,j=B?function(e){return L[e]}:function(){return L};for(s=new Array(z),o=0;o<z;o++){var U={x:M[o],y:E[o],z:C[o]},$={xLabel:R("xaxis",M[o]),yLabel:R("yaxis",E[o]),zLabel:R("zaxis",C[o])},V={};m(V,t,o);var q=t._meta||{};s[o]=l.texttemplateString(j(o),$,F,V,U,q)}}if(i={position:p,mode:t.mode,text:s},"line"in t&&(i.lineColor=u(S,1,N),i.lineWidth=S.width,i.lineDashes=S.dash),"marker"in t){var W=f(t);i.scatterColor=u(A,1,N),i.scatterSize=k(A.size,N,_,20,W),i.scatterMarker=k(A.symbol,N,w,"●"),i.scatterLineWidth=A.line.width,i.scatterLineColor=u(A.line,1,N),i.scatterAngle=0}"textposition"in t&&(i.textOffset=function(e){var t=[0,0];if(Array.isArray(e))for(var r=0;r<e.length;r++)t[r]=[0,0],e[r]&&(t[r][0]=b(e[r]),t[r][1]=x(e[r]));else t[0]=b(e),t[1]=x(e);return t}(t.textposition),i.textColor=u(t.textfont,1,N),i.textSize=k(t.textfont.size,N,l.identity,12),i.textFont=t.textfont.family,i.textAngle=0);var H=["x","y","z"];for(i.project=[!1,!1,!1],i.projectScale=[1,1,1],i.projectOpacity=[1,1,1],o=0;o<3;++o){var G=t.projection[H[o]];(i.project[o]=G.show)&&(i.projectOpacity[o]=G.opacity,i.projectScale[o]=G.scale)}i.errorBounds=g(t,y,h);var X=function(e){for(var t=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[1,1,1],a=0;a<3;a++){var i=e[a];i&&!1!==i.copy_zstyle&&!1!==e[2].visible&&(i=e[2]),i&&i.visible&&(t[a]=i.width/2,r[a]=c(i.color),n[a]=i.thickness)}return{capSize:t,color:r,lineWidth:n}}([t.error_x,t.error_y,t.error_z]);return i.errorColor=X.color,i.errorLineWidth=X.lineWidth,i.errorCapSize=X.capSize,i.delaunayAxis=t.surfaceaxis,i.delaunayColor=c(t.surfacecolor),i}function T(e){if(l.isArrayOrTypedArray(e)){var t=e[0];return l.isArrayOrTypedArray(t)&&(e=t),"rgb("+e.slice(0,3).map((function(e){return Math.round(255*e)}))+")"}return null}function A(e){return l.isArrayOrTypedArray(e)?4===e.length&&"number"==typeof e[0]?T(e):e.map(T):null}v.handlePick=function(e){if(e.object&&(e.object===this.linePlot||e.object===this.delaunayMesh||e.object===this.textMarkers||e.object===this.scatterPlot)){var t=e.index=e.data.index;return e.object.highlight&&e.object.highlight(null),this.scatterPlot&&(e.object=this.scatterPlot,this.scatterPlot.highlight(e.data)),e.textLabel="",this.textLabels&&(Array.isArray(this.textLabels)?(this.textLabels[t]||0===this.textLabels[t])&&(e.textLabel=this.textLabels[t]):e.textLabel=this.textLabels),e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]],!0}},v.update=function(e){var t,r,l,c,u=this.scene.glplot.gl,f=p.solid;this.data=e;var h=D(this.scene,e);"mode"in h&&(this.mode=h.mode),"lineDashes"in h&&h.lineDashes in p&&(f=p[h.lineDashes]),this.color=A(h.scatterColor)||A(h.lineColor),this.dataPoints=h.position,t={gl:this.scene.glplot.gl,position:h.position,color:h.lineColor,lineWidth:h.lineWidth||1,dashes:f[0],dashScale:f[1],opacity:e.opacity,connectGaps:e.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(t):(this.linePlot=n(t),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var d=e.opacity;if(e.marker&&e.marker.opacity&&(d*=e.marker.opacity),r={gl:this.scene.glplot.gl,position:h.position,color:h.scatterColor,size:h.scatterSize,glyph:h.scatterMarker,opacity:d,orthographic:!0,lineWidth:h.scatterLineWidth,lineColor:h.scatterLineColor,project:h.project,projectScale:h.projectScale,projectOpacity:h.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=a(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),c={gl:this.scene.glplot.gl,position:h.position,glyph:h.text,color:h.textColor,size:h.textSize,angle:h.textAngle,alignment:h.textOffset,font:h.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:e.opacity},this.textLabels=e.hovertext||e.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(c):(this.textMarkers=a(c),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),l={gl:this.scene.glplot.gl,position:h.position,color:h.errorColor,error:h.errorBounds,lineWidth:h.errorLineWidth,capSize:h.errorCapSize,opacity:e.opacity},this.errorBars?h.errorBounds?this.errorBars.update(l):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):h.errorBounds&&(this.errorBars=i(l),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),h.delaunayAxis>=0){var m=function(e,t,r){var n,a=(r+1)%3,i=(r+2)%3,o=[],l=[];for(n=0;n<e.length;++n){var c=e[n];!isNaN(c[a])&&isFinite(c[a])&&!isNaN(c[i])&&isFinite(c[i])&&(o.push([c[a],c[i]]),l.push(n))}var u=s(o);for(n=0;n<u.length;++n)for(var f=u[n],p=0;p<f.length;++p)f[p]=l[f[p]];return{positions:e,cells:u,meshColor:t}}(h.position,h.delaunayColor,h.delaunayAxis);m.opacity=e.opacity,this.delaunayMesh?this.delaunayMesh.update(m):(m.gl=u,this.delaunayMesh=o(m),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},v.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},t.exports=function(e,t){var r=new y(e,t.uid);return r.update(t),r}},{"../../../stackgl_modules":1120,"../../components/fx/helpers":402,"../../constants/gl3d_dashes":476,"../../constants/gl3d_markers":477,"../../lib":503,"../../lib/gl_format_color":499,"../../lib/str2rgbarray":528,"../../plots/cartesian/axes":554,"../scatter/make_bubble_size_func":943,"./calc_errors":956}],958:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../scatter/subtypes"),o=e("../scatter/marker_defaults"),s=e("../scatter/line_defaults"),l=e("../scatter/text_defaults"),c=e("./attributes");t.exports=function(e,t,r,u){function f(r,n){return a.coerce(e,t,c,r,n)}if(function(e,t,r,a){var i=0,o=r("x"),s=r("y"),l=r("z");return n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],a),o&&s&&l&&(i=Math.min(o.length,s.length,l.length),t._length=t._xlength=t._ylength=t._zlength=i),i}(e,t,f,u)){f("text"),f("hovertext"),f("hovertemplate"),f("xhoverformat"),f("yhoverformat"),f("zhoverformat"),f("mode"),i.hasLines(t)&&(f("connectgaps"),s(e,t,r,u,f)),i.hasMarkers(t)&&o(e,t,r,u,f,{noSelect:!0}),i.hasText(t)&&(f("texttemplate"),l(e,t,u,f,{noSelect:!0}));var p=(t.line||{}).color,h=(t.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",p||h);for(var d=["x","y","z"],m=0;m<3;++m){var g="projection."+d[m];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}var y=n.getComponentMethod("errorbars","supplyDefaults");y(e,t,p||h||r,{axis:"z"}),y(e,t,p||h||r,{axis:"y",inherit:"z"}),y(e,t,p||h||r,{axis:"x",inherit:"z"})}else t.visible=!1}},{"../../lib":503,"../../registry":638,"../scatter/line_defaults":939,"../scatter/marker_defaults":945,"../scatter/subtypes":951,"../scatter/text_defaults":952,"./attributes":954}],959:[function(e,t,r){"use strict";t.exports={plot:e("./convert"),attributes:e("./attributes"),markerSymbols:e("../../constants/gl3d_markers"),supplyDefaults:e("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:e("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:e("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":477,"../../plots/gl3d":598,"./attributes":954,"./calc":955,"./convert":957,"./defaults":958}],960:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../plots/attributes"),i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../../plots/template_attributes").texttemplateAttrs,s=e("../../components/colorscale/attributes"),l=e("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;t.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},a.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:i()}},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/template_attributes":633,"../scatter/attributes":926}],961:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../scatter/colorscale_calc"),i=e("../scatter/arrays_to_calcdata"),o=e("../scatter/calc_selection"),s=e("../scatter/calc").calcMarkerSize,l=e("../carpet/lookup_carpetid");t.exports=function(e,t){var r=t._carpetTrace=l(e,t);if(r&&r.visible&&"legendonly"!==r.visible){var c;t.xaxis=r.xaxis,t.yaxis=r.yaxis;var u,f,p=t._length,h=new Array(p),d=!1;for(c=0;c<p;c++)if(u=t.a[c],f=t.b[c],n(u)&&n(f)){var m=r.ab2xy(+u,+f,!0),g=r.isVisible(+u,+f);g||(d=!0),h[c]={x:m[0],y:m[1],a:u,b:f,vis:g}}else h[c]={x:!1,y:!1};return t._needsCull=d,h[0].carpet=r,h[0].trace=t,s(t,p),a(e,t),i(h,t),o(h,t),h}}},{"../carpet/lookup_carpetid":708,"../scatter/arrays_to_calcdata":925,"../scatter/calc":927,"../scatter/calc_selection":928,"../scatter/colorscale_calc":929,"fast-isnumeric":190}],962:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../scatter/constants"),i=e("../scatter/subtypes"),o=e("../scatter/marker_defaults"),s=e("../scatter/line_defaults"),l=e("../scatter/line_shape_defaults"),c=e("../scatter/text_defaults"),u=e("../scatter/fillcolor_defaults"),f=e("./attributes");t.exports=function(e,t,r,p){function h(r,a){return n.coerce(e,t,f,r,a)}h("carpet"),t.xaxis="x",t.yaxis="y";var d=h("a"),m=h("b"),g=Math.min(d.length,m.length);if(g){t._length=g,h("text"),h("texttemplate"),h("hovertext"),h("mode",g<a.PTS_LINESONLY?"lines+markers":"lines"),i.hasLines(t)&&(s(e,t,r,p,h),l(e,t,h),h("connectgaps")),i.hasMarkers(t)&&o(e,t,r,p,h,{gradient:!0}),i.hasText(t)&&c(e,t,p,h);var y=[];(i.hasMarkers(t)||i.hasText(t))&&(h("marker.maxdisplayed"),y.push("points")),h("fill"),"none"!==t.fill&&(u(e,t,r,h),i.hasLines(t)||l(e,t,h)),"tonext"!==t.fill&&"toself"!==t.fill||y.push("fills"),"fills"!==h("hoveron",y.join("+")||"points")&&h("hovertemplate"),n.coerceSelectionMarkerOpacity(t,h)}else t.visible=!1}},{"../../lib":503,"../scatter/constants":930,"../scatter/fillcolor_defaults":934,"../scatter/line_defaults":939,"../scatter/line_shape_defaults":941,"../scatter/marker_defaults":945,"../scatter/subtypes":951,"../scatter/text_defaults":952,"./attributes":960}],963:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a){var i=n[a];return e.a=i.a,e.b=i.b,e.y=i.y,e}},{}],964:[function(e,t,r){"use strict";t.exports=function(e,t){var r={},n=t._carpet,a=n.ab2ij([e.a,e.b]),i=Math.floor(a[0]),o=a[0]-i,s=Math.floor(a[1]),l=a[1]-s,c=n.evalxy([],i,s,o,l);return r.yLabel=c[1].toFixed(3),r}},{}],965:[function(e,t,r){"use strict";var n=e("../scatter/hover"),a=e("../../lib").fillText;t.exports=function(e,t,r,i){var o=n(e,t,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/e.ya._length,c=e.xa._length,u=c*l/2,f=c-u;return s.x0=Math.max(Math.min(s.x0,f),u),s.x1=Math.max(Math.min(s.x1,f),u),o}var p=s.cd[s.index];s.a=p.a,s.b=p.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var h=s.trace,d=h._carpet,m=h._module.formatLabels(p,h);s.yLabel=m.yLabel,delete s.text;var g=[];if(!h.hovertemplate){var y=(p.hi||h.hoverinfo).split("+");-1!==y.indexOf("all")&&(y=["a","b","text"]),-1!==y.indexOf("a")&&v(d.aaxis,p.a),-1!==y.indexOf("b")&&v(d.baxis,p.b),g.push("y: "+s.yLabel),-1!==y.indexOf("text")&&a(p,h,g),s.extraText=g.join("<br>")}return o}function v(e,t){var r;r=e.labelprefix&&e.labelprefix.length>0?e.labelprefix.replace(/ = $/,""):e._hovertitle,g.push(r+": "+t.toFixed(3)+e.labelsuffix)}}},{"../../lib":503,"../scatter/hover":937}],966:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../scatter/select"),eventData:e("./event_data"),moduleType:"trace",name:"scattercarpet",basePlotModule:e("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":568,"../scatter/marker_colorbar":944,"../scatter/select":948,"../scatter/style":950,"./attributes":960,"./calc":961,"./defaults":962,"./event_data":963,"./format_labels":964,"./hover":965,"./plot":967}],967:[function(e,t,r){"use strict";var n=e("../scatter/plot"),a=e("../../plots/cartesian/axes"),i=e("../../components/drawing");t.exports=function(e,t,r,o){var s,l,c,u=r[0][0].carpet,f={xaxis:a.getFromId(e,u.xaxis||"x"),yaxis:a.getFromId(e,u.yaxis||"y"),plot:t.plot};for(n(e,f,r,o),s=0;s<r.length;s++)l=r[s][0].trace,c=o.selectAll("g.trace"+l.uid+" .js-line"),i.setClipUrl(c,r[s][0].carpet._clipPathId,e)}},{"../../components/drawing":388,"../../plots/cartesian/axes":554,"../scatter/plot":947}],968:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../../plots/template_attributes").texttemplateAttrs,i=e("../scatter/attributes"),o=e("../../plots/attributes"),s=e("../../components/colorscale/attributes"),l=e("../../components/drawing/attributes").dash,c=e("../../lib/extend").extendFlat,u=e("../../plot_api/edit_types").overrideAll,f=i.marker,p=i.line,h=f.line;t.exports=u({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:c({},i.mode,{dflt:"markers"}),text:c({},i.text,{}),texttemplate:a({editType:"plot"},{keys:["lat","lon","location","text"]}),hovertext:c({},i.hovertext,{}),textfont:i.textfont,textposition:i.textposition,line:{color:p.color,width:p.width,dash:l},connectgaps:i.connectgaps,marker:c({symbol:f.symbol,opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,colorbar:f.colorbar,line:c({width:h.width},s("marker.line")),gradient:f.gradient},s("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:i.fillcolor,selected:i.selected,unselected:i.unselected,hoverinfo:c({},o.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:n()},"calc","nested")},{"../../components/colorscale/attributes":373,"../../components/drawing/attributes":387,"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plots/attributes":550,"../../plots/template_attributes":633,"../scatter/attributes":926}],969:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,i=e("../scatter/colorscale_calc"),o=e("../scatter/arrays_to_calcdata"),s=e("../scatter/calc_selection"),l=e("../../lib")._;function c(e){return e&&"string"==typeof e}t.exports=function(e,t){var r,u=Array.isArray(t.locations),f=u?t.locations.length:t._length,p=new Array(f);r=t.geojson?function(e){return c(e)||n(e)}:c;for(var h=0;h<f;h++){var d=p[h]={};if(u){var m=t.locations[h];d.loc=r(m)?m:null}else{var g=t.lon[h],y=t.lat[h];n(g)&&n(y)?d.lonlat=[+g,+y]:d.lonlat=[a,a]}}return o(p,t),i(e,t),s(p,t),f&&(p[0].t={labels:{lat:l(e,"lat:")+" ",lon:l(e,"lon:")+" "}}),p}},{"../../constants/numerical":479,"../../lib":503,"../scatter/arrays_to_calcdata":925,"../scatter/calc_selection":928,"../scatter/colorscale_calc":929,"fast-isnumeric":190}],970:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../scatter/subtypes"),i=e("../scatter/marker_defaults"),o=e("../scatter/line_defaults"),s=e("../scatter/text_defaults"),l=e("../scatter/fillcolor_defaults"),c=e("./attributes");t.exports=function(e,t,r,u){function f(r,a){return n.coerce(e,t,c,r,a)}var p,h=f("locations");if(h&&h.length){var d,m=f("geojson");("string"==typeof m&&""!==m||n.isPlainObject(m))&&(d="geojson-id"),"geojson-id"===f("locationmode",d)&&f("featureidkey"),p=h.length}else{var g=f("lon")||[],y=f("lat")||[];p=Math.min(g.length,y.length)}p?(t._length=p,f("text"),f("hovertext"),f("hovertemplate"),f("mode"),a.hasLines(t)&&(o(e,t,r,u,f),f("connectgaps")),a.hasMarkers(t)&&i(e,t,r,u,f,{gradient:!0}),a.hasText(t)&&(f("texttemplate"),s(e,t,u,f)),f("fill"),"none"!==t.fill&&l(e,t,r,f),n.coerceSelectionMarkerOpacity(t,f)):t.visible=!1}},{"../../lib":503,"../scatter/fillcolor_defaults":934,"../scatter/line_defaults":939,"../scatter/marker_defaults":945,"../scatter/subtypes":951,"../scatter/text_defaults":952,"./attributes":968}],971:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a){e.lon=t.lon,e.lat=t.lat,e.location=t.loc?t.loc:null;var i=n[a];return i.fIn&&i.fIn.properties&&(e.properties=i.fIn.properties),e}},{}],972:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes");t.exports=function(e,t,r){var a={},i=r[t.geo]._subplot.mockAxis,o=e.lonlat;return a.lonLabel=n.tickText(i,i.c2l(o[0]),!0).text,a.latLabel=n.tickText(i,i.c2l(o[1]),!0).text,a}},{"../../plots/cartesian/axes":554}],973:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../constants/numerical").BADNUM,i=e("../scatter/get_trace_color"),o=e("../../lib").fillText,s=e("./attributes");t.exports=function(e,t,r){var l=e.cd,c=l[0].trace,u=e.xa,f=e.ya,p=e.subplot,h=p.projection.isLonLatOverEdges,d=p.project;if(n.getClosest(l,(function(e){var n=e.lonlat;if(n[0]===a)return 1/0;if(h(n))return 1/0;var i=d(n),o=d([t,r]),s=Math.abs(i[0]-o[0]),l=Math.abs(i[1]-o[1]),c=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(s*s+l*l)-c,1-3/c)}),e),!1!==e.index){var m=l[e.index],g=m.lonlat,y=[u.c2p(g),f.c2p(g)],v=m.mrc||1;e.x0=y[0]-v,e.x1=y[0]+v,e.y0=y[1]-v,e.y1=y[1]+v,e.loc=m.loc,e.lon=g[0],e.lat=g[1];var b={};b[c.geo]={_subplot:p};var x=c._module.formatLabels(m,c,b);return e.lonLabel=x.lonLabel,e.latLabel=x.latLabel,e.color=i(c,m),e.extraText=function(e,t,r,n){if(!e.hovertemplate){var a=t.hi||e.hoverinfo,i="all"===a?s.hoverinfo.flags:a.split("+"),l=-1!==i.indexOf("location")&&Array.isArray(e.locations),c=-1!==i.indexOf("lon"),u=-1!==i.indexOf("lat"),f=-1!==i.indexOf("text"),p=[];return l?p.push(t.loc):c&&u?p.push("("+h(r.latLabel)+", "+h(r.lonLabel)+")"):c?p.push(n.lon+h(r.lonLabel)):u&&p.push(n.lat+h(r.latLabel)),f&&o(t,e,p),p.join("<br>")}function h(e){return e+"°"}}(c,m,e,l[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}}},{"../../components/fx":406,"../../constants/numerical":479,"../../lib":503,"../scatter/get_trace_color":936,"./attributes":968}],974:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:e("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":589,"../scatter/marker_colorbar":944,"../scatter/style":950,"./attributes":968,"./calc":969,"./defaults":970,"./event_data":971,"./format_labels":972,"./hover":973,"./plot":975,"./select":976,"./style":977}],975:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../lib/topojson_utils").getTopojsonFeatures,o=e("../../lib/geojson_utils"),s=e("../../lib/geo_location_utils"),l=e("../../plots/cartesian/autorange").findExtremes,c=e("../../constants/numerical").BADNUM,u=e("../scatter/calc").calcMarkerSize,f=e("../scatter/subtypes"),p=e("./style");t.exports={calcGeoJSON:function(e,t){var r,n,a=e[0].trace,o=t[a.geo],f=o._subplot,p=a._length;if(Array.isArray(a.locations)){var h=a.locationmode,d="geojson-id"===h?s.extractTraceFeature(e):i(a,f.topojson);for(r=0;r<p;r++){n=e[r];var m="geojson-id"===h?n.fOut:s.locationToFeature(h,n.loc,d);n.lonlat=m?m.properties.ct:[c,c]}}var g,y,v={padded:!0};if("geojson"===o.fitbounds&&"geojson-id"===a.locationmode){var b=s.computeBbox(s.getTraceGeojson(a));g=[b[0],b[2]],y=[b[1],b[3]]}else{for(g=new Array(p),y=new Array(p),r=0;r<p;r++)n=e[r],g[r]=n.lonlat[0],y[r]=n.lonlat[1];v.ppad=u(a,p)}a._extremes.lon=l(o.lonaxis._ax,g,v),a._extremes.lat=l(o.lataxis._ax,y,v)},plot:function(e,t,r){var i=t.layers.frontplot.select(".scatterlayer"),s=a.makeTraceGroups(i,r,"trace scattergeo");function l(e,t){e.lonlat[0]===c&&n.select(t).remove()}s.selectAll("*").remove(),s.each((function(t){var r=n.select(this),i=t[0].trace;if(f.hasLines(i)||"none"!==i.fill){var s=o.calcTraceToLineCoords(t),c="none"!==i.fill?o.makePolygon(s):o.makeLine(s);r.selectAll("path.js-line").data([{geojson:c,trace:i}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}f.hasMarkers(i)&&r.selectAll("path.point").data(a.identity).enter().append("path").classed("point",!0).each((function(e){l(e,this)})),f.hasText(i)&&r.selectAll("g").data(a.identity).enter().append("g").append("text").each((function(e){l(e,this)})),p(e,t)}))}}},{"../../constants/numerical":479,"../../lib":503,"../../lib/geo_location_utils":496,"../../lib/geojson_utils":497,"../../lib/topojson_utils":532,"../../plots/cartesian/autorange":553,"../scatter/calc":927,"../scatter/subtypes":951,"./style":977,"@plotly/d3":58}],976:[function(e,t,r){"use strict";var n=e("../scatter/subtypes"),a=e("../../constants/numerical").BADNUM;t.exports=function(e,t){var r,i,o,s,l,c=e.cd,u=e.xaxis,f=e.yaxis,p=[],h=c[0].trace;if(!n.hasMarkers(h)&&!n.hasText(h))return[];if(!1===t)for(l=0;l<c.length;l++)c[l].selected=0;else for(l=0;l<c.length;l++)(i=(r=c[l]).lonlat)[0]!==a&&(o=u.c2p(i),s=f.c2p(i),t.contains([o,s],null,l,e)?(p.push({pointNumber:l,lon:i[0],lat:i[1]}),r.selected=1):r.selected=0);return p}},{"../../constants/numerical":479,"../scatter/subtypes":951}],977:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../../components/color"),o=e("../scatter/style"),s=o.stylePoints,l=o.styleText;t.exports=function(e,t){t&&function(e,t){var r=t[0].trace,o=t[0].node3;o.style("opacity",t[0].trace.opacity),s(o,r,e),l(o,r,e),o.selectAll("path.js-line").style("fill","none").each((function(e){var t=n.select(this),r=e.trace,o=r.line||{};t.call(i.stroke,o.color).call(a.dashLine,o.dash||"",o.width||0),"none"!==r.fill&&t.call(i.fill,r.fillcolor)}))}(e,t)}},{"../../components/color":366,"../../components/drawing":388,"../scatter/style":950,"@plotly/d3":58}],978:[function(e,t,r){"use strict";var n=e("../../plots/attributes"),a=e("../scatter/attributes"),i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=e("../../components/colorscale/attributes"),s=e("../../lib/sort_object_keys"),l=e("../../lib/extend").extendFlat,c=e("../../plot_api/edit_types").overrideAll,u=e("./constants").DASHES,f=a.line,p=a.marker,h=p.line,d=t.exports=c({x:a.x,x0:a.x0,dx:a.dx,y:a.y,y0:a.y0,dy:a.dy,xperiod:a.xperiod,yperiod:a.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:a.xperiodalignment,yperiodalignment:a.yperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),text:a.text,hovertext:a.hovertext,textposition:a.textposition,textfont:a.textfont,mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:f.color,width:f.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:s(u),dflt:"solid"}},marker:l({},o("marker"),{symbol:p.symbol,size:p.size,sizeref:p.sizeref,sizemin:p.sizemin,sizemode:p.sizemode,opacity:p.opacity,colorbar:p.colorbar,line:l({},o("marker.line"),{width:h.width})}),connectgaps:a.connectgaps,fill:l({},a.fill,{dflt:"none"}),fillcolor:a.fillcolor,selected:{marker:a.selected.marker,textfont:a.selected.textfont},unselected:{marker:a.unselected.marker,textfont:a.unselected.textfont},opacity:n.opacity},"calc","nested");d.x.editType=d.y.editType=d.x0.editType=d.y0.editType="calc+clearAxisTypes",d.hovertemplate=a.hovertemplate,d.texttemplate=a.texttemplate},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../lib/sort_object_keys":526,"../../plot_api/edit_types":536,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../scatter/attributes":926,"./constants":980}],979:[function(e,t,r){"use strict";var n=e("@plotly/point-cluster"),a=e("../../lib"),i=e("../../plots/cartesian/axis_ids"),o=e("../../plots/cartesian/autorange").findExtremes,s=e("../../plots/cartesian/align_period"),l=e("../scatter/calc"),c=l.calcMarkerSize,u=l.calcAxisExpansion,f=l.setFirstScatter,p=e("../scatter/colorscale_calc"),h=e("./convert"),d=e("./scene_update"),m=e("../../constants/numerical").BADNUM,g=e("./constants").TOO_MANY_POINTS;function y(e,t,r){var n=e._extremes[t._id],a=o(t,r._bnds,{padded:!0});n.min=n.min.concat(a.min),n.max=n.max.concat(a.max)}t.exports=function(e,t){var r,o=e._fullLayout,l=i.getFromId(e,t.xaxis),v=i.getFromId(e,t.yaxis),b=o._plots[t.xaxis+t.yaxis],x=t._length,_=x>=g,w=2*x,k={},D=l.makeCalcdata(t,"x"),T=v.makeCalcdata(t,"y"),A=s(t,l,"x",D),S=s(t,v,"y",T),M=A.vals,E=S.vals;t._x=M,t._y=E,t.xperiodalignment&&(t._origX=D,t._xStarts=A.starts,t._xEnds=A.ends),t.yperiodalignment&&(t._origY=T,t._yStarts=S.starts,t._yEnds=S.ends);var C=new Array(w),N=new Array(x);for(r=0;r<x;r++)C[2*r]=M[r]===m?NaN:M[r],C[2*r+1]=E[r]===m?NaN:E[r],N[r]=r;if("log"===l.type)for(r=0;r<w;r+=2)C[r]=l.c2l(C[r]);if("log"===v.type)for(r=1;r<w;r+=2)C[r]=v.c2l(C[r]);_&&"log"!==l.type&&"log"!==v.type?k.tree=n(C):k.ids=N,p(e,t);var O,I=function(e,t,r,n,i,o){var s=h.style(e,r);if(s.marker&&(s.marker.positions=n),s.line&&n.length>1&&a.extendFlat(s.line,h.linePositions(e,r,n)),s.errorX||s.errorY){var l=h.errorBarPositions(e,r,n,i,o);s.errorX&&a.extendFlat(s.errorX,l.x),s.errorY&&a.extendFlat(s.errorY,l.y)}return s.text&&(a.extendFlat(s.text,{positions:n},h.textPosition(e,r,s.text,s.marker)),a.extendFlat(s.textSel,{positions:n},h.textPosition(e,r,s.text,s.markerSel)),a.extendFlat(s.textUnsel,{positions:n},h.textPosition(e,r,s.text,s.markerUnsel))),s}(e,0,t,C,M,E),P=d(e,b);return f(o,t),_?I.marker&&(O=I.marker.sizeAvg||Math.max(I.marker.size,3)):O=c(t,x),u(e,t,l,v,M,E,O),I.errorX&&y(t,l,I.errorX),I.errorY&&y(t,v,I.errorY),I.fill&&!P.fill2d&&(P.fill2d=!0),I.marker&&!P.scatter2d&&(P.scatter2d=!0),I.line&&!P.line2d&&(P.line2d=!0),!I.errorX&&!I.errorY||P.error2d||(P.error2d=!0),I.text&&!P.glText&&(P.glText=!0),I.marker&&(I.marker.snap=x),P.lineOptions.push(I.line),P.errorXOptions.push(I.errorX),P.errorYOptions.push(I.errorY),P.fillOptions.push(I.fill),P.markerOptions.push(I.marker),P.markerSelectedOptions.push(I.markerSel),P.markerUnselectedOptions.push(I.markerUnsel),P.textOptions.push(I.text),P.textSelectedOptions.push(I.textSel),P.textUnselectedOptions.push(I.textUnsel),P.selectBatch.push([]),P.unselectBatch.push([]),k._scene=P,k.index=P.count,k.x=M,k.y=E,k.positions=C,P.count++,[{x:!1,y:!1,t:k,trace:t}]}},{"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/align_period":551,"../../plots/cartesian/autorange":553,"../../plots/cartesian/axis_ids":558,"../scatter/calc":927,"../scatter/colorscale_calc":929,"./constants":980,"./convert":981,"./scene_update":989,"@plotly/point-cluster":59}],980:[function(e,t,r){"use strict";t.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],981:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("svg-path-sdf"),i=e("color-normalize"),o=e("../../registry"),s=e("../../lib"),l=e("../../components/drawing"),c=e("../../plots/cartesian/axis_ids"),u=e("../../lib/gl_format_color").formatColor,f=e("../scatter/subtypes"),p=e("../scatter/make_bubble_size_func"),h=e("./helpers"),d=e("./constants"),m=e("../../constants/interactions").DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=e("../../components/fx/helpers").appendArrayPointValue;function v(e,t){var r,a=e._fullLayout,i=t._length,o=t.textfont,l=t.textposition,c=Array.isArray(l)?l:[l],u=o.color,f=o.size,p=o.family,h={},d=e._context.plotGlPixelRatio,m=t.texttemplate;if(m){h.text=[];var g=a._d3locale,v=Array.isArray(m),b=v?Math.min(m.length,i):i,x=v?function(e){return m[e]}:function(){return m};for(r=0;r<b;r++){var _={i:r},w=t._module.formatLabels(_,t,a),k={};y(k,t,r);var D=t._meta||{};h.text.push(s.texttemplateString(x(r),w,g,k,_,D))}}else Array.isArray(t.text)&&t.text.length<i?h.text=t.text.slice():h.text=t.text;if(Array.isArray(h.text))for(r=h.text.length;r<i;r++)h.text[r]="";for(h.opacity=t.opacity,h.font={},h.align=[],h.baseline=[],r=0;r<c.length;r++){var T=c[r].split(/\s+/);switch(T[1]){case"left":h.align.push("right");break;case"right":h.align.push("left");break;default:h.align.push(T[1])}switch(T[0]){case"top":h.baseline.push("bottom");break;case"bottom":h.baseline.push("top");break;default:h.baseline.push(T[0])}}if(Array.isArray(u))for(h.color=new Array(i),r=0;r<i;r++)h.color[r]=u[r];else h.color=u;if(s.isArrayOrTypedArray(f)||Array.isArray(p))for(h.font=new Array(i),r=0;r<i;r++){var A=h.font[r]={};A.size=(s.isTypedArray(f)?f[r]:Array.isArray(f)?n(f[r])?f[r]:0:f)*d,A.family=Array.isArray(p)?p[r]:p}else h.font={size:f*d,family:p};return h}function b(e){var t,r,n=e._length,a=e.marker,o={},l=s.isArrayOrTypedArray(a.symbol),c=s.isArrayOrTypedArray(a.color),f=s.isArrayOrTypedArray(a.line.color),d=s.isArrayOrTypedArray(a.opacity),m=s.isArrayOrTypedArray(a.size),g=s.isArrayOrTypedArray(a.line.width);if(l||(r=h.isOpenSymbol(a.symbol)),l||c||f||d){o.colors=new Array(n),o.borderColors=new Array(n);var y=u(a,a.opacity,n),v=u(a.line,a.opacity,n);if(!Array.isArray(v[0])){var b=v;for(v=Array(n),t=0;t<n;t++)v[t]=b}if(!Array.isArray(y[0])){var x=y;for(y=Array(n),t=0;t<n;t++)y[t]=x}for(o.colors=y,o.borderColors=v,t=0;t<n;t++){if(l){var _=a.symbol[t];r=h.isOpenSymbol(_)}r&&(v[t]=y[t].slice(),y[t]=y[t].slice(),y[t][3]=0)}o.opacity=e.opacity}else r?(o.color=i(a.color,"uint8"),o.color[3]=0,o.borderColor=i(a.color,"uint8")):(o.color=i(a.color,"uint8"),o.borderColor=i(a.line.color,"uint8")),o.opacity=e.opacity*a.opacity;if(l)for(o.markers=new Array(n),t=0;t<n;t++)o.markers[t]=M(a.symbol[t]);else o.marker=M(a.symbol);var w,k=p(e,1);if(m||g){var D,T=o.sizes=new Array(n),A=o.borderSizes=new Array(n),S=0;if(m){for(t=0;t<n;t++)T[t]=k(a.size[t]),S+=T[t];D=S/n}else for(w=k(a.size),t=0;t<n;t++)T[t]=w;if(g)for(t=0;t<n;t++)A[t]=a.line.width[t];else for(w=a.line.width,t=0;t<n;t++)A[t]=w;o.sizeAvg=D}else o.size=k(a&&a.size||10),o.borderSizes=k(a.line.width);return o}function x(e,t){var r=e.marker,n={};return t?(t.marker&&t.marker.symbol?n=b(s.extendFlat({},r,t.marker)):t.marker&&(t.marker.size&&(n.size=t.marker.size),t.marker.color&&(n.colors=t.marker.color),void 0!==t.marker.opacity&&(n.opacity=t.marker.opacity)),n):n}function _(e,t,r){var n={};if(!r)return n;if(r.textfont){var a={opacity:1,text:t.text,texttemplate:t.texttemplate,textposition:t.textposition,textfont:s.extendFlat({},t.textfont)};r.textfont&&s.extendFlat(a.textfont,r.textfont),n=v(e,a)}return n}function w(e,t,r){var n={capSize:2*t.width*r,lineWidth:t.thickness*r,color:t.color};return t.copy_ystyle&&(n=e.error_y),n}var k=d.SYMBOL_SDF_SIZE,D=d.SYMBOL_SIZE,T=d.SYMBOL_STROKE,A={},S=l.symbolFuncs[0](.05*D);function M(e){if("circle"===e)return null;var t,r,n=l.symbolNumber(e),i=l.symbolFuncs[n%100],o=!!l.symbolNoDot[n%100],s=!!l.symbolNoFill[n%100],c=h.isDotSymbol(e);return A[e]?A[e]:(t=c&&!o?i(1.1*D)+S:i(D),r=a(t,{w:k,h:k,viewBox:[-D,-D,D,D],stroke:s?T:-T}),A[e]=r,r||null)}t.exports={style:function(e,t){var r,n={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},a=e._context.plotGlPixelRatio;if(!0!==t.visible)return n;if(f.hasText(t)&&(n.text=v(e,t),n.textSel=_(e,t,t.selected),n.textUnsel=_(e,t,t.unselected)),f.hasMarkers(t)&&(n.marker=b(t),n.markerSel=x(t,t.selected),n.markerUnsel=x(t,t.unselected),!t.unselected&&s.isArrayOrTypedArray(t.marker.opacity))){var i=t.marker.opacity;for(n.markerUnsel.opacity=new Array(i.length),r=0;r<i.length;r++)n.markerUnsel.opacity[r]=m*i[r]}if(f.hasLines(t)){n.line={overlay:!0,thickness:t.line.width*a,color:t.line.color,opacity:t.opacity};var o=(d.DASHES[t.line.dash]||[1]).slice();for(r=0;r<o.length;++r)o[r]*=t.line.width*a;n.line.dashes=o}return t.error_x&&t.error_x.visible&&(n.errorX=w(t,t.error_x,a)),t.error_y&&t.error_y.visible&&(n.errorY=w(t,t.error_y,a)),t.fill&&"none"!==t.fill&&(n.fill={closed:!0,fill:t.fillcolor,thickness:0}),n},markerStyle:b,markerSelection:x,linePositions:function(e,t,r){var n,a,i=r.length,o=i/2;if(f.hasLines(t)&&o)if("hv"===t.line.shape){for(n=[],a=0;a<o-1;a++)isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*a],r[2*a+1]),isNaN(r[2*a+2])||isNaN(r[2*a+3])?n.push(NaN,NaN):n.push(r[2*a+2],r[2*a+1]));n.push(r[i-2],r[i-1])}else if("hvh"===t.line.shape){for(n=[],a=0;a<o-1;a++)if(isNaN(r[2*a])||isNaN(r[2*a+1])||isNaN(r[2*a+2])||isNaN(r[2*a+3]))isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN):n.push(r[2*a],r[2*a+1]),n.push(NaN,NaN);else{var s=(r[2*a]+r[2*a+2])/2;n.push(r[2*a],r[2*a+1],s,r[2*a+1],s,r[2*a+3])}n.push(r[i-2],r[i-1])}else if("vhv"===t.line.shape){for(n=[],a=0;a<o-1;a++)if(isNaN(r[2*a])||isNaN(r[2*a+1])||isNaN(r[2*a+2])||isNaN(r[2*a+3]))isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN):n.push(r[2*a],r[2*a+1]),n.push(NaN,NaN);else{var l=(r[2*a+1]+r[2*a+3])/2;n.push(r[2*a],r[2*a+1],r[2*a],l,r[2*a+2],l)}n.push(r[i-2],r[i-1])}else if("vh"===t.line.shape){for(n=[],a=0;a<o-1;a++)isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*a],r[2*a+1]),isNaN(r[2*a+2])||isNaN(r[2*a+3])?n.push(NaN,NaN):n.push(r[2*a],r[2*a+3]));n.push(r[i-2],r[i-1])}else n=r;var c=!1;for(a=0;a<n.length;a++)if(isNaN(n[a])){c=!0;break}var u=c||n.length>d.TOO_MANY_POINTS||f.hasMarkers(t)?"rect":"round";if(c&&t.connectgaps){var p=n[0],h=n[1];for(a=0;a<n.length;a+=2)isNaN(n[a])||isNaN(n[a+1])?(n[a]=p,n[a+1]=h):(p=n[a],h=n[a+1])}return{join:u,positions:n}},errorBarPositions:function(e,t,r,a,i){var s=o.getComponentMethod("errorbars","makeComputeError"),l=c.getFromId(e,t.xaxis),u=c.getFromId(e,t.yaxis),f=r.length/2,p={};function h(e,a){var i=a._id.charAt(0),o=t["error_"+i];if(o&&o.visible&&("linear"===a.type||"log"===a.type)){for(var l=s(o),c={x:0,y:1}[i],u={x:[0,1,2,3],y:[2,3,0,1]}[i],h=new Float64Array(4*f),d=1/0,m=-1/0,g=0,y=0;g<f;g++,y+=4){var v=e[g];if(n(v)){var b=r[2*g+c],x=l(v,g),_=x[0],w=x[1];if(n(_)&&n(w)){var k=v-_,D=v+w;h[y+u[0]]=b-a.c2l(k),h[y+u[1]]=a.c2l(D)-b,h[y+u[2]]=0,h[y+u[3]]=0,d=Math.min(d,v-_),m=Math.max(m,v+w)}}}p[i]={positions:r,errors:h,_bnds:[d,m]}}}return h(a,l),h(i,u),p},textPosition:function(e,t,r,n){var a,i=t._length,o={};if(f.hasMarkers(t)){var s=r.font,l=r.align,c=r.baseline;for(o.offset=new Array(i),a=0;a<i;a++){var u=n.sizes?n.sizes[a]:n.size,p=Array.isArray(s)?s[a].size:s.size,h=Array.isArray(l)?l.length>1?l[a]:l[0]:l,d=Array.isArray(c)?c.length>1?c[a]:c[0]:c,m=g[h],y=g[d],v=u?u/.8+1:0,b=-y*v-.5*y;o.offset[a]=[m*v/p,b/p]}}return o}}},{"../../components/drawing":388,"../../components/fx/helpers":402,"../../constants/interactions":478,"../../lib":503,"../../lib/gl_format_color":499,"../../plots/cartesian/axis_ids":558,"../../registry":638,"../scatter/make_bubble_size_func":943,"../scatter/subtypes":951,"./constants":980,"./helpers":985,"color-normalize":89,"fast-isnumeric":190,"svg-path-sdf":310}],982:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./helpers"),o=e("./attributes"),s=e("../scatter/constants"),l=e("../scatter/subtypes"),c=e("../scatter/xy_defaults"),u=e("../scatter/period_defaults"),f=e("../scatter/marker_defaults"),p=e("../scatter/line_defaults"),h=e("../scatter/fillcolor_defaults"),d=e("../scatter/text_defaults");t.exports=function(e,t,r,m){function g(r,a){return n.coerce(e,t,o,r,a)}var y=!!e.marker&&i.isOpenSymbol(e.marker.symbol),v=l.isBubble(e),b=c(e,t,m,g);if(b){u(e,t,m,g),g("xhoverformat"),g("yhoverformat");var x=b<s.PTS_LINESONLY?"lines+markers":"lines";g("text"),g("hovertext"),g("hovertemplate"),g("mode",x),l.hasLines(t)&&(g("connectgaps"),p(e,t,r,m,g),g("line.shape")),l.hasMarkers(t)&&(f(e,t,r,m,g),g("marker.line.width",y||v?1:0)),l.hasText(t)&&(g("texttemplate"),d(e,t,m,g));var _=(t.line||{}).color,w=(t.marker||{}).color;g("fill"),"none"!==t.fill&&h(e,t,r,g);var k=a.getComponentMethod("errorbars","supplyDefaults");k(e,t,_||w||r,{axis:"y"}),k(e,t,_||w||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(t,g)}else t.visible=!1}},{"../../lib":503,"../../registry":638,"../scatter/constants":930,"../scatter/fillcolor_defaults":934,"../scatter/line_defaults":939,"../scatter/marker_defaults":945,"../scatter/period_defaults":946,"../scatter/subtypes":951,"../scatter/text_defaults":952,"../scatter/xy_defaults":953,"./attributes":978,"./helpers":985}],983:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../../constants/interactions").DESELECTDIM;t.exports={styleTextSelection:function(e){var t,r,o=e[0],s=o.trace,l=o.t,c=l._scene,u=l.index,f=c.selectBatch[u],p=c.unselectBatch[u],h=c.textOptions[u],d=c.textSelectedOptions[u]||{},m=c.textUnselectedOptions[u]||{},g=n.extendFlat({},h);if(f.length||p.length){var y=d.color,v=m.color,b=h.color,x=Array.isArray(b);for(g.color=new Array(s._length),t=0;t<f.length;t++)r=f[t],g.color[r]=y||(x?b[r]:b);for(t=0;t<p.length;t++){r=p[t];var _=x?b[r]:b;g.color[r]=v||(y?_:a.addOpacity(_,i))}}c.glText[u].update(g)}}},{"../../components/color":366,"../../constants/interactions":478,"../../lib":503}],984:[function(e,t,r){"use strict";var n=e("../scatter/format_labels");t.exports=function(e,t,r){var a=e.i;return"x"in e||(e.x=t._x[a]),"y"in e||(e.y=t._y[a]),n(e,t,r)}},{"../scatter/format_labels":935}],985:[function(e,t,r){"use strict";var n=e("./constants");r.isOpenSymbol=function(e){return"string"==typeof e?n.OPEN_RE.test(e):e%200>100},r.isDotSymbol=function(e){return"string"==typeof e?n.DOT_RE.test(e):e>200}},{"./constants":980}],986:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../scatter/get_trace_color");function o(e,t,r,o){var s=e.xa,l=e.ya,c=e.distance,u=e.dxy,f=e.index,p={pointNumber:f,x:t[f],y:r[f]};p.tx=Array.isArray(o.text)?o.text[f]:o.text,p.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,p.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,p.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var h=o.textfont;h&&(p.ts=a.isArrayOrTypedArray(h.size)?h.size[f]:h.size,p.tc=Array.isArray(h.color)?h.color[f]:h.color,p.tf=Array.isArray(h.family)?h.family[f]:h.family);var d=o.marker;d&&(p.ms=a.isArrayOrTypedArray(d.size)?d.size[f]:d.size,p.mo=a.isArrayOrTypedArray(d.opacity)?d.opacity[f]:d.opacity,p.mx=a.isArrayOrTypedArray(d.symbol)?d.symbol[f]:d.symbol,p.mc=a.isArrayOrTypedArray(d.color)?d.color[f]:d.color);var m=d&&d.line;m&&(p.mlc=Array.isArray(m.color)?m.color[f]:m.color,p.mlw=a.isArrayOrTypedArray(m.width)?m.width[f]:m.width);var g=d&&d.gradient;g&&"none"!==g.type&&(p.mgt=Array.isArray(g.type)?g.type[f]:g.type,p.mgc=Array.isArray(g.color)?g.color[f]:g.color);var y=s.c2p(p.x,!0),v=l.c2p(p.y,!0),b=p.mrc||1,x=o.hoverlabel;x&&(p.hbg=Array.isArray(x.bgcolor)?x.bgcolor[f]:x.bgcolor,p.hbc=Array.isArray(x.bordercolor)?x.bordercolor[f]:x.bordercolor,p.hts=a.isArrayOrTypedArray(x.font.size)?x.font.size[f]:x.font.size,p.htc=Array.isArray(x.font.color)?x.font.color[f]:x.font.color,p.htf=Array.isArray(x.font.family)?x.font.family[f]:x.font.family,p.hnl=a.isArrayOrTypedArray(x.namelength)?x.namelength[f]:x.namelength);var _=o.hoverinfo;_&&(p.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(p.ht=Array.isArray(w)?w[f]:w);var k={};k[e.index]=p;var D=o._origX,T=o._origY,A=a.extendFlat({},e,{color:i(o,p),x0:y-b,x1:y+b,xLabelVal:D?D[f]:p.x,y0:v-b,y1:v+b,yLabelVal:T?T[f]:p.y,cd:k,distance:c,spikeDistance:u,hovertemplate:p.ht});return p.htx?A.text=p.htx:p.tx?A.text=p.tx:o.text&&(A.text=o.text),a.fillText(p,o,A),n.getComponentMethod("errorbars","hoverInfo")(p,o,A),A}t.exports={hoverPoints:function(e,t,r,n){var a,i,s,l,c,u,f,p,h,d,m=e.cd,g=m[0].t,y=m[0].trace,v=e.xa,b=e.ya,x=g.x,_=g.y,w=v.c2p(t),k=b.c2p(r),D=e.distance;if(g.tree){var T=v.p2c(w-D),A=v.p2c(w+D),S=b.p2c(k-D),M=b.p2c(k+D);a="x"===n?g.tree.range(Math.min(T,A),Math.min(b._rl[0],b._rl[1]),Math.max(T,A),Math.max(b._rl[0],b._rl[1])):g.tree.range(Math.min(T,A),Math.min(S,M),Math.max(T,A),Math.max(S,M))}else a=g.ids;var E=D;if("x"===n){var C=!!y.xperiodalignment,N=!!y.yperiodalignment;for(u=0;u<a.length;u++){if(l=x[i=a[u]],f=Math.abs(v.c2p(l)-w),C){var O=v.c2p(y._xStarts[i]),I=v.c2p(y._xEnds[i]);f=w>=Math.min(O,I)&&w<=Math.max(O,I)?0:1/0}if(f<E){if(E=f,c=_[i],p=b.c2p(c)-k,N){var P=b.c2p(y._yStarts[i]),R=b.c2p(y._yEnds[i]);p=k>=Math.min(P,R)&&k<=Math.max(P,R)?0:1/0}d=Math.sqrt(f*f+p*p),s=a[u]}}}else for(u=a.length-1;u>-1;u--)l=x[i=a[u]],c=_[i],f=v.c2p(l)-w,p=b.c2p(c)-k,(h=Math.sqrt(f*f+p*p))<E&&(E=d=h,s=i);return e.index=s,e.distance=E,e.dxy=d,void 0===s?[e]:[o(e,x,_,y)]},calcHover:o}},{"../../lib":503,"../../registry":638,"../scatter/get_trace_color":936}],987:[function(e,t,r){"use strict";var n=e("./hover");t.exports={moduleType:"trace",name:"scattergl",basePlotModule:e("../../plots/cartesian"),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("../scatter/cross_trace_defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),hoverPoints:n.hoverPoints,selectPoints:e("./select"),meta:{}}},{"../../plots/cartesian":568,"../scatter/cross_trace_defaults":932,"../scatter/marker_colorbar":944,"./attributes":978,"./calc":979,"./defaults":982,"./format_labels":984,"./hover":986,"./plot":988,"./select":990}],988:[function(e,t,r){"use strict";var n=e("regl-scatter2d"),a=e("regl-line2d"),i=e("regl-error2d"),o=e("gl-text"),s=e("../../lib"),l=e("../../components/dragelement/helpers").selectMode,c=e("../../lib/prepare_regl"),u=e("../scatter/subtypes"),f=e("../scatter/link_traces"),p=e("./edit_style").styleTextSelection;function h(e,t,r,n){var a=e._size,i=e.width*n,o=e.height*n,s=a.l*n,l=a.b*n,c=a.r*n,u=a.t*n,f=a.w*n,p=a.h*n;return[s+t.domain[0]*f,l+r.domain[0]*p,i-c-(1-t.domain[1])*f,o-u-(1-r.domain[1])*p]}t.exports=function(e,t,r){if(r.length){var d,m,g=e._fullLayout,y=t._scene,v=t.xaxis,b=t.yaxis;if(y)if(c(e,["ANGLE_instanced_arrays","OES_element_index_uint"])){var x=y.count,_=g._glcanvas.data()[0].regl;if(f(e,t,r),y.dirty){if(!0===y.error2d&&(y.error2d=i(_)),!0===y.line2d&&(y.line2d=a(_)),!0===y.scatter2d&&(y.scatter2d=n(_)),!0===y.fill2d&&(y.fill2d=a(_)),!0===y.glText)for(y.glText=new Array(x),d=0;d<x;d++)y.glText[d]=new o(_);if(y.glText){if(x>y.glText.length){var w=x-y.glText.length;for(d=0;d<w;d++)y.glText.push(new o(_))}else if(x<y.glText.length){var k=y.glText.length-x;y.glText.splice(x,k).forEach((function(e){e.destroy()}))}for(d=0;d<x;d++)y.glText[d].update(y.textOptions[d])}if(y.line2d&&(y.line2d.update(y.lineOptions),y.lineOptions=y.lineOptions.map((function(e){if(e&&e.positions){for(var t=e.positions,r=0;r<t.length&&(isNaN(t[r])||isNaN(t[r+1]));)r+=2;for(var n=t.length-2;n>r&&(isNaN(t[n])||isNaN(t[n+1]));)n-=2;e.positions=t.slice(r,n+2)}return e})),y.line2d.update(y.lineOptions)),y.error2d){var D=(y.errorXOptions||[]).concat(y.errorYOptions||[]);y.error2d.update(D)}y.scatter2d&&y.scatter2d.update(y.markerOptions),y.fillOrder=s.repeat(null,x),y.fill2d&&(y.fillOptions=y.fillOptions.map((function(e,t){var n=r[t];if(e&&n&&n[0]&&n[0].trace){var a,i,o=n[0],s=o.trace,l=o.t,c=y.lineOptions[t],u=[];s._ownfill&&u.push(t),s._nexttrace&&u.push(t+1),u.length&&(y.fillOrder[t]=u);var f,p,h=[],d=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(f=0;f<d.length&&isNaN(d[f+1]);)f+=2;for(p=d.length-2;p>f&&isNaN(d[p+1]);)p-=2;0!==d[f+1]&&(h=[d[f],0]),h=h.concat(d.slice(f,p+2)),0!==d[p+1]&&(h=h.concat([d[p],0]))}else if("tozerox"===s.fill){for(f=0;f<d.length&&isNaN(d[f]);)f+=2;for(p=d.length-2;p>f&&isNaN(d[p]);)p-=2;0!==d[f]&&(h=[0,d[f+1]]),h=h.concat(d.slice(f,p+2)),0!==d[p]&&(h=h.concat([0,d[p+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(h=[],a=0,e.splitNull=!0,i=0;i<d.length;i+=2)(isNaN(d[i])||isNaN(d[i+1]))&&((h=h.concat(d.slice(a,i))).push(d[a],d[a+1]),h.push(null,null),a=i+2);h=h.concat(d.slice(a)),a&&h.push(d[a],d[a+1])}else{var m=s._nexttrace;if(m){var g=y.lineOptions[t+1];if(g){var v=g.positions;if("tonexty"===s.fill){for(h=d.slice(),t=Math.floor(v.length/2);t--;){var b=v[2*t],x=v[2*t+1];isNaN(b)||isNaN(x)||h.push(b,x)}e.fill=m.fillcolor}}}}if(s._prevtrace&&"tonext"===s._prevtrace.fill){var _=y.lineOptions[t-1].positions,w=h.length/2,k=[a=w];for(i=0;i<_.length;i+=2)(isNaN(_[i])||isNaN(_[i+1]))&&(k.push(i/2+w+1),a=i+2);h=h.concat(_),e.hole=k}return e.fillmode=s.fill,e.opacity=s.opacity,e.positions=h,e}})),y.fill2d.update(y.fillOptions))}var T=g.dragmode,A=l(T),S=g.clickmode.indexOf("select")>-1;for(d=0;d<x;d++){var M=r[d][0],E=M.trace,C=M.t,N=C.index,O=E._length,I=C.x,P=C.y;if(E.selectedpoints||A||S){if(A||(A=!0),E.selectedpoints){var R=y.selectBatch[N]=s.selIndices2selPoints(E),L={};for(m=0;m<R.length;m++)L[R[m]]=1;var F=[];for(m=0;m<O;m++)L[m]||F.push(m);y.unselectBatch[N]=F}var B=C.xpx=new Array(O),z=C.ypx=new Array(O);for(m=0;m<O;m++)B[m]=v.c2p(I[m]),z[m]=b.c2p(P[m])}else C.xpx=C.ypx=null}if(A){if(y.select2d||(y.select2d=n(g._glcanvas.data()[1].regl)),y.scatter2d){var j=new Array(x);for(d=0;d<x;d++)j[d]=y.selectBatch[d].length||y.unselectBatch[d].length?y.markerUnselectedOptions[d]:{};y.scatter2d.update(j)}y.select2d&&(y.select2d.update(y.markerOptions),y.select2d.update(y.markerSelectedOptions)),y.glText&&r.forEach((function(e){var t=((e||[])[0]||{}).trace||{};u.hasText(t)&&p(e)}))}else y.scatter2d&&y.scatter2d.update(y.markerOptions);var U={viewport:h(g,v,b,e._context.plotGlPixelRatio),range:[(v._rl||v.range)[0],(b._rl||b.range)[0],(v._rl||v.range)[1],(b._rl||b.range)[1]]},$=s.repeat(U,y.count);y.fill2d&&y.fill2d.update($),y.line2d&&y.line2d.update($),y.error2d&&y.error2d.update($.concat($)),y.scatter2d&&y.scatter2d.update($),y.select2d&&y.select2d.update($),y.glText&&y.glText.forEach((function(e){e.update(U)}))}else y.init()}}},{"../../components/dragelement/helpers":384,"../../lib":503,"../../lib/prepare_regl":516,"../scatter/link_traces":942,"../scatter/subtypes":951,"./edit_style":983,"gl-text":225,"regl-error2d":279,"regl-line2d":280,"regl-scatter2d":281}],989:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){var r=t._scene,a={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},i={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return t._scene||((r=t._scene={}).init=function(){n.extendFlat(r,i,a)},r.init(),r.update=function(e){var t=n.repeat(e,r.count);if(r.fill2d&&r.fill2d.update(t),r.scatter2d&&r.scatter2d.update(t),r.line2d&&r.line2d.update(t),r.error2d&&r.error2d.update(t.concat(t)),r.select2d&&r.select2d.update(t),r.glText)for(var a=0;a<r.count;a++)r.glText[a].update(e)},r.draw=function(){for(var e=r.count,t=r.fill2d,a=r.error2d,i=r.line2d,o=r.scatter2d,s=r.glText,l=r.select2d,c=r.selectBatch,u=r.unselectBatch,f=0;f<e;f++){if(t&&r.fillOrder[f]&&t.draw(r.fillOrder[f]),i&&r.lineOptions[f]&&i.draw(f),a&&(r.errorXOptions[f]&&a.draw(f),r.errorYOptions[f]&&a.draw(f+e)),o&&r.markerOptions[f])if(u[f].length){var p=n.repeat([],r.count);p[f]=u[f],o.draw(p)}else c[f].length||o.draw(f);s[f]&&r.textOptions[f]&&s[f].render()}l&&l.draw(c),r.dirty=!1},r.destroy=function(){r.fill2d&&r.fill2d.destroy&&r.fill2d.destroy(),r.scatter2d&&r.scatter2d.destroy&&r.scatter2d.destroy(),r.error2d&&r.error2d.destroy&&r.error2d.destroy(),r.line2d&&r.line2d.destroy&&r.line2d.destroy(),r.select2d&&r.select2d.destroy&&r.select2d.destroy(),r.glText&&r.glText.forEach((function(e){e.destroy&&e.destroy()})),r.lineOptions=null,r.fillOptions=null,r.markerOptions=null,r.markerSelectedOptions=null,r.markerUnselectedOptions=null,r.errorXOptions=null,r.errorYOptions=null,r.textOptions=null,r.textSelectedOptions=null,r.textUnselectedOptions=null,r.selectBatch=null,r.unselectBatch=null,t._scene=null}),r.dirty||n.extendFlat(r,a),r}},{"../../lib":503}],990:[function(e,t,r){"use strict";var n=e("../scatter/subtypes"),a=e("./edit_style").styleTextSelection;t.exports=function(e,t){var r=e.cd,i=e.xaxis,o=e.yaxis,s=[],l=r[0].trace,c=r[0].t,u=l._length,f=c.x,p=c.y,h=c._scene,d=c.index;if(!h)return s;var m=n.hasText(l),g=n.hasMarkers(l),y=!g&&!m;if(!0!==l.visible||y)return s;var v=[],b=[];if(!1!==t&&!t.degenerate)for(var x=0;x<u;x++)t.contains([c.xpx[x],c.ypx[x]],!1,x,e)?(v.push(x),s.push({pointNumber:x,x:i.c2d(f[x]),y:o.c2d(p[x])})):b.push(x);if(g){var _=h.scatter2d;if(v.length||b.length){if(!h.selectBatch[d].length&&!h.unselectBatch[d].length){var w=new Array(h.count);w[d]=h.markerUnselectedOptions[d],_.update.apply(_,w)}}else{var k=new Array(h.count);k[d]=h.markerOptions[d],_.update.apply(_,k)}}return h.selectBatch[d]=v,h.unselectBatch[d]=b,m&&a(r),s}},{"../scatter/subtypes":951,"./edit_style":983}],991:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../../plots/template_attributes").texttemplateAttrs,i=e("../scattergeo/attributes"),o=e("../scatter/attributes"),s=e("../../plots/mapbox/layout_attributes"),l=e("../../plots/attributes"),c=e("../../components/colorscale/attributes"),u=e("../../lib/extend").extendFlat,f=e("../../plot_api/edit_types").overrideAll,p=i.line,h=i.marker;t.exports=f({lon:i.lon,lat:i.lat,mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:a({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:h.opacity,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode},c("marker")),fill:i.fill,fillcolor:o.fillcolor,textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:n()},"calc","nested")},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plots/attributes":550,"../../plots/mapbox/layout_attributes":615,"../../plots/template_attributes":633,"../scatter/attributes":926,"../scattergeo/attributes":968}],992:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM,o=e("../../lib/geojson_utils"),s=e("../../components/colorscale"),l=e("../../components/drawing"),c=e("../scatter/make_bubble_size_func"),u=e("../scatter/subtypes"),f=e("../../plots/mapbox/convert_text_opts"),p=e("../../components/fx/helpers").appendArrayPointValue,h=e("../../lib/svg_text_utils").NEWLINES,d=e("../../lib/svg_text_utils").BR_TAG_ALL;function m(){return{geojson:o.makeBlank(),layout:{visibility:"none"},paint:{}}}function g(e,t){return a.isArrayOrTypedArray(e)?t?function(t){return n(e[t])?+e[t]:0}:function(t){return e[t]}:e?function(){return e}:y}function y(){return""}function v(e){return e[0]===i}t.exports=function(e,t){var r,i=t[0].trace,b=!0===i.visible&&0!==i._length,x="none"!==i.fill,_=u.hasLines(i),w=u.hasMarkers(i),k=u.hasText(i),D=w&&"circle"===i.marker.symbol,T=w&&"circle"!==i.marker.symbol,A=m(),S=m(),M=m(),E=m(),C={fill:A,line:S,circle:M,symbol:E};if(!b)return C;if((x||_)&&(r=o.calcTraceToLineCoords(t)),x&&(A.geojson=o.makePolygon(r),A.layout.visibility="visible",a.extendFlat(A.paint,{"fill-color":i.fillcolor})),_&&(S.geojson=o.makeLine(r),S.layout.visibility="visible",a.extendFlat(S.paint,{"line-width":i.line.width,"line-color":i.line.color,"line-opacity":i.opacity})),D){var N=function(e){var t,r,i,o,u=e[0].trace,f=u.marker,p=u.selectedpoints,h=a.isArrayOrTypedArray(f.color),d=a.isArrayOrTypedArray(f.size),m=a.isArrayOrTypedArray(f.opacity);function g(e){return u.opacity*e}h&&(r=s.hasColorscale(u,"marker")?s.makeColorScaleFuncFromTrace(f):a.identity),d&&(i=c(u)),m&&(o=function(e){return g(n(e)?+a.constrain(e,0,1):0)});var y,b,x=[];for(t=0;t<e.length;t++){var _=e[t],w=_.lonlat;if(!v(w)){var k={};r&&(k.mcc=_.mcc=r(_.mc)),i&&(k.mrc=_.mrc=i(_.ms)),o&&(k.mo=o(_.mo)),p&&(k.selected=_.selected||0),x.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:k})}}if(p)for(y=l.makeSelectedPointStyleFns(u),t=0;t<x.length;t++){var D=x[t].properties;y.selectedOpacityFn&&(D.mo=g(y.selectedOpacityFn(D))),y.selectedColorFn&&(D.mcc=y.selectedColorFn(D)),y.selectedSizeFn&&(D.mrc=y.selectedSizeFn(D))}return{geojson:{type:"FeatureCollection",features:x},mcc:h||y&&y.selectedColorFn?{type:"identity",property:"mcc"}:f.color,mrc:d||y&&y.selectedSizeFn?{type:"identity",property:"mrc"}:(b=f.size,b/2),mo:m||y&&y.selectedOpacityFn?{type:"identity",property:"mo"}:g(f.opacity)}}(t);M.geojson=N.geojson,M.layout.visibility="visible",a.extendFlat(M.paint,{"circle-color":N.mcc,"circle-radius":N.mrc,"circle-opacity":N.mo})}if((T||k)&&(E.geojson=function(e,t){for(var r=t._fullLayout,n=e[0].trace,i=n.marker||{},o=i.symbol,s=i.angle,l="circle"!==o?g(o):y,c="auto"!==s?g(s,!0):y,f=u.hasText(n)?g(n.text):y,m=[],b=0;b<e.length;b++){var x=e[b];if(!v(x.lonlat)){var _,w=n.texttemplate;if(w){var k=Array.isArray(w)?w[b]||"":w,D=n._module.formatLabels(x,n,r),T={};p(T,n,x.i);var A=n._meta||{};_=a.texttemplateString(k,D,r._d3locale,T,x,A)}else _=f(b);_&&(_=_.replace(h,"").replace(d,"\n")),m.push({type:"Feature",geometry:{type:"Point",coordinates:x.lonlat},properties:{symbol:l(b),angle:c(b),text:_}})}}return{type:"FeatureCollection",features:m}}(t,e),a.extendFlat(E.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),T&&(a.extendFlat(E.layout,{"icon-size":i.marker.size/10}),"angle"in i.marker&&"auto"!==i.marker.angle&&a.extendFlat(E.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),E.layout["icon-allow-overlap"]=i.marker.allowoverlap,a.extendFlat(E.paint,{"icon-opacity":i.opacity*i.marker.opacity,"icon-color":i.marker.color})),k)){var O=(i.marker||{}).size,I=f(i.textposition,O);a.extendFlat(E.layout,{"text-size":i.textfont.size,"text-anchor":I.anchor,"text-offset":I.offset}),a.extendFlat(E.paint,{"text-color":i.textfont.color,"text-opacity":i.opacity})}return C}},{"../../components/colorscale":378,"../../components/drawing":388,"../../components/fx/helpers":402,"../../constants/numerical":479,"../../lib":503,"../../lib/geojson_utils":497,"../../lib/svg_text_utils":529,"../../plots/mapbox/convert_text_opts":612,"../scatter/make_bubble_size_func":943,"../scatter/subtypes":951,"fast-isnumeric":190}],993:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../scatter/subtypes"),i=e("../scatter/marker_defaults"),o=e("../scatter/line_defaults"),s=e("../scatter/text_defaults"),l=e("../scatter/fillcolor_defaults"),c=e("./attributes");t.exports=function(e,t,r,u){function f(r,a){return n.coerce(e,t,c,r,a)}if(function(e,t,r){var n=r("lon")||[],a=r("lat")||[],i=Math.min(n.length,a.length);return t._length=i,i}(0,t,f)){if(f("text"),f("texttemplate"),f("hovertext"),f("hovertemplate"),f("mode"),f("below"),a.hasLines(t)&&(o(e,t,r,u,f,{noDash:!0}),f("connectgaps")),a.hasMarkers(t)){i(e,t,r,u,f,{noLine:!0}),f("marker.allowoverlap"),f("marker.angle");var p=t.marker;"circle"!==p.symbol&&(n.isArrayOrTypedArray(p.size)&&(p.size=p.size[0]),n.isArrayOrTypedArray(p.color)&&(p.color=p.color[0]))}a.hasText(t)&&s(e,t,u,f,{noSelect:!0}),f("fill"),"none"!==t.fill&&l(e,t,r,f),n.coerceSelectionMarkerOpacity(t,f)}else t.visible=!1}},{"../../lib":503,"../scatter/fillcolor_defaults":934,"../scatter/line_defaults":939,"../scatter/marker_defaults":945,"../scatter/subtypes":951,"../scatter/text_defaults":952,"./attributes":991}],994:[function(e,t,r){"use strict";t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e}},{}],995:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes");t.exports=function(e,t,r){var a={},i=r[t.subplot]._subplot.mockAxis,o=e.lonlat;return a.lonLabel=n.tickText(i,i.c2l(o[0]),!0).text,a.latLabel=n.tickText(i,i.c2l(o[1]),!0).text,a}},{"../../plots/cartesian/axes":554}],996:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../lib"),i=e("../scatter/get_trace_color"),o=a.fillText,s=e("../../constants/numerical").BADNUM;function l(e,t,r){if(!e.hovertemplate){var n=(t.hi||e.hoverinfo).split("+"),a=-1!==n.indexOf("all"),i=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=t.lonlat,c=[];return a||i&&s?c.push("("+u(l[1])+", "+u(l[0])+")"):i?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1])),(a||-1!==n.indexOf("text"))&&o(t,e,c),c.join("<br>")}function u(e){return e+"°"}}t.exports={hoverPoints:function(e,t,r){var o=e.cd,c=o[0].trace,u=e.xa,f=e.ya,p=e.subplot,h=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),d=t-h;if(n.getClosest(o,(function(e){var t=e.lonlat;if(t[0]===s)return 1/0;var n=a.modHalf(t[0],360),i=t[1],o=p.project([n,i]),l=o.x-u.c2p([d,i]),c=o.y-f.c2p([n,r]),h=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-h,1-3/h)}),e),!1!==e.index){var m=o[e.index],g=m.lonlat,y=[a.modHalf(g[0],360)+h,g[1]],v=u.c2p(y),b=f.c2p(y),x=m.mrc||1;e.x0=v-x,e.x1=v+x,e.y0=b-x,e.y1=b+x;var _={};_[c.subplot]={_subplot:p};var w=c._module.formatLabels(m,c,_);return e.lonLabel=w.lonLabel,e.latLabel=w.latLabel,e.color=i(c,m),e.extraText=l(c,m,o[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}},getExtraText:l}},{"../../components/fx":406,"../../constants/numerical":479,"../../lib":503,"../scatter/get_trace_color":936}],997:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("../scattergeo/calc"),plot:e("./plot"),hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.update(t)},moduleType:"trace",name:"scattermapbox",basePlotModule:e("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":613,"../scatter/marker_colorbar":944,"../scattergeo/calc":969,"./attributes":991,"./defaults":993,"./event_data":994,"./format_labels":995,"./hover":996,"./plot":998,"./select":999}],998:[function(e,t,r){"use strict";var n=e("./convert"),a=e("../../plots/mapbox/constants").traceLayerPrefix,i=["fill","line","circle","symbol"];function o(e,t){this.type="scattermapbox",this.subplot=e,this.uid=t,this.sourceIds={fill:"source-"+t+"-fill",line:"source-"+t+"-line",circle:"source-"+t+"-circle",symbol:"source-"+t+"-symbol"},this.layerIds={fill:a+t+"-fill",line:a+t+"-line",circle:a+t+"-circle",symbol:a+t+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(e,t){this.subplot.map.addSource(this.sourceIds[e],{type:"geojson",data:t.geojson})},s.setSourceData=function(e,t){this.subplot.map.getSource(this.sourceIds[e]).setData(t.geojson)},s.addLayer=function(e,t,r){this.subplot.addLayer({type:e,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint},r)},s.update=function(e){var t,r,a,o=this.subplot,s=o.map,l=n(o.gd,e),c=o.belowLookup["trace-"+this.uid];if(c!==this.below){for(t=i.length-1;t>=0;t--)r=i[t],s.removeLayer(this.layerIds[r]);for(t=0;t<i.length;t++)a=l[r=i[t]],this.addLayer(r,a,c);this.below=c}for(t=0;t<i.length;t++)a=l[r=i[t]],o.setOptions(this.layerIds[r],"setLayoutProperty",a.layout),"visible"===a.layout.visibility&&(this.setSourceData(r,a),o.setOptions(this.layerIds[r],"setPaintProperty",a.paint));e[0].trace._glTrace=this},s.dispose=function(){for(var e=this.subplot.map,t=i.length-1;t>=0;t--){var r=i[t];e.removeLayer(this.layerIds[r]),e.removeSource(this.sourceIds[r])}},t.exports=function(e,t){for(var r=t[0].trace,a=new o(e,r.uid),s=n(e.gd,t),l=a.below=e.belowLookup["trace-"+r.uid],c=0;c<i.length;c++){var u=i[c],f=s[u];a.addSource(u,f),a.addLayer(u,f,l)}return t[0].trace._glTrace=a,a}},{"../../plots/mapbox/constants":611,"./convert":992}],999:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../scatter/subtypes"),i=e("../../constants/numerical").BADNUM;t.exports=function(e,t){var r,o=e.cd,s=e.xaxis,l=e.yaxis,c=[],u=o[0].trace;if(!a.hasMarkers(u))return[];if(!1===t)for(r=0;r<o.length;r++)o[r].selected=0;else for(r=0;r<o.length;r++){var f=o[r],p=f.lonlat;if(p[0]!==i){var h=[n.modHalf(p[0],360),p[1]],d=[s.c2p(h),l.c2p(h)];t.contains(d,null,r,e)?(c.push({pointNumber:r,lon:p[0],lat:p[1]}),f.selected=1):f.selected=0}}return c}},{"../../constants/numerical":479,"../../lib":503,"../scatter/subtypes":951}],1e3:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../../plots/template_attributes").texttemplateAttrs,i=e("../../lib/extend").extendFlat,o=e("../scatter/attributes"),s=e("../../plots/attributes"),l=o.line;t.exports={mode:o.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:a({editType:"plot"},{keys:["r","theta","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,shape:i({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:i({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:i({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o.fillcolor,hoverinfo:i({},s.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:o.hoveron,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},{"../../lib/extend":493,"../../plots/attributes":550,"../../plots/template_attributes":633,"../scatter/attributes":926}],1001:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,i=e("../../plots/cartesian/axes"),o=e("../scatter/colorscale_calc"),s=e("../scatter/arrays_to_calcdata"),l=e("../scatter/calc_selection"),c=e("../scatter/calc").calcMarkerSize;t.exports=function(e,t){for(var r=e._fullLayout,u=t.subplot,f=r[u].radialaxis,p=r[u].angularaxis,h=f.makeCalcdata(t,"r"),d=p.makeCalcdata(t,"theta"),m=t._length,g=new Array(m),y=0;y<m;y++){var v=h[y],b=d[y],x=g[y]={};n(v)&&n(b)?(x.r=v,x.theta=b):x.r=a}var _=c(t,m);return t._extremes.x=i.findExtremes(f,h,{ppad:_}),o(e,t),s(g,t),l(g,t),g}},{"../../constants/numerical":479,"../../plots/cartesian/axes":554,"../scatter/arrays_to_calcdata":925,"../scatter/calc":927,"../scatter/calc_selection":928,"../scatter/colorscale_calc":929,"fast-isnumeric":190}],1002:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../scatter/subtypes"),i=e("../scatter/marker_defaults"),o=e("../scatter/line_defaults"),s=e("../scatter/line_shape_defaults"),l=e("../scatter/text_defaults"),c=e("../scatter/fillcolor_defaults"),u=e("../scatter/constants").PTS_LINESONLY,f=e("./attributes");function p(e,t,r,n){var a,i=n("r"),o=n("theta");if(i)o?a=Math.min(i.length,o.length):(a=i.length,n("theta0"),n("dtheta"));else{if(!o)return 0;a=t.theta.length,n("r0"),n("dr")}return t._length=a,a}t.exports={handleRThetaDefaults:p,supplyDefaults:function(e,t,r,h){function d(r,a){return n.coerce(e,t,f,r,a)}var m=p(0,t,0,d);if(m){d("thetaunit"),d("mode",m<u?"lines+markers":"lines"),d("text"),d("hovertext"),"fills"!==t.hoveron&&d("hovertemplate"),a.hasLines(t)&&(o(e,t,r,h,d),s(e,t,d),d("connectgaps")),a.hasMarkers(t)&&i(e,t,r,h,d,{gradient:!0}),a.hasText(t)&&(d("texttemplate"),l(e,t,h,d));var g=[];(a.hasMarkers(t)||a.hasText(t))&&(d("cliponaxis"),d("marker.maxdisplayed"),g.push("points")),d("fill"),"none"!==t.fill&&(c(e,t,r,d),a.hasLines(t)||s(e,t,d)),"tonext"!==t.fill&&"toself"!==t.fill||g.push("fills"),d("hoveron",g.join("+")||"points"),n.coerceSelectionMarkerOpacity(t,d)}else t.visible=!1}}},{"../../lib":503,"../scatter/constants":930,"../scatter/fillcolor_defaults":934,"../scatter/line_defaults":939,"../scatter/line_shape_defaults":941,"../scatter/marker_defaults":945,"../scatter/subtypes":951,"../scatter/text_defaults":952,"./attributes":1e3}],1003:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes");t.exports=function(e,t,r){var i,o,s={},l=r[t.subplot]._subplot;l?(i=l.radialAxis,o=l.angularAxis):(i=(l=r[t.subplot]).radialaxis,o=l.angularaxis);var c=i.c2l(e.r);s.rLabel=a.tickText(i,c,!0).text;var u="degrees"===o.thetaunit?n.rad2deg(e.theta):e.theta;return s.thetaLabel=a.tickText(o,u,!0).text,s}},{"../../lib":503,"../../plots/cartesian/axes":554}],1004:[function(e,t,r){"use strict";var n=e("../scatter/hover");function a(e,t,r,n){var a=r.radialAxis,i=r.angularAxis;a._hovertitle="r",i._hovertitle="θ";var o={};o[t.subplot]={_subplot:r};var s=t._module.formatLabels(e,t,o);n.rLabel=s.rLabel,n.thetaLabel=s.thetaLabel;var l=e.hi||t.hoverinfo,c=[];function u(e,t){c.push(e._hovertitle+": "+t)}if(!t.hovertemplate){var f=l.split("+");-1!==f.indexOf("all")&&(f=["r","theta","text"]),-1!==f.indexOf("r")&&u(a,n.rLabel),-1!==f.indexOf("theta")&&u(i,n.thetaLabel),-1!==f.indexOf("text")&&n.text&&(c.push(n.text),delete n.text),n.extraText=c.join("<br>")}}t.exports={hoverPoints:function(e,t,r,i){var o=n(e,t,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,a(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:a}},{"../scatter/hover":937}],1005:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:e("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:e("./attributes"),supplyDefaults:e("./defaults").supplyDefaults,colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,selectPoints:e("../scatter/select"),meta:{}}},{"../../plots/polar":622,"../scatter/marker_colorbar":944,"../scatter/select":948,"../scatter/style":950,"./attributes":1e3,"./calc":1001,"./defaults":1002,"./format_labels":1003,"./hover":1004,"./plot":1006}],1006:[function(e,t,r){"use strict";var n=e("../scatter/plot"),a=e("../../constants/numerical").BADNUM;t.exports=function(e,t,r){for(var i=t.layers.frontplot.select("g.scatterlayer"),o={xaxis:t.xaxis,yaxis:t.yaxis,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},s=t.radialAxis,l=t.angularAxis,c=0;c<r.length;c++)for(var u=r[c],f=0;f<u.length;f++){var p=u[f],h=p.r;if(h===a)p.x=p.y=a;else{var d=s.c2g(h),m=l.c2g(p.theta);p.x=d*Math.cos(m),p.y=d*Math.sin(m)}}n(e,o,r,i)}},{"../../constants/numerical":479,"../scatter/plot":947}],1007:[function(e,t,r){"use strict";var n=e("../scatterpolar/attributes"),a=e("../scattergl/attributes"),i=e("../../plots/template_attributes").texttemplateAttrs;t.exports={mode:n.mode,r:n.r,theta:n.theta,r0:n.r0,dr:n.dr,theta0:n.theta0,dtheta:n.dtheta,thetaunit:n.thetaunit,text:n.text,texttemplate:i({editType:"plot"},{keys:["r","theta","text"]}),hovertext:n.hovertext,hovertemplate:n.hovertemplate,line:a.line,connectgaps:a.connectgaps,marker:a.marker,fill:a.fill,fillcolor:a.fillcolor,textposition:a.textposition,textfont:a.textfont,hoverinfo:n.hoverinfo,selected:n.selected,unselected:n.unselected}},{"../../plots/template_attributes":633,"../scattergl/attributes":978,"../scatterpolar/attributes":1e3}],1008:[function(e,t,r){"use strict";var n=e("../scatter/colorscale_calc"),a=e("../scatter/calc").calcMarkerSize,i=e("../scattergl/convert"),o=e("../../plots/cartesian/axes"),s=e("../scattergl/constants").TOO_MANY_POINTS;t.exports=function(e,t){var r=e._fullLayout,l=t.subplot,c=r[l].radialaxis,u=r[l].angularaxis,f=t._r=c.makeCalcdata(t,"r"),p=t._theta=u.makeCalcdata(t,"theta"),h=t._length,d={};h<f.length&&(f=f.slice(0,h)),h<p.length&&(p=p.slice(0,h)),d.r=f,d.theta=p,n(e,t);var m,g=d.opts=i.style(e,t);return h<s?m=a(t,h):g.marker&&(m=2*(g.marker.sizeAvg||Math.max(g.marker.size,3))),t._extremes.x=o.findExtremes(c,f,{ppad:m}),[{x:!1,y:!1,t:d,trace:t}]}},{"../../plots/cartesian/axes":554,"../scatter/calc":927,"../scatter/colorscale_calc":929,"../scattergl/constants":980,"../scattergl/convert":981}],1009:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../scatter/subtypes"),i=e("../scatterpolar/defaults").handleRThetaDefaults,o=e("../scatter/marker_defaults"),s=e("../scatter/line_defaults"),l=e("../scatter/text_defaults"),c=e("../scatter/fillcolor_defaults"),u=e("../scatter/constants").PTS_LINESONLY,f=e("./attributes");t.exports=function(e,t,r,p){function h(r,a){return n.coerce(e,t,f,r,a)}var d=i(e,t,p,h);d?(h("thetaunit"),h("mode",d<u?"lines+markers":"lines"),h("text"),h("hovertext"),"fills"!==t.hoveron&&h("hovertemplate"),a.hasLines(t)&&(s(e,t,r,p,h),h("connectgaps")),a.hasMarkers(t)&&o(e,t,r,p,h),a.hasText(t)&&(h("texttemplate"),l(e,t,p,h)),h("fill"),"none"!==t.fill&&c(e,t,r,h),n.coerceSelectionMarkerOpacity(t,h)):t.visible=!1}},{"../../lib":503,"../scatter/constants":930,"../scatter/fillcolor_defaults":934,"../scatter/line_defaults":939,"../scatter/marker_defaults":945,"../scatter/subtypes":951,"../scatter/text_defaults":952,"../scatterpolar/defaults":1002,"./attributes":1007}],1010:[function(e,t,r){"use strict";var n=e("../scatterpolar/format_labels");t.exports=function(e,t,r){var a=e.i;return"r"in e||(e.r=t._r[a]),"theta"in e||(e.theta=t._theta[a]),n(e,t,r)}},{"../scatterpolar/format_labels":1003}],1011:[function(e,t,r){"use strict";var n=e("../scattergl/hover"),a=e("../scatterpolar/hover").makeHoverPointText;t.exports={hoverPoints:function(e,t,r,i){var o=e.cd[0].t,s=o.r,l=o.theta,c=n.hoverPoints(e,t,r,i);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var f=e.subplot,p=u.cd[u.index],h=u.trace;if(p.r=s[u.index],p.theta=l[u.index],f.isPtInside(p))return u.xLabelVal=void 0,u.yLabelVal=void 0,a(p,h,f,u),c}}}},{"../scattergl/hover":986,"../scatterpolar/hover":1004}],1012:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:e("../../plots/polar"),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("../scattergl/select"),meta:{}}},{"../../plots/polar":622,"../scatter/marker_colorbar":944,"../scattergl/select":990,"./attributes":1007,"./calc":1008,"./defaults":1009,"./format_labels":1010,"./hover":1011,"./plot":1013}],1013:[function(e,t,r){"use strict";var n=e("@plotly/point-cluster"),a=e("fast-isnumeric"),i=e("../scattergl/plot"),o=e("../scattergl/scene_update"),s=e("../scattergl/convert"),l=e("../../lib"),c=e("../scattergl/constants").TOO_MANY_POINTS;t.exports=function(e,t,r){if(r.length){var u=t.radialAxis,f=t.angularAxis,p=o(e,t);return r.forEach((function(r){if(r&&r[0]&&r[0].trace){var i,o=r[0],h=o.trace,d=o.t,m=h._length,g=d.r,y=d.theta,v=d.opts,b=g.slice(),x=y.slice();for(i=0;i<g.length;i++)t.isPtInside({r:g[i],theta:y[i]})||(b[i]=NaN,x[i]=NaN);var _=new Array(2*m),w=Array(m),k=Array(m);for(i=0;i<m;i++){var D,T,A=b[i];if(a(A)){var S=u.c2g(A),M=f.c2g(x[i],h.thetaunit);D=S*Math.cos(M),T=S*Math.sin(M)}else D=T=NaN;w[i]=_[2*i]=D,k[i]=_[2*i+1]=T}d.tree=n(_),v.marker&&m>=c&&(v.marker.cluster=d.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=_),v.line&&_.length>1&&l.extendFlat(v.line,s.linePositions(e,h,_)),v.text&&(l.extendFlat(v.text,{positions:_},s.textPosition(e,h,v.text,v.marker)),l.extendFlat(v.textSel,{positions:_},s.textPosition(e,h,v.text,v.markerSel)),l.extendFlat(v.textUnsel,{positions:_},s.textPosition(e,h,v.text,v.markerUnsel))),v.fill&&!p.fill2d&&(p.fill2d=!0),v.marker&&!p.scatter2d&&(p.scatter2d=!0),v.line&&!p.line2d&&(p.line2d=!0),v.text&&!p.glText&&(p.glText=!0),p.lineOptions.push(v.line),p.fillOptions.push(v.fill),p.markerOptions.push(v.marker),p.markerSelectedOptions.push(v.markerSel),p.markerUnselectedOptions.push(v.markerUnsel),p.textOptions.push(v.text),p.textSelectedOptions.push(v.textSel),p.textUnselectedOptions.push(v.textUnsel),p.selectBatch.push([]),p.unselectBatch.push([]),d.x=w,d.y=k,d.rawx=w,d.rawy=k,d.r=g,d.theta=y,d.positions=_,d._scene=p,d.index=p.count,p.count++}})),i(e,t,r)}}},{"../../lib":503,"../scattergl/constants":980,"../scattergl/convert":981,"../scattergl/plot":988,"../scattergl/scene_update":989,"@plotly/point-cluster":59,"fast-isnumeric":190}],1014:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../../plots/template_attributes").texttemplateAttrs,i=e("../../lib/extend").extendFlat,o=e("../scatter/attributes"),s=e("../../plots/attributes"),l=o.line;t.exports={mode:o.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:a({editType:"plot"},{keys:["real","imag","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,shape:i({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:i({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:i({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o.fillcolor,hoverinfo:i({},s.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:o.hoveron,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},{"../../lib/extend":493,"../../plots/attributes":550,"../../plots/template_attributes":633,"../scatter/attributes":926}],1015:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,i=e("../scatter/colorscale_calc"),o=e("../scatter/arrays_to_calcdata"),s=e("../scatter/calc_selection"),l=e("../scatter/calc").calcMarkerSize;t.exports=function(e,t){for(var r=e._fullLayout,c=t.subplot,u=r[c].realaxis,f=r[c].imaginaryaxis,p=u.makeCalcdata(t,"real"),h=f.makeCalcdata(t,"imag"),d=t._length,m=new Array(d),g=0;g<d;g++){var y=p[g],v=h[g],b=m[g]={};n(y)&&n(v)?(b.real=y,b.imag=v):b.real=a}return l(t,d),i(e,t),o(m,t),s(m,t),m}},{"../../constants/numerical":479,"../scatter/arrays_to_calcdata":925,"../scatter/calc":927,"../scatter/calc_selection":928,"../scatter/colorscale_calc":929,"fast-isnumeric":190}],1016:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../scatter/subtypes"),i=e("../scatter/marker_defaults"),o=e("../scatter/line_defaults"),s=e("../scatter/line_shape_defaults"),l=e("../scatter/text_defaults"),c=e("../scatter/fillcolor_defaults"),u=e("../scatter/constants").PTS_LINESONLY,f=e("./attributes");t.exports=function(e,t,r,p){function h(r,a){return n.coerce(e,t,f,r,a)}var d=function(e,t,r,n){var a,i=n("real"),o=n("imag");return i&&o&&(a=Math.min(i.length,o.length)),t._length=a,a}(0,t,0,h);if(d){h("mode",d<u?"lines+markers":"lines"),h("text"),h("hovertext"),"fills"!==t.hoveron&&h("hovertemplate"),a.hasLines(t)&&(o(e,t,r,p,h),s(e,t,h),h("connectgaps")),a.hasMarkers(t)&&i(e,t,r,p,h,{gradient:!0}),a.hasText(t)&&(h("texttemplate"),l(e,t,p,h));var m=[];(a.hasMarkers(t)||a.hasText(t))&&(h("cliponaxis"),h("marker.maxdisplayed"),m.push("points")),h("fill"),"none"!==t.fill&&(c(e,t,r,h),a.hasLines(t)||s(e,t,h)),"tonext"!==t.fill&&"toself"!==t.fill||m.push("fills"),h("hoveron",m.join("+")||"points"),n.coerceSelectionMarkerOpacity(t,h)}else t.visible=!1}},{"../../lib":503,"../scatter/constants":930,"../scatter/fillcolor_defaults":934,"../scatter/line_defaults":939,"../scatter/line_shape_defaults":941,"../scatter/marker_defaults":945,"../scatter/subtypes":951,"../scatter/text_defaults":952,"./attributes":1014}],1017:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes");t.exports=function(e,t,r){var a={},i=r[t.subplot]._subplot;return a.realLabel=n.tickText(i.radialAxis,e.real,!0).text,a.imagLabel=n.tickText(i.angularAxis,e.imag,!0).text,a}},{"../../plots/cartesian/axes":554}],1018:[function(e,t,r){"use strict";var n=e("../scatter/hover");function a(e,t,r,n){var a=r.radialAxis,i=r.angularAxis;a._hovertitle="real",i._hovertitle="imag";var o={};o[t.subplot]={_subplot:r};var s=t._module.formatLabels(e,t,o);n.realLabel=s.realLabel,n.imagLabel=s.imagLabel;var l=e.hi||t.hoverinfo,c=[];function u(e,t){c.push(e._hovertitle+": "+t)}if(!t.hovertemplate){var f=l.split("+");-1!==f.indexOf("all")&&(f=["real","imag","text"]),-1!==f.indexOf("real")&&u(a,n.realLabel),-1!==f.indexOf("imag")&&u(i,n.imagLabel),-1!==f.indexOf("text")&&n.text&&(c.push(n.text),delete n.text),n.extraText=c.join("<br>")}}t.exports={hoverPoints:function(e,t,r,i){var o=n(e,t,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,a(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:a}},{"../scatter/hover":937}],1019:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"scattersmith",basePlotModule:e("../../plots/smith"),categories:["smith","symbols","showLegend","scatter-like"],attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,selectPoints:e("../scatter/select"),meta:{}}},{"../../plots/smith":629,"../scatter/marker_colorbar":944,"../scatter/select":948,"../scatter/style":950,"./attributes":1014,"./calc":1015,"./defaults":1016,"./format_labels":1017,"./hover":1018,"./plot":1020}],1020:[function(e,t,r){"use strict";var n=e("../scatter/plot"),a=e("../../constants/numerical").BADNUM,i=e("../../plots/smith/helpers").smith;t.exports=function(e,t,r){for(var o=t.layers.frontplot.select("g.scatterlayer"),s={xaxis:t.xaxis,yaxis:t.yaxis,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},l=0;l<r.length;l++)for(var c=r[l],u=0;u<c.length;u++){var f=c[u],p=f.real;if(p===a)f.x=f.y=a;else{var h=i([p,f.imag]);f.x=h[0],f.y=h[1]}}n(e,s,r,o)}},{"../../constants/numerical":479,"../../plots/smith/helpers":628,"../scatter/plot":947}],1021:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../../plots/template_attributes").texttemplateAttrs,i=e("../scatter/attributes"),o=e("../../plots/attributes"),s=e("../../components/colorscale/attributes"),l=e("../../components/drawing/attributes").dash,c=e("../../lib/extend").extendFlat,u=i.marker,f=i.line,p=u.line;t.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},i.mode,{dflt:"markers"}),text:c({},i.text,{}),texttemplate:a({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},i.hovertext,{}),line:{color:f.color,width:f.width,dash:l,shape:c({},f.shape,{values:["linear","spline"]}),smoothing:f.smoothing,editType:"calc"},connectgaps:i.connectgaps,cliponaxis:i.cliponaxis,fill:c({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i.fillcolor,marker:c({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:p.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:i.hoveron,hovertemplate:n()}},{"../../components/colorscale/attributes":373,"../../components/drawing/attributes":387,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/template_attributes":633,"../scatter/attributes":926}],1022:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../scatter/colorscale_calc"),i=e("../scatter/arrays_to_calcdata"),o=e("../scatter/calc_selection"),s=e("../scatter/calc").calcMarkerSize,l=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};t.exports=function(e,t){var r,u,f,p,h,d,m=e._fullLayout[t.subplot].sum,g=t.sum||m,y={a:t.a,b:t.b,c:t.c};for(r=0;r<l.length;r++)if(!y[f=l[r]]){for(h=y[c[f][0]],d=y[c[f][1]],p=new Array(h.length),u=0;u<h.length;u++)p[u]=g-h[u]-d[u];y[f]=p}var v,b,x,_,w,k,D=t._length,T=new Array(D);for(r=0;r<D;r++)v=y.a[r],b=y.b[r],x=y.c[r],n(v)&&n(b)&&n(x)?(1!=(_=m/((v=+v)+(b=+b)+(x=+x)))&&(v*=_,b*=_,x*=_),k=v,w=x-b,T[r]={x:w,y:k,a:v,b,c:x}):T[r]={x:!1,y:!1};return s(t,D),a(e,t),i(T,t),o(T,t),T}},{"../scatter/arrays_to_calcdata":925,"../scatter/calc":927,"../scatter/calc_selection":928,"../scatter/colorscale_calc":929,"fast-isnumeric":190}],1023:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../scatter/constants"),i=e("../scatter/subtypes"),o=e("../scatter/marker_defaults"),s=e("../scatter/line_defaults"),l=e("../scatter/line_shape_defaults"),c=e("../scatter/text_defaults"),u=e("../scatter/fillcolor_defaults"),f=e("./attributes");t.exports=function(e,t,r,p){function h(r,a){return n.coerce(e,t,f,r,a)}var d,m=h("a"),g=h("b"),y=h("c");if(m?(d=m.length,g?(d=Math.min(d,g.length),y&&(d=Math.min(d,y.length))):d=y?Math.min(d,y.length):0):g&&y&&(d=Math.min(g.length,y.length)),d){t._length=d,h("sum"),h("text"),h("hovertext"),"fills"!==t.hoveron&&h("hovertemplate"),h("mode",d<a.PTS_LINESONLY?"lines+markers":"lines"),i.hasLines(t)&&(s(e,t,r,p,h),l(e,t,h),h("connectgaps")),i.hasMarkers(t)&&o(e,t,r,p,h,{gradient:!0}),i.hasText(t)&&(h("texttemplate"),c(e,t,p,h));var v=[];(i.hasMarkers(t)||i.hasText(t))&&(h("cliponaxis"),h("marker.maxdisplayed"),v.push("points")),h("fill"),"none"!==t.fill&&(u(e,t,r,h),i.hasLines(t)||l(e,t,h)),"tonext"!==t.fill&&"toself"!==t.fill||v.push("fills"),h("hoveron",v.join("+")||"points"),n.coerceSelectionMarkerOpacity(t,h)}else t.visible=!1}},{"../../lib":503,"../scatter/constants":930,"../scatter/fillcolor_defaults":934,"../scatter/line_defaults":939,"../scatter/line_shape_defaults":941,"../scatter/marker_defaults":945,"../scatter/subtypes":951,"../scatter/text_defaults":952,"./attributes":1021}],1024:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a){if(t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),n[a]){var i=n[a];e.a=i.a,e.b=i.b,e.c=i.c}else e.a=t.a,e.b=t.b,e.c=t.c;return e}},{}],1025:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes");t.exports=function(e,t,r){var a={},i=r[t.subplot]._subplot;return a.aLabel=n.tickText(i.aaxis,e.a,!0).text,a.bLabel=n.tickText(i.baxis,e.b,!0).text,a.cLabel=n.tickText(i.caxis,e.c,!0).text,a}},{"../../plots/cartesian/axes":554}],1026:[function(e,t,r){"use strict";var n=e("../scatter/hover");t.exports=function(e,t,r,a){var i=n(e,t,r,a);if(i&&!1!==i[0].index){var o=i[0];if(void 0===o.index){var s=1-o.y0/e.ya._length,l=e.xa._length,c=l*s/2,u=l-c;return o.x0=Math.max(Math.min(o.x0,u),c),o.x1=Math.max(Math.min(o.x1,u),c),i}var f=o.cd[o.index],p=o.trace,h=o.subplot;o.a=f.a,o.b=f.b,o.c=f.c,o.xLabelVal=void 0,o.yLabelVal=void 0;var d={};d[p.subplot]={_subplot:h};var m=p._module.formatLabels(f,p,d);o.aLabel=m.aLabel,o.bLabel=m.bLabel,o.cLabel=m.cLabel;var g=f.hi||p.hoverinfo,y=[];if(!p.hovertemplate){var v=g.split("+");-1!==v.indexOf("all")&&(v=["a","b","c"]),-1!==v.indexOf("a")&&b(h.aaxis,o.aLabel),-1!==v.indexOf("b")&&b(h.baxis,o.bLabel),-1!==v.indexOf("c")&&b(h.caxis,o.cLabel)}return o.extraText=y.join("<br>"),o.hovertemplate=p.hovertemplate,i}function b(e,t){y.push(e._hovertitle+": "+t)}}},{"../scatter/hover":937}],1027:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../scatter/select"),eventData:e("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:e("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":634,"../scatter/marker_colorbar":944,"../scatter/select":948,"../scatter/style":950,"./attributes":1021,"./calc":1022,"./defaults":1023,"./event_data":1024,"./format_labels":1025,"./hover":1026,"./plot":1028}],1028:[function(e,t,r){"use strict";var n=e("../scatter/plot");t.exports=function(e,t,r){var a=t.plotContainer;a.select(".scatterlayer").selectAll("*").remove();var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:a,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},o=t.layers.frontplot.select("g.scatterlayer");n(e,i,r,o)}},{"../scatter/plot":947}],1029:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../components/colorscale/attributes"),i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=e("../../plots/template_attributes").hovertemplateAttrs,s=e("../scattergl/attributes"),l=e("../../plots/cartesian/constants").idRegex,c=e("../../plot_api/plot_template").templatedArray,u=e("../../lib/extend").extendFlat,f=n.marker,p=f.line,h=u(a("marker.line",{editTypeOverride:"calc"}),{width:u({},p.width,{editType:"calc"}),editType:"calc"}),d=u(a("marker"),{symbol:f.symbol,size:u({},f.size,{editType:"markerSize"}),sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,opacity:f.opacity,colorbar:f.colorbar,line:h,editType:"calc"});function m(e){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:l[e],editType:"plot"}}}d.color.editType=d.cmin.editType=d.cmax.editType="style",t.exports={dimensions:c("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:u({},s.text,{}),hovertext:u({},s.hovertext,{}),hovertemplate:o(),xhoverformat:i("x"),yhoverformat:i("y"),marker:d,xaxes:m("x"),yaxes:m("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:s.selected.marker,editType:"calc"},unselected:{marker:s.unselected.marker,editType:"calc"},opacity:s.opacity}},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plot_api/plot_template":543,"../../plots/cartesian/axis_format_attributes":557,"../../plots/cartesian/constants":561,"../../plots/template_attributes":633,"../scatter/attributes":926,"../scattergl/attributes":978}],1030:[function(e,t,r){"use strict";var n=e("regl-line2d"),a=e("../../registry"),i=e("../../lib/prepare_regl"),o=e("../../plots/get_data").getModuleCalcData,s=e("../../plots/cartesian"),l=e("../../plots/cartesian/axis_ids").getFromId,c=e("../../plots/cartesian/axes").shouldShowZeroLine;function u(e,t,r){for(var n=r.matrixOptions.data.length,a=t._visibleDims,i=r.viewOpts.ranges=new Array(n),o=0;o<a.length;o++){var s=a[o],c=i[o]=new Array(4),u=l(e,t._diag[s][0]);u&&(c[0]=u.r2l(u.range[0]),c[2]=u.r2l(u.range[1]));var f=l(e,t._diag[s][1]);f&&(c[1]=f.r2l(f.range[0]),c[3]=f.r2l(f.range[1]))}r.selectBatch.length||r.unselectBatch.length?r.matrix.update({ranges:i},{ranges:i}):r.matrix.update({ranges:i})}function f(e){var t=e._fullLayout,r=t._glcanvas.data()[0].regl,a=t._splomGrid;a||(a=t._splomGrid=n(r)),a.update(function(e){var t,r=e._context.plotGlPixelRatio,n=e._fullLayout,a=n._size,i=[0,0,n.width*r,n.height*r],o={};function s(e,t,n,a,s,l){n*=r,a*=r,s*=r,l*=r;var c=t[e+"color"],u=t[e+"width"],f=String(c+u);f in o?o[f].data.push(NaN,NaN,n,a,s,l):o[f]={data:[n,a,s,l],join:"rect",thickness:u*r,color:c,viewport:i,range:i,overlay:!1}}for(t in n._splomSubplots){var l,u,f=n._plots[t],p=f.xaxis,h=f.yaxis,d=p._gridVals,m=h._gridVals,g=p._offset,y=p._length,v=h._length,b=a.b+h.domain[0]*a.h,x=-h._m,_=-x*h.r2l(h.range[0],h.calendar);if(p.showgrid)for(t=0;t<d.length;t++)l=g+p.l2p(d[t].x),s("grid",p,l,b,l,b+v);if(h.showgrid)for(t=0;t<m.length;t++)s("grid",h,g,u=b+_+x*m[t].x,g+y,u);c(e,p,h)&&(l=g+p.l2p(0),s("zeroline",p,l,b,l,b+v)),c(e,h,p)&&s("zeroline",h,g,u=b+_+0,g+y,u)}var w=[];for(t in o)w.push(o[t]);return w}(e))}t.exports={name:"splom",attr:s.attr,attrRegex:s.attrRegex,layoutAttributes:s.layoutAttributes,supplyLayoutDefaults:s.supplyLayoutDefaults,drawFramework:s.drawFramework,plot:function(e){var t=e._fullLayout,r=a.getModule("splom"),n=o(e.calcdata,r)[0];i(e,["ANGLE_instanced_arrays","OES_element_index_uint"])&&(t._hasOnlyLargeSploms&&f(e),r.plot(e,{},n))},drag:function(e){var t=e.calcdata,r=e._fullLayout;r._hasOnlyLargeSploms&&f(e);for(var n=0;n<t.length;n++){var a=t[n][0].trace,i=r._splomScenes[a.uid];"splom"===a.type&&i&&i.matrix&&u(e,a,i)}},updateGrid:f,clean:function(e,t,r,n){var a,i={};if(n._splomScenes){for(a=0;a<e.length;a++){var o=e[a];"splom"===o.type&&(i[o.uid]=1)}for(a=0;a<r.length;a++){var l=r[a];if(!i[l.uid]){var c=n._splomScenes[l.uid];c&&c.destroy&&c.destroy(),n._splomScenes[l.uid]=null,delete n._splomScenes[l.uid]}}}0===Object.keys(n._splomScenes||{}).length&&delete n._splomScenes,n._splomGrid&&!t._hasOnlyLargeSploms&&n._hasOnlyLargeSploms&&(n._splomGrid.destroy(),n._splomGrid=null,delete n._splomGrid),s.clean(e,t,r,n)},updateFx:s.updateFx,toSVG:s.toSVG}},{"../../lib/prepare_regl":516,"../../plots/cartesian":568,"../../plots/cartesian/axes":554,"../../plots/cartesian/axis_ids":558,"../../plots/get_data":593,"../../registry":638,"regl-line2d":280}],1031:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../scatter/calc").calcMarkerSize,o=e("../scatter/calc").calcAxisExpansion,s=e("../scatter/colorscale_calc"),l=e("../scattergl/convert").markerSelection,c=e("../scattergl/convert").markerStyle,u=e("./scene_update"),f=e("../../constants/numerical").BADNUM,p=e("../scattergl/constants").TOO_MANY_POINTS;t.exports=function(e,t){var r,h,d,m,g,y,v=t.dimensions,b=t._length,x={},_=x.cdata=[],w=x.data=[],k=t._visibleDims=[];function D(e,r){for(var a=e.makeCalcdata({v:r.values,vcalendar:t.calendar},"v"),i=0;i<a.length;i++)a[i]=a[i]===f?NaN:a[i];_.push(a),w.push("log"===e.type?n.simpleMap(a,e.c2l):a)}for(r=0;r<v.length;r++)if((d=v[r]).visible){if(m=a.getFromId(e,t._diag[r][0]),g=a.getFromId(e,t._diag[r][1]),m&&g&&m.type!==g.type){n.log("Skipping splom dimension "+r+" with conflicting axis types");continue}m?(D(m,d),g&&"category"===g.type&&(g._categories=m._categories.slice())):D(g,d),k.push(r)}for(s(e,t),n.extendFlat(x,c(t)),y=_.length*b>p?x.sizeAvg||Math.max(x.size,3):i(t,b),h=0;h<k.length;h++)d=v[r=k[h]],m=a.getFromId(e,t._diag[r][0])||{},g=a.getFromId(e,t._diag[r][1])||{},o(e,t,m,g,_[h],_[h],y);var T=u(e,t);return T.matrix||(T.matrix=!0),T.matrixOptions=x,T.selectedOptions=l(t,t.selected),T.unselectedOptions=l(t,t.unselected),[{x:!1,y:!1,t:{},trace:t}]}},{"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/axis_ids":558,"../scatter/calc":927,"../scatter/colorscale_calc":929,"../scattergl/constants":980,"../scattergl/convert":981,"./scene_update":1038}],1032:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("../scatter/subtypes"),s=e("../scatter/marker_defaults"),l=e("../parcoords/merge_length"),c=e("../scattergl/helpers").isOpenSymbol;function u(e,t){function r(r,a){return n.coerce(e,t,i.dimensions,r,a)}r("label");var a=r("values");a&&a.length?r("visible"):t.visible=!1,r("axis.type"),r("axis.matches")}t.exports=function(e,t,r,f){function p(r,a){return n.coerce(e,t,i,r,a)}var h=a(e,t,{name:"dimensions",handleItemDefaults:u}),d=p("diagonal.visible"),m=p("showupperhalf"),g=p("showlowerhalf");if(l(t,h,"values")&&(d||m||g)){p("text"),p("hovertext"),p("hovertemplate"),p("xhoverformat"),p("yhoverformat"),s(e,t,r,f,p);var y=c(t.marker.symbol),v=o.isBubble(t);p("marker.line.width",y||v?1:0),function(e,t,r,n){var a,i,o=t.dimensions,s=o.length,l=t.showupperhalf,c=t.showlowerhalf,u=t.diagonal.visible,f=new Array(s),p=new Array(s);for(a=0;a<s;a++){var h=a?a+1:"";f[a]="x"+h,p[a]="y"+h}var d=n("xaxes",f),m=n("yaxes",p),g=t._diag=new Array(s);t._xaxes={},t._yaxes={};var y=[],v=[];function b(e,n,a,i){if(e){var o=e.charAt(0),s=r._splomAxes[o];if(t["_"+o+"axes"][e]=1,i.push(e),!(e in s)){var l=s[e]={};a&&(l.label=a.label||"",a.visible&&a.axis&&(a.axis.type&&(l.type=a.axis.type),a.axis.matches&&(l.matches=n)))}}}var x=!u&&!c,_=!u&&!l;for(t._axesDim={},a=0;a<s;a++){var w=o[a],k=0===a,D=a===s-1,T=k&&x||D&&_?void 0:d[a],A=k&&_||D&&x?void 0:m[a];b(T,A,w,y),b(A,T,w,v),g[a]=[T,A],t._axesDim[T]=a,t._axesDim[A]=a}for(a=0;a<y.length;a++)for(i=0;i<v.length;i++){var S=y[a]+v[i];a>i&&l||a<i&&c?r._splomSubplots[S]=1:a!==i||!u&&c&&l||(r._splomSubplots[S]=1)}(!c||!u&&l&&c)&&(r._splomGridDflt.xside="bottom",r._splomGridDflt.yside="left")}(0,t,f,p),n.coerceSelectionMarkerOpacity(t,p)}else t.visible=!1}},{"../../lib":503,"../../plots/array_container_defaults":549,"../parcoords/merge_length":897,"../scatter/marker_defaults":945,"../scatter/subtypes":951,"../scattergl/helpers":985,"./attributes":1029}],1033:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../scatter/colorscale_calc"),i=e("../scattergl/convert").markerStyle;t.exports=function(e,t){var r=t.trace,o=e._fullLayout._splomScenes[r.uid];if(o){a(e,r),n.extendFlat(o.matrixOptions,i(r));var s=n.extendFlat({},o.matrixOptions,o.viewOpts);o.matrix.update(s,null)}}},{"../../lib":503,"../scatter/colorscale_calc":929,"../scattergl/convert":981}],1034:[function(e,t,r){"use strict";r.getDimIndex=function(e,t){for(var r=t._id,n={x:0,y:1}[r.charAt(0)],a=e._visibleDims,i=0;i<a.length;i++){var o=a[i];if(e._diag[o][n]===r)return i}return!1}},{}],1035:[function(e,t,r){"use strict";var n=e("./helpers"),a=e("../scattergl/hover").calcHover;t.exports={hoverPoints:function(e,t,r){var i=e.cd[0].trace,o=e.scene.matrixOptions.cdata,s=e.xa,l=e.ya,c=s.c2p(t),u=l.c2p(r),f=e.distance,p=n.getDimIndex(i,s),h=n.getDimIndex(i,l);if(!1===p||!1===h)return[e];for(var d,m,g=o[p],y=o[h],v=f,b=0;b<g.length;b++){var x=g[b],_=y[b],w=s.c2p(x)-c,k=l.c2p(_)-u,D=Math.sqrt(w*w+k*k);D<v&&(v=m=D,d=b)}return e.index=d,e.distance=v,e.dxy=m,void 0===d?[e]:[a(e,g,y,i)]}}},{"../scattergl/hover":986,"./helpers":1034}],1036:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../components/grid");t.exports={moduleType:"trace",name:"splom",basePlotModule:e("./base_plot"),categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),calc:e("./calc"),plot:e("./plot"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("./select"),editStyle:e("./edit_style"),meta:{}},n.register(a)},{"../../components/grid":410,"../../registry":638,"../scatter/marker_colorbar":944,"./attributes":1029,"./base_plot":1030,"./calc":1031,"./defaults":1032,"./edit_style":1033,"./hover":1035,"./plot":1037,"./select":1039}],1037:[function(e,t,r){"use strict";var n=e("regl-splom"),a=e("../../lib"),i=e("../../plots/cartesian/axis_ids"),o=e("../../components/dragelement/helpers").selectMode;function s(e,t){var r,s,l,c,u,f=e._fullLayout,p=f._size,h=t.trace,d=t.t,m=f._splomScenes[h.uid],g=m.matrixOptions,y=g.cdata,v=f._glcanvas.data()[0].regl,b=f.dragmode;if(0!==y.length){g.lower=h.showupperhalf,g.upper=h.showlowerhalf,g.diagonal=h.diagonal.visible;var x=h._visibleDims,_=y.length,w=m.viewOpts={};for(w.ranges=new Array(_),w.domains=new Array(_),u=0;u<x.length;u++){l=x[u];var k=w.ranges[u]=new Array(4),D=w.domains[u]=new Array(4);(r=i.getFromId(e,h._diag[l][0]))&&(k[0]=r._rl[0],k[2]=r._rl[1],D[0]=r.domain[0],D[2]=r.domain[1]),(s=i.getFromId(e,h._diag[l][1]))&&(k[1]=s._rl[0],k[3]=s._rl[1],D[1]=s.domain[0],D[3]=s.domain[1])}var T=e._context.plotGlPixelRatio,A=p.l*T,S=p.b*T,M=p.w*T,E=p.h*T;w.viewport=[A,S,M+A,E+S],!0===m.matrix&&(m.matrix=n(v));var C=f.clickmode.indexOf("select")>-1,N=!0;if(o(b)||h.selectedpoints||C){var O=h._length;if(h.selectedpoints){m.selectBatch=h.selectedpoints;var I=h.selectedpoints,P={};for(l=0;l<I.length;l++)P[I[l]]=!0;var R=[];for(l=0;l<O;l++)P[l]||R.push(l);m.unselectBatch=R}var L=d.xpx=new Array(_),F=d.ypx=new Array(_);for(u=0;u<x.length;u++){if(l=x[u],r=i.getFromId(e,h._diag[l][0]))for(L[u]=new Array(O),c=0;c<O;c++)L[u][c]=r.c2p(y[u][c]);if(s=i.getFromId(e,h._diag[l][1]))for(F[u]=new Array(O),c=0;c<O;c++)F[u][c]=s.c2p(y[u][c])}if(m.selectBatch.length||m.unselectBatch.length){var B=a.extendFlat({},g,m.unselectedOptions,w),z=a.extendFlat({},g,m.selectedOptions,w);m.matrix.update(B,z),N=!1}}else d.xpx=d.ypx=null;if(N){var j=a.extendFlat({},g,w);m.matrix.update(j,null)}}}t.exports=function(e,t,r){if(r.length)for(var n=0;n<r.length;n++)s(e,r[n][0])}},{"../../components/dragelement/helpers":384,"../../lib":503,"../../plots/cartesian/axis_ids":558,"regl-splom":282}],1038:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){var r=e._fullLayout,a=t.uid,i=r._splomScenes;i||(i=r._splomScenes={});var o={dirty:!0,selectBatch:[],unselectBatch:[]},s=i[t.uid];return s||((s=i[a]=n.extendFlat({},o,{matrix:!1,selectBatch:[],unselectBatch:[]})).draw=function(){s.matrix&&s.matrix.draw&&(s.selectBatch.length||s.unselectBatch.length?s.matrix.draw(s.unselectBatch,s.selectBatch):s.matrix.draw()),s.dirty=!1},s.destroy=function(){s.matrix&&s.matrix.destroy&&s.matrix.destroy(),s.matrixOptions=null,s.selectBatch=null,s.unselectBatch=null,s=null}),s.dirty||n.extendFlat(s,o),s}},{"../../lib":503}],1039:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../scatter/subtypes"),i=e("./helpers");t.exports=function(e,t){var r=e.cd,o=r[0].trace,s=r[0].t,l=e.scene,c=l.matrixOptions.cdata,u=e.xaxis,f=e.yaxis,p=[];if(!l)return p;var h=!a.hasMarkers(o)&&!a.hasText(o);if(!0!==o.visible||h)return p;var d=i.getDimIndex(o,u),m=i.getDimIndex(o,f);if(!1===d||!1===m)return p;var g=s.xpx[d],y=s.ypx[m],v=c[d],b=c[m],x=[],_=[];if(!1!==t&&!t.degenerate)for(var w=0;w<v.length;w++)t.contains([g[w],y[w]],null,w,e)?(x.push(w),p.push({pointNumber:w,x:v[w],y:b[w]})):_.push(w);var k=l.matrixOptions;return x.length||_.length?l.selectBatch.length||l.unselectBatch.length||l.matrix.update(l.unselectedOptions,n.extendFlat({},k,l.selectedOptions,l.viewOpts)):l.matrix.update(k,null),l.selectBatch=x,l.unselectBatch=_,p}},{"../../lib":503,"../scatter/subtypes":951,"./helpers":1034}],1040:[function(e,t,r){"use strict";var n=e("../../components/colorscale/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../mesh3d/attributes"),s=e("../../plots/attributes"),l=e("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),uhoverformat:a("u",1),vhoverformat:a("v",1),whoverformat:a("w",1),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(e){c[e]=o[e]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,t.exports=c},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../mesh3d/attributes":867}],1041:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/colorscale/calc");function i(e){var t,r,a,i,s,l,c,u,f,p,h,d,m=e._x,g=e._y,y=e._z,v=e._len,b=-1/0,x=1/0,_=-1/0,w=1/0,k=-1/0,D=1/0,T="";for(v&&(c=m[0],f=g[0],h=y[0]),v>1&&(u=m[v-1],p=g[v-1],d=y[v-1]),t=0;t<v;t++)b=Math.max(b,m[t]),x=Math.min(x,m[t]),_=Math.max(_,g[t]),w=Math.min(w,g[t]),k=Math.max(k,y[t]),D=Math.min(D,y[t]),i||m[t]===c||(i=!0,T+="x"),s||g[t]===f||(s=!0,T+="y"),l||y[t]===h||(l=!0,T+="z");i||(T+="x"),s||(T+="y"),l||(T+="z");var A=o(e._x),S=o(e._y),M=o(e._z);T=(T=(T=T.replace("x",(c>u?"-":"+")+"x")).replace("y",(f>p?"-":"+")+"y")).replace("z",(h>d?"-":"+")+"z");var E=function(){v=0,A=[],S=[],M=[]};(!v||v<A.length*S.length*M.length)&&E();var C=function(e){return"x"===e?m:"y"===e?g:y},N=function(e){return"x"===e?A:"y"===e?S:M},O=function(e){return e[v-1]<e[0]?-1:1},I=C(T[1]),P=C(T[3]),R=C(T[5]),L=N(T[1]).length,F=N(T[3]).length,B=N(T[5]).length,z=!1,j=function(e,t,r){return L*(F*e+t)+r},U=O(C(T[1])),$=O(C(T[3])),V=O(C(T[5]));for(t=0;t<B-1;t++){for(r=0;r<F-1;r++){for(a=0;a<L-1;a++){var q=j(t,r,a),W=j(t,r,a+1),H=j(t,r+1,a),G=j(t+1,r,a);if(I[q]*U<I[W]*U&&P[q]*$<P[H]*$&&R[q]*V<R[G]*V||(z=!0),z)break}if(z)break}if(z)break}return z&&(n.warn("Encountered arbitrary coordinates! Unable to input data grid."),E()),{xMin:x,yMin:w,zMin:D,xMax:b,yMax:_,zMax:k,Xs:A,Ys:S,Zs:M,len:v,fill:T}}function o(e){return n.distinctVals(e).vals}function s(e,t){if(void 0===t&&(t=e.length),n.isTypedArray(e))return e.subarray(0,t);for(var r=[],a=0;a<t;a++)r[a]=+e[a];return r}t.exports={calc:function(e,t){t._len=Math.min(t.u.length,t.v.length,t.w.length,t.x.length,t.y.length,t.z.length),t._u=s(t.u,t._len),t._v=s(t.v,t._len),t._w=s(t.w,t._len),t._x=s(t.x,t._len),t._y=s(t.y,t._len),t._z=s(t.z,t._len);var r=i(t);t._gridFill=r.fill,t._Xs=r.Xs,t._Ys=r.Ys,t._Zs=r.Zs,t._len=r.len;var n,o,l,c=0;t.starts&&(n=s(t.starts.x||[]),o=s(t.starts.y||[]),l=s(t.starts.z||[]),c=Math.min(n.length,o.length,l.length)),t._startsX=n||[],t._startsY=o||[],t._startsZ=l||[];var u,f=0,p=1/0;for(u=0;u<t._len;u++){var h=t._u[u],d=t._v[u],m=t._w[u],g=Math.sqrt(h*h+d*d+m*m);f=Math.max(f,g),p=Math.min(p,g)}for(a(e,t,{vals:[p,f],containerStr:"",cLetter:"c"}),u=0;u<c;u++){var y=n[u];r.xMax=Math.max(r.xMax,y),r.xMin=Math.min(r.xMin,y);var v=o[u];r.yMax=Math.max(r.yMax,v),r.yMin=Math.min(r.yMin,v);var b=l[u];r.zMax=Math.max(r.zMax,b),r.zMin=Math.min(r.zMin,b)}t._slen=c,t._normMax=f,t._xbnds=[r.xMin,r.xMax],t._ybnds=[r.yMin,r.yMax],t._zbnds=[r.zMin,r.zMax]},filter:s,processGrid:i}},{"../../components/colorscale/calc":374,"../../lib":503}],1042:[function(e,t,r){"use strict";var n=e("../../../stackgl_modules").gl_streamtube3d,a=n.createTubeMesh,i=e("../../lib"),o=e("../../lib/gl_format_color").parseColorScale,s=e("../../components/colorscale").extractOpts,l=e("../../plots/gl3d/zip3"),c={xaxis:0,yaxis:1,zaxis:2};function u(e,t){this.scene=e,this.uid=t,this.mesh=null,this.data=null}var f=u.prototype;function p(e){var t=e.length;return t>2?e.slice(1,t-1):2===t?[(e[0]+e[1])/2]:e}function h(e){var t=e.length;return 1===t?[.5,.5]:[e[1]-e[0],e[t-1]-e[t-2]]}function d(e,t){var r=e.fullSceneLayout,a=e.dataScale,u=t._len,f={};function d(e,t){var n=r[t],o=a[c[t]];return i.simpleMap(e,(function(e){return n.d2l(e)*o}))}if(f.vectors=l(d(t._u,"xaxis"),d(t._v,"yaxis"),d(t._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=d(t._Xs,"xaxis"),g=d(t._Ys,"yaxis"),y=d(t._Zs,"zaxis");if(f.meshgrid=[m,g,y],f.gridFill=t._gridFill,t._slen)f.startingPositions=l(d(t._startsX,"xaxis"),d(t._startsY,"yaxis"),d(t._startsZ,"zaxis"));else{for(var v=g[0],b=p(m),x=p(y),_=new Array(b.length*x.length),w=0,k=0;k<b.length;k++)for(var D=0;D<x.length;D++)_[w++]=[b[k],v,x[D]];f.startingPositions=_}f.colormap=o(t),f.tubeSize=t.sizeref,f.maxLength=t.maxdisplayed;var T=d(t._xbnds,"xaxis"),A=d(t._ybnds,"yaxis"),S=d(t._zbnds,"zaxis"),M=h(m),E=h(g),C=h(y),N=[[T[0]-M[0],A[0]-E[0],S[0]-C[0]],[T[1]+M[1],A[1]+E[1],S[1]+C[1]]],O=n(f,N),I=s(t);O.vertexIntensityBounds=[I.min/t._normMax,I.max/t._normMax];var P=t.lightposition;return O.lightPosition=[P.x,P.y,P.z],O.ambient=t.lighting.ambient,O.diffuse=t.lighting.diffuse,O.specular=t.lighting.specular,O.roughness=t.lighting.roughness,O.fresnel=t.lighting.fresnel,O.opacity=t.opacity,t._pad=O.tubeScale*t.sizeref*2,O}f.handlePick=function(e){var t=this.scene.fullSceneLayout,r=this.scene.dataScale;function n(e,n){var a=t[n],i=r[c[n]];return a.l2c(e)/i}if(e.object===this.mesh){var a=e.data.position,i=e.data.velocity;return e.traceCoordinate=[n(a[0],"xaxis"),n(a[1],"yaxis"),n(a[2],"zaxis"),n(i[0],"xaxis"),n(i[1],"yaxis"),n(i[2],"zaxis"),e.data.intensity*this.data._normMax,e.data.divergence],e.textLabel=this.data.hovertext||this.data.text,!0}},f.update=function(e){this.data=e;var t=d(this.scene,e);this.mesh.update(t)},f.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var r=e.glplot.gl,n=d(e,t),i=a(r,n),o=new u(e,t.uid);return o.mesh=i,o.data=t,i._trace=o,e.glplot.add(i),o}},{"../../../stackgl_modules":1120,"../../components/colorscale":378,"../../lib":503,"../../lib/gl_format_color":499,"../../plots/gl3d/zip3":609}],1043:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/colorscale/defaults"),i=e("./attributes");t.exports=function(e,t,r,o){function s(r,a){return n.coerce(e,t,i,r,a)}var l=s("u"),c=s("v"),u=s("w"),f=s("x"),p=s("y"),h=s("z");l&&l.length&&c&&c.length&&u&&u.length&&f&&f.length&&p&&p.length&&h&&h.length?(s("starts.x"),s("starts.y"),s("starts.z"),s("maxdisplayed"),s("sizeref"),s("lighting.ambient"),s("lighting.diffuse"),s("lighting.specular"),s("lighting.roughness"),s("lighting.fresnel"),s("lightposition.x"),s("lightposition.y"),s("lightposition.z"),a(e,t,o,s,{prefix:"",cLetter:"c"}),s("text"),s("hovertext"),s("hovertemplate"),s("uhoverformat"),s("vhoverformat"),s("whoverformat"),s("xhoverformat"),s("yhoverformat"),s("zhoverformat"),t._length=null):t.visible=!1}},{"../../components/colorscale/defaults":376,"../../lib":503,"./attributes":1040}],1044:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"streamtube",basePlotModule:e("../../plots/gl3d"),categories:["gl3d","showLegend"],attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:{min:"cmin",max:"cmax"},calc:e("./calc").calc,plot:e("./convert"),eventData:function(e,t){return e.tubex=e.x,e.tubey=e.y,e.tubez=e.z,e.tubeu=t.traceCoordinate[3],e.tubev=t.traceCoordinate[4],e.tubew=t.traceCoordinate[5],e.norm=t.traceCoordinate[6],e.divergence=t.traceCoordinate[7],delete e.x,delete e.y,delete e.z,e},meta:{}}},{"../../plots/gl3d":598,"./attributes":1040,"./calc":1041,"./convert":1042,"./defaults":1043}],1045:[function(e,t,r){"use strict";var n=e("../../plots/attributes"),a=e("../../plots/template_attributes").hovertemplateAttrs,i=e("../../plots/template_attributes").texttemplateAttrs,o=e("../../components/colorscale/attributes"),s=e("../../plots/domain").attributes,l=e("../pie/attributes"),c=e("./constants"),u=e("../../lib/extend").extendFlat;t.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:u({colors:{valType:"data_array",editType:"calc"},line:{color:u({},l.marker.line.color,{dflt:null}),width:u({},l.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},o("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:l.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:l.hovertext,hoverinfo:u({},n.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:a({},{keys:c.eventDataKeys}),textfont:l.textfont,insidetextorientation:l.insidetextorientation,insidetextfont:l.insidetextfont,outsidetextfont:u({},l.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:l.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:s({name:"sunburst",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/domain":584,"../../plots/template_attributes":633,"../pie/attributes":900,"./constants":1048}],1046:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="sunburst",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":619}],1047:[function(e,t,r){"use strict";var n=e("d3-hierarchy"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../components/colorscale").makeColorScaleFuncFromTrace,s=e("../pie/calc").makePullColorFn,l=e("../pie/calc").generateExtendedColors,c=e("../../components/colorscale").calc,u=e("../../constants/numerical").ALMOST_EQUAL,f={},p={},h={};r.calc=function(e,t){var r,l,f,p,h,d,m=e._fullLayout,g=t.ids,y=i.isArrayOrTypedArray(g),v=t.labels,b=t.parents,x=t.values,_=i.isArrayOrTypedArray(x),w=[],k={},D={},T=function(e){return e||"number"==typeof e},A=function(e){return!_||a(x[e])&&x[e]>=0};y?(r=Math.min(g.length,b.length),l=function(e){return T(g[e])&&A(e)},f=function(e){return String(g[e])}):(r=Math.min(v.length,b.length),l=function(e){return T(v[e])&&A(e)},f=function(e){return String(v[e])}),_&&(r=Math.min(r,x.length));for(var S=0;S<r;S++)if(l(S)){var M=f(S),E=T(b[S])?String(b[S]):"",C={i:S,id:M,pid:E,label:T(v[S])?String(v[S]):""};_&&(C.v=+x[S]),w.push(C),h=M,k[p=E]?k[p].push(h):k[p]=[h],D[h]=1}if(k[""]){if(k[""].length>1){for(var N=i.randstr(),O=0;O<w.length;O++)""===w[O].pid&&(w[O].pid=N);w.unshift({hasMultipleRoots:!0,id:N,pid:"",label:""})}}else{var I,P=[];for(I in k)D[I]||P.push(I);if(1!==P.length)return i.warn(["Multiple implied roots, cannot build",t.type,"hierarchy of",t.name+".","These roots include:",P.join(", ")].join(" "));I=P[0],w.unshift({hasImpliedRoot:!0,id:I,pid:"",label:I})}try{d=n.stratify().id((function(e){return e.id})).parentId((function(e){return e.pid}))(w)}catch(e){return i.warn(["Failed to build",t.type,"hierarchy of",t.name+".","Error:",e.message].join(" "))}var R=n.hierarchy(d),L=!1;if(_)switch(t.branchvalues){case"remainder":R.sum((function(e){return e.data.v}));break;case"total":R.each((function(e){var r=e.data.data,n=r.v;if(e.children){var a=e.children.reduce((function(e,t){return e+t.data.data.v}),0);if((r.hasImpliedRoot||r.hasMultipleRoots)&&(n=a),n<a*u)return L=!0,i.warn(["Total value for node",e.data.data.id,"of",t.name,"is smaller than the sum of its children.","\nparent value =",n,"\nchildren sum =",a].join(" "))}e.value=n}))}else!function e(t,r,n){var a=0,i=t.children;if(i){for(var o=i.length,s=0;s<o;s++)a+=e(i[s],r,n);n.branches&&a++}else n.leaves&&a++;return t.value=t.data.data.value=a,r._values||(r._values=[]),r._values[t.data.data.i]=a,a}(R,t,{branches:-1!==t.count.indexOf("branches"),leaves:-1!==t.count.indexOf("leaves")});if(!L){var F,B;t.sort&&R.sort((function(e,t){return t.value-e.value}));var z=t.marker.colors||[],j=!!z.length;return t._hasColorscale?(j||(z=_?t.values:t._values),c(e,t,{vals:z,containerStr:"marker",cLetter:"c"}),B=o(t.marker)):F=s(m["_"+t.type+"colormap"]),R.each((function(e){var r=e.data.data;r.color=t._hasColorscale?B(z[r.i]):F(z[r.i],r.id)})),w[0].hierarchy=R,w}},r._runCrossTraceCalc=function(e,t){var r=t._fullLayout,n=t.calcdata,a=r[e+"colorway"],i=r["_"+e+"colormap"];r["extend"+e+"colors"]&&(a=l(a,"icicle"===e?h:"treemap"===e?p:f));var o,s=0;function c(e){var t=e.data.data,r=t.id;!1===t.color&&(i[r]?t.color=i[r]:e.parent?e.parent.parent?t.color=e.parent.data.data.color:(i[r]=t.color=a[s%a.length],s++):t.color=o)}for(var u=0;u<n.length;u++){var d=n[u][0];d.trace.type===e&&d.hierarchy&&(o=d.trace.root.color,d.hierarchy.each(c))}},r.crossTraceCalc=function(e){return r._runCrossTraceCalc("sunburst",e)}},{"../../components/colorscale":378,"../../constants/numerical":479,"../../lib":503,"../pie/calc":902,"d3-hierarchy":115,"fast-isnumeric":190}],1048:[function(e,t,r){"use strict";t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}},{}],1049:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults,o=e("../bar/defaults").handleText,s=e("../../components/colorscale"),l=s.hasColorscale,c=s.handleDefaults;t.exports=function(e,t,r,s){function u(r,i){return n.coerce(e,t,a,r,i)}var f=u("labels"),p=u("parents");if(f&&f.length&&p&&p.length){var h=u("values");h&&h.length?u("branchvalues"):u("count"),u("level"),u("maxdepth"),u("marker.line.width")&&u("marker.line.color",s.paper_bgcolor),u("marker.colors");var d=t._hasColorscale=l(e,"marker","colors")||(e.marker||{}).coloraxis;d&&c(e,t,s,u,{prefix:"marker.",cLetter:"c"}),u("leaf.opacity",d?1:.7);var m=u("text");u("texttemplate"),t.texttemplate||u("textinfo",Array.isArray(m)?"text+label":"label"),u("hovertext"),u("hovertemplate"),o(e,t,s,u,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),u("insidetextorientation"),u("sort"),u("rotation"),u("root.color"),i(t,s,u),t._length=null}else t.visible=!1}},{"../../components/colorscale":378,"../../lib":503,"../../plots/domain":584,"../bar/defaults":652,"./attributes":1045}],1050:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../components/fx/helpers").appendArrayPointValue,o=e("../../components/fx"),s=e("../../lib"),l=e("../../lib/events"),c=e("./helpers"),u=e("../pie/helpers").formatPieValue;function f(e,t,r){for(var n=e.data.data,a={curveNumber:t.index,pointNumber:n.i,data:t._input,fullData:t},o=0;o<r.length;o++){var s=r[o];s in e&&(a[s]=e[s])}return"parentString"in e&&!c.isHierarchyRoot(e)&&(a.parent=e.parentString),i(a,t,n.i),a}t.exports=function(e,t,r,i,p){var h=i[0],d=h.trace,m=h.hierarchy,g="sunburst"===d.type,y="treemap"===d.type||"icicle"===d.type;"_hasHoverLabel"in d||(d._hasHoverLabel=!1),"_hasHoverEvent"in d||(d._hasHoverEvent=!1),e.on("mouseover",(function(a){var i=r._fullLayout;if(!r._dragging&&!1!==i.hovermode){var l,v=r._fullData[d.index],b=a.data.data,x=b.i,_=c.isHierarchyRoot(a),w=c.getParent(m,a),k=c.getValue(a),D=function(e){return s.castOption(v,x,e)},T=D("hovertemplate"),A=o.castHoverinfo(v,i,x),S=i.separators;if(T||A&&"none"!==A&&"skip"!==A){var M,E;g&&(M=h.cx+a.pxmid[0]*(1-a.rInscribed),E=h.cy+a.pxmid[1]*(1-a.rInscribed)),y&&(M=a._hoverX,E=a._hoverY);var C,N={},O=[],I=[],P=function(e){return-1!==O.indexOf(e)};A&&(O="all"===A?v._module.attributes.hoverinfo.flags:A.split("+")),N.label=b.label,P("label")&&N.label&&I.push(N.label),b.hasOwnProperty("v")&&(N.value=b.v,N.valueLabel=u(N.value,S),P("value")&&I.push(N.valueLabel)),N.currentPath=a.currentPath=c.getPath(a.data),P("current path")&&!_&&I.push(N.currentPath);var R=[],L=function(){-1===R.indexOf(C)&&(I.push(C),R.push(C))};N.percentParent=a.percentParent=k/c.getValue(w),N.parent=a.parentString=c.getPtLabel(w),P("percent parent")&&(C=c.formatPercent(N.percentParent,S)+" of "+N.parent,L()),N.percentEntry=a.percentEntry=k/c.getValue(t),N.entry=a.entry=c.getPtLabel(t),!P("percent entry")||_||a.onPathbar||(C=c.formatPercent(N.percentEntry,S)+" of "+N.entry,L()),N.percentRoot=a.percentRoot=k/c.getValue(m),N.root=a.root=c.getPtLabel(m),P("percent root")&&!_&&(C=c.formatPercent(N.percentRoot,S)+" of "+N.root,L()),N.text=D("hovertext")||D("text"),P("text")&&(C=N.text,s.isValidTextValue(C)&&I.push(C)),l=[f(a,v,p.eventDataKeys)];var F={trace:v,y:E,_x0:a._x0,_x1:a._x1,_y0:a._y0,_y1:a._y1,text:I.join("<br>"),name:T||P("name")?v.name:void 0,color:D("hoverlabel.bgcolor")||b.color,borderColor:D("hoverlabel.bordercolor"),fontFamily:D("hoverlabel.font.family"),fontSize:D("hoverlabel.font.size"),fontColor:D("hoverlabel.font.color"),nameLength:D("hoverlabel.namelength"),textAlign:D("hoverlabel.align"),hovertemplate:T,hovertemplateLabels:N,eventData:l};g&&(F.x0=M-a.rInscribed*a.rpx1,F.x1=M+a.rInscribed*a.rpx1,F.idealAlign=a.pxmid[0]<0?"left":"right"),y&&(F.x=M,F.idealAlign=M<0?"left":"right");var B=[];o.loneHover(F,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r,inOut_bbox:B}),l[0].bbox=B[0],d._hasHoverLabel=!0}if(y){var z=e.select("path.surface");p.styleOne(z,a,v,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[f(a,v,p.eventDataKeys)],event:n.event})}})),e.on("mouseout",(function(t){var a=r._fullLayout,i=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(t.originalEvent=n.event,r.emit("plotly_unhover",{points:[f(s,i,p.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(a._hoverlayer.node()),d._hasHoverLabel=!1),y){var l=e.select("path.surface");p.styleOne(l,s,i,{hovered:!1})}})),e.on("click",(function(e){var t=r._fullLayout,i=r._fullData[d.index],s=g&&(c.isHierarchyRoot(e)||c.isLeaf(e)),u=c.getPtId(e),h=c.isEntry(e)?c.findEntryWithChild(m,u):c.findEntryWithLevel(m,u),y=c.getPtId(h),v={points:[f(e,i,p.eventDataKeys)],event:n.event};s||(v.nextLevel=y);var b=l.triggerHandler(r,"plotly_"+d.type+"click",v);if(!1!==b&&t.hovermode&&(r._hoverdata=[f(e,i,p.eventDataKeys)],o.click(r,n.event)),!s&&!1!==b&&!r._dragging&&!r._transitioning){a.call("_storeDirectGUIEdit",i,t._tracePreGUI[i.uid],{level:i.level});var x={data:[{level:y}],traces:[d.index]},_={frame:{redraw:!1,duration:p.transitionTime},transition:{duration:p.transitionTime,easing:p.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(t._hoverlayer.node()),a.call("animate",r,x,_)}}))}},{"../../components/fx":406,"../../components/fx/helpers":402,"../../lib":503,"../../lib/events":492,"../../registry":638,"../pie/helpers":905,"./helpers":1051,"@plotly/d3":58}],1051:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../../lib/setcursor"),o=e("../pie/helpers");function s(e){return e.data.data.pid}r.findEntryWithLevel=function(e,t){var n;return t&&e.eachAfter((function(e){if(r.getPtId(e)===t)return n=e.copy()})),n||e},r.findEntryWithChild=function(e,t){var n;return e.eachAfter((function(e){for(var a=e.children||[],i=0;i<a.length;i++){var o=a[i];if(r.getPtId(o)===t)return n=e.copy()}})),n||e},r.isEntry=function(e){return!e.parent},r.isLeaf=function(e){return!e.children},r.getPtId=function(e){return e.data.data.id},r.getPtLabel=function(e){return e.data.data.label},r.getValue=function(e){return e.value},r.isHierarchyRoot=function(e){return""===s(e)},r.setSliceCursor=function(e,t,n){var a=n.isTransitioning;if(!a){var o=e.datum();a=n.hideOnRoot&&r.isHierarchyRoot(o)||n.hideOnLeaves&&r.isLeaf(o)}i(e,a?null:"pointer")},r.getInsideTextFontKey=function(e,t,r,a,i){var o=(i||{}).onPathbar?"pathbar.textfont":"insidetextfont",s=r.data.data.i;return n.castOption(t,s,o+"."+e)||n.castOption(t,s,"textfont."+e)||a.size},r.getOutsideTextFontKey=function(e,t,r,a){var i=r.data.data.i;return n.castOption(t,i,"outsidetextfont."+e)||n.castOption(t,i,"textfont."+e)||a.size},r.isOutsideText=function(e,t){return!e._hasColorscale&&r.isHierarchyRoot(t)},r.determineTextFont=function(e,t,i,o){return r.isOutsideText(e,t)?function(e,t,n){return{color:r.getOutsideTextFontKey("color",e,t,n),family:r.getOutsideTextFontKey("family",e,t,n),size:r.getOutsideTextFontKey("size",e,t,n)}}(e,t,i):function(e,t,i,o){var s=(o||{}).onPathbar,l=t.data.data,c=l.i,u=n.castOption(e,c,(s?"pathbar.textfont":"insidetextfont")+".color");return!u&&e._input.textfont&&(u=n.castOption(e._input,c,"textfont.color")),{color:u||a.contrast(l.color),family:r.getInsideTextFontKey("family",e,t,i,o),size:r.getInsideTextFontKey("size",e,t,i,o)}}(e,t,i,o)},r.hasTransition=function(e){return!!(e&&e.duration>0)},r.getMaxDepth=function(e){return e.maxdepth>=0?e.maxdepth:1/0},r.isHeader=function(e,t){return!(r.isLeaf(e)||e.depth===t._maxDepth-1)},r.getParent=function(e,t){return r.findEntryWithLevel(e,s(t))},r.listPath=function(e,t){var n=e.parent;if(!n)return[];var a=t?[n.data[t]]:[n];return r.listPath(n,t).concat(a)},r.getPath=function(e){return r.listPath(e,"label").join("/")+"/"},r.formatValue=o.formatPieValue,r.formatPercent=function(e,t){var r=n.formatPercent(e,0);return"0%"===r&&(r=o.formatPiePercent(e,t)),r}},{"../../components/color":366,"../../lib":503,"../../lib/setcursor":524,"../pie/helpers":905}],1052:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"sunburst",basePlotModule:e("./base_plot"),categories:[],animatable:!0,attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot").plot,style:e("./style").style,colorbar:e("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":944,"./attributes":1045,"./base_plot":1046,"./calc":1047,"./defaults":1049,"./layout_attributes":1053,"./layout_defaults":1054,"./plot":1055,"./style":1056}],1053:[function(e,t,r){"use strict";t.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1054:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("sunburstcolorway",t.colorway),r("extendsunburstcolors")}},{"../../lib":503,"./layout_attributes":1053}],1055:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-hierarchy"),i=e("d3-interpolate").interpolate,o=e("../../components/drawing"),s=e("../../lib"),l=e("../../lib/svg_text_utils"),c=e("../bar/uniform_text"),u=c.recordMinTextSize,f=c.clearMinTextSize,p=e("../pie/plot"),h=e("../pie/helpers").getRotationAngle,d=p.computeTransform,m=p.transformInsideText,g=e("./style").styleOne,y=e("../bar/style").resizeText,v=e("./fx"),b=e("./constants"),x=e("./helpers");function _(e,t,c,f){var p=e._fullLayout,y=!p.uniformtext.mode&&x.hasTransition(f),_=n.select(c).selectAll("g.slice"),k=t[0],D=k.trace,T=k.hierarchy,A=x.findEntryWithLevel(T,D.level),S=x.getMaxDepth(D),M=p._size,E=D.domain,C=M.w*(E.x[1]-E.x[0]),N=M.h*(E.y[1]-E.y[0]),O=.5*Math.min(C,N),I=k.cx=M.l+M.w*(E.x[1]+E.x[0])/2,P=k.cy=M.t+M.h*(1-E.y[0])-N/2;if(!A)return _.remove();var R=null,L={};y&&_.each((function(e){L[x.getPtId(e)]={rpx0:e.rpx0,rpx1:e.rpx1,x0:e.x0,x1:e.x1,transform:e.transform},!R&&x.isEntry(e)&&(R=e)}));var F=function(e){return a.partition().size([2*Math.PI,e.height+1])(e)}(A).descendants(),B=A.height+1,z=0,j=S;k.hasMultipleRoots&&x.isHierarchyRoot(A)&&(F=F.slice(1),B-=1,z=1,j+=1),F=F.filter((function(e){return e.y1<=j}));var U=h(D.rotation);U&&F.forEach((function(e){e.x0+=U,e.x1+=U}));var $=Math.min(B,S),V=function(e){return(e-z)/$*O},q=function(e,t){return[e*Math.cos(t),-e*Math.sin(t)]},W=function(e){return s.pathAnnulus(e.rpx0,e.rpx1,e.x0,e.x1,I,P)},H=function(e){return I+w(e)[0]*(e.transform.rCenter||0)+(e.transform.x||0)},G=function(e){return P+w(e)[1]*(e.transform.rCenter||0)+(e.transform.y||0)};(_=_.data(F,x.getPtId)).enter().append("g").classed("slice",!0),y?_.exit().transition().each((function(){var e=n.select(this);e.select("path.surface").transition().attrTween("d",(function(e){var t=function(e){var t,r=x.getPtId(e),n=L[r],a=L[x.getPtId(A)];if(a){var o=(e.x1>a.x1?2*Math.PI:0)+U;t=e.rpx1<a.rpx1?{x0:e.x0,x1:e.x1,rpx0:0,rpx1:0}:{x0:o,x1:o,rpx0:e.rpx0,rpx1:e.rpx1}}else{var s,l=x.getPtId(e.parent);_.each((function(e){if(x.getPtId(e)===l)return s=e}));var c,u=s.children;u.forEach((function(e,t){if(x.getPtId(e)===r)return c=t}));var f=u.length,p=i(s.x0,s.x1);t={rpx0:O,rpx1:O,x0:p(c/f),x1:p((c+1)/f)}}return i(n,t)}(e);return function(e){return W(t(e))}})),e.select("g.slicetext").attr("opacity",0)})).remove():_.exit().remove(),_.order();var X=null;if(y&&R){var Y=x.getPtId(R);_.each((function(e){null===X&&x.getPtId(e)===Y&&(X=e.x1)}))}var Z=_;function K(e){var t=e.parent,r=L[x.getPtId(t)],n={};if(r){var a=t.children,o=a.indexOf(e),s=a.length,l=i(r.x0,r.x1);n.x0=l(o/s),n.x1=l(o/s)}else n.x0=n.x1=0;return n}y&&(Z=Z.transition().each("end",(function(){var t=n.select(this);x.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})}))),Z.each((function(a){var c=n.select(this),f=s.ensureSingle(c,"path","surface",(function(e){e.style("pointer-events","all")}));a.rpx0=V(a.y0),a.rpx1=V(a.y1),a.xmid=(a.x0+a.x1)/2,a.pxmid=q(a.rpx1,a.xmid),a.midangle=-(a.xmid-Math.PI/2),a.startangle=-(a.x0-Math.PI/2),a.stopangle=-(a.x1-Math.PI/2),a.halfangle=.5*Math.min(s.angleDelta(a.x0,a.x1)||Math.PI,Math.PI),a.ring=1-a.rpx0/a.rpx1,a.rInscribed=function(e){return 0===e.rpx0&&s.isFullCircle([e.x0,e.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2))}(a),y?f.transition().attrTween("d",(function(e){var t=function(e){var t,r=L[x.getPtId(e)],n={x0:e.x0,x1:e.x1,rpx0:e.rpx0,rpx1:e.rpx1};if(r)t=r;else if(R)if(e.parent)if(X){var a=(e.x1>X?2*Math.PI:0)+U;t={x0:a,x1:a}}else t={rpx0:O,rpx1:O},s.extendFlat(t,K(e));else t={rpx0:0,rpx1:0};else t={x0:U,x1:U};return i(t,n)}(e);return function(e){return W(t(e))}})):f.attr("d",W),c.call(v,A,e,t,{eventDataKeys:b.eventDataKeys,transitionTime:b.CLICK_TRANSITION_TIME,transitionEasing:b.CLICK_TRANSITION_EASING}).call(x.setSliceCursor,e,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:e._transitioning}),f.call(g,a,D);var h=s.ensureSingle(c,"g","slicetext"),_=s.ensureSingle(h,"text","",(function(e){e.attr("data-notex",1)})),w=s.ensureUniformFontSize(e,x.determineTextFont(D,a,p.font));_.text(r.formatSliceLabel(a,A,D,t,p)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,w).call(l.convertToTspans,e);var T=o.bBox(_.node());a.transform=m(T,a,k),a.transform.targetX=H(a),a.transform.targetY=G(a);var S=function(e,t){var r=e.transform;return d(r,t),r.fontSize=w.size,u(D.type,r,p),s.getTextTransform(r)};y?_.transition().attrTween("transform",(function(e){var t=function(e){var t,r=L[x.getPtId(e)],n=e.transform;if(r)t=r;else if(t={rpx1:e.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},R)if(e.parent)if(X){var a=e.x1>X?2*Math.PI:0;t.x0=t.x1=a}else s.extendFlat(t,K(e));else t.x0=t.x1=U;else t.x0=t.x1=U;var o=i(t.transform.textPosAngle,e.transform.textPosAngle),l=i(t.rpx1,e.rpx1),c=i(t.x0,e.x0),f=i(t.x1,e.x1),h=i(t.transform.scale,n.scale),d=i(t.transform.rotate,n.rotate),m=0===n.rCenter?3:0===t.transform.rCenter?1/3:1,g=i(t.transform.rCenter,n.rCenter);return function(e){var t=l(e),r=c(e),a=f(e),i=function(e){return g(Math.pow(e,m))}(e),s={pxmid:q(t,(r+a)/2),rpx1:t,transform:{textPosAngle:o(e),rCenter:i,x:n.x,y:n.y}};return u(D.type,n,p),{transform:{targetX:H(s),targetY:G(s),scale:h(e),rotate:d(e),rCenter:i}}}}(e);return function(e){return S(t(e),T)}})):_.attr("transform",S(a,T))}))}function w(e){return t=e.rpx1,r=e.transform.textPosAngle,[t*Math.sin(r),-t*Math.cos(r)];var t,r}r.plot=function(e,t,r,a){var i,o,s=e._fullLayout,l=s._sunburstlayer,c=!r,u=!s.uniformtext.mode&&x.hasTransition(r);f("sunburst",s),(i=l.selectAll("g.trace.sunburst").data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),i.order(),u?(a&&(o=a()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(t){_(e,t,this,r)}))}))):(i.each((function(t){_(e,t,this,r)})),s.uniformtext.mode&&y(e,s._sunburstlayer.selectAll(".trace"),"sunburst")),c&&i.exit().remove()},r.formatSliceLabel=function(e,t,r,n,a){var i=r.texttemplate,o=r.textinfo;if(!(i||o&&"none"!==o))return"";var l=a.separators,c=n[0],u=e.data.data,f=c.hierarchy,p=x.isHierarchyRoot(e),h=x.getParent(f,e),d=x.getValue(e);if(!i){var m,g=o.split("+"),y=function(e){return-1!==g.indexOf(e)},v=[];if(y("label")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&y("value")&&v.push(x.formatValue(u.v,l)),!p){y("current path")&&v.push(x.getPath(e.data));var b=0;y("percent parent")&&b++,y("percent entry")&&b++,y("percent root")&&b++;var _=b>1;if(b){var w,k=function(e){m=x.formatPercent(w,l),_&&(m+=" of "+e),v.push(m)};y("percent parent")&&!p&&(w=d/x.getValue(h),k("parent")),y("percent entry")&&(w=d/x.getValue(t),k("entry")),y("percent root")&&(w=d/x.getValue(f),k("root"))}}return y("text")&&(m=s.castOption(r,u.i,"text"),s.isValidTextValue(m)&&v.push(m)),v.join("<br>")}var D=s.castOption(r,u.i,"texttemplate");if(!D)return"";var T={};u.label&&(T.label=u.label),u.hasOwnProperty("v")&&(T.value=u.v,T.valueLabel=x.formatValue(u.v,l)),T.currentPath=x.getPath(e.data),p||(T.percentParent=d/x.getValue(h),T.percentParentLabel=x.formatPercent(T.percentParent,l),T.parent=x.getPtLabel(h)),T.percentEntry=d/x.getValue(t),T.percentEntryLabel=x.formatPercent(T.percentEntry,l),T.entry=x.getPtLabel(t),T.percentRoot=d/x.getValue(f),T.percentRootLabel=x.formatPercent(T.percentRoot,l),T.root=x.getPtLabel(f),u.hasOwnProperty("color")&&(T.color=u.color);var A=s.castOption(r,u.i,"text");return(s.isValidTextValue(A)||""===A)&&(T.text=A),T.customdata=s.castOption(r,u.i,"customdata"),s.texttemplateString(D,T,a._d3locale,T,r._meta||{})}},{"../../components/drawing":388,"../../lib":503,"../../lib/svg_text_utils":529,"../bar/style":662,"../bar/uniform_text":664,"../pie/helpers":905,"../pie/plot":909,"./constants":1048,"./fx":1050,"./helpers":1051,"./style":1056,"@plotly/d3":58,"d3-hierarchy":115,"d3-interpolate":116}],1056:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/color"),i=e("../../lib"),o=e("../bar/uniform_text").resizeText;function s(e,t,r){var n=t.data.data,o=!t.children,s=n.i,l=i.castOption(r,s,"marker.line.color")||a.defaultLine,c=i.castOption(r,s,"marker.line.width")||0;e.style("stroke-width",c).call(a.fill,n.color).call(a.stroke,l).style("opacity",o?r.leaf.opacity:null)}t.exports={style:function(e){var t=e._fullLayout._sunburstlayer.selectAll(".trace");o(e,t,"sunburst"),t.each((function(e){var t=n.select(this),r=e[0].trace;t.style("opacity",r.opacity),t.selectAll("path.surface").each((function(e){n.select(this).call(s,e,r)}))}))},styleOne:s}},{"../../components/color":366,"../../lib":503,"../bar/uniform_text":664,"@plotly/d3":58}],1057:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/attributes"),i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=e("../../plots/template_attributes").hovertemplateAttrs,s=e("../../plots/attributes"),l=e("../../lib/extend").extendFlat,c=e("../../plot_api/edit_types").overrideAll;function u(e){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var f=t.exports=c(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},a("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},a.zauto,{}),zmin:l({},a.zmin,{}),zmax:l({},a.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");f.x.editType=f.y.editType=f.z.editType="calc+clearAxisTypes",f.transforms=void 0},{"../../components/color":366,"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633}],1058:[function(e,t,r){"use strict";var n=e("../../components/colorscale/calc");t.exports=function(e,t){t.surfacecolor?n(e,t,{vals:t.surfacecolor,containerStr:"",cLetter:"c"}):n(e,t,{vals:t.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":374}],1059:[function(e,t,r){"use strict";var n=e("../../../stackgl_modules").gl_surface3d,a=e("../../../stackgl_modules").ndarray,i=e("../../../stackgl_modules").ndarray_linear_interpolate.d2,o=e("../heatmap/interp2d"),s=e("../heatmap/find_empties"),l=e("../../lib").isArrayOrTypedArray,c=e("../../lib/gl_format_color").parseColorScale,u=e("../../lib/str2rgbarray"),f=e("../../components/colorscale").extractOpts;function p(e,t,r){this.scene=e,this.uid=r,this.surface=t,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var h=p.prototype;h.getXat=function(e,t,r,n){var a=l(this.data.x)?l(this.data.x[0])?this.data.x[t][e]:this.data.x[e]:e;return void 0===r?a:n.d2l(a,0,r)},h.getYat=function(e,t,r,n){var a=l(this.data.y)?l(this.data.y[0])?this.data.y[t][e]:this.data.y[t]:t;return void 0===r?a:n.d2l(a,0,r)},h.getZat=function(e,t,r,n){var a=this.data.z[t][e];return null===a&&this.data.connectgaps&&this.data._interpolatedZ&&(a=this.data._interpolatedZ[t][e]),void 0===r?a:n.d2l(a,0,r)},h.handlePick=function(e){if(e.object===this.surface){var t=(e.data.index[0]-1)/this.dataScaleX-1,r=(e.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(t),this.data.z[0].length-1),0),a=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);e.index=[n,a],e.traceCoordinate=[this.getXat(n,a),this.getYat(n,a),this.getZat(n,a)],e.dataCoordinate=[this.getXat(n,a,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,a,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,a,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var i=0;i<3;i++)null!=e.dataCoordinate[i]&&(e.dataCoordinate[i]*=this.scene.dataScale[i]);var o=this.data.hovertext||this.data.text;return Array.isArray(o)&&o[a]&&void 0!==o[a][n]?e.textLabel=o[a][n]:e.textLabel=o||"",e.data.dataCoordinate=e.dataCoordinate.slice(),this.surface.highlight(e.data),this.scene.glplot.spikes.position=e.dataCoordinate,!0}};var d=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function m(e,t){if(e<t)return 0;for(var r=0;0===Math.floor(e%t);)e/=t,r++;return r}function g(e){for(var t=[],r=0;r<d.length;r++){var n=d[r];t.push(m(e,n))}return t}function y(e){for(var t=g(e),r=e,n=0;n<d.length;n++)if(t[n]>0){r=d[n];break}return r}function v(e,t){if(!(e<1||t<1)){for(var r=g(e),n=g(t),a=1,i=0;i<d.length;i++)a*=Math.pow(d[i],Math.max(r[i],n[i]));return a}}h.calcXnums=function(e){var t,r=[];for(t=1;t<e;t++){var n=this.getXat(t-1,0),a=this.getXat(t,0);r[t-1]=a!==n&&null!=n&&null!=a?Math.abs(a-n):0}var i=0;for(t=1;t<e;t++)i+=r[t-1];for(t=1;t<e;t++)0===r[t-1]?r[t-1]=1:r[t-1]=Math.round(i/r[t-1]);return r},h.calcYnums=function(e){var t,r=[];for(t=1;t<e;t++){var n=this.getYat(0,t-1),a=this.getYat(0,t);r[t-1]=a!==n&&null!=n&&null!=a?Math.abs(a-n):0}var i=0;for(t=1;t<e;t++)i+=r[t-1];for(t=1;t<e;t++)0===r[t-1]?r[t-1]=1:r[t-1]=Math.round(i/r[t-1]);return r};var b=[1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260],x=b[9],_=b[13];function w(e,t,r){var n=r[8]+r[2]*t[0]+r[5]*t[1];return e[0]=(r[6]+r[0]*t[0]+r[3]*t[1])/n,e[1]=(r[7]+r[1]*t[0]+r[4]*t[1])/n,e}function k(e,t,r){return function(e,t,r,n){for(var a=[0,0],o=e.shape[0],s=e.shape[1],l=0;l<o;l++)for(var c=0;c<s;c++)r(a,[l,c],n),e.set(l,c,i(t,a[0],a[1]))}(e,t,w,r),e}function D(e,t){for(var r=!1,n=0;n<e.length;n++)if(t===e[n]){r=!0;break}!1===r&&e.push(t)}h.estimateScale=function(e,t){for(var r=1+function(e){if(0!==e.length){for(var t=1,r=0;r<e.length;r++)t=v(t,e[r]);return t}}(0===t?this.calcXnums(e):this.calcYnums(e));r<x;)r*=2;for(;r>_;)r--,r/=y(r),++r<x&&(r=_);var n=Math.round(r/e);return n>1?n:1},h.refineCoords=function(e){for(var t=this.dataScaleX,r=this.dataScaleY,n=e[0].shape[0],i=e[0].shape[1],o=0|Math.floor(e[0].shape[0]*t+1),s=0|Math.floor(e[0].shape[1]*r+1),l=1+n+1,c=1+i+1,u=a(new Float32Array(l*c),[l,c]),f=[1/t,0,0,0,1/r,0,0,0,1],p=0;p<e.length;++p){this.surface.padField(u,e[p]);var h=a(new Float32Array(o*s),[o,s]);k(h,u,f),e[p]=h}},h.setContourLevels=function(){var e,t,r,n=[[],[],[]],a=[!1,!1,!1],i=!1;for(e=0;e<3;++e)if(this.showContour[e]&&(i=!0,this.contourSize[e]>0&&null!==this.contourStart[e]&&null!==this.contourEnd[e]&&this.contourEnd[e]>this.contourStart[e]))for(a[e]=!0,t=this.contourStart[e];t<this.contourEnd[e];t+=this.contourSize[e])r=t*this.scene.dataScale[e],D(n[e],r);if(i){var o=[[],[],[]];for(e=0;e<3;++e)this.showContour[e]&&(o[e]=a[e]?n[e]:this.scene.contourLevels[e]);this.surface.update({levels:o})}},h.update=function(e){var t,r,n,i,l=this.scene,p=l.fullSceneLayout,h=this.surface,d=c(e),m=l.dataScale,g=e.z[0].length,y=e._ylength,v=l.contourLevels;this.data=e;var b=[];for(t=0;t<3;t++)for(b[t]=[],r=0;r<g;r++)b[t][r]=[];for(r=0;r<g;r++)for(n=0;n<y;n++)b[0][r][n]=this.getXat(r,n,e.xcalendar,p.xaxis),b[1][r][n]=this.getYat(r,n,e.ycalendar,p.yaxis),b[2][r][n]=this.getZat(r,n,e.zcalendar,p.zaxis);if(e.connectgaps)for(e._emptypoints=s(b[2]),o(b[2],e._emptypoints),e._interpolatedZ=[],r=0;r<g;r++)for(e._interpolatedZ[r]=[],n=0;n<y;n++)e._interpolatedZ[r][n]=b[2][r][n];for(t=0;t<3;t++)for(r=0;r<g;r++)for(n=0;n<y;n++)null==(i=b[t][r][n])?b[t][r][n]=NaN:i=b[t][r][n]*=m[t];for(t=0;t<3;t++)for(r=0;r<g;r++)for(n=0;n<y;n++)null!=(i=b[t][r][n])&&(this.minValues[t]>i&&(this.minValues[t]=i),this.maxValues[t]<i&&(this.maxValues[t]=i));for(t=0;t<3;t++)this.objectOffset[t]=.5*(this.minValues[t]+this.maxValues[t]);for(t=0;t<3;t++)for(r=0;r<g;r++)for(n=0;n<y;n++)null!=(i=b[t][r][n])&&(b[t][r][n]-=this.objectOffset[t]);var x=[a(new Float32Array(g*y),[g,y]),a(new Float32Array(g*y),[g,y]),a(new Float32Array(g*y),[g,y])];for(t=0;t<3;t++)for(r=0;r<g;r++)for(n=0;n<y;n++)x[t].set(r,n,b[t][r][n]);b=[];var w={colormap:d,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!e.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacityscale:e.opacityscale,opacity:e.opacity},k=f(e);if(w.intensityBounds=[k.min,k.max],e.surfacecolor){var D=a(new Float32Array(g*y),[g,y]);for(r=0;r<g;r++)for(n=0;n<y;n++)D.set(r,n,e.surfacecolor[n][r]);x.push(D)}else w.intensityBounds[0]*=m[2],w.intensityBounds[1]*=m[2];(_<x[0].shape[0]||_<x[0].shape[1])&&(this.refineData=!1),!0===this.refineData&&(this.dataScaleX=this.estimateScale(x[0].shape[0],0),this.dataScaleY=this.estimateScale(x[0].shape[1],1),1===this.dataScaleX&&1===this.dataScaleY||this.refineCoords(x)),e.surfacecolor&&(w.intensity=x.pop());var T=[!0,!0,!0],A=["x","y","z"];for(t=0;t<3;++t){var S=e.contours[A[t]];T[t]=S.highlight,w.showContour[t]=S.show||S.highlight,w.showContour[t]&&(w.contourProject[t]=[S.project.x,S.project.y,S.project.z],S.show?(this.showContour[t]=!0,w.levels[t]=v[t],h.highlightColor[t]=w.contourColor[t]=u(S.color),S.usecolormap?h.highlightTint[t]=w.contourTint[t]=0:h.highlightTint[t]=w.contourTint[t]=1,w.contourWidth[t]=S.width,this.contourStart[t]=S.start,this.contourEnd[t]=S.end,this.contourSize[t]=S.size):(this.showContour[t]=!1,this.contourStart[t]=null,this.contourEnd[t]=null,this.contourSize[t]=0),S.highlight&&(w.dynamicColor[t]=u(S.highlightcolor),w.dynamicWidth[t]=S.highlightwidth))}(function(e){var t=e[0].rgb,r=e[e.length-1].rgb;return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3]})(d)&&(w.vertexColor=!0),w.objectOffset=this.objectOffset,w.coords=x,h.update(w),h.visible=e.visible,h.enableDynamic=T,h.enableHighlight=T,h.snapToData=!0,"lighting"in e&&(h.ambientLight=e.lighting.ambient,h.diffuseLight=e.lighting.diffuse,h.specularLight=e.lighting.specular,h.roughness=e.lighting.roughness,h.fresnel=e.lighting.fresnel),"lightposition"in e&&(h.lightPosition=[e.lightposition.x,e.lightposition.y,e.lightposition.z])},h.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},t.exports=function(e,t){var r=e.glplot.gl,a=n({gl:r}),i=new p(e,a,t.uid);return a._trace=i,i.update(t),e.glplot.add(a),i}},{"../../../stackgl_modules":1120,"../../components/colorscale":378,"../../lib":503,"../../lib/gl_format_color":499,"../../lib/str2rgbarray":528,"../heatmap/find_empties":798,"../heatmap/interp2d":801}],1060:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../components/colorscale/defaults"),o=e("./attributes");function s(e,t,r,n){var a=n("opacityscale");"max"===a?t.opacityscale=[[0,.1],[1,1]]:"min"===a?t.opacityscale=[[0,1],[1,.1]]:"extremes"===a?t.opacityscale=function(e,t){for(var r=[],n=0;n<32;n++){var a=n/31,i=.1+.9*(1-Math.pow(Math.sin(1*a*Math.PI),2));r.push([a,Math.max(0,Math.min(1,i))])}return r}():function(e){var t=0;if(!Array.isArray(e)||e.length<2)return!1;if(!e[0]||!e[e.length-1])return!1;if(0!=+e[0][0]||1!=+e[e.length-1][0])return!1;for(var r=0;r<e.length;r++){var n=e[r];if(2!==n.length||+n[0]<t)return!1;t=+n[0]}return!0}(a)||(t.opacityscale=void 0)}function l(e,t,r){t in e&&!(r in e)&&(e[r]=e[t])}t.exports={supplyDefaults:function(e,t,r,c){var u,f;function p(r,n){return a.coerce(e,t,o,r,n)}var h=p("x"),d=p("y"),m=p("z");if(!m||!m.length||h&&h.length<1||d&&d.length<1)t.visible=!1;else{t._xlength=Array.isArray(h)&&a.isArrayOrTypedArray(h[0])?m.length:m[0].length,t._ylength=m.length,n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],c),p("text"),p("hovertext"),p("hovertemplate"),p("xhoverformat"),p("yhoverformat"),p("zhoverformat"),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","connectgaps","opacity"].forEach((function(e){p(e)}));var g=p("surfacecolor"),y=["x","y","z"];for(u=0;u<3;++u){var v="contours."+y[u],b=p(v+".show"),x=p(v+".highlight");if(b||x)for(f=0;f<3;++f)p(v+".project."+y[f]);b&&(p(v+".color"),p(v+".width"),p(v+".usecolormap")),x&&(p(v+".highlightcolor"),p(v+".highlightwidth")),p(v+".start"),p(v+".end"),p(v+".size")}g||(l(e,"zmin","cmin"),l(e,"zmax","cmax"),l(e,"zauto","cauto")),i(e,t,c,p,{prefix:"",cLetter:"c"}),s(0,t,0,p),t._length=null}},opacityscaleDefaults:s}},{"../../components/colorscale/defaults":376,"../../lib":503,"../../registry":638,"./attributes":1057}],1061:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults").supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:e("./calc"),plot:e("./convert"),moduleType:"trace",name:"surface",basePlotModule:e("../../plots/gl3d"),categories:["gl3d","2dMap","showLegend"],meta:{}}},{"../../plots/gl3d":598,"./attributes":1057,"./calc":1058,"./convert":1059,"./defaults":1060}],1062:[function(e,t,r){"use strict";var n=e("../../components/annotations/attributes"),a=e("../../lib/extend").extendFlat,i=e("../../plot_api/edit_types").overrideAll,o=e("../../plots/font_attributes"),s=e("../../plots/domain").attributes,l=e("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers;(t.exports=i({domain:s({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:l("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:a({},n.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:a({},o({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:l("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:a({},n.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:a({},o({arrayOk:!0}))}},"calc","from-root")).transforms=void 0},{"../../components/annotations/attributes":349,"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plots/cartesian/axis_format_attributes":557,"../../plots/domain":584,"../../plots/font_attributes":585}],1063:[function(e,t,r){"use strict";var n=e("../../plots/get_data").getModuleCalcData,a=e("./plot");r.name="table",r.plot=function(e){var t=n(e.calcdata,"table")[0];t.length&&a(e,t)},r.clean=function(e,t,r,n){var a=n._has&&n._has("table"),i=t._has&&t._has("table");a&&!i&&n._paperdiv.selectAll(".table").remove()}},{"../../plots/get_data":593,"./plot":1070}],1064:[function(e,t,r){"use strict";var n=e("../../lib/gup").wrap;t.exports=function(){return n({})}},{"../../lib/gup":500}],1065:[function(e,t,r){"use strict";t.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"<br>",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1066:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../lib/extend").extendFlat,i=e("fast-isnumeric");function o(e){if(Array.isArray(e)){for(var t=0,r=0;r<e.length;r++)t=Math.max(t,o(e[r]));return t}return e}function s(e,t){return e+t}function l(e){var t,r=e.slice(),n=1/0,a=0;for(t=0;t<r.length;t++)Array.isArray(r[t])||(r[t]=[r[t]]),n=Math.min(n,r[t].length),a=Math.max(a,r[t].length);if(n!==a)for(t=0;t<r.length;t++){var i=a-r[t].length;i&&(r[t]=r[t].concat(c(i)))}return r}function c(e){for(var t=new Array(e),r=0;r<e;r++)t[r]="";return t}function u(e){return e.calcdata.columns.reduce((function(t,r){return r.xIndex<e.xIndex?t+r.columnWidth:t}),0)}function f(e,t){return Object.keys(e).map((function(r){return a({},e[r],{auxiliaryBlocks:t})}))}function p(e,t){for(var r,n={},a=0,i=0,o={firstRowIndex:null,lastRowIndex:null,rows:[]},s=0,l=0,c=0;c<e.length;c++)r=e[c],o.rows.push({rowIndex:c,rowHeight:r}),((i+=r)>=t||c===e.length-1)&&(n[a]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},a+=i,s=c+1,i=0);return n}t.exports=function(e,t){var r=l(t.cells.values),h=function(e){return e.slice(t.header.values.length,e.length)},d=l(t.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var m=d.concat(h(r).map((function(){return c((d[0]||[""]).length)}))),g=t.domain,y=Math.floor(e._fullLayout._size.w*(g.x[1]-g.x[0])),v=Math.floor(e._fullLayout._size.h*(g.y[1]-g.y[0])),b=t.header.values.length?m[0].map((function(){return t.header.height})):[n.emptyHeaderHeight],x=r.length?r[0].map((function(){return t.cells.height})):[],_=b.reduce(s,0),w=p(x,v-_+n.uplift),k=f(p(b,_),[]),D=f(w,k),T={},A=t._fullInput.columnorder.concat(h(r.map((function(e,t){return t})))),S=m.map((function(e,r){var n=Array.isArray(t.columnwidth)?t.columnwidth[Math.min(r,t.columnwidth.length-1)]:t.columnwidth;return i(n)?Number(n):1})),M=S.reduce(s,0);S=S.map((function(e){return e/M*y}));var E=Math.max(o(t.header.line.width),o(t.cells.line.width)),C={key:t.uid+e._context.staticPlot,translateX:g.x[0]*e._fullLayout._size.w,translateY:e._fullLayout._size.h*(1-g.y[1]),size:e._fullLayout._size,width:y,maxLineWidth:E,height:v,columnOrder:A,groupHeight:v,rowBlocks:D,headerRowBlocks:k,scrollY:0,cells:a({},t.cells,{values:r}),headerCells:a({},t.header,{values:m}),gdColumns:m.map((function(e){return e[0]})),gdColumnsOriginalOrder:m.map((function(e){return e[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:m.map((function(e,t){var r=T[e];return T[e]=(r||0)+1,{key:e+"__"+T[e],label:e,specIndex:t,xIndex:A[t],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[t]}}))};return C.columns.forEach((function(e){e.calcdata=C,e.x=u(e)})),C}},{"../../lib/extend":493,"./constants":1065,"fast-isnumeric":190}],1067:[function(e,t,r){"use strict";var n=e("../../lib/extend").extendFlat;r.splitToPanels=function(e){var t=[0,0],r=n({},e,{key:"header",type:"header",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!0,values:e.calcdata.headerCells.values[e.specIndex],rowBlocks:e.calcdata.headerRowBlocks,calcdata:n({},e.calcdata,{cells:e.calcdata.headerCells})});return[n({},e,{key:"cells1",type:"cells",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),n({},e,{key:"cells2",type:"cells",page:1,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),r]},r.splitToCells=function(e){var t=function(e){var t=e.rowBlocks[e.page],r=t?t.rows[0].rowIndex:0;return[r,t?r+t.rows.length:0]}(e);return(e.values||[]).slice(t[0],t[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:t[0]+n,column:e,calcdata:e.calcdata,page:e.page,rowBlocks:e.rowBlocks,value:r}}))}},{"../../lib/extend":493}],1068:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults;t.exports=function(e,t,r,o){function s(r,i){return n.coerce(e,t,a,r,i)}i(t,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(e,t){for(var r=e.columnorder||[],n=e.header.values.length,a=r.slice(0,n),i=a.slice().sort((function(e,t){return e-t})),o=a.map((function(e){return i.indexOf(e)})),s=o.length;s<n;s++)o.push(s);t("columnorder",o)}(t,s),s("cells.values"),s("cells.format"),s("cells.align"),s("cells.prefix"),s("cells.suffix"),s("cells.height"),s("cells.line.width"),s("cells.line.color"),s("cells.fill.color"),n.coerceFont(s,"cells.font",n.extendFlat({},o.font)),t._length=null}},{"../../lib":503,"../../plots/domain":584,"./attributes":1062}],1069:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),moduleType:"trace",name:"table",basePlotModule:e("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":1062,"./base_plot":1063,"./calc":1064,"./defaults":1068,"./plot":1070}],1070:[function(e,t,r){"use strict";var n=e("./constants"),a=e("@plotly/d3"),i=e("../../lib").numberFormat,o=e("../../lib/gup"),s=e("../../components/drawing"),l=e("../../lib/svg_text_utils"),c=e("../../lib").raiseToTop,u=e("../../lib").strTranslate,f=e("../../lib").cancelTransition,p=e("./data_preparation_helper"),h=e("./data_split_helpers"),d=e("../../components/color");function m(e){return Math.ceil(e.calcdata.maxLineWidth/2)}function g(e,t){return"clip"+e._fullLayout._uid+"_scrollAreaBottomClip_"+t.key}function y(e,t){return"clip"+e._fullLayout._uid+"_columnBoundaryClippath_"+t.calcdata.key+"_"+t.specIndex}function v(e){return[].concat.apply([],e.map((function(e){return e}))).map((function(e){return e.__data__}))}function b(e,t,r){var i=e.selectAll("."+n.cn.scrollbarKit).data(o.repeat,o.keyFun);i.enter().append("g").classed(n.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),i.each((function(e){var t=e.scrollbarState;t.totalHeight=function(e){var t=e.rowBlocks;return R(t,t.length-1)+(t.length?L(t[t.length-1],1/0):1)}(e),t.scrollableAreaHeight=e.groupHeight-S(e),t.currentlyVisibleHeight=Math.min(t.totalHeight,t.scrollableAreaHeight),t.ratio=t.currentlyVisibleHeight/t.totalHeight,t.barLength=Math.max(t.ratio*t.currentlyVisibleHeight,n.goldenRatio*n.scrollbarWidth),t.barWiggleRoom=t.currentlyVisibleHeight-t.barLength,t.wiggleRoom=Math.max(0,t.totalHeight-t.scrollableAreaHeight),t.topY=0===t.barWiggleRoom?0:e.scrollY/t.wiggleRoom*t.barWiggleRoom,t.bottomY=t.topY+t.barLength,t.dragMultiplier=t.wiggleRoom/t.barWiggleRoom})).attr("transform",(function(e){var t=e.width+n.scrollbarWidth/2+n.scrollbarOffset;return u(t,S(e))}));var s=i.selectAll("."+n.cn.scrollbar).data(o.repeat,o.keyFun);s.enter().append("g").classed(n.cn.scrollbar,!0);var l=s.selectAll("."+n.cn.scrollbarSlider).data(o.repeat,o.keyFun);l.enter().append("g").classed(n.cn.scrollbarSlider,!0),l.attr("transform",(function(e){return u(0,e.scrollbarState.topY||0)}));var c=l.selectAll("."+n.cn.scrollbarGlyph).data(o.repeat,o.keyFun);c.enter().append("line").classed(n.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",n.scrollbarWidth).attr("stroke-linecap","round").attr("y1",n.scrollbarWidth/2),c.attr("y2",(function(e){return e.scrollbarState.barLength-n.scrollbarWidth/2})).attr("stroke-opacity",(function(e){return e.columnDragInProgress||!e.scrollbarState.barWiggleRoom||r?0:.4})),c.transition().delay(0).duration(0),c.transition().delay(n.scrollbarHideDelay).duration(n.scrollbarHideDuration).attr("stroke-opacity",0);var f=s.selectAll("."+n.cn.scrollbarCaptureZone).data(o.repeat,o.keyFun);f.enter().append("line").classed(n.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",n.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",(function(r){var n=a.event.y,i=this.getBoundingClientRect(),o=r.scrollbarState,s=n-i.top,l=a.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||E(t,e,null,l(s-o.barLength/2))(r)})).call(a.behavior.drag().origin((function(e){return a.event.stopPropagation(),e.scrollbarState.scrollbarScrollInProgress=!0,e})).on("drag",E(t,e)).on("dragend",(function(){}))),f.attr("y2",(function(e){return e.scrollbarState.scrollableAreaHeight})),t._context.staticPlot&&(c.remove(),f.remove())}function x(e,t,r,i){var l=function(e){var t=e.selectAll("."+n.cn.columnCell).data(h.splitToCells,(function(e){return e.keyWithinBlock}));return t.enter().append("g").classed(n.cn.columnCell,!0),t.exit().remove(),t}(function(e){var t=e.selectAll("."+n.cn.columnCells).data(o.repeat,o.keyFun);return t.enter().append("g").classed(n.cn.columnCells,!0),t.exit().remove(),t}(r));!function(e){e.each((function(e,t){var r=e.calcdata.cells.font,n=e.column.specIndex,a={size:k(r.size,n,t),color:k(r.color,n,t),family:k(r.family,n,t)};e.rowNumber=e.key,e.align=k(e.calcdata.cells.align,n,t),e.cellBorderWidth=k(e.calcdata.cells.line.width,n,t),e.font=a}))}(l),function(e){e.attr("width",(function(e){return e.column.columnWidth})).attr("stroke-width",(function(e){return e.cellBorderWidth})).each((function(e){var t=a.select(this);d.stroke(t,k(e.calcdata.cells.line.color,e.column.specIndex,e.rowNumber)),d.fill(t,k(e.calcdata.cells.fill.color,e.column.specIndex,e.rowNumber))}))}(function(e){var t=e.selectAll("."+n.cn.cellRect).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("rect").classed(n.cn.cellRect,!0),t}(l));var c=function(e){var t=e.selectAll("."+n.cn.cellText).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("text").classed(n.cn.cellText,!0).style("cursor",(function(){return"auto"})).on("mousedown",(function(){a.event.stopPropagation()})),t}(function(e){var t=e.selectAll("."+n.cn.cellTextHolder).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("g").classed(n.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),t}(l));!function(e){e.each((function(e){s.font(a.select(this),e.font)}))}(c),_(c,t,i,e),P(l)}function _(e,t,r,o){e.text((function(e){var t=e.column.specIndex,r=e.rowNumber,a=e.value,o="string"==typeof a,s=o&&a.match(/<br>/i),l=!o||s;e.mayHaveMarkup=o&&a.match(/[<&>]/);var c,u="string"==typeof(c=a)&&c.match(n.latexCheck);e.latex=u;var f,p,h=u?"":k(e.calcdata.cells.prefix,t,r)||"",d=u?"":k(e.calcdata.cells.suffix,t,r)||"",m=u?null:k(e.calcdata.cells.format,t,r)||null,g=h+(m?i(m)(e.value):e.value)+d;if(e.wrappingNeeded=!e.wrapped&&!l&&!u&&(f=w(g)),e.cellHeightMayIncrease=s||u||e.mayHaveMarkup||(void 0===f?w(g):f),e.needsConvertToTspans=e.mayHaveMarkup||e.wrappingNeeded||e.latex,e.wrappingNeeded){var y=(" "===n.wrapSplitCharacter?g.replace(/<a href=/gi,"<a_href="):g).split(n.wrapSplitCharacter),v=" "===n.wrapSplitCharacter?y.map((function(e){return e.replace(/<a_href=/gi,"<a href=")})):y;e.fragments=v.map((function(e){return{text:e,width:null}})),e.fragments.push({fragment:n.wrapSpacer,width:null}),p=v.join(n.lineBreaker)+n.lineBreaker+n.wrapSpacer}else delete e.fragments,p=g;return p})).attr("dy",(function(e){return e.needsConvertToTspans?0:"0.75em"})).each((function(e){var i=a.select(this),s=e.wrappingNeeded?N:O;e.needsConvertToTspans?l.convertToTspans(i,o,s(r,this,t,o,e)):a.select(this.parentNode).attr("transform",(function(e){return u(I(e),n.cellPad)})).attr("text-anchor",(function(e){return{left:"start",center:"middle",right:"end"}[e.align]}))}))}function w(e){return-1!==e.indexOf(n.wrapSplitCharacter)}function k(e,t,r){if(Array.isArray(e)){var n=e[Math.min(t,e.length-1)];return Array.isArray(n)?n[Math.min(r,n.length-1)]:n}return e}function D(e,t,r){e.transition().ease(n.releaseTransitionEase).duration(n.releaseTransitionDuration).attr("transform",u(t.x,r))}function T(e){return"cells"===e.type}function A(e){return"header"===e.type}function S(e){return(e.rowBlocks.length?e.rowBlocks[0].auxiliaryBlocks:[]).reduce((function(e,t){return e+L(t,1/0)}),0)}function M(e,t,r){var n=v(t)[0];if(void 0!==n){var a=n.rowBlocks,i=n.calcdata,o=R(a,a.length),s=n.calcdata.groupHeight-S(n),l=i.scrollY=Math.max(0,Math.min(o-s,i.scrollY)),c=function(e,t,r){for(var n=[],a=0,i=0;i<e.length;i++){for(var o=e[i],s=o.rows,l=0,c=0;c<s.length;c++)l+=s[c].rowHeight;o.allRowsHeight=l,t<a+l&&t+r>a&&n.push(i),a+=l}return n}(a,l,s);1===c.length&&(c[0]===a.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),t.each((function(e,t){e.page=c[t],e.scrollY=l})),t.attr("transform",(function(e){var t=R(e.rowBlocks,e.page)-e.scrollY;return u(0,t)})),e&&(C(e,r,t,c,n.prevPages,n,0),C(e,r,t,c,n.prevPages,n,1),b(r,e))}}function E(e,t,r,i){return function(o){var s=o.calcdata?o.calcdata:o,l=t.filter((function(e){return s.key===e.key})),c=r||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===i?s.scrollY+c*a.event.dy:i;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(T);return M(e,f,l),s.scrollY===u}}function C(e,t,r,n,a,i,o){n[o]!==a[o]&&(clearTimeout(i.currentRepaint[o]),i.currentRepaint[o]=setTimeout((function(){var i=r.filter((function(e,t){return t===o&&n[t]!==a[t]}));x(e,t,i,r),a[o]=n[o]})))}function N(e,t,r,i){return function(){var o=a.select(t.parentNode);o.each((function(e){var t=e.fragments;o.selectAll("tspan.line").each((function(e,r){t[r].width=this.getComputedTextLength()}));var r,a,i=t[t.length-1].width,s=t.slice(0,-1),l=[],c=0,u=e.column.columnWidth-2*n.cellPad;for(e.value="";s.length;)c+(a=(r=s.shift()).width+i)>u&&(e.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=a;c&&(e.value+=l.join(n.wrapSpacer)),e.wrapped=!0})),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,e,i),a.select(t.parentNode.parentNode).call(P)}}function O(e,t,r,i,o){return function(){if(!o.settledY){var s=a.select(t.parentNode),l=B(o),c=o.key-l.firstRowIndex,f=l.rows[c].rowHeight,p=o.cellHeightMayIncrease?t.parentNode.getBoundingClientRect().height+2*n.cellPad:f,h=Math.max(p,f);h-l.rows[c].rowHeight&&(l.rows[c].rowHeight=h,e.selectAll("."+n.cn.columnCell).call(P),M(null,e.filter(T),0),b(r,i,!0)),s.attr("transform",(function(){var e=this.parentNode.getBoundingClientRect(),t=a.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),i=t.top-e.top+(r?r.matrix.f:n.cellPad);return u(I(o,a.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),i)})),o.settledY=!0}}}function I(e,t){switch(e.align){case"left":default:return n.cellPad;case"right":return e.column.columnWidth-(t||0)-n.cellPad;case"center":return(e.column.columnWidth-(t||0))/2}}function P(e){e.attr("transform",(function(e){var t=e.rowBlocks[0].auxiliaryBlocks.reduce((function(e,t){return e+L(t,1/0)}),0),r=L(B(e),e.key);return u(0,r+t)})).selectAll("."+n.cn.cellRect).attr("height",(function(e){return(t=B(e),r=e.key,t.rows[r-t.firstRowIndex]).rowHeight;var t,r}))}function R(e,t){for(var r=0,n=t-1;n>=0;n--)r+=F(e[n]);return r}function L(e,t){for(var r=0,n=0;n<e.rows.length&&e.rows[n].rowIndex<t;n++)r+=e.rows[n].rowHeight;return r}function F(e){var t=e.allRowsHeight;if(void 0!==t)return t;for(var r=0,n=0;n<e.rows.length;n++)r+=e.rows[n].rowHeight;return e.allRowsHeight=r,r}function B(e){return e.rowBlocks[e.page]}t.exports=function(e,t){var r=!e._context.staticPlot,i=e._fullLayout._paper.selectAll("."+n.cn.table).data(t.map((function(t){var r=o.unwrap(t).trace;return p(e,r)})),o.keyFun);i.exit().remove(),i.enter().append("g").classed(n.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),i.attr("width",(function(e){return e.width+e.size.l+e.size.r})).attr("height",(function(e){return e.height+e.size.t+e.size.b})).attr("transform",(function(e){return u(e.translateX,e.translateY)}));var l=i.selectAll("."+n.cn.tableControlView).data(o.repeat,o.keyFun),d=l.enter().append("g").classed(n.cn.tableControlView,!0).style("box-sizing","content-box");if(r){var _="onwheel"in document?"wheel":"mousewheel";d.on("mousemove",(function(t){l.filter((function(e){return t===e})).call(b,e)})).on(_,(function(t){if(!t.scrollbarState.wheeling){t.scrollbarState.wheeling=!0;var r=t.scrollY+a.event.deltaY;E(e,l,null,r)(t)||(a.event.stopPropagation(),a.event.preventDefault()),t.scrollbarState.wheeling=!1}})).call(b,e,!0)}l.attr("transform",(function(e){return u(e.size.l,e.size.t)}));var w=l.selectAll("."+n.cn.scrollBackground).data(o.repeat,o.keyFun);w.enter().append("rect").classed(n.cn.scrollBackground,!0).attr("fill","none"),w.attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})),l.each((function(t){s.setClipUrl(a.select(this),g(e,t),e)}));var k=l.selectAll("."+n.cn.yColumn).data((function(e){return e.columns}),o.keyFun);k.enter().append("g").classed(n.cn.yColumn,!0),k.exit().remove(),k.attr("transform",(function(e){return u(e.x,0)})),r&&k.call(a.behavior.drag().origin((function(t){return D(a.select(this),t,-n.uplift),c(this),t.calcdata.columnDragInProgress=!0,b(l.filter((function(e){return t.calcdata.key===e.key})),e),t})).on("drag",(function(e){var t=a.select(this),r=function(t){return(e===t?a.event.x:t.x)+t.columnWidth/2};e.x=Math.max(-n.overdrag,Math.min(e.calcdata.width+n.overdrag-e.columnWidth,a.event.x)),v(k).filter((function(t){return t.calcdata.key===e.calcdata.key})).sort((function(e,t){return r(e)-r(t)})).forEach((function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t)})),k.filter((function(t){return e!==t})).transition().ease(n.transitionEase).duration(n.transitionDuration).attr("transform",(function(e){return u(e.x,0)})),t.call(f).attr("transform",u(e.x,-n.uplift))})).on("dragend",(function(t){var r=a.select(this),n=t.calcdata;t.x=t.xScale(t),t.calcdata.columnDragInProgress=!1,D(r,t,0),function(e,t,r){var n=t.gdColumnsOriginalOrder;t.gdColumns.sort((function(e,t){return r[n.indexOf(e)]-r[n.indexOf(t)]})),t.columnorder=r,e.emit("plotly_restyle")}(e,n,n.columns.map((function(e){return e.xIndex})))}))),k.each((function(t){s.setClipUrl(a.select(this),y(e,t),e)}));var S=k.selectAll("."+n.cn.columnBlock).data(h.splitToPanels,o.keyFun);S.enter().append("g").classed(n.cn.columnBlock,!0).attr("id",(function(e){return e.key})),S.style("cursor",(function(e){return e.dragHandle?"ew-resize":e.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"}));var C=S.filter(A),N=S.filter(T);r&&N.call(a.behavior.drag().origin((function(e){return a.event.stopPropagation(),e})).on("drag",E(e,l,-1)).on("dragend",(function(){}))),x(e,l,C,S),x(e,l,N,S);var O=l.selectAll("."+n.cn.scrollAreaClip).data(o.repeat,o.keyFun);O.enter().append("clipPath").classed(n.cn.scrollAreaClip,!0).attr("id",(function(t){return g(e,t)}));var I=O.selectAll("."+n.cn.scrollAreaClipRect).data(o.repeat,o.keyFun);I.enter().append("rect").classed(n.cn.scrollAreaClipRect,!0).attr("x",-n.overdrag).attr("y",-n.uplift).attr("fill","none"),I.attr("width",(function(e){return e.width+2*n.overdrag})).attr("height",(function(e){return e.height+n.uplift})),k.selectAll("."+n.cn.columnBoundary).data(o.repeat,o.keyFun).enter().append("g").classed(n.cn.columnBoundary,!0);var P=k.selectAll("."+n.cn.columnBoundaryClippath).data(o.repeat,o.keyFun);P.enter().append("clipPath").classed(n.cn.columnBoundaryClippath,!0),P.attr("id",(function(t){return y(e,t)}));var R=P.selectAll("."+n.cn.columnBoundaryRect).data(o.repeat,o.keyFun);R.enter().append("rect").classed(n.cn.columnBoundaryRect,!0).attr("fill","none"),R.attr("width",(function(e){return e.columnWidth+2*m(e)})).attr("height",(function(e){return e.calcdata.height+2*m(e)+n.uplift})).attr("x",(function(e){return-m(e)})).attr("y",(function(e){return-m(e)})),M(null,N,l)}},{"../../components/color":366,"../../components/drawing":388,"../../lib":503,"../../lib/gup":500,"../../lib/svg_text_utils":529,"./constants":1065,"./data_preparation_helper":1066,"./data_split_helpers":1067,"@plotly/d3":58}],1071:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../../plots/template_attributes").texttemplateAttrs,i=e("../../components/colorscale/attributes"),o=e("../../plots/domain").attributes,s=e("../pie/attributes"),l=e("../sunburst/attributes"),c=e("./constants"),u=e("../../lib/extend").extendFlat;t.exports={labels:l.labels,parents:l.parents,values:l.values,branchvalues:l.branchvalues,count:l.count,level:l.level,maxdepth:l.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:u({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:l.marker.colors,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:l.marker.line,editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:a({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/domain":584,"../../plots/template_attributes":633,"../pie/attributes":900,"../sunburst/attributes":1045,"./constants":1074}],1072:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="treemap",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":619}],1073:[function(e,t,r){"use strict";var n=e("../sunburst/calc");r.calc=function(e,t){return n.calc(e,t)},r.crossTraceCalc=function(e){return n._runCrossTraceCalc("treemap",e)}},{"../sunburst/calc":1047}],1074:[function(e,t,r){"use strict";t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],1075:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../components/color"),o=e("../../plots/domain").defaults,s=e("../bar/defaults").handleText,l=e("../bar/constants").TEXTPAD,c=e("../../components/colorscale"),u=c.hasColorscale,f=c.handleDefaults;t.exports=function(e,t,r,c){function p(r,i){return n.coerce(e,t,a,r,i)}var h=p("labels"),d=p("parents");if(h&&h.length&&d&&d.length){var m=p("values");m&&m.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var g=p("text");p("texttemplate"),t.texttemplate||p("textinfo",Array.isArray(g)?"text+label":"label"),p("hovertext"),p("hovertemplate");var y=p("pathbar.visible");s(e,t,c,p,"auto",{hasPathbar:y,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var v=-1!==t.textposition.indexOf("bottom");p("marker.line.width")&&p("marker.line.color",c.paper_bgcolor);var b=p("marker.colors");(t._hasColorscale=u(e,"marker","colors")||(e.marker||{}).coloraxis)?f(e,t,c,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(b||[]).length);var x=2*t.textfont.size;p("marker.pad.t",v?x/4:x),p("marker.pad.l",x/4),p("marker.pad.r",x/4),p("marker.pad.b",v?x:x/4),t._hovered={marker:{line:{width:2,color:i.contrast(c.paper_bgcolor)}}},y&&(p("pathbar.thickness",t.pathbar.textfont.size+2*l),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),o(t,c,p),t._length=null}else t.visible=!1}},{"../../components/color":366,"../../components/colorscale":378,"../../lib":503,"../../plots/domain":584,"../bar/constants":650,"../bar/defaults":652,"./attributes":1071}],1076:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../sunburst/helpers"),i=e("../bar/uniform_text").clearMinTextSize,o=e("../bar/style").resizeText,s=e("./plot_one");t.exports=function(e,t,r,l,c){var u,f,p=c.type,h=c.drawDescendants,d=e._fullLayout,m=d["_"+p+"layer"],g=!r;i(p,d),(u=m.selectAll("g.trace."+p).data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(p,!0),u.order(),!d.uniformtext.mode&&a.hasTransition(r)?(l&&(f=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){m.selectAll("g.trace").each((function(t){s(e,t,this,r,h)}))}))):(u.each((function(t){s(e,t,this,r,h)})),d.uniformtext.mode&&o(e,m.selectAll(".trace"),p)),g&&u.exit().remove()}},{"../bar/style":662,"../bar/uniform_text":664,"../sunburst/helpers":1051,"./plot_one":1085,"@plotly/d3":58}],1077:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../../lib/svg_text_utils"),s=e("./partition"),l=e("./style").styleOne,c=e("./constants"),u=e("../sunburst/helpers"),f=e("../sunburst/fx");t.exports=function(e,t,r,p,h){var d=h.barDifY,m=h.width,g=h.height,y=h.viewX,v=h.viewY,b=h.pathSlice,x=h.toMoveInsideSlice,_=h.strTransform,w=h.hasTransition,k=h.handleSlicesExit,D=h.makeUpdateSliceInterpolator,T=h.makeUpdateTextInterpolator,A={},S=e._fullLayout,M=t[0],E=M.trace,C=M.hierarchy,N=m/E._entryDepth,O=u.listPath(r.data,"id"),I=s(C.copy(),[m,g],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(I=I.filter((function(e){var t=O.indexOf(e.data.id);return-1!==t&&(e.x0=N*t,e.x1=N*(t+1),e.y0=d,e.y1=d+g,e.onPathbar=!0,!0)}))).reverse(),(p=p.data(I,u.getPtId)).enter().append("g").classed("pathbar",!0),k(p,!0,A,[m,g],b),p.order();var P=p;w&&(P=P.transition().each("end",(function(){var t=n.select(this);u.setSliceCursor(t,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),P.each((function(s){s._x0=y(s.x0),s._x1=y(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=y(s.x1-Math.min(m,g)/2),s._hoverY=v(s.y1-g/2);var p=n.select(this),h=a.ensureSingle(p,"path","surface",(function(e){e.style("pointer-events","all")}));w?h.transition().attrTween("d",(function(e){var t=D(e,!0,A,[m,g]);return function(e){return b(t(e))}})):h.attr("d",b),p.call(f,r,e,t,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:e._transitioning}),h.call(l,s,E,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("<br>").join(" ")||"";var d=a.ensureSingle(p,"g","slicetext"),k=a.ensureSingle(d,"text","",(function(e){e.attr("data-notex",1)})),M=a.ensureUniformFontSize(e,u.determineTextFont(E,s,S.font,{onPathbar:!0}));k.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,M).call(o.convertToTspans,e),s.textBB=i.bBox(k.node()),s.transform=x(s,{fontSize:M.size,onPathbar:!0}),s.transform.fontSize=M.size,w?k.transition().attrTween("transform",(function(e){var t=T(e,!0,A,[m,g]);return function(e){return _(t(e))}})):k.attr("transform",_(s))}))}},{"../../components/drawing":388,"../../lib":503,"../../lib/svg_text_utils":529,"../sunburst/fx":1050,"../sunburst/helpers":1051,"./constants":1074,"./partition":1083,"./style":1086,"@plotly/d3":58}],1078:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../../lib/svg_text_utils"),s=e("./partition"),l=e("./style").styleOne,c=e("./constants"),u=e("../sunburst/helpers"),f=e("../sunburst/fx"),p=e("../sunburst/plot").formatSliceLabel;t.exports=function(e,t,r,h,d){var m=d.width,g=d.height,y=d.viewX,v=d.viewY,b=d.pathSlice,x=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,k=d.handleSlicesExit,D=d.makeUpdateSliceInterpolator,T=d.makeUpdateTextInterpolator,A=d.prevEntry,S=e._fullLayout,M=t[0].trace,E=-1!==M.textposition.indexOf("left"),C=-1!==M.textposition.indexOf("right"),N=-1!==M.textposition.indexOf("bottom"),O=!N&&!M.marker.pad.t||N&&!M.marker.pad.b,I=s(r,[m,g],{packing:M.tiling.packing,squarifyratio:M.tiling.squarifyratio,flipX:M.tiling.flip.indexOf("x")>-1,flipY:M.tiling.flip.indexOf("y")>-1,pad:{inner:M.tiling.pad,top:M.marker.pad.t,left:M.marker.pad.l,right:M.marker.pad.r,bottom:M.marker.pad.b}}).descendants(),P=1/0,R=-1/0;I.forEach((function(e){var t=e.depth;t>=M._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(P=Math.min(P,t),R=Math.max(R,t))})),h=h.data(I,u.getPtId),M._maxVisibleLayers=isFinite(R)?R-P+1:0,h.enter().append("g").classed("slice",!0),k(h,!1,{},[m,g],b),h.order();var L=null;if(w&&A){var F=u.getPtId(A);h.each((function(e){null===L&&u.getPtId(e)===F&&(L={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var B=function(){return L||{x0:0,x1:m,y0:0,y1:g}},z=h;return w&&(z=z.transition().each("end",(function(){var t=n.select(this);u.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),z.each((function(s){var h=u.isHeader(s,M);s._x0=y(s.x0),s._x1=y(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=y(s.x1-M.marker.pad.r),s._hoverY=v(N?s.y1-M.marker.pad.b/2:s.y0+M.marker.pad.t/2);var d=n.select(this),k=a.ensureSingle(d,"path","surface",(function(e){e.style("pointer-events","all")}));w?k.transition().attrTween("d",(function(e){var t=D(e,!1,B(),[m,g]);return function(e){return b(t(e))}})):k.attr("d",b),d.call(f,r,e,t,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,e,{isTransitioning:e._transitioning}),k.call(l,s,M,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h?O?"":u.getPtLabel(s)||"":p(s,r,M,t,S)||"";var A=a.ensureSingle(d,"g","slicetext"),I=a.ensureSingle(A,"text","",(function(e){e.attr("data-notex",1)})),P=a.ensureUniformFontSize(e,u.determineTextFont(M,s,S.font));I.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":E||h?"start":"middle").call(i.font,P).call(o.convertToTspans,e),s.textBB=i.bBox(I.node()),s.transform=x(s,{fontSize:P.size,isHeader:h}),s.transform.fontSize=P.size,w?I.transition().attrTween("transform",(function(e){var t=T(e,!1,B(),[m,g]);return function(e){return _(t(e))}})):I.attr("transform",_(s))})),L}},{"../../components/drawing":388,"../../lib":503,"../../lib/svg_text_utils":529,"../sunburst/fx":1050,"../sunburst/helpers":1051,"../sunburst/plot":1055,"./constants":1074,"./partition":1083,"./style":1086,"@plotly/d3":58}],1079:[function(e,t,r){"use strict";t.exports=function e(t,r,n){var a;n.swapXY&&(a=t.x0,t.x0=t.y0,t.y0=a,a=t.x1,t.x1=t.y1,t.y1=a),n.flipX&&(a=t.x0,t.x0=r[0]-t.x1,t.x1=r[0]-a),n.flipY&&(a=t.y0,t.y0=r[1]-t.y1,t.y1=r[1]-a);var i=t.children;if(i)for(var o=0;o<i.length;o++)e(i[o],r,n)}},{}],1080:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"treemap",basePlotModule:e("./base_plot"),categories:[],animatable:!0,attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style").style,colorbar:e("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":944,"./attributes":1071,"./base_plot":1072,"./calc":1073,"./defaults":1075,"./layout_attributes":1081,"./layout_defaults":1082,"./plot":1084,"./style":1086}],1081:[function(e,t,r){"use strict";t.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1082:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("treemapcolorway",t.colorway),r("extendtreemapcolors")}},{"../../lib":503,"./layout_attributes":1081}],1083:[function(e,t,r){"use strict";var n=e("d3-hierarchy"),a=e("./flip_tree");t.exports=function(e,t,r){var i,o=r.flipX,s=r.flipY,l="dice-slice"===r.packing,c=r.pad[s?"bottom":"top"],u=r.pad[o?"right":"left"],f=r.pad[o?"left":"right"],p=r.pad[s?"top":"bottom"];l&&(i=u,u=c,c=i,i=f,f=p,p=i);var h=n.treemap().tile(function(e,t){switch(e){case"squarify":return n.treemapSquarify.ratio(t);case"binary":return n.treemapBinary;case"dice":return n.treemapDice;case"slice":return n.treemapSlice;default:return n.treemapSliceDice}}(r.packing,r.squarifyratio)).paddingInner(r.pad.inner).paddingLeft(u).paddingRight(f).paddingTop(c).paddingBottom(p).size(l?[t[1],t[0]]:t)(e);return(l||o||s)&&a(h,t,{swapXY:l,flipX:o,flipY:s}),h}},{"./flip_tree":1079,"d3-hierarchy":115}],1084:[function(e,t,r){"use strict";var n=e("./draw"),a=e("./draw_descendants");t.exports=function(e,t,r,i){return n(e,t,r,i,{type:"treemap",drawDescendants:a})}},{"./draw":1076,"./draw_descendants":1078}],1085:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-interpolate").interpolate,i=e("../sunburst/helpers"),o=e("../../lib"),s=e("../bar/constants").TEXTPAD,l=e("../bar/plot").toMoveInsideBar,c=e("../bar/uniform_text").recordMinTextSize,u=e("./constants"),f=e("./draw_ancestors");function p(e){return i.isHierarchyRoot(e)?"":i.getPtId(e)}t.exports=function(e,t,r,h,d){var m=e._fullLayout,g=t[0],y=g.trace,v="icicle"===y.type,b=g.hierarchy,x=i.findEntryWithLevel(b,y.level),_=n.select(r),w=_.selectAll("g.pathbar"),k=_.selectAll("g.slice");if(!x)return w.remove(),void k.remove();var D=i.isHierarchyRoot(x),T=!m.uniformtext.mode&&i.hasTransition(h),A=i.getMaxDepth(y),S=m._size,M=y.domain,E=S.w*(M.x[1]-M.x[0]),C=S.h*(M.y[1]-M.y[0]),N=E,O=y.pathbar.thickness,I=y.marker.line.width+u.gapWithPathbar,P=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?C+I:-(O+I):0,R={x0:N,x1:N,y0:P,y1:P+O},L=function(e,t,r){var n=y.tiling.pad,a=function(e){return e-n<=t.x0},i=function(e){return e+n>=t.x1},o=function(e){return e-n<=t.y0},s=function(e){return e+n>=t.y1};return e.x0===t.x0&&e.x1===t.x1&&e.y0===t.y0&&e.y1===t.y1?{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1}:{x0:a(e.x0-n)?0:i(e.x0-n)?r[0]:e.x0,x1:a(e.x1+n)?0:i(e.x1+n)?r[0]:e.x1,y0:o(e.y0-n)?0:s(e.y0-n)?r[1]:e.y0,y1:o(e.y1+n)?0:s(e.y1+n)?r[1]:e.y1}},F=null,B={},z={},j=null,U=function(e,t){return t?B[p(e)]:z[p(e)]};g.hasMultipleRoots&&D&&A++,y._maxDepth=A,y._backgroundColor=m.paper_bgcolor,y._entryDepth=x.data.depth,y._atRootLevel=D;var $=-E/2+S.l+S.w*(M.x[1]+M.x[0])/2,V=-C/2+S.t+S.h*(1-(M.y[1]+M.y[0])/2),q=function(e){return $+e},W=function(e){return V+e},H=W(0),G=q(0),X=function(e){return G+e},Y=function(e){return H+e};function Z(e,t){return e+","+t}var K=X(0),J=function(e){e.x=Math.max(K,e.x)},Q=y.pathbar.edgeshape,ee=function(e,t){var r=e.x0,n=e.x1,a=e.y0,i=e.y1,o=e.textBB,u=function(e){return-1!==y.textposition.indexOf(e)},f=u("bottom"),p=u("top")||t.isHeader&&!f?"start":f?"end":"middle",h=u("right"),d=u("left")||t.onPathbar?-1:h?1:0,g=y[v?"tiling":"marker"].pad;if(t.isHeader){if((r+=(v?g:g.l)-s)>=(n-=(v?g:g.r)-s)){var b=(r+n)/2;r=b,n=b}var x;f?a<(x=i-(v?g:g.b))&&x<i&&(a=x):a<(x=a+(v?g:g.t))&&x<i&&(i=x)}var _=l(r,n,a,i,o,{isHorizontal:!1,constrained:!0,angle:0,anchor:p,leftToRight:d});return _.fontSize=t.fontSize,_.targetX=q(_.targetX),_.targetY=W(_.targetY),isNaN(_.targetX)||isNaN(_.targetY)?{}:(r!==n&&a!==i&&c(y.type,_,m),{scale:_.scale,rotate:_.rotate,textX:_.textX,textY:_.textY,anchorX:_.anchorX,anchorY:_.anchorY,targetX:_.targetX,targetY:_.targetY})},te=function(e,t){for(var r,n=0,a=e;!r&&n<A;)n++,(a=a.parent)?r=U(a,t):n=A;return r||{}},re=function(e,t,r,n,i){var s,l=U(e,t);if(l)s=l;else if(t)s=R;else if(F)if(e.parent){var c=j||r;c&&!t?s=L(e,c,n):(s={},o.extendFlat(s,te(e,t)))}else s=o.extendFlat({},e),v&&("h"===i.orientation?i.flipX?s.x0=e.x1:s.x1=0:i.flipY?s.y0=e.y1:s.y1=0);else s={};return a(s,{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})},ne=function(e,t,r,n){var s=U(e,t),l={},u=function(e,t,r,n){if(t)return B[p(b)]||R;var a=z[y.level]||r;return function(e){return e.data.depth-x.data.depth<A}(e)?L(e,a,n):{}}(e,t,r,n);o.extendFlat(l,{transform:ee({x0:u.x0,x1:u.x1,y0:u.y0,y1:u.y1,textBB:e.textBB,_text:e._text},{isHeader:i.isHeader(e,y)})}),s?l=s:e.parent&&o.extendFlat(l,te(e,t));var f=e.transform;return e.x0!==e.x1&&e.y0!==e.y1&&c(y.type,f,m),a(l,{transform:{scale:f.scale,rotate:f.rotate,textX:f.textX,textY:f.textY,anchorX:f.anchorX,anchorY:f.anchorY,targetX:f.targetX,targetY:f.targetY}})},ae=function(e,t,r,i,o){var s=i[0],l=i[1];T?e.exit().transition().each((function(){var e=n.select(this);e.select("path.surface").transition().attrTween("d",(function(e){var r=function(e,t,r,n){var i,o=U(e,t);if(t)i=R;else{var s=U(x,t);i=s?L(e,s,n):{}}return a(o,i)}(e,t,0,[s,l]);return function(e){return o(r(e))}})),e.select("g.slicetext").attr("opacity",0)})).remove():e.exit().remove()},ie=function(e){var t=e.transform;return e.x0!==e.x1&&e.y0!==e.y1&&c(y.type,t,m),o.getTextTransform({textX:t.textX,textY:t.textY,anchorX:t.anchorX,anchorY:t.anchorY,targetX:t.targetX,targetY:t.targetY,scale:t.scale,rotate:t.rotate})};T&&(w.each((function(e){B[p(e)]={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},e.transform&&(B[p(e)].transform={textX:e.transform.textX,textY:e.transform.textY,anchorX:e.transform.anchorX,anchorY:e.transform.anchorY,targetX:e.transform.targetX,targetY:e.transform.targetY,scale:e.transform.scale,rotate:e.transform.rotate})})),k.each((function(e){z[p(e)]={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},e.transform&&(z[p(e)].transform={textX:e.transform.textX,textY:e.transform.textY,anchorX:e.transform.anchorX,anchorY:e.transform.anchorY,targetX:e.transform.targetX,targetY:e.transform.targetY,scale:e.transform.scale,rotate:e.transform.rotate}),!F&&i.isEntry(e)&&(F=e)}))),j=d(e,t,x,k,{width:E,height:C,viewX:q,viewY:W,pathSlice:function(e){var t=q(e.x0),r=q(e.x1),n=W(e.y0),a=W(e.y1);return r-t&&a-n?"M"+Z(t,n+0)+"L"+Z(r-0,n)+"L"+Z(r,a-0)+"L"+Z(t+0,a)+"Z":""},toMoveInsideSlice:ee,prevEntry:F,makeUpdateSliceInterpolator:re,makeUpdateTextInterpolator:ne,handleSlicesExit:ae,hasTransition:T,strTransform:ie}),y.pathbar.visible?f(e,t,x,w,{barDifY:P,width:N,height:O,viewX:X,viewY:Y,pathSlice:function(e){var t=X(Math.max(Math.min(e.x0,e.x0),0)),r=X(Math.min(Math.max(e.x1,e.x1),N)),n=Y(e.y0),a=Y(e.y1),i=O/2,o={},s={};o.x=t,s.x=r,o.y=s.y=(n+a)/2;var l={x:t,y:n},c={x:r,y:n},u={x:r,y:a},f={x:t,y:a};return">"===Q?(l.x-=i,c.x-=i,u.x-=i,f.x-=i):"/"===Q?(u.x-=i,f.x-=i,o.x-=i/2,s.x-=i/2):"\\"===Q?(l.x-=i,c.x-=i,o.x-=i/2,s.x-=i/2):"<"===Q&&(o.x-=i,s.x-=i),J(l),J(f),J(o),J(c),J(u),J(s),"M"+Z(l.x,l.y)+"L"+Z(c.x,c.y)+"L"+Z(s.x,s.y)+"L"+Z(u.x,u.y)+"L"+Z(f.x,f.y)+"L"+Z(o.x,o.y)+"Z"},toMoveInsideSlice:ee,makeUpdateSliceInterpolator:re,makeUpdateTextInterpolator:ne,handleSlicesExit:ae,hasTransition:T,strTransform:ie}):w.remove()}},{"../../lib":503,"../bar/constants":650,"../bar/plot":659,"../bar/uniform_text":664,"../sunburst/helpers":1051,"./constants":1074,"./draw_ancestors":1077,"@plotly/d3":58,"d3-interpolate":116}],1086:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/color"),i=e("../../lib"),o=e("../sunburst/helpers"),s=e("../bar/uniform_text").resizeText;function l(e,t,r,n){var s,l,c=(n||{}).hovered,u=t.data.data,f=u.i,p=u.color,h=o.isHierarchyRoot(t),d=1;if(c)s=r._hovered.marker.line.color,l=r._hovered.marker.line.width;else if(h&&p===r.root.color)d=100,s="rgba(0,0,0,0)",l=0;else if(s=i.castOption(r,f,"marker.line.color")||a.defaultLine,l=i.castOption(r,f,"marker.line.width")||0,!r._hasColorscale&&!t.onPathbar){var m=r.marker.depthfade;if(m){var g,y=a.combine(a.addOpacity(r._backgroundColor,.75),p);if(!0===m){var v=o.getMaxDepth(r);g=isFinite(v)?o.isLeaf(t)?0:r._maxVisibleLayers-(t.data.depth-r._entryDepth):t.data.height+1}else g=t.data.depth-r._entryDepth,r._atRootLevel||g++;if(g>0)for(var b=0;b<g;b++){var x=.5*b/g;p=a.combine(a.addOpacity(y,x),p)}}}e.style("stroke-width",l).call(a.fill,p).call(a.stroke,s).style("opacity",d)}t.exports={style:function(e){var t=e._fullLayout._treemaplayer.selectAll(".trace");s(e,t,"treemap"),t.each((function(e){var t=n.select(this),r=e[0].trace;t.style("opacity",r.opacity),t.selectAll("path.surface").each((function(e){n.select(this).call(l,e,r,{hovered:!1})}))}))},styleOne:l}},{"../../components/color":366,"../../lib":503,"../bar/uniform_text":664,"../sunburst/helpers":1051,"@plotly/d3":58}],1087:[function(e,t,r){"use strict";var n=e("../box/attributes"),a=e("../../lib/extend").extendFlat,i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat;t.exports={y:n.y,x:n.x,x0:n.x0,y0:n.y0,xhoverformat:i("x"),yhoverformat:i("y"),name:a({},n.name,{}),orientation:a({},n.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,points:a({},n.boxpoints,{}),jitter:a({},n.jitter,{}),pointpos:a({},n.pointpos,{}),width:a({},n.width,{}),marker:n.marker,text:n.text,hovertext:n.hovertext,hovertemplate:n.hovertemplate,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"}}},{"../../lib/extend":493,"../../plots/cartesian/axis_format_attributes":557,"../box/attributes":673}],1088:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../box/calc"),o=e("./helpers"),s=e("../../constants/numerical").BADNUM;function l(e,t,r){var a=t.max-t.min;if(!a)return e.bandwidth?e.bandwidth:0;if(e.bandwidth)return Math.max(e.bandwidth,a/1e4);var i=r.length,o=n.stdev(r,i-1,t.mean);return Math.max(function(e,t,r){return 1.059*Math.min(t,r/1.349)*Math.pow(e,-.2)}(i,o,t.q3-t.q1),a/100)}function c(e,t,r,n){var i,o=e.spanmode,l=e.span||[],c=[t.min,t.max],u=[t.min-2*n,t.max+2*n];function f(n){var a=l[n],i="multicategory"===r.type?r.r2c(a):r.d2c(a,0,e[t.valLetter+"calendar"]);return i===s?u[n]:i}var p={type:"linear",range:i="soft"===o?u:"hard"===o?c:[f(0),f(1)]};return a.setConvert(p),p.cleanRange(),i}t.exports=function(e,t){var r=i(e,t);if(r[0].t.empty)return r;for(var s=e._fullLayout,u=a.getFromId(e,t["h"===t.orientation?"xaxis":"yaxis"]),f=1/0,p=-1/0,h=0,d=0,m=0;m<r.length;m++){var g=r[m],y=g.pts.map(o.extractVal),v=g.bandwidth=l(t,g,y),b=g.span=c(t,g,u,v);if(g.min===g.max&&0===v)b=g.span=[g.min,g.max],g.density=[{v:1,t:b[0]}],g.bandwidth=v,h=Math.max(h,1);else{var x=b[1]-b[0],_=Math.ceil(x/(v/3)),w=x/_;if(!isFinite(w)||!isFinite(_))return n.error("Something went wrong with computing the violin span"),r[0].t.empty=!0,r;var k=o.makeKDE(g,t,y);g.density=new Array(_);for(var D=0,T=b[0];T<b[1]+w/2;D++,T+=w){var A=k(T);g.density[D]={v:A,t:T},h=Math.max(h,A)}}d=Math.max(d,y.length),f=Math.min(f,b[0]),p=Math.max(p,b[1])}var S=a.findExtremes(u,[f,p],{padded:!0});if(t._extremes[u._id]=S,t.width)r[0].t.maxKDE=h;else{var M=s._violinScaleGroupStats,E=t.scalegroup,C=M[E];C?(C.maxKDE=Math.max(C.maxKDE,h),C.maxCount=Math.max(C.maxCount,d)):M[E]={maxKDE:h,maxCount:d}}return r[0].t.labels.kde=n._(e,"kde:"),r}},{"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/axes":554,"../box/calc":674,"./helpers":1091}],1089:[function(e,t,r){"use strict";var n=e("../box/cross_trace_calc").setPositionOffset,a=["v","h"];t.exports=function(e,t){for(var r=e.calcdata,i=t.xaxis,o=t.yaxis,s=0;s<a.length;s++){for(var l=a[s],c="h"===l?o:i,u=[],f=0;f<r.length;f++){var p=r[f],h=p[0].t,d=p[0].trace;!0!==d.visible||"violin"!==d.type||h.empty||d.orientation!==l||d.xaxis!==i._id||d.yaxis!==o._id||u.push(f)}n("violin",e,u,c)}}},{"../box/cross_trace_calc":675}],1090:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../box/defaults"),o=e("./attributes");t.exports=function(e,t,r,s){function l(r,a){return n.coerce(e,t,o,r,a)}function c(r,a){return n.coerce2(e,t,o,r,a)}if(i.handleSampleDefaults(e,t,l,s),!1!==t.visible){l("bandwidth"),l("side"),l("width")||(l("scalegroup",t.name),l("scalemode"));var u,f=l("span");Array.isArray(f)&&(u="manual"),l("spanmode",u);var p=l("line.color",(e.marker||{}).color||r),h=l("line.width"),d=l("fillcolor",a.addOpacity(t.line.color,.5));i.handlePointsDefaults(e,t,l,{prefix:""});var m=c("box.width"),g=c("box.fillcolor",d),y=c("box.line.color",p),v=c("box.line.width",h);l("box.visible",Boolean(m||g||y||v))||(t.box={visible:!1});var b=c("meanline.color",p),x=c("meanline.width",h);l("meanline.visible",Boolean(b||x))||(t.meanline={visible:!1})}}},{"../../components/color":366,"../../lib":503,"../box/defaults":676,"./attributes":1087}],1091:[function(e,t,r){"use strict";var n=e("../../lib"),a=function(e){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*e*e)};r.makeKDE=function(e,t,r){var n=r.length,i=a,o=e.bandwidth,s=1/(n*o);return function(e){for(var t=0,a=0;a<n;a++)t+=i((e-r[a])/o);return s*t}},r.getPositionOnKdePath=function(e,t,r){var a,i;"h"===t.orientation?(a="y",i="x"):(a="x",i="y");var o=n.findPointOnPath(e.path,r,i,{pathLength:e.pathLength}),s=e.posCenterPx,l=o[a];return[l,"both"===t.side?2*s-l:s]},r.getKdeValue=function(e,t,n){var a=e.pts.map(r.extractVal);return r.makeKDE(e,t,a)(n)/e.posDensityScale},r.extractVal=function(e){return e.v}},{"../../lib":503}],1092:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../box/hover"),o=e("./helpers");t.exports=function(e,t,r,s,l){l||(l={});var c,u,f=l.hoverLayer,p=e.cd,h=p[0].trace,d=h.hoveron,m=-1!==d.indexOf("violins"),g=-1!==d.indexOf("kde"),y=[];if(m||g){var v=i.hoverOnBoxes(e,t,r,s);if(g&&v.length>0){var b,x,_,w,k,D=e.xa,T=e.ya;"h"===h.orientation?(k=t,b="y",_=T,x="x",w=D):(k=r,b="x",_=D,x="y",w=T);var A=p[e.index];if(k>=A.span[0]&&k<=A.span[1]){var S=n.extendFlat({},e),M=w.c2p(k,!0),E=o.getKdeValue(A,h,k),C=o.getPositionOnKdePath(A,h,M),N=_._offset,O=_._length;S[b+"0"]=C[0],S[b+"1"]=C[1],S[x+"0"]=S[x+"1"]=M,S[x+"Label"]=x+": "+a.hoverLabelText(w,k,h[x+"hoverformat"])+", "+p[0].t.labels.kde+" "+E.toFixed(3),S.spikeDistance=v[0].spikeDistance;var I=b+"Spike";S[I]=v[0][I],v[0].spikeDistance=void 0,v[0][I]=void 0,S.hovertemplate=!1,y.push(S),(u={stroke:e.color})[b+"1"]=n.constrain(N+C[0],N,N+O),u[b+"2"]=n.constrain(N+C[1],N,N+O),u[x+"1"]=u[x+"2"]=w._offset+M}}m&&(y=y.concat(v))}-1!==d.indexOf("points")&&(c=i.hoverOnPoints(e,t,r));var P=f.selectAll(".violinline-"+h.uid).data(u?[0]:[]);return P.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),P.exit().remove(),P.attr(u),"closest"===s?c?[c]:y:c?(y.push(c),y):y}},{"../../lib":503,"../../plots/cartesian/axes":554,"../box/hover":678,"./helpers":1091}],1093:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../box/select"),moduleType:"trace",name:"violin",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":568,"../box/defaults":676,"../box/select":683,"../scatter/style":950,"./attributes":1087,"./calc":1088,"./cross_trace_calc":1089,"./defaults":1090,"./hover":1092,"./layout_attributes":1094,"./layout_defaults":1095,"./plot":1096,"./style":1097}],1094:[function(e,t,r){"use strict";var n=e("../box/layout_attributes"),a=e("../../lib").extendFlat;t.exports={violinmode:a({},n.boxmode,{}),violingap:a({},n.boxgap,{}),violingroupgap:a({},n.boxgroupgap,{})}},{"../../lib":503,"../box/layout_attributes":680}],1095:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("../box/layout_defaults");t.exports=function(e,t,r){i._supply(e,t,r,(function(r,i){return n.coerce(e,t,a,r,i)}),"violin")}},{"../../lib":503,"../box/layout_defaults":681,"./layout_attributes":1094}],1096:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../box/plot"),s=e("../scatter/line_points"),l=e("./helpers");t.exports=function(e,t,r,c){var u=e._fullLayout,f=t.xaxis,p=t.yaxis;function h(e){var t=s(e,{xaxis:f,yaxis:p,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(t[0],1)}a.makeTraceGroups(c,r,"trace violins").each((function(e){var r=n.select(this),i=e[0],s=i.t,c=i.trace;if(!0!==c.visible||s.empty)r.remove();else{var d=s.bPos,m=s.bdPos,g=t[s.valLetter+"axis"],y=t[s.posLetter+"axis"],v="both"===c.side,b=v||"positive"===c.side,x=v||"negative"===c.side,_=r.selectAll("path.violin").data(a.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each((function(e){var t,r,a,i,o,l,f,p,_=n.select(this),w=e.density,k=w.length,D=y.c2l(e.pos+d,!0),T=y.l2p(D);if(c.width)t=s.maxKDE/m;else{var A=u._violinScaleGroupStats[c.scalegroup];t="count"===c.scalemode?A.maxKDE/m*(A.maxCount/e.pts.length):A.maxKDE/m}if(b){for(f=new Array(k),o=0;o<k;o++)(p=f[o]={})[s.posLetter]=D+w[o].v/t,p[s.valLetter]=g.c2l(w[o].t,!0);r=h(f)}if(x){for(f=new Array(k),l=0,o=k-1;l<k;l++,o--)(p=f[l]={})[s.posLetter]=D-w[o].v/t,p[s.valLetter]=g.c2l(w[o].t,!0);a=h(f)}if(v)i=r+"L"+a.substr(1)+"Z";else{var S=[T,g.c2p(w[0].t)],M=[T,g.c2p(w[k-1].t)];"h"===c.orientation&&(S.reverse(),M.reverse()),i=b?"M"+S+"L"+r.substr(1)+"L"+M:"M"+M+"L"+a.substr(1)+"L"+S}_.attr("d",i),e.posCenterPx=T,e.posDensityScale=t*m,e.path=_.node(),e.pathLength=e.path.getTotalLength()/(v?2:1)}));var w,k,D,T=c.box,A=T.width,S=(T.line||{}).width;v?(w=m*A,k=0):b?(w=[0,m*A/2],k=S*{x:1,y:-1}[s.posLetter]):(w=[m*A/2,0],k=S*{x:-1,y:1}[s.posLetter]),o.plotBoxAndWhiskers(r,{pos:y,val:g},c,{bPos:d,bdPos:w,bPosPxOffset:k}),o.plotBoxMean(r,{pos:y,val:g},c,{bPos:d,bdPos:w,bPosPxOffset:k}),!c.box.visible&&c.meanline.visible&&(D=a.identity);var M=r.selectAll("path.meanline").data(D||[]);M.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect","non-scaling-stroke"),M.exit().remove(),M.each((function(e){var t=g.c2p(e.mean,!0),r=l.getPositionOnKdePath(e,c,t);n.select(this).attr("d","h"===c.orientation?"M"+t+","+r[0]+"V"+r[1]:"M"+r[0]+","+t+"H"+r[1])})),o.plotPoints(r,{x:f,y:p},c,s)}}))}},{"../../components/drawing":388,"../../lib":503,"../box/plot":682,"../scatter/line_points":940,"./helpers":1091,"@plotly/d3":58}],1097:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/color"),i=e("../scatter/style").stylePoints;t.exports=function(e){var t=n.select(e).selectAll("g.trace.violins");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(t){var r=t[0].trace,o=n.select(this),s=r.box||{},l=s.line||{},c=r.meanline||{},u=c.width;o.selectAll("path.violin").style("stroke-width",r.line.width+"px").call(a.stroke,r.line.color).call(a.fill,r.fillcolor),o.selectAll("path.box").style("stroke-width",l.width+"px").call(a.stroke,l.color).call(a.fill,s.fillcolor);var f={"stroke-width":u+"px","stroke-dasharray":2*u+"px,"+u+"px"};o.selectAll("path.mean").style(f).call(a.stroke,c.color),o.selectAll("path.meanline").style(f).call(a.stroke,c.color),i(o,r,e)}))}},{"../../components/color":366,"../scatter/style":950,"@plotly/d3":58}],1098:[function(e,t,r){"use strict";var n=e("../../components/colorscale/attributes"),a=e("../isosurface/attributes"),i=e("../surface/attributes"),o=e("../../plots/attributes"),s=e("../../lib/extend").extendFlat,l=e("../../plot_api/edit_types").overrideAll,c=t.exports=l(s({x:a.x,y:a.y,z:a.z,value:a.value,isomin:a.isomin,isomax:a.isomax,surface:a.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:a.slices,caps:a.caps,text:a.text,hovertext:a.hovertext,xhoverformat:a.xhoverformat,yhoverformat:a.yhoverformat,zhoverformat:a.zhoverformat,valuehoverformat:a.valuehoverformat,hovertemplate:a.hovertemplate},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:a.colorbar,opacity:a.opacity,opacityscale:i.opacityscale,lightposition:a.lightposition,lighting:a.lighting,flatshading:a.flatshading,contour:a.contour,hoverinfo:s({},o.hoverinfo),showlegend:s({},o.showlegend,{dflt:!1})}),"calc","nested");c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes",c.transforms=void 0},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plots/attributes":550,"../isosurface/attributes":862,"../surface/attributes":1057}],1099:[function(e,t,r){"use strict";var n=e("../../../stackgl_modules").gl_mesh3d,a=e("../../lib/gl_format_color").parseColorScale,i=e("../../lib/str2rgbarray"),o=e("../../components/colorscale").extractOpts,s=e("../../plots/gl3d/zip3"),l=e("../isosurface/convert").findNearestOnAxis,c=e("../isosurface/convert").generateIsoMeshes;function u(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.data=null,this.showContour=!1}var f=u.prototype;f.handlePick=function(e){if(e.object===this.mesh){var t=e.data.index,r=this.data._meshX[t],n=this.data._meshY[t],a=this.data._meshZ[t],i=this.data._Ys.length,o=this.data._Zs.length,s=l(r,this.data._Xs).id,c=l(n,this.data._Ys).id,u=l(a,this.data._Zs).id,f=e.index=u+o*c+o*i*s;e.traceCoordinate=[this.data._meshX[f],this.data._meshY[f],this.data._meshZ[f],this.data._value[f]];var p=this.data.hovertext||this.data.text;return Array.isArray(p)&&void 0!==p[f]?e.textLabel=p[f]:p&&(e.textLabel=p),!0}},f.update=function(e){var t=this.scene,r=t.fullSceneLayout;function n(e,t,r,n){return t.map((function(t){return e.d2l(t,0,n)*r}))}this.data=c(e);var l={positions:s(n(r.xaxis,e._meshX,t.dataScale[0],e.xcalendar),n(r.yaxis,e._meshY,t.dataScale[1],e.ycalendar),n(r.zaxis,e._meshZ,t.dataScale[2],e.zcalendar)),cells:s(e._meshI,e._meshJ,e._meshK),lightPosition:[e.lightposition.x,e.lightposition.y,e.lightposition.z],ambient:e.lighting.ambient,diffuse:e.lighting.diffuse,specular:e.lighting.specular,roughness:e.lighting.roughness,fresnel:e.lighting.fresnel,vertexNormalsEpsilon:e.lighting.vertexnormalsepsilon,faceNormalsEpsilon:e.lighting.facenormalsepsilon,opacity:e.opacity,opacityscale:e.opacityscale,contourEnable:e.contour.show,contourColor:i(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading},u=o(e);l.vertexIntensity=e._meshIntensity,l.vertexIntensityBounds=[u.min,u.max],l.colormap=a(e),this.mesh.update(l)},f.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var r=e.glplot.gl,a=n({gl:r}),i=new u(e,a,t.uid);return a._trace=i,i.update(t),e.glplot.add(a),i}},{"../../../stackgl_modules":1120,"../../components/colorscale":378,"../../lib/gl_format_color":499,"../../lib/str2rgbarray":528,"../../plots/gl3d/zip3":609,"../isosurface/convert":864}],1100:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../isosurface/defaults").supplyIsoDefaults,o=e("../surface/defaults").opacityscaleDefaults;t.exports=function(e,t,r,s){function l(r,i){return n.coerce(e,t,a,r,i)}i(e,t,r,s,l),o(e,t,s,l)}},{"../../lib":503,"../isosurface/defaults":865,"../surface/defaults":1060,"./attributes":1098}],1101:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("../isosurface/calc"),colorbar:{min:"cmin",max:"cmax"},plot:e("./convert"),moduleType:"trace",name:"volume",basePlotModule:e("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":598,"../isosurface/calc":863,"./attributes":1098,"./convert":1099,"./defaults":1100}],1102:[function(e,t,r){"use strict";var n=e("../bar/attributes"),a=e("../scatter/attributes").line,i=e("../../plots/attributes"),o=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,c=e("./constants"),u=e("../../lib/extend").extendFlat,f=e("../../components/color");function p(e){return{marker:{color:u({},n.marker.color,{arrayOk:!1,editType:"style"}),line:{color:u({},n.marker.line.color,{arrayOk:!1,editType:"style"}),width:u({},n.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}t.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),hovertext:n.hovertext,hovertemplate:s({},{keys:c.eventDataKeys}),hoverinfo:u({},i.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:l({editType:"plot"},{keys:c.eventDataKeys.concat(["label"])}),text:n.text,textposition:n.textposition,insidetextanchor:n.insidetextanchor,textangle:n.textangle,textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:n.outsidetextfont,constraintext:n.constraintext,cliponaxis:n.cliponaxis,orientation:n.orientation,offset:n.offset,width:n.width,increasing:p(),decreasing:p(),totals:p(),connector:{line:{color:u({},a.color,{dflt:f.defaultLine}),width:u({},a.width,{editType:"plot"}),dash:a.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup}},{"../../components/color":366,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../bar/attributes":648,"../scatter/attributes":926,"./constants":1104}],1103:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../plots/cartesian/align_period"),i=e("../../lib").mergeArray,o=e("../scatter/calc_selection"),s=e("../../constants/numerical").BADNUM;function l(e){return"a"===e||"absolute"===e}function c(e){return"t"===e||"total"===e}t.exports=function(e,t){var r,u,f,p,h,d,m=n.getFromId(e,t.xaxis||"x"),g=n.getFromId(e,t.yaxis||"y");"h"===t.orientation?(r=m.makeCalcdata(t,"x"),f=g.makeCalcdata(t,"y"),p=a(t,g,"y",f),h=!!t.yperiodalignment,d="y"):(r=g.makeCalcdata(t,"y"),f=m.makeCalcdata(t,"x"),p=a(t,m,"x",f),h=!!t.xperiodalignment,d="x"),u=p.vals;for(var y,v=Math.min(u.length,r.length),b=new Array(v),x=0,_=!1,w=0;w<v;w++){var k=r[w]||0,D=!1;(r[w]!==s||c(t.measure[w])||l(t.measure[w]))&&w+1<v&&(r[w+1]!==s||c(t.measure[w+1])||l(t.measure[w+1]))&&(D=!0);var T=b[w]={i:w,p:u[w],s:k,rawS:k,cNext:D};l(t.measure[w])?(x=T.s,T.isSum=!0,T.dir="totals",T.s=x):c(t.measure[w])?(T.isSum=!0,T.dir="totals",T.s=x):(T.isSum=!1,T.dir=T.rawS<0?"decreasing":"increasing",y=T.s,T.s=x+y,x+=y),"totals"===T.dir&&(_=!0),h&&(b[w].orig_p=f[w],b[w][d+"End"]=p.ends[w],b[w][d+"Start"]=p.starts[w]),t.ids&&(T.id=String(t.ids[w])),T.v=(t.base||0)+x}return b.length&&(b[0].hasTotals=_),i(t.text,b,"tx"),i(t.hovertext,b,"htx"),o(b,t),b}},{"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/align_period":551,"../../plots/cartesian/axes":554,"../scatter/calc_selection":928}],1104:[function(e,t,r){"use strict";t.exports={eventDataKeys:["initial","delta","final"]}},{}],1105:[function(e,t,r){"use strict";var n=e("../bar/cross_trace_calc").setGroupPositions;t.exports=function(e,t){var r,a,i=e._fullLayout,o=e._fullData,s=e.calcdata,l=t.xaxis,c=t.yaxis,u=[],f=[],p=[];for(a=0;a<o.length;a++){var h=o[a];!0===h.visible&&h.xaxis===l._id&&h.yaxis===c._id&&"waterfall"===h.type&&(r=s[a],"h"===h.orientation?p.push(r):f.push(r),u.push(r))}var d={mode:i.waterfallmode,norm:i.waterfallnorm,gap:i.waterfallgap,groupgap:i.waterfallgroupgap};for(n(e,l,c,f,d),n(e,c,l,p,d),a=0;a<u.length;a++){r=u[a];for(var m=0;m<r.length;m++){var g=r[m];!1===g.isSum&&(g.s0+=0===m?0:r[m-1].s),m+1<r.length&&(r[m].nextP0=r[m+1].p0,r[m].nextS0=r[m+1].s0)}}}},{"../bar/cross_trace_calc":651}],1106:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../bar/defaults").handleGroupingDefaults,i=e("../bar/defaults").handleText,o=e("../scatter/xy_defaults"),s=e("../scatter/period_defaults"),l=e("./attributes"),c=e("../../components/color"),u=e("../../constants/delta.js"),f=u.INCREASING.COLOR,p=u.DECREASING.COLOR;function h(e,t,r){e(t+".marker.color",r),e(t+".marker.line.color",c.defaultLine),e(t+".marker.line.width")}t.exports={supplyDefaults:function(e,t,r,a){function c(r,a){return n.coerce(e,t,l,r,a)}if(o(e,t,a,c)){s(e,t,a,c),c("xhoverformat"),c("yhoverformat"),c("measure"),c("orientation",t.x&&!t.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var u=c("textposition");i(e,t,a,c,u,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==t.textposition&&(c("texttemplate"),t.texttemplate||c("textinfo")),h(c,"increasing",f),h(c,"decreasing",p),h(c,"totals","#4499FF"),c("connector.visible")&&(c("connector.mode"),c("connector.line.width")&&(c("connector.line.color"),c("connector.line.dash")))}else t.visible=!1},crossTraceDefaults:function(e,t){var r,i;function o(e){return n.coerce(i._input,i,l,e)}if("group"===t.waterfallmode)for(var s=0;s<e.length;s++)r=(i=e[s])._input,a(r,i,t,o)}}},{"../../components/color":366,"../../constants/delta.js":473,"../../lib":503,"../bar/defaults":652,"../scatter/period_defaults":946,"../scatter/xy_defaults":953,"./attributes":1102}],1107:[function(e,t,r){"use strict";t.exports=function(e,t){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"initial"in t&&(e.initial=t.initial),"delta"in t&&(e.delta=t.delta),"final"in t&&(e.final=t.final),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}},{}],1108:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes").hoverLabelText,a=e("../../components/color").opacity,i=e("../bar/hover").hoverOnBars,o=e("../../constants/delta.js"),s=o.INCREASING.SYMBOL,l=o.DECREASING.SYMBOL;t.exports=function(e,t,r,o,c){var u=i(e,t,r,o,c);if(u){var f=u.cd,p=f[0].trace,h="h"===p.orientation,d=h?"x":"y",m=h?e.xa:e.ya,g=f[u.index],y=g.isSum?g.b+g.s:g.rawS;if(!g.isSum){u.initial=g.b+g.s-y,u.delta=y,u.final=u.initial+u.delta;var v=D(Math.abs(u.delta));u.deltaLabel=y<0?"("+v+")":v,u.finalLabel=D(u.final),u.initialLabel=D(u.initial)}var b=g.hi||p.hoverinfo,x=[];if(b&&"none"!==b&&"skip"!==b){var _="all"===b,w=b.split("+"),k=function(e){return _||-1!==w.indexOf(e)};g.isSum||(!k("final")||k(h?"x":"y")||x.push(u.finalLabel),k("delta")&&(y<0?x.push(u.deltaLabel+" "+l):x.push(u.deltaLabel+" "+s)),k("initial")&&x.push("Initial: "+u.initialLabel))}return x.length&&(u.extraText=x.join("<br>")),u.color=function(e,t){var r=e[t.dir].marker,n=r.color,i=r.line.color,o=r.line.width;return a(n)?n:a(i)&&o?i:void 0}(p,g),[u]}function D(e){return n(m,e,p[d+"hoverformat"])}}},{"../../components/color":366,"../../constants/delta.js":473,"../../plots/cartesian/axes":554,"../bar/hover":655}],1109:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":568,"../bar/select":660,"./attributes":1102,"./calc":1103,"./cross_trace_calc":1105,"./defaults":1106,"./event_data":1107,"./hover":1108,"./layout_attributes":1110,"./layout_defaults":1111,"./plot":1112,"./style":1113}],1110:[function(e,t,r){"use strict";t.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1111:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var s=0;s<r.length;s++){var l=r[s];if(l.visible&&"waterfall"===l.type){i=!0;break}}i&&(o("waterfallmode"),o("waterfallgap",.2),o("waterfallgroupgap"))}},{"../../lib":503,"./layout_attributes":1110}],1112:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../../constants/numerical").BADNUM,s=e("../bar/plot"),l=e("../bar/uniform_text").clearMinTextSize;t.exports=function(e,t,r,c){var u=e._fullLayout;l("waterfall",u),s.plot(e,t,r,c,{mode:u.waterfallmode,norm:u.waterfallmode,gap:u.waterfallgap,groupgap:u.waterfallgroupgap}),function(e,t,r,s){var l=t.xaxis,c=t.yaxis;a.makeTraceGroups(s,r,"trace bars").each((function(r){var s=n.select(this),u=r[0].trace,f=a.ensureSingle(s,"g","lines");if(u.connector&&u.connector.visible){var p="h"===u.orientation,h=u.connector.mode,d=f.selectAll("g.line").data(a.identity);d.enter().append("g").classed("line",!0),d.exit().remove();var m=d.size();d.each((function(r,s){if(s===m-1||r.cNext){var u=function(e,t,r,n){var a=[],i=[],o=n?t:r,s=n?r:t;return a[0]=o.c2p(e.s0,!0),i[0]=s.c2p(e.p0,!0),a[1]=o.c2p(e.s1,!0),i[1]=s.c2p(e.p1,!0),a[2]=o.c2p(e.nextS0,!0),i[2]=s.c2p(e.nextP0,!0),n?[a,i]:[i,a]}(r,l,c,p),f=u[0],d=u[1],g="";f[0]!==o&&d[0]!==o&&f[1]!==o&&d[1]!==o&&("spanning"===h&&!r.isSum&&s>0&&(g+=p?"M"+f[0]+","+d[1]+"V"+d[0]:"M"+f[1]+","+d[0]+"H"+f[0]),"between"!==h&&(r.isSum||s<m-1)&&(g+=p?"M"+f[1]+","+d[0]+"V"+d[1]:"M"+f[0]+","+d[1]+"H"+f[1]),f[2]!==o&&d[2]!==o&&(g+=p?"M"+f[1]+","+d[1]+"V"+d[2]:"M"+f[1]+","+d[1]+"H"+f[2])),""===g&&(g="M0,0Z"),a.ensureSingle(n.select(this),"path").attr("d",g).call(i.setClipUrl,t.layerClipId,e)}}))}else f.remove()}))}(e,t,r,c)}},{"../../components/drawing":388,"../../constants/numerical":479,"../../lib":503,"../bar/plot":659,"../bar/uniform_text":664,"@plotly/d3":58}],1113:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../../components/color"),o=e("../../constants/interactions").DESELECTDIM,s=e("../bar/style"),l=e("../bar/uniform_text").resizeText,c=s.styleTextPoints;t.exports={style:function(e,t,r){var s=r||n.select(e).selectAll("g.waterfalllayer").selectAll("g.trace");l(e,s,"waterfall"),s.style("opacity",(function(e){return e[0].trace.opacity})),s.each((function(t){var r=n.select(this),s=t[0].trace;r.selectAll(".point > path").each((function(e){if(!e.isBlank){var t=s[e.dir].marker;n.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(a.dashLine,t.line.dash,t.line.width).style("opacity",s.selectedpoints&&!e.selected?o:1)}})),c(r,s,e),r.selectAll(".lines").each((function(){var e=s.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":366,"../../components/drawing":388,"../../constants/interactions":478,"../bar/style":662,"../bar/uniform_text":664,"@plotly/d3":58}],1114:[function(e,t,r){"use strict";var n=e("../plots/cartesian/axes"),a=e("../lib"),i=e("../plot_api/plot_schema"),o=e("./helpers").pointsAccessorFunction,s=e("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(e,t,r,i){if(i.enabled){for(var o=i.target,l=a.nestedProperty(t,o),c=l.get(),u=function(e,t){var r=e.func,n=t.d2c,i=t.c2d;switch(r){case"count":return f;case"first":return p;case"last":return h;case"sum":return function(e,t){for(var r=0,a=0;a<t.length;a++){var o=n(e[t[a]]);o!==s&&(r+=o)}return i(r)};case"avg":return function(e,t){for(var r=0,a=0,o=0;o<t.length;o++){var l=n(e[t[o]]);l!==s&&(r+=l,a++)}return a?i(r/a):s};case"min":return function(e,t){for(var r=1/0,a=0;a<t.length;a++){var o=n(e[t[a]]);o!==s&&(r=Math.min(r,o))}return r===1/0?s:i(r)};case"max":return function(e,t){for(var r=-1/0,a=0;a<t.length;a++){var o=n(e[t[a]]);o!==s&&(r=Math.max(r,o))}return r===-1/0?s:i(r)};case"range":return function(e,t){for(var r=1/0,a=-1/0,o=0;o<t.length;o++){var l=n(e[t[o]]);l!==s&&(r=Math.min(r,l),a=Math.max(a,l))}return a===-1/0||r===1/0?s:i(a-r)};case"change":return function(e,t){var r=n(e[t[0]]),a=n(e[t[t.length-1]]);return r===s||a===s?s:i(a-r)};case"median":return function(e,t){for(var r=[],o=0;o<t.length;o++){var l=n(e[t[o]]);l!==s&&r.push(l)}if(!r.length)return s;r.sort(a.sorterAsc);var c=(r.length-1)/2;return i((r[Math.floor(c)]+r[Math.ceil(c)])/2)};case"mode":return function(e,t){for(var r={},a=0,o=s,l=0;l<t.length;l++){var c=n(e[t[l]]);if(c!==s){var u=r[c]=(r[c]||0)+1;u>a&&(a=u,o=c)}}return a?i(o):s};case"rms":return function(e,t){for(var r=0,a=0,o=0;o<t.length;o++){var l=n(e[t[o]]);l!==s&&(r+=l*l,a++)}return a?i(Math.sqrt(r/a)):s};case"stddev":return function(t,r){var a,i=0,o=0,l=1,c=s;for(a=0;a<r.length&&c===s;a++)c=n(t[r[a]]);if(c===s)return s;for(;a<r.length;a++){var u=n(t[r[a]]);if(u!==s){var f=u-c;i+=f,o+=f*f,l++}}var p="sample"===e.funcmode?l-1:l;return p?Math.sqrt((o-i*i/l)/p):0}}}(i,n.getDataConversions(e,t,o,c)),d=new Array(r.length),m=0;m<r.length;m++)d[m]=u(c,r[m]);l.set(d),"count"===i.func&&a.pushUnique(t._arrayAttrs,o)}}function f(e,t){return t.length}function p(e,t){return e[t[0]]}function h(e,t){return e[t[t.length-1]]}r.supplyDefaults=function(e,t){var r,n={};function o(t,r){return a.coerce(e,n,l,t,r)}if(!o("enabled"))return n;var s=i.findArrayAttributes(t),u={};for(r=0;r<s.length;r++)u[s[r]]=1;var f=o("groups");if(!Array.isArray(f)){if(!u[f])return n.enabled=!1,n;u[f]=0}var p,h=e.aggregations||[],d=n.aggregations=new Array(h.length);function m(e,t){return a.coerce(h[r],p,c,e,t)}for(r=0;r<h.length;r++){p={_index:r};var g=m("target"),y=m("func");m("enabled")&&g&&(u[g]||"count"===y&&void 0===u[g])?("stddev"===y&&m("funcmode"),u[g]=0,d[r]=p):d[r]={enabled:!1,_index:r}}for(r=0;r<s.length;r++)u[s[r]]&&d.push({target:s[r],func:c.func.dflt,enabled:!0,_index:-1});return n},r.calcTransform=function(e,t,r){if(r.enabled){var n=r.groups,i=a.getTargetArray(t,{target:n});if(i){var s,l,c,f,p={},h={},d=[],m=o(t.transforms,r),g=i.length;for(t._length&&(g=Math.min(g,t._length)),s=0;s<g;s++)void 0===(c=p[l=i[s]])?(p[l]=d.length,f=[s],d.push(f),h[p[l]]=m(s)):(d[c].push(s),h[p[l]]=(h[p[l]]||[]).concat(m(s)));r._indexToPoints=h;var y=r.aggregations;for(s=0;s<y.length;s++)u(e,t,d,y[s]);"string"==typeof n&&u(e,t,d,{target:n,func:"first",enabled:!0}),t._length=d.length}}}},{"../constants/numerical":479,"../lib":503,"../plot_api/plot_schema":542,"../plots/cartesian/axes":554,"./helpers":1117}],1115:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../registry"),i=e("../plots/cartesian/axes"),o=e("./helpers").pointsAccessorFunction,s=e("../constants/filter_ops"),l=s.COMPARISON_OPS,c=s.INTERVAL_OPS,u=s.SET_OPS;r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(l).concat(c).concat(u),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(e){var t={};function i(a,i){return n.coerce(e,t,r.attributes,a,i)}if(i("enabled")){var o=i("target");if(n.isArrayOrTypedArray(o)&&0===o.length)return t.enabled=!1,t;i("preservegaps"),i("operation"),i("value");var s=a.getComponentMethod("calendars","handleDefaults");s(e,t,"valuecalendar",null),s(e,t,"targetcalendar",null)}return t},r.calcTransform=function(e,t,r){if(r.enabled){var a=n.getTargetArray(t,r);if(a){var s=r.target,f=a.length;t._length&&(f=Math.min(f,t._length));var p=r.targetcalendar,h=t._arrayAttrs,d=r.preservegaps;if("string"==typeof s){var m=n.nestedProperty(t,s+"calendar").get();m&&(p=m)}var g,y,v=function(e,t,r){var n=e.operation,a=e.value,i=Array.isArray(a);function o(e){return-1!==e.indexOf(n)}var s,f=function(r){return t(r,0,e.valuecalendar)},p=function(e){return t(e,0,r)};switch(o(l)?s=f(i?a[0]:a):o(c)?s=i?[f(a[0]),f(a[1])]:[f(a),f(a)]:o(u)&&(s=i?a.map(f):[f(a)]),n){case"=":return function(e){return p(e)===s};case"!=":return function(e){return p(e)!==s};case"<":return function(e){return p(e)<s};case"<=":return function(e){return p(e)<=s};case">":return function(e){return p(e)>s};case">=":return function(e){return p(e)>=s};case"[]":return function(e){var t=p(e);return t>=s[0]&&t<=s[1]};case"()":return function(e){var t=p(e);return t>s[0]&&t<s[1]};case"[)":return function(e){var t=p(e);return t>=s[0]&&t<s[1]};case"(]":return function(e){var t=p(e);return t>s[0]&&t<=s[1]};case"][":return function(e){var t=p(e);return t<=s[0]||t>=s[1]};case")(":return function(e){var t=p(e);return t<s[0]||t>s[1]};case"](":return function(e){var t=p(e);return t<=s[0]||t>s[1]};case")[":return function(e){var t=p(e);return t<s[0]||t>=s[1]};case"{}":return function(e){return-1!==s.indexOf(p(e))};case"}{":return function(e){return-1===s.indexOf(p(e))}}}(r,i.getDataToCoordFunc(e,t,s,a),p),b={},x={},_=0;d?(g=function(e){b[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},y=function(e,t){var r=b[e.astr][t];e.get()[t]=r}):(g=function(e){b[e.astr]=n.extendDeep([],e.get()),e.set([])},y=function(e,t){var r=b[e.astr][t];e.get().push(r)}),D(g);for(var w=o(t.transforms,r),k=0;k<f;k++)v(a[k])?(D(y,k),x[_++]=w(k)):d&&_++;r._indexToPoints=x,t._length=_}}function D(e,r){for(var a=0;a<h.length;a++)e(n.nestedProperty(t,h[a]),r)}}},{"../constants/filter_ops":475,"../lib":503,"../plots/cartesian/axes":554,"../registry":638,"./helpers":1117}],1116:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plot_api/plot_schema"),i=e("../plots/plots"),o=e("./helpers").pointsAccessorFunction;function s(e,t){var r,s,l,c,u,f,p,h,d,m,g=t.transform,y=t.transformIndex,v=e.transforms[y].groups,b=o(e.transforms,g);if(!n.isArrayOrTypedArray(v)||0===v.length)return[e];var x=n.filterUnique(v),_=new Array(x.length),w=v.length,k=a.findArrayAttributes(e),D=g.styles||[],T={};for(r=0;r<D.length;r++)T[D[r].target]=D[r].value;g.styles&&(m=n.keyedContainer(g,"styles","target","value.name"));var A={},S={};for(r=0;r<x.length;r++){A[f=x[r]]=r,S[f]=0,(p=_[r]=n.extendDeepNoArrays({},e))._group=f,p.transforms[y]._indexToPoints={};var M=null;for(m&&(M=m.get(f)),p.name=M||""===M?M:n.templateString(g.nameformat,{trace:e.name,group:f}),h=p.transforms,p.transforms=[],s=0;s<h.length;s++)p.transforms[s]=n.extendDeepNoArrays({},h[s]);for(s=0;s<k.length;s++)n.nestedProperty(p,k[s]).set([])}for(l=0;l<k.length;l++){for(c=k[l],s=0,d=[];s<x.length;s++)d[s]=n.nestedProperty(_[s],c).get();for(u=n.nestedProperty(e,c).get(),s=0;s<w;s++)d[A[v[s]]].push(u[s])}for(s=0;s<w;s++)(p=_[A[v[s]]]).transforms[y]._indexToPoints[S[v[s]]]=b(s),S[v[s]]++;for(r=0;r<x.length;r++)f=x[r],p=_[r],i.clearExpandedTraceDefaultColors(p),p=n.extendDeepNoArrays(p,T[f]||{});return _}r.moduleType="transform",r.name="groupby",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"data_array",dflt:[],editType:"calc"},nameformat:{valType:"string",editType:"calc"},styles:{_isLinkedToArray:"style",target:{valType:"string",editType:"calc"},value:{valType:"any",dflt:{},editType:"calc",_compareAsJSON:!0},editType:"calc"},editType:"calc"},r.supplyDefaults=function(e,t,a){var i,o={};function s(t,a){return n.coerce(e,o,r.attributes,t,a)}if(!s("enabled"))return o;s("groups"),s("nameformat",a._dataLength>1?"%{group} (%{trace})":"%{group}");var l=e.styles,c=o.styles=[];if(l)for(i=0;i<l.length;i++){var u=c[i]={};n.coerce(l[i],c[i],r.attributes.styles,"target");var f=n.coerce(l[i],c[i],r.attributes.styles,"value");n.isPlainObject(f)?u.value=n.extendDeep({},f):f&&delete u.value}return o},r.transform=function(e,t){var r,n,a,i=[];for(n=0;n<e.length;n++)for(r=s(e[n],t),a=0;a<r.length;a++)i.push(r[a]);return i}},{"../lib":503,"../plot_api/plot_schema":542,"../plots/plots":619,"./helpers":1117}],1117:[function(e,t,r){"use strict";r.pointsAccessorFunction=function(e,t){for(var r,n,a=0;a<e.length&&(r=e[a])!==t;a++)r._indexToPoints&&!1!==r.enabled&&(n=r._indexToPoints);return n?function(e){return n[e]}:function(e){return[e]}}},{}],1118:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/cartesian/axes"),i=e("./helpers").pointsAccessorFunction,o=e("../constants/numerical").BADNUM;r.moduleType="transform",r.name="sort",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},order:{valType:"enumerated",values:["ascending","descending"],dflt:"ascending",editType:"calc"},editType:"calc"},r.supplyDefaults=function(e){var t={};function a(a,i){return n.coerce(e,t,r.attributes,a,i)}return a("enabled")&&(a("target"),a("order")),t},r.calcTransform=function(e,t,r){if(r.enabled){var s=n.getTargetArray(t,r);if(s){var l=r.target,c=s.length;t._length&&(c=Math.min(c,t._length));var u,f,p=t._arrayAttrs,h=function(e,t,r,n){var a,i=new Array(n),s=new Array(n);for(a=0;a<n;a++)i[a]={v:t[a],i:a};for(i.sort(function(e,t){switch(e.order){case"ascending":return function(e,r){var n=t(e.v),a=t(r.v);return n===o?1:a===o?-1:n-a};case"descending":return function(e,r){var n=t(e.v),a=t(r.v);return n===o?1:a===o?-1:a-n}}}(e,r)),a=0;a<n;a++)s[a]=i[a].i;return s}(r,s,a.getDataToCoordFunc(e,t,l,s),c),d=i(t.transforms,r),m={};for(u=0;u<p.length;u++){var g=n.nestedProperty(t,p[u]),y=g.get(),v=new Array(c);for(f=0;f<c;f++)v[f]=y[h[f]];g.set(v)}for(f=0;f<c;f++)m[f]=d(h[f]);r._indexToPoints=m,t._length=c}}}},{"../constants/numerical":479,"../lib":503,"../plots/cartesian/axes":554,"./helpers":1117}],1119:[function(e,t,r){"use strict";r.version="2.8.3"},{}],1120:[function(e,t,n){(function(r){(function(){!function(e){"object"==typeof n&&void 0!==t?t.exports=e():("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this).stackgl=e()}((function(){return function t(r,n,a){function i(s,l){if(!n[s]){if(!r[s]){var c="function"==typeof e&&e;if(!l&&c)return c(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[s]={exports:{}};r[s][0].call(f.exports,(function(e){return i(r[s][1][e]||e)}),f,f.exports,t,r,n,a)}return n[s].exports}for(var o="function"==typeof e&&e,s=0;s<a.length;s++)i(a[s]);return i}({1:[function(e,t,r){"use strict";r.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=c(e),o=n[0],s=n[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),u=0,f=s>0?o-4:o;for(r=0;r<f;r+=4)t=a[e.charCodeAt(r)]<<18|a[e.charCodeAt(r+1)]<<12|a[e.charCodeAt(r+2)]<<6|a[e.charCodeAt(r+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===s&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,l[u++]=255&t),1===s&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},r.fromByteArray=function(e){for(var t,r=e.length,a=r%3,i=[],o=0,s=r-a;o<s;o+=16383)i.push(u(e,o,o+16383>s?s:o+16383));return 1===a?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s<l;++s)n[s]=o[s],a[o.charCodeAt(s)]=s;function c(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 u(e,t,r){for(var a,i,o=[],s=t;s<r;s+=3)a=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(n[(i=a)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],2:[function(e,t,r){},{}],3:[function(e,t,r){(function(t){(function(){"use strict";var t=e("base64-js"),n=e("ieee754");function a(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return o(e,t,r)}function o(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!i.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|f(e,t),n=a(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r)).__proto__=i.prototype,n}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return i.from(n,t,r);var o=function(e){if(i.isBuffer(e)){var t=0|u(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||z(e.length)?a(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return s(e),a(e<0?0:0|u(e))}function c(e){for(var t=e.length<0?0:0|u(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function u(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function f(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(a)return n?-1:R(e).length;t=(""+t).toLowerCase(),a=!0}}function p(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 A(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return w(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function h(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function d(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=i.from(t,n)),i.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,a);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,a){var i,o=1,s=e.length,l=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,l/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var u=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*o}else-1!==u&&(i-=i-u),u=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){for(var f=!0,p=0;p<l;p++)if(c(e,i+p)!==c(t,p)){f=!1;break}if(f)return i}return-1}function g(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(z(s))return o;e[r+o]=s}return o}function y(e,t,r,n){return F(R(t,e.length-r),e,r,n)}function v(e,t,r,n){return F(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function b(e,t,r,n){return v(e,t,r,n)}function x(e,t,r,n){return F(L(t),e,r,n)}function _(e,t,r,n){return F(function(e,t){for(var r,n,a,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,a=r%256,i.push(a),i.push(n);return i}(t,e.length-r),e,r,n)}function w(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a<r;){var i,o,s,l,c=e[a],u=null,f=c>239?4:c>223?3:c>191?2:1;if(a+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[a+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[a+1],o=e[a+2],128==(192&i)&&128==(192&o)&&(l=(15&c)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=e[a+1],o=e[a+2],s=e[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),a+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}function T(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}function A(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var a="",i=t;i<r;++i)a+=P(e[i]);return a}function S(e,t,r){for(var n=e.slice(t,r),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+256*n[i+1]);return a}function M(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 E(e,t,r,n,a,o){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function C(e,t,r,n,a,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,a,i){return t=+t,r>>>=0,i||C(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function O(e,t,r,a,i){return t=+t,r>>>=0,i||C(e,0,r,8),n.write(e,t,r,a,52,8),r+8}r.Buffer=i,r.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,r){return o(e,t,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,r){return function(e,t,r){return s(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},i.allocUnsafe=function(e){return l(e)},i.allocUnsafeSlow=function(e){return l(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==i.prototype},i.compare=function(e,t){if(B(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),B(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,a=0,o=Math.min(r,n);a<o;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:n<r?1:0},i.isEncoding=function(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}},i.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=i.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){var o=e[r];if(B(o,Uint8Array)&&(o=i.from(o)),!i.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,a),a+=o.length}return n},i.byteLength=f,i.prototype._isBuffer=!0,i.prototype.swap16=function(){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)h(this,t,t+1);return this},i.prototype.swap32=function(){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)h(this,t,t+3),h(this,t+1,t+2);return this},i.prototype.swap64=function(){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)h(this,t,t+7),h(this,t+1,t+6),h(this,t+2,t+5),h(this,t+3,t+4);return this},i.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?k(this,0,e):p.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},i.prototype.compare=function(e,t,r,n,a){if(B(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),l=Math.min(o,s),c=this.slice(n,a),u=e.slice(t,r),f=0;f<l;++f)if(c[f]!==u[f]){o=c[f],s=u[f];break}return o<s?-1:s<o?1:0},i.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},i.prototype.indexOf=function(e,t,r){return d(this,e,t,r,!0)},i.prototype.lastIndexOf=function(e,t,r){return d(this,e,t,r,!1)},i.prototype.write=function(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 a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},i.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=i.prototype,n},i.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);for(var n=this[e],a=1,i=0;++i<t&&(a*=256);)n+=this[e+i]*a;return n},i.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},i.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);for(var n=this[e],a=1,i=0;++i<t&&(a*=256);)n+=this[e+i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},i.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);for(var n=t,a=1,i=this[e+--n];n>0&&(a*=256);)i+=this[e+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},i.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||M(e,4,this.length),n.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),n.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),n.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),n.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||E(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[t]=255&e;++i<r&&(a*=256);)this[t+i]=e/a&255;return t+r},i.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||E(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+r},i.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*r-1);E(this,e,t,r,a-1,-a)}var i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},i.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*r-1);E(this,e,t,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},i.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},i.prototype.copy=function(e,t,r,n){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");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("Index out of range");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 a=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var o=a-1;o>=0;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return a},i.prototype.fill=function(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),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var a=e.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(e=a)}}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 o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=i.isBuffer(e)?e:i.from(e,n),l=s.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%l]}return this};var I=/[^+/0-9A-Za-z-_]/g;function P(e){return e<16?"0"+e.toString(16):e.toString(16)}function R(e,t){var r;t=t||1/0;for(var n=e.length,a=null,i=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function L(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,r,n){for(var a=0;a<n&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:4}],4:[function(e,t,r){r.read=function(e,t,r,n,a){var i,o,s=8*a-n-1,l=(1<<s)-1,c=l>>1,u=-7,f=r?a-1:0,p=r?-1:1,h=e[t+f];for(f+=p,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+f],f+=p,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+e[t+f],f+=p,u-=8);if(0===i)i=1-c;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),i-=c}return(h?-1:1)*o*Math.pow(2,i-n)},r.write=function(e,t,r,n,a,i){var o,s,l,c=8*i-a-1,u=(1<<c)-1,f=u>>1,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=n?1:-1,m=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=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?p/l:p*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(t*l-1)*Math.pow(2,a),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;e[r+h]=255&s,h+=d,s/=256,a-=8);for(o=o<<a|s,c+=a;c>0;e[r+h]=255&o,h+=d,o/=256,c-=8);e[r+h-d]|=128*m}},{}],5:[function(e,t,r){var n,a,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(e){a=s}}();var c,u=[],f=!1,p=-1;function h(){f&&c&&(f=!1,c.length?u=c.concat(u):p=-1,u.length&&d())}function d(){if(!f){var e=l(h);f=!0;for(var t=u.length;t;){for(c=u,u=[];++p<t;)c&&c[p].run();p=-1,t=u.length}c=null,f=!1,function(e){if(a===clearTimeout)return clearTimeout(e);if((a===s||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(e);try{a(e)}catch(t){try{return a.call(null,e)}catch(t){return a.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function g(){}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];u.push(new m(e,t)),1!==u.length||f||l(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,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}},{}],6:[function(e,t,r){t.exports={alpha_shape:e("alpha-shape"),convex_hull:e("convex-hull"),delaunay_triangulate:e("delaunay-triangulate"),gl_cone3d:e("gl-cone3d"),gl_error3d:e("gl-error3d"),gl_heatmap2d:e("gl-heatmap2d"),gl_line3d:e("gl-line3d"),gl_mesh3d:e("gl-mesh3d"),gl_plot2d:e("gl-plot2d"),gl_plot3d:e("gl-plot3d"),gl_pointcloud2d:e("gl-pointcloud2d"),gl_scatter3d:e("gl-scatter3d"),gl_select_box:e("gl-select-box"),gl_spikes2d:e("gl-spikes2d"),gl_streamtube3d:e("gl-streamtube3d"),gl_surface3d:e("gl-surface3d"),ndarray:e("ndarray"),ndarray_linear_interpolate:e("ndarray-linear-interpolate")}},{"alpha-shape":12,"convex-hull":58,"delaunay-triangulate":63,"gl-cone3d":79,"gl-error3d":84,"gl-heatmap2d":88,"gl-line3d":91,"gl-mesh3d":112,"gl-plot2d":118,"gl-plot3d":121,"gl-pointcloud2d":123,"gl-scatter3d":128,"gl-select-box":130,"gl-spikes2d":139,"gl-streamtube3d":143,"gl-surface3d":145,ndarray:259,"ndarray-linear-interpolate":253}],7:[function(e,t,r){"use strict";t.exports=function(e){var t=(e=e||{}).eye||[0,0,1],r=e.center||[0,0,0],s=e.up||[0,1,0],l=e.distanceLimits||[0,1/0],c=e.mode||"turntable",u=n(),f=a(),p=i();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,t,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,t,r,s),p.setDistanceLimits(l[0],l[1]),p.lookAt(0,t,r,s),new o({turntable:u,orbit:f,matrix:p},c)};var n=e("turntable-camera-controller"),a=e("orbit-camera-controller"),i=e("matrix-camera-controller");function o(e,t){this._controllerNames=Object.keys(e),this._controllerList=this._controllerNames.map((function(t){return e[t]})),this._mode=t,this._active=e[t],this._active||(this._mode="turntable",this._active=e.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(e){for(var t=this._controllerList,r=0;r<t.length;++r)t[r].flush(e)},s.idle=function(e){for(var t=this._controllerList,r=0;r<t.length;++r)t[r].idle(e)},s.lookAt=function(e,t,r,n){for(var a=this._controllerList,i=0;i<a.length;++i)a[i].lookAt(e,t,r,n)},s.rotate=function(e,t,r,n){for(var a=this._controllerList,i=0;i<a.length;++i)a[i].rotate(e,t,r,n)},s.pan=function(e,t,r,n){for(var a=this._controllerList,i=0;i<a.length;++i)a[i].pan(e,t,r,n)},s.translate=function(e,t,r,n){for(var a=this._controllerList,i=0;i<a.length;++i)a[i].translate(e,t,r,n)},s.setMatrix=function(e,t){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setMatrix(e,t)},s.setDistanceLimits=function(e,t){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setDistanceLimits(e,t)},s.setDistance=function(e,t){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setDistance(e,t)},s.recalcMatrix=function(e){this._active.recalcMatrix(e)},s.getDistance=function(e){return this._active.getDistance(e)},s.getDistanceLimits=function(e){return this._active.getDistanceLimits(e)},s.lastT=function(){return this._active.lastT()},s.setMode=function(e){if(e!==this._mode){var t=this._controllerNames.indexOf(e);if(!(t<0)){var r=this._active,n=this._controllerList[t],a=Math.max(r.lastT(),n.lastT());r.recalcMatrix(a),n.setMatrix(a,r.computedMatrix),this._active=n,this._mode=e,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},s.getMode=function(){return this._mode}},{"matrix-camera-controller":245,"orbit-camera-controller":263,"turntable-camera-controller":305}],8:[function(e,t,r){"use strict";var n="undefined"==typeof WeakMap?e("weak-map"):WeakMap,a=e("gl-buffer"),i=e("gl-vao"),o=new n;t.exports=function(e){var t=o.get(e),r=t&&(t._triangleBuffer.handle||t._triangleBuffer.buffer);if(!r||!e.isBuffer(r)){var n=a(e,new Float32Array([-1,-1,-1,4,4,-1]));(t=i(e,[{buffer:n,type:e.FLOAT,size:2}]))._triangleBuffer=n,o.set(e,t)}t.bind(),e.drawArrays(e.TRIANGLES,0,3),t.unbind()}},{"gl-buffer":78,"gl-vao":150,"weak-map":313}],9:[function(e,t,r){var n=e("pad-left");t.exports=function(e,t,r){t="number"==typeof t?t:1,r=r||": ";var a=e.split(/\r?\n/),i=String(a.length+t-1).length;return a.map((function(e,a){var o=a+t,s=String(o).length;return n(o,i-s)+r+e})).join("\n")}},{"pad-left":264}],10:[function(e,t,r){"use strict";t.exports=function(e){var t=e.length;if(0===t)return[];if(1===t)return[0];for(var r=e[0].length,n=[e[0]],i=[0],o=1;o<t;++o)if(n.push(e[o]),a(n,r)){if(i.push(o),i.length===r+1)return i}else n.pop();return i};var n=e("robust-orientation");function a(e,t){for(var r=new Array(t+1),a=0;a<e.length;++a)r[a]=e[a];for(a=0;a<=e.length;++a){for(var i=e.length;i<=t;++i){for(var o=new Array(t),s=0;s<t;++s)o[s]=Math.pow(i+1-a,s);r[i]=o}if(n.apply(void 0,r))return!0}return!1}},{"robust-orientation":284}],11:[function(e,t,r){"use strict";t.exports=function(e,t){return n(t).filter((function(r){for(var n=new Array(r.length),i=0;i<r.length;++i)n[i]=t[r[i]];return a(n)*e<1}))};var n=e("delaunay-triangulate"),a=e("circumradius")},{circumradius:49,"delaunay-triangulate":63}],12:[function(e,t,r){t.exports=function(e,t){return a(n(e,t))};var n=e("alpha-complex"),a=e("simplicial-complex-boundary")},{"alpha-complex":11,"simplicial-complex-boundary":290}],13:[function(e,t,r){t.exports=function(e){return atob(e)}},{}],14:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=t.length,i=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=e[l][o];i[o]=s}for(i[r]=new Array(r+1),o=0;o<=r;++o)i[r][o]=1;var c=new Array(r+1);for(o=0;o<r;++o)c[o]=t[o];c[r]=1;var u=n(i,c),f=a(u[r+1]);0===f&&(f=1);var p=new Array(r+1);for(o=0;o<=r;++o)p[o]=a(u[o])/f;return p};var n=e("robust-linear-solve");function a(e){for(var t=0,r=0;r<e.length;++r)t+=e[r];return t}},{"robust-linear-solve":283}],15:[function(e,t,r){"use strict";var n=e("./lib/rationalize");t.exports=function(e,t){return n(e[0].mul(t[1]).add(t[0].mul(e[1])),e[1].mul(t[1]))}},{"./lib/rationalize":25}],16:[function(e,t,r){"use strict";t.exports=function(e,t){return e[0].mul(t[1]).cmp(t[0].mul(e[1]))}},{}],17:[function(e,t,r){"use strict";var n=e("./lib/rationalize");t.exports=function(e,t){return n(e[0].mul(t[1]),e[1].mul(t[0]))}},{"./lib/rationalize":25}],18:[function(e,t,r){"use strict";var n=e("./is-rat"),a=e("./lib/is-bn"),i=e("./lib/num-to-bn"),o=e("./lib/str-to-bn"),s=e("./lib/rationalize"),l=e("./div");t.exports=function e(t,r){if(n(t))return r?l(t,e(r)):[t[0].clone(),t[1].clone()];var c,u,f=0;if(a(t))c=t.clone();else if("string"==typeof t)c=o(t);else{if(0===t)return[i(0),i(1)];if(t===Math.floor(t))c=i(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),f-=256;c=i(t)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(a(r))u=r.clone();else if("string"==typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=i(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;u=i(r)}else u=i(1);return f>0?c=c.ushln(f):f<0&&(u=u.ushln(-f)),s(c,u)}},{"./div":17,"./is-rat":19,"./lib/is-bn":23,"./lib/num-to-bn":24,"./lib/rationalize":25,"./lib/str-to-bn":26}],19:[function(e,t,r){"use strict";var n=e("./lib/is-bn");t.exports=function(e){return Array.isArray(e)&&2===e.length&&n(e[0])&&n(e[1])}},{"./lib/is-bn":23}],20:[function(e,t,r){"use strict";var n=e("bn.js");t.exports=function(e){return e.cmp(new n(0))}},{"bn.js":33}],21:[function(e,t,r){"use strict";var n=e("./bn-sign");t.exports=function(e){var t=e.length,r=e.words,a=0;if(1===t)a=r[0];else if(2===t)a=r[0]+67108864*r[1];else for(var i=0;i<t;i++)a+=r[i]*Math.pow(67108864,i);return n(e)*a}},{"./bn-sign":20}],22:[function(e,t,r){"use strict";var n=e("double-bits"),a=e("bit-twiddle").countTrailingZeros;t.exports=function(e){var t=a(n.lo(e));if(t<32)return t;var r=a(n.hi(e));return r>20?52:r+32}},{"bit-twiddle":32,"double-bits":64}],23:[function(e,t,r){"use strict";e("bn.js"),t.exports=function(e){return e&&"object"==typeof e&&Boolean(e.words)}},{"bn.js":33}],24:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("double-bits");t.exports=function(e){var t=a.exponent(e);return t<52?new n(e):new n(e*Math.pow(2,52-t)).ushln(t-52)}},{"bn.js":33,"double-bits":64}],25:[function(e,t,r){"use strict";var n=e("./num-to-bn"),a=e("./bn-sign");t.exports=function(e,t){var r=a(e),i=a(t);if(0===r)return[n(0),n(1)];if(0===i)return[n(0),n(0)];i<0&&(e=e.neg(),t=t.neg());var o=e.gcd(t);return o.cmpn(1)?[e.div(o),t.div(o)]:[e,t]}},{"./bn-sign":20,"./num-to-bn":24}],26:[function(e,t,r){"use strict";var n=e("bn.js");t.exports=function(e){return new n(e)}},{"bn.js":33}],27:[function(e,t,r){"use strict";var n=e("./lib/rationalize");t.exports=function(e,t){return n(e[0].mul(t[0]),e[1].mul(t[1]))}},{"./lib/rationalize":25}],28:[function(e,t,r){"use strict";var n=e("./lib/bn-sign");t.exports=function(e){return n(e[0])*n(e[1])}},{"./lib/bn-sign":20}],29:[function(e,t,r){"use strict";var n=e("./lib/rationalize");t.exports=function(e,t){return n(e[0].mul(t[1]).sub(e[1].mul(t[0])),e[1].mul(t[1]))}},{"./lib/rationalize":25}],30:[function(e,t,r){"use strict";var n=e("./lib/bn-to-num"),a=e("./lib/ctz");t.exports=function(e){var t=e[0],r=e[1];if(0===t.cmpn(0))return 0;var i=t.abs().divmod(r.abs()),o=i.div,s=n(o),l=i.mod,c=t.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=a(s)+4,f=n(l.ushln(u).divRound(r));return c*(s+f*Math.pow(2,-u))}var p=r.bitLength()-l.bitLength()+53;return f=n(l.ushln(p).divRound(r)),p<1023?c*f*Math.pow(2,-p):c*(f*=Math.pow(2,-1023))*Math.pow(2,1023-p)}},{"./lib/bn-to-num":21,"./lib/ctz":22}],31:[function(e,t,r){"use strict";function n(e,t,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(i=o,a=o-1):n=o+1}return i}function a(e,t,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(i=o,a=o-1):n=o+1}return i}function i(e,t,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(i=o,n=o+1):a=o-1}return i}function o(e,t,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(i=o,n=o+1):a=o-1}return i}function s(e,t,r,n,a){for(;n<=a;){var i=n+a>>>1,o=e[i],s=void 0!==r?r(o,t):o-t;if(0===s)return i;s<=0?n=i+1:a=i-1}return-1}function l(e,t,r,n,a,i){return"function"==typeof r?i(e,t,r,void 0===n?0:0|n,void 0===a?e.length-1:0|a):i(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}t.exports={ge:function(e,t,r,a,i){return l(e,t,r,a,i,n)},gt:function(e,t,r,n,i){return l(e,t,r,n,i,a)},lt:function(e,t,r,n,a){return l(e,t,r,n,a,i)},le:function(e,t,r,n,a){return l(e,t,r,n,a,o)},eq:function(e,t,r,n,a){return l(e,t,r,n,a,s)}}},{}],32:[function(e,t,r){"use strict";function n(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(e){return(e>0)-(e<0)},r.abs=function(e){var t=e>>31;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e<t)},r.max=function(e,t){return e^(e^t)&-(e<t)},r.isPow2=function(e){return!(e&e-1||!e)},r.log2=function(e){var t,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},r.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},r.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,1+((e|=e>>>8)|e>>>16)},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var a=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;e[t]=n<<a&255}}(a),r.reverse=function(e){return a[255&e]<<24|a[e>>>8&255]<<16|a[e>>>16&255]<<8|a[e>>>24&255]},r.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},r.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},r.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},r.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}},{}],33:[function(e,t,r){!function(t,r){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof t?t.exports=i:r.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var a=0,i=Math.min(e.length,r),o=t;o<i;o++){var s=e.charCodeAt(o)-48;a*=n,a+=s>=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a<e.length&&(16===t?this._parseHex(e,a,r):(this._parseBase(e,t,a),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var i,o,s=0;if("be"===r)for(a=e.length-1,i=0;a>=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(a=0,i=0;a<e.length;a+=3)o=e[a]|e[a+1]<<8|e[a+2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,i=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)a=l(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)a=l(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,s=Math.min(i,i-o)+r,l=0,u=r;u<s;u+=n)l=c(e,u,u+n,t),this.imuln(a),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var f=1;for(l=c(e,u,e.length,t),u=0;u<o;u++)f*=t;this.imuln(f),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var u=l>>>26,f=67108863&l,p=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=p;h++){var d=c-h|0;u+=(o=(a=0|e.words[d])*(i=0|t.words[h])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,i=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<a|i)).toString(16);r=0!=(i=s>>>24-a&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(a+=2)>=26&&(a-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],h=p[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(h).toString(e);r=(d=d.idivn(h)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===t,c=new e(i),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s<i;s++)c[s]=0}else{for(s=0;s<i-a;s++)c[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[i-s-1]=o}return c},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a<t;a++)this.words[a]=67108863&~this.words[a];return r>0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<a:this.words[r]&~(1<<a),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+a,this.words[i]=67108863&t,a=t>>>26;for(;0!==a&&i<r.length;i++)t=(0|r.words[i])+a,this.words[i]=67108863&t,a=t>>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)i=(t=(0|r.words[o])-(0|n.words[o])+i)>>26,this.words[o]=67108863&t;for(;0!==i&&o<r.length;o++)i=(t=(0|r.words[o])+i)>>26,this.words[o]=67108863&t;if(0===i&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var n,a,i,o=e.words,s=t.words,l=r.words,c=0,u=0|o[0],f=8191&u,p=u>>>13,h=0|o[1],d=8191&h,m=h>>>13,g=0|o[2],y=8191&g,v=g>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],k=8191&w,D=w>>>13,T=0|o[5],A=8191&T,S=T>>>13,M=0|o[6],E=8191&M,C=M>>>13,N=0|o[7],O=8191&N,I=N>>>13,P=0|o[8],R=8191&P,L=P>>>13,F=0|o[9],B=8191&F,z=F>>>13,j=0|s[0],U=8191&j,$=j>>>13,V=0|s[1],q=8191&V,W=V>>>13,H=0|s[2],G=8191&H,X=H>>>13,Y=0|s[3],Z=8191&Y,K=Y>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ae=0|s[6],ie=8191&ae,oe=ae>>>13,se=0|s[7],le=8191&se,ce=se>>>13,ue=0|s[8],fe=8191&ue,pe=ue>>>13,he=0|s[9],de=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(f,U))|0)+((8191&(a=(a=Math.imul(f,$))+Math.imul(p,U)|0))<<13)|0;c=((i=Math.imul(p,$))+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(d,U),a=(a=Math.imul(d,$))+Math.imul(m,U)|0,i=Math.imul(m,$);var ye=(c+(n=n+Math.imul(f,q)|0)|0)+((8191&(a=(a=a+Math.imul(f,W)|0)+Math.imul(p,q)|0))<<13)|0;c=((i=i+Math.imul(p,W)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),a=(a=Math.imul(y,$))+Math.imul(v,U)|0,i=Math.imul(v,$),n=n+Math.imul(d,q)|0,a=(a=a+Math.imul(d,W)|0)+Math.imul(m,q)|0,i=i+Math.imul(m,W)|0;var ve=(c+(n=n+Math.imul(f,G)|0)|0)+((8191&(a=(a=a+Math.imul(f,X)|0)+Math.imul(p,G)|0))<<13)|0;c=((i=i+Math.imul(p,X)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,U),a=(a=Math.imul(x,$))+Math.imul(_,U)|0,i=Math.imul(_,$),n=n+Math.imul(y,q)|0,a=(a=a+Math.imul(y,W)|0)+Math.imul(v,q)|0,i=i+Math.imul(v,W)|0,n=n+Math.imul(d,G)|0,a=(a=a+Math.imul(d,X)|0)+Math.imul(m,G)|0,i=i+Math.imul(m,X)|0;var be=(c+(n=n+Math.imul(f,Z)|0)|0)+((8191&(a=(a=a+Math.imul(f,K)|0)+Math.imul(p,Z)|0))<<13)|0;c=((i=i+Math.imul(p,K)|0)+(a>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(k,U),a=(a=Math.imul(k,$))+Math.imul(D,U)|0,i=Math.imul(D,$),n=n+Math.imul(x,q)|0,a=(a=a+Math.imul(x,W)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,W)|0,n=n+Math.imul(y,G)|0,a=(a=a+Math.imul(y,X)|0)+Math.imul(v,G)|0,i=i+Math.imul(v,X)|0,n=n+Math.imul(d,Z)|0,a=(a=a+Math.imul(d,K)|0)+Math.imul(m,Z)|0,i=i+Math.imul(m,K)|0;var xe=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(a=(a=a+Math.imul(f,ee)|0)+Math.imul(p,Q)|0))<<13)|0;c=((i=i+Math.imul(p,ee)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(A,U),a=(a=Math.imul(A,$))+Math.imul(S,U)|0,i=Math.imul(S,$),n=n+Math.imul(k,q)|0,a=(a=a+Math.imul(k,W)|0)+Math.imul(D,q)|0,i=i+Math.imul(D,W)|0,n=n+Math.imul(x,G)|0,a=(a=a+Math.imul(x,X)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,X)|0,n=n+Math.imul(y,Z)|0,a=(a=a+Math.imul(y,K)|0)+Math.imul(v,Z)|0,i=i+Math.imul(v,K)|0,n=n+Math.imul(d,Q)|0,a=(a=a+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,i=i+Math.imul(m,ee)|0;var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(a=(a=a+Math.imul(f,ne)|0)+Math.imul(p,re)|0))<<13)|0;c=((i=i+Math.imul(p,ne)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,U),a=(a=Math.imul(E,$))+Math.imul(C,U)|0,i=Math.imul(C,$),n=n+Math.imul(A,q)|0,a=(a=a+Math.imul(A,W)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,W)|0,n=n+Math.imul(k,G)|0,a=(a=a+Math.imul(k,X)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,X)|0,n=n+Math.imul(x,Z)|0,a=(a=a+Math.imul(x,K)|0)+Math.imul(_,Z)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(y,Q)|0,a=(a=a+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,n=n+Math.imul(d,re)|0,a=(a=a+Math.imul(d,ne)|0)+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0;var we=(c+(n=n+Math.imul(f,ie)|0)|0)+((8191&(a=(a=a+Math.imul(f,oe)|0)+Math.imul(p,ie)|0))<<13)|0;c=((i=i+Math.imul(p,oe)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,U),a=(a=Math.imul(O,$))+Math.imul(I,U)|0,i=Math.imul(I,$),n=n+Math.imul(E,q)|0,a=(a=a+Math.imul(E,W)|0)+Math.imul(C,q)|0,i=i+Math.imul(C,W)|0,n=n+Math.imul(A,G)|0,a=(a=a+Math.imul(A,X)|0)+Math.imul(S,G)|0,i=i+Math.imul(S,X)|0,n=n+Math.imul(k,Z)|0,a=(a=a+Math.imul(k,K)|0)+Math.imul(D,Z)|0,i=i+Math.imul(D,K)|0,n=n+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,a=(a=a+Math.imul(y,ne)|0)+Math.imul(v,re)|0,i=i+Math.imul(v,ne)|0,n=n+Math.imul(d,ie)|0,a=(a=a+Math.imul(d,oe)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,oe)|0;var ke=(c+(n=n+Math.imul(f,le)|0)|0)+((8191&(a=(a=a+Math.imul(f,ce)|0)+Math.imul(p,le)|0))<<13)|0;c=((i=i+Math.imul(p,ce)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,U),a=(a=Math.imul(R,$))+Math.imul(L,U)|0,i=Math.imul(L,$),n=n+Math.imul(O,q)|0,a=(a=a+Math.imul(O,W)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,W)|0,n=n+Math.imul(E,G)|0,a=(a=a+Math.imul(E,X)|0)+Math.imul(C,G)|0,i=i+Math.imul(C,X)|0,n=n+Math.imul(A,Z)|0,a=(a=a+Math.imul(A,K)|0)+Math.imul(S,Z)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(k,Q)|0,a=(a=a+Math.imul(k,ee)|0)+Math.imul(D,Q)|0,i=i+Math.imul(D,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(y,ie)|0,a=(a=a+Math.imul(y,oe)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,oe)|0,n=n+Math.imul(d,le)|0,a=(a=a+Math.imul(d,ce)|0)+Math.imul(m,le)|0,i=i+Math.imul(m,ce)|0;var De=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(a=(a=a+Math.imul(f,pe)|0)+Math.imul(p,fe)|0))<<13)|0;c=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(B,U),a=(a=Math.imul(B,$))+Math.imul(z,U)|0,i=Math.imul(z,$),n=n+Math.imul(R,q)|0,a=(a=a+Math.imul(R,W)|0)+Math.imul(L,q)|0,i=i+Math.imul(L,W)|0,n=n+Math.imul(O,G)|0,a=(a=a+Math.imul(O,X)|0)+Math.imul(I,G)|0,i=i+Math.imul(I,X)|0,n=n+Math.imul(E,Z)|0,a=(a=a+Math.imul(E,K)|0)+Math.imul(C,Z)|0,i=i+Math.imul(C,K)|0,n=n+Math.imul(A,Q)|0,a=(a=a+Math.imul(A,ee)|0)+Math.imul(S,Q)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(k,re)|0,a=(a=a+Math.imul(k,ne)|0)+Math.imul(D,re)|0,i=i+Math.imul(D,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,oe)|0,n=n+Math.imul(y,le)|0,a=(a=a+Math.imul(y,ce)|0)+Math.imul(v,le)|0,i=i+Math.imul(v,ce)|0,n=n+Math.imul(d,fe)|0,a=(a=a+Math.imul(d,pe)|0)+Math.imul(m,fe)|0,i=i+Math.imul(m,pe)|0;var Te=(c+(n=n+Math.imul(f,de)|0)|0)+((8191&(a=(a=a+Math.imul(f,me)|0)+Math.imul(p,de)|0))<<13)|0;c=((i=i+Math.imul(p,me)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,W))+Math.imul(z,q)|0,i=Math.imul(z,W),n=n+Math.imul(R,G)|0,a=(a=a+Math.imul(R,X)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,X)|0,n=n+Math.imul(O,Z)|0,a=(a=a+Math.imul(O,K)|0)+Math.imul(I,Z)|0,i=i+Math.imul(I,K)|0,n=n+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(C,Q)|0,i=i+Math.imul(C,ee)|0,n=n+Math.imul(A,re)|0,a=(a=a+Math.imul(A,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(k,ie)|0,a=(a=a+Math.imul(k,oe)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,oe)|0,n=n+Math.imul(x,le)|0,a=(a=a+Math.imul(x,ce)|0)+Math.imul(_,le)|0,i=i+Math.imul(_,ce)|0,n=n+Math.imul(y,fe)|0,a=(a=a+Math.imul(y,pe)|0)+Math.imul(v,fe)|0,i=i+Math.imul(v,pe)|0;var Ae=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;c=((i=i+Math.imul(m,me)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,G),a=(a=Math.imul(B,X))+Math.imul(z,G)|0,i=Math.imul(z,X),n=n+Math.imul(R,Z)|0,a=(a=a+Math.imul(R,K)|0)+Math.imul(L,Z)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(O,Q)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,n=n+Math.imul(E,re)|0,a=(a=a+Math.imul(E,ne)|0)+Math.imul(C,re)|0,i=i+Math.imul(C,ne)|0,n=n+Math.imul(A,ie)|0,a=(a=a+Math.imul(A,oe)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,oe)|0,n=n+Math.imul(k,le)|0,a=(a=a+Math.imul(k,ce)|0)+Math.imul(D,le)|0,i=i+Math.imul(D,ce)|0,n=n+Math.imul(x,fe)|0,a=(a=a+Math.imul(x,pe)|0)+Math.imul(_,fe)|0,i=i+Math.imul(_,pe)|0;var Se=(c+(n=n+Math.imul(y,de)|0)|0)+((8191&(a=(a=a+Math.imul(y,me)|0)+Math.imul(v,de)|0))<<13)|0;c=((i=i+Math.imul(v,me)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,Z),a=(a=Math.imul(B,K))+Math.imul(z,Z)|0,i=Math.imul(z,K),n=n+Math.imul(R,Q)|0,a=(a=a+Math.imul(R,ee)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(I,re)|0,i=i+Math.imul(I,ne)|0,n=n+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,oe)|0,n=n+Math.imul(A,le)|0,a=(a=a+Math.imul(A,ce)|0)+Math.imul(S,le)|0,i=i+Math.imul(S,ce)|0,n=n+Math.imul(k,fe)|0,a=(a=a+Math.imul(k,pe)|0)+Math.imul(D,fe)|0,i=i+Math.imul(D,pe)|0;var Me=(c+(n=n+Math.imul(x,de)|0)|0)+((8191&(a=(a=a+Math.imul(x,me)|0)+Math.imul(_,de)|0))<<13)|0;c=((i=i+Math.imul(_,me)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Q),a=(a=Math.imul(B,ee))+Math.imul(z,Q)|0,i=Math.imul(z,ee),n=n+Math.imul(R,re)|0,a=(a=a+Math.imul(R,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,oe)|0,n=n+Math.imul(E,le)|0,a=(a=a+Math.imul(E,ce)|0)+Math.imul(C,le)|0,i=i+Math.imul(C,ce)|0,n=n+Math.imul(A,fe)|0,a=(a=a+Math.imul(A,pe)|0)+Math.imul(S,fe)|0,i=i+Math.imul(S,pe)|0;var Ee=(c+(n=n+Math.imul(k,de)|0)|0)+((8191&(a=(a=a+Math.imul(k,me)|0)+Math.imul(D,de)|0))<<13)|0;c=((i=i+Math.imul(D,me)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,re),a=(a=Math.imul(B,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(R,ie)|0,a=(a=a+Math.imul(R,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(O,le)|0,a=(a=a+Math.imul(O,ce)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,ce)|0,n=n+Math.imul(E,fe)|0,a=(a=a+Math.imul(E,pe)|0)+Math.imul(C,fe)|0,i=i+Math.imul(C,pe)|0;var Ce=(c+(n=n+Math.imul(A,de)|0)|0)+((8191&(a=(a=a+Math.imul(A,me)|0)+Math.imul(S,de)|0))<<13)|0;c=((i=i+Math.imul(S,me)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,ie),a=(a=Math.imul(B,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(R,le)|0,a=(a=a+Math.imul(R,ce)|0)+Math.imul(L,le)|0,i=i+Math.imul(L,ce)|0,n=n+Math.imul(O,fe)|0,a=(a=a+Math.imul(O,pe)|0)+Math.imul(I,fe)|0,i=i+Math.imul(I,pe)|0;var Ne=(c+(n=n+Math.imul(E,de)|0)|0)+((8191&(a=(a=a+Math.imul(E,me)|0)+Math.imul(C,de)|0))<<13)|0;c=((i=i+Math.imul(C,me)|0)+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,le),a=(a=Math.imul(B,ce))+Math.imul(z,le)|0,i=Math.imul(z,ce),n=n+Math.imul(R,fe)|0,a=(a=a+Math.imul(R,pe)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,pe)|0;var Oe=(c+(n=n+Math.imul(O,de)|0)|0)+((8191&(a=(a=a+Math.imul(O,me)|0)+Math.imul(I,de)|0))<<13)|0;c=((i=i+Math.imul(I,me)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(B,fe),a=(a=Math.imul(B,pe))+Math.imul(z,fe)|0,i=Math.imul(z,pe);var Ie=(c+(n=n+Math.imul(R,de)|0)|0)+((8191&(a=(a=a+Math.imul(R,me)|0)+Math.imul(L,de)|0))<<13)|0;c=((i=i+Math.imul(L,me)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863;var Pe=(c+(n=Math.imul(B,de))|0)+((8191&(a=(a=Math.imul(B,me))+Math.imul(z,de)|0))<<13)|0;return c=((i=Math.imul(z,me))+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,l[0]=ge,l[1]=ye,l[2]=ve,l[3]=be,l[4]=xe,l[5]=_e,l[6]=we,l[7]=ke,l[8]=De,l[9]=Te,l[10]=Ae,l[11]=Se,l[12]=Me,l[13]=Ee,l[14]=Ce,l[15]=Ne,l[16]=Oe,l[17]=Ie,l[18]=Pe,0!==c&&(l[19]=c,r.length++),r};function m(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(d=h),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i<r.length-1;i++){var o=a;a=0;for(var s=67108863&n,l=Math.min(i,t.length-1),c=Math.max(0,i-e.length+1);c<=l;c++){var u=i-c,f=(0|e.words[u])*(0|t.words[c]),p=67108863&f;s=67108863&(p=p+s|0),a+=(o=(o=o+(f/67108864|0)|0)+(p>>>26)|0)>>>26,o&=67108863}r.words[i]=s,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):m(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,a=0;a<t;a++)n|=(1&e)<<t-a-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o<i;o++)n[o]=t[e[o]],a[o]=r[e[o]]},g.prototype.transform=function(e,t,r,n,a,i){this.permute(i,e,t,r,n,a);for(var o=1;o<a;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),u=0;u<a;u+=s)for(var f=l,p=c,h=0;h<o;h++){var d=r[u+h],m=n[u+h],g=r[u+h+o],y=n[u+h+o],v=f*g-p*y;y=f*y+p*g,g=v,r[u+h]=d+g,n[u+h]=m+y,r[u+h+o]=d-g,n[u+h+o]=m-y,h!==s&&(v=l*f-c*p,p=l*p+c*f,f=v)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,a=0;for(r=r/2|0;r;r>>>=1)a++;return 1<<a+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var a=e[n];e[n]=e[r-n-1],e[r-n-1]=a,a=t[n],t[n]=-t[r-n-1],t[r-n-1]=-a}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var a=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&a,r=a<67108864?0:a/67108864|0}return e},g.prototype.convert13b=function(e,t,r,a){for(var i=0,o=0;o<t;o++)i+=0|e[o],r[2*o]=8191&i,i>>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o<a;++o)r[o]=0;n(0===i),n(0==(-8192&i))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),a=this.makeRBT(n),i=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),c=new Array(n),u=new Array(n),f=new Array(n),p=r.words;p.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,c,n),this.transform(o,i,s,l,n,a),this.transform(c,i,u,f,n,a);for(var h=0;h<n;h++){var d=s[h]*u[h]-l[h]*f[h];l[h]=s[h]*f[h]+l[h]*u[h],s[h]=d}return this.conjugate(s,l,n),this.transform(s,l,p,i,n,a),this.conjugate(p,i,n),this.normalize13b(p,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),m(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var a=(0|this.words[r])*e,i=(67108863&a)+(67108863&t);t>>=26,t+=a/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,a=r%26;t[r]=(e.words[n]&1<<a)>>>a}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,a=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&i,l=(0|this.words[t])-s<<r;this.words[t]=l|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t<a;t++)this.words[t]=0;this.length+=a}return this.strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var a;n("number"==typeof e&&e>=0),a=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,l=r;if(a-=o,a=Math.max(0,a),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=a);c--){var f=0|this.words[c];this.words[c]=u<<26-i|f>>>i,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<<t;return!(this.length<=r||!(this.words[r]&a))},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<<t;this.words[this.length-1]&=a}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var a,i,o=e.length+r;this._expand(o);var s=0;for(a=0;a<e.length;a++){i=(0|this.words[a+r])+s;var l=(0|e.words[a])*t;s=((i-=67108863&l)>>26)-(l/67108864|0),this.words[a+r]=67108863&i}for(;a<this.length-r;a++)s=(i=(0|this.words[a+r])+s)>>26,this.words[a+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,a=0;a<this.length;a++)s=(i=-(0|this.words[a])+s)>>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,o=0|a.words[a.length-1];0!=(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,l=n.length-a.length;if("mod"!==t){(s=new i(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var u=n.clone()._ishlnsubmul(a,1,l);0===u.negative&&(n=u,s&&(s.words[l]=1));for(var f=l-1;f>=0;f--){var p=67108864*(0|n.words[a.length+f])+(0|n.words[a.length+f-1]);for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(a,p,f);0!==n.negative;)p--,n.negative=0,n._ishlnsubmul(a,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=p)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,a=this.length-1;a>=0;a--)r=(t*r+(0|this.words[a]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*t;this.words[r]=a/e|0,t=a%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=t.clone();!t.isZero();){for(var p=0,h=1;0==(t.words[0]&h)&&p<26;++p,h<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(u),o.isub(f)),a.iushrn(1),o.iushrn(1);for(var d=0,m=1;0==(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(f)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s),o.isub(l)):(r.isub(t),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,p=1;0==(r.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,a=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var i=a,o=r;0!==i&&o<this.length;o++){var s=0|this.words[o];i=(s+=i)>>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:a<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){n<a?t=-1:n>a&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new k(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function D(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},a(b,v),b.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n<r;n++)t.words[n]=e.words[n];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=4194303&a,n=10;n<e.length;n++){var i=0|e.words[n];e.words[n-10]=(4194303&i)<<4|a>>>22,a=i}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},a(x,v),a(_,v),a(w,v),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,a=67108863&n;n>>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new x;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return y[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,a),p=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),d=o;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<d);var y=this.pow(f,new i(1).iushln(d-g-1));p=p.redMul(y),f=y.redSqr(),h=h.redMul(f),d=g}return p},k.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},k.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],o=0,s=0,l=t.bitLength()%26;for(0===l&&(l=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],u=l-1;u>=0;u--){var f=c>>u&1;a!==r[0]&&(a=this.sqr(a)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===u)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}l=26}return a},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new D(e)},a(D,k),D.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},D.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},D.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},D.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},D.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:2}],34:[function(e,t,r){"use strict";t.exports=function(e){var t,r,n,a=e.length,i=0;for(t=0;t<a;++t)i+=e[t].length;var o=new Array(i),s=0;for(t=0;t<a;++t){var l=e[t],c=l.length;for(r=0;r<c;++r){var u=o[s++]=new Array(c-1),f=0;for(n=0;n<c;++n)n!==r&&(u[f++]=l[n]);if(1&r){var p=u[1];u[1]=u[0],u[0]=p}}}return o}},{}],35:[function(e,t,r){"use strict";t.exports=function(e,t,r){switch(arguments.length){case 1:return f(e);case 2:return"function"==typeof t?c(e,e,t,!0):p(e,t);case 3:return c(e,t,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var n,a=e("typedarray-pool"),i=e("./lib/sweep"),o=e("./lib/intersect");function s(e,t){for(var r=0;r<e;++r)if(!(t[r]<=t[r+e]))return!0;return!1}function l(e,t,r,n){for(var a=0,i=0,o=0,l=e.length;o<l;++o){var c=e[o];if(!s(t,c)){for(var u=0;u<2*t;++u)r[a++]=c[u];n[i++]=o}}return i}function c(e,t,r,n){var s=e.length,c=t.length;if(!(s<=0||c<=0)){var u=e[0].length>>>1;if(!(u<=0)){var f,p=a.mallocDouble(2*u*s),h=a.mallocInt32(s);if((s=l(e,u,p,h))>0){if(1===u&&n)i.init(s),f=i.sweepComplete(u,r,0,s,p,h,0,s,p,h);else{var d=a.mallocDouble(2*u*c),m=a.mallocInt32(c);(c=l(t,u,d,m))>0&&(i.init(s+c),f=1===u?i.sweepBipartite(u,r,0,s,p,h,0,c,d,m):o(u,r,n,s,p,h,c,d,m),a.free(d),a.free(m))}a.free(p),a.free(h)}return f}}}function u(e,t){n.push([e,t])}function f(e){return n=[],c(e,e,u,!0),n}function p(e,t){return n=[],c(e,t,u,!1),n}},{"./lib/intersect":37,"./lib/sweep":41,"typedarray-pool":308}],36:[function(e,t,r){"use strict";function n(e){return e?function(e,t,r,n,a,i,o,s,l,c,u){return a-n>l-s?function(e,t,r,n,a,i,o,s,l,c,u){for(var f=2*e,p=n,h=f*n;p<a;++p,h+=f){var d=i[t+h],m=i[t+h+e],g=o[p];e:for(var y=s,v=f*s;y<l;++y,v+=f){var b=c[t+v],x=c[t+v+e],_=u[y];if(!(x<d||m<b)){for(var w=t+1;w<e;++w){var k=i[w+h],D=i[w+e+h],T=c[w+v],A=c[w+e+v];if(D<T||A<k)continue e}var S=r(g,_);if(void 0!==S)return S}}}}(e,t,r,n,a,i,o,s,l,c,u):function(e,t,r,n,a,i,o,s,l,c,u){for(var f=2*e,p=s,h=f*s;p<l;++p,h+=f){var d=c[t+h],m=c[t+h+e],g=u[p];e:for(var y=n,v=f*n;y<a;++y,v+=f){var b=i[t+v],x=i[t+v+e],_=o[y];if(!(m<b||x<d)){for(var w=t+1;w<e;++w){var k=i[w+v],D=i[w+e+v],T=c[w+h],A=c[w+e+h];if(D<T||A<k)continue e}var S=r(_,g);if(void 0!==S)return S}}}}(e,t,r,n,a,i,o,s,l,c,u)}:function(e,t,r,n,a,i,o,s,l,c,u,f){return i-a>c-l?n?function(e,t,r,n,a,i,o,s,l,c,u){for(var f=2*e,p=n,h=f*n;p<a;++p,h+=f){var d=i[t+h],m=i[t+h+e],g=o[p];e:for(var y=s,v=f*s;y<l;++y,v+=f){var b=c[t+v],x=u[y];if(!(b<=d||m<b)){for(var _=t+1;_<e;++_){var w=i[_+h],k=i[_+e+h],D=c[_+v],T=c[_+e+v];if(k<D||T<w)continue e}var A=r(x,g);if(void 0!==A)return A}}}}(e,t,r,a,i,o,s,l,c,u,f):function(e,t,r,n,a,i,o,s,l,c,u){for(var f=2*e,p=n,h=f*n;p<a;++p,h+=f){var d=i[t+h],m=i[t+h+e],g=o[p];e:for(var y=s,v=f*s;y<l;++y,v+=f){var b=c[t+v],x=u[y];if(!(b<d||m<b)){for(var _=t+1;_<e;++_){var w=i[_+h],k=i[_+e+h],D=c[_+v],T=c[_+e+v];if(k<D||T<w)continue e}var A=r(g,x);if(void 0!==A)return A}}}}(e,t,r,a,i,o,s,l,c,u,f):n?function(e,t,r,n,a,i,o,s,l,c,u){for(var f=2*e,p=s,h=f*s;p<l;++p,h+=f){var d=c[t+h],m=u[p];e:for(var g=n,y=f*n;g<a;++g,y+=f){var v=i[t+y],b=i[t+y+e],x=o[g];if(!(d<=v||b<d)){for(var _=t+1;_<e;++_){var w=i[_+y],k=i[_+e+y],D=c[_+h],T=c[_+e+h];if(k<D||T<w)continue e}var A=r(m,x);if(void 0!==A)return A}}}}(e,t,r,a,i,o,s,l,c,u,f):function(e,t,r,n,a,i,o,s,l,c,u){for(var f=2*e,p=s,h=f*s;p<l;++p,h+=f){var d=c[t+h],m=u[p];e:for(var g=n,y=f*n;g<a;++g,y+=f){var v=i[t+y],b=i[t+y+e],x=o[g];if(!(d<v||b<d)){for(var _=t+1;_<e;++_){var w=i[_+y],k=i[_+e+y],D=c[_+h],T=c[_+e+h];if(k<D||T<w)continue e}var A=r(x,m);if(void 0!==A)return A}}}}(e,t,r,a,i,o,s,l,c,u,f)}}r.partial=n(!1),r.full=n(!0)},{}],37:[function(e,t,r){"use strict";t.exports=function(e,t,r,i,u,w,k,D,T){!function(e,t){var r=8*a.log2(t+1)*(e+1)|0,i=a.nextPow2(6*r);y.length<i&&(n.free(y),y=n.mallocInt32(i));var o=a.nextPow2(2*r);v.length<o&&(n.free(v),v=n.mallocDouble(o))}(e,i+k);var A,S=0,M=2*e;for(b(S++,0,0,i,0,k,r?16:0,-1/0,1/0),r||b(S++,0,0,k,0,i,1,-1/0,1/0);S>0;){var E=6*(S-=1),C=y[E],N=y[E+1],O=y[E+2],I=y[E+3],P=y[E+4],R=y[E+5],L=2*S,F=v[L],B=v[L+1],z=1&R,j=!!(16&R),U=u,$=w,V=D,q=T;if(z&&(U=D,$=T,V=u,q=w),!(2&R&&(O=h(e,C,N,O,U,$,B),N>=O)||4&R&&(N=d(e,C,N,O,U,$,F))>=O)){var W=O-N,H=P-I;if(j){if(e*W*(W+H)<1<<22){if(void 0!==(A=l.scanComplete(e,C,t,N,O,U,$,I,P,V,q)))return A;continue}}else{if(e*Math.min(W,H)<128){if(void 0!==(A=o(e,C,t,z,N,O,U,$,I,P,V,q)))return A;continue}if(e*W*H<1<<22){if(void 0!==(A=l.scanBipartite(e,C,t,z,N,O,U,$,I,P,V,q)))return A;continue}}var G=f(e,C,N,O,U,$,F,B);if(N<G)if(e*(G-N)<128){if(void 0!==(A=s(e,C+1,t,N,G,U,$,I,P,V,q)))return A}else if(C===e-2){if(void 0!==(A=z?l.sweepBipartite(e,t,I,P,V,q,N,G,U,$):l.sweepBipartite(e,t,N,G,U,$,I,P,V,q)))return A}else b(S++,C+1,N,G,I,P,z,-1/0,1/0),b(S++,C+1,I,P,N,G,1^z,-1/0,1/0);if(G<O){var X=c(e,C,I,P,V,q),Y=V[M*X+C],Z=p(e,C,X,P,V,q,Y);if(Z<P&&b(S++,C,G,O,Z,P,(4|z)+(j?16:0),Y,B),I<X&&b(S++,C,G,O,I,X,(2|z)+(j?16:0),F,Y),X+1===Z){if(void 0!==(A=j?_(e,C,t,G,O,U,$,X,V,q[X]):x(e,C,t,z,G,O,U,$,X,V,q[X])))return A}else if(X<Z){var K;if(j){if(G<(K=m(e,C,G,O,U,$,Y))){var J=p(e,C,G,K,U,$,Y);if(C===e-2){if(G<J&&void 0!==(A=l.sweepComplete(e,t,G,J,U,$,X,Z,V,q)))return A;if(J<K&&void 0!==(A=l.sweepBipartite(e,t,J,K,U,$,X,Z,V,q)))return A}else G<J&&b(S++,C+1,G,J,X,Z,16,-1/0,1/0),J<K&&(b(S++,C+1,J,K,X,Z,0,-1/0,1/0),b(S++,C+1,X,Z,J,K,1,-1/0,1/0))}}else G<(K=z?g(e,C,G,O,U,$,Y):m(e,C,G,O,U,$,Y))&&(C===e-2?A=z?l.sweepBipartite(e,t,X,Z,V,q,G,K,U,$):l.sweepBipartite(e,t,G,K,U,$,X,Z,V,q):(b(S++,C+1,G,K,X,Z,z,-1/0,1/0),b(S++,C+1,X,Z,G,K,1^z,-1/0,1/0)))}}}}};var n=e("typedarray-pool"),a=e("bit-twiddle"),i=e("./brute"),o=i.partial,s=i.full,l=e("./sweep"),c=e("./median"),u=e("./partition"),f=u("!(lo>=p0)&&!(p1>=hi)"),p=u("lo===p0"),h=u("lo<p0"),d=u("hi<=p0"),m=u("lo<=p0&&p0<=hi"),g=u("lo<p0&&p0<=hi"),y=n.mallocInt32(1024),v=n.mallocDouble(1024);function b(e,t,r,n,a,i,o,s,l){var c=6*e;y[c]=t,y[c+1]=r,y[c+2]=n,y[c+3]=a,y[c+4]=i,y[c+5]=o;var u=2*e;v[u]=s,v[u+1]=l}function x(e,t,r,n,a,i,o,s,l,c,u){var f=2*e,p=l*f,h=c[p+t];e:for(var d=a,m=a*f;d<i;++d,m+=f){var g=o[m+t],y=o[m+t+e];if(!(h<g||y<h||n&&h===g)){for(var v,b=s[d],x=t+1;x<e;++x){g=o[m+x],y=o[m+x+e];var _=c[p+x],w=c[p+x+e];if(y<_||w<g)continue e}if(void 0!==(v=n?r(u,b):r(b,u)))return v}}}function _(e,t,r,n,a,i,o,s,l,c){var u=2*e,f=s*u,p=l[f+t];e:for(var h=n,d=n*u;h<a;++h,d+=u){var m=o[h];if(m!==c){var g=i[d+t],y=i[d+t+e];if(!(p<g||y<p)){for(var v=t+1;v<e;++v){g=i[d+v],y=i[d+v+e];var b=l[f+v],x=l[f+v+e];if(y<b||x<g)continue e}var _=r(m,c);if(void 0!==_)return _}}}}},{"./brute":36,"./median":38,"./partition":39,"./sweep":41,"bit-twiddle":32,"typedarray-pool":308}],38:[function(e,t,r){"use strict";t.exports=function(e,t,r,i,o,s){if(i<=r+1)return r;for(var l=r,c=i,u=i+r>>>1,f=2*e,p=u,h=o[f*u+t];l<c;){if(c-l<8){a(e,t,l,c,o,s),h=o[f*u+t];break}var d=c-l,m=Math.random()*d+l|0,g=o[f*m+t],y=Math.random()*d+l|0,v=o[f*y+t],b=Math.random()*d+l|0,x=o[f*b+t];g<=v?x>=v?(p=y,h=v):g>=x?(p=m,h=g):(p=b,h=x):v>=x?(p=y,h=v):x>=g?(p=m,h=g):(p=b,h=x);for(var _=f*(c-1),w=f*p,k=0;k<f;++k,++_,++w){var D=o[_];o[_]=o[w],o[w]=D}var T=s[c-1];for(s[c-1]=s[p],s[p]=T,_=f*(c-1),w=f*(p=n(e,t,l,c-1,o,s,h)),k=0;k<f;++k,++_,++w)D=o[_],o[_]=o[w],o[w]=D;if(T=s[c-1],s[c-1]=s[p],s[p]=T,u<p){for(c=p-1;l<c&&o[f*(c-1)+t]===h;)c-=1;c+=1}else{if(!(p<u))break;for(l=p+1;l<c&&o[f*l+t]===h;)l+=1}}return n(e,t,r,u,o,s,o[f*u+t])};var n=e("./partition")("lo<p0");function a(e,t,r,n,a,i){for(var o=2*e,s=o*(r+1)+t,l=r+1;l<n;++l,s+=o)for(var c=a[s],u=l,f=o*(l-1);u>r&&a[f+t]>c;--u,f-=o){for(var p=f,h=f+o,d=0;d<o;++d,++p,++h){var m=a[p];a[p]=a[h],a[h]=m}var g=i[u];i[u]=i[u-1],i[u-1]=g}}},{"./partition":39}],39:[function(e,t,r){"use strict";t.exports=function(e){return n[e]};var n={"lo===p0":function(e,t,r,n,a,i,o){for(var s=2*e,l=s*r,c=l,u=r,f=t,p=r;n>p;++p,l+=s)if(a[l+f]===o)if(u===p)u+=1,c+=s;else{for(var h=0;s>h;++h){var d=a[l+h];a[l+h]=a[c],a[c++]=d}var m=i[p];i[p]=i[u],i[u++]=m}return u},"lo<p0":function(e,t,r,n,a,i,o){for(var s=2*e,l=s*r,c=l,u=r,f=t,p=r;n>p;++p,l+=s)if(a[l+f]<o)if(u===p)u+=1,c+=s;else{for(var h=0;s>h;++h){var d=a[l+h];a[l+h]=a[c],a[c++]=d}var m=i[p];i[p]=i[u],i[u++]=m}return u},"lo<=p0":function(e,t,r,n,a,i,o){for(var s=2*e,l=s*r,c=l,u=r,f=e+t,p=r;n>p;++p,l+=s)if(a[l+f]<=o)if(u===p)u+=1,c+=s;else{for(var h=0;s>h;++h){var d=a[l+h];a[l+h]=a[c],a[c++]=d}var m=i[p];i[p]=i[u],i[u++]=m}return u},"hi<=p0":function(e,t,r,n,a,i,o){for(var s=2*e,l=s*r,c=l,u=r,f=e+t,p=r;n>p;++p,l+=s)if(a[l+f]<=o)if(u===p)u+=1,c+=s;else{for(var h=0;s>h;++h){var d=a[l+h];a[l+h]=a[c],a[c++]=d}var m=i[p];i[p]=i[u],i[u++]=m}return u},"lo<p0&&p0<=hi":function(e,t,r,n,a,i,o){for(var s=2*e,l=s*r,c=l,u=r,f=t,p=e+t,h=r;n>h;++h,l+=s){var d=a[l+f],m=a[l+p];if(d<o&&o<=m)if(u===h)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=a[l+g];a[l+g]=a[c],a[c++]=y}var v=i[h];i[h]=i[u],i[u++]=v}}return u},"lo<=p0&&p0<=hi":function(e,t,r,n,a,i,o){for(var s=2*e,l=s*r,c=l,u=r,f=t,p=e+t,h=r;n>h;++h,l+=s){var d=a[l+f],m=a[l+p];if(d<=o&&o<=m)if(u===h)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=a[l+g];a[l+g]=a[c],a[c++]=y}var v=i[h];i[h]=i[u],i[u++]=v}}return u},"!(lo>=p0)&&!(p1>=hi)":function(e,t,r,n,a,i,o,s){for(var l=2*e,c=l*r,u=c,f=r,p=t,h=e+t,d=r;n>d;++d,c+=l){var m=a[c+p],g=a[c+h];if(!(m>=o||s>=g))if(f===d)f+=1,u+=l;else{for(var y=0;l>y;++y){var v=a[c+y];a[c+y]=a[u],a[u++]=v}var b=i[d];i[d]=i[f],i[f++]=b}}return f}}},{}],40:[function(e,t,r){"use strict";function n(e,t,r){for(var n=2*(e+1),a=e+1;a<=t;++a){for(var i=r[n++],o=r[n++],s=a,l=n-2;s-- >e;){var c=r[l-2],u=r[l-1];if(c<i)break;if(c===i&&u<o)break;r[l]=c,r[l+1]=u,l-=2}r[l]=i,r[l+1]=o}}function a(e,t,r){t*=2;var n=r[e*=2],a=r[e+1];r[e]=r[t],r[e+1]=r[t+1],r[t]=n,r[t+1]=a}function i(e,t,r){t*=2,r[e*=2]=r[t],r[e+1]=r[t+1]}function o(e,t,r,n){t*=2,r*=2;var a=n[e*=2],i=n[e+1];n[e]=n[t],n[e+1]=n[t+1],n[t]=n[r],n[t+1]=n[r+1],n[r]=a,n[r+1]=i}function s(e,t,r,n,a){t*=2,a[e*=2]=a[t],a[t]=r,a[e+1]=a[t+1],a[t+1]=n}function l(e,t,r){t*=2;var n=r[e*=2],a=r[t];return!(n<a)&&(n!==a||r[e+1]>r[t+1])}function c(e,t,r,n){var a=n[e*=2];return a<t||a===t&&n[e+1]<r}t.exports=function(e,t){t<=128?n(0,t-1,e):function e(t,r,u){var f=(r-t+1)/6|0,p=t+f,h=r-f,d=t+r>>1,m=d-f,g=d+f,y=p,v=m,b=d,x=g,_=h,w=t+1,k=r-1,D=0;l(y,v,u)&&(D=y,y=v,v=D),l(x,_,u)&&(D=x,x=_,_=D),l(y,b,u)&&(D=y,y=b,b=D),l(v,b,u)&&(D=v,v=b,b=D),l(y,x,u)&&(D=y,y=x,x=D),l(b,x,u)&&(D=b,b=x,x=D),l(v,_,u)&&(D=v,v=_,_=D),l(v,b,u)&&(D=v,v=b,b=D),l(x,_,u)&&(D=x,x=_,_=D);for(var T=u[2*v],A=u[2*v+1],S=u[2*x],M=u[2*x+1],E=2*y,C=2*b,N=2*_,O=2*p,I=2*d,P=2*h,R=0;R<2;++R){var L=u[E+R],F=u[C+R],B=u[N+R];u[O+R]=L,u[I+R]=F,u[P+R]=B}i(m,t,u),i(g,r,u);for(var z=w;z<=k;++z)if(c(z,T,A,u))z!==w&&a(z,w,u),++w;else if(!c(z,S,M,u))for(;;){if(c(k,S,M,u)){c(k,T,A,u)?(o(z,w,k,u),++w,--k):(a(z,k,u),--k);break}if(--k<z)break}s(t,w-1,T,A,u),s(r,k+1,S,M,u),w-2-t<=32?n(t,w-2,u):e(t,w-2,u),r-(k+2)<=32?n(k+2,r,u):e(k+2,r,u),k-w<=32?n(w,k,u):e(w,k,u)}(0,t-1,e)}},{}],41:[function(e,t,r){"use strict";t.exports={init:function(e){var t=a.nextPow2(e);o.length<t&&(n.free(o),o=n.mallocInt32(t)),s.length<t&&(n.free(s),s=n.mallocInt32(t)),l.length<t&&(n.free(l),l=n.mallocInt32(t)),c.length<t&&(n.free(c),c=n.mallocInt32(t)),u.length<t&&(n.free(u),u=n.mallocInt32(t)),f.length<t&&(n.free(f),f=n.mallocInt32(t));var r=8*t;p.length<r&&(n.free(p),p=n.mallocDouble(r))},sweepBipartite:function(e,t,r,n,a,u,f,m,g,y){for(var v=0,b=2*e,x=e-1,_=b-1,w=r;w<n;++w){var k=u[w],D=b*w;p[v++]=a[D+x],p[v++]=-(k+1),p[v++]=a[D+_],p[v++]=k}for(w=f;w<m;++w){k=y[w]+(1<<28);var T=b*w;p[v++]=g[T+x],p[v++]=-k,p[v++]=g[T+_],p[v++]=k}var A=v>>>1;i(p,A);var S=0,M=0;for(w=0;w<A;++w){var E=0|p[2*w+1];if(E>=1<<28)h(l,c,M--,E=E-(1<<28)|0);else if(E>=0)h(o,s,S--,E);else if(E<=-(1<<28)){E=-E-(1<<28)|0;for(var C=0;C<S;++C)if(void 0!==(N=t(o[C],E)))return N;d(l,c,M++,E)}else{for(E=-E-1|0,C=0;C<M;++C){var N;if(void 0!==(N=t(E,l[C])))return N}d(o,s,S++,E)}}},sweepComplete:function(e,t,r,n,a,m,g,y,v,b){for(var x=0,_=2*e,w=e-1,k=_-1,D=r;D<n;++D){var T=m[D]+1<<1,A=_*D;p[x++]=a[A+w],p[x++]=-T,p[x++]=a[A+k],p[x++]=T}for(D=g;D<y;++D){T=b[D]+1<<1;var S=_*D;p[x++]=v[S+w],p[x++]=1|-T,p[x++]=v[S+k],p[x++]=1|T}var M=x>>>1;i(p,M);var E=0,C=0,N=0;for(D=0;D<M;++D){var O=0|p[2*D+1],I=1&O;if(D<M-1&&O>>1==p[2*D+3]>>1&&(I=2,D+=1),O<0){for(var P=-(O>>1)-1,R=0;R<N;++R)if(void 0!==(L=t(u[R],P)))return L;if(0!==I)for(R=0;R<E;++R)if(void 0!==(L=t(o[R],P)))return L;if(1!==I)for(R=0;R<C;++R){var L;if(void 0!==(L=t(l[R],P)))return L}0===I?d(o,s,E++,P):1===I?d(l,c,C++,P):2===I&&d(u,f,N++,P)}else P=(O>>1)-1,0===I?h(o,s,E--,P):1===I?h(l,c,C--,P):2===I&&h(u,f,N--,P)}},scanBipartite:function(e,t,r,n,a,l,c,u,f,m,g,y){var v=0,b=2*e,x=t,_=t+e,w=1,k=1;n?k=1<<28:w=1<<28;for(var D=a;D<l;++D){var T=D+w,A=b*D;p[v++]=c[A+x],p[v++]=-T,p[v++]=c[A+_],p[v++]=T}for(D=f;D<m;++D){T=D+k;var S=b*D;p[v++]=g[S+x],p[v++]=-T}var M=v>>>1;i(p,M);var E=0;for(D=0;D<M;++D){var C=0|p[2*D+1];if(C<0){var N=!1;if((T=-C)>=1<<28?(N=!n,T-=1<<28):(N=!!n,T-=1),N)d(o,s,E++,T);else{var O=y[T],I=b*T,P=g[I+t+1],R=g[I+t+1+e];e:for(var L=0;L<E;++L){var F=o[L],B=b*F;if(!(R<c[B+t+1]||c[B+t+1+e]<P)){for(var z=t+2;z<e;++z)if(g[I+z+e]<c[B+z]||c[B+z+e]<g[I+z])continue e;var j,U=u[F];if(void 0!==(j=n?r(O,U):r(U,O)))return j}}}}else h(o,s,E--,C-w)}},scanComplete:function(e,t,r,n,a,s,l,c,u,f,h){for(var d=0,m=2*e,g=t,y=t+e,v=n;v<a;++v){var b=v+(1<<28),x=m*v;p[d++]=s[x+g],p[d++]=-b,p[d++]=s[x+y],p[d++]=b}for(v=c;v<u;++v){b=v+1;var _=m*v;p[d++]=f[_+g],p[d++]=-b}var w=d>>>1;i(p,w);var k=0;for(v=0;v<w;++v){var D=0|p[2*v+1];if(D<0)if((b=-D)>=1<<28)o[k++]=b-(1<<28);else{var T=h[b-=1],A=m*b,S=f[A+t+1],M=f[A+t+1+e];e:for(var E=0;E<k;++E){var C=o[E],N=l[C];if(N===T)break;var O=m*C;if(!(M<s[O+t+1]||s[O+t+1+e]<S)){for(var I=t+2;I<e;++I)if(f[A+I+e]<s[O+I]||s[O+I+e]<f[A+I])continue e;var P=r(N,T);if(void 0!==P)return P}}}else{for(b=D-(1<<28),E=k-1;E>=0;--E)if(o[E]===b){for(I=E+1;I<k;++I)o[I-1]=o[I];break}--k}}}};var n=e("typedarray-pool"),a=e("bit-twiddle"),i=e("./sort"),o=n.mallocInt32(1024),s=n.mallocInt32(1024),l=n.mallocInt32(1024),c=n.mallocInt32(1024),u=n.mallocInt32(1024),f=n.mallocInt32(1024),p=n.mallocDouble(8192);function h(e,t,r,n){var a=t[n],i=e[r-1];e[a]=i,t[i]=a}function d(e,t,r,n){e[r]=n,t[n]=r}},{"./sort":40,"bit-twiddle":32,"typedarray-pool":308}],42:[function(e,t,r){"use strict";var n=e("./lib/monotone"),a=e("./lib/triangulation"),i=e("./lib/delaunay"),o=e("./lib/filter");function s(e){return[Math.min(e[0],e[1]),Math.max(e[0],e[1])]}function l(e,t){return e[0]-t[0]||e[1]-t[1]}function c(e,t,r){return t in e?e[t]:r}t.exports=function(e,t,r){Array.isArray(t)?(r=r||{},t=t||[]):(r=t||{},t=[]);var u=!!c(r,"delaunay",!0),f=!!c(r,"interior",!0),p=!!c(r,"exterior",!0),h=!!c(r,"infinity",!1);if(!f&&!p||0===e.length)return[];var d=n(e,t);if(u||f!==p||h){for(var m=a(e.length,function(e){return e.map(s).sort(l)}(t)),g=0;g<d.length;++g){var y=d[g];m.addTriangle(y[0],y[1],y[2])}return u&&i(e,m),p?f?h?o(m,0,h):m.cells():o(m,1,h):o(m,-1)}return d}},{"./lib/delaunay":43,"./lib/filter":44,"./lib/monotone":45,"./lib/triangulation":46}],43:[function(e,t,r){"use strict";var n=e("robust-in-sphere")[4];function a(e,t,r,a,i,o){var s=t.opposite(a,i);if(!(s<0)){if(i<a){var l=a;a=i,i=l,l=o,o=s,s=l}t.isConstraint(a,i)||n(e[a],e[i],e[o],e[s])<0&&r.push(a,i)}}e("binary-search-bounds"),t.exports=function(e,t){for(var r=[],i=e.length,o=t.stars,s=0;s<i;++s)for(var l=o[s],c=1;c<l.length;c+=2)if(!((h=l[c])<s||t.isConstraint(s,h))){for(var u=l[c-1],f=-1,p=1;p<l.length;p+=2)if(l[p-1]===h){f=l[p];break}f<0||n(e[s],e[h],e[u],e[f])<0&&r.push(s,h)}for(;r.length>0;){for(var h=r.pop(),d=(u=-1,f=-1,l=o[s=r.pop()],1);d<l.length;d+=2){var m=l[d-1],g=l[d];m===h?f=g:g===h&&(u=m)}u<0||f<0||n(e[s],e[h],e[u],e[f])>=0||(t.flip(s,h),a(e,t,r,u,s,f),a(e,t,r,s,f,u),a(e,t,r,f,h,u),a(e,t,r,h,u,f))}}},{"binary-search-bounds":31,"robust-in-sphere":282}],44:[function(e,t,r){"use strict";var n,a=e("binary-search-bounds");function i(e,t,r,n,a,i,o){this.cells=e,this.neighbor=t,this.flags=n,this.constraint=r,this.active=a,this.next=i,this.boundary=o}function o(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]}t.exports=function(e,t,r){var n=function(e,t){for(var r=e.cells(),n=r.length,a=0;a<n;++a){var s=(y=r[a])[0],l=y[1],c=y[2];l<c?l<s&&(y[0]=l,y[1]=c,y[2]=s):c<s&&(y[0]=c,y[1]=s,y[2]=l)}r.sort(o);var u=new Array(n);for(a=0;a<u.length;++a)u[a]=0;var f=[],p=[],h=new Array(3*n),d=new Array(3*n),m=null;t&&(m=[]);var g=new i(r,h,d,u,f,p,m);for(a=0;a<n;++a)for(var y=r[a],v=0;v<3;++v){s=y[v],l=y[(v+1)%3];var b=h[3*a+v]=g.locate(l,s,e.opposite(l,s)),x=d[3*a+v]=e.isConstraint(s,l);b<0&&(x?p.push(a):(f.push(a),u[a]=1),t&&m.push([l,s,-1]))}return g}(e,r);if(0===t)return r?n.cells.concat(n.boundary):n.cells;for(var a=1,s=n.active,l=n.next,c=n.flags,u=n.cells,f=n.constraint,p=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var h=s.pop();if(c[h]!==-a){c[h]=a,u[h];for(var d=0;d<3;++d){var m=p[3*h+d];m>=0&&0===c[m]&&(f[3*h+d]?l.push(m):(s.push(m),c[m]=a))}}}var g=l;l=s,s=g,l.length=0,a=-a}var y=function(e,t,r){for(var n=0,a=0;a<e.length;++a)t[a]===r&&(e[n++]=e[a]);return e.length=n,e}(u,c,t);return r?y.concat(n.boundary):y},i.prototype.locate=(n=[0,0,0],function(e,t,r){var i=e,s=t,l=r;return t<r?t<e&&(i=t,s=r,l=e):r<e&&(i=r,s=e,l=t),i<0?-1:(n[0]=i,n[1]=s,n[2]=l,a.eq(this.cells,n,o))})},{"binary-search-bounds":31}],45:[function(e,t,r){"use strict";var n=e("binary-search-bounds"),a=e("robust-orientation")[3];function i(e,t,r,n,a){this.a=e,this.b=t,this.idx=r,this.lowerIds=n,this.upperIds=a}function o(e,t,r,n){this.a=e,this.b=t,this.type=r,this.idx=n}function s(e,t){var r=e.a[0]-t.a[0]||e.a[1]-t.a[1]||e.type-t.type;return r||(0!==e.type&&(r=a(e.a,e.b,t.b))?r:e.idx-t.idx)}function l(e,t){return a(e.a,e.b,t)}function c(e,t,r,i,o){for(var s=n.lt(t,i,l),c=n.gt(t,i,l),u=s;u<c;++u){for(var f=t[u],p=f.lowerIds,h=p.length;h>1&&a(r[p[h-2]],r[p[h-1]],i)>0;)e.push([p[h-1],p[h-2],o]),h-=1;p.length=h,p.push(o);var d=f.upperIds;for(h=d.length;h>1&&a(r[d[h-2]],r[d[h-1]],i)<0;)e.push([d[h-2],d[h-1],o]),h-=1;d.length=h,d.push(o)}}function u(e,t){var r;return(r=e.a[0]<t.a[0]?a(e.a,e.b,t.a):a(t.b,t.a,e.a))?r:(r=t.b[0]<e.b[0]?a(e.a,e.b,t.b):a(t.b,t.a,e.b))||e.idx-t.idx}function f(e,t,r){var a=n.le(e,r,u),o=e[a],s=o.upperIds,l=s[s.length-1];o.upperIds=[l],e.splice(a+1,0,new i(r.a,r.b,r.idx,[l],s))}function p(e,t,r){var a=r.a;r.a=r.b,r.b=a;var i=n.eq(e,r,u),o=e[i];e[i-1].upperIds=o.upperIds,e.splice(i,1)}t.exports=function(e,t){for(var r=e.length,n=t.length,a=[],l=0;l<r;++l)a.push(new o(e[l],null,0,l));for(l=0;l<n;++l){var u=t[l],h=e[u[0]],d=e[u[1]];h[0]<d[0]?a.push(new o(h,d,2,l),new o(d,h,1,l)):h[0]>d[0]&&a.push(new o(d,h,2,l),new o(h,d,1,l))}a.sort(s);for(var m=a[0].a[0]-(1+Math.abs(a[0].a[0]))*Math.pow(2,-52),g=[new i([m,1],[m,0],-1,[],[],[],[])],y=[],v=(l=0,a.length);l<v;++l){var b=a[l],x=b.type;0===x?c(y,g,e,b.a,b.idx):2===x?f(g,0,b):p(g,0,b)}return y}},{"binary-search-bounds":31,"robust-orientation":284}],46:[function(e,t,r){"use strict";var n=e("binary-search-bounds");function a(e,t){this.stars=e,this.edges=t}t.exports=function(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=[];return new a(r,t)};var i=a.prototype;function o(e,t,r){for(var n=1,a=e.length;n<a;n+=2)if(e[n-1]===t&&e[n]===r)return e[n-1]=e[a-2],e[n]=e[a-1],void(e.length=a-2)}i.isConstraint=function(){var e=[0,0];function t(e,t){return e[0]-t[0]||e[1]-t[1]}return function(r,a){return e[0]=Math.min(r,a),e[1]=Math.max(r,a),n.eq(this.edges,e,t)>=0}}(),i.removeTriangle=function(e,t,r){var n=this.stars;o(n[e],t,r),o(n[t],r,e),o(n[r],e,t)},i.addTriangle=function(e,t,r){var n=this.stars;n[e].push(t,r),n[t].push(r,e),n[r].push(e,t)},i.opposite=function(e,t){for(var r=this.stars[t],n=1,a=r.length;n<a;n+=2)if(r[n]===e)return r[n-1];return-1},i.flip=function(e,t){var r=this.opposite(e,t),n=this.opposite(t,e);this.removeTriangle(e,t,r),this.removeTriangle(t,e,n),this.addTriangle(e,n,r),this.addTriangle(t,r,n)},i.edges=function(){for(var e=this.stars,t=[],r=0,n=e.length;r<n;++r)for(var a=e[r],i=0,o=a.length;i<o;i+=2)t.push([a[i],a[i+1]]);return t},i.cells=function(){for(var e=this.stars,t=[],r=0,n=e.length;r<n;++r)for(var a=e[r],i=0,o=a.length;i<o;i+=2){var s=a[i],l=a[i+1];r<Math.min(s,l)&&t.push([r,s,l])}return t}},{"binary-search-bounds":31}],47:[function(e,t,r){"use strict";t.exports=function(e){for(var t=1,r=1;r<e.length;++r)for(var n=0;n<r;++n)if(e[r]<e[n])t=-t;else if(e[n]===e[r])return 0;return t}},{}],48:[function(e,t,r){"use strict";var n=e("dup"),a=e("robust-linear-solve");function i(e,t){for(var r=0,n=e.length,a=0;a<n;++a)r+=e[a]*t[a];return r}function o(e){var t=e.length;if(0===t)return[];e[0].length;var r=n([e.length+1,e.length+1],1),o=n([e.length+1],1);r[t][t]=0;for(var s=0;s<t;++s){for(var l=0;l<=s;++l)r[l][s]=r[s][l]=2*i(e[s],e[l]);o[s]=i(e[s],e[s])}var c=a(r,o),u=0,f=c[t+1];for(s=0;s<f.length;++s)u+=f[s];var p=new Array(t);for(s=0;s<t;++s){f=c[s];var h=0;for(l=0;l<f.length;++l)h+=f[l];p[s]=h/u}return p}function s(e){if(0===e.length)return[];for(var t=e[0].length,r=n([t]),a=o(e),i=0;i<e.length;++i)for(var s=0;s<t;++s)r[s]+=e[i][s]*a[i];return r}s.barycenetric=o,t.exports=s},{dup:65,"robust-linear-solve":283}],49:[function(e,t,r){t.exports=function(e){for(var t=n(e),r=0,a=0;a<e.length;++a)for(var i=e[a],o=0;o<t.length;++o)r+=Math.pow(i[o]-t[o],2);return Math.sqrt(r/e.length)};var n=e("circumcenter")},{circumcenter:48}],50:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n;if(r){n=t;for(var a=new Array(t.length),i=0;i<t.length;++i){var o=t[i];a[i]=[o[0],o[1],r[i]]}t=a}for(var s=function(e,t,r){var n=d(e,[],h(e));return y(t,n,r),!!n}(e,t,!!r);v(e,t,!!r);)s=!0;if(r&&s)for(n.length=0,r.length=0,i=0;i<t.length;++i)o=t[i],n.push([o[0],o[1]]),r.push(o[2]);return s};var n=e("union-find"),a=e("box-intersect"),i=e("robust-segment-intersect"),o=e("big-rat"),s=e("big-rat/cmp"),l=e("big-rat/to-float"),c=e("rat-vec"),u=e("nextafter"),f=e("./lib/rat-seg-intersect");function p(e){var t=l(e);return[u(t,-1/0),u(t,1/0)]}function h(e){for(var t=new Array(e.length),r=0;r<e.length;++r){var n=e[r];t[r]=[u(n[0],-1/0),u(n[1],-1/0),u(n[0],1/0),u(n[1],1/0)]}return t}function d(e,t,r){for(var i=t.length,o=new n(i),s=[],l=0;l<t.length;++l){var c=t[l],f=p(c[0]),h=p(c[1]);s.push([u(f[0],-1/0),u(h[0],-1/0),u(f[1],1/0),u(h[1],1/0)])}a(s,(function(e,t){o.link(e,t)}));var d=!0,m=new Array(i);for(l=0;l<i;++l)(y=o.find(l))!==l&&(d=!1,e[y]=[Math.min(e[l][0],e[y][0]),Math.min(e[l][1],e[y][1])]);if(d)return null;var g=0;for(l=0;l<i;++l){var y;(y=o.find(l))===l?(m[l]=g,e[g++]=e[l]):m[l]=-1}for(e.length=g,l=0;l<i;++l)m[l]<0&&(m[l]=m[o.find(l)]);return m}function m(e,t){return e[0]-t[0]||e[1]-t[1]}function g(e,t){return e[0]-t[0]||e[1]-t[1]||(e[2]<t[2]?-1:e[2]>t[2]?1:0)}function y(e,t,r){if(0!==e.length){if(t)for(var n=0;n<e.length;++n){var a=t[(o=e[n])[0]],i=t[o[1]];o[0]=Math.min(a,i),o[1]=Math.max(a,i)}else for(n=0;n<e.length;++n){var o;a=(o=e[n])[0],i=o[1],o[0]=Math.min(a,i),o[1]=Math.max(a,i)}r?e.sort(g):e.sort(m);var s=1;for(n=1;n<e.length;++n){var l=e[n-1],c=e[n];(c[0]!==l[0]||c[1]!==l[1]||r&&c[2]!==l[2])&&(e[s++]=c)}e.length=s}}function v(e,t,r){var n=function(e,t){for(var r=new Array(t.length),n=0;n<t.length;++n){var a=t[n],i=e[a[0]],o=e[a[1]];r[n]=[u(Math.min(i[0],o[0]),-1/0),u(Math.min(i[1],o[1]),-1/0),u(Math.max(i[0],o[0]),1/0),u(Math.max(i[1],o[1]),1/0)]}return r}(e,t),p=function(e,t,r){var n=[];return a(r,(function(r,a){var o=t[r],s=t[a];if(o[0]!==s[0]&&o[0]!==s[1]&&o[1]!==s[0]&&o[1]!==s[1]){var l=e[o[0]],c=e[o[1]],u=e[s[0]],f=e[s[1]];i(l,c,u,f)&&n.push([r,a])}})),n}(e,t,n),m=function(e,t,r,n){var o=[];return a(r,n,(function(r,n){var a=t[r];if(a[0]!==n&&a[1]!==n){var s=e[n],l=e[a[0]],c=e[a[1]];i(l,c,s,s)&&o.push([r,n])}})),o}(e,t,n,h(e)),g=d(e,function(e,t,r,n,a){var i,u,p=e.map((function(e){return[o(e[0]),o(e[1])]}));for(i=0;i<r.length;++i){var h=r[i];u=h[0];var d=h[1],m=t[u],g=t[d],y=f(c(e[m[0]]),c(e[m[1]]),c(e[g[0]]),c(e[g[1]]));if(y){var v=e.length;e.push([l(y[0]),l(y[1])]),p.push(y),n.push([u,v],[d,v])}}for(n.sort((function(e,t){if(e[0]!==t[0])return e[0]-t[0];var r=p[e[1]],n=p[t[1]];return s(r[0],n[0])||s(r[1],n[1])})),i=n.length-1;i>=0;--i){var b=t[u=(S=n[i])[0]],x=b[0],_=b[1],w=e[x],k=e[_];if((w[0]-k[0]||w[1]-k[1])<0){var D=x;x=_,_=D}b[0]=x;var T,A=b[1]=S[1];for(a&&(T=b[2]);i>0&&n[i-1][0]===u;){var S,M=(S=n[--i])[1];a?t.push([A,M,T]):t.push([A,M]),A=M}a?t.push([A,_,T]):t.push([A,_])}return p}(e,t,p,m,r));return y(t,g,r),!!g||p.length>0||m.length>0}},{"./lib/rat-seg-intersect":51,"big-rat":18,"big-rat/cmp":16,"big-rat/to-float":30,"box-intersect":35,nextafter:260,"rat-vec":273,"robust-segment-intersect":287,"union-find":309}],51:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var i=s(t,e),f=s(n,r),p=u(i,f);if(0===o(p))return null;var h=u(f,s(e,r)),d=a(h,p),m=c(i,d);return l(e,m)};var n=e("big-rat/mul"),a=e("big-rat/div"),i=e("big-rat/sub"),o=e("big-rat/sign"),s=e("rat-vec/sub"),l=e("rat-vec/add"),c=e("rat-vec/muls");function u(e,t){return i(n(e[0],t[1]),n(e[1],t[0]))}},{"big-rat/div":17,"big-rat/mul":27,"big-rat/sign":28,"big-rat/sub":29,"rat-vec/add":272,"rat-vec/muls":274,"rat-vec/sub":275}],52:[function(e,t,r){t.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],53:[function(e,t,r){"use strict";var n=e("./colorScale"),a=e("lerp");function i(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function o(e){for(var t,r="#",n=0;n<3;++n)r+=("00"+(t=(t=e[n]).toString(16))).substr(t.length);return r}function s(e){return"rgba("+e.join(",")+")"}t.exports=function(e){var t,r,l,c,u,f,p,h,d,m;if(e||(e={}),h=(e.nshades||72)-1,p=e.format||"hex",(f=e.colormap)||(f="jet"),"string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");u=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);u=f.slice()}if(u.length>h+1)throw new Error(f+" map requires nshades to be at least size "+u.length);d=Array.isArray(e.alpha)?2!==e.alpha.length?[1,1]:e.alpha.slice():"number"==typeof e.alpha?[e.alpha,e.alpha]:[1,1],t=u.map((function(e){return Math.round(e.index*h)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=u.map((function(e,t){var r=u[t].index,n=u[t].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),y=[];for(m=0;m<t.length-1;++m){c=t[m+1]-t[m],r=g[m],l=g[m+1];for(var v=0;v<c;v++){var b=v/c;y.push([Math.round(a(r[0],l[0],b)),Math.round(a(r[1],l[1],b)),Math.round(a(r[2],l[2],b)),a(r[3],l[3],b)])}}return y.push(u[u.length-1].rgb.concat(d[1])),"hex"===p?y=y.map(o):"rgbaString"===p?y=y.map(s):"float"===p&&(y=y.map(i)),y}},{"./colorScale":52,lerp:240}],54:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){var o=n(t,r,i);if(0===o){var s=a(n(e,t,r)),c=a(n(e,t,i));if(s===c){if(0===s){var u=l(e,t,r);return u===l(e,t,i)?0:u?1:-1}return 0}return 0===c?s>0||l(e,t,i)?-1:1:0===s?c>0||l(e,t,r)?1:-1:a(c-s)}var f=n(e,t,r);return f>0?o>0&&n(e,t,i)>0?1:-1:f<0?o>0||n(e,t,i)>0?1:-1:n(e,t,i)>0||l(e,t,r)?1:-1};var n=e("robust-orientation"),a=e("signum"),i=e("two-sum"),o=e("robust-product"),s=e("robust-sum");function l(e,t,r){var n=i(e[0],-t[0]),a=i(e[1],-t[1]),l=i(r[0],-t[0]),c=i(r[1],-t[1]),u=s(o(n,l),o(a,c));return u[u.length-1]>=0}},{"robust-orientation":284,"robust-product":285,"robust-sum":289,signum:55,"two-sum":307}],55:[function(e,t,r){"use strict";t.exports=function(e){return e<0?-1:e>0?1:0}},{}],56:[function(e,t,r){t.exports=function(e,t){var r=e.length,i=e.length-t.length;if(i)return i;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:return e[0]+e[1]-t[0]-t[1]||n(e[0],e[1])-n(t[0],t[1]);case 3:var o=e[0]+e[1],s=t[0]+t[1];if(i=o+e[2]-(s+t[2]))return i;var l=n(e[0],e[1]),c=n(t[0],t[1]);return n(l,e[2])-n(c,t[2])||n(l+e[2],o)-n(c+t[2],s);case 4:var u=e[0],f=e[1],p=e[2],h=e[3],d=t[0],m=t[1],g=t[2],y=t[3];return u+f+p+h-(d+m+g+y)||n(u,f,p,h)-n(d,m,g,y,d)||n(u+f,u+p,u+h,f+p,f+h,p+h)-n(d+m,d+g,d+y,m+g,m+y,g+y)||n(u+f+p,u+f+h,u+p+h,f+p+h)-n(d+m+g,d+m+y,d+g+y,m+g+y);default:for(var v=e.slice().sort(a),b=t.slice().sort(a),x=0;x<r;++x)if(i=v[x]-b[x])return i;return 0}};var n=Math.min;function a(e,t){return e-t}},{}],57:[function(e,t,r){"use strict";var n=e("compare-cell"),a=e("cell-orientation");t.exports=function(e,t){return n(e,t)||a(e)-a(t)}},{"cell-orientation":47,"compare-cell":56}],58:[function(e,t,r){"use strict";var n=e("./lib/ch1d"),a=e("./lib/ch2d"),i=e("./lib/chnd");t.exports=function(e){var t=e.length;if(0===t)return[];if(1===t)return[[0]];var r=e[0].length;return 0===r?[]:1===r?n(e):2===r?a(e):i(e,r)}},{"./lib/ch1d":59,"./lib/ch2d":60,"./lib/chnd":61}],59:[function(e,t,r){"use strict";t.exports=function(e){for(var t=0,r=0,n=1;n<e.length;++n)e[n][0]<e[t][0]&&(t=n),e[n][0]>e[r][0]&&(r=n);return t<r?[[t],[r]]:t>r?[[r],[t]]:[[t]]}},{}],60:[function(e,t,r){"use strict";t.exports=function(e){var t=n(e),r=t.length;if(r<=2)return[];for(var a=new Array(r),i=t[r-1],o=0;o<r;++o){var s=t[o];a[o]=[i,s],i=s}return a};var n=e("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":246}],61:[function(e,t,r){"use strict";t.exports=function(e,t){try{return n(e,!0)}catch(o){var r=a(e);if(r.length<=t)return[];var i=function(e,t){for(var r=e.length,n=new Array(r),a=0;a<t.length;++a)n[a]=e[t[a]];var i=t.length;for(a=0;a<r;++a)t.indexOf(a)<0&&(n[i++]=e[a]);return n}(e,r);return function(e,t){for(var r=e.length,n=t.length,a=0;a<r;++a)for(var i=e[a],o=0;o<i.length;++o){var s=i[o];if(s<n)i[o]=t[s];else{s-=n;for(var l=0;l<n;++l)s>=t[l]&&(s+=1);i[o]=s}}return e}(n(i,!0),r)}};var n=e("incremental-convex-hull"),a=e("affine-hull")},{"affine-hull":10,"incremental-convex-hull":233}],62:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a,i){var o=a-1,s=a*a,l=o*o,c=(1+2*a)*l,u=a*l,f=s*(3-2*a),p=s*o;if(e.length){i||(i=new Array(e.length));for(var h=e.length-1;h>=0;--h)i[h]=c*e[h]+u*t[h]+f*r[h]+p*n[h];return i}return c*e+u*t+f*r+p*n},t.exports.derivative=function(e,t,r,n,a,i){var o=6*a*a-6*a,s=3*a*a-4*a+1,l=-6*a*a+6*a,c=3*a*a-2*a;if(e.length){i||(i=new Array(e.length));for(var u=e.length-1;u>=0;--u)i[u]=o*e[u]+s*t[u]+l*r[u]+c*n[u];return i}return o*e+s*t+l*r[u]+c*n}},{}],63:[function(e,t,r){"use strict";var n=e("incremental-convex-hull"),a=e("uniq");function i(e,t){this.point=e,this.index=t}function o(e,t){for(var r=e.point,n=t.point,a=r.length,i=0;i<a;++i){var o=n[i]-r[i];if(o)return o}return 0}t.exports=function(e,t){var r=e.length;if(0===r)return[];var s=e[0].length;if(s<1)return[];if(1===s)return function(e,t,r){if(1===e)return r?[[-1,0]]:[];var n=t.map((function(e,t){return[e[0],t]}));n.sort((function(e,t){return e[0]-t[0]}));for(var a=new Array(e-1),i=1;i<e;++i){var o=n[i-1],s=n[i];a[i-1]=[o[1],s[1]]}return r&&a.push([-1,a[0][1]],[a[e-1][1],-1]),a}(r,e,t);for(var l=new Array(r),c=1,u=0;u<r;++u){for(var f=e[u],p=new Array(s+1),h=0,d=0;d<s;++d){var m=f[d];p[d]=m,h+=m*m}p[s]=h,l[u]=new i(p,u),c=Math.max(h,c)}a(l,o),r=l.length;var g=new Array(r+s+1),y=new Array(r+s+1),v=(s+1)*(s+1)*c,b=new Array(s+1);for(u=0;u<=s;++u)b[u]=0;for(b[s]=v,g[0]=b.slice(),y[0]=-1,u=0;u<=s;++u)(p=b.slice())[u]=1,g[u+1]=p,y[u+1]=-1;for(u=0;u<r;++u){var x=l[u];g[u+s+1]=x.point,y[u+s+1]=x.index}var _=n(g,!1);if(_=t?_.filter((function(e){for(var t=0,r=0;r<=s;++r){var n=y[e[r]];if(n<0&&++t>=2)return!1;e[r]=n}return!0})):_.filter((function(e){for(var t=0;t<=s;++t){var r=y[e[t]];if(r<0)return!1;e[t]=r}return!0})),1&s)for(u=0;u<_.length;++u)p=(x=_[u])[0],x[0]=x[1],x[1]=p;return _}},{"incremental-convex-hull":233,uniq:310}],64:[function(e,t,r){(function(e){(function(){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),a=new Uint32Array(n.buffer);n[0]=1,r=!0,1072693248===a[1]?(t.exports=function(e){return n[0]=e,[a[0],a[1]]},t.exports.pack=function(e,t){return a[0]=e,a[1]=t,n[0]},t.exports.lo=function(e){return n[0]=e,a[0]},t.exports.hi=function(e){return n[0]=e,a[1]}):1072693248===a[0]?(t.exports=function(e){return n[0]=e,[a[1],a[0]]},t.exports.pack=function(e,t){return a[1]=e,a[0]=t,n[0]},t.exports.lo=function(e){return n[0]=e,a[1]},t.exports.hi=function(e){return n[0]=e,a[0]}):r=!1}if(!r){var i=new e(8);t.exports=function(e){return i.writeDoubleLE(e,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},t.exports.pack=function(e,t){return i.writeUInt32LE(e,0,!0),i.writeUInt32LE(t,4,!0),i.readDoubleLE(0,!0)},t.exports.lo=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(0,!0)},t.exports.hi=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(4,!0)}}t.exports.sign=function(e){return t.exports.hi(e)>>>31},t.exports.exponent=function(e){return(t.exports.hi(e)<<1>>>21)-1023},t.exports.fraction=function(e){var r=t.exports.lo(e),n=t.exports.hi(e),a=1048575&n;return 2146435072&n&&(a+=1<<20),[r,a]},t.exports.denormalized=function(e){return!(2146435072&t.exports.hi(e))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:3}],65:[function(e,t,r){"use strict";t.exports=function(e,t){switch(void 0===t&&(t=0),typeof e){case"number":if(e>0)return function(e,t){var r,n;for(r=new Array(e),n=0;n<e;++n)r[n]=t;return r}(0|e,t);break;case"object":if("number"==typeof e.length)return function e(t,r,n){var a=0|t[n];if(a<=0)return[];var i,o=new Array(a);if(n===t.length-1)for(i=0;i<a;++i)o[i]=r;else for(i=0;i<a;++i)o[i]=e(t,r,n+1);return o}(e,t,0)}return[]}},{}],66:[function(e,t,r){"use strict";t.exports=function(e,t){var r=e.length;if("number"!=typeof t){t=0;for(var a=0;a<r;++a){var i=e[a];t=Math.max(t,i[0],i[1])}t=1+(0|t)}t|=0;var o=new Array(t);for(a=0;a<t;++a)o[a]=[];for(a=0;a<r;++a)o[(i=e[a])[0]].push(i[1]),o[i[1]].push(i[0]);for(var s=0;s<t;++s)n(o[s],(function(e,t){return e-t}));return o};var n=e("uniq")},{uniq:310}],67:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=t||0,a=r||1;return[[e[12]+e[0],e[13]+e[1],e[14]+e[2],e[15]+e[3]],[e[12]-e[0],e[13]-e[1],e[14]-e[2],e[15]-e[3]],[e[12]+e[4],e[13]+e[5],e[14]+e[6],e[15]+e[7]],[e[12]-e[4],e[13]-e[5],e[14]-e[6],e[15]-e[7]],[n*e[12]+e[8],n*e[13]+e[9],n*e[14]+e[10],n*e[15]+e[11]],[a*e[12]-e[8],a*e[13]-e[9],a*e[14]-e[10],a*e[15]-e[11]]]}},{}],68:[function(e,t,r){"use strict";t.exports=function(e,t,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:return"number"==typeof e?new o(n=l(e),n,0):new o(e,l(e.length),0);case 2:if("number"==typeof t){var n=l(e.length);return new o(e,n,+t)}r=0;case 3:if(e.length!==t.length)throw new Error("state and velocity lengths must match");return new o(e,t,r)}};var n=e("cubic-hermite"),a=e("binary-search-bounds");function i(e,t,r){return Math.min(t,Math.max(e,r))}function o(e,t,r){this.dimension=e.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-1/0,this.bounds[1][n]=1/0;this._state=e.slice().reverse(),this._velocity=t.slice().reverse(),this._time=[r],this._scratch=[e.slice(),e.slice(),e.slice(),e.slice(),e.slice()]}var s=o.prototype;function l(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=0;return t}s.flush=function(e){var t=a.gt(this._time,e)-1;t<=0||(this._time.splice(0,t),this._state.splice(0,t*this.dimension),this._velocity.splice(0,t*this.dimension))},s.curve=function(e){var t=this._time,r=t.length,o=a.le(t,e),s=this._scratch[0],l=this._state,c=this._velocity,u=this.dimension,f=this.bounds;if(o<0)for(var p=u-1,h=0;h<u;++h,--p)s[h]=l[p];else if(o>=r-1){p=l.length-1;var d=e-t[r-1];for(h=0;h<u;++h,--p)s[h]=l[p]+d*c[p]}else{p=u*(o+1)-1;var m=t[o],g=t[o+1]-m||1,y=this._scratch[1],v=this._scratch[2],b=this._scratch[3],x=this._scratch[4],_=!0;for(h=0;h<u;++h,--p)y[h]=l[p],b[h]=c[p]*g,v[h]=l[p+u],x[h]=c[p+u]*g,_=_&&y[h]===v[h]&&b[h]===x[h]&&0===b[h];if(_)for(h=0;h<u;++h)s[h]=y[h];else n(y,b,v,x,(e-m)/g,s)}var w=f[0],k=f[1];for(h=0;h<u;++h)s[h]=i(w[h],k[h],s[h]);return s},s.dcurve=function(e){var t=this._time,r=t.length,i=a.le(t,e),o=this._scratch[0],s=this._state,l=this._velocity,c=this.dimension;if(i>=r-1)for(var u=s.length-1,f=(t[r-1],0);f<c;++f,--u)o[f]=l[u];else{u=c*(i+1)-1;var p=t[i],h=t[i+1]-p||1,d=this._scratch[1],m=this._scratch[2],g=this._scratch[3],y=this._scratch[4],v=!0;for(f=0;f<c;++f,--u)d[f]=s[u],g[f]=l[u]*h,m[f]=s[u+c],y[f]=l[u+c]*h,v=v&&d[f]===m[f]&&g[f]===y[f]&&0===g[f];if(v)for(f=0;f<c;++f)o[f]=0;else for(n.derivative(d,g,m,y,(e-p)/h,o),f=0;f<c;++f)o[f]/=h}return o},s.lastT=function(){var e=this._time;return e[e.length-1]},s.stable=function(){for(var e=this._velocity,t=e.length,r=this.dimension-1;r>=0;--r)if(e[--t])return!1;return!0},s.jump=function(e){var t=this.lastT(),r=this.dimension;if(!(e<t||arguments.length!==r+1)){var n=this._state,a=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1];this._time.push(t,e);for(var u=0;u<2;++u)for(var f=0;f<r;++f)n.push(n[o++]),a.push(0);for(this._time.push(e),f=r;f>0;--f)n.push(i(l[f-1],c[f-1],arguments[f])),a.push(0)}},s.push=function(e){var t=this.lastT(),r=this.dimension;if(!(e<t||arguments.length!==r+1)){var n=this._state,a=this._velocity,o=n.length-this.dimension,s=e-t,l=this.bounds,c=l[0],u=l[1],f=s>1e-6?1/s:0;this._time.push(e);for(var p=r;p>0;--p){var h=i(c[p-1],u[p-1],arguments[p]);n.push(h),a.push((h-n[o++])*f)}}},s.set=function(e){var t=this.dimension;if(!(e<this.lastT()||arguments.length!==t+1)){var r=this._state,n=this._velocity,a=this.bounds,o=a[0],s=a[1];this._time.push(e);for(var l=t;l>0;--l)r.push(i(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(e){var t=this.lastT(),r=this.dimension;if(!(e<=t||arguments.length!==r+1)){var n=this._state,a=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=e-t,f=u>1e-6?1/u:0;this._time.push(e);for(var p=r;p>0;--p){var h=arguments[p];n.push(i(l[p-1],c[p-1],n[o++]+h)),a.push(h*f)}}},s.idle=function(e){var t=this.lastT();if(!(e<t)){var r=this.dimension,n=this._state,a=this._velocity,o=n.length-r,s=this.bounds,l=s[0],c=s[1],u=e-t;this._time.push(e);for(var f=r-1;f>=0;--f)n.push(i(l[f],c[f],n[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":31,"cubic-hermite":62}],69:[function(e,t,r){"use strict";function n(e,t,r,n,a,i){this._color=e,this.key=t,this.value=r,this.left=n,this.right=a,this._count=i}function a(e){return new n(e._color,e.key,e.value,e.left,e.right,e._count)}function i(e,t){return new n(e,t.key,t.value,t.left,t.right,t._count)}function o(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function s(e,t){this._compare=e,this.root=t}t.exports=function(e){return new s(e||m,null)};var l=s.prototype;function c(e,t){var r;return t.left&&(r=c(e,t.left))?r:(r=e(t.key,t.value))||(t.right?c(e,t.right):void 0)}function u(e,t,r,n){if(t(e,n.key)<=0){var a;if(n.left&&(a=u(e,t,r,n.left)))return a;if(a=r(n.key,n.value))return a}if(n.right)return u(e,t,r,n.right)}function f(e,t,r,n,a){var i,o=r(e,a.key),s=r(t,a.key);if(o<=0){if(a.left&&(i=f(e,t,r,n,a.left)))return i;if(s>0&&(i=n(a.key,a.value)))return i}if(s>0&&a.right)return f(e,t,r,n,a.right)}function p(e,t){this.tree=e,this._stack=t}Object.defineProperty(l,"keys",{get:function(){var e=[];return this.forEach((function(t,r){e.push(t)})),e}}),Object.defineProperty(l,"values",{get:function(){var e=[];return this.forEach((function(t,r){e.push(r)})),e}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(e,t){for(var r=this._compare,a=this.root,l=[],c=[];a;){var u=r(e,a.key);l.push(a),c.push(u),a=u<=0?a.left:a.right}l.push(new n(0,e,t,null,null,1));for(var f=l.length-2;f>=0;--f)a=l[f],c[f]<=0?l[f]=new n(a._color,a.key,a.value,l[f+1],a.right,a._count+1):l[f]=new n(a._color,a.key,a.value,a.left,l[f+1],a._count+1);for(f=l.length-1;f>1;--f){var p=l[f-1];if(a=l[f],1===p._color||1===a._color)break;var h=l[f-2];if(h.left===p)if(p.left===a){if(!(d=h.right)||0!==d._color){h._color=0,h.left=p.right,p._color=1,p.right=h,l[f-2]=p,l[f-1]=a,o(h),o(p),f>=3&&((m=l[f-3]).left===h?m.left=p:m.right=p);break}p._color=1,h.right=i(1,d),h._color=0,f-=1}else{if(!(d=h.right)||0!==d._color){p.right=a.left,h._color=0,h.left=a.right,a._color=1,a.left=p,a.right=h,l[f-2]=a,l[f-1]=p,o(h),o(p),o(a),f>=3&&((m=l[f-3]).left===h?m.left=a:m.right=a);break}p._color=1,h.right=i(1,d),h._color=0,f-=1}else if(p.right===a){if(!(d=h.left)||0!==d._color){h._color=0,h.right=p.left,p._color=1,p.left=h,l[f-2]=p,l[f-1]=a,o(h),o(p),f>=3&&((m=l[f-3]).right===h?m.right=p:m.left=p);break}p._color=1,h.left=i(1,d),h._color=0,f-=1}else{var d;if(!(d=h.left)||0!==d._color){var m;p.left=a.right,h._color=0,h.right=a.left,a._color=1,a.right=p,a.left=h,l[f-2]=a,l[f-1]=p,o(h),o(p),o(a),f>=3&&((m=l[f-3]).right===h?m.right=a:m.left=a);break}p._color=1,h.left=i(1,d),h._color=0,f-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(e,t,r){if(this.root)switch(arguments.length){case 1:return c(e,this.root);case 2:return u(t,this._compare,e,this.root);case 3:if(this._compare(t,r)>=0)return;return f(t,r,this._compare,e,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new p(this,e)}}),Object.defineProperty(l,"end",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new p(this,e)}}),l.at=function(e){if(e<0)return new p(this,[]);for(var t=this.root,r=[];;){if(r.push(t),t.left){if(e<t.left._count){t=t.left;continue}e-=t.left._count}if(!e)return new p(this,r);if(e-=1,!t.right)break;if(e>=t.right._count)break;t=t.right}return new p(this,[])},l.ge=function(e){for(var t=this._compare,r=this.root,n=[],a=0;r;){var i=t(e,r.key);n.push(r),i<=0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new p(this,n)},l.gt=function(e){for(var t=this._compare,r=this.root,n=[],a=0;r;){var i=t(e,r.key);n.push(r),i<0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new p(this,n)},l.lt=function(e){for(var t=this._compare,r=this.root,n=[],a=0;r;){var i=t(e,r.key);n.push(r),i>0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new p(this,n)},l.le=function(e){for(var t=this._compare,r=this.root,n=[],a=0;r;){var i=t(e,r.key);n.push(r),i>=0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new p(this,n)},l.find=function(e){for(var t=this._compare,r=this.root,n=[];r;){var a=t(e,r.key);if(n.push(r),0===a)return new p(this,n);r=a<=0?r.left:r.right}return new p(this,[])},l.remove=function(e){var t=this.find(e);return t?t.remove():this},l.get=function(e){for(var t=this._compare,r=this.root;r;){var n=t(e,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=p.prototype;function d(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e._color=t._color,e._count=t._count}function m(e,t){return e<t?-1:e>t?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new p(this.tree,this._stack.slice())},h.remove=function(){var e=this._stack;if(0===e.length)return this.tree;var t=new Array(e.length),r=e[e.length-1];t[t.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var l=e.length-2;l>=0;--l)(r=e[l]).left===e[l+1]?t[l]=new n(r._color,r.key,r.value,t[l+1],r.right,r._count):t[l]=new n(r._color,r.key,r.value,r.left,t[l+1],r._count);if((r=t[t.length-1]).left&&r.right){var c=t.length;for(r=r.left;r.right;)t.push(r),r=r.right;var u=t[c-1];for(t.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),t[c-1].key=r.key,t[c-1].value=r.value,l=t.length-2;l>=c;--l)r=t[l],t[l]=new n(r._color,r.key,r.value,r.left,t[l+1],r._count);t[c-1].left=t[c]}if(0===(r=t[t.length-1])._color){var f=t[t.length-2];for(f.left===r?f.left=null:f.right===r&&(f.right=null),t.pop(),l=0;l<t.length;++l)t[l]._count--;return new s(this.tree._compare,t[0])}if(r.left||r.right){for(r.left?d(r,r.left):r.right&&d(r,r.right),r._color=1,l=0;l<t.length-1;++l)t[l]._count--;return new s(this.tree._compare,t[0])}if(1===t.length)return new s(this.tree._compare,null);for(l=0;l<t.length;++l)t[l]._count--;var p=t[t.length-2];return function(e){for(var t,r,n,s,l=e.length-1;l>=0;--l){if(t=e[l],0===l)return void(t._color=1);if((r=e[l-1]).left===t){if((n=r.right).right&&0===n.right._color)return s=(n=r.right=a(n)).right=a(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,t._color=1,r._color=1,s._color=1,o(r),o(n),l>1&&((c=e[l-2]).left===r?c.left=n:c.right=n),void(e[l-1]=n);if(n.left&&0===n.left._color)return s=(n=r.right=a(n)).left=a(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=1,n._color=1,t._color=1,o(r),o(n),o(s),l>1&&((c=e[l-2]).left===r?c.left=s:c.right=s),void(e[l-1]=s);if(1===n._color){if(0===r._color)return r._color=1,void(r.right=i(0,n));r.right=i(0,n);continue}n=a(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=e[l-2]).left===r?c.left=n:c.right=n),e[l-1]=n,e[l]=r,l+1<e.length?e[l+1]=t:e.push(t),l+=2}else{if((n=r.left).left&&0===n.left._color)return s=(n=r.left=a(n)).left=a(n.left),r.left=n.right,n.right=r,n.left=s,n._color=r._color,t._color=1,r._color=1,s._color=1,o(r),o(n),l>1&&((c=e[l-2]).right===r?c.right=n:c.left=n),void(e[l-1]=n);if(n.right&&0===n.right._color)return s=(n=r.left=a(n)).right=a(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=1,n._color=1,t._color=1,o(r),o(n),o(s),l>1&&((c=e[l-2]).right===r?c.right=s:c.left=s),void(e[l-1]=s);if(1===n._color){if(0===r._color)return r._color=1,void(r.left=i(0,n));r.left=i(0,n);continue}var c;n=a(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=e[l-2]).right===r?c.right=n:c.left=n),e[l-1]=n,e[l]=r,l+1<e.length?e[l+1]=t:e.push(t),l+=2}}}(t),p.left===r?p.left=null:p.right=null,new s(this.tree._compare,t[0])},Object.defineProperty(h,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var e=0,t=this._stack;if(0===t.length){var r=this.tree.root;return r?r._count:0}t[t.length-1].left&&(e=t[t.length-1].left._count);for(var n=t.length-2;n>=0;--n)t[n+1]===t[n].right&&(++e,t[n].left&&(e+=t[n].left._count));return e},enumerable:!0}),h.next=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.right)for(t=t.right;t;)e.push(t),t=t.left;else for(e.pop();e.length>0&&e[e.length-1].right===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].right)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}}),h.update=function(e){var t=this._stack;if(0===t.length)throw new Error("Can't update empty node!");var r=new Array(t.length),a=t[t.length-1];r[r.length-1]=new n(a._color,a.key,e,a.left,a.right,a._count);for(var i=t.length-2;i>=0;--i)(a=t[i]).left===t[i+1]?r[i]=new n(a._color,a.key,a.value,r[i+1],a.right,a._count):r[i]=new n(a._color,a.key,a.value,a.left,r[i+1],a._count);return new s(this.tree._compare,r[0])},h.prev=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.left)for(t=t.left;t;)e.push(t),t=t.right;else for(e.pop();e.length>0&&e[e.length-1].left===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].left)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}})},{}],70:[function(e,t,r){"use strict";t.exports=function(e,t){var r=new u(e);return r.update(t),r};var n=e("./lib/text.js"),a=e("./lib/lines.js"),i=e("./lib/background.js"),o=e("./lib/cube.js"),s=e("./lib/ticks.js"),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function c(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function u(e){this.gl=e,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=i(e)}var f=u.prototype;function p(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.update=function(e){function t(t,r,n){if(n in e){var a,i=e[n],o=this[n];(t?Array.isArray(i)&&Array.isArray(i[0]):Array.isArray(i))?this[n]=a=[r(i[0]),r(i[1]),r(i[2])]:this[n]=a=[r(i),r(i),r(i)];for(var s=0;s<3;++s)if(a[s]!==o[s])return!0}return!1}e=e||{};var r,i=t.bind(this,!1,Number),o=t.bind(this,!1,Boolean),l=t.bind(this,!1,String),c=t.bind(this,!0,(function(e){if(Array.isArray(e)){if(3===e.length)return[+e[0],+e[1],+e[2],1];if(4===e.length)return[+e[0],+e[1],+e[2],+e[3]]}return[0,0,0,1]})),u=!1,f=!1;if("bounds"in e)for(var p=e.bounds,h=0;h<2;++h)for(var d=0;d<3;++d)p[h][d]!==this.bounds[h][d]&&(f=!0),this.bounds[h][d]=p[h][d];if("ticks"in e)for(r=e.ticks,u=!0,this.autoTicks=!1,h=0;h<3;++h)this.tickSpacing[h]=0;else i("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in e||"tickSpacing"in e||(this.autoTicks=!0),f=!0,u=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(h=0;h<3;++h)r[h].sort((function(e,t){return e.x-t.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),i("tickSize"),i("tickAngle"),i("tickPad"),c("tickColor");var m=l("labels");l("labelFont")&&(m=!0),o("labelEnable"),i("labelSize"),i("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),i("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),i("lineTickLength"),i("lineTickWidth"),c("lineTickColor"),o("gridEnable"),i("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),i("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor"),this._text?this._text&&(m||u)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=n(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=a(this.gl,this.bounds,this.ticks))};var h=[new p,new p,new p];function d(e,t,r,n,a){for(var i=e.primalOffset,o=e.primalMinor,s=e.mirrorOffset,l=e.mirrorMinor,c=n[t],u=0;u<3;++u)if(t!==u){var f=i,p=s,h=o,d=l;c&1<<u&&(f=s,p=i,h=l,d=o),f[u]=r[0][u],p[u]=r[1][u],a[u]>0?(h[u]=-1,d[u]=0):(h[u]=0,d[u]=1)}}var m=[0,0,0],g={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(e){};var y=[0,0,0],v=[0,0,0],b=[0,0,0];f.draw=function(e){e=e||g;for(var t=this.gl,r=e.model||l,n=e.view||l,a=e.projection||l,i=this.bounds,s=e._ortho||!1,u=o(r,n,a,i,s),f=u.cubeEdges,p=u.axis,x=n[12],_=n[13],w=n[14],k=n[15],D=(s?2:1)*this.pixelRatio*(a[3]*x+a[7]*_+a[11]*w+a[15]*k)/t.drawingBufferHeight,T=0;T<3;++T)this.lastCubeProps.cubeEdges[T]=f[T],this.lastCubeProps.axis[T]=p[T];var A=h;for(T=0;T<3;++T)d(h[T],T,this.bounds,f,p);t=this.gl;var S,M,E,C=m;for(T=0;T<3;++T)this.backgroundEnable[T]?C[T]=p[T]:C[T]=0;for(this._background.draw(r,n,a,i,C,this.backgroundColor),this._lines.bind(r,n,a,this),T=0;T<3;++T){var N=[0,0,0];p[T]>0?N[T]=i[1][T]:N[T]=i[0][T];for(var O=0;O<2;++O){var I=(T+1+O)%3,P=(T+1+(1^O))%3;this.gridEnable[I]&&this._lines.drawGrid(I,P,this.bounds,N,this.gridColor[I],this.gridWidth[I]*this.pixelRatio)}for(O=0;O<2;++O)I=(T+1+O)%3,P=(T+1+(1^O))%3,this.zeroEnable[P]&&Math.min(i[0][P],i[1][P])<=0&&Math.max(i[0][P],i[1][P])>=0&&this._lines.drawZero(I,P,this.bounds,N,this.zeroLineColor[P],this.zeroLineWidth[P]*this.pixelRatio)}for(T=0;T<3;++T){this.lineEnable[T]&&this._lines.drawAxisLine(T,this.bounds,A[T].primalOffset,this.lineColor[T],this.lineWidth[T]*this.pixelRatio),this.lineMirror[T]&&this._lines.drawAxisLine(T,this.bounds,A[T].mirrorOffset,this.lineColor[T],this.lineWidth[T]*this.pixelRatio);var R=c(y,A[T].primalMinor),L=c(v,A[T].mirrorMinor),F=this.lineTickLength;for(O=0;O<3;++O){var B=D/r[5*O];R[O]*=F[O]*B,L[O]*=F[O]*B}this.lineTickEnable[T]&&this._lines.drawAxisTicks(T,A[T].primalOffset,R,this.lineTickColor[T],this.lineTickWidth[T]*this.pixelRatio),this.lineTickMirror[T]&&this._lines.drawAxisTicks(T,A[T].mirrorOffset,L,this.lineTickColor[T],this.lineTickWidth[T]*this.pixelRatio)}function z(e){(E=[0,0,0])[e]=1}function j(e,t,r){var n=(e+1)%3,a=(e+2)%3,i=t[n],o=t[a],s=r[n],l=r[a];i>0&&l>0||i>0&&l<0||i<0&&l>0||i<0&&l<0?z(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&z(a)}for(this._lines.unbind(),this._text.bind(r,n,a,this.pixelRatio),T=0;T<3;++T){var U=A[T].primalMinor,$=A[T].mirrorMinor,V=c(b,A[T].primalOffset);for(O=0;O<3;++O)this.lineTickEnable[T]&&(V[O]+=D*U[O]*Math.max(this.lineTickLength[O],0)/r[5*O]);var q=[0,0,0];if(q[T]=1,this.tickEnable[T]){for(-3600===this.tickAngle[T]?(this.tickAngle[T]=0,this.tickAlign[T]="auto"):this.tickAlign[T]=-1,M=1,"auto"===(S=[this.tickAlign[T],.5,M])[0]?S[0]=0:S[0]=parseInt(""+S[0]),E=[0,0,0],j(T,U,$),O=0;O<3;++O)V[O]+=D*U[O]*this.tickPad[O]/r[5*O];this._text.drawTicks(T,this.tickSize[T],this.tickAngle[T],V,this.tickColor[T],q,E,S)}if(this.labelEnable[T]){for(M=0,E=[0,0,0],this.labels[T].length>4&&(z(T),M=1),"auto"===(S=[this.labelAlign[T],.5,M])[0]?S[0]=0:S[0]=parseInt(""+S[0]),O=0;O<3;++O)V[O]+=D*U[O]*this.labelPad[O]/r[5*O];V[T]+=.5*(i[0][T]+i[1][T]),this._text.drawLabel(T,this.labelSize[T],this.labelAngle[T],V,this.labelColor[T],[0,0,0],E,S)}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":71,"./lib/cube.js":72,"./lib/lines.js":73,"./lib/text.js":75,"./lib/ticks.js":76}],71:[function(e,t,r){"use strict";t.exports=function(e){for(var t=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],p=[0,0,0],h=-1;h<=1;h+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=h,p[l]=h;for(var d=-1;d<=1;d+=2){f[c]=d;for(var m=-1;m<=1;m+=2)f[u]=m,t.push(f[0],f[1],f[2],p[0],p[1],p[2]),s+=1}var g=c;c=u,u=g}var y=n(e,new Float32Array(t)),v=n(e,new Uint16Array(r),e.ELEMENT_ARRAY_BUFFER),b=a(e,[{buffer:y,type:e.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:e.FLOAT,size:3,offset:12,stride:24}],v),x=i(e);return x.attributes.position.location=0,x.attributes.normal.location=1,new o(e,y,b,x)};var n=e("gl-buffer"),a=e("gl-vao"),i=e("./shaders").bg;function o(e,t,r,n){this.gl=e,this.buffer=t,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(e,t,r,n,a,i){for(var o=!1,s=0;s<3;++s)o=o||a[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:e,view:t,projection:r,bounds:n,enable:a,colors:i},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":74,"gl-buffer":78,"gl-vao":150}],72:[function(e,t,r){"use strict";t.exports=function(e,t,r,i,h){a(s,t,e),a(s,r,s);for(var v=0,b=0;b<2;++b){u[2]=i[b][2];for(var x=0;x<2;++x){u[1]=i[x][1];for(var _=0;_<2;++_)u[0]=i[_][0],p(l[v],u,s),v+=1}}var w=-1;for(b=0;b<8;++b){for(var k=l[b][3],D=0;D<3;++D)c[b][D]=l[b][D]/k;h&&(c[b][2]*=-1),k<0&&(w<0||c[b][2]<c[w][2])&&(w=b)}if(w<0){w=0;for(var T=0;T<3;++T){for(var A=(T+2)%3,S=(T+1)%3,M=-1,E=-1,C=0;C<2;++C){var N=(I=C<<T)+(C<<A)+(1-C<<S),O=I+(1-C<<A)+(C<<S);o(c[I],c[N],c[O],f)<0||(C?M=1:E=1)}if(M<0||E<0)E>M&&(w|=1<<T);else{for(C=0;C<2;++C){N=(I=C<<T)+(C<<A)+(1-C<<S),O=I+(1-C<<A)+(C<<S);var I,P=d([l[I],l[N],l[O],l[I+(1<<A)+(1<<S)]]);C?M=P:E=P}E>M&&(w|=1<<T)}}}var R=7^w,L=-1;for(b=0;b<8;++b)b!==w&&b!==R&&(L<0||c[L][1]>c[b][1])&&(L=b);var F=-1;for(b=0;b<3;++b)(z=L^1<<b)!==w&&z!==R&&(F<0&&(F=z),(S=c[z])[0]<c[F][0]&&(F=z));var B=-1;for(b=0;b<3;++b){var z;(z=L^1<<b)!==w&&z!==R&&z!==F&&(B<0&&(B=z),(S=c[z])[0]>c[B][0]&&(B=z))}var j=m;j[0]=j[1]=j[2]=0,j[n.log2(F^L)]=L&F,j[n.log2(L^B)]=L&B;var U=7^B;U===w||U===R?(U=7^F,j[n.log2(B^U)]=U&B):j[n.log2(F^U)]=U&F;var $=g,V=w;for(T=0;T<3;++T)$[T]=V&1<<T?-1:1;return y};var n=e("bit-twiddle"),a=e("gl-mat4/multiply"),i=e("split-polygon"),o=e("robust-orientation"),s=new Array(16),l=new Array(8),c=new Array(8),u=new Array(3),f=[0,0,0];function p(e,t,r){for(var n=0;n<4;++n){e[n]=r[12+n];for(var a=0;a<3;++a)e[n]+=t[a]*r[4*a+n]}}!function(){for(var e=0;e<8;++e)l[e]=[1,1,1,1],c[e]=[1,1,1]}();var h=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function d(e){for(var t=0;t<h.length;++t)if((e=i.positive(e,h[t])).length<3)return 0;var r=e[0],n=r[0]/r[3],a=r[1]/r[3],o=0;for(t=1;t+1<e.length;++t){var s=e[t],l=e[t+1],c=s[0]/s[3]-n,u=s[1]/s[3]-a,f=l[0]/l[3]-n,p=l[1]/l[3]-a;o+=Math.abs(c*p-u*f)}return o}var m=[1,1,1],g=[0,0,0],y={cubeEdges:m,axis:g}},{"bit-twiddle":32,"gl-mat4/multiply":100,"robust-orientation":284,"split-polygon":300}],73:[function(e,t,r){"use strict";t.exports=function(e,t,r){var o=[],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[0,0,0];o.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var f=0;f<3;++f){for(var p=o.length/3|0,d=0;d<r[f].length;++d){var m=+r[f][d].x;o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var g=o.length/3|0;s[f]=p,l[f]=g-p,p=o.length/3|0;for(var y=0;y<r[f].length;++y)m=+r[f][y].x,o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1);g=o.length/3|0,c[f]=p,u[f]=g-p}var v=n(e,new Float32Array(o)),b=a(e,[{buffer:v,type:e.FLOAT,size:3,stride:0,offset:0}]),x=i(e);return x.attributes.position.location=0,new h(e,v,b,x,l,s,u,c)};var n=e("gl-buffer"),a=e("gl-vao"),i=e("./shaders").line,o=[0,0,0],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[1,1];function f(e){return e[0]=e[1]=e[2]=0,e}function p(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function h(e,t,r,n,a,i,o,s){this.gl=e,this.vertBuffer=t,this.vao=r,this.shader=n,this.tickCount=a,this.tickOffset=i,this.gridCount=o,this.gridOffset=s}var d=h.prototype;d.bind=function(e,t,r){this.shader.bind(),this.shader.uniforms.model=e,this.shader.uniforms.view=t,this.shader.uniforms.projection=r,u[0]=this.gl.drawingBufferWidth,u[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=u,this.vao.bind()},d.unbind=function(){this.vao.unbind()},d.drawAxisLine=function(e,t,r,n,a){var i=f(s);this.shader.uniforms.majorAxis=s,i[e]=t[1][e]-t[0][e],this.shader.uniforms.minorAxis=i;var o,u=p(c,r);u[e]+=t[0][e],this.shader.uniforms.offset=u,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=n,(o=f(l))[(e+2)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6),(o=f(l))[(e+1)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6)},d.drawAxisTicks=function(e,t,r,n,a){if(this.tickCount[e]){var i=f(o);i[e]=1,this.shader.uniforms.majorAxis=i,this.shader.uniforms.offset=t,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=n,this.shader.uniforms.lineWidth=a;var s=f(l);s[e]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[e],this.tickOffset[e])}},d.drawGrid=function(e,t,r,n,a,i){if(this.gridCount[e]){var u=f(s);u[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=u;var h=p(c,n);h[t]+=r[0][t],this.shader.uniforms.offset=h;var d=f(o);d[e]=1,this.shader.uniforms.majorAxis=d;var m=f(l);m[e]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=a,this.vao.draw(this.gl.TRIANGLES,this.gridCount[e],this.gridOffset[e])}},d.drawZero=function(e,t,r,n,a,i){var o=f(s);this.shader.uniforms.majorAxis=o,o[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=o;var u=p(c,n);u[e]+=r[0][e],this.shader.uniforms.offset=u;var h=f(l);h[t]=1,this.shader.uniforms.screenAxis=h,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=a,this.vao.draw(this.gl.TRIANGLES,6)},d.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{"./shaders":74,"gl-buffer":78,"gl-vao":150}],74:[function(e,t,r){"use strict";var n=e("glslify"),a=e("gl-shader"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\nuniform float lineWidth;\nuniform vec2 screenShape;\n\nvec3 project(vec3 p) {\n  vec4 pp = projection * view * model * vec4(p, 1.0);\n  return pp.xyz / max(pp.w, 0.0001);\n}\n\nvoid main() {\n  vec3 major = position.x * majorAxis;\n  vec3 minor = position.y * minorAxis;\n\n  vec3 vPosition = major + minor + offset;\n  vec3 pPosition = project(vPosition);\n  vec3 offset = project(vPosition + screenAxis * position.z);\n\n  vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\n\n  gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n  gl_FragColor = color;\n}"]);r.line=function(e){return a(e,i,o,null,[{name:"position",type:"vec3"}])};var s=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis, alignDir, alignOpt;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\n\nvec3 project(vec3 p) {\n  vec4 pp = projection * view * model * vec4(p, 1.0);\n  return pp.xyz / max(pp.w, 0.0001);\n}\n\nfloat computeViewAngle(vec3 a, vec3 b) {\n  vec3 A = project(a);\n  vec3 B = project(b);\n\n  return atan(\n    (B.y - A.y) * resolution.y,\n    (B.x - A.x) * resolution.x\n  );\n}\n\nconst float PI = 3.141592;\nconst float TWO_PI = 2.0 * PI;\nconst float HALF_PI = 0.5 * PI;\nconst float ONE_AND_HALF_PI = 1.5 * PI;\n\nint option = int(floor(alignOpt.x + 0.001));\nfloat hv_ratio =       alignOpt.y;\nbool enableAlign =    (alignOpt.z != 0.0);\n\nfloat mod_angle(float a) {\n  return mod(a, PI);\n}\n\nfloat positive_angle(float a) {\n  return mod_angle((a < 0.0) ?\n    a + TWO_PI :\n    a\n  );\n}\n\nfloat look_upwards(float a) {\n  float b = positive_angle(a);\n  return ((b > HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n    b - PI :\n    b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n  // ratio controls the ratio between being horizontal to (vertical + horizontal)\n  // if ratio is set to 0.5 then it is 50%, 50%.\n  // when using a higher ratio e.g. 0.75 the result would\n  // likely be more horizontal than vertical.\n\n  float b = positive_angle(a);\n\n  return\n    (b < (      ratio) * HALF_PI) ? 0.0 :\n    (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n    (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n    (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n                                    0.0;\n}\n\nfloat roundTo(float a, float b) {\n  return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n  float b = positive_angle(a);\n  float div = TWO_PI / float(n);\n  float c = roundTo(b, div);\n  return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n  return\n    (option >  2) ? look_round_n_directions(rawAngle + delta, option) :       // option 3-n: round to n directions\n    (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n    (option == 1) ? rawAngle + delta :       // use free angle, and flip to align with one direction of the axis\n    (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n    (option ==-1) ? 0.0 :                    // useful for backward compatibility, all texts remains horizontal\n                    rawAngle;                // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n                   (axis.y == 0.0) &&\n                   (axis.z == 0.0);\n\nvoid main() {\n  //Compute world offset\n  float axisDistance = position.z;\n  vec3 dataPosition = axisDistance * axis + offset;\n\n  float beta = angle; // i.e. user defined attributes for each tick\n\n  float axisAngle;\n  float clipAngle;\n  float flip;\n\n  if (enableAlign) {\n    axisAngle = (isAxisTitle) ? HALF_PI :\n                      computeViewAngle(dataPosition, dataPosition + axis);\n    clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n    axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n    clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n    flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n                vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n    beta += applyAlignOption(clipAngle, flip * PI);\n  }\n\n  //Compute plane offset\n  vec2 planeCoord = position.xy * pixelScale;\n\n  mat2 planeXform = scale * mat2(\n     cos(beta), sin(beta),\n    -sin(beta), cos(beta)\n  );\n\n  vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n  //Compute clip position\n  vec3 clipPosition = project(dataPosition);\n\n  //Apply text offset in clip coordinates\n  clipPosition += vec3(viewOffset, 0.0);\n\n  //Done\n  gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n  gl_FragColor = color;\n}"]);r.text=function(e){return a(e,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n  vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n  vec3 realNormal = signAxis * normal;\n\n  if(dot(realNormal, enable) > 0.0) {\n    vec3 minRange = min(bounds[0], bounds[1]);\n    vec3 maxRange = max(bounds[0], bounds[1]);\n    vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n    gl_Position = projection * view * model * vec4(nPosition, 1.0);\n  } else {\n    gl_Position = vec4(0,0,0,0);\n  }\n\n  colorChannel = abs(realNormal);\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n  gl_FragColor = colorChannel.x * colors[0] +\n                 colorChannel.y * colors[1] +\n                 colorChannel.z * colors[2];\n}"]);r.bg=function(e){return a(e,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":132,glslify:231}],75:[function(e,t,r){(function(r){(function(){"use strict";t.exports=function(e,t,r,i,s,l){var u=n(e),f=a(e,[{buffer:u,size:3}]),p=o(e);p.attributes.position.location=0;var h=new c(e,p,u,f);return h.update(t,r,i,s,l),h};var n=e("gl-buffer"),a=e("gl-vao"),i=e("vectorize-text"),o=e("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};function c(e,t,r,n){this.gl=e,this.shader=t,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}s.__TEXT_CACHE={};var u=c.prototype,f=[0,0];u.bind=function(e,t,r,n){this.vao.bind(),this.shader.bind();var a=this.shader.uniforms;a.model=e,a.view=t,a.projection=r,a.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.unbind=function(){this.vao.unbind()},u.update=function(e,t,r,n,a){var o=[];function s(e,t,r,n,a,s){var c=l[r];c||(c=l[r]={});var u=c[t];u||(u=c[t]=function(e,t){try{return i(e,t)}catch(t){return console.warn('error vectorizing text:"'+e+'" error:',t),{cells:[],positions:[]}}}(t,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:a,styletags:s}));for(var f=(n||12)/12,p=u.positions,h=u.cells,d=0,m=h.length;d<m;++d)for(var g=h[d],y=2;y>=0;--y){var v=p[g[y]];o.push(f*v[0],-f*v[1],e)}}for(var c=[0,0,0],u=[0,0,0],f=[0,0,0],p=[0,0,0],h={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){f[d]=o.length/3|0,s(.5*(e[0][d]+e[1][d]),t[d],r[d],12,1.25,h),p[d]=(o.length/3|0)-f[d],c[d]=o.length/3|0;for(var m=0;m<n[d].length;++m)n[d][m].text&&s(n[d][m].x,n[d][m].text,n[d][m].font||a,n[d][m].fontSize||12,1.25,h);u[d]=(o.length/3|0)-c[d]}this.buffer.update(o),this.tickOffset=c,this.tickCount=u,this.labelOffset=f,this.labelCount=p},u.drawTicks=function(e,t,r,n,a,i,o,s){this.tickCount[e]&&(this.shader.uniforms.axis=i,this.shader.uniforms.color=a,this.shader.uniforms.angle=r,this.shader.uniforms.scale=t,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[e],this.tickOffset[e]))},u.drawLabel=function(e,t,r,n,a,i,o,s){this.labelCount[e]&&(this.shader.uniforms.axis=i,this.shader.uniforms.color=a,this.shader.uniforms.angle=r,this.shader.uniforms.scale=t,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.labelCount[e],this.labelOffset[e]))},u.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this)}).call(this,e("_process"))},{"./shaders":74,_process:5,"gl-buffer":78,"gl-vao":150,"vectorize-text":311}],76:[function(e,t,r){"use strict";function n(e,t){var r=e+"",n=r.indexOf("."),a=0;n>=0&&(a=r.length-n-1);var i=Math.pow(10,a),o=Math.round(e*t*i),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/i,c=o%i;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),a){for(var f=""+c;f.length<a;)f="0"+f;return u+"."+f}return u}r.create=function(e,t){for(var r=[],a=0;a<3;++a){for(var i=[],o=(e[0][a],e[1][a],0);o*t[a]<=e[1][a];++o)i.push({x:o*t[a],text:n(t[a],o)});for(o=-1;o*t[a]>=e[0][a];--o)i.push({x:o*t[a],text:n(t[a],o)});r.push(i)}return r},r.equal=function(e,t){for(var r=0;r<3;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;n<e[r].length;++n){var a=e[r][n],i=t[r][n];if(a.x!==i.x||a.text!==i.text||a.font!==i.font||a.fontColor!==i.fontColor||a.fontSize!==i.fontSize||a.dx!==i.dx||a.dy!==i.dy)return!1}}return!0}},{}],77:[function(e,t,r){"use strict";t.exports=function(e,t,r,l,f){var p=t.model||c,h=t.view||c,y=t.projection||c,v=t._ortho||!1,b=e.bounds,x=(f=f||i(p,h,y,b,v)).axis;o(u,h,p),o(u,y,u);for(var _=m,w=0;w<3;++w)_[w].lo=1/0,_[w].hi=-1/0,_[w].pixelsPerDataUnit=1/0;var k=n(s(u,u));s(u,u);for(var D=0;D<3;++D){var T=(D+1)%3,A=(D+2)%3,S=g;e:for(w=0;w<2;++w){var M=[];if(x[D]<0!=!!w){S[D]=b[w][D];for(var E=0;E<2;++E){S[T]=b[E^w][T];for(var C=0;C<2;++C)S[A]=b[C^E^w][A],M.push(S.slice())}var N=v?5:4;for(E=N;E===N;++E){if(0===M.length)continue e;M=a.positive(M,k[E])}for(E=0;E<M.length;++E){A=M[E];var O=d(g,u,A,r,l);for(C=0;C<3;++C)_[C].lo=Math.min(_[C].lo,A[C]),_[C].hi=Math.max(_[C].hi,A[C]),C!==D&&(_[C].pixelsPerDataUnit=Math.min(_[C].pixelsPerDataUnit,Math.abs(O[C])))}}}}return _};var n=e("extract-frustum-planes"),a=e("split-polygon"),i=e("./lib/cube.js"),o=e("gl-mat4/multiply"),s=e("gl-mat4/transpose"),l=e("gl-vec4/transformMat4"),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=new Float32Array(16);function f(e,t,r){this.lo=e,this.hi=t,this.pixelsPerDataUnit=r}var p=[0,0,0,1],h=[0,0,0,1];function d(e,t,r,n,a){for(var i=0;i<3;++i){for(var o=p,s=h,c=0;c<3;++c)s[c]=o[c]=r[c];s[3]=o[3]=1,s[i]+=1,l(s,s,t),s[3]<0&&(e[i]=1/0),o[i]-=1,l(o,o,t),o[3]<0&&(e[i]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,f=(o[1]/o[3]-s[1]/s[3])*a;e[i]=.25*Math.sqrt(u*u+f*f)}return e}var m=[new f(1/0,-1/0,1/0),new f(1/0,-1/0,1/0),new f(1/0,-1/0,1/0)],g=[0,0,0]},{"./lib/cube.js":72,"extract-frustum-planes":67,"gl-mat4/multiply":100,"gl-mat4/transpose":109,"gl-vec4/transformMat4":221,"split-polygon":300}],78:[function(e,t,r){"use strict";var n=e("typedarray-pool"),a=e("ndarray-ops"),i=e("ndarray"),o=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(e,t,r,n,a){this.gl=e,this.type=t,this.handle=r,this.length=n,this.usage=a}var l=s.prototype;function c(e,t,r,n,a,i){var o=a.length*a.BYTES_PER_ELEMENT;if(i<0)return e.bufferData(t,a,n),o;if(o+i>r)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return e.bufferSubData(t,i,a),r}function u(e,t){for(var r=n.malloc(e.length,t),a=e.length,i=0;i<a;++i)r[i]=e[i];return r}l.bind=function(){this.gl.bindBuffer(this.type,this.handle)},l.unbind=function(){this.gl.bindBuffer(this.type,null)},l.dispose=function(){this.gl.deleteBuffer(this.handle)},l.update=function(e,t){if("number"!=typeof t&&(t=-1),this.bind(),"object"==typeof e&&void 0!==e.shape){var r=e.dtype;if(o.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER&&(r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16"),r===e.dtype&&function(e,t){for(var r=1,n=t.length-1;n>=0;--n){if(t[n]!==r)return!1;r*=e[n]}return!0}(e.shape,e.stride))0===e.offset&&e.data.length===e.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,e.data,t):this.length=c(this.gl,this.type,this.length,this.usage,e.data.subarray(e.offset,e.shape[0]),t);else{var s=n.malloc(e.size,r),l=i(s,e.shape);a.assign(l,e),this.length=c(this.gl,this.type,this.length,this.usage,t<0?s:s.subarray(0,e.size),t),n.free(s)}}else if(Array.isArray(e)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(e,"uint16"):u(e,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,t<0?f:f.subarray(0,e.length),t),n.free(f)}else if("object"==typeof e&&"number"==typeof e.length)this.length=c(this.gl,this.type,this.length,this.usage,e,t);else{if("number"!=typeof e&&void 0!==e)throw new Error("gl-buffer: Invalid data type");if(t>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(e|=0)<=0&&(e=1),this.gl.bufferData(this.type,0|e,this.usage),this.length=e}},t.exports=function(e,t,r,n){if(r=r||e.ARRAY_BUFFER,n=n||e.DYNAMIC_DRAW,r!==e.ARRAY_BUFFER&&r!==e.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==e.DYNAMIC_DRAW&&n!==e.STATIC_DRAW&&n!==e.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var a=e.createBuffer(),i=new s(e,r,a,0,n);return i.update(t),i}},{ndarray:259,"ndarray-ops":254,"typedarray-pool":308}],79:[function(e,t,r){"use strict";var n=e("gl-vec3");t.exports=function(e,t){var r=e.positions,a=e.vectors,i={positions:[],vertexIntensity:[],vertexIntensityBounds:e.vertexIntensityBounds,vectors:[],cells:[],coneOffset:e.coneOffset,colormap:e.colormap};if(0===e.positions.length)return t&&(t[0]=[0,0,0],t[1]=[0,0,0]),i;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,f=1/0,p=-1/0,h=null,d=null,m=[],g=1/0,y=!1,v=0;v<r.length;v++){var b=r[v];s=Math.min(b[0],s),l=Math.max(b[0],l),c=Math.min(b[1],c),u=Math.max(b[1],u),f=Math.min(b[2],f),p=Math.max(b[2],p);var x=a[v];if(n.length(x)>o&&(o=n.length(x)),v){var _=2*n.distance(h,b)/(n.length(d)+n.length(x));_?(g=Math.min(g,_),y=!1):y=!0}y||(h=b,d=x),m.push(x)}var w=[s,c,f],k=[l,u,p];t&&(t[0]=w,t[1]=k),0===o&&(o=1);var D=1/o;isFinite(g)||(g=1),i.vectorScale=g;var T=e.coneSize||.5;e.absoluteConeSize&&(T=e.absoluteConeSize*D),i.coneScale=T,v=0;for(var A=0;v<r.length;v++)for(var S=(b=r[v])[0],M=b[1],E=b[2],C=m[v],N=n.length(C)*D,O=0;O<8;O++){i.positions.push([S,M,E,A++]),i.positions.push([S,M,E,A++]),i.positions.push([S,M,E,A++]),i.positions.push([S,M,E,A++]),i.positions.push([S,M,E,A++]),i.positions.push([S,M,E,A++]),i.vectors.push(C),i.vectors.push(C),i.vectors.push(C),i.vectors.push(C),i.vectors.push(C),i.vectors.push(C),i.vertexIntensity.push(N,N,N),i.vertexIntensity.push(N,N,N);var I=i.positions.length;i.cells.push([I-6,I-5,I-4],[I-3,I-2,I-1])}return i};var a=e("./lib/shaders");t.exports.createMesh=e("./create_mesh"),t.exports.createConeMesh=function(e,r){return t.exports.createMesh(e,r,{shaders:a,traceType:"cone"})}},{"./create_mesh":80,"./lib/shaders":81,"gl-vec3":169}],80:[function(e,t,r){"use strict";var n=e("gl-shader"),a=e("gl-buffer"),i=e("gl-vao"),o=e("gl-texture2d"),s=e("gl-mat4/multiply"),l=e("gl-mat4/invert"),c=e("ndarray"),u=e("colormap"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function p(e,t,r,n,a,i,o,s,l,c,u){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=a,this.triangleVectors=i,this.triangleColors=s,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=c,this.triangleCount=0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.traceType=u,this.tubeScale=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=f,this._view=f,this._projection=f,this._resolution=[1,1]}var h=p.prototype;function d(e,t){var r=n(e,t.meshShader.vertex,t.meshShader.fragment,null,t.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}function m(e,t){var r=n(e,t.pickShader.vertex,t.pickShader.fragment,null,t.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}h.isOpaque=function(){return this.opacity>=1},h.isTransparent=function(){return this.opacity<1},h.pickSlots=1,h.setPickBase=function(e){this.pickId=e},h.update=function(e){e=e||{};var t=this.gl;this.dirty=!0,"lightPosition"in e&&(this.lightPosition=e.lightPosition),"opacity"in e&&(this.opacity=e.opacity),"ambient"in e&&(this.ambientLight=e.ambient),"diffuse"in e&&(this.diffuseLight=e.diffuse),"specular"in e&&(this.specularLight=e.specular),"roughness"in e&&(this.roughness=e.roughness),"fresnel"in e&&(this.fresnel=e.fresnel),void 0!==e.tubeScale&&(this.tubeScale=e.tubeScale),void 0!==e.vectorScale&&(this.vectorScale=e.vectorScale),void 0!==e.coneScale&&(this.coneScale=e.coneScale),void 0!==e.coneOffset&&(this.coneOffset=e.coneOffset),e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(function(e){for(var t=u({colormap:e,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var a=t[n],i=0;i<3;++i)r[4*n+i]=a[i];r[4*n+3]=255*a[3]}return c(r,[256,256,4],[4,0,1])}(e.colormap)),this.texture.generateMipmap());var r=e.cells,n=e.positions,a=e.vectors;if(n&&r&&a){var i=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=a;var p=e.meshColor||[1,1,1,1],h=e.vertexIntensity,d=1/0,m=-1/0;if(h)if(e.vertexIntensityBounds)d=+e.vertexIntensityBounds[0],m=+e.vertexIntensityBounds[1];else for(var g=0;g<h.length;++g){var y=h[g];d=Math.min(d,y),m=Math.max(m,y)}else for(g=0;g<n.length;++g)y=n[g][2],d=Math.min(d,y),m=Math.max(m,y);for(this.intensity=h||function(e){for(var t=e.length,r=new Array(t),n=0;n<t;++n)r[n]=e[n][2];return r}(n),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=0;g<n.length;++g)for(var v=n[g],b=0;b<3;++b)!isNaN(v[b])&&isFinite(v[b])&&(this.bounds[0][b]=Math.min(this.bounds[0][b],v[b]),this.bounds[1][b]=Math.max(this.bounds[1][b],v[b]));var x=0;e:for(g=0;g<r.length;++g){var _=r[g];if(3===_.length){for(b=0;b<3;++b){v=n[k=_[b]];for(var w=0;w<3;++w)if(isNaN(v[w])||!isFinite(v[w]))continue e}for(b=0;b<3;++b){var k;v=n[k=_[2-b]],i.push(v[0],v[1],v[2],v[3]);var D=a[k];o.push(D[0],D[1],D[2],D[3]||0);var T,A=p;3===A.length?s.push(A[0],A[1],A[2],1):s.push(A[0],A[1],A[2],A[3]),T=h?[(h[k]-d)/(m-d),0]:[(v[2]-d)/(m-d),0],l.push(T[0],T[1]),f.push(g)}x+=1}}this.triangleCount=x,this.trianglePositions.update(i),this.triangleVectors.update(o),this.triangleColors.update(s),this.triangleUVs.update(l),this.triangleIds.update(new Uint32Array(f))}},h.drawTransparent=h.draw=function(e){e=e||{};for(var t=this.gl,r=e.model||f,n=e.view||f,a=e.projection||f,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);var c={model:r,view:n,projection:a,inverseModel:f.slice(),clipBounds:i,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,texture:0};c.inverseModel=l(c.inverseModel,c.model),t.disable(t.CULL_FACE),this.texture.bind(0);var u=new Array(16);for(s(u,c.view,c.model),s(u,c.projection,u),l(u,u),o=0;o<3;++o)c.eyePosition[o]=u[12+o]/u[15];var p=u[15];for(o=0;o<3;++o)p+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var h=u[12+o],d=0;d<3;++d)h+=u[4*d+o]*this.lightPosition[d];c.lightPosition[o]=h/p}if(this.triangleCount>0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},h.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||f,n=e.view||f,a=e.projection||f,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:r,view:n,projection:a,clipBounds:i,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},h.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions[r[1]].slice(0,3),a={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?a.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(a.intensity=this.intensity[r[1]],a.velocity=this.vectors[r[1]].slice(0,3),a.divergence=this.vectors[r[1]][3],a.index=t),a},h.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},t.exports=function(e,t,r){var n=r.shaders;1===arguments.length&&(e=(t=e).gl);var s=d(e,n),l=m(e,n),u=o(e,c(new Uint8Array([255,255,255,255]),[1,1,4]));u.generateMipmap(),u.minFilter=e.LINEAR_MIPMAP_LINEAR,u.magFilter=e.LINEAR;var f=a(e),h=a(e),g=a(e),y=a(e),v=a(e),b=new p(e,u,s,l,f,h,v,g,y,i(e,[{buffer:f,type:e.FLOAT,size:4},{buffer:v,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:g,type:e.FLOAT,size:4},{buffer:y,type:e.FLOAT,size:2},{buffer:h,type:e.FLOAT,size:4}]),r.traceType||"cone");return b.update(t),b}},{colormap:53,"gl-buffer":78,"gl-mat4/invert":98,"gl-mat4/multiply":100,"gl-shader":132,"gl-texture2d":146,"gl-vao":150,ndarray:259}],81:[function(e,t,r){var n=e("glslify"),a=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n  // Return up-vector for only-z vector.\n  // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n  // From the above if-statement we have ||a|| > 0  U  ||b|| > 0.\n  // Assign z = 0, x = -b, y = a:\n  // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n  if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n    return normalize(vec3(-v.y, v.x, 0.0));\n  } else {\n    return normalize(vec3(0.0, v.z, -v.y));\n  }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n//   segment + 0 top vertex\n//   segment + 1 perimeter vertex a+1\n//   segment + 2 perimeter vertex a\n//   segment + 3 center base vertex\n//   segment + 4 perimeter vertex a\n//   segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n  const float segmentCount = 8.0;\n\n  float index = rawIndex - floor(rawIndex /\n    (segmentCount * 6.0)) *\n    (segmentCount * 6.0);\n\n  float segment = floor(0.001 + index/6.0);\n  float segmentIndex = index - (segment*6.0);\n\n  normal = -normalize(d);\n\n  if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n    return mix(vec3(0.0), -d, coneOffset);\n  }\n\n  float nextAngle = (\n    (segmentIndex > 0.99 &&  segmentIndex < 1.01) ||\n    (segmentIndex > 4.99 &&  segmentIndex < 5.01)\n  ) ? 1.0 : 0.0;\n  float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n  vec3 v1 = mix(d, vec3(0.0), coneOffset);\n  vec3 v2 = v1 - d;\n\n  vec3 u = getOrthogonalVector(d);\n  vec3 v = normalize(cross(u, d));\n\n  vec3 x = u * cos(angle) * length(d)*0.25;\n  vec3 y = v * sin(angle) * length(d)*0.25;\n  vec3 v3 = v2 + x + y;\n  if (segmentIndex < 3.0) {\n    vec3 tx = u * sin(angle);\n    vec3 ty = v * -cos(angle);\n    vec3 tangent = tx + ty;\n    normal = normalize(cross(v3 - v1, tangent));\n  }\n\n  if (segmentIndex == 0.0) {\n    return mix(d, vec3(0.0), coneOffset);\n  }\n  return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n  // Scale the vector magnitude to stay constant with\n  // model & view changes.\n  vec3 normal;\n  vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n  vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n  //Lighting geometry parameters\n  vec4 cameraCoordinate = view * conePosition;\n  cameraCoordinate.xyz /= cameraCoordinate.w;\n  f_lightDirection = lightPosition - cameraCoordinate.xyz;\n  f_eyeDirection   = eyePosition - cameraCoordinate.xyz;\n  f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n  // vec4 m_position  = model * vec4(conePosition, 1.0);\n  vec4 t_position  = view * conePosition;\n  gl_Position      = projection * t_position;\n\n  f_color          = color;\n  f_data           = conePosition.xyz;\n  f_position       = position.xyz;\n  f_uv             = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n  float NdotH = max(x, 0.0001);\n  float cos2Alpha = NdotH * NdotH;\n  float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n  float roughness2 = roughness * roughness;\n  float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n  return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n  vec3 lightDirection,\n  vec3 viewDirection,\n  vec3 surfaceNormal,\n  float roughness,\n  float fresnel) {\n\n  float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n  float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n  //Half angle vector\n  vec3 H = normalize(lightDirection + viewDirection);\n\n  //Geometric term\n  float NdotH = max(dot(surfaceNormal, H), 0.0);\n  float VdotH = max(dot(viewDirection, H), 0.000001);\n  float LdotH = max(dot(lightDirection, H), 0.000001);\n  float G1 = (2.0 * NdotH * VdotN) / VdotH;\n  float G2 = (2.0 * NdotH * LdotN) / LdotH;\n  float G = min(1.0, min(G1, G2));\n  \n  //Distribution term\n  float D = beckmannDistribution(NdotH, roughness);\n\n  //Fresnel term\n  float F = pow(1.0 - VdotN, fresnel);\n\n  //Multiply terms and done\n  return  G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n  vec3 N = normalize(f_normal);\n  vec3 L = normalize(f_lightDirection);\n  vec3 V = normalize(f_eyeDirection);\n\n  if(gl_FrontFacing) {\n    N = -N;\n  }\n\n  float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n  float diffuse  = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n  vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n  vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular,  1.0);\n\n  gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n  // Return up-vector for only-z vector.\n  // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n  // From the above if-statement we have ||a|| > 0  U  ||b|| > 0.\n  // Assign z = 0, x = -b, y = a:\n  // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n  if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n    return normalize(vec3(-v.y, v.x, 0.0));\n  } else {\n    return normalize(vec3(0.0, v.z, -v.y));\n  }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n//   segment + 0 top vertex\n//   segment + 1 perimeter vertex a+1\n//   segment + 2 perimeter vertex a\n//   segment + 3 center base vertex\n//   segment + 4 perimeter vertex a\n//   segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n  const float segmentCount = 8.0;\n\n  float index = rawIndex - floor(rawIndex /\n    (segmentCount * 6.0)) *\n    (segmentCount * 6.0);\n\n  float segment = floor(0.001 + index/6.0);\n  float segmentIndex = index - (segment*6.0);\n\n  normal = -normalize(d);\n\n  if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n    return mix(vec3(0.0), -d, coneOffset);\n  }\n\n  float nextAngle = (\n    (segmentIndex > 0.99 &&  segmentIndex < 1.01) ||\n    (segmentIndex > 4.99 &&  segmentIndex < 5.01)\n  ) ? 1.0 : 0.0;\n  float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n  vec3 v1 = mix(d, vec3(0.0), coneOffset);\n  vec3 v2 = v1 - d;\n\n  vec3 u = getOrthogonalVector(d);\n  vec3 v = normalize(cross(u, d));\n\n  vec3 x = u * cos(angle) * length(d)*0.25;\n  vec3 y = v * sin(angle) * length(d)*0.25;\n  vec3 v3 = v2 + x + y;\n  if (segmentIndex < 3.0) {\n    vec3 tx = u * sin(angle);\n    vec3 ty = v * -cos(angle);\n    vec3 tangent = tx + ty;\n    normal = normalize(cross(v3 - v1, tangent));\n  }\n\n  if (segmentIndex == 0.0) {\n    return mix(d, vec3(0.0), coneOffset);\n  }\n  return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  vec3 normal;\n  vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n  vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n  gl_Position = projection * view * conePosition;\n  f_id        = id;\n  f_position  = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3  clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n  gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:231}],82:[function(e,t,r){t.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],83:[function(e,t,r){var n=e("./1.0/numbers");t.exports=function(e){return n[e]}},{"./1.0/numbers":82}],84:[function(e,t,r){"use strict";t.exports=function(e){var t=e.gl,r=n(t),o=a(t,[{buffer:r,type:t.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:t.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:t.FLOAT,size:3,offset:28,stride:40}]),l=i(t);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(t,r,o,l);return c.update(e),c};var n=e("gl-buffer"),a=e("gl-vao"),i=e("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,n){this.gl=e,this.shader=n,this.buffer=t,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function c(e,t){for(var r=0;r<3;++r)e[0][r]=Math.min(e[0][r],t[r]),e[1][r]=Math.max(e[1][r],t[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(e){var t=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=e.view||o,a=r.projection=e.projection||o;r.model=e.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var i=n[12],s=n[13],l=n[14],c=n[15],u=(e._ortho?2:1)*this.pixelRatio*(a[3]*i+a[7]*s+a[11]*l+a[15]*c)/t.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)t.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*u,this.lineCount[f]&&t.drawArrays(t.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var u=function(){for(var e=new Array(3),t=0;t<3;++t){for(var r=[],n=1;n<=2;++n)for(var a=-1;a<=1;a+=2){var i=[0,0,0];i[(n+t)%3]=a,r.push(i)}e[t]=r}return e}();function f(e,t,r,n){for(var a=u[n],i=0;i<a.length;++i){var o=a[i];e.push(t[0],t[1],t[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return a.length}l.update=function(e){"lineWidth"in(e=e||{})&&(this.lineWidth=e.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in e&&(this.capSize=e.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),this.hasAlpha=!1,"opacity"in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var t=e.color||[[0,0,0],[0,0,0],[0,0,0]],r=e.position,n=e.error;if(Array.isArray(t[0])||(t=[t,t,t]),r&&n){var a=[],i=r.length,o=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var s=0;s<3;++s){this.lineOffset[s]=o;e:for(var l=0;l<i;++l){for(var u=r[l],p=0;p<3;++p)if(isNaN(u[p])||!isFinite(u[p]))continue e;var h,d=n[l],m=t[s];Array.isArray(m[0])&&(m=t[l]),3===m.length?m=[m[0],m[1],m[2],1]:4===m.length&&(m=[m[0],m[1],m[2],m[3]],!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0)),isNaN(d[0][s])||isNaN(d[1][s])||(d[0][s]<0&&((h=u.slice())[s]+=d[0][s],a.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,h[0],h[1],h[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,h),o+=2+f(a,h,m,s)),d[1][s]>0&&((h=u.slice())[s]+=d[1][s],a.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,h[0],h[1],h[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,h),o+=2+f(a,h,m,s)))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(a)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":85,"gl-buffer":78,"gl-vao":150}],85:[function(e,t,r){"use strict";var n=e("glslify"),a=e("gl-shader"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n  vec4 worldPosition  = model * vec4(position, 1.0);\n  worldPosition       = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n  gl_Position         = projection * view * worldPosition;\n  fragColor           = color;\n  fragPosition        = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n  if (\n    outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n    fragColor.a * opacity == 0.\n  ) discard;\n\n  gl_FragColor = opacity * fragColor;\n}"]);t.exports=function(e){return a(e,i,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":132,glslify:231}],86:[function(e,t,r){"use strict";var n=e("gl-texture2d");t.exports=function(e,t,r,n){a||(a=e.FRAMEBUFFER_UNSUPPORTED,i=e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=e.getExtension("WEBGL_draw_buffers");if(!l&&c&&function(e,t){var r=e.getParameter(t.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var a=new Array(r),i=0;i<n;++i)a[i]=e.COLOR_ATTACHMENT0+i;for(i=n;i<r;++i)a[i]=e.NONE;l[n]=a}}(e,c),Array.isArray(t)&&(n=r,r=0|t[1],t=0|t[0]),"number"!=typeof t)throw new Error("gl-fbo: Missing shape parameter");var u=e.getParameter(e.MAX_RENDERBUFFER_SIZE);if(t<0||t>u||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>e.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var p=e.UNSIGNED_BYTE,h=e.getExtension("OES_texture_float");if(n.float&&f>0){if(!h)throw new Error("gl-fbo: Context does not support floating point textures");p=e.FLOAT}else n.preferFloat&&f>0&&h&&(p=e.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new d(e,t,r,p,f,m,g,c)};var a,i,o,s,l=null;function c(e){return[e.getParameter(e.FRAMEBUFFER_BINDING),e.getParameter(e.RENDERBUFFER_BINDING),e.getParameter(e.TEXTURE_BINDING_2D)]}function u(e,t){e.bindFramebuffer(e.FRAMEBUFFER,t[0]),e.bindRenderbuffer(e.RENDERBUFFER,t[1]),e.bindTexture(e.TEXTURE_2D,t[2])}function f(e){switch(e){case a:throw new Error("gl-fbo: Framebuffer unsupported");case i:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function p(e,t,r,a,i,o){if(!a)return null;var s=n(e,t,r,i,a);return s.magFilter=e.NEAREST,s.minFilter=e.NEAREST,s.mipSamples=1,s.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,o,e.TEXTURE_2D,s.handle,0),s}function h(e,t,r,n,a){var i=e.createRenderbuffer();return e.bindRenderbuffer(e.RENDERBUFFER,i),e.renderbufferStorage(e.RENDERBUFFER,n,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,a,e.RENDERBUFFER,i),i}function d(e,t,r,n,a,i,o,s){this.gl=e,this._shape=[0|t,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(a);for(var d=0;d<a;++d)this.color[d]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=i,this._useStencil=o;var m=this,g=[0|t,0|r];Object.defineProperties(g,{0:{get:function(){return m._shape[0]},set:function(e){return m.width=e}},1:{get:function(){return m._shape[1]},set:function(e){return m.height=e}}}),this._shapeVector=g,function(e){var t=c(e.gl),r=e.gl,n=e.handle=r.createFramebuffer(),a=e._shape[0],i=e._shape[1],o=e.color.length,s=e._ext,d=e._useStencil,m=e._useDepth,g=e._colorType;r.bindFramebuffer(r.FRAMEBUFFER,n);for(var y=0;y<o;++y)e.color[y]=p(r,a,i,g,r.RGBA,r.COLOR_ATTACHMENT0+y);0===o?(e._color_rb=h(r,a,i,r.RGBA4,r.COLOR_ATTACHMENT0),s&&s.drawBuffersWEBGL(l[0])):o>1&&s.drawBuffersWEBGL(l[o]);var v=r.getExtension("WEBGL_depth_texture");v?d?e.depth=p(r,a,i,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(e.depth=p(r,a,i,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&d?e._depth_rb=h(r,a,i,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?e._depth_rb=h(r,a,i,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(e._depth_rb=h(r,a,i,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){for(e._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(e.handle),e.handle=null,e.depth&&(e.depth.dispose(),e.depth=null),e._depth_rb&&(r.deleteRenderbuffer(e._depth_rb),e._depth_rb=null),y=0;y<e.color.length;++y)e.color[y].dispose(),e.color[y]=null;e._color_rb&&(r.deleteRenderbuffer(e._color_rb),e._color_rb=null),u(r,t),f(b)}u(r,t)}(this)}var m=d.prototype;function g(e,t,r){if(e._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(e._shape[0]!==t||e._shape[1]!==r){var n=e.gl,a=n.getParameter(n.MAX_RENDERBUFFER_SIZE);if(t<0||t>a||r<0||r>a)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");e._shape[0]=t,e._shape[1]=r;for(var i=c(n),o=0;o<e.color.length;++o)e.color[o].shape=e._shape;e._color_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,e._color_rb),n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,e._shape[0],e._shape[1])),e.depth&&(e.depth.shape=e._shape),e._depth_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,e._depth_rb),e._useDepth&&e._useStencil?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e._shape[0],e._shape[1]):e._useDepth?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,e._shape[0],e._shape[1]):e._useStencil&&n.renderbufferStorage(n.RENDERBUFFER,n.STENCIL_INDEX,e._shape[0],e._shape[1])),n.bindFramebuffer(n.FRAMEBUFFER,e.handle);var s=n.checkFramebufferStatus(n.FRAMEBUFFER);s!==n.FRAMEBUFFER_COMPLETE&&(e.dispose(),u(n,i),f(s)),u(n,i)}}Object.defineProperties(m,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(e){if(Array.isArray(e)||(e=[0|e,0|e]),2!==e.length)throw new Error("gl-fbo: Shape vector must be length 2");var t=0|e[0],r=0|e[1];return g(this,t,r),[t,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(e){return g(this,e|=0,this._shape[1]),e},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(e){return e|=0,g(this,this._shape[0],e),e},enumerable:!1}}),m.bind=function(){if(!this._destroyed){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.handle),e.viewport(0,0,this._shape[0],this._shape[1])}},m.dispose=function(){if(!this._destroyed){this._destroyed=!0;var e=this.gl;e.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(e.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var t=0;t<this.color.length;++t)this.color[t].dispose(),this.color[t]=null;this._color_rb&&(e.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},{"gl-texture2d":146}],87:[function(e,t,r){var n=e("sprintf-js").sprintf,a=e("gl-constants/lookup"),i=e("glsl-shader-name"),o=e("add-line-numbers");t.exports=function(e,t,r){"use strict";var s=i(t)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===a.FRAGMENT_SHADER?"fragment":"vertex");for(var c=n("Error compiling %s shader %s:\n",l,s),u=n("%s%s",c,e),f=e.split("\n"),p={},h=0;h<f.length;h++){var d=f[h];if(""!==d&&"\0"!==d){var m=parseInt(d.split(":")[2]);if(isNaN(m))throw new Error(n("Could not parse error: %s",d));p[m]=d}}var g=o(t).split("\n");for(h=0;h<g.length;h++)if((p[h+3]||p[h+2]||p[h+1])&&(c+=g[h]+"\n",p[h+1])){var y=p[h+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),c+=n("^^^ %s\n\n",y)}return{long:c.trim(),short:u.trim()}}},{"add-line-numbers":9,"gl-constants/lookup":83,"glsl-shader-name":223,"sprintf-js":301}],88:[function(e,t,r){"use strict";t.exports=function(e,t){var r=e.gl,n=new c(e,o(r,l.vertex,l.fragment),o(r,l.pickVertex,l.pickFragment),s(r),s(r),s(r),s(r));return n.update(t),e.addObject(n),n};var n=e("binary-search-bounds"),a=e("iota-array"),i=e("typedarray-pool"),o=e("gl-shader"),s=e("gl-buffer"),l=e("./lib/shaders");function c(e,t,r,n,a,i,o){this.plot=e,this.shader=t,this.pickShader=r,this.positionBuffer=n,this.weightBuffer=a,this.colorBuffer=i,this.idBuffer=o,this.xData=[],this.yData=[],this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0}var u,f=c.prototype,p=[0,0,1,0,0,1,1,0,1,1,0,1];f.draw=(u=[1,0,0,0,1,0,0,0,1],function(){var e=this.plot,t=this.shader,r=this.bounds,n=this.numVertices;if(!(n<=0)){var a=e.gl,i=e.dataBox,o=r[2]-r[0],s=r[3]-r[1],l=i[2]-i[0],c=i[3]-i[1];u[0]=2*o/l,u[4]=2*s/c,u[6]=2*(r[0]-i[0])/l-1,u[7]=2*(r[1]-i[1])/c-1,t.bind();var f=t.uniforms;f.viewTransform=u,f.shape=this.shape;var p=t.attributes;this.positionBuffer.bind(),p.position.pointer(),this.weightBuffer.bind(),p.weight.pointer(a.UNSIGNED_BYTE,!1),this.colorBuffer.bind(),p.color.pointer(a.UNSIGNED_BYTE,!0),a.drawArrays(a.TRIANGLES,0,n)}}),f.drawPick=function(){var e=[1,0,0,0,1,0,0,0,1],t=[0,0,0,0];return function(r){var n=this.plot,a=this.pickShader,i=this.bounds,o=this.numVertices;if(!(o<=0)){var s=n.gl,l=n.dataBox,c=i[2]-i[0],u=i[3]-i[1],f=l[2]-l[0],p=l[3]-l[1];e[0]=2*c/f,e[4]=2*u/p,e[6]=2*(i[0]-l[0])/f-1,e[7]=2*(i[1]-l[1])/p-1;for(var h=0;h<4;++h)t[h]=r>>8*h&255;this.pickOffset=r,a.bind();var d=a.uniforms;d.viewTransform=e,d.pickOffset=t,d.shape=this.shape;var m=a.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(e,t,r){var n=this.pickOffset,a=this.shape[0]*this.shape[1];if(r<n||r>=n+a)return null;var i=r-n,o=this.xData,s=this.yData;return{object:this,pointId:i,dataCoord:[o[i%this.shape[0]],s[i/this.shape[0]|0]]}},f.update=function(e){var t=(e=e||{}).shape||[0,0],r=e.x||a(t[0]),o=e.y||a(t[1]),s=e.z||new Float32Array(t[0]*t[1]),l=!1!==e.zsmooth;this.xData=r,this.yData=o;var c,u,f,h,d=e.colorLevels||[0],m=e.colorValues||[0,0,0,1],g=d.length,y=this.bounds;l?(c=y[0]=r[0],u=y[1]=o[0],f=y[2]=r[r.length-1],h=y[3]=o[o.length-1]):(c=y[0]=r[0]+(r[1]-r[0])/2,u=y[1]=o[0]+(o[1]-o[0])/2,f=y[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,h=y[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var v=1/(f-c),b=1/(h-u),x=t[0],_=t[1];this.shape=[x,_];var w=(l?(x-1)*(_-1):x*_)*(p.length>>>1);this.numVertices=w;for(var k=i.mallocUint8(4*w),D=i.mallocFloat32(2*w),T=i.mallocUint8(2*w),A=i.mallocUint32(w),S=0,M=l?x-1:x,E=l?_-1:_,C=0;C<E;++C){var N,O;l?(N=b*(o[C]-u),O=b*(o[C+1]-u)):(N=C<_-1?b*(o[C]-(o[C+1]-o[C])/2-u):b*(o[C]-(o[C]-o[C-1])/2-u),O=C<_-1?b*(o[C]+(o[C+1]-o[C])/2-u):b*(o[C]+(o[C]-o[C-1])/2-u));for(var I=0;I<M;++I){var P,R;l?(P=v*(r[I]-c),R=v*(r[I+1]-c)):(P=I<x-1?v*(r[I]-(r[I+1]-r[I])/2-c):v*(r[I]-(r[I]-r[I-1])/2-c),R=I<x-1?v*(r[I]+(r[I+1]-r[I])/2-c):v*(r[I]+(r[I]-r[I-1])/2-c));for(var L=0;L<p.length;L+=2){var F,B,z,j,U=p[L],$=p[L+1],V=s[l?(C+$)*x+(I+U):C*x+I],q=n.le(d,V);if(q<0)F=m[0],B=m[1],z=m[2],j=m[3];else if(q===g-1)F=m[4*g-4],B=m[4*g-3],z=m[4*g-2],j=m[4*g-1];else{var W=(V-d[q])/(d[q+1]-d[q]),H=1-W,G=4*q,X=4*(q+1);F=H*m[G]+W*m[X],B=H*m[G+1]+W*m[X+1],z=H*m[G+2]+W*m[X+2],j=H*m[G+3]+W*m[X+3]}k[4*S]=255*F,k[4*S+1]=255*B,k[4*S+2]=255*z,k[4*S+3]=255*j,D[2*S]=.5*P+.5*R,D[2*S+1]=.5*N+.5*O,T[2*S]=U,T[2*S+1]=$,A[S]=C*x+I,S+=1}}}this.positionBuffer.update(D),this.weightBuffer.update(T),this.colorBuffer.update(k),this.idBuffer.update(A),i.free(D),i.free(k),i.free(T),i.free(A)},f.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.weightBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{"./lib/shaders":89,"binary-search-bounds":31,"gl-buffer":78,"gl-shader":132,"iota-array":235,"typedarray-pool":308}],89:[function(e,t,r){"use strict";var n=e("glslify");t.exports={fragment:n(["precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n  gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n}\n"]),vertex:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 color;\nattribute vec2 weight;\n\nuniform vec2 shape;\nuniform mat3 viewTransform;\n\nvarying vec4 fragColor;\n\nvoid main() {\n  vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\n  fragColor = color;\n  gl_Position = vec4(vPosition.xy, 0, vPosition.z);\n}\n"]),pickFragment:n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\nvarying vec2 vWeight;\n\nuniform vec2 shape;\nuniform vec4 pickOffset;\n\nvoid main() {\n  vec2 d = step(.5, vWeight);\n  vec4 id = fragId + pickOffset;\n  id.x += d.x + d.y*shape.x;\n\n  id.y += floor(id.x / 256.0);\n  id.x -= floor(id.x / 256.0) * 256.0;\n\n  id.z += floor(id.y / 256.0);\n  id.y -= floor(id.y / 256.0) * 256.0;\n\n  id.w += floor(id.z / 256.0);\n  id.z -= floor(id.z / 256.0) * 256.0;\n\n  gl_FragColor = id/255.;\n}\n"]),pickVertex:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\nattribute vec2 weight;\n\nuniform vec2 shape;\nuniform mat3 viewTransform;\n\nvarying vec4 fragId;\nvarying vec2 vWeight;\n\nvoid main() {\n  vWeight = weight;\n\n  fragId = pickId;\n\n  vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\n  gl_Position = vec4(vPosition.xy, 0, vPosition.z);\n}\n"])}},{glslify:231}],90:[function(e,t,r){var n=e("glslify"),a=e("gl-shader"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvec4 project(vec3 p) {\n  return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n  vec4 startPoint = project(position);\n  vec4 endPoint   = project(nextPosition);\n\n  vec2 A = startPoint.xy / startPoint.w;\n  vec2 B =   endPoint.xy /   endPoint.w;\n\n  float clipAngle = atan(\n    (B.y - A.y) * screenShape.y,\n    (B.x - A.x) * screenShape.x\n  );\n\n  vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(\n    sin(clipAngle),\n    -cos(clipAngle)\n  ) / screenShape;\n\n  gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);\n\n  worldPosition = position;\n  pixelArcLength = arcLength;\n  fragColor = color;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3      clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float     dashScale;\nuniform float     opacity;\n\nvarying vec3    worldPosition;\nvarying float   pixelArcLength;\nvarying vec4    fragColor;\n\nvoid main() {\n  if (\n    outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n    fragColor.a * opacity == 0.\n  ) discard;\n\n  float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n  if(dashWeight < 0.5) {\n    discard;\n  }\n  gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX  1.70141184e38\n#define FLOAT_MIN  1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n  float av = abs(v);\n\n  //Handle special cases\n  if(av < FLOAT_MIN) {\n    return vec4(0.0, 0.0, 0.0, 0.0);\n  } else if(v > FLOAT_MAX) {\n    return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n  } else if(v < -FLOAT_MAX) {\n    return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n  }\n\n  vec4 c = vec4(0,0,0,0);\n\n  //Compute exponent and mantissa\n  float e = floor(log2(av));\n  float m = av * pow(2.0, -e) - 1.0;\n\n  //Unpack mantissa\n  c[1] = floor(128.0 * m);\n  m -= c[1] / 128.0;\n  c[2] = floor(32768.0 * m);\n  m -= c[2] / 32768.0;\n  c[3] = floor(8388608.0 * m);\n\n  //Unpack exponent\n  float ebias = e + 127.0;\n  c[0] = floor(ebias / 2.0);\n  ebias -= c[0] * 2.0;\n  c[1] += floor(ebias) * 128.0;\n\n  //Unpack sign bit\n  c[0] += 128.0 * step(0.0, -v);\n\n  //Scale back to range\n  return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n  gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(e){return a(e,i,o,null,l)},r.createPickShader=function(e){return a(e,i,s,null,l)}},{"gl-shader":132,glslify:231}],91:[function(e,t,r){"use strict";t.exports=function(e){var t=e.gl||e.scene&&e.scene.gl,r=f(t);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=p(t);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(t),l=a(t,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),h=0;h<1024;++h)u.data[h]=255;var d=i(t,u);d.wrap=t.REPEAT;var m=new y(t,r,o,s,l,d);return m.update(e),m};var n=e("gl-buffer"),a=e("gl-vao"),i=e("gl-texture2d"),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=e("binary-search-bounds"),c=e("ndarray"),u=e("./lib/shaders"),f=u.createShader,p=u.createPickShader,h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(e,t){for(var r=0,n=0;n<3;++n){var a=e[n]-t[n];r+=a*a}return Math.sqrt(r)}function m(e){for(var t=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)t[0][r]=Math.max(e[0][r],t[0][r]),t[1][r]=Math.min(e[1][r],t[1][r]);return t}function g(e,t,r,n){this.arcLength=e,this.position=t,this.index=r,this.dataCoordinate=n}function y(e,t,r,n,a,i){this.gl=e,this.shader=t,this.pickShader=r,this.buffer=n,this.vao=a,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=i,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var v=y.prototype;v.isTransparent=function(){return this.hasAlpha},v.isOpaque=function(){return!this.hasAlpha},v.pickSlots=1,v.setPickBase=function(e){this.pickId=e},v.drawTransparent=v.draw=function(e){if(this.vertexCount){var t=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:e.model||h,view:e.view||h,projection:e.projection||h,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.drawPick=function(e){if(this.vertexCount){var t=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:e.model||h,view:e.view||h,projection:e.projection||h,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.update=function(e){var t,r;this.dirty=!0;var n=!!e.connectGaps;"dashScale"in e&&(this.dashScale=e.dashScale),this.hasAlpha=!1,"opacity"in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var a=[],i=[],o=[],s=0,u=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],p=e.position||e.positions;if(p){var h=e.color||e.colors||[0,0,0,1],m=e.lineWidth||1,g=!1;e:for(t=1;t<p.length;++t){var y,v,b,x=p[t-1],_=p[t];for(i.push(s),o.push(x.slice()),r=0;r<3;++r){if(isNaN(x[r])||isNaN(_[r])||!isFinite(x[r])||!isFinite(_[r])){if(!n&&a.length>0){for(var w=0;w<24;++w)a.push(a[a.length-12]);u+=2,g=!0}continue e}f[0][r]=Math.min(f[0][r],x[r],_[r]),f[1][r]=Math.max(f[1][r],x[r],_[r])}Array.isArray(h[0])?(y=h.length>t-1?h[t-1]:h.length>0?h[h.length-1]:[0,0,0,1],v=h.length>t?h[t]:h.length>0?h[h.length-1]:[0,0,0,1]):y=v=h,3===y.length&&(y=[y[0],y[1],y[2],1]),3===v.length&&(v=[v[0],v[1],v[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),b=Array.isArray(m)?m.length>t-1?m[t-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var k=s;if(s+=d(x,_),g){for(r=0;r<2;++r)a.push(x[0],x[1],x[2],_[0],_[1],_[2],k,b,y[0],y[1],y[2],y[3]);u+=2,g=!1}a.push(x[0],x[1],x[2],_[0],_[1],_[2],k,b,y[0],y[1],y[2],y[3],x[0],x[1],x[2],_[0],_[1],_[2],k,-b,y[0],y[1],y[2],y[3],_[0],_[1],_[2],x[0],x[1],x[2],s,-b,v[0],v[1],v[2],v[3],_[0],_[1],_[2],x[0],x[1],x[2],s,b,v[0],v[1],v[2],v[3]),u+=4}}if(this.buffer.update(a),i.push(s),o.push(p[p.length-1].slice()),this.bounds=f,this.vertexCount=u,this.points=o,this.arcLength=i,"dashes"in e){var D=e.dashes.slice();for(D.unshift(0),t=1;t<D.length;++t)D[t]=D[t-1]+D[t];var T=c(new Array(1024),[256,1,4]);for(t=0;t<256;++t){for(r=0;r<4;++r)T.set(t,0,r,0);1&l.le(D,D[D.length-1]*t/255)?T.set(t,0,0,0):T.set(t,0,0,255)}this.texture.setPixels(T)}},v.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},v.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=function(e,t,r,n){return o[0]=0,o[1]=r,o[2]=t,o[3]=e,s[0]}(e.value[0],e.value[1],e.value[2]),r=l.le(this.arcLength,t);if(r<0)return null;if(r===this.arcLength.length-1)return new g(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],a=this.points[Math.min(r+1,this.points.length-1)],i=(t-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),c=1-i,u=[0,0,0],f=0;f<3;++f)u[f]=c*n[f]+i*a[f];var p=Math.min(i<.5?r:r+1,this.points.length-1);return new g(t,u,p,this.points[p])}},{"./lib/shaders":90,"binary-search-bounds":31,"gl-buffer":78,"gl-texture2d":146,"gl-vao":150,ndarray:259}],92:[function(e,t,r){t.exports=function(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],93:[function(e,t,r){t.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],94:[function(e,t,r){t.exports=function(e){var t=e[0],r=e[1],n=e[2],a=e[3],i=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],f=e[10],p=e[11],h=e[12],d=e[13],m=e[14],g=e[15];return(t*o-r*i)*(f*g-p*m)-(t*s-n*i)*(u*g-p*d)+(t*l-a*i)*(u*m-f*d)+(r*s-n*o)*(c*g-p*h)-(r*l-a*o)*(c*m-f*h)+(n*l-a*s)*(c*d-u*h)}},{}],95:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r+r,s=n+n,l=a+a,c=r*o,u=n*o,f=n*s,p=a*o,h=a*s,d=a*l,m=i*o,g=i*s,y=i*l;return e[0]=1-f-d,e[1]=u+y,e[2]=p-g,e[3]=0,e[4]=u-y,e[5]=1-c-d,e[6]=h+m,e[7]=0,e[8]=p+g,e[9]=h-m,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],96:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=n+n,l=a+a,c=i+i,u=n*s,f=n*l,p=n*c,h=a*l,d=a*c,m=i*c,g=o*s,y=o*l,v=o*c;return e[0]=1-(h+m),e[1]=f+v,e[2]=p-y,e[3]=0,e[4]=f-v,e[5]=1-(u+m),e[6]=d+g,e[7]=0,e[8]=p+y,e[9]=d-g,e[10]=1-(u+h),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}},{}],97:[function(e,t,r){t.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],98:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],p=t[10],h=t[11],d=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,b=r*l-a*o,x=r*c-i*o,_=n*l-a*s,w=n*c-i*s,k=a*c-i*l,D=u*m-f*d,T=u*g-p*d,A=u*y-h*d,S=f*g-p*m,M=f*y-h*m,E=p*y-h*g,C=v*E-b*M+x*S+_*A-w*T+k*D;return C?(C=1/C,e[0]=(s*E-l*M+c*S)*C,e[1]=(a*M-n*E-i*S)*C,e[2]=(m*k-g*w+y*_)*C,e[3]=(p*w-f*k-h*_)*C,e[4]=(l*A-o*E-c*T)*C,e[5]=(r*E-a*A+i*T)*C,e[6]=(g*x-d*k-y*b)*C,e[7]=(u*k-p*x+h*b)*C,e[8]=(o*M-s*A+c*D)*C,e[9]=(n*A-r*M-i*D)*C,e[10]=(d*w-m*x+y*v)*C,e[11]=(f*x-u*w-h*v)*C,e[12]=(s*T-o*S-l*D)*C,e[13]=(r*S-n*T+a*D)*C,e[14]=(m*b-d*_-g*v)*C,e[15]=(u*_-f*b+p*v)*C,e):null}},{}],99:[function(e,t,r){var n=e("./identity");t.exports=function(e,t,r,a){var i,o,s,l,c,u,f,p,h,d,m=t[0],g=t[1],y=t[2],v=a[0],b=a[1],x=a[2],_=r[0],w=r[1],k=r[2];return Math.abs(m-_)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-k)<1e-6?n(e):(f=m-_,p=g-w,h=y-k,i=b*(h*=d=1/Math.sqrt(f*f+p*p+h*h))-x*(p*=d),o=x*(f*=d)-v*h,s=v*p-b*f,(d=Math.sqrt(i*i+o*o+s*s))?(i*=d=1/d,o*=d,s*=d):(i=0,o=0,s=0),l=p*s-h*o,c=h*i-f*s,u=f*o-p*i,(d=Math.sqrt(l*l+c*c+u*u))?(l*=d=1/d,c*=d,u*=d):(l=0,c=0,u=0),e[0]=i,e[1]=l,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=p,e[7]=0,e[8]=s,e[9]=u,e[10]=h,e[11]=0,e[12]=-(i*m+o*g+s*y),e[13]=-(l*m+c*g+u*y),e[14]=-(f*m+p*g+h*y),e[15]=1,e)}},{"./identity":97}],100:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],p=t[9],h=t[10],d=t[11],m=t[12],g=t[13],y=t[14],v=t[15],b=r[0],x=r[1],_=r[2],w=r[3];return e[0]=b*n+x*s+_*f+w*m,e[1]=b*a+x*l+_*p+w*g,e[2]=b*i+x*c+_*h+w*y,e[3]=b*o+x*u+_*d+w*v,b=r[4],x=r[5],_=r[6],w=r[7],e[4]=b*n+x*s+_*f+w*m,e[5]=b*a+x*l+_*p+w*g,e[6]=b*i+x*c+_*h+w*y,e[7]=b*o+x*u+_*d+w*v,b=r[8],x=r[9],_=r[10],w=r[11],e[8]=b*n+x*s+_*f+w*m,e[9]=b*a+x*l+_*p+w*g,e[10]=b*i+x*c+_*h+w*y,e[11]=b*o+x*u+_*d+w*v,b=r[12],x=r[13],_=r[14],w=r[15],e[12]=b*n+x*s+_*f+w*m,e[13]=b*a+x*l+_*p+w*g,e[14]=b*i+x*c+_*h+w*y,e[15]=b*o+x*u+_*d+w*v,e}},{}],101:[function(e,t,r){t.exports=function(e,t,r,n,a,i,o){var s=1/(t-r),l=1/(n-a),c=1/(i-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(a+n)*l,e[14]=(o+i)*c,e[15]=1,e}},{}],102:[function(e,t,r){t.exports=function(e,t,r,n,a){var i=1/Math.tan(t/2),o=1/(n-a);return e[0]=i/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(a+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*a*n*o,e[15]=0,e}},{}],103:[function(e,t,r){t.exports=function(e,t,r,n){var a,i,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,k,D,T,A,S,M=n[0],E=n[1],C=n[2],N=Math.sqrt(M*M+E*E+C*C);return Math.abs(N)<1e-6?null:(M*=N=1/N,E*=N,C*=N,a=Math.sin(r),o=1-(i=Math.cos(r)),s=t[0],l=t[1],c=t[2],u=t[3],f=t[4],p=t[5],h=t[6],d=t[7],m=t[8],g=t[9],y=t[10],v=t[11],b=M*M*o+i,x=E*M*o+C*a,_=C*M*o-E*a,w=M*E*o-C*a,k=E*E*o+i,D=C*E*o+M*a,T=M*C*o+E*a,A=E*C*o-M*a,S=C*C*o+i,e[0]=s*b+f*x+m*_,e[1]=l*b+p*x+g*_,e[2]=c*b+h*x+y*_,e[3]=u*b+d*x+v*_,e[4]=s*w+f*k+m*D,e[5]=l*w+p*k+g*D,e[6]=c*w+h*k+y*D,e[7]=u*w+d*k+v*D,e[8]=s*T+f*A+m*S,e[9]=l*T+p*A+g*S,e[10]=c*T+h*A+y*S,e[11]=u*T+d*A+v*S,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}},{}],104:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*a+c*n,e[5]=o*a+u*n,e[6]=s*a+f*n,e[7]=l*a+p*n,e[8]=c*a-i*n,e[9]=u*a-o*n,e[10]=f*a-s*n,e[11]=p*a-l*n,e}},{}],105:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],s=t[2],l=t[3],c=t[8],u=t[9],f=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*a-c*n,e[1]=o*a-u*n,e[2]=s*a-f*n,e[3]=l*a-p*n,e[8]=i*n+c*a,e[9]=o*n+u*a,e[10]=s*n+f*a,e[11]=l*n+p*a,e}},{}],106:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],f=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*a+c*n,e[1]=o*a+u*n,e[2]=s*a+f*n,e[3]=l*a+p*n,e[4]=c*a-i*n,e[5]=u*a-o*n,e[6]=f*a-s*n,e[7]=p*a-l*n,e}},{}],107:[function(e,t,r){t.exports=function(e,t,r){var n=r[0],a=r[1],i=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],108:[function(e,t,r){t.exports=function(e,t,r){var n,a,i,o,s,l,c,u,f,p,h,d,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],p=t[9],h=t[10],d=t[11],e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=f,e[9]=p,e[10]=h,e[11]=d,e[12]=n*m+s*g+f*y+t[12],e[13]=a*m+l*g+p*y+t[13],e[14]=i*m+c*g+h*y+t[14],e[15]=o*m+u*g+d*y+t[15]),e}},{}],109:[function(e,t,r){t.exports=function(e,t){if(e===t){var r=t[1],n=t[2],a=t[3],i=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=i,e[11]=t[14],e[12]=a,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},{}],110:[function(e,t,r){"use strict";var n=e("barycentric"),a=e("polytope-closest-point/lib/closest_point_2d.js");function i(e,t){for(var r=[0,0,0,0],n=0;n<4;++n)for(var a=0;a<4;++a)r[a]+=e[4*n+a]*t[n];return r}function o(e,t,r,n,a){for(var o=i(n,i(r,i(t,[e[0],e[1],e[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*a[0]*(1+o[0]),.5*a[1]*(1-o[1])]}function s(e,t){for(var r=[0,0,0],n=0;n<e.length;++n)for(var a=e[n],i=t[n],o=0;o<3;++o)r[o]+=i*a[o];return r}t.exports=function(e,t,r,i,l,c){if(1===e.length)return[0,e[0].slice()];for(var u=new Array(e.length),f=0;f<e.length;++f)u[f]=o(e[f],r,i,l,c);var p=0,h=1/0;for(f=0;f<u.length;++f){for(var d=0,m=0;m<2;++m)d+=Math.pow(u[f][m]-t[m],2);d<h&&(h=d,p=f)}var g=function(e,t){if(2===e.length){for(var r=0,i=0,o=0;o<2;++o)r+=Math.pow(t[o]-e[0][o],2),i+=Math.pow(t[o]-e[1][o],2);return(r=Math.sqrt(r))+(i=Math.sqrt(i))<1e-6?[1,0]:[i/(r+i),r/(i+r)]}if(3===e.length){var s=[0,0];return a(e[0],e[1],e[2],t,s),n(e,s)}return[]}(u,t),y=0;for(f=0;f<3;++f){if(g[f]<-.001||g[f]>1.0001)return null;y+=g[f]}return Math.abs(y-1)>.001?null:[p,s(e,g),g]}},{barycentric:14,"polytope-closest-point/lib/closest_point_2d.js":270}],111:[function(e,t,r){var n=e("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n           , view\n           , projection\n           , inverseModel;\nuniform vec3 eyePosition\n           , lightPosition;\n\nvarying vec3 f_normal\n           , f_lightDirection\n           , f_eyeDirection\n           , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n  return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n  gl_Position      = project(position);\n\n  //Lighting geometry parameters\n  vec4 cameraCoordinate = view * vec4(position , 1.0);\n  cameraCoordinate.xyz /= cameraCoordinate.w;\n  f_lightDirection = lightPosition - cameraCoordinate.xyz;\n  f_eyeDirection   = eyePosition - cameraCoordinate.xyz;\n  f_normal  = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n  f_color          = color;\n  f_data           = position;\n  f_uv             = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n  float NdotH = max(x, 0.0001);\n  float cos2Alpha = NdotH * NdotH;\n  float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n  float roughness2 = roughness * roughness;\n  float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n  return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n  vec3 lightDirection,\n  vec3 viewDirection,\n  vec3 surfaceNormal,\n  float roughness,\n  float fresnel) {\n\n  float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n  float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n  //Half angle vector\n  vec3 H = normalize(lightDirection + viewDirection);\n\n  //Geometric term\n  float NdotH = max(dot(surfaceNormal, H), 0.0);\n  float VdotH = max(dot(viewDirection, H), 0.000001);\n  float LdotH = max(dot(lightDirection, H), 0.000001);\n  float G1 = (2.0 * NdotH * VdotN) / VdotH;\n  float G2 = (2.0 * NdotH * LdotN) / LdotH;\n  float G = min(1.0, min(G1, G2));\n  \n  //Distribution term\n  float D = beckmannDistribution(NdotH, roughness);\n\n  //Fresnel term\n  float F = pow(1.0 - VdotN, fresnel);\n\n  //Multiply terms and done\n  return  G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n            , fresnel\n            , kambient\n            , kdiffuse\n            , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n           , f_lightDirection\n           , f_eyeDirection\n           , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n  if (f_color.a == 0.0 ||\n    outOfRange(clipBounds[0], clipBounds[1], f_data)\n  ) discard;\n\n  vec3 N = normalize(f_normal);\n  vec3 L = normalize(f_lightDirection);\n  vec3 V = normalize(f_eyeDirection);\n\n  if(gl_FrontFacing) {\n    N = -N;\n  }\n\n  float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n  //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n  float diffuse  = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n  vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n  vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular,  1.0);\n\n  gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n  gl_Position = projection * view * model * vec4(position, 1.0);\n  f_color = color;\n  f_data  = position;\n  f_uv    = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n  gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n    gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n  } else {\n    gl_Position = projection * view * model * vec4(position, 1.0);\n  }\n  gl_PointSize = pointSize;\n  f_color = color;\n  f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n  vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n  if(dot(pointR, pointR) > 0.25) {\n    discard;\n  }\n  gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  gl_Position = projection * view * model * vec4(position, 1.0);\n  f_id        = id;\n  f_position  = position;\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3  clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n  gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3  position;\nattribute float pointSize;\nattribute vec4  id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n    gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n  } else {\n    gl_Position  = projection * view * model * vec4(position, 1.0);\n    gl_PointSize = pointSize;\n  }\n  f_id         = id;\n  f_position   = position;\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n  gl_Position = projection * view * model * vec4(position, 1.0);\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n  gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:p,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:h,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{glslify:231}],112:[function(e,t,r){"use strict";var n=e("gl-shader"),a=e("gl-buffer"),i=e("gl-vao"),o=e("gl-texture2d"),s=e("normals"),l=e("gl-mat4/multiply"),c=e("gl-mat4/invert"),u=e("ndarray"),f=e("colormap"),p=e("simplicial-complex-contour"),h=e("typedarray-pool"),d=e("./lib/shaders"),m=e("./lib/closest-point"),g=d.meshShader,y=d.wireShader,v=d.pointShader,b=d.pickShader,x=d.pointPickShader,_=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function k(e,t,r,n,a,i,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,k,D,T,A,S){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=a,this.pickShader=i,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=p,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=h,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=m,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=k,this.pointSizes=D,this.pointIds=x,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var D=k.prototype;function T(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;r<t.length;++r){if(t.length<2)return 1;if(t[r][0]===e)return t[r][1];if(t[r][0]>e&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}function A(e){var t=n(e,g.vertex,g.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.normal.location=4,t}function S(e){var t=n(e,y.vertex,y.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t}function M(e){var t=n(e,v.vertex,v.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.pointSize.location=4,t}function E(e){var t=n(e,b.vertex,b.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t}function C(e){var t=n(e,x.vertex,x.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t.attributes.pointSize.location=4,t}function N(e){var t=n(e,_.vertex,_.fragment);return t.attributes.position.location=0,t}D.isOpaque=function(){return!this.hasAlpha},D.isTransparent=function(){return this.hasAlpha},D.pickSlots=1,D.setPickBase=function(e){this.pickId=e},D.highlight=function(e){if(e&&this.contourEnable){for(var t=p(this.cells,this.intensity,e.intensity),r=t.cells,n=t.vertexIds,a=t.vertexWeights,i=r.length,o=h.mallocFloat32(6*i),s=0,l=0;l<i;++l)for(var c=r[l],u=0;u<2;++u){var f=c[0];2===c.length&&(f=c[u]);for(var d=n[f][0],m=n[f][1],g=a[f],y=1-g,v=this.positions[d],b=this.positions[m],x=0;x<3;++x)o[s++]=g*v[x]+y*b[x]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),h.free(o)}else this.contourCount=0},D.update=function(e){e=e||{};var t=this.gl;this.dirty=!0,"contourEnable"in e&&(this.contourEnable=e.contourEnable),"contourColor"in e&&(this.contourColor=e.contourColor),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"lightPosition"in e&&(this.lightPosition=e.lightPosition),this.hasAlpha=!1,"opacity"in e&&(this.opacity=e.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in e&&(this.opacityscale=e.opacityscale,this.hasAlpha=!0),"ambient"in e&&(this.ambientLight=e.ambient),"diffuse"in e&&(this.diffuseLight=e.diffuse),"specular"in e&&(this.specularLight=e.specular),"roughness"in e&&(this.roughness=e.roughness),"fresnel"in e&&(this.fresnel=e.fresnel),e.texture?(this.texture.dispose(),this.texture=o(t,e.texture)):e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(function(e,t){for(var r=f({colormap:e,nshades:256,format:"rgba"}),n=new Uint8Array(1024),a=0;a<256;++a){for(var i=r[a],o=0;o<3;++o)n[4*a+o]=i[o];n[4*a+3]=t?255*T(a/255,t):255*i[3]}return u(n,[256,256,4],[4,0,1])}(e.colormap,this.opacityscale)),this.texture.generateMipmap());var r=e.cells,n=e.positions;if(n&&r){var a=[],i=[],l=[],c=[],p=[],h=[],d=[],m=[],g=[],y=[],v=[],b=[],x=[],_=[];this.cells=r,this.positions=n;var w=e.vertexNormals,k=e.cellNormals,D=void 0===e.vertexNormalsEpsilon?1e-6:e.vertexNormalsEpsilon,A=void 0===e.faceNormalsEpsilon?1e-6:e.faceNormalsEpsilon;e.useFacetNormals&&!k&&(k=s.faceNormals(r,n,A)),k||w||(w=s.vertexNormals(r,n,D));var S=e.vertexColors,M=e.cellColors,E=e.meshColor||[1,1,1,1],C=e.vertexUVs,N=e.vertexIntensity,O=e.cellUVs,I=e.cellIntensity,P=1/0,R=-1/0;if(!C&&!O)if(N)if(e.vertexIntensityBounds)P=+e.vertexIntensityBounds[0],R=+e.vertexIntensityBounds[1];else for(var L=0;L<N.length;++L){var F=N[L];P=Math.min(P,F),R=Math.max(R,F)}else if(I)if(e.cellIntensityBounds)P=+e.cellIntensityBounds[0],R=+e.cellIntensityBounds[1];else for(L=0;L<I.length;++L)F=I[L],P=Math.min(P,F),R=Math.max(R,F);else for(L=0;L<n.length;++L)F=n[L][2],P=Math.min(P,F),R=Math.max(R,F);this.intensity=N||I||function(e){for(var t=e.length,r=new Array(t),n=0;n<t;++n)r[n]=e[n][2];return r}(n),this.pickVertex=!(I||M);var B=e.pointSizes,z=e.pointSize||1;for(this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],L=0;L<n.length;++L)for(var j=n[L],U=0;U<3;++U)!isNaN(j[U])&&isFinite(j[U])&&(this.bounds[0][U]=Math.min(this.bounds[0][U],j[U]),this.bounds[1][U]=Math.max(this.bounds[1][U],j[U]));var $=0,V=0,q=0;e:for(L=0;L<r.length;++L){var W=r[L];switch(W.length){case 1:for(j=n[G=W[0]],U=0;U<3;++U)if(isNaN(j[U])||!isFinite(j[U]))continue e;y.push(j[0],j[1],j[2]),X=S?S[G]:M?M[L]:E,this.opacityscale&&N?i.push(X[0],X[1],X[2],this.opacity*T((N[G]-P)/(R-P),this.opacityscale)):3===X.length?v.push(X[0],X[1],X[2],this.opacity):(v.push(X[0],X[1],X[2],X[3]*this.opacity),X[3]<1&&(this.hasAlpha=!0)),Y=C?C[G]:N?[(N[G]-P)/(R-P),0]:O?O[L]:I?[(I[L]-P)/(R-P),0]:[(j[2]-P)/(R-P),0],b.push(Y[0],Y[1]),B?x.push(B[G]):x.push(z),_.push(L),q+=1;break;case 2:for(U=0;U<2;++U){j=n[G=W[U]];for(var H=0;H<3;++H)if(isNaN(j[H])||!isFinite(j[H]))continue e}for(U=0;U<2;++U)j=n[G=W[U]],h.push(j[0],j[1],j[2]),X=S?S[G]:M?M[L]:E,this.opacityscale&&N?i.push(X[0],X[1],X[2],this.opacity*T((N[G]-P)/(R-P),this.opacityscale)):3===X.length?d.push(X[0],X[1],X[2],this.opacity):(d.push(X[0],X[1],X[2],X[3]*this.opacity),X[3]<1&&(this.hasAlpha=!0)),Y=C?C[G]:N?[(N[G]-P)/(R-P),0]:O?O[L]:I?[(I[L]-P)/(R-P),0]:[(j[2]-P)/(R-P),0],m.push(Y[0],Y[1]),g.push(L);V+=1;break;case 3:for(U=0;U<3;++U)for(j=n[G=W[U]],H=0;H<3;++H)if(isNaN(j[H])||!isFinite(j[H]))continue e;for(U=0;U<3;++U){var G,X,Y,Z;j=n[G=W[2-U]],a.push(j[0],j[1],j[2]),(X=S?S[G]:M?M[L]:E)?this.opacityscale&&N?i.push(X[0],X[1],X[2],this.opacity*T((N[G]-P)/(R-P),this.opacityscale)):3===X.length?i.push(X[0],X[1],X[2],this.opacity):(i.push(X[0],X[1],X[2],X[3]*this.opacity),X[3]<1&&(this.hasAlpha=!0)):i.push(.5,.5,.5,1),Y=C?C[G]:N?[(N[G]-P)/(R-P),0]:O?O[L]:I?[(I[L]-P)/(R-P),0]:[(j[2]-P)/(R-P),0],c.push(Y[0],Y[1]),Z=w?w[G]:k[L],l.push(Z[0],Z[1],Z[2]),p.push(L)}$+=1}}this.pointCount=q,this.edgeCount=V,this.triangleCount=$,this.pointPositions.update(y),this.pointColors.update(v),this.pointUVs.update(b),this.pointSizes.update(x),this.pointIds.update(new Uint32Array(_)),this.edgePositions.update(h),this.edgeColors.update(d),this.edgeUVs.update(m),this.edgeIds.update(new Uint32Array(g)),this.trianglePositions.update(a),this.triangleColors.update(i),this.triangleUVs.update(c),this.triangleNormals.update(l),this.triangleIds.update(new Uint32Array(p))}},D.drawTransparent=D.draw=function(e){e=e||{};for(var t=this.gl,r=e.model||w,n=e.view||w,a=e.projection||w,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:a,inverseModel:w.slice(),clipBounds:i,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],contourColor:this.contourColor,texture:0};s.inverseModel=c(s.inverseModel,s.model),t.disable(t.CULL_FACE),this.texture.bind(0);var u=new Array(16);for(l(u,s.view,s.model),l(u,s.projection,u),c(u,u),o=0;o<3;++o)s.eyePosition[o]=u[12+o]/u[15];var f,p=u[15];for(o=0;o<3;++o)p+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var h=u[12+o],d=0;d<3;++d)h+=u[4*d+o]*this.lightPosition[d];s.lightPosition[o]=h/p}this.triangleCount>0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),t.drawArrays(t.LINES,0,this.contourCount),this.contourVAO.unbind())},D.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||w,n=e.view||w,a=e.projection||w,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s,l={model:r,view:n,projection:a,clipBounds:i,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind())},D.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;for(var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions,a=new Array(r.length),i=0;i<r.length;++i)a[i]=n[r[i]];var o=e.coord[0],s=e.coord[1];if(!this.pickVertex){var l=this.positions[r[0]],c=this.positions[r[1]],u=this.positions[r[2]],f=[(l[0]+c[0]+u[0])/3,(l[1]+c[1]+u[1])/3,(l[2]+c[2]+u[2])/3];return{_cellCenter:!0,position:[o,s],index:t,cell:r,cellId:t,intensity:this.intensity[t],dataCoordinate:f}}var p=m(a,[o*this.pixelRatio,this._resolution[1]-s*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!p)return null;var h=p[2],d=0;for(i=0;i<r.length;++i)d+=h[i]*this.intensity[r[i]];return{position:p[1],index:r[p[0]],cell:r,cellId:t,intensity:d,dataCoordinate:this.positions[r[p[0]]]}},D.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},t.exports=function(e,t){if(1===arguments.length&&(e=(t=e).gl),!(e.getExtension("OES_standard_derivatives")||e.getExtension("MOZ_OES_standard_derivatives")||e.getExtension("WEBKIT_OES_standard_derivatives")))throw new Error("derivatives not supported");var r=A(e),n=S(e),s=M(e),l=E(e),c=C(e),f=N(e),p=o(e,u(new Uint8Array([255,255,255,255]),[1,1,4]));p.generateMipmap(),p.minFilter=e.LINEAR_MIPMAP_LINEAR,p.magFilter=e.LINEAR;var h=a(e),d=a(e),m=a(e),g=a(e),y=a(e),v=i(e,[{buffer:h,type:e.FLOAT,size:3},{buffer:y,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:d,type:e.FLOAT,size:4},{buffer:m,type:e.FLOAT,size:2},{buffer:g,type:e.FLOAT,size:3}]),b=a(e),x=a(e),_=a(e),w=a(e),D=i(e,[{buffer:b,type:e.FLOAT,size:3},{buffer:w,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:x,type:e.FLOAT,size:4},{buffer:_,type:e.FLOAT,size:2}]),T=a(e),O=a(e),I=a(e),P=a(e),R=a(e),L=i(e,[{buffer:T,type:e.FLOAT,size:3},{buffer:R,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:O,type:e.FLOAT,size:4},{buffer:I,type:e.FLOAT,size:2},{buffer:P,type:e.FLOAT,size:1}]),F=a(e),B=new k(e,p,r,n,s,l,c,f,h,y,d,m,g,v,b,w,x,_,D,T,R,O,I,P,L,F,i(e,[{buffer:F,type:e.FLOAT,size:3}]));return B.update(t),B}},{"./lib/closest-point":110,"./lib/shaders":111,colormap:53,"gl-buffer":78,"gl-mat4/invert":98,"gl-mat4/multiply":100,"gl-shader":132,"gl-texture2d":146,"gl-vao":150,ndarray:259,normals:261,"simplicial-complex-contour":291,"typedarray-pool":308}],113:[function(e,t,r){"use strict";t.exports=function(e){var t=e.gl;return new o(e,n(t,[0,0,0,1,1,0,1,1]),a(t,i.boxVert,i.lineFrag))};var n=e("gl-buffer"),a=e("gl-shader"),i=e("./shaders");function o(e,t,r){this.plot=e,this.vbo=t,this.shader=r}var s,l,c=o.prototype;c.bind=function(){var e=this.shader;this.vbo.bind(),this.shader.bind(),e.attributes.coord.pointer(),e.uniforms.screenBox=this.plot.screenBox},c.drawBox=(s=[0,0],l=[0,0],function(e,t,r,n,a){var i=this.plot,o=this.shader,c=i.gl;s[0]=e,s[1]=t,l[0]=r,l[1]=n,o.uniforms.lo=s,o.uniforms.hi=l,o.uniforms.color=a,c.drawArrays(c.TRIANGLE_STRIP,0,4)}),c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":116,"gl-buffer":78,"gl-shader":132}],114:[function(e,t,r){"use strict";t.exports=function(e){var t=e.gl;return new s(e,n(t),a(t,o.gridVert,o.gridFrag),a(t,o.tickVert,o.gridFrag))};var n=e("gl-buffer"),a=e("gl-shader"),i=e("binary-search-bounds"),o=e("./shaders");function s(e,t,r,n){this.plot=e,this.vbo=t,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function l(e,t){return e-t}var c,u,f,p,h,d=s.prototype;d.draw=(c=[0,0],u=[0,0],f=[0,0],function(){for(var e=this.plot,t=this.vbo,r=this.shader,n=this.ticks,a=e.gl,i=e._tickBounds,o=e.dataBox,s=e.viewBox,l=e.gridLineWidth,p=e.gridLineColor,h=e.gridLineEnable,d=e.pixelRatio,m=0;m<2;++m){var g=i[m],y=i[m+2]-g,v=.5*(o[m+2]+o[m]),b=o[m+2]-o[m];u[m]=2*y/b,c[m]=2*(g-v)/b}r.bind(),t.bind(),r.attributes.dataCoord.pointer(),r.uniforms.dataShift=c,r.uniforms.dataScale=u;var x=0;for(m=0;m<2;++m){f[0]=f[1]=0,f[m]=1,r.uniforms.dataAxis=f,r.uniforms.lineWidth=l[m]/(s[m+2]-s[m])*d,r.uniforms.color=p[m];var _=6*n[m].length;h[m]&&_&&a.drawArrays(a.TRIANGLES,x,_),x+=_}}),d.drawTickMarks=function(){var e=[0,0],t=[0,0],r=[1,0],n=[0,1],a=[0,0],o=[0,0];return function(){for(var s=this.plot,c=this.vbo,u=this.tickShader,f=this.ticks,p=s.gl,h=s._tickBounds,d=s.dataBox,m=s.viewBox,g=s.pixelRatio,y=s.screenBox,v=y[2]-y[0],b=y[3]-y[1],x=m[2]-m[0],_=m[3]-m[1],w=0;w<2;++w){var k=h[w],D=h[w+2]-k,T=.5*(d[w+2]+d[w]),A=d[w+2]-d[w];t[w]=2*D/A,e[w]=2*(k-T)/A}t[0]*=x/v,e[0]*=x/v,t[1]*=_/b,e[1]*=_/b,u.bind(),c.bind(),u.attributes.dataCoord.pointer();var S=u.uniforms;S.dataShift=e,S.dataScale=t;var M=s.tickMarkLength,E=s.tickMarkWidth,C=s.tickMarkColor,N=6*f[0].length,O=Math.min(i.ge(f[0],(d[0]-h[0])/(h[2]-h[0]),l),f[0].length),I=Math.min(i.gt(f[0],(d[2]-h[0])/(h[2]-h[0]),l),f[0].length),P=0+6*O,R=6*Math.max(0,I-O),L=Math.min(i.ge(f[1],(d[1]-h[1])/(h[3]-h[1]),l),f[1].length),F=Math.min(i.gt(f[1],(d[3]-h[1])/(h[3]-h[1]),l),f[1].length),B=N+6*L,z=6*Math.max(0,F-L);a[0]=2*(m[0]-M[1])/v-1,a[1]=(m[3]+m[1])/b-1,o[0]=M[1]*g/v,o[1]=E[1]*g/b,z&&(S.color=C[1],S.tickScale=o,S.dataAxis=n,S.screenOffset=a,p.drawArrays(p.TRIANGLES,B,z)),a[0]=(m[2]+m[0])/v-1,a[1]=2*(m[1]-M[0])/b-1,o[0]=E[0]*g/v,o[1]=M[0]*g/b,R&&(S.color=C[0],S.tickScale=o,S.dataAxis=r,S.screenOffset=a,p.drawArrays(p.TRIANGLES,P,R)),a[0]=2*(m[2]+M[3])/v-1,a[1]=(m[3]+m[1])/b-1,o[0]=M[3]*g/v,o[1]=E[3]*g/b,z&&(S.color=C[3],S.tickScale=o,S.dataAxis=n,S.screenOffset=a,p.drawArrays(p.TRIANGLES,B,z)),a[0]=(m[2]+m[0])/v-1,a[1]=2*(m[3]+M[2])/b-1,o[0]=E[2]*g/v,o[1]=M[2]*g/b,R&&(S.color=C[2],S.tickScale=o,S.dataAxis=r,S.screenOffset=a,p.drawArrays(p.TRIANGLES,P,R))}}(),d.update=(p=[1,1,-1,-1,1,-1],h=[1,-1,1,1,-1,-1],function(e){for(var t=e.ticks,r=e.bounds,n=new Float32Array(18*(t[0].length+t[1].length)),a=(this.plot.zeroLineEnable,0),i=[[],[]],o=0;o<2;++o)for(var s=i[o],l=t[o],c=r[o],u=r[o+2],f=0;f<l.length;++f){var d=(l[f].x-c)/(u-c);s.push(d);for(var m=0;m<6;++m)n[a++]=d,n[a++]=p[m],n[a++]=h[m]}this.ticks=i,this.vbo.update(n)}),d.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{"./shaders":116,"binary-search-bounds":31,"gl-buffer":78,"gl-shader":132}],115:[function(e,t,r){"use strict";t.exports=function(e){var t=e.gl;return new o(e,n(t,[-1,-1,-1,1,1,-1,1,1]),a(t,i.lineVert,i.lineFrag))};var n=e("gl-buffer"),a=e("gl-shader"),i=e("./shaders");function o(e,t,r){this.plot=e,this.vbo=t,this.shader=r}var s,l,c=o.prototype;c.bind=function(){var e=this.shader;this.vbo.bind(),this.shader.bind(),e.attributes.coord.pointer(),e.uniforms.screenBox=this.plot.screenBox},c.drawLine=(s=[0,0],l=[0,0],function(e,t,r,n,a,i){var o=this.plot,c=this.shader,u=o.gl;s[0]=e,s[1]=t,l[0]=r,l[1]=n,c.uniforms.start=s,c.uniforms.end=l,c.uniforms.width=a*o.pixelRatio,c.uniforms.color=i,u.drawArrays(u.TRIANGLE_STRIP,0,4)}),c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":116,"gl-buffer":78,"gl-shader":132}],116:[function(e,t,r){"use strict";var n=e("glslify"),a=n(["precision lowp float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n  gl_FragColor = vec4(color.xyz * color.w, color.w);\n}\n"]);t.exports={lineVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 start, end;\nuniform float width;\n\nvec2 perp(vec2 v) {\n  return vec2(v.y, -v.x);\n}\n\nvec2 screen(vec2 v) {\n  return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n  vec2 delta = normalize(perp(start - end));\n  vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\n  gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\n}\n"]),lineFrag:a,textVert:n(["#define GLSLIFY 1\nattribute vec3 textCoordinate;\n\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\nuniform float angle;\n\nvoid main() {\n  float dataOffset  = textCoordinate.z;\n  vec2 glyphOffset  = textCoordinate.xy;\n  mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n  vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\n    glyphMatrix * glyphOffset * textScale + screenOffset;\n  gl_Position = vec4(screenCoordinate, 0, 1);\n}\n"]),textFrag:a,gridVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale;\nuniform float lineWidth;\n\nvoid main() {\n  vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n  pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\n  gl_Position = vec4(pos, 0, 1);\n}\n"]),gridFrag:a,boxVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 lo, hi;\n\nvec2 screen(vec2 v) {\n  return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n  gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\n}\n"]),tickVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\n\nvoid main() {\n  vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n  gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\n}\n"])}},{glslify:231}],117:[function(e,t,r){"use strict";t.exports=function(e){var t=e.gl;return new l(e,n(t),a(t,s.textVert,s.textFrag))};var n=e("gl-buffer"),a=e("gl-shader"),i=e("text-cache"),o=e("binary-search-bounds"),s=e("./shaders");function l(e,t,r){this.plot=e,this.vbo=t,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}var c,u,f,p,h,d,m=l.prototype;m.drawTicks=(c=[0,0],u=[0,0],f=[0,0],function(e){var t=this.plot,r=this.shader,n=this.tickX[e],a=this.tickOffset[e],i=t.gl,s=t.viewBox,l=t.dataBox,p=t.screenBox,h=t.pixelRatio,d=t.tickEnable,m=t.tickPad,g=t.tickColor,y=t.tickAngle,v=t.labelEnable,b=t.labelPad,x=t.labelColor,_=t.labelAngle,w=this.labelOffset[e],k=this.labelCount[e],D=o.lt(n,l[e]),T=o.le(n,l[e+2]);c[0]=c[1]=0,c[e]=1,u[e]=(s[2+e]+s[e])/(p[2+e]-p[e])-1;var A=2/p[2+(1^e)]-p[1^e];u[1^e]=A*s[1^e]-1,d[e]&&(u[1^e]-=A*h*m[e],D<T&&a[T]>a[D]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[e],r.uniforms.angle=y[e],i.drawArrays(i.TRIANGLES,a[D],a[T]-a[D]))),v[e]&&k&&(u[1^e]-=A*h*b[e],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=x[e],r.uniforms.angle=_[e],i.drawArrays(i.TRIANGLES,w,k)),u[1^e]=A*s[2+(1^e)]-1,d[e+2]&&(u[1^e]+=A*h*m[e+2],D<T&&a[T]>a[D]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[e+2],r.uniforms.angle=y[e+2],i.drawArrays(i.TRIANGLES,a[D],a[T]-a[D]))),v[e+2]&&k&&(u[1^e]+=A*h*b[e+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=x[e+2],r.uniforms.angle=_[e+2],i.drawArrays(i.TRIANGLES,w,k))}),m.drawTitle=function(){var e=[0,0],t=[0,0];return function(){var r=this.plot,n=this.shader,a=r.gl,i=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)t[u]=2*(o[u]*c-i[u])/(i[2+u]-i[u])-1;n.bind(),n.uniforms.dataAxis=e,n.uniforms.screenOffset=t,n.uniforms.angle=s,n.uniforms.color=l,a.drawArrays(a.TRIANGLES,this.titleOffset,this.titleCount)}}}(),m.bind=(p=[0,0],h=[0,0],d=[0,0],function(){var e=this.plot,t=this.shader,r=e._tickBounds,n=e.dataBox,a=e.screenBox,i=e.viewBox;t.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],f=i[o],m=i[o+2]-f,g=a[o],y=a[o+2]-g;h[o]=2*l/u*m/y,p[o]=2*(s-c)/u*m/y}d[1]=2*e.pixelRatio/(a[3]-a[1]),d[0]=d[1]*(a[3]-a[1])/(a[2]-a[0]),t.uniforms.dataScale=h,t.uniforms.dataShift=p,t.uniforms.textScale=d,this.vbo.bind(),t.attributes.textCoordinate.pointer()}),m.update=function(e){var t,r,n,a,o,s=[],l=e.ticks,c=e.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],f=[-1/0],p=l[o];for(t=0;t<p.length;++t){var h=p[t],d=h.x,m=h.text,g=h.font||"sans-serif";a=h.fontSize||12;for(var y=1/(c[o+2]-c[o]),v=c[o],b=m.split("\n"),x=0;x<b.length;x++)for(n=i(g,b[x]).data,r=0;r<n.length;r+=2)s.push(n[r]*a,-n[r+1]*a-x*a*1.2,(d-v)*y);u.push(Math.floor(s.length/3)),f.push(d)}this.tickOffset[o]=u,this.tickX[o]=f}for(o=0;o<2;++o){for(this.labelOffset[o]=Math.floor(s.length/3),n=i(e.labelFont[o],e.labels[o],{textAlign:"center"}).data,a=e.labelSize[o],t=0;t<n.length;t+=2)s.push(n[t]*a,-n[t+1]*a,0);this.labelCount[o]=Math.floor(s.length/3)-this.labelOffset[o]}for(this.titleOffset=Math.floor(s.length/3),n=i(e.titleFont,e.title).data,a=e.titleSize,t=0;t<n.length;t+=2)s.push(n[t]*a,-n[t+1]*a,0);this.titleCount=Math.floor(s.length/3)-this.titleOffset,this.vbo.update(s)},m.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":116,"binary-search-bounds":31,"gl-buffer":78,"gl-shader":132,"text-cache":303}],118:[function(e,t,r){"use strict";t.exports=function(e){var t=e.gl,r=new l(t,n(t,[t.drawingBufferWidth,t.drawingBufferHeight]));return r.grid=a(r),r.text=i(r),r.line=o(r),r.box=s(r),r.update(e),r};var n=e("gl-select-static"),a=e("./lib/grid"),i=e("./lib/text"),o=e("./lib/line"),s=e("./lib/box");function l(e,t){this.gl=e,this.pickBuffer=t,this.screenBox=[0,0,e.drawingBufferWidth,e.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-1/0,-1/0],this.static=!1,this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}var c=l.prototype;function u(e){for(var t=e.slice(),r=0;r<t.length;++r)t[r]=t[r].slice();return t}function f(e,t){return e.x-t.x}c.setDirty=function(){this.dirty=this.pickDirty=!0},c.setOverlayDirty=function(){this.dirty=!0},c.nextDepthValue=function(){return this._depthCounter++/65536},c.draw=function(){var e=this.gl,t=this.screenBox,r=this.viewBox,n=this.dataBox,a=this.pixelRatio,i=this.grid,o=this.line,s=this.text,l=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),this.dirty){if(this.dirty=!1,e.bindFramebuffer(e.FRAMEBUFFER,null),e.enable(e.SCISSOR_TEST),e.disable(e.DEPTH_TEST),e.depthFunc(e.LESS),e.depthMask(!1),e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD,e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),this.borderColor){e.scissor(t[0],t[1],t[2]-t[0],t[3]-t[1]);var c=this.borderColor;e.clearColor(c[0]*c[3],c[1]*c[3],c[2]*c[3],c[3]),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}e.scissor(r[0],r[1],r[2]-r[0],r[3]-r[1]),e.viewport(r[0],r[1],r[2]-r[0],r[3]-r[1]);var u=this.backgroundColor;e.clearColor(u[0]*u[3],u[1]*u[3],u[2]*u[3],u[3]),e.clear(e.COLOR_BUFFER_BIT),i.draw();var f=this.zeroLineEnable,p=this.zeroLineColor,h=this.zeroLineWidth;if(f[0]||f[1]){o.bind();for(var d=0;d<2;++d)if(f[d]&&n[d]<=0&&n[d+2]>=0){var m=t[d]-n[d]*(t[d+2]-t[d])/(n[d+2]-n[d]);0===d?o.drawLine(m,t[1],m,t[3],h[d],p[d]):o.drawLine(t[0],m,t[2],m,h[d],p[d])}}for(d=0;d<l.length;++d)l[d].draw();e.viewport(t[0],t[1],t[2]-t[0],t[3]-t[1]),e.scissor(t[0],t[1],t[2]-t[0],t[3]-t[1]),this.grid.drawTickMarks(),o.bind();var g=this.borderLineEnable,y=this.borderLineWidth,v=this.borderLineColor;for(g[1]&&o.drawLine(r[0],r[1]-.5*y[1]*a,r[0],r[3]+.5*y[3]*a,y[1],v[1]),g[0]&&o.drawLine(r[0]-.5*y[0]*a,r[1],r[2]+.5*y[2]*a,r[1],y[0],v[0]),g[3]&&o.drawLine(r[2],r[1]-.5*y[1]*a,r[2],r[3]+.5*y[3]*a,y[3],v[3]),g[2]&&o.drawLine(r[0]-.5*y[0]*a,r[3],r[2]+.5*y[2]*a,r[3],y[2],v[2]),s.bind(),d=0;d<2;++d)s.drawTicks(d);this.titleEnable&&s.drawTitle();var b=this.overlays;for(d=0;d<b.length;++d)b[d].draw();e.disable(e.SCISSOR_TEST),e.disable(e.BLEND),e.depthMask(!0)}},c.drawPick=function(){if(!this.static){var e=this.pickBuffer;this.gl,this._pickTimeout=null,e.begin();for(var t=1,r=this.objects,n=0;n<r.length;++n)t=r[n].drawPick(t);e.end()}},c.pick=function(e,t){if(!this.static){var r=this.pixelRatio,n=this.pickPixelRatio,a=this.viewBox,i=0|Math.round((e-a[0]/r)*n),o=0|Math.round((t-a[1]/r)*n),s=this.pickBuffer.query(i,o,this.pickRadius);if(!s)return null;for(var l=s.id+(s.value[0]<<8)+(s.value[1]<<16)+(s.value[2]<<24),c=this.objects,u=0;u<c.length;++u){var f=c[u].pick(i,o,l);if(f)return f}return null}},c.setScreenBox=function(e){var t=this.screenBox,r=this.pixelRatio;t[0]=0|Math.round(e[0]*r),t[1]=0|Math.round(e[1]*r),t[2]=0|Math.round(e[2]*r),t[3]=0|Math.round(e[3]*r),this.setDirty()},c.setDataBox=function(e){var t=this.dataBox;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3])&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this.setDirty())},c.setViewBox=function(e){var t=this.pixelRatio,r=this.viewBox;r[0]=0|Math.round(e[0]*t),r[1]=0|Math.round(e[1]*t),r[2]=0|Math.round(e[2]*t),r[3]=0|Math.round(e[3]*t);var n=this.pickPixelRatio;this.pickBuffer.shape=[0|Math.round((e[2]-e[0])*n),0|Math.round((e[3]-e[1])*n)],this.setDirty()},c.update=function(e){e=e||{};var t=this.gl;this.pixelRatio=e.pixelRatio||1;var r=this.pixelRatio;this.pickPixelRatio=Math.max(r,1),this.setScreenBox(e.screenBox||[0,0,t.drawingBufferWidth/r,t.drawingBufferHeight/r]),this.screenBox,this.setViewBox(e.viewBox||[.125*(this.screenBox[2]-this.screenBox[0])/r,.125*(this.screenBox[3]-this.screenBox[1])/r,.875*(this.screenBox[2]-this.screenBox[0])/r,.875*(this.screenBox[3]-this.screenBox[1])/r]);var n=this.viewBox,a=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(e.dataBox||[-10,-10/a,10,10/a]),this.borderColor=!1!==e.borderColor&&(e.borderColor||[0,0,0,0]).slice(),this.backgroundColor=(e.backgroundColor||[0,0,0,0]).slice(),this.gridLineEnable=(e.gridLineEnable||[!0,!0]).slice(),this.gridLineWidth=(e.gridLineWidth||[1,1]).slice(),this.gridLineColor=u(e.gridLineColor||[[.5,.5,.5,1],[.5,.5,.5,1]]),this.zeroLineEnable=(e.zeroLineEnable||[!0,!0]).slice(),this.zeroLineWidth=(e.zeroLineWidth||[4,4]).slice(),this.zeroLineColor=u(e.zeroLineColor||[[0,0,0,1],[0,0,0,1]]),this.tickMarkLength=(e.tickMarkLength||[0,0,0,0]).slice(),this.tickMarkWidth=(e.tickMarkWidth||[0,0,0,0]).slice(),this.tickMarkColor=u(e.tickMarkColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.titleCenter=(e.titleCenter||[.5*(n[0]+n[2])/r,(n[3]+120)/r]).slice(),this.titleEnable=!("titleEnable"in e)||!!e.titleEnable,this.titleAngle=e.titleAngle||0,this.titleColor=(e.titleColor||[0,0,0,1]).slice(),this.labelPad=(e.labelPad||[15,15,15,15]).slice(),this.labelAngle=(e.labelAngle||[0,Math.PI/2,0,3*Math.PI/2]).slice(),this.labelEnable=(e.labelEnable||[!0,!0,!0,!0]).slice(),this.labelColor=u(e.labelColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.tickPad=(e.tickPad||[15,15,15,15]).slice(),this.tickAngle=(e.tickAngle||[0,0,0,0]).slice(),this.tickEnable=(e.tickEnable||[!0,!0,!0,!0]).slice(),this.tickColor=u(e.tickColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.borderLineEnable=(e.borderLineEnable||[!0,!0,!0,!0]).slice(),this.borderLineWidth=(e.borderLineWidth||[2,2,2,2]).slice(),this.borderLineColor=u(e.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var i=e.ticks||[[],[]],o=this._tickBounds;o[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(var s=0;s<2;++s){var l=i[s].slice(0);0!==l.length&&(l.sort(f),o[s]=Math.min(o[s],l[0].x),o[s+2]=Math.max(o[s+2],l[l.length-1].x))}this.grid.update({bounds:o,ticks:i}),this.text.update({bounds:o,ticks:i,labels:e.labels||["x","y"],labelSize:e.labelSize||[12,12],labelFont:e.labelFont||["sans-serif","sans-serif"],title:e.title||"",titleSize:e.titleSize||18,titleFont:e.titleFont||"sans-serif"}),this.static=!!e.static,this.setDirty()},c.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var e=this.objects.length-1;e>=0;--e)this.objects[e].dispose();for(this.objects.length=0,e=this.overlays.length-1;e>=0;--e)this.overlays[e].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(e){this.objects.indexOf(e)<0&&(this.objects.push(e),this.setDirty())},c.removeObject=function(e){for(var t=this.objects,r=0;r<t.length;++r)if(t[r]===e){t.splice(r,1),this.setDirty();break}},c.addOverlay=function(e){this.overlays.indexOf(e)<0&&(this.overlays.push(e),this.setOverlayDirty())},c.removeOverlay=function(e){for(var t=this.overlays,r=0;r<t.length;++r)if(t[r]===e){t.splice(r,1),this.setOverlayDirty();break}}},{"./lib/box":113,"./lib/grid":114,"./lib/line":115,"./lib/text":117,"gl-select-static":131}],119:[function(e,t,r){"use strict";t.exports=function(e,t){e=e||document.body;var r=[.01,1/0];"distanceLimits"in(t=t||{})&&(r[0]=t.distanceLimits[0],r[1]=t.distanceLimits[1]),"zoomMin"in t&&(r[0]=t.zoomMin),"zoomMax"in t&&(r[1]=t.zoomMax);var c=a({center:t.center||[0,0,0],up:t.up||[0,1,0],eye:t.eye||[0,0,10],mode:t.mode||"orbit",distanceLimits:r}),u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,p=e.clientWidth,h=e.clientHeight,d={keyBindingMode:"rotate",enableWheel:!0,view:c,element:e,delay:t.delay||16,rotateSpeed:t.rotateSpeed||1,zoomSpeed:t.zoomSpeed||1,translateSpeed:t.translateSpeed||1,flipX:!!t.flipX,flipY:!!t.flipY,modes:c.modes,_ortho:t._ortho||t.projection&&"orthographic"===t.projection.type||!1,tick:function(){var t=n(),r=this.delay,a=t-2*r;c.idle(t-r),c.recalcMatrix(a),c.flush(t-(100+2*r));for(var i=!0,o=c.computedMatrix,s=0;s<16;++s)i=i&&u[s]===o[s],u[s]=o[s];var l=e.clientWidth===p&&e.clientHeight===h;return p=e.clientWidth,h=e.clientHeight,i?!l:(f=Math.exp(c.computedRadius[0]),!0)},lookAt:function(e,t,r){c.lookAt(c.lastT(),e,t,r)},rotate:function(e,t,r){c.rotate(c.lastT(),e,t,r)},pan:function(e,t,r){c.pan(c.lastT(),e,t,r)},translate:function(e,t,r){c.translate(c.lastT(),e,t,r)}};return Object.defineProperties(d,{matrix:{get:function(){return c.computedMatrix},set:function(e){return c.setMatrix(c.lastT(),e),c.computedMatrix},enumerable:!0},mode:{get:function(){return c.getMode()},set:function(e){var t=c.computedUp.slice(),r=c.computedEye.slice(),a=c.computedCenter.slice();if(c.setMode(e),"turntable"===e){var i=n();c._active.lookAt(i,r,a,t),c._active.lookAt(i+500,r,a,[0,0,1]),c._active.flush(i)}return c.getMode()},enumerable:!0},center:{get:function(){return c.computedCenter},set:function(e){return c.lookAt(c.lastT(),null,e),c.computedCenter},enumerable:!0},eye:{get:function(){return c.computedEye},set:function(e){return c.lookAt(c.lastT(),e),c.computedEye},enumerable:!0},up:{get:function(){return c.computedUp},set:function(e){return c.lookAt(c.lastT(),null,null,e),c.computedUp},enumerable:!0},distance:{get:function(){return f},set:function(e){return c.setDistance(c.lastT(),e),e},enumerable:!0},distanceLimits:{get:function(){return c.getDistanceLimits(r)},set:function(e){return c.setDistanceLimits(e),e},enumerable:!0}}),e.addEventListener("contextmenu",(function(e){return e.preventDefault(),!1})),d._lastX=-1,d._lastY=-1,d._lastMods={shift:!1,control:!1,alt:!1,meta:!1},d.enableMouseListeners=function(){function t(t,r,a,i){var o=d.keyBindingMode;if(!1!==o){var s="rotate"===o,l="pan"===o,u="zoom"===o,p=!!i.control,h=!!i.alt,m=!!i.shift,g=!!(1&t),y=!!(2&t),v=!!(4&t),b=1/e.clientHeight,x=b*(r-d._lastX),_=b*(a-d._lastY),w=d.flipX?1:-1,k=d.flipY?1:-1,D=Math.PI*d.rotateSpeed,T=n();if(-1!==d._lastX&&-1!==d._lastY&&((s&&g&&!p&&!h&&!m||g&&!p&&!h&&m)&&c.rotate(T,w*D*x,-k*D*_,0),(l&&g&&!p&&!h&&!m||y||g&&p&&!h&&!m)&&c.pan(T,-d.translateSpeed*x*f,d.translateSpeed*_*f,0),u&&g&&!p&&!h&&!m||v||g&&!p&&h&&!m)){var A=-d.zoomSpeed*_/window.innerHeight*(T-c.lastT())*100;c.pan(T,0,0,f*(Math.exp(A)-1))}return d._lastX=r,d._lastY=a,d._lastMods=i,!0}}d.mouseListener=i(e,t),e.addEventListener("touchstart",(function(r){var n=s(r.changedTouches[0],e);t(0,n[0],n[1],d._lastMods),t(1,n[0],n[1],d._lastMods)}),!!l&&{passive:!0}),e.addEventListener("touchmove",(function(r){var n=s(r.changedTouches[0],e);t(1,n[0],n[1],d._lastMods),r.preventDefault()}),!!l&&{passive:!1}),e.addEventListener("touchend",(function(e){t(0,d._lastX,d._lastY,d._lastMods)}),!!l&&{passive:!0}),d.wheelListener=o(e,(function(e,t){if(!1!==d.keyBindingMode&&d.enableWheel){var r=d.flipX?1:-1,a=d.flipY?1:-1,i=n();if(Math.abs(e)>Math.abs(t))c.rotate(i,0,0,-e*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*a*t/window.innerHeight*(i-c.lastT())/20;c.pan(i,0,0,f*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=e("right-now"),a=e("3d-view"),i=e("mouse-change"),o=e("mouse-wheel"),s=e("mouse-event-offset"),l=e("has-passive-events")},{"3d-view":7,"has-passive-events":232,"mouse-change":247,"mouse-event-offset":248,"mouse-wheel":250,"right-now":278}],120:[function(e,t,r){var n=e("glslify"),a=e("gl-shader"),i=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n  uv = position;\n  gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n  vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n  gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);t.exports=function(e){return a(e,i,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":132,glslify:231}],121:[function(e,t,r){"use strict";var n=e("./camera.js"),a=e("gl-axes3d"),i=e("gl-axes3d/properties"),o=e("gl-spikes3d"),s=e("gl-select-static"),l=e("gl-fbo"),c=e("a-big-triangle"),u=e("mouse-change"),f=e("gl-mat4/perspective"),p=e("gl-mat4/ortho"),h=e("./lib/shader"),d=e("is-mobile")({tablet:!0,featureDetect:!0});function m(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(e){var t=Math.round(Math.log(Math.abs(e))/Math.log(10));if(t<0){var r=Math.round(Math.pow(10,-t));return Math.ceil(e*r)/r}return t>0?(r=Math.round(Math.pow(10,t)),Math.ceil(e/r)*r):Math.ceil(e)}function y(e){return"boolean"!=typeof e||e}t.exports={createScene:function(e){(e=e||{}).camera=e.camera||{};var t=e.canvas;t||(t=document.createElement("canvas"),e.container?e.container.appendChild(t):document.body.appendChild(t));var r=e.gl;if(r||(e.glOptions&&(d=!!e.glOptions.preserveDrawingBuffer),r=function(e,t){var r=null;try{(r=e.getContext("webgl",t))||(r=e.getContext("experimental-webgl",t))}catch(e){return null}return r}(t,e.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d})),!r)throw new Error("webgl not supported");var v=e.bounds||[[-10,-10,-10],[10,10,10]],b=new m,x=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),_=h(r),w=e.cameraObject&&!0===e.cameraObject._ortho||e.camera.projection&&"orthographic"===e.camera.projection.type||!1,k={eye:e.camera.eye||[2,0,0],center:e.camera.center||[0,0,0],up:e.camera.up||[0,1,0],zoomMin:e.camera.zoomMax||.1,zoomMax:e.camera.zoomMin||100,mode:e.camera.mode||"turntable",_ortho:w},D=e.axes||{},T=a(r,D);T.enable=!D.disable;var A=e.spikes||{},S=o(r,A),M=[],E=[],C=[],N=[],O=!0,I=!0,P={view:null,projection:new Array(16),model:new Array(16),_ortho:!1},R=(I=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),L=e.cameraObject||n(t,k),F={gl:r,contextLost:!1,pixelRatio:e.pixelRatio||1,canvas:t,selection:b,camera:L,axes:T,axesPixels:null,spikes:S,bounds:v,objects:M,shape:R,aspect:e.aspectRatio||[1,1,1],pickRadius:e.pickRadius||10,zNear:e.zNear||.01,zFar:e.zFar||1e3,fovy:e.fovy||Math.PI/4,clearColor:e.clearColor||[0,0,0,0],autoResize:y(e.autoResize),autoBounds:y(e.autoBounds),autoScale:!!e.autoScale,autoCenter:y(e.autoCenter),clipToBounds:y(e.clipToBounds),snapToData:!!e.snapToData,onselect:e.onselect||null,onrender:e.onrender||null,onclick:e.onclick||null,cameraParams:P,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(e){this.aspect[0]=e.x,this.aspect[1]=e.y,this.aspect[2]=e.z,I=!0},setBounds:function(e,t){this.bounds[0][e]=t.min,this.bounds[1][e]=t.max},setClearColor:function(e){this.clearColor=e},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},B=[r.drawingBufferWidth/F.pixelRatio|0,r.drawingBufferHeight/F.pixelRatio|0];function z(){if(!F._stopped&&F.autoResize){var e=t.parentNode,r=1,n=1;e&&e!==document.body?(r=e.clientWidth,n=e.clientHeight):(r=window.innerWidth,n=window.innerHeight);var a=0|Math.ceil(r*F.pixelRatio),i=0|Math.ceil(n*F.pixelRatio);if(a!==t.width||i!==t.height){t.width=a,t.height=i;var o=t.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",O=!0}}}function j(){for(var e=M.length,t=N.length,n=0;n<t;++n)C[n]=0;e:for(n=0;n<e;++n){var a=M[n],i=a.pickSlots;if(i){for(var o=0;o<t;++o)if(C[o]+i<255){E[n]=o,a.setPickBase(C[o]+1),C[o]+=i;continue e}var l=s(r,R);E[n]=t,N.push(l),C.push(i),a.setPickBase(1),t+=1}else E[n]=-1}for(;t>0&&0===C[t-1];)C.pop(),N.pop().dispose()}function U(){if(F.contextLost)return!0;r.isContextLost()&&(F.contextLost=!0,F.mouseListener.enabled=!1,F.selection.object=null,F.oncontextloss&&F.oncontextloss())}F.autoResize&&z(),window.addEventListener("resize",z),F.update=function(e){F._stopped||(e=e||{},O=!0,I=!0)},F.add=function(e){F._stopped||(e.axes=T,M.push(e),E.push(-1),O=!0,I=!0,j())},F.remove=function(e){if(!F._stopped){var t=M.indexOf(e);t<0||(M.splice(t,1),E.pop(),O=!0,I=!0,j())}},F.dispose=function(){if(!F._stopped&&(F._stopped=!0,window.removeEventListener("resize",z),t.removeEventListener("webglcontextlost",U),F.mouseListener.enabled=!1,!F.contextLost)){T.dispose(),S.dispose();for(var e=0;e<M.length;++e)M[e].dispose();for(x.dispose(),e=0;e<N.length;++e)N[e].dispose();_.dispose(),r=null,T=null,S=null,M=[]}},F._mouseRotating=!1,F._prevButtons=0,F.enableMouseListeners=function(){F.mouseListener=u(t,(function(e,t,r){if(!F._stopped){var n=N.length,a=M.length,i=b.object;b.distance=1/0,b.mouse[0]=t,b.mouse[1]=r,b.object=null,b.screen=null,b.dataCoordinate=b.dataPosition=null;var o=!1;if(e&&F._prevButtons)F._mouseRotating=!0;else{F._mouseRotating&&(I=!0),F._mouseRotating=!1;for(var s=0;s<n;++s){var l=N[s].query(t,B[1]-r-1,F.pickRadius);if(l){if(l.distance>b.distance)continue;for(var c=0;c<a;++c){var u=M[c];if(E[c]===s){var f=u.pick(l);f&&(b.buttons=e,b.screen=l.coord,b.distance=l.distance,b.object=u,b.index=f.distance,b.dataPosition=f.position,b.dataCoordinate=f.dataCoordinate,b.data=f,o=!0)}}}}}i&&i!==b.object&&(i.highlight&&i.highlight(null),O=!0),b.object&&(b.object.highlight&&b.object.highlight(b.data),O=!0),(o=o||b.object!==i)&&F.onselect&&F.onselect(b),1&e&&!(1&F._prevButtons)&&F.onclick&&F.onclick(b),F._prevButtons=e}}))},t.addEventListener("webglcontextlost",U);var $=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],V=[$[0].slice(),$[1].slice()];function q(){if(!U()){z();var e=F.camera.tick();P.view=F.camera.matrix,O=O||e,I=I||e,T.pixelRatio=F.pixelRatio,S.pixelRatio=F.pixelRatio;var t=M.length,n=$[0],a=$[1];n[0]=n[1]=n[2]=1/0,a[0]=a[1]=a[2]=-1/0;for(var o=0;o<t;++o){(C=M[o]).pixelRatio=F.pixelRatio,C.axes=F.axes,O=O||!!C.dirty,I=I||!!C.dirty;var s=C.bounds;if(s)for(var l=s[0],u=s[1],h=0;h<3;++h)n[h]=Math.min(n[h],l[h]),a[h]=Math.max(a[h],u[h])}var d=F.bounds;if(F.autoBounds)for(h=0;h<3;++h){if(a[h]<n[h])n[h]=-1,a[h]=1;else{n[h]===a[h]&&(n[h]-=1,a[h]+=1);var m=.05*(a[h]-n[h]);n[h]=n[h]-m,a[h]=a[h]+m}d[0][h]=n[h],d[1][h]=a[h]}var y=!1;for(h=0;h<3;++h)y=y||V[0][h]!==d[0][h]||V[1][h]!==d[1][h],V[0][h]=d[0][h],V[1][h]=d[1][h];if(I=I||y,O=O||y){if(y){var v=[0,0,0];for(o=0;o<3;++o)v[o]=g((d[1][o]-d[0][o])/10);T.autoTicks?T.update({bounds:d,tickSpacing:v}):T.update({bounds:d})}var k=r.drawingBufferWidth,D=r.drawingBufferHeight;for(R[0]=k,R[1]=D,B[0]=0|Math.max(k/F.pixelRatio,1),B[1]=0|Math.max(D/F.pixelRatio,1),function(e,t){var r=e.bounds,n=e.cameraParams,a=n.projection,i=n.model,o=e.gl.drawingBufferWidth,s=e.gl.drawingBufferHeight,l=e.zNear,c=e.zFar,u=e.fovy,h=o/s;t?(p(a,-h,h,-1,1,l,c),n._ortho=!0):(f(a,u,h,l,c),n._ortho=!1);for(var d=0;d<16;++d)i[d]=0;i[15]=1;var m=0;for(d=0;d<3;++d)m=Math.max(m,r[1][d]-r[0][d]);for(d=0;d<3;++d)e.autoScale?i[5*d]=e.aspect[d]/(r[1][d]-r[0][d]):i[5*d]=1/m,e.autoCenter&&(i[12+d]=.5*-i[5*d]*(r[0][d]+r[1][d]))}(F,w),o=0;o<t;++o)(C=M[o]).axesBounds=d,F.clipToBounds&&(C.clipBounds=d);b.object&&(F.snapToData?S.position=b.dataCoordinate:S.position=b.dataPosition,S.bounds=d),I&&(I=!1,function(){if(!U()){r.colorMask(!0,!0,!0,!0),r.depthMask(!0),r.disable(r.BLEND),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL);for(var e=M.length,t=N.length,n=0;n<t;++n){var a=N[n];a.shape=B,a.begin();for(var i=0;i<e;++i)if(E[i]===n){var o=M[i];o.drawPick&&(o.pixelRatio=1,o.drawPick(P))}a.end()}}}()),F.axesPixels=i(F.axes,P,k,D),F.onrender&&F.onrender(),r.bindFramebuffer(r.FRAMEBUFFER,null),r.viewport(0,0,k,D),F.clearRGBA(),r.depthMask(!0),r.colorMask(!0,!0,!0,!0),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.disable(r.BLEND),r.disable(r.CULL_FACE);var A=!1;for(T.enable&&(A=A||T.isTransparent(),T.draw(P)),S.axes=T,b.object&&S.draw(P),r.disable(r.CULL_FACE),o=0;o<t;++o)(C=M[o]).axes=T,C.pixelRatio=F.pixelRatio,C.isOpaque&&C.isOpaque()&&C.draw(P),C.isTransparent&&C.isTransparent()&&(A=!0);if(A){for(x.shape=R,x.bind(),r.clear(r.DEPTH_BUFFER_BIT),r.colorMask(!1,!1,!1,!1),r.depthMask(!0),r.depthFunc(r.LESS),T.enable&&T.isTransparent()&&T.drawTransparent(P),o=0;o<t;++o)(C=M[o]).isOpaque&&C.isOpaque()&&C.draw(P);for(r.enable(r.BLEND),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.colorMask(!0,!0,!0,!0),r.depthMask(!1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),T.isTransparent()&&T.drawTransparent(P),o=0;o<t;++o){var C;(C=M[o]).isTransparent&&C.isTransparent()&&C.drawTransparent(P)}r.bindFramebuffer(r.FRAMEBUFFER,null),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.disable(r.DEPTH_TEST),_.bind(),x.color[0].bind(0),_.uniforms.accumBuffer=0,c(r),r.disable(r.BLEND)}for(O=!1,o=0;o<t;++o)M[o].dirty=!1}}}return F.enableMouseListeners(),function e(){F._stopped||F.contextLost||(q(),requestAnimationFrame(e))}(),F.redraw=function(){F._stopped||(O=!0,q())},F},createCamera:n}},{"./camera.js":119,"./lib/shader":120,"a-big-triangle":8,"gl-axes3d":70,"gl-axes3d/properties":77,"gl-fbo":86,"gl-mat4/ortho":101,"gl-mat4/perspective":102,"gl-select-static":131,"gl-spikes3d":141,"is-mobile":238,"mouse-change":247}],122:[function(e,t,r){var n=e("glslify");r.pointVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform float pointCloud;\n\nhighp float rand(vec2 co) {\n  highp float a = 12.9898;\n  highp float b = 78.233;\n  highp float c = 43758.5453;\n  highp float d = dot(co.xy, vec2(a, b));\n  highp float e = mod(d, 3.14);\n  return fract(sin(e) * c);\n}\n\nvoid main() {\n  vec3 hgPosition = matrix * vec3(position, 1);\n  gl_Position  = vec4(hgPosition.xy, 0, hgPosition.z);\n    // if we don't jitter the point size a bit, overall point cloud\n    // saturation 'jumps' on zooming, which is disturbing and confusing\n  gl_PointSize = pointSize * ((19.5 + rand(position)) / 20.0);\n  if(pointCloud != 0.0) { // pointCloud is truthy\n    // get the same square surface as circle would be\n    gl_PointSize *= 0.886;\n  }\n}"]),r.pointFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color, borderColor;\nuniform float centerFraction;\nuniform float pointCloud;\n\nvoid main() {\n  float radius;\n  vec4 baseColor;\n  if(pointCloud != 0.0) { // pointCloud is truthy\n    if(centerFraction == 1.0) {\n      gl_FragColor = color;\n    } else {\n      gl_FragColor = mix(borderColor, color, centerFraction);\n    }\n  } else {\n    radius = length(2.0 * gl_PointCoord.xy - 1.0);\n    if(radius > 1.0) {\n      discard;\n    }\n    baseColor = mix(borderColor, color, step(radius, centerFraction));\n    gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n  }\n}\n"]),r.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n  vec3 hgPosition = matrix * vec3(position, 1);\n  gl_Position  = vec4(hgPosition.xy, 0, hgPosition.z);\n  gl_PointSize = pointSize;\n\n  vec4 id = pickId + pickOffset;\n  id.y += floor(id.x / 256.0);\n  id.x -= floor(id.x / 256.0) * 256.0;\n\n  id.z += floor(id.y / 256.0);\n  id.y -= floor(id.y / 256.0) * 256.0;\n\n  id.w += floor(id.z / 256.0);\n  id.z -= floor(id.z / 256.0) * 256.0;\n\n  fragId = id;\n}\n"]),r.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n  float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n  if(radius > 1.0) {\n    discard;\n  }\n  gl_FragColor = fragId / 255.0;\n}\n"])},{glslify:231}],123:[function(e,t,r){"use strict";var n=e("gl-shader"),a=e("gl-buffer"),i=e("typedarray-pool"),o=e("./lib/shader");function s(e,t,r,n,a){this.plot=e,this.offsetBuffer=t,this.pickBuffer=r,this.shader=n,this.pickShader=a,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}t.exports=function(e,t){var r=e.gl,i=new s(e,a(r),a(r),n(r,o.pointVertex,o.pointFragment),n(r,o.pickVertex,o.pickFragment));return i.update(t),e.addObject(i),i};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(e){var t;function r(t,r){return t in e?e[t]:r}e=e||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=e.positions.length>>>1,a=e.positions instanceof Float32Array,o=e.idToIndex instanceof Int32Array&&e.idToIndex.length>=n,s=e.positions,l=a?s:i.mallocFloat32(s.length),c=o?e.idToIndex:i.mallocInt32(n);if(a||l.set(s),!o)for(l.set(s),t=0;t<n;t++)c[t]=t;this.points=s,this.offsetBuffer.update(l),this.pickBuffer.update(c),a||i.free(l),o||i.free(c),this.pointCount=n,this.pickOffset=0},u.unifiedDraw=(l=[1,0,0,0,1,0,0,0,1],c=[0,0,0,0],function(e){var t=void 0!==e,r=t?this.pickShader:this.shader,n=this.plot.gl,a=this.plot.dataBox;if(0===this.pointCount)return e;var i=a[2]-a[0],o=a[3]-a[1],s=function(e,t){var r,n=0,a=e.length>>>1;for(r=0;r<a;r++){var i=e[2*r],o=e[2*r+1];i>=t[0]&&i<=t[2]&&o>=t[1]&&o<=t[3]&&n++}return n}(this.points,a),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/i,l[4]=2/o,l[6]=-2*a[0]/i-1,l[7]=-2*a[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),t&&(c[0]=255&e,c[1]=e>>8&255,c[2]=e>>16&255,c[3]=e>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=e);var f=n.getParameter(n.BLEND),p=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),p&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),p&&n.enable(n.DITHER),e+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(e,t,r){var n=this.pickOffset,a=this.pointCount;if(r<n||r>=n+a)return null;var i=r-n,o=this.points;return{object:this,pointId:i,dataCoord:[o[2*i],o[2*i+1]]}}},{"./lib/shader":122,"gl-buffer":78,"gl-shader":132,"typedarray-pool":308}],124:[function(e,t,r){t.exports=function(e,t,r,n){var a,i,o,s,l,c=t[0],u=t[1],f=t[2],p=t[3],h=r[0],d=r[1],m=r[2],g=r[3];return(i=c*h+u*d+f*m+p*g)<0&&(i=-i,h=-h,d=-d,m=-m,g=-g),1-i>1e-6?(a=Math.acos(i),o=Math.sin(a),s=Math.sin((1-n)*a)/o,l=Math.sin(n*a)/o):(s=1-n,l=n),e[0]=s*c+l*h,e[1]=s*u+l*d,e[2]=s*f+l*m,e[3]=s*p+l*g,e}},{}],125:[function(e,t,r){"use strict";t.exports=function(e){return e||0===e?e.toString():""}},{}],126:[function(e,t,r){"use strict";var n=e("vectorize-text");t.exports=function(e,t,r){var i=a[t];if(i||(i=a[t]={}),e in i)return i[e];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:t,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(e,o);o.triangles=!1;var l,c,u=n(e,o);if(r&&1!==r){for(l=0;l<s.positions.length;++l)for(c=0;c<s.positions[l].length;++c)s.positions[l][c]/=r;for(l=0;l<u.positions.length;++l)for(c=0;c<u.positions[l].length;++c)u.positions[l][c]/=r}var f=[[1/0,1/0],[-1/0,-1/0]],p=u.positions.length;for(l=0;l<p;++l){var h=u.positions[l];for(c=0;c<2;++c)f[0][c]=Math.min(f[0][c],h[c]),f[1][c]=Math.max(f[1][c],h[c])}return i[e]=[s,u,f]};var a={}},{"vectorize-text":311}],127:[function(e,t,r){var n=e("gl-shader"),a=e("glslify"),i=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n    gl_Position = vec4(0,0,0,0);\n  } else {\n    float scale = 1.0;\n    if(distance(highlightId, id) < 0.0001) {\n      scale = highlightScale;\n    }\n\n    vec4 worldPosition = model * vec4(position, 1);\n    vec4 viewPosition = view * worldPosition;\n    viewPosition = viewPosition / viewPosition.w;\n    vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n    gl_Position = clipPosition;\n    interpColor = color;\n    pickId = id;\n    dataCoordinate = position;\n  }\n}"]),o=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n    gl_Position = vec4(0,0,0,0);\n  } else {\n    float scale = pixelRatio;\n    if(distance(highlightId.bgr, id.bgr) < 0.001) {\n      scale *= highlightScale;\n    }\n\n    vec4 worldPosition = model * vec4(position, 1.0);\n    vec4 viewPosition = view * worldPosition;\n    vec4 clipPosition = projection * viewPosition;\n    clipPosition /= clipPosition.w;\n\n    gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n    interpColor = color;\n    pickId = id;\n    dataCoordinate = position;\n  }\n}"]),s=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n    gl_Position = vec4(0,0,0,0);\n  } else {\n    float lscale = pixelRatio * scale;\n    if(distance(highlightId, id) < 0.0001) {\n      lscale *= highlightScale;\n    }\n\n    vec4 clipCenter   = projection * view * model * vec4(position, 1);\n    vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n    vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n    gl_Position = clipPosition;\n    interpColor = color;\n    pickId = id;\n    dataCoordinate = dataPosition;\n  }\n}\n"]),l=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n  if (\n    outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n    interpColor.a * opacity == 0.\n  ) discard;\n  gl_FragColor = interpColor * opacity;\n}\n"]),c=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n  if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n  gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:i,fragment:l,attributes:u},p={vertex:o,fragment:l,attributes:u},h={vertex:s,fragment:l,attributes:u},d={vertex:i,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function y(e,t){var r=n(e,t),a=r.attributes;return a.position.location=0,a.color.location=1,a.glyph.location=2,a.id.location=3,r}r.createPerspective=function(e){return y(e,f)},r.createOrtho=function(e){return y(e,p)},r.createProject=function(e){return y(e,h)},r.createPickPerspective=function(e){return y(e,d)},r.createPickOrtho=function(e){return y(e,m)},r.createPickProject=function(e){return y(e,g)}},{"gl-shader":132,glslify:231}],128:[function(e,t,r){"use strict";var n=e("is-string-blank"),a=e("gl-buffer"),i=e("gl-vao"),o=e("typedarray-pool"),s=e("gl-mat4/multiply"),l=e("./lib/shaders"),c=e("./lib/glyphs"),u=e("./lib/get-simple-string"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function p(e,t){var r=e[0],n=e[1],a=e[2],i=e[3];return e[0]=t[0]*r+t[4]*n+t[8]*a+t[12]*i,e[1]=t[1]*r+t[5]*n+t[9]*a+t[13]*i,e[2]=t[2]*r+t[6]*n+t[10]*a+t[14]*i,e[3]=t[3]*r+t[7]*n+t[11]*a+t[15]*i,e}function h(e,t,r,n){return p(n,n),p(n,n),p(n,n)}function d(e,t){this.index=e,this.dataCoordinate=this.position=t}function m(e){return!0===e||e>1?1:e}function g(e,t,r,n,a,i,o,s,l,c,u,f){this.gl=e,this.pixelRatio=1,this.shader=t,this.orthoShader=r,this.projectShader=n,this.pointBuffer=a,this.colorBuffer=i,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=f,this.points=[],this._selectResult=new d(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}t.exports=function(e){var t=e.gl,r=l.createPerspective(t),n=l.createOrtho(t),o=l.createProject(t),s=l.createPickPerspective(t),c=l.createPickOrtho(t),u=l.createPickProject(t),f=a(t),p=a(t),h=a(t),d=a(t),m=new g(t,r,n,o,f,p,h,d,i(t,[{buffer:f,size:3,type:t.FLOAT},{buffer:p,size:4,type:t.FLOAT},{buffer:h,size:2,type:t.FLOAT},{buffer:d,size:4,type:t.UNSIGNED_BYTE,normalized:!0}]),s,c,u);return m.update(e),m};var y=g.prototype;y.pickSlots=1,y.setPickBase=function(e){this.pickId=e},y.isTransparent=function(){if(this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&this.projectHasAlpha)return!0;return!1},y.isOpaque=function(){if(!this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&!this.projectHasAlpha)return!0;return!1};var v=[0,0],b=[0,0,0],x=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],k=f.slice(),D=[0,0,0],T=[[0,0,0],[0,0,0]];function A(e){return e[0]=e[1]=e[2]=0,e}function S(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=1,e}function M(e,t,r,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[r]=n,e}function E(e,t,r,n){var a,i=t.axesProject,o=t.gl,l=e.uniforms,c=r.model||f,u=r.view||f,p=r.projection||f,d=t.axesBounds,m=function(e){for(var t=T,r=0;r<2;++r)for(var n=0;n<3;++n)t[r][n]=Math.max(Math.min(e[r][n],1e8),-1e8);return t}(t.clipBounds);a=t.axes&&t.axes.lastCubeProps?t.axes.lastCubeProps.axis:[1,1,1],v[0]=2/o.drawingBufferWidth,v[1]=2/o.drawingBufferHeight,e.bind(),l.view=u,l.projection=p,l.screenSize=v,l.highlightId=t.highlightId,l.highlightScale=t.highlightScale,l.clipBounds=m,l.pickGroup=t.pickId/255,l.pixelRatio=n;for(var g=0;g<3;++g)if(i[g]){l.scale=t.projectScale[g],l.opacity=t.projectOpacity[g];for(var y=k,E=0;E<16;++E)y[E]=0;for(E=0;E<4;++E)y[5*E]=1;y[5*g]=0,a[g]<0?y[12+g]=d[0][g]:y[12+g]=d[1][g],s(y,c,y),l.model=y;var C=(g+1)%3,N=(g+2)%3,O=A(b),I=A(x);O[C]=1,I[N]=1;var P=h(0,0,0,S(_,O)),R=h(0,0,0,S(w,I));if(Math.abs(P[1])>Math.abs(R[1])){var L=P;P=R,R=L,L=O,O=I,I=L;var F=C;C=N,N=F}P[0]<0&&(O[C]=-1),R[1]>0&&(I[N]=-1);var B=0,z=0;for(E=0;E<4;++E)B+=Math.pow(c[4*C+E],2),z+=Math.pow(c[4*N+E],2);O[C]/=Math.sqrt(B),I[N]/=Math.sqrt(z),l.axes[0]=O,l.axes[1]=I,l.fragClipBounds[0]=M(D,m[0],g,-1e8),l.fragClipBounds[1]=M(D,m[1],g,1e8),t.vao.bind(),t.vao.draw(o.TRIANGLES,t.vertexCount),t.lineWidth>0&&(o.lineWidth(t.lineWidth*n),t.vao.draw(o.LINES,t.lineVertexCount,t.vertexCount)),t.vao.unbind()}}var C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function N(e,t,r,n,a,i,o){var s=r.gl;if((i===r.projectHasAlpha||o)&&E(t,r,n,a),i===r.hasAlpha||o){e.bind();var l=e.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,v[0]=2/s.drawingBufferWidth,v[1]=2/s.drawingBufferHeight,l.screenSize=v,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=C,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=a,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*a),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function O(e,t,r,a){var i;i=Array.isArray(e)?t<e.length?e[t]:void 0:e,i=u(i);var o=!0;n(i)&&(i="▼",o=!1);var s=c(i,r,a);return{mesh:s[0],lines:s[1],bounds:s[2],visible:o}}y.draw=function(e){N(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,e,this.pixelRatio,!1,!1)},y.drawTransparent=function(e){N(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,e,this.pixelRatio,!0,!1)},y.drawPick=function(e){N(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,e,1,!0,!0)},y.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=e.value[2]+(e.value[1]<<8)+(e.value[0]<<16);if(t>=this.pointCount||t<0)return null;var r=this.points[t],n=this._selectResult;n.index=t;for(var a=0;a<3;++a)n.position[a]=n.dataCoordinate[a]=r[a];return n},y.highlight=function(e){if(e){var t=e.index,r=255&t,n=t>>8&255,a=t>>16&255;this.highlightId=[r/255,n/255,a/255,0]}else this.highlightId=[1,1,1,1]},y.update=function(e){if("perspective"in(e=e||{})&&(this.useOrtho=!e.perspective),"orthographic"in e&&(this.useOrtho=!!e.orthographic),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"project"in e)if(Array.isArray(e.project))this.axesProject=e.project;else{var t=!!e.project;this.axesProject=[t,t,t]}if("projectScale"in e)if(Array.isArray(e.projectScale))this.projectScale=e.projectScale.slice();else{var r=+e.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in e){Array.isArray(e.projectOpacity)?this.projectOpacity=e.projectOpacity.slice():(r=+e.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=m(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in e&&(this.opacity=m(e.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var a,i,s=e.position,l=e.font||"normal",c=e.alignment||[0,0];if(2===c.length)a=c[0],i=c[1];else for(a=[],i=[],n=0;n<c.length;++n)a[n]=c[n][0],i[n]=c[n][1];var u=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],p=e.glyph,h=e.color,d=e.size,g=e.angle,y=e.lineColor,v=-1,b=0,x=0,_=0;if(s.length){_=s.length;e:for(n=0;n<_;++n){for(var w=s[n],k=0;k<3;++k)if(isNaN(w[k])||!isFinite(w[k]))continue e;var D=(z=O(p,n,l,this.pixelRatio)).mesh,T=z.lines,A=z.bounds;b+=3*D.cells.length,x+=2*T.edges.length}}var S=b+x,M=o.mallocFloat(3*S),E=o.mallocFloat(4*S),C=o.mallocFloat(2*S),N=o.mallocUint32(S);if(S>0){var I=0,P=b,R=[0,0,0,1],L=[0,0,0,1],F=Array.isArray(h)&&Array.isArray(h[0]),B=Array.isArray(y)&&Array.isArray(y[0]);e:for(n=0;n<_;++n){for(v+=1,w=s[n],k=0;k<3;++k){if(isNaN(w[k])||!isFinite(w[k]))continue e;f[k]=Math.max(f[k],w[k]),u[k]=Math.min(u[k],w[k])}D=(z=O(p,n,l,this.pixelRatio)).mesh,T=z.lines,A=z.bounds;var z,j=z.visible;if(j)if(Array.isArray(h)){if(3===(U=F?n<h.length?h[n]:[0,0,0,0]:h).length){for(k=0;k<3;++k)R[k]=U[k];R[3]=1}else if(4===U.length){for(k=0;k<4;++k)R[k]=U[k];!this.hasAlpha&&U[3]<1&&(this.hasAlpha=!0)}}else R[0]=R[1]=R[2]=0,R[3]=1;else R=[1,1,1,0];if(j)if(Array.isArray(y)){var U;if(3===(U=B?n<y.length?y[n]:[0,0,0,0]:y).length){for(k=0;k<3;++k)L[k]=U[k];L[k]=1}else if(4===U.length){for(k=0;k<4;++k)L[k]=U[k];!this.hasAlpha&&U[3]<1&&(this.hasAlpha=!0)}}else L[0]=L[1]=L[2]=0,L[3]=1;else L=[1,1,1,0];var $=.5;j?Array.isArray(d)?$=n<d.length?+d[n]:12:d?$=+d:this.useOrtho&&($=12):$=0;var V=0;Array.isArray(g)?V=n<g.length?+g[n]:0:g&&(V=+g);var q=Math.cos(V),W=Math.sin(V);for(w=s[n],k=0;k<3;++k)f[k]=Math.max(f[k],w[k]),u[k]=Math.min(u[k],w[k]);var H=a,G=i;H=0,Array.isArray(a)?H=n<a.length?a[n]:0:a&&(H=a),G=0,Array.isArray(i)?G=n<i.length?i[n]:0:i&&(G=i);var X=[H*=H>0?1-A[0][0]:H<0?1+A[1][0]:1,G*=G>0?1-A[0][1]:G<0?1+A[1][1]:1],Y=D.cells||[],Z=D.positions||[];for(k=0;k<Y.length;++k)for(var K=Y[k],J=0;J<3;++J){for(var Q=0;Q<3;++Q)M[3*I+Q]=w[Q];for(Q=0;Q<4;++Q)E[4*I+Q]=R[Q];N[I]=v;var ee=Z[K[J]];C[2*I]=$*(q*ee[0]-W*ee[1]+X[0]),C[2*I+1]=$*(W*ee[0]+q*ee[1]+X[1]),I+=1}for(Y=T.edges,Z=T.positions,k=0;k<Y.length;++k)for(K=Y[k],J=0;J<2;++J){for(Q=0;Q<3;++Q)M[3*P+Q]=w[Q];for(Q=0;Q<4;++Q)E[4*P+Q]=L[Q];N[P]=v,ee=Z[K[J]],C[2*P]=$*(q*ee[0]-W*ee[1]+X[0]),C[2*P+1]=$*(W*ee[0]+q*ee[1]+X[1]),P+=1}}}this.bounds=[u,f],this.points=s,this.pointCount=s.length,this.vertexCount=b,this.lineVertexCount=x,this.pointBuffer.update(M),this.colorBuffer.update(E),this.glyphBuffer.update(C),this.idBuffer.update(N),o.free(M),o.free(E),o.free(C),o.free(N)},y.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{"./lib/get-simple-string":125,"./lib/glyphs":126,"./lib/shaders":127,"gl-buffer":78,"gl-mat4/multiply":100,"gl-vao":150,"is-string-blank":239,"typedarray-pool":308}],129:[function(e,t,r){"use strict";var n=e("glslify");r.boxVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 vertex;\n\nuniform vec2 cornerA, cornerB;\n\nvoid main() {\n  gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\n}\n"]),r.boxFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n  gl_FragColor = color;\n}\n"])},{glslify:231}],130:[function(e,t,r){"use strict";var n=e("gl-shader"),a=e("gl-buffer"),i=e("./lib/shaders");function o(e,t,r){this.plot=e,this.boxBuffer=t,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-1/0,-1/0],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}t.exports=function(e,t){var r=e.gl,s=new o(e,a(r,[0,0,0,1,1,0,1,1]),n(r,i.boxVertex,i.boxFragment));return s.update(t),e.addOverlay(s),s};var s=o.prototype;s.draw=function(){if(this.enabled){var e=this.plot,t=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),a=(this.outerFill,this.outerColor),i=this.borderColor,o=e.box,s=e.screenBox,l=e.dataBox,c=e.viewBox,u=e.pixelRatio,f=(t[0]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],p=(t[1]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1],h=(t[2]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],d=(t[3]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1];if(f=Math.max(f,c[0]),p=Math.max(p,c[1]),h=Math.min(h,c[2]),d=Math.min(d,c[3]),!(h<f||d<p)){o.bind();var m=s[2]-s[0],g=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,m,p,a),o.drawBox(0,p,f,d,a),o.drawBox(0,d,m,g,a),o.drawBox(h,p,m,d,a)),this.innerFill&&o.drawBox(f,p,h,d,n),r>0){var y=r*u;o.drawBox(f-y,p-y,h+y,p+y,i),o.drawBox(f-y,d-y,h+y,d+y,i),o.drawBox(f-y,p-y,f+y,d+y,i),o.drawBox(h-y,p-y,h+y,d+y,i)}}}},s.update=function(e){e=e||{},this.innerFill=!!e.innerFill,this.outerFill=!!e.outerFill,this.innerColor=(e.innerColor||[0,0,0,.5]).slice(),this.outerColor=(e.outerColor||[0,0,0,.5]).slice(),this.borderColor=(e.borderColor||[0,0,0,1]).slice(),this.borderWidth=e.borderWidth||0,this.selectBox=(e.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":129,"gl-buffer":78,"gl-shader":132}],131:[function(e,t,r){"use strict";t.exports=function(e,t){var r=t[0],i=t[1];return new l(e,n(e,r,i,{}),a.mallocUint8(r*i*4))};var n=e("gl-fbo"),a=e("typedarray-pool"),i=e("ndarray"),o=e("bit-twiddle").nextPow2;function s(e,t,r,n,a){this.coord=[e,t],this.id=r,this.value=n,this.distance=a}function l(e,t,r){this.gl=e,this.fbo=t,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(t.bind(),e.readPixels(0,0,t.shape[0],t.shape[1],e.RGBA,e.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(e){if(this.gl){this.fbo.shape=e;var t=this.fbo.shape[0],r=this.fbo.shape[1];if(r*t*4>this.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(o(r*t*4)),i=0;i<r*t*4;++i)n[i]=255}return e}}}),c.begin=function(){var e=this.gl;this.shape,e&&(this.fbo.bind(),e.clearColor(1,1,1,1),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT))},c.end=function(){var e=this.gl;e&&(e.bindFramebuffer(e.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},c.query=function(e,t,r){if(!this.gl)return null;var n=this.fbo.shape.slice();e|=0,t|=0,"number"!=typeof r&&(r=1);var a=0|Math.min(Math.max(e-r,0),n[0]),o=0|Math.min(Math.max(e+r,0),n[0]),l=0|Math.min(Math.max(t-r,0),n[1]),c=0|Math.min(Math.max(t+r,0),n[1]);if(o<=a||c<=l)return null;var u=[o-a,c-l],f=i(this.buffer,[u[0],u[1],4],[4,4*n[0],1],4*(a+n[0]*l)),p=function(e,t,r){for(var n=1e8,a=-1,i=-1,o=e.shape[0],s=e.shape[1],l=0;l<o;l++)for(var c=0;c<s;c++){var u=e.get(l,c,0),f=e.get(l,c,1),p=e.get(l,c,2),h=e.get(l,c,3);if(u<255||f<255||p<255||h<255){var d=t-l,m=r-c,g=d*d+m*m;g<n&&(n=g,a=l,i=c)}}return[a,i,n]}(f.hi(u[0],u[1],1),r,r),h=p[0],d=p[1];return h<0||Math.pow(this.radius,2)<p[2]?null:new s(h+a|0,d+l|0,f.get(h,d,0),[f.get(h,d,1),f.get(h,d,2),f.get(h,d,3)],Math.sqrt(p[2]))},c.dispose=function(){this.gl&&(this.fbo.dispose(),a.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{"bit-twiddle":32,"gl-fbo":86,ndarray:259,"typedarray-pool":308}],132:[function(e,t,r){"use strict";var n=e("./lib/create-uniforms"),a=e("./lib/create-attributes"),i=e("./lib/reflect"),o=e("./lib/shader-cache"),s=e("./lib/runtime-reflect"),l=e("./lib/GLError");function c(e){this.gl=e,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var u=c.prototype;function f(e,t){return e.name<t.name?-1:1}u.bind=function(){var e;this.program||this._relink();var t=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(t>r)for(e=r;e<t;e++)this.gl.enableVertexAttribArray(e);else if(r>t)for(e=t;e<r;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=t,this.gl.useProgram(this.program)},u.dispose=function(){for(var e=this.gl.lastAttribCount,t=0;t<e;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},u.update=function(e,t,r,c){if(!t||1===arguments.length){var u=e;e=u.vertex,t=u.fragment,r=u.uniforms,c=u.attributes}var p=this,h=p.gl,d=p._vref;p._vref=o.shader(h,h.VERTEX_SHADER,e),d&&d.dispose(),p.vertShader=p._vref.shader;var m=this._fref;if(p._fref=o.shader(h,h.FRAGMENT_SHADER,t),m&&m.dispose(),p.fragShader=p._fref.shader,!r||!c){var g=h.createProgram();if(h.attachShader(g,p.fragShader),h.attachShader(g,p.vertShader),h.linkProgram(g),!h.getProgramParameter(g,h.LINK_STATUS)){var y=h.getProgramInfoLog(g);throw new l(y,"Error linking program:"+y)}r=r||s.uniforms(h,g),c=c||s.attributes(h,g),h.deleteProgram(g)}(c=c.slice()).sort(f);var v,b=[],x=[],_=[];for(v=0;v<c.length;++v){var w=c[v];if(w.type.indexOf("mat")>=0){for(var k=0|w.type.charAt(w.type.length-1),D=new Array(k),T=0;T<k;++T)D[T]=_.length,x.push(w.name+"["+T+"]"),"number"==typeof w.location?_.push(w.location+T):Array.isArray(w.location)&&w.location.length===k&&"number"==typeof w.location[T]?_.push(0|w.location[T]):_.push(-1);b.push({name:w.name,type:w.type,locations:D})}else b.push({name:w.name,type:w.type,locations:[_.length]}),x.push(w.name),"number"==typeof w.location?_.push(0|w.location):_.push(-1)}var A=0;for(v=0;v<_.length;++v)if(_[v]<0){for(;_.indexOf(A)>=0;)A+=1;_[v]=A}var S=new Array(r.length);function M(){p.program=o.program(h,p._vref,p._fref,x,_);for(var e=0;e<r.length;++e)S[e]=h.getUniformLocation(p.program,r[e].name)}M(),p._relink=M,p.types={uniforms:i(r),attributes:i(c)},p.attributes=a(h,p,b,_),Object.defineProperty(p,"uniforms",n(h,p,r,S))},t.exports=function(e,t,r,n,a){var i=new c(e);return i.update(t,r,n,a),i}},{"./lib/GLError":133,"./lib/create-attributes":134,"./lib/create-uniforms":135,"./lib/reflect":136,"./lib/runtime-reflect":137,"./lib/shader-cache":138}],133:[function(e,t,r){function n(e,t,r){this.shortMessage=t||"",this.longMessage=r||"",this.rawError=e||"",this.message="gl-shader: "+(t||e||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,t.exports=n},{}],134:[function(e,t,r){"use strict";t.exports=function(e,t,r,a){for(var i={},o=0,c=r.length;o<c;++o){var u=r[o],f=u.name,p=u.type,h=u.locations;switch(p){case"bool":case"int":case"float":s(e,t,h[0],a,1,i,f);break;default:if(p.indexOf("vec")>=0){if((d=p.charCodeAt(p.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+p);s(e,t,h[0],a,d,i,f)}else{if(!(p.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+p);var d;if((d=p.charCodeAt(p.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+p);l(e,t,h,a,d,i,f)}}}return i};var n=e("./GLError");function a(e,t,r,n,a,i){this._gl=e,this._wrapper=t,this._index=r,this._locations=n,this._dimension=a,this._constFunc=i}var i=a.prototype;i.pointer=function(e,t,r,n){var a=this._gl,i=this._locations[this._index];a.vertexAttribPointer(i,this._dimension,e||a.FLOAT,!!t,r||0,n||0),a.enableVertexAttribArray(i)},i.set=function(e,t,r,n){return this._constFunc(this._locations[this._index],e,t,r,n)},Object.defineProperty(i,"location",{get:function(){return this._locations[this._index]},set:function(e){return e!==this._locations[this._index]&&(this._locations[this._index]=0|e,this._wrapper.program=null),0|e}});var o=[function(e,t,r){return void 0===r.length?e.vertexAttrib1f(t,r):e.vertexAttrib1fv(t,r)},function(e,t,r,n){return void 0===r.length?e.vertexAttrib2f(t,r,n):e.vertexAttrib2fv(t,r)},function(e,t,r,n,a){return void 0===r.length?e.vertexAttrib3f(t,r,n,a):e.vertexAttrib3fv(t,r)},function(e,t,r,n,a,i){return void 0===r.length?e.vertexAttrib4f(t,r,n,a,i):e.vertexAttrib4fv(t,r)}];function s(e,t,r,n,i,s,l){var c=o[i],u=new a(e,t,r,n,i,c);Object.defineProperty(s,l,{set:function(t){return e.disableVertexAttribArray(n[r]),c(e,n[r],t),t},get:function(){return u},enumerable:!0})}function l(e,t,r,n,a,i,o){for(var l=new Array(a),c=new Array(a),u=0;u<a;++u)s(e,t,r[u],n,a,l,u),c[u]=l[u];Object.defineProperty(l,"location",{set:function(e){if(Array.isArray(e))for(var t=0;t<a;++t)c[t].location=e[t];else for(t=0;t<a;++t)c[t].location=e+t;return e},get:function(){for(var e=new Array(a),t=0;t<a;++t)e[t]=n[r[t]];return e},enumerable:!0}),l.pointer=function(t,i,o,s){t=t||e.FLOAT,i=!!i,o=o||a*a,s=s||0;for(var l=0;l<a;++l){var c=n[r[l]];e.vertexAttribPointer(c,a,t,i,o,s+l*a),e.enableVertexAttribArray(c)}};var f=new Array(a),p=e["vertexAttrib"+a+"fv"];Object.defineProperty(i,o,{set:function(t){for(var i=0;i<a;++i){var o=n[r[i]];if(e.disableVertexAttribArray(o),Array.isArray(t[0]))p.call(e,o,t[i]);else{for(var s=0;s<a;++s)f[s]=t[a*i+s];p.call(e,o,f)}}return t},get:function(){return l},enumerable:!0})}},{"./GLError":133}],135:[function(e,t,r){"use strict";var n=e("./reflect"),a=e("./GLError");function i(e){return function(){return e}}function o(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=t;return r}t.exports=function(e,t,r,s){function l(t){return function(n){for(var i=function e(t,r){if("object"!=typeof r)return[[t,r]];var n=[];for(var a in r){var i=r[a],o=t;parseInt(a)+""===a?o+="["+a+"]":o+="."+a,"object"==typeof i?n.push.apply(n,e(o,i)):n.push([o,i])}return n}("",t),o=0;o<i.length;++o){var l=i[o],c=l[0],u=l[1];if(s[u]){var f=n;if("string"==typeof c&&(0===c.indexOf(".")||0===c.indexOf("["))){var p=c;if(0===c.indexOf(".")&&(p=c.slice(1)),p.indexOf("]")===p.length-1){var h=p.indexOf("["),d=p.slice(0,h),m=p.slice(h+1,p.length-1);f=d?n[d][m]:n[m]}else f=n[p]}var g,y=r[u].type;switch(y){case"bool":case"int":case"sampler2D":case"samplerCube":e.uniform1i(s[u],f);break;case"float":e.uniform1f(s[u],f);break;default:var v=y.indexOf("vec");if(!(0<=v&&v<=1&&y.length===4+v)){if(0===y.indexOf("mat")&&4===y.length){if((g=y.charCodeAt(y.length-1)-48)<2||g>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+y);e["uniformMatrix"+g+"fv"](s[u],!1,f);break}throw new a("","Unknown uniform data type for "+name+": "+y)}if((g=y.charCodeAt(y.length-1)-48)<2||g>4)throw new a("","Invalid data type");switch(y.charAt(0)){case"b":case"i":e["uniform"+g+"iv"](s[u],f);break;case"v":e["uniform"+g+"fv"](s[u],f);break;default:throw new a("","Unrecognized data type for vector "+name+": "+y)}}}}}}function c(e,t,n){if("object"==typeof n){var c=u(n);Object.defineProperty(e,t,{get:i(c),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(e,t,{get:(f=n,function(e,t,r){return e.getUniform(t.program,r[f])}),set:l(n),enumerable:!0,configurable:!1}):e[t]=function(e){switch(e){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var t=e.indexOf("vec");if(0<=t&&t<=1&&e.length===4+t){if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new a("","Invalid data type");return"b"===e.charAt(0)?o(r,!1):o(r,0)}if(0===e.indexOf("mat")&&4===e.length){var r;if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+e);return o(r*r,0)}throw new a("","Unknown uniform data type for "+name+": "+e)}}(r[n].type);var f}function u(e){var t;if(Array.isArray(e)){t=new Array(e.length);for(var r=0;r<e.length;++r)c(t,r,e[r])}else for(var n in t={},e)c(t,n,e[n]);return t}var f=n(r,!0);return{get:i(u(f)),set:l(f),enumerable:!0,configurable:!0}}},{"./GLError":133,"./reflect":136}],136:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r={},n=0;n<e.length;++n)for(var a=e[n].name.split("."),i=r,o=0;o<a.length;++o){var s=a[o].split("[");if(s.length>1){s[0]in i||(i[s[0]]=[]),i=i[s[0]];for(var l=1;l<s.length;++l){var c=parseInt(s[l]);l<s.length-1||o<a.length-1?(c in i||(l<s.length-1?i[c]=[]:i[c]={}),i=i[c]):i[c]=t?n:e[n].type}}else o<a.length-1?(s[0]in i||(i[s[0]]={}),i=i[s[0]]):i[s[0]]=t?n:e[n].type}return r}},{}],137:[function(e,t,r){"use strict";r.uniforms=function(e,t){for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=[],a=0;a<r;++a){var o=e.getActiveUniform(t,a);if(o){var s=i(e,o.type);if(o.size>1)for(var l=0;l<o.size;++l)n.push({name:o.name.replace("[0]","["+l+"]"),type:s});else n.push({name:o.name,type:s})}}return n},r.attributes=function(e,t){for(var r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=[],a=0;a<r;++a){var o=e.getActiveAttrib(t,a);o&&n.push({name:o.name,type:i(e,o.type)})}return n};var n={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},a=null;function i(e,t){if(!a){var r=Object.keys(n);a={};for(var i=0;i<r.length;++i){var o=r[i];a[e[o]]=n[o]}}return a[t]}},{}],138:[function(e,t,r){"use strict";r.shader=function(e,t,r){return u(e).getShaderReference(t,r)},r.program=function(e,t,r,n,a){return u(e).getProgram(t,r,n,a)};var n=e("./GLError"),a=e("gl-format-compiler-error"),i=new("undefined"==typeof WeakMap?e("weakmap-shim"):WeakMap),o=0;function s(e,t,r,n,a,i,o){this.id=e,this.src=t,this.type=r,this.shader=n,this.count=i,this.programs=[],this.cache=o}function l(e){this.gl=e,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0==--this.count){for(var e=this.cache,t=e.gl,r=this.programs,n=0,a=r.length;n<a;++n){var i=e.programs[r[n]];i&&(delete e.programs[n],t.deleteProgram(i))}t.deleteShader(this.shader),delete e.shaders[this.type===t.FRAGMENT_SHADER|0][this.src]}};var c=l.prototype;function u(e){var t=i.get(e);return t||(t=new l(e),i.set(e,t)),t}c.getShaderReference=function(e,t){var r=this.gl,i=this.shaders[e===r.FRAGMENT_SHADER|0],l=i[t];if(l&&r.isShader(l.shader))l.count+=1;else{var c=function(e,t,r){var i=e.createShader(t);if(e.shaderSource(i,r),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){var o=e.getShaderInfoLog(i);try{var s=a(o,r,t)}catch(e){throw console.warn("Failed to format compiler error: "+e),new n(o,"Error compiling shader:\n"+o)}throw new n(o,s.short,s.long)}return i}(r,e,t);l=i[t]=new s(o++,t,e,c,[],1,this)}return l},c.getProgram=function(e,t,r,a){var i=[e.id,t.id,r.join(":"),a.join(":")].join("@"),o=this.programs[i];return o&&this.gl.isProgram(o)||(this.programs[i]=o=function(e,t,r,a,i){var o=e.createProgram();e.attachShader(o,t),e.attachShader(o,r);for(var s=0;s<a.length;++s)e.bindAttribLocation(o,i[s],a[s]);if(e.linkProgram(o),!e.getProgramParameter(o,e.LINK_STATUS)){var l=e.getProgramInfoLog(o);throw new n(l,"Error linking program: "+l)}return o}(this.gl,e.shader,t.shader,r,a),e.programs.push(i),t.programs.push(i)),o}},{"./GLError":133,"gl-format-compiler-error":87,"weakmap-shim":316}],139:[function(e,t,r){"use strict";function n(e){this.plot=e,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}t.exports=function(e,t){var r=new n(e);return r.update(t),e.addOverlay(r),r};var a=n.prototype;a.update=function(e){e=e||{},this.enable=(e.enable||[!0,!0,!1,!1]).slice(),this.width=(e.width||[1,1,1,1]).slice(),this.color=(e.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map((function(e){return e.slice()})),this.center=(e.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},a.draw=function(){var e=this.enable,t=this.width,r=this.color,n=this.center,a=this.plot,i=a.line,o=a.dataBox,s=a.viewBox;if(i.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);e[0]&&i.drawLine(l,c,s[0],c,t[0],r[0]),e[1]&&i.drawLine(l,c,l,s[1],t[1],r[1]),e[2]&&i.drawLine(l,c,s[2],c,t[2],r[2]),e[3]&&i.drawLine(l,c,l,s[3],t[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],140:[function(e,t,r){"use strict";var n=e("glslify"),a=e("gl-shader"),i=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n  vec3 vertexPosition = mix(coordinates[0],\n    mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n  vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n  vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n  vec2 delta = weight * clipOffset * screenShape;\n  vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n  gl_Position   = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n  fragColor     = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n  gl_FragColor = fragColor;\n}"]);t.exports=function(e){return a(e,i,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":132,glslify:231}],141:[function(e,t,r){"use strict";var n=e("gl-buffer"),a=e("gl-vao"),i=e("./shaders/index");t.exports=function(e,t){var r=[];function o(e,t,n,a,i,o){var s=[e,t,n,0,0,0,1];s[a+3]=1,s[a]=i,r.push.apply(r,s),s[6]=-1,r.push.apply(r,s),s[a]=o,r.push.apply(r,s),r.push.apply(r,s),s[6]=1,r.push.apply(r,s),s[a]=i,r.push.apply(r,s)}o(0,0,0,0,0,1),o(0,0,0,1,0,1),o(0,0,0,2,0,1),o(1,0,0,1,-1,1),o(1,0,0,2,-1,1),o(0,1,0,0,-1,1),o(0,1,0,2,-1,1),o(0,0,1,0,-1,1),o(0,0,1,1,-1,1);var l=n(e,r),c=a(e,[{type:e.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:e.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:e.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=i(e);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var f=new s(e,l,c,u);return f.update(t),f};var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,n){this.gl=e,this.buffer=t,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var l=s.prototype,c=[0,0,0],u=[0,0,0],f=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(e){},l.draw=function(e){var t=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var a,i=e.model||o,s=e.view||o,l=e.projection||o;this.axes&&(a=this.axes.lastCubeProps.axis);for(var p=c,h=u,d=0;d<3;++d)a&&a[d]<0?(p[d]=this.bounds[0][d],h[d]=this.bounds[1][d]):(p[d]=this.bounds[1][d],h[d]=this.bounds[0][d]);for(f[0]=t.drawingBufferWidth,f[1]=t.drawingBufferHeight,n.uniforms.model=i,n.uniforms.view=s,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,p,h],n.uniforms.colors=this.colors,n.uniforms.screenShape=f,d=0;d<3;++d)n.uniforms.lineWidth=this.lineWidth[d]*this.pixelRatio,this.enabled[d]&&(r.draw(t.TRIANGLES,6,6*d),this.drawSides[d]&&r.draw(t.TRIANGLES,12,18+12*d));r.unbind()},l.update=function(e){e&&("bounds"in e&&(this.bounds=e.bounds),"position"in e&&(this.position=e.position),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"colors"in e&&(this.colors=e.colors),"enabled"in e&&(this.enabled=e.enabled),"drawSides"in e&&(this.drawSides=e.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":140,"gl-buffer":78,"gl-vao":150}],142:[function(e,t,r){var n=e("glslify"),a=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n  // Return up-vector for only-z vector.\n  // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n  // From the above if-statement we have ||a|| > 0  U  ||b|| > 0.\n  // Assign z = 0, x = -b, y = a:\n  // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n  if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n    return normalize(vec3(-v.y, v.x, 0.0));\n  } else {\n    return normalize(vec3(0.0, v.z, -v.y));\n  }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n  float segmentCount = 8.0;\n\n  float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n  vec3 u = getOrthogonalVector(d);\n  vec3 v = normalize(cross(u, d));\n\n  vec3 x = u * cos(angle) * length(d);\n  vec3 y = v * sin(angle) * length(d);\n  vec3 v3 = x + y;\n\n  normal = normalize(v3);\n\n  return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n  // Scale the vector magnitude to stay constant with\n  // model & view changes.\n  vec3 normal;\n  vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n  vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n  //Lighting geometry parameters\n  vec4 cameraCoordinate = view * tubePosition;\n  cameraCoordinate.xyz /= cameraCoordinate.w;\n  f_lightDirection = lightPosition - cameraCoordinate.xyz;\n  f_eyeDirection   = eyePosition - cameraCoordinate.xyz;\n  f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n  // vec4 m_position  = model * vec4(tubePosition, 1.0);\n  vec4 t_position  = view * tubePosition;\n  gl_Position      = projection * t_position;\n\n  f_color          = color;\n  f_data           = tubePosition.xyz;\n  f_position       = position.xyz;\n  f_uv             = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n  float NdotH = max(x, 0.0001);\n  float cos2Alpha = NdotH * NdotH;\n  float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n  float roughness2 = roughness * roughness;\n  float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n  return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n  vec3 lightDirection,\n  vec3 viewDirection,\n  vec3 surfaceNormal,\n  float roughness,\n  float fresnel) {\n\n  float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n  float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n  //Half angle vector\n  vec3 H = normalize(lightDirection + viewDirection);\n\n  //Geometric term\n  float NdotH = max(dot(surfaceNormal, H), 0.0);\n  float VdotH = max(dot(viewDirection, H), 0.000001);\n  float LdotH = max(dot(lightDirection, H), 0.000001);\n  float G1 = (2.0 * NdotH * VdotN) / VdotH;\n  float G2 = (2.0 * NdotH * LdotN) / LdotH;\n  float G = min(1.0, min(G1, G2));\n  \n  //Distribution term\n  float D = beckmannDistribution(NdotH, roughness);\n\n  //Fresnel term\n  float F = pow(1.0 - VdotN, fresnel);\n\n  //Multiply terms and done\n  return  G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n  vec3 N = normalize(f_normal);\n  vec3 L = normalize(f_lightDirection);\n  vec3 V = normalize(f_eyeDirection);\n\n  if(gl_FrontFacing) {\n    N = -N;\n  }\n\n  float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n  float diffuse  = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n  vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n  vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular,  1.0);\n\n  gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n  // Return up-vector for only-z vector.\n  // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n  // From the above if-statement we have ||a|| > 0  U  ||b|| > 0.\n  // Assign z = 0, x = -b, y = a:\n  // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n  if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n    return normalize(vec3(-v.y, v.x, 0.0));\n  } else {\n    return normalize(vec3(0.0, v.z, -v.y));\n  }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n  float segmentCount = 8.0;\n\n  float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n  vec3 u = getOrthogonalVector(d);\n  vec3 v = normalize(cross(u, d));\n\n  vec3 x = u * cos(angle) * length(d);\n  vec3 y = v * sin(angle) * length(d);\n  vec3 v3 = x + y;\n\n  normal = normalize(v3);\n\n  return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  vec3 normal;\n  vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n  vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n  gl_Position = projection * view * tubePosition;\n  f_id        = id;\n  f_position  = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3  clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n  gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:231}],143:[function(e,t,r){"use strict";var n=e("gl-vec3"),a=e("gl-vec4"),i=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(e,t,r,i){for(var o=0,s=0;s<e.length;s++)for(var l=e[s].velocities,c=0;c<l.length;c++)o=Math.max(o,n.length(l[c]));var u=e.map((function(e){return function(e,t,r,i){for(var o=e.points,s=e.velocities,l=e.divergences,c=[],u=[],f=[],p=[],h=[],d=[],m=0,g=0,y=a.create(),v=a.create(),b=0;b<o.length;b++){var x=o[b],_=s[b],w=l[b];0===t&&(w=.05*r),g=n.length(_)/i,y=a.create(),n.copy(y,_),y[3]=w;for(var k=0;k<8;k++)h[k]=[x[0],x[1],x[2],k];if(p.length>0)for(k=0;k<8;k++){var D=(k+1)%8;c.push(p[k],h[k],h[D],h[D],p[D],p[k]),f.push(v,y,y,y,v,v),d.push(m,g,g,g,m,m);var T=c.length;u.push([T-6,T-5,T-4],[T-3,T-2,T-1])}var A=p;p=h,h=A;var S=v;v=y,y=S;var M=m;m=g,g=M}return{positions:c,cells:u,vectors:f,vertexIntensity:d}}(e,r,i,o)})),f=[],p=[],h=[],d=[];for(s=0;s<u.length;s++){var m=u[s],g=f.length;for(f=f.concat(m.positions),h=h.concat(m.vectors),d=d.concat(m.vertexIntensity),c=0;c<m.cells.length;c++){var y=m.cells[c],v=[];p.push(v);for(var b=0;b<y.length;b++)v.push(y[b]+g)}}return{positions:f,cells:p,vectors:h,vertexIntensity:d,colormap:t}},s=function(e,t){var r,n=e.length;for(r=0;r<n;r++){var a=e[r];if(a===t)return r;if(a>t)return r-1}return r},l=function(e,t,r){return e<t?t:e>r?r:e},c=function(e){var t=1/0;e.sort((function(e,t){return e-t}));for(var r=e.length,n=1;n<r;n++){var a=Math.abs(e[n]-e[n-1]);a<t&&(t=a)}return t};t.exports=function(e,t){var r=e.startingPositions,a=e.maxLength||1e3,u=e.tubeSize||1,f=e.absoluteTubeSize,p=e.gridFill||"+x+y+z",h={};-1!==p.indexOf("-x")&&(h.reversedX=!0),-1!==p.indexOf("-y")&&(h.reversedY=!0),-1!==p.indexOf("-z")&&(h.reversedZ=!0),h.filled=i.indexOf(p.replace(/-/g,"").replace(/\+/g,""));var d=e.getVelocity||function(t){return function(e,t,r){var a=t.vectors,i=t.meshgrid,o=e[0],c=e[1],u=e[2],f=i[0].length,p=i[1].length,h=i[2].length,d=s(i[0],o),m=s(i[1],c),g=s(i[2],u),y=d+1,v=m+1,b=g+1;if(d=l(d,0,f-1),y=l(y,0,f-1),m=l(m,0,p-1),v=l(v,0,p-1),g=l(g,0,h-1),b=l(b,0,h-1),d<0||m<0||g<0||y>f-1||v>p-1||b>h-1)return n.create();var x,_,w,k,D,T,A=i[0][d],S=i[0][y],M=i[1][m],E=i[1][v],C=i[2][g],N=(o-A)/(S-A),O=(c-M)/(E-M),I=(u-C)/(i[2][b]-C);switch(isFinite(N)||(N=.5),isFinite(O)||(O=.5),isFinite(I)||(I=.5),r.reversedX&&(d=f-1-d,y=f-1-y),r.reversedY&&(m=p-1-m,v=p-1-v),r.reversedZ&&(g=h-1-g,b=h-1-b),r.filled){case 5:D=g,T=b,w=m*h,k=v*h,x=d*h*p,_=y*h*p;break;case 4:D=g,T=b,x=d*h,_=y*h,w=m*h*f,k=v*h*f;break;case 3:w=m,k=v,D=g*p,T=b*p,x=d*p*h,_=y*p*h;break;case 2:w=m,k=v,x=d*p,_=y*p,D=g*p*f,T=b*p*f;break;case 1:x=d,_=y,D=g*f,T=b*f,w=m*f*h,k=v*f*h;break;default:x=d,_=y,w=m*f,k=v*f,D=g*f*p,T=b*f*p}var P=a[x+w+D],R=a[x+w+T],L=a[x+k+D],F=a[x+k+T],B=a[_+w+D],z=a[_+w+T],j=a[_+k+D],U=a[_+k+T],$=n.create(),V=n.create(),q=n.create(),W=n.create();n.lerp($,P,B,N),n.lerp(V,R,z,N),n.lerp(q,L,j,N),n.lerp(W,F,U,N);var H=n.create(),G=n.create();n.lerp(H,$,q,O),n.lerp(G,V,W,O);var X=n.create();return n.lerp(X,H,G,I),X}(t,e,h)},m=e.getDivergence||function(e,t){var r=n.create(),a=1e-4;n.add(r,e,[a,0,0]);var i=d(r);n.subtract(i,i,t),n.scale(i,i,1/a),n.add(r,e,[0,a,0]);var o=d(r);n.subtract(o,o,t),n.scale(o,o,1/a),n.add(r,e,[0,0,a]);var s=d(r);return n.subtract(s,s,t),n.scale(s,s,1/a),n.add(r,i,o),n.add(r,r,s),r},g=[],y=t[0][0],v=t[0][1],b=t[0][2],x=t[1][0],_=t[1][1],w=t[1][2],k=function(e){var t=e[0],r=e[1],n=e[2];return!(t<y||t>x||r<v||r>_||n<b||n>w)},D=10*n.distance(t[0],t[1])/a,T=D*D,A=1,S=0,M=r.length;M>1&&(A=function(e){for(var t=[],r=[],n=[],a={},i={},o={},s=e.length,l=0;l<s;l++){var u=e[l],f=u[0],p=u[1],h=u[2];a[f]||(t.push(f),a[f]=!0),i[p]||(r.push(p),i[p]=!0),o[h]||(n.push(h),o[h]=!0)}var d=c(t),m=c(r),g=c(n),y=Math.min(d,m,g);return isFinite(y)?y:1}(r));for(var E=0;E<M;E++){var C=n.create();n.copy(C,r[E]);var N=[C],O=[],I=d(C),P=C;O.push(I);var R=[],L=m(C,I),F=n.length(L);isFinite(F)&&F>S&&(S=F),R.push(F),g.push({points:N,velocities:O,divergences:R});for(var B=0;B<100*a&&N.length<a&&k(C);){B++;var z=n.clone(I),j=n.squaredLength(z);if(0===j)break;j>T&&n.scale(z,z,D/Math.sqrt(j)),n.add(z,z,C),I=d(z),n.squaredDistance(P,z)-T>-1e-4*T&&(N.push(z),P=z,O.push(I),L=m(z,I),F=n.length(L),isFinite(F)&&F>S&&(S=F),R.push(F)),C=z}}var U=o(g,e.colormap,S,A);return f?U.tubeScale=f:(0===S&&(S=1),U.tubeScale=.5*u*A/S),U};var u=e("./lib/shaders"),f=e("gl-cone3d").createMesh;t.exports.createTubeMesh=function(e,t){return f(e,t,{shaders:u,traceType:"streamtube"})}},{"./lib/shaders":142,"gl-cone3d":79,"gl-vec3":169,"gl-vec4":205}],144:[function(e,t,r){var n=e("gl-shader"),a=e("glslify"),i=a(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n  vec3 localCoordinate = vec3(uv.zw, f.x);\n  worldCoordinate = objectOffset + localCoordinate;\n  vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n  vec4 clipPosition = projection * view * worldPosition;\n  gl_Position = clipPosition;\n  kill = f.y;\n  value = f.z;\n  planeCoordinate = uv.xy;\n\n  vColor = texture2D(colormap, vec2(value, value));\n\n  //Lighting geometry parameters\n  vec4 cameraCoordinate = view * worldPosition;\n  cameraCoordinate.xyz /= cameraCoordinate.w;\n  lightDirection = lightPosition - cameraCoordinate.xyz;\n  eyeDirection   = eyePosition - cameraCoordinate.xyz;\n  surfaceNormal  = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=a(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n  float NdotH = max(x, 0.0001);\n  float cos2Alpha = NdotH * NdotH;\n  float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n  float roughness2 = roughness * roughness;\n  float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n  return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n  vec3 lightDirection,\n  vec3 viewDirection,\n  vec3 surfaceNormal,\n  float roughness) {\n  return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n  if (\n    kill > 0.0 ||\n    vColor.a == 0.0 ||\n    outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n  ) discard;\n\n  vec3 N = normalize(surfaceNormal);\n  vec3 V = normalize(eyeDirection);\n  vec3 L = normalize(lightDirection);\n\n  if(gl_FrontFacing) {\n    N = -N;\n  }\n\n  float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n  float diffuse  = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n  //decide how to interpolate color — in vertex or in fragment\n  vec4 surfaceColor =\n    step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n    step(.5, vertexColor) * vColor;\n\n  vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular,  1.0);\n\n  gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=a(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n  vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n  worldCoordinate = objectOffset + dataCoordinate;\n  vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n  vec4 clipPosition = projection * view * worldPosition;\n  clipPosition.z += zOffset;\n\n  gl_Position = clipPosition;\n  value = f + objectOffset.z;\n  kill = -1.0;\n  planeCoordinate = uv.zw;\n\n  vColor = texture2D(colormap, vec2(value, value));\n\n  //Don't do lighting for contours\n  surfaceNormal   = vec3(1,0,0);\n  eyeDirection    = vec3(0,1,0);\n  lightDirection  = vec3(0,0,1);\n}\n"]),l=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n  return ((p > max(a, b)) || \n          (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n  return (outOfRange(a.x, b.x, p.x) ||\n          outOfRange(a.y, b.y, p.y) ||\n          outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n  return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n  float vh = 255.0 * v;\n  float upper = floor(vh);\n  float lower = fract(vh);\n  return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n  if ((kill > 0.0) ||\n      (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n  vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n  vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n  gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);r.createShader=function(e){var t=n(e,i,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},r.createPickShader=function(e){var t=n(e,i,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},r.createContourShader=function(e){var t=n(e,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t},r.createPickContourShader=function(e){var t=n(e,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t}},{"gl-shader":132,glslify:231}],145:[function(e,t,r){"use strict";t.exports=function(e){var t=e.gl,r=v(t),n=x(t),s=b(t),l=_(t),c=a(t),u=i(t,[{buffer:c,size:4,stride:40,offset:0},{buffer:c,size:3,stride:40,offset:16},{buffer:c,size:3,stride:40,offset:28}]),f=a(t),p=i(t,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),h=a(t),d=i(t,[{buffer:h,size:2,type:t.FLOAT}]),m=o(t,1,256,t.RGBA,t.UNSIGNED_BYTE);m.minFilter=t.LINEAR,m.magFilter=t.LINEAR;var g=new A(t,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,f,p,h,d,[0,0,0]),y={levels:[[],[],[]]};for(var w in e)y[w]=e[w];return y.colormap=y.colormap||"jet",g.update(y),g};var n=e("bit-twiddle"),a=e("gl-buffer"),i=e("gl-vao"),o=e("gl-texture2d"),s=e("typedarray-pool"),l=e("colormap"),c=e("ndarray-ops"),u=e("ndarray-pack"),f=e("ndarray"),p=e("surface-nets"),h=e("gl-mat4/multiply"),d=e("gl-mat4/invert"),m=e("binary-search-bounds"),g=e("ndarray-gradient"),y=e("./lib/shaders"),v=y.createShader,b=y.createContourShader,x=y.createPickShader,_=y.createPickContourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],D=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function T(e,t,r,n,a){this.position=e,this.index=t,this.uv=r,this.level=n,this.dataCoordinate=a}function A(e,t,r,n,a,i,o,l,c,u,p,h,d,m,g){this.gl=e,this.shape=t,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=a,this._coordinateBuffer=i,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=p,this._contourVAO=h,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new T([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}!function(){for(var e=0;e<3;++e){var t=D[e],r=(e+2)%3;t[(e+1)%3+0]=1,t[r+3]=1,t[e+6]=1}}();var S=A.prototype;S.genColormap=function(e,t){var r=!1,n=u([l({colormap:e,nshades:256,format:"rgba"}).map((function(e,n){var a=t?function(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;r<t.length;++r){if(t.length<2)return 1;if(t[r][0]===e)return t[r][1];if(t[r][0]>e&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}(n/255,t):e[3];return a<1&&(r=!0),[e[0],e[1],e[2],255*a]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},S.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},S.isOpaque=function(){return!this.isTransparent()},S.pickSlots=1,S.setPickBase=function(e){this.pickId=e};var M=[0,0,0],E={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function C(e,t){var r,n,a,i=t.axes&&t.axes.lastCubeProps.axis||M,o=t.showSurface,s=t.showContour;for(r=0;r<3;++r)for(o=o||t.surfaceProject[r],n=0;n<3;++n)s=s||t.contourProject[r][n];for(r=0;r<3;++r){var l=E.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=t.axesBounds[+(i[r]>0)][r],h(l,e.model,l);var c=E.clipBounds[r];for(a=0;a<2;++a)for(n=0;n<3;++n)c[a][n]=e.clipBounds[a][n];c[0][r]=-1e8,c[1][r]=1e8}return E.showSurface=o,E.showContour=s,E}var N={model:w,view:w,projection:w,inverseModel:w.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},O=w.slice(),I=[1,0,0,0,1,0,0,0,1];function P(e,t){e=e||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=N;n.model=e.model||w,n.view=e.view||w,n.projection=e.projection||w,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var i=n.clipBounds[a],o=0;o<3;++o)i[o]=Math.min(Math.max(this.clipBounds[a][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=I,n.vertexColor=this.vertexColor;var s=O;for(h(s,n.view,n.model),h(s,n.projection,s),d(s,s),a=0;a<3;++a)n.eyePosition[a]=s[12+a]/s[15];var l=s[15];for(a=0;a<3;++a)l+=this.lightPosition[a]*s[4*a+3];for(a=0;a<3;++a){var c=s[12+a];for(o=0;o<3;++o)c+=s[4*o+a]*this.lightPosition[o];n.lightPosition[a]=c/l}var u=C(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[a],this._shader.uniforms.clipBounds=u.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var p=this._contourVAO;for(p.bind(),a=0;a<3;++a)for(f.uniforms.permutation=D[a],r.lineWidth(this.contourWidth[a]*this.pixelRatio),o=0;o<this.contourLevels[a].length;++o)o===this.highlightLevel[a]?(f.uniforms.contourColor=this.highlightColor[a],f.uniforms.contourTint=this.highlightTint[a]):0!==o&&o-1!==this.highlightLevel[a]||(f.uniforms.contourColor=this.contourColor[a],f.uniforms.contourTint=this.contourTint[a]),this._contourCounts[a][o]&&(f.uniforms.height=this.contourLevels[a][o],p.draw(r.LINES,this._contourCounts[a][o],this._contourOffsets[a][o]));for(a=0;a<3;++a)for(f.uniforms.model=u.projections[a],f.uniforms.clipBounds=u.clipBounds[a],o=0;o<3;++o)if(this.contourProject[a][o]){f.uniforms.permutation=D[o],r.lineWidth(this.contourWidth[o]*this.pixelRatio);for(var m=0;m<this.contourLevels[o].length;++m)m===this.highlightLevel[o]?(f.uniforms.contourColor=this.highlightColor[o],f.uniforms.contourTint=this.highlightTint[o]):0!==m&&m-1!==this.highlightLevel[o]||(f.uniforms.contourColor=this.contourColor[o],f.uniforms.contourTint=this.contourTint[o]),this._contourCounts[o][m]&&(f.uniforms.height=this.contourLevels[o][m],p.draw(r.LINES,this._contourCounts[o][m],this._contourOffsets[o][m]))}for(p.unbind(),(p=this._dynamicVAO).bind(),a=0;a<3;++a)if(0!==this._dynamicCounts[a])for(f.uniforms.model=n.model,f.uniforms.clipBounds=n.clipBounds,f.uniforms.permutation=D[a],r.lineWidth(this.dynamicWidth[a]*this.pixelRatio),f.uniforms.contourColor=this.dynamicColor[a],f.uniforms.contourTint=this.dynamicTint[a],f.uniforms.height=this.dynamicLevel[a],p.draw(r.LINES,this._dynamicCounts[a],this._dynamicOffsets[a]),o=0;o<3;++o)this.contourProject[o][a]&&(f.uniforms.model=u.projections[o],f.uniforms.clipBounds=u.clipBounds[o],p.draw(r.LINES,this._dynamicCounts[a],this._dynamicOffsets[a]));p.unbind()}}S.draw=function(e){return P.call(this,e,!1)},S.drawTransparent=function(e){return P.call(this,e,!0)};var R={model:w,view:w,projection:w,inverseModel:w,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,objectOffset:[0,0,0],permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};function L(e,t){return Array.isArray(e)?[t(e[0]),t(e[1]),t(e[2])]:[t(e),t(e),t(e)]}function F(e){return Array.isArray(e)?3===e.length?[e[0],e[1],e[2],1]:[e[0],e[1],e[2],e[3]]:[0,0,0,1]}function B(e){if(Array.isArray(e)){if(Array.isArray(e))return[F(e[0]),F(e[1]),F(e[2])];var t=F(e);return[t.slice(),t.slice(),t.slice()]}}S.drawPick=function(e){e=e||{};var t=this.gl;t.disable(t.CULL_FACE);var r=R;r.model=e.model||w,r.view=e.view||w,r.projection=e.projection||w,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.objectOffset=this.objectOffset,r.permutation=I;for(var n=0;n<2;++n)for(var a=r.clipBounds[n],i=0;i<3;++i)a[i]=Math.min(Math.max(this.clipBounds[n][i],-1e8),1e8);var o=C(r,this);if(o.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(t.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=o.projections[n],this._pickShader.uniforms.clipBounds=o.clipBounds[n],this._vao.draw(t.TRIANGLES,this._vertexCount));this._vao.unbind()}if(o.showContour){var s=this._contourPickShader;s.bind(),s.uniforms=r;var l=this._contourVAO;for(l.bind(),i=0;i<3;++i)for(t.lineWidth(this.contourWidth[i]*this.pixelRatio),s.uniforms.permutation=D[i],n=0;n<this.contourLevels[i].length;++n)this._contourCounts[i][n]&&(s.uniforms.height=this.contourLevels[i][n],l.draw(t.LINES,this._contourCounts[i][n],this._contourOffsets[i][n]));for(n=0;n<3;++n)for(s.uniforms.model=o.projections[n],s.uniforms.clipBounds=o.clipBounds[n],i=0;i<3;++i)if(this.contourProject[n][i]){s.uniforms.permutation=D[i],t.lineWidth(this.contourWidth[i]*this.pixelRatio);for(var c=0;c<this.contourLevels[i].length;++c)this._contourCounts[i][c]&&(s.uniforms.height=this.contourLevels[i][c],l.draw(t.LINES,this._contourCounts[i][c],this._contourOffsets[i][c]))}l.unbind()}},S.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=this._field[2].shape,r=this._pickResult,n=t[0]*(e.value[0]+(e.value[2]>>4)/16)/255,a=Math.floor(n),i=n-a,o=t[1]*(e.value[1]+(15&e.value[2])/16)/255,s=Math.floor(o),l=o-s;a+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?i:1-i,p=0;p<2;++p)for(var h=a+u,d=s+p,g=f*(p?l:1-l),y=0;y<3;++y)c[y]+=this._field[y].get(h,d)*g;for(var v=this._pickResult.level,b=0;b<3;++b)if(v[b]=m.le(this.contourLevels[b],c[b]),v[b]<0)this.contourLevels[b].length>0&&(v[b]=0);else if(v[b]<this.contourLevels[b].length-1){var x=this.contourLevels[b][v[b]],_=this.contourLevels[b][v[b]+1];Math.abs(x-c[b])>Math.abs(_-c[b])&&(v[b]+=1)}for(r.index[0]=i<.5?a:a+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/t[0],r.uv[1]=o/t[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},S.padField=function(e,t){var r=t.shape.slice(),n=e.shape.slice();c.assign(e.lo(1,1).hi(r[0],r[1]),t),c.assign(e.lo(1).hi(r[0],1),t.hi(r[0],1)),c.assign(e.lo(1,n[1]-1).hi(r[0],1),t.lo(0,r[1]-1).hi(r[0],1)),c.assign(e.lo(0,1).hi(1,r[1]),t.hi(1)),c.assign(e.lo(n[0]-1,1).hi(1,r[1]),t.lo(r[0]-1)),e.set(0,0,t.get(0,0)),e.set(0,n[1]-1,t.get(0,r[1]-1)),e.set(n[0]-1,0,t.get(r[0]-1,0)),e.set(n[0]-1,n[1]-1,t.get(r[0]-1,r[1]-1))},S.update=function(e){e=e||{},this.objectOffset=e.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in e&&(this.contourWidth=L(e.contourWidth,Number)),"showContour"in e&&(this.showContour=L(e.showContour,Boolean)),"showSurface"in e&&(this.showSurface=!!e.showSurface),"contourTint"in e&&(this.contourTint=L(e.contourTint,Boolean)),"contourColor"in e&&(this.contourColor=B(e.contourColor)),"contourProject"in e&&(this.contourProject=L(e.contourProject,(function(e){return L(e,Boolean)}))),"surfaceProject"in e&&(this.surfaceProject=e.surfaceProject),"dynamicColor"in e&&(this.dynamicColor=B(e.dynamicColor)),"dynamicTint"in e&&(this.dynamicTint=L(e.dynamicTint,Number)),"dynamicWidth"in e&&(this.dynamicWidth=L(e.dynamicWidth,Number)),"opacity"in e&&(this.opacity=e.opacity),"opacityscale"in e&&(this.opacityscale=e.opacityscale),"colorBounds"in e&&(this.colorBounds=e.colorBounds),"vertexColor"in e&&(this.vertexColor=e.vertexColor?1:0),"colormap"in e&&this._colorMap.setPixels(this.genColormap(e.colormap,this.opacityscale));var t=e.field||e.coords&&e.coords[2]||null,r=!1;if(t||(t=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in e||"coords"in e){var a=(t.shape[0]+2)*(t.shape[1]+2);a>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(a))),this._field[2]=f(this._field[2].data,[t.shape[0]+2,t.shape[1]+2]),this.padField(this._field[2],t),this.shape=t.shape.slice();for(var i=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[i[0]+2,i[1]+2]);if(e.coords){var l=e.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(y=0;y<2;++y)if(c.shape[y]!==i[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(e.ticks){var u=e.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var h=u[o];if((Array.isArray(h)||h.length)&&(h=f(h)),h.shape[0]!==i[o])throw new Error("gl-surface: invalid tick length");var d=f(h.data,i);d.stride[o]=h.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=f(this._field[o].data,[i[0]+2,i[1]+2],m,0)}this._field[0].set(0,0,0);for(var y=0;y<i[0];++y)this._field[0].set(y+1,0,y);for(this._field[0].set(i[0]+1,0,i[0]-1),this._field[1].set(0,0,0),y=0;y<i[1];++y)this._field[1].set(0,y+1,y);this._field[1].set(0,i[1]+1,i[1]-1)}var v=this._field,b=f(s.mallocFloat(3*v[2].size*2),[3,i[0]+2,i[1]+2,2]);for(o=0;o<3;++o)g(b.pick(o),v[o],"mirror");var x=f(s.mallocFloat(3*v[2].size),[i[0]+2,i[1]+2,3]);for(o=0;o<i[0]+2;++o)for(y=0;y<i[1]+2;++y){var _=b.get(0,o,y,0),w=b.get(0,o,y,1),D=b.get(1,o,y,0),T=b.get(1,o,y,1),A=b.get(2,o,y,0),S=b.get(2,o,y,1),M=D*S-T*A,E=A*w-S*_,C=_*T-w*D,N=Math.sqrt(M*M+E*E+C*C);N<1e-8?(N=Math.max(Math.abs(M),Math.abs(E),Math.abs(C)))<1e-8?(C=1,E=M=0,N=1):N=1/N:N=1/Math.sqrt(N),x.set(o,y,0,M*N),x.set(o,y,1,E*N),x.set(o,y,2,C*N)}s.free(b.data);var O=[1/0,1/0,1/0],I=[-1/0,-1/0,-1/0],P=1/0,R=-1/0,F=(i[0]-1)*(i[1]-1)*6,z=s.mallocFloat(n.nextPow2(10*F)),j=0,U=0;for(o=0;o<i[0]-1;++o)e:for(y=0;y<i[1]-1;++y){for(var $=0;$<2;++$)for(var V=0;V<2;++V)for(var q=0;q<3;++q){var W=this._field[q].get(1+o+$,1+y+V);if(isNaN(W)||!isFinite(W))continue e}for(q=0;q<6;++q){var H=o+k[q][0],G=y+k[q][1],X=this._field[0].get(H+1,G+1),Y=this._field[1].get(H+1,G+1);W=this._field[2].get(H+1,G+1),M=x.get(H+1,G+1,0),E=x.get(H+1,G+1,1),C=x.get(H+1,G+1,2),e.intensity&&(Z=e.intensity.get(H,G));var Z=e.intensity?e.intensity.get(H,G):W+this.objectOffset[2];z[j++]=H,z[j++]=G,z[j++]=X,z[j++]=Y,z[j++]=W,z[j++]=0,z[j++]=Z,z[j++]=M,z[j++]=E,z[j++]=C,O[0]=Math.min(O[0],X+this.objectOffset[0]),O[1]=Math.min(O[1],Y+this.objectOffset[1]),O[2]=Math.min(O[2],W+this.objectOffset[2]),P=Math.min(P,Z),I[0]=Math.max(I[0],X+this.objectOffset[0]),I[1]=Math.max(I[1],Y+this.objectOffset[1]),I[2]=Math.max(I[2],W+this.objectOffset[2]),R=Math.max(R,Z),U+=1}}for(e.intensityBounds&&(P=+e.intensityBounds[0],R=+e.intensityBounds[1]),o=6;o<j;o+=10)z[o]=(z[o]-P)/(R-P);this._vertexCount=U,this._coordinateBuffer.update(z.subarray(0,j)),s.freeFloat(z),s.free(x.data),this.bounds=[O,I],this.intensity=e.intensity||this._field[2],this.intensityBounds[0]===P&&this.intensityBounds[1]===R||(r=!0),this.intensityBounds=[P,R]}if("levels"in e){var K=e.levels;for(K=Array.isArray(K[0])?K.slice():[[],[],K],o=0;o<3;++o)K[o]=K[o].slice(),K[o].sort((function(e,t){return e-t}));for(o=0;o<3;++o)for(y=0;y<K[o].length;++y)K[o][y]-=this.objectOffset[o];e:for(o=0;o<3;++o){if(K[o].length!==this.contourLevels[o].length){r=!0;break}for(y=0;y<K[o].length;++y)if(K[o][y]!==this.contourLevels[o][y]){r=!0;break e}}this.contourLevels=K}if(r){v=this._field,i=this.shape;for(var J=[],Q=0;Q<3;++Q){var ee=this.contourLevels[Q],te=[],re=[],ne=[0,0,0];for(o=0;o<ee.length;++o){var ae=p(this._field[Q],ee[o]);te.push(J.length/5|0),U=0;e:for(y=0;y<ae.cells.length;++y){var ie=ae.cells[y];for(q=0;q<2;++q){var oe=ae.positions[ie[q]],se=oe[0],le=0|Math.floor(se),ce=se-le,ue=oe[1],fe=0|Math.floor(ue),pe=ue-fe,he=!1;t:for(var de=0;de<3;++de){ne[de]=0;var me=(Q+de+1)%3;for($=0;$<2;++$){var ge=$?ce:1-ce;for(H=0|Math.min(Math.max(le+$,0),i[0]),V=0;V<2;++V){var ye=V?pe:1-pe;if(G=0|Math.min(Math.max(fe+V,0),i[1]),W=de<2?this._field[me].get(H,G):(this.intensity.get(H,G)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(W)||isNaN(W)){he=!0;break t}var ve=ge*ye;ne[de]+=ve*W}}}if(he){if(q>0){for(var be=0;be<5;++be)J.pop();U-=1}continue e}J.push(ne[0],ne[1],oe[0],oe[1],ne[2]),U+=1}}re.push(U)}this._contourOffsets[Q]=te,this._contourCounts[Q]=re}var xe=s.mallocFloat(J.length);for(o=0;o<J.length;++o)xe[o]=J[o];this._contourBuffer.update(xe),s.freeFloat(xe)}},S.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var e=0;e<3;++e)s.freeFloat(this._field[e].data)},S.highlight=function(e){var t,r;if(!e)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(t=0;t<3;++t)this.enableHighlight[t]?this.highlightLevel[t]=e.level[t]:this.highlightLevel[t]=-1;for(r=this.snapToData?e.dataCoordinate:e.position,t=0;t<3;++t)r[t]-=this.objectOffset[t];if(this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,a=this.shape,i=s.mallocFloat(12*a[0]*a[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var l=(o+1)%3,c=(o+2)%3,u=this._field[o],f=this._field[l],h=this._field[c],d=p(u,r[o]),m=d.cells,g=d.positions;for(this._dynamicOffsets[o]=n,t=0;t<m.length;++t)for(var y=m[t],v=0;v<2;++v){var b=g[y[v]],x=+b[0],_=0|x,w=0|Math.min(_+1,a[0]),k=x-_,D=1-k,T=+b[1],A=0|T,S=0|Math.min(A+1,a[1]),M=T-A,E=1-M,C=D*E,N=D*M,O=k*E,I=k*M,P=C*f.get(_,A)+N*f.get(_,S)+O*f.get(w,A)+I*f.get(w,S),R=C*h.get(_,A)+N*h.get(_,S)+O*h.get(w,A)+I*h.get(w,S);if(isNaN(P)||isNaN(R)){v&&(n-=1);break}i[2*n+0]=P,i[2*n+1]=R,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(i.subarray(0,2*n)),s.freeFloat(i)}}},{"./lib/shaders":144,"binary-search-bounds":31,"bit-twiddle":32,colormap:53,"gl-buffer":78,"gl-mat4/invert":98,"gl-mat4/multiply":100,"gl-texture2d":146,"gl-vao":150,ndarray:259,"ndarray-gradient":252,"ndarray-ops":254,"ndarray-pack":255,"surface-nets":302,"typedarray-pool":308}],146:[function(e,t,r){"use strict";var n=e("ndarray"),a=e("ndarray-ops"),i=e("typedarray-pool");t.exports=function(e){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(o||c(e),"number"==typeof arguments[1])return y(e,arguments[1],arguments[2],arguments[3]||e.RGBA,arguments[4]||e.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return y(e,0|arguments[1][0],0|arguments[1][1],arguments[2]||e.RGBA,arguments[3]||e.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var t=arguments[1],r=u(t)?t:t.raw;if(r)return v(e,r,0|t.width,0|t.height,arguments[2]||e.RGBA,arguments[3]||e.UNSIGNED_BYTE);if(t.shape&&t.data&&t.stride)return b(e,t)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(e){o=[e.LINEAR,e.NEAREST_MIPMAP_LINEAR,e.LINEAR_MIPMAP_NEAREST,e.LINEAR_MIPMAP_NEAREST],s=[e.NEAREST,e.LINEAR,e.NEAREST_MIPMAP_NEAREST,e.NEAREST_MIPMAP_LINEAR,e.LINEAR_MIPMAP_NEAREST,e.LINEAR_MIPMAP_LINEAR],l=[e.REPEAT,e.CLAMP_TO_EDGE,e.MIRRORED_REPEAT]}function u(e){return"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&e instanceof ImageData}var f=function(e,t){a.muls(e,t,255)};function p(e,t,r){var n=e.gl,a=n.getParameter(n.MAX_TEXTURE_SIZE);if(t<0||t>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture size");return e._shape=[t,r],e.bind(),n.texImage2D(n.TEXTURE_2D,0,e.format,t,r,0,e.format,e.type,null),e._mipLevels=[0],e}function h(e,t,r,n,a,i){this.gl=e,this.handle=t,this.format=a,this.type=i,this._shape=[r,n],this._mipLevels=[0],this._magFilter=e.NEAREST,this._minFilter=e.NEAREST,this._wrapS=e.CLAMP_TO_EDGE,this._wrapT=e.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(e){return o.wrapS=e}},{get:function(){return o._wrapT},set:function(e){return o.wrapT=e}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(e){return o.width=e}},{get:function(){return o._shape[1]},set:function(e){return o.height=e}}]),this._shapeVector=l}var d=h.prototype;function m(e,t){return 3===e.length?1===t[2]&&t[1]===e[0]*e[2]&&t[0]===e[2]:1===t[0]&&t[1]===e[0]}function g(e){var t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t}function y(e,t,r,n,a){var i=e.getParameter(e.MAX_TEXTURE_SIZE);if(t<0||t>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture shape");if(a===e.FLOAT&&!e.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=g(e);return e.texImage2D(e.TEXTURE_2D,0,n,t,r,0,n,a,null),new h(e,o,t,r,n,a)}function v(e,t,r,n,a,i){var o=g(e);return e.texImage2D(e.TEXTURE_2D,0,a,a,i,t),new h(e,o,r,n,a,i)}function b(e,t){var r=t.dtype,o=t.shape.slice(),s=e.getParameter(e.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=m(o,t.stride.slice()),c=0;"float32"===r?c=e.FLOAT:"float64"===r?(c=e.FLOAT,l=!1,r="float32"):"uint8"===r?c=e.UNSIGNED_BYTE:(c=e.UNSIGNED_BYTE,l=!1,r="uint8");var u,p,d=0;if(2===o.length)d=e.LUMINANCE,o=[o[0],o[1],1],t=n(t.data,o,[t.stride[0],t.stride[1],1],t.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])d=e.ALPHA;else if(2===o[2])d=e.LUMINANCE_ALPHA;else if(3===o[2])d=e.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=e.RGBA}}c!==e.FLOAT||e.getExtension("OES_texture_float")||(c=e.UNSIGNED_BYTE,l=!1);var y=t.size;if(l)u=0===t.offset&&t.data.length===y?t.data:t.data.subarray(t.offset,t.offset+y);else{var v=[o[2],o[2]*o[0],1];p=i.malloc(y,r);var b=n(p,o,v,0);"float32"!==r&&"float64"!==r||c!==e.UNSIGNED_BYTE?a.assign(b,t):f(b,t),u=p.subarray(0,y)}var x=g(e);return e.texImage2D(e.TEXTURE_2D,0,d,o[0],o[1],0,d,c,u),l||i.free(p),new h(e,x,o[0],o[1],d,c)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),this._minFilter=e}},magFilter:{get:function(){return this._magFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),this._magFilter=e}},mipSamples:{get:function(){return this._anisoSamples},set:function(e){var t=this._anisoSamples;if(this._anisoSamples=0|Math.max(e,1),t!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,e),this._wrapS=e}},wrapT:{get:function(){return this._wrapT},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,e),this._wrapT=e}},wrap:{get:function(){return this._wrapVector},set:function(e){if(Array.isArray(e)||(e=[e,e]),2!==e.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var t=0;t<2;++t)if(l.indexOf(e[t])<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);this._wrapS=e[0],this._wrapT=e[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),e}},shape:{get:function(){return this._shapeVector},set:function(e){if(Array.isArray(e)){if(2!==e.length)throw new Error("gl-texture2d: Invalid texture shape")}else e=[0|e,0|e];return p(this,0|e[0],0|e[1]),[0|e[0],0|e[1]]}},width:{get:function(){return this._shape[0]},set:function(e){return p(this,e|=0,this._shape[1]),e}},height:{get:function(){return this._shape[1]},set:function(e){return e|=0,p(this,this._shape[0],e),e}}}),d.bind=function(e){var t=this.gl;return void 0!==e&&t.activeTexture(t.TEXTURE0+(0|e)),t.bindTexture(t.TEXTURE_2D,this.handle),void 0!==e?0|e:t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var e=Math.min(this._shape[0],this._shape[1]),t=0;e>0;++t,e>>>=1)this._mipLevels.indexOf(t)<0&&this._mipLevels.push(t)},d.setPixels=function(e,t,r,o){var s=this.gl;this.bind(),Array.isArray(t)?(o=r,r=0|t[1],t=0|t[0]):(t=t||0,r=r||0),o=o||0;var l=u(e)?e:e.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,t,r,this.format,this.type,l);else{if(!(e.shape&&e.stride&&e.data))throw new Error("gl-texture2d: Unsupported data type");if(e.shape.length<2||t+e.shape[1]>this._shape[1]>>>o||r+e.shape[0]>this._shape[0]>>>o||t<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(e,t,r,o,s,l,c,u){var p=u.dtype,h=u.shape.slice();if(h.length<2||h.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var d=0,g=0,y=m(h,u.stride.slice());if("float32"===p?d=e.FLOAT:"float64"===p?(d=e.FLOAT,y=!1,p="float32"):"uint8"===p?d=e.UNSIGNED_BYTE:(d=e.UNSIGNED_BYTE,y=!1,p="uint8"),2===h.length)g=e.LUMINANCE,h=[h[0],h[1],1],u=n(u.data,h,[u.stride[0],u.stride[1],1],u.offset);else{if(3!==h.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===h[2])g=e.ALPHA;else if(2===h[2])g=e.LUMINANCE_ALPHA;else if(3===h[2])g=e.RGB;else{if(4!==h[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=e.RGBA}h[2]}if(g!==e.LUMINANCE&&g!==e.ALPHA||s!==e.LUMINANCE&&s!==e.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=u.size,b=c.indexOf(o)<0;if(b&&c.push(o),d===l&&y)0===u.offset&&u.data.length===v?b?e.texImage2D(e.TEXTURE_2D,o,s,h[0],h[1],0,s,l,u.data):e.texSubImage2D(e.TEXTURE_2D,o,t,r,h[0],h[1],s,l,u.data):b?e.texImage2D(e.TEXTURE_2D,o,s,h[0],h[1],0,s,l,u.data.subarray(u.offset,u.offset+v)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,h[0],h[1],s,l,u.data.subarray(u.offset,u.offset+v));else{var x;x=l===e.FLOAT?i.mallocFloat32(v):i.mallocUint8(v);var _=n(x,h,[h[2],h[2]*h[0],1]);d===e.FLOAT&&l===e.UNSIGNED_BYTE?f(_,u):a.assign(_,u),b?e.texImage2D(e.TEXTURE_2D,o,s,h[0],h[1],0,s,l,x.subarray(0,v)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,h[0],h[1],s,l,x.subarray(0,v)),l===e.FLOAT?i.freeFloat32(x):i.freeUint8(x)}}(s,t,r,o,this.format,this.type,this._mipLevels,e)}}},{ndarray:259,"ndarray-ops":254,"typedarray-pool":308}],147:[function(e,t,r){"use strict";t.exports=function(e,t,r){t?t.bind():e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null);var n=0|e.getParameter(e.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var a=0;a<r.length;++a){var i=r[a];if(i.buffer){var o=i.buffer,s=i.size||4,l=i.type||e.FLOAT,c=!!i.normalized,u=i.stride||0,f=i.offset||0;o.bind(),e.enableVertexAttribArray(a),e.vertexAttribPointer(a,s,l,c,u,f)}else{if("number"==typeof i)e.vertexAttrib1f(a,i);else if(1===i.length)e.vertexAttrib1f(a,i[0]);else if(2===i.length)e.vertexAttrib2f(a,i[0],i[1]);else if(3===i.length)e.vertexAttrib3f(a,i[0],i[1],i[2]);else{if(4!==i.length)throw new Error("gl-vao: Invalid vertex attribute");e.vertexAttrib4f(a,i[0],i[1],i[2],i[3])}e.disableVertexAttribArray(a)}}for(;a<n;++a)e.disableVertexAttribArray(a)}else for(e.bindBuffer(e.ARRAY_BUFFER,null),a=0;a<n;++a)e.disableVertexAttribArray(a)}},{}],148:[function(e,t,r){"use strict";var n=e("./do-bind.js");function a(e){this.gl=e,this._elements=null,this._attributes=null,this._elementsType=e.UNSIGNED_SHORT}a.prototype.bind=function(){n(this.gl,this._elements,this._attributes)},a.prototype.update=function(e,t,r){this._elements=t,this._attributes=e,this._elementsType=r||this.gl.UNSIGNED_SHORT},a.prototype.dispose=function(){},a.prototype.unbind=function(){},a.prototype.draw=function(e,t,r){r=r||0;var n=this.gl;this._elements?n.drawElements(e,t,this._elementsType,r):n.drawArrays(e,r,t)},t.exports=function(e){return new a(e)}},{"./do-bind.js":147}],149:[function(e,t,r){"use strict";var n=e("./do-bind.js");function a(e,t,r,n,a,i){this.location=e,this.dimension=t,this.a=r,this.b=n,this.c=a,this.d=i}function i(e,t,r){this.gl=e,this._ext=t,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=e.UNSIGNED_SHORT}a.prototype.bind=function(e){switch(this.dimension){case 1:e.vertexAttrib1f(this.location,this.a);break;case 2:e.vertexAttrib2f(this.location,this.a,this.b);break;case 3:e.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:e.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var e=0;e<this._attribs.length;++e)this._attribs[e].bind(this.gl)},i.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},i.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},i.prototype.update=function(e,t,r){if(this.bind(),n(this.gl,t,e),this.unbind(),this._attribs.length=0,e)for(var i=0;i<e.length;++i){var o=e[i];"number"==typeof o?this._attribs.push(new a(i,1,o)):Array.isArray(o)&&this._attribs.push(new a(i,o.length,o[0],o[1],o[2],o[3]))}this._useElements=!!t,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.draw=function(e,t,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(e,t,this._elementsType,r):n.drawArrays(e,r,t)},t.exports=function(e,t){return new i(e,t,t.createVertexArrayOES())}},{"./do-bind.js":147}],150:[function(e,t,r){"use strict";var n=e("./lib/vao-native.js"),a=e("./lib/vao-emulated.js");function i(e){this.bindVertexArrayOES=e.bindVertexArray.bind(e),this.createVertexArrayOES=e.createVertexArray.bind(e),this.deleteVertexArrayOES=e.deleteVertexArray.bind(e)}t.exports=function(e,t,r,o){var s,l=e.createVertexArray?new i(e):e.getExtension("OES_vertex_array_object");return(s=l?n(e,l):a(e)).update(t,r,o),s}},{"./lib/vao-emulated.js":148,"./lib/vao-native.js":149}],151:[function(e,t,r){t.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}},{}],152:[function(e,t,r){t.exports=function(e,t){var r=n(e[0],e[1],e[2]),o=n(t[0],t[1],t[2]);a(r,r),a(o,o);var s=i(r,o);return s>1?0:Math.acos(s)};var n=e("./fromValues"),a=e("./normalize"),i=e("./dot")},{"./dot":162,"./fromValues":168,"./normalize":179}],153:[function(e,t,r){t.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}},{}],154:[function(e,t,r){t.exports=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],155:[function(e,t,r){t.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],156:[function(e,t,r){t.exports=function(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},{}],157:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=r[0],s=r[1],l=r[2];return e[0]=a*l-i*s,e[1]=i*o-n*l,e[2]=n*s-a*o,e}},{}],158:[function(e,t,r){t.exports=e("./distance")},{"./distance":159}],159:[function(e,t,r){t.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],a=t[2]-e[2];return Math.sqrt(r*r+n*n+a*a)}},{}],160:[function(e,t,r){t.exports=e("./divide")},{"./divide":161}],161:[function(e,t,r){t.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}},{}],162:[function(e,t,r){t.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},{}],163:[function(e,t,r){t.exports=1e-6},{}],164:[function(e,t,r){t.exports=function(e,t){var r=e[0],a=e[1],i=e[2],o=t[0],s=t[1],l=t[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(a-s)<=n*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(i-l)<=n*Math.max(1,Math.abs(i),Math.abs(l))};var n=e("./epsilon")},{"./epsilon":163}],165:[function(e,t,r){t.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},{}],166:[function(e,t,r){t.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}},{}],167:[function(e,t,r){t.exports=function(e,t,r,a,i,o){var s,l;for(t||(t=3),r||(r=0),l=a?Math.min(a*t+r,e.length):e.length,s=r;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],n[2]=e[s+2],i(n,n,o),e[s]=n[0],e[s+1]=n[1],e[s+2]=n[2];return e};var n=e("./create")()},{"./create":156}],168:[function(e,t,r){t.exports=function(e,t,r){var n=new Float32Array(3);return n[0]=e,n[1]=t,n[2]=r,n}},{}],169:[function(e,t,r){t.exports={EPSILON:e("./epsilon"),create:e("./create"),clone:e("./clone"),angle:e("./angle"),fromValues:e("./fromValues"),copy:e("./copy"),set:e("./set"),equals:e("./equals"),exactEquals:e("./exactEquals"),add:e("./add"),subtract:e("./subtract"),sub:e("./sub"),multiply:e("./multiply"),mul:e("./mul"),divide:e("./divide"),div:e("./div"),min:e("./min"),max:e("./max"),floor:e("./floor"),ceil:e("./ceil"),round:e("./round"),scale:e("./scale"),scaleAndAdd:e("./scaleAndAdd"),distance:e("./distance"),dist:e("./dist"),squaredDistance:e("./squaredDistance"),sqrDist:e("./sqrDist"),length:e("./length"),len:e("./len"),squaredLength:e("./squaredLength"),sqrLen:e("./sqrLen"),negate:e("./negate"),inverse:e("./inverse"),normalize:e("./normalize"),dot:e("./dot"),cross:e("./cross"),lerp:e("./lerp"),random:e("./random"),transformMat4:e("./transformMat4"),transformMat3:e("./transformMat3"),transformQuat:e("./transformQuat"),rotateX:e("./rotateX"),rotateY:e("./rotateY"),rotateZ:e("./rotateZ"),forEach:e("./forEach")}},{"./add":151,"./angle":152,"./ceil":153,"./clone":154,"./copy":155,"./create":156,"./cross":157,"./dist":158,"./distance":159,"./div":160,"./divide":161,"./dot":162,"./epsilon":163,"./equals":164,"./exactEquals":165,"./floor":166,"./forEach":167,"./fromValues":168,"./inverse":170,"./len":171,"./length":172,"./lerp":173,"./max":174,"./min":175,"./mul":176,"./multiply":177,"./negate":178,"./normalize":179,"./random":180,"./rotateX":181,"./rotateY":182,"./rotateZ":183,"./round":184,"./scale":185,"./scaleAndAdd":186,"./set":187,"./sqrDist":188,"./sqrLen":189,"./squaredDistance":190,"./squaredLength":191,"./sub":192,"./subtract":193,"./transformMat3":194,"./transformMat4":195,"./transformQuat":196}],170:[function(e,t,r){t.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}},{}],171:[function(e,t,r){t.exports=e("./length")},{"./length":172}],172:[function(e,t,r){t.exports=function(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}},{}],173:[function(e,t,r){t.exports=function(e,t,r,n){var a=t[0],i=t[1],o=t[2];return e[0]=a+n*(r[0]-a),e[1]=i+n*(r[1]-i),e[2]=o+n*(r[2]-o),e}},{}],174:[function(e,t,r){t.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}},{}],175:[function(e,t,r){t.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}},{}],176:[function(e,t,r){t.exports=e("./multiply")},{"./multiply":177}],177:[function(e,t,r){t.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}},{}],178:[function(e,t,r){t.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}},{}],179:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=r*r+n*n+a*a;return i>0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i),e}},{}],180:[function(e,t,r){t.exports=function(e,t){t=t||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,a=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*a,e[1]=Math.sin(r)*a,e[2]=n*t,e}},{}],181:[function(e,t,r){t.exports=function(e,t,r,n){var a=r[1],i=r[2],o=t[1]-a,s=t[2]-i,l=Math.sin(n),c=Math.cos(n);return e[0]=t[0],e[1]=a+o*c-s*l,e[2]=i+o*l+s*c,e}},{}],182:[function(e,t,r){t.exports=function(e,t,r,n){var a=r[0],i=r[2],o=t[0]-a,s=t[2]-i,l=Math.sin(n),c=Math.cos(n);return e[0]=a+s*l+o*c,e[1]=t[1],e[2]=i+s*c-o*l,e}},{}],183:[function(e,t,r){t.exports=function(e,t,r,n){var a=r[0],i=r[1],o=t[0]-a,s=t[1]-i,l=Math.sin(n),c=Math.cos(n);return e[0]=a+o*c-s*l,e[1]=i+o*l+s*c,e[2]=t[2],e}},{}],184:[function(e,t,r){t.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}},{}],185:[function(e,t,r){t.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}},{}],186:[function(e,t,r){t.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}},{}],187:[function(e,t,r){t.exports=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}},{}],188:[function(e,t,r){t.exports=e("./squaredDistance")},{"./squaredDistance":190}],189:[function(e,t,r){t.exports=e("./squaredLength")},{"./squaredLength":191}],190:[function(e,t,r){t.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],a=t[2]-e[2];return r*r+n*n+a*a}},{}],191:[function(e,t,r){t.exports=function(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}},{}],192:[function(e,t,r){t.exports=e("./subtract")},{"./subtract":193}],193:[function(e,t,r){t.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}},{}],194:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2];return e[0]=n*r[0]+a*r[3]+i*r[6],e[1]=n*r[1]+a*r[4]+i*r[7],e[2]=n*r[2]+a*r[5]+i*r[8],e}},{}],195:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=r[3]*n+r[7]*a+r[11]*i+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*a+r[8]*i+r[12])/o,e[1]=(r[1]*n+r[5]*a+r[9]*i+r[13])/o,e[2]=(r[2]*n+r[6]*a+r[10]*i+r[14])/o,e}},{}],196:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*i-l*a,f=c*a+l*n-o*i,p=c*i+o*a-s*n,h=-o*n-s*a-l*i;return e[0]=u*c+h*-o+f*-l-p*-s,e[1]=f*c+h*-s+p*-o-u*-l,e[2]=p*c+h*-l+u*-s-f*-o,e}},{}],197:[function(e,t,r){t.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}},{}],198:[function(e,t,r){t.exports=function(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],199:[function(e,t,r){t.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],200:[function(e,t,r){t.exports=function(){var e=new Float32Array(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}},{}],201:[function(e,t,r){t.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],a=t[2]-e[2],i=t[3]-e[3];return Math.sqrt(r*r+n*n+a*a+i*i)}},{}],202:[function(e,t,r){t.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}},{}],203:[function(e,t,r){t.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}},{}],204:[function(e,t,r){t.exports=function(e,t,r,n){var a=new Float32Array(4);return a[0]=e,a[1]=t,a[2]=r,a[3]=n,a}},{}],205:[function(e,t,r){t.exports={create:e("./create"),clone:e("./clone"),fromValues:e("./fromValues"),copy:e("./copy"),set:e("./set"),add:e("./add"),subtract:e("./subtract"),multiply:e("./multiply"),divide:e("./divide"),min:e("./min"),max:e("./max"),scale:e("./scale"),scaleAndAdd:e("./scaleAndAdd"),distance:e("./distance"),squaredDistance:e("./squaredDistance"),length:e("./length"),squaredLength:e("./squaredLength"),negate:e("./negate"),inverse:e("./inverse"),normalize:e("./normalize"),dot:e("./dot"),lerp:e("./lerp"),random:e("./random"),transformMat4:e("./transformMat4"),transformQuat:e("./transformQuat")}},{"./add":197,"./clone":198,"./copy":199,"./create":200,"./distance":201,"./divide":202,"./dot":203,"./fromValues":204,"./inverse":206,"./length":207,"./lerp":208,"./max":209,"./min":210,"./multiply":211,"./negate":212,"./normalize":213,"./random":214,"./scale":215,"./scaleAndAdd":216,"./set":217,"./squaredDistance":218,"./squaredLength":219,"./subtract":220,"./transformMat4":221,"./transformQuat":222}],206:[function(e,t,r){t.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}},{}],207:[function(e,t,r){t.exports=function(e){var t=e[0],r=e[1],n=e[2],a=e[3];return Math.sqrt(t*t+r*r+n*n+a*a)}},{}],208:[function(e,t,r){t.exports=function(e,t,r,n){var a=t[0],i=t[1],o=t[2],s=t[3];return e[0]=a+n*(r[0]-a),e[1]=i+n*(r[1]-i),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}},{}],209:[function(e,t,r){t.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}},{}],210:[function(e,t,r){t.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}},{}],211:[function(e,t,r){t.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}},{}],212:[function(e,t,r){t.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}},{}],213:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r*r+n*n+a*a+i*i;return o>0&&(o=1/Math.sqrt(o),e[0]=r*o,e[1]=n*o,e[2]=a*o,e[3]=i*o),e}},{}],214:[function(e,t,r){var n=e("./normalize"),a=e("./scale");t.exports=function(e,t){return t=t||1,e[0]=Math.random(),e[1]=Math.random(),e[2]=Math.random(),e[3]=Math.random(),n(e,e),a(e,e,t),e}},{"./normalize":213,"./scale":215}],215:[function(e,t,r){t.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}},{}],216:[function(e,t,r){t.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e}},{}],217:[function(e,t,r){t.exports=function(e,t,r,n,a){return e[0]=t,e[1]=r,e[2]=n,e[3]=a,e}},{}],218:[function(e,t,r){t.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],a=t[2]-e[2],i=t[3]-e[3];return r*r+n*n+a*a+i*i}},{}],219:[function(e,t,r){t.exports=function(e){var t=e[0],r=e[1],n=e[2],a=e[3];return t*t+r*r+n*n+a*a}},{}],220:[function(e,t,r){t.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}},{}],221:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3];return e[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*o,e[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*o,e[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*o,e[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*o,e}},{}],222:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*i-l*a,f=c*a+l*n-o*i,p=c*i+o*a-s*n,h=-o*n-s*a-l*i;return e[0]=u*c+h*-o+f*-l-p*-s,e[1]=f*c+h*-s+p*-o-u*-l,e[2]=p*c+h*-l+u*-s-f*-o,e[3]=t[3],e}},{}],223:[function(e,t,r){var n=e("glsl-tokenizer"),a=e("atob-lite");t.exports=function(e){for(var t=Array.isArray(e)?e:n(e),r=0;r<t.length;r++){var i=t[r];if("preprocessor"===i.type){var o=i.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?a(l):l).trim()}}}}},{"atob-lite":13,"glsl-tokenizer":230}],224:[function(e,t,r){t.exports=function(e){var t,r,c,u=0,f=0,p=999,h=[],d=[],m=1,g=0,y=0,v=!1,b=!1,x="",_=i,w=n;"300 es"===(e=e||{}).version&&(_=s,w=o);var k={},D={};for(u=0;u<_.length;u++)k[_[u]]=!0;for(u=0;u<w.length;u++)D[w[u]]=!0;return function(e){return d=[],null!==e?function(e){var r;for(u=0,e.toString&&(e=e.toString()),x+=e.replace(/\r\n/g,"\n"),c=x.length;t=x[u],u<c;){switch(r=u,p){case 0:u=E();break;case 1:case 2:u=M();break;case 3:u=C();break;case 4:u=I();break;case 11:u=O();break;case 5:u=P();break;case 9999:u=R();break;case 9:u=S();break;case 999:u=A()}r!==u&&("\n"===x[r]?(g=0,++m):++g)}return f+=u,x=x.slice(u),d}(e):(h.length&&T(h.join("")),p=10,T("(eof)"),d)};function T(e){e.length&&d.push({type:l[p],data:e,position:y,line:m,column:g})}function A(){return h=h.length?[]:h,"/"===r&&"*"===t?(y=f+u-1,p=0,r=t,u+1):"/"===r&&"/"===t?(y=f+u-1,p=1,r=t,u+1):"#"===t?(p=2,y=f+u,u):/\s/.test(t)?(p=9,y=f+u,u):(v=/\d/.test(t),b=/[^\w_]/.test(t),y=f+u,p=v?4:b?3:9999,u)}function S(){return/[^\s]/g.test(t)?(T(h.join("")),p=999,u):(h.push(t),r=t,u+1)}function M(){return"\r"!==t&&"\n"!==t||"\\"===r?(h.push(t),r=t,u+1):(T(h.join("")),p=999,u)}function E(){return"/"===t&&"*"===r?(h.push(t),T(h.join("")),p=999,u+1):(h.push(t),r=t,u+1)}function C(){if("."===r&&/\d/.test(t))return p=5,u;if("/"===r&&"*"===t)return p=0,u;if("/"===r&&"/"===t)return p=1,u;if("."===t&&h.length){for(;N(h););return p=5,u}if(";"===t||")"===t||"("===t){if(h.length)for(;N(h););return T(t),p=999,u+1}var e=2===h.length&&"="!==t;if(/[\w_\d\s]/.test(t)||e){for(;N(h););return p=999,u}return h.push(t),r=t,u+1}function N(e){for(var t,r,n=0;;){if(t=a.indexOf(e.slice(0,e.length+n).join("")),r=a[t],-1===t){if(n--+e.length>0)continue;r=e.slice(0,1).join("")}return T(r),y+=r.length,(h=h.slice(r.length)).length}}function O(){return/[^a-fA-F0-9]/.test(t)?(T(h.join("")),p=999,u):(h.push(t),r=t,u+1)}function I(){return"."===t||/[eE]/.test(t)?(h.push(t),p=5,r=t,u+1):"x"===t&&1===h.length&&"0"===h[0]?(p=11,h.push(t),r=t,u+1):/[^\d]/.test(t)?(T(h.join("")),p=999,u):(h.push(t),r=t,u+1)}function P(){return"f"===t&&(h.push(t),r=t,u+=1),/[eE]/.test(t)?(h.push(t),r=t,u+1):("-"!==t&&"+"!==t||!/[eE]/.test(r))&&/[^\d]/.test(t)?(T(h.join("")),p=999,u):(h.push(t),r=t,u+1)}function R(){if(/[^\d\w_]/.test(t)){var e=h.join("");return p=D[e]?8:k[e]?7:6,T(h.join("")),p=999,u}return h.push(t),r=t,u+1}};var n=e("./lib/literals"),a=e("./lib/operators"),i=e("./lib/builtins"),o=e("./lib/literals-300es"),s=e("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":226,"./lib/builtins-300es":225,"./lib/literals":228,"./lib/literals-300es":227,"./lib/operators":229}],225:[function(e,t,r){var n=e("./builtins");n=n.slice().filter((function(e){return!/^(gl\_|texture)/.test(e)})),t.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":226}],226:[function(e,t,r){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],227:[function(e,t,r){var n=e("./literals");t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":228}],228:[function(e,t,r){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],229:[function(e,t,r){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],230:[function(e,t,r){var n=e("./index");t.exports=function(e,t){var r=n(t),a=[];return(a=a.concat(r(e))).concat(r(null))}},{"./index":224}],231:[function(e,t,r){t.exports=function(e){"string"==typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n<e.length-1;n++)r.push(e[n],t[n]||"");return r.push(e[n]),r.join("")}},{}],232:[function(e,t,r){"use strict";var n=e("is-browser");t.exports=n&&function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){e=!1}return e}()},{"is-browser":236}],233:[function(e,t,r){"use strict";t.exports=function(e,t){var r=e.length;if(0===r)throw new Error("Must have at least d+1 points");var a=e[0].length;if(r<=a)throw new Error("Must input at least d+1 points");var o=e.slice(0,a+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(a+1),u=0;u<=a;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var f=new i(l,new Array(a+1),!1),p=f.adjacent,h=new Array(a+2);for(u=0;u<=a;++u){for(var d=l.slice(),m=0;m<=a;++m)m===u&&(d[m]=-1);var g=d[0];d[0]=d[1],d[1]=g;var y=new i(d,new Array(a+1),!0);p[u]=y,h[u]=y}for(h[a+1]=f,u=0;u<=a;++u){d=p[u].vertices;var v=p[u].adjacent;for(m=0;m<=a;++m){var b=d[m];if(b<0)v[m]=f;else for(var x=0;x<=a;++x)p[x].vertices.indexOf(b)<0&&(v[m]=p[x])}}var _=new c(a,o,h),w=!!t;for(u=a+1;u<r;++u)_.insert(e[u],w);return _.boundary()};var n=e("robust-orientation"),a=e("simplicial-complex").compareCells;function i(e,t,r){this.vertices=e,this.adjacent=t,this.boundary=r,this.lastVisited=-1}function o(e,t,r){this.vertices=e,this.cell=t,this.index=r}function s(e,t){return a(e.vertices,t.vertices)}i.prototype.flip=function(){var e=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=e;var t=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=t};var l=[];function c(e,t,r){this.dimension=e,this.vertices=t,this.simplices=r,this.interior=r.filter((function(e){return!e.boundary})),this.tuple=new Array(e+1);for(var a=0;a<=e;++a)this.tuple[a]=this.vertices[a];var i,o=l[e];o||(o=l[e]=((i=n[e+1])||(i=n),function(e){return function(){var t=this.tuple;return e.apply(this,t)}}(i))),this.orient=o}var u=c.prototype;u.handleBoundaryDegeneracy=function(e,t){var r=this.dimension,n=this.vertices.length-1,a=this.tuple,i=this.vertices,o=[e];for(e.lastVisited=-n;o.length>0;)for(var s=(e=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var p=u[f];a[f]=p<0?t:i[p]}var h=this.orient();if(h>0)return c;c.lastVisited=-n,0===h&&o.push(c)}}return null},u.walk=function(e,t){var r=this.vertices.length-1,n=this.dimension,a=this.vertices,i=this.tuple,o=t?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];e:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)i[u]=a[l[u]];for(s.lastVisited=r,u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var p=i[u];i[u]=e;var h=this.orient();if(i[u]=p,h<0){s=f;continue e}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(e,t){var r=this.vertices.length-1,n=this.dimension,a=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[t];t.lastVisited=r,t.vertices[t.vertices.indexOf(-1)]=r,t.boundary=!1,c.push(t);for(var p=[];f.length>0;){var h=(t=f.pop()).vertices,d=t.adjacent,m=h.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var y=d[g];if(y.boundary&&!(y.lastVisited>=r)){var v=y.vertices;if(y.lastVisited!==-r){for(var b=0,x=0;x<=n;++x)v[x]<0?(b=x,l[x]=e):l[x]=a[v[x]];if(this.orient()>0){v[b]=r,y.boundary=!1,c.push(y),f.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var _=y.adjacent,w=h.slice(),k=d.slice(),D=new i(w,k,!0);u.push(D);var T=_.indexOf(t);if(!(T<0))for(_[T]=D,k[m]=y,w[g]=-1,k[g]=t,d[g]=D,D.flip(),x=0;x<=n;++x){var A=w[x];if(!(A<0||A===r)){for(var S=new Array(n-1),M=0,E=0;E<=n;++E){var C=w[E];C<0||E===x||(S[M++]=C)}p.push(new o(S,D,x))}}}}}for(p.sort(s),g=0;g+1<p.length;g+=2){var N=p[g],O=p[g+1],I=N.index,P=O.index;I<0||P<0||(N.cell.adjacent[N.index]=O.cell,O.cell.adjacent[O.index]=N.cell)}},u.insert=function(e,t){var r=this.vertices;r.push(e);var n=this.walk(e,t);if(n){for(var a=this.dimension,i=this.tuple,o=0;o<=a;++o){var s=n.vertices[o];i[o]=s<0?e:r[s]}var l=this.orient(i);l<0||(0!==l||(n=this.handleBoundaryDegeneracy(n,e)))&&this.addPeaks(e,n)}},u.boundary=function(){for(var e=this.dimension,t=[],r=this.simplices,n=r.length,a=0;a<n;++a){var i=r[a];if(i.boundary){for(var o=new Array(e),s=i.vertices,l=0,c=0,u=0;u<=e;++u)s[u]>=0?o[l++]=s[u]:c=1&u;if(c===(1&e)){var f=o[0];o[0]=o[1],o[1]=f}t.push(o)}}return t}},{"robust-orientation":284,"simplicial-complex":293}],234:[function(e,t,r){"use strict";var n=e("binary-search-bounds");function a(e,t,r,n,a){this.mid=e,this.left=t,this.right=r,this.leftPoints=n,this.rightPoints=a,this.count=(t?t.count:0)+(r?r.count:0)+n.length}t.exports=function(e){return e&&0!==e.length?new y(g(e)):new y(null)};var i=a.prototype;function o(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function s(e,t){var r=g(t);e.mid=r.mid,e.left=r.left,e.right=r.right,e.leftPoints=r.leftPoints,e.rightPoints=r.rightPoints,e.count=r.count}function l(e,t){var r=e.intervals([]);r.push(t),s(e,r)}function c(e,t){var r=e.intervals([]),n=r.indexOf(t);return n<0?0:(r.splice(n,1),s(e,r),1)}function u(e,t,r){for(var n=0;n<e.length&&e[n][0]<=t;++n){var a=r(e[n]);if(a)return a}}function f(e,t,r){for(var n=e.length-1;n>=0&&e[n][1]>=t;--n){var a=r(e[n]);if(a)return a}}function p(e,t){for(var r=0;r<e.length;++r){var n=t(e[r]);if(n)return n}}function h(e,t){return e-t}function d(e,t){return e[0]-t[0]||e[1]-t[1]}function m(e,t){return e[1]-t[1]||e[0]-t[0]}function g(e){if(0===e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e[r][0],e[r][1]);t.sort(h);var n=t[t.length>>1],i=[],o=[],s=[];for(r=0;r<e.length;++r){var l=e[r];l[1]<n?i.push(l):n<l[0]?o.push(l):s.push(l)}var c=s,u=s.slice();return c.sort(d),u.sort(m),new a(n,g(i),g(o),c,u)}function y(e){this.root=e}i.intervals=function(e){return e.push.apply(e,this.leftPoints),this.left&&this.left.intervals(e),this.right&&this.right.intervals(e),e},i.insert=function(e){var t=this.count-this.leftPoints.length;if(this.count+=1,e[1]<this.mid)this.left?4*(this.left.count+1)>3*(t+1)?l(this,e):this.left.insert(e):this.left=g([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?l(this,e):this.right.insert(e):this.right=g([e]);else{var r=n.ge(this.leftPoints,e,d),a=n.ge(this.rightPoints,e,m);this.leftPoints.splice(r,0,e),this.rightPoints.splice(a,0,e)}},i.remove=function(e){var t=this.count-this.leftPoints;if(e[1]<this.mid)return this.left?4*(this.right?this.right.count:0)>3*(t-1)?c(this,e):2===(s=this.left.remove(e))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(e[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(t-1)?c(this,e):2===(s=this.right.remove(e))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===e?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===e){if(this.left&&this.right){for(var r=this,a=this.left;a.right;)r=a,a=a.right;if(r===this)a.right=this.right;else{var i=this.left,s=this.right;r.count-=a.count,r.right=a.left,a.left=i,a.right=s}o(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(i=n.ge(this.leftPoints,e,d);i<this.leftPoints.length&&this.leftPoints[i][0]===e[0];++i)if(this.leftPoints[i]===e)for(this.count-=1,this.leftPoints.splice(i,1),s=n.ge(this.rightPoints,e,m);s<this.rightPoints.length&&this.rightPoints[s][1]===e[1];++s)if(this.rightPoints[s]===e)return this.rightPoints.splice(s,1),1;return 0},i.queryPoint=function(e,t){return e<this.mid?this.left&&(r=this.left.queryPoint(e,t))?r:u(this.leftPoints,e,t):e>this.mid?this.right&&(r=this.right.queryPoint(e,t))?r:f(this.rightPoints,e,t):p(this.leftPoints,t);var r},i.queryInterval=function(e,t,r){var n;return e<this.mid&&this.left&&(n=this.left.queryInterval(e,t,r))||t>this.mid&&this.right&&(n=this.right.queryInterval(e,t,r))?n:t<this.mid?u(this.leftPoints,t,r):e>this.mid?f(this.rightPoints,e,r):p(this.leftPoints,r)};var v=y.prototype;v.insert=function(e){this.root?this.root.insert(e):this.root=new a(e[0],null,null,[e],[e])},v.remove=function(e){if(this.root){var t=this.root.remove(e);return 2===t&&(this.root=null),0!==t}return!1},v.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},v.queryInterval=function(e,t,r){if(e<=t&&this.root)return this.root.queryInterval(e,t,r)},Object.defineProperty(v,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(v,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":31}],235:[function(e,t,r){"use strict";t.exports=function(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=r;return t}},{}],236:[function(e,t,r){t.exports=!0},{}],237:[function(e,t,r){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],238:[function(e,t,r){"use strict";t.exports=i,t.exports.isMobile=i,t.exports.default=i;var n=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(e){e||(e={});var t=e.ua;if(t||"undefined"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!=typeof t)return!1;var r=e.tablet?a.test(t):n.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(r=!0),r}},{}],239:[function(e,t,r){"use strict";t.exports=function(e){for(var t,r=e.length,n=0;n<r;n++)if(((t=e.charCodeAt(n))<9||t>13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},{}],240:[function(e,t,r){t.exports=function(e,t,r){return e*(1-r)+t*r}},{}],241:[function(e,t,r){var n=e("./normalize"),a=e("gl-mat4/create"),i=e("gl-mat4/clone"),o=e("gl-mat4/determinant"),s=e("gl-mat4/invert"),l=e("gl-mat4/transpose"),c={length:e("gl-vec3/length"),normalize:e("gl-vec3/normalize"),dot:e("gl-vec3/dot"),cross:e("gl-vec3/cross")},u=a(),f=a(),p=[0,0,0,0],h=[[0,0,0],[0,0,0],[0,0,0]],d=[0,0,0];function m(e,t,r,n,a){e[0]=t[0]*n+r[0]*a,e[1]=t[1]*n+r[1]*a,e[2]=t[2]*n+r[2]*a}t.exports=function(e,t,r,a,g,y){if(t||(t=[0,0,0]),r||(r=[0,0,0]),a||(a=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!n(u,e))return!1;if(i(f,u),f[3]=0,f[7]=0,f[11]=0,f[15]=1,Math.abs(o(f)<1e-8))return!1;var v,b,x,_,w,k,D,T=u[3],A=u[7],S=u[11],M=u[12],E=u[13],C=u[14],N=u[15];if(0!==T||0!==A||0!==S){if(p[0]=T,p[1]=A,p[2]=S,p[3]=N,!s(f,f))return!1;l(f,f),v=g,x=f,_=(b=p)[0],w=b[1],k=b[2],D=b[3],v[0]=x[0]*_+x[4]*w+x[8]*k+x[12]*D,v[1]=x[1]*_+x[5]*w+x[9]*k+x[13]*D,v[2]=x[2]*_+x[6]*w+x[10]*k+x[14]*D,v[3]=x[3]*_+x[7]*w+x[11]*k+x[15]*D}else g[0]=g[1]=g[2]=0,g[3]=1;if(t[0]=M,t[1]=E,t[2]=C,function(e,t){e[0][0]=t[0],e[0][1]=t[1],e[0][2]=t[2],e[1][0]=t[4],e[1][1]=t[5],e[1][2]=t[6],e[2][0]=t[8],e[2][1]=t[9],e[2][2]=t[10]}(h,u),r[0]=c.length(h[0]),c.normalize(h[0],h[0]),a[0]=c.dot(h[0],h[1]),m(h[1],h[1],h[0],1,-a[0]),r[1]=c.length(h[1]),c.normalize(h[1],h[1]),a[0]/=r[1],a[1]=c.dot(h[0],h[2]),m(h[2],h[2],h[0],1,-a[1]),a[2]=c.dot(h[1],h[2]),m(h[2],h[2],h[1],1,-a[2]),r[2]=c.length(h[2]),c.normalize(h[2],h[2]),a[1]/=r[2],a[2]/=r[2],c.cross(d,h[1],h[2]),c.dot(h[0],d)<0)for(var O=0;O<3;O++)r[O]*=-1,h[O][0]*=-1,h[O][1]*=-1,h[O][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+h[0][0]-h[1][1]-h[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-h[0][0]+h[1][1]-h[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-h[0][0]-h[1][1]+h[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+h[0][0]+h[1][1]+h[2][2],0)),h[2][1]>h[1][2]&&(y[0]=-y[0]),h[0][2]>h[2][0]&&(y[1]=-y[1]),h[1][0]>h[0][1]&&(y[2]=-y[2]),!0}},{"./normalize":242,"gl-mat4/clone":92,"gl-mat4/create":93,"gl-mat4/determinant":94,"gl-mat4/invert":98,"gl-mat4/transpose":109,"gl-vec3/cross":157,"gl-vec3/dot":162,"gl-vec3/length":172,"gl-vec3/normalize":179}],242:[function(e,t,r){t.exports=function(e,t){var r=t[15];if(0===r)return!1;for(var n=1/r,a=0;a<16;a++)e[a]=t[a]*n;return!0}},{}],243:[function(e,t,r){var n=e("gl-vec3/lerp"),a=e("mat4-recompose"),i=e("mat4-decompose"),o=e("gl-mat4/determinant"),s=e("quat-slerp"),l=f(),c=f(),u=f();function f(){return{translate:p(),scale:p(1),skew:p(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function p(e){return[e||0,e||0,e||0]}t.exports=function(e,t,r,f){if(0===o(t)||0===o(r))return!1;var p=i(t,l.translate,l.scale,l.skew,l.perspective,l.quaternion),h=i(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!p||!h||(n(u.translate,l.translate,c.translate,f),n(u.skew,l.skew,c.skew,f),n(u.scale,l.scale,c.scale,f),n(u.perspective,l.perspective,c.perspective,f),s(u.quaternion,l.quaternion,c.quaternion,f),a(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),0))}},{"gl-mat4/determinant":94,"gl-vec3/lerp":173,"mat4-decompose":241,"mat4-recompose":244,"quat-slerp":271}],244:[function(e,t,r){var n={identity:e("gl-mat4/identity"),translate:e("gl-mat4/translate"),multiply:e("gl-mat4/multiply"),create:e("gl-mat4/create"),scale:e("gl-mat4/scale"),fromRotationTranslation:e("gl-mat4/fromRotationTranslation")},a=(n.create(),n.create());t.exports=function(e,t,r,i,o,s){return n.identity(e),n.fromRotationTranslation(e,s,t),e[3]=o[0],e[7]=o[1],e[11]=o[2],e[15]=o[3],n.identity(a),0!==i[2]&&(a[9]=i[2],n.multiply(e,e,a)),0!==i[1]&&(a[9]=0,a[8]=i[1],n.multiply(e,e,a)),0!==i[0]&&(a[8]=0,a[4]=i[0],n.multiply(e,e,a)),n.scale(e,e,r),e}},{"gl-mat4/create":93,"gl-mat4/fromRotationTranslation":96,"gl-mat4/identity":97,"gl-mat4/multiply":100,"gl-mat4/scale":107,"gl-mat4/translate":108}],245:[function(e,t,r){"use strict";var n=e("binary-search-bounds"),a=e("mat4-interpolate"),i=e("gl-mat4/invert"),o=e("gl-mat4/rotateX"),s=e("gl-mat4/rotateY"),l=e("gl-mat4/rotateZ"),c=e("gl-mat4/lookAt"),u=e("gl-mat4/translate"),f=(e("gl-mat4/scale"),e("gl-vec3/normalize")),p=[0,0,0];function h(e){this._components=e.slice(),this._time=[0],this.prevMatrix=e.slice(),this.nextMatrix=e.slice(),this.computedMatrix=e.slice(),this.computedInverse=e.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}t.exports=function(e){return new h((e=e||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=h.prototype;d.recalcMatrix=function(e){var t=this._time,r=n.le(t,e),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===t.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=t[r+1]-t[r],p=(l=16*r,this.prevMatrix),h=!0;for(c=0;c<16;++c)p[c]=s[l++];var d=this.nextMatrix;for(c=0;c<16;++c)d[c]=s[l++],h=h&&p[c]===d[c];if(u<1e-6||h)for(c=0;c<16;++c)o[c]=p[c];else a(o,p,d,(e-t[r])/u)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],f(m,m);var g=this.computedInverse;i(g,o);var y=this.computedEye,v=g[15];y[0]=g[12]/v,y[1]=g[13]/v,y[2]=g[14]/v;var b=this.computedCenter,x=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)b[c]=y[c]-o[2+4*c]*x}},d.idle=function(e){if(!(e<this.lastT())){for(var t=this._components,r=t.length-16,n=0;n<16;++n)t.push(t[r++]);this._time.push(e)}},d.flush=function(e){var t=n.gt(this._time,e)-2;t<0||(this._time.splice(0,t),this._components.splice(0,16*t))},d.lastT=function(){return this._time[this._time.length-1]},d.lookAt=function(e,t,r,n){this.recalcMatrix(e),t=t||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(e,c(this.computedMatrix,t,r,n));for(var a=0,i=0;i<3;++i)a+=Math.pow(r[i]-t[i],2);a=Math.log(Math.sqrt(a)),this.computedRadius[0]=a},d.rotate=function(e,t,r,n){this.recalcMatrix(e);var a=this.computedInverse;t&&s(a,a,t),r&&o(a,a,r),n&&l(a,a,n),this.setMatrix(e,i(this.computedMatrix,a))};var m=[0,0,0];d.pan=function(e,t,r,n){m[0]=-(t||0),m[1]=-(r||0),m[2]=-(n||0),this.recalcMatrix(e);var a=this.computedInverse;u(a,a,m),this.setMatrix(e,i(a,a))},d.translate=function(e,t,r,n){m[0]=t||0,m[1]=r||0,m[2]=n||0,this.recalcMatrix(e);var a=this.computedMatrix;u(a,a,m),this.setMatrix(e,a)},d.setMatrix=function(e,t){if(!(e<this.lastT())){this._time.push(e);for(var r=0;r<16;++r)this._components.push(t[r])}},d.setDistance=function(e,t){this.computedRadius[0]=t},d.setDistanceLimits=function(e,t){var r=this._limits;r[0]=e,r[1]=t},d.getDistanceLimits=function(e){var t=this._limits;return e?(e[0]=t[0],e[1]=t[1],e):t}},{"binary-search-bounds":31,"gl-mat4/invert":98,"gl-mat4/lookAt":99,"gl-mat4/rotateX":104,"gl-mat4/rotateY":105,"gl-mat4/rotateZ":106,"gl-mat4/scale":107,"gl-mat4/translate":108,"gl-vec3/normalize":179,"mat4-interpolate":243}],246:[function(e,t,r){"use strict";t.exports=function(e){var t=e.length;if(t<3){for(var r=new Array(t),a=0;a<t;++a)r[a]=a;return 2===t&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]?[0]:r}var i=new Array(t);for(a=0;a<t;++a)i[a]=a;i.sort((function(t,r){return e[t][0]-e[r][0]||e[t][1]-e[r][1]}));var o=[i[0],i[1]],s=[i[0],i[1]];for(a=2;a<t;++a){for(var l=i[a],c=e[l],u=o.length;u>1&&n(e[o[u-2]],e[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(e[s[u-2]],e[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var f=0,p=(a=0,o.length);a<p;++a)r[f++]=o[a];for(var h=s.length-2;h>0;--h)r[f++]=s[h];return r};var n=e("robust-orientation")[3]},{"robust-orientation":284}],247:[function(e,t,r){"use strict";t.exports=function(e,t){t||(t=e,e=window);var r=0,a=0,i=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function c(e,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||c!==a||u!==i||l(s))&&(r=0|e,a=c||0,i=u||0,t&&t(r,a,i,o))}function u(e){c(0,e)}function f(){(r||a||i||o.shift||o.alt||o.meta||o.control)&&(a=i=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function p(e){l(e)&&t&&t(r,a,i,o)}function h(e){0===n.buttons(e)?c(0,e):c(r,e)}function d(e){c(r|n.buttons(e),e)}function m(e){c(r&~n.buttons(e),e)}function g(){s||(s=!0,e.addEventListener("mousemove",h),e.addEventListener("mousedown",d),e.addEventListener("mouseup",m),e.addEventListener("mouseleave",u),e.addEventListener("mouseenter",u),e.addEventListener("mouseout",u),e.addEventListener("mouseover",u),e.addEventListener("blur",f),e.addEventListener("keyup",p),e.addEventListener("keydown",p),e.addEventListener("keypress",p),e!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",p),window.addEventListener("keydown",p),window.addEventListener("keypress",p)))}g();var y={element:e};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(t){t?g():s&&(s=!1,e.removeEventListener("mousemove",h),e.removeEventListener("mousedown",d),e.removeEventListener("mouseup",m),e.removeEventListener("mouseleave",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseout",u),e.removeEventListener("mouseover",u),e.removeEventListener("blur",f),e.removeEventListener("keyup",p),e.removeEventListener("keydown",p),e.removeEventListener("keypress",p),e!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",p),window.removeEventListener("keydown",p),window.removeEventListener("keypress",p)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return a},enumerable:!0},y:{get:function(){return i},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=e("mouse-event")},{"mouse-event":249}],248:[function(e,t,r){var n={left:0,top:0};t.exports=function(e,t,r){t=t||e.currentTarget||e.srcElement,Array.isArray(r)||(r=[0,0]);var a,i=e.clientX||0,o=e.clientY||0,s=(a=t)===window||a===document||a===document.body?n:a.getBoundingClientRect();return r[0]=i-s.left,r[1]=o-s.top,r}},{}],249:[function(e,t,r){"use strict";function n(e){return e.target||e.srcElement||window}r.buttons=function(e){if("object"==typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<<t-1}else if("button"in e){var t;if(1===(t=e.button))return 4;if(2===t)return 2;if(t>=0)return 1<<t}}return 0},r.element=n,r.x=function(e){if("object"==typeof e){if("offsetX"in e)return e.offsetX;var t=n(e).getBoundingClientRect();return e.clientX-t.left}return 0},r.y=function(e){if("object"==typeof e){if("offsetY"in e)return e.offsetY;var t=n(e).getBoundingClientRect();return e.clientY-t.top}return 0}},{}],250:[function(e,t,r){"use strict";var n=e("to-px");t.exports=function(e,t,r){"function"==typeof e&&(r=!!t,t=e,e=window);var a=n("ex",e),i=function(e){r&&e.preventDefault();var n=e.deltaX||0,i=e.deltaY||0,o=e.deltaZ||0,s=1;switch(e.deltaMode){case 1:s=a;break;case 2:s=window.innerHeight}if(i*=s,o*=s,(n*=s)||i||o)return t(n,i,o,e)};return e.addEventListener("wheel",i),i}},{"to-px":304}],251:[function(e,t,r){"use strict";var n=e("typedarray-pool");t.exports=function(e){function t(e){throw new Error("ndarray-extract-contour: "+e)}"object"!=typeof e&&t("Must specify arguments");var r=e.order;Array.isArray(r)||t("Must specify order");var i=e.arrayArguments||1;i<1&&t("Must have at least one array argument"),(e.scalarArguments||0)<0&&t("Scalar arg count must be > 0"),"function"!=typeof e.vertex&&t("Must specify vertex creation function"),"function"!=typeof e.cell&&t("Must specify cell creation function"),"function"!=typeof e.phase&&t("Must specify phase function");for(var o=e.getters||[],s=new Array(i),l=0;l<i;++l)o.indexOf(l)>=0?s[l]=!0:s[l]=!1;return function(e,t,r,i,o,s){var l=[s,o].join(",");return(0,a[l])(e,t,r,n.mallocUint32,n.freeUint32)}(e.vertex,e.cell,e.phase,0,r,s)};var a={"false,0,1":function(e,t,r,n,a){return function(i,o,s,l){var c,u=0|i.shape[0],f=0|i.shape[1],p=i.data,h=0|i.offset,d=0|i.stride[0],m=0|i.stride[1],g=h,y=0|-d,v=0,b=0|-m,x=0,_=-d-m|0,w=0,k=0|d,D=m-d*u|0,T=0,A=0,S=0,M=2*u|0,E=n(M),C=n(M),N=0,O=0,I=-1,P=-1,R=0,L=0|-u,F=0|u,B=0,z=-u-1|0,j=u-1|0,U=0,$=0,V=0;for(T=0;T<u;++T)E[N++]=r(p[g],o,s,l),g+=k;if(g+=D,f>0){if(A=1,E[N++]=r(p[g],o,s,l),g+=k,u>0)for(T=1,c=p[g],O=E[N]=r(c,o,s,l),R=E[N+I],B=E[N+L],U=E[N+z],O===R&&O===B&&O===U||(v=p[g+y],x=p[g+b],w=p[g+_],e(T,A,c,v,x,w,O,R,B,U,o,s,l),$=C[N]=S++),N+=1,g+=k,T=2;T<u;++T)c=p[g],O=E[N]=r(c,o,s,l),R=E[N+I],B=E[N+L],U=E[N+z],O===R&&O===B&&O===U||(v=p[g+y],x=p[g+b],w=p[g+_],e(T,A,c,v,x,w,O,R,B,U,o,s,l),$=C[N]=S++,U!==R&&t(C[N+I],$,w,v,U,R,o,s,l)),N+=1,g+=k;for(g+=D,N=0,V=I,I=P,P=V,V=L,L=F,F=V,V=z,z=j,j=V,A=2;A<f;++A){if(E[N++]=r(p[g],o,s,l),g+=k,u>0)for(T=1,c=p[g],O=E[N]=r(c,o,s,l),R=E[N+I],B=E[N+L],U=E[N+z],O===R&&O===B&&O===U||(v=p[g+y],x=p[g+b],w=p[g+_],e(T,A,c,v,x,w,O,R,B,U,o,s,l),$=C[N]=S++,U!==B&&t(C[N+L],$,x,w,B,U,o,s,l)),N+=1,g+=k,T=2;T<u;++T)c=p[g],O=E[N]=r(c,o,s,l),R=E[N+I],B=E[N+L],U=E[N+z],O===R&&O===B&&O===U||(v=p[g+y],x=p[g+b],w=p[g+_],e(T,A,c,v,x,w,O,R,B,U,o,s,l),$=C[N]=S++,U!==B&&t(C[N+L],$,x,w,B,U,o,s,l),U!==R&&t(C[N+I],$,w,v,U,R,o,s,l)),N+=1,g+=k;1&A&&(N=0),V=I,I=P,P=V,V=L,L=F,F=V,V=z,z=j,j=V,g+=D}}a(C),a(E)}},"false,1,0":function(e,t,r,n,a){return function(i,o,s,l){var c,u=0|i.shape[0],f=0|i.shape[1],p=i.data,h=0|i.offset,d=0|i.stride[0],m=0|i.stride[1],g=h,y=0|-d,v=0,b=0|-m,x=0,_=-d-m|0,w=0,k=0|m,D=d-m*f|0,T=0,A=0,S=0,M=2*f|0,E=n(M),C=n(M),N=0,O=0,I=-1,P=-1,R=0,L=0|-f,F=0|f,B=0,z=-f-1|0,j=f-1|0,U=0,$=0,V=0;for(A=0;A<f;++A)E[N++]=r(p[g],o,s,l),g+=k;if(g+=D,u>0){if(T=1,E[N++]=r(p[g],o,s,l),g+=k,f>0)for(A=1,c=p[g],O=E[N]=r(c,o,s,l),B=E[N+L],R=E[N+I],U=E[N+z],O===B&&O===R&&O===U||(v=p[g+y],x=p[g+b],w=p[g+_],e(T,A,c,v,x,w,O,B,R,U,o,s,l),$=C[N]=S++),N+=1,g+=k,A=2;A<f;++A)c=p[g],O=E[N]=r(c,o,s,l),B=E[N+L],R=E[N+I],U=E[N+z],O===B&&O===R&&O===U||(v=p[g+y],x=p[g+b],w=p[g+_],e(T,A,c,v,x,w,O,B,R,U,o,s,l),$=C[N]=S++,U!==R&&t(C[N+I],$,x,w,R,U,o,s,l)),N+=1,g+=k;for(g+=D,N=0,V=L,L=F,F=V,V=I,I=P,P=V,V=z,z=j,j=V,T=2;T<u;++T){if(E[N++]=r(p[g],o,s,l),g+=k,f>0)for(A=1,c=p[g],O=E[N]=r(c,o,s,l),B=E[N+L],R=E[N+I],U=E[N+z],O===B&&O===R&&O===U||(v=p[g+y],x=p[g+b],w=p[g+_],e(T,A,c,v,x,w,O,B,R,U,o,s,l),$=C[N]=S++,U!==B&&t(C[N+L],$,w,v,U,B,o,s,l)),N+=1,g+=k,A=2;A<f;++A)c=p[g],O=E[N]=r(c,o,s,l),B=E[N+L],R=E[N+I],U=E[N+z],O===B&&O===R&&O===U||(v=p[g+y],x=p[g+b],w=p[g+_],e(T,A,c,v,x,w,O,B,R,U,o,s,l),$=C[N]=S++,U!==R&&t(C[N+I],$,x,w,R,U,o,s,l),U!==B&&t(C[N+L],$,w,v,U,B,o,s,l)),N+=1,g+=k;1&T&&(N=0),V=L,L=F,F=V,V=I,I=P,P=V,V=z,z=j,j=V,g+=D}}a(C),a(E)}}}},{"typedarray-pool":308}],252:[function(e,t,r){"use strict";var n=e("dup"),a={zero:function(e,t,r,n){var a=e[0];n|=0;var i=0,o=r[0];for(i=0;i<a;++i)t[n]=0,n+=o},fdTemplate1:function(e,t,r,n,a,i,o){var s=e[0],l=r[0],c=-1*l,u=l;n|=0,o|=0;var f=0,p=l,h=i[0];for(f=0;f<s;++f)a[o]=.5*(t[n+c]-t[n+u]),n+=p,o+=h},fdTemplate2:function(e,t,r,n,a,i,o,s,l,c){var u=e[0],f=e[1],p=r[0],h=r[1],d=i[0],m=i[1],g=l[0],y=l[1],v=-1*p,b=p,x=-1*h,_=h;n|=0,o|=0,c|=0;var w=0,k=0,D=h,T=p-f*h,A=m,S=d-f*m,M=y,E=g-f*y;for(k=0;k<u;++k){for(w=0;w<f;++w)a[o]=.5*(t[n+v]-t[n+b]),s[c]=.5*(t[n+x]-t[n+_]),n+=D,o+=A,c+=M;n+=T,o+=S,c+=E}}},i={cdiff:function(e){var t={};return function(r,n,a){var i=r.dtype,o=r.order,s=n.dtype,l=n.order,c=a.dtype,u=a.order,f=[i,o.join(),s,l.join(),c,u.join()].join(),p=t[f];return p||(t[f]=p=e([i,o,s,l,c,u])),p(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,a.data,a.stride,0|a.offset)}},zero:function(e){var t={};return function(r){var n=r.dtype,a=r.order,i=[n,a.join()].join(),o=t[i];return o||(t[i]=o=e([n,a])),o(r.shape.slice(0),r.data,r.stride,0|r.offset)}},fdTemplate1:function(e){var t={};return function(r,n){var a=r.dtype,i=r.order,o=n.dtype,s=n.order,l=[a,i.join(),o,s.join()].join(),c=t[l];return c||(t[l]=c=e([a,i,o,s])),c(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset)}},fdTemplate2:function(e){var t={};return function(r,n,a){var i=r.dtype,o=r.order,s=n.dtype,l=n.order,c=a.dtype,u=a.order,f=[i,o.join(),s,l.join(),c,u.join()].join(),p=t[f];return p||(t[f]=p=e([i,o,s,l,c,u])),p(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,a.data,a.stride,0|a.offset)}}};function o(e){return(0,i[e.funcName])(s.bind(void 0,e))}function s(e){return a[e.funcName]}function l(e){return o({funcName:e.funcName})}var c={},u={},f=l({funcName:"cdiff"}),p=l({funcName:"zero"});function h(e){return e in c?c[e]:c[e]=l({funcName:"fdTemplate"+e})}function d(e,t,r,n){return function(e,a){var i=a.shape.slice();return i[0]>2&&i[1]>2&&n(a.pick(-1,-1).lo(1,1).hi(i[0]-2,i[1]-2),e.pick(-1,-1,0).lo(1,1).hi(i[0]-2,i[1]-2),e.pick(-1,-1,1).lo(1,1).hi(i[0]-2,i[1]-2)),i[1]>2&&(r(a.pick(0,-1).lo(1).hi(i[1]-2),e.pick(0,-1,1).lo(1).hi(i[1]-2)),t(e.pick(0,-1,0).lo(1).hi(i[1]-2))),i[1]>2&&(r(a.pick(i[0]-1,-1).lo(1).hi(i[1]-2),e.pick(i[0]-1,-1,1).lo(1).hi(i[1]-2)),t(e.pick(i[0]-1,-1,0).lo(1).hi(i[1]-2))),i[0]>2&&(r(a.pick(-1,0).lo(1).hi(i[0]-2),e.pick(-1,0,0).lo(1).hi(i[0]-2)),t(e.pick(-1,0,1).lo(1).hi(i[0]-2))),i[0]>2&&(r(a.pick(-1,i[1]-1).lo(1).hi(i[0]-2),e.pick(-1,i[1]-1,0).lo(1).hi(i[0]-2)),t(e.pick(-1,i[1]-1,1).lo(1).hi(i[0]-2))),e.set(0,0,0,0),e.set(0,0,1,0),e.set(i[0]-1,0,0,0),e.set(i[0]-1,0,1,0),e.set(0,i[1]-1,0,0),e.set(0,i[1]-1,1,0),e.set(i[0]-1,i[1]-1,0,0),e.set(i[0]-1,i[1]-1,1,0),e}}t.exports=function(e,t,r){return Array.isArray(r)||(r=n(t.dimension,"string"==typeof r?r:"clamp")),0===t.size?e:0===t.dimension?(e.set(0),e):function(e){var t=e.join();if(i=u[t])return i;for(var r=e.length,n=[f,p],a=1;a<=r;++a)n.push(h(a));var i=d.apply(void 0,n);return u[t]=i,i}(r)(e,t)}},{dup:65}],253:[function(e,t,r){"use strict";function n(e,t){var r=Math.floor(t),n=t-r,a=0<=r&&r<e.shape[0],i=0<=r+1&&r+1<e.shape[0];return(1-n)*(a?+e.get(r):0)+n*(i?+e.get(r+1):0)}function a(e,t,r){var n=Math.floor(t),a=t-n,i=0<=n&&n<e.shape[0],o=0<=n+1&&n+1<e.shape[0],s=Math.floor(r),l=r-s,c=0<=s&&s<e.shape[1],u=0<=s+1&&s+1<e.shape[1],f=i&&c?e.get(n,s):0,p=i&&u?e.get(n,s+1):0;return(1-l)*((1-a)*f+a*(o&&c?e.get(n+1,s):0))+l*((1-a)*p+a*(o&&u?e.get(n+1,s+1):0))}function i(e,t,r,n){var a=Math.floor(t),i=t-a,o=0<=a&&a<e.shape[0],s=0<=a+1&&a+1<e.shape[0],l=Math.floor(r),c=r-l,u=0<=l&&l<e.shape[1],f=0<=l+1&&l+1<e.shape[1],p=Math.floor(n),h=n-p,d=0<=p&&p<e.shape[2],m=0<=p+1&&p+1<e.shape[2],g=o&&u&&d?e.get(a,l,p):0,y=o&&f&&d?e.get(a,l+1,p):0,v=s&&u&&d?e.get(a+1,l,p):0,b=s&&f&&d?e.get(a+1,l+1,p):0,x=o&&u&&m?e.get(a,l,p+1):0,_=o&&f&&m?e.get(a,l+1,p+1):0;return(1-h)*((1-c)*((1-i)*g+i*v)+c*((1-i)*y+i*b))+h*((1-c)*((1-i)*x+i*(s&&u&&m?e.get(a+1,l,p+1):0))+c*((1-i)*_+i*(s&&f&&m?e.get(a+1,l+1,p+1):0)))}function o(e){var t,r,n=0|e.shape.length,a=new Array(n),i=new Array(n),o=new Array(n),s=new Array(n);for(t=0;t<n;++t)r=+arguments[t+1],a[t]=Math.floor(r),i[t]=r-a[t],o[t]=0<=a[t]&&a[t]<e.shape[t],s[t]=0<=a[t]+1&&a[t]+1<e.shape[t];var l,c,u,f=0;e:for(t=0;t<1<<n;++t){for(c=1,u=e.offset,l=0;l<n;++l)if(t&1<<l){if(!s[l])continue e;c*=i[l],u+=e.stride[l]*(a[l]+1)}else{if(!o[l])continue e;c*=1-i[l],u+=e.stride[l]*a[l]}f+=c*e.data[u]}return f}t.exports=function(e,t,r,s){switch(e.shape.length){case 0:return 0;case 1:return n(e,t);case 2:return a(e,t,r);case 3:return i(e,t,r,s);default:return o.apply(void 0,arguments)}},t.exports.d1=n,t.exports.d2=a,t.exports.d3=i},{}],254:[function(e,t,r){"use strict";var n={"float64,2,1,0":function(){return function(e,t,r,n,a){var i=e[0],o=e[1],s=e[2],l=r[0],c=r[1],u=r[2];n|=0;var f=0,p=0,h=0,d=u,m=c-s*u,g=l-o*c;for(h=0;h<i;++h){for(p=0;p<o;++p){for(f=0;f<s;++f)t[n]/=a,n+=d;n+=m}n+=g}}},"uint8,2,0,1,float64,2,1,0":function(){return function(e,t,r,n,a,i,o,s){for(var l=e[0],c=e[1],u=e[2],f=r[0],p=r[1],h=r[2],d=i[0],m=i[1],g=i[2],y=n|=0,v=o|=0,b=0|e[0];b>0;){b<64?(l=b,b=0):(l=64,b-=64);for(var x=0|e[1];x>0;){x<64?(c=x,x=0):(c=64,x-=64),n=y+b*f+x*p,o=v+b*d+x*m;var _=0,w=0,k=0,D=h,T=f-u*h,A=p-l*f,S=g,M=d-u*g,E=m-l*d;for(k=0;k<c;++k){for(w=0;w<l;++w){for(_=0;_<u;++_)t[n]=a[o]*s,n+=D,o+=S;n+=T,o+=M}n+=A,o+=E}}}}},"float32,1,0,float32,1,0":function(){return function(e,t,r,n,a,i,o){var s=e[0],l=e[1],c=r[0],u=r[1],f=i[0],p=i[1];n|=0,o|=0;var h=0,d=0,m=u,g=c-l*u,y=p,v=f-l*p;for(d=0;d<s;++d){for(h=0;h<l;++h)t[n]=a[o],n+=m,o+=y;n+=g,o+=v}}},"float32,1,0,float32,0,1":function(){return function(e,t,r,n,a,i,o){for(var s=e[0],l=e[1],c=r[0],u=r[1],f=i[0],p=i[1],h=n|=0,d=o|=0,m=0|e[1];m>0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|e[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=h+m*u+g*c,o=d+m*p+g*f;var y=0,v=0,b=u,x=c-l*u,_=p,w=f-l*p;for(v=0;v<s;++v){for(y=0;y<l;++y)t[n]=a[o],n+=b,o+=_;n+=x,o+=w}}}}},"uint8,2,0,1,uint8,1,2,0":function(){return function(e,t,r,n,a,i,o){for(var s=e[0],l=e[1],c=e[2],u=r[0],f=r[1],p=r[2],h=i[0],d=i[1],m=i[2],g=n|=0,y=o|=0,v=0|e[2];v>0;){v<64?(c=v,v=0):(c=64,v-=64);for(var b=0|e[0];b>0;){b<64?(s=b,b=0):(s=64,b-=64);for(var x=0|e[1];x>0;){x<64?(l=x,x=0):(l=64,x-=64),n=g+v*p+b*u+x*f,o=y+v*m+b*h+x*d;var _=0,w=0,k=0,D=p,T=u-c*p,A=f-s*u,S=m,M=h-c*m,E=d-s*h;for(k=0;k<l;++k){for(w=0;w<s;++w){for(_=0;_<c;++_)t[n]=a[o],n+=D,o+=S;n+=T,o+=M}n+=A,o+=E}}}}}},"uint8,2,0,1,array,2,0,1":function(){return function(e,t,r,n,a,i,o){var s=e[0],l=e[1],c=e[2],u=r[0],f=r[1],p=r[2],h=i[0],d=i[1],m=i[2];n|=0,o|=0;var g=0,y=0,v=0,b=p,x=u-c*p,_=f-s*u,w=m,k=h-c*m,D=d-s*h;for(v=0;v<l;++v){for(y=0;y<s;++y){for(g=0;g<c;++g)t[n]=a[o],n+=b,o+=w;n+=x,o+=k}n+=_,o+=D}}}},a=function(e,t){var r=t.join(",");return(0,n[r])()},i={mul:function(e){var t={};return function(r,n,a){var i=r.dtype,o=r.order,s=n.dtype,l=n.order,c=a.dtype,u=a.order,f=[i,o.join(),s,l.join(),c,u.join()].join(),p=t[f];return p||(t[f]=p=e([i,o,s,l,c,u])),p(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,a.data,a.stride,0|a.offset)}},muls:function(e){var t={};return function(r,n,a){var i=r.dtype,o=r.order,s=n.dtype,l=n.order,c=[i,o.join(),s,l.join()].join(),u=t[c];return u||(t[c]=u=e([i,o,s,l])),u(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,a)}},mulseq:function(e){var t={};return function(r,n){var a=r.dtype,i=r.order,o=[a,i.join()].join(),s=t[o];return s||(t[o]=s=e([a,i])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}},div:function(e){var t={};return function(r,n,a){var i=r.dtype,o=r.order,s=n.dtype,l=n.order,c=a.dtype,u=a.order,f=[i,o.join(),s,l.join(),c,u.join()].join(),p=t[f];return p||(t[f]=p=e([i,o,s,l,c,u])),p(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,a.data,a.stride,0|a.offset)}},divs:function(e){var t={};return function(r,n,a){var i=r.dtype,o=r.order,s=n.dtype,l=n.order,c=[i,o.join(),s,l.join()].join(),u=t[c];return u||(t[c]=u=e([i,o,s,l])),u(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,a)}},divseq:function(e){var t={};return function(r,n){var a=r.dtype,i=r.order,o=[a,i.join()].join(),s=t[o];return s||(t[o]=s=e([a,i])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}},assign:function(e){var t={};return function(r,n){var a=r.dtype,i=r.order,o=n.dtype,s=n.order,l=[a,i.join(),o,s.join()].join(),c=t[l];return c||(t[l]=c=e([a,i,o,s])),c(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset)}}};function o(e){return t={funcName:e.funcName},(0,i[t.funcName])(a.bind(void 0,t));var t}var s={mul:"*",div:"/"};!function(){for(var e in s)r[e]=o({funcName:e}),r[e+"s"]=o({funcName:e+"s"}),r[e+"seq"]=o({funcName:e+"seq"})}(),r.assign=o({funcName:"assign"})},{}],255:[function(e,t,r){"use strict";var n=e("ndarray"),a=e("./doConvert.js");t.exports=function(e,t){for(var r=[],i=e,o=1;Array.isArray(i);)r.push(i.length),o*=i.length,i=i[0];return 0===r.length?n():(t||(t=n(new Float64Array(o),r)),a(t,e),t)}},{"./doConvert.js":256,ndarray:259}],256:[function(e,t,r){"use strict";t.exports=function(e){var t={};return function(r,n){var a=r.dtype,i=r.order,o=[a,i.join()].join(),s=t[o];return s||(t[o]=s=e([a,i])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}}(function(){return function(e,t,r,n,a){var i=e[0],o=e[1],s=e[2],l=r[0],c=r[1],u=r[2],f=[0,0,0];n|=0;var p=0,h=0,d=0,m=u,g=c-s*u,y=l-o*c;for(d=0;d<i;++d){for(h=0;h<o;++h){for(p=0;p<s;++p){var v,b=a;for(v=0;v<f.length-1;++v)b=b[f[v]];t[n]=b[f[f.length-1]],n+=m,++f[2]}n+=g,f[2]-=s,++f[1]}n+=y,f[1]-=o,++f[0]}}}.bind(void 0,{funcName:"convert"}))},{}],257:[function(e,t,r){"use strict";var n=e("typedarray-pool");function a(e){return"uint32"===e?[n.mallocUint32,n.freeUint32]:null}var i={"uint32,1,0":function(e,t){return function(r,n,a,i,o,s,l,c,u,f,p){var h,d,m,g,y,v,b,x,_=r*o+i,w=e(c);for(h=r+1;h<=n;++h){for(d=h,m=_+=o,y=0,v=_,g=0;g<c;++g)w[y++]=a[v],v+=u;e:for(;d-- >r;){y=0,v=m-o;t:for(g=0;g<c;++g){if((b=a[v])<(x=w[y]))break e;if(b>x)break t;v+=f,y+=p}for(y=m,v=m-o,g=0;g<c;++g)a[y]=a[v],y+=u,v+=u;m-=o}for(y=m,v=0,g=0;g<c;++g)a[y]=w[v++],y+=u}t(w)}}},o={"uint32,1,0":function(e,t,r){return function n(a,i,o,s,l,c,u,f,p,h,d){var m,g,y,v,b,x,_,w,k,D,T,A,S,M,E,C,N,O,I,P,R,L,F,B,z,j=(i-a+1)/6|0,U=a+j,$=i-j,V=a+i>>1,q=V-j,W=V+j,H=U,G=q,X=V,Y=W,Z=$,K=a+1,J=i-1,Q=!0,ee=0,te=0,re=0,ne=f,ae=t(ne),ie=t(ne);T=l*H,A=l*G,z=s;e:for(D=0;D<f;++D){if(w=A+z,(re=o[_=T+z]-o[w])>0){g=H,H=G,G=g;break e}if(re<0)break e;z+=h}T=l*Y,A=l*Z,z=s;e:for(D=0;D<f;++D){if(w=A+z,(re=o[_=T+z]-o[w])>0){g=Y,Y=Z,Z=g;break e}if(re<0)break e;z+=h}T=l*H,A=l*X,z=s;e:for(D=0;D<f;++D){if(w=A+z,(re=o[_=T+z]-o[w])>0){g=H,H=X,X=g;break e}if(re<0)break e;z+=h}T=l*G,A=l*X,z=s;e:for(D=0;D<f;++D){if(w=A+z,(re=o[_=T+z]-o[w])>0){g=G,G=X,X=g;break e}if(re<0)break e;z+=h}T=l*H,A=l*Y,z=s;e:for(D=0;D<f;++D){if(w=A+z,(re=o[_=T+z]-o[w])>0){g=H,H=Y,Y=g;break e}if(re<0)break e;z+=h}T=l*X,A=l*Y,z=s;e:for(D=0;D<f;++D){if(w=A+z,(re=o[_=T+z]-o[w])>0){g=X,X=Y,Y=g;break e}if(re<0)break e;z+=h}T=l*G,A=l*Z,z=s;e:for(D=0;D<f;++D){if(w=A+z,(re=o[_=T+z]-o[w])>0){g=G,G=Z,Z=g;break e}if(re<0)break e;z+=h}T=l*G,A=l*X,z=s;e:for(D=0;D<f;++D){if(w=A+z,(re=o[_=T+z]-o[w])>0){g=G,G=X,X=g;break e}if(re<0)break e;z+=h}T=l*Y,A=l*Z,z=s;e:for(D=0;D<f;++D){if(w=A+z,(re=o[_=T+z]-o[w])>0){g=Y,Y=Z,Z=g;break e}if(re<0)break e;z+=h}for(T=l*H,A=l*G,S=l*X,M=l*Y,E=l*Z,C=l*U,N=l*V,O=l*$,B=0,z=s,D=0;D<f;++D)_=T+z,w=A+z,k=S+z,I=M+z,P=E+z,R=C+z,L=N+z,F=O+z,ae[B]=o[w],ie[B]=o[I],Q=Q&&ae[B]===ie[B],y=o[_],v=o[k],b=o[P],o[R]=y,o[L]=v,o[F]=b,++B,z+=p;for(T=l*q,A=l*a,z=s,D=0;D<f;++D)w=A+z,o[_=T+z]=o[w],z+=p;for(T=l*W,A=l*i,z=s,D=0;D<f;++D)w=A+z,o[_=T+z]=o[w],z+=p;if(Q)for(x=K;x<=J;++x){for(_=s+x*l,B=0,D=0;D<f&&0==(re=o[_]-ae[B]);++D)B+=d,_+=h;if(0!==re)if(re<0){if(x!==K)for(T=l*x,A=l*K,z=s,D=0;D<f;++D)w=A+z,m=o[_=T+z],o[_]=o[w],o[w]=m,z+=p;++K}else for(;;){for(_=s+J*l,B=0,D=0;D<f&&0==(re=o[_]-ae[B]);++D)B+=d,_+=h;if(!(re>0)){if(re<0){for(T=l*x,A=l*K,S=l*J,z=s,D=0;D<f;++D)w=A+z,k=S+z,m=o[_=T+z],o[_]=o[w],o[w]=o[k],o[k]=m,z+=p;++K,--J;break}for(T=l*x,A=l*J,z=s,D=0;D<f;++D)w=A+z,m=o[_=T+z],o[_]=o[w],o[w]=m,z+=p;--J;break}J--}}else for(x=K;x<=J;++x){for(_=s+x*l,B=0,D=0;D<f&&0==(ee=o[_]-ae[B]);++D)B+=d,_+=h;if(ee<0){if(x!==K)for(T=l*x,A=l*K,z=s,D=0;D<f;++D)w=A+z,m=o[_=T+z],o[_]=o[w],o[w]=m,z+=p;++K}else{for(_=s+x*l,B=0,D=0;D<f&&0==(te=o[_]-ie[B]);++D)B+=d,_+=h;if(te>0)for(;;){for(_=s+J*l,B=0,D=0;D<f&&0==(re=o[_]-ie[B]);++D)B+=d,_+=h;if(!(re>0)){for(_=s+J*l,B=0,D=0;D<f&&0==(re=o[_]-ae[B]);++D)B+=d,_+=h;if(re<0){for(T=l*x,A=l*K,S=l*J,z=s,D=0;D<f;++D)w=A+z,k=S+z,m=o[_=T+z],o[_]=o[w],o[w]=o[k],o[k]=m,z+=p;++K,--J}else{for(T=l*x,A=l*J,z=s,D=0;D<f;++D)w=A+z,m=o[_=T+z],o[_]=o[w],o[w]=m,z+=p;--J}break}if(--J<x)break}}}for(T=l*a,A=l*(K-1),B=0,z=s,D=0;D<f;++D)w=A+z,o[_=T+z]=o[w],o[w]=ae[B],++B,z+=p;for(T=l*i,A=l*(J+1),B=0,z=s,D=0;D<f;++D)w=A+z,o[_=T+z]=o[w],o[w]=ie[B],++B,z+=p;if(K-2-a<=32?e(a,K-2,o,s,l,c,u,f,p,h,d):n(a,K-2,o,s,l,c,u,f,p,h,d),i-(J+2)<=32?e(J+2,i,o,s,l,c,u,f,p,h,d):n(J+2,i,o,s,l,c,u,f,p,h,d),Q)return r(ae),void r(ie);if(K<U&&J>$){e:for(;;){for(_=s+K*l,B=0,z=s,D=0;D<f;++D){if(o[_]!==ae[B])break e;++B,_+=p}++K}e:for(;;){for(_=s+J*l,B=0,z=s,D=0;D<f;++D){if(o[_]!==ie[B])break e;++B,_+=p}--J}for(x=K;x<=J;++x){for(_=s+x*l,B=0,D=0;D<f&&0==(ee=o[_]-ae[B]);++D)B+=d,_+=h;if(0===ee){if(x!==K)for(T=l*x,A=l*K,z=s,D=0;D<f;++D)w=A+z,m=o[_=T+z],o[_]=o[w],o[w]=m,z+=p;++K}else{for(_=s+x*l,B=0,D=0;D<f&&0==(te=o[_]-ie[B]);++D)B+=d,_+=h;if(0===te)for(;;){for(_=s+J*l,B=0,D=0;D<f&&0==(re=o[_]-ie[B]);++D)B+=d,_+=h;if(0!==re){for(_=s+J*l,B=0,D=0;D<f&&0==(re=o[_]-ae[B]);++D)B+=d,_+=h;if(re<0){for(T=l*x,A=l*K,S=l*J,z=s,D=0;D<f;++D)w=A+z,k=S+z,m=o[_=T+z],o[_]=o[w],o[w]=o[k],o[k]=m,z+=p;++K,--J}else{for(T=l*x,A=l*J,z=s,D=0;D<f;++D)w=A+z,m=o[_=T+z],o[_]=o[w],o[w]=m,z+=p;--J}break}if(--J<x)break}}}}r(ae),r(ie),J-K<=32?e(K,J,o,s,l,c,u,f,p,h,d):n(K,J,o,s,l,c,u,f,p,h,d)}}},s={"uint32,1,0":function(e,t){return function(r){var n=r.data,a=0|r.offset,i=r.shape,o=r.stride,s=0|o[0],l=0|i[0],c=0|o[1],u=0|i[1],f=c,p=c;l<=32?e(0,l-1,n,a,s,c,l,u,f,p,1):t(0,l-1,n,a,s,c,l,u,f,p,1)}}};t.exports=function(e,t){var r=[t,e].join(","),n=s[r],l=function(e,t){var r=a(t),n=[t,e].join(","),o=i[n];return r?o(r[0],r[1]):o()}(e,t),c=function(e,t,r){var n=a(t),i=[t,e].join(","),s=o[i];return e.length>1&&n?s(r,n[0],n[1]):s(r)}(e,t,l);return n(l,c)}},{"typedarray-pool":308}],258:[function(e,t,r){"use strict";var n=e("./lib/compile_sort.js"),a={};t.exports=function(e){var t=e.order,r=e.dtype,i=[t,r].join(":"),o=a[i];return o||(a[i]=o=n(t,r)),o(e),e}},{"./lib/compile_sort.js":257}],259:[function(e,t,r){var n=e("is-buffer"),a="undefined"!=typeof Float64Array;function i(e,t){return e[0]-t[0]}function o(){var e,t=this.stride,r=new Array(t.length);for(e=0;e<r.length;++e)r[e]=[Math.abs(t[e]),e];r.sort(i);var n=new Array(r.length);for(e=0;e<n.length;++e)n[e]=r[e][1];return n}var s={T:function(e){function t(e){this.data=e}var r=t.prototype;return r.dtype=e,r.index=function(){return-1},r.size=0,r.dimension=-1,r.shape=r.stride=r.order=[],r.lo=r.hi=r.transpose=r.step=function(){return new t(this.data)},r.get=r.set=function(){},r.pick=function(){return null},function(e){return new t(e)}},0:function(e,t){function r(e,t){this.data=e,this.offset=t}var n=r.prototype;return n.dtype=e,n.index=function(){return this.offset},n.dimension=0,n.size=1,n.shape=n.stride=n.order=[],n.lo=n.hi=n.transpose=n.step=function(){return new r(this.data,this.offset)},n.pick=function(){return t(this.data)},n.valueOf=n.get=function(){return"generic"===e?this.data.get(this.offset):this.data[this.offset]},n.set=function(t){return"generic"===e?this.data.set(this.offset,t):this.data[this.offset]=t},function(e,t,n,a){return new r(e,a)}},1:function(e,t,r){function n(e,t,r,n){this.data=e,this.shape=[t],this.stride=[r],this.offset=0|n}var a=n.prototype;return a.dtype=e,a.dimension=1,Object.defineProperty(a,"size",{get:function(){return this.shape[0]}}),a.order=[0],a.set=function(t,r){return"generic"===e?this.data.set(this.offset+this.stride[0]*t,r):this.data[this.offset+this.stride[0]*t]=r},a.get=function(t){return"generic"===e?this.data.get(this.offset+this.stride[0]*t):this.data[this.offset+this.stride[0]*t]},a.index=function(e){return this.offset+this.stride[0]*e},a.hi=function(e){return new n(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,this.stride[0],this.offset)},a.lo=function(e){var t=this.offset,r=0,a=this.shape[0],i=this.stride[0];return"number"==typeof e&&e>=0&&(t+=i*(r=0|e),a-=r),new n(this.data,a,i,t)},a.step=function(e){var t=this.shape[0],r=this.stride[0],a=this.offset,i=0,o=Math.ceil;return"number"==typeof e&&((i=0|e)<0?(a+=r*(t-1),t=o(-t/i)):t=o(t/i),r*=i),new n(this.data,t,r,a)},a.transpose=function(e){e=void 0===e?0:0|e;var t=this.shape,r=this.stride;return new n(this.data,t[e],r[e],this.offset)},a.pick=function(e){var r=[],n=[],a=this.offset;return"number"==typeof e&&e>=0?a=a+this.stride[0]*e|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,t[r.length+1])(this.data,r,n,a)},function(e,t,r,a){return new n(e,t[0],r[0],a)}},2:function(e,t,r){function n(e,t,r,n,a,i){this.data=e,this.shape=[t,r],this.stride=[n,a],this.offset=0|i}var a=n.prototype;return a.dtype=e,a.dimension=2,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(a,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),a.set=function(t,r,n){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]=n},a.get=function(t,r){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]},a.index=function(e,t){return this.offset+this.stride[0]*e+this.stride[1]*t},a.hi=function(e,t){return new n(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,this.stride[0],this.stride[1],this.offset)},a.lo=function(e,t){var r=this.offset,a=0,i=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof e&&e>=0&&(r+=s*(a=0|e),i-=a),"number"==typeof t&&t>=0&&(r+=l*(a=0|t),o-=a),new n(this.data,i,o,s,l,r)},a.step=function(e,t){var r=this.shape[0],a=this.shape[1],i=this.stride[0],o=this.stride[1],s=this.offset,l=0,c=Math.ceil;return"number"==typeof e&&((l=0|e)<0?(s+=i*(r-1),r=c(-r/l)):r=c(r/l),i*=l),"number"==typeof t&&((l=0|t)<0?(s+=o*(a-1),a=c(-a/l)):a=c(a/l),o*=l),new n(this.data,r,a,i,o,s)},a.transpose=function(e,t){e=void 0===e?0:0|e,t=void 0===t?1:0|t;var r=this.shape,a=this.stride;return new n(this.data,r[e],r[t],a[e],a[t],this.offset)},a.pick=function(e,r){var n=[],a=[],i=this.offset;return"number"==typeof e&&e>=0?i=i+this.stride[0]*e|0:(n.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?i=i+this.stride[1]*r|0:(n.push(this.shape[1]),a.push(this.stride[1])),(0,t[n.length+1])(this.data,n,a,i)},function(e,t,r,a){return new n(e,t[0],t[1],r[0],r[1],a)}},3:function(e,t,r){function n(e,t,r,n,a,i,o,s){this.data=e,this.shape=[t,r,n],this.stride=[a,i,o],this.offset=0|s}var a=n.prototype;return a.dtype=e,a.dimension=3,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(a,"order",{get:function(){var e=Math.abs(this.stride[0]),t=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return e>t?t>r?[2,1,0]:e>r?[1,2,0]:[1,0,2]:e>r?[2,0,1]:r>t?[0,1,2]:[0,2,1]}}),a.set=function(t,r,n,a){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n,a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]=a},a.get=function(t,r,n){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]},a.index=function(e,t,r){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r},a.hi=function(e,t,r){return new n(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},a.lo=function(e,t,r){var a=this.offset,i=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.stride[0],u=this.stride[1],f=this.stride[2];return"number"==typeof e&&e>=0&&(a+=c*(i=0|e),o-=i),"number"==typeof t&&t>=0&&(a+=u*(i=0|t),s-=i),"number"==typeof r&&r>=0&&(a+=f*(i=0|r),l-=i),new n(this.data,o,s,l,c,u,f,a)},a.step=function(e,t,r){var a=this.shape[0],i=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],c=this.stride[2],u=this.offset,f=0,p=Math.ceil;return"number"==typeof e&&((f=0|e)<0?(u+=s*(a-1),a=p(-a/f)):a=p(a/f),s*=f),"number"==typeof t&&((f=0|t)<0?(u+=l*(i-1),i=p(-i/f)):i=p(i/f),l*=f),"number"==typeof r&&((f=0|r)<0?(u+=c*(o-1),o=p(-o/f)):o=p(o/f),c*=f),new n(this.data,a,i,o,s,l,c,u)},a.transpose=function(e,t,r){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r;var a=this.shape,i=this.stride;return new n(this.data,a[e],a[t],a[r],i[e],i[t],i[r],this.offset)},a.pick=function(e,r,n){var a=[],i=[],o=this.offset;return"number"==typeof e&&e>=0?o=o+this.stride[0]*e|0:(a.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(a.push(this.shape[1]),i.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(a.push(this.shape[2]),i.push(this.stride[2])),(0,t[a.length+1])(this.data,a,i,o)},function(e,t,r,a){return new n(e,t[0],t[1],t[2],r[0],r[1],r[2],a)}},4:function(e,t,r){function n(e,t,r,n,a,i,o,s,l,c){this.data=e,this.shape=[t,r,n,a],this.stride=[i,o,s,l],this.offset=0|c}var a=n.prototype;return a.dtype=e,a.dimension=4,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(a,"order",{get:r}),a.set=function(t,r,n,a,i){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a,i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a]=i},a.get=function(t,r,n,a){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a]},a.index=function(e,t,r,n){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n},a.hi=function(e,t,r,a){return new n(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof a||a<0?this.shape[3]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},a.lo=function(e,t,r,a){var i=this.offset,o=0,s=this.shape[0],l=this.shape[1],c=this.shape[2],u=this.shape[3],f=this.stride[0],p=this.stride[1],h=this.stride[2],d=this.stride[3];return"number"==typeof e&&e>=0&&(i+=f*(o=0|e),s-=o),"number"==typeof t&&t>=0&&(i+=p*(o=0|t),l-=o),"number"==typeof r&&r>=0&&(i+=h*(o=0|r),c-=o),"number"==typeof a&&a>=0&&(i+=d*(o=0|a),u-=o),new n(this.data,s,l,c,u,f,p,h,d,i)},a.step=function(e,t,r,a){var i=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],c=this.stride[0],u=this.stride[1],f=this.stride[2],p=this.stride[3],h=this.offset,d=0,m=Math.ceil;return"number"==typeof e&&((d=0|e)<0?(h+=c*(i-1),i=m(-i/d)):i=m(i/d),c*=d),"number"==typeof t&&((d=0|t)<0?(h+=u*(o-1),o=m(-o/d)):o=m(o/d),u*=d),"number"==typeof r&&((d=0|r)<0?(h+=f*(s-1),s=m(-s/d)):s=m(s/d),f*=d),"number"==typeof a&&((d=0|a)<0?(h+=p*(l-1),l=m(-l/d)):l=m(l/d),p*=d),new n(this.data,i,o,s,l,c,u,f,p,h)},a.transpose=function(e,t,r,a){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,a=void 0===a?3:0|a;var i=this.shape,o=this.stride;return new n(this.data,i[e],i[t],i[r],i[a],o[e],o[t],o[r],o[a],this.offset)},a.pick=function(e,r,n,a){var i=[],o=[],s=this.offset;return"number"==typeof e&&e>=0?s=s+this.stride[0]*e|0:(i.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(i.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(i.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof a&&a>=0?s=s+this.stride[3]*a|0:(i.push(this.shape[3]),o.push(this.stride[3])),(0,t[i.length+1])(this.data,i,o,s)},function(e,t,r,a){return new n(e,t[0],t[1],t[2],t[3],r[0],r[1],r[2],r[3],a)}},5:function(e,t,r){function n(e,t,r,n,a,i,o,s,l,c,u,f){this.data=e,this.shape=[t,r,n,a,i],this.stride=[o,s,l,c,u],this.offset=0|f}var a=n.prototype;return a.dtype=e,a.dimension=5,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(a,"order",{get:r}),a.set=function(t,r,n,a,i,o){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i,o):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i]=o},a.get=function(t,r,n,a,i){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i]},a.index=function(e,t,r,n,a){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n+this.stride[4]*a},a.hi=function(e,t,r,a,i){return new n(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof a||a<0?this.shape[3]:0|a,"number"!=typeof i||i<0?this.shape[4]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},a.lo=function(e,t,r,a,i){var o=this.offset,s=0,l=this.shape[0],c=this.shape[1],u=this.shape[2],f=this.shape[3],p=this.shape[4],h=this.stride[0],d=this.stride[1],m=this.stride[2],g=this.stride[3],y=this.stride[4];return"number"==typeof e&&e>=0&&(o+=h*(s=0|e),l-=s),"number"==typeof t&&t>=0&&(o+=d*(s=0|t),c-=s),"number"==typeof r&&r>=0&&(o+=m*(s=0|r),u-=s),"number"==typeof a&&a>=0&&(o+=g*(s=0|a),f-=s),"number"==typeof i&&i>=0&&(o+=y*(s=0|i),p-=s),new n(this.data,l,c,u,f,p,h,d,m,g,y,o)},a.step=function(e,t,r,a,i){var o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.shape[3],u=this.shape[4],f=this.stride[0],p=this.stride[1],h=this.stride[2],d=this.stride[3],m=this.stride[4],g=this.offset,y=0,v=Math.ceil;return"number"==typeof e&&((y=0|e)<0?(g+=f*(o-1),o=v(-o/y)):o=v(o/y),f*=y),"number"==typeof t&&((y=0|t)<0?(g+=p*(s-1),s=v(-s/y)):s=v(s/y),p*=y),"number"==typeof r&&((y=0|r)<0?(g+=h*(l-1),l=v(-l/y)):l=v(l/y),h*=y),"number"==typeof a&&((y=0|a)<0?(g+=d*(c-1),c=v(-c/y)):c=v(c/y),d*=y),"number"==typeof i&&((y=0|i)<0?(g+=m*(u-1),u=v(-u/y)):u=v(u/y),m*=y),new n(this.data,o,s,l,c,u,f,p,h,d,m,g)},a.transpose=function(e,t,r,a,i){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,a=void 0===a?3:0|a,i=void 0===i?4:0|i;var o=this.shape,s=this.stride;return new n(this.data,o[e],o[t],o[r],o[a],o[i],s[e],s[t],s[r],s[a],s[i],this.offset)},a.pick=function(e,r,n,a,i){var o=[],s=[],l=this.offset;return"number"==typeof e&&e>=0?l=l+this.stride[0]*e|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof a&&a>=0?l=l+this.stride[3]*a|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof i&&i>=0?l=l+this.stride[4]*i|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,t[o.length+1])(this.data,o,s,l)},function(e,t,r,a){return new n(e,t[0],t[1],t[2],t[3],t[4],r[0],r[1],r[2],r[3],r[4],a)}}};function l(e,t){var r=-1===t?"T":String(t),n=s[r];return-1===t?n(e):0===t?n(e,c[e][0]):n(e,c[e],o)}var c={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};t.exports=function(e,t,r,i){if(void 0===e)return(0,c.array[0])([]);"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var o=t.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=t[s]}if(void 0===i)for(i=0,s=0;s<o;++s)r[s]<0&&(i-=(t[s]-1)*r[s]);for(var f=function(e){if(n(e))return"buffer";if(a)switch(Object.prototype.toString.call(e)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(e)?"array":"generic"}(e),p=c[f];p.length<=o+1;)p.push(l(f,p.length-1));return(0,p[o+1])(e,t,r,i)}},{"is-buffer":237}],260:[function(e,t,r){"use strict";var n=e("double-bits"),a=Math.pow(2,-1074);t.exports=function(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(0===e)return t<0?-a:a;var r=n.hi(e),i=n.lo(e);return t>e==e>0?i===-1>>>0?(r+=1,i=0):i+=1:0===i?(i=-1>>>0,r-=1):i-=1,n.pack(i,r)}},{"double-bits":64}],261:[function(e,t,r){r.vertexNormals=function(e,t,r){for(var n=t.length,a=new Array(n),i=void 0===r?1e-6:r,o=0;o<n;++o)a[o]=[0,0,0];for(o=0;o<e.length;++o)for(var s=e[o],l=0,c=s[s.length-1],u=s[0],f=0;f<s.length;++f){l=c,c=u,u=s[(f+1)%s.length];for(var p=t[l],h=t[c],d=t[u],m=new Array(3),g=0,y=new Array(3),v=0,b=0;b<3;++b)m[b]=p[b]-h[b],g+=m[b]*m[b],y[b]=d[b]-h[b],v+=y[b]*y[b];if(g*v>i){var x=a[c],_=1/Math.sqrt(g*v);for(b=0;b<3;++b){var w=(b+1)%3,k=(b+2)%3;x[b]+=_*(y[w]*m[k]-y[k]*m[w])}}}for(o=0;o<n;++o){x=a[o];var D=0;for(b=0;b<3;++b)D+=x[b]*x[b];if(D>i)for(_=1/Math.sqrt(D),b=0;b<3;++b)x[b]*=_;else for(b=0;b<3;++b)x[b]=0}return a},r.faceNormals=function(e,t,r){for(var n=e.length,a=new Array(n),i=void 0===r?1e-6:r,o=0;o<n;++o){for(var s=e[o],l=new Array(3),c=0;c<3;++c)l[c]=t[s[c]];var u=new Array(3),f=new Array(3);for(c=0;c<3;++c)u[c]=l[1][c]-l[0][c],f[c]=l[2][c]-l[0][c];var p=new Array(3),h=0;for(c=0;c<3;++c){var d=(c+1)%3,m=(c+2)%3;p[c]=u[d]*f[m]-u[m]*f[d],h+=p[c]*p[c]}for(h=h>i?1/Math.sqrt(h):0,c=0;c<3;++c)p[c]*=h;a[o]=p}return a}},{}],262:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a,i,o,s,l,c){var u=t+i+c;if(f>0){var f=Math.sqrt(u+1);e[0]=.5*(o-l)/f,e[1]=.5*(s-n)/f,e[2]=.5*(r-i)/f,e[3]=.5*f}else{var p=Math.max(t,i,c);f=Math.sqrt(2*p-u+1),t>=p?(e[0]=.5*f,e[1]=.5*(a+r)/f,e[2]=.5*(s+n)/f,e[3]=.5*(o-l)/f):i>=p?(e[0]=.5*(r+a)/f,e[1]=.5*f,e[2]=.5*(l+o)/f,e[3]=.5*(s-n)/f):(e[0]=.5*(n+s)/f,e[1]=.5*(o+l)/f,e[2]=.5*f,e[3]=.5*(r-a)/f)}return e}},{}],263:[function(e,t,r){"use strict";t.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.rotation||[0,0,0,1],n=e.radius||1;t=[].slice.call(t,0,3),u(r=[].slice.call(r,0,4),r);var a=new f(r,t,Math.log(n));return a.setDistanceLimits(e.zoomMin,e.zoomMax),("eye"in e||"up"in e)&&a.lookAt(0,e.eye,e.center,e.up),a};var n=e("filtered-vector"),a=e("gl-mat4/lookAt"),i=e("gl-mat4/fromQuat"),o=e("gl-mat4/invert"),s=e("./lib/quatFromFrame");function l(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function c(e,t,r,n){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2)+Math.pow(n,2))}function u(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=c(r,n,a,i);o>1e-6?(e[0]=r/o,e[1]=n/o,e[2]=a/o,e[3]=i/o):(e[0]=e[1]=e[2]=0,e[3]=1)}function f(e,t,r){this.radius=n([r]),this.center=n(t),this.rotation=n(e),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var p=f.prototype;p.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},p.recalcMatrix=function(e){this.radius.curve(e),this.center.curve(e),this.rotation.curve(e);var t=this.computedRotation;u(t,t);var r=this.computedMatrix;i(r,t);var n=this.computedCenter,a=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);a[0]=n[0]+s*r[2],a[1]=n[1]+s*r[6],a[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var c=0,f=0;f<3;++f)c+=r[l+4*f]*a[f];r[12+l]=-c}},p.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r},p.idle=function(e){this.center.idle(e),this.radius.idle(e),this.rotation.idle(e)},p.flush=function(e){this.center.flush(e),this.radius.flush(e),this.rotation.flush(e)},p.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var a=this.computedMatrix,i=a[1],o=a[5],s=a[9],c=l(i,o,s);i/=c,o/=c,s/=c;var u=a[0],f=a[4],p=a[8],h=u*i+f*o+p*s,d=l(u-=i*h,f-=o*h,p-=s*h);u/=d,f/=d,p/=d;var m=a[2],g=a[6],y=a[10],v=m*i+g*o+y*s,b=m*u+g*f+y*p,x=l(m-=v*i+b*u,g-=v*o+b*f,y-=v*s+b*p);m/=x,g/=x,y/=x;var _=u*t+i*r,w=f*t+o*r,k=p*t+s*r;this.center.move(e,_,w,k);var D=Math.exp(this.computedRadius[0]);D=Math.max(1e-4,D+n),this.radius.set(e,Math.log(D))},p.rotate=function(e,t,r,n){this.recalcMatrix(e),t=t||0,r=r||0;var a=this.computedMatrix,i=a[0],o=a[4],s=a[8],u=a[1],f=a[5],p=a[9],h=a[2],d=a[6],m=a[10],g=t*i+r*u,y=t*o+r*f,v=t*s+r*p,b=-(d*v-m*y),x=-(m*g-h*v),_=-(h*y-d*g),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),k=c(b,x,_,w);k>1e-6?(b/=k,x/=k,_/=k,w/=k):(b=x=_=0,w=1);var D=this.computedRotation,T=D[0],A=D[1],S=D[2],M=D[3],E=T*w+M*b+A*_-S*x,C=A*w+M*x+S*b-T*_,N=S*w+M*_+T*x-A*b,O=M*w-T*b-A*x-S*_;if(n){b=h,x=d,_=m;var I=Math.sin(n)/l(b,x,_);b*=I,x*=I,_*=I,O=O*(w=Math.cos(t))-(E=E*w+O*b+C*_-N*x)*b-(C=C*w+O*x+N*b-E*_)*x-(N=N*w+O*_+E*x-C*b)*_}var P=c(E,C,N,O);P>1e-6?(E/=P,C/=P,N/=P,O/=P):(E=C=N=0,O=1),this.rotation.set(e,E,C,N,O)},p.lookAt=function(e,t,r,n){this.recalcMatrix(e),r=r||this.computedCenter,t=t||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;a(i,t,r,n);var o=this.computedRotation;s(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),u(o,o),this.rotation.set(e,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-t[c],2);this.radius.set(e,.5*Math.log(Math.max(l,1e-6))),this.center.set(e,r[0],r[1],r[2])},p.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},p.setMatrix=function(e,t){var r=this.computedRotation;s(r,t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]),u(r,r),this.rotation.set(e,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,t);var a=n[15];if(Math.abs(a)>1e-6){var i=n[12]/a,l=n[13]/a,c=n[14]/a;this.recalcMatrix(e);var f=Math.exp(this.computedRadius[0]);this.center.set(e,i-n[2]*f,l-n[6]*f,c-n[10]*f),this.radius.idle(e)}else this.center.idle(e),this.radius.idle(e)},p.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},p.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},p.getDistanceLimits=function(e){var t=this.radius.bounds;return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},p.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},p.fromJSON=function(e){var t=this.lastT(),r=e.center;r&&this.center.set(t,r[0],r[1],r[2]);var n=e.rotation;n&&this.rotation.set(t,n[0],n[1],n[2],n[3]);var a=e.distance;a&&a>0&&this.radius.set(t,Math.log(a)),this.setDistanceLimits(e.zoomMin,e.zoomMax)}},{"./lib/quatFromFrame":262,"filtered-vector":68,"gl-mat4/fromQuat":95,"gl-mat4/invert":98,"gl-mat4/lookAt":99}],264:[function(e,t,r){"use strict";var n=e("repeat-string");t.exports=function(e,t,r){return n(r=void 0!==r?r+"":" ",t)+e}},{"repeat-string":277}],265:[function(e,t,r){t.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},{}],266:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=0|t.length,a=e.length,i=[new Array(r),new Array(r)],o=0;o<r;++o)i[0][o]=[],i[1][o]=[];for(o=0;o<a;++o){var s=e[o];i[0][s[0]].push(s),i[1][s[1]].push(s)}var l=[];for(o=0;o<r;++o)i[0][o].length+i[1][o].length===0&&l.push([o]);function c(e,t){var r=i[t][e[t]];r.splice(r.indexOf(e),1)}function u(e,r,a){for(var o,s,l,u=0;u<2;++u)if(i[u][r].length>0){o=i[u][r][0],l=u;break}s=o[1^l];for(var f=0;f<2;++f)for(var p=i[f][r],h=0;h<p.length;++h){var d=p[h],m=d[1^f];n(t[e],t[r],t[s],t[m])>0&&(o=d,s=m,l=f)}return a||o&&c(o,l),s}function f(e,r){var a=i[r][e][0],o=[e];c(a,r);for(var s=a[1^r];;){for(;s!==e;)o.push(s),s=u(o[o.length-2],s,!1);if(i[0][e].length+i[1][e].length===0)break;var l=o[o.length-1],f=e,p=o[1],h=u(l,f,!0);if(n(t[l],t[f],t[p],t[h])<0)break;o.push(e),s=u(l,f)}return o}function p(e,t){return t[1]===t[t.length-1]}for(o=0;o<r;++o)for(var h=0;h<2;++h){for(var d=[];i[h][o].length>0;){i[0][o].length;var m=f(o,h);p(0,m)?d.push.apply(d,m):(d.length>0&&l.push(d),d=m)}d.length>0&&l.push(d)}return l};var n=e("compare-angle")},{"compare-angle":54}],267:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=n(e,t.length),a=new Array(t.length),i=new Array(t.length),o=[],s=0;s<t.length;++s){var l=r[s].length;i[s]=l,a[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){var c=o.pop();a[c]=!1;var u=r[c];for(s=0;s<u.length;++s){var f=u[s];0==--i[f]&&o.push(f)}}var p=new Array(t.length),h=[];for(s=0;s<t.length;++s)a[s]?(c=h.length,p[s]=c,h.push(t[s])):p[s]=-1;var d=[];for(s=0;s<e.length;++s){var m=e[s];a[m[0]]&&a[m[1]]&&d.push([p[m[0]],p[m[1]]])}return[d,h]};var n=e("edges-to-adjacency-list")},{"edges-to-adjacency-list":66}],268:[function(e,t,r){"use strict";t.exports=function(e,t){var r=c(e,t);e=r[0];for(var f=(t=r[1]).length,p=(e.length,n(e,t.length)),h=0;h<f;++h)if(p[h].length%2==1)throw new Error("planar-graph-to-polyline: graph must be manifold");var d=a(e,t),m=(d=d.filter((function(e){for(var r=e.length,n=[0],a=0;a<r;++a){var i=t[e[a]],l=t[e[(a+1)%r]],c=o(-i[0],i[1]),u=o(-i[0],l[1]),f=o(l[0],i[1]),p=o(l[0],l[1]);n=s(n,s(s(c,u),s(f,p)))}return n[n.length-1]>0}))).length,g=new Array(m),y=new Array(m);for(h=0;h<m;++h){g[h]=h;var v=new Array(m),b=d[h].map((function(e){return t[e]})),x=i([b]),_=0;e:for(var w=0;w<m;++w)if(v[w]=0,h!==w){for(var k=(V=d[w]).length,D=0;D<k;++D){var T=x(t[V[D]]);if(0!==T){T<0&&(v[w]=1,_+=1);continue e}}v[w]=1,_+=1}y[h]=[_,h,v]}for(y.sort((function(e,t){return t[0]-e[0]})),h=0;h<m;++h){var A=(v=y[h])[1],S=v[2];for(w=0;w<m;++w)S[w]&&(g[w]=A)}var M=function(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=[];return t}(m);for(h=0;h<m;++h)M[h].push(g[h]),M[g[h]].push(h);var E={},C=u(f,!1);for(h=0;h<m;++h)for(k=(V=d[h]).length,w=0;w<k;++w){var N=V[w],O=V[(w+1)%k],I=Math.min(N,O)+":"+Math.max(N,O);if(I in E){var P=E[I];M[P].push(h),M[h].push(P),C[N]=C[O]=!0}else E[I]=h}function R(e){for(var t=e.length,r=0;r<t;++r)if(!C[e[r]])return!1;return!0}var L=[],F=u(m,-1);for(h=0;h<m;++h)g[h]!==h||R(d[h])?F[h]=-1:(L.push(h),F[h]=0);for(r=[];L.length>0;){var B=L.pop(),z=M[B];l(z,(function(e,t){return e-t}));var j,U=z.length,$=F[B];if(0===$){var V=d[B];j=[V]}for(h=0;h<U;++h){var q=z[h];F[q]>=0||(F[q]=1^$,L.push(q),0===$&&(R(V=d[q])||(V.reverse(),j.push(V))))}0===$&&r.push(j)}return r};var n=e("edges-to-adjacency-list"),a=e("planar-dual"),i=e("point-in-big-polygon"),o=e("two-product"),s=e("robust-sum"),l=e("uniq"),c=e("./lib/trim-leaves");function u(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=t;return r}},{"./lib/trim-leaves":267,"edges-to-adjacency-list":66,"planar-dual":266,"point-in-big-polygon":269,"robust-sum":289,"two-product":306,uniq:310}],269:[function(e,t,r){t.exports=function(e){for(var t=e.length,r=[],i=[],s=0;s<t;++s)for(var u=e[s],f=u.length,p=f-1,h=0;h<f;p=h++){var d=u[p],m=u[h];d[0]===m[0]?i.push([d,m]):r.push([d,m])}if(0===r.length)return 0===i.length?c:(g=l(i),function(e){return g(e[0],e[1])?0:1});var g,y=a(r),v=function(e,t){return function(r){var a=o.le(t,r[0]);if(a<0)return 1;var i=e[a];if(!i){if(!(a>0&&t[a]===r[0]))return 1;i=e[a-1]}for(var s=1;i;){var l=i.key,c=n(r,l[0],l[1]);if(l[0][0]<l[1][0])if(c<0)i=i.left;else{if(!(c>0))return 0;s=-1,i=i.right}else if(c>0)i=i.left;else{if(!(c<0))return 0;s=1,i=i.right}}return s}}(y.slabs,y.coordinates);return 0===i.length?v:function(e,t){return function(r){return e(r[0],r[1])?0:t(r)}}(l(i),v)};var n=e("robust-orientation")[3],a=e("slab-decomposition"),i=e("interval-tree-1d"),o=e("binary-search-bounds");function s(){return!0}function l(e){for(var t={},r=0;r<e.length;++r){var n=e[r],a=n[0][0],o=n[0][1],l=n[1][1],c=[Math.min(o,l),Math.max(o,l)];a in t?t[a].push(c):t[a]=[c]}var u={},f=Object.keys(t);for(r=0;r<f.length;++r){var p=t[f[r]];u[f[r]]=i(p)}return function(e){return function(t,r){var n=e[t];return!!n&&!!n.queryPoint(r,s)}}(u)}function c(e){return 1}},{"binary-search-bounds":31,"interval-tree-1d":234,"robust-orientation":284,"slab-decomposition":299}],270:[function(e,t,r){"use strict";var n=new Float64Array(4),a=new Float64Array(4),i=new Float64Array(4);t.exports=function(e,t,r,o,s){n.length<o.length&&(n=new Float64Array(o.length),a=new Float64Array(o.length),i=new Float64Array(o.length));for(var l=0;l<o.length;++l)n[l]=e[l]-o[l],a[l]=t[l]-e[l],i[l]=r[l]-e[l];var c=0,u=0,f=0,p=0,h=0,d=0;for(l=0;l<o.length;++l){var m=a[l],g=i[l],y=n[l];c+=m*m,u+=m*g,f+=g*g,p+=y*m,h+=y*g,d+=y*y}var v,b,x,_,w,k=Math.abs(c*f-u*u),D=u*h-f*p,T=u*p-c*h;if(D+T<=k)if(D<0)T<0&&p<0?(T=0,-p>=c?(D=1,v=c+2*p+d):v=p*(D=-p/c)+d):(D=0,h>=0?(T=0,v=d):-h>=f?(T=1,v=f+2*h+d):v=h*(T=-h/f)+d);else if(T<0)T=0,p>=0?(D=0,v=d):-p>=c?(D=1,v=c+2*p+d):v=p*(D=-p/c)+d;else{var A=1/k;v=(D*=A)*(c*D+u*(T*=A)+2*p)+T*(u*D+f*T+2*h)+d}else D<0?(x=f+h)>(b=u+p)?(_=x-b)>=(w=c-2*u+f)?(D=1,T=0,v=c+2*p+d):v=(D=_/w)*(c*D+u*(T=1-D)+2*p)+T*(u*D+f*T+2*h)+d:(D=0,x<=0?(T=1,v=f+2*h+d):h>=0?(T=0,v=d):v=h*(T=-h/f)+d):T<0?(x=c+p)>(b=u+h)?(_=x-b)>=(w=c-2*u+f)?(T=1,D=0,v=f+2*h+d):v=(D=1-(T=_/w))*(c*D+u*T+2*p)+T*(u*D+f*T+2*h)+d:(T=0,x<=0?(D=1,v=c+2*p+d):p>=0?(D=0,v=d):v=p*(D=-p/c)+d):(_=f+h-u-p)<=0?(D=0,T=1,v=f+2*h+d):_>=(w=c-2*u+f)?(D=1,T=0,v=c+2*p+d):v=(D=_/w)*(c*D+u*(T=1-D)+2*p)+T*(u*D+f*T+2*h)+d;var S=1-D-T;for(l=0;l<o.length;++l)s[l]=S*e[l]+D*t[l]+T*r[l];return v<0?0:v}},{}],271:[function(e,t,r){t.exports=e("gl-quat/slerp")},{"gl-quat/slerp":124}],272:[function(e,t,r){"use strict";var n=e("big-rat/add");t.exports=function(e,t){for(var r=e.length,a=new Array(r),i=0;i<r;++i)a[i]=n(e[i],t[i]);return a}},{"big-rat/add":15}],273:[function(e,t,r){"use strict";t.exports=function(e){for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=n(e[r]);return t};var n=e("big-rat")},{"big-rat":18}],274:[function(e,t,r){"use strict";var n=e("big-rat"),a=e("big-rat/mul");t.exports=function(e,t){for(var r=n(t),i=e.length,o=new Array(i),s=0;s<i;++s)o[s]=a(e[s],r);return o}},{"big-rat":18,"big-rat/mul":27}],275:[function(e,t,r){"use strict";var n=e("big-rat/sub");t.exports=function(e,t){for(var r=e.length,a=new Array(r),i=0;i<r;++i)a[i]=n(e[i],t[i]);return a}},{"big-rat/sub":29}],276:[function(e,t,r){"use strict";var n=e("compare-cell"),a=e("compare-oriented-cell"),i=e("cell-orientation");t.exports=function(e){e.sort(a);for(var t=e.length,r=0,o=0;o<t;++o){var s=e[o],l=i(s);if(0!==l){if(r>0){var c=e[r-1];if(0===n(s,c)&&i(c)!==l){r-=1;continue}}e[r++]=s}}return e.length=r,e}},{"cell-orientation":47,"compare-cell":56,"compare-oriented-cell":57}],277:[function(e,t,r){"use strict";var n,a="";t.exports=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var r=e.length*t;if(n!==e||void 0===n)n=e,a="";else if(a.length>=r)return a.substr(0,r);for(;r>a.length&&t>1;)1&t&&(a+=e),t>>=1,e+=e;return a=(a+=e).substr(0,r)}},{}],278:[function(e,t,n){(function(e){(function(){t.exports=e.performance&&e.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this)}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],279:[function(e,t,r){"use strict";t.exports=function(e){for(var t=e.length,r=e[e.length-1],n=t,a=t-2;a>=0;--a){var i=r,o=e[a];(l=o-((r=i+o)-i))&&(e[--n]=r,r=l)}var s=0;for(a=n;a<t;++a){var l;(l=(o=r)-((r=(i=e[a])+o)-i))&&(e[s++]=l)}return e[s++]=r,e.length=s,e}},{}],280:[function(e,t,r){"use strict";var n=e("two-product"),a=e("robust-sum"),i=e("robust-scale"),o=e("robust-compress");function s(e,t,r,n){return function(t){return n(e(r(t[0][0],t[1][1]),r(-t[0][1],t[1][0])))}}function l(e,t,r,n){return function(a){return n(e(t(e(r(a[1][1],a[2][2]),r(-a[1][2],a[2][1])),a[0][0]),e(t(e(r(a[1][0],a[2][2]),r(-a[1][2],a[2][0])),-a[0][1]),t(e(r(a[1][0],a[2][1]),r(-a[1][1],a[2][0])),a[0][2]))))}}function c(e){return(2===e?s:3===e?l:void 0)(a,i,n,o)}var u=[function(){return[0]},function(e){return[e[0][0]]}];function f(e,t,r,n,a,i){return function(o){switch(o.length){case 0:return e(o);case 1:return t(o);case 2:return r(o);case 3:return n(o)}var s=a[o.length];return s||(s=a[o.length]=i(o.length)),s(o)}}!function(){for(;u.length<4;)u.push(c(u.length));t.exports=f.apply(void 0,u.concat([u,c]));for(var e=0;e<u.length;++e)t.exports[e]=u[e]}()},{"robust-compress":279,"robust-scale":286,"robust-sum":289,"two-product":306}],281:[function(e,t,r){"use strict";var n=e("two-product"),a=e("robust-sum");t.exports=function(e,t){for(var r=n(e[0],t[0]),i=1;i<e.length;++i)r=a(r,n(e[i],t[i]));return r}},{"robust-sum":289,"two-product":306}],282:[function(e,t,r){"use strict";var n=e("two-product"),a=e("robust-sum"),i=e("robust-subtract"),o=e("robust-scale");function s(e){return(3===e?l:4===e?c:5===e?u:f)(a,i,n,o)}function l(e,t,r,n){return function(a,i,o){var s=r(a[0],a[0]),l=n(s,i[0]),c=n(s,o[0]),u=r(i[0],i[0]),f=n(u,a[0]),p=n(u,o[0]),h=r(o[0],o[0]),d=n(h,a[0]),m=n(h,i[0]),g=e(t(m,p),t(f,l)),y=t(d,c),v=t(g,y);return v[v.length-1]}}function c(e,t,r,n){return function(a,i,o,s){var l=e(r(a[0],a[0]),r(a[1],a[1])),c=n(l,i[0]),u=n(l,o[0]),f=n(l,s[0]),p=e(r(i[0],i[0]),r(i[1],i[1])),h=n(p,a[0]),d=n(p,o[0]),m=n(p,s[0]),g=e(r(o[0],o[0]),r(o[1],o[1])),y=n(g,a[0]),v=n(g,i[0]),b=n(g,s[0]),x=e(r(s[0],s[0]),r(s[1],s[1])),_=n(x,a[0]),w=n(x,i[0]),k=n(x,o[0]),D=e(e(n(t(k,b),i[1]),e(n(t(w,m),-o[1]),n(t(v,d),s[1]))),e(n(t(w,m),a[1]),e(n(t(_,f),-i[1]),n(t(h,c),s[1])))),T=e(e(n(t(k,b),a[1]),e(n(t(_,f),-o[1]),n(t(y,u),s[1]))),e(n(t(v,d),a[1]),e(n(t(y,u),-i[1]),n(t(h,c),o[1])))),A=t(D,T);return A[A.length-1]}}function u(e,t,r,n){return function(a,i,o,s,l){var c=e(r(a[0],a[0]),e(r(a[1],a[1]),r(a[2],a[2]))),u=n(c,i[0]),f=n(c,o[0]),p=n(c,s[0]),h=n(c,l[0]),d=e(r(i[0],i[0]),e(r(i[1],i[1]),r(i[2],i[2]))),m=n(d,a[0]),g=n(d,o[0]),y=n(d,s[0]),v=n(d,l[0]),b=e(r(o[0],o[0]),e(r(o[1],o[1]),r(o[2],o[2]))),x=n(b,a[0]),_=n(b,i[0]),w=n(b,s[0]),k=n(b,l[0]),D=e(r(s[0],s[0]),e(r(s[1],s[1]),r(s[2],s[2]))),T=n(D,a[0]),A=n(D,i[0]),S=n(D,o[0]),M=n(D,l[0]),E=e(r(l[0],l[0]),e(r(l[1],l[1]),r(l[2],l[2]))),C=n(E,a[0]),N=n(E,i[0]),O=n(E,o[0]),I=n(E,s[0]),P=e(e(e(n(e(n(t(I,M),o[1]),e(n(t(O,k),-s[1]),n(t(S,w),l[1]))),i[2]),e(n(e(n(t(I,M),i[1]),e(n(t(N,v),-s[1]),n(t(A,y),l[1]))),-o[2]),n(e(n(t(O,k),i[1]),e(n(t(N,v),-o[1]),n(t(_,g),l[1]))),s[2]))),e(n(e(n(t(S,w),i[1]),e(n(t(A,y),-o[1]),n(t(_,g),s[1]))),-l[2]),e(n(e(n(t(I,M),i[1]),e(n(t(N,v),-s[1]),n(t(A,y),l[1]))),a[2]),n(e(n(t(I,M),a[1]),e(n(t(C,h),-s[1]),n(t(T,p),l[1]))),-i[2])))),e(e(n(e(n(t(N,v),a[1]),e(n(t(C,h),-i[1]),n(t(m,u),l[1]))),s[2]),e(n(e(n(t(A,y),a[1]),e(n(t(T,p),-i[1]),n(t(m,u),s[1]))),-l[2]),n(e(n(t(S,w),i[1]),e(n(t(A,y),-o[1]),n(t(_,g),s[1]))),a[2]))),e(n(e(n(t(S,w),a[1]),e(n(t(T,p),-o[1]),n(t(x,f),s[1]))),-i[2]),e(n(e(n(t(A,y),a[1]),e(n(t(T,p),-i[1]),n(t(m,u),s[1]))),o[2]),n(e(n(t(_,g),a[1]),e(n(t(x,f),-i[1]),n(t(m,u),o[1]))),-s[2]))))),R=e(e(e(n(e(n(t(I,M),o[1]),e(n(t(O,k),-s[1]),n(t(S,w),l[1]))),a[2]),n(e(n(t(I,M),a[1]),e(n(t(C,h),-s[1]),n(t(T,p),l[1]))),-o[2])),e(n(e(n(t(O,k),a[1]),e(n(t(C,h),-o[1]),n(t(x,f),l[1]))),s[2]),n(e(n(t(S,w),a[1]),e(n(t(T,p),-o[1]),n(t(x,f),s[1]))),-l[2]))),e(e(n(e(n(t(O,k),i[1]),e(n(t(N,v),-o[1]),n(t(_,g),l[1]))),a[2]),n(e(n(t(O,k),a[1]),e(n(t(C,h),-o[1]),n(t(x,f),l[1]))),-i[2])),e(n(e(n(t(N,v),a[1]),e(n(t(C,h),-i[1]),n(t(m,u),l[1]))),o[2]),n(e(n(t(_,g),a[1]),e(n(t(x,f),-i[1]),n(t(m,u),o[1]))),-l[2])))),L=t(P,R);return L[L.length-1]}}function f(e,t,r,n){return function(a,i,o,s,l,c){var u=e(e(r(a[0],a[0]),r(a[1],a[1])),e(r(a[2],a[2]),r(a[3],a[3]))),f=n(u,i[0]),p=n(u,o[0]),h=n(u,s[0]),d=n(u,l[0]),m=n(u,c[0]),g=e(e(r(i[0],i[0]),r(i[1],i[1])),e(r(i[2],i[2]),r(i[3],i[3]))),y=n(g,a[0]),v=n(g,o[0]),b=n(g,s[0]),x=n(g,l[0]),_=n(g,c[0]),w=e(e(r(o[0],o[0]),r(o[1],o[1])),e(r(o[2],o[2]),r(o[3],o[3]))),k=n(w,a[0]),D=n(w,i[0]),T=n(w,s[0]),A=n(w,l[0]),S=n(w,c[0]),M=e(e(r(s[0],s[0]),r(s[1],s[1])),e(r(s[2],s[2]),r(s[3],s[3]))),E=n(M,a[0]),C=n(M,i[0]),N=n(M,o[0]),O=n(M,l[0]),I=n(M,c[0]),P=e(e(r(l[0],l[0]),r(l[1],l[1])),e(r(l[2],l[2]),r(l[3],l[3]))),R=n(P,a[0]),L=n(P,i[0]),F=n(P,o[0]),B=n(P,s[0]),z=n(P,c[0]),j=e(e(r(c[0],c[0]),r(c[1],c[1])),e(r(c[2],c[2]),r(c[3],c[3]))),U=n(j,a[0]),$=n(j,i[0]),V=n(j,o[0]),q=n(j,s[0]),W=n(j,l[0]),H=e(e(e(n(e(e(n(e(n(t(W,z),s[1]),e(n(t(q,I),-l[1]),n(t(B,O),c[1]))),o[2]),n(e(n(t(W,z),o[1]),e(n(t(V,S),-l[1]),n(t(F,A),c[1]))),-s[2])),e(n(e(n(t(q,I),o[1]),e(n(t(V,S),-s[1]),n(t(N,T),c[1]))),l[2]),n(e(n(t(B,O),o[1]),e(n(t(F,A),-s[1]),n(t(N,T),l[1]))),-c[2]))),i[3]),e(n(e(e(n(e(n(t(W,z),s[1]),e(n(t(q,I),-l[1]),n(t(B,O),c[1]))),i[2]),n(e(n(t(W,z),i[1]),e(n(t($,_),-l[1]),n(t(L,x),c[1]))),-s[2])),e(n(e(n(t(q,I),i[1]),e(n(t($,_),-s[1]),n(t(C,b),c[1]))),l[2]),n(e(n(t(B,O),i[1]),e(n(t(L,x),-s[1]),n(t(C,b),l[1]))),-c[2]))),-o[3]),n(e(e(n(e(n(t(W,z),o[1]),e(n(t(V,S),-l[1]),n(t(F,A),c[1]))),i[2]),n(e(n(t(W,z),i[1]),e(n(t($,_),-l[1]),n(t(L,x),c[1]))),-o[2])),e(n(e(n(t(V,S),i[1]),e(n(t($,_),-o[1]),n(t(D,v),c[1]))),l[2]),n(e(n(t(F,A),i[1]),e(n(t(L,x),-o[1]),n(t(D,v),l[1]))),-c[2]))),s[3]))),e(e(n(e(e(n(e(n(t(q,I),o[1]),e(n(t(V,S),-s[1]),n(t(N,T),c[1]))),i[2]),n(e(n(t(q,I),i[1]),e(n(t($,_),-s[1]),n(t(C,b),c[1]))),-o[2])),e(n(e(n(t(V,S),i[1]),e(n(t($,_),-o[1]),n(t(D,v),c[1]))),s[2]),n(e(n(t(N,T),i[1]),e(n(t(C,b),-o[1]),n(t(D,v),s[1]))),-c[2]))),-l[3]),n(e(e(n(e(n(t(B,O),o[1]),e(n(t(F,A),-s[1]),n(t(N,T),l[1]))),i[2]),n(e(n(t(B,O),i[1]),e(n(t(L,x),-s[1]),n(t(C,b),l[1]))),-o[2])),e(n(e(n(t(F,A),i[1]),e(n(t(L,x),-o[1]),n(t(D,v),l[1]))),s[2]),n(e(n(t(N,T),i[1]),e(n(t(C,b),-o[1]),n(t(D,v),s[1]))),-l[2]))),c[3])),e(n(e(e(n(e(n(t(W,z),s[1]),e(n(t(q,I),-l[1]),n(t(B,O),c[1]))),i[2]),n(e(n(t(W,z),i[1]),e(n(t($,_),-l[1]),n(t(L,x),c[1]))),-s[2])),e(n(e(n(t(q,I),i[1]),e(n(t($,_),-s[1]),n(t(C,b),c[1]))),l[2]),n(e(n(t(B,O),i[1]),e(n(t(L,x),-s[1]),n(t(C,b),l[1]))),-c[2]))),a[3]),n(e(e(n(e(n(t(W,z),s[1]),e(n(t(q,I),-l[1]),n(t(B,O),c[1]))),a[2]),n(e(n(t(W,z),a[1]),e(n(t(U,m),-l[1]),n(t(R,d),c[1]))),-s[2])),e(n(e(n(t(q,I),a[1]),e(n(t(U,m),-s[1]),n(t(E,h),c[1]))),l[2]),n(e(n(t(B,O),a[1]),e(n(t(R,d),-s[1]),n(t(E,h),l[1]))),-c[2]))),-i[3])))),e(e(e(n(e(e(n(e(n(t(W,z),i[1]),e(n(t($,_),-l[1]),n(t(L,x),c[1]))),a[2]),n(e(n(t(W,z),a[1]),e(n(t(U,m),-l[1]),n(t(R,d),c[1]))),-i[2])),e(n(e(n(t($,_),a[1]),e(n(t(U,m),-i[1]),n(t(y,f),c[1]))),l[2]),n(e(n(t(L,x),a[1]),e(n(t(R,d),-i[1]),n(t(y,f),l[1]))),-c[2]))),s[3]),n(e(e(n(e(n(t(q,I),i[1]),e(n(t($,_),-s[1]),n(t(C,b),c[1]))),a[2]),n(e(n(t(q,I),a[1]),e(n(t(U,m),-s[1]),n(t(E,h),c[1]))),-i[2])),e(n(e(n(t($,_),a[1]),e(n(t(U,m),-i[1]),n(t(y,f),c[1]))),s[2]),n(e(n(t(C,b),a[1]),e(n(t(E,h),-i[1]),n(t(y,f),s[1]))),-c[2]))),-l[3])),e(n(e(e(n(e(n(t(B,O),i[1]),e(n(t(L,x),-s[1]),n(t(C,b),l[1]))),a[2]),n(e(n(t(B,O),a[1]),e(n(t(R,d),-s[1]),n(t(E,h),l[1]))),-i[2])),e(n(e(n(t(L,x),a[1]),e(n(t(R,d),-i[1]),n(t(y,f),l[1]))),s[2]),n(e(n(t(C,b),a[1]),e(n(t(E,h),-i[1]),n(t(y,f),s[1]))),-l[2]))),c[3]),n(e(e(n(e(n(t(q,I),o[1]),e(n(t(V,S),-s[1]),n(t(N,T),c[1]))),i[2]),n(e(n(t(q,I),i[1]),e(n(t($,_),-s[1]),n(t(C,b),c[1]))),-o[2])),e(n(e(n(t(V,S),i[1]),e(n(t($,_),-o[1]),n(t(D,v),c[1]))),s[2]),n(e(n(t(N,T),i[1]),e(n(t(C,b),-o[1]),n(t(D,v),s[1]))),-c[2]))),a[3]))),e(e(n(e(e(n(e(n(t(q,I),o[1]),e(n(t(V,S),-s[1]),n(t(N,T),c[1]))),a[2]),n(e(n(t(q,I),a[1]),e(n(t(U,m),-s[1]),n(t(E,h),c[1]))),-o[2])),e(n(e(n(t(V,S),a[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),s[2]),n(e(n(t(N,T),a[1]),e(n(t(E,h),-o[1]),n(t(k,p),s[1]))),-c[2]))),-i[3]),n(e(e(n(e(n(t(q,I),i[1]),e(n(t($,_),-s[1]),n(t(C,b),c[1]))),a[2]),n(e(n(t(q,I),a[1]),e(n(t(U,m),-s[1]),n(t(E,h),c[1]))),-i[2])),e(n(e(n(t($,_),a[1]),e(n(t(U,m),-i[1]),n(t(y,f),c[1]))),s[2]),n(e(n(t(C,b),a[1]),e(n(t(E,h),-i[1]),n(t(y,f),s[1]))),-c[2]))),o[3])),e(n(e(e(n(e(n(t(V,S),i[1]),e(n(t($,_),-o[1]),n(t(D,v),c[1]))),a[2]),n(e(n(t(V,S),a[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),-i[2])),e(n(e(n(t($,_),a[1]),e(n(t(U,m),-i[1]),n(t(y,f),c[1]))),o[2]),n(e(n(t(D,v),a[1]),e(n(t(k,p),-i[1]),n(t(y,f),o[1]))),-c[2]))),-s[3]),n(e(e(n(e(n(t(N,T),i[1]),e(n(t(C,b),-o[1]),n(t(D,v),s[1]))),a[2]),n(e(n(t(N,T),a[1]),e(n(t(E,h),-o[1]),n(t(k,p),s[1]))),-i[2])),e(n(e(n(t(C,b),a[1]),e(n(t(E,h),-i[1]),n(t(y,f),s[1]))),o[2]),n(e(n(t(D,v),a[1]),e(n(t(k,p),-i[1]),n(t(y,f),o[1]))),-s[2]))),c[3]))))),G=e(e(e(n(e(e(n(e(n(t(W,z),s[1]),e(n(t(q,I),-l[1]),n(t(B,O),c[1]))),o[2]),n(e(n(t(W,z),o[1]),e(n(t(V,S),-l[1]),n(t(F,A),c[1]))),-s[2])),e(n(e(n(t(q,I),o[1]),e(n(t(V,S),-s[1]),n(t(N,T),c[1]))),l[2]),n(e(n(t(B,O),o[1]),e(n(t(F,A),-s[1]),n(t(N,T),l[1]))),-c[2]))),a[3]),e(n(e(e(n(e(n(t(W,z),s[1]),e(n(t(q,I),-l[1]),n(t(B,O),c[1]))),a[2]),n(e(n(t(W,z),a[1]),e(n(t(U,m),-l[1]),n(t(R,d),c[1]))),-s[2])),e(n(e(n(t(q,I),a[1]),e(n(t(U,m),-s[1]),n(t(E,h),c[1]))),l[2]),n(e(n(t(B,O),a[1]),e(n(t(R,d),-s[1]),n(t(E,h),l[1]))),-c[2]))),-o[3]),n(e(e(n(e(n(t(W,z),o[1]),e(n(t(V,S),-l[1]),n(t(F,A),c[1]))),a[2]),n(e(n(t(W,z),a[1]),e(n(t(U,m),-l[1]),n(t(R,d),c[1]))),-o[2])),e(n(e(n(t(V,S),a[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),l[2]),n(e(n(t(F,A),a[1]),e(n(t(R,d),-o[1]),n(t(k,p),l[1]))),-c[2]))),s[3]))),e(e(n(e(e(n(e(n(t(q,I),o[1]),e(n(t(V,S),-s[1]),n(t(N,T),c[1]))),a[2]),n(e(n(t(q,I),a[1]),e(n(t(U,m),-s[1]),n(t(E,h),c[1]))),-o[2])),e(n(e(n(t(V,S),a[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),s[2]),n(e(n(t(N,T),a[1]),e(n(t(E,h),-o[1]),n(t(k,p),s[1]))),-c[2]))),-l[3]),n(e(e(n(e(n(t(B,O),o[1]),e(n(t(F,A),-s[1]),n(t(N,T),l[1]))),a[2]),n(e(n(t(B,O),a[1]),e(n(t(R,d),-s[1]),n(t(E,h),l[1]))),-o[2])),e(n(e(n(t(F,A),a[1]),e(n(t(R,d),-o[1]),n(t(k,p),l[1]))),s[2]),n(e(n(t(N,T),a[1]),e(n(t(E,h),-o[1]),n(t(k,p),s[1]))),-l[2]))),c[3])),e(n(e(e(n(e(n(t(W,z),o[1]),e(n(t(V,S),-l[1]),n(t(F,A),c[1]))),i[2]),n(e(n(t(W,z),i[1]),e(n(t($,_),-l[1]),n(t(L,x),c[1]))),-o[2])),e(n(e(n(t(V,S),i[1]),e(n(t($,_),-o[1]),n(t(D,v),c[1]))),l[2]),n(e(n(t(F,A),i[1]),e(n(t(L,x),-o[1]),n(t(D,v),l[1]))),-c[2]))),a[3]),n(e(e(n(e(n(t(W,z),o[1]),e(n(t(V,S),-l[1]),n(t(F,A),c[1]))),a[2]),n(e(n(t(W,z),a[1]),e(n(t(U,m),-l[1]),n(t(R,d),c[1]))),-o[2])),e(n(e(n(t(V,S),a[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),l[2]),n(e(n(t(F,A),a[1]),e(n(t(R,d),-o[1]),n(t(k,p),l[1]))),-c[2]))),-i[3])))),e(e(e(n(e(e(n(e(n(t(W,z),i[1]),e(n(t($,_),-l[1]),n(t(L,x),c[1]))),a[2]),n(e(n(t(W,z),a[1]),e(n(t(U,m),-l[1]),n(t(R,d),c[1]))),-i[2])),e(n(e(n(t($,_),a[1]),e(n(t(U,m),-i[1]),n(t(y,f),c[1]))),l[2]),n(e(n(t(L,x),a[1]),e(n(t(R,d),-i[1]),n(t(y,f),l[1]))),-c[2]))),o[3]),n(e(e(n(e(n(t(V,S),i[1]),e(n(t($,_),-o[1]),n(t(D,v),c[1]))),a[2]),n(e(n(t(V,S),a[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),-i[2])),e(n(e(n(t($,_),a[1]),e(n(t(U,m),-i[1]),n(t(y,f),c[1]))),o[2]),n(e(n(t(D,v),a[1]),e(n(t(k,p),-i[1]),n(t(y,f),o[1]))),-c[2]))),-l[3])),e(n(e(e(n(e(n(t(F,A),i[1]),e(n(t(L,x),-o[1]),n(t(D,v),l[1]))),a[2]),n(e(n(t(F,A),a[1]),e(n(t(R,d),-o[1]),n(t(k,p),l[1]))),-i[2])),e(n(e(n(t(L,x),a[1]),e(n(t(R,d),-i[1]),n(t(y,f),l[1]))),o[2]),n(e(n(t(D,v),a[1]),e(n(t(k,p),-i[1]),n(t(y,f),o[1]))),-l[2]))),c[3]),n(e(e(n(e(n(t(B,O),o[1]),e(n(t(F,A),-s[1]),n(t(N,T),l[1]))),i[2]),n(e(n(t(B,O),i[1]),e(n(t(L,x),-s[1]),n(t(C,b),l[1]))),-o[2])),e(n(e(n(t(F,A),i[1]),e(n(t(L,x),-o[1]),n(t(D,v),l[1]))),s[2]),n(e(n(t(N,T),i[1]),e(n(t(C,b),-o[1]),n(t(D,v),s[1]))),-l[2]))),a[3]))),e(e(n(e(e(n(e(n(t(B,O),o[1]),e(n(t(F,A),-s[1]),n(t(N,T),l[1]))),a[2]),n(e(n(t(B,O),a[1]),e(n(t(R,d),-s[1]),n(t(E,h),l[1]))),-o[2])),e(n(e(n(t(F,A),a[1]),e(n(t(R,d),-o[1]),n(t(k,p),l[1]))),s[2]),n(e(n(t(N,T),a[1]),e(n(t(E,h),-o[1]),n(t(k,p),s[1]))),-l[2]))),-i[3]),n(e(e(n(e(n(t(B,O),i[1]),e(n(t(L,x),-s[1]),n(t(C,b),l[1]))),a[2]),n(e(n(t(B,O),a[1]),e(n(t(R,d),-s[1]),n(t(E,h),l[1]))),-i[2])),e(n(e(n(t(L,x),a[1]),e(n(t(R,d),-i[1]),n(t(y,f),l[1]))),s[2]),n(e(n(t(C,b),a[1]),e(n(t(E,h),-i[1]),n(t(y,f),s[1]))),-l[2]))),o[3])),e(n(e(e(n(e(n(t(F,A),i[1]),e(n(t(L,x),-o[1]),n(t(D,v),l[1]))),a[2]),n(e(n(t(F,A),a[1]),e(n(t(R,d),-o[1]),n(t(k,p),l[1]))),-i[2])),e(n(e(n(t(L,x),a[1]),e(n(t(R,d),-i[1]),n(t(y,f),l[1]))),o[2]),n(e(n(t(D,v),a[1]),e(n(t(k,p),-i[1]),n(t(y,f),o[1]))),-l[2]))),-s[3]),n(e(e(n(e(n(t(N,T),i[1]),e(n(t(C,b),-o[1]),n(t(D,v),s[1]))),a[2]),n(e(n(t(N,T),a[1]),e(n(t(E,h),-o[1]),n(t(k,p),s[1]))),-i[2])),e(n(e(n(t(C,b),a[1]),e(n(t(E,h),-i[1]),n(t(y,f),s[1]))),o[2]),n(e(n(t(D,v),a[1]),e(n(t(k,p),-i[1]),n(t(y,f),o[1]))),-s[2]))),l[3]))))),X=t(H,G);return X[X.length-1]}}var p=[function(){return 0},function(){return 0},function(){return 0}];function h(e){var t=p[e.length];return t||(t=p[e.length]=s(e.length)),t.apply(void 0,e)}function d(e,t,r,n,a,i,o,s){return function(t,r,l,c,u,f){switch(arguments.length){case 0:case 1:return 0;case 2:return n(t,r);case 3:return a(t,r,l);case 4:return i(t,r,l,c);case 5:return o(t,r,l,c,u);case 6:return s(t,r,l,c,u,f)}for(var p=new Array(arguments.length),h=0;h<arguments.length;++h)p[h]=arguments[h];return e(p)}}!function(){for(;p.length<=6;)p.push(s(p.length));t.exports=d.apply(void 0,[h].concat(p));for(var e=0;e<=6;++e)t.exports[e]=p[e]}()},{"robust-scale":286,"robust-subtract":288,"robust-sum":289,"two-product":306}],283:[function(e,t,r){"use strict";var n=e("robust-determinant");function a(e){return(2===e?i:o)(e<3?n[e]:n)}function i(e){return function(t,r){return[e([[+r[0],+t[0][1]],[+r[1],+t[1][1]]]),e([[+t[0][0],+r[0]],[+t[1][0],+r[1]]]),e(t)]}}function o(e){return function(t,r){return[e([[+r[0],+t[0][1],+t[0][2]],[+r[1],+t[1][1],+t[1][2]],[+r[2],+t[2][1],+t[2][2]]]),e([[+t[0][0],+r[0],+t[0][2]],[+t[1][0],+r[1],+t[1][2]],[+t[2][0],+r[2],+t[2][2]]]),e([[+t[0][0],+t[0][1],+r[0]],[+t[1][0],+t[1][1],+r[1]],[+t[2][0],+t[2][1],+r[2]]]),e(t)]}}var s=[function(){return[[0]]},function(e,t){return[[t[0]],[e[0][0]]]}];function l(e,t,r,n,a,i){return function(o,s){switch(o.length){case 0:return e(o,s);case 1:return t(o,s);case 2:return r(o,s);case 3:return n(o,s)}var l=a[o.length];return l||(l=a[o.length]=i(o.length)),l(o,s)}}!function(){for(;s.length<=3;)s.push(a(s.length));t.exports=l.apply(void 0,s.concat([s,a]));for(var e=0;e<3;++e)t.exports[e]=s[e]}()},{"robust-determinant":280}],284:[function(e,t,r){"use strict";var n=e("two-product"),a=e("robust-sum"),i=e("robust-scale"),o=e("robust-subtract");function s(e,t,r,n){return function(r,a,i){var o=e(e(t(a[1],i[0]),t(-i[1],a[0])),e(t(r[1],a[0]),t(-a[1],r[0]))),s=e(t(r[1],i[0]),t(-i[1],r[0])),l=n(o,s);return l[l.length-1]}}function l(e,t,r,n){return function(a,i,o,s){var l=e(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-i[2]),r(e(t(a[1],i[0]),t(-i[1],a[0])),s[2])))),c=e(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),e(r(e(t(i[1],o[0]),t(-o[1],i[0])),a[2]),e(r(e(t(a[1],o[0]),t(-o[1],a[0])),-i[2]),r(e(t(a[1],i[0]),t(-i[1],a[0])),o[2])))),u=n(l,c);return u[u.length-1]}}function c(e,t,r,n){return function(a,i,o,s,l){var c=e(e(e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),o[2]),e(r(e(t(o[1],l[0]),t(-l[1],o[0])),-s[2]),r(e(t(o[1],s[0]),t(-s[1],o[0])),l[2]))),i[3]),e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-s[2]),r(e(t(i[1],s[0]),t(-s[1],i[0])),l[2]))),-o[3]),r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),l[2]))),s[3]))),e(r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),-l[3]),e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-s[2]),r(e(t(i[1],s[0]),t(-s[1],i[0])),l[2]))),a[3]),r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),r(e(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),-i[3])))),e(e(r(e(r(e(t(i[1],l[0]),t(-l[1],i[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-i[2]),r(e(t(a[1],i[0]),t(-i[1],a[0])),l[2]))),s[3]),e(r(e(r(e(t(i[1],s[0]),t(-s[1],i[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-i[2]),r(e(t(a[1],i[0]),t(-i[1],a[0])),s[2]))),-l[3]),r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),a[3]))),e(r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),-i[3]),e(r(e(r(e(t(i[1],s[0]),t(-s[1],i[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-i[2]),r(e(t(a[1],i[0]),t(-i[1],a[0])),s[2]))),o[3]),r(e(r(e(t(i[1],o[0]),t(-o[1],i[0])),a[2]),e(r(e(t(a[1],o[0]),t(-o[1],a[0])),-i[2]),r(e(t(a[1],i[0]),t(-i[1],a[0])),o[2]))),-s[3]))))),u=e(e(e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),o[2]),e(r(e(t(o[1],l[0]),t(-l[1],o[0])),-s[2]),r(e(t(o[1],s[0]),t(-s[1],o[0])),l[2]))),a[3]),r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),r(e(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),-o[3])),e(r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),s[3]),r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),-l[3]))),e(e(r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),l[2]))),a[3]),r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),-i[3])),e(r(e(r(e(t(i[1],l[0]),t(-l[1],i[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-i[2]),r(e(t(a[1],i[0]),t(-i[1],a[0])),l[2]))),o[3]),r(e(r(e(t(i[1],o[0]),t(-o[1],i[0])),a[2]),e(r(e(t(a[1],o[0]),t(-o[1],a[0])),-i[2]),r(e(t(a[1],i[0]),t(-i[1],a[0])),o[2]))),-l[3])))),f=n(c,u);return f[f.length-1]}}function u(e){return(3===e?s:4===e?l:c)(a,n,i,o)}var f=u(3),p=u(4),h=[function(){return 0},function(){return 0},function(e,t){return t[0]-e[0]},function(e,t,r){var n,a=(e[1]-r[1])*(t[0]-r[0]),i=(e[0]-r[0])*(t[1]-r[1]),o=a-i;if(a>0){if(i<=0)return o;n=a+i}else{if(!(a<0))return o;if(i>=0)return o;n=-(a+i)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(e,t,r)},function(e,t,r,n){var a=e[0]-n[0],i=t[0]-n[0],o=r[0]-n[0],s=e[1]-n[1],l=t[1]-n[1],c=r[1]-n[1],u=e[2]-n[2],f=t[2]-n[2],h=r[2]-n[2],d=i*c,m=o*l,g=o*s,y=a*c,v=a*l,b=i*s,x=u*(d-m)+f*(g-y)+h*(v-b),_=7771561172376103e-31*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(y))*Math.abs(f)+(Math.abs(v)+Math.abs(b))*Math.abs(h));return x>_||-x>_?x:p(e,t,r,n)}];function d(e){var t=h[e.length];return t||(t=h[e.length]=u(e.length)),t.apply(void 0,e)}function m(e,t,r,n,a,i,o){return function(t,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(t,r);case 3:return a(t,r,s);case 4:return i(t,r,s,l);case 5:return o(t,r,s,l,c)}for(var u=new Array(arguments.length),f=0;f<arguments.length;++f)u[f]=arguments[f];return e(u)}}!function(){for(;h.length<=5;)h.push(u(h.length));t.exports=m.apply(void 0,[d].concat(h));for(var e=0;e<=5;++e)t.exports[e]=h[e]}()},{"robust-scale":286,"robust-subtract":288,"robust-sum":289,"two-product":306}],285:[function(e,t,r){"use strict";var n=e("robust-sum"),a=e("robust-scale");t.exports=function(e,t){if(1===e.length)return a(t,e[0]);if(1===t.length)return a(e,t[0]);if(0===e.length||0===t.length)return[0];var r=[0];if(e.length<t.length)for(var i=0;i<e.length;++i)r=n(r,a(t,e[i]));else for(i=0;i<t.length;++i)r=n(r,a(e,t[i]));return r}},{"robust-scale":286,"robust-sum":289}],286:[function(e,t,r){"use strict";var n=e("two-product"),a=e("two-sum");t.exports=function(e,t){var r=e.length;if(1===r){var i=n(e[0],t);return i[0]?i:[i[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],c=0;n(e[0],t,s),s[0]&&(o[c++]=s[0]);for(var u=1;u<r;++u){n(e[u],t,l);var f=s[1];a(f,l[0],s),s[0]&&(o[c++]=s[0]);var p=l[1],h=s[1],d=p+h,m=h-(d-p);s[1]=d,m&&(o[c++]=m)}return s[1]&&(o[c++]=s[1]),0===c&&(o[c++]=0),o.length=c,o}},{"two-product":306,"two-sum":307}],287:[function(e,t,r){"use strict";t.exports=function(e,t,r,a){var i=n(e,r,a),o=n(t,r,a);if(i>0&&o>0||i<0&&o<0)return!1;var s=n(r,e,t),l=n(a,e,t);return!(s>0&&l>0||s<0&&l<0)&&(0!==i||0!==o||0!==s||0!==l||function(e,t,r,n){for(var a=0;a<2;++a){var i=e[a],o=t[a],s=Math.min(i,o),l=Math.max(i,o),c=r[a],u=n[a],f=Math.min(c,u);if(Math.max(c,u)<s||l<f)return!1}return!0}(e,t,r,a))};var n=e("robust-orientation")[3]},{"robust-orientation":284}],288:[function(e,t,r){"use strict";t.exports=function(e,t){var r=0|e.length,n=0|t.length;if(1===r&&1===n)return function(e,t){var r=e+t,n=r-e,a=e-(r-n)+(t-n);return a?[a,r]:[r]}(e[0],-t[0]);var a,i,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,f=e[l],p=u(f),h=-t[c],d=u(h);p<d?(i=f,(l+=1)<r&&(p=u(f=e[l]))):(i=h,(c+=1)<n&&(d=u(h=-t[c]))),l<r&&p<d||c>=n?(a=f,(l+=1)<r&&(p=u(f=e[l]))):(a=h,(c+=1)<n&&(d=u(h=-t[c])));for(var m,g,y=a+i,v=y-a,b=i-v,x=b,_=y;l<r&&c<n;)p<d?(a=f,(l+=1)<r&&(p=u(f=e[l]))):(a=h,(c+=1)<n&&(d=u(h=-t[c]))),(b=(i=x)-(v=(y=a+i)-a))&&(o[s++]=b),x=_-((m=_+y)-(g=m-_))+(y-g),_=m;for(;l<r;)(b=(i=x)-(v=(y=(a=f)+i)-a))&&(o[s++]=b),x=_-((m=_+y)-(g=m-_))+(y-g),_=m,(l+=1)<r&&(f=e[l]);for(;c<n;)(b=(i=x)-(v=(y=(a=h)+i)-a))&&(o[s++]=b),x=_-((m=_+y)-(g=m-_))+(y-g),_=m,(c+=1)<n&&(h=-t[c]);return x&&(o[s++]=x),_&&(o[s++]=_),s||(o[s++]=0),o.length=s,o}},{}],289:[function(e,t,r){"use strict";t.exports=function(e,t){var r=0|e.length,n=0|t.length;if(1===r&&1===n)return function(e,t){var r=e+t,n=r-e,a=e-(r-n)+(t-n);return a?[a,r]:[r]}(e[0],t[0]);var a,i,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,f=e[l],p=u(f),h=t[c],d=u(h);p<d?(i=f,(l+=1)<r&&(p=u(f=e[l]))):(i=h,(c+=1)<n&&(d=u(h=t[c]))),l<r&&p<d||c>=n?(a=f,(l+=1)<r&&(p=u(f=e[l]))):(a=h,(c+=1)<n&&(d=u(h=t[c])));for(var m,g,y=a+i,v=y-a,b=i-v,x=b,_=y;l<r&&c<n;)p<d?(a=f,(l+=1)<r&&(p=u(f=e[l]))):(a=h,(c+=1)<n&&(d=u(h=t[c]))),(b=(i=x)-(v=(y=a+i)-a))&&(o[s++]=b),x=_-((m=_+y)-(g=m-_))+(y-g),_=m;for(;l<r;)(b=(i=x)-(v=(y=(a=f)+i)-a))&&(o[s++]=b),x=_-((m=_+y)-(g=m-_))+(y-g),_=m,(l+=1)<r&&(f=e[l]);for(;c<n;)(b=(i=x)-(v=(y=(a=h)+i)-a))&&(o[s++]=b),x=_-((m=_+y)-(g=m-_))+(y-g),_=m,(c+=1)<n&&(h=t[c]);return x&&(o[s++]=x),_&&(o[s++]=_),s||(o[s++]=0),o.length=s,o}},{}],290:[function(e,t,r){"use strict";t.exports=function(e){return a(n(e))};var n=e("boundary-cells"),a=e("reduce-simplicial-complex")},{"boundary-cells":34,"reduce-simplicial-complex":276}],291:[function(e,t,r){"use strict";t.exports=function(e,t,r,s){if(r=r||0,void 0===s&&(s=function(e){for(var t=e.length,r=0,n=0;n<t;++n)r=0|Math.max(r,e[n].length);return r-1}(e)),0===e.length||s<1)return{cells:[],vertexIds:[],vertexWeights:[]};var l=function(e,t){for(var r=e.length,n=a.mallocUint8(r),i=0;i<r;++i)n[i]=e[i]<t|0;return n}(t,+r),c=function(e,t){for(var r=e.length,o=t*(t+1)/2*r|0,s=a.mallocUint32(2*o),l=0,c=0;c<r;++c)for(var u=e[c],f=(t=u.length,0);f<t;++f)for(var p=0;p<f;++p){var h=u[p],d=u[f];s[l++]=0|Math.min(h,d),s[l++]=0|Math.max(h,d)}i(n(s,[l/2|0,2]));var m=2;for(c=2;c<l;c+=2)s[c-2]===s[c]&&s[c-1]===s[c+1]||(s[m++]=s[c],s[m++]=s[c+1]);return n(s,[m/2|0,2])}(e,s),u=function(e,t,r,i){for(var o=e.data,s=e.shape[0],l=a.mallocDouble(s),c=0,u=0;u<s;++u){var f=o[2*u],p=o[2*u+1];if(r[f]!==r[p]){var h=t[f],d=t[p];o[2*c]=f,o[2*c+1]=p,l[c++]=(d-i)/(d-h)}}return e.shape[0]=c,n(l,[c])}(c,t,l,+r),f=function(e,t){var r=a.mallocInt32(2*t),n=e.shape[0],i=e.data;r[0]=0;for(var o=0,s=0;s<n;++s){var l=i[2*s];if(l!==o){for(r[2*o+1]=s;++o<l;)r[2*o]=s,r[2*o+1]=s;r[2*o]=s}}for(r[2*o+1]=n;++o<t;)r[2*o]=r[2*o+1]=n;return r}(c,0|t.length),p=o(s)(e,c.data,f,l),h=function(e){for(var t=0|e.shape[0],r=e.data,n=new Array(t),a=0;a<t;++a)n[a]=[r[2*a],r[2*a+1]];return n}(c),d=[].slice.call(u.data,0,u.shape[0]);return a.free(l),a.free(c.data),a.free(u.data),a.free(f),{cells:p,vertexIds:h,vertexWeights:d}};var n=e("ndarray"),a=e("typedarray-pool"),i=e("ndarray-sort"),o=e("./lib/codegen")},{"./lib/codegen":292,ndarray:259,"ndarray-sort":258,"typedarray-pool":308}],292:[function(e,t,r){"use strict";t.exports=function(e){return n[e]()};var n=[function(){return function(e,t,r,n){for(var a=e.length,i=0;i<a;++i)e[i].length;return[]}},function(){function e(e,t,r,n){for(var a=0|Math.min(r,n),i=0|Math.max(r,n),o=e[2*a],s=e[2*a+1];o<s;){var l=o+s>>1,c=t[2*l+1];if(c===i)return l;i<c?s=l:o=l+1}return o}return function(t,r,n,a){for(var i=t.length,o=[],s=0;s<i;++s){var l=t[s];if(2===l.length){var c=(a[l[0]]<<0)+(a[l[1]]<<1);if(0===c||3===c)continue;switch(c){case 0:break;case 1:o.push([e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0])])}}}return o}},function(){function e(e,t,r,n){for(var a=0|Math.min(r,n),i=0|Math.max(r,n),o=e[2*a],s=e[2*a+1];o<s;){var l=o+s>>1,c=t[2*l+1];if(c===i)return l;i<c?s=l:o=l+1}return o}return function(t,r,n,a){for(var i=t.length,o=[],s=0;s<i;++s){var l=t[s],c=l.length;if(3===c){if(0==(u=(a[l[0]]<<0)+(a[l[1]]<<1)+(a[l[2]]<<2))||7===u)continue;switch(u){case 0:break;case 1:o.push([e(n,r,l[0],l[2]),e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0]),e(n,r,l[1],l[2])]);break;case 3:o.push([e(n,r,l[0],l[2]),e(n,r,l[1],l[2])]);break;case 4:o.push([e(n,r,l[2],l[1]),e(n,r,l[2],l[0])]);break;case 5:o.push([e(n,r,l[2],l[1]),e(n,r,l[0],l[1])]);break;case 6:o.push([e(n,r,l[1],l[0]),e(n,r,l[2],l[0])])}}else if(2===c){var u;if(0==(u=(a[l[0]]<<0)+(a[l[1]]<<1))||3===u)continue;switch(u){case 0:break;case 1:o.push([e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0])])}}}return o}},function(){function e(e,t,r,n){for(var a=0|Math.min(r,n),i=0|Math.max(r,n),o=e[2*a],s=e[2*a+1];o<s;){var l=o+s>>1,c=t[2*l+1];if(c===i)return l;i<c?s=l:o=l+1}return o}return function(t,r,n,a){for(var i=t.length,o=[],s=0;s<i;++s){var l=t[s],c=l.length;if(4===c){if(0==(u=(a[l[0]]<<0)+(a[l[1]]<<1)+(a[l[2]]<<2)+(a[l[3]]<<3))||15===u)continue;switch(u){case 0:break;case 1:o.push([e(n,r,l[0],l[1]),e(n,r,l[0],l[2]),e(n,r,l[0],l[3])]);break;case 2:o.push([e(n,r,l[1],l[2]),e(n,r,l[1],l[0]),e(n,r,l[1],l[3])]);break;case 3:o.push([e(n,r,l[1],l[2]),e(n,r,l[0],l[2]),e(n,r,l[0],l[3])],[e(n,r,l[1],l[3]),e(n,r,l[1],l[2]),e(n,r,l[0],l[3])]);break;case 4:o.push([e(n,r,l[2],l[0]),e(n,r,l[2],l[1]),e(n,r,l[2],l[3])]);break;case 5:o.push([e(n,r,l[0],l[1]),e(n,r,l[2],l[1]),e(n,r,l[0],l[3])],[e(n,r,l[2],l[1]),e(n,r,l[2],l[3]),e(n,r,l[0],l[3])]);break;case 6:o.push([e(n,r,l[2],l[0]),e(n,r,l[1],l[0]),e(n,r,l[1],l[3])],[e(n,r,l[2],l[3]),e(n,r,l[2],l[0]),e(n,r,l[1],l[3])]);break;case 7:o.push([e(n,r,l[0],l[3]),e(n,r,l[1],l[3]),e(n,r,l[2],l[3])]);break;case 8:o.push([e(n,r,l[3],l[1]),e(n,r,l[3],l[0]),e(n,r,l[3],l[2])]);break;case 9:o.push([e(n,r,l[3],l[1]),e(n,r,l[0],l[1]),e(n,r,l[0],l[2])],[e(n,r,l[3],l[2]),e(n,r,l[3],l[1]),e(n,r,l[0],l[2])]);break;case 10:o.push([e(n,r,l[1],l[0]),e(n,r,l[3],l[0]),e(n,r,l[1],l[2])],[e(n,r,l[3],l[0]),e(n,r,l[3],l[2]),e(n,r,l[1],l[2])]);break;case 11:o.push([e(n,r,l[1],l[2]),e(n,r,l[0],l[2]),e(n,r,l[3],l[2])]);break;case 12:o.push([e(n,r,l[3],l[0]),e(n,r,l[2],l[0]),e(n,r,l[2],l[1])],[e(n,r,l[3],l[1]),e(n,r,l[3],l[0]),e(n,r,l[2],l[1])]);break;case 13:o.push([e(n,r,l[0],l[1]),e(n,r,l[2],l[1]),e(n,r,l[3],l[1])]);break;case 14:o.push([e(n,r,l[2],l[0]),e(n,r,l[1],l[0]),e(n,r,l[3],l[0])])}}else if(3===c){if(0==(u=(a[l[0]]<<0)+(a[l[1]]<<1)+(a[l[2]]<<2))||7===u)continue;switch(u){case 0:break;case 1:o.push([e(n,r,l[0],l[2]),e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0]),e(n,r,l[1],l[2])]);break;case 3:o.push([e(n,r,l[0],l[2]),e(n,r,l[1],l[2])]);break;case 4:o.push([e(n,r,l[2],l[1]),e(n,r,l[2],l[0])]);break;case 5:o.push([e(n,r,l[2],l[1]),e(n,r,l[0],l[1])]);break;case 6:o.push([e(n,r,l[1],l[0]),e(n,r,l[2],l[0])])}}else if(2===c){var u;if(0==(u=(a[l[0]]<<0)+(a[l[1]]<<1))||3===u)continue;switch(u){case 0:break;case 1:o.push([e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0])])}}}return o}}]},{}],293:[function(e,t,r){"use strict";var n=e("bit-twiddle"),a=e("union-find");function i(e,t){var r=e.length,n=e.length-t.length,a=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:return(s=e[0]+e[1]-t[0]-t[1])||a(e[0],e[1])-a(t[0],t[1]);case 3:var i=e[0]+e[1],o=t[0]+t[1];if(s=i+e[2]-(o+t[2]))return s;var s,l=a(e[0],e[1]),c=a(t[0],t[1]);return(s=a(l,e[2])-a(c,t[2]))||a(l+e[2],i)-a(c+t[2],o);default:var u=e.slice(0);u.sort();var f=t.slice(0);f.sort();for(var p=0;p<r;++p)if(n=u[p]-f[p])return n;return 0}}function o(e,t){return i(e[0],t[0])}function s(e,t){if(t){for(var r=e.length,n=new Array(r),a=0;a<r;++a)n[a]=[e[a],t[a]];for(n.sort(o),a=0;a<r;++a)e[a]=n[a][0],t[a]=n[a][1];return e}return e.sort(i),e}function l(e){if(0===e.length)return[];for(var t=1,r=e.length,n=1;n<r;++n){var a=e[n];if(i(a,e[n-1])){if(n===t){t++;continue}e[t++]=a}}return e.length=t,e}function c(e,t){for(var r=0,n=e.length-1,a=-1;r<=n;){var o=r+n>>1,s=i(e[o],t);s<=0?(0===s&&(a=o),r=o+1):s>0&&(n=o-1)}return a}function u(e,t){for(var r=new Array(e.length),a=0,o=r.length;a<o;++a)r[a]=[];for(var s=[],l=(a=0,t.length);a<l;++a)for(var u=t[a],f=u.length,p=1,h=1<<f;p<h;++p){s.length=n.popCount(p);for(var d=0,m=0;m<f;++m)p&1<<m&&(s[d++]=u[m]);var g=c(e,s);if(!(g<0))for(;r[g++].push(a),!(g>=e.length||0!==i(e[g],s)););}return r}function f(e,t){if(t<0)return[];for(var r=[],a=(1<<t+1)-1,i=0;i<e.length;++i)for(var o=e[i],l=a;l<1<<o.length;l=n.nextCombination(l)){for(var c=new Array(t+1),u=0,f=0;f<o.length;++f)l&1<<f&&(c[u++]=o[f]);r.push(c)}return s(r)}r.dimension=function(e){for(var t=0,r=Math.max,n=0,a=e.length;n<a;++n)t=r(t,e[n].length);return t-1},r.countVertices=function(e){for(var t=-1,r=Math.max,n=0,a=e.length;n<a;++n)for(var i=e[n],o=0,s=i.length;o<s;++o)t=r(t,i[o]);return t+1},r.cloneCells=function(e){for(var t=new Array(e.length),r=0,n=e.length;r<n;++r)t[r]=e[r].slice(0);return t},r.compareCells=i,r.normalize=s,r.unique=l,r.findCell=c,r.incidence=u,r.dual=function(e,t){if(!t)return u(l(f(e,0)),e);for(var r=new Array(t),n=0;n<t;++n)r[n]=[];n=0;for(var a=e.length;n<a;++n)for(var i=e[n],o=0,s=i.length;o<s;++o)r[i[o]].push(n);return r},r.explode=function(e){for(var t=[],r=0,n=e.length;r<n;++r)for(var a=e[r],i=0|a.length,o=1,l=1<<i;o<l;++o){for(var c=[],u=0;u<i;++u)o>>>u&1&&c.push(a[u]);t.push(c)}return s(t)},r.skeleton=f,r.boundary=function(e){for(var t=[],r=0,n=e.length;r<n;++r)for(var a=e[r],i=0,o=a.length;i<o;++i){for(var l=new Array(a.length-1),c=0,u=0;c<o;++c)c!==i&&(l[u++]=a[c]);t.push(l)}return s(t)},r.connectedComponents=function(e,t){return t?function(e,t){for(var r=new a(t),n=0;n<e.length;++n)for(var i=e[n],o=0;o<i.length;++o)for(var s=o+1;s<i.length;++s)r.link(i[o],i[s]);var l=[],c=r.ranks;for(n=0;n<c.length;++n)c[n]=-1;for(n=0;n<e.length;++n){var u=r.find(e[n][0]);c[u]<0?(c[u]=l.length,l.push([e[n].slice(0)])):l[c[u]].push(e[n].slice(0))}return l}(e,t):function(e){for(var t=l(s(f(e,0))),r=new a(t.length),n=0;n<e.length;++n)for(var i=e[n],o=0;o<i.length;++o)for(var u=c(t,[i[o]]),p=o+1;p<i.length;++p)r.link(u,c(t,[i[p]]));var h=[],d=r.ranks;for(n=0;n<d.length;++n)d[n]=-1;for(n=0;n<e.length;++n){var m=r.find(c(t,[e[n][0]]));d[m]<0?(d[m]=h.length,h.push([e[n].slice(0)])):h[d[m]].push(e[n].slice(0))}return h}(e)}},{"bit-twiddle":32,"union-find":309}],294:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],295:[function(e,t,r){arguments[4][293][0].apply(r,arguments)},{"bit-twiddle":294,dup:293,"union-find":296}],296:[function(e,t,r){"use strict";function n(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t<e;++t)this.roots[t]=t,this.ranks[t]=0}t.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var e=this.roots.length;return this.roots.push(e),this.ranks.push(0),e},n.prototype.find=function(e){for(var t=this.roots;t[e]!==e;){var r=t[e];t[e]=t[r],e=r}return e},n.prototype.link=function(e,t){var r=this.find(e),n=this.find(t);if(r!==n){var a=this.ranks,i=this.roots,o=a[r],s=a[n];o<s?i[r]=n:s<o?i[n]=r:(i[n]=r,++a[r])}}},{}],297:[function(e,t,r){"use strict";t.exports=function(e,t,r){for(var i=t.length,o=e.length,s=new Array(i),l=new Array(i),c=new Array(i),u=new Array(i),f=0;f<i;++f)s[f]=l[f]=-1,c[f]=1/0,u[f]=!1;for(f=0;f<o;++f){var p=e[f];if(2!==p.length)throw new Error("Input must be a graph");var h=p[1],d=p[0];-1!==l[d]?l[d]=-2:l[d]=h,-1!==s[h]?s[h]=-2:s[h]=d}function m(e){if(u[e])return 1/0;var r,a,i,o=s[e],c=l[e];return o<0||c<0?1/0:(r=t[e],a=t[o],i=t[c],Math.abs(n(r,a,i))/Math.sqrt(Math.pow(a[0]-i[0],2)+Math.pow(a[1]-i[1],2)))}function g(e,t){var r=D[e],n=D[t];D[e]=n,D[t]=r,T[r]=t,T[n]=e}function y(e){return c[D[e]]}function v(e){return 1&e?e-1>>1:(e>>1)-1}function b(e){for(var t=y(e);;){var r=t,n=2*e+1,a=2*(e+1),i=e;if(n<A){var o=y(n);o<r&&(i=n,r=o)}if(a<A&&y(a)<r&&(i=a),i===e)return e;g(e,i),e=i}}function x(e){for(var t=y(e);e>0;){var r=v(e);if(!(r>=0&&t<y(r)))return e;g(e,r),e=r}}function _(){if(A>0){var e=D[0];return g(0,A-1),A-=1,b(0),e}return-1}function w(e,t){var r=D[e];return c[r]===t?e:(c[r]=-1/0,x(e),_(),c[r]=t,x((A+=1)-1))}function k(e){if(!u[e]){u[e]=!0;var t=s[e],r=l[e];s[r]>=0&&(s[r]=t),l[t]>=0&&(l[t]=r),T[t]>=0&&w(T[t],m(t)),T[r]>=0&&w(T[r],m(r))}}var D=[],T=new Array(i);for(f=0;f<i;++f)(c[f]=m(f))<1/0?(T[f]=D.length,D.push(f)):T[f]=-1;var A=D.length;for(f=A>>1;f>=0;--f)b(f);for(;;){var S=_();if(S<0||c[S]>r)break;k(S)}var M=[];for(f=0;f<i;++f)u[f]||(T[f]=M.length,M.push(t[f].slice()));function E(e,t){if(e[t]<0)return t;var r=t,n=t;do{var a=e[n];if(!u[n]||a<0||a===n)break;if(a=e[n=a],!u[n]||a<0||a===n)break;n=a,r=e[r]}while(r!==n);for(var i=t;i!==n;i=e[i])e[i]=n;return n}M.length;var C=[];return e.forEach((function(e){var t=E(s,e[0]),r=E(l,e[1]);if(t>=0&&r>=0&&t!==r){var n=T[t],a=T[r];n!==a&&C.push([n,a])}})),a.unique(a.normalize(C)),{positions:M,edges:C}};var n=e("robust-orientation"),a=e("simplicial-complex")},{"robust-orientation":284,"simplicial-complex":295}],298:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,o,s;if(t[0][0]<t[1][0])r=t[0],i=t[1];else{if(!(t[0][0]>t[1][0]))return a(t,e);r=t[1],i=t[0]}if(e[0][0]<e[1][0])o=e[0],s=e[1];else{if(!(e[0][0]>e[1][0]))return-a(e,t);o=e[1],s=e[0]}var l=n(r,i,s),c=n(r,i,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,i),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return i[0]-s[0]};var n=e("robust-orientation");function a(e,t){var r,a,i,o;if(t[0][0]<t[1][0])r=t[0],a=t[1];else{if(!(t[0][0]>t[1][0])){var s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]),c=Math.min(t[0][1],t[1][1]),u=Math.max(t[0][1],t[1][1]);return l<c?l-c:s>u?s-u:l-u}r=t[1],a=t[0]}e[0][1]<e[1][1]?(i=e[0],o=e[1]):(i=e[1],o=e[0]);var f=n(a,r,i);return f||(f=n(a,r,o))||o-a}},{"robust-orientation":284}],299:[function(e,t,r){"use strict";t.exports=function(e){for(var t=e.length,r=2*t,n=new Array(r),i=0;i<t;++i){var l=e[i],c=l[0][0]<l[1][0];n[2*i]=new f(l[0][0],l,c,i),n[2*i+1]=new f(l[1][0],l,!c,i)}n.sort((function(e,t){var r=e.x-t.x;return r||(r=e.create-t.create)||Math.min(e.segment[0][1],e.segment[1][1])-Math.min(t.segment[0][1],t.segment[1][1])}));var p=a(o),h=[],d=[],m=[];for(i=0;i<r;){for(var g=n[i].x,y=[];i<r;){var v=n[i];if(v.x!==g)break;i+=1,v.segment[0][0]===v.x&&v.segment[1][0]===v.x?v.create&&(v.segment[0][1]<v.segment[1][1]?(y.push(new u(v.segment[0][1],v.index,!0,!0)),y.push(new u(v.segment[1][1],v.index,!1,!1))):(y.push(new u(v.segment[1][1],v.index,!0,!1)),y.push(new u(v.segment[0][1],v.index,!1,!0)))):p=v.create?p.insert(v.segment,v.index):p.remove(v.segment)}h.push(p.root),d.push(g),m.push(y)}return new s(h,d,m)};var n=e("binary-search-bounds"),a=e("functional-red-black-tree"),i=e("robust-orientation"),o=e("./lib/order-segments");function s(e,t,r){this.slabs=e,this.coordinates=t,this.horizontal=r}function l(e,t){return e.y-t}function c(e,t){for(var r=null;e;){var n,a,o=e.key;o[0][0]<o[1][0]?(n=o[0],a=o[1]):(n=o[1],a=o[0]);var s=i(n,a,t);if(s<0)e=e.left;else if(s>0)if(t[0]!==o[1][0])r=e,e=e.right;else{if(l=c(e.right,t))return l;e=e.left}else{if(t[0]!==o[1][0])return e;var l;if(l=c(e.right,t))return l;e=e.left}}return r}function u(e,t,r,n){this.y=e,this.index=t,this.start=r,this.closed=n}function f(e,t,r,n){this.x=e,this.segment=t,this.create=r,this.index=n}s.prototype.castUp=function(e){var t=n.le(this.coordinates,e[0]);if(t<0)return-1;this.slabs[t];var r=c(this.slabs[t],e),a=-1;if(r&&(a=r.value),this.coordinates[t]===e[0]){var s=null;if(r&&(s=r.key),t>0){var u=c(this.slabs[t-1],e);u&&(s?o(u.key,s)>0&&(s=u.key,a=u.value):(a=u.value,s=u.key))}var f=this.horizontal[t];if(f.length>0){var p=n.ge(f,e[1],l);if(p<f.length){var h=f[p];if(e[1]===h.y){if(h.closed)return h.index;for(;p<f.length-1&&f[p+1].y===e[1];)if((h=f[p+=1]).closed)return h.index;if(h.y===e[1]&&!h.start){if((p+=1)>=f.length)return a;h=f[p]}}if(h.start)if(s){var d=i(s[0],s[1],[e[0],h.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(a=h.index)}else a=h.index;else h.y!==e[1]&&(a=h.index)}}}return a}},{"./lib/order-segments":298,"binary-search-bounds":31,"functional-red-black-tree":69,"robust-orientation":284}],300:[function(e,t,r){"use strict";var n=e("robust-dot-product"),a=e("robust-sum");function i(e,t){var r=a(n(e,t),[t[t.length-1]]);return r[r.length-1]}function o(e,t,r,n){var a=-t/(n-t);a<0?a=0:a>1&&(a=1);for(var i=1-a,o=e.length,s=new Array(o),l=0;l<o;++l)s[l]=a*e[l]+i*r[l];return s}t.exports=function(e,t){for(var r=[],n=[],a=i(e[e.length-1],t),s=e[e.length-1],l=e[0],c=0;c<e.length;++c,s=l){var u=i(l=e[c],t);if(a<0&&u>0||a>0&&u<0){var f=o(s,u,l,a);r.push(f),n.push(f.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),a=u}return{positive:r,negative:n}},t.exports.positive=function(e,t){for(var r=[],n=i(e[e.length-1],t),a=e[e.length-1],s=e[0],l=0;l<e.length;++l,a=s){var c=i(s=e[l],t);(n<0&&c>0||n>0&&c<0)&&r.push(o(a,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},t.exports.negative=function(e,t){for(var r=[],n=i(e[e.length-1],t),a=e[e.length-1],s=e[0],l=0;l<e.length;++l,a=s){var c=i(s=e[l],t);(n<0&&c>0||n>0&&c<0)&&r.push(o(a,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},{"robust-dot-product":281,"robust-sum":289}],301:[function(e,t,r){!function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(e){return a(o(e),arguments)}function n(e,r){return t.apply(null,[e].concat(r||[]))}function a(r,n){var a,i,o,s,l,c,u,f,p,h=1,d=r.length,m="";for(i=0;i<d;i++)if("string"==typeof r[i])m+=r[i];else if("object"==typeof r[i]){if((s=r[i]).keys)for(a=n[h],o=0;o<s.keys.length;o++){if(null==a)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));a=a[s.keys[o]]}else a=s.param_no?n[s.param_no]:n[h++];if(e.not_type.test(s.type)&&e.not_primitive.test(s.type)&&a instanceof Function&&(a=a()),e.numeric_arg.test(s.type)&&"number"!=typeof a&&isNaN(a))throw new TypeError(t("[sprintf] expecting number but found %T",a));switch(e.number.test(s.type)&&(f=a>=0),s.type){case"b":a=parseInt(a,10).toString(2);break;case"c":a=String.fromCharCode(parseInt(a,10));break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,s.width?parseInt(s.width):0);break;case"e":a=s.precision?parseFloat(a).toExponential(s.precision):parseFloat(a).toExponential();break;case"f":a=s.precision?parseFloat(a).toFixed(s.precision):parseFloat(a);break;case"g":a=s.precision?String(Number(a.toPrecision(s.precision))):parseFloat(a);break;case"o":a=(parseInt(a,10)>>>0).toString(8);break;case"s":a=String(a),a=s.precision?a.substring(0,s.precision):a;break;case"t":a=String(!!a),a=s.precision?a.substring(0,s.precision):a;break;case"T":a=Object.prototype.toString.call(a).slice(8,-1).toLowerCase(),a=s.precision?a.substring(0,s.precision):a;break;case"u":a=parseInt(a,10)>>>0;break;case"v":a=a.valueOf(),a=s.precision?a.substring(0,s.precision):a;break;case"x":a=(parseInt(a,10)>>>0).toString(16);break;case"X":a=(parseInt(a,10)>>>0).toString(16).toUpperCase()}e.json.test(s.type)?m+=a:(!e.number.test(s.type)||f&&!s.sign?p="":(p=f?"+":"-",a=a.toString().replace(e.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+a).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?p+a+l:"0"===c?p+l+a:l+p+a)}return m}var i=Object.create(null);function o(t){if(i[t])return i[t];for(var r,n=t,a=[],o=0;n;){if(null!==(r=e.text.exec(n)))a.push(r[0]);else if(null!==(r=e.modulo.exec(n)))a.push("%");else{if(null===(r=e.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],c=[];if(null===(c=e.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=e.key_access.exec(l)))s.push(c[1]);else{if(null===(c=e.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[t]=a}void 0!==r&&(r.sprintf=t,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=t,window.vsprintf=n)}()},{}],302:[function(e,t,r){"use strict";t.exports=function(e,t){if(e.dimension<=0)return{positions:[],cells:[]};if(1===e.dimension)return function(e,t){for(var r=a(e,t),n=r.length,i=new Array(n),o=new Array(n),s=0;s<n;++s)i[s]=[r[s]],o[s]=[s];return{positions:i,cells:o}}(e,t);var r=e.order.join()+"-"+e.dtype,s=o[r];return t=+t||0,s||(s=o[r]=function(e,t){var r=e.length+"d",a=i[r];if(a)return a(n,e,t)}(e.order,e.dtype)),s(e,t)};var n=e("ndarray-extract-contour"),a=e("zero-crossings"),i={"2d":function(e,t,r){var n=e({order:t,scalarArguments:3,getters:"generic"===r?[0]:void 0,phase:function(e,t,r,n){return e>n|0},vertex:function(e,t,r,n,a,i,o,s,l,c,u,f,p){var h=(o<<0)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==h&&15!==h)switch(h){case 0:case 15:u.push([e-.5,t-.5]);break;case 1:u.push([e-.25-.25*(n+r-2*p)/(r-n),t-.25-.25*(a+r-2*p)/(r-a)]);break;case 2:u.push([e-.75-.25*(-n-r+2*p)/(n-r),t-.25-.25*(i+n-2*p)/(n-i)]);break;case 3:u.push([e-.5,t-.5-.5*(a+r+i+n-4*p)/(r-a+n-i)]);break;case 4:u.push([e-.25-.25*(i+a-2*p)/(a-i),t-.75-.25*(-a-r+2*p)/(a-r)]);break;case 5:u.push([e-.5-.5*(n+r+i+a-4*p)/(r-n+a-i),t-.5]);break;case 6:u.push([e-.5-.25*(-n-r+i+a)/(n-r+a-i),t-.5-.25*(-a-r+i+n)/(a-r+n-i)]);break;case 7:u.push([e-.75-.25*(i+a-2*p)/(a-i),t-.75-.25*(i+n-2*p)/(n-i)]);break;case 8:u.push([e-.75-.25*(-i-a+2*p)/(i-a),t-.75-.25*(-i-n+2*p)/(i-n)]);break;case 9:u.push([e-.5-.25*(n+r+-i-a)/(r-n+i-a),t-.5-.25*(a+r+-i-n)/(r-a+i-n)]);break;case 10:u.push([e-.5-.5*(-n-r-i-a+4*p)/(n-r+i-a),t-.5]);break;case 11:u.push([e-.25-.25*(-i-a+2*p)/(i-a),t-.75-.25*(a+r-2*p)/(r-a)]);break;case 12:u.push([e-.5,t-.5-.5*(-a-r-i-n+4*p)/(a-r+i-n)]);break;case 13:u.push([e-.75-.25*(n+r-2*p)/(r-n),t-.25-.25*(-i-n+2*p)/(i-n)]);break;case 14:u.push([e-.25-.25*(-n-r+2*p)/(n-r),t-.25-.25*(-a-r+2*p)/(a-r)])}},cell:function(e,t,r,n,a,i,o,s,l){a?s.push([e,t]):s.push([t,e])}});return function(e,t){var r=[],a=[];return n(e,r,a,t),{positions:r,cells:a}}}},o={}},{"ndarray-extract-contour":251,"zero-crossings":318}],303:[function(e,t,r){(function(r){(function(){"use strict";t.exports=function e(t,r,a){a=a||{};var o=i[t];o||(o=i[t]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(e){for(var t=e.cells,r=e.positions,n=new Float32Array(6*t.length),a=0,i=0,o=0;o<t.length;++o)for(var s=t[o],l=0;l<3;++l){var c=r[s[l]];n[a++]=c[0],n[a++]=c[1]+1.4,i=Math.max(c[0],i)}return{data:n,shape:i}}(n(r,{triangles:!0,font:t,textAlign:a.textAlign||"left",textBaseline:"alphabetic",styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}}));else{for(var l=r.split(/(\d|\s)/),c=new Array(l.length),u=0,f=0,p=0;p<l.length;++p)c[p]=e(t,l[p]),u+=c[p].data.length,f+=c[p].shape,p>0&&(f+=.02);var h=new Float32Array(u),d=0,m=-.5*f;for(p=0;p<c.length;++p){for(var g=c[p].data,y=0;y<g.length;y+=2)h[d++]=g[y]+m,h[d++]=g[y+1];m+=c[p].shape+.02}s=o[r]={data:h,shape:f}}return s};var n=e("vectorize-text"),a=window||r.global||{},i=a.__TEXT_CACHE||{};a.__TEXT_CACHE={}}).call(this)}).call(this,e("_process"))},{_process:5,"vectorize-text":311}],304:[function(e,t,r){"use strict";var n=e("parse-unit");function a(e,t){var r=n(getComputedStyle(e).getPropertyValue(t));return r[0]*i(r[1],e)}function i(e,t){switch(t=t||document.body,e=(e||"px").trim().toLowerCase(),t!==window&&t!==document||(t=document.body),e){case"%":return t.clientHeight/100;case"ch":case"ex":return function(e,t){var r=document.createElement("div");r.style["font-size"]="128"+e,t.appendChild(r);var n=a(r,"font-size")/128;return t.removeChild(r),n}(e,t);case"em":return a(t,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}t.exports=i},{"parse-unit":265}],305:[function(e,t,r){"use strict";t.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.up||[0,1,0],n=e.right||f(r),a=e.radius||1,i=e.theta||0,u=e.phi||0;if(t=[].slice.call(t,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in e){var h=e.eye,d=[h[0]-t[0],h[1]-t[1],h[2]-t[2]];o(n,d,r),c(n[0],n[1],n[2])<1e-6?n=f(r):s(n,n),a=c(d[0],d[1],d[2]);var m=l(r,d)/a,g=l(n,d)/a;u=Math.acos(m),i=Math.acos(g)}return a=Math.log(a),new p(e.zoomMin,e.zoomMax,t,r,n,a,i,u)};var n=e("filtered-vector"),a=e("gl-mat4/invert"),i=e("gl-mat4/rotate"),o=e("gl-vec3/cross"),s=e("gl-vec3/normalize"),l=e("gl-vec3/dot");function c(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function u(e){return Math.min(1,Math.max(-1,e))}function f(e){var t=Math.abs(e[0]),r=Math.abs(e[1]),n=Math.abs(e[2]),a=[0,0,0];t>Math.max(r,n)?a[2]=1:r>Math.max(t,n)?a[0]=1:a[1]=1;for(var i=0,o=0,l=0;l<3;++l)i+=e[l]*e[l],o+=a[l]*e[l];for(l=0;l<3;++l)a[l]-=o/i*e[l];return s(a,a),a}function p(e,t,r,a,i,o,s,l){this.center=n(r),this.up=n(a),this.right=n(i),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(e,t),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var h=p.prototype;h.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},h.getDistanceLimits=function(e){var t=this.radius.bounds[0];return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},h.recalcMatrix=function(e){this.center.curve(e),this.up.curve(e),this.right.curve(e),this.radius.curve(e),this.angle.curve(e);for(var t=this.computedUp,r=this.computedRight,n=0,a=0,i=0;i<3;++i)a+=t[i]*r[i],n+=t[i]*t[i];var l=Math.sqrt(n),u=0;for(i=0;i<3;++i)r[i]-=t[i]*a/n,u+=r[i]*r[i],t[i]/=l;var f=Math.sqrt(u);for(i=0;i<3;++i)r[i]/=f;var p=this.computedToward;o(p,t,r),s(p,p);var h=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(d),y=Math.sin(d),v=Math.cos(m),b=Math.sin(m),x=this.computedCenter,_=g*v,w=y*v,k=b,D=-g*b,T=-y*b,A=v,S=this.computedEye,M=this.computedMatrix;for(i=0;i<3;++i){var E=_*r[i]+w*p[i]+k*t[i];M[4*i+1]=D*r[i]+T*p[i]+A*t[i],M[4*i+2]=E,M[4*i+3]=0}var C=M[1],N=M[5],O=M[9],I=M[2],P=M[6],R=M[10],L=N*R-O*P,F=O*I-C*R,B=C*P-N*I,z=c(L,F,B);for(L/=z,F/=z,B/=z,M[0]=L,M[4]=F,M[8]=B,i=0;i<3;++i)S[i]=x[i]+M[2+4*i]*h;for(i=0;i<3;++i){u=0;for(var j=0;j<3;++j)u+=M[i+4*j]*S[j];M[12+i]=-u}M[15]=1},h.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r};var d=[0,0,0];h.rotate=function(e,t,r,n){if(this.angle.move(e,t,r),n){this.recalcMatrix(e);var a=this.computedMatrix;d[0]=a[2],d[1]=a[6],d[2]=a[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)a[4*c]=o[c],a[4*c+1]=s[c],a[4*c+2]=l[c];for(i(a,a,n,d),c=0;c<3;++c)o[c]=a[4*c],s[c]=a[4*c+1];this.up.set(e,o[0],o[1],o[2]),this.right.set(e,s[0],s[1],s[2])}},h.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var a=this.computedMatrix,i=(Math.exp(this.computedRadius[0]),a[1]),o=a[5],s=a[9],l=c(i,o,s);i/=l,o/=l,s/=l;var u=a[0],f=a[4],p=a[8],h=u*i+f*o+p*s,d=c(u-=i*h,f-=o*h,p-=s*h),m=(u/=d)*t+i*r,g=(f/=d)*t+o*r,y=(p/=d)*t+s*r;this.center.move(e,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+n),this.radius.set(e,Math.log(v))},h.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},h.setMatrix=function(e,t,r,n){var i=1;"number"==typeof r&&(i=0|r),(i<0||i>3)&&(i=1);var o=(i+2)%3;t||(this.recalcMatrix(e),t=this.computedMatrix);var s=t[i],l=t[i+4],f=t[i+8];if(n){var p=Math.abs(s),h=Math.abs(l),d=Math.abs(f),m=Math.max(p,h,d);p===m?(s=s<0?-1:1,l=f=0):d===m?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var g=c(s,l,f);s/=g,l/=g,f/=g}var y,v,b=t[o],x=t[o+4],_=t[o+8],w=b*s+x*l+_*f,k=c(b-=s*w,x-=l*w,_-=f*w),D=l*(_/=k)-f*(x/=k),T=f*(b/=k)-s*_,A=s*x-l*b,S=c(D,T,A);if(D/=S,T/=S,A/=S,this.center.jump(e,q,W,H),this.radius.idle(e),this.up.jump(e,s,l,f),this.right.jump(e,b,x,_),2===i){var M=t[1],E=t[5],C=t[9],N=M*b+E*x+C*_,O=M*D+E*T+C*A;y=L<0?-Math.PI/2:Math.PI/2,v=Math.atan2(O,N)}else{var I=t[2],P=t[6],R=t[10],L=I*s+P*l+R*f,F=I*b+P*x+R*_,B=I*D+P*T+R*A;y=Math.asin(u(L)),v=Math.atan2(B,F)}this.angle.jump(e,v,y),this.recalcMatrix(e);var z=t[2],j=t[6],U=t[10],$=this.computedMatrix;a($,t);var V=$[15],q=$[12]/V,W=$[13]/V,H=$[14]/V,G=Math.exp(this.computedRadius[0]);this.center.jump(e,q-z*G,W-j*G,H-U*G)},h.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},h.idle=function(e){this.center.idle(e),this.up.idle(e),this.right.idle(e),this.radius.idle(e),this.angle.idle(e)},h.flush=function(e){this.center.flush(e),this.up.flush(e),this.right.flush(e),this.radius.flush(e),this.angle.flush(e)},h.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},h.lookAt=function(e,t,r,n){this.recalcMatrix(e),t=t||this.computedEye,r=r||this.computedCenter;var a=(n=n||this.computedUp)[0],i=n[1],o=n[2],s=c(a,i,o);if(!(s<1e-6)){a/=s,i/=s,o/=s;var l=t[0]-r[0],f=t[1]-r[1],p=t[2]-r[2],h=c(l,f,p);if(!(h<1e-6)){l/=h,f/=h,p/=h;var d=this.computedRight,m=d[0],g=d[1],y=d[2],v=a*m+i*g+o*y,b=c(m-=v*a,g-=v*i,y-=v*o);if(!(b<.01&&(b=c(m=i*p-o*f,g=o*l-a*p,y=a*f-i*l))<1e-6)){m/=b,g/=b,y/=b,this.up.set(e,a,i,o),this.right.set(e,m,g,y),this.center.set(e,r[0],r[1],r[2]),this.radius.set(e,Math.log(h));var x=i*y-o*g,_=o*m-a*y,w=a*g-i*m,k=c(x,_,w),D=a*l+i*f+o*p,T=m*l+g*f+y*p,A=(x/=k)*l+(_/=k)*f+(w/=k)*p,S=Math.asin(u(D)),M=Math.atan2(A,T),E=this.angle._state,C=E[E.length-1],N=E[E.length-2];C%=2*Math.PI;var O=Math.abs(C+2*Math.PI-M),I=Math.abs(C-M),P=Math.abs(C-2*Math.PI-M);O<I&&(C+=2*Math.PI),P<I&&(C-=2*Math.PI),this.angle.jump(this.angle.lastT(),C,N),this.angle.set(e,M,S)}}}}},{"filtered-vector":68,"gl-mat4/invert":98,"gl-mat4/rotate":103,"gl-vec3/cross":157,"gl-vec3/dot":162,"gl-vec3/normalize":179}],306:[function(e,t,r){"use strict";t.exports=function(e,t,r){var a=e*t,i=n*e,o=i-(i-e),s=e-o,l=n*t,c=l-(l-t),u=t-c,f=s*u-(a-o*c-s*c-o*u);return r?(r[0]=f,r[1]=a,r):[f,a]};var n=+(Math.pow(2,27)+1)},{}],307:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=e+t,a=n-e,i=t-a,o=e-(n-a);return r?(r[0]=o+i,r[1]=n,r):[o+i,n]}},{}],308:[function(e,t,n){(function(t){(function(){"use strict";var r=e("bit-twiddle"),a=e("dup"),i=e("buffer").Buffer;t.__TYPEDARRAY_POOL||(t.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),BIGUINT64:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),BIGINT64:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=t.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=a([32,0])),c.BIGUINT64||(c.BIGUINT64=a([32,0])),c.BIGINT64||(c.BIGINT64=a([32,0])),c.BUFFER||(c.BUFFER=a([32,0]));var u=c.DATA,f=c.BUFFER;function p(e){if(e){var t=e.length||e.byteLength,n=r.log2(t);u[n].push(e)}}function h(e){e=r.nextPow2(e);var t=r.log2(e),n=u[t];return n.length>0?n.pop():new ArrayBuffer(e)}function d(e){return new Uint8Array(h(e),0,e)}function m(e){return new Uint16Array(h(2*e),0,e)}function g(e){return new Uint32Array(h(4*e),0,e)}function y(e){return new Int8Array(h(e),0,e)}function v(e){return new Int16Array(h(2*e),0,e)}function b(e){return new Int32Array(h(4*e),0,e)}function x(e){return new Float32Array(h(4*e),0,e)}function _(e){return new Float64Array(h(8*e),0,e)}function w(e){return o?new Uint8ClampedArray(h(e),0,e):d(e)}function k(e){return s?new BigUint64Array(h(8*e),0,e):null}function D(e){return l?new BigInt64Array(h(8*e),0,e):null}function T(e){return new DataView(h(e),0,e)}function A(e){e=r.nextPow2(e);var t=r.log2(e),n=f[t];return n.length>0?n.pop():new i(e)}n.free=function(e){if(i.isBuffer(e))f[r.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,n=0|r.log2(t);u[n].push(e)}},n.freeUint8=n.freeUint16=n.freeUint32=n.freeBigUint64=n.freeInt8=n.freeInt16=n.freeInt32=n.freeBigInt64=n.freeFloat32=n.freeFloat=n.freeFloat64=n.freeDouble=n.freeUint8Clamped=n.freeDataView=function(e){p(e.buffer)},n.freeArrayBuffer=p,n.freeBuffer=function(e){f[r.log2(e.length)].push(e)},n.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return h(e);switch(t){case"uint8":return d(e);case"uint16":return m(e);case"uint32":return g(e);case"int8":return y(e);case"int16":return v(e);case"int32":return b(e);case"float":case"float32":return x(e);case"double":case"float64":return _(e);case"uint8_clamped":return w(e);case"bigint64":return D(e);case"biguint64":return k(e);case"buffer":return A(e);case"data":case"dataview":return T(e);default:return null}return null},n.mallocArrayBuffer=h,n.mallocUint8=d,n.mallocUint16=m,n.mallocUint32=g,n.mallocInt8=y,n.mallocInt16=v,n.mallocInt32=b,n.mallocFloat32=n.mallocFloat=x,n.mallocFloat64=n.mallocDouble=_,n.mallocUint8Clamped=w,n.mallocBigUint64=k,n.mallocBigInt64=D,n.mallocDataView=T,n.mallocBuffer=A,n.clearCache=function(){for(var e=0;e<32;++e)c.UINT8[e].length=0,c.UINT16[e].length=0,c.UINT32[e].length=0,c.INT8[e].length=0,c.INT16[e].length=0,c.INT32[e].length=0,c.FLOAT[e].length=0,c.DOUBLE[e].length=0,c.BIGUINT64[e].length=0,c.BIGINT64[e].length=0,c.UINT8C[e].length=0,u[e].length=0,f[e].length=0}}).call(this)}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":32,buffer:3,dup:65}],309:[function(e,t,r){"use strict";function n(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t<e;++t)this.roots[t]=t,this.ranks[t]=0}t.exports=n;var a=n.prototype;Object.defineProperty(a,"length",{get:function(){return this.roots.length}}),a.makeSet=function(){var e=this.roots.length;return this.roots.push(e),this.ranks.push(0),e},a.find=function(e){for(var t=e,r=this.roots;r[e]!==e;)e=r[e];for(;r[t]!==e;){var n=r[t];r[t]=e,t=n}return e},a.link=function(e,t){var r=this.find(e),n=this.find(t);if(r!==n){var a=this.ranks,i=this.roots,o=a[r],s=a[n];o<s?i[r]=n:s<o?i[n]=r:(i[n]=r,++a[r])}}},{}],310:[function(e,t,r){"use strict";t.exports=function(e,t,r){return 0===e.length?e:t?(r||e.sort(t),function(e,t){for(var r=1,n=e.length,a=e[0],i=e[0],o=1;o<n;++o)if(i=a,t(a=e[o],i)){if(o===r){r++;continue}e[r++]=a}return e.length=r,e}(e,t)):(r||e.sort(),function(e){for(var t=1,r=e.length,n=e[0],a=e[0],i=1;i<r;++i,a=n)if(a=n,(n=e[i])!==a){if(i===t){t++;continue}e[t++]=n}return e.length=t,e}(e))}},{}],311:[function(e,t,r){"use strict";t.exports=function(e,t){return"object"==typeof t&&null!==t||(t={}),n(e,t.canvas||a,t.context||i,t)};var n=e("./lib/vtext"),a=null,i=null;"undefined"!=typeof document&&((a=document.createElement("canvas")).width=8192,a.height=1024,i=a.getContext("2d"))},{"./lib/vtext":312}],312:[function(e,t,r){t.exports=function(e,t,r,n){var i=64,o=1.25,s={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};return n&&(n.size&&n.size>0&&(i=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,i+"px",n.font].filter((function(e){return e})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",p(function(e,t,r,n,i,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\<br\>/g,"\n"):r.replace(/\<br\>/g," ");var s="",l=[];for(h=0;h<r.length;++h)l[h]=s;!0===o.bolds&&(l=c("b","b|",r,l)),!0===o.italics&&(l=c("i","i|",r,l)),!0===o.superscripts&&(l=c("sup","+1",r,l)),!0===o.subscripts&&(l=c("sub","-1",r,l));var u=[],f="";for(h=0;h<r.length;++h)null!==l[h]&&(f+=r[h],u.push(l[h]));var p,h,d,m,g,y=f.split("\n"),v=y.length,b=Math.round(i*n),x=n,_=2*n,w=0,k=v*b+_;e.height<k&&(e.height=k),t.fillStyle="#000",t.fillRect(0,0,e.width,e.height),t.fillStyle="#fff";var D=0,T="";function A(){if(""!==T){var e=t.measureText(T).width;t.fillText(T,x+d,_+m),d+=e}}function S(){return Math.round(g)+"px "}function M(e,r){var n=""+t.font;if(!0===o.subscripts){var a=e.indexOf("-"),i=r.indexOf("-"),s=a>-1?parseInt(e[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(S(),"?px "),g*=Math.pow(.75,l-s),n=n.replace("?px ",S())),m+=.25*b*(l-s)}if(!0===o.superscripts){var c=e.indexOf("+"),u=r.indexOf("+"),f=c>-1?parseInt(e[1+c]):0,p=u>-1?parseInt(r[1+u]):0;f!==p&&(n=n.replace(S(),"?px "),g*=Math.pow(.75,p-f),n=n.replace("?px ",S())),m-=.25*b*(p-f)}if(!0===o.bolds){var h=e.indexOf("b|")>-1,d=r.indexOf("b|")>-1;!h&&d&&(n=y?n.replace("italic ","italic bold "):"bold "+n),h&&!d&&(n=n.replace("bold ",""))}if(!0===o.italics){var y=e.indexOf("i|")>-1,v=r.indexOf("i|")>-1;!y&&v&&(n="italic "+n),y&&!v&&(n=n.replace("italic ",""))}t.font=n}for(p=0;p<v;++p){var E=y[p]+"\n";for(d=0,m=p*b,g=n,T="",h=0;h<E.length;++h){var C=h+D<u.length?u[h+D]:u[u.length-1];s===C?T+=E[h]:(A(),T=E[h],void 0!==C&&(M(s,C),s=C))}A(),D+=E.length;var N=0|Math.round(d+2*x);w<N&&(w=N)}var O=w,I=_+b*v;return a(t.getImageData(0,0,O,I).data,[I,O,4]).pick(-1,-1,0).transpose(1,0)}(t,r,e,i,o,s),n,i)},t.exports.processPixels=p;var n=e("surface-nets"),a=e("ndarray"),i=e("simplify-planar-graph"),o=e("clean-pslg"),s=e("cdt2d"),l=e("planar-graph-to-polyline");function c(e,t,r,n){for(var a="<"+e+">",i="</"+e+">",o=a.length,s=i.length,l="+"===t[0]||"-"===t[0],c=0,u=-s;c>-1&&-1!==(c=r.indexOf(a,c))&&-1!==(u=r.indexOf(i,c+o))&&!(u<=c);){for(var f=c;f<u+s;++f)if(f<c+o||f>=u)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var p=n[f].indexOf(t[0]);-1===p?n[f]+=t:l&&(n[f]=n[f].substr(0,p+1)+(1+parseInt(n[f][p+1]))+n[f].substr(p+2))}var h=c+o,d=r.substr(h,u-h).indexOf(a);c=-1!==d?d:u+s}return n}function u(e,t){var r=n(e,128);return t?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(e,t,r,n){var a=u(e,n),i=function(e,t,r){for(var n=t.textAlign||"start",a=t.textBaseline||"alphabetic",i=[1<<30,1<<30],o=[0,0],s=e.length,l=0;l<s;++l)for(var c=e[l],u=0;u<2;++u)i[u]=0|Math.min(i[u],c[u]),o[u]=0|Math.max(o[u],c[u]);var f=0;switch(n){case"center":f=-.5*(i[0]+o[0]);break;case"right":case"end":f=-o[0];break;case"left":case"start":f=-i[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var p=0;switch(a){case"hanging":case"top":p=-i[1];break;case"middle":p=-.5*(i[1]+o[1]);break;case"alphabetic":case"ideographic":p=-3*r;break;case"bottom":p=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+a+"'")}var h=1/r;return"lineHeight"in t?h*=+t.lineHeight:"width"in t?h=t.width/(o[0]-i[0]):"height"in t&&(h=t.height/(o[1]-i[1])),e.map((function(e){return[h*(e[0]+f),h*(e[1]+p)]}))}(a.positions,t,r),c=a.edges,f="ccw"===t.orientation;if(o(i,c),t.polygons||t.polygon||t.polyline){for(var p=l(c,i),h=new Array(p.length),d=0;d<p.length;++d){for(var m=p[d],g=new Array(m.length),y=0;y<m.length;++y){for(var v=m[y],b=new Array(v.length),x=0;x<v.length;++x)b[x]=i[v[x]].slice();f&&b.reverse(),g[y]=b}h[d]=g}return h}return t.triangles||t.triangulate||t.triangle?{cells:s(i,c,{delaunay:!1,exterior:!1,interior:!0}),positions:i}:{edges:c,positions:i}}function p(e,t,r){try{return f(e,t,r,!0)}catch(e){}try{return f(e,t,r,!1)}catch(e){}return t.polygons||t.polyline||t.polygon?[]:t.triangles||t.triangulate||t.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}},{cdt2d:42,"clean-pslg":50,ndarray:259,"planar-graph-to-polyline":268,"simplify-planar-graph":297,"surface-nets":302}],313:[function(e,t,r){!function(){"use strict";if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=m);var e=!1;if("function"==typeof WeakMap){var r=WeakMap;if("undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var n=new r,a=Object.freeze({});if(n.set(a,1),1===n.get(a))return void(t.exports=WeakMap);e=!0}}Object.prototype.hasOwnProperty;var i=Object.getOwnPropertyNames,o=Object.defineProperty,s=Object.isExtensible,l="weakmap:ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var c=new ArrayBuffer(25),u=new Uint8Array(c);crypto.getRandomValues(u),l="weakmap:rand:"+Array.prototype.map.call(u,(function(e){return(e%36).toString(36)})).join("")+"___"}if(o(Object,"getOwnPropertyNames",{value:function(e){return i(e).filter(g)}}),"getPropertyNames"in Object){var f=Object.getPropertyNames;o(Object,"getPropertyNames",{value:function(e){return f(e).filter(g)}})}!function(){var e=Object.freeze;o(Object,"freeze",{value:function(t){return y(t),e(t)}});var t=Object.seal;o(Object,"seal",{value:function(e){return y(e),t(e)}});var r=Object.preventExtensions;o(Object,"preventExtensions",{value:function(e){return y(e),r(e)}})}();var p=!1,h=0,d=function(){this instanceof d||b();var e=[],t=[],r=h++;return Object.create(d.prototype,{get___:{value:v((function(n,a){var i,o=y(n);return o?r in o?o[r]:a:(i=e.indexOf(n))>=0?t[i]:a}))},has___:{value:v((function(t){var n=y(t);return n?r in n:e.indexOf(t)>=0}))},set___:{value:v((function(n,a){var i,o=y(n);return o?o[r]=a:(i=e.indexOf(n))>=0?t[i]=a:(i=e.length,t[i]=a,e[i]=n),this}))},delete___:{value:v((function(n){var a,i,o=y(n);return o?r in o&&delete o[r]:!((a=e.indexOf(n))<0||(i=e.length-1,e[a]=void 0,t[a]=t[i],e[a]=e[i],e.length=i,t.length=i,0))}))}})};d.prototype=Object.create(Object.prototype,{get:{value:function(e,t){return this.get___(e,t)},writable:!0,configurable:!0},has:{value:function(e){return this.has___(e)},writable:!0,configurable:!0},set:{value:function(e,t){return this.set___(e,t)},writable:!0,configurable:!0},delete:{value:function(e){return this.delete___(e)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof d||b();var t,n=new r,a=void 0,i=!1;return t=e?function(e,t){return n.set(e,t),n.has(e)||(a||(a=new d),a.set(e,t)),this}:function(e,t){if(i)try{n.set(e,t)}catch(r){a||(a=new d),a.set___(e,t)}else n.set(e,t);return this},Object.create(d.prototype,{get___:{value:v((function(e,t){return a?n.has(e)?n.get(e):a.get___(e,t):n.get(e,t)}))},has___:{value:v((function(e){return n.has(e)||!!a&&a.has___(e)}))},set___:{value:v(t)},delete___:{value:v((function(e){var t=!!n.delete(e);return a&&a.delete___(e)||t}))},permitHostObjects___:{value:v((function(e){if(e!==m)throw new Error("bogus call to permitHostObjects___");i=!0}))}})}e&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=d.prototype,t.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),t.exports=d)}function m(e){e.permitHostObjects___&&e.permitHostObjects___(m)}function g(e){return!("weakmap:"==e.substr(0,"weakmap:".length)&&"___"===e.substr(e.length-3))}function y(e){if(e!==Object(e))throw new TypeError("Not an object: "+e);var t=e[l];if(t&&t.key===e)return t;if(s(e)){t={key:e};try{return o(e,l,{value:t,writable:!1,enumerable:!1,configurable:!1}),t}catch(e){return}}}function v(e){return e.prototype=null,Object.freeze(e)}function b(){p||"undefined"==typeof console||(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],314:[function(e,t,r){var n=e("./hidden-store.js");t.exports=function(){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)}}},{"./hidden-store.js":315}],315:[function(e,t,r){t.exports=function(e,t){var r={identity:t},n=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function(e){return e!==t?n.apply(this,arguments):r},writable:!0}),r}},{}],316:[function(e,t,r){var n=e("./create-store.js");t.exports=function(){var e=n();return{get:function(t,r){var n=e(t);return n.hasOwnProperty("value")?n.value:r},set:function(t,r){return e(t).value=r,this},has:function(t){return"value"in e(t)},delete:function(t){return delete e(t).value}}}},{"./create-store.js":314}],317:[function(e,t,r){"use strict";t.exports=function(e){var t={};return function(r,n,a){var i=r.dtype,o=r.order,s=[i,o.join()].join(),l=t[s];return l||(t[s]=l=e([i,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,a)}}(function(){return function(e,t,r,n,a,i){var o=e[0],s=r[0],l=[0],c=s;n|=0;var u=0,f=s;for(u=0;u<o;++u){var p=t[n]-i,h=t[n+c]-i;p>=0!=h>=0&&a.push(l[0]+.5+.5*(p+h)/(p-h)),n+=f,++l[0]}}}.bind(void 0,{funcName:"zeroCrossings"}))},{}],318:[function(e,t,r){"use strict";t.exports=function(e,t){var r=[];return t=+t||0,n(e.hi(e.shape[0]-1),r,t),r};var n=e("./lib/zc-core")},{"./lib/zc-core":317}]},{},[6])(6)}))}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[27])(27)},73005:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var a=t&&t.prototype instanceof g?t:g,i=Object.create(a.prototype),o=new M(n||[]);return i._invoke=function(e,t,r){var n=f;return function(a,i){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===a)throw i;return C()}for(r.method=a,r.arg=i;;){var o=r.delegate;if(o){var s=T(o,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var l=u(e,t,r);if("normal"===l.type){if(n=r.done?d:p,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n=d,r.method="throw",r.arg=l.arg)}}}(e,r,o),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",p="suspendedYield",h="executing",d="completed",m={};function g(){}function y(){}function v(){}var b={};l(b,i,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(E([])));_&&_!==r&&n.call(_,i)&&(b=_);var w=v.prototype=g.prototype=Object.create(b);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function r(a,i,o,s){var l=u(e[a],e,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(f).then((function(e){c.value=e,o(c)}),(function(e){return r("throw",e,o,s)}))}s(l.arg)}var a;this._invoke=function(e,n){function i(){return new t((function(t,a){r(e,n,t,a)}))}return a=a?a.then(i,i):i()}}function T(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,T(e,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=u(n,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function E(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}return{next:C}}function C(){return{value:t,done:!0}}return y.prototype=v,l(w,"constructor",v),l(v,"constructor",y),y.displayName=l(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,l(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},k(D.prototype),l(D.prototype,o,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var o=new D(c(t,r,n,a),i);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},k(w),l(w,s,"Generator"),l(w,i,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=E,M.prototype={constructor:M,reset:function(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(S),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return s.type="throw",s.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(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),m},finish:function(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),S(r),m}},catch:function(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 a=n.arg;S(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},70047:(e,t,r)=>{var n=r(95148),a=r(63782),i=r(40912),o=r(47954),s=r(31424),l=r(62171),c=r(61622);c.alea=n,c.xor128=a,c.xorwow=i,c.xorshift7=o,c.xor4096=s,c.tychei=l,e.exports=c},95148:function(e,t,r){var n;!function(e,a,i){function o(e){var t,r=this,n=(t=4022871197,function(e){e=e.toString();for(var r=0;r<e.length;r++){var n=.02519603282416938*(t+=e.charCodeAt(r));n-=t=n>>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var r=new o(e),n=t&&t.state,a=r.next;return a.int32=function(){return 4294967296*r.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.alea=l}(0,e=r.nmd(e),r.amdD)},62171:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,a=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)t.b^=0|r.charCodeAt(n),t.next()}function s(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.tychei=l}(0,e=r.nmd(e),r.amdD)},63782:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor128=l}(0,e=r.nmd(e),r.amdD)},31424:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,r,n=t.w,a=t.X,i=t.i;return t.w=n=n+1640531527|0,r=a[i+34&127],e=a[i=i+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=a[i]=r^e,t.i=i,r+(n^n>>>16)|0},function(e,t){var r,n,a,i,o,s=[],l=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,l=Math.max(l,t.length)),a=0,i=-32;i<l;++i)t&&(n^=t.charCodeAt((i+32)%t.length)),0===i&&(o=n),n^=n<<10,n^=n>>>15,n^=n<<4,n^=n>>>13,i>=0&&(o=o+1640531527|0,a=0==(r=s[127&i]^=n+o)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,i=512;i>0;--i)n=s[a+34&127],r=s[a=a+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[a]=n^r;e.w=o,e.X=s,e.i=a}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.X&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xor4096=l}(0,e=r.nmd(e),r.amdD)},47954:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,r,n=t.x,a=t.i;return e=n[a],r=(e^=e>>>7)^e<<24,r^=(e=n[a+1&7])^e>>>10,r^=(e=n[a+3&7])^e>>>3,r^=(e=n[a+4&7])^e<<7,e=n[a+7&7],r^=(e^=e<<13)^e<<9,n[a]=r,t.i=a+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r<t.length;++r)n[7&r]=n[7&r]<<15^t.charCodeAt(r)+n[r+1&7]<<13;for(;n.length<8;)n.push(0);for(r=0;r<8&&0===n[r];++r);for(8==r?n[7]=-1:n[r],e.x=n,e.i=0,r=256;r>0;--r)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&(n.x&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorshift7=l}(0,e=r.nmd(e),r.amdD)},40912:function(e,t,r){var n;!function(e,a,i){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),n==r.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function l(e,t){var r=new o(e),n=t&&t.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=r.next,a.quick=a,n&&("object"==typeof n&&s(n,r),a.state=function(){return s(r,{})}),a}a&&a.exports?a.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,a))||(a.exports=n):this.xorwow=l}(0,e=r.nmd(e),r.amdD)},61622:(e,t,r)=>{var n;!function(a,i){var o,s=(0,eval)("this"),l=256,c=i.pow(l,6),u=i.pow(2,52),f=2*u,p=255;function h(e,t,r){var n=[],p=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,v(a)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(l):(e=new Uint8Array(l),(s.crypto||s.msCrypto).getRandomValues(e)),v(e)}catch(e){var t=s.navigator,r=t&&t.plugins;return[+new Date,s,r,s.screen,v(a)]}}():e,3),n),h=new d(n),b=function(){for(var e=h.g(6),t=c,r=0;e<u;)e=(e+r)*l,t*=l,r=h.g(1);for(;e>=f;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|h.g(4)},b.quick=function(){return h.g(4)/4294967296},b.double=b,y(v(h.S),a),(t.pass||r||function(e,t,r,n){return n&&(n.S&&m(n,h),e.state=function(){return m(h,{})}),r?(i.random=e,t):e})(b,p,"global"in t?t.global:this==i,t.state)}function d(e){var t,r=e.length,n=this,a=0,i=n.i=n.j=0,o=n.S=[];for(r||(e=[r++]);a<l;)o[a]=a++;for(a=0;a<l;a++)o[a]=o[i=p&i+e[a%r]+(t=o[a])],o[i]=t;(n.g=function(e){for(var t,r=0,a=n.i,i=n.j,o=n.S;e--;)t=o[a=p&a+1],r=r*l+o[p&(o[a]=o[i=p&i+t])+(o[i]=t)];return n.i=a,n.j=i,r})(l)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function g(e,t){var r,n=[],a=typeof e;if(t&&"object"==a)for(r in e)try{n.push(g(e[r],t-1))}catch(e){}return n.length?n:"string"==a?e:e+"\0"}function y(e,t){for(var r,n=e+"",a=0;a<n.length;)t[p&a]=p&(r^=19*t[p&a])+n.charCodeAt(a++);return v(t)}function v(e){return String.fromCharCode.apply(0,e)}if(i.seedrandom=h,y(i.random(),a),e.exports){e.exports=h;try{o=r(260)}catch(e){}}else void 0===(n=function(){return h}.call(t,r,t,e))||(e.exports=n)}([],Math)},44081:(e,t,r)=>{"use strict";const n=r(32633),a=r(42389),i=r(72436),o=["","›"],s=e=>`${o[0]}[${e}m`,l=(e,t,r)=>{let n=[];e=[...e];for(let r of e){const a=r;r.includes(";")&&(r=r.split(";")[0][0]+"0");const o=i.codes.get(Number.parseInt(r,10));if(o){const r=e.indexOf(o.toString());-1===r?n.push(s(t?o:a)):e.splice(r,1)}else{if(t){n.push(s(0));break}n.push(s(a))}}if(t&&(n=n.filter(((e,t)=>n.indexOf(e)===t)),void 0!==r)){const e=s(i.codes.get(Number.parseInt(r,10)));n=n.reduce(((t,r)=>r===e?[r,...t]:[...t,r]),[])}return n.join("")};e.exports=(e,t,r)=>{const i=[...e],s=[];let c,u="number"==typeof r?r:i.length,f=!1,p=0,h="";for(const[d,m]of i.entries()){let i=!1;if(o.includes(m)){const t=/\d[^m]*/.exec(e.slice(d,d+18));c=t&&t.length>0?t[0]:void 0,p<u&&(f=!0,void 0!==c&&s.push(c))}else f&&"m"===m&&(f=!1,i=!0);if(f||i||p++,!a({exact:!0}).test(m)&&n(m.codePointAt())&&(p++,"number"!=typeof r&&u++),p>t&&p<=u)h+=m;else if(p!==t||f||void 0===c){if(p>=u){h+=l(s,!0,c);break}}else h=l(s)}return h}},31279:(e,t,r)=>{"use strict";const n=r(31862),a=r(32633),i=r(2382),o=e=>{if("string"!=typeof e||0===e.length)return 0;if(0===(e=n(e)).length)return 0;e=e.replace(i(),"  ");let t=0;for(let r=0;r<e.length;r++){const n=e.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,t+=a(n)?2:1)}return t};e.exports=o,e.exports.default=o},31862:(e,t,r)=>{"use strict";const n=r(76673);e.exports=e=>"string"==typeof e?e.replace(n(),""):e},43325:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.alignString=void 0;const a=n(r(31279)),i=r(8318),o=(e,t)=>e+" ".repeat(t);t.alignString=(e,t,r)=>{const n=a.default(e);if(n===t)return e;if(n>t)throw new Error("Subject parameter value width cannot be greater than the container width.");if(0===n)return" ".repeat(t);const s=t-n;return"left"===r?o(e,s):"right"===r?((e,t)=>" ".repeat(t)+e)(e,s):"justify"===r?((e,t)=>{const r=i.countSpaceSequence(e);if(0===r)return o(e,t);const n=i.distributeUnevenly(t,r);if(Math.max(...n)>3)return o(e,t);let a=0;return e.replace(/\s+/g,(e=>e+" ".repeat(n[a++])))})(e,s):((e,t)=>" ".repeat(Math.floor(t/2))+e+" ".repeat(Math.ceil(t/2)))(e,s)}},78627:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.alignTableData=void 0;const n=r(43325);t.alignTableData=(e,t)=>e.map((e=>e.map(((e,r)=>{const{width:a,alignment:i}=t.columns[r];return n.alignString(e,a,i)}))))},27109:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateCellHeight=void 0;const n=r(97987);t.calculateCellHeight=(e,t,r=!1)=>n.wrapCell(e,t,r).length},70839:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calculateCellWidths=void 0;const a=n(r(31279));t.calculateCellWidths=e=>e.map((e=>Math.max(...e.split("\n").map(a.default))))},42290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(70839);t.default=e=>{const t=new Array(e[0].length).fill(0);return e.forEach((e=>{n.calculateCellWidths(e).forEach(((e,r)=>{t[r]=Math.max(t[r],e)}))})),t}},38498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateRowHeights=void 0;const n=r(27109);t.calculateRowHeights=(e,t)=>e.map((e=>{let r=1;return e.forEach(((e,a)=>{const i=n.calculateCellHeight(e,t.columns[a].width,t.columns[a].wrapWord);r=Math.max(r,i)})),r}))},88220:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createStream=void 0;const n=r(78627),a=r(38498),i=r(81482),o=r(87648),s=r(17793),l=r(69305),c=r(5669),u=r(772),f=r(43373),p=(e,t)=>{let r=u.stringifyTableData(e);r=f.truncateTableData(r,t);const i=a.calculateRowHeights(r,t);return r=l.mapDataUsingRowHeights(r,i,t),r=n.alignTableData(r,t),r=c.padTableData(r,t),r};t.createStream=e=>{const t=s.makeStreamConfig(e),r=Object.values(t.columns).map((e=>e.width+e.paddingLeft+e.paddingRight));let n=!0;return{write:e=>{if(e.length!==t.columnCount)throw new Error("Row cell count does not match the config.columnCount.");n?(n=!1,((e,t,r)=>{const n=p([e],r).map((e=>o.drawRow(e,r))).join("");let a;a="",a+=i.drawBorderTop(t,r),a+=n,a+=i.drawBorderBottom(t,r),a=a.trimEnd(),process.stdout.write(a)})(e,r,t)):((e,t,r)=>{const n=p([e],r).map((e=>o.drawRow(e,r))).join("");let a="";const s=i.drawBorderBottom(t,r);"\n"!==s&&(a="\r"),a+=i.drawBorderJoin(t,r),a+=n,a+=s,a=a.trimEnd(),process.stdout.write(a)})(e,r,t)}}}},81482:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.drawBorderTop=t.drawBorderJoin=t.drawBorderBottom=t.drawBorder=t.createTableBorderGetter=void 0;const n=r(47278),a=(e,t)=>{const{separator:r,drawVerticalLine:a}=t,i=e.map((e=>t.separator.body.repeat(e)));return n.drawContent(i,{drawSeparator:a,separatorGetter:(e,t)=>0===e?r.left:e===t?r.right:r.join})+"\n"};t.drawBorder=a;const i=(e,t)=>{const r=a(e,{...t,separator:{body:t.border.topBody,join:t.border.topJoin,left:t.border.topLeft,right:t.border.topRight}});return"\n"===r?"":r};t.drawBorderTop=i;const o=(e,t)=>a(e,{...t,separator:{body:t.border.joinBody,join:t.border.joinJoin,left:t.border.joinLeft,right:t.border.joinRight}});t.drawBorderJoin=o;const s=(e,t)=>a(e,{...t,separator:{body:t.border.bottomBody,join:t.border.bottomJoin,left:t.border.bottomLeft,right:t.border.bottomRight}});t.drawBorderBottom=s,t.createTableBorderGetter=(e,t)=>(r,n)=>t.header?0===r?i(e,{...t,border:{...t.border,topJoin:t.border.topBody}}):1===r?o(e,{...t,border:{...t.border,joinJoin:t.border.headerJoin}}):r===n?s(e,t):o(e,t):0===r?i(e,t):r===n?s(e,t):o(e,t)},47278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.drawContent=void 0,t.drawContent=(e,t)=>{const{separatorGetter:r,drawSeparator:n}=t,a=e.length,i=[];return n(0,a)&&i.push(r(0,a)),e.forEach(((e,t)=>{i.push(e),t+1<a&&n(t+1,a)&&i.push(r(t+1,a))})),n(a,a)&&i.push(r(a,a)),i.join("")}},86088:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.drawHeader=void 0;const n=r(43325),a=r(87648),i=r(5669),o=r(43373),s=r(97987);t.drawHeader=(e,t)=>{if(!t.header)throw new Error("Can not draw header without header configuration");const{alignment:r,paddingRight:l,paddingLeft:c,wrapWord:u}=t.header;let f=t.header.content;return f=o.truncateString(f,t.header.truncate),s.wrapCell(f,e,u).map((o=>{let s=n.alignString(o,e,r);return s=i.padString(s,c,l),a.drawRow([s],{...t,drawVerticalLine:e=>{const r=t.columns.length;return t.drawVerticalLine(0===e?0:r,r)}})})).join("")}},87648:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.drawRow=void 0;const n=r(47278);t.drawRow=(e,t)=>{const{border:r,drawVerticalLine:a}=t;return n.drawContent(e,{drawSeparator:a,separatorGetter:(e,t)=>0===e?r.bodyLeft:e===t?r.bodyRight:r.bodyJoin})+"\n"}},31567:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.drawTable=void 0;const a=n(r(31279)),i=r(81482),o=r(47278),s=r(86088),l=r(87648),c=r(8318);t.drawTable=(e,t,r,n)=>{const{drawHorizontalLine:u,singleLine:f}=n,p=c.groupBySizes(e,r).map((e=>e.map((e=>l.drawRow(e,n))).join("")));if(n.header){const t=a.default(l.drawRow(e[0],n))-2-n.header.paddingLeft-n.header.paddingRight,r=s.drawHeader(t,n);p.unshift(r)}return o.drawContent(p,{drawSeparator:(e,t)=>(0===e||e===t||!f)&&u(e,t),separatorGetter:i.createTableBorderGetter(t,n)})}},89670:(e,t,r)=>{"use strict";t["config.json"]=function e(t,{instancePath:r="",parentData:n,parentDataProperty:a,rootData:i=t}={}){let s=null,c=0;if(t&&"object"==typeof t&&!Array.isArray(t)){for(const e in t)if("border"!==e&&"header"!==e&&"columns"!==e&&"columnDefault"!==e&&"drawVerticalLine"!==e&&"drawHorizontalLine"!==e&&"singleLine"!==e){const t={instancePath:r,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"};null===s?s=[t]:s.push(t),c++}if(void 0!==t.border&&(o(t.border,{instancePath:r+"/border",parentData:t,parentDataProperty:"border",rootData:i})||(s=null===s?o.errors:s.concat(o.errors),c=s.length)),void 0!==t.header){let e=t.header;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.content){const e={instancePath:r+"/header",schemaPath:"#/properties/header/required",keyword:"required",params:{missingProperty:"content"},message:"must have required property 'content'"};null===s?s=[e]:s.push(e),c++}for(const t in e)if("content"!==t&&"alignment"!==t&&"wrapWord"!==t&&"truncate"!==t&&"paddingLeft"!==t&&"paddingRight"!==t){const e={instancePath:r+"/header",schemaPath:"#/properties/header/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:t},message:"must NOT have additional properties"};null===s?s=[e]:s.push(e),c++}if(void 0!==e.content&&"string"!=typeof e.content){const e={instancePath:r+"/header/content",schemaPath:"#/properties/header/properties/content/type",keyword:"type",params:{type:"string"},message:"must be string"};null===s?s=[e]:s.push(e),c++}if(void 0!==e.alignment&&(l(e.alignment,{instancePath:r+"/header/alignment",parentData:e,parentDataProperty:"alignment",rootData:i})||(s=null===s?l.errors:s.concat(l.errors),c=s.length)),void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:r+"/header/wrapWord",schemaPath:"#/properties/header/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===s?s=[e]:s.push(e),c++}if(void 0!==e.truncate){let t=e.truncate;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:r+"/header/truncate",schemaPath:"#/properties/header/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===s?s=[e]:s.push(e),c++}}if(void 0!==e.paddingLeft){let t=e.paddingLeft;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:r+"/header/paddingLeft",schemaPath:"#/properties/header/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===s?s=[e]:s.push(e),c++}}if(void 0!==e.paddingRight){let t=e.paddingRight;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:r+"/header/paddingRight",schemaPath:"#/properties/header/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===s?s=[e]:s.push(e),c++}}}else{const e={instancePath:r+"/header",schemaPath:"#/properties/header/type",keyword:"type",params:{type:"object"},message:"must be object"};null===s?s=[e]:s.push(e),c++}}if(void 0!==t.columns&&(h(t.columns,{instancePath:r+"/columns",parentData:t,parentDataProperty:"columns",rootData:i})||(s=null===s?h.errors:s.concat(h.errors),c=s.length)),void 0!==t.columnDefault&&(d(t.columnDefault,{instancePath:r+"/columnDefault",parentData:t,parentDataProperty:"columnDefault",rootData:i})||(s=null===s?d.errors:s.concat(d.errors),c=s.length)),void 0!==t.drawVerticalLine&&"function"!=typeof t.drawVerticalLine){const e={instancePath:r+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'should pass "typeof" keyword validation'};null===s?s=[e]:s.push(e),c++}if(void 0!==t.drawHorizontalLine&&"function"!=typeof t.drawHorizontalLine){const e={instancePath:r+"/drawHorizontalLine",schemaPath:"#/properties/drawHorizontalLine/typeof",keyword:"typeof",params:{},message:'should pass "typeof" keyword validation'};null===s?s=[e]:s.push(e),c++}if(void 0!==t.singleLine&&"boolean"!=typeof t.singleLine){const e={instancePath:r+"/singleLine",schemaPath:"#/properties/singleLine/typeof",keyword:"typeof",params:{},message:'should pass "typeof" keyword validation'};null===s?s=[e]:s.push(e),c++}}else{const e={instancePath:r,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===s?s=[e]:s.push(e),c++}return e.errors=s,0===c};const n={topBody:{$ref:"#/definitions/border"},topJoin:{$ref:"#/definitions/border"},topLeft:{$ref:"#/definitions/border"},topRight:{$ref:"#/definitions/border"},bottomBody:{$ref:"#/definitions/border"},bottomJoin:{$ref:"#/definitions/border"},bottomLeft:{$ref:"#/definitions/border"},bottomRight:{$ref:"#/definitions/border"},bodyLeft:{$ref:"#/definitions/border"},bodyRight:{$ref:"#/definitions/border"},bodyJoin:{$ref:"#/definitions/border"},headerJoin:{$ref:"#/definitions/border"},joinBody:{$ref:"#/definitions/border"},joinLeft:{$ref:"#/definitions/border"},joinRight:{$ref:"#/definitions/border"},joinJoin:{$ref:"#/definitions/border"}},a=Object.prototype.hasOwnProperty;function i(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:a=e}={}){let o=null,s=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===o?o=[e]:o.push(e),s++}return i.errors=o,0===s}function o(e,{instancePath:t="",parentData:r,parentDataProperty:s,rootData:l=e}={}){let c=null,u=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const r in e)if(!a.call(n,r)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};null===c?c=[e]:c.push(e),u++}void 0!==e.topBody&&(i(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.topJoin&&(i(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.topLeft&&(i(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.topRight&&(i(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomBody&&(i(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomJoin&&(i(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomLeft&&(i(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomRight&&(i(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bodyLeft&&(i(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bodyRight&&(i(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bodyJoin&&(i(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.headerJoin&&(i(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinBody&&(i(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinLeft&&(i(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinRight&&(i(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinJoin&&(i(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:l})||(c=null===c?i.errors:c.concat(i.errors),u=c.length))}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===c?c=[e]:c.push(e),u++}return o.errors=c,0===u}const s={type:"string",enum:["left","right","center","justify"]};function l(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:a=e}={}){let i=null,o=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===i?i=[e]:i.push(e),o++}if("left"!==e&&"right"!==e&&"center"!==e&&"justify"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:s.enum},message:"must be equal to one of the allowed values"};null===i?i=[e]:i.push(e),o++}return l.errors=i,0===o}r(15966).Z;const c=new RegExp("^[0-9]+$","u"),u={type:"object",properties:{alignment:{$ref:"#/definitions/alignment"},verticalAlignment:{type:"string",enum:["top","middle","bottom"]},width:{type:"integer",minimum:1},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},additionalProperties:!1};function f(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:a=e}={}){let i=null,o=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===i?i=[e]:i.push(e),o++}if("left"!==e&&"right"!==e&&"center"!==e&&"justify"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:s.enum},message:"must be equal to one of the allowed values"};null===i?i=[e]:i.push(e),o++}return f.errors=i,0===o}function p(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:a=e}={}){let i=null,o=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const r in e)if("alignment"!==r&&"verticalAlignment"!==r&&"width"!==r&&"wrapWord"!==r&&"truncate"!==r&&"paddingLeft"!==r&&"paddingRight"!==r){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};null===i?i=[e]:i.push(e),o++}if(void 0!==e.alignment&&(f(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:a})||(i=null===i?f.errors:i.concat(f.errors),o=i.length)),void 0!==e.verticalAlignment){let r=e.verticalAlignment;if("string"!=typeof r){const e={instancePath:t+"/verticalAlignment",schemaPath:"#/properties/verticalAlignment/type",keyword:"type",params:{type:"string"},message:"must be string"};null===i?i=[e]:i.push(e),o++}if("top"!==r&&"middle"!==r&&"bottom"!==r){const e={instancePath:t+"/verticalAlignment",schemaPath:"#/properties/verticalAlignment/enum",keyword:"enum",params:{allowedValues:u.properties.verticalAlignment.enum},message:"must be equal to one of the allowed values"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.width){let r=e.width;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}if("number"==typeof r&&isFinite(r)&&(r<1||isNaN(r))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===i?i=[e]:i.push(e),o++}if(void 0!==e.truncate){let r=e.truncate;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.paddingLeft){let r=e.paddingLeft;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.paddingRight){let r=e.paddingRight;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===i?i=[e]:i.push(e),o++}return p.errors=i,0===o}function h(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:a=e}={}){let i=null,o=0;const s=o;let l=!1,u=null;const f=o;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const r in e)if(!c.test(r)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};null===i?i=[e]:i.push(e),o++}for(const r in e)c.test(r)&&(p(e[r],{instancePath:t+"/"+r.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:r,rootData:a})||(i=null===i?p.errors:i.concat(p.errors),o=i.length))}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};null===i?i=[e]:i.push(e),o++}f===o&&(l=!0,u=0);const d=o;if(Array.isArray(e)){const r=e.length;for(let n=0;n<r;n++)p(e[n],{instancePath:t+"/"+n,parentData:e,parentDataProperty:n,rootData:a})||(i=null===i?p.errors:i.concat(p.errors),o=i.length)}else{const e={instancePath:t,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};null===i?i=[e]:i.push(e),o++}var m;if((m=d===o)&&l?(l=!1,u=[u,1]):m&&(l=!0,u=1),l)o=s,null!==i&&(s?i.length=s:i=null);else{const e={instancePath:t,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:u},message:"must match exactly one schema in oneOf"};null===i?i=[e]:i.push(e),o++}return h.errors=i,0===o}function d(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:a=e}={}){let i=null,o=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const r in e)if("alignment"!==r&&"verticalAlignment"!==r&&"width"!==r&&"wrapWord"!==r&&"truncate"!==r&&"paddingLeft"!==r&&"paddingRight"!==r){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};null===i?i=[e]:i.push(e),o++}if(void 0!==e.alignment&&(f(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:a})||(i=null===i?f.errors:i.concat(f.errors),o=i.length)),void 0!==e.verticalAlignment){let r=e.verticalAlignment;if("string"!=typeof r){const e={instancePath:t+"/verticalAlignment",schemaPath:"#/properties/verticalAlignment/type",keyword:"type",params:{type:"string"},message:"must be string"};null===i?i=[e]:i.push(e),o++}if("top"!==r&&"middle"!==r&&"bottom"!==r){const e={instancePath:t+"/verticalAlignment",schemaPath:"#/properties/verticalAlignment/enum",keyword:"enum",params:{allowedValues:u.properties.verticalAlignment.enum},message:"must be equal to one of the allowed values"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.width){let r=e.width;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}if("number"==typeof r&&isFinite(r)&&(r<1||isNaN(r))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===i?i=[e]:i.push(e),o++}if(void 0!==e.truncate){let r=e.truncate;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.paddingLeft){let r=e.paddingLeft;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.paddingRight){let r=e.paddingRight;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===i?i=[e]:i.push(e),o++}return d.errors=i,0===o}function m(e,{instancePath:t="",parentData:r,parentDataProperty:o,rootData:s=e}={}){let l=null,c=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const r in e)if(!a.call(n,r)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};null===l?l=[e]:l.push(e),c++}void 0!==e.topBody&&(i(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.topJoin&&(i(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.topLeft&&(i(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.topRight&&(i(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.bottomBody&&(i(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.bottomJoin&&(i(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.bottomLeft&&(i(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.bottomRight&&(i(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.bodyLeft&&(i(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.bodyRight&&(i(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.bodyJoin&&(i(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.headerJoin&&(i(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.joinBody&&(i(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.joinLeft&&(i(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.joinRight&&(i(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length)),void 0!==e.joinJoin&&(i(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:s})||(l=null===l?i.errors:l.concat(i.errors),c=l.length))}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===l?l=[e]:l.push(e),c++}return m.errors=l,0===c}function g(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:a=e}={}){let i=null,o=0;const s=o;let l=!1,u=null;const f=o;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const r in e)if(!c.test(r)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};null===i?i=[e]:i.push(e),o++}for(const r in e)c.test(r)&&(p(e[r],{instancePath:t+"/"+r.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:r,rootData:a})||(i=null===i?p.errors:i.concat(p.errors),o=i.length))}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};null===i?i=[e]:i.push(e),o++}f===o&&(l=!0,u=0);const h=o;if(Array.isArray(e)){const r=e.length;for(let n=0;n<r;n++)p(e[n],{instancePath:t+"/"+n,parentData:e,parentDataProperty:n,rootData:a})||(i=null===i?p.errors:i.concat(p.errors),o=i.length)}else{const e={instancePath:t,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};null===i?i=[e]:i.push(e),o++}var d;if((d=h===o)&&l?(l=!1,u=[u,1]):d&&(l=!0,u=1),l)o=s,null!==i&&(s?i.length=s:i=null);else{const e={instancePath:t,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:u},message:"must match exactly one schema in oneOf"};null===i?i=[e]:i.push(e),o++}return g.errors=i,0===o}function y(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:a=e}={}){let i=null,o=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const r in e)if("alignment"!==r&&"verticalAlignment"!==r&&"width"!==r&&"wrapWord"!==r&&"truncate"!==r&&"paddingLeft"!==r&&"paddingRight"!==r){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};null===i?i=[e]:i.push(e),o++}if(void 0!==e.alignment&&(f(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:a})||(i=null===i?f.errors:i.concat(f.errors),o=i.length)),void 0!==e.verticalAlignment){let r=e.verticalAlignment;if("string"!=typeof r){const e={instancePath:t+"/verticalAlignment",schemaPath:"#/properties/verticalAlignment/type",keyword:"type",params:{type:"string"},message:"must be string"};null===i?i=[e]:i.push(e),o++}if("top"!==r&&"middle"!==r&&"bottom"!==r){const e={instancePath:t+"/verticalAlignment",schemaPath:"#/properties/verticalAlignment/enum",keyword:"enum",params:{allowedValues:u.properties.verticalAlignment.enum},message:"must be equal to one of the allowed values"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.width){let r=e.width;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}if("number"==typeof r&&isFinite(r)&&(r<1||isNaN(r))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===i?i=[e]:i.push(e),o++}if(void 0!==e.truncate){let r=e.truncate;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.paddingLeft){let r=e.paddingLeft;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}}if(void 0!==e.paddingRight){let r=e.paddingRight;if("number"!=typeof r||r%1||isNaN(r)||!isFinite(r)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),o++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===i?i=[e]:i.push(e),o++}return y.errors=i,0===o}t["streamConfig.json"]=function e(t,{instancePath:r="",parentData:n,parentDataProperty:a,rootData:i=t}={}){let o=null,s=0;if(t&&"object"==typeof t&&!Array.isArray(t)){if(void 0===t.columnDefault){const e={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnDefault"},message:"must have required property 'columnDefault'"};null===o?o=[e]:o.push(e),s++}if(void 0===t.columnCount){const e={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnCount"},message:"must have required property 'columnCount'"};null===o?o=[e]:o.push(e),s++}for(const e in t)if("border"!==e&&"columns"!==e&&"columnDefault"!==e&&"columnCount"!==e&&"drawVerticalLine"!==e){const t={instancePath:r,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"};null===o?o=[t]:o.push(t),s++}if(void 0!==t.border&&(m(t.border,{instancePath:r+"/border",parentData:t,parentDataProperty:"border",rootData:i})||(o=null===o?m.errors:o.concat(m.errors),s=o.length)),void 0!==t.columns&&(g(t.columns,{instancePath:r+"/columns",parentData:t,parentDataProperty:"columns",rootData:i})||(o=null===o?g.errors:o.concat(g.errors),s=o.length)),void 0!==t.columnDefault&&(y(t.columnDefault,{instancePath:r+"/columnDefault",parentData:t,parentDataProperty:"columnDefault",rootData:i})||(o=null===o?y.errors:o.concat(y.errors),s=o.length)),void 0!==t.columnCount){let e=t.columnCount;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:r+"/columnCount",schemaPath:"#/properties/columnCount/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}if("number"==typeof e&&isFinite(e)&&(e<1||isNaN(e))){const e={instancePath:r+"/columnCount",schemaPath:"#/properties/columnCount/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===o?o=[e]:o.push(e),s++}}if(void 0!==t.drawVerticalLine&&"function"!=typeof t.drawVerticalLine){const e={instancePath:r+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'should pass "typeof" keyword validation'};null===o?o=[e]:o.push(e),s++}}else{const e={instancePath:r,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===o?o=[e]:o.push(e),s++}return e.errors=o,0===s}},26247:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBorderCharacters=void 0,t.getBorderCharacters=e=>{if("honeywell"===e)return{topBody:"═",topJoin:"╤",topLeft:"╔",topRight:"╗",bottomBody:"═",bottomJoin:"╧",bottomLeft:"╚",bottomRight:"╝",bodyLeft:"║",bodyRight:"║",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"╟",joinRight:"╢",joinJoin:"┼"};if("norc"===e)return{topBody:"─",topJoin:"┬",topLeft:"┌",topRight:"┐",bottomBody:"─",bottomJoin:"┴",bottomLeft:"└",bottomRight:"┘",bodyLeft:"│",bodyRight:"│",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"├",joinRight:"┤",joinJoin:"┼"};if("ramac"===e)return{topBody:"-",topJoin:"+",topLeft:"+",topRight:"+",bottomBody:"-",bottomJoin:"+",bottomLeft:"+",bottomRight:"+",bodyLeft:"|",bodyRight:"|",bodyJoin:"|",headerJoin:"+",joinBody:"-",joinLeft:"|",joinRight:"|",joinJoin:"|"};if("void"===e)return{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"",bodyRight:"",bodyJoin:"",headerJoin:"",joinBody:"",joinLeft:"",joinRight:"",joinJoin:""};throw new Error('Unknown border template "'+e+'".')}},3539:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.getBorderCharacters=t.createStream=t.table=void 0;const i=r(88220);Object.defineProperty(t,"createStream",{enumerable:!0,get:function(){return i.createStream}});const o=r(26247);Object.defineProperty(t,"getBorderCharacters",{enumerable:!0,get:function(){return o.getBorderCharacters}});const s=r(53601);Object.defineProperty(t,"table",{enumerable:!0,get:function(){return s.table}}),a(r(79068),t)},17793:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.makeStreamConfig=void 0;const a=n(r(76267)),i=r(8318),o=r(83565),s=(e,t={},r)=>Array.from({length:e}).map(((e,n)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",wrapWord:!1,...r,...t[n]})));t.makeStreamConfig=e=>{o.validateConfig("streamConfig.json",e);const t=a.default(e);if(void 0===t.columnDefault.width)throw new Error("Must provide config.columnDefault.width when creating a stream.");return{drawVerticalLine:()=>!0,...t,border:i.makeBorderConfig(t.border),columns:s(t.columnCount,t.columns,t.columnDefault)}}},73895:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.makeTableConfig=void 0;const a=n(r(76267)),i=n(r(42290)),o=r(8318),s=r(83565),l=(e,t,r)=>{const n=i.default(e);return e[0].map(((e,a)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",width:n[a],wrapWord:!1,...r,...null==t?void 0:t[a]})))},c=e=>{if(e.header)return{alignment:"center",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,wrapWord:!1,...e.header}};t.makeTableConfig=(e,t={})=>{var r,n,i;s.validateConfig("config.json",t);const u=a.default(t);return{...u,border:o.makeBorderConfig(u.border),columns:l(e,u.columns,u.columnDefault),drawHorizontalLine:null!==(r=u.drawHorizontalLine)&&void 0!==r?r:()=>!0,drawVerticalLine:null!==(n=u.drawVerticalLine)&&void 0!==n?n:()=>!0,header:c(u),singleLine:null!==(i=u.singleLine)&&void 0!==i&&i}}},69305:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapDataUsingRowHeights=void 0;const n=r(97987),a=e=>new Array(e).fill("");t.mapDataUsingRowHeights=(e,t,r)=>{const i=e[0].length;return o=e.map(((e,o)=>{const s=t[o],l=Array.from({length:s},(()=>new Array(i).fill("")));return e.forEach(((e,t)=>{((e,t,r)=>{const{verticalAlignment:n}=r,i=t-e.length;return"top"===n?[...e,...a(i)]:"bottom"===n?[...a(i),...e]:[...a(Math.floor(i/2)),...e,...a(Math.ceil(i/2))]})(n.wrapCell(e,r.columns[t].width,r.columns[t].wrapWord),s,r.columns[t]).forEach(((e,r)=>{l[r][t]=e}))})),l})),[].concat(...o);var o}},5669:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.padTableData=t.padString=void 0,t.padString=(e,t,r)=>" ".repeat(t)+e+" ".repeat(r),t.padTableData=(e,r)=>e.map((e=>e.map(((e,n)=>{const{paddingLeft:a,paddingRight:i}=r.columns[n];return t.padString(e,a,i)}))))},772:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringifyTableData=void 0;const n=r(8318);t.stringifyTableData=e=>e.map((e=>e.map((e=>n.normalizeString(String(e))))))},53601:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.table=void 0;const n=r(78627),a=r(70839),i=r(38498),o=r(31567),s=r(73895),l=r(69305),c=r(5669),u=r(772),f=r(43373),p=r(72074);t.table=(e,t={})=>{p.validateTableData(e);let r=u.stringifyTableData(e);const h=s.makeTableConfig(r,t);r=f.truncateTableData(r,h);const d=i.calculateRowHeights(r,h);r=l.mapDataUsingRowHeights(r,d,h),r=n.alignTableData(r,h),r=c.padTableData(r,h);const m=a.calculateCellWidths(r[0]);return o.drawTable(r,m,d,h)}},43373:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.truncateTableData=t.truncateString=void 0;const a=n(r(5232));t.truncateString=(e,t)=>a.default(e,{length:t,omission:"…"}),t.truncateTableData=(e,r)=>e.map((e=>e.map(((e,n)=>t.truncateString(e,r.columns[n].truncate)))))},79068:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8318:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.distributeUnevenly=t.countSpaceSequence=t.groupBySizes=t.makeBorderConfig=t.splitAnsi=t.normalizeString=void 0;const a=n(r(44081)),i=n(r(31279)),o=n(r(31862)),s=r(26247);t.normalizeString=e=>e.replace(/\r\n/g,"\n"),t.splitAnsi=e=>{const t=o.default(e).split("\n").map(i.default),r=[];let n=0;return t.forEach((t=>{r.push(0===t?"":a.default(e,n,n+t)),n+=t+1})),r},t.makeBorderConfig=e=>({...s.getBorderCharacters("honeywell"),...e}),t.groupBySizes=(e,t)=>{let r=0;return t.map((t=>{const n=e.slice(r,r+t);return r+=t,n}))},t.countSpaceSequence=e=>{var t,r;return null!==(r=null===(t=e.match(/\s+/g))||void 0===t?void 0:t.length)&&void 0!==r?r:0},t.distributeUnevenly=(e,t)=>Array.from({length:t}).fill(Math.floor(e/t)).map(((r,n)=>r+(n<e%t?1:0)))},83565:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validateConfig=void 0;const a=n(r(89670));t.validateConfig=(e,t)=>{const r=a.default[e];if(!r(t)&&r.errors){const e=r.errors.map((e=>({message:e.message,params:e.params,schemaPath:e.schemaPath})));throw console.log("config",t),console.log("errors",e),new Error("Invalid config.")}}},72074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTableData=void 0;const n=r(8318);t.validateTableData=e=>{if(!Array.isArray(e))throw new TypeError("Table data must be an array.");if(0===e.length)throw new Error("Table must define at least one row.");if(0===e[0].length)throw new Error("Table must define at least one column.");const t=e[0].length;for(const r of e){if(!Array.isArray(r))throw new TypeError("Table row data must be an array.");if(r.length!==t)throw new Error("Table must have a consistent number of cells.");for(const e of r)if(/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test(n.normalizeString(String(e))))throw new Error("Table data must not contain control characters.")}}},97987:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapCell=void 0;const n=r(8318),a=r(14730),i=r(74982);t.wrapCell=(e,t,r)=>{const o=n.splitAnsi(e);for(let e=0;e<o.length;){let n;n=r?i.wrapWord(o[e],t):a.wrapString(o[e],t),o.splice(e,1,...n),e+=n.length}return o}},14730:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapString=void 0;const a=n(r(44081)),i=n(r(31279));t.wrapString=(e,t)=>{let r=e;const n=[];do{n.push(a.default(r,0,t)),r=a.default(r,t).trim()}while(i.default(r));return n}},74982:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapWord=void 0;const a=n(r(44081)),i=n(r(31862));t.wrapWord=(e,t)=>{const r=[];let n=0;return((e,t)=>{let r=i.default(e);const n=[],a=new RegExp("(^.{1,"+String(t)+"}(\\s+|$))|(^.{1,"+String(t-1)+"}(\\\\|/|_|\\.|,|;|-))");do{let e;const i=a.exec(r);if(i){e=i[0],r=r.slice(e.length);const t=e.trim().length,a=e.length-t;n.push([t,a])}else e=r.slice(0,t),r=r.slice(t),n.push([e.length,0])}while(r.length);return n})(e,t).forEach((([t,i])=>{r.push(a.default(e,n,n+t)),n+=t+i})),r}},15966:(e,t,r)=>{"use strict";const n=r(78011);n.code='require("ajv/dist/runtime/equal").default',t.Z=n},7906:e=>{function t(){}t.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function a(){n.off(e,a),t.apply(r,arguments)}return a._=t,this.on(e,a,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,a=r.length;n<a;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),n=r[e],a=[];if(n&&t)for(var i=0,o=n.length;i<o;i++)n[i].fn!==t&&n[i].fn._!==t&&a.push(n[i]);return a.length?r[e]=a:delete r[e],this}},e.exports=t,e.exports.TinyEmitter=t},54116:function(e,t){"use strict";var r,n;r=function(){function e(){return!0}function t(){return!1}function r(){}return function n(){var a=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:function(e){return"object"==typeof e&&null!==e&&e.constructor===Object}},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],i={name:"any",test:e},o=[],s=[],l={types:a,conversions:s,ignore:o};function c(e){var t=z(l.types,(function(t){return t.name===e}));if(t)return t;if("any"===e)return i;var r=z(l.types,(function(t){return t.name.toLowerCase()===e.toLowerCase()}));throw new TypeError('Unknown type "'+e+'"'+(r?'. Did you mean "'+r.name+'"?':""))}function u(e){return e===i?999:l.types.indexOf(e)}function f(e){var t=z(l.types,(function(t){return t.test(e)}));if(t)return t.name;throw new TypeError("Value has unknown type. Value: "+e)}function p(e){return e.map((function(e){var t=e.types.map(x);return(e.restParam?"...":"")+t.join("|")})).join(",")}function h(e,t){var r=0===e.indexOf("..."),n=(r?e.length>3?e.slice(3):"any":e).split("|").map(O).filter(I).filter(N),a=function(e,t){var r={};return e.forEach((function(e){-1!==t.indexOf(e.from)||-1===t.indexOf(e.to)||r[e.from]||(r[e.from]=e)})),Object.keys(r).map((function(e){return r[e]}))}(t,n),i=n.map((function(e){var t=c(e);return{name:e,typeIndex:u(t),test:t.test,conversion:null,conversionIndex:-1}})),o=a.map((function(e){var r=c(e.from);return{name:e.from,typeIndex:u(r),test:r.test,conversion:e,conversionIndex:t.indexOf(e)}}));return{types:i.concat(o),restParam:r}}function d(e){var t=L(e);return!!t&&t.restParam}function m(e){return e.types.some((function(e){return null!=e.conversion}))}function g(t){if(t&&0!==t.types.length){if(1===t.types.length)return c(t.types[0].name).test;if(2===t.types.length){var r=c(t.types[0].name).test,n=c(t.types[1].name).test;return function(e){return r(e)||n(e)}}var a=t.types.map((function(e){return c(e.name).test}));return function(e){for(var t=0;t<a.length;t++)if(a[t](e))return!0;return!1}}return e}function y(e){var t,r,n,a;if(d(e)){var i=(t=(a=e,a.slice(0,a.length-1)).map(g)).length,o=g(L(e));return function(e){for(var r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return function(e){for(var t=i;t<e.length;t++)if(!o(e[t]))return!1;return!0}(e)&&e.length>=i+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(r=g(e[0]),function(e){return r(e[0])&&1===e.length}):2===e.length?(r=g(e[0]),n=g(e[1]),function(e){return r(e[0])&&n(e[1])&&2===e.length}):(t=e.map(g),function(e){for(var r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return e.length===t.length})}function v(e,t){return t<e.params.length?e.params[t]:d(e.params)?L(e.params):null}function b(e,t,r){var n=v(e,t);return(n?r?n.types.filter(_):n.types:[]).map(x)}function x(e){return e.name}function _(e){return null===e.conversion||void 0===e.conversion}function w(e,t){var r=function(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!0;return Object.keys(t)}(j(e,(function(e){return b(e,t,!1)})));return-1!==r.indexOf("any")?["any"]:r}function k(e,t,r){var n,a,i,o=e||"unnamed",s=r;for(i=0;i<t.length;i++){var l=s.filter((function(e){var r=g(v(e,i));return(i<e.params.length||d(e.params))&&r(t[i])}));if(0===l.length){if((a=w(s,i)).length>0){var c=f(t[i]);return(n=new TypeError("Unexpected type of argument in function "+o+" (expected: "+a.join(" or ")+", actual: "+c+", index: "+i+")")).data={category:"wrongType",fn:o,index:i,actual:c,expected:a},n}}else s=l}var u=s.map((function(e){return d(e.params)?1/0:e.params.length}));if(t.length<Math.min.apply(null,u))return a=w(s,i),(n=new TypeError("Too few arguments in function "+o+" (expected: "+a.join(" or ")+", index: "+t.length+")")).data={category:"tooFewArgs",fn:o,index:t.length,expected:a},n;var p=Math.max.apply(null,u);return t.length>p?((n=new TypeError("Too many arguments in function "+o+" (expected: "+p+", actual: "+t.length+")")).data={category:"tooManyArgs",fn:o,index:t.length,expectedLength:p},n):((n=new TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+o+".")).data={category:"mismatch",actual:t.map(f)},n)}function D(e){for(var t=999,r=0;r<e.types.length;r++)_(e.types[r])&&(t=Math.min(t,e.types[r].typeIndex));return t}function T(e){for(var t=999,r=0;r<e.types.length;r++)_(e.types[r])||(t=Math.min(t,e.types[r].conversionIndex));return t}function A(e,t){var r;return 0!=(r=e.restParam-t.restParam)||0!=(r=m(e)-m(t))||0!=(r=D(e)-D(t))?r:T(e)-T(t)}function S(e,t){var r,n,a=Math.min(e.params.length,t.params.length);if(0!=(n=e.params.some(m)-t.params.some(m)))return n;for(r=0;r<a;r++)if(0!=(n=m(e.params[r])-m(t.params[r])))return n;for(r=0;r<a;r++)if(0!==(n=A(e.params[r],t.params[r])))return n;return e.params.length-t.params.length}function M(e){var t,r,n,a,i=[],o=[];switch(e.types.forEach((function(e){e.conversion&&(i.push(c(e.conversion.from).test),o.push(e.conversion.convert))})),o.length){case 0:return function(e){return e};case 1:return t=i[0],n=o[0],function(e){return t(e)?n(e):e};case 2:return t=i[0],r=i[1],n=o[0],a=o[1],function(e){return t(e)?n(e):r(e)?a(e):e};default:return function(e){for(var t=0;t<o.length;t++)if(i[t](e))return o[t](e);return e}}}function E(e,t){return function e(r,n,a){if(n<r.length){var i,o=r[n],s=t?o.types.filter(_):o.types;if(o.restParam){var l=s.filter(_);i=l.length<s.length?[l,s]:[s]}else i=s.map((function(e){return[e]}));return j(i,(function(t){return e(r,n+1,a.concat([t]))}))}return[a.map((function(e,t){return{types:e,restParam:t===r.length-1&&d(r)}}))]}(e,0,[])}function C(e,n){if(0===Object.keys(n).length)throw new SyntaxError("No signatures provided");var a=[];Object.keys(n).map((function(e){return function(e,t,r){var n=[];return""!==e.trim()&&(n=e.split(",").map(O).map((function(e,t,n){var a=h(e,r);if(a.restParam&&t!==n.length-1)throw new SyntaxError('Unexpected rest parameter "'+e+'": only allowed for the last parameter');return a}))),n.some(R)?null:{params:n,fn:t}}(e,n[e],l.conversions)})).filter(P).forEach((function(e){var t=z(a,(function(t){return function(e,t){for(var r=Math.max(e.params.length,t.params.length),n=0;n<r;n++)if(!B(b(e,n,!0),b(t,n,!0)))return!1;var a=e.params.length,i=t.params.length,o=d(e.params),s=d(t.params);return o?s?a===i:i>=a:s?a>=i:a===i}(t,e)}));if(t)throw new TypeError('Conflicting signatures "'+p(t.params)+'" and "'+p(e.params)+'".');a.push(e)}));var i=j(a,(function(e){return(e?E(e.params,!1):[]).map((function(t){return{params:t,fn:e.fn}}))})).filter(P);i.sort(S);var o=i[0]&&i[0].params.length<=2&&!d(i[0].params),s=i[1]&&i[1].params.length<=2&&!d(i[1].params),c=i[2]&&i[2].params.length<=2&&!d(i[2].params),u=i[3]&&i[3].params.length<=2&&!d(i[3].params),f=i[4]&&i[4].params.length<=2&&!d(i[4].params),v=i[5]&&i[5].params.length<=2&&!d(i[5].params),x=o&&s&&c&&u&&f&&v,_=i.map((function(e){return y(e.params)})),w=o?g(i[0].params[0]):t,D=s?g(i[1].params[0]):t,T=c?g(i[2].params[0]):t,A=u?g(i[3].params[0]):t,C=f?g(i[4].params[0]):t,N=v?g(i[5].params[0]):t,I=o?g(i[0].params[1]):t,L=s?g(i[1].params[1]):t,U=c?g(i[2].params[1]):t,$=u?g(i[3].params[1]):t,V=f?g(i[4].params[1]):t,q=v?g(i[5].params[1]):t,W=i.map((function(e){return function(e,t){var r=t;if(e.some(m)){var n=d(e),a=e.map(M);r=function(){for(var e=[],r=n?arguments.length-1:arguments.length,i=0;i<r;i++)e[i]=a[i](arguments[i]);return n&&(e[r]=arguments[r].map(a[r])),t.apply(this,e)}}var i=r;if(d(e)){var o=e.length-1;i=function(){return r.apply(this,F(arguments,0,o).concat([F(arguments,o)]))}}return i}(e.params,e.fn)})),H=o?W[0]:r,G=s?W[1]:r,X=c?W[2]:r,Y=u?W[3]:r,Z=f?W[4]:r,K=v?W[5]:r,J=o?i[0].params.length:-1,Q=s?i[1].params.length:-1,ee=c?i[2].params.length:-1,te=u?i[3].params.length:-1,re=f?i[4].params.length:-1,ne=v?i[5].params.length:-1,ae=x?6:0,ie=i.length,oe=function(){for(var t=ae;t<ie;t++)if(_[t](arguments))return W[t].apply(this,arguments);throw k(e,arguments,i)},se=function e(t,r){return arguments.length===J&&w(t)&&I(r)?H.apply(e,arguments):arguments.length===Q&&D(t)&&L(r)?G.apply(e,arguments):arguments.length===ee&&T(t)&&U(r)?X.apply(e,arguments):arguments.length===te&&A(t)&&$(r)?Y.apply(e,arguments):arguments.length===re&&C(t)&&V(r)?Z.apply(e,arguments):arguments.length===ne&&N(t)&&q(r)?K.apply(e,arguments):oe.apply(e,arguments)};try{Object.defineProperty(se,"name",{value:e})}catch(e){}return se.signatures=function(e){var t={};return e.forEach((function(e){e.params.some(m)||E(e.params,!0).forEach((function(r){t[p(r)]=e.fn}))})),t}(i),se}function N(e){return-1===l.ignore.indexOf(e)}function O(e){return e.trim()}function I(e){return!!e}function P(e){return null!==e}function R(e){return 0===e.types.length}function L(e){return e[e.length-1]}function F(e,t,r){return Array.prototype.slice.call(e,t,r)}function B(e,t){for(var r=0;r<e.length;r++)if(n=t,a=e[r],-1!==n.indexOf(a))return!0;var n,a;return!1}function z(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function j(e,t){return Array.prototype.concat.apply([],e.map(t))}function U(e){for(var t="",r=0;r<e.length;r++){var n=e[r];if(("object"==typeof n.signatures||"string"==typeof n.signature)&&""!==n.name)if(""===t)t=n.name;else if(t!==n.name){var a=new Error("Function names do not match (expected: "+t+", actual: "+n.name+")");throw a.data={actual:n.name,expected:t},a}}return t}function $(e){var t,r={};function n(e,n){if(r.hasOwnProperty(e)&&n!==r[e])throw(t=new Error('Signature "'+e+'" is defined twice')).data={signature:e},t}for(var a=0;a<e.length;a++){var i=e[a];if("object"==typeof i.signatures)for(var o in i.signatures)i.signatures.hasOwnProperty(o)&&(n(o,i.signatures[o]),r[o]=i.signatures[o]);else{if("string"!=typeof i.signature)throw(t=new TypeError("Function is no typed-function (index: "+a+")")).data={index:a},t;n(i.signature,i),r[i.signature]=i}}return r}return(l=C("typed",{"string, Object":C,Object:function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return C(U(t),e)},"...Function":function(e){return C(U(e),$(e))},"string, ...Function":function(e,t){return C(e,$(t))}})).create=n,l.types=a,l.conversions=s,l.ignore=o,l.convert=function(e,t){var r=f(e);if(t===r)return e;for(var n=0;n<l.conversions.length;n++){var a=l.conversions[n];if(a.from===r&&a.to===t)return a.convert(e)}throw new Error("Cannot convert from "+r+" to "+t)},l.find=function(e,t){if(!e.signatures)throw new TypeError("Function is no typed-function");var r;if("string"==typeof t){r=t.split(",");for(var n=0;n<r.length;n++)r[n]=r[n].trim()}else{if(!Array.isArray(t))throw new TypeError("String array or a comma separated string expected");r=t}var a=r.join(","),i=e.signatures[a];if(i)return i;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+r.join(", ")+"))")},l.addType=function(e,t){if(!e||"string"!=typeof e.name||"function"!=typeof e.test)throw new TypeError("Object with properties {name: string, test: function} expected");if(!1!==t)for(var r=0;r<l.types.length;r++)if("Object"===l.types[r].name)return void l.types.splice(r,0,e);l.types.push(e)},l.addConversion=function(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");l.conversions.push(e)},l}()},void 0===(n=r.apply(t,[]))||(e.exports=n)},1050:function(e){var t={version:"1.15.0"};t[437]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[620]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖܢ٥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[737]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[850]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[852]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[857]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[861]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[865]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[866]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[874]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[895]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ČüéďäĎŤčěĚĹÍľǪÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[932]=function(){var e,t=[],r={},n=[];for(n[0]="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~���������������������������������。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚��������������������������������".split(""),e=0;e!=n[0].length;++e)65533!==n[0][e].charCodeAt(0)&&(r[n[0][e]]=0+e,t[0+e]=n[0][e]);for(n[129]="���������������������������������������������������������������� 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈〉《》「」『』【】+-±×�÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓�����������∈∋⊆⊇⊂⊃∪∩��������∧∨¬⇒⇔∀∃�����������∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬�������ʼn♯♭♪†‡¶����◯���".split(""),e=0;e!=n[129].length;++e)65533!==n[129][e].charCodeAt(0)&&(r[n[129][e]]=33024+e,t[33024+e]=n[129][e]);for(n[130]="�������������������������������������������������������������������������������0123456789�������ABCDEFGHIJKLMNOPQRSTUVWXYZ�������abcdefghijklmnopqrstuvwxyz����ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん��������������".split(""),e=0;e!=n[130].length;++e)65533!==n[130][e].charCodeAt(0)&&(r[n[130][e]]=33280+e,t[33280+e]=n[130][e]);for(n[131]="����������������������������������������������������������������ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミ�ムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ��������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω�����������������������������������������".split(""),e=0;e!=n[131].length;++e)65533!==n[131][e].charCodeAt(0)&&(r[n[131][e]]=33536+e,t[33536+e]=n[131][e]);for(n[132]="����������������������������������������������������������������АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмн�опрстуфхцчшщъыьэюя�������������─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂�����������������������������������������������������������������".split(""),e=0;e!=n[132].length;++e)65533!==n[132][e].charCodeAt(0)&&(r[n[132][e]]=33792+e,t[33792+e]=n[132][e]);for(n[135]="����������������������������������������������������������������①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ�㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡��������㍻�〝〟№㏍℡㊤㊥㊦㊧㊨㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪���������������������������������������������������������������������������������������������������".split(""),e=0;e!=n[135].length;++e)65533!==n[135][e].charCodeAt(0)&&(r[n[135][e]]=34560+e,t[34560+e]=n[135][e]);for(n[136]="���������������������������������������������������������������������������������������������������������������������������������������������������������������亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭���".split(""),e=0;e!=n[136].length;++e)65533!==n[136][e].charCodeAt(0)&&(r[n[136][e]]=34816+e,t[34816+e]=n[136][e]);for(n[137]="����������������������������������������������������������������院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円�園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改���".split(""),e=0;e!=n[137].length;++e)65533!==n[137][e].charCodeAt(0)&&(r[n[137][e]]=35072+e,t[35072+e]=n[137][e]);for(n[138]="����������������������������������������������������������������魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫�橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄���".split(""),e=0;e!=n[138].length;++e)65533!==n[138][e].charCodeAt(0)&&(r[n[138][e]]=35328+e,t[35328+e]=n[138][e]);for(n[139]="����������������������������������������������������������������機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救�朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈���".split(""),e=0;e!=n[139].length;++e)65533!==n[139][e].charCodeAt(0)&&(r[n[139][e]]=35584+e,t[35584+e]=n[139][e]);for(n[140]="����������������������������������������������������������������掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨�劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向���".split(""),e=0;e!=n[140].length;++e)65533!==n[140][e].charCodeAt(0)&&(r[n[140][e]]=35840+e,t[35840+e]=n[140][e]);for(n[141]="����������������������������������������������������������������后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降�項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷���".split(""),e=0;e!=n[141].length;++e)65533!==n[141][e].charCodeAt(0)&&(r[n[141][e]]=36096+e,t[36096+e]=n[141][e]);for(n[142]="����������������������������������������������������������������察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止�死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周���".split(""),e=0;e!=n[142].length;++e)65533!==n[142][e].charCodeAt(0)&&(r[n[142][e]]=36352+e,t[36352+e]=n[142][e]);for(n[143]="����������������������������������������������������������������宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳�準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾���".split(""),e=0;e!=n[143].length;++e)65533!==n[143][e].charCodeAt(0)&&(r[n[143][e]]=36608+e,t[36608+e]=n[143][e]);for(n[144]="����������������������������������������������������������������拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨�逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線���".split(""),e=0;e!=n[144].length;++e)65533!==n[144][e].charCodeAt(0)&&(r[n[144][e]]=36864+e,t[36864+e]=n[144][e]);for(n[145]="����������������������������������������������������������������繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻�操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只���".split(""),e=0;e!=n[145].length;++e)65533!==n[145][e].charCodeAt(0)&&(r[n[145][e]]=37120+e,t[37120+e]=n[145][e]);for(n[146]="����������������������������������������������������������������叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄�逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓���".split(""),e=0;e!=n[146].length;++e)65533!==n[146][e].charCodeAt(0)&&(r[n[146][e]]=37376+e,t[37376+e]=n[146][e]);for(n[147]="����������������������������������������������������������������邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬�凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入���".split(""),e=0;e!=n[147].length;++e)65533!==n[147][e].charCodeAt(0)&&(r[n[147][e]]=37632+e,t[37632+e]=n[147][e]);for(n[148]="����������������������������������������������������������������如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅�楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美���".split(""),e=0;e!=n[148].length;++e)65533!==n[148][e].charCodeAt(0)&&(r[n[148][e]]=37888+e,t[37888+e]=n[148][e]);for(n[149]="����������������������������������������������������������������鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷�斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋���".split(""),e=0;e!=n[149].length;++e)65533!==n[149][e].charCodeAt(0)&&(r[n[149][e]]=38144+e,t[38144+e]=n[149][e]);for(n[150]="����������������������������������������������������������������法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆�摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒���".split(""),e=0;e!=n[150].length;++e)65533!==n[150][e].charCodeAt(0)&&(r[n[150][e]]=38400+e,t[38400+e]=n[150][e]);for(n[151]="����������������������������������������������������������������諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲�沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯���".split(""),e=0;e!=n[151].length;++e)65533!==n[151][e].charCodeAt(0)&&(r[n[151][e]]=38656+e,t[38656+e]=n[151][e]);for(n[152]="����������������������������������������������������������������蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕��������������������������������������������弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲���".split(""),e=0;e!=n[152].length;++e)65533!==n[152][e].charCodeAt(0)&&(r[n[152][e]]=38912+e,t[38912+e]=n[152][e]);for(n[153]="����������������������������������������������������������������僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭�凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨���".split(""),e=0;e!=n[153].length;++e)65533!==n[153][e].charCodeAt(0)&&(r[n[153][e]]=39168+e,t[39168+e]=n[153][e]);for(n[154]="����������������������������������������������������������������咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸�噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩���".split(""),e=0;e!=n[154].length;++e)65533!==n[154][e].charCodeAt(0)&&(r[n[154][e]]=39424+e,t[39424+e]=n[154][e]);for(n[155]="����������������������������������������������������������������奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀�它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏���".split(""),e=0;e!=n[155].length;++e)65533!==n[155][e].charCodeAt(0)&&(r[n[155][e]]=39680+e,t[39680+e]=n[155][e]);for(n[156]="����������������������������������������������������������������廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠�怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛���".split(""),e=0;e!=n[156].length;++e)65533!==n[156][e].charCodeAt(0)&&(r[n[156][e]]=39936+e,t[39936+e]=n[156][e]);for(n[157]="����������������������������������������������������������������戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫�捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼���".split(""),e=0;e!=n[157].length;++e)65533!==n[157][e].charCodeAt(0)&&(r[n[157][e]]=40192+e,t[40192+e]=n[157][e]);for(n[158]="����������������������������������������������������������������曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎�梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣���".split(""),e=0;e!=n[158].length;++e)65533!==n[158][e].charCodeAt(0)&&(r[n[158][e]]=40448+e,t[40448+e]=n[158][e]);for(n[159]="����������������������������������������������������������������檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯�麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌���".split(""),e=0;e!=n[159].length;++e)65533!==n[159][e].charCodeAt(0)&&(r[n[159][e]]=40704+e,t[40704+e]=n[159][e]);for(n[224]="����������������������������������������������������������������漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝�烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱���".split(""),e=0;e!=n[224].length;++e)65533!==n[224][e].charCodeAt(0)&&(r[n[224][e]]=57344+e,t[57344+e]=n[224][e]);for(n[225]="����������������������������������������������������������������瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿�痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬���".split(""),e=0;e!=n[225].length;++e)65533!==n[225][e].charCodeAt(0)&&(r[n[225][e]]=57600+e,t[57600+e]=n[225][e]);for(n[226]="����������������������������������������������������������������磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰�窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆���".split(""),e=0;e!=n[226].length;++e)65533!==n[226][e].charCodeAt(0)&&(r[n[226][e]]=57856+e,t[57856+e]=n[226][e]);for(n[227]="����������������������������������������������������������������紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷�縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋���".split(""),e=0;e!=n[227].length;++e)65533!==n[227][e].charCodeAt(0)&&(r[n[227][e]]=58112+e,t[58112+e]=n[227][e]);for(n[228]="����������������������������������������������������������������隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤�艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈���".split(""),e=0;e!=n[228].length;++e)65533!==n[228][e].charCodeAt(0)&&(r[n[228][e]]=58368+e,t[58368+e]=n[228][e]);for(n[229]="����������������������������������������������������������������蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬�蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞���".split(""),e=0;e!=n[229].length;++e)65533!==n[229][e].charCodeAt(0)&&(r[n[229][e]]=58624+e,t[58624+e]=n[229][e]);for(n[230]="����������������������������������������������������������������襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧�諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊���".split(""),e=0;e!=n[230].length;++e)65533!==n[230][e].charCodeAt(0)&&(r[n[230][e]]=58880+e,t[58880+e]=n[230][e]);for(n[231]="����������������������������������������������������������������蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜�轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮���".split(""),e=0;e!=n[231].length;++e)65533!==n[231][e].charCodeAt(0)&&(r[n[231][e]]=59136+e,t[59136+e]=n[231][e]);for(n[232]="����������������������������������������������������������������錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙�閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰���".split(""),e=0;e!=n[232].length;++e)65533!==n[232][e].charCodeAt(0)&&(r[n[232][e]]=59392+e,t[59392+e]=n[232][e]);for(n[233]="����������������������������������������������������������������顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃�騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈���".split(""),e=0;e!=n[233].length;++e)65533!==n[233][e].charCodeAt(0)&&(r[n[233][e]]=59648+e,t[59648+e]=n[233][e]);for(n[234]="����������������������������������������������������������������鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯�黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙�������������������������������������������������������������������������������������������".split(""),e=0;e!=n[234].length;++e)65533!==n[234][e].charCodeAt(0)&&(r[n[234][e]]=59904+e,t[59904+e]=n[234][e]);for(n[237]="����������������������������������������������������������������纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏�塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱���".split(""),e=0;e!=n[237].length;++e)65533!==n[237][e].charCodeAt(0)&&(r[n[237][e]]=60672+e,t[60672+e]=n[237][e]);for(n[238]="����������������������������������������������������������������犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙�蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑��ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹ¬¦'"���".split(""),e=0;e!=n[238].length;++e)65533!==n[238][e].charCodeAt(0)&&(r[n[238][e]]=60928+e,t[60928+e]=n[238][e]);for(n[250]="����������������������������������������������������������������ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊�兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯���".split(""),e=0;e!=n[250].length;++e)65533!==n[250][e].charCodeAt(0)&&(r[n[250][e]]=64e3+e,t[64e3+e]=n[250][e]);for(n[251]="����������������������������������������������������������������涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神�祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙���".split(""),e=0;e!=n[251].length;++e)65533!==n[251][e].charCodeAt(0)&&(r[n[251][e]]=64256+e,t[64256+e]=n[251][e]);for(n[252]="����������������������������������������������������������������髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������".split(""),e=0;e!=n[252].length;++e)65533!==n[252][e].charCodeAt(0)&&(r[n[252][e]]=64512+e,t[64512+e]=n[252][e]);return{enc:r,dec:t}}(),t[936]=function(){var e,t=[],r={},n=[];for(n[0]="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�������������������������������������������������������������������������������������������������������������������������������".split(""),e=0;e!=n[0].length;++e)65533!==n[0][e].charCodeAt(0)&&(r[n[0][e]]=0+e,t[0+e]=n[0][e]);for(n[129]="����������������������������������������������������������������丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪乫乬乭乮乯乲乴乵乶乷乸乹乺乻乼乽乿亀亁亂亃亄亅亇亊�亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂伃伄伅伆伇伈伋伌伒伓伔伕伖伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾伿佀佁佂佄佅佇佈佉佊佋佌佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢�".split(""),e=0;e!=n[129].length;++e)65533!==n[129][e].charCodeAt(0)&&(r[n[129][e]]=33024+e,t[33024+e]=n[129][e]);for(n[130]="����������������������������������������������������������������侤侫侭侰侱侲侳侴侶侷侸侹侺侻侼侽侾俀俁係俆俇俈俉俋俌俍俒俓俔俕俖俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿倀倁倂倃倄倅倆倇倈倉倊�個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯倰倱倲倳倴倵倶倷倸倹倻倽倿偀偁偂偄偅偆偉偊偋偍偐偑偒偓偔偖偗偘偙偛偝偞偟偠偡偢偣偤偦偧偨偩偪偫偭偮偯偰偱偲偳側偵偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎傏傐傑傒傓傔傕傖傗傘備傚傛傜傝傞傟傠傡傢傤傦傪傫傭傮傯傰傱傳傴債傶傷傸傹傼�".split(""),e=0;e!=n[130].length;++e)65533!==n[130][e].charCodeAt(0)&&(r[n[130][e]]=33280+e,t[33280+e]=n[130][e]);for(n[131]="����������������������������������������������������������������傽傾傿僀僁僂僃僄僅僆僇僈僉僊僋僌働僎僐僑僒僓僔僕僗僘僙僛僜僝僞僟僠僡僢僣僤僥僨僩僪僫僯僰僱僲僴僶僷僸價僺僼僽僾僿儀儁儂儃億儅儈�儉儊儌儍儎儏儐儑儓儔儕儖儗儘儙儚儛儜儝儞償儠儢儣儤儥儦儧儨儩優儫儬儭儮儯儰儱儲儳儴儵儶儷儸儹儺儻儼儽儾兂兇兊兌兎兏児兒兓兗兘兙兛兝兞兟兠兡兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦冧冨冩冪冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒凓凔凕凖凗�".split(""),e=0;e!=n[131].length;++e)65533!==n[131][e].charCodeAt(0)&&(r[n[131][e]]=33536+e,t[33536+e]=n[131][e]);for(n[132]="����������������������������������������������������������������凘凙凚凜凞凟凢凣凥処凧凨凩凪凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄剅剆則剈剉剋剎剏剒剓剕剗剘�剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳剴創剶剷剸剹剺剻剼剾劀劃劄劅劆劇劉劊劋劌劍劎劏劑劒劔劕劖劗劘劙劚劜劤劥劦劧劮劯劰労劵劶劷劸効劺劻劼劽勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務勚勛勜勝勞勠勡勢勣勥勦勧勨勩勪勫勬勭勮勯勱勲勳勴勵勶勷勸勻勼勽匁匂匃匄匇匉匊匋匌匎�".split(""),e=0;e!=n[132].length;++e)65533!==n[132][e].charCodeAt(0)&&(r[n[132][e]]=33792+e,t[33792+e]=n[132][e]);for(n[133]="����������������������������������������������������������������匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯匰匱匲匳匴匵匶匷匸匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏�厐厑厒厓厔厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯厰厱厲厳厴厵厷厸厹厺厼厽厾叀參叄叅叆叇収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝呞呟呠呡呣呥呧呩呪呫呬呭呮呯呰呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡�".split(""),e=0;e!=n[133].length;++e)65533!==n[133][e].charCodeAt(0)&&(r[n[133][e]]=34048+e,t[34048+e]=n[133][e]);for(n[134]="����������������������������������������������������������������咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠員哢哣哤哫哬哯哰哱哴哵哶哷哸哹哻哾唀唂唃唄唅唈唊唋唌唍唎唒唓唕唖唗唘唙唚唜唝唞唟唡唥唦�唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋啌啍啎問啑啒啓啔啗啘啙啚啛啝啞啟啠啢啣啨啩啫啯啰啱啲啳啴啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠喡喢喣喤喥喦喨喩喪喫喬喭單喯喰喲喴営喸喺喼喿嗀嗁嗂嗃嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗嗘嗙嗚嗛嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸嗹嗺嗻嗼嗿嘂嘃嘄嘅�".split(""),e=0;e!=n[134].length;++e)65533!==n[134][e].charCodeAt(0)&&(r[n[134][e]]=34304+e,t[34304+e]=n[134][e]);for(n[135]="����������������������������������������������������������������嘆嘇嘊嘋嘍嘐嘑嘒嘓嘔嘕嘖嘗嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀噁噂噃噄噅噆噇噈噉噊噋噏噐噑噒噓噕噖噚噛噝噞噟噠噡�噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽噾噿嚀嚁嚂嚃嚄嚇嚈嚉嚊嚋嚌嚍嚐嚑嚒嚔嚕嚖嚗嚘嚙嚚嚛嚜嚝嚞嚟嚠嚡嚢嚤嚥嚦嚧嚨嚩嚪嚫嚬嚭嚮嚰嚱嚲嚳嚴嚵嚶嚸嚹嚺嚻嚽嚾嚿囀囁囂囃囄囅囆囇囈囉囋囌囍囎囏囐囑囒囓囕囖囘囙囜団囥囦囧囨囩囪囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國圌圍圎圏圐圑�".split(""),e=0;e!=n[135].length;++e)65533!==n[135][e].charCodeAt(0)&&(r[n[135][e]]=34560+e,t[34560+e]=n[135][e]);for(n[136]="����������������������������������������������������������������園圓圔圕圖圗團圙圚圛圝圞圠圡圢圤圥圦圧圫圱圲圴圵圶圷圸圼圽圿坁坃坄坅坆坈坉坋坒坓坔坕坖坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀�垁垇垈垉垊垍垎垏垐垑垔垕垖垗垘垙垚垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹垺垻垼垽垾垿埀埁埄埅埆埇埈埉埊埌埍埐埑埓埖埗埛埜埞埡埢埣埥埦埧埨埩埪埫埬埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥堦堧堨堩堫堬堭堮堯報堲堳場堶堷堸堹堺堻堼堽�".split(""),e=0;e!=n[136].length;++e)65533!==n[136][e].charCodeAt(0)&&(r[n[136][e]]=34816+e,t[34816+e]=n[136][e]);for(n[137]="����������������������������������������������������������������堾堿塀塁塂塃塅塆塇塈塉塊塋塎塏塐塒塓塕塖塗塙塚塛塜塝塟塠塡塢塣塤塦塧塨塩塪塭塮塯塰塱塲塳塴塵塶塷塸塹塺塻塼塽塿墂墄墆墇墈墊墋墌�墍墎墏墐墑墔墕墖増墘墛墜墝墠墡墢墣墤墥墦墧墪墫墬墭墮墯墰墱墲墳墴墵墶墷墸墹墺墻墽墾墿壀壂壃壄壆壇壈壉壊壋壌壍壎壏壐壒壓壔壖壗壘壙壚壛壜壝壞壟壠壡壢壣壥壦壧壨壩壪壭壯壱売壴壵壷壸壺壻壼壽壾壿夀夁夃夅夆夈変夊夋夌夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻�".split(""),e=0;e!=n[137].length;++e)65533!==n[137][e].charCodeAt(0)&&(r[n[137][e]]=35072+e,t[35072+e]=n[137][e]);for(n[138]="����������������������������������������������������������������夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛奜奝奞奟奡奣奤奦奧奨奩奪奫奬奭奮奯奰奱奲奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦�妧妬妭妰妱妳妴妵妶妷妸妺妼妽妿姀姁姂姃姄姅姇姈姉姌姍姎姏姕姖姙姛姞姟姠姡姢姤姦姧姩姪姫姭姮姯姰姱姲姳姴姵姶姷姸姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪娫娬娭娮娯娰娳娵娷娸娹娺娻娽娾娿婁婂婃婄婅婇婈婋婌婍婎婏婐婑婒婓婔婖婗婘婙婛婜婝婞婟婠�".split(""),e=0;e!=n[138].length;++e)65533!==n[138][e].charCodeAt(0)&&(r[n[138][e]]=35328+e,t[35328+e]=n[138][e]);for(n[139]="����������������������������������������������������������������婡婣婤婥婦婨婩婫婬婭婮婯婰婱婲婳婸婹婻婼婽婾媀媁媂媃媄媅媆媇媈媉媊媋媌媍媎媏媐媑媓媔媕媖媗媘媙媜媝媞媟媠媡媢媣媤媥媦媧媨媩媫媬�媭媮媯媰媱媴媶媷媹媺媻媼媽媿嫀嫃嫄嫅嫆嫇嫈嫊嫋嫍嫎嫏嫐嫑嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬嫭嫮嫯嫰嫲嫳嫴嫵嫶嫷嫸嫹嫺嫻嫼嫽嫾嫿嬀嬁嬂嬃嬄嬅嬆嬇嬈嬊嬋嬌嬍嬎嬏嬐嬑嬒嬓嬔嬕嬘嬙嬚嬛嬜嬝嬞嬟嬠嬡嬢嬣嬤嬥嬦嬧嬨嬩嬪嬫嬬嬭嬮嬯嬰嬱嬳嬵嬶嬸嬹嬺嬻嬼嬽嬾嬿孁孂孃孄孅孆孇�".split(""),e=0;e!=n[139].length;++e)65533!==n[139][e].charCodeAt(0)&&(r[n[139][e]]=35584+e,t[35584+e]=n[139][e]);for(n[140]="����������������������������������������������������������������孈孉孊孋孌孍孎孏孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏�寑寔寕寖寗寘寙寚寛寜寠寢寣實寧審寪寫寬寭寯寱寲寳寴寵寶寷寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧屨屩屪屫屬屭屰屲屳屴屵屶屷屸屻屼屽屾岀岃岄岅岆岇岉岊岋岎岏岒岓岕岝岞岟岠岡岤岥岦岧岨�".split(""),e=0;e!=n[140].length;++e)65533!==n[140][e].charCodeAt(0)&&(r[n[140][e]]=35840+e,t[35840+e]=n[140][e]);for(n[141]="����������������������������������������������������������������岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅峆峇峈峉峊峌峍峎峏峐峑峓峔峕峖峗峘峚峛峜峝峞峟峠峢峣峧峩峫峬峮峯峱峲峳峴峵島峷峸峹峺峼峽峾峿崀�崁崄崅崈崉崊崋崌崍崏崐崑崒崓崕崗崘崙崚崜崝崟崠崡崢崣崥崨崪崫崬崯崰崱崲崳崵崶崷崸崹崺崻崼崿嵀嵁嵂嵃嵄嵅嵆嵈嵉嵍嵎嵏嵐嵑嵒嵓嵔嵕嵖嵗嵙嵚嵜嵞嵟嵠嵡嵢嵣嵤嵥嵦嵧嵨嵪嵭嵮嵰嵱嵲嵳嵵嵶嵷嵸嵹嵺嵻嵼嵽嵾嵿嶀嶁嶃嶄嶅嶆嶇嶈嶉嶊嶋嶌嶍嶎嶏嶐嶑嶒嶓嶔嶕嶖嶗嶘嶚嶛嶜嶞嶟嶠�".split(""),e=0;e!=n[141].length;++e)65533!==n[141][e].charCodeAt(0)&&(r[n[141][e]]=36096+e,t[36096+e]=n[141][e]);for(n[142]="����������������������������������������������������������������嶡嶢嶣嶤嶥嶦嶧嶨嶩嶪嶫嶬嶭嶮嶯嶰嶱嶲嶳嶴嶵嶶嶸嶹嶺嶻嶼嶽嶾嶿巀巁巂巃巄巆巇巈巉巊巋巌巎巏巐巑巒巓巔巕巖巗巘巙巚巜巟巠巣巤巪巬巭�巰巵巶巸巹巺巻巼巿帀帄帇帉帊帋帍帎帒帓帗帞帟帠帡帢帣帤帥帨帩帪師帬帯帰帲帳帴帵帶帹帺帾帿幀幁幃幆幇幈幉幊幋幍幎幏幐幑幒幓幖幗幘幙幚幜幝幟幠幣幤幥幦幧幨幩幪幫幬幭幮幯幰幱幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨庩庪庫庬庮庯庰庱庲庴庺庻庼庽庿廀廁廂廃廄廅�".split(""),e=0;e!=n[142].length;++e)65533!==n[142][e].charCodeAt(0)&&(r[n[142][e]]=36352+e,t[36352+e]=n[142][e]);for(n[143]="����������������������������������������������������������������廆廇廈廋廌廍廎廏廐廔廕廗廘廙廚廜廝廞廟廠廡廢廣廤廥廦廧廩廫廬廭廮廯廰廱廲廳廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤�弨弫弬弮弰弲弳弴張弶強弸弻弽弾弿彁彂彃彄彅彆彇彈彉彊彋彌彍彎彏彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢徣徤徥徦徧復徫徬徯徰徱徲徳徴徶徸徹徺徻徾徿忀忁忂忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇�".split(""),e=0;e!=n[143].length;++e)65533!==n[143][e].charCodeAt(0)&&(r[n[143][e]]=36608+e,t[36608+e]=n[143][e]);for(n[144]="����������������������������������������������������������������怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰怱怲怳怴怶怷怸怹怺怽怾恀恄恅恆恇恈恉恊恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀�悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽悾悿惀惁惂惃惄惇惈惉惌惍惎惏惐惒惓惔惖惗惙惛惞惡惢惣惤惥惪惱惲惵惷惸惻惼惽惾惿愂愃愄愅愇愊愋愌愐愑愒愓愔愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬愭愮愯愰愱愲愳愴愵愶愷愸愹愺愻愼愽愾慀慁慂慃慄慅慆�".split(""),e=0;e!=n[144].length;++e)65533!==n[144][e].charCodeAt(0)&&(r[n[144][e]]=36864+e,t[36864+e]=n[144][e]);for(n[145]="����������������������������������������������������������������慇慉態慍慏慐慒慓慔慖慗慘慙慚慛慜慞慟慠慡慣慤慥慦慩慪慫慬慭慮慯慱慲慳慴慶慸慹慺慻慼慽慾慿憀憁憂憃憄憅憆憇憈憉憊憌憍憏憐憑憒憓憕�憖憗憘憙憚憛憜憞憟憠憡憢憣憤憥憦憪憫憭憮憯憰憱憲憳憴憵憶憸憹憺憻憼憽憿懀懁懃懄懅懆懇應懌懍懎懏懐懓懕懖懗懘懙懚懛懜懝懞懟懠懡懢懣懤懥懧懨懩懪懫懬懭懮懯懰懱懲懳懴懶懷懸懹懺懻懼懽懾戀戁戂戃戄戅戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸戹戺戻戼扂扄扅扆扊�".split(""),e=0;e!=n[145].length;++e)65533!==n[145][e].charCodeAt(0)&&(r[n[145][e]]=37120+e,t[37120+e]=n[145][e]);for(n[146]="����������������������������������������������������������������扏扐払扖扗扙扚扜扝扞扟扠扡扢扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋抌抍抎抏抐抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁�拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳挴挵挶挷挸挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖捗捘捙捚捛捜捝捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙掚掛掜掝掞掟採掤掦掫掯掱掲掵掶掹掻掽掿揀�".split(""),e=0;e!=n[146].length;++e)65533!==n[146][e].charCodeAt(0)&&(r[n[146][e]]=37376+e,t[37376+e]=n[146][e]);for(n[147]="����������������������������������������������������������������揁揂揃揅揇揈揊揋揌揑揓揔揕揗揘揙揚換揜揝揟揢揤揥揦揧揨揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆搇搈搉搊損搎搑搒搕搖搗搘搙搚搝搟搢搣搤�搥搧搨搩搫搮搯搰搱搲搳搵搶搷搸搹搻搼搾摀摂摃摉摋摌摍摎摏摐摑摓摕摖摗摙摚摛摜摝摟摠摡摢摣摤摥摦摨摪摫摬摮摯摰摱摲摳摴摵摶摷摻摼摽摾摿撀撁撃撆撈撉撊撋撌撍撎撏撐撓撔撗撘撚撛撜撝撟撠撡撢撣撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆擇擈擉擊擋擌擏擑擓擔擕擖擙據�".split(""),e=0;e!=n[147].length;++e)65533!==n[147][e].charCodeAt(0)&&(r[n[147][e]]=37632+e,t[37632+e]=n[147][e]);for(n[148]="����������������������������������������������������������������擛擜擝擟擠擡擣擥擧擨擩擪擫擬擭擮擯擰擱擲擳擴擵擶擷擸擹擺擻擼擽擾擿攁攂攃攄攅攆攇攈攊攋攌攍攎攏攐攑攓攔攕攖攗攙攚攛攜攝攞攟攠攡�攢攣攤攦攧攨攩攪攬攭攰攱攲攳攷攺攼攽敀敁敂敃敄敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數敹敺敻敼敽敾敿斀斁斂斃斄斅斆斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱斲斳斴斵斶斷斸斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘旙旚旛旜旝旞旟旡旣旤旪旫�".split(""),e=0;e!=n[148].length;++e)65533!==n[148][e].charCodeAt(0)&&(r[n[148][e]]=37888+e,t[37888+e]=n[148][e]);for(n[149]="����������������������������������������������������������������旲旳旴旵旸旹旻旼旽旾旿昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷昸昹昺昻昽昿晀時晄晅晆晇晈晉晊晍晎晐晑晘�晙晛晜晝晞晠晢晣晥晧晩晪晫晬晭晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘暙暚暛暜暞暟暠暡暢暣暤暥暦暩暪暫暬暭暯暰暱暲暳暵暶暷暸暺暻暼暽暿曀曁曂曃曄曅曆曇曈曉曊曋曌曍曎曏曐曑曒曓曔曕曖曗曘曚曞曟曠曡曢曣曤曥曧曨曪曫曬曭曮曯曱曵曶書曺曻曽朁朂會�".split(""),e=0;e!=n[149].length;++e)65533!==n[149][e].charCodeAt(0)&&(r[n[149][e]]=38144+e,t[38144+e]=n[149][e]);for(n[150]="����������������������������������������������������������������朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠朡朢朣朤朥朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗杘杙杚杛杝杢杣杤杦杧杫杬杮東杴杶�杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹枺枻枼枽枾枿柀柂柅柆柇柈柉柊柋柌柍柎柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵柶柷柸柹柺査柼柾栁栂栃栄栆栍栐栒栔栕栘栙栚栛栜栞栟栠栢栣栤栥栦栧栨栫栬栭栮栯栰栱栴栵栶栺栻栿桇桋桍桏桒桖桗桘桙桚桛�".split(""),e=0;e!=n[150].length;++e)65533!==n[150][e].charCodeAt(0)&&(r[n[150][e]]=38400+e,t[38400+e]=n[150][e]);for(n[151]="����������������������������������������������������������������桜桝桞桟桪桬桭桮桯桰桱桲桳桵桸桹桺桻桼桽桾桿梀梂梄梇梈梉梊梋梌梍梎梐梑梒梔梕梖梘梙梚梛梜條梞梟梠梡梣梤梥梩梪梫梬梮梱梲梴梶梷梸�梹梺梻梼梽梾梿棁棃棄棅棆棇棈棊棌棎棏棐棑棓棔棖棗棙棛棜棝棞棟棡棢棤棥棦棧棨棩棪棫棬棭棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆椇椈椉椊椌椏椑椓椔椕椖椗椘椙椚椛検椝椞椡椢椣椥椦椧椨椩椪椫椬椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃楄楅楆楇楈楉楊楋楌楍楎楏楐楑楒楓楕楖楘楙楛楜楟�".split(""),e=0;e!=n[151].length;++e)65533!==n[151][e].charCodeAt(0)&&(r[n[151][e]]=38656+e,t[38656+e]=n[151][e]);for(n[152]="����������������������������������������������������������������楡楢楤楥楧楨楩楪楬業楯楰楲楳楴極楶楺楻楽楾楿榁榃榅榊榋榌榎榏榐榑榒榓榖榗榙榚榝榞榟榠榡榢榣榤榥榦榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽�榾榿槀槂槃槄槅槆槇槈槉構槍槏槑槒槓槕槖槗様槙槚槜槝槞槡槢槣槤槥槦槧槨槩槪槫槬槮槯槰槱槳槴槵槶槷槸槹槺槻槼槾樀樁樂樃樄樅樆樇樈樉樋樌樍樎樏樐樑樒樓樔樕樖標樚樛樜樝樞樠樢樣樤樥樦樧権樫樬樭樮樰樲樳樴樶樷樸樹樺樻樼樿橀橁橂橃橅橆橈橉橊橋橌橍橎橏橑橒橓橔橕橖橗橚�".split(""),e=0;e!=n[152].length;++e)65533!==n[152][e].charCodeAt(0)&&(r[n[152][e]]=38912+e,t[38912+e]=n[152][e]);for(n[153]="����������������������������������������������������������������橜橝橞機橠橢橣橤橦橧橨橩橪橫橬橭橮橯橰橲橳橴橵橶橷橸橺橻橽橾橿檁檂檃檅檆檇檈檉檊檋檌檍檏檒檓檔檕檖檘檙檚檛檜檝檞檟檡檢檣檤檥檦�檧檨檪檭檮檯檰檱檲檳檴檵檶檷檸檹檺檻檼檽檾檿櫀櫁櫂櫃櫄櫅櫆櫇櫈櫉櫊櫋櫌櫍櫎櫏櫐櫑櫒櫓櫔櫕櫖櫗櫘櫙櫚櫛櫜櫝櫞櫟櫠櫡櫢櫣櫤櫥櫦櫧櫨櫩櫪櫫櫬櫭櫮櫯櫰櫱櫲櫳櫴櫵櫶櫷櫸櫹櫺櫻櫼櫽櫾櫿欀欁欂欃欄欅欆欇欈欉權欋欌欍欎欏欐欑欒欓欔欕欖欗欘欙欚欛欜欝欞欟欥欦欨欩欪欫欬欭欮�".split(""),e=0;e!=n[153].length;++e)65533!==n[153][e].charCodeAt(0)&&(r[n[153][e]]=39168+e,t[39168+e]=n[153][e]);for(n[154]="����������������������������������������������������������������欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍歎歏歐歑歒歓歔歕歖歗歘歚歛歜歝歞歟歠歡歨歩歫歬歭歮歯歰歱歲歳歴歵歶歷歸歺歽歾歿殀殅殈�殌殎殏殐殑殔殕殗殘殙殜殝殞殟殠殢殣殤殥殦殧殨殩殫殬殭殮殯殰殱殲殶殸殹殺殻殼殽殾毀毃毄毆毇毈毉毊毌毎毐毑毘毚毜毝毞毟毠毢毣毤毥毦毧毨毩毬毭毮毰毱毲毴毶毷毸毺毻毼毾毿氀氁氂氃氄氈氉氊氋氌氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋汌汍汎汏汑汒汓汖汘�".split(""),e=0;e!=n[154].length;++e)65533!==n[154][e].charCodeAt(0)&&(r[n[154][e]]=39424+e,t[39424+e]=n[154][e]);for(n[155]="����������������������������������������������������������������汙汚汢汣汥汦汧汫汬汭汮汯汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘�泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟洠洡洢洣洤洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽浾浿涀涁涃涄涆涇涊涋涍涏涐涒涖涗涘涙涚涜涢涥涬涭涰涱涳涴涶涷涹涺涻涼涽涾淁淂淃淈淉淊�".split(""),e=0;e!=n[155].length;++e)65533!==n[155][e].charCodeAt(0)&&(r[n[155][e]]=39680+e,t[39680+e]=n[155][e]);for(n[156]="����������������������������������������������������������������淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽淾淿渀渁渂渃渄渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵�渶渷渹渻渼渽渾渿湀湁湂湅湆湇湈湉湊湋湌湏湐湑湒湕湗湙湚湜湝湞湠湡湢湣湤湥湦湧湨湩湪湬湭湯湰湱湲湳湴湵湶湷湸湹湺湻湼湽満溁溂溄溇溈溊溋溌溍溎溑溒溓溔溕準溗溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪滫滬滭滮滯�".split(""),e=0;e!=n[156].length;++e)65533!==n[156][e].charCodeAt(0)&&(r[n[156][e]]=39936+e,t[39936+e]=n[156][e]);for(n[157]="����������������������������������������������������������������滰滱滲滳滵滶滷滸滺滻滼滽滾滿漀漁漃漄漅漇漈漊漋漌漍漎漐漑漒漖漗漘漙漚漛漜漝漞漟漡漢漣漥漦漧漨漬漮漰漲漴漵漷漸漹漺漻漼漽漿潀潁潂�潃潄潅潈潉潊潌潎潏潐潑潒潓潔潕潖潗潙潚潛潝潟潠潡潣潤潥潧潨潩潪潫潬潯潰潱潳潵潶潷潹潻潽潾潿澀澁澂澃澅澆澇澊澋澏澐澑澒澓澔澕澖澗澘澙澚澛澝澞澟澠澢澣澤澥澦澨澩澪澫澬澭澮澯澰澱澲澴澵澷澸澺澻澼澽澾澿濁濃濄濅濆濇濈濊濋濌濍濎濏濐濓濔濕濖濗濘濙濚濛濜濝濟濢濣濤濥�".split(""),e=0;e!=n[157].length;++e)65533!==n[157][e].charCodeAt(0)&&(r[n[157][e]]=40192+e,t[40192+e]=n[157][e]);for(n[158]="����������������������������������������������������������������濦濧濨濩濪濫濬濭濰濱濲濳濴濵濶濷濸濹濺濻濼濽濾濿瀀瀁瀂瀃瀄瀅瀆瀇瀈瀉瀊瀋瀌瀍瀎瀏瀐瀒瀓瀔瀕瀖瀗瀘瀙瀜瀝瀞瀟瀠瀡瀢瀤瀥瀦瀧瀨瀩瀪�瀫瀬瀭瀮瀯瀰瀱瀲瀳瀴瀶瀷瀸瀺瀻瀼瀽瀾瀿灀灁灂灃灄灅灆灇灈灉灊灋灍灎灐灑灒灓灔灕灖灗灘灙灚灛灜灝灟灠灡灢灣灤灥灦灧灨灩灪灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞炟炠炡炢炣炤炥炦炧炨炩炪炰炲炴炵炶為炾炿烄烅烆烇烉烋烌烍烎烏烐烑烒烓烔烕烖烗烚�".split(""),e=0;e!=n[158].length;++e)65533!==n[158][e].charCodeAt(0)&&(r[n[158][e]]=40448+e,t[40448+e]=n[158][e]);for(n[159]="����������������������������������������������������������������烜烝烞烠烡烢烣烥烪烮烰烱烲烳烴烵烶烸烺烻烼烾烿焀焁焂焃焄焅焆焇焈焋焌焍焎焏焑焒焔焗焛焜焝焞焟焠無焢焣焤焥焧焨焩焪焫焬焭焮焲焳焴�焵焷焸焹焺焻焼焽焾焿煀煁煂煃煄煆煇煈煉煋煍煏煐煑煒煓煔煕煖煗煘煙煚煛煝煟煠煡煢煣煥煩煪煫煬煭煯煰煱煴煵煶煷煹煻煼煾煿熀熁熂熃熅熆熇熈熉熋熌熍熎熐熑熒熓熕熖熗熚熛熜熝熞熡熢熣熤熥熦熧熩熪熫熭熮熯熰熱熲熴熶熷熸熺熻熼熽熾熿燀燁燂燄燅燆燇燈燉燊燋燌燍燏燐燑燒燓�".split(""),e=0;e!=n[159].length;++e)65533!==n[159][e].charCodeAt(0)&&(r[n[159][e]]=40704+e,t[40704+e]=n[159][e]);for(n[160]="����������������������������������������������������������������燖燗燘燙燚燛燜燝燞營燡燢燣燤燦燨燩燪燫燬燭燯燰燱燲燳燴燵燶燷燸燺燻燼燽燾燿爀爁爂爃爄爅爇爈爉爊爋爌爍爎爏爐爑爒爓爔爕爖爗爘爙爚�爛爜爞爟爠爡爢爣爤爥爦爧爩爫爭爮爯爲爳爴爺爼爾牀牁牂牃牄牅牆牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅犆犇犈犉犌犎犐犑犓犔犕犖犗犘犙犚犛犜犝犞犠犡犢犣犤犥犦犧犨犩犪犫犮犱犲犳犵犺犻犼犽犾犿狀狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛�".split(""),e=0;e!=n[160].length;++e)65533!==n[160][e].charCodeAt(0)&&(r[n[160][e]]=40960+e,t[40960+e]=n[160][e]);for(n[161]="����������������������������������������������������������������������������������������������������������������������������������������������������������������� 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈〉《》「」『』〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓�".split(""),e=0;e!=n[161].length;++e)65533!==n[161][e].charCodeAt(0)&&(r[n[161][e]]=41216+e,t[41216+e]=n[161][e]);for(n[162]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹ������⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇①②③④⑤⑥⑦⑧⑨⑩��㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩��ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ���".split(""),e=0;e!=n[162].length;++e)65533!==n[162][e].charCodeAt(0)&&(r[n[162][e]]=41472+e,t[41472+e]=n[162][e]);for(n[163]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������!"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} ̄�".split(""),e=0;e!=n[163].length;++e)65533!==n[163][e].charCodeAt(0)&&(r[n[163][e]]=41728+e,t[41728+e]=n[163][e]);for(n[164]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん������������".split(""),e=0;e!=n[164].length;++e)65533!==n[164][e].charCodeAt(0)&&(r[n[164][e]]=41984+e,t[41984+e]=n[164][e]);for(n[165]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ���������".split(""),e=0;e!=n[165].length;++e)65533!==n[165][e].charCodeAt(0)&&(r[n[165][e]]=42240+e,t[42240+e]=n[165][e]);for(n[166]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω�������︵︶︹︺︿﹀︽︾﹁﹂﹃﹄��︻︼︷︸︱�︳︴����������".split(""),e=0;e!=n[166].length;++e)65533!==n[166][e].charCodeAt(0)&&(r[n[166][e]]=42496+e,t[42496+e]=n[166][e]);for(n[167]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмнопрстуфхцчшщъыьэюя��������������".split(""),e=0;e!=n[167].length;++e)65533!==n[167][e].charCodeAt(0)&&(r[n[167][e]]=42752+e,t[42752+e]=n[167][e]);for(n[168]="����������������������������������������������������������������ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╭╮╯╰╱╲╳▁▂▃▄▅▆▇�█▉▊▋▌▍▎▏▓▔▕▼▽◢◣◤◥☉⊕〒〝〞�����������āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ�ńň�ɡ����ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦㄧㄨㄩ����������������������".split(""),e=0;e!=n[168].length;++e)65533!==n[168][e].charCodeAt(0)&&(r[n[168][e]]=43008+e,t[43008+e]=n[168][e]);for(n[169]="����������������������������������������������������������������〡〢〣〤〥〦〧〨〩㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦�℡㈱�‐���ー゛゜ヽヾ〆ゝゞ﹉﹊﹋﹌﹍﹎﹏﹐﹑﹒﹔﹕﹖﹗﹙﹚﹛﹜﹝﹞﹟﹠﹡�﹢﹣﹤﹥﹦﹨﹩﹪﹫�������������〇�������������─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋����������������".split(""),e=0;e!=n[169].length;++e)65533!==n[169][e].charCodeAt(0)&&(r[n[169][e]]=43264+e,t[43264+e]=n[169][e]);for(n[170]="����������������������������������������������������������������狜狝狟狢狣狤狥狦狧狪狫狵狶狹狽狾狿猀猂猄猅猆猇猈猉猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀獁獂獃獄獅獆獇獈�獉獊獋獌獎獏獑獓獔獕獖獘獙獚獛獜獝獞獟獡獢獣獤獥獦獧獨獩獪獫獮獰獱�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[170].length;++e)65533!==n[170][e].charCodeAt(0)&&(r[n[170][e]]=43520+e,t[43520+e]=n[170][e]);for(n[171]="����������������������������������������������������������������獲獳獴獵獶獷獸獹獺獻獼獽獿玀玁玂玃玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣玤玥玦玧玨玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃珄珅珆珇�珋珌珎珒珓珔珕珖珗珘珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳珴珵珶珷�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[171].length;++e)65533!==n[171][e].charCodeAt(0)&&(r[n[171][e]]=43776+e,t[43776+e]=n[171][e]);for(n[172]="����������������������������������������������������������������珸珹珺珻珼珽現珿琀琁琂琄琇琈琋琌琍琎琑琒琓琔琕琖琗琘琙琜琝琞琟琠琡琣琤琧琩琫琭琯琱琲琷琸琹琺琻琽琾琿瑀瑂瑃瑄瑅瑆瑇瑈瑉瑊瑋瑌瑍�瑎瑏瑐瑑瑒瑓瑔瑖瑘瑝瑠瑡瑢瑣瑤瑥瑦瑧瑨瑩瑪瑫瑬瑮瑯瑱瑲瑳瑴瑵瑸瑹瑺�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[172].length;++e)65533!==n[172][e].charCodeAt(0)&&(r[n[172][e]]=44032+e,t[44032+e]=n[172][e]);for(n[173]="����������������������������������������������������������������瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑璒璓璔璕璖璗璘璙璚璛璝璟璠璡璢璣璤璥璦璪璫璬璭璮璯環璱璲璳璴璵璶璷璸璹璻璼璽璾璿瓀瓁瓂瓃瓄瓅瓆瓇�瓈瓉瓊瓋瓌瓍瓎瓏瓐瓑瓓瓔瓕瓖瓗瓘瓙瓚瓛瓝瓟瓡瓥瓧瓨瓩瓪瓫瓬瓭瓰瓱瓲�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[173].length;++e)65533!==n[173][e].charCodeAt(0)&&(r[n[173][e]]=44288+e,t[44288+e]=n[173][e]);for(n[174]="����������������������������������������������������������������瓳瓵瓸瓹瓺瓻瓼瓽瓾甀甁甂甃甅甆甇甈甉甊甋甌甎甐甒甔甕甖甗甛甝甞甠甡產産甤甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘�畝畞畟畠畡畢畣畤畧畨畩畫畬畭畮畯異畱畳畵當畷畺畻畼畽畾疀疁疂疄疅疇�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[174].length;++e)65533!==n[174][e].charCodeAt(0)&&(r[n[174][e]]=44544+e,t[44544+e]=n[174][e]);for(n[175]="����������������������������������������������������������������疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦疧疨疩疪疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇�瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[175].length;++e)65533!==n[175][e].charCodeAt(0)&&(r[n[175][e]]=44800+e,t[44800+e]=n[175][e]);for(n[176]="����������������������������������������������������������������癅癆癇癈癉癊癋癎癏癐癑癒癓癕癗癘癙癚癛癝癟癠癡癢癤癥癦癧癨癩癪癬癭癮癰癱癲癳癴癵癶癷癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛�皜皝皞皟皠皡皢皣皥皦皧皨皩皪皫皬皭皯皰皳皵皶皷皸皹皺皻皼皽皾盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥�".split(""),e=0;e!=n[176].length;++e)65533!==n[176][e].charCodeAt(0)&&(r[n[176][e]]=45056+e,t[45056+e]=n[176][e]);for(n[177]="����������������������������������������������������������������盄盇盉盋盌盓盕盙盚盜盝盞盠盡盢監盤盦盧盨盩盪盫盬盭盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎眏眐眑眒眓眔眕眖眗眘眛眜眝眞眡眣眤眥眧眪眫�眬眮眰眱眲眳眴眹眻眽眾眿睂睄睅睆睈睉睊睋睌睍睎睏睒睓睔睕睖睗睘睙睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳�".split(""),e=0;e!=n[177].length;++e)65533!==n[177][e].charCodeAt(0)&&(r[n[177][e]]=45312+e,t[45312+e]=n[177][e]);for(n[178]="����������������������������������������������������������������睝睞睟睠睤睧睩睪睭睮睯睰睱睲睳睴睵睶睷睸睺睻睼瞁瞂瞃瞆瞇瞈瞉瞊瞋瞏瞐瞓瞔瞕瞖瞗瞘瞙瞚瞛瞜瞝瞞瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶瞷瞸瞹瞺�瞼瞾矀矁矂矃矄矅矆矇矈矉矊矋矌矎矏矐矑矒矓矔矕矖矘矙矚矝矞矟矠矡矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖�".split(""),e=0;e!=n[178].length;++e)65533!==n[178][e].charCodeAt(0)&&(r[n[178][e]]=45568+e,t[45568+e]=n[178][e]);for(n[179]="����������������������������������������������������������������矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃砄砅砆砇砈砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚�硛硜硞硟硠硡硢硣硤硥硦硧硨硩硯硰硱硲硳硴硵硶硸硹硺硻硽硾硿碀碁碂碃场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚�".split(""),e=0;e!=n[179].length;++e)65533!==n[179][e].charCodeAt(0)&&(r[n[179][e]]=45824+e,t[45824+e]=n[179][e]);for(n[180]="����������������������������������������������������������������碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨碩碪碫碬碭碮碯碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚磛磜磝磞磟磠磡磢磣�磤磥磦磧磩磪磫磭磮磯磰磱磳磵磶磸磹磻磼磽磾磿礀礂礃礄礆礇礈礉礊礋礌础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮�".split(""),e=0;e!=n[180].length;++e)65533!==n[180][e].charCodeAt(0)&&(r[n[180][e]]=46080+e,t[46080+e]=n[180][e]);for(n[181]="����������������������������������������������������������������礍礎礏礐礑礒礔礕礖礗礘礙礚礛礜礝礟礠礡礢礣礥礦礧礨礩礪礫礬礭礮礯礰礱礲礳礵礶礷礸礹礽礿祂祃祄祅祇祊祋祌祍祎祏祐祑祒祔祕祘祙祡祣�祤祦祩祪祫祬祮祰祱祲祳祴祵祶祹祻祼祽祾祿禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠�".split(""),e=0;e!=n[181].length;++e)65533!==n[181][e].charCodeAt(0)&&(r[n[181][e]]=46336+e,t[46336+e]=n[181][e]);for(n[182]="����������������������������������������������������������������禓禔禕禖禗禘禙禛禜禝禞禟禠禡禢禣禤禥禦禨禩禪禫禬禭禮禯禰禱禲禴禵禶禷禸禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙秚秛秜秝秞秠秡秢秥秨秪�秬秮秱秲秳秴秵秶秷秹秺秼秾秿稁稄稅稇稈稉稊稌稏稐稑稒稓稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二�".split(""),e=0;e!=n[182].length;++e)65533!==n[182][e].charCodeAt(0)&&(r[n[182][e]]=46592+e,t[46592+e]=n[182][e]);for(n[183]="����������������������������������������������������������������稝稟稡稢稤稥稦稧稨稩稪稫稬稭種稯稰稱稲稴稵稶稸稺稾穀穁穂穃穄穅穇穈穉穊穋穌積穎穏穐穒穓穔穕穖穘穙穚穛穜穝穞穟穠穡穢穣穤穥穦穧穨�穩穪穫穬穭穮穯穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服�".split(""),e=0;e!=n[183].length;++e)65533!==n[183][e].charCodeAt(0)&&(r[n[183][e]]=46848+e,t[46848+e]=n[183][e]);for(n[184]="����������������������������������������������������������������窣窤窧窩窪窫窮窯窰窱窲窴窵窶窷窸窹窺窻窼窽窾竀竁竂竃竄竅竆竇竈竉竊竌竍竎竏竐竑竒竓竔竕竗竘竚竛竜竝竡竢竤竧竨竩竪竫竬竮竰竱竲竳�竴竵競竷竸竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹�".split(""),e=0;e!=n[184].length;++e)65533!==n[184][e].charCodeAt(0)&&(r[n[184][e]]=47104+e,t[47104+e]=n[184][e]);for(n[185]="����������������������������������������������������������������笯笰笲笴笵笶笷笹笻笽笿筀筁筂筃筄筆筈筊筍筎筓筕筗筙筜筞筟筡筣筤筥筦筧筨筩筪筫筬筭筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆箇箈箉箊箋箌箎箏�箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹箺箻箼箽箾箿節篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈�".split(""),e=0;e!=n[185].length;++e)65533!==n[185][e].charCodeAt(0)&&(r[n[185][e]]=47360+e,t[47360+e]=n[185][e]);for(n[186]="����������������������������������������������������������������篅篈築篊篋篍篎篏篐篒篔篕篖篗篘篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲篳篴篵篶篸篹篺篻篽篿簀簁簂簃簄簅簆簈簉簊簍簎簐簑簒簓簔簕簗簘簙�簚簛簜簝簞簠簡簢簣簤簥簨簩簫簬簭簮簯簰簱簲簳簴簵簶簷簹簺簻簼簽簾籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖�".split(""),e=0;e!=n[186].length;++e)65533!==n[186][e].charCodeAt(0)&&(r[n[186][e]]=47616+e,t[47616+e]=n[186][e]);for(n[187]="����������������������������������������������������������������籃籄籅籆籇籈籉籊籋籌籎籏籐籑籒籓籔籕籖籗籘籙籚籛籜籝籞籟籠籡籢籣籤籥籦籧籨籩籪籫籬籭籮籯籰籱籲籵籶籷籸籹籺籾籿粀粁粂粃粄粅粆粇�粈粊粋粌粍粎粏粐粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴粵粶粷粸粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕�".split(""),e=0;e!=n[187].length;++e)65533!==n[187][e].charCodeAt(0)&&(r[n[187][e]]=47872+e,t[47872+e]=n[187][e]);for(n[188]="����������������������������������������������������������������粿糀糂糃糄糆糉糋糎糏糐糑糒糓糔糘糚糛糝糞糡糢糣糤糥糦糧糩糪糫糬糭糮糰糱糲糳糴糵糶糷糹糺糼糽糾糿紀紁紂紃約紅紆紇紈紉紋紌納紎紏紐�紑紒紓純紕紖紗紘紙級紛紜紝紞紟紡紣紤紥紦紨紩紪紬紭紮細紱紲紳紴紵紶肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件�".split(""),e=0;e!=n[188].length;++e)65533!==n[188][e].charCodeAt(0)&&(r[n[188][e]]=48128+e,t[48128+e]=n[188][e]);for(n[189]="����������������������������������������������������������������紷紸紹紺紻紼紽紾紿絀絁終絃組絅絆絇絈絉絊絋経絍絎絏結絑絒絓絔絕絖絗絘絙絚絛絜絝絞絟絠絡絢絣絤絥給絧絨絩絪絫絬絭絯絰統絲絳絴絵絶�絸絹絺絻絼絽絾絿綀綁綂綃綄綅綆綇綈綉綊綋綌綍綎綏綐綑綒經綔綕綖綗綘健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸�".split(""),e=0;e!=n[189].length;++e)65533!==n[189][e].charCodeAt(0)&&(r[n[189][e]]=48384+e,t[48384+e]=n[189][e]);for(n[190]="����������������������������������������������������������������継続綛綜綝綞綟綠綡綢綣綤綥綧綨綩綪綫綬維綯綰綱網綳綴綵綶綷綸綹綺綻綼綽綾綿緀緁緂緃緄緅緆緇緈緉緊緋緌緍緎総緐緑緒緓緔緕緖緗緘緙�線緛緜緝緞緟締緡緢緣緤緥緦緧編緩緪緫緬緭緮緯緰緱緲緳練緵緶緷緸緹緺尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻�".split(""),e=0;e!=n[190].length;++e)65533!==n[190][e].charCodeAt(0)&&(r[n[190][e]]=48640+e,t[48640+e]=n[190][e]);for(n[191]="����������������������������������������������������������������緻緼緽緾緿縀縁縂縃縄縅縆縇縈縉縊縋縌縍縎縏縐縑縒縓縔縕縖縗縘縙縚縛縜縝縞縟縠縡縢縣縤縥縦縧縨縩縪縫縬縭縮縯縰縱縲縳縴縵縶縷縸縹�縺縼總績縿繀繂繃繄繅繆繈繉繊繋繌繍繎繏繐繑繒繓織繕繖繗繘繙繚繛繜繝俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀�".split(""),e=0;e!=n[191].length;++e)65533!==n[191][e].charCodeAt(0)&&(r[n[191][e]]=48896+e,t[48896+e]=n[191][e]);for(n[192]="����������������������������������������������������������������繞繟繠繡繢繣繤繥繦繧繨繩繪繫繬繭繮繯繰繱繲繳繴繵繶繷繸繹繺繻繼繽繾繿纀纁纃纄纅纆纇纈纉纊纋續纍纎纏纐纑纒纓纔纕纖纗纘纙纚纜纝纞�纮纴纻纼绖绤绬绹缊缐缞缷缹缻缼缽缾缿罀罁罃罆罇罈罉罊罋罌罍罎罏罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐�".split(""),e=0;e!=n[192].length;++e)65533!==n[192][e].charCodeAt(0)&&(r[n[192][e]]=49152+e,t[49152+e]=n[192][e]);for(n[193]="����������������������������������������������������������������罖罙罛罜罝罞罠罣罤罥罦罧罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂羃羄羅羆羇羈羉羋羍羏羐羑羒羓羕羖羗羘羙羛羜羠羢羣羥羦羨義羪羫羬羭羮羱�羳羴羵羶羷羺羻羾翀翂翃翄翆翇翈翉翋翍翏翐翑習翓翖翗翙翚翛翜翝翞翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿�".split(""),e=0;e!=n[193].length;++e)65533!==n[193][e].charCodeAt(0)&&(r[n[193][e]]=49408+e,t[49408+e]=n[193][e]);for(n[194]="����������������������������������������������������������������翤翧翨翪翫翬翭翯翲翴翵翶翷翸翹翺翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫耬耭耮耯耰耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗�聙聛聜聝聞聟聠聡聢聣聤聥聦聧聨聫聬聭聮聯聰聲聳聴聵聶職聸聹聺聻聼聽隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫�".split(""),e=0;e!=n[194].length;++e)65533!==n[194][e].charCodeAt(0)&&(r[n[194][e]]=49664+e,t[49664+e]=n[194][e]);for(n[195]="����������������������������������������������������������������聾肁肂肅肈肊肍肎肏肐肑肒肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇胈胉胊胋胏胐胑胒胓胔胕胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋�脌脕脗脙脛脜脝脟脠脡脢脣脤脥脦脧脨脩脪脫脭脮脰脳脴脵脷脹脺脻脼脽脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸�".split(""),e=0;e!=n[195].length;++e)65533!==n[195][e].charCodeAt(0)&&(r[n[195][e]]=49920+e,t[49920+e]=n[195][e]);for(n[196]="����������������������������������������������������������������腀腁腂腃腄腅腇腉腍腎腏腒腖腗腘腛腜腝腞腟腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃膄膅膆膇膉膋膌膍膎膐膒膓膔膕膖膗膙膚膞膟膠膡膢膤膥�膧膩膫膬膭膮膯膰膱膲膴膵膶膷膸膹膼膽膾膿臄臅臇臈臉臋臍臎臏臐臑臒臓摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁�".split(""),e=0;e!=n[196].length;++e)65533!==n[196][e].charCodeAt(0)&&(r[n[196][e]]=50176+e,t[50176+e]=n[196][e]);for(n[197]="����������������������������������������������������������������臔臕臖臗臘臙臚臛臜臝臞臟臠臡臢臤臥臦臨臩臫臮臯臰臱臲臵臶臷臸臹臺臽臿舃與興舉舊舋舎舏舑舓舕舖舗舘舙舚舝舠舤舥舦舧舩舮舲舺舼舽舿�艀艁艂艃艅艆艈艊艌艍艎艐艑艒艓艔艕艖艗艙艛艜艝艞艠艡艢艣艤艥艦艧艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗�".split(""),e=0;e!=n[197].length;++e)65533!==n[197][e].charCodeAt(0)&&(r[n[197][e]]=50432+e,t[50432+e]=n[197][e]);for(n[198]="����������������������������������������������������������������艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸�苺苼苽苾苿茀茊茋茍茐茒茓茖茘茙茝茞茟茠茡茢茣茤茥茦茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐�".split(""),e=0;e!=n[198].length;++e)65533!==n[198][e].charCodeAt(0)&&(r[n[198][e]]=50688+e,t[50688+e]=n[198][e]);for(n[199]="����������������������������������������������������������������茾茿荁荂荄荅荈荊荋荌荍荎荓荕荖荗荘荙荝荢荰荱荲荳荴荵荶荹荺荾荿莀莁莂莃莄莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡莢莣莤莥莦莧莬莭莮�莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠�".split(""),e=0;e!=n[199].length;++e)65533!==n[199][e].charCodeAt(0)&&(r[n[199][e]]=50944+e,t[50944+e]=n[199][e]);for(n[200]="����������������������������������������������������������������菮華菳菴菵菶菷菺菻菼菾菿萀萂萅萇萈萉萊萐萒萓萔萕萖萗萙萚萛萞萟萠萡萢萣萩萪萫萬萭萮萯萰萲萳萴萵萶萷萹萺萻萾萿葀葁葂葃葄葅葇葈葉�葊葋葌葍葎葏葐葒葓葔葕葖葘葝葞葟葠葢葤葥葦葧葨葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁�".split(""),e=0;e!=n[200].length;++e)65533!==n[200][e].charCodeAt(0)&&(r[n[200][e]]=51200+e,t[51200+e]=n[200][e]);for(n[201]="����������������������������������������������������������������葽葾葿蒀蒁蒃蒄蒅蒆蒊蒍蒏蒐蒑蒒蒓蒔蒕蒖蒘蒚蒛蒝蒞蒟蒠蒢蒣蒤蒥蒦蒧蒨蒩蒪蒫蒬蒭蒮蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗�蓘蓙蓚蓛蓜蓞蓡蓢蓤蓧蓨蓩蓪蓫蓭蓮蓯蓱蓲蓳蓴蓵蓶蓷蓸蓹蓺蓻蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳�".split(""),e=0;e!=n[201].length;++e)65533!==n[201][e].charCodeAt(0)&&(r[n[201][e]]=51456+e,t[51456+e]=n[201][e]);for(n[202]="����������������������������������������������������������������蔃蔄蔅蔆蔇蔈蔉蔊蔋蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢蔣蔤蔥蔦蔧蔨蔩蔪蔭蔮蔯蔰蔱蔲蔳蔴蔵蔶蔾蔿蕀蕁蕂蕄蕅蕆蕇蕋蕌蕍蕎蕏蕐蕑蕒蕓蕔蕕�蕗蕘蕚蕛蕜蕝蕟蕠蕡蕢蕣蕥蕦蕧蕩蕪蕫蕬蕭蕮蕯蕰蕱蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱�".split(""),e=0;e!=n[202].length;++e)65533!==n[202][e].charCodeAt(0)&&(r[n[202][e]]=51712+e,t[51712+e]=n[202][e]);for(n[203]="����������������������������������������������������������������薂薃薆薈薉薊薋薌薍薎薐薑薒薓薔薕薖薗薘薙薚薝薞薟薠薡薢薣薥薦薧薩薫薬薭薱薲薳薴薵薶薸薺薻薼薽薾薿藀藂藃藄藅藆藇藈藊藋藌藍藎藑藒�藔藖藗藘藙藚藛藝藞藟藠藡藢藣藥藦藧藨藪藫藬藭藮藯藰藱藲藳藴藵藶藷藸恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔�".split(""),e=0;e!=n[203].length;++e)65533!==n[203][e].charCodeAt(0)&&(r[n[203][e]]=51968+e,t[51968+e]=n[203][e]);for(n[204]="����������������������������������������������������������������藹藺藼藽藾蘀蘁蘂蘃蘄蘆蘇蘈蘉蘊蘋蘌蘍蘎蘏蘐蘒蘓蘔蘕蘗蘘蘙蘚蘛蘜蘝蘞蘟蘠蘡蘢蘣蘤蘥蘦蘨蘪蘫蘬蘭蘮蘯蘰蘱蘲蘳蘴蘵蘶蘷蘹蘺蘻蘽蘾蘿虀�虁虂虃虄虅虆虇虈虉虊虋虌虒虓處虖虗虘虙虛虜虝號虠虡虣虤虥虦虧虨虩虪獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃�".split(""),e=0;e!=n[204].length;++e)65533!==n[204][e].charCodeAt(0)&&(r[n[204][e]]=52224+e,t[52224+e]=n[204][e]);for(n[205]="����������������������������������������������������������������虭虯虰虲虳虴虵虶虷虸蚃蚄蚅蚆蚇蚈蚉蚎蚏蚐蚑蚒蚔蚖蚗蚘蚙蚚蚛蚞蚟蚠蚡蚢蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻蚼蚽蚾蚿蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜�蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威�".split(""),e=0;e!=n[205].length;++e)65533!==n[205][e].charCodeAt(0)&&(r[n[205][e]]=52480+e,t[52480+e]=n[205][e]);for(n[206]="����������������������������������������������������������������蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀蝁蝂蝃蝄蝅蝆蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚蝛蝜蝝蝞蝟蝡蝢蝦蝧蝨蝩蝪蝫蝬蝭蝯蝱蝲蝳蝵�蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎螏螐螑螒螔螕螖螘螙螚螛螜螝螞螠螡螢螣螤巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺�".split(""),e=0;e!=n[206].length;++e)65533!==n[206][e].charCodeAt(0)&&(r[n[206][e]]=52736+e,t[52736+e]=n[206][e]);for(n[207]="����������������������������������������������������������������螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁蟂蟃蟄蟅蟇蟈蟉蟌蟍蟎蟏蟐蟔蟕蟖蟗蟘蟙蟚蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯蟰蟱蟲蟳蟴蟵蟶蟷蟸�蟺蟻蟼蟽蟿蠀蠁蠂蠄蠅蠆蠇蠈蠉蠋蠌蠍蠎蠏蠐蠑蠒蠔蠗蠘蠙蠚蠜蠝蠞蠟蠠蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓�".split(""),e=0;e!=n[207].length;++e)65533!==n[207][e].charCodeAt(0)&&(r[n[207][e]]=52992+e,t[52992+e]=n[207][e]);for(n[208]="����������������������������������������������������������������蠤蠥蠦蠧蠨蠩蠪蠫蠬蠭蠮蠯蠰蠱蠳蠴蠵蠶蠷蠸蠺蠻蠽蠾蠿衁衂衃衆衇衈衉衊衋衎衏衐衑衒術衕衖衘衚衛衜衝衞衟衠衦衧衪衭衯衱衳衴衵衶衸衹衺�衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗袘袙袚袛袝袞袟袠袡袣袥袦袧袨袩袪小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄�".split(""),e=0;e!=n[208].length;++e)65533!==n[208][e].charCodeAt(0)&&(r[n[208][e]]=53248+e,t[53248+e]=n[208][e]);for(n[209]="����������������������������������������������������������������袬袮袯袰袲袳袴袵袶袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚裛補裝裞裠裡裦裧裩裪裫裬裭裮裯裲裵裶裷裺裻製裿褀褁褃褄褅褆複褈�褉褋褌褍褎褏褑褔褕褖褗褘褜褝褞褟褠褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶�".split(""),e=0;e!=n[209].length;++e)65533!==n[209][e].charCodeAt(0)&&(r[n[209][e]]=53504+e,t[53504+e]=n[209][e]);for(n[210]="����������������������������������������������������������������褸褹褺褻褼褽褾褿襀襂襃襅襆襇襈襉襊襋襌襍襎襏襐襑襒襓襔襕襖襗襘襙襚襛襜襝襠襡襢襣襤襥襧襨襩襪襫襬襭襮襯襰襱襲襳襴襵襶襷襸襹襺襼�襽襾覀覂覄覅覇覈覉覊見覌覍覎規覐覑覒覓覔覕視覗覘覙覚覛覜覝覞覟覠覡摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐�".split(""),e=0;e!=n[210].length;++e)65533!==n[210][e].charCodeAt(0)&&(r[n[210][e]]=53760+e,t[53760+e]=n[210][e]);for(n[211]="����������������������������������������������������������������覢覣覤覥覦覧覨覩親覫覬覭覮覯覰覱覲観覴覵覶覷覸覹覺覻覼覽覾覿觀觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴觵觶觷觸觹觺�觻觼觽觾觿訁訂訃訄訅訆計訉訊訋訌訍討訏訐訑訒訓訔訕訖託記訙訚訛訜訝印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉�".split(""),e=0;e!=n[211].length;++e)65533!==n[211][e].charCodeAt(0)&&(r[n[211][e]]=54016+e,t[54016+e]=n[211][e]);for(n[212]="����������������������������������������������������������������訞訟訠訡訢訣訤訥訦訧訨訩訪訫訬設訮訯訰許訲訳訴訵訶訷訸訹診註証訽訿詀詁詂詃詄詅詆詇詉詊詋詌詍詎詏詐詑詒詓詔評詖詗詘詙詚詛詜詝詞�詟詠詡詢詣詤詥試詧詨詩詪詫詬詭詮詯詰話該詳詴詵詶詷詸詺詻詼詽詾詿誀浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧�".split(""),e=0;e!=n[212].length;++e)65533!==n[212][e].charCodeAt(0)&&(r[n[212][e]]=54272+e,t[54272+e]=n[212][e]);for(n[213]="����������������������������������������������������������������誁誂誃誄誅誆誇誈誋誌認誎誏誐誑誒誔誕誖誗誘誙誚誛誜誝語誟誠誡誢誣誤誥誦誧誨誩說誫説読誮誯誰誱課誳誴誵誶誷誸誹誺誻誼誽誾調諀諁諂�諃諄諅諆談諈諉諊請諌諍諎諏諐諑諒諓諔諕論諗諘諙諚諛諜諝諞諟諠諡諢諣铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政�".split(""),e=0;e!=n[213].length;++e)65533!==n[213][e].charCodeAt(0)&&(r[n[213][e]]=54528+e,t[54528+e]=n[213][e]);for(n[214]="����������������������������������������������������������������諤諥諦諧諨諩諪諫諬諭諮諯諰諱諲諳諴諵諶諷諸諹諺諻諼諽諾諿謀謁謂謃謄謅謆謈謉謊謋謌謍謎謏謐謑謒謓謔謕謖謗謘謙謚講謜謝謞謟謠謡謢謣�謤謥謧謨謩謪謫謬謭謮謯謰謱謲謳謴謵謶謷謸謹謺謻謼謽謾謿譀譁譂譃譄譅帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑�".split(""),e=0;e!=n[214].length;++e)65533!==n[214][e].charCodeAt(0)&&(r[n[214][e]]=54784+e,t[54784+e]=n[214][e]);for(n[215]="����������������������������������������������������������������譆譇譈證譊譋譌譍譎譏譐譑譒譓譔譕譖譗識譙譚譛譜譝譞譟譠譡譢譣譤譥譧譨譩譪譫譭譮譯議譱譲譳譴譵譶護譸譹譺譻譼譽譾譿讀讁讂讃讄讅讆�讇讈讉變讋讌讍讎讏讐讑讒讓讔讕讖讗讘讙讚讛讜讝讞讟讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座������".split(""),e=0;e!=n[215].length;++e)65533!==n[215][e].charCodeAt(0)&&(r[n[215][e]]=55040+e,t[55040+e]=n[215][e]);for(n[216]="����������������������������������������������������������������谸谹谺谻谼谽谾谿豀豂豃豄豅豈豊豋豍豎豏豐豑豒豓豔豖豗豘豙豛豜豝豞豟豠豣豤豥豦豧豨豩豬豭豮豯豰豱豲豴豵豶豷豻豼豽豾豿貀貁貃貄貆貇�貈貋貍貎貏貐貑貒貓貕貖貗貙貚貛貜貝貞貟負財貢貣貤貥貦貧貨販貪貫責貭亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝�".split(""),e=0;e!=n[216].length;++e)65533!==n[216][e].charCodeAt(0)&&(r[n[216][e]]=55296+e,t[55296+e]=n[216][e]);for(n[217]="����������������������������������������������������������������貮貯貰貱貲貳貴貵貶買貸貹貺費貼貽貾貿賀賁賂賃賄賅賆資賈賉賊賋賌賍賎賏賐賑賒賓賔賕賖賗賘賙賚賛賜賝賞賟賠賡賢賣賤賥賦賧賨賩質賫賬�賭賮賯賰賱賲賳賴賵賶賷賸賹賺賻購賽賾賿贀贁贂贃贄贅贆贇贈贉贊贋贌贍佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼�".split(""),e=0;e!=n[217].length;++e)65533!==n[217][e].charCodeAt(0)&&(r[n[217][e]]=55552+e,t[55552+e]=n[217][e]);for(n[218]="����������������������������������������������������������������贎贏贐贑贒贓贔贕贖贗贘贙贚贛贜贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸赹赺赻赼赽赾赿趀趂趃趆趇趈趉趌趍趎趏趐趒趓趕趖趗趘趙趚趛趜趝趞趠趡�趢趤趥趦趧趨趩趪趫趬趭趮趯趰趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺�".split(""),e=0;e!=n[218].length;++e)65533!==n[218][e].charCodeAt(0)&&(r[n[218][e]]=55808+e,t[55808+e]=n[218][e]);for(n[219]="����������������������������������������������������������������跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾跿踀踁踂踃踄踆踇踈踋踍踎踐踑踒踓踕踖踗踘踙踚踛踜踠踡踤踥踦踧踨踫踭踰踲踳踴踶踷踸踻踼踾�踿蹃蹅蹆蹌蹍蹎蹏蹐蹓蹔蹕蹖蹗蹘蹚蹛蹜蹝蹞蹟蹠蹡蹢蹣蹤蹥蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝�".split(""),e=0;e!=n[219].length;++e)65533!==n[219][e].charCodeAt(0)&&(r[n[219][e]]=56064+e,t[56064+e]=n[219][e]);for(n[220]="����������������������������������������������������������������蹳蹵蹷蹸蹹蹺蹻蹽蹾躀躂躃躄躆躈躉躊躋躌躍躎躑躒躓躕躖躗躘躙躚躛躝躟躠躡躢躣躤躥躦躧躨躩躪躭躮躰躱躳躴躵躶躷躸躹躻躼躽躾躿軀軁軂�軃軄軅軆軇軈軉車軋軌軍軏軐軑軒軓軔軕軖軗軘軙軚軛軜軝軞軟軠軡転軣軤堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥�".split(""),e=0;e!=n[220].length;++e)65533!==n[220][e].charCodeAt(0)&&(r[n[220][e]]=56320+e,t[56320+e]=n[220][e]);for(n[221]="����������������������������������������������������������������軥軦軧軨軩軪軫軬軭軮軯軰軱軲軳軴軵軶軷軸軹軺軻軼軽軾軿輀輁輂較輄輅輆輇輈載輊輋輌輍輎輏輐輑輒輓輔輕輖輗輘輙輚輛輜輝輞輟輠輡輢輣�輤輥輦輧輨輩輪輫輬輭輮輯輰輱輲輳輴輵輶輷輸輹輺輻輼輽輾輿轀轁轂轃轄荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺�".split(""),e=0;e!=n[221].length;++e)65533!==n[221][e].charCodeAt(0)&&(r[n[221][e]]=56576+e,t[56576+e]=n[221][e]);for(n[222]="����������������������������������������������������������������轅轆轇轈轉轊轋轌轍轎轏轐轑轒轓轔轕轖轗轘轙轚轛轜轝轞轟轠轡轢轣轤轥轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆�迉迊迋迌迍迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖�".split(""),e=0;e!=n[222].length;++e)65533!==n[222][e].charCodeAt(0)&&(r[n[222][e]]=56832+e,t[56832+e]=n[222][e]);for(n[223]="����������������������������������������������������������������這逜連逤逥逧逨逩逪逫逬逰週進逳逴逷逹逺逽逿遀遃遅遆遈遉遊運遌過達違遖遙遚遜遝遞遟遠遡遤遦遧適遪遫遬遯遰遱遲遳遶遷選遹遺遻遼遾邁�還邅邆邇邉邊邌邍邎邏邐邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼�".split(""),e=0;e!=n[223].length;++e)65533!==n[223][e].charCodeAt(0)&&(r[n[223][e]]=57088+e,t[57088+e]=n[223][e]);for(n[224]="����������������������������������������������������������������郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅鄆鄇鄈鄉鄊鄋鄌鄍鄎鄏鄐鄑鄒鄓鄔鄕鄖鄗鄘鄚鄛鄜�鄝鄟鄠鄡鄤鄥鄦鄧鄨鄩鄪鄫鄬鄭鄮鄰鄲鄳鄴鄵鄶鄷鄸鄺鄻鄼鄽鄾鄿酀酁酂酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼�".split(""),e=0;e!=n[224].length;++e)65533!==n[224][e].charCodeAt(0)&&(r[n[224][e]]=57344+e,t[57344+e]=n[224][e]);for(n[225]="����������������������������������������������������������������酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀醁醂醃醄醆醈醊醎醏醓醔醕醖醗醘醙醜醝醞醟醠醡醤醥醦醧醨醩醫醬醰醱醲醳醶醷醸醹醻�醼醽醾醿釀釁釂釃釄釅釆釈釋釐釒釓釔釕釖釗釘釙釚釛針釞釟釠釡釢釣釤釥帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺�".split(""),e=0;e!=n[225].length;++e)65533!==n[225][e].charCodeAt(0)&&(r[n[225][e]]=57600+e,t[57600+e]=n[225][e]);for(n[226]="����������������������������������������������������������������釦釧釨釩釪釫釬釭釮釯釰釱釲釳釴釵釶釷釸釹釺釻釼釽釾釿鈀鈁鈂鈃鈄鈅鈆鈇鈈鈉鈊鈋鈌鈍鈎鈏鈐鈑鈒鈓鈔鈕鈖鈗鈘鈙鈚鈛鈜鈝鈞鈟鈠鈡鈢鈣鈤�鈥鈦鈧鈨鈩鈪鈫鈬鈭鈮鈯鈰鈱鈲鈳鈴鈵鈶鈷鈸鈹鈺鈻鈼鈽鈾鈿鉀鉁鉂鉃鉄鉅狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧饨饩饪饫饬饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂�".split(""),e=0;e!=n[226].length;++e)65533!==n[226][e].charCodeAt(0)&&(r[n[226][e]]=57856+e,t[57856+e]=n[226][e]);for(n[227]="����������������������������������������������������������������鉆鉇鉈鉉鉊鉋鉌鉍鉎鉏鉐鉑鉒鉓鉔鉕鉖鉗鉘鉙鉚鉛鉜鉝鉞鉟鉠鉡鉢鉣鉤鉥鉦鉧鉨鉩鉪鉫鉬鉭鉮鉯鉰鉱鉲鉳鉵鉶鉷鉸鉹鉺鉻鉼鉽鉾鉿銀銁銂銃銄銅�銆銇銈銉銊銋銌銍銏銐銑銒銓銔銕銖銗銘銙銚銛銜銝銞銟銠銡銢銣銤銥銦銧恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾�".split(""),e=0;e!=n[227].length;++e)65533!==n[227][e].charCodeAt(0)&&(r[n[227][e]]=58112+e,t[58112+e]=n[227][e]);for(n[228]="����������������������������������������������������������������銨銩銪銫銬銭銯銰銱銲銳銴銵銶銷銸銹銺銻銼銽銾銿鋀鋁鋂鋃鋄鋅鋆鋇鋉鋊鋋鋌鋍鋎鋏鋐鋑鋒鋓鋔鋕鋖鋗鋘鋙鋚鋛鋜鋝鋞鋟鋠鋡鋢鋣鋤鋥鋦鋧鋨�鋩鋪鋫鋬鋭鋮鋯鋰鋱鋲鋳鋴鋵鋶鋷鋸鋹鋺鋻鋼鋽鋾鋿錀錁錂錃錄錅錆錇錈錉洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑�".split(""),e=0;e!=n[228].length;++e)65533!==n[228][e].charCodeAt(0)&&(r[n[228][e]]=58368+e,t[58368+e]=n[228][e]);for(n[229]="����������������������������������������������������������������錊錋錌錍錎錏錐錑錒錓錔錕錖錗錘錙錚錛錜錝錞錟錠錡錢錣錤錥錦錧錨錩錪錫錬錭錮錯錰錱録錳錴錵錶錷錸錹錺錻錼錽錿鍀鍁鍂鍃鍄鍅鍆鍇鍈鍉�鍊鍋鍌鍍鍎鍏鍐鍑鍒鍓鍔鍕鍖鍗鍘鍙鍚鍛鍜鍝鍞鍟鍠鍡鍢鍣鍤鍥鍦鍧鍨鍩鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣�".split(""),e=0;e!=n[229].length;++e)65533!==n[229][e].charCodeAt(0)&&(r[n[229][e]]=58624+e,t[58624+e]=n[229][e]);for(n[230]="����������������������������������������������������������������鍬鍭鍮鍯鍰鍱鍲鍳鍴鍵鍶鍷鍸鍹鍺鍻鍼鍽鍾鍿鎀鎁鎂鎃鎄鎅鎆鎇鎈鎉鎊鎋鎌鎍鎎鎐鎑鎒鎓鎔鎕鎖鎗鎘鎙鎚鎛鎜鎝鎞鎟鎠鎡鎢鎣鎤鎥鎦鎧鎨鎩鎪鎫�鎬鎭鎮鎯鎰鎱鎲鎳鎴鎵鎶鎷鎸鎹鎺鎻鎼鎽鎾鎿鏀鏁鏂鏃鏄鏅鏆鏇鏈鏉鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩�".split(""),e=0;e!=n[230].length;++e)65533!==n[230][e].charCodeAt(0)&&(r[n[230][e]]=58880+e,t[58880+e]=n[230][e]);for(n[231]="����������������������������������������������������������������鏎鏏鏐鏑鏒鏓鏔鏕鏗鏘鏙鏚鏛鏜鏝鏞鏟鏠鏡鏢鏣鏤鏥鏦鏧鏨鏩鏪鏫鏬鏭鏮鏯鏰鏱鏲鏳鏴鏵鏶鏷鏸鏹鏺鏻鏼鏽鏾鏿鐀鐁鐂鐃鐄鐅鐆鐇鐈鐉鐊鐋鐌鐍�鐎鐏鐐鐑鐒鐓鐔鐕鐖鐗鐘鐙鐚鐛鐜鐝鐞鐟鐠鐡鐢鐣鐤鐥鐦鐧鐨鐩鐪鐫鐬鐭鐮纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡缢缣缤缥缦缧缪缫缬缭缯缰缱缲缳缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬�".split(""),e=0;e!=n[231].length;++e)65533!==n[231][e].charCodeAt(0)&&(r[n[231][e]]=59136+e,t[59136+e]=n[231][e]);for(n[232]="����������������������������������������������������������������鐯鐰鐱鐲鐳鐴鐵鐶鐷鐸鐹鐺鐻鐼鐽鐿鑀鑁鑂鑃鑄鑅鑆鑇鑈鑉鑊鑋鑌鑍鑎鑏鑐鑑鑒鑓鑔鑕鑖鑗鑘鑙鑚鑛鑜鑝鑞鑟鑠鑡鑢鑣鑤鑥鑦鑧鑨鑩鑪鑬鑭鑮鑯�鑰鑱鑲鑳鑴鑵鑶鑷鑸鑹鑺鑻鑼鑽鑾鑿钀钁钂钃钄钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹�".split(""),e=0;e!=n[232].length;++e)65533!==n[232][e].charCodeAt(0)&&(r[n[232][e]]=59392+e,t[59392+e]=n[232][e]);for(n[233]="����������������������������������������������������������������锧锳锽镃镈镋镕镚镠镮镴镵長镸镹镺镻镼镽镾門閁閂閃閄閅閆閇閈閉閊開閌閍閎閏閐閑閒間閔閕閖閗閘閙閚閛閜閝閞閟閠閡関閣閤閥閦閧閨閩閪�閫閬閭閮閯閰閱閲閳閴閵閶閷閸閹閺閻閼閽閾閿闀闁闂闃闄闅闆闇闈闉闊闋椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋�".split(""),e=0;e!=n[233].length;++e)65533!==n[233][e].charCodeAt(0)&&(r[n[233][e]]=59648+e,t[59648+e]=n[233][e]);for(n[234]="����������������������������������������������������������������闌闍闎闏闐闑闒闓闔闕闖闗闘闙闚闛關闝闞闟闠闡闢闣闤闥闦闧闬闿阇阓阘阛阞阠阣阤阥阦阧阨阩阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗�陘陙陚陜陝陞陠陣陥陦陫陭陮陯陰陱陳陸陹険陻陼陽陾陿隀隁隂隃隄隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰�".split(""),e=0;e!=n[234].length;++e)65533!==n[234][e].charCodeAt(0)&&(r[n[234][e]]=59904+e,t[59904+e]=n[234][e]);for(n[235]="����������������������������������������������������������������隌階隑隒隓隕隖隚際隝隞隟隠隡隢隣隤隥隦隨隩險隫隬隭隮隯隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖雗雘雙雚雛雜雝雞雟雡離難雤雥雦雧雫�雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗霘霙霚霛霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻�".split(""),e=0;e!=n[235].length;++e)65533!==n[235][e].charCodeAt(0)&&(r[n[235][e]]=60160+e,t[60160+e]=n[235][e]);for(n[236]="����������������������������������������������������������������霡霢霣霤霥霦霧霨霩霫霬霮霯霱霳霴霵霶霷霺霻霼霽霿靀靁靂靃靄靅靆靇靈靉靊靋靌靍靎靏靐靑靔靕靗靘靚靜靝靟靣靤靦靧靨靪靫靬靭靮靯靰靱�靲靵靷靸靹靺靻靽靾靿鞀鞁鞂鞃鞄鞆鞇鞈鞉鞊鞌鞎鞏鞐鞓鞕鞖鞗鞙鞚鞛鞜鞝臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐�".split(""),e=0;e!=n[236].length;++e)65533!==n[236][e].charCodeAt(0)&&(r[n[236][e]]=60416+e,t[60416+e]=n[236][e]);for(n[237]="����������������������������������������������������������������鞞鞟鞡鞢鞤鞥鞦鞧鞨鞩鞪鞬鞮鞰鞱鞳鞵鞶鞷鞸鞹鞺鞻鞼鞽鞾鞿韀韁韂韃韄韅韆韇韈韉韊韋韌韍韎韏韐韑韒韓韔韕韖韗韘韙韚韛韜韝韞韟韠韡韢韣�韤韥韨韮韯韰韱韲韴韷韸韹韺韻韼韽韾響頀頁頂頃頄項順頇須頉頊頋頌頍頎怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨�".split(""),e=0;e!=n[237].length;++e)65533!==n[237][e].charCodeAt(0)&&(r[n[237][e]]=60672+e,t[60672+e]=n[237][e]);for(n[238]="����������������������������������������������������������������頏預頑頒頓頔頕頖頗領頙頚頛頜頝頞頟頠頡頢頣頤頥頦頧頨頩頪頫頬頭頮頯頰頱頲頳頴頵頶頷頸頹頺頻頼頽頾頿顀顁顂顃顄顅顆顇顈顉顊顋題額�顎顏顐顑顒顓顔顕顖顗願顙顚顛顜顝類顟顠顡顢顣顤顥顦顧顨顩顪顫顬顭顮睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶钷钸钹钺钼钽钿铄铈铉铊铋铌铍铎铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪�".split(""),e=0;e!=n[238].length;++e)65533!==n[238][e].charCodeAt(0)&&(r[n[238][e]]=60928+e,t[60928+e]=n[238][e]);for(n[239]="����������������������������������������������������������������顯顰顱顲顳顴颋颎颒颕颙颣風颩颪颫颬颭颮颯颰颱颲颳颴颵颶颷颸颹颺颻颼颽颾颿飀飁飂飃飄飅飆飇飈飉飊飋飌飍飏飐飔飖飗飛飜飝飠飡飢飣飤�飥飦飩飪飫飬飭飮飯飰飱飲飳飴飵飶飷飸飹飺飻飼飽飾飿餀餁餂餃餄餅餆餇铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒锓锔锕锖锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤镥镦镧镨镩镪镫镬镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔�".split(""),e=0;e!=n[239].length;++e)65533!==n[239][e].charCodeAt(0)&&(r[n[239][e]]=61184+e,t[61184+e]=n[239][e]);for(n[240]="����������������������������������������������������������������餈餉養餋餌餎餏餑餒餓餔餕餖餗餘餙餚餛餜餝餞餟餠餡餢餣餤餥餦餧館餩餪餫餬餭餯餰餱餲餳餴餵餶餷餸餹餺餻餼餽餾餿饀饁饂饃饄饅饆饇饈饉�饊饋饌饍饎饏饐饑饒饓饖饗饘饙饚饛饜饝饞饟饠饡饢饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨鸩鸪鸫鸬鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦鹧鹨鹩鹪鹫鹬鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙�".split(""),e=0;e!=n[240].length;++e)65533!==n[240][e].charCodeAt(0)&&(r[n[240][e]]=61440+e,t[61440+e]=n[240][e]);for(n[241]="����������������������������������������������������������������馌馎馚馛馜馝馞馟馠馡馢馣馤馦馧馩馪馫馬馭馮馯馰馱馲馳馴馵馶馷馸馹馺馻馼馽馾馿駀駁駂駃駄駅駆駇駈駉駊駋駌駍駎駏駐駑駒駓駔駕駖駗駘�駙駚駛駜駝駞駟駠駡駢駣駤駥駦駧駨駩駪駫駬駭駮駯駰駱駲駳駴駵駶駷駸駹瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃�".split(""),e=0;e!=n[241].length;++e)65533!==n[241][e].charCodeAt(0)&&(r[n[241][e]]=61696+e,t[61696+e]=n[241][e]);for(n[242]="����������������������������������������������������������������駺駻駼駽駾駿騀騁騂騃騄騅騆騇騈騉騊騋騌騍騎騏騐騑騒験騔騕騖騗騘騙騚騛騜騝騞騟騠騡騢騣騤騥騦騧騨騩騪騫騬騭騮騯騰騱騲騳騴騵騶騷騸�騹騺騻騼騽騾騿驀驁驂驃驄驅驆驇驈驉驊驋驌驍驎驏驐驑驒驓驔驕驖驗驘驙颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒�".split(""),e=0;e!=n[242].length;++e)65533!==n[242][e].charCodeAt(0)&&(r[n[242][e]]=61952+e,t[61952+e]=n[242][e]);for(n[243]="����������������������������������������������������������������驚驛驜驝驞驟驠驡驢驣驤驥驦驧驨驩驪驫驲骃骉骍骎骔骕骙骦骩骪骫骬骭骮骯骲骳骴骵骹骻骽骾骿髃髄髆髇髈髉髊髍髎髏髐髒體髕髖髗髙髚髛髜�髝髞髠髢髣髤髥髧髨髩髪髬髮髰髱髲髳髴髵髶髷髸髺髼髽髾髿鬀鬁鬂鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋�".split(""),e=0;e!=n[243].length;++e)65533!==n[243][e].charCodeAt(0)&&(r[n[243][e]]=62208+e,t[62208+e]=n[243][e]);for(n[244]="����������������������������������������������������������������鬇鬉鬊鬋鬌鬍鬎鬐鬑鬒鬔鬕鬖鬗鬘鬙鬚鬛鬜鬝鬞鬠鬡鬢鬤鬥鬦鬧鬨鬩鬪鬫鬬鬭鬮鬰鬱鬳鬴鬵鬶鬷鬸鬹鬺鬽鬾鬿魀魆魊魋魌魎魐魒魓魕魖魗魘魙魚�魛魜魝魞魟魠魡魢魣魤魥魦魧魨魩魪魫魬魭魮魯魰魱魲魳魴魵魶魷魸魹魺魻簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤�".split(""),e=0;e!=n[244].length;++e)65533!==n[244][e].charCodeAt(0)&&(r[n[244][e]]=62464+e,t[62464+e]=n[244][e]);for(n[245]="����������������������������������������������������������������魼魽魾魿鮀鮁鮂鮃鮄鮅鮆鮇鮈鮉鮊鮋鮌鮍鮎鮏鮐鮑鮒鮓鮔鮕鮖鮗鮘鮙鮚鮛鮜鮝鮞鮟鮠鮡鮢鮣鮤鮥鮦鮧鮨鮩鮪鮫鮬鮭鮮鮯鮰鮱鮲鮳鮴鮵鮶鮷鮸鮹鮺�鮻鮼鮽鮾鮿鯀鯁鯂鯃鯄鯅鯆鯇鯈鯉鯊鯋鯌鯍鯎鯏鯐鯑鯒鯓鯔鯕鯖鯗鯘鯙鯚鯛酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜�".split(""),e=0;e!=n[245].length;++e)65533!==n[245][e].charCodeAt(0)&&(r[n[245][e]]=62720+e,t[62720+e]=n[245][e]);for(n[246]="����������������������������������������������������������������鯜鯝鯞鯟鯠鯡鯢鯣鯤鯥鯦鯧鯨鯩鯪鯫鯬鯭鯮鯯鯰鯱鯲鯳鯴鯵鯶鯷鯸鯹鯺鯻鯼鯽鯾鯿鰀鰁鰂鰃鰄鰅鰆鰇鰈鰉鰊鰋鰌鰍鰎鰏鰐鰑鰒鰓鰔鰕鰖鰗鰘鰙鰚�鰛鰜鰝鰞鰟鰠鰡鰢鰣鰤鰥鰦鰧鰨鰩鰪鰫鰬鰭鰮鰯鰰鰱鰲鰳鰴鰵鰶鰷鰸鰹鰺鰻觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅龆龇龈龉龊龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞鲟鲠鲡鲢鲣鲥鲦鲧鲨鲩鲫鲭鲮鲰鲱鲲鲳鲴鲵鲶鲷鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋�".split(""),e=0;e!=n[246].length;++e)65533!==n[246][e].charCodeAt(0)&&(r[n[246][e]]=62976+e,t[62976+e]=n[246][e]);for(n[247]="����������������������������������������������������������������鰼鰽鰾鰿鱀鱁鱂鱃鱄鱅鱆鱇鱈鱉鱊鱋鱌鱍鱎鱏鱐鱑鱒鱓鱔鱕鱖鱗鱘鱙鱚鱛鱜鱝鱞鱟鱠鱡鱢鱣鱤鱥鱦鱧鱨鱩鱪鱫鱬鱭鱮鱯鱰鱱鱲鱳鱴鱵鱶鱷鱸鱹鱺�鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾鲿鳀鳁鳂鳈鳉鳑鳒鳚鳛鳠鳡鳌鳍鳎鳏鳐鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄�".split(""),e=0;e!=n[247].length;++e)65533!==n[247][e].charCodeAt(0)&&(r[n[247][e]]=63232+e,t[63232+e]=n[247][e]);for(n[248]="����������������������������������������������������������������鳣鳤鳥鳦鳧鳨鳩鳪鳫鳬鳭鳮鳯鳰鳱鳲鳳鳴鳵鳶鳷鳸鳹鳺鳻鳼鳽鳾鳿鴀鴁鴂鴃鴄鴅鴆鴇鴈鴉鴊鴋鴌鴍鴎鴏鴐鴑鴒鴓鴔鴕鴖鴗鴘鴙鴚鴛鴜鴝鴞鴟鴠鴡�鴢鴣鴤鴥鴦鴧鴨鴩鴪鴫鴬鴭鴮鴯鴰鴱鴲鴳鴴鴵鴶鴷鴸鴹鴺鴻鴼鴽鴾鴿鵀鵁鵂�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[248].length;++e)65533!==n[248][e].charCodeAt(0)&&(r[n[248][e]]=63488+e,t[63488+e]=n[248][e]);for(n[249]="����������������������������������������������������������������鵃鵄鵅鵆鵇鵈鵉鵊鵋鵌鵍鵎鵏鵐鵑鵒鵓鵔鵕鵖鵗鵘鵙鵚鵛鵜鵝鵞鵟鵠鵡鵢鵣鵤鵥鵦鵧鵨鵩鵪鵫鵬鵭鵮鵯鵰鵱鵲鵳鵴鵵鵶鵷鵸鵹鵺鵻鵼鵽鵾鵿鶀鶁�鶂鶃鶄鶅鶆鶇鶈鶉鶊鶋鶌鶍鶎鶏鶐鶑鶒鶓鶔鶕鶖鶗鶘鶙鶚鶛鶜鶝鶞鶟鶠鶡鶢�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[249].length;++e)65533!==n[249][e].charCodeAt(0)&&(r[n[249][e]]=63744+e,t[63744+e]=n[249][e]);for(n[250]="����������������������������������������������������������������鶣鶤鶥鶦鶧鶨鶩鶪鶫鶬鶭鶮鶯鶰鶱鶲鶳鶴鶵鶶鶷鶸鶹鶺鶻鶼鶽鶾鶿鷀鷁鷂鷃鷄鷅鷆鷇鷈鷉鷊鷋鷌鷍鷎鷏鷐鷑鷒鷓鷔鷕鷖鷗鷘鷙鷚鷛鷜鷝鷞鷟鷠鷡�鷢鷣鷤鷥鷦鷧鷨鷩鷪鷫鷬鷭鷮鷯鷰鷱鷲鷳鷴鷵鷶鷷鷸鷹鷺鷻鷼鷽鷾鷿鸀鸁鸂�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[250].length;++e)65533!==n[250][e].charCodeAt(0)&&(r[n[250][e]]=64e3+e,t[64e3+e]=n[250][e]);for(n[251]="����������������������������������������������������������������鸃鸄鸅鸆鸇鸈鸉鸊鸋鸌鸍鸎鸏鸐鸑鸒鸓鸔鸕鸖鸗鸘鸙鸚鸛鸜鸝鸞鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴鹵鹶鹷鹸鹹鹺鹻鹼鹽麀�麁麃麄麅麆麉麊麌麍麎麏麐麑麔麕麖麗麘麙麚麛麜麞麠麡麢麣麤麥麧麨麩麪�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[251].length;++e)65533!==n[251][e].charCodeAt(0)&&(r[n[251][e]]=64256+e,t[64256+e]=n[251][e]);for(n[252]="����������������������������������������������������������������麫麬麭麮麯麰麱麲麳麵麶麷麹麺麼麿黀黁黂黃黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰黱黲黳黴黵黶黷黸黺黽黿鼀鼁鼂鼃鼄鼅�鼆鼇鼈鼉鼊鼌鼏鼑鼒鼔鼕鼖鼘鼚鼛鼜鼝鼞鼟鼡鼣鼤鼥鼦鼧鼨鼩鼪鼫鼭鼮鼰鼱�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[252].length;++e)65533!==n[252][e].charCodeAt(0)&&(r[n[252][e]]=64512+e,t[64512+e]=n[252][e]);for(n[253]="����������������������������������������������������������������鼲鼳鼴鼵鼶鼸鼺鼼鼿齀齁齂齃齅齆齇齈齉齊齋齌齍齎齏齒齓齔齕齖齗齘齙齚齛齜齝齞齟齠齡齢齣齤齥齦齧齨齩齪齫齬齭齮齯齰齱齲齳齴齵齶齷齸�齹齺齻齼齽齾龁龂龍龎龏龐龑龒龓龔龕龖龗龘龜龝龞龡龢龣龤龥郎凉秊裏隣�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[253].length;++e)65533!==n[253][e].charCodeAt(0)&&(r[n[253][e]]=64768+e,t[64768+e]=n[253][e]);for(n[254]="����������������������������������������������������������������兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������".split(""),e=0;e!=n[254].length;++e)65533!==n[254][e].charCodeAt(0)&&(r[n[254][e]]=65024+e,t[65024+e]=n[254][e]);return{enc:r,dec:t}}(),t[949]=function(){var e,t=[],r={},n=[];for(n[0]="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������".split(""),e=0;e!=n[0].length;++e)65533!==n[0][e].charCodeAt(0)&&(r[n[0][e]]=0+e,t[0+e]=n[0][e]);for(n[129]="�����������������������������������������������������������������갂갃갅갆갋갌갍갎갏갘갞갟갡갢갣갥갦갧갨갩갪갫갮갲갳갴������갵갶갷갺갻갽갾갿걁걂걃걄걅걆걇걈걉걊걌걎걏걐걑걒걓걕������걖걗걙걚걛걝걞걟걠걡걢걣걤걥걦걧걨걩걪걫걬걭걮걯걲걳걵걶걹걻걼걽걾걿겂겇겈겍겎겏겑겒겓겕겖겗겘겙겚겛겞겢겣겤겥겦겧겫겭겮겱겲겳겴겵겶겷겺겾겿곀곂곃곅곆곇곉곊곋곍곎곏곐곑곒곓곔곖곘곙곚곛곜곝곞곟곢곣곥곦곩곫곭곮곲곴곷곸곹곺곻곾곿괁괂괃괅괇괈괉괊괋괎괐괒괓�".split(""),e=0;e!=n[129].length;++e)65533!==n[129][e].charCodeAt(0)&&(r[n[129][e]]=33024+e,t[33024+e]=n[129][e]);for(n[130]="�����������������������������������������������������������������괔괕괖괗괙괚괛괝괞괟괡괢괣괤괥괦괧괨괪괫괮괯괰괱괲괳������괶괷괹괺괻괽괾괿굀굁굂굃굆굈굊굋굌굍굎굏굑굒굓굕굖굗������굙굚굛굜굝굞굟굠굢굤굥굦굧굨굩굪굫굮굯굱굲굷굸굹굺굾궀궃궄궅궆궇궊궋궍궎궏궑궒궓궔궕궖궗궘궙궚궛궞궟궠궡궢궣궥궦궧궨궩궪궫궬궭궮궯궰궱궲궳궴궵궶궸궹궺궻궼궽궾궿귂귃귅귆귇귉귊귋귌귍귎귏귒귔귕귖귗귘귙귚귛귝귞귟귡귢귣귥귦귧귨귩귪귫귬귭귮귯귰귱귲귳귴귵귶귷�".split(""),e=0;e!=n[130].length;++e)65533!==n[130][e].charCodeAt(0)&&(r[n[130][e]]=33280+e,t[33280+e]=n[130][e]);for(n[131]="�����������������������������������������������������������������귺귻귽귾긂긃긄긅긆긇긊긌긎긏긐긑긒긓긕긖긗긘긙긚긛긜������긝긞긟긠긡긢긣긤긥긦긧긨긩긪긫긬긭긮긯긲긳긵긶긹긻긼������긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗깘깙깚깛깞깢깣깤깦깧깪깫깭깮깯깱깲깳깴깵깶깷깺깾깿꺀꺁꺂꺃꺆꺇꺈꺉꺊꺋꺍꺎꺏꺐꺑꺒꺓꺔꺕꺖꺗꺘꺙꺚꺛꺜꺝꺞꺟꺠꺡꺢꺣꺤꺥꺦꺧꺨꺩꺪꺫꺬꺭꺮꺯꺰꺱꺲꺳꺴꺵꺶꺷꺸꺹꺺꺻꺿껁껂껃껅껆껇껈껉껊껋껎껒껓껔껕껖껗껚껛껝껞껟껠껡껢껣껤껥�".split(""),e=0;e!=n[131].length;++e)65533!==n[131][e].charCodeAt(0)&&(r[n[131][e]]=33536+e,t[33536+e]=n[131][e]);for(n[132]="�����������������������������������������������������������������껦껧껩껪껬껮껯껰껱껲껳껵껶껷껹껺껻껽껾껿꼀꼁꼂꼃꼄꼅������꼆꼉꼊꼋꼌꼎꼏꼑꼒꼓꼔꼕꼖꼗꼘꼙꼚꼛꼜꼝꼞꼟꼠꼡꼢꼣������꼤꼥꼦꼧꼨꼩꼪꼫꼮꼯꼱꼳꼵꼶꼷꼸꼹꼺꼻꼾꽀꽄꽅꽆꽇꽊꽋꽌꽍꽎꽏꽑꽒꽓꽔꽕꽖꽗꽘꽙꽚꽛꽞꽟꽠꽡꽢꽣꽦꽧꽨꽩꽪꽫꽬꽭꽮꽯꽰꽱꽲꽳꽴꽵꽶꽷꽸꽺꽻꽼꽽꽾꽿꾁꾂꾃꾅꾆꾇꾉꾊꾋꾌꾍꾎꾏꾒꾓꾔꾖꾗꾘꾙꾚꾛꾝꾞꾟꾠꾡꾢꾣꾤꾥꾦꾧꾨꾩꾪꾫꾬꾭꾮꾯꾰꾱꾲꾳꾴꾵꾶꾷꾺꾻꾽꾾�".split(""),e=0;e!=n[132].length;++e)65533!==n[132][e].charCodeAt(0)&&(r[n[132][e]]=33792+e,t[33792+e]=n[132][e]);for(n[133]="�����������������������������������������������������������������꾿꿁꿂꿃꿄꿅꿆꿊꿌꿏꿐꿑꿒꿓꿕꿖꿗꿘꿙꿚꿛꿝꿞꿟꿠꿡������꿢꿣꿤꿥꿦꿧꿪꿫꿬꿭꿮꿯꿲꿳꿵꿶꿷꿹꿺꿻꿼꿽꿾꿿뀂뀃������뀅뀆뀇뀈뀉뀊뀋뀍뀎뀏뀑뀒뀓뀕뀖뀗뀘뀙뀚뀛뀞뀟뀠뀡뀢뀣뀤뀥뀦뀧뀩뀪뀫뀬뀭뀮뀯뀰뀱뀲뀳뀴뀵뀶뀷뀸뀹뀺뀻뀼뀽뀾뀿끀끁끂끃끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞끟끠끡끢끣끤끥끦끧끨끩끪끫끬끭끮끯끰끱끲끳끴끵끶끷끸끹끺끻끾끿낁낂낃낅낆낇낈낉낊낋낎낐낒낓낔낕낖낗낛낝낞낣낤�".split(""),e=0;e!=n[133].length;++e)65533!==n[133][e].charCodeAt(0)&&(r[n[133][e]]=34048+e,t[34048+e]=n[133][e]);for(n[134]="�����������������������������������������������������������������낥낦낧낪낰낲낶낷낹낺낻낽낾낿냀냁냂냃냆냊냋냌냍냎냏냒������냓냕냖냗냙냚냛냜냝냞냟냡냢냣냤냦냧냨냩냪냫냬냭냮냯냰������냱냲냳냴냵냶냷냸냹냺냻냼냽냾냿넀넁넂넃넄넅넆넇넊넍넎넏넑넔넕넖넗넚넞넟넠넡넢넦넧넩넪넫넭넮넯넰넱넲넳넶넺넻넼넽넾넿녂녃녅녆녇녉녊녋녌녍녎녏녒녓녖녗녙녚녛녝녞녟녡녢녣녤녥녦녧녨녩녪녫녬녭녮녯녰녱녲녳녴녵녶녷녺녻녽녾녿놁놃놄놅놆놇놊놌놎놏놐놑놕놖놗놙놚놛놝�".split(""),e=0;e!=n[134].length;++e)65533!==n[134][e].charCodeAt(0)&&(r[n[134][e]]=34304+e,t[34304+e]=n[134][e]);for(n[135]="�����������������������������������������������������������������놞놟놠놡놢놣놤놥놦놧놩놪놫놬놭놮놯놰놱놲놳놴놵놶놷놸������놹놺놻놼놽놾놿뇀뇁뇂뇃뇄뇅뇆뇇뇈뇉뇊뇋뇍뇎뇏뇑뇒뇓뇕������뇖뇗뇘뇙뇚뇛뇞뇠뇡뇢뇣뇤뇥뇦뇧뇪뇫뇭뇮뇯뇱뇲뇳뇴뇵뇶뇷뇸뇺뇼뇾뇿눀눁눂눃눆눇눉눊눍눎눏눐눑눒눓눖눘눚눛눜눝눞눟눡눢눣눤눥눦눧눨눩눪눫눬눭눮눯눰눱눲눳눵눶눷눸눹눺눻눽눾눿뉀뉁뉂뉃뉄뉅뉆뉇뉈뉉뉊뉋뉌뉍뉎뉏뉐뉑뉒뉓뉔뉕뉖뉗뉙뉚뉛뉝뉞뉟뉡뉢뉣뉤뉥뉦뉧뉪뉫뉬뉭뉮�".split(""),e=0;e!=n[135].length;++e)65533!==n[135][e].charCodeAt(0)&&(r[n[135][e]]=34560+e,t[34560+e]=n[135][e]);for(n[136]="�����������������������������������������������������������������뉯뉰뉱뉲뉳뉶뉷뉸뉹뉺뉻뉽뉾뉿늀늁늂늃늆늇늈늊늋늌늍늎������늏늒늓늕늖늗늛늜늝늞늟늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷������늸늹늺늻늼늽늾늿닀닁닂닃닄닅닆닇닊닋닍닎닏닑닓닔닕닖닗닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉댊댋댌댍댎댏댒댖댗댘댙댚댛댝댞댟댠댡댢댣댤댥댦댧댨댩댪댫댬댭댮댯댰댱댲댳댴댵댶댷댸댹댺댻댼댽댾댿덀덁덂덃덄덅덆덇덈덉덊덋덌덍덎덏덐덑덒덓덗덙덚덝덠덡덢덣�".split(""),e=0;e!=n[136].length;++e)65533!==n[136][e].charCodeAt(0)&&(r[n[136][e]]=34816+e,t[34816+e]=n[136][e]);for(n[137]="�����������������������������������������������������������������덦덨덪덬덭덯덲덳덵덶덷덹덺덻덼덽덾덿뎂뎆뎇뎈뎉뎊뎋뎍������뎎뎏뎑뎒뎓뎕뎖뎗뎘뎙뎚뎛뎜뎝뎞뎟뎢뎣뎤뎥뎦뎧뎩뎪뎫뎭������뎮뎯뎰뎱뎲뎳뎴뎵뎶뎷뎸뎹뎺뎻뎼뎽뎾뎿돀돁돂돃돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩돪돫돬돭돮돯돰돱돲돳돴돵돶돷돸돹돺돻돽돾돿됀됁됂됃됄됅됆됇됈됉됊됋됌됍됎됏됑됒됓됔됕됖됗됙됚됛됝됞됟됡됢됣됤됥됦됧됪됬됭됮됯됰됱됲됳됵됶됷됸됹됺됻됼됽됾됿둀둁둂둃둄�".split(""),e=0;e!=n[137].length;++e)65533!==n[137][e].charCodeAt(0)&&(r[n[137][e]]=35072+e,t[35072+e]=n[137][e]);for(n[138]="�����������������������������������������������������������������둅둆둇둈둉둊둋둌둍둎둏둒둓둕둖둗둙둚둛둜둝둞둟둢둤둦������둧둨둩둪둫둭둮둯둰둱둲둳둴둵둶둷둸둹둺둻둼둽둾둿뒁뒂������뒃뒄뒅뒆뒇뒉뒊뒋뒌뒍뒎뒏뒐뒑뒒뒓뒔뒕뒖뒗뒘뒙뒚뒛뒜뒞뒟뒠뒡뒢뒣뒥뒦뒧뒩뒪뒫뒭뒮뒯뒰뒱뒲뒳뒴뒶뒸뒺뒻뒼뒽뒾뒿듁듂듃듅듆듇듉듊듋듌듍듎듏듑듒듓듔듖듗듘듙듚듛듞듟듡듢듥듧듨듩듪듫듮듰듲듳듴듵듶듷듹듺듻듼듽듾듿딀딁딂딃딄딅딆딇딈딉딊딋딌딍딎딏딐딑딒딓딖딗딙딚딝�".split(""),e=0;e!=n[138].length;++e)65533!==n[138][e].charCodeAt(0)&&(r[n[138][e]]=35328+e,t[35328+e]=n[138][e]);for(n[139]="�����������������������������������������������������������������딞딟딠딡딢딣딦딫딬딭딮딯딲딳딵딶딷딹딺딻딼딽딾딿땂땆������땇땈땉땊땎땏땑땒땓땕땖땗땘땙땚땛땞땢땣땤땥땦땧땨땩땪������땫땬땭땮땯땰땱땲땳땴땵땶땷땸땹땺땻땼땽땾땿떀떁떂떃떄떅떆떇떈떉떊떋떌떍떎떏떐떑떒떓떔떕떖떗떘떙떚떛떜떝떞떟떢떣떥떦떧떩떬떭떮떯떲떶떷떸떹떺떾떿뗁뗂뗃뗅뗆뗇뗈뗉뗊뗋뗎뗒뗓뗔뗕뗖뗗뗙뗚뗛뗜뗝뗞뗟뗠뗡뗢뗣뗤뗥뗦뗧뗨뗩뗪뗫뗭뗮뗯뗰뗱뗲뗳뗴뗵뗶뗷뗸뗹뗺뗻뗼뗽뗾뗿�".split(""),e=0;e!=n[139].length;++e)65533!==n[139][e].charCodeAt(0)&&(r[n[139][e]]=35584+e,t[35584+e]=n[139][e]);for(n[140]="�����������������������������������������������������������������똀똁똂똃똄똅똆똇똈똉똊똋똌똍똎똏똒똓똕똖똗똙똚똛똜똝������똞똟똠똡똢똣똤똦똧똨똩똪똫똭똮똯똰똱똲똳똵똶똷똸똹똺������똻똼똽똾똿뙀뙁뙂뙃뙄뙅뙆뙇뙉뙊뙋뙌뙍뙎뙏뙐뙑뙒뙓뙔뙕뙖뙗뙘뙙뙚뙛뙜뙝뙞뙟뙠뙡뙢뙣뙥뙦뙧뙩뙪뙫뙬뙭뙮뙯뙰뙱뙲뙳뙴뙵뙶뙷뙸뙹뙺뙻뙼뙽뙾뙿뚀뚁뚂뚃뚄뚅뚆뚇뚈뚉뚊뚋뚌뚍뚎뚏뚐뚑뚒뚓뚔뚕뚖뚗뚘뚙뚚뚛뚞뚟뚡뚢뚣뚥뚦뚧뚨뚩뚪뚭뚮뚯뚰뚲뚳뚴뚵뚶뚷뚸뚹뚺뚻뚼뚽뚾뚿뛀뛁뛂�".split(""),e=0;e!=n[140].length;++e)65533!==n[140][e].charCodeAt(0)&&(r[n[140][e]]=35840+e,t[35840+e]=n[140][e]);for(n[141]="�����������������������������������������������������������������뛃뛄뛅뛆뛇뛈뛉뛊뛋뛌뛍뛎뛏뛐뛑뛒뛓뛕뛖뛗뛘뛙뛚뛛뛜뛝������뛞뛟뛠뛡뛢뛣뛤뛥뛦뛧뛨뛩뛪뛫뛬뛭뛮뛯뛱뛲뛳뛵뛶뛷뛹뛺������뛻뛼뛽뛾뛿뜂뜃뜄뜆뜇뜈뜉뜊뜋뜌뜍뜎뜏뜐뜑뜒뜓뜔뜕뜖뜗뜘뜙뜚뜛뜜뜝뜞뜟뜠뜡뜢뜣뜤뜥뜦뜧뜪뜫뜭뜮뜱뜲뜳뜴뜵뜶뜷뜺뜼뜽뜾뜿띀띁띂띃띅띆띇띉띊띋띍띎띏띐띑띒띓띖띗띘띙띚띛띜띝띞띟띡띢띣띥띦띧띩띪띫띬띭띮띯띲띴띶띷띸띹띺띻띾띿랁랂랃랅랆랇랈랉랊랋랎랓랔랕랚랛랝랞�".split(""),e=0;e!=n[141].length;++e)65533!==n[141][e].charCodeAt(0)&&(r[n[141][e]]=36096+e,t[36096+e]=n[141][e]);for(n[142]="�����������������������������������������������������������������랟랡랢랣랤랥랦랧랪랮랯랰랱랲랳랶랷랹랺랻랼랽랾랿럀럁������럂럃럄럅럆럈럊럋럌럍럎럏럐럑럒럓럔럕럖럗럘럙럚럛럜럝������럞럟럠럡럢럣럤럥럦럧럨럩럪럫럮럯럱럲럳럵럶럷럸럹럺럻럾렂렃렄렅렆렊렋렍렎렏렑렒렓렔렕렖렗렚렜렞렟렠렡렢렣렦렧렩렪렫렭렮렯렰렱렲렳렶렺렻렼렽렾렿롁롂롃롅롆롇롈롉롊롋롌롍롎롏롐롒롔롕롖롗롘롙롚롛롞롟롡롢롣롥롦롧롨롩롪롫롮롰롲롳롴롵롶롷롹롺롻롽롾롿뢀뢁뢂뢃뢄�".split(""),e=0;e!=n[142].length;++e)65533!==n[142][e].charCodeAt(0)&&(r[n[142][e]]=36352+e,t[36352+e]=n[142][e]);for(n[143]="�����������������������������������������������������������������뢅뢆뢇뢈뢉뢊뢋뢌뢎뢏뢐뢑뢒뢓뢔뢕뢖뢗뢘뢙뢚뢛뢜뢝뢞뢟������뢠뢡뢢뢣뢤뢥뢦뢧뢩뢪뢫뢬뢭뢮뢯뢱뢲뢳뢵뢶뢷뢹뢺뢻뢼뢽������뢾뢿룂룄룆룇룈룉룊룋룍룎룏룑룒룓룕룖룗룘룙룚룛룜룞룠룢룣룤룥룦룧룪룫룭룮룯룱룲룳룴룵룶룷룺룼룾룿뤀뤁뤂뤃뤅뤆뤇뤈뤉뤊뤋뤌뤍뤎뤏뤐뤑뤒뤓뤔뤕뤖뤗뤙뤚뤛뤜뤝뤞뤟뤡뤢뤣뤤뤥뤦뤧뤨뤩뤪뤫뤬뤭뤮뤯뤰뤱뤲뤳뤴뤵뤶뤷뤸뤹뤺뤻뤾뤿륁륂륃륅륆륇륈륉륊륋륍륎륐륒륓륔륕륖륗�".split(""),e=0;e!=n[143].length;++e)65533!==n[143][e].charCodeAt(0)&&(r[n[143][e]]=36608+e,t[36608+e]=n[143][e]);for(n[144]="�����������������������������������������������������������������륚륛륝륞륟륡륢륣륤륥륦륧륪륬륮륯륰륱륲륳륶륷륹륺륻륽������륾륿릀릁릂릃릆릈릋릌릏릐릑릒릓릔릕릖릗릘릙릚릛릜릝릞������릟릠릡릢릣릤릥릦릧릨릩릪릫릮릯릱릲릳릵릶릷릸릹릺릻릾맀맂맃맄맅맆맇맊맋맍맓맔맕맖맗맚맜맟맠맢맦맧맩맪맫맭맮맯맰맱맲맳맶맻맼맽맾맿먂먃먄먅먆먇먉먊먋먌먍먎먏먐먑먒먓먔먖먗먘먙먚먛먜먝먞먟먠먡먢먣먤먥먦먧먨먩먪먫먬먭먮먯먰먱먲먳먴먵먶먷먺먻먽먾먿멁멃멄멅멆�".split(""),e=0;e!=n[144].length;++e)65533!==n[144][e].charCodeAt(0)&&(r[n[144][e]]=36864+e,t[36864+e]=n[144][e]);for(n[145]="�����������������������������������������������������������������멇멊멌멏멐멑멒멖멗멙멚멛멝멞멟멠멡멢멣멦멪멫멬멭멮멯������멲멳멵멶멷멹멺멻멼멽멾멿몀몁몂몆몈몉몊몋몍몎몏몐몑몒������몓몔몕몖몗몘몙몚몛몜몝몞몟몠몡몢몣몤몥몦몧몪몭몮몯몱몳몴몵몶몷몺몼몾몿뫀뫁뫂뫃뫅뫆뫇뫉뫊뫋뫌뫍뫎뫏뫐뫑뫒뫓뫔뫕뫖뫗뫚뫛뫜뫝뫞뫟뫠뫡뫢뫣뫤뫥뫦뫧뫨뫩뫪뫫뫬뫭뫮뫯뫰뫱뫲뫳뫴뫵뫶뫷뫸뫹뫺뫻뫽뫾뫿묁묂묃묅묆묇묈묉묊묋묌묎묐묒묓묔묕묖묗묙묚묛묝묞묟묡묢묣묤묥묦묧�".split(""),e=0;e!=n[145].length;++e)65533!==n[145][e].charCodeAt(0)&&(r[n[145][e]]=37120+e,t[37120+e]=n[145][e]);for(n[146]="�����������������������������������������������������������������묨묪묬묭묮묯묰묱묲묳묷묹묺묿뭀뭁뭂뭃뭆뭈뭊뭋뭌뭎뭑뭒������뭓뭕뭖뭗뭙뭚뭛뭜뭝뭞뭟뭠뭢뭤뭥뭦뭧뭨뭩뭪뭫뭭뭮뭯뭰뭱������뭲뭳뭴뭵뭶뭷뭸뭹뭺뭻뭼뭽뭾뭿뮀뮁뮂뮃뮄뮅뮆뮇뮉뮊뮋뮍뮎뮏뮑뮒뮓뮔뮕뮖뮗뮘뮙뮚뮛뮜뮝뮞뮟뮠뮡뮢뮣뮥뮦뮧뮩뮪뮫뮭뮮뮯뮰뮱뮲뮳뮵뮶뮸뮹뮺뮻뮼뮽뮾뮿믁믂믃믅믆믇믉믊믋믌믍믎믏믑믒믔믕믖믗믘믙믚믛믜믝믞믟믠믡믢믣믤믥믦믧믨믩믪믫믬믭믮믯믰믱믲믳믴믵믶믷믺믻믽믾밁�".split(""),e=0;e!=n[146].length;++e)65533!==n[146][e].charCodeAt(0)&&(r[n[146][e]]=37376+e,t[37376+e]=n[146][e]);for(n[147]="�����������������������������������������������������������������밃밄밅밆밇밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵������밶밷밹밺밻밼밽밾밿뱂뱆뱇뱈뱊뱋뱎뱏뱑뱒뱓뱔뱕뱖뱗뱘뱙������뱚뱛뱜뱞뱟뱠뱡뱢뱣뱤뱥뱦뱧뱨뱩뱪뱫뱬뱭뱮뱯뱰뱱뱲뱳뱴뱵뱶뱷뱸뱹뱺뱻뱼뱽뱾뱿벀벁벂벃벆벇벉벊벍벏벐벑벒벓벖벘벛벜벝벞벟벢벣벥벦벩벪벫벬벭벮벯벲벶벷벸벹벺벻벾벿볁볂볃볅볆볇볈볉볊볋볌볎볒볓볔볖볗볙볚볛볝볞볟볠볡볢볣볤볥볦볧볨볩볪볫볬볭볮볯볰볱볲볳볷볹볺볻볽�".split(""),e=0;e!=n[147].length;++e)65533!==n[147][e].charCodeAt(0)&&(r[n[147][e]]=37632+e,t[37632+e]=n[147][e]);for(n[148]="�����������������������������������������������������������������볾볿봀봁봂봃봆봈봊봋봌봍봎봏봑봒봓봕봖봗봘봙봚봛봜봝������봞봟봠봡봢봣봥봦봧봨봩봪봫봭봮봯봰봱봲봳봴봵봶봷봸봹������봺봻봼봽봾봿뵁뵂뵃뵄뵅뵆뵇뵊뵋뵍뵎뵏뵑뵒뵓뵔뵕뵖뵗뵚뵛뵜뵝뵞뵟뵠뵡뵢뵣뵥뵦뵧뵩뵪뵫뵬뵭뵮뵯뵰뵱뵲뵳뵴뵵뵶뵷뵸뵹뵺뵻뵼뵽뵾뵿붂붃붅붆붋붌붍붎붏붒붔붖붗붘붛붝붞붟붠붡붢붣붥붦붧붨붩붪붫붬붭붮붯붱붲붳붴붵붶붷붹붺붻붼붽붾붿뷀뷁뷂뷃뷄뷅뷆뷇뷈뷉뷊뷋뷌뷍뷎뷏뷐뷑�".split(""),e=0;e!=n[148].length;++e)65533!==n[148][e].charCodeAt(0)&&(r[n[148][e]]=37888+e,t[37888+e]=n[148][e]);for(n[149]="�����������������������������������������������������������������뷒뷓뷖뷗뷙뷚뷛뷝뷞뷟뷠뷡뷢뷣뷤뷥뷦뷧뷨뷪뷫뷬뷭뷮뷯뷱������뷲뷳뷵뷶뷷뷹뷺뷻뷼뷽뷾뷿븁븂븄븆븇븈븉븊븋븎븏븑븒븓������븕븖븗븘븙븚븛븞븠븡븢븣븤븥븦븧븨븩븪븫븬븭븮븯븰븱븲븳븴븵븶븷븸븹븺븻븼븽븾븿빀빁빂빃빆빇빉빊빋빍빏빐빑빒빓빖빘빜빝빞빟빢빣빥빦빧빩빫빬빭빮빯빲빶빷빸빹빺빾빿뺁뺂뺃뺅뺆뺇뺈뺉뺊뺋뺎뺒뺓뺔뺕뺖뺗뺚뺛뺜뺝뺞뺟뺠뺡뺢뺣뺤뺥뺦뺧뺩뺪뺫뺬뺭뺮뺯뺰뺱뺲뺳뺴뺵뺶뺷�".split(""),e=0;e!=n[149].length;++e)65533!==n[149][e].charCodeAt(0)&&(r[n[149][e]]=38144+e,t[38144+e]=n[149][e]);for(n[150]="�����������������������������������������������������������������뺸뺹뺺뺻뺼뺽뺾뺿뻀뻁뻂뻃뻄뻅뻆뻇뻈뻉뻊뻋뻌뻍뻎뻏뻒뻓������뻕뻖뻙뻚뻛뻜뻝뻞뻟뻡뻢뻦뻧뻨뻩뻪뻫뻭뻮뻯뻰뻱뻲뻳뻴뻵������뻶뻷뻸뻹뻺뻻뻼뻽뻾뻿뼀뼂뼃뼄뼅뼆뼇뼊뼋뼌뼍뼎뼏뼐뼑뼒뼓뼔뼕뼖뼗뼚뼞뼟뼠뼡뼢뼣뼤뼥뼦뼧뼨뼩뼪뼫뼬뼭뼮뼯뼰뼱뼲뼳뼴뼵뼶뼷뼸뼹뼺뼻뼼뼽뼾뼿뽂뽃뽅뽆뽇뽉뽊뽋뽌뽍뽎뽏뽒뽓뽔뽖뽗뽘뽙뽚뽛뽜뽝뽞뽟뽠뽡뽢뽣뽤뽥뽦뽧뽨뽩뽪뽫뽬뽭뽮뽯뽰뽱뽲뽳뽴뽵뽶뽷뽸뽹뽺뽻뽼뽽뽾뽿뾀뾁뾂�".split(""),e=0;e!=n[150].length;++e)65533!==n[150][e].charCodeAt(0)&&(r[n[150][e]]=38400+e,t[38400+e]=n[150][e]);for(n[151]="�����������������������������������������������������������������뾃뾄뾅뾆뾇뾈뾉뾊뾋뾌뾍뾎뾏뾐뾑뾒뾓뾕뾖뾗뾘뾙뾚뾛뾜뾝������뾞뾟뾠뾡뾢뾣뾤뾥뾦뾧뾨뾩뾪뾫뾬뾭뾮뾯뾱뾲뾳뾴뾵뾶뾷뾸������뾹뾺뾻뾼뾽뾾뾿뿀뿁뿂뿃뿄뿆뿇뿈뿉뿊뿋뿎뿏뿑뿒뿓뿕뿖뿗뿘뿙뿚뿛뿝뿞뿠뿢뿣뿤뿥뿦뿧뿨뿩뿪뿫뿬뿭뿮뿯뿰뿱뿲뿳뿴뿵뿶뿷뿸뿹뿺뿻뿼뿽뿾뿿쀀쀁쀂쀃쀄쀅쀆쀇쀈쀉쀊쀋쀌쀍쀎쀏쀐쀑쀒쀓쀔쀕쀖쀗쀘쀙쀚쀛쀜쀝쀞쀟쀠쀡쀢쀣쀤쀥쀦쀧쀨쀩쀪쀫쀬쀭쀮쀯쀰쀱쀲쀳쀴쀵쀶쀷쀸쀹쀺쀻쀽쀾쀿�".split(""),e=0;e!=n[151].length;++e)65533!==n[151][e].charCodeAt(0)&&(r[n[151][e]]=38656+e,t[38656+e]=n[151][e]);for(n[152]="�����������������������������������������������������������������쁀쁁쁂쁃쁄쁅쁆쁇쁈쁉쁊쁋쁌쁍쁎쁏쁐쁒쁓쁔쁕쁖쁗쁙쁚쁛������쁝쁞쁟쁡쁢쁣쁤쁥쁦쁧쁪쁫쁬쁭쁮쁯쁰쁱쁲쁳쁴쁵쁶쁷쁸쁹������쁺쁻쁼쁽쁾쁿삀삁삂삃삄삅삆삇삈삉삊삋삌삍삎삏삒삓삕삖삗삙삚삛삜삝삞삟삢삤삦삧삨삩삪삫삮삱삲삷삸삹삺삻삾샂샃샄샆샇샊샋샍샎샏샑샒샓샔샕샖샗샚샞샟샠샡샢샣샦샧샩샪샫샭샮샯샰샱샲샳샶샸샺샻샼샽샾샿섁섂섃섅섆섇섉섊섋섌섍섎섏섑섒섓섔섖섗섘섙섚섛섡섢섥섨섩섪섫섮�".split(""),e=0;e!=n[152].length;++e)65533!==n[152][e].charCodeAt(0)&&(r[n[152][e]]=38912+e,t[38912+e]=n[152][e]);for(n[153]="�����������������������������������������������������������������섲섳섴섵섷섺섻섽섾섿셁셂셃셄셅셆셇셊셎셏셐셑셒셓셖셗������셙셚셛셝셞셟셠셡셢셣셦셪셫셬셭셮셯셱셲셳셵셶셷셹셺셻������셼셽셾셿솀솁솂솃솄솆솇솈솉솊솋솏솑솒솓솕솗솘솙솚솛솞솠솢솣솤솦솧솪솫솭솮솯솱솲솳솴솵솶솷솸솹솺솻솼솾솿쇀쇁쇂쇃쇅쇆쇇쇉쇊쇋쇍쇎쇏쇐쇑쇒쇓쇕쇖쇙쇚쇛쇜쇝쇞쇟쇡쇢쇣쇥쇦쇧쇩쇪쇫쇬쇭쇮쇯쇲쇴쇵쇶쇷쇸쇹쇺쇻쇾쇿숁숂숃숅숆숇숈숉숊숋숎숐숒숓숔숕숖숗숚숛숝숞숡숢숣�".split(""),e=0;e!=n[153].length;++e)65533!==n[153][e].charCodeAt(0)&&(r[n[153][e]]=39168+e,t[39168+e]=n[153][e]);for(n[154]="�����������������������������������������������������������������숤숥숦숧숪숬숮숰숳숵숶숷숸숹숺숻숼숽숾숿쉀쉁쉂쉃쉄쉅������쉆쉇쉉쉊쉋쉌쉍쉎쉏쉒쉓쉕쉖쉗쉙쉚쉛쉜쉝쉞쉟쉡쉢쉣쉤쉦������쉧쉨쉩쉪쉫쉮쉯쉱쉲쉳쉵쉶쉷쉸쉹쉺쉻쉾슀슂슃슄슅슆슇슊슋슌슍슎슏슑슒슓슔슕슖슗슙슚슜슞슟슠슡슢슣슦슧슩슪슫슮슯슰슱슲슳슶슸슺슻슼슽슾슿싀싁싂싃싄싅싆싇싈싉싊싋싌싍싎싏싐싑싒싓싔싕싖싗싘싙싚싛싞싟싡싢싥싦싧싨싩싪싮싰싲싳싴싵싷싺싽싾싿쌁쌂쌃쌄쌅쌆쌇쌊쌋쌎쌏�".split(""),e=0;e!=n[154].length;++e)65533!==n[154][e].charCodeAt(0)&&(r[n[154][e]]=39424+e,t[39424+e]=n[154][e]);for(n[155]="�����������������������������������������������������������������쌐쌑쌒쌖쌗쌙쌚쌛쌝쌞쌟쌠쌡쌢쌣쌦쌧쌪쌫쌬쌭쌮쌯쌰쌱쌲������쌳쌴쌵쌶쌷쌸쌹쌺쌻쌼쌽쌾쌿썀썁썂썃썄썆썇썈썉썊썋썌썍������썎썏썐썑썒썓썔썕썖썗썘썙썚썛썜썝썞썟썠썡썢썣썤썥썦썧썪썫썭썮썯썱썳썴썵썶썷썺썻썾썿쎀쎁쎂쎃쎅쎆쎇쎉쎊쎋쎍쎎쎏쎐쎑쎒쎓쎔쎕쎖쎗쎘쎙쎚쎛쎜쎝쎞쎟쎠쎡쎢쎣쎤쎥쎦쎧쎨쎩쎪쎫쎬쎭쎮쎯쎰쎱쎲쎳쎴쎵쎶쎷쎸쎹쎺쎻쎼쎽쎾쎿쏁쏂쏃쏄쏅쏆쏇쏈쏉쏊쏋쏌쏍쏎쏏쏐쏑쏒쏓쏔쏕쏖쏗쏚�".split(""),e=0;e!=n[155].length;++e)65533!==n[155][e].charCodeAt(0)&&(r[n[155][e]]=39680+e,t[39680+e]=n[155][e]);for(n[156]="�����������������������������������������������������������������쏛쏝쏞쏡쏣쏤쏥쏦쏧쏪쏫쏬쏮쏯쏰쏱쏲쏳쏶쏷쏹쏺쏻쏼쏽쏾������쏿쐀쐁쐂쐃쐄쐅쐆쐇쐉쐊쐋쐌쐍쐎쐏쐑쐒쐓쐔쐕쐖쐗쐘쐙쐚������쐛쐜쐝쐞쐟쐠쐡쐢쐣쐥쐦쐧쐨쐩쐪쐫쐭쐮쐯쐱쐲쐳쐵쐶쐷쐸쐹쐺쐻쐾쐿쑀쑁쑂쑃쑄쑅쑆쑇쑉쑊쑋쑌쑍쑎쑏쑐쑑쑒쑓쑔쑕쑖쑗쑘쑙쑚쑛쑜쑝쑞쑟쑠쑡쑢쑣쑦쑧쑩쑪쑫쑭쑮쑯쑰쑱쑲쑳쑶쑷쑸쑺쑻쑼쑽쑾쑿쒁쒂쒃쒄쒅쒆쒇쒈쒉쒊쒋쒌쒍쒎쒏쒐쒑쒒쒓쒕쒖쒗쒘쒙쒚쒛쒝쒞쒟쒠쒡쒢쒣쒤쒥쒦쒧쒨쒩�".split(""),e=0;e!=n[156].length;++e)65533!==n[156][e].charCodeAt(0)&&(r[n[156][e]]=39936+e,t[39936+e]=n[156][e]);for(n[157]="�����������������������������������������������������������������쒪쒫쒬쒭쒮쒯쒰쒱쒲쒳쒴쒵쒶쒷쒹쒺쒻쒽쒾쒿쓀쓁쓂쓃쓄쓅������쓆쓇쓈쓉쓊쓋쓌쓍쓎쓏쓐쓑쓒쓓쓔쓕쓖쓗쓘쓙쓚쓛쓜쓝쓞쓟������쓠쓡쓢쓣쓤쓥쓦쓧쓨쓪쓫쓬쓭쓮쓯쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂씃씄씅씆씇씈씉씊씋씍씎씏씑씒씓씕씖씗씘씙씚씛씝씞씟씠씡씢씣씤씥씦씧씪씫씭씮씯씱씲씳씴씵씶씷씺씼씾씿앀앁앂앃앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩앪앫앬앭앮앯앲앶앷앸앹앺앻앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔�".split(""),e=0;e!=n[157].length;++e)65533!==n[157][e].charCodeAt(0)&&(r[n[157][e]]=40192+e,t[40192+e]=n[157][e]);for(n[158]="�����������������������������������������������������������������얖얙얚얛얝얞얟얡얢얣얤얥얦얧얨얪얫얬얭얮얯얰얱얲얳얶������얷얺얿엀엁엂엃엋엍엏엒엓엕엖엗엙엚엛엜엝엞엟엢엤엦엧������엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑옒옓옔옕옖옗옚옝옞옟옠옡옢옣옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉왊왋왌왍왎왏왒왖왗왘왙왚왛왞왟왡왢왣왤왥왦왧왨왩왪왫왭왮왰왲왳왴왵왶왷왺왻왽왾왿욁욂욃욄욅욆욇욊욌욎욏욐욑욒욓욖욗욙욚욛욝욞욟욠욡욢욣욦�".split(""),e=0;e!=n[158].length;++e)65533!==n[158][e].charCodeAt(0)&&(r[n[158][e]]=40448+e,t[40448+e]=n[158][e]);for(n[159]="�����������������������������������������������������������������욨욪욫욬욭욮욯욲욳욵욶욷욻욼욽욾욿웂웄웆웇웈웉웊웋웎������웏웑웒웓웕웖웗웘웙웚웛웞웟웢웣웤웥웦웧웪웫웭웮웯웱웲������웳웴웵웶웷웺웻웼웾웿윀윁윂윃윆윇윉윊윋윍윎윏윐윑윒윓윖윘윚윛윜윝윞윟윢윣윥윦윧윩윪윫윬윭윮윯윲윴윶윸윹윺윻윾윿읁읂읃읅읆읇읈읉읋읎읐읙읚읛읝읞읟읡읢읣읤읥읦읧읩읪읬읭읮읯읰읱읲읳읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛잜잝잞잟잢잧잨잩잪잫잮잯잱잲잳잵잶잷�".split(""),e=0;e!=n[159].length;++e)65533!==n[159][e].charCodeAt(0)&&(r[n[159][e]]=40704+e,t[40704+e]=n[159][e]);for(n[160]="�����������������������������������������������������������������잸잹잺잻잾쟂쟃쟄쟅쟆쟇쟊쟋쟍쟏쟑쟒쟓쟔쟕쟖쟗쟙쟚쟛쟜������쟞쟟쟠쟡쟢쟣쟥쟦쟧쟩쟪쟫쟭쟮쟯쟰쟱쟲쟳쟴쟵쟶쟷쟸쟹쟺������쟻쟼쟽쟾쟿젂젃젅젆젇젉젋젌젍젎젏젒젔젗젘젙젚젛젞젟젡젢젣젥젦젧젨젩젪젫젮젰젲젳젴젵젶젷젹젺젻젽젾젿졁졂졃졄졅졆졇졊졋졎졏졐졑졒졓졕졖졗졘졙졚졛졜졝졞졟졠졡졢졣졤졥졦졧졨졩졪졫졬졭졮졯졲졳졵졶졷졹졻졼졽졾졿좂좄좈좉좊좎좏좐좑좒좓좕좖좗좘좙좚좛좜좞좠좢좣좤�".split(""),e=0;e!=n[160].length;++e)65533!==n[160][e].charCodeAt(0)&&(r[n[160][e]]=40960+e,t[40960+e]=n[160][e]);for(n[161]="�����������������������������������������������������������������좥좦좧좩좪좫좬좭좮좯좰좱좲좳좴좵좶좷좸좹좺좻좾좿죀죁������죂죃죅죆죇죉죊죋죍죎죏죐죑죒죓죖죘죚죛죜죝죞죟죢죣죥������죦죧죨죩죪죫죬죭죮죯죰죱죲죳죴죶죷죸죹죺죻죾죿줁줂줃줇줈줉줊줋줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈〉《》「」『』【】±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬�".split(""),e=0;e!=n[161].length;++e)65533!==n[161][e].charCodeAt(0)&&(r[n[161][e]]=41216+e,t[41216+e]=n[161][e]);for(n[162]="�����������������������������������������������������������������줐줒줓줔줕줖줗줙줚줛줜줝줞줟줠줡줢줣줤줥줦줧줨줩줪줫������줭줮줯줰줱줲줳줵줶줷줸줹줺줻줼줽줾줿쥀쥁쥂쥃쥄쥅쥆쥇������쥈쥉쥊쥋쥌쥍쥎쥏쥒쥓쥕쥖쥗쥙쥚쥛쥜쥝쥞쥟쥢쥤쥥쥦쥧쥨쥩쥪쥫쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®������������������������".split(""),e=0;e!=n[162].length;++e)65533!==n[162][e].charCodeAt(0)&&(r[n[162][e]]=41472+e,t[41472+e]=n[162][e]);for(n[163]="�����������������������������������������������������������������쥱쥲쥳쥵쥶쥷쥸쥹쥺쥻쥽쥾쥿즀즁즂즃즄즅즆즇즊즋즍즎즏������즑즒즓즔즕즖즗즚즜즞즟즠즡즢즣즤즥즦즧즨즩즪즫즬즭즮������즯즰즱즲즳즴즵즶즷즸즹즺즻즼즽즾즿짂짃짅짆짉짋짌짍짎짏짒짔짗짘짛!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[₩]^_`abcdefghijklmnopqrstuvwxyz{|} ̄�".split(""),e=0;e!=n[163].length;++e)65533!==n[163][e].charCodeAt(0)&&(r[n[163][e]]=41728+e,t[41728+e]=n[163][e]);for(n[164]="�����������������������������������������������������������������짞짟짡짣짥짦짨짩짪짫짮짲짳짴짵짶짷짺짻짽짾짿쨁쨂쨃쨄������쨅쨆쨇쨊쨎쨏쨐쨑쨒쨓쨕쨖쨗쨙쨚쨛쨜쨝쨞쨟쨠쨡쨢쨣쨤쨥������쨦쨧쨨쨪쨫쨬쨭쨮쨯쨰쨱쨲쨳쨴쨵쨶쨷쨸쨹쨺쨻쨼쨽쨾쨿쩀쩁쩂쩃쩄쩅쩆ㄱㄲㄳㄴㄵㄶㄷㄸㄹㄺㄻㄼㄽㄾㄿㅀㅁㅂㅃㅄㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎㅏㅐㅑㅒㅓㅔㅕㅖㅗㅘㅙㅚㅛㅜㅝㅞㅟㅠㅡㅢㅣㅤㅥㅦㅧㅨㅩㅪㅫㅬㅭㅮㅯㅰㅱㅲㅳㅴㅵㅶㅷㅸㅹㅺㅻㅼㅽㅾㅿㆀㆁㆂㆃㆄㆅㆆㆇㆈㆉㆊㆋㆌㆍㆎ�".split(""),e=0;e!=n[164].length;++e)65533!==n[164][e].charCodeAt(0)&&(r[n[164][e]]=41984+e,t[41984+e]=n[164][e]);for(n[165]="�����������������������������������������������������������������쩇쩈쩉쩊쩋쩎쩏쩑쩒쩓쩕쩖쩗쩘쩙쩚쩛쩞쩢쩣쩤쩥쩦쩧쩩쩪������쩫쩬쩭쩮쩯쩰쩱쩲쩳쩴쩵쩶쩷쩸쩹쩺쩻쩼쩾쩿쪀쪁쪂쪃쪅쪆������쪇쪈쪉쪊쪋쪌쪍쪎쪏쪐쪑쪒쪓쪔쪕쪖쪗쪙쪚쪛쪜쪝쪞쪟쪠쪡쪢쪣쪤쪥쪦쪧ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹ�����ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ�������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω�������".split(""),e=0;e!=n[165].length;++e)65533!==n[165][e].charCodeAt(0)&&(r[n[165][e]]=42240+e,t[42240+e]=n[165][e]);for(n[166]="�����������������������������������������������������������������쪨쪩쪪쪫쪬쪭쪮쪯쪰쪱쪲쪳쪴쪵쪶쪷쪸쪹쪺쪻쪾쪿쫁쫂쫃쫅������쫆쫇쫈쫉쫊쫋쫎쫐쫒쫔쫕쫖쫗쫚쫛쫜쫝쫞쫟쫡쫢쫣쫤쫥쫦쫧������쫨쫩쫪쫫쫭쫮쫯쫰쫱쫲쫳쫵쫶쫷쫸쫹쫺쫻쫼쫽쫾쫿쬀쬁쬂쬃쬄쬅쬆쬇쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃╄╅╆╇╈╉╊���������������������������".split(""),e=0;e!=n[166].length;++e)65533!==n[166][e].charCodeAt(0)&&(r[n[166][e]]=42496+e,t[42496+e]=n[166][e]);for(n[167]="�����������������������������������������������������������������쬋쬌쬍쬎쬏쬑쬒쬓쬕쬖쬗쬙쬚쬛쬜쬝쬞쬟쬢쬣쬤쬥쬦쬧쬨쬩������쬪쬫쬬쬭쬮쬯쬰쬱쬲쬳쬴쬵쬶쬷쬸쬹쬺쬻쬼쬽쬾쬿쭀쭂쭃쭄������쭅쭆쭇쭊쭋쭍쭎쭏쭑쭒쭓쭔쭕쭖쭗쭚쭛쭜쭞쭟쭠쭡쭢쭣쭥쭦쭧쭨쭩쭪쭫쭬㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙㎚㎛㎜㎝㎞㎟㎠㎡㎢㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰㎱㎲㎳㎴㎵㎶㎷㎸㎹㎀㎁㎂㎃㎄㎺㎻㎼㎽㎾㎿㎐㎑㎒㎓㎔Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆����������������".split(""),e=0;e!=n[167].length;++e)65533!==n[167][e].charCodeAt(0)&&(r[n[167][e]]=42752+e,t[42752+e]=n[167][e]);for(n[168]="�����������������������������������������������������������������쭭쭮쭯쭰쭱쭲쭳쭴쭵쭶쭷쭺쭻쭼쭽쭾쭿쮀쮁쮂쮃쮄쮅쮆쮇쮈������쮉쮊쮋쮌쮍쮎쮏쮐쮑쮒쮓쮔쮕쮖쮗쮘쮙쮚쮛쮝쮞쮟쮠쮡쮢쮣������쮤쮥쮦쮧쮨쮩쮪쮫쮬쮭쮮쮯쮰쮱쮲쮳쮴쮵쮶쮷쮹쮺쮻쮼쮽쮾쮿쯀쯁쯂쯃쯄ÆÐªĦ�IJ�ĿŁØŒºÞŦŊ�㉠㉡㉢㉣㉤㉥㉦㉧㉨㉩㉪㉫㉬㉭㉮㉯㉰㉱㉲㉳㉴㉵㉶㉷㉸㉹㉺㉻ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮½⅓⅔¼¾⅛⅜⅝⅞�".split(""),e=0;e!=n[168].length;++e)65533!==n[168][e].charCodeAt(0)&&(r[n[168][e]]=43008+e,t[43008+e]=n[168][e]);for(n[169]="�����������������������������������������������������������������쯅쯆쯇쯈쯉쯊쯋쯌쯍쯎쯏쯐쯑쯒쯓쯕쯖쯗쯘쯙쯚쯛쯜쯝쯞쯟������쯠쯡쯢쯣쯥쯦쯨쯪쯫쯬쯭쯮쯯쯰쯱쯲쯳쯴쯵쯶쯷쯸쯹쯺쯻쯼������쯽쯾쯿찀찁찂찃찄찅찆찇찈찉찊찋찎찏찑찒찓찕찖찗찘찙찚찛찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀㈁㈂㈃㈄㈅㈆㈇㈈㈉㈊㈋㈌㈍㈎㈏㈐㈑㈒㈓㈔㈕㈖㈗㈘㈙㈚㈛⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲⒳⒴⒵⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂¹²³⁴ⁿ₁₂₃₄�".split(""),e=0;e!=n[169].length;++e)65533!==n[169][e].charCodeAt(0)&&(r[n[169][e]]=43264+e,t[43264+e]=n[169][e]);for(n[170]="�����������������������������������������������������������������찥찦찪찫찭찯찱찲찳찴찵찶찷찺찿챀챁챂챃챆챇챉챊챋챍챎������챏챐챑챒챓챖챚챛챜챝챞챟챡챢챣챥챧챩챪챫챬챭챮챯챱챲������챳챴챶챷챸챹챺챻챼챽챾챿첀첁첂첃첄첅첆첇첈첉첊첋첌첍첎첏첐첑첒첓ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん������������".split(""),e=0;e!=n[170].length;++e)65533!==n[170][e].charCodeAt(0)&&(r[n[170][e]]=43520+e,t[43520+e]=n[170][e]);for(n[171]="�����������������������������������������������������������������첔첕첖첗첚첛첝첞첟첡첢첣첤첥첦첧첪첮첯첰첱첲첳첶첷첹������첺첻첽첾첿쳀쳁쳂쳃쳆쳈쳊쳋쳌쳍쳎쳏쳑쳒쳓쳕쳖쳗쳘쳙쳚������쳛쳜쳝쳞쳟쳠쳡쳢쳣쳥쳦쳧쳨쳩쳪쳫쳭쳮쳯쳱쳲쳳쳴쳵쳶쳷쳸쳹쳺쳻쳼쳽ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ���������".split(""),e=0;e!=n[171].length;++e)65533!==n[171][e].charCodeAt(0)&&(r[n[171][e]]=43776+e,t[43776+e]=n[171][e]);for(n[172]="�����������������������������������������������������������������쳾쳿촀촂촃촄촅촆촇촊촋촍촎촏촑촒촓촔촕촖촗촚촜촞촟촠������촡촢촣촥촦촧촩촪촫촭촮촯촰촱촲촳촴촵촶촷촸촺촻촼촽촾������촿쵀쵁쵂쵃쵄쵅쵆쵇쵈쵉쵊쵋쵌쵍쵎쵏쵐쵑쵒쵓쵔쵕쵖쵗쵘쵙쵚쵛쵝쵞쵟АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмнопрстуфхцчшщъыьэюя��������������".split(""),e=0;e!=n[172].length;++e)65533!==n[172][e].charCodeAt(0)&&(r[n[172][e]]=44032+e,t[44032+e]=n[172][e]);for(n[173]="�����������������������������������������������������������������쵡쵢쵣쵥쵦쵧쵨쵩쵪쵫쵮쵰쵲쵳쵴쵵쵶쵷쵹쵺쵻쵼쵽쵾쵿춀������춁춂춃춄춅춆춇춉춊춋춌춍춎춏춐춑춒춓춖춗춙춚춛춝춞춟������춠춡춢춣춦춨춪춫춬춭춮춯춱춲춳춴춵춶춷춸춹춺춻춼춽춾춿췀췁췂췃췅�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[173].length;++e)65533!==n[173][e].charCodeAt(0)&&(r[n[173][e]]=44288+e,t[44288+e]=n[173][e]);for(n[174]="�����������������������������������������������������������������췆췇췈췉췊췋췍췎췏췑췒췓췔췕췖췗췘췙췚췛췜췝췞췟췠췡������췢췣췤췥췦췧췩췪췫췭췮췯췱췲췳췴췵췶췷췺췼췾췿츀츁츂������츃츅츆츇츉츊츋츍츎츏츐츑츒츓츕츖츗츘츚츛츜츝츞츟츢츣츥츦츧츩츪츫�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[174].length;++e)65533!==n[174][e].charCodeAt(0)&&(r[n[174][e]]=44544+e,t[44544+e]=n[174][e]);for(n[175]="�����������������������������������������������������������������츬츭츮츯츲츴츶츷츸츹츺츻츼츽츾츿칀칁칂칃칄칅칆칇칈칉������칊칋칌칍칎칏칐칑칒칓칔칕칖칗칚칛칝칞칢칣칤칥칦칧칪칬������칮칯칰칱칲칳칶칷칹칺칻칽칾칿캀캁캂캃캆캈캊캋캌캍캎캏캒캓캕캖캗캙�����������������������������������������������������������������������������������������������".split(""),e=0;e!=n[175].length;++e)65533!==n[175][e].charCodeAt(0)&&(r[n[175][e]]=44800+e,t[44800+e]=n[175][e]);for(n[176]="�����������������������������������������������������������������캚캛캜캝캞캟캢캦캧캨캩캪캫캮캯캰캱캲캳캴캵캶캷캸캹캺������캻캼캽캾캿컀컂컃컄컅컆컇컈컉컊컋컌컍컎컏컐컑컒컓컔컕������컖컗컘컙컚컛컜컝컞컟컠컡컢컣컦컧컩컪컭컮컯컰컱컲컳컶컺컻컼컽컾컿가각간갇갈갉갊감갑값갓갔강갖갗같갚갛개객갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆�".split(""),e=0;e!=n[176].length;++e)65533!==n[176][e].charCodeAt(0)&&(r[n[176][e]]=45056+e,t[45056+e]=n[176][e]);for(n[177]="�����������������������������������������������������������������켂켃켅켆켇켉켊켋켌켍켎켏켒켔켖켗켘켙켚켛켝켞켟켡켢켣������켥켦켧켨켩켪켫켮켲켳켴켵켶켷켹켺켻켼켽켾켿콀콁콂콃콄������콅콆콇콈콉콊콋콌콍콎콏콐콑콒콓콖콗콙콚콛콝콞콟콠콡콢콣콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸�".split(""),e=0;e!=n[177].length;++e)65533!==n[177][e].charCodeAt(0)&&(r[n[177][e]]=45312+e,t[45312+e]=n[177][e]);for(n[178]="�����������������������������������������������������������������콭콮콯콲콳콵콶콷콹콺콻콼콽콾콿쾁쾂쾃쾄쾆쾇쾈쾉쾊쾋쾍������쾎쾏쾐쾑쾒쾓쾔쾕쾖쾗쾘쾙쾚쾛쾜쾝쾞쾟쾠쾢쾣쾤쾥쾦쾧쾩������쾪쾫쾬쾭쾮쾯쾱쾲쾳쾴쾵쾶쾷쾸쾹쾺쾻쾼쾽쾾쾿쿀쿁쿂쿃쿅쿆쿇쿈쿉쿊쿋깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙�".split(""),e=0;e!=n[178].length;++e)65533!==n[178][e].charCodeAt(0)&&(r[n[178][e]]=45568+e,t[45568+e]=n[178][e]);for(n[179]="�����������������������������������������������������������������쿌쿍쿎쿏쿐쿑쿒쿓쿔쿕쿖쿗쿘쿙쿚쿛쿜쿝쿞쿟쿢쿣쿥쿦쿧쿩������쿪쿫쿬쿭쿮쿯쿲쿴쿶쿷쿸쿹쿺쿻쿽쿾쿿퀁퀂퀃퀅퀆퀇퀈퀉퀊������퀋퀌퀍퀎퀏퀐퀒퀓퀔퀕퀖퀗퀙퀚퀛퀜퀝퀞퀟퀠퀡퀢퀣퀤퀥퀦퀧퀨퀩퀪퀫퀬끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫났낭낮낯낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝�".split(""),e=0;e!=n[179].length;++e)65533!==n[179][e].charCodeAt(0)&&(r[n[179][e]]=45824+e,t[45824+e]=n[179][e]);for(n[180]="�����������������������������������������������������������������퀮퀯퀰퀱퀲퀳퀶퀷퀹퀺퀻퀽퀾퀿큀큁큂큃큆큈큊큋큌큍큎큏������큑큒큓큕큖큗큙큚큛큜큝큞큟큡큢큣큤큥큦큧큨큩큪큫큮큯������큱큲큳큵큶큷큸큹큺큻큾큿킀킂킃킄킅킆킇킈킉킊킋킌킍킎킏킐킑킒킓킔뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫달닭닮닯닳담답닷닸당닺닻닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥�".split(""),e=0;e!=n[180].length;++e)65533!==n[180][e].charCodeAt(0)&&(r[n[180][e]]=46080+e,t[46080+e]=n[180][e]);for(n[181]="�����������������������������������������������������������������킕킖킗킘킙킚킛킜킝킞킟킠킡킢킣킦킧킩킪킫킭킮킯킰킱킲������킳킶킸킺킻킼킽킾킿탂탃탅탆탇탊탋탌탍탎탏탒탖탗탘탙탚������탛탞탟탡탢탣탥탦탧탨탩탪탫탮탲탳탴탵탶탷탹탺탻탼탽탾탿턀턁턂턃턄덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸�".split(""),e=0;e!=n[181].length;++e)65533!==n[181][e].charCodeAt(0)&&(r[n[181][e]]=46336+e,t[46336+e]=n[181][e]);for(n[182]="�����������������������������������������������������������������턅턆턇턈턉턊턋턌턎턏턐턑턒턓턔턕턖턗턘턙턚턛턜턝턞턟������턠턡턢턣턤턥턦턧턨턩턪턫턬턭턮턯턲턳턵턶턷턹턻턼턽턾������턿텂텆텇텈텉텊텋텎텏텑텒텓텕텖텗텘텙텚텛텞텠텢텣텤텥텦텧텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗�".split(""),e=0;e!=n[182].length;++e)65533!==n[182][e].charCodeAt(0)&&(r[n[182][e]]=46592+e,t[46592+e]=n[182][e]);for(n[183]="�����������������������������������������������������������������텮텯텰텱텲텳텴텵텶텷텸텹텺텻텽텾텿톀톁톂톃톅톆톇톉톊������톋톌톍톎톏톐톑톒톓톔톕톖톗톘톙톚톛톜톝톞톟톢톣톥톦톧������톩톪톫톬톭톮톯톲톴톶톷톸톹톻톽톾톿퇁퇂퇃퇄퇅퇆퇇퇈퇉퇊퇋퇌퇍퇎퇏래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩�".split(""),e=0;e!=n[183].length;++e)65533!==n[183][e].charCodeAt(0)&&(r[n[183][e]]=46848+e,t[46848+e]=n[183][e]);for(n[184]="�����������������������������������������������������������������퇐퇑퇒퇓퇔퇕퇖퇗퇙퇚퇛퇜퇝퇞퇟퇠퇡퇢퇣퇤퇥퇦퇧퇨퇩퇪������퇫퇬퇭퇮퇯퇰퇱퇲퇳퇵퇶퇷퇹퇺퇻퇼퇽퇾퇿툀툁툂툃툄툅툆������툈툊툋툌툍툎툏툑툒툓툔툕툖툗툘툙툚툛툜툝툞툟툠툡툢툣툤툥툦툧툨툩륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많맏말맑맒맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼�".split(""),e=0;e!=n[184].length;++e)65533!==n[184][e].charCodeAt(0)&&(r[n[184][e]]=47104+e,t[47104+e]=n[184][e]);for(n[185]="�����������������������������������������������������������������툪툫툮툯툱툲툳툵툶툷툸툹툺툻툾퉀퉂퉃퉄퉅퉆퉇퉉퉊퉋퉌������퉍퉎퉏퉐퉑퉒퉓퉔퉕퉖퉗퉘퉙퉚퉛퉝퉞퉟퉠퉡퉢퉣퉥퉦퉧퉨������퉩퉪퉫퉬퉭퉮퉯퉰퉱퉲퉳퉴퉵퉶퉷퉸퉹퉺퉻퉼퉽퉾퉿튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바박밖밗반받발밝밞밟밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗�".split(""),e=0;e!=n[185].length;++e)65533!==n[185][e].charCodeAt(0)&&(r[n[185][e]]=47360+e,t[47360+e]=n[185][e]);for(n[186]="�����������������������������������������������������������������튍튎튏튒튓튔튖튗튘튙튚튛튝튞튟튡튢튣튥튦튧튨튩튪튫튭������튮튯튰튲튳튴튵튶튷튺튻튽튾틁틃틄틅틆틇틊틌틍틎틏틐틑������틒틓틕틖틗틙틚틛틝틞틟틠틡틢틣틦틧틨틩틪틫틬틭틮틯틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤�".split(""),e=0;e!=n[186].length;++e)65533!==n[186][e].charCodeAt(0)&&(r[n[186][e]]=47616+e,t[47616+e]=n[186][e]);for(n[187]="�����������������������������������������������������������������틻틼틽틾틿팂팄팆팇팈팉팊팋팏팑팒팓팕팗팘팙팚팛팞팢팣������팤팦팧팪팫팭팮팯팱팲팳팴팵팶팷팺팾팿퍀퍁퍂퍃퍆퍇퍈퍉������퍊퍋퍌퍍퍎퍏퍐퍑퍒퍓퍔퍕퍖퍗퍘퍙퍚퍛퍜퍝퍞퍟퍠퍡퍢퍣퍤퍥퍦퍧퍨퍩빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤�".split(""),e=0;e!=n[187].length;++e)65533!==n[187][e].charCodeAt(0)&&(r[n[187][e]]=47872+e,t[47872+e]=n[187][e]);for(n[188]="�����������������������������������������������������������������퍪퍫퍬퍭퍮퍯퍰퍱퍲퍳퍴퍵퍶퍷퍸퍹퍺퍻퍾퍿펁펂펃펅펆펇������펈펉펊펋펎펒펓펔펕펖펗펚펛펝펞펟펡펢펣펤펥펦펧펪펬펮������펯펰펱펲펳펵펶펷펹펺펻펽펾펿폀폁폂폃폆폇폊폋폌폍폎폏폑폒폓폔폕폖샥샨샬샴샵샷샹섀섄섈섐섕서석섞섟선섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭�".split(""),e=0;e!=n[188].length;++e)65533!==n[188][e].charCodeAt(0)&&(r[n[188][e]]=48128+e,t[48128+e]=n[188][e]);for(n[189]="�����������������������������������������������������������������폗폙폚폛폜폝폞폟폠폢폤폥폦폧폨폩폪폫폮폯폱폲폳폵폶폷������폸폹폺폻폾퐀퐂퐃퐄퐅퐆퐇퐉퐊퐋퐌퐍퐎퐏퐐퐑퐒퐓퐔퐕퐖������퐗퐘퐙퐚퐛퐜퐞퐟퐠퐡퐢퐣퐤퐥퐦퐧퐨퐩퐪퐫퐬퐭퐮퐯퐰퐱퐲퐳퐴퐵퐶퐷숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰�".split(""),e=0;e!=n[189].length;++e)65533!==n[189][e].charCodeAt(0)&&(r[n[189][e]]=48384+e,t[48384+e]=n[189][e]);for(n[190]="�����������������������������������������������������������������퐸퐹퐺퐻퐼퐽퐾퐿푁푂푃푅푆푇푈푉푊푋푌푍푎푏푐푑푒푓������푔푕푖푗푘푙푚푛푝푞푟푡푢푣푥푦푧푨푩푪푫푬푮푰푱푲������푳푴푵푶푷푺푻푽푾풁풃풄풅풆풇풊풌풎풏풐풑풒풓풕풖풗풘풙풚풛풜풝쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄업없엇었엉엊엌엎�".split(""),e=0;e!=n[190].length;++e)65533!==n[190][e].charCodeAt(0)&&(r[n[190][e]]=48640+e,t[48640+e]=n[190][e]);for(n[191]="�����������������������������������������������������������������풞풟풠풡풢풣풤풥풦풧풨풪풫풬풭풮풯풰풱풲풳풴풵풶풷풸������풹풺풻풼풽풾풿퓀퓁퓂퓃퓄퓅퓆퓇퓈퓉퓊퓋퓍퓎퓏퓑퓒퓓퓕������퓖퓗퓘퓙퓚퓛퓝퓞퓠퓡퓢퓣퓤퓥퓦퓧퓩퓪퓫퓭퓮퓯퓱퓲퓳퓴퓵퓶퓷퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염엽엾엿였영옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨�".split(""),e=0;e!=n[191].length;++e)65533!==n[191][e].charCodeAt(0)&&(r[n[191][e]]=48896+e,t[48896+e]=n[191][e]);for(n[192]="�����������������������������������������������������������������퓾퓿픀픁픂픃픅픆픇픉픊픋픍픎픏픐픑픒픓픖픘픙픚픛픜픝������픞픟픠픡픢픣픤픥픦픧픨픩픪픫픬픭픮픯픰픱픲픳픴픵픶픷������픸픹픺픻픾픿핁핂핃핅핆핇핈핉핊핋핎핐핒핓핔핕핖핗핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응읒읓읔읕읖읗의읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊�".split(""),e=0;e!=n[192].length;++e)65533!==n[192][e].charCodeAt(0)&&(r[n[192][e]]=49152+e,t[49152+e]=n[192][e]);for(n[193]="�����������������������������������������������������������������핤핦핧핪핬핮핯핰핱핲핳핶핷핹핺핻핽핾핿햀햁햂햃햆햊햋������햌햍햎햏햑햒햓햔햕햖햗햘햙햚햛햜햝햞햟햠햡햢햣햤햦햧������햨햩햪햫햬햭햮햯햰햱햲햳햴햵햶햷햸햹햺햻햼햽햾햿헀헁헂헃헄헅헆헇점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓�".split(""),e=0;e!=n[193].length;++e)65533!==n[193][e].charCodeAt(0)&&(r[n[193][e]]=49408+e,t[49408+e]=n[193][e]);for(n[194]="�����������������������������������������������������������������헊헋헍헎헏헑헓헔헕헖헗헚헜헞헟헠헡헢헣헦헧헩헪헫헭헮������헯헰헱헲헳헶헸헺헻헼헽헾헿혂혃혅혆혇혉혊혋혌혍혎혏혒������혖혗혘혙혚혛혝혞혟혡혢혣혥혦혧혨혩혪혫혬혮혯혰혱혲혳혴혵혶혷혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻�".split(""),e=0;e!=n[194].length;++e)65533!==n[194][e].charCodeAt(0)&&(r[n[194][e]]=49664+e,t[49664+e]=n[194][e]);for(n[195]="�����������������������������������������������������������������혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝홞홟홠홡������홢홣홤홥홦홨홪홫홬홭홮홯홲홳홵홶홷홸홹홺홻홼홽홾홿횀������횁횂횄횆횇횈횉횊횋횎횏횑횒횓횕횖횗횘횙횚횛횜횞횠횢횣횤횥횦횧횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층�".split(""),e=0;e!=n[195].length;++e)65533!==n[195][e].charCodeAt(0)&&(r[n[195][e]]=49920+e,t[49920+e]=n[195][e]);for(n[196]="�����������������������������������������������������������������횫횭횮횯횱횲횳횴횵횶횷횸횺횼횽횾횿훀훁훂훃훆훇훉훊훋������훍훎훏훐훒훓훕훖훘훚훛훜훝훞훟훡훢훣훥훦훧훩훪훫훬훭������훮훯훱훲훳훴훶훷훸훹훺훻훾훿휁휂휃휅휆휇휈휉휊휋휌휍휎휏휐휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼�".split(""),e=0;e!=n[196].length;++e)65533!==n[196][e].charCodeAt(0)&&(r[n[196][e]]=50176+e,t[50176+e]=n[196][e]);for(n[197]="�����������������������������������������������������������������휕휖휗휚휛휝휞휟휡휢휣휤휥휦휧휪휬휮휯휰휱휲휳휶휷휹������휺휻휽휾휿흀흁흂흃흅흆흈흊흋흌흍흎흏흒흓흕흚흛흜흝흞������흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵흶흷흸흹흺흻흾흿힀힂힃힄힅힆힇힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜�".split(""),e=0;e!=n[197].length;++e)65533!==n[197][e].charCodeAt(0)&&(r[n[197][e]]=50432+e,t[50432+e]=n[197][e]);for(n[198]="�����������������������������������������������������������������힍힎힏힑힒힓힔힕힖힗힚힜힞힟힠힡힢힣������������������������������������������������������������������������������퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁�".split(""),e=0;e!=n[198].length;++e)65533!==n[198][e].charCodeAt(0)&&(r[n[198][e]]=50688+e,t[50688+e]=n[198][e]);for(n[199]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠�".split(""),e=0;e!=n[199].length;++e)65533!==n[199][e].charCodeAt(0)&&(r[n[199][e]]=50944+e,t[50944+e]=n[199][e]);for(n[200]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝�".split(""),e=0;e!=n[200].length;++e)65533!==n[200][e].charCodeAt(0)&&(r[n[200][e]]=51200+e,t[51200+e]=n[200][e]);for(n[202]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕�".split(""),e=0;e!=n[202].length;++e)65533!==n[202][e].charCodeAt(0)&&(r[n[202][e]]=51712+e,t[51712+e]=n[202][e]);for(n[203]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢�".split(""),e=0;e!=n[203].length;++e)65533!==n[203][e].charCodeAt(0)&&(r[n[203][e]]=51968+e,t[51968+e]=n[203][e]);for(n[204]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械�".split(""),e=0;e!=n[204].length;++e)65533!==n[204][e].charCodeAt(0)&&(r[n[204][e]]=52224+e,t[52224+e]=n[204][e]);for(n[205]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜�".split(""),e=0;e!=n[205].length;++e)65533!==n[205][e].charCodeAt(0)&&(r[n[205][e]]=52480+e,t[52480+e]=n[205][e]);for(n[206]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾�".split(""),e=0;e!=n[206].length;++e)65533!==n[206][e].charCodeAt(0)&&(r[n[206][e]]=52736+e,t[52736+e]=n[206][e]);for(n[207]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴�".split(""),e=0;e!=n[207].length;++e)65533!==n[207][e].charCodeAt(0)&&(r[n[207][e]]=52992+e,t[52992+e]=n[207][e]);for(n[208]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣�".split(""),e=0;e!=n[208].length;++e)65533!==n[208][e].charCodeAt(0)&&(r[n[208][e]]=53248+e,t[53248+e]=n[208][e]);for(n[209]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩羅蘿螺裸邏那樂洛烙珞落諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉�".split(""),e=0;e!=n[209].length;++e)65533!==n[209][e].charCodeAt(0)&&(r[n[209][e]]=53504+e,t[53504+e]=n[209][e]);for(n[210]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������納臘蠟衲囊娘廊朗浪狼郎乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧老蘆虜路露駑魯鷺碌祿綠菉錄鹿論壟弄濃籠聾膿農惱牢磊腦賂雷尿壘屢樓淚漏累縷陋嫩訥杻紐勒肋凜凌稜綾能菱陵尼泥匿溺多茶�".split(""),e=0;e!=n[210].length;++e)65533!==n[210][e].charCodeAt(0)&&(r[n[210][e]]=53760+e,t[53760+e]=n[210][e]);for(n[211]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃�".split(""),e=0;e!=n[211].length;++e)65533!==n[211][e].charCodeAt(0)&&(r[n[211][e]]=54016+e,t[54016+e]=n[211][e]);for(n[212]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅�".split(""),e=0;e!=n[212].length;++e)65533!==n[212][e].charCodeAt(0)&&(r[n[212][e]]=54272+e,t[54272+e]=n[212][e]);for(n[213]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣�".split(""),e=0;e!=n[213].length;++e)65533!==n[213][e].charCodeAt(0)&&(r[n[213][e]]=54528+e,t[54528+e]=n[213][e]);for(n[214]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼�".split(""),e=0;e!=n[214].length;++e)65533!==n[214][e].charCodeAt(0)&&(r[n[214][e]]=54784+e,t[54784+e]=n[214][e]);for(n[215]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬�".split(""),e=0;e!=n[215].length;++e)65533!==n[215][e].charCodeAt(0)&&(r[n[215][e]]=55040+e,t[55040+e]=n[215][e]);for(n[216]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅�".split(""),e=0;e!=n[216].length;++e)65533!==n[216][e].charCodeAt(0)&&(r[n[216][e]]=55296+e,t[55296+e]=n[216][e]);for(n[217]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文�".split(""),e=0;e!=n[217].length;++e)65533!==n[217][e].charCodeAt(0)&&(r[n[217][e]]=55552+e,t[55552+e]=n[217][e]);for(n[218]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑�".split(""),e=0;e!=n[218].length;++e)65533!==n[218][e].charCodeAt(0)&&(r[n[218][e]]=55808+e,t[55808+e]=n[218][e]);for(n[219]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖�".split(""),e=0;e!=n[219].length;++e)65533!==n[219][e].charCodeAt(0)&&(r[n[219][e]]=56064+e,t[56064+e]=n[219][e]);for(n[220]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦�".split(""),e=0;e!=n[220].length;++e)65533!==n[220][e].charCodeAt(0)&&(r[n[220][e]]=56320+e,t[56320+e]=n[220][e]);for(n[221]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥�".split(""),e=0;e!=n[221].length;++e)65533!==n[221][e].charCodeAt(0)&&(r[n[221][e]]=56576+e,t[56576+e]=n[221][e]);for(n[222]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索�".split(""),e=0;e!=n[222].length;++e)65533!==n[222][e].charCodeAt(0)&&(r[n[222][e]]=56832+e,t[56832+e]=n[222][e]);for(n[223]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署�".split(""),e=0;e!=n[223].length;++e)65533!==n[223][e].charCodeAt(0)&&(r[n[223][e]]=57088+e,t[57088+e]=n[223][e]);for(n[224]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬�".split(""),e=0;e!=n[224].length;++e)65533!==n[224][e].charCodeAt(0)&&(r[n[224][e]]=57344+e,t[57344+e]=n[224][e]);for(n[225]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁�".split(""),e=0;e!=n[225].length;++e)65533!==n[225][e].charCodeAt(0)&&(r[n[225][e]]=57600+e,t[57600+e]=n[225][e]);for(n[226]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧�".split(""),e=0;e!=n[226].length;++e)65533!==n[226][e].charCodeAt(0)&&(r[n[226][e]]=57856+e,t[57856+e]=n[226][e]);for(n[227]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁�".split(""),e=0;e!=n[227].length;++e)65533!==n[227][e].charCodeAt(0)&&(r[n[227][e]]=58112+e,t[58112+e]=n[227][e]);for(n[228]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額�".split(""),e=0;e!=n[228].length;++e)65533!==n[228][e].charCodeAt(0)&&(r[n[228][e]]=58368+e,t[58368+e]=n[228][e]);for(n[229]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬�".split(""),e=0;e!=n[229].length;++e)65533!==n[229][e].charCodeAt(0)&&(r[n[229][e]]=58624+e,t[58624+e]=n[229][e]);for(n[230]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒�".split(""),e=0;e!=n[230].length;++e)65533!==n[230][e].charCodeAt(0)&&(r[n[230][e]]=58880+e,t[58880+e]=n[230][e]);for(n[231]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳�".split(""),e=0;e!=n[231].length;++e)65533!==n[231][e].charCodeAt(0)&&(r[n[231][e]]=59136+e,t[59136+e]=n[231][e]);for(n[232]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療�".split(""),e=0;e!=n[232].length;++e)65533!==n[232][e].charCodeAt(0)&&(r[n[232][e]]=59392+e,t[59392+e]=n[232][e]);for(n[233]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓�".split(""),e=0;e!=n[233].length;++e)65533!==n[233][e].charCodeAt(0)&&(r[n[233][e]]=59648+e,t[59648+e]=n[233][e]);for(n[234]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜�".split(""),e=0;e!=n[234].length;++e)65533!==n[234][e].charCodeAt(0)&&(r[n[234][e]]=59904+e,t[59904+e]=n[234][e]);for(n[235]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼�".split(""),e=0;e!=n[235].length;++e)65533!==n[235][e].charCodeAt(0)&&(r[n[235][e]]=60160+e,t[60160+e]=n[235][e]);for(n[236]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄�".split(""),e=0;e!=n[236].length;++e)65533!==n[236][e].charCodeAt(0)&&(r[n[236][e]]=60416+e,t[60416+e]=n[236][e]);for(n[237]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長�".split(""),e=0;e!=n[237].length;++e)65533!==n[237][e].charCodeAt(0)&&(r[n[237][e]]=60672+e,t[60672+e]=n[237][e]);for(n[238]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱�".split(""),e=0;e!=n[238].length;++e)65533!==n[238][e].charCodeAt(0)&&(r[n[238][e]]=60928+e,t[60928+e]=n[238][e]);for(n[239]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖�".split(""),e=0;e!=n[239].length;++e)65533!==n[239][e].charCodeAt(0)&&(r[n[239][e]]=61184+e,t[61184+e]=n[239][e]);for(n[240]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫�".split(""),e=0;e!=n[240].length;++e)65533!==n[240][e].charCodeAt(0)&&(r[n[240][e]]=61440+e,t[61440+e]=n[240][e]);for(n[241]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只�".split(""),e=0;e!=n[241].length;++e)65533!==n[241][e].charCodeAt(0)&&(r[n[241][e]]=61696+e,t[61696+e]=n[241][e]);for(n[242]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯�".split(""),e=0;e!=n[242].length;++e)65533!==n[242][e].charCodeAt(0)&&(r[n[242][e]]=61952+e,t[61952+e]=n[242][e]);for(n[243]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策�".split(""),e=0;e!=n[243].length;++e)65533!==n[243][e].charCodeAt(0)&&(r[n[243][e]]=62208+e,t[62208+e]=n[243][e]);for(n[244]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢�".split(""),e=0;e!=n[244].length;++e)65533!==n[244][e].charCodeAt(0)&&(r[n[244][e]]=62464+e,t[62464+e]=n[244][e]);for(n[245]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃�".split(""),e=0;e!=n[245].length;++e)65533!==n[245][e].charCodeAt(0)&&(r[n[245][e]]=62720+e,t[62720+e]=n[245][e]);for(n[246]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託�".split(""),e=0;e!=n[246].length;++e)65533!==n[246][e].charCodeAt(0)&&(r[n[246][e]]=62976+e,t[62976+e]=n[246][e]);for(n[247]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑�".split(""),e=0;e!=n[247].length;++e)65533!==n[247][e].charCodeAt(0)&&(r[n[247][e]]=63232+e,t[63232+e]=n[247][e]);for(n[248]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃�".split(""),e=0;e!=n[248].length;++e)65533!==n[248][e].charCodeAt(0)&&(r[n[248][e]]=63488+e,t[63488+e]=n[248][e]);for(n[249]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航�".split(""),e=0;e!=n[249].length;++e)65533!==n[249][e].charCodeAt(0)&&(r[n[249][e]]=63744+e,t[63744+e]=n[249][e]);for(n[250]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型�".split(""),e=0;e!=n[250].length;++e)65533!==n[250][e].charCodeAt(0)&&(r[n[250][e]]=64e3+e,t[64e3+e]=n[250][e]);for(n[251]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵�".split(""),e=0;e!=n[251].length;++e)65533!==n[251][e].charCodeAt(0)&&(r[n[251][e]]=64256+e,t[64256+e]=n[251][e]);for(n[252]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆�".split(""),e=0;e!=n[252].length;++e)65533!==n[252][e].charCodeAt(0)&&(r[n[252][e]]=64512+e,t[64512+e]=n[252][e]);for(n[253]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰�".split(""),e=0;e!=n[253].length;++e)65533!==n[253][e].charCodeAt(0)&&(r[n[253][e]]=64768+e,t[64768+e]=n[253][e]);return{enc:r,dec:t}}(),t[950]=function(){var e,t=[],r={},n=[];for(n[0]="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������".split(""),e=0;e!=n[0].length;++e)65533!==n[0][e].charCodeAt(0)&&(r[n[0][e]]=0+e,t[0+e]=n[0][e]);for(n[161]="���������������������������������������������������������������� ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚����������������������������������﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢﹣﹤﹥﹦~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/�".split(""),e=0;e!=n[161].length;++e)65533!==n[161][e].charCodeAt(0)&&(r[n[161][e]]=41216+e,t[41216+e]=n[161][e]);for(n[162]="����������������������������������������������������������������\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁▂▃▄▅▆▇█▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭����������������������������������╮╰╯═╞╪╡◢◣◥◤╱╲╳0123456789ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ〡〢〣〤〥〦〧〨〩十卄卅ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv�".split(""),e=0;e!=n[162].length;++e)65533!==n[162][e].charCodeAt(0)&&(r[n[162][e]]=41472+e,t[41472+e]=n[162][e]);for(n[163]="����������������������������������������������������������������wxyzΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρστυφχψωㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏ����������������������������������ㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦㄧㄨㄩ˙ˉˊˇˋ���������������������������������€������������������������������".split(""),e=0;e!=n[163].length;++e)65533!==n[163][e].charCodeAt(0)&&(r[n[163][e]]=41728+e,t[41728+e]=n[163][e]);for(n[164]="����������������������������������������������������������������一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才����������������������������������丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙�".split(""),e=0;e!=n[164].length;++e)65533!==n[164][e].charCodeAt(0)&&(r[n[164][e]]=41984+e,t[41984+e]=n[164][e]);for(n[165]="����������������������������������������������������������������世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外����������������������������������央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全�".split(""),e=0;e!=n[165].length;++e)65533!==n[165][e].charCodeAt(0)&&(r[n[165][e]]=42240+e,t[42240+e]=n[165][e]);for(n[166]="����������������������������������������������������������������共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年����������������������������������式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣�".split(""),e=0;e!=n[166].length;++e)65533!==n[166][e].charCodeAt(0)&&(r[n[166][e]]=42496+e,t[42496+e]=n[166][e]);for(n[167]="����������������������������������������������������������������作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍����������������������������������均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠�".split(""),e=0;e!=n[167].length;++e)65533!==n[167][e].charCodeAt(0)&&(r[n[167][e]]=42752+e,t[42752+e]=n[167][e]);for(n[168]="����������������������������������������������������������������杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒����������������������������������芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵�".split(""),e=0;e!=n[168].length;++e)65533!==n[168][e].charCodeAt(0)&&(r[n[168][e]]=43008+e,t[43008+e]=n[168][e]);for(n[169]="����������������������������������������������������������������咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居����������������������������������屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊�".split(""),e=0;e!=n[169].length;++e)65533!==n[169][e].charCodeAt(0)&&(r[n[169][e]]=43264+e,t[43264+e]=n[169][e]);for(n[170]="����������������������������������������������������������������昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠����������������������������������炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附�".split(""),e=0;e!=n[170].length;++e)65533!==n[170][e].charCodeAt(0)&&(r[n[170][e]]=43520+e,t[43520+e]=n[170][e]);for(n[171]="����������������������������������������������������������������陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品����������������������������������哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷�".split(""),e=0;e!=n[171].length;++e)65533!==n[171][e].charCodeAt(0)&&(r[n[171][e]]=43776+e,t[43776+e]=n[171][e]);for(n[172]="����������������������������������������������������������������拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗����������������������������������活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄�".split(""),e=0;e!=n[172].length;++e)65533!==n[172][e].charCodeAt(0)&&(r[n[172][e]]=44032+e,t[44032+e]=n[172][e]);for(n[173]="����������������������������������������������������������������耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥����������������������������������迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪�".split(""),e=0;e!=n[173].length;++e)65533!==n[173][e].charCodeAt(0)&&(r[n[173][e]]=44288+e,t[44288+e]=n[173][e]);for(n[174]="����������������������������������������������������������������哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙����������������������������������恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓�".split(""),e=0;e!=n[174].length;++e)65533!==n[174][e].charCodeAt(0)&&(r[n[174][e]]=44544+e,t[44544+e]=n[174][e]);for(n[175]="����������������������������������������������������������������浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷����������������������������������砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃�".split(""),e=0;e!=n[175].length;++e)65533!==n[175][e].charCodeAt(0)&&(r[n[175][e]]=44800+e,t[44800+e]=n[175][e]);for(n[176]="����������������������������������������������������������������虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡����������������������������������陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀�".split(""),e=0;e!=n[176].length;++e)65533!==n[176][e].charCodeAt(0)&&(r[n[176][e]]=45056+e,t[45056+e]=n[176][e]);for(n[177]="����������������������������������������������������������������娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽����������������������������������情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺�".split(""),e=0;e!=n[177].length;++e)65533!==n[177][e].charCodeAt(0)&&(r[n[177][e]]=45312+e,t[45312+e]=n[177][e]);for(n[178]="����������������������������������������������������������������毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶����������������������������������瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼�".split(""),e=0;e!=n[178].length;++e)65533!==n[178][e].charCodeAt(0)&&(r[n[178][e]]=45568+e,t[45568+e]=n[178][e]);for(n[179]="����������������������������������������������������������������莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途����������������������������������部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠�".split(""),e=0;e!=n[179].length;++e)65533!==n[179][e].charCodeAt(0)&&(r[n[179][e]]=45824+e,t[45824+e]=n[179][e]);for(n[180]="����������������������������������������������������������������婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍����������������������������������插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋�".split(""),e=0;e!=n[180].length;++e)65533!==n[180][e].charCodeAt(0)&&(r[n[180][e]]=46080+e,t[46080+e]=n[180][e]);for(n[181]="����������������������������������������������������������������溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘����������������������������������窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁�".split(""),e=0;e!=n[181].length;++e)65533!==n[181][e].charCodeAt(0)&&(r[n[181][e]]=46336+e,t[46336+e]=n[181][e]);for(n[182]="����������������������������������������������������������������詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑����������������������������������間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼�".split(""),e=0;e!=n[182].length;++e)65533!==n[182][e].charCodeAt(0)&&(r[n[182][e]]=46592+e,t[46592+e]=n[182][e]);for(n[183]="����������������������������������������������������������������媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業����������������������������������楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督�".split(""),e=0;e!=n[183].length;++e)65533!==n[183][e].charCodeAt(0)&&(r[n[183][e]]=46848+e,t[46848+e]=n[183][e]);for(n[184]="����������������������������������������������������������������睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫����������������������������������腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊�".split(""),e=0;e!=n[184].length;++e)65533!==n[184][e].charCodeAt(0)&&(r[n[184][e]]=47104+e,t[47104+e]=n[184][e]);for(n[185]="����������������������������������������������������������������辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴����������������������������������飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇�".split(""),e=0;e!=n[185].length;++e)65533!==n[185][e].charCodeAt(0)&&(r[n[185][e]]=47360+e,t[47360+e]=n[185][e]);for(n[186]="����������������������������������������������������������������愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢����������������������������������滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬�".split(""),e=0;e!=n[186].length;++e)65533!==n[186][e].charCodeAt(0)&&(r[n[186][e]]=47616+e,t[47616+e]=n[186][e]);for(n[187]="����������������������������������������������������������������罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤����������������������������������說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜�".split(""),e=0;e!=n[187].length;++e)65533!==n[187][e].charCodeAt(0)&&(r[n[187][e]]=47872+e,t[47872+e]=n[187][e]);for(n[188]="����������������������������������������������������������������劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂����������������������������������慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃�".split(""),e=0;e!=n[188].length;++e)65533!==n[188][e].charCodeAt(0)&&(r[n[188][e]]=48128+e,t[48128+e]=n[188][e]);for(n[189]="����������������������������������������������������������������瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯����������������������������������翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞�".split(""),e=0;e!=n[189].length;++e)65533!==n[189][e].charCodeAt(0)&&(r[n[189][e]]=48384+e,t[48384+e]=n[189][e]);for(n[190]="����������������������������������������������������������������輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉����������������������������������鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡�".split(""),e=0;e!=n[190].length;++e)65533!==n[190][e].charCodeAt(0)&&(r[n[190][e]]=48640+e,t[48640+e]=n[190][e]);for(n[191]="����������������������������������������������������������������濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊����������������������������������縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚�".split(""),e=0;e!=n[191].length;++e)65533!==n[191][e].charCodeAt(0)&&(r[n[191][e]]=48896+e,t[48896+e]=n[191][e]);for(n[192]="����������������������������������������������������������������錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇����������������������������������嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬�".split(""),e=0;e!=n[192].length;++e)65533!==n[192][e].charCodeAt(0)&&(r[n[192][e]]=49152+e,t[49152+e]=n[192][e]);for(n[193]="����������������������������������������������������������������瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪����������������������������������薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁�".split(""),e=0;e!=n[193].length;++e)65533!==n[193][e].charCodeAt(0)&&(r[n[193][e]]=49408+e,t[49408+e]=n[193][e]);for(n[194]="����������������������������������������������������������������駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘����������������������������������癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦�".split(""),e=0;e!=n[194].length;++e)65533!==n[194][e].charCodeAt(0)&&(r[n[194][e]]=49664+e,t[49664+e]=n[194][e]);for(n[195]="����������������������������������������������������������������鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸����������������������������������獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類�".split(""),e=0;e!=n[195].length;++e)65533!==n[195][e].charCodeAt(0)&&(r[n[195][e]]=49920+e,t[49920+e]=n[195][e]);for(n[196]="����������������������������������������������������������������願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼����������������������������������纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴�".split(""),e=0;e!=n[196].length;++e)65533!==n[196][e].charCodeAt(0)&&(r[n[196][e]]=50176+e,t[50176+e]=n[196][e]);for(n[197]="����������������������������������������������������������������護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬����������������������������������禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒�".split(""),e=0;e!=n[197].length;++e)65533!==n[197][e].charCodeAt(0)&&(r[n[197][e]]=50432+e,t[50432+e]=n[197][e]);for(n[198]="����������������������������������������������������������������讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲���������������������������������������������������������������������������������������������������������������������������������".split(""),e=0;e!=n[198].length;++e)65533!==n[198][e].charCodeAt(0)&&(r[n[198][e]]=50688+e,t[50688+e]=n[198][e]);for(n[201]="����������������������������������������������������������������乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕����������������������������������氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋�".split(""),e=0;e!=n[201].length;++e)65533!==n[201][e].charCodeAt(0)&&(r[n[201][e]]=51456+e,t[51456+e]=n[201][e]);for(n[202]="����������������������������������������������������������������汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘����������������������������������吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇�".split(""),e=0;e!=n[202].length;++e)65533!==n[202][e].charCodeAt(0)&&(r[n[202][e]]=51712+e,t[51712+e]=n[202][e]);for(n[203]="����������������������������������������������������������������杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓����������������������������������芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢�".split(""),e=0;e!=n[203].length;++e)65533!==n[203][e].charCodeAt(0)&&(r[n[203][e]]=51968+e,t[51968+e]=n[203][e]);for(n[204]="����������������������������������������������������������������坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋����������������������������������怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲�".split(""),e=0;e!=n[204].length;++e)65533!==n[204][e].charCodeAt(0)&&(r[n[204][e]]=52224+e,t[52224+e]=n[204][e]);for(n[205]="����������������������������������������������������������������泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺����������������������������������矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏�".split(""),e=0;e!=n[205].length;++e)65533!==n[205][e].charCodeAt(0)&&(r[n[205][e]]=52480+e,t[52480+e]=n[205][e]);for(n[206]="����������������������������������������������������������������哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛����������������������������������峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺�".split(""),e=0;e!=n[206].length;++e)65533!==n[206][e].charCodeAt(0)&&(r[n[206][e]]=52736+e,t[52736+e]=n[206][e]);for(n[207]="����������������������������������������������������������������柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂����������������������������������洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀�".split(""),e=0;e!=n[207].length;++e)65533!==n[207][e].charCodeAt(0)&&(r[n[207][e]]=52992+e,t[52992+e]=n[207][e]);for(n[208]="����������������������������������������������������������������穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪����������������������������������苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱�".split(""),e=0;e!=n[208].length;++e)65533!==n[208][e].charCodeAt(0)&&(r[n[208][e]]=53248+e,t[53248+e]=n[208][e]);for(n[209]="����������������������������������������������������������������唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧����������������������������������恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤�".split(""),e=0;e!=n[209].length;++e)65533!==n[209][e].charCodeAt(0)&&(r[n[209][e]]=53504+e,t[53504+e]=n[209][e]);for(n[210]="����������������������������������������������������������������毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸����������������������������������牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐�".split(""),e=0;e!=n[210].length;++e)65533!==n[210][e].charCodeAt(0)&&(r[n[210][e]]=53760+e,t[53760+e]=n[210][e]);for(n[211]="����������������������������������������������������������������笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢����������������������������������荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐�".split(""),e=0;e!=n[211].length;++e)65533!==n[211][e].charCodeAt(0)&&(r[n[211][e]]=54016+e,t[54016+e]=n[211][e]);for(n[212]="����������������������������������������������������������������酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅����������������������������������唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏�".split(""),e=0;e!=n[212].length;++e)65533!==n[212][e].charCodeAt(0)&&(r[n[212][e]]=54272+e,t[54272+e]=n[212][e]);for(n[213]="����������������������������������������������������������������崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟����������������������������������捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉�".split(""),e=0;e!=n[213].length;++e)65533!==n[213][e].charCodeAt(0)&&(r[n[213][e]]=54528+e,t[54528+e]=n[213][e]);for(n[214]="����������������������������������������������������������������淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏����������������������������������痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟�".split(""),e=0;e!=n[214].length;++e)65533!==n[214][e].charCodeAt(0)&&(r[n[214][e]]=54784+e,t[54784+e]=n[214][e]);for(n[215]="����������������������������������������������������������������耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷����������������������������������蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪�".split(""),e=0;e!=n[215].length;++e)65533!==n[215][e].charCodeAt(0)&&(r[n[215][e]]=55040+e,t[55040+e]=n[215][e]);for(n[216]="����������������������������������������������������������������釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷����������������������������������堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔�".split(""),e=0;e!=n[216].length;++e)65533!==n[216][e].charCodeAt(0)&&(r[n[216][e]]=55296+e,t[55296+e]=n[216][e]);for(n[217]="����������������������������������������������������������������惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒����������������������������������晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞�".split(""),e=0;e!=n[217].length;++e)65533!==n[217][e].charCodeAt(0)&&(r[n[217][e]]=55552+e,t[55552+e]=n[217][e]);for(n[218]="����������������������������������������������������������������湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖����������������������������������琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥�".split(""),e=0;e!=n[218].length;++e)65533!==n[218][e].charCodeAt(0)&&(r[n[218][e]]=55808+e,t[55808+e]=n[218][e]);for(n[219]="����������������������������������������������������������������罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳����������������������������������菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺�".split(""),e=0;e!=n[219].length;++e)65533!==n[219][e].charCodeAt(0)&&(r[n[219][e]]=56064+e,t[56064+e]=n[219][e]);for(n[220]="����������������������������������������������������������������軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈����������������������������������隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆�".split(""),e=0;e!=n[220].length;++e)65533!==n[220][e].charCodeAt(0)&&(r[n[220][e]]=56320+e,t[56320+e]=n[220][e]);for(n[221]="����������������������������������������������������������������媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤����������������������������������搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼�".split(""),e=0;e!=n[221].length;++e)65533!==n[221][e].charCodeAt(0)&&(r[n[221][e]]=56576+e,t[56576+e]=n[221][e]);for(n[222]="����������������������������������������������������������������毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓����������������������������������煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓�".split(""),e=0;e!=n[222].length;++e)65533!==n[222][e].charCodeAt(0)&&(r[n[222][e]]=56832+e,t[56832+e]=n[222][e]);for(n[223]="����������������������������������������������������������������稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯����������������������������������腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤�".split(""),e=0;e!=n[223].length;++e)65533!==n[223][e].charCodeAt(0)&&(r[n[223][e]]=57088+e,t[57088+e]=n[223][e]);for(n[224]="����������������������������������������������������������������觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿����������������������������������遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠�".split(""),e=0;e!=n[224].length;++e)65533!==n[224][e].charCodeAt(0)&&(r[n[224][e]]=57344+e,t[57344+e]=n[224][e]);for(n[225]="����������������������������������������������������������������凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠����������������������������������寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉�".split(""),e=0;e!=n[225].length;++e)65533!==n[225][e].charCodeAt(0)&&(r[n[225][e]]=57600+e,t[57600+e]=n[225][e]);for(n[226]="����������������������������������������������������������������榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊����������������������������������漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓�".split(""),e=0;e!=n[226].length;++e)65533!==n[226][e].charCodeAt(0)&&(r[n[226][e]]=57856+e,t[57856+e]=n[226][e]);for(n[227]="����������������������������������������������������������������禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞����������������������������������耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻�".split(""),e=0;e!=n[227].length;++e)65533!==n[227][e].charCodeAt(0)&&(r[n[227][e]]=58112+e,t[58112+e]=n[227][e]);for(n[228]="����������������������������������������������������������������裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍����������������������������������銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘�".split(""),e=0;e!=n[228].length;++e)65533!==n[228][e].charCodeAt(0)&&(r[n[228][e]]=58368+e,t[58368+e]=n[228][e]);for(n[229]="����������������������������������������������������������������噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉����������������������������������憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒�".split(""),e=0;e!=n[229].length;++e)65533!==n[229][e].charCodeAt(0)&&(r[n[229][e]]=58624+e,t[58624+e]=n[229][e]);for(n[230]="����������������������������������������������������������������澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙����������������������������������獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟�".split(""),e=0;e!=n[230].length;++e)65533!==n[230][e].charCodeAt(0)&&(r[n[230][e]]=58880+e,t[58880+e]=n[230][e]);for(n[231]="����������������������������������������������������������������膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢����������������������������������蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧�".split(""),e=0;e!=n[231].length;++e)65533!==n[231][e].charCodeAt(0)&&(r[n[231][e]]=59136+e,t[59136+e]=n[231][e]);for(n[232]="����������������������������������������������������������������踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓����������������������������������銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮�".split(""),e=0;e!=n[232].length;++e)65533!==n[232][e].charCodeAt(0)&&(r[n[232][e]]=59392+e,t[59392+e]=n[232][e]);for(n[233]="����������������������������������������������������������������噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺����������������������������������憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸�".split(""),e=0;e!=n[233].length;++e)65533!==n[233][e].charCodeAt(0)&&(r[n[233][e]]=59648+e,t[59648+e]=n[233][e]);for(n[234]="����������������������������������������������������������������澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙����������������������������������瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘�".split(""),e=0;e!=n[234].length;++e)65533!==n[234][e].charCodeAt(0)&&(r[n[234][e]]=59904+e,t[59904+e]=n[234][e]);for(n[235]="����������������������������������������������������������������蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠����������������������������������諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌�".split(""),e=0;e!=n[235].length;++e)65533!==n[235][e].charCodeAt(0)&&(r[n[235][e]]=60160+e,t[60160+e]=n[235][e]);for(n[236]="����������������������������������������������������������������錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕����������������������������������魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎�".split(""),e=0;e!=n[236].length;++e)65533!==n[236][e].charCodeAt(0)&&(r[n[236][e]]=60416+e,t[60416+e]=n[236][e]);for(n[237]="����������������������������������������������������������������檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶����������������������������������瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞�".split(""),e=0;e!=n[237].length;++e)65533!==n[237][e].charCodeAt(0)&&(r[n[237][e]]=60672+e,t[60672+e]=n[237][e]);for(n[238]="����������������������������������������������������������������蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞����������������������������������謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜�".split(""),e=0;e!=n[238].length;++e)65533!==n[238][e].charCodeAt(0)&&(r[n[238][e]]=60928+e,t[60928+e]=n[238][e]);for(n[239]="����������������������������������������������������������������鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰����������������������������������鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶�".split(""),e=0;e!=n[239].length;++e)65533!==n[239][e].charCodeAt(0)&&(r[n[239][e]]=61184+e,t[61184+e]=n[239][e]);for(n[240]="����������������������������������������������������������������璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒����������������������������������臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧�".split(""),e=0;e!=n[240].length;++e)65533!==n[240][e].charCodeAt(0)&&(r[n[240][e]]=61440+e,t[61440+e]=n[240][e]);for(n[241]="����������������������������������������������������������������蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪����������������������������������鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰�".split(""),e=0;e!=n[241].length;++e)65533!==n[241][e].charCodeAt(0)&&(r[n[241][e]]=61696+e,t[61696+e]=n[241][e]);for(n[242]="����������������������������������������������������������������徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛����������������������������������礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕�".split(""),e=0;e!=n[242].length;++e)65533!==n[242][e].charCodeAt(0)&&(r[n[242][e]]=61952+e,t[61952+e]=n[242][e]);for(n[243]="����������������������������������������������������������������譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦����������������������������������鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲�".split(""),e=0;e!=n[243].length;++e)65533!==n[243][e].charCodeAt(0)&&(r[n[243][e]]=62208+e,t[62208+e]=n[243][e]);for(n[244]="����������������������������������������������������������������嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩����������������������������������禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿�".split(""),e=0;e!=n[244].length;++e)65533!==n[244][e].charCodeAt(0)&&(r[n[244][e]]=62464+e,t[62464+e]=n[244][e]);for(n[245]="����������������������������������������������������������������鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛����������������������������������鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥�".split(""),e=0;e!=n[245].length;++e)65533!==n[245][e].charCodeAt(0)&&(r[n[245][e]]=62720+e,t[62720+e]=n[245][e]);for(n[246]="����������������������������������������������������������������蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺����������������������������������騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚�".split(""),e=0;e!=n[246].length;++e)65533!==n[246][e].charCodeAt(0)&&(r[n[246][e]]=62976+e,t[62976+e]=n[246][e]);for(n[247]="����������������������������������������������������������������糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊����������������������������������驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾�".split(""),e=0;e!=n[247].length;++e)65533!==n[247][e].charCodeAt(0)&&(r[n[247][e]]=63232+e,t[63232+e]=n[247][e]);for(n[248]="����������������������������������������������������������������讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏����������������������������������齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚�".split(""),e=0;e!=n[248].length;++e)65533!==n[248][e].charCodeAt(0)&&(r[n[248][e]]=63488+e,t[63488+e]=n[248][e]);for(n[249]="����������������������������������������������������������������纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊����������������������������������龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓�".split(""),e=0;e!=n[249].length;++e)65533!==n[249][e].charCodeAt(0)&&(r[n[249][e]]=63744+e,t[63744+e]=n[249][e]);return{enc:r,dec:t}}(),t[1250]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[1251]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[1252]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[1253]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[1254]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[1255]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹ�ֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[1256]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[1257]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[1258]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[1e4]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[10006]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[10007]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[10008]=function(){var e,t=[],r={},n=[];for(n[0]="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€���������������������������������������������������������������������������������������".split(""),e=0;e!=n[0].length;++e)65533!==n[0][e].charCodeAt(0)&&(r[n[0][e]]=0+e,t[0+e]=n[0][e]);for(n[161]="����������������������������������������������������������������������������������������������������������������������������������������������������������������� 、。・ˉˇ¨〃々―~�…‘’“”〔〕〈〉《》「」『』〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓�".split(""),e=0;e!=n[161].length;++e)65533!==n[161][e].charCodeAt(0)&&(r[n[161][e]]=41216+e,t[41216+e]=n[161][e]);for(n[162]="���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇①②③④⑤⑥⑦⑧⑨⑩��㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩��ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ���".split(""),e=0;e!=n[162].length;++e)65533!==n[162][e].charCodeAt(0)&&(r[n[162][e]]=41472+e,t[41472+e]=n[162][e]);for(n[163]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������!"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} ̄�".split(""),e=0;e!=n[163].length;++e)65533!==n[163][e].charCodeAt(0)&&(r[n[163][e]]=41728+e,t[41728+e]=n[163][e]);for(n[164]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん������������".split(""),e=0;e!=n[164].length;++e)65533!==n[164][e].charCodeAt(0)&&(r[n[164][e]]=41984+e,t[41984+e]=n[164][e]);for(n[165]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ���������".split(""),e=0;e!=n[165].length;++e)65533!==n[165][e].charCodeAt(0)&&(r[n[165][e]]=42240+e,t[42240+e]=n[165][e]);for(n[166]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω���������������������������������������".split(""),e=0;e!=n[166].length;++e)65533!==n[166][e].charCodeAt(0)&&(r[n[166][e]]=42496+e,t[42496+e]=n[166][e]);for(n[167]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмнопрстуфхцчшщъыьэюя��������������".split(""),e=0;e!=n[167].length;++e)65533!==n[167][e].charCodeAt(0)&&(r[n[167][e]]=42752+e,t[42752+e]=n[167][e]);for(n[168]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüê����������ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦㄧㄨㄩ����������������������".split(""),e=0;e!=n[168].length;++e)65533!==n[168][e].charCodeAt(0)&&(r[n[168][e]]=43008+e,t[43008+e]=n[168][e]);for(n[169]="��������������������������������������������������������������������������������������������������������������������������������������������������������������������─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋����������������".split(""),e=0;e!=n[169].length;++e)65533!==n[169][e].charCodeAt(0)&&(r[n[169][e]]=43264+e,t[43264+e]=n[169][e]);for(n[176]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥�".split(""),e=0;e!=n[176].length;++e)65533!==n[176][e].charCodeAt(0)&&(r[n[176][e]]=45056+e,t[45056+e]=n[176][e]);for(n[177]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳�".split(""),e=0;e!=n[177].length;++e)65533!==n[177][e].charCodeAt(0)&&(r[n[177][e]]=45312+e,t[45312+e]=n[177][e]);for(n[178]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖�".split(""),e=0;e!=n[178].length;++e)65533!==n[178][e].charCodeAt(0)&&(r[n[178][e]]=45568+e,t[45568+e]=n[178][e]);for(n[179]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚�".split(""),e=0;e!=n[179].length;++e)65533!==n[179][e].charCodeAt(0)&&(r[n[179][e]]=45824+e,t[45824+e]=n[179][e]);for(n[180]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮�".split(""),e=0;e!=n[180].length;++e)65533!==n[180][e].charCodeAt(0)&&(r[n[180][e]]=46080+e,t[46080+e]=n[180][e]);for(n[181]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠�".split(""),e=0;e!=n[181].length;++e)65533!==n[181][e].charCodeAt(0)&&(r[n[181][e]]=46336+e,t[46336+e]=n[181][e]);for(n[182]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二�".split(""),e=0;e!=n[182].length;++e)65533!==n[182][e].charCodeAt(0)&&(r[n[182][e]]=46592+e,t[46592+e]=n[182][e]);for(n[183]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服�".split(""),e=0;e!=n[183].length;++e)65533!==n[183][e].charCodeAt(0)&&(r[n[183][e]]=46848+e,t[46848+e]=n[183][e]);for(n[184]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹�".split(""),e=0;e!=n[184].length;++e)65533!==n[184][e].charCodeAt(0)&&(r[n[184][e]]=47104+e,t[47104+e]=n[184][e]);for(n[185]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈�".split(""),e=0;e!=n[185].length;++e)65533!==n[185][e].charCodeAt(0)&&(r[n[185][e]]=47360+e,t[47360+e]=n[185][e]);for(n[186]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖�".split(""),e=0;e!=n[186].length;++e)65533!==n[186][e].charCodeAt(0)&&(r[n[186][e]]=47616+e,t[47616+e]=n[186][e]);for(n[187]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕�".split(""),e=0;e!=n[187].length;++e)65533!==n[187][e].charCodeAt(0)&&(r[n[187][e]]=47872+e,t[47872+e]=n[187][e]);for(n[188]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件�".split(""),e=0;e!=n[188].length;++e)65533!==n[188][e].charCodeAt(0)&&(r[n[188][e]]=48128+e,t[48128+e]=n[188][e]);for(n[189]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸�".split(""),e=0;e!=n[189].length;++e)65533!==n[189][e].charCodeAt(0)&&(r[n[189][e]]=48384+e,t[48384+e]=n[189][e]);for(n[190]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻�".split(""),e=0;e!=n[190].length;++e)65533!==n[190][e].charCodeAt(0)&&(r[n[190][e]]=48640+e,t[48640+e]=n[190][e]);for(n[191]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀�".split(""),e=0;e!=n[191].length;++e)65533!==n[191][e].charCodeAt(0)&&(r[n[191][e]]=48896+e,t[48896+e]=n[191][e]);for(n[192]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐�".split(""),e=0;e!=n[192].length;++e)65533!==n[192][e].charCodeAt(0)&&(r[n[192][e]]=49152+e,t[49152+e]=n[192][e]);for(n[193]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿�".split(""),e=0;e!=n[193].length;++e)65533!==n[193][e].charCodeAt(0)&&(r[n[193][e]]=49408+e,t[49408+e]=n[193][e]);for(n[194]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫�".split(""),e=0;e!=n[194].length;++e)65533!==n[194][e].charCodeAt(0)&&(r[n[194][e]]=49664+e,t[49664+e]=n[194][e]);for(n[195]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸�".split(""),e=0;e!=n[195].length;++e)65533!==n[195][e].charCodeAt(0)&&(r[n[195][e]]=49920+e,t[49920+e]=n[195][e]);for(n[196]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁�".split(""),e=0;e!=n[196].length;++e)65533!==n[196][e].charCodeAt(0)&&(r[n[196][e]]=50176+e,t[50176+e]=n[196][e]);for(n[197]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗�".split(""),e=0;e!=n[197].length;++e)65533!==n[197][e].charCodeAt(0)&&(r[n[197][e]]=50432+e,t[50432+e]=n[197][e]);for(n[198]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐�".split(""),e=0;e!=n[198].length;++e)65533!==n[198][e].charCodeAt(0)&&(r[n[198][e]]=50688+e,t[50688+e]=n[198][e]);for(n[199]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠�".split(""),e=0;e!=n[199].length;++e)65533!==n[199][e].charCodeAt(0)&&(r[n[199][e]]=50944+e,t[50944+e]=n[199][e]);for(n[200]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁�".split(""),e=0;e!=n[200].length;++e)65533!==n[200][e].charCodeAt(0)&&(r[n[200][e]]=51200+e,t[51200+e]=n[200][e]);for(n[201]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳�".split(""),e=0;e!=n[201].length;++e)65533!==n[201][e].charCodeAt(0)&&(r[n[201][e]]=51456+e,t[51456+e]=n[201][e]);for(n[202]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱�".split(""),e=0;e!=n[202].length;++e)65533!==n[202][e].charCodeAt(0)&&(r[n[202][e]]=51712+e,t[51712+e]=n[202][e]);for(n[203]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔�".split(""),e=0;e!=n[203].length;++e)65533!==n[203][e].charCodeAt(0)&&(r[n[203][e]]=51968+e,t[51968+e]=n[203][e]);for(n[204]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃�".split(""),e=0;e!=n[204].length;++e)65533!==n[204][e].charCodeAt(0)&&(r[n[204][e]]=52224+e,t[52224+e]=n[204][e]);for(n[205]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威�".split(""),e=0;e!=n[205].length;++e)65533!==n[205][e].charCodeAt(0)&&(r[n[205][e]]=52480+e,t[52480+e]=n[205][e]);for(n[206]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺�".split(""),e=0;e!=n[206].length;++e)65533!==n[206][e].charCodeAt(0)&&(r[n[206][e]]=52736+e,t[52736+e]=n[206][e]);for(n[207]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓�".split(""),e=0;e!=n[207].length;++e)65533!==n[207][e].charCodeAt(0)&&(r[n[207][e]]=52992+e,t[52992+e]=n[207][e]);for(n[208]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄�".split(""),e=0;e!=n[208].length;++e)65533!==n[208][e].charCodeAt(0)&&(r[n[208][e]]=53248+e,t[53248+e]=n[208][e]);for(n[209]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶�".split(""),e=0;e!=n[209].length;++e)65533!==n[209][e].charCodeAt(0)&&(r[n[209][e]]=53504+e,t[53504+e]=n[209][e]);for(n[210]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐�".split(""),e=0;e!=n[210].length;++e)65533!==n[210][e].charCodeAt(0)&&(r[n[210][e]]=53760+e,t[53760+e]=n[210][e]);for(n[211]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉�".split(""),e=0;e!=n[211].length;++e)65533!==n[211][e].charCodeAt(0)&&(r[n[211][e]]=54016+e,t[54016+e]=n[211][e]);for(n[212]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧�".split(""),e=0;e!=n[212].length;++e)65533!==n[212][e].charCodeAt(0)&&(r[n[212][e]]=54272+e,t[54272+e]=n[212][e]);for(n[213]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政�".split(""),e=0;e!=n[213].length;++e)65533!==n[213][e].charCodeAt(0)&&(r[n[213][e]]=54528+e,t[54528+e]=n[213][e]);for(n[214]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑�".split(""),e=0;e!=n[214].length;++e)65533!==n[214][e].charCodeAt(0)&&(r[n[214][e]]=54784+e,t[54784+e]=n[214][e]);for(n[215]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座������".split(""),e=0;e!=n[215].length;++e)65533!==n[215][e].charCodeAt(0)&&(r[n[215][e]]=55040+e,t[55040+e]=n[215][e]);for(n[216]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝�".split(""),e=0;e!=n[216].length;++e)65533!==n[216][e].charCodeAt(0)&&(r[n[216][e]]=55296+e,t[55296+e]=n[216][e]);for(n[217]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼�".split(""),e=0;e!=n[217].length;++e)65533!==n[217][e].charCodeAt(0)&&(r[n[217][e]]=55552+e,t[55552+e]=n[217][e]);for(n[218]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺�".split(""),e=0;e!=n[218].length;++e)65533!==n[218][e].charCodeAt(0)&&(r[n[218][e]]=55808+e,t[55808+e]=n[218][e]);for(n[219]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝�".split(""),e=0;e!=n[219].length;++e)65533!==n[219][e].charCodeAt(0)&&(r[n[219][e]]=56064+e,t[56064+e]=n[219][e]);for(n[220]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥�".split(""),e=0;e!=n[220].length;++e)65533!==n[220][e].charCodeAt(0)&&(r[n[220][e]]=56320+e,t[56320+e]=n[220][e]);for(n[221]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺�".split(""),e=0;e!=n[221].length;++e)65533!==n[221][e].charCodeAt(0)&&(r[n[221][e]]=56576+e,t[56576+e]=n[221][e]);for(n[222]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖�".split(""),e=0;e!=n[222].length;++e)65533!==n[222][e].charCodeAt(0)&&(r[n[222][e]]=56832+e,t[56832+e]=n[222][e]);for(n[223]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼�".split(""),e=0;e!=n[223].length;++e)65533!==n[223][e].charCodeAt(0)&&(r[n[223][e]]=57088+e,t[57088+e]=n[223][e]);for(n[224]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼�".split(""),e=0;e!=n[224].length;++e)65533!==n[224][e].charCodeAt(0)&&(r[n[224][e]]=57344+e,t[57344+e]=n[224][e]);for(n[225]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺�".split(""),e=0;e!=n[225].length;++e)65533!==n[225][e].charCodeAt(0)&&(r[n[225][e]]=57600+e,t[57600+e]=n[225][e]);for(n[226]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧饨饩饪饫饬饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂�".split(""),e=0;e!=n[226].length;++e)65533!==n[226][e].charCodeAt(0)&&(r[n[226][e]]=57856+e,t[57856+e]=n[226][e]);for(n[227]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾�".split(""),e=0;e!=n[227].length;++e)65533!==n[227][e].charCodeAt(0)&&(r[n[227][e]]=58112+e,t[58112+e]=n[227][e]);for(n[228]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑�".split(""),e=0;e!=n[228].length;++e)65533!==n[228][e].charCodeAt(0)&&(r[n[228][e]]=58368+e,t[58368+e]=n[228][e]);for(n[229]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣�".split(""),e=0;e!=n[229].length;++e)65533!==n[229][e].charCodeAt(0)&&(r[n[229][e]]=58624+e,t[58624+e]=n[229][e]);for(n[230]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩�".split(""),e=0;e!=n[230].length;++e)65533!==n[230][e].charCodeAt(0)&&(r[n[230][e]]=58880+e,t[58880+e]=n[230][e]);for(n[231]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡缢缣缤缥缦缧缪缫缬缭缯缰缱缲缳缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬�".split(""),e=0;e!=n[231].length;++e)65533!==n[231][e].charCodeAt(0)&&(r[n[231][e]]=59136+e,t[59136+e]=n[231][e]);for(n[232]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹�".split(""),e=0;e!=n[232].length;++e)65533!==n[232][e].charCodeAt(0)&&(r[n[232][e]]=59392+e,t[59392+e]=n[232][e]);for(n[233]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋�".split(""),e=0;e!=n[233].length;++e)65533!==n[233][e].charCodeAt(0)&&(r[n[233][e]]=59648+e,t[59648+e]=n[233][e]);for(n[234]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰�".split(""),e=0;e!=n[234].length;++e)65533!==n[234][e].charCodeAt(0)&&(r[n[234][e]]=59904+e,t[59904+e]=n[234][e]);for(n[235]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻�".split(""),e=0;e!=n[235].length;++e)65533!==n[235][e].charCodeAt(0)&&(r[n[235][e]]=60160+e,t[60160+e]=n[235][e]);for(n[236]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐�".split(""),e=0;e!=n[236].length;++e)65533!==n[236][e].charCodeAt(0)&&(r[n[236][e]]=60416+e,t[60416+e]=n[236][e]);for(n[237]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨�".split(""),e=0;e!=n[237].length;++e)65533!==n[237][e].charCodeAt(0)&&(r[n[237][e]]=60672+e,t[60672+e]=n[237][e]);for(n[238]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶钷钸钹钺钼钽钿铄铈铉铊铋铌铍铎铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪�".split(""),e=0;e!=n[238].length;++e)65533!==n[238][e].charCodeAt(0)&&(r[n[238][e]]=60928+e,t[60928+e]=n[238][e]);for(n[239]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒锓锔锕锖锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤镥镦镧镨镩镪镫镬镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔�".split(""),e=0;e!=n[239].length;++e)65533!==n[239][e].charCodeAt(0)&&(r[n[239][e]]=61184+e,t[61184+e]=n[239][e]);for(n[240]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨鸩鸪鸫鸬鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦鹧鹨鹩鹪鹫鹬鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙�".split(""),e=0;e!=n[240].length;++e)65533!==n[240][e].charCodeAt(0)&&(r[n[240][e]]=61440+e,t[61440+e]=n[240][e]);for(n[241]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃�".split(""),e=0;e!=n[241].length;++e)65533!==n[241][e].charCodeAt(0)&&(r[n[241][e]]=61696+e,t[61696+e]=n[241][e]);for(n[242]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒�".split(""),e=0;e!=n[242].length;++e)65533!==n[242][e].charCodeAt(0)&&(r[n[242][e]]=61952+e,t[61952+e]=n[242][e]);for(n[243]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋�".split(""),e=0;e!=n[243].length;++e)65533!==n[243][e].charCodeAt(0)&&(r[n[243][e]]=62208+e,t[62208+e]=n[243][e]);for(n[244]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤�".split(""),e=0;e!=n[244].length;++e)65533!==n[244][e].charCodeAt(0)&&(r[n[244][e]]=62464+e,t[62464+e]=n[244][e]);for(n[245]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜�".split(""),e=0;e!=n[245].length;++e)65533!==n[245][e].charCodeAt(0)&&(r[n[245][e]]=62720+e,t[62720+e]=n[245][e]);for(n[246]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅龆龇龈龉龊龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞鲟鲠鲡鲢鲣鲥鲦鲧鲨鲩鲫鲭鲮鲰鲱鲲鲳鲴鲵鲶鲷鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋�".split(""),e=0;e!=n[246].length;++e)65533!==n[246][e].charCodeAt(0)&&(r[n[246][e]]=62976+e,t[62976+e]=n[246][e]);for(n[247]="�����������������������������������������������������������������������������������������������������������������������������������������������������������������鳌鳍鳎鳏鳐鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄�".split(""),e=0;e!=n[247].length;++e)65533!==n[247][e].charCodeAt(0)&&(r[n[247][e]]=63232+e,t[63232+e]=n[247][e]);return{enc:r,dec:t}}(),t[10029]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[10079]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[10081]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),t[28591]=function(){for(var e="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ",t=[],r={},n=0;n!=e.length;++n)65533!==e.charCodeAt(n)&&(r[e.charAt(n)]=n),t[n]=e.charAt(n);return{enc:r,dec:t}}(),e.exports&&"undefined"==typeof DO_NOT_EXPORT_CODEPAGE&&(e.exports=t),function(r,n){"use strict";if(void 0===t){var a=t;e.exports&&"undefined"==typeof DO_NOT_EXPORT_CODEPAGE?e.exports=n(a):r.cptable=n(a)}else t=n(t)}(this,(function(e){"use strict";var t={1200:"utf16le",1201:"utf16be",12e3:"utf32le",12001:"utf32be",16969:"utf64le",20127:"ascii",65e3:"utf7",65001:"utf8"},r=[874,1250,1251,1252,1253,1254,1255,1256,1e4],n=[932,936,949,950],a=[65001],i={},o={},s={},l={},c=function(e){return String.fromCharCode(e)},u=function(e){return e.charCodeAt(0)},f="undefined"!=typeof Buffer,p=function(){};if(f){var h=!Buffer.from;if(!h)try{Buffer.from("foo","utf8")}catch(e){h=!0}p=h?function(e,t){return t?new Buffer(e,t):new Buffer(e)}:Buffer.from.bind(Buffer),Buffer.allocUnsafe||(Buffer.allocUnsafe=function(e){return new Buffer(e)});var d=1024,m=Buffer.allocUnsafe(d),g=function(t){var r=function(e){for(var t=Buffer.allocUnsafe(65536),r=0;r<65536;++r)t[r]=0;for(var n=Object.keys(e),a=n.length,i=0,o=n[i];i<a;++i)(o=n[i])&&(t[o.charCodeAt(0)]=e[o]);return t}(e[t].enc);return function(e,t){var n,a=e.length,i=0,o=0,s=0,l=0;if("string"==typeof e)for(n=Buffer.allocUnsafe(a),i=0;i<a;++i)n[i]=r[e.charCodeAt(i)];else if(Buffer.isBuffer(e)){for(n=Buffer.allocUnsafe(2*a),o=0,i=0;i<a;++i)(s=e[i])<128?n[o++]=r[s]:s<224?(n[o++]=r[((31&s)<<6)+(63&e[i+1])],++i):s<240?(n[o++]=r[((15&s)<<12)+((63&e[i+1])<<6)+(63&e[i+2])],i+=2):(l=((7&s)<<18)+((63&e[i+1])<<12)+((63&e[i+2])<<6)+(63&e[i+3]),i+=3,l<65536?n[o++]=r[l]:(l-=65536,n[o++]=r[55296+(l>>10&1023)],n[o++]=r[56320+(1023&l)]));n=n.slice(0,o)}else for(n=Buffer.allocUnsafe(a),i=0;i<a;++i)n[i]=r[e[i].charCodeAt(0)];return t&&"buf"!==t?"arr"!==t?n.toString("binary"):[].slice.call(n):n}},y=function(t){var r=e[t].dec,n=Buffer.allocUnsafe(131072),a=0,i="";for(a=0;a<r.length;++a)if(i=r[a]){var o=i.charCodeAt(0);n[2*a]=255&o,n[2*a+1]=o>>8}return function(e){var t=e.length,r=0,a=0;if(2*t>d&&(d=2*t,m=Buffer.allocUnsafe(d)),Buffer.isBuffer(e))for(r=0;r<t;r++)a=2*e[r],m[2*r]=n[a],m[2*r+1]=n[a+1];else if("string"==typeof e)for(r=0;r<t;r++)a=2*e.charCodeAt(r),m[2*r]=n[a],m[2*r+1]=n[a+1];else for(r=0;r<t;r++)a=2*e[r],m[2*r]=n[a],m[2*r+1]=n[a+1];return m.slice(0,2*t).toString("ucs2")}},v=function(t){for(var r=e[t].enc,n=Buffer.allocUnsafe(131072),a=0;a<131072;++a)n[a]=0;for(var i=Object.keys(r),o=0,s=i[o];o<i.length;++o)if(s=i[o]){var l=s.charCodeAt(0);n[2*l]=255&r[s],n[2*l+1]=r[s]>>8}return function(e,t){var r=e.length,a=Buffer.allocUnsafe(2*r),i=0,o=0,s=0,l=0,c=0;if("string"==typeof e){for(i=l=0;i<r;++i)o=2*e.charCodeAt(i),a[l++]=n[o+1]||n[o],n[o+1]>0&&(a[l++]=n[o]);a=a.slice(0,l)}else if(Buffer.isBuffer(e)){for(i=l=0;i<r;++i)(c=e[i])<128?o=c:c<224?(o=((31&c)<<6)+(63&e[i+1]),++i):c<240?(o=((15&c)<<12)+((63&e[i+1])<<6)+(63&e[i+2]),i+=2):(o=((7&c)<<18)+((63&e[i+1])<<12)+((63&e[i+2])<<6)+(63&e[i+3]),i+=3),o<65536?(o*=2,a[l++]=n[o+1]||n[o],n[o+1]>0&&(a[l++]=n[o])):(o=2*(55296+((s=o-65536)>>10&1023)),a[l++]=n[o+1]||n[o],n[o+1]>0&&(a[l++]=n[o]),o=2*(56320+(1023&s)),a[l++]=n[o+1]||n[o],n[o+1]>0&&(a[l++]=n[o]));a=a.slice(0,l)}else for(i=l=0;i<r;i++)o=2*e[i].charCodeAt(0),a[l++]=n[o+1]||n[o],n[o+1]>0&&(a[l++]=n[o]);return t&&"buf"!==t?"arr"!==t?a.toString("binary"):[].slice.call(a):a}},b=function(t){var r,n=e[t].dec,a=Buffer.allocUnsafe(131072),i=0,o=0,s=0,l=0;for(l=0;l<65536;++l)a[2*l]=255,a[2*l+1]=253;for(i=0;i<n.length;++i)(r=n[i])&&(o=r.charCodeAt(0),a[s=2*i]=255&o,a[s+1]=o>>8);return function(e){var t=e.length,r=Buffer.allocUnsafe(2*t),n=0,i=0,o=0;if(Buffer.isBuffer(e))for(n=0;n<t;n++)i=2*e[n],255===a[i]&&253===a[i+1]&&(i=2*((e[n]<<8)+e[n+1]),++n),r[o++]=a[i],r[o++]=a[i+1];else if("string"==typeof e)for(n=0;n<t;n++)i=2*e.charCodeAt(n),255===a[i]&&253===a[i+1]&&(i=2*((e.charCodeAt(n)<<8)+e.charCodeAt(n+1)),++n),r[o++]=a[i],r[o++]=a[i+1];else for(n=0;n<t;n++)i=2*e[n],255===a[i]&&253===a[i+1]&&(i=2*((e[n]<<8)+e[n+1]),++n),r[o++]=a[i],r[o++]=a[i+1];return r.slice(0,o).toString("ucs2")}};i[65001]=function e(t){if("string"==typeof t)return e(t.split("").map(u));var r=t.length,n=0,a=0;4*r>d&&(d=4*r,m=Buffer.allocUnsafe(d));var i=0;r>=3&&239==t[0]&&187==t[1]&&191==t[2]&&(i=3);for(var o=1,s=0,l=0;i<r;i+=o)o=1,(l=t[i])<128?n=l:l<224?(n=64*(31&l)+(63&t[i+1]),o=2):l<240?(n=((15&l)<<12)+64*(63&t[i+1])+(63&t[i+2]),o=3):(n=262144*(7&l)+((63&t[i+1])<<12)+64*(63&t[i+2])+(63&t[i+3]),o=4),n<65536?(m[s++]=255&n,m[s++]=n>>8):(a=55296+((n-=65536)>>10&1023),n=56320+(1023&n),m[s++]=255&a,m[s++]=a>>>8,m[s++]=255&n,m[s++]=n>>>8&255);return m.slice(0,s).toString("ucs2")},o[65001]=function(e,t){if(f&&Buffer.isBuffer(e))return t&&"buf"!==t?"arr"!==t?e.toString("binary"):[].slice.call(e):e;var r=e.length,n=0,a=0,i=0,o="string"==typeof e;4*r>d&&(d=4*r,m=Buffer.allocUnsafe(d));for(var s=0;s<r;++s)(n=o?e.charCodeAt(s):e[s].charCodeAt(0))<=127?m[i++]=n:n<=2047?(m[i++]=192+(n>>6),m[i++]=128+(63&n)):n>=55296&&n<=57343?(n-=55296,++s,a=(o?e.charCodeAt(s):e[s].charCodeAt(0))-56320+(n<<10),m[i++]=240+(a>>>18&7),m[i++]=144+(a>>>12&63),m[i++]=128+(a>>>6&63),m[i++]=128+(63&a)):(m[i++]=224+(n>>12),m[i++]=128+(n>>6&63),m[i++]=128+(63&n));return t&&"buf"!==t?"arr"!==t?m.slice(0,i).toString("binary"):[].slice.call(m,0,i):m.slice(0,i)}}var x=function(){if(f){if(s[r[0]])return;var t=0,c=0;for(t=0;t<r.length;++t)c=r[t],e[c]&&(s[c]=y(c),l[c]=g(c));for(t=0;t<n.length;++t)c=n[t],e[c]&&(s[c]=b(c),l[c]=v(c));for(t=0;t<a.length;++t)c=a[t],i[c]&&(s[c]=i[c]),o[c]&&(l[c]=o[c])}},_=function(e,t){return""},w=function(e){delete s[e],delete l[e]},k={encache:x,decache:function(){if(f){if(!s[r[0]])return;r.forEach(w),n.forEach(w),a.forEach(w)}T=_,A=0},sbcs:r,dbcs:n};x();var D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=_,A=0;return e.utils={decode:function r(n,a){var i;if(i=s[n])return i(a);if("string"==typeof a)return r(n,a.split("").map(u));var o,l=a.length,c=new Array(l),p="",h=0,d=0,m=1,g=0,y=0,v=e[n],b="";if(v&&(o=v.dec))for(d=0;d<l;d+=m){if(m=2,(p=o[(a[d]<<8)+a[d+1]])||(m=1,p=o[a[d]]),!p)throw new Error("Unrecognized code: "+a[d]+" "+a[d+m-1]+" "+d+" "+m+" "+o[a[d]]);c[g++]=p}else{if(!(b=t[n]))throw new Error("Unrecognized CP: "+n);switch(b){case"utf8":for(l>=3&&239==a[0]&&187==a[1]&&191==a[2]&&(d=3);d<l;d+=m)m=1,a[d]<128?h=a[d]:a[d]<224?(h=64*(31&a[d])+(63&a[d+1]),m=2):a[d]<240?(h=((15&a[d])<<12)+64*(63&a[d+1])+(63&a[d+2]),m=3):(h=262144*(7&a[d])+((63&a[d+1])<<12)+64*(63&a[d+2])+(63&a[d+3]),m=4),h<65536||(y=55296+((h-=65536)>>10&1023),h=56320+(1023&h),c[g++]=String.fromCharCode(y)),c[g++]=String.fromCharCode(h);break;case"ascii":if(f&&Buffer.isBuffer(a))return a.toString(b);for(d=0;d<l;d++)c[d]=String.fromCharCode(a[d]);g=l;break;case"utf16le":if(l>=2&&255==a[0]&&254==a[1]&&(d=2),f&&Buffer.isBuffer(a))return a.toString(b);for(m=2;d+1<l;d+=m)c[g++]=String.fromCharCode((a[d+1]<<8)+a[d]);break;case"utf16be":for(l>=2&&254==a[0]&&255==a[1]&&(d=2),m=2;d+1<l;d+=m)c[g++]=String.fromCharCode((a[d]<<8)+a[d+1]);break;case"utf32le":for(l>=4&&255==a[0]&&254==a[1]&&0===a[2]&&0===a[3]&&(d=4),m=4;d<l;d+=m)(h=(a[d+3]<<24)+(a[d+2]<<16)+(a[d+1]<<8)+a[d])>65535?(h-=65536,c[g++]=String.fromCharCode(55296+(h>>10&1023)),c[g++]=String.fromCharCode(56320+(1023&h))):c[g++]=String.fromCharCode(h);break;case"utf32be":for(l>=4&&255==a[3]&&254==a[2]&&0===a[1]&&0===a[0]&&(d=4),m=4;d<l;d+=m)(h=(a[d]<<24)+(a[d+1]<<16)+(a[d+2]<<8)+a[d+3])>65535?(h-=65536,c[g++]=String.fromCharCode(55296+(h>>10&1023)),c[g++]=String.fromCharCode(56320+(1023&h))):c[g++]=String.fromCharCode(h);break;case"utf7":for(l>=4&&43==a[0]&&47==a[1]&&118==a[2]&&(l>=5&&56==a[3]&&45==a[4]?d=5:56!=a[3]&&57!=a[3]&&43!=a[3]&&47!=a[3]||(d=4));d<l;d+=m)if(43===a[d])if(m=1,45!==a[d+1]){for(;String.fromCharCode(a[d+m]).match(/[A-Za-z0-9+\/]/);)m++;var x=0;45===a[d+m]&&(++m,x=1);for(var _=[],w="",k=0,T=0,A=0,S=0,M=0,E=0,C=1;C<m-x&&(k=D.indexOf(String.fromCharCode(a[d+C++]))<<2|(S=D.indexOf(String.fromCharCode(a[d+C++])))>>4,_.push(k),-1!==(M=D.indexOf(String.fromCharCode(a[d+C++]))))&&(T=(15&S)<<4|M>>2,_.push(T),-1!==(E=D.indexOf(String.fromCharCode(a[d+C++]))));)A=(3&M)<<6|E,E<64&&_.push(A);for(w=r(1201,_),C=0;C<w.length;++C)c[g++]=w.charAt(C)}else m=2,c[g++]="+";else m=1,c[g++]=String.fromCharCode(a[d]);break;default:throw new Error("Unsupported magic: "+n+" "+t[n])}}return c.slice(0,g).join("")},encode:function r(n,a,i){if(n===A&&T)return T(a,i);if(l[n])return(T=l[A=n])(a,i);f&&Buffer.isBuffer(a)&&(a=a.toString("utf8"));var o,s=a.length,u=f?Buffer.allocUnsafe(4*s):[],h=0,d=0,m=0,g=0,y=e[n],v="",b="string"==typeof a;if(y&&(o=y.enc))for(d=0;d<s;++d,++m)(h=o[b?a.charAt(d):a[d]])>255?(u[m]=h>>8,u[++m]=255&h):u[m]=255&h;else{if(!(v=t[n]))throw new Error("Unrecognized CP: "+n);switch(v){case"utf8":if(f&&b){m=(u=p(a,v)).length;break}for(d=0;d<s;++d,++m)(h=b?a.charCodeAt(d):a[d].charCodeAt(0))<=127?u[m]=h:h<=2047?(u[m]=192+(h>>6),u[++m]=128+(63&h)):h>=55296&&h<=57343?(h-=55296,g=(b?a.charCodeAt(++d):a[++d].charCodeAt(0))-56320+(h<<10),u[m]=240+(g>>>18&7),u[++m]=144+(g>>>12&63),u[++m]=128+(g>>>6&63),u[++m]=128+(63&g)):(u[m]=224+(h>>12),u[++m]=128+(h>>6&63),u[++m]=128+(63&h));break;case"ascii":if(f&&"string"==typeof a){m=(u=p(a,v)).length;break}for(d=0;d<s;++d,++m){if(!((h=b?a.charCodeAt(d):a[d].charCodeAt(0))<=127))throw new Error("bad ascii "+h);u[m]=h}break;case"utf16le":if(f&&"string"==typeof a){m=(u=p(a,v)).length;break}for(d=0;d<s;++d)h=b?a.charCodeAt(d):a[d].charCodeAt(0),u[m++]=255&h,u[m++]=h>>8;break;case"utf16be":for(d=0;d<s;++d)h=b?a.charCodeAt(d):a[d].charCodeAt(0),u[m++]=h>>8,u[m++]=255&h;break;case"utf32le":for(d=0;d<s;++d)(h=b?a.charCodeAt(d):a[d].charCodeAt(0))>=55296&&h<=57343&&(h=65536+(h-55296<<10)+(a[++d].charCodeAt(0)-56320)),u[m++]=255&h,h>>=8,u[m++]=255&h,h>>=8,u[m++]=255&h,h>>=8,u[m++]=255&h;break;case"utf32be":for(d=0;d<s;++d)(h=b?a.charCodeAt(d):a[d].charCodeAt(0))>=55296&&h<=57343&&(h=65536+(h-55296<<10)+(a[++d].charCodeAt(0)-56320)),u[m+3]=255&h,h>>=8,u[m+2]=255&h,h>>=8,u[m+1]=255&h,h>>=8,u[m]=255&h,m+=4;break;case"utf7":for(d=0;d<s;d++){var x=b?a.charAt(d):a[d].charAt(0);if("+"!==x)if("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'(),-./:?".indexOf(x)>-1)u[m++]=x.charCodeAt(0);else{var _=r(1201,x);u[m++]=43,u[m++]=D.charCodeAt(_[0]>>2),u[m++]=D.charCodeAt(((3&_[0])<<4)+((_[1]||0)>>4)),u[m++]=D.charCodeAt(((15&_[1])<<2)+((_[2]||0)>>6)),u[m++]=45}else u[m++]=43,u[m++]=45}break;default:throw new Error("Unsupported magic: "+n+" "+t[n])}}return u=u.slice(0,m),f?i&&"buf"!==i?"arr"!==i?u.toString("binary"):[].slice.call(u):u:"str"==i?u.map(c).join(""):u},hascp:function(r){return!(!e[r]&&!t[r])},magic:t,cache:k},e}))},63744:(e,t,r)=>{var n,a,i;!function(o){if("undefined"==typeof DO_NOT_EXPORT_JSZIP)e.exports=o();else if("undefined"==typeof DO_NOT_EXPORT_JSZIP)JSZipSync=o(),a=[],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i);else{var s;"undefined"!=typeof globalThis?s=globalThis:"undefined"!=typeof window?s=window:void 0!==r.g?s=r.g:"undefined"!=typeof $&&$.global?s=$.global:"undefined"!=typeof self&&(s=self),s.JSZipSync=o()}}((function(){return function e(t,r,n){function a(o,s){if(!r[o]){if(!t[o]){if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var l=r[o]={exports:{}};t[o][0].call(l.exports,(function(e){return a(t[o][1][e]||e)}),l,l.exports,e,t,r,n)}return r[o].exports}for(var i=void 0,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(e,t,r){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e,t){for(var r,a,i,o,s,l,c,u="",f=0;f<e.length;)o=(r=e.charCodeAt(f++))>>2,s=(3&r)<<4|(a=e.charCodeAt(f++))>>4,l=(15&a)<<2|(i=e.charCodeAt(f++))>>6,c=63&i,isNaN(a)?l=c=64:isNaN(i)&&(c=64),u=u+n.charAt(o)+n.charAt(s)+n.charAt(l)+n.charAt(c);return u},r.decode=function(e,t){var r,a,i,o,s,l,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)r=n.indexOf(e.charAt(u++))<<2|(o=n.indexOf(e.charAt(u++)))>>4,a=(15&o)<<4|(s=n.indexOf(e.charAt(u++)))>>2,i=(3&s)<<6|(l=n.indexOf(e.charAt(u++))),c+=String.fromCharCode(r),64!=s&&(c+=String.fromCharCode(a)),64!=l&&(c+=String.fromCharCode(i));return c}},{}],2:[function(e,t,r){"use strict";function n(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}n.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},t.exports=n},{}],3:[function(e,t,r){"use strict";r.STORE={magic:"\0\0",compress:function(e){return e},uncompress:function(e){return e},compressInputType:null,uncompressInputType:null},r.DEFLATE=e("./flate")},{"./flate":8}],4:[function(e,t,r){"use strict";var n=e("./utils"),a=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];t.exports=function(e,t){if(void 0===e||!e.length)return 0;var r="string"!==n.getTypeOf(e);void 0===t&&(t=0);var i=0;t^=-1;for(var o=0,s=e.length;o<s;o++)i=r?e[o]:e.charCodeAt(o),t=t>>>8^a[255&(t^i)];return-1^t}},{"./utils":21}],5:[function(e,t,r){"use strict";var n=e("./utils");function a(e){this.data=null,this.length=0,this.index=0}a.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(e){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1)}},t.exports=a},{"./utils":21}],6:[function(e,t,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!1,r.date=null,r.compression=null,r.comment=null},{}],7:[function(e,t,r){"use strict";var n=e("./utils");r.string2binary=function(e){return n.string2binary(e)},r.string2Uint8Array=function(e){return n.transformTo("uint8array",e)},r.uint8Array2String=function(e){return n.transformTo("string",e)},r.string2Blob=function(e){var t=n.transformTo("arraybuffer",e);return n.arrayBuffer2Blob(t)},r.arrayBuffer2Blob=function(e){return n.arrayBuffer2Blob(e)},r.transformTo=function(e,t){return n.transformTo(e,t)},r.getTypeOf=function(e){return n.getTypeOf(e)},r.checkSupport=function(e){return n.checkSupport(e)},r.MAX_VALUE_16BITS=n.MAX_VALUE_16BITS,r.MAX_VALUE_32BITS=n.MAX_VALUE_32BITS,r.pretty=function(e){return n.pretty(e)},r.findCompression=function(e){return n.findCompression(e)},r.isRegExp=function(e){return n.isRegExp(e)}},{"./utils":21}],8:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,a=e("pako");r.uncompressInputType=n?"uint8array":"array",r.compressInputType=n?"uint8array":"array",r.magic="\b\0",r.compress=function(e){return a.deflateRaw(e)},r.uncompress=function(e){return a.inflateRaw(e)}},{pako:24}],9:[function(e,t,r){"use strict";var n=e("./base64");function a(e,t){if(!(this instanceof a))return new a(e,t);this.files={},this.comment=null,this.root="",e&&this.load(e,t),this.clone=function(){var e=new a;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}a.prototype=e("./object"),a.prototype.load=e("./load"),a.support=e("./support"),a.defaults=e("./defaults"),a.utils=e("./deprecatedPublicUtils"),a.base64={encode:function(e){return n.encode(e)},decode:function(e){return n.decode(e)}},a.compressions=e("./compressions"),t.exports=a},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(e,t,r){"use strict";var n=e("./base64"),a=e("./zipEntries");t.exports=function(e,t){var r,i,o,s;for((t=t||{}).base64&&(e=n.decode(e)),r=(i=new a(e,t)).files,o=0;o<r.length;o++)s=r[o],this.file(s.fileName,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileComment.length?s.fileComment:null,createFolders:t.createFolders});return i.zipComment.length&&(this.comment=i.zipComment),this}},{"./base64":1,"./zipEntries":22}],11:[function(e,t,r){(function(e){"use strict";var r=function(){};if(void 0!==e){var n=!e.from;if(!n)try{e.from("foo","utf8")}catch(e){n=!0}r=n?function(t,r){return r?new e(t,r):new e(t)}:e.from.bind(e),e.alloc||(e.alloc=function(t){return new e(t)})}t.exports=function(t,n){return"number"==typeof t?e.alloc(t):r(t,n)},t.exports.test=function(t){return e.isBuffer(t)}}).call(this,"undefined"!=typeof Buffer?Buffer:void 0)},{}],12:[function(e,t,r){"use strict";var n=e("./uint8ArrayReader");function a(e){this.data=e,this.length=this.data.length,this.index=0}a.prototype=new n,a.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.index,this.index+e);return this.index+=e,t},t.exports=a},{"./uint8ArrayReader":18}],13:[function(e,t,r){"use strict";var n=e("./support"),a=e("./utils"),i=e("./crc32"),o=e("./signature"),s=e("./defaults"),l=e("./base64"),c=e("./compressions"),u=e("./compressedObject"),f=e("./nodeBuffer"),p=e("./utf8"),h=e("./stringWriter"),d=e("./uint8ArrayWriter"),m=function(e){if(e._data instanceof u&&(e._data=e._data.getContent(),e.options.binary=!0,e.options.base64=!1,"uint8array"===a.getTypeOf(e._data))){var t=e._data;e._data=new Uint8Array(t.length),0!==t.length&&e._data.set(t,0)}return e._data},g=function(e){var t=m(e);return"string"===a.getTypeOf(t)?!e.options.binary&&n.nodebuffer?f(t,"utf-8"):e.asBinary():t},y=function(e){var t=m(this);return null==t?"":(this.options.base64&&(t=l.decode(t)),t=e&&this.options.binary?A.utf8decode(t):a.transformTo("string",t),e||this.options.binary||(t=a.transformTo("string",A.utf8encode(t))),t)},v=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this._data=t,this.options=r,this._initialMetadata={dir:r.dir,date:r.date}};v.prototype={asText:function(){return y.call(this,!0)},asBinary:function(){return y.call(this,!1)},asNodeBuffer:function(){var e=g(this);return a.transformTo("nodebuffer",e)},asUint8Array:function(){var e=g(this);return a.transformTo("uint8array",e)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var b=function(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n},x=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},_=function(e,t,r){var n,i=a.getTypeOf(t);if((r=function(e){return!0!==(e=e||{}).base64||null!==e.binary&&void 0!==e.binary||(e.binary=!0),(e=x(e,s)).date=e.date||new Date,null!==e.compression&&(e.compression=e.compression.toUpperCase()),e}(r)).createFolders&&(n=w(e))&&k.call(this,n,!0),r.dir||null==t)r.base64=!1,r.binary=!1,t=null;else if("string"===i)r.binary&&!r.base64&&!0!==r.optimizedBinaryString&&(t=a.string2binary(t));else{if(r.base64=!1,r.binary=!0,!(i||t instanceof u))throw new Error("The data of '"+e+"' is in an unsupported format !");"arraybuffer"===i&&(t=a.transformTo("uint8array",t))}var o=new v(e,t,r);return this.files[e]=o,o},w=function(e){"/"==e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},k=function(e,t){return"/"!=e.slice(-1)&&(e+="/"),t=void 0!==t&&t,this.files[e]||_.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]},D=function(e,t){var r,n=new u;return e._data instanceof u?(n.uncompressedSize=e._data.uncompressedSize,n.crc32=e._data.crc32,0===n.uncompressedSize||e.dir?(t=c.STORE,n.compressedContent="",n.crc32=0):e._data.compressionMethod===t.magic?n.compressedContent=e._data.getCompressedContent():(r=e._data.getContent(),n.compressedContent=t.compress(a.transformTo(t.compressInputType,r)))):((r=g(e))&&0!==r.length&&!e.dir||(t=c.STORE,r=""),n.uncompressedSize=r.length,n.crc32=i(r),n.compressedContent=t.compress(a.transformTo(t.compressInputType,r))),n.compressedSize=n.compressedContent.length,n.compressionMethod=t.magic,n},T=function(e,t,r,n){r.compressedContent;var s,l,c,u,f=a.transformTo("string",p.utf8encode(t.name)),h=t.comment||"",d=a.transformTo("string",p.utf8encode(h)),m=f.length!==t.name.length,g=d.length!==h.length,y=t.options,v="",x="",_="";c=t._initialMetadata.dir!==t.dir?t.dir:y.dir,s=(u=t._initialMetadata.date!==t.date?t.date:y.date).getHours(),s<<=6,s|=u.getMinutes(),s<<=5,s|=u.getSeconds()/2,l=u.getFullYear()-1980,l<<=4,l|=u.getMonth()+1,l<<=5,l|=u.getDate(),m&&(x=b(1,1)+b(i(f),4)+f,v+="up"+b(x.length,2)+x),g&&(_=b(1,1)+b(this.crc32(d),4)+d,v+="uc"+b(_.length,2)+_);var w="";return w+="\n\0",w+=m||g?"\0\b":"\0\0",w+=r.compressionMethod,w+=b(s,2),w+=b(l,2),w+=b(r.crc32,4),w+=b(r.compressedSize,4),w+=b(r.uncompressedSize,4),w+=b(f.length,2),w+=b(v.length,2),{fileRecord:o.LOCAL_FILE_HEADER+w+f+v,dirRecord:o.CENTRAL_FILE_HEADER+"\0"+w+b(d.length,2)+"\0\0\0\0"+(!0===c?"\0\0\0":"\0\0\0\0")+b(n,4)+f+v+d,compressedObject:r}},A={load:function(e,t){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(e){var t,r,n,a,i=[];for(t in this.files)this.files.hasOwnProperty(t)&&(n=this.files[t],a=new v(n.name,n._data,x(n.options)),r=t.slice(this.root.length,t.length),t.slice(0,this.root.length)===this.root&&e(r,a)&&i.push(a));return i},file:function(e,t,r){if(1===arguments.length){if(a.isRegExp(e)){var n=e;return this.filter((function(e,t){return!t.dir&&n.test(e)}))}return this.filter((function(t,r){return!r.dir&&t===e}))[0]||null}return e=this.root+e,_.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(a.isRegExp(e))return this.filter((function(t,r){return r.dir&&e.test(t)}));var t=this.root+e,r=k.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!=e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter((function(t,r){return r.name.slice(0,e.length)===e})),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(e){e=x(e||{},{base64:!0,compression:"STORE",type:"base64",comment:null}),a.checkSupport(e.type);var t,r,n,i=[],s=0,u=0,f=a.transformTo("string",this.utf8encode(e.comment||this.comment||""));for(var p in this.files)if(this.files.hasOwnProperty(p)){var m=this.files[p],g=m.options.compression||e.compression.toUpperCase(),y=c[g];if(!y)throw new Error(g+" is not a valid compression method !");var v=D.call(this,m,y),_=T.call(this,p,m,v,s);s+=_.fileRecord.length+v.compressedSize,u+=_.dirRecord.length,i.push(_)}n=o.CENTRAL_DIRECTORY_END+"\0\0\0\0"+b(i.length,2)+b(i.length,2)+b(u,4)+b(s,4)+b(f.length,2)+f;var w=e.type.toLowerCase();for(t="uint8array"===w||"arraybuffer"===w||"blob"===w||"nodebuffer"===w?new d(s+u+n.length):new h(s+u+n.length),r=0;r<i.length;r++)t.append(i[r].fileRecord),t.append(i[r].compressedObject.compressedContent);for(r=0;r<i.length;r++)t.append(i[r].dirRecord);t.append(n);var k=t.finalize();switch(e.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return a.transformTo(e.type.toLowerCase(),k);case"blob":return a.arrayBuffer2Blob(a.transformTo("arraybuffer",k));case"base64":return e.base64?l.encode(k):k;default:return k}},crc32:function(e,t){return i(e,t)},utf8encode:function(e){return a.transformTo("string",p.utf8encode(e))},utf8decode:function(e){return p.utf8decode(e)}};t.exports=A},{"./base64":1,"./compressedObject":2,"./compressions":3,"./crc32":4,"./defaults":6,"./nodeBuffer":11,"./signature":14,"./stringWriter":16,"./support":17,"./uint8ArrayWriter":19,"./utf8":20,"./utils":21}],14:[function(e,t,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],15:[function(e,t,r){"use strict";var n=e("./dataReader"),a=e("./utils");function i(e,t){this.data=e,t||(this.data=a.string2binary(this.data)),this.length=this.data.length,this.index=0}i.prototype=new n,i.prototype.byteAt=function(e){return this.data.charCodeAt(e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.index,this.index+e);return this.index+=e,t},t.exports=i},{"./dataReader":5,"./utils":21}],16:[function(e,t,r){"use strict";var n=e("./utils"),a=function(){this.data=[]};a.prototype={append:function(e){e=n.transformTo("string",e),this.data.push(e)},finalize:function(){return this.data.join("")}},t.exports=a},{"./utils":21}],17:[function(e,t,r){(function(e){"use strict";if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer=void 0!==e,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var t=new ArrayBuffer(0);try{r.blob=0===new Blob([t],{type:"application/zip"}).size}catch(e){try{var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);n.append(t),r.blob=0===n.getBlob("application/zip").size}catch(e){r.blob=!1}}}}).call(this,"undefined"!=typeof Buffer?Buffer:void 0)},{}],18:[function(e,t,r){"use strict";var n=e("./dataReader");function a(e){e&&(this.data=e,this.length=this.data.length,this.index=0)}a.prototype=new n,a.prototype.byteAt=function(e){return this.data[e]},a.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),a=e.charCodeAt(3),i=this.length-4;i>=0;--i)if(this.data[i]===t&&this.data[i+1]===r&&this.data[i+2]===n&&this.data[i+3]===a)return i;return-1},a.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.index,this.index+e);return this.index+=e,t},t.exports=a},{"./dataReader":5}],19:[function(e,t,r){"use strict";var n=e("./utils"),a=function(e){this.data=new Uint8Array(e),this.index=0};a.prototype={append:function(e){0!==e.length&&(e=n.transformTo("uint8array",e),this.data.set(e,this.index),this.index+=e.length)},finalize:function(){return this.data}},t.exports=a},{"./utils":21}],20:[function(e,t,r){"use strict";for(var n=e("./utils"),a=e("./support"),i=e("./nodeBuffer"),o=new Array(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;o[254]=o[254]=1;var l=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t},c=function(e){var t,r,a,i,s=e.length,l=new Array(2*s);for(r=0,t=0;t<s;)if((a=e[t++])<128)l[r++]=a;else if((i=o[a])>4)l[r++]=65533,t+=i-1;else{for(a&=2===i?31:3===i?15:7;i>1&&t<s;)a=a<<6|63&e[t++],i--;i>1?l[r++]=65533:a<65536?l[r++]=a:(a-=65536,l[r++]=55296|a>>10&1023,l[r++]=56320|1023&a)}return l.length!==r&&(l.subarray?l=l.subarray(0,r):l.length=r),n.applyFromCharCode(l)};r.utf8encode=function(e){return a.nodebuffer?i(e,"utf-8"):function(e){var t,r,n,i,o,s=e.length,l=0;for(i=0;i<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=a.uint8array?new Uint8Array(l):new Array(l),o=0,i=0;o<l;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t}(e)},r.utf8decode=function(e){if(a.nodebuffer)return n.transformTo("nodebuffer",e).toString("utf-8");for(var t=[],r=0,i=(e=n.transformTo(a.uint8array?"uint8array":"array",e)).length;r<i;){var o=l(e,Math.min(r+65536,i));a.uint8array?t.push(c(e.subarray(r,o))):t.push(c(e.slice(r,o))),r=o}return t.join("")}},{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(e,t,r){"use strict";var n=e("./support"),a=e("./compressions"),i=e("./nodeBuffer");function o(e){return e}function s(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}function l(e){var t=65536,n=[],a=e.length,o=r.getTypeOf(e),s=0,l=!0;try{switch(o){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,i(0))}}catch(e){l=!1}if(!l){for(var c="",u=0;u<e.length;u++)c+=String.fromCharCode(e[u]);return c}for(;s<a&&t>1;)try{"array"===o||"nodebuffer"===o?n.push(String.fromCharCode.apply(null,e.slice(s,Math.min(s+t,a)))):n.push(String.fromCharCode.apply(null,e.subarray(s,Math.min(s+t,a)))),s+=t}catch(e){t=Math.floor(t/2)}return n.join("")}function c(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}r.string2binary=function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(255&e.charCodeAt(r));return t},r.arrayBuffer2Blob=function(e){r.checkSupport("blob");try{return new Blob([e],{type:"application/zip"})}catch(r){try{var t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);return t.append(e),t.getBlob("application/zip")}catch(e){throw new Error("Bug : can't construct the Blob.")}}},r.applyFromCharCode=l;var u={};u.string={string:o,array:function(e){return s(e,new Array(e.length))},arraybuffer:function(e){return u.string.uint8array(e).buffer},uint8array:function(e){return s(e,new Uint8Array(e.length))},nodebuffer:function(e){return s(e,i(e.length))}},u.array={string:l,array:o,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return i(e)}},u.arraybuffer={string:function(e){return l(new Uint8Array(e))},array:function(e){return c(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:o,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return i(new Uint8Array(e))}},u.uint8array={string:l,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:o,nodebuffer:function(e){return i(e)}},u.nodebuffer={string:l,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return u.nodebuffer.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:o},r.transformTo=function(e,t){if(t||(t=""),!e)return t;r.checkSupport(e);var n=r.getTypeOf(t);return u[n][e](t)},r.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":n.nodebuffer&&i.test(e)?"nodebuffer":n.uint8array&&e instanceof Uint8Array?"uint8array":n.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(e){if(!n[e.toLowerCase()])throw new Error(e+" is not supported by this browser")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},r.findCompression=function(e){for(var t in a)if(a.hasOwnProperty(t)&&a[t].magic===e)return a[t];return null},r.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(e,t,r){"use strict";var n=e("./stringReader"),a=e("./nodeBufferReader"),i=e("./uint8ArrayReader"),o=e("./utils"),s=e("./signature"),l=e("./zipEntry"),c=e("./support"),u=e("./object");function f(e,t){this.files=[],this.loadOptions=t,e&&this.load(e)}f.prototype={checkSignature:function(e){var t=this.reader.readString(4);if(t!==e)throw new Error("Corrupted zip or bug : unexpected signature ("+o.pretty(t)+", expected "+o.pretty(e)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength),this.zipComment=u.utf8decode(this.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readString(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===s.CENTRAL_FILE_HEADER;)(e=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(-1===e)throw new Error("Corrupted zip : can't find end of central directory");if(this.reader.setIndex(e),this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,-1===(e=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR)))throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");this.reader.setIndex(e),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(e){var t=o.getTypeOf(e);"string"!==t||c.uint8array?this.reader="nodebuffer"===t?new a(e):new i(o.transformTo("uint8array",e)):this.reader=new n(e,this.loadOptions.optimizedBinaryString)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=f},{"./nodeBufferReader":12,"./object":13,"./signature":14,"./stringReader":15,"./support":17,"./uint8ArrayReader":18,"./utils":21,"./zipEntry":23}],23:[function(e,t,r){"use strict";var n=e("./stringReader"),a=e("./utils"),i=e("./compressedObject"),o=e("./object");function s(e,t){this.options=e,this.loadOptions=t}s.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},prepareCompressedContent:function(e,t,r){return function(){var n=e.index;e.setIndex(t);var a=e.readData(r);return e.setIndex(n),a}},prepareContent:function(e,t,r,n,i){return function(){var e=a.transformTo(n.uncompressInputType,this.getCompressedContent()),t=n.uncompress(e);if(t.length!==i)throw new Error("Bug : uncompressed data size mismatch");return t}},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readString(this.fileNameLength),e.skip(r),-1==this.compressedSize||-1==this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(null===(t=a.findCompression(this.compressionMethod)))throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=new i,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(e,e.index,this.compressedSize,t),this.decompressed.getContent=this.prepareContent(e,e.index,this.compressedSize,t,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=a.transformTo("string",this.decompressed.getContent()),o.crc32(this.decompressed)!==this.crc32))throw new Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(e){if(this.versionMadeBy=e.readString(2),this.versionNeeded=e.readInt(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4),this.fileNameLength=e.readInt(2),this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");this.fileName=e.readString(this.fileNameLength),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readString(this.fileCommentLength),this.dir=!!(16&this.externalFileAttributes)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=new n(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,a=e.index;for(this.extraFields=this.extraFields||{};e.index<a+this.extraFieldsLength;)t=e.readInt(2),r=e.readInt(2),n=e.readString(r),this.extraFields[t]={id:t,length:r,value:n}},handleUTF8:function(){if(this.useUTF8())this.fileName=o.utf8decode(this.fileName),this.fileComment=o.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();null!==e&&(this.fileName=e);var t=this.findExtraFieldUnicodeComment();null!==t&&(this.fileComment=t)}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=new n(e.value);return 1!==t.readInt(1)||o.crc32(this.fileName)!==t.readInt(4)?null:o.utf8decode(t.readString(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=new n(e.value);return 1!==t.readInt(1)||o.crc32(this.fileComment)!==t.readInt(4)?null:o.utf8decode(t.readString(e.length-5))}return null}},t.exports=s},{"./compressedObject":2,"./object":13,"./stringReader":15,"./utils":21}],24:[function(e,t,r){"use strict";var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":25,"./lib/inflate":26,"./lib/utils/common":27,"./lib/zlib/constants":30}],25:[function(e,t,r){"use strict";var n=e("./zlib/deflate.js"),a=e("./utils/common"),i=e("./utils/strings"),o=e("./zlib/messages"),s=e("./zlib/zstream"),l=function(e){this.options=a.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(o[r]);t.header&&n.deflateSetHeader(this.strm,t.header)};function c(e,t){var r=new l(t);if(r.push(e,!0),r.err)throw r.msg;return r.result}l.prototype.push=function(e,t){var r,o,s=this.strm,l=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,s.input="string"==typeof e?i.string2buf(e):e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new a.Buf8(l),s.next_out=0,s.avail_out=l),1!==(r=n.deflate(s,o))&&0!==r)return this.onEnd(r),this.ended=!0,!1;(0===s.avail_out||0===s.avail_in&&4===o)&&("string"===this.options.to?this.onData(i.buf2binstring(a.shrinkBuf(s.output,s.next_out))):this.onData(a.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4!==o||(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r)},l.prototype.onData=function(e){this.chunks.push(e)},l.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=l,r.deflate=c,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,c(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,c(e,t)}},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(e,t,r){"use strict";var n=e("./zlib/inflate.js"),a=e("./utils/common"),i=e("./utils/strings"),o=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),u=function(e){this.options=a.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);this.header=new c,n.inflateGetHeader(this.strm,this.header)};function f(e,t){var r=new u(t);if(r.push(e,!0),r.err)throw r.msg;return r.result}u.prototype.push=function(e,t){var r,s,l,c,u,f=this.strm,p=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,f.input="string"==typeof e?i.binstring2buf(e):e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new a.Buf8(p),f.next_out=0,f.avail_out=p),(r=n.inflate(f,o.Z_NO_FLUSH))!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;f.next_out&&(0===f.avail_out||r===o.Z_STREAM_END||0===f.avail_in&&s===o.Z_FINISH)&&("string"===this.options.to?(l=i.utf8border(f.output,f.next_out),c=f.next_out-l,u=i.buf2string(f.output,l),f.next_out=c,f.avail_out=p-c,c&&a.arraySet(f.output,f.output,l,c,0),this.onData(u)):this.onData(a.shrinkBuf(f.output,f.next_out)))}while(f.avail_in>0&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s!==o.Z_FINISH||(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK)},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=u,r.inflate=f,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},r.ungzip=f},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,r,n,a){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),a);else for(var i=0;i<n;i++)e[a+i]=t[r+i]},flattenChunks:function(e){var t,r,n,a,i,o;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(o=new Uint8Array(n),a=0,t=0,r=e.length;t<r;t++)i=e[t],o.set(i,a),a+=i.length;return o}},i={arraySet:function(e,t,r,n,a){for(var i=0;i<n;i++)e[a+i]=t[r+i]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,a)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,i))},r.setTyped(n)},{}],28:[function(e,t,r){"use strict";var n=e("./common"),a=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var o=new n.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65537&&(e.subarray&&i||!e.subarray&&a))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",o=0;o<t;o++)r+=String.fromCharCode(e[o]);return r}o[254]=o[254]=1,r.string2buf=function(e){var t,r,a,i,o,s=e.length,l=0;for(i=0;i<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(a=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(a-56320),i++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(l),o=0,i=0;o<l;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(a=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(a-56320),i++),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,a=t.length;r<a;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,a,i,s=t||e.length,c=new Array(2*s);for(n=0,r=0;r<s;)if((a=e[r++])<128)c[n++]=a;else if((i=o[a])>4)c[n++]=65533,r+=i-1;else{for(a&=2===i?31:3===i?15:7;i>1&&r<s;)a=a<<6|63&e[r++],i--;i>1?c[n++]=65533:a<65536?c[n++]=a:(a-=65536,c[n++]=55296|a>>10&1023,c[n++]=56320|1023&a)}return l(c,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t}},{"./common":27}],29:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){for(var a=65535&e|0,i=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{i=i+(a=a+t[n++]|0)|0}while(--o);a%=65521,i%=65521}return a|i<<16|0}},{}],30:[function(e,t,r){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],31:[function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,a){var i=n,o=a+r;e^=-1;for(var s=a;s<o;s++)e=e>>>8^i[255&(e^t[s])];return-1^e}},{}],32:[function(e,t,r){"use strict";var n=e("../utils/common"),a=e("./trees"),i=e("./adler32"),o=e("./crc32"),s=e("./messages"),l=-2,c=258,u=262,f=103,p=113,h=666;function d(e,t){return e.msg=s[t],t}function m(e){return(e<<1)-(e>4?9:0)}function g(e){for(var t=e.length;--t>=0;)e[t]=0}function y(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function v(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,y(e.strm)}function b(e,t){e.pending_buf[e.pending++]=t}function x(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function _(e,t){var r,n,a=e.max_chain_length,i=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-u?e.strstart-(e.w_size-u):0,f=e.window,p=e.w_mask,h=e.prev,d=e.strstart+c,m=f[i+o-1],g=f[i+o];e.prev_length>=e.good_match&&(a>>=2),s>e.lookahead&&(s=e.lookahead);do{if(f[(r=t)+o]===g&&f[r+o-1]===m&&f[r]===f[i]&&f[++r]===f[i+1]){i+=2,r++;do{}while(f[++i]===f[++r]&&f[++i]===f[++r]&&f[++i]===f[++r]&&f[++i]===f[++r]&&f[++i]===f[++r]&&f[++i]===f[++r]&&f[++i]===f[++r]&&f[++i]===f[++r]&&i<d);if(n=c-(d-i),i=d-c,n>o){if(e.match_start=t,o=n,n>=s)break;m=f[i+o-1],g=f[i+o]}}}while((t=h[t&p])>l&&0!=--a);return o<=e.lookahead?o:e.lookahead}function w(e){var t,r,a,s,l,c,f,p,h,d,m=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-u)){n.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=r=e.hash_size;do{a=e.head[--t],e.head[t]=a>=m?a-m:0}while(--r);t=r=m;do{a=e.prev[--t],e.prev[t]=a>=m?a-m:0}while(--r);s+=m}if(0===e.strm.avail_in)break;if(c=e.strm,f=e.window,p=e.strstart+e.lookahead,h=s,d=void 0,(d=c.avail_in)>h&&(d=h),r=0===d?0:(c.avail_in-=d,n.arraySet(f,c.input,c.next_in,d,p),1===c.state.wrap?c.adler=i(c.adler,f,d,p):2===c.state.wrap&&(c.adler=o(c.adler,f,d,p)),c.next_in+=d,c.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+3-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<u&&0!==e.strm.avail_in)}function k(e,t){for(var r,n;;){if(e.lookahead<u){if(w(e),e.lookahead<u&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-u&&(e.match_length=_(e,r)),e.match_length>=3)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(v(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(v(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(v(e,!1),0===e.strm.avail_out)?1:2}function D(e,t){for(var r,n,i;;){if(e.lookahead<u){if(w(e),e.lookahead<u&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-u&&(e.match_length=_(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(v(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=a._tr_tally(e,0,e.window[e.strstart-1]))&&v(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=a._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(v(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(v(e,!1),0===e.strm.avail_out)?1:2}var T,A=function(e,t,r,n,a){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=a};function S(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),g(this.dyn_ltree),g(this.dyn_dtree),g(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),g(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),g(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function M(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:p,e.adler=2===t.wrap?0:1,t.last_flush=0,a._tr_init(t),0):d(e,l)}function E(e){var t,r=M(e);return 0===r&&((t=e.state).window_size=2*t.w_size,g(t.head),t.max_lazy_match=T[t.level].max_lazy,t.good_match=T[t.level].good_length,t.nice_match=T[t.level].nice_length,t.max_chain_length=T[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function C(e,t,r,a,i,o){if(!e)return l;var s=1;if(-1===t&&(t=6),a<0?(s=0,a=-a):a>15&&(s=2,a-=16),i<1||i>9||8!==r||a<8||a>15||t<0||t>9||o<0||o>4)return d(e,l);8===a&&(a=9);var c=new S;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=a,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=i+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+3-1)/3),c.window=new n.Buf8(2*c.w_size),c.head=new n.Buf16(c.hash_size),c.prev=new n.Buf16(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new n.Buf8(c.pending_buf_size),c.d_buf=c.lit_bufsize>>1,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=o,c.method=r,E(e)}T=[new A(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(w(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,v(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-u&&(v(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(v(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(v(e,!1),e.strm.avail_out),1)})),new A(4,4,8,4,k),new A(4,5,16,8,k),new A(4,6,32,32,k),new A(4,4,16,16,D),new A(8,16,32,32,D),new A(8,16,128,128,D),new A(8,32,128,256,D),new A(32,128,258,1024,D),new A(32,258,258,4096,D)],r.deflateInit=function(e,t){return C(e,t,8,15,8,0)},r.deflateInit2=C,r.deflateReset=E,r.deflateResetKeep=M,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?l:(e.state.gzhead=t,0):l},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||t>5||t<0)return e?d(e,l):l;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===h&&4!==t)return d(e,0===e.avail_out?-5:l);if(n.strm=e,r=n.last_flush,n.last_flush=t,42===n.status)if(2===n.wrap)e.adler=0,b(n,31),b(n,139),b(n,8),n.gzhead?(b(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),b(n,255&n.gzhead.time),b(n,n.gzhead.time>>8&255),b(n,n.gzhead.time>>16&255),b(n,n.gzhead.time>>24&255),b(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),b(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(b(n,255&n.gzhead.extra.length),b(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=o(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(b(n,0),b(n,0),b(n,0),b(n,0),b(n,0),b(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),b(n,3),n.status=p);else{var u=8+(n.w_bits-8<<4)<<8;u|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(u|=32),u+=31-u%31,n.status=p,x(n,u),0!==n.strstart&&(x(n,e.adler>>>16),x(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),y(e),i=n.pending,n.pending!==n.pending_buf_size));)b(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),y(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,b(n,s)}while(0!==s);n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),y(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,b(n,s)}while(0!==s);n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=f)}else n.status=f;if(n.status===f&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&y(e),n.pending+2<=n.pending_buf_size&&(b(n,255&e.adler),b(n,e.adler>>8&255),e.adler=0,n.status=p)):n.status=p),0!==n.pending){if(y(e),0===e.avail_out)return n.last_flush=-1,0}else if(0===e.avail_in&&m(t)<=m(r)&&4!==t)return d(e,-5);if(n.status===h&&0!==e.avail_in)return d(e,-5);if(0!==e.avail_in||0!==n.lookahead||0!==t&&n.status!==h){var _=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(w(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(v(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(v(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(v(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=c){if(w(e),e.lookahead<=c&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){o=e.strstart+c;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);e.match_length=c-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(v(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(v(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(v(e,!1),0===e.strm.avail_out)?1:2}(n,t):T[n.level].func(n,t);if(3!==_&&4!==_||(n.status=h),1===_||3===_)return 0===e.avail_out&&(n.last_flush=-1),0;if(2===_&&(1===t?a._tr_align(n):5!==t&&(a._tr_stored_block(n,0,0,!1),3===t&&(g(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),y(e),0===e.avail_out))return n.last_flush=-1,0}return 4!==t?0:n.wrap<=0?1:(2===n.wrap?(b(n,255&e.adler),b(n,e.adler>>8&255),b(n,e.adler>>16&255),b(n,e.adler>>24&255),b(n,255&e.total_in),b(n,e.total_in>>8&255),b(n,e.total_in>>16&255),b(n,e.total_in>>24&255)):(x(n,e.adler>>>16),x(n,65535&e.adler)),y(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},r.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==f&&t!==p&&t!==h?d(e,l):(e.state=null,t===p?d(e,-3):0):l},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(e,t,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],34:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,a,i,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,k,D,T,A;r=e.state,n=e.next_in,T=e.input,a=n+(e.avail_in-5),i=e.next_out,A=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),l=r.dmax,c=r.wsize,u=r.whave,f=r.wnext,p=r.window,h=r.hold,d=r.bits,m=r.lencode,g=r.distcode,y=(1<<r.lenbits)-1,v=(1<<r.distbits)-1;e:do{d<15&&(h+=T[n++]<<d,d+=8,h+=T[n++]<<d,d+=8),b=m[h&y];t:for(;;){if(h>>>=x=b>>>24,d-=x,0==(x=b>>>16&255))A[i++]=65535&b;else{if(!(16&x)){if(0==(64&x)){b=m[(65535&b)+(h&(1<<x)-1)];continue t}if(32&x){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}_=65535&b,(x&=15)&&(d<x&&(h+=T[n++]<<d,d+=8),_+=h&(1<<x)-1,h>>>=x,d-=x),d<15&&(h+=T[n++]<<d,d+=8,h+=T[n++]<<d,d+=8),b=g[h&v];r:for(;;){if(h>>>=x=b>>>24,d-=x,!(16&(x=b>>>16&255))){if(0==(64&x)){b=g[(65535&b)+(h&(1<<x)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(w=65535&b,d<(x&=15)&&(h+=T[n++]<<d,(d+=8)<x&&(h+=T[n++]<<d,d+=8)),(w+=h&(1<<x)-1)>l){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=x,d-=x,w>(x=i-o)){if((x=w-x)>u&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(k=0,D=p,0===f){if(k+=c-x,x<_){_-=x;do{A[i++]=p[k++]}while(--x);k=i-w,D=A}}else if(f<x){if(k+=c+f-x,(x-=f)<_){_-=x;do{A[i++]=p[k++]}while(--x);if(k=0,f<_){_-=x=f;do{A[i++]=p[k++]}while(--x);k=i-w,D=A}}}else if(k+=f-x,x<_){_-=x;do{A[i++]=p[k++]}while(--x);k=i-w,D=A}for(;_>2;)A[i++]=D[k++],A[i++]=D[k++],A[i++]=D[k++],_-=3;_&&(A[i++]=D[k++],_>1&&(A[i++]=D[k++]))}else{k=i-w;do{A[i++]=A[k++],A[i++]=A[k++],A[i++]=A[k++],_-=3}while(_>2);_&&(A[i++]=A[k++],_>1&&(A[i++]=A[k++]))}break}}break}}while(n<a&&i<s);n-=_=d>>3,h&=(1<<(d-=_<<3))-1,e.next_in=n,e.next_out=i,e.avail_in=n<a?a-n+5:5-(n-a),e.avail_out=i<s?s-i+257:257-(i-s),r.hold=h,r.bits=d}},{}],35:[function(e,t,r){"use strict";var n=e("../utils/common"),a=e("./adler32"),i=e("./crc32"),o=e("./inffast"),s=e("./inftrees"),l=-2,c=12,u=30;function f(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function p(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):l}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,h(e)):l}function m(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?l:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,d(e))):l}function g(e,t){var r,n;return e?(n=new p,e.state=n,n.window=null,0!==(r=m(e,t))&&(e.state=null),r):l}var y,v,b=!0;function x(e){if(b){var t;for(y=new n.Buf32(512),v=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,y,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,v,0,e.work,{bits:5}),b=!1}e.lencode=y,e.lenbits=9,e.distcode=v,e.distbits=5}r.inflateReset=d,r.inflateReset2=m,r.inflateResetKeep=h,r.inflateInit=function(e){return g(e,15)},r.inflateInit2=g,r.inflate=function(e,t){var r,p,h,d,m,g,y,v,b,_,w,k,D,T,A,S,M,E,C,N,O,I,P,R,L=0,F=new n.Buf8(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return l;(r=e.state).mode===c&&(r.mode=13),m=e.next_out,h=e.output,y=e.avail_out,d=e.next_in,p=e.input,g=e.avail_in,v=r.hold,b=r.bits,_=g,w=y,I=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;b<16;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}if(2&r.wrap&&35615===v){r.check=0,F[0]=255&v,F[1]=v>>>8&255,r.check=i(r.check,F,2,0),v=0,b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){e.msg="incorrect header check",r.mode=u;break}if(8!=(15&v)){e.msg="unknown compression method",r.mode=u;break}if(b-=4,O=8+(15&(v>>>=4)),0===r.wbits)r.wbits=O;else if(O>r.wbits){e.msg="invalid window size",r.mode=u;break}r.dmax=1<<O,e.adler=r.check=1,r.mode=512&v?10:c,v=0,b=0;break;case 2:for(;b<16;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}if(r.flags=v,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=u;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=u;break}r.head&&(r.head.text=v>>8&1),512&r.flags&&(F[0]=255&v,F[1]=v>>>8&255,r.check=i(r.check,F,2,0)),v=0,b=0,r.mode=3;case 3:for(;b<32;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}r.head&&(r.head.time=v),512&r.flags&&(F[0]=255&v,F[1]=v>>>8&255,F[2]=v>>>16&255,F[3]=v>>>24&255,r.check=i(r.check,F,4,0)),v=0,b=0,r.mode=4;case 4:for(;b<16;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}r.head&&(r.head.xflags=255&v,r.head.os=v>>8),512&r.flags&&(F[0]=255&v,F[1]=v>>>8&255,r.check=i(r.check,F,2,0)),v=0,b=0,r.mode=5;case 5:if(1024&r.flags){for(;b<16;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}r.length=v,r.head&&(r.head.extra_len=v),512&r.flags&&(F[0]=255&v,F[1]=v>>>8&255,r.check=i(r.check,F,2,0)),v=0,b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((k=r.length)>g&&(k=g),k&&(r.head&&(O=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,p,d,k,O)),512&r.flags&&(r.check=i(r.check,p,k,d)),g-=k,d+=k,r.length-=k),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===g)break e;k=0;do{O=p[d+k++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O))}while(O&&k<g);if(512&r.flags&&(r.check=i(r.check,p,k,d)),g-=k,d+=k,O)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===g)break e;k=0;do{O=p[d+k++],r.head&&O&&r.length<65536&&(r.head.comment+=String.fromCharCode(O))}while(O&&k<g);if(512&r.flags&&(r.check=i(r.check,p,k,d)),g-=k,d+=k,O)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;b<16;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}if(v!==(65535&r.check)){e.msg="header crc mismatch",r.mode=u;break}v=0,b=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=c;break;case 10:for(;b<32;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}e.adler=r.check=f(v),v=0,b=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=m,e.avail_out=y,e.next_in=d,e.avail_in=g,r.hold=v,r.bits=b,2;e.adler=r.check=1,r.mode=c;case c:if(5===t||6===t)break e;case 13:if(r.last){v>>>=7&b,b-=7&b,r.mode=27;break}for(;b<3;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}switch(r.last=1&v,b-=1,3&(v>>>=1)){case 0:r.mode=14;break;case 1:if(x(r),r.mode=20,6===t){v>>>=2,b-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=u}v>>>=2,b-=2;break;case 14:for(v>>>=7&b,b-=7&b;b<32;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}if((65535&v)!=(v>>>16^65535)){e.msg="invalid stored block lengths",r.mode=u;break}if(r.length=65535&v,v=0,b=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(k=r.length){if(k>g&&(k=g),k>y&&(k=y),0===k)break e;n.arraySet(h,p,d,k,m),g-=k,d+=k,y-=k,m+=k,r.length-=k;break}r.mode=c;break;case 17:for(;b<14;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}if(r.nlen=257+(31&v),v>>>=5,b-=5,r.ndist=1+(31&v),v>>>=5,b-=5,r.ncode=4+(15&v),v>>>=4,b-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=u;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;b<3;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}r.lens[B[r.have++]]=7&v,v>>>=3,b-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},I=s(0,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,I){e.msg="invalid code lengths set",r.mode=u;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;S=(L=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,M=65535&L,!((A=L>>>24)<=b);){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}if(M<16)v>>>=A,b-=A,r.lens[r.have++]=M;else{if(16===M){for(R=A+2;b<R;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}if(v>>>=A,b-=A,0===r.have){e.msg="invalid bit length repeat",r.mode=u;break}O=r.lens[r.have-1],k=3+(3&v),v>>>=2,b-=2}else if(17===M){for(R=A+3;b<R;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}b-=A,O=0,k=3+(7&(v>>>=A)),v>>>=3,b-=3}else{for(R=A+7;b<R;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}b-=A,O=0,k=11+(127&(v>>>=A)),v>>>=7,b-=7}if(r.have+k>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=u;break}for(;k--;)r.lens[r.have++]=O}}if(r.mode===u)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=u;break}if(r.lenbits=9,P={bits:r.lenbits},I=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,I){e.msg="invalid literal/lengths set",r.mode=u;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},I=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,I){e.msg="invalid distances set",r.mode=u;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(g>=6&&y>=258){e.next_out=m,e.avail_out=y,e.next_in=d,e.avail_in=g,r.hold=v,r.bits=b,o(e,w),m=e.next_out,h=e.output,y=e.avail_out,d=e.next_in,p=e.input,g=e.avail_in,v=r.hold,b=r.bits,r.mode===c&&(r.back=-1);break}for(r.back=0;S=(L=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,M=65535&L,!((A=L>>>24)<=b);){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}if(S&&0==(240&S)){for(E=A,C=S,N=M;S=(L=r.lencode[N+((v&(1<<E+C)-1)>>E)])>>>16&255,M=65535&L,!(E+(A=L>>>24)<=b);){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}v>>>=E,b-=E,r.back+=E}if(v>>>=A,b-=A,r.back+=A,r.length=M,0===S){r.mode=26;break}if(32&S){r.back=-1,r.mode=c;break}if(64&S){e.msg="invalid literal/length code",r.mode=u;break}r.extra=15&S,r.mode=22;case 22:if(r.extra){for(R=r.extra;b<R;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}r.length+=v&(1<<r.extra)-1,v>>>=r.extra,b-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;S=(L=r.distcode[v&(1<<r.distbits)-1])>>>16&255,M=65535&L,!((A=L>>>24)<=b);){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}if(0==(240&S)){for(E=A,C=S,N=M;S=(L=r.distcode[N+((v&(1<<E+C)-1)>>E)])>>>16&255,M=65535&L,!(E+(A=L>>>24)<=b);){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}v>>>=E,b-=E,r.back+=E}if(v>>>=A,b-=A,r.back+=A,64&S){e.msg="invalid distance code",r.mode=u;break}r.offset=M,r.extra=15&S,r.mode=24;case 24:if(r.extra){for(R=r.extra;b<R;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}r.offset+=v&(1<<r.extra)-1,v>>>=r.extra,b-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=u;break}r.mode=25;case 25:if(0===y)break e;if(k=w-y,r.offset>k){if((k=r.offset-k)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=u;break}k>r.wnext?(k-=r.wnext,D=r.wsize-k):D=r.wnext-k,k>r.length&&(k=r.length),T=r.window}else T=h,D=m-r.offset,k=r.length;k>y&&(k=y),y-=k,r.length-=k;do{h[m++]=T[D++]}while(--k);0===r.length&&(r.mode=21);break;case 26:if(0===y)break e;h[m++]=r.length,y--,r.mode=21;break;case 27:if(r.wrap){for(;b<32;){if(0===g)break e;g--,v|=p[d++]<<b,b+=8}if(w-=y,e.total_out+=w,r.total+=w,w&&(e.adler=r.check=r.flags?i(r.check,h,w,m-w):a(r.check,h,w,m-w)),w=y,(r.flags?v:f(v))!==r.check){e.msg="incorrect data check",r.mode=u;break}v=0,b=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;b<32;){if(0===g)break e;g--,v+=p[d++]<<b,b+=8}if(v!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=u;break}v=0,b=0}r.mode=29;case 29:I=1;break e;case u:I=-3;break e;case 31:return-4;default:return l}return e.next_out=m,e.avail_out=y,e.next_in=d,e.avail_in=g,r.hold=v,r.bits=b,(r.wsize||w!==e.avail_out&&r.mode<u&&(r.mode<27||4!==t))&&function(e,t,r,a){var i,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),a>=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>a&&(i=a),n.arraySet(o.window,t,r-a,i,o.wnext),(a-=i)?(n.arraySet(o.window,t,r-a,a,0),o.wnext=a,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}(e,e.output,e.next_out,w-e.avail_out)?(r.mode=31,-4):(_-=e.avail_in,w-=e.avail_out,e.total_in+=_,e.total_out+=w,r.total+=w,r.wrap&&w&&(e.adler=r.check=r.flags?i(r.check,h,w,e.next_out-w):a(r.check,h,w,e.next_out-w)),e.data_type=r.bits+(r.last?64:0)+(r.mode===c?128:0)+(20===r.mode||15===r.mode?256:0),(0===_&&0===w||4===t)&&0===I&&(I=-5),I)},r.inflateEnd=function(e){if(!e||!e.state)return l;var t=e.state;return t.window&&(t.window=null),e.state=null,0},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?l:(r.head=t,t.done=!1,0):l},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./inffast":34,"./inftrees":36}],36:[function(e,t,r){"use strict";var n=e("../utils/common"),a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],i=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,l,c,u,f,p){var h,d,m,g,y,v,b,x,_,w=p.bits,k=0,D=0,T=0,A=0,S=0,M=0,E=0,C=0,N=0,O=0,I=null,P=0,R=new n.Buf16(16),L=new n.Buf16(16),F=null,B=0;for(k=0;k<=15;k++)R[k]=0;for(D=0;D<l;D++)R[t[r+D]]++;for(S=w,A=15;A>=1&&0===R[A];A--);if(S>A&&(S=A),0===A)return c[u++]=20971520,c[u++]=20971520,p.bits=1,0;for(T=1;T<A&&0===R[T];T++);for(S<T&&(S=T),C=1,k=1;k<=15;k++)if(C<<=1,(C-=R[k])<0)return-1;if(C>0&&(0===e||1!==A))return-1;for(L[1]=0,k=1;k<15;k++)L[k+1]=L[k]+R[k];for(D=0;D<l;D++)0!==t[r+D]&&(f[L[t[r+D]]++]=D);if(0===e?(I=F=f,v=19):1===e?(I=a,P-=257,F=i,B-=257,v=256):(I=o,F=s,v=-1),O=0,D=0,k=T,y=u,M=S,E=0,m=-1,g=(N=1<<S)-1,1===e&&N>852||2===e&&N>592)return 1;for(;;){b=k-E,f[D]<v?(x=0,_=f[D]):f[D]>v?(x=F[B+f[D]],_=I[P+f[D]]):(x=96,_=0),h=1<<k-E,T=d=1<<M;do{c[y+(O>>E)+(d-=h)]=b<<24|x<<16|_|0}while(0!==d);for(h=1<<k-1;O&h;)h>>=1;if(0!==h?(O&=h-1,O+=h):O=0,D++,0==--R[k]){if(k===A)break;k=t[r+f[D]]}if(k>S&&(O&g)!==m){for(0===E&&(E=S),y+=T,C=1<<(M=k-E);M+E<A&&!((C-=R[M+E])<=0);)M++,C<<=1;if(N+=1<<M,1===e&&N>852||2===e&&N>592)return 1;c[m=O&g]=S<<24|M<<16|y-u|0}}return 0!==O&&(c[y+O]=k-E<<24|64<<16|0),p.bits=S,0}},{"../utils/common":27}],37:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],38:[function(e,t,r){"use strict";var n=e("../utils/common");function a(e){for(var t=e.length;--t>=0;)e[t]=0}var i=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],o=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],l=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],c=new Array(576);a(c);var u=new Array(60);a(u);var f=new Array(512);a(f);var p=new Array(256);a(p);var h=new Array(29);a(h);var d=new Array(30);a(d);var m,g,y,v=function(e,t,r,n,a){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=a,this.has_stree=e&&e.length},b=function(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t};function x(e){return e<256?f[e]:f[256+(e>>>7)]}function _(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function w(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,_(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function k(e,t,r){w(e,r[2*t],r[2*t+1])}function D(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function T(e,t,r){var n,a,i=new Array(16),o=0;for(n=1;n<=15;n++)i[n]=o=o+r[n-1]<<1;for(a=0;a<=t;a++){var s=e[2*a+1];0!==s&&(e[2*a]=D(i[s]++,s))}}function A(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function S(e){e.bi_valid>8?_(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function M(e,t,r,n){var a=2*t,i=2*r;return e[a]<e[i]||e[a]===e[i]&&n[t]<=n[r]}function E(e,t,r){for(var n=e.heap[r],a=r<<1;a<=e.heap_len&&(a<e.heap_len&&M(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!M(t,n,e.heap[a],e.depth));)e.heap[r]=e.heap[a],r=a,a<<=1;e.heap[r]=n}function C(e,t,r){var n,a,s,l,c=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],a=e.pending_buf[e.l_buf+c],c++,0===n?k(e,a,t):(k(e,(s=p[a])+256+1,t),0!==(l=i[s])&&w(e,a-=h[s],l),k(e,s=x(--n),r),0!==(l=o[s])&&w(e,n-=d[s],l))}while(c<e.last_lit);k(e,256,t)}function N(e,t){var r,n,a,i=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<l;r++)0!==i[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):i[2*r+1]=0;for(;e.heap_len<2;)i[2*(a=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[a]=0,e.opt_len--,s&&(e.static_len-=o[2*a+1]);for(t.max_code=c,r=e.heap_len>>1;r>=1;r--)E(e,i,r);a=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],E(e,i,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,i[2*a]=i[2*r]+i[2*n],e.depth[a]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,i[2*r+1]=i[2*n+1]=a,e.heap[1]=a++,E(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,a,i,o,s,l=t.dyn_tree,c=t.max_code,u=t.stat_desc.static_tree,f=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(i=0;i<=15;i++)e.bl_count[i]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(i=l[2*l[2*(n=e.heap[r])+1]+1]+1)>d&&(i=d,m++),l[2*n+1]=i,n>c||(e.bl_count[i]++,o=0,n>=h&&(o=p[n-h]),s=l[2*n],e.opt_len+=s*(i+o),f&&(e.static_len+=s*(u[2*n+1]+o)));if(0!==m){do{for(i=d-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[d]--,m-=2}while(m>0);for(i=d;0!==i;i--)for(n=e.bl_count[i];0!==n;)(a=e.heap[--r])>c||(l[2*a+1]!==i&&(e.opt_len+=(i-l[2*a+1])*l[2*a],l[2*a+1]=i),n--)}}(e,t),T(i,c,e.bl_count)}function O(e,t,r){var n,a,i=-1,o=t[1],s=0,l=7,c=4;for(0===o&&(l=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)a=o,o=t[2*(n+1)+1],++s<l&&a===o||(s<c?e.bl_tree[2*a]+=s:0!==a?(a!==i&&e.bl_tree[2*a]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,i=a,0===o?(l=138,c=3):a===o?(l=6,c=3):(l=7,c=4))}function I(e,t,r){var n,a,i=-1,o=t[1],s=0,l=7,c=4;for(0===o&&(l=138,c=3),n=0;n<=r;n++)if(a=o,o=t[2*(n+1)+1],!(++s<l&&a===o)){if(s<c)do{k(e,a,e.bl_tree)}while(0!=--s);else 0!==a?(a!==i&&(k(e,a,e.bl_tree),s--),k(e,16,e.bl_tree),w(e,s-3,2)):s<=10?(k(e,17,e.bl_tree),w(e,s-3,3)):(k(e,18,e.bl_tree),w(e,s-11,7));s=0,i=a,0===o?(l=138,c=3):a===o?(l=6,c=3):(l=7,c=4)}}var P=!1;function R(e,t,r,a){w(e,0+(a?1:0),3),function(e,t,r,a){S(e),_(e,r),_(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r)}r._tr_init=function(e){P||(function(){var e,t,r,n,a,l=new Array(16);for(r=0,n=0;n<28;n++)for(h[n]=r,e=0;e<1<<i[n];e++)p[r++]=n;for(p[r-1]=n,a=0,n=0;n<16;n++)for(d[n]=a,e=0;e<1<<o[n];e++)f[a++]=n;for(a>>=7;n<30;n++)for(d[n]=a<<7,e=0;e<1<<o[n]-7;e++)f[256+a++]=n;for(t=0;t<=15;t++)l[t]=0;for(e=0;e<=143;)c[2*e+1]=8,e++,l[8]++;for(;e<=255;)c[2*e+1]=9,e++,l[9]++;for(;e<=279;)c[2*e+1]=7,e++,l[7]++;for(;e<=287;)c[2*e+1]=8,e++,l[8]++;for(T(c,287,l),e=0;e<30;e++)u[2*e+1]=5,u[2*e]=D(e,5);m=new v(c,i,257,286,15),g=new v(u,o,0,30,15),y=new v(new Array(0),s,0,19,7)}(),P=!0),e.l_desc=new b(e.dyn_ltree,m),e.d_desc=new b(e.dyn_dtree,g),e.bl_desc=new b(e.bl_tree,y),e.bi_buf=0,e.bi_valid=0,A(e)},r._tr_stored_block=R,r._tr_flush_block=function(e,t,r,n){var a,i,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),N(e,e.l_desc),N(e,e.d_desc),o=function(e){var t;for(O(e,e.dyn_ltree,e.l_desc.max_code),O(e,e.dyn_dtree,e.d_desc.max_code),N(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*l[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),a=e.opt_len+3+7>>>3,(i=e.static_len+3+7>>>3)<=a&&(a=i)):a=i=r+5,r+4<=a&&-1!==t?R(e,t,r,n):4===e.strategy||i===a?(w(e,2+(n?1:0),3),C(e,c,u)):(w(e,4+(n?1:0),3),function(e,t,r,n){var a;for(w(e,t-257,5),w(e,r-1,5),w(e,n-4,4),a=0;a<n;a++)w(e,e.bl_tree[2*l[a]+1],3);I(e,e.dyn_ltree,t-1),I(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),C(e,e.dyn_ltree,e.dyn_dtree)),A(e),n&&S(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(p[r]+256+1)]++,e.dyn_dtree[2*x(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){w(e,2,3),k(e,256,c),function(e){16===e.bi_valid?(_(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":27}],39:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}]},{},[9])(9)}))},42695:(e,t,r)=>{(function(t){t.version="0.17.4";var n=1200,a=1252;"undefined"==typeof cptable&&(void 0!==r.g?r.g.cptable=r(1050):"undefined"!=typeof window&&(window.cptable=r(1050)));for(var i=[874,932,936,949,950],o=0;o<=8;++o)i.push(1250+o);var s={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},l=function(e){-1!=i.indexOf(e)&&(a=s[0]=e)},c=function(e){n=e,l(e)};function u(){c(1200),l(1252)}function f(e){for(var t=[],r=0,n=e.length;r<n;++r)t[r]=e.charCodeAt(r);return t}var p=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1);return 255==t&&254==r?function(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r)+(e.charCodeAt(2*r+1)<<8));return t.join("")}(e.slice(2)):254==t&&255==r?function(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r+1)+(e.charCodeAt(2*r)<<8));return t.join("")}(e.slice(2)):65279==t?e.slice(1):e},h=function(e){return String.fromCharCode(e)},d=function(e){return String.fromCharCode(e)};"undefined"!=typeof cptable&&(c=function(e){n=e,l(e)},p=function(e){return 255===e.charCodeAt(0)&&254===e.charCodeAt(1)?cptable.utils.decode(1200,f(e.slice(2))):e},h=function(e){return 1200===n?String.fromCharCode(e):cptable.utils.decode(n,[255&e,e>>8])[0]},d=function(e){return cptable.utils.decode(a,[e])[0]});var m,g=(m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",{encode:function(e){for(var t="",r=0,n=0,a=0,i=0,o=0,s=0,l=0,c=0;c<e.length;)i=(r=e.charCodeAt(c++))>>2,o=(3&r)<<4|(n=e.charCodeAt(c++))>>4,s=(15&n)<<2|(a=e.charCodeAt(c++))>>6,l=63&a,isNaN(n)?s=l=64:isNaN(a)&&(l=64),t+=m.charAt(i)+m.charAt(o)+m.charAt(s)+m.charAt(l);return t},decode:function(e){var t="",r=0,n=0,a=0,i=0,o=0,s=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var l=0;l<e.length;)r=m.indexOf(e.charAt(l++))<<2|(i=m.indexOf(e.charAt(l++)))>>4,t+=String.fromCharCode(r),n=(15&i)<<4|(o=m.indexOf(e.charAt(l++)))>>2,64!==o&&(t+=String.fromCharCode(n)),a=(3&o)<<6|(s=m.indexOf(e.charAt(l++))),64!==s&&(t+=String.fromCharCode(a));return t}}),y="undefined"!=typeof Buffer&&"undefined"!=typeof process&&void 0!==process.versions&&!!process.versions.node,v=function(){};if("undefined"!=typeof Buffer){var b=!Buffer.from;if(!b)try{Buffer.from("foo","utf8")}catch(e){b=!0}v=b?function(e,t){return t?new Buffer(e,t):new Buffer(e)}:Buffer.from.bind(Buffer),Buffer.alloc||(Buffer.alloc=function(e){return new Buffer(e)}),Buffer.allocUnsafe||(Buffer.allocUnsafe=function(e){return new Buffer(e)})}function x(e){return y?Buffer.alloc(e):new Array(e)}function _(e){return y?Buffer.allocUnsafe(e):new Array(e)}var w=function(e){return y?v(e,"binary"):e.split("").map((function(e){return 255&e.charCodeAt(0)}))};function k(e){if("undefined"==typeof ArrayBuffer)return w(e);for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n!=e.length;++n)r[n]=255&e.charCodeAt(n);return t}function D(e){if(Array.isArray(e))return e.map((function(e){return String.fromCharCode(e)})).join("");for(var t=[],r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function T(e){if("undefined"==typeof ArrayBuffer)throw new Error("Unsupported");if(e instanceof ArrayBuffer)return T(new Uint8Array(e));for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=e[r];return t}var A=function(e){return[].concat.apply([],e)},S=/\u0000/g,M=/[\u0001-\u0006]/g,E={},C=function(e){function t(e){for(var t="",r=e.length-1;r>=0;)t+=e.charAt(r--);return t}function r(e,t){for(var r="";r.length<t;)r+=e;return r}function n(e,t){var n=""+e;return n.length>=t?n:r("0",t-n.length)+n}function a(e,t){var n=""+e;return n.length>=t?n:r(" ",t-n.length)+n}function i(e,t){var n=""+e;return n.length>=t?n:n+r(" ",t-n.length)}e.version="0.11.2";var o=Math.pow(2,32);function s(e,t){return e>o||e<-o?function(e,t){var n=""+Math.round(e);return n.length>=t?n:r("0",t-n.length)+n}(e,t):function(e,t){var n=""+e;return n.length>=t?n:r("0",t-n.length)+n}(Math.round(e),t)}function l(e,t){return t=t||0,e.length>=7+t&&103==(32|e.charCodeAt(t))&&101==(32|e.charCodeAt(t+1))&&110==(32|e.charCodeAt(t+2))&&101==(32|e.charCodeAt(t+3))&&114==(32|e.charCodeAt(t+4))&&97==(32|e.charCodeAt(t+5))&&108==(32|e.charCodeAt(t+6))}var c=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],u=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function f(e){e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "'}var p={};f(p);var h=[],d=0;for(d=5;d<=8;++d)h[d]=32+d;for(d=23;d<=26;++d)h[d]=0;for(d=27;d<=31;++d)h[d]=14;for(d=50;d<=58;++d)h[d]=14;for(d=59;d<=62;++d)h[d]=d-58;for(d=67;d<=68;++d)h[d]=d-58;for(d=72;d<=75;++d)h[d]=d-58;for(d=67;d<=68;++d)h[d]=d-57;for(d=76;d<=78;++d)h[d]=d-56;for(d=79;d<=81;++d)h[d]=d-34;var m=[];function g(e,t,r){for(var n=e<0?-1:1,a=e*n,i=0,o=1,s=0,l=1,c=0,u=0,f=Math.floor(a);c<t&&(s=(f=Math.floor(a))*o+i,u=f*c+l,!(a-f<5e-8));)a=1/(a-f),i=o,o=s,l=c,c=u;if(u>t&&(c>t?(u=l,s=i):(u=c,s=o)),!r)return[0,n*s,u];var p=Math.floor(n*s/u);return[p,n*s-p*u,u]}function y(e,t,r){if(e>2958465||e<0)return null;var n=0|e,a=Math.floor(86400*(e-n)),i=0,o=[],s={D:n,T:a,u:86400*(e-n)-a,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(s.u)<1e-6&&(s.u=0),t&&t.date1904&&(n+=1462),s.u>.9999&&(s.u=0,86400==++a&&(s.T=a=0,++n,++s.D)),60===n)o=r?[1317,10,29]:[1900,2,29],i=3;else if(0===n)o=r?[1317,8,29]:[1900,1,0],i=6;else{n>60&&--n;var l=new Date(1900,0,1);l.setDate(l.getDate()+n-1),o=[l.getFullYear(),l.getMonth()+1,l.getDate()],i=l.getDay(),n<60&&(i=(i+6)%7),r&&(i=function(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}(l,o))}return s.y=o[0],s.m=o[1],s.d=o[2],s.S=a%60,a=Math.floor(a/60),s.M=a%60,a=Math.floor(a/60),s.H=a,s.q=i,s}m[5]=m[63]='"$"#,##0_);\\("$"#,##0\\)',m[6]=m[64]='"$"#,##0_);[Red]\\("$"#,##0\\)',m[7]=m[65]='"$"#,##0.00_);\\("$"#,##0.00\\)',m[8]=m[66]='"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',m[41]='_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',m[42]='_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',m[43]='_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',m[44]='_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)',e.parse_date_code=y;var v=new Date(1899,11,31,0,0,0),b=v.getTime(),x=new Date(1900,2,1,0,0,0);function _(e,t){var r=e.getTime();return t?r-=1262304e5:e>=x&&(r+=864e5),(r-(b+6e4*(e.getTimezoneOffset()-v.getTimezoneOffset())))/864e5}e._general_int=function(e){return e.toString(10)};var w=function(){var e=/(?:\.0*|(\.\d*[1-9])0+)$/;function t(t){return-1==t.indexOf(".")?t:t.replace(e,"$1")}var r=/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,n=/(E[+-])(\d)$/;return function(e){var a,i=Math.floor(Math.log(Math.abs(e))*Math.LOG10E);return a=i>=-4&&i<=-1?e.toPrecision(10+i):Math.abs(i)<=9?function(e){var r=e<0?12:11,n=t(e.toFixed(12));return n.length<=r||(n=e.toPrecision(10)).length<=r?n:e.toExponential(5)}(e):10===i?e.toFixed(10).substr(0,12):function(e){var r=t(e.toFixed(11));return r.length>(e<0?12:11)||"0"===r||"-0"===r?e.toPrecision(6):r}(e),t(function(e){return-1==e.indexOf("E")?e:e.replace(r,"$1E").replace(n,"$10$2")}(a.toUpperCase()))}}();function k(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(0|e)===e?e.toString(10):w(e);case"undefined":return"";case"object":if(null==e)return"";if(e instanceof Date)return P(14,_(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function D(e,t,r,a){var i,o="",s=0,l=0,f=r.y,p=0;switch(e){case 98:f=r.y+543;case 121:switch(t.length){case 1:case 2:i=f%100,p=2;break;default:i=f%1e4,p=4}break;case 109:switch(t.length){case 1:case 2:i=r.m,p=t.length;break;case 3:return u[r.m-1][1];case 5:return u[r.m-1][0];default:return u[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:i=r.d,p=t.length;break;case 3:return c[r.q][0];default:return c[r.q][1]}break;case 104:switch(t.length){case 1:case 2:i=1+(r.H+11)%12,p=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:i=r.H,p=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:i=r.M,p=t.length;break;default:throw"bad minute format: "+t}break;case 115:if("s"!=t&&"ss"!=t&&".0"!=t&&".00"!=t&&".000"!=t)throw"bad second format: "+t;return 0!==r.u||"s"!=t&&"ss"!=t?(l=a>=2?3===a?1e3:100:1===a?10:1,(s=Math.round(l*(r.S+r.u)))>=60*l&&(s=0),"s"===t?0===s?"0":""+s/l:(o=n(s,2+a),"ss"===t?o.substr(0,2):"."+o.substr(2,t.length-1))):n(r.S,t.length);case 90:switch(t){case"[h]":case"[hh]":i=24*r.D+r.H;break;case"[m]":case"[mm]":i=60*(24*r.D+r.H)+r.M;break;case"[s]":case"[ss]":i=60*(60*(24*r.D+r.H)+r.M)+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+t}p=3===t.length?1:2;break;case 101:i=f,p=1}return p>0?n(i,p):""}function T(e){if(e.length<=3)return e;for(var t=e.length%3,r=e.substr(0,t);t!=e.length;t+=3)r+=(r.length>0?",":"")+e.substr(t,3);return r}e._general_num=w,e._general=k;var A=function(){var e=/%/g;function o(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==t)return"0.0E+0";if(t<0)return"-"+o(e,-t);var a=e.indexOf(".");-1===a&&(a=e.indexOf("E"));var i=Math.floor(Math.log(t)*Math.LOG10E)%a;if(i<0&&(i+=a),-1===(r=(t/Math.pow(10,i)).toPrecision(n+1+(a+i)%a)).indexOf("e")){var s=Math.floor(Math.log(t)*Math.LOG10E);for(-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+i):r+="E+"+(s-i);"0."===r.substr(0,2);)r=(r=r.charAt(0)+r.substr(2,a)+"."+r.substr(2+a)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(e,t,r,n){return t+r+n.substr(0,(a+i)%a)+"."+n.substr(i)+"E"}))}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var l=/# (\?+)( ?)\/( ?)(\d+)/,c=/^#*0*\.([0#]+)/,u=/\).*[0#]/,f=/\(###\) ###\\?-####/;function p(e){for(var t,r="",n=0;n!=e.length;++n)switch(t=e.charCodeAt(n)){case 35:break;case 63:r+=" ";break;case 48:r+="0";break;default:r+=String.fromCharCode(t)}return r}function h(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r}function d(e,t){var r=e-Math.floor(e),n=Math.pow(10,t);return t<(""+Math.round(r*n)).length?0:Math.round(r*n)}function m(y,v,b){if(40===y.charCodeAt(0)&&!v.match(u)){var x=v.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return b>=0?m("n",x,b):"("+m("n",x,-b)+")"}if(44===v.charCodeAt(v.length-1))return function(e,t,r){for(var n=t.length-1;44===t.charCodeAt(n-1);)--n;return A(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}(y,v,b);if(-1!==v.indexOf("%"))return function(t,n,a){var i=n.replace(e,""),o=n.length-i.length;return A(t,i,a*Math.pow(10,2*o))+r("%",o)}(y,v,b);if(-1!==v.indexOf("E"))return o(v,b);if(36===v.charCodeAt(0))return"$"+m(y,v.substr(" "==v.charAt(1)?2:1),b);var _,w,k,D,S=Math.abs(b),M=b<0?"-":"";if(v.match(/^00+$/))return M+s(S,v.length);if(v.match(/^[#?]+$/))return"0"===(_=s(b,0))&&(_=""),_.length>v.length?_:p(v.substr(0,v.length-_.length))+_;if(w=v.match(l))return function(e,t,i){var o=parseInt(e[4],10),s=Math.round(t*o),l=Math.floor(s/o),c=s-l*o,u=o;return i+(0===l?"":""+l)+" "+(0===c?r(" ",e[1].length+1+e[4].length):a(c,e[1].length)+e[2]+"/"+e[3]+n(u,e[4].length))}(w,S,M);if(v.match(/^#+0+$/))return M+s(S,v.length-v.indexOf("0"));if(w=v.match(c))return _=h(b,w[1].length).replace(/^([^\.]+)$/,"$1."+p(w[1])).replace(/\.$/,"."+p(w[1])).replace(/\.(\d*)$/,(function(e,t){return"."+t+r("0",p(w[1]).length-t.length)})),-1!==v.indexOf("0.")?_:_.replace(/^0\./,".");if(v=v.replace(/^#+([0.])/,"$1"),w=v.match(/^(0*)\.(#*)$/))return M+h(S,w[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,w[1].length?"0.":".");if(w=v.match(/^#{1,3},##0(\.?)$/))return M+T(s(S,0));if(w=v.match(/^#,##0\.([#0]*0)$/))return b<0?"-"+m(y,v,-b):T(""+(Math.floor(b)+function(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}(b,w[1].length)))+"."+n(d(b,w[1].length),w[1].length);if(w=v.match(/^#,#*,#0/))return m(y,v.replace(/^#,#*,/,""),b);if(w=v.match(/^([0#]+)(\\?-([0#]+))+$/))return _=t(m(y,v.replace(/[\\-]/g,""),b)),k=0,t(t(v.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return k<_.length?_.charAt(k++):"0"===e?"0":""})));if(v.match(f))return"("+(_=m(y,"##########",b)).substr(0,3)+") "+_.substr(3,3)+"-"+_.substr(6);var E="";if(w=v.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return k=Math.min(w[4].length,7),D=g(S,Math.pow(10,k)-1,!1),_=""+M," "==(E=A("n",w[1],D[1])).charAt(E.length-1)&&(E=E.substr(0,E.length-1)+"0"),_+=E+w[2]+"/"+w[3],(E=i(D[2],k)).length<w[4].length&&(E=p(w[4].substr(w[4].length-E.length))+E),_+=E;if(w=v.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return k=Math.min(Math.max(w[1].length,w[4].length),7),M+((D=g(S,Math.pow(10,k)-1,!0))[0]||(D[1]?"":"0"))+" "+(D[1]?a(D[1],k)+w[2]+"/"+w[3]+i(D[2],k):r(" ",2*k+1+w[2].length+w[3].length));if(w=v.match(/^[#0?]+$/))return _=s(b,0),v.length<=_.length?_:p(v.substr(0,v.length-_.length))+_;if(w=v.match(/^([#0?]+)\.([#0]+)$/)){_=""+b.toFixed(Math.min(w[2].length,10)).replace(/([^0])0+$/,"$1"),k=_.indexOf(".");var C=v.indexOf(".")-k,N=v.length-_.length-C;return p(v.substr(0,C)+_+v.substr(v.length-N))}if(w=v.match(/^00,000\.([#0]*0)$/))return k=d(b,w[1].length),b<0?"-"+m(y,v,-b):T(function(e){return e<2147483647&&e>-2147483648?""+(e>=0?0|e:e-1|0):""+Math.floor(e)}(b)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(e){return"00,"+(e.length<3?n(0,3-e.length):"")+e}))+"."+n(k,w[1].length);switch(v){case"###,##0.00":return m(y,"#,##0.00",b);case"###,###":case"##,###":case"#,###":var O=T(s(S,0));return"0"!==O?M+O:"";case"###,###.00":return m(y,"###,##0.00",b).replace(/^0\./,".");case"#,###.00":return m(y,"#,##0.00",b).replace(/^0\./,".")}throw new Error("unsupported format |"+v+"|")}function y(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==t)return"0.0E+0";if(t<0)return"-"+y(e,-t);var a=e.indexOf(".");-1===a&&(a=e.indexOf("E"));var i=Math.floor(Math.log(t)*Math.LOG10E)%a;if(i<0&&(i+=a),!(r=(t/Math.pow(10,i)).toPrecision(n+1+(a+i)%a)).match(/[Ee]/)){var o=Math.floor(Math.log(t)*Math.LOG10E);-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(o-r.length+i):r+="E+"+(o-i),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(e,t,r,n){return t+r+n.substr(0,(a+i)%a)+"."+n.substr(i)+"E"}))}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function v(o,s,h){if(40===o.charCodeAt(0)&&!s.match(u)){var d=s.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return h>=0?v("n",d,h):"("+v("n",d,-h)+")"}if(44===s.charCodeAt(s.length-1))return function(e,t,r){for(var n=t.length-1;44===t.charCodeAt(n-1);)--n;return A(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}(o,s,h);if(-1!==s.indexOf("%"))return function(t,n,a){var i=n.replace(e,""),o=n.length-i.length;return A(t,i,a*Math.pow(10,2*o))+r("%",o)}(o,s,h);if(-1!==s.indexOf("E"))return y(s,h);if(36===s.charCodeAt(0))return"$"+v(o,s.substr(" "==s.charAt(1)?2:1),h);var m,b,x,_,w=Math.abs(h),k=h<0?"-":"";if(s.match(/^00+$/))return k+n(w,s.length);if(s.match(/^[#?]+$/))return m=""+h,0===h&&(m=""),m.length>s.length?m:p(s.substr(0,s.length-m.length))+m;if(b=s.match(l))return function(e,t,n){return n+(0===t?"":""+t)+r(" ",e[1].length+2+e[4].length)}(b,w,k);if(s.match(/^#+0+$/))return k+n(w,s.length-s.indexOf("0"));if(b=s.match(c))return m=(m=(""+h).replace(/^([^\.]+)$/,"$1."+p(b[1])).replace(/\.$/,"."+p(b[1]))).replace(/\.(\d*)$/,(function(e,t){return"."+t+r("0",p(b[1]).length-t.length)})),-1!==s.indexOf("0.")?m:m.replace(/^0\./,".");if(s=s.replace(/^#+([0.])/,"$1"),b=s.match(/^(0*)\.(#*)$/))return k+(""+w).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,b[1].length?"0.":".");if(b=s.match(/^#{1,3},##0(\.?)$/))return k+T(""+w);if(b=s.match(/^#,##0\.([#0]*0)$/))return h<0?"-"+v(o,s,-h):T(""+h)+"."+r("0",b[1].length);if(b=s.match(/^#,#*,#0/))return v(o,s.replace(/^#,#*,/,""),h);if(b=s.match(/^([0#]+)(\\?-([0#]+))+$/))return m=t(v(o,s.replace(/[\\-]/g,""),h)),x=0,t(t(s.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return x<m.length?m.charAt(x++):"0"===e?"0":""})));if(s.match(f))return"("+(m=v(o,"##########",h)).substr(0,3)+") "+m.substr(3,3)+"-"+m.substr(6);var D="";if(b=s.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return x=Math.min(b[4].length,7),_=g(w,Math.pow(10,x)-1,!1),m=""+k," "==(D=A("n",b[1],_[1])).charAt(D.length-1)&&(D=D.substr(0,D.length-1)+"0"),m+=D+b[2]+"/"+b[3],(D=i(_[2],x)).length<b[4].length&&(D=p(b[4].substr(b[4].length-D.length))+D),m+=D;if(b=s.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return x=Math.min(Math.max(b[1].length,b[4].length),7),k+((_=g(w,Math.pow(10,x)-1,!0))[0]||(_[1]?"":"0"))+" "+(_[1]?a(_[1],x)+b[2]+"/"+b[3]+i(_[2],x):r(" ",2*x+1+b[2].length+b[3].length));if(b=s.match(/^[#0?]+$/))return m=""+h,s.length<=m.length?m:p(s.substr(0,s.length-m.length))+m;if(b=s.match(/^([#0]+)\.([#0]+)$/)){m=""+h.toFixed(Math.min(b[2].length,10)).replace(/([^0])0+$/,"$1"),x=m.indexOf(".");var S=s.indexOf(".")-x,M=s.length-m.length-S;return p(s.substr(0,S)+m+s.substr(s.length-M))}if(b=s.match(/^00,000\.([#0]*0)$/))return h<0?"-"+v(o,s,-h):T(""+h).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(e){return"00,"+(e.length<3?n(0,3-e.length):"")+e}))+"."+n(0,b[1].length);switch(s){case"###,###":case"##,###":case"#,###":var E=T(""+w);return"0"!==E?k+E:"";default:if(s.match(/\.[0#?]*$/))return v(o,s.slice(0,s.lastIndexOf(".")),h)+p(s.slice(s.lastIndexOf(".")))}throw new Error("unsupported format |"+s+"|")}return function(e,t,r){return(0|r)===r?v(e,t,r):m(e,t,r)}}();function S(e){for(var t=[],r=!1,n=0,a=0;n<e.length;++n)switch(e.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:t[t.length]=e.substr(a,n-a),a=n+1}if(t[t.length]=e.substr(a),!0===r)throw new Error("Format |"+e+"| unterminated string ");return t}e._split=S;var M=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function E(e){for(var t=0,r="",n="";t<e.length;)switch(r=e.charAt(t)){case"G":l(e,t)&&(t+=6),t++;break;case'"':for(;34!==e.charCodeAt(++t)&&t<e.length;);++t;break;case"\\":case"_":t+=2;break;case"@":++t;break;case"B":case"b":if("1"===e.charAt(t+1)||"2"===e.charAt(t+1))return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if("A/P"===e.substr(t,3).toUpperCase())return!0;if("AM/PM"===e.substr(t,5).toUpperCase())return!0;if("上午/下午"===e.substr(t,5).toUpperCase())return!0;++t;break;case"[":for(n=r;"]"!==e.charAt(t++)&&t<e.length;)n+=e.charAt(t);if(n.match(M))return!0;break;case".":case"0":case"#":for(;t<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++t))>-1||"\\"==r&&"-"==e.charAt(t+1)&&"0#".indexOf(e.charAt(t+2))>-1););break;case"?":for(;e.charAt(++t)===r;);break;case"*":++t," "!=e.charAt(t)&&"*"!=e.charAt(t)||++t;break;case"(":case")":++t;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;t<e.length&&"0123456789".indexOf(e.charAt(++t))>-1;);break;default:++t}return!1}function C(e,t,r,n){for(var a,i,o,s=[],c="",u=0,f="",p="t",h="H";u<e.length;)switch(f=e.charAt(u)){case"G":if(!l(e,u))throw new Error("unrecognized character "+f+" in "+e);s[s.length]={t:"G",v:"General"},u+=7;break;case'"':for(c="";34!==(o=e.charCodeAt(++u))&&u<e.length;)c+=String.fromCharCode(o);s[s.length]={t:"t",v:c},++u;break;case"\\":var d=e.charAt(++u),m="("===d||")"===d?d:"t";s[s.length]={t:m,v:d},++u;break;case"_":s[s.length]={t:"t",v:" "},u+=2;break;case"@":s[s.length]={t:"T",v:t},++u;break;case"B":case"b":if("1"===e.charAt(u+1)||"2"===e.charAt(u+1)){if(null==a&&null==(a=y(t,r,"2"===e.charAt(u+1))))return"";s[s.length]={t:"X",v:e.substr(u,2)},p=f,u+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":f=f.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(t<0)return"";if(null==a&&null==(a=y(t,r)))return"";for(c=f;++u<e.length&&e.charAt(u).toLowerCase()===f;)c+=f;"m"===f&&"h"===p.toLowerCase()&&(f="M"),"h"===f&&(f=h),s[s.length]={t:f,v:c},p=f;break;case"A":case"a":case"上":var g={t:f,v:f};if(null==a&&(a=y(t,r)),"A/P"===e.substr(u,3).toUpperCase()?(null!=a&&(g.v=a.H>=12?"P":"A"),g.t="T",h="h",u+=3):"AM/PM"===e.substr(u,5).toUpperCase()?(null!=a&&(g.v=a.H>=12?"PM":"AM"),g.t="T",u+=5,h="h"):"上午/下午"===e.substr(u,5).toUpperCase()?(null!=a&&(g.v=a.H>=12?"下午":"上午"),g.t="T",u+=5,h="h"):(g.t="t",++u),null==a&&"T"===g.t)return"";s[s.length]=g,p=f;break;case"[":for(c=f;"]"!==e.charAt(u++)&&u<e.length;)c+=e.charAt(u);if("]"!==c.slice(-1))throw'unterminated "[" block: |'+c+"|";if(c.match(M)){if(null==a&&null==(a=y(t,r)))return"";s[s.length]={t:"Z",v:c.toLowerCase()},p=c.charAt(1)}else c.indexOf("$")>-1&&(c=(c.match(/\$([^-\[\]]*)/)||[])[1]||"$",E(e)||(s[s.length]={t:"t",v:c}));break;case".":if(null!=a){for(c=f;++u<e.length&&"0"===(f=e.charAt(u));)c+=f;s[s.length]={t:"s",v:c};break}case"0":case"#":for(c=f;++u<e.length&&"0#?.,E+-%".indexOf(f=e.charAt(u))>-1;)c+=f;s[s.length]={t:"n",v:c};break;case"?":for(c=f;e.charAt(++u)===f;)c+=f;s[s.length]={t:f,v:c},p=f;break;case"*":++u," "!=e.charAt(u)&&"*"!=e.charAt(u)||++u;break;case"(":case")":s[s.length]={t:1===n?"t":f,v:f},++u;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(c=f;u<e.length&&"0123456789".indexOf(e.charAt(++u))>-1;)c+=e.charAt(u);s[s.length]={t:"D",v:c};break;case" ":s[s.length]={t:f,v:f},++u;break;case"$":s[s.length]={t:"t",v:"$"},++u;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(f))throw new Error("unrecognized character "+f+" in "+e);s[s.length]={t:"t",v:f},++u}var v,b=0,x=0;for(u=s.length-1,p="t";u>=0;--u)switch(s[u].t){case"h":case"H":s[u].t=h,p="h",b<1&&(b=1);break;case"s":(v=s[u].v.match(/\.0+$/))&&(x=Math.max(x,v[0].length-1)),b<3&&(b=3);case"d":case"y":case"M":case"e":p=s[u].t;break;case"m":"s"===p&&(s[u].t="M",b<2&&(b=2));break;case"X":break;case"Z":b<1&&s[u].v.match(/[Hh]/)&&(b=1),b<2&&s[u].v.match(/[Mm]/)&&(b=2),b<3&&s[u].v.match(/[Ss]/)&&(b=3)}switch(b){case 0:break;case 1:a.u>=.5&&(a.u=0,++a.S),a.S>=60&&(a.S=0,++a.M),a.M>=60&&(a.M=0,++a.H);break;case 2:a.u>=.5&&(a.u=0,++a.S),a.S>=60&&(a.S=0,++a.M)}var _,w="";for(u=0;u<s.length;++u)switch(s[u].t){case"t":case"T":case" ":case"D":break;case"X":s[u].v="",s[u].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":s[u].v=D(s[u].t.charCodeAt(0),s[u].v,a,x),s[u].t="t";break;case"n":case"?":for(_=u+1;null!=s[_]&&("?"===(f=s[_].t)||"D"===f||(" "===f||"t"===f)&&null!=s[_+1]&&("?"===s[_+1].t||"t"===s[_+1].t&&"/"===s[_+1].v)||"("===s[u].t&&(" "===f||"n"===f||")"===f)||"t"===f&&("/"===s[_].v||" "===s[_].v&&null!=s[_+1]&&"?"==s[_+1].t));)s[u].v+=s[_].v,s[_]={v:"",t:";"},++_;w+=s[u].v,u=_-1;break;case"G":s[u].t="t",s[u].v=k(t,r)}var T,S,C="";if(w.length>0){40==w.charCodeAt(0)?(T=t<0&&45===w.charCodeAt(0)?-t:t,S=A("n",w,T)):(S=A("n",w,T=t<0&&n>1?-t:t),T<0&&s[0]&&"t"==s[0].t&&(S=S.substr(1),s[0].v="-"+s[0].v)),_=S.length-1;var N=s.length;for(u=0;u<s.length;++u)if(null!=s[u]&&"t"!=s[u].t&&s[u].v.indexOf(".")>-1){N=u;break}var O=s.length;if(N===s.length&&-1===S.indexOf("E")){for(u=s.length-1;u>=0;--u)null!=s[u]&&-1!=="n?".indexOf(s[u].t)&&(_>=s[u].v.length-1?(_-=s[u].v.length,s[u].v=S.substr(_+1,s[u].v.length)):_<0?s[u].v="":(s[u].v=S.substr(0,_+1),_=-1),s[u].t="t",O=u);_>=0&&O<s.length&&(s[O].v=S.substr(0,_+1)+s[O].v)}else if(N!==s.length&&-1===S.indexOf("E")){for(_=S.indexOf(".")-1,u=N;u>=0;--u)if(null!=s[u]&&-1!=="n?".indexOf(s[u].t)){for(i=s[u].v.indexOf(".")>-1&&u===N?s[u].v.indexOf(".")-1:s[u].v.length-1,C=s[u].v.substr(i+1);i>=0;--i)_>=0&&("0"===s[u].v.charAt(i)||"#"===s[u].v.charAt(i))&&(C=S.charAt(_--)+C);s[u].v=C,s[u].t="t",O=u}for(_>=0&&O<s.length&&(s[O].v=S.substr(0,_+1)+s[O].v),_=S.indexOf(".")+1,u=N;u<s.length;++u)if(null!=s[u]&&(-1!=="n?(".indexOf(s[u].t)||u===N)){for(i=s[u].v.indexOf(".")>-1&&u===N?s[u].v.indexOf(".")+1:0,C=s[u].v.substr(0,i);i<s[u].v.length;++i)_<S.length&&(C+=S.charAt(_++));s[u].v=C,s[u].t="t",O=u}}}for(u=0;u<s.length;++u)null!=s[u]&&"n?".indexOf(s[u].t)>-1&&(T=n>1&&t<0&&u>0&&"-"===s[u-1].v?-t:t,s[u].v=A(s[u].t,s[u].v,T),s[u].t="t");var I="";for(u=0;u!==s.length;++u)null!=s[u]&&(I+=s[u].v);return I}e.is_date=E,e._eval=C;var N=/\[[=<>]/,O=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function I(e,t){if(null==t)return!1;var r=parseFloat(t[2]);switch(t[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0}return!1}function P(e,t,r){null==r&&(r={});var n="";switch(typeof e){case"string":n="m/d/yy"==e&&r.dateNF?r.dateNF:e;break;case"number":null==(n=14==e&&r.dateNF?r.dateNF:(null!=r.table?r.table:p)[e])&&(n=r.table&&r.table[h[e]]||p[h[e]]),null==n&&(n=m[e]||"General")}if(l(n,0))return k(t,r);t instanceof Date&&(t=_(t,r.date1904));var a=function(e,t){var r=S(e),n=r.length,a=r[n-1].indexOf("@");if(n<4&&a>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if("number"!=typeof t)return[4,4===r.length||a>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=a>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=a>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=a>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"]}var i=t>0?r[0]:t<0?r[1]:r[2];if(-1===r[0].indexOf("[")&&-1===r[1].indexOf("["))return[n,i];if(null!=r[0].match(N)||null!=r[1].match(N)){var o=r[0].match(O),s=r[1].match(O);return I(t,o)?[n,r[0]]:I(t,s)?[n,r[1]]:[n,r[null!=o&&null!=s?2:1]]}return[n,i]}(n,t);if(l(a[1]))return k(t,r);if(!0===t)t="TRUE";else if(!1===t)t="FALSE";else if(""===t||null==t)return"";return C(a[1],t,r,a[0])}function R(e,t){if("number"!=typeof t){t=+t||-1;for(var r=0;r<392;++r)if(null!=p[r]){if(p[r]==e){t=r;break}}else t<0&&(t=r);t<0&&(t=391)}return p[t]=e,t}e.load=R,e._table=p,e.get_table=function(){return p},e.load_table=function(e){for(var t=0;392!=t;++t)void 0!==e[t]&&R(e[t],t)},e.init_table=f,e.format=P};C(E);var N,O={"General Number":"General","General Date":E._table[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":E._table[15],"Short Date":E._table[14],"Long Time":E._table[19],"Medium Time":E._table[18],"Short Time":E._table[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:E._table[2],Standard:E._table[4],Percent:E._table[10],Scientific:E._table[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'},I={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},P=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;!function(e){e.version="1.2.0";var t=function(){for(var e=0,t=new Array(256),r=0;256!=r;++r)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=r)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,t[r]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}();e.table=t,e.bstr=function(e,r){for(var n=-1^r,a=e.length-1,i=0;i<a;)n=(n=n>>>8^t[255&(n^e.charCodeAt(i++))])>>>8^t[255&(n^e.charCodeAt(i++))];return i===a&&(n=n>>>8^t[255&(n^e.charCodeAt(i))]),-1^n},e.buf=function(e,r){if(e.length>1e4)return function(e,r){for(var n=-1^r,a=e.length-7,i=0;i<a;)n=(n=(n=(n=(n=(n=(n=(n=n>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])];for(;i<a+7;)n=n>>>8^t[255&(n^e[i++])];return-1^n}(e,r);for(var n=-1^r,a=e.length-3,i=0;i<a;)n=(n=(n=(n=n>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])];for(;i<a+3;)n=n>>>8^t[255&(n^e[i++])];return-1^n},e.str=function(e,r){for(var n,a,i=-1^r,o=0,s=e.length;o<s;)(n=e.charCodeAt(o++))<128?i=i>>>8^t[255&(i^n)]:n<2048?i=(i=i>>>8^t[255&(i^(192|n>>6&31))])>>>8^t[255&(i^(128|63&n))]:n>=55296&&n<57344?(n=64+(1023&n),a=1023&e.charCodeAt(o++),i=(i=(i=(i=i>>>8^t[255&(i^(240|n>>8&7))])>>>8^t[255&(i^(128|n>>2&63))])>>>8^t[255&(i^(128|a>>6&15|(3&n)<<4))])>>>8^t[255&(i^(128|63&a))]):i=(i=(i=i>>>8^t[255&(i^(224|n>>12&15))])>>>8^t[255&(i^(128|n>>6&63))])>>>8^t[255&(i^(128|63&n))];return-1^i}}(N={});var R,L=function(){var e,t={};function n(e){if("/"==e.charAt(e.length-1))return-1===e.slice(0,-1).indexOf("/")?e:n(e.slice(0,-1));var t=e.lastIndexOf("/");return-1===t?e:e.slice(0,t+1)}function a(e){if("/"==e.charAt(e.length-1))return a(e.slice(0,-1));var t=e.lastIndexOf("/");return-1===t?e:e.slice(t+1)}function i(e,t){"string"==typeof t&&(t=new Date(t));var r=t.getHours();r=(r=r<<6|t.getMinutes())<<5|t.getSeconds()>>>1,e.write_shift(2,r);var n=t.getFullYear()-1980;n=(n=n<<4|t.getMonth()+1)<<5|t.getDate(),e.write_shift(2,n)}function o(e){Lt(e,0);for(var t={},r=0;e.l<=e.length-4;){var n=e.read_shift(2),a=e.read_shift(2),i=e.l+a,o={};21589===n&&(1&(r=e.read_shift(1))&&(o.mtime=e.read_shift(4)),a>5&&(2&r&&(o.atime=e.read_shift(4)),4&r&&(o.ctime=e.read_shift(4))),o.mtime&&(o.mt=new Date(1e3*o.mtime))),e.l=i,t[n]=o}return t}function s(){return e||(e=r(73118))}function l(e,t){if(80==e[0]&&75==e[1])return fe(e,t);if(e.length<512)throw new Error("CFB file size "+e.length+" < 512");var r,n,a,i,o,s,l=512,h=[],d=e.slice(0,512);Lt(d,0);var m=function(e){if(80==e[e.l]&&75==e[e.l+1])return[0,0];e.chk(D,"Header Signature: "),e.l+=16;var t=e.read_shift(2,"u");return[e.read_shift(2,"u"),t]}(d);switch(r=m[0]){case 3:l=512;break;case 4:l=4096;break;case 0:if(0==m[1])return fe(e,t);default:throw new Error("Major Version: Expected 3 or 4 saw "+r)}512!==l&&Lt(d=e.slice(0,l),28);var g=e.slice(0,l);!function(e,t){var r;switch(e.l+=2,r=e.read_shift(2)){case 9:if(3!=t)throw new Error("Sector Shift: Expected 9 saw "+r);break;case 12:if(4!=t)throw new Error("Sector Shift: Expected 12 saw "+r);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+r)}e.chk("0600","Mini Sector Shift: "),e.chk("000000000000","Reserved: ")}(d,r);var y=d.read_shift(4,"i");if(3===r&&0!==y)throw new Error("# Directory Sectors: Expected 0 saw "+y);d.l+=4,i=d.read_shift(4,"i"),d.l+=4,d.chk("00100000","Mini Stream Cutoff Size: "),o=d.read_shift(4,"i"),n=d.read_shift(4,"i"),s=d.read_shift(4,"i"),a=d.read_shift(4,"i");for(var v=-1,b=0;b<109&&!((v=d.read_shift(4,"i"))<0);++b)h[b]=v;var x=function(e,t){for(var r=Math.ceil(e.length/t)-1,n=[],a=1;a<r;++a)n[a-1]=e.slice(a*t,(a+1)*t);return n[r-1]=e.slice(r*t),n}(e,l);u(s,a,x,l,h);var _=function(e,t,r,n){var a=e.length,i=[],o=[],s=[],l=[],c=n-1,u=0,f=0,p=0,h=0;for(u=0;u<a;++u)if(s=[],(p=u+t)>=a&&(p-=a),!o[p]){l=[];var d=[];for(f=p;f>=0;){d[f]=!0,o[f]=!0,s[s.length]=f,l.push(e[f]);var m=r[Math.floor(4*f/n)];if(n<4+(h=4*f&c))throw new Error("FAT boundary crossed: "+f+" 4 "+n);if(!e[m])break;if(d[f=Ct(e[m],h)])break}i[p]={nodes:s,data:st([l])}}return i}(x,i,h,l);_[i].name="!Directory",n>0&&o!==k&&(_[o].name="!MiniFAT"),_[h[0]].name="!FAT",_.fat_addrs=h,_.ssz=l;var w=[],T=[],A=[];!function(e,t,r,n,a,i,o,s){for(var l,u=0,h=n.length?2:0,d=t[e].data,m=0,g=0;m<d.length;m+=128){var y=d.slice(m,m+128);Lt(y,64),g=y.read_shift(2),l=ct(y,0,g-h),n.push(l);var v={name:l,type:y.read_shift(1),color:y.read_shift(1),L:y.read_shift(4,"i"),R:y.read_shift(4,"i"),C:y.read_shift(4,"i"),clsid:y.read_shift(16),state:y.read_shift(4,"i"),start:0,size:0};0!==y.read_shift(2)+y.read_shift(2)+y.read_shift(2)+y.read_shift(2)&&(v.ct=p(y,y.l-8)),0!==y.read_shift(2)+y.read_shift(2)+y.read_shift(2)+y.read_shift(2)&&(v.mt=p(y,y.l-8)),v.start=y.read_shift(4,"i"),v.size=y.read_shift(4,"i"),v.size<0&&v.start<0&&(v.size=v.type=0,v.start=k,v.name=""),5===v.type?(u=v.start,a>0&&u!==k&&(t[u].name="!StreamData")):v.size>=4096?(v.storage="fat",void 0===t[v.start]&&(t[v.start]=f(r,v.start,t.fat_addrs,t.ssz)),t[v.start].name=v.name,v.content=t[v.start].data.slice(0,v.size)):(v.storage="minifat",v.size<0?v.size=0:u!==k&&v.start!==k&&t[u]&&(v.content=c(v,t[u].data,(t[s]||{}).data))),v.content&&Lt(v.content,0),i[l]=v,o.push(v)}}(i,_,x,w,n,{},T,o),function(e,t,r){for(var n=0,a=0,i=0,o=0,s=0,l=r.length,c=[],u=[];n<l;++n)c[n]=u[n]=n,t[n]=r[n];for(;s<u.length;++s)a=e[n=u[s]].L,i=e[n].R,o=e[n].C,c[n]===n&&(-1!==a&&c[a]!==a&&(c[n]=c[a]),-1!==i&&c[i]!==i&&(c[n]=c[i])),-1!==o&&(c[o]=n),-1!==a&&n!=c[n]&&(c[a]=c[n],u.lastIndexOf(a)<s&&u.push(a)),-1!==i&&n!=c[n]&&(c[i]=c[n],u.lastIndexOf(i)<s&&u.push(i));for(n=1;n<l;++n)c[n]===n&&(-1!==i&&c[i]!==i?c[n]=c[i]:-1!==a&&c[a]!==a&&(c[n]=c[a]));for(n=1;n<l;++n)if(0!==e[n].type){if((s=n)!=c[s])do{s=c[s],t[n]=t[s]+"/"+t[n]}while(0!==s&&-1!==c[s]&&s!=c[s]);c[n]=-1}for(t[0]+="/",n=1;n<l;++n)2!==e[n].type&&(t[n]+="/")}(T,A,w),w.shift();var S={FileIndex:T,FullPaths:A};return t&&t.raw&&(S.raw={header:g,sectors:x}),S}function c(e,t,r){for(var n=e.start,a=e.size,i=[],o=n;r&&a>0&&o>=0;)i.push(t.slice(o*b,o*b+b)),a-=b,o=Ct(r,4*o);return 0===i.length?Bt(0):A(i).slice(0,e.size)}function u(e,t,r,n,a){var i=k;if(e===k){if(0!==t)throw new Error("DIFAT chain shorter than expected")}else if(-1!==e){var o=r[e],s=(n>>>2)-1;if(!o)return;for(var l=0;l<s&&(i=Ct(o,4*l))!==k;++l)a.push(i);t>=1&&u(Ct(o,n-4),t-1,r,n,a)}}function f(e,t,r,n,a){var i=[],o=[];a||(a=[]);var s=n-1,l=0,c=0;for(l=t;l>=0;){a[l]=!0,i[i.length]=l,o.push(e[l]);var u=r[Math.floor(4*l/n)];if(n<4+(c=4*l&s))throw new Error("FAT boundary crossed: "+l+" 4 "+n);if(!e[u])break;l=Ct(e[u],c)}return{nodes:i,data:st([o])}}function p(e,t){return new Date(1e3*(Et(e,t+4)/1e7*Math.pow(2,32)+Et(e,t)/1e7-11644473600))}function h(e,t){var r=t||{},n=r.root||"Root Entry";if(e.FullPaths||(e.FullPaths=[]),e.FileIndex||(e.FileIndex=[]),e.FullPaths.length!==e.FileIndex.length)throw new Error("inconsistent CFB structure");0===e.FullPaths.length&&(e.FullPaths[0]=n+"/",e.FileIndex[0]={name:n,type:5}),r.CLSID&&(e.FileIndex[0].clsid=r.CLSID),function(e){var t="Sh33tJ5";if(!L.find(e,"/"+t)){var r=Bt(4);r[0]=55,r[1]=r[3]=50,r[2]=54,e.FileIndex.push({name:t,type:2,content:r,size:4,L:69,R:69,C:69}),e.FullPaths.push(e.FullPaths[0]+t),d(e)}}(e)}function d(e,t){h(e);for(var r=!1,i=!1,o=e.FullPaths.length-1;o>=0;--o){var s=e.FileIndex[o];switch(s.type){case 0:i?r=!0:(e.FileIndex.pop(),e.FullPaths.pop());break;case 1:case 2:case 5:i=!0,isNaN(s.R*s.L*s.C)&&(r=!0),s.R>-1&&s.L>-1&&s.R==s.L&&(r=!0);break;default:r=!0}}if(r||t){var l=new Date(1987,1,19),c=0,u=[];for(o=0;o<e.FullPaths.length;++o)0!==e.FileIndex[o].type&&u.push([e.FullPaths[o],e.FileIndex[o]]);for(o=0;o<u.length;++o){var f=n(u[o][0]);for(i=!1,c=0;c<u.length;++c)u[c][0]===f&&(i=!0);i||u.push([f,{name:a(f).replace("/",""),type:1,clsid:E,ct:l,mt:l,content:null}])}for(u.sort((function(e,t){return function(e,t){for(var r=e.split("/"),n=t.split("/"),a=0,i=0,o=Math.min(r.length,n.length);a<o;++a){if(i=r[a].length-n[a].length)return i;if(r[a]!=n[a])return r[a]<n[a]?-1:1}return r.length-n.length}(e[0],t[0])})),e.FullPaths=[],e.FileIndex=[],o=0;o<u.length;++o)e.FullPaths[o]=u[o][0],e.FileIndex[o]=u[o][1];for(o=0;o<u.length;++o){var p=e.FileIndex[o],d=e.FullPaths[o];if(p.name=a(d).replace("/",""),p.L=p.R=p.C=-(p.color=1),p.size=p.content?p.content.length:0,p.start=0,p.clsid=p.clsid||E,0===o)p.C=u.length>1?1:-1,p.size=0,p.type=5;else if("/"==d.slice(-1)){for(c=o+1;c<u.length&&n(e.FullPaths[c])!=d;++c);for(p.C=c>=u.length?-1:c,c=o+1;c<u.length&&n(e.FullPaths[c])!=n(d);++c);p.R=c>=u.length?-1:c,p.type=1}else n(e.FullPaths[o+1]||"")==n(d)&&(p.R=o+1),p.type=2}}}function m(e,t){var r=t||{};if(d(e),"zip"==r.fileType)return function(e,t){var r=t||{},n=[],a=[],o=Bt(1),s=r.compression?8:0,l=0,c=0,u=0,f=0,p=e.FullPaths[0],h=p,d=e.FileIndex[0],m=[],g=0;for(l=1;l<e.FullPaths.length;++l)if(h=e.FullPaths[l].slice(p.length),(d=e.FileIndex[l]).size&&d.content&&"Sh33tJ5"!=h){var y=u,v=Bt(h.length);for(c=0;c<h.length;++c)v.write_shift(1,127&h.charCodeAt(c));v=v.slice(0,v.l),m[f]=N.buf(d.content,0);var b=d.content;8==s&&(b=I(b)),(o=Bt(30)).write_shift(4,67324752),o.write_shift(2,20),o.write_shift(2,0),o.write_shift(2,s),d.mt?i(o,d.mt):o.write_shift(4,0),o.write_shift(-4,m[f]),o.write_shift(4,b.length),o.write_shift(4,d.content.length),o.write_shift(2,v.length),o.write_shift(2,0),u+=o.length,n.push(o),u+=v.length,n.push(v),u+=b.length,n.push(b),(o=Bt(46)).write_shift(4,33639248),o.write_shift(2,0),o.write_shift(2,20),o.write_shift(2,0),o.write_shift(2,s),o.write_shift(4,0),o.write_shift(-4,m[f]),o.write_shift(4,b.length),o.write_shift(4,d.content.length),o.write_shift(2,v.length),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(4,0),o.write_shift(4,y),g+=o.l,a.push(o),g+=v.length,a.push(v),++f}return(o=Bt(22)).write_shift(4,101010256),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,f),o.write_shift(2,f),o.write_shift(4,g),o.write_shift(4,u),o.write_shift(2,0),A([A(n),A(a),o])}(e,r);var n=function(e){for(var t=0,r=0,n=0;n<e.FileIndex.length;++n){var a=e.FileIndex[n];if(a.content){var i=a.content.length;i>0&&(i<4096?t+=i+63>>6:r+=i+511>>9)}}for(var o=e.FullPaths.length+3>>2,s=t+127>>7,l=(t+7>>3)+r+o+s,c=l+127>>7,u=c<=109?0:Math.ceil((c-109)/127);l+c+u+127>>7>c;)u=++c<=109?0:Math.ceil((c-109)/127);var f=[1,u,c,s,o,r,t,0];return e.FileIndex[0].size=t<<6,f[7]=(e.FileIndex[0].start=f[0]+f[1]+f[2]+f[3]+f[4]+f[5])+(f[6]+7>>3),f}(e),a=Bt(n[7]<<9),o=0,s=0;for(o=0;o<8;++o)a.write_shift(1,T[o]);for(o=0;o<8;++o)a.write_shift(2,0);for(a.write_shift(2,62),a.write_shift(2,3),a.write_shift(2,65534),a.write_shift(2,9),a.write_shift(2,6),o=0;o<3;++o)a.write_shift(2,0);for(a.write_shift(4,0),a.write_shift(4,n[2]),a.write_shift(4,n[0]+n[1]+n[2]+n[3]-1),a.write_shift(4,0),a.write_shift(4,4096),a.write_shift(4,n[3]?n[0]+n[1]+n[2]-1:k),a.write_shift(4,n[3]),a.write_shift(-4,n[1]?n[0]-1:k),a.write_shift(4,n[1]),o=0;o<109;++o)a.write_shift(-4,o<n[2]?n[1]+o:-1);if(n[1])for(s=0;s<n[1];++s){for(;o<236+127*s;++o)a.write_shift(-4,o<n[2]?n[1]+o:-1);a.write_shift(-4,s===n[1]-1?k:s+1)}var l=function(e){for(s+=e;o<s-1;++o)a.write_shift(-4,o+1);e&&(++o,a.write_shift(-4,k))};for(s=o=0,s+=n[1];o<s;++o)a.write_shift(-4,C.DIFSECT);for(s+=n[2];o<s;++o)a.write_shift(-4,C.FATSECT);l(n[3]),l(n[4]);for(var c=0,u=0,f=e.FileIndex[0];c<e.FileIndex.length;++c)(f=e.FileIndex[c]).content&&((u=f.content.length)<4096||(f.start=s,l(u+511>>9)));for(l(n[6]+7>>3);511&a.l;)a.write_shift(-4,C.ENDOFCHAIN);for(s=o=0,c=0;c<e.FileIndex.length;++c)(f=e.FileIndex[c]).content&&(!(u=f.content.length)||u>=4096||(f.start=s,l(u+63>>6)));for(;511&a.l;)a.write_shift(-4,C.ENDOFCHAIN);for(o=0;o<n[4]<<2;++o){var p=e.FullPaths[o];if(p&&0!==p.length){f=e.FileIndex[o],0===o&&(f.start=f.size?f.start-1:k);var h=0===o&&r.root||f.name;if(u=2*(h.length+1),a.write_shift(64,h,"utf16le"),a.write_shift(2,u),a.write_shift(1,f.type),a.write_shift(1,f.color),a.write_shift(-4,f.L),a.write_shift(-4,f.R),a.write_shift(-4,f.C),f.clsid)a.write_shift(16,f.clsid,"hex");else for(c=0;c<4;++c)a.write_shift(4,0);a.write_shift(4,f.state||0),a.write_shift(4,0),a.write_shift(4,0),a.write_shift(4,0),a.write_shift(4,0),a.write_shift(4,f.start),a.write_shift(4,f.size),a.write_shift(4,0)}else{for(c=0;c<17;++c)a.write_shift(4,0);for(c=0;c<3;++c)a.write_shift(4,-1);for(c=0;c<12;++c)a.write_shift(4,0)}}for(o=1;o<e.FileIndex.length;++o)if((f=e.FileIndex[o]).size>=4096){for(a.l=f.start+1<<9,c=0;c<f.size;++c)a.write_shift(1,f.content[c]);for(;511&c;++c)a.write_shift(1,0)}for(o=1;o<e.FileIndex.length;++o)if((f=e.FileIndex[o]).size>0&&f.size<4096){for(c=0;c<f.size;++c)a.write_shift(1,f.content[c]);for(;63&c;++c)a.write_shift(1,0)}for(;a.l<a.length;)a.write_shift(1,0);return a}t.version="1.1.4";var v,b=64,k=-2,D="d0cf11e0a1b11ae1",T=[208,207,17,224,161,177,26,225],E="00000000000000000000000000000000",C={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:k,FREESECT:-1,HEADER_SIGNATURE:D,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:E,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function O(e){for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function I(e){return v?v.deflateRawSync(e):J(e)}for(var P,R,F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],z=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],j="undefined"!=typeof Uint8Array,U=j?new Uint8Array(256):[],$=0;$<256;++$)U[$]=(void 0,255&((R=139536&((P=$)<<1|P<<11)|558144&(P<<5|P<<15))>>16|R>>8|R));function V(e,t){var r=U[255&e];return t<=8?r>>>8-t:(r=r<<8|U[e>>8&255],t<=16?r>>>16-t:(r=r<<8|U[e>>16&255])>>>24-t)}function q(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=6?0:e[n+1]<<8))>>>r&3}function W(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=5?0:e[n+1]<<8))>>>r&7}function H(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=3?0:e[n+1]<<8))>>>r&31}function G(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=1?0:e[n+1]<<8))>>>r&127}function X(e,t,r){var n=7&t,a=t>>>3,i=(1<<r)-1,o=e[a]>>>n;return r<8-n?o&i:(o|=e[a+1]<<8-n,r<16-n?o&i:(o|=e[a+2]<<16-n,r<24-n?o&i:(o|=e[a+3]<<24-n)&i))}function Y(e,t){var r=e.length,n=2*r>t?2*r:t+5,a=0;if(r>=t)return e;if(y){var i=_(n);if(e.copy)e.copy(i);else for(;a<e.length;++a)i[a]=e[a];return i}if(j){var o=new Uint8Array(n);if(o.set)o.set(e);else for(;a<e.length;++a)o[a]=e[a];return o}return e.length=n,e}function Z(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=0;return t}var K,J=(K=function(e,t){for(var r=0;r<e.length;){var n=Math.min(65535,e.length-r),a=r+n==e.length;for(t.write_shift(1,+a),t.write_shift(2,n),t.write_shift(2,65535&~n);n-- >0;)t[t.l++]=e[r++]}return t.l},function(e){var t=Bt(50+Math.floor(1.1*e.length)),r=K(e,t);return t.slice(0,r)});function Q(e,t,r){var n=1,a=0,i=0,o=0,s=0,l=e.length,c=j?new Uint16Array(32):Z(32);for(i=0;i<32;++i)c[i]=0;for(i=l;i<r;++i)e[i]=0;l=e.length;var u=j?new Uint16Array(l):Z(l);for(i=0;i<l;++i)c[a=e[i]]++,n<a&&(n=a),u[i]=0;for(c[0]=0,i=1;i<=n;++i)c[i+16]=s=s+c[i-1]<<1;for(i=0;i<l;++i)0!=(s=e[i])&&(u[i]=c[s+16]++);var f=0;for(i=0;i<l;++i)if(0!=(f=e[i]))for(s=V(u[i],n)>>n-f,o=(1<<n+4-f)-1;o>=0;--o)t[s|o<<f]=15&f|i<<4;return n}var ee=j?new Uint16Array(512):Z(512),te=j?new Uint16Array(32):Z(32);if(!j){for(var re=0;re<512;++re)ee[re]=0;for(re=0;re<32;++re)te[re]=0}!function(){for(var e=[],t=0;t<32;t++)e.push(5);Q(e,te,32);var r=[];for(t=0;t<=143;t++)r.push(8);for(;t<=255;t++)r.push(9);for(;t<=279;t++)r.push(7);for(;t<=287;t++)r.push(8);Q(r,ee,288)}();var ne=j?new Uint16Array(32768):Z(32768),ae=j?new Uint16Array(32768):Z(32768),ie=j?new Uint16Array(128):Z(128),oe=1,se=1;function le(e,t){var r=H(e,t)+257,n=H(e,t+=5)+1,a=function(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=4?0:e[n+1]<<8))>>>r&15}(e,t+=5)+4;t+=4;for(var i=0,o=j?new Uint8Array(19):Z(19),s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=1,c=j?new Uint8Array(8):Z(8),u=j?new Uint8Array(8):Z(8),f=o.length,p=0;p<a;++p)o[F[p]]=i=W(e,t),l<i&&(l=i),c[i]++,t+=3;var h=0;for(c[0]=0,p=1;p<=l;++p)u[p]=h=h+c[p-1]<<1;for(p=0;p<f;++p)0!=(h=o[p])&&(s[p]=u[h]++);var d=0;for(p=0;p<f;++p)if(0!=(d=o[p])){h=U[s[p]]>>8-d;for(var m=(1<<7-d)-1;m>=0;--m)ie[h|m<<d]=7&d|p<<3}var g=[];for(l=1;g.length<r+n;)switch(t+=7&(h=ie[G(e,t)]),h>>>=3){case 16:for(i=3+q(e,t),t+=2,h=g[g.length-1];i-- >0;)g.push(h);break;case 17:for(i=3+W(e,t),t+=3;i-- >0;)g.push(0);break;case 18:for(i=11+G(e,t),t+=7;i-- >0;)g.push(0);break;default:g.push(h),l<h&&(l=h)}var y=g.slice(0,r),v=g.slice(r);for(p=r;p<286;++p)y[p]=0;for(p=n;p<30;++p)v[p]=0;return oe=Q(y,ne,286),se=Q(v,ae,30),t}function ce(e,t){var r=function(e,t){if(3==e[0]&&!(3&e[1]))return[x(t),2];for(var r=0,n=0,a=_(t||1<<18),i=0,o=a.length>>>0,s=0,l=0;0==(1&n);)if(n=W(e,r),r+=3,n>>>1!=0)for(n>>>1==1?(s=9,l=5):(r=le(e,r),s=oe,l=se),!t&&o<i+32767&&(o=(a=Y(a,i+32767)).length);;){var c=X(e,r,s),u=n>>>1==1?ee[c]:ne[c];if(r+=15&u,0==((u>>>=4)>>>8&255))a[i++]=u;else{if(256==u)break;var f=(u-=257)<8?0:u-4>>2;f>5&&(f=0);var p=i+B[u];f>0&&(p+=X(e,r,f),r+=f),c=X(e,r,l),r+=15&(u=n>>>1==1?te[c]:ae[c]);var h=(u>>>=4)<4?0:u-2>>1,d=z[u];for(h>0&&(d+=X(e,r,h),r+=h),!t&&o<p&&(o=(a=Y(a,p)).length);i<p;)a[i]=a[i-d],++i}}else{7&r&&(r+=8-(7&r));var m=e[r>>>3]|e[1+(r>>>3)]<<8;if(r+=32,!t&&o<i+m&&(o=(a=Y(a,i+m)).length),"function"==typeof e.copy)e.copy(a,i,r>>>3,(r>>>3)+m),i+=m,r+=8*m;else for(;m-- >0;)a[i++]=e[r>>>3],r+=8}return[t?a:a.slice(0,i),r+7>>>3]}(e.slice(e.l||0),t);return e.l+=r[1],r[0]}function ue(e,t){if(!e)throw new Error(t);"undefined"!=typeof console&&console.error(t)}function fe(e,t){var r=e;Lt(r,0);var n={FileIndex:[],FullPaths:[]};h(n,{root:t.root});for(var a=r.length-4;(80!=r[a]||75!=r[a+1]||5!=r[a+2]||6!=r[a+3])&&a>=0;)--a;r.l=a+4,r.l+=4;var i=r.read_shift(2);r.l+=6;var s=r.read_shift(4);for(r.l=s,a=0;a<i;++a){r.l+=20;var l=r.read_shift(4),c=r.read_shift(4),u=r.read_shift(2),f=r.read_shift(2),p=r.read_shift(2);r.l+=8;var d=r.read_shift(4),m=o(r.slice(r.l+u,r.l+u+f));r.l+=u+f+p;var g=r.l;r.l=d+4,pe(r,l,c,n,m),r.l=g}return n}function pe(e,t,r,n,a){e.l+=2;var i=e.read_shift(2),s=e.read_shift(2),l=function(e){var t=65535&e.read_shift(2),r=65535&e.read_shift(2),n=new Date,a=31&r,i=15&(r>>>=5);r>>>=4,n.setMilliseconds(0),n.setFullYear(r+1980),n.setMonth(i-1),n.setDate(a);var o=31&t,s=63&(t>>>=5);return t>>>=6,n.setHours(t),n.setMinutes(s),n.setSeconds(o<<1),n}(e);if(8257&i)throw new Error("Unsupported ZIP encryption");for(var c=e.read_shift(4),u=e.read_shift(4),f=e.read_shift(4),p=e.read_shift(2),h=e.read_shift(2),d="",m=0;m<p;++m)d+=String.fromCharCode(e[e.l++]);if(h){var g=o(e.slice(e.l,e.l+h));(g[21589]||{}).mt&&(l=g[21589].mt),((a||{})[21589]||{}).mt&&(l=a[21589].mt)}e.l+=h;var y=e.slice(e.l,e.l+u);switch(s){case 8:y=function(e,t){if(!v)return ce(e,t);var r=new(0,v.InflateRaw),n=r._processChunk(e.slice(e.l),r._finishFlushFlag);return e.l+=r.bytesRead,n}(e,f);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+s)}var b=!1;8&i&&(134695760==(c=e.read_shift(4))&&(c=e.read_shift(4),b=!0),u=e.read_shift(4),f=e.read_shift(4)),u!=t&&ue(b,"Bad compressed size: "+t+" != "+u),f!=r&&ue(b,"Bad uncompressed size: "+r+" != "+f);var x=N.buf(y,0);c>>0!=x>>0&&ue(b,"Bad CRC32 checksum: "+c+" != "+x),he(n,d,y,{unsafe:!0,mt:l})}function he(e,t,r,n){var i=n&&n.unsafe;i||h(e);var o=!i&&L.find(e,t);if(!o){var s=e.FullPaths[0];t.slice(0,s.length)==s?s=t:("/"!=s.slice(-1)&&(s+="/"),s=(s+t).replace("//","/")),o={name:a(t),type:2},e.FileIndex.push(o),e.FullPaths.push(s),i||L.utils.cfb_gc(e)}return o.content=r,o.size=r?r.length:0,n&&(n.CLSID&&(o.clsid=n.CLSID),n.mt&&(o.mt=n.mt),n.ct&&(o.ct=n.ct)),o}return t.find=function(e,t){var r=e.FullPaths.map((function(e){return e.toUpperCase()})),n=r.map((function(e){var t=e.split("/");return t[t.length-("/"==e.slice(-1)?2:1)]})),a=!1;47===t.charCodeAt(0)?(a=!0,t=r[0].slice(0,-1)+t):a=-1!==t.indexOf("/");var i=t.toUpperCase(),o=!0===a?r.indexOf(i):n.indexOf(i);if(-1!==o)return e.FileIndex[o];var s=!i.match(M);for(i=i.replace(S,""),s&&(i=i.replace(M,"!")),o=0;o<r.length;++o){if((s?r[o].replace(M,"!"):r[o]).replace(S,"")==i)return e.FileIndex[o];if((s?n[o].replace(M,"!"):n[o]).replace(S,"")==i)return e.FileIndex[o]}return null},t.read=function(t,r){switch(r&&r.type||"base64"){case"file":return function(t,r){return s(),l(e.readFileSync(t),r)}(t,r);case"base64":return l(w(g.decode(t)),r);case"binary":return l(w(t),r)}return l(t,r)},t.parse=l,t.write=function(t,r){var n=m(t,r);switch(r&&r.type){case"file":return s(),e.writeFileSync(r.filename,n),n;case"binary":return O(n);case"base64":return g.encode(O(n))}return n},t.writeFile=function(t,r,n){s();var a=m(t,n);e.writeFileSync(r,a)},t.utils={cfb_new:function(e){var t={};return h(t,e),t},cfb_add:he,cfb_del:function(e,t){h(e);var r=L.find(e,t);if(r)for(var n=0;n<e.FileIndex.length;++n)if(e.FileIndex[n]==r)return e.FileIndex.splice(n,1),e.FullPaths.splice(n,1),!0;return!1},cfb_mov:function(e,t,r){h(e);var n=L.find(e,t);if(n)for(var i=0;i<e.FileIndex.length;++i)if(e.FileIndex[i]==n)return e.FileIndex[i].name=a(r),e.FullPaths[i]=r,!0;return!1},cfb_gc:function(e){d(e,!0)},ReadShift:Ot,CheckField:Rt,prep_blob:Lt,bconcat:A,use_zlib:function(e){try{var t=new(0,e.InflateRaw);if(t._processChunk(new Uint8Array([3,0]),t._finishFlushFlag),!t.bytesRead)throw new Error("zlib does not expose bytesRead");v=e}catch(e){console.error("cannot use native zlib: "+(e.message||e))}},_deflateRaw:J,_inflateRaw:ce,consts:C},t}();try{R=r(73118)}catch(e){}function F(e){return"string"==typeof e?k(e):Array.isArray(e)?function(e){if("undefined"==typeof Uint8Array)throw new Error("Unsupported");return new Uint8Array(e)}(e):e}function B(e,t,r){if(void 0!==R&&R.writeFileSync)return r?R.writeFileSync(e,t,r):R.writeFileSync(e,t);var n="utf8"==r?Fe(t):t;if("undefined"!=typeof IE_SaveFile)return IE_SaveFile(n,e);if("undefined"!=typeof Blob){var a=new Blob([F(n)],{type:"application/octet-stream"});if("undefined"!=typeof navigator&&navigator.msSaveBlob)return navigator.msSaveBlob(a,e);if("undefined"!=typeof saveAs)return saveAs(a,e);if("undefined"!=typeof URL&&"undefined"!=typeof document&&document.createElement&&URL.createObjectURL){var i=URL.createObjectURL(a);if("object"==typeof chrome&&"function"==typeof(chrome.downloads||{}).download)return URL.revokeObjectURL&&"undefined"!=typeof setTimeout&&setTimeout((function(){URL.revokeObjectURL(i)}),6e4),chrome.downloads.download({url:i,filename:e,saveAs:!0});var o=document.createElement("a");if(null!=o.download)return o.download=e,o.href=i,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL&&"undefined"!=typeof setTimeout&&setTimeout((function(){URL.revokeObjectURL(i)}),6e4),i}}if("undefined"!=typeof $&&"undefined"!=typeof File&&"undefined"!=typeof Folder)try{var s=File(e);return s.open("w"),s.encoding="binary",Array.isArray(t)&&(t=D(t)),s.write(t),s.close(),t}catch(e){if(!e.message||!e.message.match(/onstruct/))throw e}throw new Error("cannot save file "+e)}function z(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;++n)Object.prototype.hasOwnProperty.call(e,t[n])&&r.push(t[n]);return r}function j(e,t){for(var r=[],n=z(e),a=0;a!==n.length;++a)null==r[e[n[a]][t]]&&(r[e[n[a]][t]]=n[a]);return r}function U(e){for(var t=[],r=z(e),n=0;n!==r.length;++n)t[e[r[n]]]=r[n];return t}function V(e){for(var t=[],r=z(e),n=0;n!==r.length;++n)t[e[r[n]]]=parseInt(r[n],10);return t}var q=new Date(1899,11,30,0,0,0);function W(e,t){var r=e.getTime();return t&&(r-=1263168e5),(r-(q.getTime()+6e4*(e.getTimezoneOffset()-q.getTimezoneOffset())))/864e5}var H=new Date,G=q.getTime()+6e4*(H.getTimezoneOffset()-q.getTimezoneOffset()),X=H.getTimezoneOffset();function Y(e){var t=new Date;return t.setTime(24*e*60*60*1e3+G),t.getTimezoneOffset()!==X&&t.setTime(t.getTime()+6e4*(t.getTimezoneOffset()-X)),t}function Z(e){var t=0,r=0,n=!1,a=e.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!a)throw new Error("|"+e+"| is not an ISO8601 Duration");for(var i=1;i!=a.length;++i)if(a[i]){switch(r=1,i>3&&(n=!0),a[i].slice(a[i].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+a[i].slice(a[i].length-1));case"D":r*=24;case"H":r*=60;case"M":if(!n)throw new Error("Unsupported ISO Duration Field: M");r*=60}t+=r*parseInt(a[i],10)}return t}var K=new Date("2017-02-19T19:06:09.000Z");isNaN(K.getFullYear())&&(K=new Date("2/19/17"));var J=2017==K.getFullYear();function Q(e,t){var r=new Date(e);if(J)return t>0?r.setTime(r.getTime()+60*r.getTimezoneOffset()*1e3):t<0&&r.setTime(r.getTime()-60*r.getTimezoneOffset()*1e3),r;if(e instanceof Date)return e;if(1917==K.getFullYear()&&!isNaN(r.getFullYear())){var n=r.getFullYear();return e.indexOf(""+n)>-1||r.setFullYear(r.getFullYear()+100),r}var a=e.match(/\d+/g)||["2017","2","19","0","0","0"],i=new Date(+a[0],+a[1]-1,+a[2],+a[3]||0,+a[4]||0,+a[5]||0);return e.indexOf("Z")>-1&&(i=new Date(i.getTime()-60*i.getTimezoneOffset()*1e3)),i}function ee(e){for(var t="",r=0;r!=e.length;++r)t+=String.fromCharCode(e[r]);return t}function te(e){if("undefined"!=typeof JSON&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if("object"!=typeof e||null==e)return e;if(e instanceof Date)return new Date(e.getTime());var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=te(e[r]));return t}function re(e,t){for(var r="";r.length<t;)r+=e;return r}function ne(e){var t=Number(e);if(isFinite(t))return t;if(!isNaN(t))return NaN;if(!/\d/.test(e))return t;var r=1,n=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,(function(){return r*=100,""}));return isNaN(t=Number(n))?(n=n.replace(/[(](.*)[)]/,(function(e,t){return r=-r,t})),isNaN(t=Number(n))?t:t/r):t/r}function ae(e){var t=new Date(e),r=new Date(NaN),n=t.getYear(),a=t.getMonth(),i=t.getDate();return isNaN(i)||n<0||n>8099?r:(a>0||i>1)&&101!=n||e.toLowerCase().match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)?t:e.match(/[^-0-9:,\/\\]/)?r:t}var ie,oe=5=="abacaba".split(/(:?b)/i).length;function se(e){return e?e.data?p(e.data):e.asNodeBuffer&&y?p(e.asNodeBuffer().toString("binary")):e.asBinary?p(e.asBinary()):e._data&&e._data.getContent?p(ee(Array.prototype.slice.call(e._data.getContent(),0))):e.content&&e.type?p(ee(e.content)):null:null}function le(e,t){for(var r=e.FullPaths||z(e.files),n=t.toLowerCase().replace(/[\/]/g,"\\"),a=n.replace(/\\/g,"/"),i=0;i<r.length;++i){var o=r[i].replace(/^Root Entry[\/]/,"").toLowerCase();if(n==o||a==o)return e.files?e.files[r[i]]:e.FileIndex[i]}return null}function ce(e,t){var r=le(e,t);if(null==r)throw new Error("Cannot find file "+t+" in zip");return r}function ue(e,t,r){if(!r)return(n=ce(e,t))&&".bin"===n.name.slice(-4)?function(e){if(!e)return null;if(e.data)return f(e.data);if(e.asNodeBuffer&&y)return e.asNodeBuffer();if(e._data&&e._data.getContent){var t=e._data.getContent();return"string"==typeof t?f(t):Array.prototype.slice.call(t)}return e.content&&e.type?e.content:null}(n):se(n);var n;if(!t)return null;try{return ue(e,t)}catch(e){return null}}function fe(e,t,r){if(!r)return se(ce(e,t));if(!t)return null;try{return fe(e,t)}catch(e){return null}}function pe(e,t,r){e.FullPaths?L.utils.cfb_add(e,t,r):e.file(t,r)}function he(){return ie?new ie:L.utils.cfb_new()}function de(e,t){var r;if(ie)switch(t.type){case"base64":r=new ie(e,{base64:!0});break;case"binary":case"array":r=new ie(e,{base64:!1});break;case"buffer":r=new ie(e);break;default:throw new Error("Unrecognized type "+t.type)}else switch(t.type){case"base64":r=L.read(e,{type:"base64"});break;case"binary":r=L.read(e,{type:"binary"});break;case"buffer":case"array":r=L.read(e,{type:"buffer"});break;default:throw new Error("Unrecognized type "+t.type)}return r}function me(e,t){if("/"==e.charAt(0))return e.slice(1);var r=t.split("/");"/"!=t.slice(-1)&&r.pop();for(var n=e.split("/");0!==n.length;){var a=n.shift();".."===a?r.pop():"."!==a&&r.push(a)}return r.join("/")}"undefined"!=typeof JSZipSync&&(ie=JSZipSync),e.exports&&void 0===ie&&(ie=r(63744));var ge='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n',ye=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,ve=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/gm;ge.match(ve)||(ve=/<[^>]*>/g);var be=/<\w*:/,xe=/<(\/?)\w+:/;function _e(e,t,r){for(var n={},a=0,i=0;a!==e.length&&32!==(i=e.charCodeAt(a))&&10!==i&&13!==i;++a);if(t||(n[0]=e.slice(0,a)),a===e.length)return n;var o=e.match(ye),s=0,l="",c=0,u="",f="",p=1;if(o)for(c=0;c!=o.length;++c){for(f=o[c],i=0;i!=f.length&&61!==f.charCodeAt(i);++i);for(u=f.slice(0,i).trim();32==f.charCodeAt(i+1);)++i;for(p=34==(a=f.charCodeAt(i+1))||39==a?1:0,l=f.slice(i+1+p,f.length-p),s=0;s!=u.length&&58!==u.charCodeAt(s);++s);if(s===u.length)u.indexOf("_")>0&&(u=u.slice(0,u.indexOf("_"))),n[u]=l,r||(n[u.toLowerCase()]=l);else{var h=(5===s&&"xmlns"===u.slice(0,5)?"xmlns":"")+u.slice(s+1);if(n[h]&&"ext"==u.slice(s-3,s))continue;n[h]=l,r||(n[h.toLowerCase()]=l)}}return n}function we(e){return e.replace(xe,"<$1")}var ke,De,Te={"&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<","&amp;":"&"},Ae=U(Te),Se=(ke=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/gi,De=/_x([\da-fA-F]{4})_/gi,function e(t){var r=t+"",n=r.indexOf("<![CDATA[");if(-1==n)return r.replace(ke,(function(e,t){return Te[e]||String.fromCharCode(parseInt(t,e.indexOf("x")>-1?16:10))||e})).replace(De,(function(e,t){return String.fromCharCode(parseInt(t,16))}));var a=r.indexOf("]]>");return e(r.slice(0,n))+r.slice(n+9,a)+e(r.slice(a+3))}),Me=/[&<>'"]/g,Ee=/[\u0000-\u0008\u000b-\u001f]/g;function Ce(e){return(e+"").replace(Me,(function(e){return Ae[e]})).replace(Ee,(function(e){return"_x"+("000"+e.charCodeAt(0).toString(16)).slice(-4)+"_"}))}function Ne(e){return Ce(e).replace(/ /g,"_x0020_")}var Oe=/[\u0000-\u001f]/g;function Ie(e){return(e+"").replace(Me,(function(e){return Ae[e]})).replace(/\n/g,"<br/>").replace(Oe,(function(e){return"&#x"+("000"+e.charCodeAt(0).toString(16)).slice(-4)+";"}))}var Pe=function(){var e=/&#(\d+);/g;function t(e,t){return String.fromCharCode(parseInt(t,10))}return function(r){return r.replace(e,t)}}();function Re(e){switch(e){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}var Le=function(e){for(var t="",r=0,n=0,a=0,i=0,o=0,s=0;r<e.length;)(n=e.charCodeAt(r++))<128?t+=String.fromCharCode(n):(a=e.charCodeAt(r++),n>191&&n<224?(o=(31&n)<<6,o|=63&a,t+=String.fromCharCode(o)):(i=e.charCodeAt(r++),n<240?t+=String.fromCharCode((15&n)<<12|(63&a)<<6|63&i):(s=((7&n)<<18|(63&a)<<12|(63&i)<<6|63&(o=e.charCodeAt(r++)))-65536,t+=String.fromCharCode(55296+(s>>>10&1023)),t+=String.fromCharCode(56320+(1023&s)))));return t},Fe=function(e){for(var t=[],r=0,n=0,a=0;r<e.length;)switch(n=e.charCodeAt(r++),!0){case n<128:t.push(String.fromCharCode(n));break;case n<2048:t.push(String.fromCharCode(192+(n>>6))),t.push(String.fromCharCode(128+(63&n)));break;case n>=55296&&n<57344:n-=55296,a=e.charCodeAt(r++)-56320+(n<<10),t.push(String.fromCharCode(240+(a>>18&7))),t.push(String.fromCharCode(144+(a>>12&63))),t.push(String.fromCharCode(128+(a>>6&63))),t.push(String.fromCharCode(128+(63&a)));break;default:t.push(String.fromCharCode(224+(n>>12))),t.push(String.fromCharCode(128+(n>>6&63))),t.push(String.fromCharCode(128+(63&n)))}return t.join("")};if(y){var Be=function(e){var t,r,n,a=Buffer.alloc(2*e.length),i=1,o=0,s=0;for(r=0;r<e.length;r+=i)i=1,(n=e.charCodeAt(r))<128?t=n:n<224?(t=64*(31&n)+(63&e.charCodeAt(r+1)),i=2):n<240?(t=4096*(15&n)+64*(63&e.charCodeAt(r+1))+(63&e.charCodeAt(r+2)),i=3):(i=4,t=262144*(7&n)+4096*(63&e.charCodeAt(r+1))+64*(63&e.charCodeAt(r+2))+(63&e.charCodeAt(r+3)),s=55296+((t-=65536)>>>10&1023),t=56320+(1023&t)),0!==s&&(a[o++]=255&s,a[o++]=s>>>8,s=0),a[o++]=t%256,a[o++]=t>>>8;return a.slice(0,o).toString("ucs2")},ze="foo bar baz☃🍣";Le(ze)==Be(ze)&&(Le=Be);var je=function(e){return v(e,"binary").toString("utf8")};Le(ze)==je(ze)&&(Le=je),Fe=function(e){return v(e,"utf8").toString("binary")}}var Ue,$e,Ve,qe=(Ue={},function(e,t){var r=e+"|"+(t||"");return Ue[r]?Ue[r]:Ue[r]=new RegExp("<(?:\\w+:)?"+e+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+e+">",t||"")}),We=($e=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map((function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]})),function(e){for(var t=e.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,""),r=0;r<$e.length;++r)t=t.replace($e[r][0],$e[r][1]);return t}),He=(Ve={},function(e){return void 0!==Ve[e]?Ve[e]:Ve[e]=new RegExp("<(?:vt:)?"+e+">([\\s\\S]*?)</(?:vt:)?"+e+">","g")}),Ge=/<\/?(?:vt:)?variant>/g,Xe=/<(?:vt:)([^>]*)>([\s\S]*)</;function Ye(e,t){var r=_e(e),n=e.match(He(r.baseType))||[],a=[];if(n.length!=r.size){if(t.WTF)throw new Error("unexpected vector length "+n.length+" != "+r.size);return a}return n.forEach((function(e){var t=e.replace(Ge,"").match(Xe);t&&a.push({v:Le(t[2]),t:t[1]})})),a}var Ze=/(^\s|\s$|\n)/;function Ke(e,t){return"<"+e+(t.match(Ze)?' xml:space="preserve"':"")+">"+t+"</"+e+">"}function Je(e){return z(e).map((function(t){return" "+t+'="'+e[t]+'"'})).join("")}function Qe(e,t,r){return"<"+e+(null!=r?Je(r):"")+(null!=t?(t.match(Ze)?' xml:space="preserve"':"")+">"+t+"</"+e:"/")+">"}function et(e,t){try{return e.toISOString().replace(/\.\d*/,"")}catch(e){if(t)throw e}return""}var tt,rt,nt={dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema",main:["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"]},at="urn:schemas-microsoft-com:office:office",it="urn:schemas-microsoft-com:office:excel",ot="urn:schemas-microsoft-com:office:spreadsheet",st=function(e){for(var t=[],r=0;r<e[0].length;++r)if(e[0][r])for(var n=0,a=e[0][r].length;n<a;n+=10240)t.push.apply(t,e[0][r].slice(n,n+10240));return t},lt=st,ct=function(e,t,r){for(var n=[],a=t;a<r;a+=2)n.push(String.fromCharCode(St(e,a)));return n.join("").replace(S,"")},ut=ct,ft=function(e,t,r){for(var n=[],a=t;a<t+r;++a)n.push(("0"+e[a].toString(16)).slice(-2));return n.join("")},pt=ft,ht=function(e,t,r){for(var n=[],a=t;a<r;a++)n.push(String.fromCharCode(At(e,a)));return n.join("")},dt=ht,mt=function(e,t){var r=Et(e,t);return r>0?ht(e,t+4,t+4+r-1):""},gt=mt,yt=function(e,t){var r=Et(e,t);return r>0?ht(e,t+4,t+4+r-1):""},vt=yt,bt=function(e,t){var r=2*Et(e,t);return r>0?ht(e,t+4,t+4+r-1):""},xt=bt;tt=rt=function(e,t){var r=Et(e,t);return r>0?ct(e,t+4,t+4+r):""};var _t,wt,kt=function(e,t){var r=Et(e,t);return r>0?ht(e,t+4,t+4+r):""},Dt=kt;_t=wt=function(e,t){return function(e,t){for(var r=1-2*(e[t+7]>>>7),n=((127&e[t+7])<<4)+(e[t+6]>>>4&15),a=15&e[t+6],i=5;i>=0;--i)a=256*a+e[t+i];return 2047==n?0==a?r*(1/0):NaN:(0==n?n=-1022:(n-=1023,a+=Math.pow(2,52)),r*Math.pow(2,n-52)*a)}(e,t)};var Tt=function(e){return Array.isArray(e)};y&&(ct=function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf16le",t,r).replace(S,""):ut(e,t,r)},ft=function(e,t,r){return Buffer.isBuffer(e)?e.toString("hex",t,t+r):pt(e,t,r)},mt=function(e,t){if(!Buffer.isBuffer(e))return gt(e,t);var r=e.readUInt32LE(t);return r>0?e.toString("utf8",t+4,t+4+r-1):""},yt=function(e,t){if(!Buffer.isBuffer(e))return vt(e,t);var r=e.readUInt32LE(t);return r>0?e.toString("utf8",t+4,t+4+r-1):""},bt=function(e,t){if(!Buffer.isBuffer(e))return xt(e,t);var r=2*e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+r-1)},tt=function(e,t){if(!Buffer.isBuffer(e))return rt(e,t);var r=e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+r)},kt=function(e,t){if(!Buffer.isBuffer(e))return Dt(e,t);var r=e.readUInt32LE(t);return e.toString("utf8",t+4,t+4+r)},ht=function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf8",t,r):dt(e,t,r)},st=function(e){return e[0].length>0&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0]):lt(e)},A=function(e){return Buffer.isBuffer(e[0])?Buffer.concat(e):[].concat.apply([],e)},_t=function(e,t){return Buffer.isBuffer(e)?e.readDoubleLE(t):wt(e,t)},Tt=function(e){return Buffer.isBuffer(e)||Array.isArray(e)}),"undefined"!=typeof cptable&&(ct=function(e,t,r){return cptable.utils.decode(1200,e.slice(t,r)).replace(S,"")},ht=function(e,t,r){return cptable.utils.decode(65001,e.slice(t,r))},mt=function(e,t){var r=Et(e,t);return r>0?cptable.utils.decode(a,e.slice(t+4,t+4+r-1)):""},yt=function(e,t){var r=Et(e,t);return r>0?cptable.utils.decode(n,e.slice(t+4,t+4+r-1)):""},bt=function(e,t){var r=2*Et(e,t);return r>0?cptable.utils.decode(1200,e.slice(t+4,t+4+r-1)):""},tt=function(e,t){var r=Et(e,t);return r>0?cptable.utils.decode(1200,e.slice(t+4,t+4+r)):""},kt=function(e,t){var r=Et(e,t);return r>0?cptable.utils.decode(65001,e.slice(t+4,t+4+r)):""});var At=function(e,t){return e[t]},St=function(e,t){return 256*e[t+1]+e[t]},Mt=function(e,t){var r=256*e[t+1]+e[t];return r<32768?r:-1*(65535-r+1)},Et=function(e,t){return e[t+3]*(1<<24)+(e[t+2]<<16)+(e[t+1]<<8)+e[t]},Ct=function(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]},Nt=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};function Ot(e,t){var r,a,i,o,s,l,c="",u=[];switch(t){case"dbcs":if(l=this.l,y&&Buffer.isBuffer(this))c=this.slice(this.l,this.l+2*e).toString("utf16le");else for(s=0;s<e;++s)c+=String.fromCharCode(St(this,l)),l+=2;e*=2;break;case"utf8":c=ht(this,this.l,this.l+e);break;case"utf16le":e*=2,c=ct(this,this.l,this.l+e);break;case"wstr":if("undefined"==typeof cptable)return Ot.call(this,e,"dbcs");c=cptable.utils.decode(n,this.slice(this.l,this.l+2*e)),e*=2;break;case"lpstr-ansi":c=mt(this,this.l),e=4+Et(this,this.l);break;case"lpstr-cp":c=yt(this,this.l),e=4+Et(this,this.l);break;case"lpwstr":c=bt(this,this.l),e=4+2*Et(this,this.l);break;case"lpp4":e=4+Et(this,this.l),c=tt(this,this.l),2&e&&(e+=2);break;case"8lpp4":e=4+Et(this,this.l),c=kt(this,this.l),3&e&&(e+=4-(3&e));break;case"cstr":for(e=0,c="";0!==(i=At(this,this.l+e++));)u.push(h(i));c=u.join("");break;case"_wstr":for(e=0,c="";0!==(i=St(this,this.l+e));)u.push(h(i)),e+=2;e+=2,c=u.join("");break;case"dbcs-cont":for(c="",l=this.l,s=0;s<e;++s){if(this.lens&&-1!==this.lens.indexOf(l))return i=At(this,l),this.l=l+1,o=Ot.call(this,e-s,i?"dbcs-cont":"sbcs-cont"),u.join("")+o;u.push(h(St(this,l))),l+=2}c=u.join(""),e*=2;break;case"cpstr":if("undefined"!=typeof cptable){c=cptable.utils.decode(n,this.slice(this.l,this.l+e));break}case"sbcs-cont":for(c="",l=this.l,s=0;s!=e;++s){if(this.lens&&-1!==this.lens.indexOf(l))return i=At(this,l),this.l=l+1,o=Ot.call(this,e-s,i?"dbcs-cont":"sbcs-cont"),u.join("")+o;u.push(h(At(this,l))),l+=1}c=u.join("");break;default:switch(e){case 1:return r=At(this,this.l),this.l++,r;case 2:return r=("i"===t?Mt:St)(this,this.l),this.l+=2,r;case 4:case-4:return"i"===t||0==(128&this[this.l+3])?(r=(e>0?Ct:Nt)(this,this.l),this.l+=4,r):(a=Et(this,this.l),this.l+=4,a);case 8:case-8:if("f"===t)return a=8==e?_t(this,this.l):_t([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,a;e=8;case 16:c=ft(this,this.l,e)}}return this.l+=e,c}var It=function(e,t,r){e[r]=255&t,e[r+1]=t>>>8&255};function Pt(e,t,r){var n=0,i=0;if("dbcs"===r){for(i=0;i!=t.length;++i)It(this,t.charCodeAt(i),this.l+2*i);n=2*t.length}else if("sbcs"===r){if("undefined"!=typeof cptable&&874==a)for(i=0;i!=t.length;++i){var o=cptable.utils.encode(a,t.charAt(i));this[this.l+i]=o[0]}else for(t=t.replace(/[^\x00-\x7F]/g,"_"),i=0;i!=t.length;++i)this[this.l+i]=255&t.charCodeAt(i);n=t.length}else{if("hex"===r){for(;i<e;++i)this[this.l++]=parseInt(t.slice(2*i,2*i+2),16)||0;return this}if("utf16le"===r){var s=Math.min(this.l+e,this.length);for(i=0;i<Math.min(t.length,e);++i){var l=t.charCodeAt(i);this[this.l++]=255&l,this[this.l++]=l>>8}for(;this.l<s;)this[this.l++]=0;return this}switch(e){case 1:n=1,this[this.l]=255&t;break;case 2:n=2,this[this.l]=255&t,t>>>=8,this[this.l+1]=255&t;break;case 3:n=3,this[this.l]=255&t,t>>>=8,this[this.l+1]=255&t,t>>>=8,this[this.l+2]=255&t;break;case 4:n=4,function(e,t,r){e[r]=255&t,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24&255}(this,t,this.l);break;case 8:if(n=8,"f"===r){!function(e,t,r){var n=(t<0||1/t==-1/0?1:0)<<7,a=0,i=0,o=n?-t:t;isFinite(o)?0==o?a=i=0:(a=Math.floor(Math.log(o)/Math.LN2),i=o*Math.pow(2,52-a),a<=-1023&&(!isFinite(i)||i<Math.pow(2,52))?a=-1022:(i-=Math.pow(2,52),a+=1023)):(a=2047,i=isNaN(t)?26985:0);for(var s=0;s<=5;++s,i/=256)e[r+s]=255&i;e[r+6]=(15&a)<<4|15&i,e[r+7]=a>>4|n}(this,t,this.l);break}case 16:break;case-4:n=4,function(e,t,r){e[r]=255&t,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255}(this,t,this.l)}}return this.l+=n,this}function Rt(e,t){var r=ft(this,this.l,e.length>>1);if(r!==e)throw new Error(t+"Expected "+e+" saw "+r);this.l+=e.length>>1}function Lt(e,t){e.l=t,e.read_shift=Ot,e.chk=Rt,e.write_shift=Pt}function Ft(e,t){e.l+=t}function Bt(e){var t=x(e);return Lt(t,0),t}function zt(e,t,r){if(e){var n,a,i;Lt(e,e.l||0);for(var o=e.length,s=0,l=0;e.l<o;){128&(s=e.read_shift(1))&&(s=(127&s)+((127&e.read_shift(1))<<7));var c=jl[s]||jl[65535];for(i=127&(n=e.read_shift(1)),a=1;a<4&&128&n;++a)i+=(127&(n=e.read_shift(1)))<<7*a;l=e.l+i;var u=c.f&&c.f(e,i,r);if(e.l=l,t(u,c.n,s))return}}}function jt(){var e=[],t=y?256:2048,r=function(e){var t=Bt(e);return Lt(t,0),t},n=r(t),a=function(){n&&(n.length>n.l&&((n=n.slice(0,n.l)).l=n.length),n.length>0&&e.push(n),n=null)},i=function(e){return n&&e<n.length-n.l?n:(a(),n=r(Math.max(e+1,t)))};return{next:i,push:function(e){a(),null==(n=e).l&&(n.l=n.length),i(t)},end:function(){return a(),st([e])},_bufs:e}}function Ut(e,t,r,n){var a,i=+Ul[t];if(!isNaN(i)){n||(n=jl[i].p||(r||[]).length||0),a=1+(i>=128?1:0)+1,n>=128&&++a,n>=16384&&++a,n>=2097152&&++a;var o=e.next(a);i<=127?o.write_shift(1,i):(o.write_shift(1,128+(127&i)),o.write_shift(1,i>>7));for(var s=0;4!=s;++s){if(!(n>=128)){o.write_shift(1,n);break}o.write_shift(1,128+(127&n)),n>>=7}n>0&&Tt(r)&&e.push(r)}}function $t(e,t,r){var n=te(e);if(t.s?(n.cRel&&(n.c+=t.s.c),n.rRel&&(n.r+=t.s.r)):(n.cRel&&(n.c+=t.c),n.rRel&&(n.r+=t.r)),!r||r.biff<12){for(;n.c>=256;)n.c-=256;for(;n.r>=65536;)n.r-=65536}return n}function Vt(e,t,r){var n=te(e);return n.s=$t(n.s,t.s,r),n.e=$t(n.e,t.s,r),n}function qt(e,t){if(e.cRel&&e.c<0)for(e=te(e);e.c<0;)e.c+=t>8?16384:256;if(e.rRel&&e.r<0)for(e=te(e);e.r<0;)e.r+=t>8?1048576:t>5?65536:16384;var r=Kt(e);return e.cRel||null==e.cRel||(r=r.replace(/^([A-Z])/,"$$$1")),e.rRel||null==e.rRel||(r=r.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")),r}function Wt(e,t){return 0!=e.s.r||e.s.rRel||e.e.r!=(t.biff>=12?1048575:t.biff>=8?65536:16384)||e.e.rRel?0!=e.s.c||e.s.cRel||e.e.c!=(t.biff>=12?16383:255)||e.e.cRel?qt(e.s,t.biff)+":"+qt(e.e,t.biff):(e.s.rRel?"":"$")+Gt(e.s.r)+":"+(e.e.rRel?"":"$")+Gt(e.e.r):(e.s.cRel?"":"$")+Yt(e.s.c)+":"+(e.e.cRel?"":"$")+Yt(e.e.c)}function Ht(e){return parseInt(e.replace(/\$(\d+)$/,"$1"),10)-1}function Gt(e){return""+(e+1)}function Xt(e){for(var t=e.replace(/^\$([A-Z])/,"$1"),r=0,n=0;n!==t.length;++n)r=26*r+t.charCodeAt(n)-64;return r-1}function Yt(e){if(e<0)throw new Error("invalid column "+e);var t="";for(++e;e;e=Math.floor((e-1)/26))t=String.fromCharCode((e-1)%26+65)+t;return t}function Zt(e){for(var t=0,r=0,n=0;n<e.length;++n){var a=e.charCodeAt(n);a>=48&&a<=57?t=10*t+(a-48):a>=65&&a<=90&&(r=26*r+(a-64))}return{c:r-1,r:t-1}}function Kt(e){for(var t=e.c+1,r="";t;t=(t-1)/26|0)r=String.fromCharCode((t-1)%26+65)+r;return r+(e.r+1)}function Jt(e){var t=e.indexOf(":");return-1==t?{s:Zt(e),e:Zt(e)}:{s:Zt(e.slice(0,t)),e:Zt(e.slice(t+1))}}function Qt(e,t){return void 0===t||"number"==typeof t?Qt(e.s,e.e):("string"!=typeof e&&(e=Kt(e)),"string"!=typeof t&&(t=Kt(t)),e==t?e:e+":"+t)}function er(e){var t={s:{c:0,r:0},e:{c:0,r:0}},r=0,n=0,a=0,i=e.length;for(r=0;n<i&&!((a=e.charCodeAt(n)-64)<1||a>26);++n)r=26*r+a;for(t.s.c=--r,r=0;n<i&&!((a=e.charCodeAt(n)-48)<0||a>9);++n)r=10*r+a;if(t.s.r=--r,n===i||58===e.charCodeAt(++n))return t.e.c=t.s.c,t.e.r=t.s.r,t;for(r=0;n!=i&&!((a=e.charCodeAt(n)-64)<1||a>26);++n)r=26*r+a;for(t.e.c=--r,r=0;n!=i&&!((a=e.charCodeAt(n)-48)<0||a>9);++n)r=10*r+a;return t.e.r=--r,t}function tr(e,t,r){return null==e||null==e.t||"z"==e.t?"":void 0!==e.w?e.w:("d"==e.t&&!e.z&&r&&r.dateNF&&(e.z=r.dateNF),"e"==e.t?Ur[e.v]||e.v:function(e,t){var r="d"==e.t&&t instanceof Date;if(null!=e.z)try{return e.w=E.format(e.z,r?W(t):t)}catch(e){}try{return e.w=E.format((e.XF||{}).numFmtId||(r?14:0),r?W(t):t)}catch(e){return""+t}}(e,null==t?e.v:t))}function rr(e,t){var r=t&&t.sheet?t.sheet:"Sheet1",n={};return n[r]=e,{SheetNames:[r],Sheets:n}}function nr(e,t,r){var n=r||{},a=e?Array.isArray(e):n.dense,i=e||(a?[]:{}),o=0,s=0;if(i&&null!=n.origin){if("number"==typeof n.origin)o=n.origin;else{var l="string"==typeof n.origin?Zt(n.origin):n.origin;o=l.r,s=l.c}i["!ref"]||(i["!ref"]="A1:A1")}var c={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(i["!ref"]){var u=er(i["!ref"]);c.s.c=u.s.c,c.s.r=u.s.r,c.e.c=Math.max(c.e.c,u.e.c),c.e.r=Math.max(c.e.r,u.e.r),-1==o&&(c.e.r=o=u.e.r+1)}for(var f=0;f!=t.length;++f)if(t[f]){if(!Array.isArray(t[f]))throw new Error("aoa_to_sheet expects an array of arrays");for(var p=0;p!=t[f].length;++p)if(void 0!==t[f][p]){var h={v:t[f][p]},d=o+f,m=s+p;if(c.s.r>d&&(c.s.r=d),c.s.c>m&&(c.s.c=m),c.e.r<d&&(c.e.r=d),c.e.c<m&&(c.e.c=m),!t[f][p]||"object"!=typeof t[f][p]||Array.isArray(t[f][p])||t[f][p]instanceof Date)if(Array.isArray(h.v)&&(h.f=t[f][p][1],h.v=h.v[0]),null===h.v)if(h.f)h.t="n";else if(n.nullError)h.t="e",h.v=0;else{if(!n.sheetStubs)continue;h.t="z"}else"number"==typeof h.v?h.t="n":"boolean"==typeof h.v?h.t="b":h.v instanceof Date?(h.z=n.dateNF||E._table[14],n.cellDates?(h.t="d",h.w=E.format(h.z,W(h.v))):(h.t="n",h.v=W(h.v),h.w=E.format(h.z,h.v))):h.t="s";else h=t[f][p];if(a)i[d]||(i[d]=[]),i[d][m]&&i[d][m].z&&(h.z=i[d][m].z),i[d][m]=h;else{var g=Kt({c:m,r:d});i[g]&&i[g].z&&(h.z=i[g].z),i[g]=h}}}return c.s.c<1e7&&(i["!ref"]=Qt(c)),i}function ar(e,t){return nr(null,e,t)}function ir(e,t){return t||(t=Bt(4)),t.write_shift(4,e),t}function or(e){var t=e.read_shift(4);return 0===t?"":e.read_shift(t,"dbcs")}function sr(e,t){var r=!1;return null==t&&(r=!0,t=Bt(4+2*e.length)),t.write_shift(4,e.length),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}function lr(e){return{ich:e.read_shift(2),ifnt:e.read_shift(2)}}function cr(e,t){var r=e.l,n=e.read_shift(1),a=or(e),i=[],o={t:a,h:a};if(0!=(1&n)){for(var s=e.read_shift(4),l=0;l!=s;++l)i.push(lr(e));o.r=i}else o.r=[{ich:0,ifnt:0}];return e.l=r+t,o}!function(e,t){var n;if(void 0!==t)n=t;else try{n=r(34684)}catch(e){n=null}e.rc4=function(e,t){var r=new Array(256),n=0,a=0,i=0,o=0;for(a=0;256!=a;++a)r[a]=a;for(a=0;256!=a;++a)i=i+r[a]+e[a%e.length].charCodeAt(0)&255,o=r[a],r[a]=r[i],r[i]=o;a=i=0;var s=x(t.length);for(n=0;n!=t.length;++n)i=(i+r[a=a+1&255])%256,o=r[a],r[a]=r[i],r[i]=o,s[n]=t[n]^r[r[a]+r[i]&255];return s},e.md5=function(e){if(!n)throw new Error("Unsupported crypto");return n.createHash("md5").update(e).digest("hex")}}({},"undefined"!=typeof crypto?crypto:void 0);var ur=cr;function fr(e){var t=e.read_shift(4),r=e.read_shift(2);return r+=e.read_shift(1)<<16,e.l++,{c:t,iStyleRef:r}}function pr(e,t){return null==t&&(t=Bt(8)),t.write_shift(-4,e.c),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}function hr(e){var t=e.read_shift(2);return t+=e.read_shift(1)<<16,e.l++,{c:-1,iStyleRef:t}}function dr(e,t){return null==t&&(t=Bt(4)),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}var mr=or,gr=sr;function yr(e){var t=e.read_shift(4);return 0===t||4294967295===t?"":e.read_shift(t,"dbcs")}function vr(e,t){var r=!1;return null==t&&(r=!0,t=Bt(127)),t.write_shift(4,e.length>0?e.length:4294967295),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}var br=or,xr=yr,_r=vr;function wr(e){var t=e.slice(e.l,e.l+4),r=1&t[0],n=2&t[0];e.l+=4,t[0]&=252;var a=0===n?_t([0,0,0,0,t[0],t[1],t[2],t[3]],0):Ct(t,0)>>2;return r?a/100:a}function kr(e,t){null==t&&(t=Bt(4));var r=0,n=0,a=100*e;if(e==(0|e)&&e>=-(1<<29)&&e<1<<29?n=1:a==(0|a)&&a>=-(1<<29)&&a<1<<29&&(n=1,r=1),!n)throw new Error("unsupported RkNumber "+e);t.write_shift(-4,((r?a:e)<<2)+(r+2))}function Dr(e){var t={s:{},e:{}};return t.s.r=e.read_shift(4),t.e.r=e.read_shift(4),t.s.c=e.read_shift(4),t.e.c=e.read_shift(4),t}var Tr=Dr,Ar=function(e,t){return t||(t=Bt(16)),t.write_shift(4,e.s.r),t.write_shift(4,e.e.r),t.write_shift(4,e.s.c),t.write_shift(4,e.e.c),t};function Sr(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e.read_shift(8,"f")}function Mr(e,t){return(t||Bt(8)).write_shift(8,e,"f")}function Er(e,t){if(t||(t=Bt(8)),!e||e.auto)return t.write_shift(4,0),t.write_shift(4,0),t;null!=e.index?(t.write_shift(1,2),t.write_shift(1,e.index)):null!=e.theme?(t.write_shift(1,6),t.write_shift(1,e.theme)):(t.write_shift(1,5),t.write_shift(1,0));var r=e.tint||0;if(r>0?r*=32767:r<0&&(r*=32768),t.write_shift(2,r),e.rgb&&null==e.theme){var n=e.rgb||"FFFFFF";"number"==typeof n&&(n=("000000"+n.toString(16)).slice(-6)),t.write_shift(1,parseInt(n.slice(0,2),16)),t.write_shift(1,parseInt(n.slice(2,4),16)),t.write_shift(1,parseInt(n.slice(4,6),16)),t.write_shift(1,255)}else t.write_shift(2,0),t.write_shift(1,0),t.write_shift(1,0);return t}function Cr(e,t){var r=e.read_shift(4);switch(r){case 0:return"";case 4294967295:case 4294967294:return{2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"}[e.read_shift(4)]||""}if(r>400)throw new Error("Unsupported Clipboard: "+r.toString(16));return e.l-=4,e.read_shift(0,1==t?"lpstr":"lpwstr")}var Nr,Or=80,Ir=[Or,81],Pr={1:{n:"CodePage",t:2},2:{n:"Category",t:Or},3:{n:"PresentationFormat",t:Or},4:{n:"ByteCount",t:3},5:{n:"LineCount",t:3},6:{n:"ParagraphCount",t:3},7:{n:"SlideCount",t:3},8:{n:"NoteCount",t:3},9:{n:"HiddenCount",t:3},10:{n:"MultimediaClipCount",t:3},11:{n:"ScaleCrop",t:11},12:{n:"HeadingPairs",t:4108},13:{n:"TitlesOfParts",t:4126},14:{n:"Manager",t:Or},15:{n:"Company",t:Or},16:{n:"LinksUpToDate",t:11},17:{n:"CharacterCount",t:3},19:{n:"SharedDoc",t:11},22:{n:"HyperlinksChanged",t:11},23:{n:"AppVersion",t:3,p:"version"},24:{n:"DigSig",t:65},26:{n:"ContentType",t:Or},27:{n:"ContentStatus",t:Or},28:{n:"Language",t:Or},29:{n:"Version",t:Or},255:{},2147483648:{n:"Locale",t:19},2147483651:{n:"Behavior",t:19},1919054434:{}},Rr={1:{n:"CodePage",t:2},2:{n:"Title",t:Or},3:{n:"Subject",t:Or},4:{n:"Author",t:Or},5:{n:"Keywords",t:Or},6:{n:"Comments",t:Or},7:{n:"Template",t:Or},8:{n:"LastAuthor",t:Or},9:{n:"RevNumber",t:Or},10:{n:"EditTime",t:64},11:{n:"LastPrinted",t:64},12:{n:"CreatedDate",t:64},13:{n:"ModifiedDate",t:64},14:{n:"PageCount",t:3},15:{n:"WordCount",t:3},16:{n:"CharCount",t:3},17:{n:"Thumbnail",t:71},18:{n:"Application",t:Or},19:{n:"DocSecurity",t:3},255:{},2147483648:{n:"Locale",t:19},2147483651:{n:"Behavior",t:19},1919054434:{}},Lr=j(Pr,"n"),Fr=j(Rr,"n"),Br={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},zr=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],jr=te([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].map((function(e){return[e>>16&255,e>>8&255,255&e]}))),Ur={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},$r=V(Ur),Vr={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.sheetMetadata":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"TODO","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"vba","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"},qr=(z(Nr={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"},comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}}).forEach((function(e){["xlsm","xlam"].forEach((function(t){Nr[e][t]||(Nr[e][t]=Nr[e].xlsx)}))})),z(Nr).forEach((function(e){z(Nr[e]).forEach((function(t){Vr[Nr[e][t]]=e}))})),Nr),Wr=function(e){for(var t=[],r=z(e),n=0;n!==r.length;++n)null==t[e[r[n]]]&&(t[e[r[n]]]=[]),t[e[r[n]]].push(r[n]);return t}(Vr);nt.CT="http://schemas.openxmlformats.org/package/2006/content-types";var Hr=Qe("Types",null,{xmlns:nt.CT,"xmlns:xsd":nt.xsd,"xmlns:xsi":nt.xsi}),Gr=[["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels",Wr.rels[0]]].map((function(e){return Qe("Default",null,{Extension:e[0],ContentType:e[1]})})),Xr={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function Yr(e){var t=e.lastIndexOf("/");return e.slice(0,t+1)+"_rels/"+e.slice(t+1)+".rels"}function Zr(e,t){var r={"!id":{}};if(!e)return r;"/"!==t.charAt(0)&&(t="/"+t);var n={};return(e.match(ve)||[]).forEach((function(e){var a=_e(e);if("<Relationship"===a[0]){var i={};i.Type=a.Type,i.Target=a.Target,i.Id=a.Id,i.TargetMode=a.TargetMode;var o="External"===a.TargetMode?a.Target:me(a.Target,t);r[o]=i,n[a.Id]=i}})),r["!id"]=n,r}nt.RELS="http://schemas.openxmlformats.org/package/2006/relationships";var Kr=Qe("Relationships",null,{xmlns:nt.RELS});function Jr(e){var t=[ge,Kr];return z(e["!id"]).forEach((function(r){t[t.length]=Qe("Relationship",null,e["!id"][r])})),t.length>2&&(t[t.length]="</Relationships>",t[1]=t[1].replace("/>",">")),t.join("")}var Qr=[Xr.HLINK,Xr.XPATH,Xr.XMISS];function en(e,t,r,n,a,i){if(a||(a={}),e["!id"]||(e["!id"]={}),t<0)for(t=1;e["!id"]["rId"+t];++t);if(a.Id="rId"+t,a.Type=n,a.Target=r,i?a.TargetMode=i:Qr.indexOf(a.Type)>-1&&(a.TargetMode="External"),e["!id"][a.Id])throw new Error("Cannot rewrite rId "+t);return e["!id"][a.Id]=a,e[("/"+a.Target).replace("//","/")]=a,t}function tn(e,t,r){return['  <rdf:Description rdf:about="'+e+'">\n','    <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/'+(r||"odf")+"#"+t+'"/>\n',"  </rdf:Description>\n"].join("")}var rn,nn=(rn='<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>SheetJS '+t.version+"</meta:generator></office:meta></office:document-meta>",function(){return rn}),an=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]];nt.CORE_PROPS="http://schemas.openxmlformats.org/package/2006/metadata/core-properties",Xr.CORE_PROPS="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";var on=function(){for(var e=new Array(an.length),t=0;t<an.length;++t){var r=an[t],n="(?:"+r[0].slice(0,r[0].indexOf(":"))+":)"+r[0].slice(r[0].indexOf(":")+1);e[t]=new RegExp("<"+n+"[^>]*>([\\s\\S]*?)</"+n+">")}return e}();function sn(e){var t={};e=Le(e);for(var r=0;r<an.length;++r){var n=an[r],a=e.match(on[r]);null!=a&&a.length>0&&(t[n[1]]=Se(a[1])),"date"===n[2]&&t[n[1]]&&(t[n[1]]=Q(t[n[1]]))}return t}var ln=Qe("cp:coreProperties",null,{"xmlns:cp":nt.CORE_PROPS,"xmlns:dc":nt.dc,"xmlns:dcterms":nt.dcterms,"xmlns:dcmitype":nt.dcmitype,"xmlns:xsi":nt.xsi});function cn(e,t,r,n,a){null==a[e]&&null!=t&&""!==t&&(a[e]=t,t=Ce(t),n[n.length]=r?Qe(e,t,r):Ke(e,t))}var un=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]];function fn(e,t,r,n){var a=[];if("string"==typeof e)a=Ye(e,n);else for(var i=0;i<e.length;++i)a=a.concat(e[i].map((function(e){return{v:e}})));var o="string"==typeof t?Ye(t,n).map((function(e){return e.v})):t,s=0,l=0;if(o.length>0)for(var c=0;c!==a.length;c+=2){switch(l=+a[c+1].v,a[c].v){case"Worksheets":case"工作表":case"Листы":case"أوراق العمل":case"ワークシート":case"גליונות עבודה":case"Arbeitsblätter":case"Çalışma Sayfaları":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de cálculo":case"Planilhas":case"Regneark":case"Hojas de cálculo":case"Werkbladen":r.Worksheets=l,r.SheetNames=o.slice(s,s+l);break;case"Named Ranges":case"Rangos con nombre":case"名前付き一覧":case"Benannte Bereiche":case"Navngivne områder":r.NamedRanges=l,r.DefinedNames=o.slice(s,s+l);break;case"Charts":case"Diagramme":r.Chartsheets=l,r.ChartNames=o.slice(s,s+l)}s+=l}}nt.EXT_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",Xr.EXT_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";var pn=Qe("Properties",null,{xmlns:nt.EXT_PROPS,"xmlns:vt":nt.vt});nt.CUST_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",Xr.CUST_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties";var hn=/<[^>]+>[^<]*/g,dn=Qe("Properties",null,{xmlns:nt.CUST_PROPS,"xmlns:vt":nt.vt});var mn={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"},gn=U(mn);function yn(e,t,r){e[t=gn[t]||t]=r}function vn(e){var t=e.read_shift(4),r=e.read_shift(4);return new Date(1e3*(r/1e7*Math.pow(2,32)+t/1e7-11644473600)).toISOString().replace(/\.000/,"")}function bn(e,t,r){var n=e.l,a=e.read_shift(0,"lpstr-cp");if(r)for(;e.l-n&3;)++e.l;return a}function xn(e,t,r){var n=e.read_shift(0,"lpwstr");return r&&(e.l+=4-(n.length+1&3)&3),n}function _n(e,t,r){return 31===t?xn(e):bn(e,0,r)}function wn(e,t,r){return _n(e,t,!1===r?0:4)}function kn(e){var t=e.l,r=An(e,81);return 0==e[e.l]&&0==e[e.l+1]&&e.l-t&2&&(e.l+=2),[r,An(e,3)]}function Dn(e,t){for(var r=e.read_shift(4),n={},a=0;a!=r;++a){var i=e.read_shift(4),o=e.read_shift(4);n[i]=e.read_shift(o,1200===t?"utf16le":"utf8").replace(S,"").replace(M,"!"),1200===t&&o%2&&(e.l+=2)}return 3&e.l&&(e.l=e.l>>3<<2),n}function Tn(e){var t=e.read_shift(4),r=e.slice(e.l,e.l+t);return e.l+=t,(3&t)>0&&(e.l+=4-(3&t)&3),r}function An(e,t,r){var n,a=e.read_shift(2),i=r||{};if(e.l+=2,12!==t&&a!==t&&-1===Ir.indexOf(t)&&(4126!=(65534&t)||4126!=(65534&a)))throw new Error("Expected type "+t+" saw "+a);switch(12===t?a:t){case 2:return n=e.read_shift(2,"i"),i.raw||(e.l+=2),n;case 3:return e.read_shift(4,"i");case 11:return 0!==e.read_shift(4);case 19:return e.read_shift(4);case 30:return bn(e,0,4).replace(S,"");case 31:return xn(e);case 64:return vn(e);case 65:return Tn(e);case 71:return function(e){var t={};return t.Size=e.read_shift(4),e.l+=t.Size+3-(t.Size-1)%4,t}(e);case 80:return wn(e,a,!i.raw).replace(S,"");case 81:return function(e,t){if(!t)throw new Error("VtUnalignedString must have positive length");return _n(e,t,0)}(e,a).replace(S,"");case 4108:return function(e){for(var t=e.read_shift(4),r=[],n=0;n<t/2;++n)r.push(kn(e));return r}(e);case 4126:case 4127:return 4127==a?function(e){for(var t=e.read_shift(4),r=[],n=0;n!=t;++n){var a=e.l;r[n]=e.read_shift(0,"lpwstr").replace(S,""),e.l-a&2&&(e.l+=2)}return r}(e):function(e){for(var t=e.read_shift(4),r=[],n=0;n!=t;++n)r[n]=e.read_shift(0,"lpstr-cp").replace(S,"");return r}(e);default:throw new Error("TypedPropertyValue unrecognized type "+t+" "+a)}}function Sn(e,t){var r=Bt(4),n=Bt(4);switch(r.write_shift(4,80==e?31:e),e){case 3:n.write_shift(-4,t);break;case 5:(n=Bt(8)).write_shift(8,t,"f");break;case 11:n.write_shift(4,t?1:0);break;case 64:n=function(e){var t=("string"==typeof e?new Date(Date.parse(e)):e).getTime()/1e3+11644473600,r=t%Math.pow(2,32),n=(t-r)/Math.pow(2,32);n*=1e7;var a=(r*=1e7)/Math.pow(2,32)|0;a>0&&(r%=Math.pow(2,32),n+=a);var i=Bt(8);return i.write_shift(4,r),i.write_shift(4,n),i}(t);break;case 31:case 80:for((n=Bt(4+2*(t.length+1)+(t.length%2?0:2))).write_shift(4,t.length+1),n.write_shift(0,t,"dbcs");n.l!=n.length;)n.write_shift(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+t)}return A([r,n])}function Mn(e,t){var r=e.l,n=e.read_shift(4),a=e.read_shift(4),i=[],o=0,s=0,l=-1,u={};for(o=0;o!=a;++o){var f=e.read_shift(4),p=e.read_shift(4);i[o]=[f,p+r]}i.sort((function(e,t){return e[1]-t[1]}));var h={};for(o=0;o!=a;++o){if(e.l!==i[o][1]){var d=!0;if(o>0&&t)switch(t[i[o-1][0]].t){case 2:e.l+2===i[o][1]&&(e.l+=2,d=!1);break;case 80:case 4108:e.l<=i[o][1]&&(e.l=i[o][1],d=!1)}if((!t||0==o)&&e.l<=i[o][1]&&(d=!1,e.l=i[o][1]),d)throw new Error("Read Error: Expected address "+i[o][1]+" at "+e.l+" :"+o)}if(t){var m=t[i[o][0]];if(h[m.n]=An(e,m.t,{raw:!0}),"version"===m.p&&(h[m.n]=String(h[m.n]>>16)+"."+("0000"+String(65535&h[m.n])).slice(-4)),"CodePage"==m.n)switch(h[m.n]){case 0:h[m.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:c(s=h[m.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+h[m.n])}}else if(1===i[o][0]){if(s=h.CodePage=An(e,2),c(s),-1!==l){var g=e.l;e.l=i[l][1],u=Dn(e,s),e.l=g}}else if(0===i[o][0]){if(0===s){l=o,e.l=i[o+1][1];continue}u=Dn(e,s)}else{var y,v=u[i[o][0]];switch(e[e.l]){case 65:e.l+=4,y=Tn(e);break;case 30:case 31:e.l+=4,y=wn(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 3:e.l+=4,y=e.read_shift(4,"i");break;case 19:e.l+=4,y=e.read_shift(4);break;case 5:e.l+=4,y=e.read_shift(8,"f");break;case 11:e.l+=4,y=Rn(e,4);break;case 64:e.l+=4,y=Q(vn(e));break;default:throw new Error("unparsed value: "+e[e.l])}h[v]=y}}return e.l=r+n,h}var En=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"].concat(["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"]);function Cn(e){switch(typeof e){case"boolean":return 11;case"number":return(0|e)==e?3:5;case"string":return 31;case"object":if(e instanceof Date)return 64}return-1}function Nn(e,t,r){var n=Bt(8),a=[],i=[],o=8,s=0,l=Bt(8),c=Bt(8);if(l.write_shift(4,2),l.write_shift(4,1200),c.write_shift(4,1),i.push(l),a.push(c),o+=8+l.length,!t){(c=Bt(8)).write_shift(4,0),a.unshift(c);var u=[Bt(4)];for(u[0].write_shift(4,e.length),s=0;s<e.length;++s){var f=e[s][0];for((l=Bt(8+2*(f.length+1)+(f.length%2?0:2))).write_shift(4,s+2),l.write_shift(4,f.length+1),l.write_shift(0,f,"dbcs");l.l!=l.length;)l.write_shift(1,0);u.push(l)}l=A(u),i.unshift(l),o+=8+l.length}for(s=0;s<e.length;++s)if((!t||t[e[s][0]])&&!(En.indexOf(e[s][0])>-1)&&null!=e[s][1]){var p=e[s][1],h=0;if(t){var d=r[h=+t[e[s][0]]];if("version"==d.p&&"string"==typeof p){var m=p.split(".");p=(+m[0]<<16)+(+m[1]||0)}l=Sn(d.t,p)}else{var g=Cn(p);-1==g&&(g=31,p=String(p)),l=Sn(g,p)}i.push(l),(c=Bt(8)).write_shift(4,t?h:2+s),a.push(c),o+=8+l.length}var y=8*(i.length+1);for(s=0;s<i.length;++s)a[s].write_shift(4,y),y+=i[s].length;return n.write_shift(4,o),n.write_shift(4,i.length),A([n].concat(a).concat(i))}function On(e,t,r){var n=e.content;if(!n)return{};Lt(n,0);var a,i,o,s,l=0;n.chk("feff","Byte Order: "),n.read_shift(2);var c=n.read_shift(4),u=n.read_shift(16);if(u!==L.utils.consts.HEADER_CLSID&&u!==r)throw new Error("Bad PropertySet CLSID "+u);if(1!==(a=n.read_shift(4))&&2!==a)throw new Error("Unrecognized #Sets: "+a);if(i=n.read_shift(16),s=n.read_shift(4),1===a&&s!==n.l)throw new Error("Length mismatch: "+s+" !== "+n.l);2===a&&(o=n.read_shift(16),l=n.read_shift(4));var f,p=Mn(n,t),h={SystemIdentifier:c};for(var d in p)h[d]=p[d];if(h.FMTID=i,1===a)return h;if(l-n.l==2&&(n.l+=2),n.l!==l)throw new Error("Length mismatch 2: "+n.l+" !== "+l);try{f=Mn(n,null)}catch(e){}for(d in f)h[d]=f[d];return h.FMTID=[i,o],h}function In(e,t,r,n,a,i){var o=Bt(a?68:48),s=[o];o.write_shift(2,65534),o.write_shift(2,0),o.write_shift(4,842412599),o.write_shift(16,L.utils.consts.HEADER_CLSID,"hex"),o.write_shift(4,a?2:1),o.write_shift(16,t,"hex"),o.write_shift(4,a?68:48);var l=Nn(e,r,n);if(s.push(l),a){var c=Nn(a,null,null);o.write_shift(16,i,"hex"),o.write_shift(4,68+l.length),s.push(c)}return A(s)}function Pn(e,t){return e.read_shift(t),null}function Rn(e,t){return 1===e.read_shift(t)}function Ln(e,t){return t||(t=Bt(2)),t.write_shift(2,+!!e),t}function Fn(e){return e.read_shift(2,"u")}function Bn(e,t){return t||(t=Bt(2)),t.write_shift(2,e),t}function zn(e,t){return function(e,t,r){for(var n=[],a=e.l+t;e.l<a;)n.push(r(e,a-e.l));if(a!==e.l)throw new Error("Slurp error");return n}(e,t,Fn)}function jn(e,t,r){return r||(r=Bt(2)),r.write_shift(1,"e"==t?+e:+!!e),r.write_shift(1,"e"==t?1:0),r}function Un(e,t,r){var a=e.read_shift(r&&r.biff>=12?2:1),i="sbcs-cont",o=n;r&&r.biff>=8&&(n=1200),r&&8!=r.biff?12==r.biff&&(i="wstr"):e.read_shift(1)&&(i="dbcs-cont"),r.biff>=2&&r.biff<=5&&(i="cpstr");var s=a?e.read_shift(a,i):"";return n=o,s}function $n(e){var t=n;n=1200;var r,a=e.read_shift(2),i=e.read_shift(1),o=4&i,s=8&i,l=1+(1&i),c=0,u={};s&&(c=e.read_shift(2)),o&&(r=e.read_shift(4));var f=2==l?"dbcs-cont":"sbcs-cont",p=0===a?"":e.read_shift(a,f);return s&&(e.l+=4*c),o&&(e.l+=r),u.t=p,s||(u.raw="<t>"+u.t+"</t>",u.r=u.t),n=t,u}function Vn(e){var t=e.t||"",r=Bt(3);r.write_shift(2,t.length),r.write_shift(1,1);var n=Bt(2*t.length);return n.write_shift(2*t.length,t,"utf16le"),A([r,n])}function qn(e,t,r){if(r){if(r.biff>=2&&r.biff<=5)return e.read_shift(t,"cpstr");if(r.biff>=12)return e.read_shift(t,"dbcs-cont")}return 0===e.read_shift(1)?e.read_shift(t,"sbcs-cont"):e.read_shift(t,"dbcs-cont")}function Wn(e,t,r){var n=e.read_shift(r&&2==r.biff?1:2);return 0===n?(e.l++,""):qn(e,n,r)}function Hn(e,t,r){if(r.biff>5)return Wn(e,0,r);var n=e.read_shift(1);return 0===n?(e.l++,""):e.read_shift(n,r.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function Gn(e,t,r){return r||(r=Bt(3+2*e.length)),r.write_shift(2,e.length),r.write_shift(1,1),r.write_shift(31,e,"utf16le"),r}function Xn(e){var t=e.read_shift(4);return t>0?e.read_shift(t,"utf16le").replace(S,""):""}function Yn(e,t){t||(t=Bt(6+2*e.length)),t.write_shift(4,1+e.length);for(var r=0;r<e.length;++r)t.write_shift(2,e.charCodeAt(r));return t.write_shift(2,0),t}function Zn(e){var t=Bt(512),r=0,n=e.Target;"file://"==n.slice(0,7)&&(n=n.slice(7));var a=n.indexOf("#"),i=a>-1?31:23;switch(n.charAt(0)){case"#":i=28;break;case".":i&=-3}t.write_shift(4,2),t.write_shift(4,i);var o=[8,6815827,6619237,4849780,83];for(r=0;r<o.length;++r)t.write_shift(4,o[r]);if(28==i)Yn(n=n.slice(1),t);else if(2&i){for(o="e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),r=0;r<o.length;++r)t.write_shift(1,parseInt(o[r],16));var s=a>-1?n.slice(0,a):n;for(t.write_shift(4,2*(s.length+1)),r=0;r<s.length;++r)t.write_shift(2,s.charCodeAt(r));t.write_shift(2,0),8&i&&Yn(a>-1?n.slice(a+1):"",t)}else{for(o="03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" "),r=0;r<o.length;++r)t.write_shift(1,parseInt(o[r],16));for(var l=0;"../"==n.slice(3*l,3*l+3)||"..\\"==n.slice(3*l,3*l+3);)++l;for(t.write_shift(2,l),t.write_shift(4,n.length-3*l+1),r=0;r<n.length-3*l;++r)t.write_shift(1,255&n.charCodeAt(r+3*l));for(t.write_shift(1,0),t.write_shift(2,65535),t.write_shift(2,57005),r=0;r<6;++r)t.write_shift(4,0)}return t.slice(0,t.l)}function Kn(e){return[e.read_shift(1),e.read_shift(1),e.read_shift(1),e.read_shift(1)]}function Jn(e,t){var r=Kn(e);return r[3]=0,r}function Qn(e){return{r:e.read_shift(2),c:e.read_shift(2),ixfe:e.read_shift(2)}}function ea(e,t,r,n){return n||(n=Bt(6)),n.write_shift(2,e),n.write_shift(2,t),n.write_shift(2,r||0),n}function ta(e,t,r){var n=r.biff>8?4:2;return[e.read_shift(n),e.read_shift(n,"i"),e.read_shift(n,"i")]}function ra(e){return[e.read_shift(2),wr(e)]}function na(e){var t=e.read_shift(2),r=e.read_shift(2);return{s:{c:e.read_shift(2),r:t},e:{c:e.read_shift(2),r}}}function aa(e,t){return t||(t=Bt(8)),t.write_shift(2,e.s.r),t.write_shift(2,e.e.r),t.write_shift(2,e.s.c),t.write_shift(2,e.e.c),t}function ia(e){var t=e.read_shift(2),r=e.read_shift(2);return{s:{c:e.read_shift(1),r:t},e:{c:e.read_shift(1),r}}}var oa=ia;function sa(e){e.l+=4;var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(2);return e.l+=12,[r,t,n]}function la(e){e.l+=2,e.l+=e.read_shift(2)}var ca={0:la,4:la,5:la,6:la,7:function(e){return e.l+=4,e.cf=e.read_shift(2),{}},8:la,9:la,10:la,11:la,12:la,13:function(e){var t={};return e.l+=4,e.l+=16,t.fSharedNote=e.read_shift(2),e.l+=4,t},14:la,15:la,16:la,17:la,18:la,19:la,20:la,21:sa};function ua(e,t){var r={BIFFVer:0,dt:0};switch(r.BIFFVer=e.read_shift(2),(t-=2)>=2&&(r.dt=e.read_shift(2),e.l-=2),r.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(t>6)throw new Error("Unexpected BIFF Ver "+r.BIFFVer)}return e.read_shift(t),r}function fa(e,t,r){var n=1536,a=16;switch(r.bookType){case"biff8":case"xla":break;case"biff5":n=1280,a=8;break;case"biff4":n=4,a=6;break;case"biff3":n=3,a=6;break;case"biff2":n=2,a=4;break;default:throw new Error("unsupported BIFF version")}var i=Bt(a);return i.write_shift(2,n),i.write_shift(2,t),a>4&&i.write_shift(2,29282),a>6&&i.write_shift(2,1997),a>8&&(i.write_shift(2,49161),i.write_shift(2,1),i.write_shift(2,1798),i.write_shift(2,0)),i}function pa(e,t){var r=!t||t.biff>=8?2:1,n=Bt(8+r*e.name.length);n.write_shift(4,e.pos),n.write_shift(1,e.hs||0),n.write_shift(1,e.dt),n.write_shift(1,e.name.length),t.biff>=8&&n.write_shift(1,1),n.write_shift(r*e.name.length,e.name,t.biff<8?"sbcs":"utf16le");var a=n.slice(0,n.l);return a.l=n.l,a}function ha(e,t,r){var n=0;r&&2==r.biff||(n=e.read_shift(2));var a=e.read_shift(2);return r&&2==r.biff&&(n=1-(a>>15),a&=32767),[{Unsynced:1&n,DyZero:(2&n)>>1,ExAsc:(4&n)>>2,ExDsc:(8&n)>>3},a]}function da(e,t,r,n){var a=r&&5==r.biff;n||(n=Bt(a?3+t.length:5+2*t.length)),n.write_shift(2,e),n.write_shift(a?1:2,t.length),a||n.write_shift(1,1),n.write_shift((a?1:2)*t.length,t,a?"sbcs":"utf16le");var i=n.length>n.l?n.slice(0,n.l):n;return null==i.l&&(i.l=i.length),i}var ma=Hn;function ga(e,t,r){var n=e.l+t,a=8!=r.biff&&r.biff?2:4,i=e.read_shift(a),o=e.read_shift(a),s=e.read_shift(2),l=e.read_shift(2);return e.l=n,{s:{r:i,c:s},e:{r:o,c:l}}}function ya(e,t,r,n){var a=r&&5==r.biff;n||(n=Bt(a?16:20)),n.write_shift(2,0),e.style?(n.write_shift(2,e.numFmtId||0),n.write_shift(2,65524)):(n.write_shift(2,e.numFmtId||0),n.write_shift(2,t<<4));var i=0;return e.numFmtId>0&&a&&(i|=1024),n.write_shift(4,i),n.write_shift(4,0),a||n.write_shift(4,0),n.write_shift(2,0),n}function va(e,t,r){var n=Qn(e);2!=r.biff&&9!=t||++e.l;var a=function(e){var t=e.read_shift(1);return 1===e.read_shift(1)?t:1===t}(e);return n.val=a,n.t=!0===a||!1===a?"b":"e",n}var ba=function(e,t,r){return 0===t?"":Hn(e,0,r)};function xa(e,t,r){var n,a=e.read_shift(2),i={fBuiltIn:1&a,fWantAdvise:a>>>1&1,fWantPict:a>>>2&1,fOle:a>>>3&1,fOleLink:a>>>4&1,cf:a>>>5&1023,fIcon:a>>>15&1};return 14849===r.sbcch&&(n=function(e,t,r){e.l+=4,t-=4;var n=e.l+t,a=Un(e,0,r),i=e.read_shift(2);if(i!==(n-=e.l))throw new Error("Malformed AddinUdf: padding = "+n+" != "+i);return e.l+=i,a}(e,t-2,r)),i.body=n||e.read_shift(t-2),"string"==typeof n&&(i.Name=n),i}var _a=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function wa(e,t,r){var n=e.l+t,a=e.read_shift(2),i=e.read_shift(1),o=e.read_shift(1),s=e.read_shift(r&&2==r.biff?1:2),l=0;(!r||r.biff>=5)&&(5!=r.biff&&(e.l+=2),l=e.read_shift(2),5==r.biff&&(e.l+=2),e.l+=4);var c=qn(e,o,r);32&a&&(c=_a[c.charCodeAt(0)]);var u=n-e.l;r&&2==r.biff&&--u;var f=n!=e.l&&0!==s&&u>0?function(e,t,r,n){var a,i=e.l+t,o=Uo(e,n,r);return i!==e.l&&(a=jo(e,i-e.l,o,r)),[o,a]}(e,u,r,s):[];return{chKey:i,Name:c,itab:l,rgce:f}}function ka(e,t,r){if(r.biff<8)return function(e,t,r){3==e[e.l+1]&&e[e.l]++;var n=Un(e,0,r);return 3==n.charCodeAt(0)?n.slice(1):n}(e,0,r);for(var n=[],a=e.l+t,i=e.read_shift(r.biff>8?4:2);0!=i--;)n.push(ta(e,r.biff,r));if(e.l!=a)throw new Error("Bad ExternSheet: "+e.l+" != "+a);return n}function Da(e,t,r){var n=oa(e,6);switch(r.biff){case 2:e.l++,t-=7;break;case 3:case 4:e.l+=2,t-=8;break;default:e.l+=6,t-=12}return[n,Xo(e,t,r)]}var Ta=[];function Aa(e){var t=Bt(24),r=Zt(e[0]);t.write_shift(2,r.r),t.write_shift(2,r.r),t.write_shift(2,r.c),t.write_shift(2,r.c);for(var n="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),a=0;a<16;++a)t.write_shift(1,parseInt(n[a],16));return A([t,Zn(e[1])])}function Sa(e){var t=e[1].Tooltip,r=Bt(10+2*(t.length+1));r.write_shift(2,2048);var n=Zt(e[0]);r.write_shift(2,n.r),r.write_shift(2,n.r),r.write_shift(2,n.c),r.write_shift(2,n.c);for(var a=0;a<t.length;++a)r.write_shift(2,t.charCodeAt(a));return r.write_shift(2,0),r}function Ma(e,t,r){if(!r.cellStyles)return Ft(e,t);var n=r&&r.biff>=12?4:2,a=e.read_shift(n),i=e.read_shift(n),o=e.read_shift(n),s=e.read_shift(n),l=e.read_shift(2);2==n&&(e.l+=2);var c={s:a,e:i,w:o,ixfe:s,flags:l};return(r.biff>=5||!r.biff)&&(c.level=l>>8&7),c}Ta[8]=function(e,t){var r=e.l+t;e.l+=10;var n=e.read_shift(2);e.l+=4,e.l+=2,e.l+=2,e.l+=2,e.l+=4;var a=e.read_shift(1);return e.l+=a,e.l=r,{fmt:n}};var Ea=Qn,Ca=zn,Na=Wn,Oa=function(){var e={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},t=U({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function r(t,r){var n=r||{};return n.dateNF||(n.dateNF="yyyymmdd"),ar(function(t,r){var n=[],a=x(1);switch(r.type){case"base64":a=w(g.decode(t));break;case"binary":a=w(t);break;case"buffer":case"array":a=t}Lt(a,0);var i=a.read_shift(1),o=!!(136&i),s=!1,l=!1;switch(i){case 2:case 3:case 131:case 139:case 245:break;case 48:case 49:s=!0,o=!0;break;case 140:l=!0;break;default:throw new Error("DBF Unsupported Version: "+i.toString(16))}var c=0,u=521;2==i&&(c=a.read_shift(2)),a.l+=3,2!=i&&(c=a.read_shift(4)),c>1048576&&(c=1e6),2!=i&&(u=a.read_shift(2));var f=a.read_shift(2),p=r.codepage||1252;2!=i&&(a.l+=16,a.read_shift(1),0!==a[a.l]&&(p=e[a[a.l]]),a.l+=1,a.l+=2),l&&(a.l+=36);for(var h=[],d={},m=Math.min(a.length,2==i?521:u-10-(s?264:0)),y=l?32:11;a.l<m&&13!=a[a.l];)switch((d={}).name=cptable.utils.decode(p,a.slice(a.l,a.l+y)).replace(/[\u0000\r\n].*$/g,""),a.l+=y,d.type=String.fromCharCode(a.read_shift(1)),2==i||l||(d.offset=a.read_shift(4)),d.len=a.read_shift(1),2==i&&(d.offset=a.read_shift(2)),d.dec=a.read_shift(1),d.name.length&&h.push(d),2!=i&&(a.l+=l?13:14),d.type){case"B":s&&8==d.len||!r.WTF||console.log("Skipping "+d.name+":"+d.type);break;case"G":case"P":r.WTF&&console.log("Skipping "+d.name+":"+d.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+d.type)}if(13!==a[a.l]&&(a.l=u-1),13!==a.read_shift(1))throw new Error("DBF Terminator not found "+a.l+" "+a[a.l]);a.l=u;var v=0,b=0;for(n[0]=[],b=0;b!=h.length;++b)n[0][b]=h[b].name;for(;c-- >0;)if(42!==a[a.l])for(++a.l,n[++v]=[],b=0,b=0;b!=h.length;++b){var _=a.slice(a.l,a.l+h[b].len);a.l+=h[b].len,Lt(_,0);var k=cptable.utils.decode(p,_);switch(h[b].type){case"C":k.trim().length&&(n[v][b]=k.replace(/\s+$/,""));break;case"D":8===k.length?n[v][b]=new Date(+k.slice(0,4),+k.slice(4,6)-1,+k.slice(6,8)):n[v][b]=k;break;case"F":n[v][b]=parseFloat(k.trim());break;case"+":case"I":n[v][b]=l?2147483648^_.read_shift(-4,"i"):_.read_shift(4,"i");break;case"L":switch(k.trim().toUpperCase()){case"Y":case"T":n[v][b]=!0;break;case"N":case"F":n[v][b]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+k+"|")}break;case"M":if(!o)throw new Error("DBF Unexpected MEMO for type "+i.toString(16));n[v][b]="##MEMO##"+(l?parseInt(k.trim(),10):_.read_shift(4));break;case"N":(k=k.replace(/\u0000/g,"").trim())&&"."!=k&&(n[v][b]=+k||0);break;case"@":n[v][b]=new Date(_.read_shift(-8,"f")-621356832e5);break;case"T":n[v][b]=new Date(864e5*(_.read_shift(4)-2440588)+_.read_shift(4));break;case"Y":n[v][b]=_.read_shift(4,"i")/1e4;break;case"O":n[v][b]=-_.read_shift(-8,"f");break;case"B":if(s&&8==h[b].len){n[v][b]=_.read_shift(8,"f");break}case"G":case"P":_.l+=h[b].len;break;case"0":if("_NullFlags"===h[b].name)break;default:throw new Error("DBF Unsupported data type "+h[b].type)}}else a.l+=f;if(2!=i&&a.l<a.length&&26!=a[a.l++])throw new Error("DBF EOF Marker missing "+(a.l-1)+" of "+a.length+" "+a[a.l-1].toString(16));return r&&r.sheetRows&&(n=n.slice(0,r.sheetRows)),n}(t,n),n)}var n={B:8,C:250,L:1,D:8,"?":0,"":0};return{versions:[2,3,48,49,131,139,140,245],to_workbook:function(e,t){try{return rr(r(e,t),t)}catch(e){if(t&&t.WTF)throw e}return{SheetNames:[],Sheets:{}}},to_sheet:r,from_sheet:function(e,r){var i=r||{};if(+i.codepage>=0&&c(+i.codepage),"string"==i.type)throw new Error("Cannot write DBF to JS string");var o=jt(),s=zc(e,{header:1,raw:!0,cellDates:!0}),l=s[0],u=s.slice(1),f=0,p=0,h=0,d=1;for(f=0;f<l.length;++f)if(null!=f){if(++h,"number"==typeof l[f]&&(l[f]=l[f].toString(10)),"string"!=typeof l[f])throw new Error("DBF Invalid column name "+l[f]+" |"+typeof l[f]+"|");if(l.indexOf(l[f])!==f)for(p=0;p<1024;++p)if(-1==l.indexOf(l[f]+"_"+p)){l[f]+="_"+p;break}}var m=er(e["!ref"]),g=[];for(f=0;f<=m.e.c-m.s.c;++f){var y=[];for(p=0;p<u.length;++p)null!=u[p][f]&&y.push(u[p][f]);if(0!=y.length&&null!=l[f]){var v="",b="";for(p=0;p<y.length;++p){switch(typeof y[p]){case"number":b="B";break;case"string":default:b="C";break;case"boolean":b="L";break;case"object":b=y[p]instanceof Date?"D":"C"}if("C"==(v=v&&v!=b?"C":b))break}d+=n[v]||0,g[f]=v}else g[f]="?"}var x=o.next(32);for(x.write_shift(4,318902576),x.write_shift(4,u.length),x.write_shift(2,296+32*h),x.write_shift(2,d),f=0;f<4;++f)x.write_shift(4,0);for(x.write_shift(4,0|(+t[a]||3)<<8),f=0,p=0;f<l.length;++f)if(null!=l[f]){var _=o.next(32),w=(l[f].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);_.write_shift(1,w,"sbcs"),_.write_shift(1,"?"==g[f]?"C":g[f],"sbcs"),_.write_shift(4,p),_.write_shift(1,n[g[f]]||0),_.write_shift(1,0),_.write_shift(1,2),_.write_shift(4,0),_.write_shift(1,0),_.write_shift(4,0),_.write_shift(4,0),p+=n[g[f]]||0}var k=o.next(264);for(k.write_shift(4,13),f=0;f<65;++f)k.write_shift(4,0);for(f=0;f<u.length;++f){var D=o.next(d);for(D.write_shift(1,0),p=0;p<l.length;++p)if(null!=l[p])switch(g[p]){case"L":D.write_shift(1,null==u[f][p]?63:u[f][p]?84:70);break;case"B":D.write_shift(8,u[f][p]||0,"f");break;case"D":u[f][p]?(D.write_shift(4,("0000"+u[f][p].getFullYear()).slice(-4),"sbcs"),D.write_shift(2,("00"+(u[f][p].getMonth()+1)).slice(-2),"sbcs"),D.write_shift(2,("00"+u[f][p].getDate()).slice(-2),"sbcs")):D.write_shift(8,"00000000","sbcs");break;case"C":var T=String(u[f][p]||"");for(D.write_shift(1,T,"sbcs"),h=0;h<250-T.length;++h)D.write_shift(1,32)}}return o.next(1).write_shift(1,26),o.end()}}}(),Ia=function(){var e={AA:"À",BA:"Á",CA:"Â",DA:195,HA:"Ä",JA:197,AE:"È",BE:"É",CE:"Ê",HE:"Ë",AI:"Ì",BI:"Í",CI:"Î",HI:"Ï",AO:"Ò",BO:"Ó",CO:"Ô",DO:213,HO:"Ö",AU:"Ù",BU:"Ú",CU:"Û",HU:"Ü",Aa:"à",Ba:"á",Ca:"â",Da:227,Ha:"ä",Ja:229,Ae:"è",Be:"é",Ce:"ê",He:"ë",Ai:"ì",Bi:"í",Ci:"î",Hi:"ï",Ao:"ò",Bo:"ó",Co:"ô",Do:245,Ho:"ö",Au:"ù",Bu:"ú",Cu:"û",Hu:"ü",KC:"Ç",Kc:"ç",q:"æ",z:"œ",a:"Æ",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},t=new RegExp("N("+z(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(t,r){var n=e[r];return"number"==typeof n?d(n):n},n=function(e,t,r){var n=t.charCodeAt(0)-32<<4|r.charCodeAt(0)-48;return 59==n?e:d(n)};function a(e,a){var i,o=e.split(/[\n\r]+/),s=-1,l=-1,u=0,f=0,p=[],h=[],d=null,m={},g=[],y=[],v=[],b=0;for(+a.codepage>=0&&c(+a.codepage);u!==o.length;++u){b=0;var x,_=o[u].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,n).replace(t,r),w=_.replace(/;;/g,"\0").split(";").map((function(e){return e.replace(/\u0000/g,";")})),k=w[0];if(_.length>0)switch(k){case"ID":case"E":case"B":case"O":case"W":break;case"P":"P"==w[1].charAt(0)&&h.push(_.slice(3).replace(/;;/g,";"));break;case"C":var D=!1,T=!1,A=!1,S=!1,M=-1,C=-1;for(f=1;f<w.length;++f)switch(w[f].charAt(0)){case"A":case"G":break;case"X":l=parseInt(w[f].slice(1))-1,T=!0;break;case"Y":for(s=parseInt(w[f].slice(1))-1,T||(l=0),i=p.length;i<=s;++i)p[i]=[];break;case"K":'"'===(x=w[f].slice(1)).charAt(0)?x=x.slice(1,x.length-1):"TRUE"===x?x=!0:"FALSE"===x?x=!1:isNaN(ne(x))?isNaN(ae(x).getDate())||(x=Q(x)):(x=ne(x),null!==d&&E.is_date(d)&&(x=Y(x))),"undefined"!=typeof cptable&&"string"==typeof x&&"string"!=(a||{}).type&&(a||{}).codepage&&(x=cptable.utils.decode(a.codepage,x)),D=!0;break;case"E":S=!0;var N=oo(w[f].slice(1),{r:s,c:l});p[s][l]=[p[s][l],N];break;case"S":A=!0,p[s][l]=[p[s][l],"S5S"];break;case"R":M=parseInt(w[f].slice(1))-1;break;case"C":C=parseInt(w[f].slice(1))-1;break;default:if(a&&a.WTF)throw new Error("SYLK bad record "+_)}if(D&&(p[s][l]&&2==p[s][l].length?p[s][l][0]=x:p[s][l]=x,d=null),A){if(S)throw new Error("SYLK shared formula cannot have own formula");var O=M>-1&&p[M][C];if(!O||!O[1])throw new Error("SYLK shared formula cannot find base");p[s][l][1]=co(O[1],{r:s-M,c:l-C})}break;case"F":var I=0;for(f=1;f<w.length;++f)switch(w[f].charAt(0)){case"X":l=parseInt(w[f].slice(1))-1,++I;break;case"Y":for(s=parseInt(w[f].slice(1))-1,i=p.length;i<=s;++i)p[i]=[];break;case"M":b=parseInt(w[f].slice(1))/20;break;case"F":case"G":case"S":case"D":case"N":break;case"P":d=h[parseInt(w[f].slice(1))];break;case"W":for(v=w[f].slice(1).split(" "),i=parseInt(v[0],10);i<=parseInt(v[1],10);++i)b=parseInt(v[2],10),y[i-1]=0===b?{hidden:!0}:{wch:b},xi(y[i-1]);break;case"C":y[l=parseInt(w[f].slice(1))-1]||(y[l]={});break;case"R":g[s=parseInt(w[f].slice(1))-1]||(g[s]={}),b>0?(g[s].hpt=b,g[s].hpx=wi(b)):0===b&&(g[s].hidden=!0);break;default:if(a&&a.WTF)throw new Error("SYLK bad record "+_)}I<1&&(d=null);break;default:if(a&&a.WTF)throw new Error("SYLK bad record "+_)}}return g.length>0&&(m["!rows"]=g),y.length>0&&(m["!cols"]=y),a&&a.sheetRows&&(p=p.slice(0,a.sheetRows)),[p,m]}function i(e,t){var r=function(e,t){switch(t.type){case"base64":return a(g.decode(e),t);case"binary":return a(e,t);case"buffer":return a(y&&Buffer.isBuffer(e)?e.toString("binary"):D(e),t);case"array":return a(ee(e),t)}throw new Error("Unrecognized type "+t.type)}(e,t),n=r[0],i=r[1],o=ar(n,t);return z(i).forEach((function(e){o[e]=i[e]})),o}function o(e,t,r,n){var a="C;Y"+(r+1)+";X"+(n+1)+";K";switch(e.t){case"n":a+=e.v||0,e.f&&!e.F&&(a+=";E"+lo(e.f,{r,c:n}));break;case"b":a+=e.v?"TRUE":"FALSE";break;case"e":a+=e.w||e.v;break;case"d":a+='"'+(e.w||e.v)+'"';break;case"s":a+='"'+e.v.replace(/"/g,"")+'"'}return a}return e["|"]=254,{to_workbook:function(e,t){return rr(i(e,t),t)},to_sheet:i,from_sheet:function(e,t){var r,n,a=["ID;PWXL;N;E"],i=[],s=er(e["!ref"]),l=Array.isArray(e),c="\r\n";a.push("P;PGeneral"),a.push("F;P0;DG0G8;M255"),e["!cols"]&&(n=a,e["!cols"].forEach((function(e,t){var r="F;W"+(t+1)+" "+(t+1)+" ";e.hidden?r+="0":("number"!=typeof e.width||e.wpx||(e.wpx=mi(e.width)),"number"!=typeof e.wpx||e.wch||(e.wch=gi(e.wpx)),"number"==typeof e.wch&&(r+=Math.round(e.wch)))," "!=r.charAt(r.length-1)&&n.push(r)}))),e["!rows"]&&function(e,t){t.forEach((function(t,r){var n="F;";t.hidden?n+="M0;":t.hpt?n+="M"+20*t.hpt+";":t.hpx&&(n+="M"+20*_i(t.hpx)+";"),n.length>2&&e.push(n+"R"+(r+1))}))}(a,e["!rows"]),a.push("B;Y"+(s.e.r-s.s.r+1)+";X"+(s.e.c-s.s.c+1)+";D"+[s.s.c,s.s.r,s.e.c,s.e.r].join(" "));for(var u=s.s.r;u<=s.e.r;++u)for(var f=s.s.c;f<=s.e.c;++f){var p=Kt({r:u,c:f});(r=l?(e[u]||[])[f]:e[p])&&(null!=r.v||r.f&&!r.F)&&i.push(o(r,0,u,f))}return a.join(c)+c+i.join(c)+c+"E"+c}}}(),Pa=function(){function e(e,t){for(var r=e.split("\n"),n=-1,a=-1,i=0,o=[];i!==r.length;++i)if("BOT"!==r[i].trim()){if(!(n<0)){for(var s=r[i].trim().split(","),l=s[0],c=s[1],u=r[++i]||"";1&(u.match(/["]/g)||[]).length&&i<r.length-1;)u+="\n"+r[++i];switch(u=u.trim(),+l){case-1:if("BOT"===u){o[++n]=[],a=0;continue}if("EOD"!==u)throw new Error("Unrecognized DIF special command "+u);break;case 0:"TRUE"===u?o[n][a]=!0:"FALSE"===u?o[n][a]=!1:isNaN(ne(c))?isNaN(ae(c).getDate())?o[n][a]=c:o[n][a]=Q(c):o[n][a]=ne(c),++a;break;case 1:(u=(u=u.slice(1,u.length-1)).replace(/""/g,'"'))&&u.match(/^=".*"$/)&&(u=u.slice(2,-1)),o[n][a++]=""!==u?u:null}if("EOD"===u)break}}else o[++n]=[],a=0;return t&&t.sheetRows&&(o=o.slice(0,t.sheetRows)),o}function t(t,r){return ar(function(t,r){switch(r.type){case"base64":return e(g.decode(t),r);case"binary":return e(t,r);case"buffer":return e(y&&Buffer.isBuffer(t)?t.toString("binary"):D(t),r);case"array":return e(ee(t),r)}throw new Error("Unrecognized type "+r.type)}(t,r),r)}var r,n,a=(r=function(e,t,r,n,a){e.push(t),e.push(r+","+n),e.push('"'+a.replace(/"/g,'""')+'"')},n=function(e,t,r,n){e.push(t+","+r),e.push(1==t?'"'+n.replace(/"/g,'""')+'"':n)},function(e){var t,a=[],i=er(e["!ref"]),o=Array.isArray(e);r(a,"TABLE",0,1,"sheetjs"),r(a,"VECTORS",0,i.e.r-i.s.r+1,""),r(a,"TUPLES",0,i.e.c-i.s.c+1,""),r(a,"DATA",0,0,"");for(var s=i.s.r;s<=i.e.r;++s){n(a,-1,0,"BOT");for(var l=i.s.c;l<=i.e.c;++l){var c=Kt({r:s,c:l});if(t=o?(e[s]||[])[l]:e[c])switch(t.t){case"n":var u=t.w;u||null==t.v||(u=t.v),null==u?t.f&&!t.F?n(a,1,0,"="+t.f):n(a,1,0,""):n(a,0,u,"V");break;case"b":n(a,0,t.v?1:0,t.v?"TRUE":"FALSE");break;case"s":n(a,1,0,isNaN(t.v)?t.v:'="'+t.v+'"');break;case"d":t.w||(t.w=E.format(t.z||E._table[14],W(Q(t.v)))),n(a,0,t.w,"V");break;default:n(a,1,0,"")}else n(a,1,0,"")}}return n(a,-1,0,"EOD"),a.join("\r\n")});return{to_workbook:function(e,r){return rr(t(e,r),r)},to_sheet:t,from_sheet:a}}(),Ra=function(){function e(e){return e.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function t(e,t){return ar(function(e,t){for(var r=e.split("\n"),n=-1,a=-1,i=0,o=[];i!==r.length;++i){var s=r[i].trim().split(":");if("cell"===s[0]){var l=Zt(s[1]);if(o.length<=l.r)for(n=o.length;n<=l.r;++n)o[n]||(o[n]=[]);switch(n=l.r,a=l.c,s[2]){case"t":o[n][a]=s[3].replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,"\n");break;case"v":o[n][a]=+s[3];break;case"vtf":var c=s[s.length-1];case"vtc":"nl"===s[3]?o[n][a]=!!+s[4]:o[n][a]=+s[4],"vtf"==s[2]&&(o[n][a]=[o[n][a],c])}}}return t&&t.sheetRows&&(o=o.slice(0,t.sheetRows)),o}(e,t),t)}var r=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join("\n"),n=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join("\n")+"\n",a=["# SocialCalc Spreadsheet Control Save","part:sheet"].join("\n"),i="--SocialCalcSpreadsheetControlSave--";function o(t){if(!t||!t["!ref"])return"";for(var r,n=[],a=[],i="",o=Jt(t["!ref"]),s=Array.isArray(t),l=o.s.r;l<=o.e.r;++l)for(var c=o.s.c;c<=o.e.c;++c)if(i=Kt({r:l,c}),(r=s?(t[l]||[])[c]:t[i])&&null!=r.v&&"z"!==r.t){switch(a=["cell",i,"t"],r.t){case"s":case"str":a.push(e(r.v));break;case"n":r.f?(a[2]="vtf",a[3]="n",a[4]=r.v,a[5]=e(r.f)):(a[2]="v",a[3]=r.v);break;case"b":a[2]="vt"+(r.f?"f":"c"),a[3]="nl",a[4]=r.v?"1":"0",a[5]=e(r.f||(r.v?"TRUE":"FALSE"));break;case"d":var u=W(Q(r.v));a[2]="vtc",a[3]="nd",a[4]=""+u,a[5]=r.w||E.format(r.z||E._table[14],u);break;case"e":continue}n.push(a.join(":"))}return n.push("sheet:c:"+(o.e.c-o.s.c+1)+":r:"+(o.e.r-o.s.r+1)+":tvf:1"),n.push("valueformat:1:text-wiki"),n.join("\n")}return{to_workbook:function(e,r){return rr(t(e,r),r)},to_sheet:t,from_sheet:function(e){return[r,n,a,n,o(e),i].join("\n")}}}(),La=function(){function e(e,t,r,n,a){a.raw?t[r][n]=e:""===e||("TRUE"===e?t[r][n]=!0:"FALSE"===e?t[r][n]=!1:isNaN(ne(e))?isNaN(ae(e).getDate())?t[r][n]=e:t[r][n]=Q(e):t[r][n]=ne(e))}var t={44:",",9:"\t",59:";",124:"|"},r={44:3,9:2,59:1,124:0};function n(e){for(var n={},a=!1,i=0,o=0;i<e.length;++i)34==(o=e.charCodeAt(i))?a=!a:!a&&o in t&&(n[o]=(n[o]||0)+1);for(i in o=[],n)Object.prototype.hasOwnProperty.call(n,i)&&o.push([n[i],i]);if(!o.length)for(i in n=r)Object.prototype.hasOwnProperty.call(n,i)&&o.push([n[i],i]);return o.sort((function(e,t){return e[0]-t[0]||r[e[1]]-r[t[1]]})),t[o.pop()[1]]||44}function a(e,t){var r=t||{},a="",i=r.dense?[]:{},o={s:{c:0,r:0},e:{c:0,r:0}};"sep="==e.slice(0,4)?13==e.charCodeAt(5)&&10==e.charCodeAt(6)?(a=e.charAt(4),e=e.slice(7)):13==e.charCodeAt(5)||10==e.charCodeAt(5)?(a=e.charAt(4),e=e.slice(6)):a=n(e.slice(0,1024)):a=r&&r.FS?r.FS:n(e.slice(0,1024));var s=0,l=0,c=0,u=0,f=0,p=a.charCodeAt(0),h=!1,d=0,m=e.charCodeAt(0);e=e.replace(/\r\n/gm,"\n");var g,y,v=null!=r.dateNF?(y=(y="number"==typeof(g=r.dateNF)?E._table[g]:g).replace(P,"(\\d+)"),new RegExp("^"+y+"$")):null;function b(){var t=e.slice(u,f),n={};if('"'==t.charAt(0)&&'"'==t.charAt(t.length-1)&&(t=t.slice(1,-1).replace(/""/g,'"')),0===t.length)n.t="z";else if(r.raw)n.t="s",n.v=t;else if(0===t.trim().length)n.t="s",n.v=t;else if(61==t.charCodeAt(0))34==t.charCodeAt(1)&&34==t.charCodeAt(t.length-1)?(n.t="s",n.v=t.slice(2,-1).replace(/""/g,'"')):1!=t.length?(n.t="n",n.f=t.slice(1)):(n.t="s",n.v=t);else if("TRUE"==t)n.t="b",n.v=!0;else if("FALSE"==t)n.t="b",n.v=!1;else if(isNaN(c=ne(t)))if(!isNaN(ae(t).getDate())||v&&t.match(v)){n.z=r.dateNF||E._table[14];var a=0;v&&t.match(v)&&(t=function(e,t,r){var n=-1,a=-1,i=-1,o=-1,s=-1,l=-1;(t.match(P)||[]).forEach((function(e,t){var c=parseInt(r[t+1],10);switch(e.toLowerCase().charAt(0)){case"y":n=c;break;case"d":i=c;break;case"h":o=c;break;case"s":l=c;break;case"m":o>=0?s=c:a=c}})),l>=0&&-1==s&&a>=0&&(s=a,a=-1);var c=(""+(n>=0?n:(new Date).getFullYear())).slice(-4)+"-"+("00"+(a>=1?a:1)).slice(-2)+"-"+("00"+(i>=1?i:1)).slice(-2);7==c.length&&(c="0"+c),8==c.length&&(c="20"+c);var u=("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(s>=0?s:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return-1==o&&-1==s&&-1==l?c:-1==n&&-1==a&&-1==i?u:c+"T"+u}(0,r.dateNF,t.match(v)||[]),a=1),r.cellDates?(n.t="d",n.v=Q(t,a)):(n.t="n",n.v=W(Q(t,a))),!1!==r.cellText&&(n.w=E.format(n.z,n.v instanceof Date?W(n.v):n.v)),r.cellNF||delete n.z}else n.t="s",n.v=t;else n.t="n",!1!==r.cellText&&(n.w=t),n.v=c;if("z"==n.t||(r.dense?(i[s]||(i[s]=[]),i[s][l]=n):i[Kt({c:l,r:s})]=n),u=f+1,m=e.charCodeAt(u),o.e.c<l&&(o.e.c=l),o.e.r<s&&(o.e.r=s),d==p)++l;else if(l=0,++s,r.sheetRows&&r.sheetRows<=s)return!0}e:for(;f<e.length;++f)switch(d=e.charCodeAt(f)){case 34:34===m&&(h=!h);break;case p:case 10:case 13:if(!h&&b())break e}return f-u>0&&b(),i["!ref"]=Qt(o),i}function i(t,r){var n="",i="string"==r.type?[0,0,0,0]:Sc(t,r);switch(r.type){case"base64":n=g.decode(t);break;case"binary":case"string":n=t;break;case"buffer":n=65001==r.codepage?t.toString("utf8"):r.codepage&&"undefined"!=typeof cptable?cptable.utils.decode(r.codepage,t):y&&Buffer.isBuffer(t)?t.toString("binary"):D(t);break;case"array":n=ee(t);break;default:throw new Error("Unrecognized type "+r.type)}return 239==i[0]&&187==i[1]&&191==i[2]?n=Le(n.slice(3)):"string"!=r.type&&65001==r.codepage?n=Le(n):"binary"==r.type&&"undefined"!=typeof cptable&&r.codepage&&(n=cptable.utils.decode(r.codepage,cptable.utils.encode(28591,n))),"socialcalc:version:"==n.slice(0,19)?Ra.to_sheet("string"==r.type?n:Le(n),r):function(t,r){return r&&r.PRN?r.FS||"sep="==t.slice(0,4)||t.indexOf("\t")>=0||t.indexOf(",")>=0||t.indexOf(";")>=0?a(t,r):ar(function(t,r){var n=r||{},a=[];if(!t||0===t.length)return a;for(var i=t.split(/[\r\n]/),o=i.length-1;o>=0&&0===i[o].length;)--o;for(var s=10,l=0,c=0;c<=o;++c)-1==(l=i[c].indexOf(" "))?l=i[c].length:l++,s=Math.max(s,l);for(c=0;c<=o;++c){a[c]=[];var u=0;for(e(i[c].slice(0,s).trim(),a,c,u,n),u=1;u<=(i[c].length-s)/10+1;++u)e(i[c].slice(s+10*(u-1),s+10*u).trim(),a,c,u,n)}return n.sheetRows&&(a=a.slice(0,n.sheetRows)),a}(t,r),r):a(t,r)}(n,r)}return{to_workbook:function(e,t){return rr(i(e,t),t)},to_sheet:i,from_sheet:function(e){for(var t,r=[],n=er(e["!ref"]),a=Array.isArray(e),i=n.s.r;i<=n.e.r;++i){for(var o=[],s=n.s.c;s<=n.e.c;++s){var l=Kt({r:i,c:s});if((t=a?(e[i]||[])[s]:e[l])&&null!=t.v){for(var c=(t.w||(tr(t),t.w)||"").slice(0,10);c.length<10;)c+=" ";o.push(c+(0===s?" ":""))}else o.push("          ")}r.push(o.join(""))}return r.join("\n")}}}(),Fa=function(){function e(e,t,r){if(e){Lt(e,e.l||0);for(var n=r.Enum||v;e.l<e.length;){var a=e.read_shift(2),i=n[a]||n[65535],o=e.read_shift(2),s=e.l+o,l=i.f&&i.f(e,o,r);if(e.l=s,t(l,i,a))return}}}function t(t,r){if(!t)return t;var n=r||{},a=n.dense?[]:{},i="Sheet1",o=0,s={},l=[i],c=[],u={s:{r:0,c:0},e:{r:0,c:0}},f=n.sheetRows||0;if(2==t[2])n.Enum=v,e(t,(function(e,t,r){switch(r){case 0:n.vers=e,e>=4096&&(n.qpro=!0);break;case 6:u=e;break;case 15:case 51:n.qpro||(e[1].v=e[1].v.slice(1));case 13:case 14:case 16:14==r&&112==(112&e[2])&&(15&e[2])>1&&(15&e[2])<15&&(e[1].z=n.dateNF||E._table[14],n.cellDates&&(e[1].t="d",e[1].v=Y(e[1].v)));var i=n.dense?(a[e[0].r]||[])[e[0].c]:a[Kt(e[0])];if(i){i.t=e[1].t,i.v=e[1].v,null!=e[1].z&&(i.z=e[1].z),null!=e[1].f&&(i.f=e[1].f);break}n.dense?(a[e[0].r]||(a[e[0].r]=[]),a[e[0].r][e[0].c]=e[1]):a[Kt(e[0])]=e[1]}}),n);else{if(26!=t[2]&&14!=t[2])throw new Error("Unrecognized LOTUS BOF "+t[2]);n.Enum=b,14==t[2]&&(n.qpro=!0,t.l=0),e(t,(function(e,t,r){switch(r){case 22:e[1].v=e[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(e[3]>o&&(a["!ref"]=Qt(u),s[i]=a,a=n.dense?[]:{},u={s:{r:0,c:0},e:{r:0,c:0}},o=e[3],i="Sheet"+(o+1),l.push(i)),f>0&&e[0].r>=f)break;n.dense?(a[e[0].r]||(a[e[0].r]=[]),a[e[0].r][e[0].c]=e[1]):a[Kt(e[0])]=e[1],u.e.c<e[0].c&&(u.e.c=e[0].c),u.e.r<e[0].r&&(u.e.r=e[0].r);break;case 27:e[14e3]&&(c[e[14e3][0]]=e[14e3][1])}}),n)}if(a["!ref"]=Qt(u),s[i]=a,!c.length)return{SheetNames:l,Sheets:s};for(var p={},h=[],d=0;d<c.length;++d)s[l[d]]&&(h.push(c[d]),p[c[d]]=s[l[d]]);return{SheetNames:h,Sheets:p}}function r(e,t,r){var n=[{c:0,r:0},{t:"n",v:0},0];return r.qpro&&20768!=r.vers?(n[0].c=e.read_shift(1),e.l++,n[0].r=e.read_shift(2),e.l+=2):(n[2]=e.read_shift(1),n[0].c=e.read_shift(2),n[0].r=e.read_shift(2)),n}function n(e,t,n){var a=e.l+t,i=r(e,0,n);if(i[1].t="s",20768==n.vers){e.l++;var o=e.read_shift(1);return i[1].v=e.read_shift(o,"utf8"),i}return n.qpro&&e.l++,i[1].v=e.read_shift(a-e.l,"cstr"),i}function a(e,t,r){var n=Bt(7+r.length);n.write_shift(1,255),n.write_shift(2,t),n.write_shift(2,e),n.write_shift(1,39);for(var a=0;a<n.length;++a){var i=r.charCodeAt(a);n.write_shift(1,i>=128?95:i)}return n.write_shift(1,0),n}function i(e,t,r){var n=Bt(7);return n.write_shift(1,255),n.write_shift(2,t),n.write_shift(2,e),n.write_shift(2,r,"i"),n}function o(e,t,r){var n=Bt(13);return n.write_shift(1,255),n.write_shift(2,t),n.write_shift(2,e),n.write_shift(8,r,"f"),n}function s(e,t,r){var n=32768&t;return t=(n?e:0)+((t&=-32769)>=8192?t-16384:t),(n?"":"$")+(r?Yt(t):Gt(t))}var l={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},u=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function f(e){var t=[{c:0,r:0},{t:"n",v:0},0];return t[0].r=e.read_shift(2),t[3]=e[e.l++],t[0].c=e[e.l++],t}function p(e,t,r,n){var a=Bt(6+n.length);a.write_shift(2,e),a.write_shift(1,r),a.write_shift(1,t),a.write_shift(1,39);for(var i=0;i<n.length;++i){var o=n.charCodeAt(i);a.write_shift(1,o>=128?95:o)}return a.write_shift(1,0),a}function h(e,t){var r=f(e),n=e.read_shift(4),a=e.read_shift(4),i=e.read_shift(2);if(65535==i)return 0===n&&3221225472===a?(r[1].t="e",r[1].v=15):0===n&&3489660928===a?(r[1].t="e",r[1].v=42):r[1].v=0,r;var o=32768&i;return i=(32767&i)-16446,r[1].v=(1-2*o)*(a*Math.pow(2,i+32)+n*Math.pow(2,i)),r}function d(e,t,r,n){var a=Bt(14);if(a.write_shift(2,e),a.write_shift(1,r),a.write_shift(1,t),0==n)return a.write_shift(4,0),a.write_shift(4,0),a.write_shift(2,65535),a;var i,o=0,s=0,l=0;return n<0&&(o=1,n=-n),s=0|Math.log2(n),0==(2147483648&(l=(n/=Math.pow(2,s-31))>>>0))&&(++s,l=(n/=2)>>>0),n-=l,l|=2147483648,l>>>=0,i=(n*=Math.pow(2,32))>>>0,a.write_shift(4,i),a.write_shift(4,l),s+=16383+(o?32768:0),a.write_shift(2,s),a}function m(e,t){var r=f(e),n=e.read_shift(8,"f");return r[1].v=n,r}function y(e,t){var r=Bt(5+e.length);r.write_shift(2,14e3),r.write_shift(2,t);for(var n=0;n<e.length;++n){var a=e.charCodeAt(n);r[r.l++]=a>127?95:a}return r[r.l++]=0,r}var v={0:{n:"BOF",f:Fn},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:function(e){var t={s:{c:0,r:0},e:{c:0,r:0}};return t.s.c=e.read_shift(2),t.s.r=e.read_shift(2),t.e.c=e.read_shift(2),t.e.r=e.read_shift(2),65535==t.s.c&&(t.s.c=t.e.c=t.s.r=t.e.r=0),t}},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:function(e,t,n){var a=r(e,0,n);return a[1].v=e.read_shift(2,"i"),a}},14:{n:"NUMBER",f:function(e,t,n){var a=r(e,0,n);return a[1].v=e.read_shift(8,"f"),a}},15:{n:"LABEL",f:n},16:{n:"FORMULA",f:function(e,t,n){var a=e.l+t,i=r(e,0,n);if(i[1].v=e.read_shift(8,"f"),n.qpro)e.l=a;else{var o=e.read_shift(2);!function(e,t){Lt(e,0);for(var r=[],n=0,a="",i="";e.l<e.length;){var o=e[e.l++];switch(o){case 0:r.push(e.read_shift(8,"f"));break;case 1:i=s(t[0].c,e.read_shift(2),!0),a=s(t[0].r,e.read_shift(2),!1),r.push(i+a);break;case 2:var c=s(t[0].c,e.read_shift(2),!0),f=s(t[0].r,e.read_shift(2),!1);i=s(t[0].c,e.read_shift(2),!0),a=s(t[0].r,e.read_shift(2),!1),r.push(c+f+":"+i+a);break;case 3:if(e.l<e.length)return void console.error("WK1 premature formula end");break;case 4:r.push("("+r.pop()+")");break;case 5:r.push(e.read_shift(2));break;case 6:for(var p="";o=e[e.l++];)p+=String.fromCharCode(o);r.push('"'+p.replace(/"/g,'""')+'"');break;case 8:r.push("-"+r.pop());break;case 23:r.push("+"+r.pop());break;case 22:r.push("NOT("+r.pop()+")");break;case 20:case 21:var h=r.pop(),d=r.pop();r.push(["AND","OR"][o-20]+"("+d+","+h+")");break;default:if(o<32&&u[o])h=r.pop(),d=r.pop(),r.push(d+u[o]+h);else{if(!l[o])return o<=7?console.error("WK1 invalid opcode "+o.toString(16)):o<=24?console.error("WK1 unsupported op "+o.toString(16)):o<=30?console.error("WK1 invalid opcode "+o.toString(16)):o<=115?console.error("WK1 unsupported function opcode "+o.toString(16)):console.error("WK1 unrecognized opcode "+o.toString(16));if(69==(n=l[o][1])&&(n=e[e.l++]),n>r.length)return void console.error("WK1 bad formula parse 0x"+o.toString(16)+":|"+r.join("|")+"|");var m=r.slice(-n);r.length-=n,r.push(l[o][0]+"("+m.join(",")+")")}}}1==r.length?t[1].f=""+r[0]:console.error("WK1 bad formula parse |"+r.join("|")+"|")}(e.slice(e.l,e.l+o),i),e.l+=o}return i}},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:n},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},65535:{n:""}},b={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:function(e,t){var r=f(e);return r[1].t="s",r[1].v=e.read_shift(t-4,"cstr"),r}},23:{n:"NUMBER17",f:h},24:{n:"NUMBER18",f:function(e,t){var r=f(e);r[1].v=e.read_shift(2);var n=r[1].v>>1;if(1&r[1].v)switch(7&n){case 0:n=5e3*(n>>3);break;case 1:n=500*(n>>3);break;case 2:n=(n>>3)/20;break;case 3:n=(n>>3)/200;break;case 4:n=(n>>3)/2e3;break;case 5:n=(n>>3)/2e4;break;case 6:n=(n>>3)/16;break;case 7:n=(n>>3)/64}return r[1].v=n,r}},25:{n:"FORMULA19",f:function(e,t){var r=h(e);return e.l+=t-14,r}},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:function(e,t){for(var r={},n=e.l+t;e.l<n;){var a=e.read_shift(2);if(14e3==a){for(r[a]=[0,""],r[a][0]=e.read_shift(2);e[e.l];)r[a][1]+=String.fromCharCode(e[e.l]),e.l++;e.l++}}return r}},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:function(e,t){var r=f(e),n=e.read_shift(4);return r[1].v=n>>6,r}},38:{n:"??"},39:{n:"NUMBER27",f:m},40:{n:"FORMULA28",f:function(e,t){var r=m(e);return e.l+=t-10,r}},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:function(e,t){var r=t||{};if(+r.codepage>=0&&c(+r.codepage),"string"==r.type)throw new Error("Cannot write WK1 to JS string");var n,s=jt(),l=er(e["!ref"]),u=Array.isArray(e),f=[];ql(s,0,(1030,(n=Bt(2)).write_shift(2,1030),n)),ql(s,6,function(e){var t=Bt(8);return t.write_shift(2,e.s.c),t.write_shift(2,e.s.r),t.write_shift(2,e.e.c),t.write_shift(2,e.e.r),t}(l));for(var p=l.s.r;p<=l.e.r;++p)for(var h=Gt(p),d=l.s.c;d<=l.e.c;++d){p===l.s.r&&(f[d]=Yt(d));var m=f[d]+h,g=u?(e[p]||[])[d]:e[m];g&&"z"!=g.t&&("n"==g.t?(0|g.v)==g.v&&g.v>=-32768&&g.v<=32767?ql(s,13,i(p,d,g.v)):ql(s,14,o(p,d,g.v)):ql(s,15,a(p,d,tr(g).slice(0,239))))}return ql(s,1),s.end()},book_to_wk3:function(e,t){var r=t||{};if(+r.codepage>=0&&c(+r.codepage),"string"==r.type)throw new Error("Cannot write WK3 to JS string");var n=jt();ql(n,0,function(e){var t=Bt(26);t.write_shift(2,4096),t.write_shift(2,4),t.write_shift(4,0);for(var r=0,n=0,a=0,i=0;i<e.SheetNames.length;++i){var o=e.SheetNames[i],s=e.Sheets[o];if(s&&s["!ref"]){++a;var l=Jt(s["!ref"]);r<l.e.r&&(r=l.e.r),n<l.e.c&&(n=l.e.c)}}return t.write_shift(2,r),t.write_shift(1,a),t.write_shift(1,n),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(1,1),t.write_shift(1,2),t.write_shift(4,0),t.write_shift(4,0),t}(e));for(var a=0,i=0;a<e.SheetNames.length;++a)(e.Sheets[e.SheetNames[a]]||{})["!ref"]&&ql(n,27,y(e.SheetNames[a],i++));var o=0;for(a=0;a<e.SheetNames.length;++a){var s=e.Sheets[e.SheetNames[a]];if(s&&s["!ref"]){for(var l=er(s["!ref"]),u=Array.isArray(s),f=[],h=l.s.r;h<=l.e.r;++h)for(var m=Gt(h),g=l.s.c;g<=l.e.c;++g){h===l.s.r&&(f[g]=Yt(g));var v=f[g]+m,b=u?(s[h]||[])[g]:s[v];b&&"z"!=b.t&&("n"==b.t?ql(n,23,d(h,g,o,b.v)):ql(n,22,p(h,g,o,tr(b).slice(0,239))))}++o}}return ql(n,1),n.end()},to_workbook:function(e,r){switch(r.type){case"base64":return t(w(g.decode(e)),r);case"binary":return t(w(e),r);case"buffer":case"array":return t(e,r)}throw"Unsupported type "+r.type}}}(),Ba=function(){var e=qe("t"),t=qe("rPr");function r(r){var n=r.match(e);if(!n)return{t:"s",v:""};var a={t:"s",v:Se(n[1])},i=r.match(t);return i&&(a.s=function(e){var t={},r=e.match(ve),n=0,a=!1;if(r)for(;n!=r.length;++n){var i=_e(r[n]);switch(i[0].replace(/\w*:/g,"")){case"<condense":case"<extend":break;case"<shadow":if(!i.val)break;case"<shadow>":case"<shadow/>":t.shadow=1;break;case"</shadow>":break;case"<charset":if("1"==i.val)break;t.cp=s[parseInt(i.val,10)];break;case"<outline":if(!i.val)break;case"<outline>":case"<outline/>":t.outline=1;break;case"</outline>":break;case"<rFont":t.name=i.val;break;case"<sz":t.sz=i.val;break;case"<strike":if(!i.val)break;case"<strike>":case"<strike/>":t.strike=1;break;case"</strike>":break;case"<u":if(!i.val)break;switch(i.val){case"double":t.uval="double";break;case"singleAccounting":t.uval="single-accounting";break;case"doubleAccounting":t.uval="double-accounting"}case"<u>":case"<u/>":t.u=1;break;case"</u>":break;case"<b":if("0"==i.val)break;case"<b>":case"<b/>":t.b=1;break;case"</b>":break;case"<i":if("0"==i.val)break;case"<i>":case"<i/>":t.i=1;break;case"</i>":break;case"<color":i.rgb&&(t.color=i.rgb.slice(2,8));break;case"<family":t.family=i.val;break;case"<vertAlign":t.valign=i.val;break;case"<scheme":case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(47!==i[0].charCodeAt(1)&&!a)throw new Error("Unrecognized rich format "+i[0])}}return t}(i[1])),a}var n=/<(?:\w+:)?r>/g,a=/<\/(?:\w+:)?r>/;return function(e){return e.replace(n,"").split(a).map(r).filter((function(e){return e.v}))}}(),za=function(){var e=/(\r\n|\n)/g;function t(t){var r=[[],t.v,[]];return t.v?(t.s&&function(e,t,r){var n=[];e.u&&n.push("text-decoration: underline;"),e.uval&&n.push("text-underline-style:"+e.uval+";"),e.sz&&n.push("font-size:"+e.sz+"pt;"),e.outline&&n.push("text-effect: outline;"),e.shadow&&n.push("text-shadow: auto;"),t.push('<span style="'+n.join("")+'">'),e.b&&(t.push("<b>"),r.push("</b>")),e.i&&(t.push("<i>"),r.push("</i>")),e.strike&&(t.push("<s>"),r.push("</s>"));var a=e.valign||"";"superscript"==a||"super"==a?a="sup":"subscript"==a&&(a="sub"),""!=a&&(t.push("<"+a+">"),r.push("</"+a+">")),r.push("</span>")}(t.s,r[0],r[2]),r[0].join("")+r[1].replace(e,"<br/>")+r[2].join("")):""}return function(e){return e.map(t).join("")}}(),ja=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,Ua=/<(?:\w+:)?r>/,$a=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function Va(e,t){var r=!t||t.cellHTML,n={};return e?(e.match(/^\s*<(?:\w+:)?t[^>]*>/)?(n.t=Se(Le(e.slice(e.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")),n.r=Le(e),r&&(n.h=Ie(n.t))):e.match(Ua)&&(n.r=Le(e),n.t=Se(Le((e.replace($a,"").match(ja)||[]).join("").replace(ve,""))),r&&(n.h=za(Ba(n.r)))),n):{t:""}}var qa=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,Wa=/<(?:\w+:)?(?:si|sstItem)>/g,Ha=/<\/(?:\w+:)?(?:si|sstItem)>/;Xr.SST="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings";var Ga=/^\s|\s$|[\t\n\r]/;function Xa(e,t){if(!t.bookSST)return"";var r=[ge];r[r.length]=Qe("sst",null,{xmlns:nt.main[0],count:e.Count,uniqueCount:e.Unique});for(var n=0;n!=e.length;++n)if(null!=e[n]){var a=e[n],i="<si>";a.r?i+=a.r:(i+="<t",a.t||(a.t=""),a.t.match(Ga)&&(i+=' xml:space="preserve"'),i+=">"+Ce(a.t)+"</t>"),i+="</si>",r[r.length]=i}return r.length>2&&(r[r.length]="</sst>",r[1]=r[1].replace("/>",">")),r.join("")}var Ya=function(e,t){var r=!1;return null==t&&(r=!0,t=Bt(15+4*e.t.length)),t.write_shift(1,0),sr(e.t,t),r?t.slice(0,t.l):t};function Za(e){var t=jt();Ut(t,"BrtBeginSst",function(e,t){return t||(t=Bt(8)),t.write_shift(4,e.Count),t.write_shift(4,e.Unique),t}(e));for(var r=0;r<e.length;++r)Ut(t,"BrtSSTItem",Ya(e[r]));return Ut(t,"BrtEndSst"),t.end()}function Ka(e){if("undefined"!=typeof cptable)return cptable.utils.encode(a,e);for(var t=[],r=e.split(""),n=0;n<r.length;++n)t[n]=r[n].charCodeAt(0);return t}function Ja(e,t){var r={};return r.Major=e.read_shift(2),r.Minor=e.read_shift(2),t>=4&&(e.l+=t-4),r}function Qa(e){for(var t=e.read_shift(4),r=e.l+t-4,n={},a=e.read_shift(4),i=[];a-- >0;)i.push({t:e.read_shift(4),v:e.read_shift(0,"lpp4")});if(n.name=e.read_shift(0,"lpp4"),n.comps=i,e.l!=r)throw new Error("Bad DataSpaceMapEntry: "+e.l+" != "+r);return n}function ei(e,t){var r=e.l+t,n={};n.Flags=63&e.read_shift(4),e.l+=4,n.AlgID=e.read_shift(4);var a=!1;switch(n.AlgID){case 26126:case 26127:case 26128:a=36==n.Flags;break;case 26625:a=4==n.Flags;break;case 0:a=16==n.Flags||4==n.Flags||36==n.Flags;break;default:throw"Unrecognized encryption algorithm: "+n.AlgID}if(!a)throw new Error("Encryption Flags/AlgID mismatch");return n.AlgIDHash=e.read_shift(4),n.KeySize=e.read_shift(4),n.ProviderType=e.read_shift(4),e.l+=8,n.CSPName=e.read_shift(r-e.l>>1,"utf16le"),e.l=r,n}function ti(e,t){var r={},n=e.l+t;return e.l+=4,r.Salt=e.slice(e.l,e.l+16),e.l+=16,r.Verifier=e.slice(e.l,e.l+16),e.l+=16,e.read_shift(4),r.VerifierHash=e.slice(e.l,n),e.l=n,r}function ri(e){if(36!=(63&e.read_shift(4)))throw new Error("EncryptionInfo mismatch");var t=e.read_shift(4);return{t:"Std",h:ei(e,t),v:ti(e,e.length-e.l)}}function ni(){throw new Error("File is password-protected: ECMA-376 Extensible")}function ai(e){var t=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];e.l+=4;var r=e.read_shift(e.length-e.l,"utf8"),n={};return r.replace(ve,(function(e){var r=_e(e);switch(we(r[0])){case"<?xml":case"<encryption":case"</encryption>":case"</keyEncryptors>":case"</keyEncryptor>":break;case"<keyData":t.forEach((function(e){n[e]=r[e]}));break;case"<dataIntegrity":n.encryptedHmacKey=r.encryptedHmacKey,n.encryptedHmacValue=r.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":n.encs=[];break;case"<keyEncryptor":n.uri=r.uri;break;case"<encryptedKey":n.encs.push(r);break;default:throw r[0]}})),n}function ii(e){var t,r,n=0,a=Ka(e),i=a.length+1;for((t=x(i))[0]=a.length,r=1;r!=i;++r)t[r]=a[r-1];for(r=i-1;r>=0;--r)n=((0==(16384&n)?0:1)|n<<1&32767)^t[r];return 52811^n}var oi,si,li,ci,ui=(oi=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],si=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],li=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],ci=function(e,t){return 255&((r=e^t)/2|128*r);var r},function(e){for(var t,r,n,a=Ka(e),i=function(e){for(var t=si[e.length-1],r=104,n=e.length-1;n>=0;--n)for(var a=e[n],i=0;7!=i;++i)64&a&&(t^=li[r]),a*=2,--r;return t}(a),o=a.length,s=x(16),l=0;16!=l;++l)s[l]=0;for(1==(1&o)&&(t=i>>8,s[o]=ci(oi[0],t),--o,t=255&i,r=a[a.length-1],s[o]=ci(r,t));o>0;)t=i>>8,s[--o]=ci(a[o],t),t=255&i,s[--o]=ci(a[o],t);for(o=15,n=15-a.length;n>0;)t=i>>8,s[o]=ci(oi[n],t),--n,t=255&i,s[--o]=ci(a[o],t),--o,--n;return s});var fi=function(){function e(e,r){switch(r.type){case"base64":return t(g.decode(e),r);case"binary":return t(e,r);case"buffer":return t(y&&Buffer.isBuffer(e)?e.toString("binary"):D(e),r);case"array":return t(ee(e),r)}throw new Error("Unrecognized type "+r.type)}function t(e,t){var r=(t||{}).dense?[]:{},n=e.match(/\\trowd.*?\\row\b/g);if(!n.length)throw new Error("RTF missing table");var a={s:{c:0,r:0},e:{c:0,r:n.length-1}};return n.forEach((function(e,t){Array.isArray(r)&&(r[t]=[]);for(var n,i=/\\\w+\b/g,o=0,s=-1;n=i.exec(e);){if("\\cell"===n[0]){var l=e.slice(o,i.lastIndex-n[0].length);if(" "==l[0]&&(l=l.slice(1)),++s,l.length){var c={v:l,t:"s"};Array.isArray(r)?r[t][s]=c:r[Kt({r:t,c:s})]=c}}o=i.lastIndex}s>a.e.c&&(a.e.c=s)})),r["!ref"]=Qt(a),r}return{to_workbook:function(t,r){return rr(e(t,r),r)},to_sheet:e,from_sheet:function(e){for(var t,r=["{\\rtf1\\ansi"],n=er(e["!ref"]),a=Array.isArray(e),i=n.s.r;i<=n.e.r;++i){r.push("\\trowd\\trautofit1");for(var o=n.s.c;o<=n.e.c;++o)r.push("\\cellx"+(o+1));for(r.push("\\pard\\intbl"),o=n.s.c;o<=n.e.c;++o){var s=Kt({r:i,c:o});(t=a?(e[i]||[])[o]:e[s])&&(null!=t.v||t.f&&!t.F)&&(r.push(" "+(t.w||(tr(t),t.w))),r.push("\\cell"))}r.push("\\pard\\intbl\\row")}return r.join("")+"}"}}}();function pi(e){for(var t=0,r=1;3!=t;++t)r=256*r+(e[t]>255?255:e[t]<0?0:e[t]);return r.toString(16).toUpperCase().slice(1)}function hi(e,t){if(0===t)return e;var r=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.max(t,r,n),i=Math.min(t,r,n),o=a-i;if(0===o)return[0,0,t];var s,l=0,c=a+i;switch(s=o/(c>1?2-c:c),a){case t:l=((r-n)/o+6)%6;break;case r:l=(n-t)/o+2;break;case n:l=(t-r)/o+4}return[l/6,s,c/2]}(function(e){var t=e.slice("#"===e[0]?1:0).slice(0,6);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}(e));return r[2]=t<0?r[2]*(1+t):1-(1-r[2])*(1-t),pi(function(e){var t,r=e[0],n=e[1],a=e[2],i=2*n*(a<.5?a:1-a),o=a-i/2,s=[o,o,o],l=6*r;if(0!==n)switch(0|l){case 0:case 6:t=i*l,s[0]+=i,s[1]+=t;break;case 1:t=i*(2-l),s[0]+=t,s[1]+=i;break;case 2:t=i*(l-2),s[1]+=i,s[2]+=t;break;case 3:t=i*(4-l),s[1]+=t,s[2]+=i;break;case 4:t=i*(l-4),s[2]+=i,s[0]+=t;break;case 5:t=i*(6-l),s[2]+=t,s[0]+=i}for(var c=0;3!=c;++c)s[c]=Math.round(255*s[c]);return s}(r))}var di=6;function mi(e){return Math.floor((e+Math.round(128/di)/256)*di)}function gi(e){return Math.floor((e-5)/di*100+.5)/100}function yi(e){return Math.round((e*di+5)/di*256)/256}function vi(e){return yi(gi(mi(e)))}function bi(e){var t=Math.abs(e-vi(e)),r=di;if(t>.005)for(di=1;di<15;++di)Math.abs(e-vi(e))<=t&&(t=Math.abs(e-vi(e)),r=di);di=r}function xi(e){e.width?(e.wpx=mi(e.width),e.wch=gi(e.wpx),e.MDW=di):e.wpx?(e.wch=gi(e.wpx),e.width=yi(e.wch),e.MDW=di):"number"==typeof e.wch&&(e.width=yi(e.wch),e.wpx=mi(e.width),e.MDW=di),e.customWidth&&delete e.customWidth}function _i(e){return 96*e/96}function wi(e){return 96*e/96}var ki,Di,Ti,Ai,Si,Mi={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"},Ei=["numFmtId","fillId","fontId","borderId","xfId"],Ci=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"],Ni=(ki=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,Di=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,Ti=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,Ai=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,Si=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/,function(e,t,r){var n,a={};return e?((n=(e=e.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"")).match(ki))&&function(e,t,r){t.NumberFmt=[];for(var n=z(E._table),a=0;a<n.length;++a)t.NumberFmt[n[a]]=E._table[n[a]];var i=e[0].match(ve);if(i)for(a=0;a<i.length;++a){var o=_e(i[a]);switch(we(o[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":case"</numFmt>":break;case"<numFmt":var s=Se(Le(o.formatCode)),l=parseInt(o.numFmtId,10);if(t.NumberFmt[l]=s,l>0){if(l>392){for(l=392;l>60&&null!=t.NumberFmt[l];--l);t.NumberFmt[l]=s}E.load(s,l)}break;default:if(r.WTF)throw new Error("unrecognized "+o[0]+" in numFmts")}}}(n,a,r),(n=e.match(Ai))&&function(e,t,r,n){t.Fonts=[];var a={},i=!1;(e[0].match(ve)||[]).forEach((function(e){var o=_e(e);switch(we(o[0])){case"<fonts":case"<fonts>":case"</fonts>":case"<font":case"<font>":case"<name/>":case"</name>":case"<sz/>":case"</sz>":case"<vertAlign/>":case"</vertAlign>":case"<family/>":case"</family>":case"<scheme/>":case"</scheme>":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"</font>":case"<font/>":t.Fonts.push(a),a={};break;case"<name":o.val&&(a.name=Le(o.val));break;case"<b":a.bold=o.val?Re(o.val):1;break;case"<b/>":a.bold=1;break;case"<i":a.italic=o.val?Re(o.val):1;break;case"<i/>":a.italic=1;break;case"<u":switch(o.val){case"none":a.underline=0;break;case"single":a.underline=1;break;case"double":a.underline=2;break;case"singleAccounting":a.underline=33;break;case"doubleAccounting":a.underline=34}break;case"<u/>":a.underline=1;break;case"<strike":a.strike=o.val?Re(o.val):1;break;case"<strike/>":a.strike=1;break;case"<outline":a.outline=o.val?Re(o.val):1;break;case"<outline/>":a.outline=1;break;case"<shadow":a.shadow=o.val?Re(o.val):1;break;case"<shadow/>":a.shadow=1;break;case"<condense":a.condense=o.val?Re(o.val):1;break;case"<condense/>":a.condense=1;break;case"<extend":a.extend=o.val?Re(o.val):1;break;case"<extend/>":a.extend=1;break;case"<sz":o.val&&(a.sz=+o.val);break;case"<vertAlign":o.val&&(a.vertAlign=o.val);break;case"<family":o.val&&(a.family=parseInt(o.val,10));break;case"<scheme":o.val&&(a.scheme=o.val);break;case"<charset":if("1"==o.val)break;o.codepage=s[parseInt(o.val,10)];break;case"<color":if(a.color||(a.color={}),o.auto&&(a.color.auto=Re(o.auto)),o.rgb)a.color.rgb=o.rgb.slice(-6);else if(o.indexed){a.color.index=parseInt(o.indexed,10);var l=jr[a.color.index];81==a.color.index&&(l=jr[1]),l||(l=jr[1]),a.color.rgb=l[0].toString(16)+l[1].toString(16)+l[2].toString(16)}else o.theme&&(a.color.theme=parseInt(o.theme,10),o.tint&&(a.color.tint=parseFloat(o.tint)),o.theme&&r.themeElements&&r.themeElements.clrScheme&&(a.color.rgb=hi(r.themeElements.clrScheme[a.color.theme].rgb,a.color.tint||0)));break;case"<AlternateContent":case"<ext":i=!0;break;case"</AlternateContent>":case"</ext>":i=!1;break;default:if(n&&n.WTF&&!i)throw new Error("unrecognized "+o[0]+" in fonts")}}))}(n,a,t,r),(n=e.match(Ti))&&function(e,t,r,n){t.Fills=[];var a={},i=!1;(e[0].match(ve)||[]).forEach((function(e){var r=_e(e);switch(we(r[0])){case"<fills":case"<fills>":case"</fills>":case"</fill>":case"<gradientFill>":case"<patternFill/>":case"</patternFill>":case"<bgColor/>":case"</bgColor>":case"<fgColor/>":case"</fgColor>":case"<stop":case"<stop/>":case"</stop>":case"<color":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<fill>":case"<fill":case"<fill/>":a={},t.Fills.push(a);break;case"<gradientFill":case"</gradientFill>":t.Fills.push(a),a={};break;case"<patternFill":case"<patternFill>":r.patternType&&(a.patternType=r.patternType);break;case"<bgColor":a.bgColor||(a.bgColor={}),r.indexed&&(a.bgColor.indexed=parseInt(r.indexed,10)),r.theme&&(a.bgColor.theme=parseInt(r.theme,10)),r.tint&&(a.bgColor.tint=parseFloat(r.tint)),r.rgb&&(a.bgColor.rgb=r.rgb.slice(-6));break;case"<fgColor":a.fgColor||(a.fgColor={}),r.theme&&(a.fgColor.theme=parseInt(r.theme,10)),r.tint&&(a.fgColor.tint=parseFloat(r.tint)),null!=r.rgb&&(a.fgColor.rgb=r.rgb.slice(-6));break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(n&&n.WTF&&!i)throw new Error("unrecognized "+r[0]+" in fills")}}))}(n,a,0,r),(n=e.match(Si))&&function(e,t,r,n){t.Borders=[];var a={},i=!1;(e[0].match(ve)||[]).forEach((function(e){var r=_e(e);switch(we(r[0])){case"<borders":case"<borders>":case"</borders>":case"</border>":case"<left/>":case"<left":case"<left>":case"</left>":case"<right/>":case"<right":case"<right>":case"</right>":case"<top/>":case"<top":case"<top>":case"</top>":case"<bottom/>":case"<bottom":case"<bottom>":case"</bottom>":case"<diagonal":case"<diagonal>":case"<diagonal/>":case"</diagonal>":case"<horizontal":case"<horizontal>":case"<horizontal/>":case"</horizontal>":case"<vertical":case"<vertical>":case"<vertical/>":case"</vertical>":case"<start":case"<start>":case"<start/>":case"</start>":case"<end":case"<end>":case"<end/>":case"</end>":case"<color":case"<color>":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<border":case"<border>":case"<border/>":a={},r.diagonalUp&&(a.diagonalUp=Re(r.diagonalUp)),r.diagonalDown&&(a.diagonalDown=Re(r.diagonalDown)),t.Borders.push(a);break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(n&&n.WTF&&!i)throw new Error("unrecognized "+r[0]+" in borders")}}))}(n,a,0,r),(n=e.match(Di))&&function(e,t,r){var n;t.CellXf=[];var a=!1;(e[0].match(ve)||[]).forEach((function(e){var i=_e(e),o=0;switch(we(i[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":case"</xf>":case"</alignment>":case"<protection":case"</protection>":case"<protection/>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<xf":case"<xf/>":for(delete(n=i)[0],o=0;o<Ei.length;++o)n[Ei[o]]&&(n[Ei[o]]=parseInt(n[Ei[o]],10));for(o=0;o<Ci.length;++o)n[Ci[o]]&&(n[Ci[o]]=Re(n[Ci[o]]));if(t.NumberFmt&&n.numFmtId>392)for(o=392;o>60;--o)if(t.NumberFmt[n.numFmtId]==t.NumberFmt[o]){n.numFmtId=o;break}t.CellXf.push(n);break;case"<alignment":case"<alignment/>":var s={};i.vertical&&(s.vertical=i.vertical),i.horizontal&&(s.horizontal=i.horizontal),null!=i.textRotation&&(s.textRotation=i.textRotation),i.indent&&(s.indent=i.indent),i.wrapText&&(s.wrapText=Re(i.wrapText)),n.alignment=s;break;case"<AlternateContent":case"<ext":a=!0;break;case"</AlternateContent>":case"</ext>":a=!1;break;default:if(r&&r.WTF&&!a)throw new Error("unrecognized "+i[0]+" in cellXfs")}}))}(n,a,r),a):a}),Oi=Qe("styleSheet",null,{xmlns:nt.main[0],"xmlns:vt":nt.vt});function Ii(e,t){var r,n=[ge,Oi];return e.SSF&&null!=(r=function(e){var t=["<numFmts>"];return[[5,8],[23,26],[41,44],[50,392]].forEach((function(r){for(var n=r[0];n<=r[1];++n)null!=e[n]&&(t[t.length]=Qe("numFmt",null,{numFmtId:n,formatCode:Ce(e[n])}))})),1===t.length?"":(t[t.length]="</numFmts>",t[0]=Qe("numFmts",null,{count:t.length-2}).replace("/>",">"),t.join(""))}(e.SSF))&&(n[n.length]=r),n[n.length]='<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>',n[n.length]='<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>',n[n.length]='<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>',n[n.length]='<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>',(r=function(e){var t=[];return t[t.length]=Qe("cellXfs",null),e.forEach((function(e){t[t.length]=Qe("xf",null,e)})),t[t.length]="</cellXfs>",2===t.length?"":(t[0]=Qe("cellXfs",null,{count:t.length-2}).replace("/>",">"),t.join(""))}(t.cellXfs))&&(n[n.length]=r),n[n.length]='<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>',n[n.length]='<dxfs count="0"/>',n[n.length]='<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>',n.length>2&&(n[n.length]="</styleSheet>",n[1]=n[1].replace("/>",">")),n.join("")}function Pi(e,t,r){r||(r=Bt(6+4*t.length)),r.write_shift(2,e),sr(t,r);var n=r.length>r.l?r.slice(0,r.l):r;return null==r.l&&(r.l=r.length),n}Xr.STY="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";var Ri=U(["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"]),Li=Ft;function Fi(e,t){t||(t=Bt(84));var r=Ri[e.patternType];null==r&&(r=40),t.write_shift(4,r);var n=0;if(40!=r)for(Er({auto:1},t),Er({auto:1},t);n<12;++n)t.write_shift(4,0);else{for(;n<4;++n)t.write_shift(4,0);for(;n<12;++n)t.write_shift(4,0)}return t.length>t.l?t.slice(0,t.l):t}function Bi(e,t,r){return r||(r=Bt(16)),r.write_shift(2,t||0),r.write_shift(2,e.numFmtId||0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(1,0),r}function zi(e,t){return t||(t=Bt(10)),t.write_shift(1,0),t.write_shift(1,0),t.write_shift(4,0),t.write_shift(4,0),t}var ji=Ft;function Ui(e,t){var r=jt();return Ut(r,"BrtBeginStyleSheet"),function(e,t){if(t){var r=0;[[5,8],[23,26],[41,44],[50,392]].forEach((function(e){for(var n=e[0];n<=e[1];++n)null!=t[n]&&++r})),0!=r&&(Ut(e,"BrtBeginFmts",ir(r)),[[5,8],[23,26],[41,44],[50,392]].forEach((function(r){for(var n=r[0];n<=r[1];++n)null!=t[n]&&Ut(e,"BrtFmt",Pi(n,t[n]))})),Ut(e,"BrtEndFmts"))}}(r,e.SSF),function(e){Ut(e,"BrtBeginFonts",ir(1)),Ut(e,"BrtFont",function(e,t){t||(t=Bt(153)),t.write_shift(2,20*e.sz),function(e,t){t||(t=Bt(2));var r=(e.italic?2:0)|(e.strike?8:0)|(e.outline?16:0)|(e.shadow?32:0)|(e.condense?64:0)|(e.extend?128:0);t.write_shift(1,r),t.write_shift(1,0)}(e,t),t.write_shift(2,e.bold?700:400);var r=0;"superscript"==e.vertAlign?r=1:"subscript"==e.vertAlign&&(r=2),t.write_shift(2,r),t.write_shift(1,e.underline||0),t.write_shift(1,e.family||0),t.write_shift(1,e.charset||0),t.write_shift(1,0),Er(e.color,t);var n=0;return"major"==e.scheme&&(n=1),"minor"==e.scheme&&(n=2),t.write_shift(1,n),sr(e.name,t),t.length>t.l?t.slice(0,t.l):t}({sz:12,color:{theme:1},name:"Calibri",family:2,scheme:"minor"})),Ut(e,"BrtEndFonts")}(r),function(e){Ut(e,"BrtBeginFills",ir(2)),Ut(e,"BrtFill",Fi({patternType:"none"})),Ut(e,"BrtFill",Fi({patternType:"gray125"})),Ut(e,"BrtEndFills")}(r),function(e){Ut(e,"BrtBeginBorders",ir(1)),Ut(e,"BrtBorder",function(e,t){return t||(t=Bt(51)),t.write_shift(1,0),zi(0,t),zi(0,t),zi(0,t),zi(0,t),zi(0,t),t.length>t.l?t.slice(0,t.l):t}()),Ut(e,"BrtEndBorders")}(r),function(e){Ut(e,"BrtBeginCellStyleXFs",ir(1)),Ut(e,"BrtXF",Bi({numFmtId:0,fontId:0,fillId:0,borderId:0},65535)),Ut(e,"BrtEndCellStyleXFs")}(r),function(e,t){Ut(e,"BrtBeginCellXFs",ir(t.length)),t.forEach((function(t){Ut(e,"BrtXF",Bi(t,0))})),Ut(e,"BrtEndCellXFs")}(r,t.cellXfs),function(e){Ut(e,"BrtBeginStyles",ir(1)),Ut(e,"BrtStyle",function(e,t){return t||(t=Bt(52)),t.write_shift(4,e.xfId),t.write_shift(2,1),t.write_shift(1,+e.builtinId),t.write_shift(1,0),vr(e.name||"",t),t.length>t.l?t.slice(0,t.l):t}({xfId:0,builtinId:0,name:"Normal"})),Ut(e,"BrtEndStyles")}(r),function(e){Ut(e,"BrtBeginDXFs",ir(0)),Ut(e,"BrtEndDXFs")}(r),function(e){Ut(e,"BrtBeginTableStyles",function(e,t,r){var n=Bt(2052);return n.write_shift(4,0),vr("TableStyleMedium9",n),vr("PivotStyleMedium4",n),n.length>n.l?n.slice(0,n.l):n}()),Ut(e,"BrtEndTableStyles")}(r),Ut(r,"BrtEndStyleSheet"),r.end()}Xr.THEME="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";var $i=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];function Vi(e,t,r){t.themeElements.clrScheme=[];var n={};(e[0].match(ve)||[]).forEach((function(e){var a=_e(e);switch(a[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":n.rgb=a.val;break;case"<a:sysClr":n.rgb=a.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":"/"===a[0].charAt(1)?(t.themeElements.clrScheme[$i.indexOf(a[0])]=n,n={}):n.name=a[0].slice(3,a[0].length-1);break;default:if(r&&r.WTF)throw new Error("Unrecognized "+a[0]+" in clrScheme")}}))}function qi(){}function Wi(){}var Hi=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,Gi=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,Xi=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/,Yi=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function Zi(e,t){if(!e||0===e.length)return Zi(Ki());var r,n={};if(!(r=e.match(Yi)))throw new Error("themeElements not found in theme");return function(e,t,r){var n;t.themeElements={},[["clrScheme",Hi,Vi],["fontScheme",Gi,qi],["fmtScheme",Xi,Wi]].forEach((function(a){if(!(n=e.match(a[1])))throw new Error(a[0]+" not found in themeElements");a[2](n,t,r)}))}(r[0],n,t),n.raw=e,n}function Ki(e,t){if(t&&t.themeXLSX)return t.themeXLSX;if(e&&"string"==typeof e.raw)return e.raw;var r=[ge];return r[r.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',r[r.length]="<a:themeElements>",r[r.length]='<a:clrScheme name="Office">',r[r.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',r[r.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',r[r.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',r[r.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',r[r.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',r[r.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',r[r.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',r[r.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',r[r.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',r[r.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',r[r.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',r[r.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',r[r.length]="</a:clrScheme>",r[r.length]='<a:fontScheme name="Office">',r[r.length]="<a:majorFont>",r[r.length]='<a:latin typeface="Cambria"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Times New Roman"/>',r[r.length]='<a:font script="Hebr" typeface="Times New Roman"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="MoolBoran"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Times New Roman"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:majorFont>",r[r.length]="<a:minorFont>",r[r.length]='<a:latin typeface="Calibri"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Arial"/>',r[r.length]='<a:font script="Hebr" typeface="Arial"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="DaunPenh"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Arial"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:minorFont>",r[r.length]="</a:fontScheme>",r[r.length]='<a:fmtScheme name="Office">',r[r.length]="<a:fillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="1"/>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="0"/>',r[r.length]="</a:gradFill>",r[r.length]="</a:fillStyleLst>",r[r.length]="<a:lnStyleLst>",r[r.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]="</a:lnStyleLst>",r[r.length]="<a:effectStyleLst>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',r[r.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',r[r.length]="</a:effectStyle>",r[r.length]="</a:effectStyleLst>",r[r.length]="<a:bgFillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]="</a:bgFillStyleLst>",r[r.length]="</a:fmtScheme>",r[r.length]="</a:themeElements>",r[r.length]="<a:objectDefaults>",r[r.length]="<a:spDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',r[r.length]="</a:spDef>",r[r.length]="<a:lnDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',r[r.length]="</a:lnDef>",r[r.length]="</a:objectDefaults>",r[r.length]="<a:extraClrSchemeLst/>",r[r.length]="</a:theme>",r.join("")}function Ji(e){var t=e.read_shift(2),r=e.read_shift(2)-4,n=[t];switch(t){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:n[1]=function(e){var t={};switch(t.xclrType=e.read_shift(2),t.nTintShade=e.read_shift(2),t.xclrType){case 0:case 4:e.l+=4;break;case 1:t.xclrValue=function(e,t){return Ft(e,4)}(e);break;case 2:t.xclrValue=Kn(e);break;case 3:t.xclrValue=function(e){return e.read_shift(4)}(e)}return e.l+=8,t}(e);break;case 6:n[1]=function(e,t){return Ft(e,t)}(e,r);break;case 14:case 15:n[1]=e.read_shift(1===r?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+t+" "+r)}return n}Xr.IMG="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Xr.DRAW="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing";var Qi=1024;function eo(e,t){for(var r=[21600,21600],n=["m0,0l0",r[1],r[0],r[1],r[0],"0xe"].join(","),a=[Qe("xml",null,{"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":at,"xmlns:x":it,"xmlns:mv":"http://macVmlSchemaUri"}).replace(/\/>/,">"),Qe("o:shapelayout",Qe("o:idmap",null,{"v:ext":"edit",data:e}),{"v:ext":"edit"}),Qe("v:shapetype",[Qe("v:stroke",null,{joinstyle:"miter"}),Qe("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:r.join(","),path:n})];Qi<1e3*e;)Qi+=1e3;return t.forEach((function(e){var t=Zt(e[0]),r={color2:"#BEFF82",type:"gradient"};"gradient"==r.type&&(r.angle="-180");var n="gradient"==r.type?Qe("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}):null,i=Qe("v:fill",n,r);++Qi,a=a.concat(["<v:shape"+Je({id:"_x0000_s"+Qi,type:"#_x0000_t202",style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10"+(e[1].hidden?";visibility:hidden":""),fillcolor:"#ECFAD4",strokecolor:"#edeaa1"})+">",i,Qe("v:shadow",null,{on:"t",obscured:"t"}),Qe("v:path",null,{"o:connecttype":"none"}),'<v:textbox><div style="text-align:left"></div></v:textbox>','<x:ClientData ObjectType="Note">',"<x:MoveWithCells/>","<x:SizeWithCells/>",Ke("x:Anchor",[t.c+1,0,t.r+1,0,t.c+3,20,t.r+5,20].join(",")),Ke("x:AutoFill","False"),Ke("x:Row",String(t.r)),Ke("x:Column",String(t.c)),e[1].hidden?"":"<x:Visible/>","</x:ClientData>","</v:shape>"])})),a.push("</xml>"),a.join("")}Xr.CMNT="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";var to=Qe("comments",null,{xmlns:nt.main[0]});function ro(e){var t=[ge,to],r=[];return t.push("<authors>"),e.forEach((function(e){e[1].forEach((function(e){var n=Ce(e.a);r.indexOf(n)>-1||(r.push(n),t.push("<author>"+n+"</author>"))}))})),t.push("</authors>"),t.push("<commentList>"),e.forEach((function(e){e[1].forEach((function(n){t.push('<comment ref="'+e[0]+'" authorId="'+r.indexOf(Ce(n.a))+'"><text>'),t.push(Ke("t",null==n.t?"":Ce(n.t))),t.push("</text></comment>")}))})),t.push("</commentList>"),t.length>2&&(t[t.length]="</comments>",t[1]=t[1].replace("/>",">")),t.join("")}var no=or;function ao(e){var t=jt(),r=[];return Ut(t,"BrtBeginComments"),Ut(t,"BrtBeginCommentAuthors"),e.forEach((function(e){e[1].forEach((function(e){r.indexOf(e.a)>-1||(r.push(e.a.slice(0,54)),Ut(t,"BrtCommentAuthor",function(e){return sr(e.slice(0,54))}(e.a)))}))})),Ut(t,"BrtEndCommentAuthors"),Ut(t,"BrtBeginCommentList"),e.forEach((function(e){e[1].forEach((function(n){n.iauthor=r.indexOf(n.a);var a={s:Zt(e[0]),e:Zt(e[0])};Ut(t,"BrtBeginComment",function(e,t){return null==t&&(t=Bt(36)),t.write_shift(4,e[1].iauthor),Ar(e[0],t),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t}([a,n])),n.t&&n.t.length>0&&Ut(t,"BrtCommentText",function(e,t){var r=!1;return null==t&&(r=!0,t=Bt(23+4*e.t.length)),t.write_shift(1,1),sr(e.t,t),t.write_shift(4,1),function(e,t){t||(t=Bt(4)),t.write_shift(2,e.ich||0),t.write_shift(2,e.ifnt||0)}({ich:0,ifnt:0},t),r?t.slice(0,t.l):t}(n)),Ut(t,"BrtEndComment"),delete n.iauthor}))})),Ut(t,"BrtEndCommentList"),Ut(t,"BrtEndComments"),t.end()}var io=["xlsb","xlsm","xlam","biff8","xla"];Xr.DS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",Xr.MS="http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet";var oo=function(){var e=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,t={r:0,c:0};function r(e,r,n,a){var i=!1,o=!1;0==n.length?o=!0:"["==n.charAt(0)&&(o=!0,n=n.slice(1,-1)),0==a.length?i=!0:"["==a.charAt(0)&&(i=!0,a=a.slice(1,-1));var s=n.length>0?0|parseInt(n,10):0,l=a.length>0?0|parseInt(a,10):0;return i?l+=t.c:--l,o?s+=t.r:--s,r+(i?"":"$")+Yt(l)+(o?"":"$")+Gt(s)}return function(n,a){return t=a,n.replace(e,r)}}(),so=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,lo=function(e,t){return e.replace(so,(function(e,r,n,a,i,o){var s=Xt(a)-(n?0:t.c),l=Ht(o)-(i?0:t.r);return r+"R"+(0==l?"":i?l+1:"["+l+"]")+"C"+(0==s?"":n?s+1:"["+s+"]")}))};function co(e,t){return e.replace(so,(function(e,r,n,a,i,o){return r+("$"==n?n+a:Yt(Xt(a)+t.c))+("$"==i?i+o:Gt(Ht(o)+t.r))}))}function uo(e,t,r){var n=Jt(t).s,a=Zt(r);return co(e,{r:a.r-n.r,c:a.c-n.c})}function fo(e){return e.replace(/_xlfn\./g,"")}function po(e){e.l+=1}function ho(e,t){var r=e.read_shift(1==t?1:2);return[16383&r,r>>14&1,r>>15&1]}function mo(e,t,r){var n=2;if(r){if(r.biff>=2&&r.biff<=5)return go(e);12==r.biff&&(n=4)}var a=e.read_shift(n),i=e.read_shift(n),o=ho(e,2),s=ho(e,2);return{s:{r:a,c:o[0],cRel:o[1],rRel:o[2]},e:{r:i,c:s[0],cRel:s[1],rRel:s[2]}}}function go(e){var t=ho(e,2),r=ho(e,2),n=e.read_shift(1),a=e.read_shift(1);return{s:{r:t[0],c:n,cRel:t[1],rRel:t[2]},e:{r:r[0],c:a,cRel:r[1],rRel:r[2]}}}function yo(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return function(e){var t=ho(e,2),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}(e);var n=e.read_shift(r&&12==r.biff?4:2),a=ho(e,2);return{r:n,c:a[0],cRel:a[1],rRel:a[2]}}function vo(e){var t=e.read_shift(2),r=e.read_shift(2);return{r:t,c:255&r,fQuoted:!!(16384&r),cRel:r>>15,rRel:r>>15}}function bo(e){return[e.read_shift(1),e.read_shift(1)]}function xo(e,t){var r=[e.read_shift(1)];if(12==t)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2}switch(r[0]){case 4:r[1]=Rn(e,1)?"TRUE":"FALSE",12!=t&&(e.l+=7);break;case 37:case 16:r[1]=Ur[e[e.l]],e.l+=12==t?4:8;break;case 0:e.l+=8;break;case 1:r[1]=Sr(e);break;case 2:r[1]=Hn(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function _o(e,t,r){for(var n=e.read_shift(12==r.biff?4:2),a=[],i=0;i!=n;++i)a.push((12==r.biff?Tr:na)(e,8));return a}function wo(e,t,r){var n=0,a=0;12==r.biff?(n=e.read_shift(4),a=e.read_shift(4)):(a=1+e.read_shift(1),n=1+e.read_shift(2)),r.biff>=2&&r.biff<8&&(--n,0==--a&&(a=256));for(var i=0,o=[];i!=n&&(o[i]=[]);++i)for(var s=0;s!=a;++s)o[i][s]=xo(e,r.biff);return o}function ko(e,t,r){return e.l+=2,[vo(e)]}function Do(e){return e.l+=6,[]}var To=ko,Ao=Do,So=Do,Mo=ko;function Eo(e){return e.l+=2,[Fn(e),1&e.read_shift(2)]}var Co=ko,No=Eo,Oo=Do,Io=ko,Po=ko,Ro=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"],Lo={1:{n:"PtgExp",f:function(e,t,r){return e.l++,r&&12==r.biff?[e.read_shift(4,"i"),0]:[e.read_shift(2),e.read_shift(r&&2==r.biff?1:2)]}},2:{n:"PtgTbl",f:Ft},3:{n:"PtgAdd",f:po},4:{n:"PtgSub",f:po},5:{n:"PtgMul",f:po},6:{n:"PtgDiv",f:po},7:{n:"PtgPower",f:po},8:{n:"PtgConcat",f:po},9:{n:"PtgLt",f:po},10:{n:"PtgLe",f:po},11:{n:"PtgEq",f:po},12:{n:"PtgGe",f:po},13:{n:"PtgGt",f:po},14:{n:"PtgNe",f:po},15:{n:"PtgIsect",f:po},16:{n:"PtgUnion",f:po},17:{n:"PtgRange",f:po},18:{n:"PtgUplus",f:po},19:{n:"PtgUminus",f:po},20:{n:"PtgPercent",f:po},21:{n:"PtgParen",f:po},22:{n:"PtgMissArg",f:po},23:{n:"PtgStr",f:function(e,t,r){return e.l++,Un(e,0,r)}},26:{n:"PtgSheet",f:function(e,t,r){return e.l+=5,e.l+=2,e.l+=2==r.biff?1:4,["PTGSHEET"]}},27:{n:"PtgEndSheet",f:function(e,t,r){return e.l+=2==r.biff?4:5,["PTGENDSHEET"]}},28:{n:"PtgErr",f:function(e){return e.l++,Ur[e.read_shift(1)]}},29:{n:"PtgBool",f:function(e){return e.l++,0!==e.read_shift(1)}},30:{n:"PtgInt",f:function(e){return e.l++,e.read_shift(2)}},31:{n:"PtgNum",f:function(e){return e.l++,Sr(e)}},32:{n:"PtgArray",f:function(e,t,r){var n=(96&e[e.l++])>>5;return e.l+=2==r.biff?6:12==r.biff?14:7,[n]}},33:{n:"PtgFunc",f:function(e,t,r){var n=(96&e[e.l])>>5;e.l+=1;var a=e.read_shift(r&&r.biff<=3?1:2);return[as[a],ns[a],n]}},34:{n:"PtgFuncVar",f:function(e,t,r){var n=e[e.l++],a=e.read_shift(1),i=r&&r.biff<=3?[88==n?-1:0,e.read_shift(1)]:function(e){return[e[e.l+1]>>7,32767&e.read_shift(2)]}(e);return[a,(0===i[0]?ns:rs)[i[1]]]}},35:{n:"PtgName",f:function(e,t,r){var n=e.read_shift(1)>>>5&3,a=!r||r.biff>=8?4:2,i=e.read_shift(a);switch(r.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12}return[n,0,i]}},36:{n:"PtgRef",f:function(e,t,r){var n=(96&e[e.l])>>5;return e.l+=1,[n,yo(e,0,r)]}},37:{n:"PtgArea",f:function(e,t,r){return[(96&e[e.l++])>>5,mo(e,r.biff>=2&&r.biff,r)]}},38:{n:"PtgMemArea",f:function(e,t,r){var n=e.read_shift(1)>>>5&3;return e.l+=r&&2==r.biff?3:4,[n,e.read_shift(r&&2==r.biff?1:2)]}},39:{n:"PtgMemErr",f:Ft},40:{n:"PtgMemNoMem",f:Ft},41:{n:"PtgMemFunc",f:function(e,t,r){return[e.read_shift(1)>>>5&3,e.read_shift(r&&2==r.biff?1:2)]}},42:{n:"PtgRefErr",f:function(e,t,r){var n=e.read_shift(1)>>>5&3;return e.l+=4,r.biff<8&&e.l--,12==r.biff&&(e.l+=2),[n]}},43:{n:"PtgAreaErr",f:function(e,t,r){var n=(96&e[e.l++])>>5;return e.l+=r&&r.biff>8?12:r.biff<8?6:8,[n]}},44:{n:"PtgRefN",f:function(e,t,r){var n=(96&e[e.l])>>5;e.l+=1;var a=function(e,t,r){var n=r&&r.biff?r.biff:8;if(n>=2&&n<=5)return function(e){var t=e.read_shift(2),r=e.read_shift(1),n=(32768&t)>>15,a=(16384&t)>>14;return t&=16383,1==n&&t>=8192&&(t-=16384),1==a&&r>=128&&(r-=256),{r:t,c:r,cRel:a,rRel:n}}(e);var a=e.read_shift(n>=12?4:2),i=e.read_shift(2),o=(16384&i)>>14,s=(32768&i)>>15;if(i&=16383,1==s)for(;a>524287;)a-=1048576;if(1==o)for(;i>8191;)i-=16384;return{r:a,c:i,cRel:o,rRel:s}}(e,0,r);return[n,a]}},45:{n:"PtgAreaN",f:function(e,t,r){var n=(96&e[e.l++])>>5,a=function(e,t,r){if(r.biff<8)return go(e);var n=e.read_shift(12==r.biff?4:2),a=e.read_shift(12==r.biff?4:2),i=ho(e,2),o=ho(e,2);return{s:{r:n,c:i[0],cRel:i[1],rRel:i[2]},e:{r:a,c:o[0],cRel:o[1],rRel:o[2]}}}(e,0,r);return[n,a]}},46:{n:"PtgMemAreaN",f:function(e){return[e.read_shift(1)>>>5&3,e.read_shift(2)]}},47:{n:"PtgMemNoMemN",f:function(e){return[e.read_shift(1)>>>5&3,e.read_shift(2)]}},57:{n:"PtgNameX",f:function(e,t,r){return 5==r.biff?function(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2,"i");e.l+=8;var n=e.read_shift(2);return e.l+=12,[t,r,n]}(e):[e.read_shift(1)>>>5&3,e.read_shift(2),e.read_shift(4)]}},58:{n:"PtgRef3d",f:function(e,t,r){var n=(96&e[e.l])>>5;e.l+=1;var a=e.read_shift(2);return r&&5==r.biff&&(e.l+=12),[n,a,yo(e,0,r)]}},59:{n:"PtgArea3d",f:function(e,t,r){var n=(96&e[e.l++])>>5,a=e.read_shift(2,"i");if(r&&5===r.biff)e.l+=12;return[n,a,mo(e,0,r)]}},60:{n:"PtgRefErr3d",f:function(e,t,r){var n=(96&e[e.l++])>>5,a=e.read_shift(2),i=4;if(r)switch(r.biff){case 5:i=15;break;case 12:i=6}return e.l+=i,[n,a]}},61:{n:"PtgAreaErr3d",f:function(e,t,r){var n=(96&e[e.l++])>>5,a=e.read_shift(2),i=8;if(r)switch(r.biff){case 5:e.l+=12,i=6;break;case 12:i=12}return e.l+=i,[n,a]}},255:{}},Fo={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61};!function(){for(var e in Fo)Lo[e]=Lo[Fo[e]]}();var Bo={1:{n:"PtgElfLel",f:Eo},2:{n:"PtgElfRw",f:Io},3:{n:"PtgElfCol",f:To},6:{n:"PtgElfRwV",f:Po},7:{n:"PtgElfColV",f:Mo},10:{n:"PtgElfRadical",f:Co},11:{n:"PtgElfRadicalS",f:Oo},13:{n:"PtgElfColS",f:Ao},15:{n:"PtgElfColSV",f:So},16:{n:"PtgElfRadicalLel",f:No},25:{n:"PtgList",f:function(e){e.l+=2;var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(4),a=e.read_shift(2),i=e.read_shift(2);return{ixti:t,coltype:3&r,rt:Ro[r>>2&31],idx:n,c:a,C:i}}},29:{n:"PtgSxName",f:function(e){return e.l+=2,[e.read_shift(4)]}},255:{}},zo={0:{n:"PtgAttrNoop",f:function(e){return e.l+=4,[0,0]}},1:{n:"PtgAttrSemi",f:function(e,t,r){var n=255&e[e.l+1]?1:0;return e.l+=r&&2==r.biff?3:4,[n]}},2:{n:"PtgAttrIf",f:function(e,t,r){var n=255&e[e.l+1]?1:0;return e.l+=2,[n,e.read_shift(r&&2==r.biff?1:2)]}},4:{n:"PtgAttrChoose",f:function(e,t,r){e.l+=2;for(var n=e.read_shift(r&&2==r.biff?1:2),a=[],i=0;i<=n;++i)a.push(e.read_shift(r&&2==r.biff?1:2));return a}},8:{n:"PtgAttrGoto",f:function(e,t,r){var n=255&e[e.l+1]?1:0;return e.l+=2,[n,e.read_shift(r&&2==r.biff?1:2)]}},16:{n:"PtgAttrSum",f:function(e,t,r){e.l+=r&&2==r.biff?3:4}},32:{n:"PtgAttrBaxcel",f:function(e){var t=1&e[e.l+1];return e.l+=4,[t,1]}},64:{n:"PtgAttrSpace",f:function(e){return e.read_shift(2),bo(e)}},65:{n:"PtgAttrSpaceSemi",f:function(e){return e.read_shift(2),bo(e)}},128:{n:"PtgAttrIfError",f:function(e){var t=255&e[e.l+1]?1:0;return e.l+=2,[t,e.read_shift(2)]}},255:{}};function jo(e,t,r,n){if(n.biff<8)return Ft(e,t);for(var a=e.l+t,i=[],o=0;o!==r.length;++o)switch(r[o][0]){case"PtgArray":r[o][1]=wo(e,0,n),i.push(r[o][1]);break;case"PtgMemArea":r[o][2]=_o(e,r[o][1],n),i.push(r[o][2]);break;case"PtgExp":n&&12==n.biff&&(r[o][1][1]=e.read_shift(4),i.push(r[o][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[o][0]}return 0!=(t=a-e.l)&&i.push(Ft(e,t)),i}function Uo(e,t,r){for(var n,a,i=e.l+t,o=[];i!=e.l;)t=i-e.l,a=e[e.l],n=Lo[a],24!==a&&25!==a||(n=(24===a?Bo:zo)[e[e.l+1]]),n&&n.f?o.push([n.n,n.f(e,t,r)]):Ft(e,t);return o}function $o(e){for(var t=[],r=0;r<e.length;++r){for(var n=e[r],a=[],i=0;i<n.length;++i){var o=n[i];o?2===o[0]?a.push('"'+o[1].replace(/"/g,'""')+'"'):a.push(o[1]):a.push("")}t.push(a.join(","))}return t.join(";")}zo[33]=zo[32];var Vo={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"},qo=new RegExp(/[^\w\u4E00-\u9FFF\u3040-\u30FF]/);function Wo(e,t,r){if(!e)return"SH33TJSERR0";if(r.biff>8&&(!e.XTI||!e.XTI[t]))return e.SheetNames[t];if(!e.XTI)return"SH33TJSERR6";var n=e.XTI[t];if(r.biff<8)return t>1e4&&(t-=65536),t<0&&(t=-t),0==t?"":e.XTI[t-1];if(!n)return"SH33TJSERR1";var a="";if(r.biff>8)switch(e[n[0]][0]){case 357:return a=-1==n[1]?"#REF":e.SheetNames[n[1]],n[1]==n[2]?a:a+":"+e.SheetNames[n[2]];case 358:return null!=r.SID?e.SheetNames[r.SID]:"SH33TJSSAME"+e[n[0]][0];default:return"SH33TJSSRC"+e[n[0]][0]}switch(e[n[0]][0][0]){case 1025:return a=-1==n[1]?"#REF":e.SheetNames[n[1]]||"SH33TJSERR3",n[1]==n[2]?a:a+":"+e.SheetNames[n[2]];case 14849:return e[n[0]].slice(1).map((function(e){return e.Name})).join(";;");default:return e[n[0]][0][3]?(a=-1==n[1]?"#REF":e[n[0]][0][3][n[1]]||"SH33TJSERR4",n[1]==n[2]?a:a+":"+e[n[0]][0][3][n[2]]):"SH33TJSERR2"}}function Ho(e,t,r){var n=Wo(e,t,r);return"#REF"==n?n:function(e,t){if(!(e||t&&t.biff<=5&&t.biff>=2))throw new Error("empty sheet name");return qo.test(e)?"'"+e+"'":e}(n,r)}function Go(e,t,r,n,a){var i,o,s,l,c=a&&a.biff||8,u={s:{c:0,r:0},e:{c:0,r:0}},f=[],p=0,h=0,d="";if(!e[0]||!e[0][0])return"";for(var m=-1,g="",y=0,v=e[0].length;y<v;++y){var b=e[0][y];switch(b[0]){case"PtgUminus":f.push("-"+f.pop());break;case"PtgUplus":f.push("+"+f.pop());break;case"PtgPercent":f.push(f.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(i=f.pop(),o=f.pop(),m>=0){switch(e[0][m][1][0]){case 0:g=re(" ",e[0][m][1][1]);break;case 1:g=re("\r",e[0][m][1][1]);break;default:if(g="",a.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][m][1][0])}o+=g,m=-1}f.push(o+Vo[b[0]]+i);break;case"PtgIsect":i=f.pop(),o=f.pop(),f.push(o+" "+i);break;case"PtgUnion":i=f.pop(),o=f.pop(),f.push(o+","+i);break;case"PtgRange":i=f.pop(),o=f.pop(),f.push(o+":"+i);break;case"PtgAttrChoose":case"PtgAttrGoto":case"PtgAttrIf":case"PtgAttrIfError":case"PtgAttrBaxcel":case"PtgAttrSemi":case"PtgMemArea":case"PtgTbl":case"PtgMemErr":case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":case"PtgMemFunc":case"PtgMemNoMem":break;case"PtgRef":s=$t(b[1][1],u,a),f.push(qt(s,c));break;case"PtgRefN":s=r?$t(b[1][1],r,a):b[1][1],f.push(qt(s,c));break;case"PtgRef3d":p=b[1][1],s=$t(b[1][2],u,a),d=Ho(n,p,a),f.push(d+"!"+qt(s,c));break;case"PtgFunc":case"PtgFuncVar":var x=b[1][0],_=b[1][1];x||(x=0);var w=0==(x&=127)?[]:f.slice(-x);f.length-=x,"User"===_&&(_=w.shift()),f.push(_+"("+w.join(",")+")");break;case"PtgBool":f.push(b[1]?"TRUE":"FALSE");break;case"PtgInt":case"PtgErr":f.push(b[1]);break;case"PtgNum":f.push(String(b[1]));break;case"PtgStr":f.push('"'+b[1].replace(/"/g,'""')+'"');break;case"PtgAreaN":l=Vt(b[1][1],r?{s:r}:u,a),f.push(Wt(l,a));break;case"PtgArea":l=Vt(b[1][1],u,a),f.push(Wt(l,a));break;case"PtgArea3d":p=b[1][1],l=b[1][2],d=Ho(n,p,a),f.push(d+"!"+Wt(l,a));break;case"PtgAttrSum":f.push("SUM("+f.pop()+")");break;case"PtgName":h=b[1][2];var k=(n.names||[])[h-1]||(n[0]||[])[h],D=k?k.Name:"SH33TJSNAME"+String(h);D in is&&(D=is[D]),f.push(D);break;case"PtgNameX":var T,A=b[1][1];if(h=b[1][2],!(a.biff<=5)){var S="";if(14849==((n[A]||[])[0]||[])[0]||(1025==((n[A]||[])[0]||[])[0]?n[A][h]&&n[A][h].itab>0&&(S=n.SheetNames[n[A][h].itab-1]+"!"):S=n.SheetNames[h-1]+"!"),n[A]&&n[A][h])S+=n[A][h].Name;else if(n[0]&&n[0][h])S+=n[0][h].Name;else{var M=(Wo(n,A,a)||"").split(";;");M[h-1]?S=M[h-1]:S+="SH33TJSERRX"}f.push(S);break}A<0&&(A=-A),n[A]&&(T=n[A][h]),T||(T={Name:"SH33TJSERRY"}),f.push(T.Name);break;case"PtgParen":var E="(",C=")";if(m>=0){switch(g="",e[0][m][1][0]){case 2:E=re(" ",e[0][m][1][1])+E;break;case 3:E=re("\r",e[0][m][1][1])+E;break;case 4:C=re(" ",e[0][m][1][1])+C;break;case 5:C=re("\r",e[0][m][1][1])+C;break;default:if(a.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][m][1][0])}m=-1}f.push(E+f.pop()+C);break;case"PtgRefErr":case"PtgRefErr3d":case"PtgAreaErr":case"PtgAreaErr3d":f.push("#REF!");break;case"PtgExp":s={c:b[1][1],r:b[1][0]};var N={c:r.c,r:r.r};if(n.sharedf[Kt(s)]){var O=n.sharedf[Kt(s)];f.push(Go(O,0,N,n,a))}else{var I=!1;for(i=0;i!=n.arrayf.length;++i)if(o=n.arrayf[i],!(s.c<o[0].s.c||s.c>o[0].e.c||s.r<o[0].s.r||s.r>o[0].e.r)){f.push(Go(o[1],0,N,n,a)),I=!0;break}I||f.push(b[1])}break;case"PtgArray":f.push("{"+$o(b[1])+"}");break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":m=y;break;case"PtgMissArg":f.push("");break;case"PtgList":f.push("Table"+b[1].idx+"[#"+b[1].rt+"]");break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");default:throw new Error("Unrecognized Formula Token: "+String(b))}if(3!=a.biff&&m>=0&&-1==["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"].indexOf(e[0][y][0])){var P=!0;switch((b=e[0][m])[1][0]){case 4:P=!1;case 0:g=re(" ",b[1][1]);break;case 5:P=!1;case 1:g=re("\r",b[1][1]);break;default:if(g="",a.WTF)throw new Error("Unexpected PtgAttrSpaceType "+b[1][0])}f.push((P?g:"")+f.pop()+(P?"":g)),m=-1}}if(f.length>1&&a.WTF)throw new Error("bad formula stack");return f[0]}function Xo(e,t,r){var n,a=e.l+t,i=2==r.biff?1:2,o=e.read_shift(i);if(65535==o)return[[],Ft(e,t-2)];var s=Uo(e,o,r);return t!==o+i&&(n=jo(e,t-o-i,s,r)),e.l=a,[s,n]}function Yo(e,t,r){var n,a=e.l+t,i=e.read_shift(2),o=Uo(e,i,r);return 65535==i?[[],Ft(e,t-2)]:(t!==i+2&&(n=jo(e,a-i-2,o,r)),[o,n])}function Zo(e,t,r){var n=e.l+t,a=Qn(e);2==r.biff&&++e.l;var i=function(e){var t;if(65535!==St(e,e.l+6))return[Sr(e),"n"];switch(e[e.l]){case 0:return e.l+=8,["String","s"];case 1:return t=1===e[e.l+2],e.l+=8,[t,"b"];case 2:return t=e[e.l+2],e.l+=8,[t,"e"];case 3:return e.l+=8,["","s"]}return[]}(e),o=e.read_shift(1);2!=r.biff&&(e.read_shift(1),r.biff>=5&&e.read_shift(4));var s=function(e,t,r){var n,a=e.l+t,i=2==r.biff?1:2,o=e.read_shift(i);if(65535==o)return[[],Ft(e,t-2)];var s=Uo(e,o,r);return t!==o+i&&(n=jo(e,t-o-i,s,r)),e.l=a,[s,n]}(e,n-e.l,r);return{cell:a,val:i[0],formula:s,shared:o>>3&1,tt:i[1]}}function Ko(e,t,r){var n=e.read_shift(4),a=Uo(e,n,r),i=e.read_shift(4);return[a,i>0?jo(e,i,a,r):null]}var Jo=Ko,Qo=Ko,es=Ko,ts=Ko,rs={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},ns={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},as={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0},is={"_xlfn.ACOT":"ACOT","_xlfn.ACOTH":"ACOTH","_xlfn.AGGREGATE":"AGGREGATE","_xlfn.ARABIC":"ARABIC","_xlfn.AVERAGEIF":"AVERAGEIF","_xlfn.AVERAGEIFS":"AVERAGEIFS","_xlfn.BASE":"BASE","_xlfn.BETA.DIST":"BETA.DIST","_xlfn.BETA.INV":"BETA.INV","_xlfn.BINOM.DIST":"BINOM.DIST","_xlfn.BINOM.DIST.RANGE":"BINOM.DIST.RANGE","_xlfn.BINOM.INV":"BINOM.INV","_xlfn.BITAND":"BITAND","_xlfn.BITLSHIFT":"BITLSHIFT","_xlfn.BITOR":"BITOR","_xlfn.BITRSHIFT":"BITRSHIFT","_xlfn.BITXOR":"BITXOR","_xlfn.CEILING.MATH":"CEILING.MATH","_xlfn.CEILING.PRECISE":"CEILING.PRECISE","_xlfn.CHISQ.DIST":"CHISQ.DIST","_xlfn.CHISQ.DIST.RT":"CHISQ.DIST.RT","_xlfn.CHISQ.INV":"CHISQ.INV","_xlfn.CHISQ.INV.RT":"CHISQ.INV.RT","_xlfn.CHISQ.TEST":"CHISQ.TEST","_xlfn.COMBINA":"COMBINA","_xlfn.CONCAT":"CONCAT","_xlfn.CONFIDENCE.NORM":"CONFIDENCE.NORM","_xlfn.CONFIDENCE.T":"CONFIDENCE.T","_xlfn.COT":"COT","_xlfn.COTH":"COTH","_xlfn.COUNTIFS":"COUNTIFS","_xlfn.COVARIANCE.P":"COVARIANCE.P","_xlfn.COVARIANCE.S":"COVARIANCE.S","_xlfn.CSC":"CSC","_xlfn.CSCH":"CSCH","_xlfn.DAYS":"DAYS","_xlfn.DECIMAL":"DECIMAL","_xlfn.ECMA.CEILING":"ECMA.CEILING","_xlfn.ERF.PRECISE":"ERF.PRECISE","_xlfn.ERFC.PRECISE":"ERFC.PRECISE","_xlfn.EXPON.DIST":"EXPON.DIST","_xlfn.F.DIST":"F.DIST","_xlfn.F.DIST.RT":"F.DIST.RT","_xlfn.F.INV":"F.INV","_xlfn.F.INV.RT":"F.INV.RT","_xlfn.F.TEST":"F.TEST","_xlfn.FILTERXML":"FILTERXML","_xlfn.FLOOR.MATH":"FLOOR.MATH","_xlfn.FLOOR.PRECISE":"FLOOR.PRECISE","_xlfn.FORECAST.ETS":"FORECAST.ETS","_xlfn.FORECAST.ETS.CONFINT":"FORECAST.ETS.CONFINT","_xlfn.FORECAST.ETS.SEASONALITY":"FORECAST.ETS.SEASONALITY","_xlfn.FORECAST.ETS.STAT":"FORECAST.ETS.STAT","_xlfn.FORECAST.LINEAR":"FORECAST.LINEAR","_xlfn.FORMULATEXT":"FORMULATEXT","_xlfn.GAMMA":"GAMMA","_xlfn.GAMMA.DIST":"GAMMA.DIST","_xlfn.GAMMA.INV":"GAMMA.INV","_xlfn.GAMMALN.PRECISE":"GAMMALN.PRECISE","_xlfn.GAUSS":"GAUSS","_xlfn.HYPGEOM.DIST":"HYPGEOM.DIST","_xlfn.IFERROR":"IFERROR","_xlfn.IFNA":"IFNA","_xlfn.IFS":"IFS","_xlfn.IMCOSH":"IMCOSH","_xlfn.IMCOT":"IMCOT","_xlfn.IMCSC":"IMCSC","_xlfn.IMCSCH":"IMCSCH","_xlfn.IMSEC":"IMSEC","_xlfn.IMSECH":"IMSECH","_xlfn.IMSINH":"IMSINH","_xlfn.IMTAN":"IMTAN","_xlfn.ISFORMULA":"ISFORMULA","_xlfn.ISO.CEILING":"ISO.CEILING","_xlfn.ISOWEEKNUM":"ISOWEEKNUM","_xlfn.LOGNORM.DIST":"LOGNORM.DIST","_xlfn.LOGNORM.INV":"LOGNORM.INV","_xlfn.MAXIFS":"MAXIFS","_xlfn.MINIFS":"MINIFS","_xlfn.MODE.MULT":"MODE.MULT","_xlfn.MODE.SNGL":"MODE.SNGL","_xlfn.MUNIT":"MUNIT","_xlfn.NEGBINOM.DIST":"NEGBINOM.DIST","_xlfn.NETWORKDAYS.INTL":"NETWORKDAYS.INTL","_xlfn.NIGBINOM":"NIGBINOM","_xlfn.NORM.DIST":"NORM.DIST","_xlfn.NORM.INV":"NORM.INV","_xlfn.NORM.S.DIST":"NORM.S.DIST","_xlfn.NORM.S.INV":"NORM.S.INV","_xlfn.NUMBERVALUE":"NUMBERVALUE","_xlfn.PDURATION":"PDURATION","_xlfn.PERCENTILE.EXC":"PERCENTILE.EXC","_xlfn.PERCENTILE.INC":"PERCENTILE.INC","_xlfn.PERCENTRANK.EXC":"PERCENTRANK.EXC","_xlfn.PERCENTRANK.INC":"PERCENTRANK.INC","_xlfn.PERMUTATIONA":"PERMUTATIONA","_xlfn.PHI":"PHI","_xlfn.POISSON.DIST":"POISSON.DIST","_xlfn.QUARTILE.EXC":"QUARTILE.EXC","_xlfn.QUARTILE.INC":"QUARTILE.INC","_xlfn.QUERYSTRING":"QUERYSTRING","_xlfn.RANK.AVG":"RANK.AVG","_xlfn.RANK.EQ":"RANK.EQ","_xlfn.RRI":"RRI","_xlfn.SEC":"SEC","_xlfn.SECH":"SECH","_xlfn.SHEET":"SHEET","_xlfn.SHEETS":"SHEETS","_xlfn.SKEW.P":"SKEW.P","_xlfn.STDEV.P":"STDEV.P","_xlfn.STDEV.S":"STDEV.S","_xlfn.SUMIFS":"SUMIFS","_xlfn.SWITCH":"SWITCH","_xlfn.T.DIST":"T.DIST","_xlfn.T.DIST.2T":"T.DIST.2T","_xlfn.T.DIST.RT":"T.DIST.RT","_xlfn.T.INV":"T.INV","_xlfn.T.INV.2T":"T.INV.2T","_xlfn.T.TEST":"T.TEST","_xlfn.TEXTJOIN":"TEXTJOIN","_xlfn.UNICHAR":"UNICHAR","_xlfn.UNICODE":"UNICODE","_xlfn.VAR.P":"VAR.P","_xlfn.VAR.S":"VAR.S","_xlfn.WEBSERVICE":"WEBSERVICE","_xlfn.WEIBULL.DIST":"WEIBULL.DIST","_xlfn.WORKDAY.INTL":"WORKDAY.INTL","_xlfn.XOR":"XOR","_xlfn.Z.TEST":"Z.TEST"};function os(e){return"of:"==e.slice(0,3)&&(e=e.slice(3)),61==e.charCodeAt(0)&&61==(e=e.slice(1)).charCodeAt(0)&&(e=e.slice(1)),(e=(e=(e=e.replace(/COM\.MICROSOFT\./g,"")).replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,(function(e,t){return t.replace(/\./g,"")}))).replace(/\[.(#[A-Z]*[?!])\]/g,"$1")).replace(/[;~]/g,",").replace(/\|/g,";")}function ss(e){var t=e.split(":");return[t[0].split(".")[0],t[0].split(".")[1]+(t.length>1?":"+(t[1].split(".")[1]||t[1].split(".")[0]):"")]}var ls={},cs={};Xr.WS=["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"];var us="undefined"!=typeof Map;function fs(e,t,r){var n=0,a=e.length;if(r){if(us?r.has(t):Object.prototype.hasOwnProperty.call(r,t))for(var i=us?r.get(t):r[t];n<i.length;++n)if(e[i[n]].t===t)return e.Count++,i[n]}else for(;n<a;++n)if(e[n].t===t)return e.Count++,n;return e[a]={t},e.Count++,e.Unique++,r&&(us?(r.has(t)||r.set(t,[]),r.get(t).push(a)):(Object.prototype.hasOwnProperty.call(r,t)||(r[t]=[]),r[t].push(a))),a}function ps(e,t){var r={min:e+1,max:e+1},n=-1;return t.MDW&&(di=t.MDW),null!=t.width?r.customWidth=1:null!=t.wpx?n=gi(t.wpx):null!=t.wch&&(n=t.wch),n>-1?(r.width=yi(n),r.customWidth=1):null!=t.width&&(r.width=t.width),t.hidden&&(r.hidden=!0),null!=t.level&&(r.outlineLevel=r.level=t.level),r}function hs(e,t){if(e){var r=[.7,.7,.75,.75,.3,.3];"xlml"==t&&(r=[1,1,1,1,.5,.5]),null==e.left&&(e.left=r[0]),null==e.right&&(e.right=r[1]),null==e.top&&(e.top=r[2]),null==e.bottom&&(e.bottom=r[3]),null==e.header&&(e.header=r[4]),null==e.footer&&(e.footer=r[5])}}function ds(e,t,r){var n=r.revssf[null!=t.z?t.z:"General"],a=60,i=e.length;if(null==n&&r.ssf)for(;a<392;++a)if(null==r.ssf[a]){E.load(t.z,a),r.ssf[a]=t.z,r.revssf[t.z]=n=a;break}for(a=0;a!=i;++a)if(e[a].numFmtId===n)return a;return e[i]={numFmtId:n,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},i}function ms(e,t,r,n,a,i){try{n.cellNF&&(e.z=E._table[t])}catch(e){if(n.WTF)throw e}if("z"!==e.t||n.cellStyles){if("d"===e.t&&"string"==typeof e.v&&(e.v=Q(e.v)),(!n||!1!==n.cellText)&&"z"!==e.t)try{if(null==E._table[t]&&E.load(I[t]||"General",t),"e"===e.t)e.w=e.w||Ur[e.v];else if(0===t)if("n"===e.t)(0|e.v)===e.v?e.w=E._general_int(e.v):e.w=E._general_num(e.v);else if("d"===e.t){var o=W(e.v);e.w=(0|o)===o?E._general_int(o):E._general_num(o)}else{if(void 0===e.v)return"";e.w=E._general(e.v,cs)}else"d"===e.t?e.w=E.format(t,W(e.v),cs):e.w=E.format(t,e.v,cs)}catch(e){if(n.WTF)throw e}if(n.cellStyles&&null!=r)try{e.s=i.Fills[r],e.s.fgColor&&e.s.fgColor.theme&&!e.s.fgColor.rgb&&(e.s.fgColor.rgb=hi(a.themeElements.clrScheme[e.s.fgColor.theme].rgb,e.s.fgColor.tint||0),n.WTF&&(e.s.fgColor.raw_rgb=a.themeElements.clrScheme[e.s.fgColor.theme].rgb)),e.s.bgColor&&e.s.bgColor.theme&&(e.s.bgColor.rgb=hi(a.themeElements.clrScheme[e.s.bgColor.theme].rgb,e.s.bgColor.tint||0),n.WTF&&(e.s.bgColor.raw_rgb=a.themeElements.clrScheme[e.s.bgColor.theme].rgb))}catch(e){if(n.WTF&&i.Fills)throw e}}}function gs(e,t,r){if(e&&e["!ref"]){var n=er(e["!ref"]);if(n.e.c<n.s.c||n.e.r<n.s.r)throw new Error("Bad range ("+r+"): "+e["!ref"])}}var ys=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,vs=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,bs=/<(?:\w:)?hyperlink [^>]*>/gm,xs=/"(\w*:\w*)"/,_s=/<(?:\w:)?col\b[^>]*[\/]?>/g,ws=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,ks=/<(?:\w:)?pageMargins[^>]*\/>/g,Ds=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,Ts=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,As=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function Ss(e,t,r,n){var a=_e(e);r.Sheets[n]||(r.Sheets[n]={}),a.codeName&&(r.Sheets[n].CodeName=Se(Le(a.codeName)))}var Ms=["objects","scenarios","selectLockedCells","selectUnlockedCells"],Es=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"],Cs=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;function Ns(e,t,r,n){if(void 0===e.v&&"string"!=typeof e.f||"z"===e.t)return"";var a="",i=e.t,o=e.v;if("z"!==e.t)switch(e.t){case"b":a=e.v?"1":"0";break;case"n":a=""+e.v;break;case"e":a=Ur[e.v];break;case"d":n&&n.cellDates?a=Q(e.v,-1).toISOString():((e=te(e)).t="n",a=""+(e.v=W(Q(e.v)))),void 0===e.z&&(e.z=E._table[14]);break;default:a=e.v}var s=Ke("v",Ce(a)),l={r:t},c=ds(n.cellXfs,e,n);switch(0!==c&&(l.s=c),e.t){case"n":case"z":break;case"d":l.t="d";break;case"b":l.t="b";break;case"e":l.t="e";break;default:if(null==e.v){delete e.t;break}if(e.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(n&&n.bookSST){s=Ke("v",""+fs(n.Strings,e.v,n.revStrings)),l.t="s";break}l.t="str"}if(e.t!=i&&(e.t=i,e.v=o),"string"==typeof e.f&&e.f){var u=e.F&&e.F.slice(0,t.length)==t?{t:"array",ref:e.F}:null;s=Qe("f",Ce(e.f),u)+(null!=e.v?s:"")}return e.l&&r["!links"].push([t,e.l]),e.c&&r["!comments"].push([t,e.c]),Qe("c",s,l)}var Os,Is,Ps,Rs,Ls,Fs,Bs,zs=(Os=/<(?:\w+:)?c[ \/>]/,Is=/<\/(?:\w+:)?row>/,Ps=/r=["']([^"']*)["']/,Rs=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,Ls=/ref=["']([^"']*)["']/,Fs=qe("v"),Bs=qe("f"),function(e,t,r,n,a,i){for(var o,s,l,c,u,f=0,p="",h=[],d=[],m=0,g=0,y=0,v="",b=0,x=0,_=0,w=0,k=Array.isArray(i.CellXf),D=[],T=[],A=Array.isArray(t),S=[],M={},C=!1,N=!!r.sheetStubs,O=e.split(Is),I=0,P=O.length;I!=P;++I){var R=(p=O[I].trim()).length;if(0!==R){var L=0;e:for(f=0;f<R;++f)switch(p[f]){case">":if("/"!=p[f-1]){++f;break e}if(r&&r.cellStyles){if(b=null!=(s=_e(p.slice(L,f),!0)).r?parseInt(s.r,10):b+1,x=-1,r.sheetRows&&r.sheetRows<b)continue;M={},C=!1,s.ht&&(C=!0,M.hpt=parseFloat(s.ht),M.hpx=wi(M.hpt)),"1"==s.hidden&&(C=!0,M.hidden=!0),null!=s.outlineLevel&&(C=!0,M.level=+s.outlineLevel),C&&(S[b-1]=M)}break;case"<":L=f}if(L>=f)break;if(b=null!=(s=_e(p.slice(L,f),!0)).r?parseInt(s.r,10):b+1,x=-1,!(r.sheetRows&&r.sheetRows<b)){n.s.r>b-1&&(n.s.r=b-1),n.e.r<b-1&&(n.e.r=b-1),r&&r.cellStyles&&(M={},C=!1,s.ht&&(C=!0,M.hpt=parseFloat(s.ht),M.hpx=wi(M.hpt)),"1"==s.hidden&&(C=!0,M.hidden=!0),null!=s.outlineLevel&&(C=!0,M.level=+s.outlineLevel),C&&(S[b-1]=M)),h=p.slice(f).split(Os);for(var F=0;F!=h.length&&"<"==h[F].trim().charAt(0);++F);for(h=h.slice(F),f=0;f!=h.length;++f)if(0!==(p=h[f].trim()).length){if(d=p.match(Ps),m=f,g=0,y=0,p="<c "+("<"==p.slice(0,1)?">":"")+p,null!=d&&2===d.length){for(m=0,v=d[1],g=0;g!=v.length&&!((y=v.charCodeAt(g)-64)<1||y>26);++g)m=26*m+y;x=--m}else++x;for(g=0;g!=p.length&&62!==p.charCodeAt(g);++g);if(++g,(s=_e(p.slice(0,g),!0)).r||(s.r=Kt({r:b-1,c:x})),o={t:""},null!=(d=(v=p.slice(g)).match(Fs))&&""!==d[1]&&(o.v=Se(d[1])),r.cellFormula){if(null!=(d=v.match(Bs))&&""!==d[1]){if(o.f=Se(Le(d[1])).replace(/\r\n/g,"\n"),r.xlfn||(o.f=fo(o.f)),d[0].indexOf('t="array"')>-1)o.F=(v.match(Ls)||[])[1],o.F.indexOf(":")>-1&&D.push([er(o.F),o.F]);else if(d[0].indexOf('t="shared"')>-1){c=_e(d[0]);var B=Se(Le(d[1]));r.xlfn||(B=fo(B)),T[parseInt(c.si,10)]=[c,B,s.r]}}else(d=v.match(/<f[^>]*\/>/))&&T[(c=_e(d[0])).si]&&(o.f=uo(T[c.si][1],T[c.si][2],s.r));var z=Zt(s.r);for(g=0;g<D.length;++g)z.r>=D[g][0].s.r&&z.r<=D[g][0].e.r&&z.c>=D[g][0].s.c&&z.c<=D[g][0].e.c&&(o.F=D[g][1])}if(null==s.t&&void 0===o.v)if(o.f||o.F)o.v=0,o.t="n";else{if(!N)continue;o.t="z"}else o.t=s.t||"n";switch(n.s.c>x&&(n.s.c=x),n.e.c<x&&(n.e.c=x),o.t){case"n":if(""==o.v||null==o.v){if(!N)continue;o.t="z"}else o.v=parseFloat(o.v);break;case"s":if(void 0===o.v){if(!N)continue;o.t="z"}else l=ls[parseInt(o.v,10)],o.v=l.t,o.r=l.r,r.cellHTML&&(o.h=l.h);break;case"str":o.t="s",o.v=null!=o.v?Le(o.v):"",r.cellHTML&&(o.h=Ie(o.v));break;case"inlineStr":d=v.match(Rs),o.t="s",null!=d&&(l=Va(d[1]))?(o.v=l.t,r.cellHTML&&(o.h=l.h)):o.v="";break;case"b":o.v=Re(o.v);break;case"d":r.cellDates?o.v=Q(o.v,1):(o.v=W(Q(o.v,1)),o.t="n");break;case"e":r&&!1===r.cellText||(o.w=o.v),o.v=$r[o.v]}if(_=w=0,u=null,k&&void 0!==s.s&&null!=(u=i.CellXf[s.s])&&(null!=u.numFmtId&&(_=u.numFmtId),r.cellStyles&&null!=u.fillId&&(w=u.fillId)),ms(o,_,w,r,a,i),r.cellDates&&k&&"n"==o.t&&E.is_date(E._table[_])&&(o.t="d",o.v=Y(o.v)),A){var j=Zt(s.r);t[j.r]||(t[j.r]=[]),t[j.r][j.c]=o}else t[s.r]=o}}}}S.length>0&&(t["!rows"]=S)}),js=Qe("worksheet",null,{xmlns:nt.main[0],"xmlns:r":nt.r});function Us(e,t,r,n){var a,i=[ge,js],o=r.SheetNames[e],s="",l=r.Sheets[o];null==l&&(l={});var c=l["!ref"]||"A1",u=er(c);if(u.e.c>16383||u.e.r>1048575){if(t.WTF)throw new Error("Range "+c+" exceeds format limit A1:XFD1048576");u.e.c=Math.min(u.e.c,16383),u.e.r=Math.min(u.e.c,1048575),c=Qt(u)}n||(n={}),l["!comments"]=[];var f=[];!function(e,t,r,n,a){var i=!1,o={},s=null;if("xlsx"!==n.bookType&&t.vbaraw){var l=t.SheetNames[r];try{t.Workbook&&(l=t.Workbook.Sheets[r].CodeName||l)}catch(e){}i=!0,o.codeName=Fe(Ce(l))}if(e&&e["!outline"]){var c={summaryBelow:1,summaryRight:1};e["!outline"].above&&(c.summaryBelow=0),e["!outline"].left&&(c.summaryRight=0),s=(s||"")+Qe("outlinePr",null,c)}(i||s)&&(a[a.length]=Qe("sheetPr",s,o))}(l,r,e,t,i),i[i.length]=Qe("dimension",null,{ref:c}),i[i.length]=function(e,t,r,n){var a={workbookViewId:"0"};return(((n||{}).Workbook||{}).Views||[])[0]&&(a.rightToLeft=n.Workbook.Views[0].RTL?"1":"0"),Qe("sheetViews",Qe("sheetView",null,a),{})}(0,0,0,r),t.sheetFormat&&(i[i.length]=Qe("sheetFormatPr",null,{defaultRowHeight:t.sheetFormat.defaultRowHeight||"16",baseColWidth:t.sheetFormat.baseColWidth||"10",outlineLevelRow:t.sheetFormat.outlineLevelRow||"7"})),null!=l["!cols"]&&l["!cols"].length>0&&(i[i.length]=function(e,t){for(var r,n=["<cols>"],a=0;a!=t.length;++a)(r=t[a])&&(n[n.length]=Qe("col",null,ps(a,r)));return n[n.length]="</cols>",n.join("")}(0,l["!cols"])),i[a=i.length]="<sheetData/>",l["!links"]=[],null!=l["!ref"]&&(s=function(e,t,r,n){var a,i,o=[],s=[],l=er(e["!ref"]),c="",u="",f=[],p=0,h=0,d=e["!rows"],m=Array.isArray(e),g={r:u},y=-1;for(h=l.s.c;h<=l.e.c;++h)f[h]=Yt(h);for(p=l.s.r;p<=l.e.r;++p){for(s=[],u=Gt(p),h=l.s.c;h<=l.e.c;++h){a=f[h]+u;var v=m?(e[p]||[])[h]:e[a];void 0!==v&&null!=(c=Ns(v,a,e,t))&&s.push(c)}(s.length>0||d&&d[p])&&(g={r:u},d&&d[p]&&((i=d[p]).hidden&&(g.hidden=1),y=-1,i.hpx?y=_i(i.hpx):i.hpt&&(y=i.hpt),y>-1&&(g.ht=y,g.customHeight=1),i.level&&(g.outlineLevel=i.level)),o[o.length]=Qe("row",s.join(""),g))}if(d)for(;p<d.length;++p)d&&d[p]&&(g={r:p+1},(i=d[p]).hidden&&(g.hidden=1),y=-1,i.hpx?y=_i(i.hpx):i.hpt&&(y=i.hpt),y>-1&&(g.ht=y,g.customHeight=1),i.level&&(g.outlineLevel=i.level),o[o.length]=Qe("row","",g));return o.join("")}(l,t),s.length>0&&(i[i.length]=s)),i.length>a+1&&(i[i.length]="</sheetData>",i[a]=i[a].replace("/>",">")),l["!protect"]&&(i[i.length]=function(e){var t={sheet:1};return Ms.forEach((function(r){null!=e[r]&&e[r]&&(t[r]="1")})),Es.forEach((function(r){null==e[r]||e[r]||(t[r]="0")})),e.password&&(t.password=ii(e.password).toString(16).toUpperCase()),Qe("sheetProtection",null,t)}(l["!protect"])),null!=l["!autofilter"]&&(i[i.length]=function(e,t,r,n){var a="string"==typeof e.ref?e.ref:Qt(e.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var i=r.Workbook.Names,o=Jt(a);o.s.r==o.e.r&&(o.e.r=Jt(t["!ref"]).e.r,a=Qt(o));for(var s=0;s<i.length;++s){var l=i[s];if("_xlnm._FilterDatabase"==l.Name&&l.Sheet==n){l.Ref="'"+r.SheetNames[n]+"'!"+a;break}}return s==i.length&&i.push({Name:"_xlnm._FilterDatabase",Sheet:n,Ref:"'"+r.SheetNames[n]+"'!"+a}),Qe("autoFilter",null,{ref:a})}(l["!autofilter"],l,r,e)),null!=l["!merges"]&&l["!merges"].length>0&&(i[i.length]=function(e){if(0===e.length)return"";for(var t='<mergeCells count="'+e.length+'">',r=0;r!=e.length;++r)t+='<mergeCell ref="'+Qt(e[r])+'"/>';return t+"</mergeCells>"}(l["!merges"]));var p,h,d=-1,m=-1;return l["!links"].length>0&&(i[i.length]="<hyperlinks>",l["!links"].forEach((function(e){e[1].Target&&(p={ref:e[0]},"#"!=e[1].Target.charAt(0)&&(m=en(n,-1,Ce(e[1].Target).replace(/#.*$/,""),Xr.HLINK),p["r:id"]="rId"+m),(d=e[1].Target.indexOf("#"))>-1&&(p.location=Ce(e[1].Target.slice(d+1))),e[1].Tooltip&&(p.tooltip=Ce(e[1].Tooltip)),i[i.length]=Qe("hyperlink",null,p))})),i[i.length]="</hyperlinks>"),delete l["!links"],null!=l["!margins"]&&(i[i.length]=(hs(h=l["!margins"]),Qe("pageMargins",null,h))),t&&!t.ignoreEC&&null!=t.ignoreEC||(i[i.length]=Ke("ignoredErrors",Qe("ignoredError",null,{numberStoredAsText:1,sqref:c}))),f.length>0&&(m=en(n,-1,"../drawings/drawing"+(e+1)+".xml",Xr.DRAW),i[i.length]=Qe("drawing",null,{"r:id":"rId"+m}),l["!drawing"]=f),l["!comments"].length>0&&(m=en(n,-1,"../drawings/vmlDrawing"+(e+1)+".vml",Xr.VML),i[i.length]=Qe("legacyDrawing",null,{"r:id":"rId"+m}),l["!legacy"]=m),i.length>1&&(i[i.length]="</worksheet>",i[1]=i[1].replace("/>",">")),i.join("")}function $s(e,t,r,n){var a=function(e,t,r){var n=Bt(145),a=(r["!rows"]||[])[e]||{};n.write_shift(4,e),n.write_shift(4,0);var i=320;a.hpx?i=20*_i(a.hpx):a.hpt&&(i=20*a.hpt),n.write_shift(2,i),n.write_shift(1,0);var o=0;a.level&&(o|=a.level),a.hidden&&(o|=16),(a.hpx||a.hpt)&&(o|=32),n.write_shift(1,o),n.write_shift(1,0);var s=0,l=n.l;n.l+=4;for(var c={r:e,c:0},u=0;u<16;++u)if(!(t.s.c>u+1<<10||t.e.c<u<<10)){for(var f=-1,p=-1,h=u<<10;h<u+1<<10;++h)c.c=h,(Array.isArray(r)?(r[c.r]||[])[c.c]:r[Kt(c)])&&(f<0&&(f=h),p=h);f<0||(++s,n.write_shift(4,f),n.write_shift(4,p))}var d=n.l;return n.l=l,n.write_shift(4,s),n.l=d,n.length>n.l?n.slice(0,n.l):n}(n,r,t);(a.length>17||(t["!rows"]||[])[n])&&Ut(e,"BrtRowHdr",a)}var Vs=Tr,qs=Ar;function Ws(e){return[hr(e),Sr(e),"n"]}var Hs=Tr,Gs=Ar,Xs=["left","right","top","bottom","header","footer"];function Ys(e,t,r,n,a,i,o){if(void 0===t.v)return!1;var s="";switch(t.t){case"b":s=t.v?"1":"0";break;case"d":(t=te(t)).z=t.z||E._table[14],t.v=W(Q(t.v)),t.t="n";break;case"n":case"e":s=""+t.v;break;default:s=t.v}var l={r,c:n};switch(l.s=ds(a.cellXfs,t,a),t.l&&i["!links"].push([Kt(l),t.l]),t.c&&i["!comments"].push([Kt(l),t.c]),t.t){case"s":case"str":return a.bookSST?(s=fs(a.Strings,t.v,a.revStrings),l.t="s",l.v=s,o?Ut(e,"BrtShortIsst",function(e,t,r){return null==r&&(r=Bt(8)),dr(t,r),r.write_shift(4,t.v),r}(0,l)):Ut(e,"BrtCellIsst",function(e,t,r){return null==r&&(r=Bt(12)),pr(t,r),r.write_shift(4,t.v),r}(0,l))):(l.t="str",o?Ut(e,"BrtShortSt",function(e,t,r){return null==r&&(r=Bt(8+4*e.v.length)),dr(t,r),sr(e.v,r),r.length>r.l?r.slice(0,r.l):r}(t,l)):Ut(e,"BrtCellSt",function(e,t,r){return null==r&&(r=Bt(12+4*e.v.length)),pr(t,r),sr(e.v,r),r.length>r.l?r.slice(0,r.l):r}(t,l))),!0;case"n":return t.v==(0|t.v)&&t.v>-1e3&&t.v<1e3?o?Ut(e,"BrtShortRk",function(e,t,r){return null==r&&(r=Bt(8)),dr(t,r),kr(e.v,r),r}(t,l)):Ut(e,"BrtCellRk",function(e,t,r){return null==r&&(r=Bt(12)),pr(t,r),kr(e.v,r),r}(t,l)):o?Ut(e,"BrtShortReal",function(e,t,r){return null==r&&(r=Bt(12)),dr(t,r),Mr(e.v,r),r}(t,l)):Ut(e,"BrtCellReal",function(e,t,r){return null==r&&(r=Bt(16)),pr(t,r),Mr(e.v,r),r}(t,l)),!0;case"b":return l.t="b",o?Ut(e,"BrtShortBool",function(e,t,r){return null==r&&(r=Bt(5)),dr(t,r),r.write_shift(1,e.v?1:0),r}(t,l)):Ut(e,"BrtCellBool",function(e,t,r){return null==r&&(r=Bt(9)),pr(t,r),r.write_shift(1,e.v?1:0),r}(t,l)),!0;case"e":return l.t="e",o?Ut(e,"BrtShortError",function(e,t,r){return null==r&&(r=Bt(8)),dr(t,r),r.write_shift(1,e.v),r.write_shift(2,0),r.write_shift(1,0),r}(t,l)):Ut(e,"BrtCellError",function(e,t,r){return null==r&&(r=Bt(9)),pr(t,r),r.write_shift(1,e.v),r}(t,l)),!0}return o?Ut(e,"BrtShortBlank",function(e,t,r){return null==r&&(r=Bt(4)),dr(t,r)}(0,l)):Ut(e,"BrtCellBlank",function(e,t,r){return null==r&&(r=Bt(8)),pr(t,r)}(0,l)),!0}function Zs(e,t,r,n){var a=jt(),i=r.SheetNames[e],o=r.Sheets[i]||{},s=i;try{r&&r.Workbook&&(s=r.Workbook.Sheets[e].CodeName||s)}catch(e){}var l=er(o["!ref"]||"A1");if(l.e.c>16383||l.e.r>1048575){if(t.WTF)throw new Error("Range "+(o["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");l.e.c=Math.min(l.e.c,16383),l.e.r=Math.min(l.e.c,1048575)}return o["!links"]=[],o["!comments"]=[],Ut(a,"BrtBeginSheet"),(r.vbaraw||o["!outline"])&&Ut(a,"BrtWsProp",function(e,t,r){null==r&&(r=Bt(84+4*e.length));var n=192;t&&(t.above&&(n&=-65),t.left&&(n&=-129)),r.write_shift(1,n);for(var a=1;a<3;++a)r.write_shift(1,0);return Er({auto:1},r),r.write_shift(-4,-1),r.write_shift(-4,-1),gr(e,r),r.slice(0,r.l)}(s,o["!outline"])),Ut(a,"BrtWsDim",qs(l)),function(e,t,r){Ut(e,"BrtBeginWsViews"),Ut(e,"BrtBeginWsView",function(e,t,r){null==r&&(r=Bt(30));var n=924;return(((t||{}).Views||[])[0]||{}).RTL&&(n|=32),r.write_shift(2,n),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(2,0),r.write_shift(2,100),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(4,0),r}(0,r)),Ut(e,"BrtEndWsView"),Ut(e,"BrtEndWsViews")}(a,0,r.Workbook),function(e,t){t&&t["!cols"]&&(Ut(e,"BrtBeginColInfos"),t["!cols"].forEach((function(t,r){t&&Ut(e,"BrtColInfo",function(e,t,r){null==r&&(r=Bt(18));var n=ps(e,t);r.write_shift(-4,e),r.write_shift(-4,e),r.write_shift(4,256*(n.width||10)),r.write_shift(4,0);var a=0;return t.hidden&&(a|=1),"number"==typeof n.width&&(a|=2),t.level&&(a|=t.level<<8),r.write_shift(2,a),r}(r,t))})),Ut(e,"BrtEndColInfos"))}(a,o),function(e,t,r,n){var a,i=er(t["!ref"]||"A1"),o="",s=[];Ut(e,"BrtBeginSheetData");var l=Array.isArray(t),c=i.e.r;t["!rows"]&&(c=Math.max(i.e.r,t["!rows"].length-1));for(var u=i.s.r;u<=c;++u){o=Gt(u),$s(e,t,i,u);var f=!1;if(u<=i.e.r)for(var p=i.s.c;p<=i.e.c;++p){u===i.s.r&&(s[p]=Yt(p)),a=s[p]+o;var h=l?(t[u]||[])[p]:t[a];f=!!h&&Ys(e,h,u,p,n,t,f)}}Ut(e,"BrtEndSheetData")}(a,o,0,t),function(e,t){t["!protect"]&&Ut(e,"BrtSheetProtection",function(e,t){return null==t&&(t=Bt(66)),t.write_shift(2,e.password?ii(e.password):0),t.write_shift(4,1),[["objects",!1],["scenarios",!1],["formatCells",!0],["formatColumns",!0],["formatRows",!0],["insertColumns",!0],["insertRows",!0],["insertHyperlinks",!0],["deleteColumns",!0],["deleteRows",!0],["selectLockedCells",!1],["sort",!0],["autoFilter",!0],["pivotTables",!0],["selectUnlockedCells",!1]].forEach((function(r){r[1]?t.write_shift(4,null==e[r[0]]||e[r[0]]?0:1):t.write_shift(4,null!=e[r[0]]&&e[r[0]]?0:1)})),t}(t["!protect"]))}(a,o),function(e,t,r,n){if(t["!autofilter"]){var a=t["!autofilter"],i="string"==typeof a.ref?a.ref:Qt(a.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var o=r.Workbook.Names,s=Jt(i);s.s.r==s.e.r&&(s.e.r=Jt(t["!ref"]).e.r,i=Qt(s));for(var l=0;l<o.length;++l){var c=o[l];if("_xlnm._FilterDatabase"==c.Name&&c.Sheet==n){c.Ref="'"+r.SheetNames[n]+"'!"+i;break}}l==o.length&&o.push({Name:"_xlnm._FilterDatabase",Sheet:n,Ref:"'"+r.SheetNames[n]+"'!"+i}),Ut(e,"BrtBeginAFilter",Ar(er(i))),Ut(e,"BrtEndAFilter")}}(a,o,r,e),function(e,t){t&&t["!merges"]&&(Ut(e,"BrtBeginMergeCells",function(e,t){return null==t&&(t=Bt(4)),t.write_shift(4,e),t}(t["!merges"].length)),t["!merges"].forEach((function(t){Ut(e,"BrtMergeCell",Gs(t))})),Ut(e,"BrtEndMergeCells"))}(a,o),function(e,t,r){t["!links"].forEach((function(t){if(t[1].Target){var n=en(r,-1,t[1].Target.replace(/#.*$/,""),Xr.HLINK);Ut(e,"BrtHLink",function(e,t){var r=Bt(50+4*(e[1].Target.length+(e[1].Tooltip||"").length));Ar({s:Zt(e[0]),e:Zt(e[0])},r),_r("rId"+t,r);var n=e[1].Target.indexOf("#");return sr((-1==n?"":e[1].Target.slice(n+1))||"",r),sr(e[1].Tooltip||"",r),sr("",r),r.slice(0,r.l)}(t,n))}})),delete t["!links"]}(a,o,n),o["!margins"]&&Ut(a,"BrtMargins",function(e,t){return null==t&&(t=Bt(48)),hs(e),Xs.forEach((function(r){Mr(e[r],t)})),t}(o["!margins"])),t&&!t.ignoreEC&&null!=t.ignoreEC||function(e,t){t&&t["!ref"]&&(Ut(e,"BrtBeginCellIgnoreECs"),Ut(e,"BrtCellIgnoreEC",function(e){var t=Bt(24);return t.write_shift(4,4),t.write_shift(4,1),Ar(e,t),t}(er(t["!ref"]))),Ut(e,"BrtEndCellIgnoreECs"))}(a,o),function(e,t,r,n){if(t["!comments"].length>0){var a=en(n,-1,"../drawings/vmlDrawing"+(r+1)+".vml",Xr.VML);Ut(e,"BrtLegacyDrawing",_r("rId"+a)),t["!legacy"]=a}}(a,o,e,n),Ut(a,"BrtEndSheet"),a.end()}Xr.CHART="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",Xr.CHARTEX="http://schemas.microsoft.com/office/2014/relationships/chartEx",Xr.CS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",Qe("chartsheet",null,{xmlns:nt.main[0],"xmlns:r":nt.r});var Ks=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],Js=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],Qs=[],el=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function tl(e,t){for(var r=0;r!=e.length;++r)for(var n=e[r],a=0;a!=t.length;++a){var i=t[a];if(null==n[i[0]])n[i[0]]=i[1];else switch(i[2]){case"bool":"string"==typeof n[i[0]]&&(n[i[0]]=Re(n[i[0]]));break;case"int":"string"==typeof n[i[0]]&&(n[i[0]]=parseInt(n[i[0]],10))}}}function rl(e,t){for(var r=0;r!=t.length;++r){var n=t[r];if(null==e[n[0]])e[n[0]]=n[1];else switch(n[2]){case"bool":"string"==typeof e[n[0]]&&(e[n[0]]=Re(e[n[0]]));break;case"int":"string"==typeof e[n[0]]&&(e[n[0]]=parseInt(e[n[0]],10))}}}function nl(e){rl(e.WBProps,Ks),rl(e.CalcPr,el),tl(e.WBView,Js),tl(e.Sheets,Qs),cs.date1904=Re(e.WBProps.date1904)}var al="][*?/\\".split("");function il(e,t){if(e.length>31){if(t)return!1;throw new Error("Sheet names cannot exceed 31 chars")}var r=!0;return al.forEach((function(n){if(-1!=e.indexOf(n)){if(!t)throw new Error("Sheet name cannot contain : \\ / ? * [ ]");r=!1}})),r}var ol=/<\w+:workbook/,sl=Qe("workbook",null,{xmlns:nt.main[0],"xmlns:r":nt.r});function ll(e){var t=[ge];t[t.length]=sl;var r=e.Workbook&&(e.Workbook.Names||[]).length>0,n={codeName:"ThisWorkbook"};e.Workbook&&e.Workbook.WBProps&&(Ks.forEach((function(t){null!=e.Workbook.WBProps[t[0]]&&e.Workbook.WBProps[t[0]]!=t[1]&&(n[t[0]]=e.Workbook.WBProps[t[0]])})),e.Workbook.WBProps.CodeName&&(n.codeName=e.Workbook.WBProps.CodeName,delete n.CodeName)),t[t.length]=Qe("workbookPr",null,n);var a=e.Workbook&&e.Workbook.Sheets||[],i=0;if(a&&a[0]&&a[0].Hidden){for(t[t.length]="<bookViews>",i=0;i!=e.SheetNames.length&&a[i]&&a[i].Hidden;++i);i==e.SheetNames.length&&(i=0),t[t.length]='<workbookView firstSheet="'+i+'" activeTab="'+i+'"/>',t[t.length]="</bookViews>"}for(t[t.length]="<sheets>",i=0;i!=e.SheetNames.length;++i){var o={name:Ce(e.SheetNames[i].slice(0,31))};if(o.sheetId=""+(i+1),o["r:id"]="rId"+(i+1),a[i])switch(a[i].Hidden){case 1:o.state="hidden";break;case 2:o.state="veryHidden"}t[t.length]=Qe("sheet",null,o)}return t[t.length]="</sheets>",r&&(t[t.length]="<definedNames>",e.Workbook&&e.Workbook.Names&&e.Workbook.Names.forEach((function(e){var r={name:e.Name};e.Comment&&(r.comment=e.Comment),null!=e.Sheet&&(r.localSheetId=""+e.Sheet),e.Hidden&&(r.hidden="1"),e.Ref&&(t[t.length]=Qe("definedName",Ce(e.Ref),r))})),t[t.length]="</definedNames>"),t.length>2&&(t[t.length]="</workbook>",t[1]=t[1].replace("/>",">")),t.join("")}function cl(e,t){return t||(t=Bt(127)),t.write_shift(4,e.Hidden),t.write_shift(4,e.iTabID),_r(e.strRelID,t),sr(e.name.slice(0,31),t),t.length>t.l?t.slice(0,t.l):t}function ul(e,t){var r={};return e.read_shift(4),r.ArchID=e.read_shift(4),e.l+=t-8,r}function fl(e,r){var n=jt();return Ut(n,"BrtBeginBook"),Ut(n,"BrtFileVersion",function(e,r){r||(r=Bt(127));for(var n=0;4!=n;++n)r.write_shift(4,0);return sr("SheetJS",r),sr(t.version,r),sr(t.version,r),sr("7262",r),r.length>r.l?r.slice(0,r.l):r}()),Ut(n,"BrtWbProp",function(e,t){t||(t=Bt(72));var r=0;return e&&e.filterPrivacy&&(r|=8),t.write_shift(4,r),t.write_shift(4,0),gr(e&&e.CodeName||"ThisWorkbook",t),t.slice(0,t.l)}(e.Workbook&&e.Workbook.WBProps||null)),function(e,t){if(t.Workbook&&t.Workbook.Sheets){for(var r=t.Workbook.Sheets,n=0,a=-1,i=-1;n<r.length;++n)!r[n]||!r[n].Hidden&&-1==a?a=n:1==r[n].Hidden&&-1==i&&(i=n);i>a||(Ut(e,"BrtBeginBookViews"),Ut(e,"BrtBookView",function(e,t){return t||(t=Bt(29)),t.write_shift(-4,0),t.write_shift(-4,460),t.write_shift(4,28800),t.write_shift(4,17600),t.write_shift(4,500),t.write_shift(4,e),t.write_shift(4,e),t.write_shift(1,120),t.length>t.l?t.slice(0,t.l):t}(a)),Ut(e,"BrtEndBookViews"))}}(n,e),function(e,t){Ut(e,"BrtBeginBundleShs");for(var r=0;r!=t.SheetNames.length;++r)Ut(e,"BrtBundleSh",cl({Hidden:t.Workbook&&t.Workbook.Sheets&&t.Workbook.Sheets[r]&&t.Workbook.Sheets[r].Hidden||0,iTabID:r+1,strRelID:"rId"+(r+1),name:t.SheetNames[r]}));Ut(e,"BrtEndBundleShs")}(n,e),Ut(n,"BrtEndBook"),n.end()}function pl(e,t,r,n,a,i,o,s){return".bin"===t.slice(-4)?function(e,t,r,n,a,i,o){if(!e)return e;var s=t||{};n||(n={"!id":{}});var l,c,u,f,p,h,d,m,g,y,v=s.dense?[]:{},b={s:{r:2e6,c:2e6},e:{r:0,c:0}},x=[],_=!1,w=!1,k=[];s.biff=12,s["!row"]=0;var D=0,T=!1,A=[],S={},M=s.supbooks||a.supbooks||[[]];if(M.sharedf=S,M.arrayf=A,M.SheetNames=a.SheetNames||a.Sheets.map((function(e){return e.name})),!s.supbooks&&(s.supbooks=M,a.Names))for(var C=0;C<a.Names.length;++C)M[0][C+1]=a.Names[C];var N=[],O=[],I=!1;if(jl[16]={n:"BrtShortReal",f:Ws},zt(e,(function(e,t,C){if(!w)switch(C){case 148:l=e;break;case 0:c=e,s.sheetRows&&s.sheetRows<=c.r&&(w=!0),g=Gt(p=c.r),s["!row"]=c.r,(e.hidden||e.hpt||null!=e.level)&&(e.hpt&&(e.hpx=wi(e.hpt)),O[e.r]=e);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:switch(u={t:e[2]},e[2]){case"n":u.v=e[1];break;case"s":m=ls[e[1]],u.v=m.t,u.r=m.r;break;case"b":u.v=!!e[1];break;case"e":u.v=e[1],!1!==s.cellText&&(u.w=Ur[u.v]);break;case"str":u.t="s",u.v=e[1]}if((f=o.CellXf[e[0].iStyleRef])&&ms(u,f.numFmtId,null,s,i,o),h=-1==e[0].c?h+1:e[0].c,s.dense?(v[p]||(v[p]=[]),v[p][h]=u):v[Yt(h)+g]=u,s.cellFormula){for(T=!1,D=0;D<A.length;++D){var P=A[D];c.r>=P[0].s.r&&c.r<=P[0].e.r&&h>=P[0].s.c&&h<=P[0].e.c&&(u.F=Qt(P[0]),T=!0)}!T&&e.length>3&&(u.f=e[3])}if(b.s.r>c.r&&(b.s.r=c.r),b.s.c>h&&(b.s.c=h),b.e.r<c.r&&(b.e.r=c.r),b.e.c<h&&(b.e.c=h),s.cellDates&&f&&"n"==u.t&&E.is_date(E._table[f.numFmtId])){var R=E.parse_date_code(u.v);R&&(u.t="d",u.v=new Date(R.y,R.m-1,R.d,R.H,R.M,R.S,R.u))}break;case 1:case 12:if(!s.sheetStubs||_)break;u={t:"z",v:void 0},h=-1==e[0].c?h+1:e[0].c,s.dense?(v[p]||(v[p]=[]),v[p][h]=u):v[Yt(h)+g]=u,b.s.r>c.r&&(b.s.r=c.r),b.s.c>h&&(b.s.c=h),b.e.r<c.r&&(b.e.r=c.r),b.e.c<h&&(b.e.c=h);break;case 176:k.push(e);break;case 494:var L=n["!id"][e.relId];for(L?(e.Target=L.Target,e.loc&&(e.Target+="#"+e.loc),e.Rel=L):""==e.relId&&(e.Target="#"+e.loc),p=e.rfx.s.r;p<=e.rfx.e.r;++p)for(h=e.rfx.s.c;h<=e.rfx.e.c;++h)s.dense?(v[p]||(v[p]=[]),v[p][h]||(v[p][h]={t:"z",v:void 0}),v[p][h].l=e):(d=Kt({c:h,r:p}),v[d]||(v[d]={t:"z",v:void 0}),v[d].l=e);break;case 426:if(!s.cellFormula)break;A.push(e),(y=s.dense?v[p][h]:v[Yt(h)+g]).f=Go(e[1],0,{r:c.r,c:h},M,s),y.F=Qt(e[0]);break;case 427:if(!s.cellFormula)break;S[Kt(e[0].s)]=e[1],(y=s.dense?v[p][h]:v[Yt(h)+g]).f=Go(e[1],0,{r:c.r,c:h},M,s);break;case 60:if(!s.cellStyles)break;for(;e.e>=e.s;)N[e.e--]={width:e.w/256,hidden:!!(1&e.flags),level:e.level},I||(I=!0,bi(e.w/256)),xi(N[e.e+1]);break;case 161:v["!autofilter"]={ref:Qt(e)};break;case 476:v["!margins"]=e;break;case 147:a.Sheets[r]||(a.Sheets[r]={}),e.name&&(a.Sheets[r].CodeName=e.name),(e.above||e.left)&&(v["!outline"]={above:e.above,left:e.left});break;case 137:a.Views||(a.Views=[{}]),a.Views[0]||(a.Views[0]={}),e.RTL&&(a.Views[0].RTL=!0);break;case 485:case 64:case 1053:case 151:case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 49:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:_=!0;break;case 36:_=!1;break;case 37:x.push(t),_=!0;break;case 38:x.pop(),_=!1;break;default:if((t||"").indexOf("Begin")>0);else if((t||"").indexOf("End")>0);else if(!_||s.WTF)throw new Error("Unexpected record "+C+" "+t)}}),s),delete s.supbooks,delete s["!row"],!v["!ref"]&&(b.s.r<2e6||l&&(l.e.r>0||l.e.c>0||l.s.r>0||l.s.c>0))&&(v["!ref"]=Qt(l||b)),s.sheetRows&&v["!ref"]){var P=er(v["!ref"]);s.sheetRows<=+P.e.r&&(P.e.r=s.sheetRows-1,P.e.r>b.e.r&&(P.e.r=b.e.r),P.e.r<P.s.r&&(P.s.r=P.e.r),P.e.c>b.e.c&&(P.e.c=b.e.c),P.e.c<P.s.c&&(P.s.c=P.e.c),v["!fullref"]=v["!ref"],v["!ref"]=Qt(P))}return k.length>0&&(v["!merges"]=k),N.length>0&&(v["!cols"]=N),O.length>0&&(v["!rows"]=O),v}(e,n,r,a,i,o,s):function(e,t,r,n,a,i,o){if(!e)return e;n||(n={"!id":{}});var s=t.dense?[]:{},l={s:{r:2e6,c:2e6},e:{r:0,c:0}},c="",u="",f=e.match(vs);f?(c=e.slice(0,f.index),u=e.slice(f.index+f[0].length)):c=u=e;var p=c.match(Ds);p?Ss(p[0],0,a,r):(p=c.match(Ts))&&function(e,t,r,n,a,i,o){Ss(e.slice(0,e.indexOf(">")),0,n,a)}(p[0],p[1],0,a,r);var h=(c.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(h>0){var d=c.slice(h,h+50).match(xs);d&&function(e,t){var r=er(t);r.s.r<=r.e.r&&r.s.c<=r.e.c&&r.s.r>=0&&r.s.c>=0&&(e["!ref"]=Qt(r))}(s,d[1])}var m=c.match(As);m&&m[1]&&function(e,t){t.Views||(t.Views=[{}]),(e.match(Cs)||[]).forEach((function(e,r){var n=_e(e);t.Views[r]||(t.Views[r]={}),+n.zoomScale&&(t.Views[r].zoom=+n.zoomScale),Re(n.rightToLeft)&&(t.Views[r].RTL=!0)}))}(m[1],a);var g=[];if(t.cellStyles){var y=c.match(_s);y&&function(e,t){for(var r=!1,n=0;n!=t.length;++n){var a=_e(t[n],!0);a.hidden&&(a.hidden=Re(a.hidden));var i=parseInt(a.min,10)-1,o=parseInt(a.max,10)-1;for(a.outlineLevel&&(a.level=+a.outlineLevel||0),delete a.min,delete a.max,a.width=+a.width,!r&&a.width&&(r=!0,bi(a.width)),xi(a);i<=o;)e[i++]=te(a)}}(g,y)}f&&zs(f[1],s,t,l,i,o);var v=u.match(ws);v&&(s["!autofilter"]=function(e){return{ref:(e.match(/ref="([^"]*)"/)||[])[1]}}(v[0]));var b=[],x=u.match(ys);if(x)for(h=0;h!=x.length;++h)b[h]=er(x[h].slice(x[h].indexOf('"')+1));var _=u.match(bs);_&&function(e,t,r){for(var n=Array.isArray(e),a=0;a!=t.length;++a){var i=_e(Le(t[a]),!0);if(!i.ref)return;var o=((r||{})["!id"]||[])[i.id];o?(i.Target=o.Target,i.location&&(i.Target+="#"+Se(i.location))):(i.Target="#"+Se(i.location),o={Target:i.Target,TargetMode:"Internal"}),i.Rel=o,i.tooltip&&(i.Tooltip=i.tooltip,delete i.tooltip);for(var s=er(i.ref),l=s.s.r;l<=s.e.r;++l)for(var c=s.s.c;c<=s.e.c;++c){var u=Kt({c,r:l});n?(e[l]||(e[l]=[]),e[l][c]||(e[l][c]={t:"z",v:void 0}),e[l][c].l=i):(e[u]||(e[u]={t:"z",v:void 0}),e[u].l=i)}}}(s,_,n);var w=u.match(ks);if(w&&(s["!margins"]=function(e){var t={};return["left","right","top","bottom","header","footer"].forEach((function(r){e[r]&&(t[r]=parseFloat(e[r]))})),t}(_e(w[0]))),!s["!ref"]&&l.e.c>=l.s.c&&l.e.r>=l.s.r&&(s["!ref"]=Qt(l)),t.sheetRows>0&&s["!ref"]){var k=er(s["!ref"]);t.sheetRows<=+k.e.r&&(k.e.r=t.sheetRows-1,k.e.r>l.e.r&&(k.e.r=l.e.r),k.e.r<k.s.r&&(k.s.r=k.e.r),k.e.c>l.e.c&&(k.e.c=l.e.c),k.e.c<k.s.c&&(k.s.c=k.e.c),s["!fullref"]=s["!ref"],s["!ref"]=Qt(k))}return g.length>0&&(s["!cols"]=g),b.length>0&&(s["!merges"]=b),s}(e,n,r,a,i,o,s)}function hl(e,t,r){return(".bin"===t.slice(-4)?fl:ll)(e,r)}function dl(e,t,r,n,a){return(".bin"===t.slice(-4)?Zs:Us)(e,r,n,a)}function ml(e,t,r){return(".bin"===t.slice(-4)?Za:Xa)(e,r)}function gl(e,t,r){return(".bin"===t.slice(-4)?ao:ro)(e,r)}var yl=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,vl=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function bl(e,t){var r=e.split(/\s+/),n=[];if(t||(n[0]=r[0]),1===r.length)return n;var a,i,o,s=e.match(yl);if(s)for(o=0;o!=s.length;++o)-1===(i=(a=s[o].match(vl))[1].indexOf(":"))?n[a[1]]=a[2].slice(1,a[2].length-1):n["xmlns:"===a[1].slice(0,6)?"xmlns"+a[1].slice(6):a[1].slice(i+1)]=a[2].slice(1,a[2].length-1);return n}function xl(e){var t={};if(1===e.split(/\s+/).length)return t;var r,n,a,i=e.match(yl);if(i)for(a=0;a!=i.length;++a)-1===(n=(r=i[a].match(vl))[1].indexOf(":"))?t[r[1]]=r[2].slice(1,r[2].length-1):t["xmlns:"===r[1].slice(0,6)?"xmlns"+r[1].slice(6):r[1].slice(n+1)]=r[2].slice(1,r[2].length-1);return t}function _l(e,t,r,n){var a=n;switch((r[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":a=Re(n);break;case"i2":case"int":a=parseInt(n,10);break;case"r4":case"float":a=parseFloat(n);break;case"date":case"dateTime.tz":a=Q(n);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+r[0])}e[Se(t)]=a}function wl(e,t,r){if(r.cellStyles&&t.Interior){var n=t.Interior;n.Pattern&&(n.patternType=Mi[n.Pattern]||n.Pattern)}e[t.ID]=t}function kl(e,t,r,n,a,i,o,s,l,c){var u="General",f=n.StyleID,p={};c=c||{};var h=[],d=0;for(void 0===f&&s&&(f=s.StyleID),void 0===f&&o&&(f=o.StyleID);void 0!==i[f]&&(i[f].nf&&(u=i[f].nf),i[f].Interior&&h.push(i[f].Interior),i[f].Parent);)f=i[f].Parent;switch(r.Type){case"Boolean":n.t="b",n.v=Re(e);break;case"String":n.t="s",n.r=Pe(Se(e)),n.v=e.indexOf("<")>-1?Se(t||e).replace(/<.*?>/g,""):n.r;break;case"DateTime":"Z"!=e.slice(-1)&&(e+="Z"),n.v=(Q(e)-new Date(Date.UTC(1899,11,30)))/864e5,n.v!=n.v?n.v=Se(e):n.v<60&&(n.v=n.v-1),u&&"General"!=u||(u="yyyy-mm-dd");case"Number":void 0===n.v&&(n.v=+e),n.t||(n.t="n");break;case"Error":n.t="e",n.v=$r[e],!1!==c.cellText&&(n.w=e);break;default:""==e&&""==t?n.t="z":(n.t="s",n.v=Pe(t||e))}if(function(e,t,r){if("z"!==e.t){if(!r||!1!==r.cellText)try{"e"===e.t?e.w=e.w||Ur[e.v]:"General"===t?"n"===e.t?(0|e.v)===e.v?e.w=E._general_int(e.v):e.w=E._general_num(e.v):e.w=E._general(e.v):e.w=(n=t||"General",a=e.v,"General"===(i=O[n]||Se(n))?E._general(a):E.format(i,a))}catch(e){if(r.WTF)throw e}var n,a,i;try{var o=O[t]||t||"General";if(r.cellNF&&(e.z=o),r.cellDates&&"n"==e.t&&E.is_date(o)){var s=E.parse_date_code(e.v);s&&(e.t="d",e.v=new Date(s.y,s.m-1,s.d,s.H,s.M,s.S,s.u))}}catch(e){if(r.WTF)throw e}}}(n,u,c),!1!==c.cellFormula)if(n.Formula){var m=Se(n.Formula);61==m.charCodeAt(0)&&(m=m.slice(1)),n.f=oo(m,a),delete n.Formula,"RC"==n.ArrayRange?n.F=oo("RC:RC",a):n.ArrayRange&&(n.F=oo(n.ArrayRange,a),l.push([er(n.F),n.F]))}else for(d=0;d<l.length;++d)a.r>=l[d][0].s.r&&a.r<=l[d][0].e.r&&a.c>=l[d][0].s.c&&a.c<=l[d][0].e.c&&(n.F=l[d][1]);c.cellStyles&&(h.forEach((function(e){!p.patternType&&e.patternType&&(p.patternType=e.patternType)})),n.s=p),void 0!==n.StyleID&&(n.ixfe=n.StyleID)}function Dl(e){e.t=e.v||"",e.t=e.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e.v=e.w=e.ixfe=void 0}function Tl(e){if(y&&Buffer.isBuffer(e))return e.toString("utf8");if("string"==typeof e)return e;if("undefined"!=typeof Uint8Array&&e instanceof Uint8Array)return Le(D(T(e)));throw new Error("Bad input format: expected Buffer or string")}var Al=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>/gm;function Sl(e,t){var r=t||{};C(E);var n=p(Tl(e));"binary"!=r.type&&"array"!=r.type&&"base64"!=r.type||(n="undefined"!=typeof cptable?cptable.utils.decode(65001,f(n)):Le(n));var a,i=n.slice(0,1024).toLowerCase(),o=!1;if((1023&i.indexOf(">"))>Math.min(1023&i.indexOf(","),1023&i.indexOf(";"))){var s=te(r);return s.type="string",La.to_workbook(n,s)}if(-1==i.indexOf("<?xml")&&["html","table","head","meta","script","style","div"].forEach((function(e){i.indexOf("<"+e)>=0&&(o=!0)})),o)return Kl.to_workbook(n,r);var l,c,u=[],h={},d=[],m=r.dense?[]:{},g="",y={},v={},b=bl('<Data ss:Type="String">'),x=0,_=0,w=0,k={s:{r:2e6,c:2e6},e:{r:0,c:0}},D={},T={},A="",S=0,M=[],N={},I={},P=0,R=[],L=[],F={},B=[],z=!1,j=[],U=[],$={},V=0,q=0,W={Sheets:[],WBProps:{date1904:!1}},H={};Al.lastIndex=0,n=n.replace(/<!--([\s\S]*?)-->/gm,"");for(var G="";a=Al.exec(n);)switch(a[3]=(G=a[3]).toLowerCase()){case"data":if("data"==G){if("/"===a[1]){if((l=u.pop())[0]!==a[3])throw new Error("Bad state: "+l.join("|"))}else"/"!==a[0].charAt(a[0].length-2)&&u.push([a[3],!0]);break}if(u[u.length-1][1])break;"/"===a[1]?kl(n.slice(x,a.index),A,b,"comment"==u[u.length-1][0]?F:y,{c:_,r:w},D,B[_],v,j,r):(A="",b=bl(a[0]),x=a.index+a[0].length);break;case"cell":if("/"===a[1])if(L.length>0&&(y.c=L),(!r.sheetRows||r.sheetRows>w)&&void 0!==y.v&&(r.dense?(m[w]||(m[w]=[]),m[w][_]=y):m[Yt(_)+Gt(w)]=y),y.HRef&&(y.l={Target:Se(y.HRef)},y.HRefScreenTip&&(y.l.Tooltip=y.HRefScreenTip),delete y.HRef,delete y.HRefScreenTip),(y.MergeAcross||y.MergeDown)&&(V=_+(0|parseInt(y.MergeAcross,10)),q=w+(0|parseInt(y.MergeDown,10)),M.push({s:{c:_,r:w},e:{c:V,r:q}})),r.sheetStubs)if(y.MergeAcross||y.MergeDown){for(var X=_;X<=V;++X)for(var Y=w;Y<=q;++Y)(X>_||Y>w)&&(r.dense?(m[Y]||(m[Y]=[]),m[Y][X]={t:"z"}):m[Yt(X)+Gt(Y)]={t:"z"});_=V+1}else++_;else y.MergeAcross?_=V+1:++_;else(y=xl(a[0])).Index&&(_=+y.Index-1),_<k.s.c&&(k.s.c=_),_>k.e.c&&(k.e.c=_),"/>"===a[0].slice(-2)&&++_,L=[];break;case"row":"/"===a[1]||"/>"===a[0].slice(-2)?(w<k.s.r&&(k.s.r=w),w>k.e.r&&(k.e.r=w),"/>"===a[0].slice(-2)&&(v=bl(a[0])).Index&&(w=+v.Index-1),_=0,++w):((v=bl(a[0])).Index&&(w=+v.Index-1),$={},("0"==v.AutoFitHeight||v.Height)&&($.hpx=parseInt(v.Height,10),$.hpt=_i($.hpx),U[w]=$),"1"==v.Hidden&&($.hidden=!0,U[w]=$));break;case"worksheet":if("/"===a[1]){if((l=u.pop())[0]!==a[3])throw new Error("Bad state: "+l.join("|"));d.push(g),k.s.r<=k.e.r&&k.s.c<=k.e.c&&(m["!ref"]=Qt(k),r.sheetRows&&r.sheetRows<=k.e.r&&(m["!fullref"]=m["!ref"],k.e.r=r.sheetRows-1,m["!ref"]=Qt(k))),M.length&&(m["!merges"]=M),B.length>0&&(m["!cols"]=B),U.length>0&&(m["!rows"]=U),h[g]=m}else k={s:{r:2e6,c:2e6},e:{r:0,c:0}},w=_=0,u.push([a[3],!1]),l=bl(a[0]),g=Se(l.Name),m=r.dense?[]:{},M=[],j=[],U=[],H={name:g,Hidden:0},W.Sheets.push(H);break;case"table":if("/"===a[1]){if((l=u.pop())[0]!==a[3])throw new Error("Bad state: "+l.join("|"))}else{if("/>"==a[0].slice(-2))break;bl(a[0]),u.push([a[3],!1]),B=[],z=!1}break;case"style":"/"===a[1]?wl(D,T,r):T=bl(a[0]);break;case"numberformat":T.nf=Se(bl(a[0]).Format||"General"),O[T.nf]&&(T.nf=O[T.nf]);for(var Z=0;392!=Z&&E._table[Z]!=T.nf;++Z);if(392==Z)for(Z=57;392!=Z;++Z)if(null==E._table[Z]){E.load(T.nf,Z);break}break;case"column":if("table"!==u[u.length-1][0])break;if((c=bl(a[0])).Hidden&&(c.hidden=!0,delete c.Hidden),c.Width&&(c.wpx=parseInt(c.Width,10)),!z&&c.wpx>10){z=!0,di=6;for(var K=0;K<B.length;++K)B[K]&&xi(B[K])}z&&xi(c),B[c.Index-1||B.length]=c;for(var J=0;J<+c.Span;++J)B[B.length]=te(c);break;case"namedrange":if("/"===a[1])break;W.Names||(W.Names=[]);var Q=_e(a[0]),ee={Name:Q.Name,Ref:oo(Q.RefersTo.slice(1),{r:0,c:0})};W.Sheets.length>0&&(ee.Sheet=W.Sheets.length-1),W.Names.push(ee);break;case"namedcell":case"b":case"i":case"u":case"s":case"em":case"h2":case"h3":case"sub":case"sup":case"span":case"alignment":case"borders":case"border":case"protection":case"paragraphs":case"name":case"pixelsperinch":case"null":break;case"font":if("/>"===a[0].slice(-2))break;"/"===a[1]?A+=n.slice(S,a.index):S=a.index+a[0].length;break;case"interior":if(!r.cellStyles)break;T.Interior=bl(a[0]);break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if("/>"===a[0].slice(-2))break;"/"===a[1]?yn(N,G,n.slice(P,a.index)):P=a.index+a[0].length;break;case"styles":case"workbook":if("/"===a[1]){if((l=u.pop())[0]!==a[3])throw new Error("Bad state: "+l.join("|"))}else u.push([a[3],!1]);break;case"comment":if("/"===a[1]){if((l=u.pop())[0]!==a[3])throw new Error("Bad state: "+l.join("|"));Dl(F),L.push(F)}else u.push([a[3],!1]),F={a:(l=bl(a[0])).Author};break;case"autofilter":if("/"===a[1]){if((l=u.pop())[0]!==a[3])throw new Error("Bad state: "+l.join("|"))}else if("/"!==a[0].charAt(a[0].length-2)){var re=bl(a[0]);m["!autofilter"]={ref:oo(re.Range).replace(/\$/g,"")},u.push([a[3],!0])}break;case"datavalidation":if("/"===a[1]){if((l=u.pop())[0]!==a[3])throw new Error("Bad state: "+l.join("|"))}else"/"!==a[0].charAt(a[0].length-2)&&u.push([a[3],!0]);break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if("/"===a[1]){if((l=u.pop())[0]!==a[3])throw new Error("Bad state: "+l.join("|"))}else"/"!==a[0].charAt(a[0].length-2)&&u.push([a[3],!0]);break;default:if(0==u.length&&"document"==a[3])return ac(n,r);if(0==u.length&&"uof"==a[3])return ac(n,r);var ne=!0;switch(u[u.length-1][0]){case"officedocumentsettings":switch(a[3]){case"allowpng":case"removepersonalinformation":case"downloadcomponents":case"locationofcomponents":case"colors":case"color":case"index":case"rgb":case"targetscreensize":case"readonlyrecommended":break;default:ne=!1}break;case"componentoptions":switch(a[3]){case"toolbar":case"hideofficelogo":case"spreadsheetautofit":case"label":case"caption":case"maxheight":case"maxwidth":case"nextsheetnumber":break;default:ne=!1}break;case"excelworkbook":switch(a[3]){case"date1904":W.WBProps.date1904=!0;break;case"windowheight":case"windowwidth":case"windowtopx":case"windowtopy":case"tabratio":case"protectstructure":case"protectwindow":case"protectwindows":case"activesheet":case"displayinknotes":case"firstvisiblesheet":case"supbook":case"sheetname":case"sheetindex":case"sheetindexfirst":case"sheetindexlast":case"dll":case"acceptlabelsinformulas":case"donotsavelinkvalues":case"iteration":case"maxiterations":case"maxchange":case"path":case"xct":case"count":case"selectedsheets":case"calculation":case"uncalced":case"startupprompt":case"crn":case"externname":case"formula":case"colfirst":case"collast":case"wantadvise":case"boolean":case"error":case"text":case"ole":case"noautorecover":case"publishobjects":case"donotcalculatebeforesave":case"number":case"refmoder1c1":case"embedsavesmarttags":break;default:ne=!1}break;case"workbookoptions":switch(a[3]){case"owcversion":case"height":case"width":break;default:ne=!1}break;case"worksheetoptions":switch(a[3]){case"visible":if("/>"===a[0].slice(-2));else if("/"===a[1])switch(n.slice(P,a.index)){case"SheetHidden":H.Hidden=1;break;case"SheetVeryHidden":H.Hidden=2}else P=a.index+a[0].length;break;case"header":m["!margins"]||hs(m["!margins"]={},"xlml"),m["!margins"].header=_e(a[0]).Margin;break;case"footer":m["!margins"]||hs(m["!margins"]={},"xlml"),m["!margins"].footer=_e(a[0]).Margin;break;case"pagemargins":var ae=_e(a[0]);m["!margins"]||hs(m["!margins"]={},"xlml"),ae.Top&&(m["!margins"].top=ae.Top),ae.Left&&(m["!margins"].left=ae.Left),ae.Right&&(m["!margins"].right=ae.Right),ae.Bottom&&(m["!margins"].bottom=ae.Bottom);break;case"displayrighttoleft":W.Views||(W.Views=[]),W.Views[0]||(W.Views[0]={}),W.Views[0].RTL=!0;break;case"freezepanes":case"frozennosplit":case"splithorizontal":case"splitvertical":case"donotdisplaygridlines":case"activerow":case"activecol":case"toprowbottompane":case"leftcolumnrightpane":case"unsynced":case"print":case"printerrors":case"panes":case"scale":case"pane":case"number":case"layout":case"pagesetup":case"selected":case"protectobjects":case"enableselection":case"protectscenarios":case"validprinterinfo":case"horizontalresolution":case"verticalresolution":case"numberofcopies":case"activepane":case"toprowvisible":case"leftcolumnvisible":case"fittopage":case"rangeselection":case"papersizeindex":case"pagelayoutzoom":case"pagebreakzoom":case"filteron":case"fitwidth":case"fitheight":case"commentslayout":case"zoom":case"lefttoright":case"gridlines":case"allowsort":case"allowfilter":case"allowinsertrows":case"allowdeleterows":case"allowinsertcols":case"allowdeletecols":case"allowinserthyperlinks":case"allowformatcells":case"allowsizecols":case"allowsizerows":case"tabcolorindex":case"donotdisplayheadings":case"showpagelayoutzoom":case"blackandwhite":case"donotdisplayzeros":case"displaypagebreak":case"rowcolheadings":case"donotdisplayoutline":case"noorientation":case"allowusepivottables":case"zeroheight":case"viewablerange":case"selection":case"protectcontents":break;case"nosummaryrowsbelowdetail":m["!outline"]||(m["!outline"]={}),m["!outline"].above=!0;break;case"nosummarycolumnsrightdetail":m["!outline"]||(m["!outline"]={}),m["!outline"].left=!0;break;default:ne=!1}break;case"pivottable":case"pivotcache":switch(a[3]){case"immediateitemsondrop":case"showpagemultipleitemlabel":case"compactrowindent":case"location":case"pivotfield":case"orientation":case"layoutform":case"layoutsubtotallocation":case"layoutcompactrow":case"position":case"pivotitem":case"datatype":case"datafield":case"sourcename":case"parentfield":case"ptlineitems":case"ptlineitem":case"countofsameitems":case"item":case"itemtype":case"ptsource":case"cacheindex":case"consolidationreference":case"filename":case"reference":case"nocolumngrand":case"norowgrand":case"blanklineafteritems":case"hidden":case"subtotal":case"basefield":case"mapchilditems":case"function":case"refreshonfileopen":case"printsettitles":case"mergelabels":case"defaultversion":case"refreshname":case"refreshdate":case"refreshdatecopy":case"versionlastrefresh":case"versionlastupdate":case"versionupdateablemin":case"versionrefreshablemin":case"calculation":break;default:ne=!1}break;case"pagebreaks":switch(a[3]){case"colbreaks":case"colbreak":case"rowbreaks":case"rowbreak":case"colstart":case"colend":case"rowend":break;default:ne=!1}break;case"autofilter":switch(a[3]){case"autofiltercolumn":case"autofiltercondition":case"autofilterand":case"autofilteror":break;default:ne=!1}break;case"querytable":switch(a[3]){case"id":case"autoformatfont":case"autoformatpattern":case"querysource":case"querytype":case"enableredirections":case"refreshedinxl9":case"urlstring":case"htmltables":case"connection":case"commandtext":case"refreshinfo":case"notitles":case"nextid":case"columninfo":case"overwritecells":case"donotpromptforfile":case"textwizardsettings":case"source":case"number":case"decimal":case"thousandseparator":case"trailingminusnumbers":case"formatsettings":case"fieldtype":case"delimiters":case"tab":case"comma":case"autoformatname":case"versionlastedit":case"versionlastrefresh":break;default:ne=!1}break;case"datavalidation":switch(a[3]){case"range":case"type":case"min":case"max":case"sort":case"descending":case"order":case"casesensitive":case"value":case"errorstyle":case"errormessage":case"errortitle":case"inputmessage":case"inputtitle":case"combohide":case"inputhide":case"condition":case"qualifier":case"useblank":case"value1":case"value2":case"format":case"cellrangelist":break;default:ne=!1}break;case"sorting":case"conditionalformatting":switch(a[3]){case"range":case"type":case"min":case"max":case"sort":case"descending":case"order":case"casesensitive":case"value":case"errorstyle":case"errormessage":case"errortitle":case"cellrangelist":case"inputmessage":case"inputtitle":case"combohide":case"inputhide":case"condition":case"qualifier":case"useblank":case"value1":case"value2":case"format":break;default:ne=!1}break;case"mapinfo":case"schema":case"data":switch(a[3]){case"map":case"entry":case"range":case"xpath":case"field":case"xsdtype":case"filteron":case"aggregate":case"elementtype":case"attributetype":case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":case"row":break;default:ne=!1}break;case"smarttags":break;default:ne=!1}if(ne)break;if(a[3].match(/!\[CDATA/))break;if(!u[u.length-1][1])throw"Unrecognized tag: "+a[3]+"|"+u.join("|");if("customdocumentproperties"===u[u.length-1][0]){if("/>"===a[0].slice(-2))break;"/"===a[1]?_l(I,G,R,n.slice(P,a.index)):(R=a,P=a.index+a[0].length);break}if(r.WTF)throw"Unrecognized tag: "+a[3]+"|"+u.join("|")}var ie={};return r.bookSheets||r.bookProps||(ie.Sheets=h),ie.SheetNames=d,ie.Workbook=W,ie.SSF=E.get_table(),ie.Props=N,ie.Custprops=I,ie}function Ml(e,t){switch(xc(t=t||{}),t.type||"base64"){case"base64":return Sl(g.decode(e),t);case"binary":case"buffer":case"file":return Sl(e,t);case"array":return Sl(D(e),t)}}function El(e){return Qe("NamedRange",null,{"ss:Name":e.Name,"ss:RefersTo":"="+lo(e.Ref,{r:0,c:0})})}function Cl(e,t,r,n,a,i,o){if(!e||null==e.v&&null==e.f)return"";var s={};if(e.f&&(s["ss:Formula"]="="+Ce(lo(e.f,o))),e.F&&e.F.slice(0,t.length)==t){var l=Zt(e.F.slice(t.length+1));s["ss:ArrayRange"]="RC:R"+(l.r==o.r?"":"["+(l.r-o.r)+"]")+"C"+(l.c==o.c?"":"["+(l.c-o.c)+"]")}if(e.l&&e.l.Target&&(s["ss:HRef"]=Ce(e.l.Target),e.l.Tooltip&&(s["x:HRefScreenTip"]=Ce(e.l.Tooltip))),r["!merges"])for(var c=r["!merges"],u=0;u!=c.length;++u)c[u].s.c==o.c&&c[u].s.r==o.r&&(c[u].e.c>c[u].s.c&&(s["ss:MergeAcross"]=c[u].e.c-c[u].s.c),c[u].e.r>c[u].s.r&&(s["ss:MergeDown"]=c[u].e.r-c[u].s.r));var f="",p="";switch(e.t){case"z":if(!n.sheetStubs)return"";break;case"n":f="Number",p=String(e.v);break;case"b":f="Boolean",p=e.v?"1":"0";break;case"e":f="Error",p=Ur[e.v];break;case"d":f="DateTime",p=new Date(e.v).toISOString(),null==e.z&&(e.z=e.z||E._table[14]);break;case"s":f="String",p=((e.v||"")+"").replace(Me,(function(e){return Ae[e]})).replace(Oe,(function(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}))}var h=ds(n.cellXfs,e,n);s["ss:StyleID"]="s"+(21+h),s["ss:Index"]=o.c+1;var d=null!=e.v?p:"",m="z"==e.t?"":'<Data ss:Type="'+f+'">'+d+"</Data>";return(e.c||[]).length>0&&(m+=e.c.map((function(e){var t=Qe("ss:Data",(e.t||"").replace(/(\r\n|[\r\n])/g,"&#10;"),{xmlns:"http://www.w3.org/TR/REC-html40"});return Qe("Comment",t,{"ss:Author":e.a})})).join("")),Qe("Cell",m,s)}function Nl(e,t){var r='<Row ss:Index="'+(e+1)+'"';return t&&(t.hpt&&!t.hpx&&(t.hpx=wi(t.hpt)),t.hpx&&(r+=' ss:AutoFitHeight="0" ss:Height="'+t.hpx+'"'),t.hidden&&(r+=' ss:Hidden="1"')),r+">"}function Ol(e,t,r){var n=[],a=r.SheetNames[e],i=r.Sheets[a],o=i?function(e,t,r,n){if(!e)return"";if(!((n||{}).Workbook||{}).Names)return"";for(var a=n.Workbook.Names,i=[],o=0;o<a.length;++o){var s=a[o];s.Sheet==r&&(s.Name.match(/^_xlfn\./)||i.push(El(s)))}return i.join("")}(i,0,e,r):"";return o.length>0&&n.push("<Names>"+o+"</Names>"),o=i?function(e,t,r,n){if(!e["!ref"])return"";var a=er(e["!ref"]),i=e["!merges"]||[],o=0,s=[];e["!cols"]&&e["!cols"].forEach((function(e,t){xi(e);var r=!!e.width,n=ps(t,e),a={"ss:Index":t+1};r&&(a["ss:Width"]=mi(n.width)),e.hidden&&(a["ss:Hidden"]="1"),s.push(Qe("Column",null,a))}));for(var l=Array.isArray(e),c=a.s.r;c<=a.e.r;++c){for(var u=[Nl(c,(e["!rows"]||[])[c])],f=a.s.c;f<=a.e.c;++f){var p=!1;for(o=0;o!=i.length;++o)if(!(i[o].s.c>f||i[o].s.r>c||i[o].e.c<f||i[o].e.r<c)){i[o].s.c==f&&i[o].s.r==c||(p=!0);break}if(!p){var h={r:c,c:f},d=Kt(h),m=l?(e[c]||[])[f]:e[d];u.push(Cl(m,d,e,t,0,0,h))}}u.push("</Row>"),u.length>2&&s.push(u.join(""))}return s.join("")}(i,t):"",o.length>0&&n.push("<Table>"+o+"</Table>"),n.push(function(e,t,r,n){if(!e)return"";var a=[];if(e["!margins"]&&(a.push("<PageSetup>"),e["!margins"].header&&a.push(Qe("Header",null,{"x:Margin":e["!margins"].header})),e["!margins"].footer&&a.push(Qe("Footer",null,{"x:Margin":e["!margins"].footer})),a.push(Qe("PageMargins",null,{"x:Bottom":e["!margins"].bottom||"0.75","x:Left":e["!margins"].left||"0.7","x:Right":e["!margins"].right||"0.7","x:Top":e["!margins"].top||"0.75"})),a.push("</PageSetup>")),n&&n.Workbook&&n.Workbook.Sheets&&n.Workbook.Sheets[r])if(n.Workbook.Sheets[r].Hidden)a.push(Qe("Visible",1==n.Workbook.Sheets[r].Hidden?"SheetHidden":"SheetVeryHidden",{}));else{for(var i=0;i<r&&(!n.Workbook.Sheets[i]||n.Workbook.Sheets[i].Hidden);++i);i==r&&a.push("<Selected/>")}return((((n||{}).Workbook||{}).Views||[])[0]||{}).RTL&&a.push("<DisplayRightToLeft/>"),e["!protect"]&&(a.push(Ke("ProtectContents","True")),e["!protect"].objects&&a.push(Ke("ProtectObjects","True")),e["!protect"].scenarios&&a.push(Ke("ProtectScenarios","True")),null==e["!protect"].selectLockedCells||e["!protect"].selectLockedCells?null==e["!protect"].selectUnlockedCells||e["!protect"].selectUnlockedCells||a.push(Ke("EnableSelection","UnlockedCells")):a.push(Ke("EnableSelection","NoSelection")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach((function(t){e["!protect"][t[0]]&&a.push("<"+t[1]+"/>")}))),0==a.length?"":Qe("WorksheetOptions",a.join(""),{xmlns:it})}(i,0,e,r)),n.join("")}function Il(e,t){t||(t={}),e.SSF||(e.SSF=E.get_table()),e.SSF&&(C(E),E.load_table(e.SSF),t.revssf=V(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF,t.cellXfs=[],ds(t.cellXfs,{},{revssf:{General:0}}));var r=[];r.push(function(e,t){var r=[];return e.Props&&r.push(function(e,t){var r=[];return z(mn).map((function(e){for(var t=0;t<an.length;++t)if(an[t][1]==e)return an[t];for(t=0;t<un.length;++t)if(un[t][1]==e)return un[t];throw e})).forEach((function(n){if(null!=e[n[1]]){var a=t&&t.Props&&null!=t.Props[n[1]]?t.Props[n[1]]:e[n[1]];"date"===n[2]&&(a=new Date(a).toISOString().replace(/\.\d*Z/,"Z")),"number"==typeof a?a=String(a):!0===a||!1===a?a=a?"1":"0":a instanceof Date&&(a=new Date(a).toISOString().replace(/\.\d*Z/,"")),r.push(Ke(mn[n[1]]||n[1],a))}})),Qe("DocumentProperties",r.join(""),{xmlns:at})}(e.Props,t)),e.Custprops&&r.push(function(e,t){var r=["Worksheets","SheetNames"],n="CustomDocumentProperties",a=[];return e&&z(e).forEach((function(t){if(Object.prototype.hasOwnProperty.call(e,t)){for(var n=0;n<an.length;++n)if(t==an[n][1])return;for(n=0;n<un.length;++n)if(t==un[n][1])return;for(n=0;n<r.length;++n)if(t==r[n])return;var i=e[t],o="string";"number"==typeof i?(o="float",i=String(i)):!0===i||!1===i?(o="boolean",i=i?"1":"0"):i=String(i),a.push(Qe(Ne(t),i,{"dt:dt":o}))}})),t&&z(t).forEach((function(r){if(Object.prototype.hasOwnProperty.call(t,r)&&(!e||!Object.prototype.hasOwnProperty.call(e,r))){var n=t[r],i="string";"number"==typeof n?(i="float",n=String(n)):!0===n||!1===n?(i="boolean",n=n?"1":"0"):n instanceof Date?(i="dateTime.tz",n=n.toISOString()):n=String(n),a.push(Qe(Ne(r),n,{"dt:dt":i}))}})),"<"+n+' xmlns="'+at+'">'+a.join("")+"</"+n+">"}(e.Props,e.Custprops)),r.join("")}(e,t)),r.push(""),r.push(""),r.push("");for(var n=0;n<e.SheetNames.length;++n)r.push(Qe("Worksheet",Ol(n,t,e),{"ss:Name":Ce(e.SheetNames[n])}));return r[2]=function(e,t){var r=['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];return t.cellXfs.forEach((function(e,t){var n=[];n.push(Qe("NumberFormat",null,{"ss:Format":Ce(E._table[e.numFmtId])}));var a={"ss:ID":"s"+(21+t)};r.push(Qe("Style",n.join(""),a))})),Qe("Styles",r.join(""))}(0,t),r[3]=function(e){if(!((e||{}).Workbook||{}).Names)return"";for(var t=e.Workbook.Names,r=[],n=0;n<t.length;++n){var a=t[n];null==a.Sheet&&(a.Name.match(/^_xlfn\./)||r.push(El(a)))}return Qe("Names",r.join(""))}(e),ge+Qe("Workbook",r.join(""),{xmlns:ot,"xmlns:o":at,"xmlns:x":it,"xmlns:ss":ot,"xmlns:dt":"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882","xmlns:html":"http://www.w3.org/TR/REC-html40"})}function Pl(e,t,r,n){var a=r,i=[],o=t.slice(t.l,t.l+a);if(n&&n.enc&&n.enc.insitu&&o.length>0)switch(e.n){case"BOF":case"FilePass":case"FileLock":case"InterfaceHdr":case"RRDInfo":case"RRDHead":case"UsrExcl":case"EOF":case"BoundSheet8":break;default:n.enc.insitu(o)}i.push(o),t.l+=a;for(var s=$l[St(t,t.l)],l=0;null!=s&&"Continue"===s.n.slice(0,8);)a=St(t,t.l+2),l=t.l+4,"ContinueFrt"==s.n?l+=4:"ContinueFrt"==s.n.slice(0,11)&&(l+=12),o=t.slice(l,t.l+4+a),i.push(o),t.l+=4+a,s=$l[St(t,t.l)];var c=A(i);Lt(c,0);var u=0;c.lens=[];for(var f=0;f<i.length;++f)c.lens.push(u),u+=i[f].length;if(c.length<r)throw"XLS Record "+(e&&e.n||"??")+" Truncated: "+c.length+" < "+r;return e.f(c,c.length,n)}function Rl(e,t,r){if("z"!==e.t&&e.XF){var n=0;try{n=e.z||e.XF.numFmtId||0,t.cellNF&&(e.z=E._table[n])}catch(e){if(t.WTF)throw e}if(!t||!1!==t.cellText)try{"e"===e.t?e.w=e.w||Ur[e.v]:0===n||"General"==n?"n"===e.t?(0|e.v)===e.v?e.w=E._general_int(e.v):e.w=E._general_num(e.v):e.w=E._general(e.v):e.w=E.format(n,e.v,{date1904:!!r,dateNF:t&&t.dateNF})}catch(e){if(t.WTF)throw e}if(t.cellDates&&n&&"n"==e.t&&E.is_date(E._table[n]||String(n))){var a=E.parse_date_code(e.v);a&&(e.t="d",e.v=new Date(a.y,a.m-1,a.d,a.H,a.M,a.S,a.u))}}}function Ll(e,t,r){return{v:e,ixfe:t,t:r}}var Fl="e0859ff2f94f6810ab9108002b27b3d9",Bl="02d5cdd59c2e1b10939708002b2cf9ae";function zl(e,t){var r,n,a,i;if(t||(t={}),xc(t),u(),t.codepage&&l(t.codepage),e.FullPaths){if(L.find(e,"/encryption"))throw new Error("File is password-protected");r=L.find(e,"!CompObj"),n=L.find(e,"/Workbook")||L.find(e,"/Book")}else{switch(t.type){case"base64":e=w(g.decode(e));break;case"binary":e=w(e);break;case"buffer":break;case"array":Array.isArray(e)||(e=Array.prototype.slice.call(e))}Lt(e,0),n={content:e}}if(r&&function(e){var t={},r=e.content;if(r.l=28,t.AnsiUserType=r.read_shift(0,"lpstr-ansi"),t.AnsiClipboardFormat=function(e){return Cr(e,1)}(r),r.length-r.l<=4)return t;var n=r.read_shift(4);0==n||n>40||(r.l-=4,t.Reserved1=r.read_shift(0,"lpstr-ansi"),r.length-r.l<=4||1907505652!==(n=r.read_shift(4))||(t.UnicodeClipboardFormat=function(e){return Cr(e,2)}(r),0==(n=r.read_shift(4))||n>40||(r.l-=4,t.Reserved2=r.read_shift(0,"lpwstr"))))}(r),t.bookProps&&!t.bookSheets)a={};else{var o=y?"buffer":"array";if(n&&n.content)a=function(e,t){var r,n,a,i,o,s,l,u,f={opts:{}},p={},h=t.dense?[]:{},d={},m={},g=null,y=[],v="",b={},x="",_={},w=[],k=[],D=[],T={Sheets:[],WBProps:{date1904:!1},Views:[{}]},A={},S=function(e){return e<8?jr[e]:e<64&&D[e-8]||jr[e]},M=function(e,t,n){if(!(j>1||n.sheetRows&&e.r>=n.sheetRows)){if(n.cellStyles&&t.XF&&t.XF.data&&function(e,t,r){var n,a=t.XF.data;a&&a.patternType&&r&&r.cellStyles&&(t.s={},t.s.patternType=a.patternType,(n=pi(S(a.icvFore)))&&(t.s.fgColor={rgb:n}),(n=pi(S(a.icvBack)))&&(t.s.bgColor={rgb:n}))}(0,t,n),delete t.ixfe,delete t.XF,r=e,x=Kt(e),m&&m.s&&m.e||(m={s:{r:0,c:0},e:{r:0,c:0}}),e.r<m.s.r&&(m.s.r=e.r),e.c<m.s.c&&(m.s.c=e.c),e.r+1>m.e.r&&(m.e.r=e.r+1),e.c+1>m.e.c&&(m.e.c=e.c+1),n.cellFormula&&t.f)for(var a=0;a<w.length;++a)if(!(w[a][0].s.c>e.c||w[a][0].s.r>e.r||w[a][0].e.c<e.c||w[a][0].e.r<e.r)){t.F=Qt(w[a][0]),w[a][0].s.c==e.c&&w[a][0].s.r==e.r||delete t.f,t.f&&(t.f=""+Go(w[a][1],0,e,L,C));break}n.dense?(h[e.r]||(h[e.r]=[]),h[e.r][e.c]=t):h[x]=t}},C={enc:!1,sbcch:0,snames:[],sharedf:_,arrayf:w,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!t&&!!t.cellStyles,WTF:!!t&&!!t.wtf};t.password&&(C.password=t.password);var N=[],O=[],I=[],P=[],R=!1,L=[];L.SheetNames=C.snames,L.sharedf=C.sharedf,L.arrayf=C.arrayf,L.names=[],L.XTI=[];var F,B="",j=0,U=0,$=[],V=[];C.codepage=1200,c(1200);for(var q=!1;e.l<e.length-1;){var W=e.l,H=e.read_shift(2);if(0===H&&"EOF"===B)break;var G=e.l===e.length?0:e.read_shift(2),X=$l[H];if(X&&X.f){if(t.bookSheets&&"BoundSheet8"===B&&"BoundSheet8"!==X.n)break;if(B=X.n,2===X.r||12==X.r){var Y=e.read_shift(2);if(G-=2,!C.enc&&Y!==H&&((255&Y)<<8|Y>>8)!==H)throw new Error("rt mismatch: "+Y+"!="+H);12==X.r&&(e.l+=10,G-=10)}var Z={};Z="EOF"===X.n?X.f(e,G,C):Pl(X,e,G,C);var K=X.n;if(0==j&&"BOF"!=K)continue;switch(K){case"Date1904":f.opts.Date1904=T.WBProps.date1904=Z;break;case"WriteProtect":f.opts.WriteProtect=!0;break;case"FilePass":if(C.enc||(e.l=0),C.enc=Z,!t.password)throw new Error("File is password-protected");if(null==Z.valid)throw new Error("Encryption scheme unsupported");if(!Z.valid)throw new Error("Password is incorrect");break;case"WriteAccess":C.lastuser=Z;break;case"FileSharing":case"Template":case"BookBool":case"UsesELFs":case"MTRSettings":case"Uncalced":case"ExtSST":case"BookExt":case"RichTextStream":case"BkHim":case"Index":case"Prot4Rev":case"Prot4RevPass":break;case"CodePage":var J=Number(Z);switch(J){case 21010:J=1200;break;case 32768:J=1e4;break;case 32769:J=1252}c(C.codepage=J),q=!0;break;case"RRTabId":C.rrtabid=Z;break;case"WinProtect":C.winlocked=Z;break;case"RefreshAll":case"CalcCount":case"CalcDelta":case"CalcIter":case"CalcMode":case"CalcPrecision":case"CalcSaveRecalc":f.opts[K]=Z;break;case"CalcRefMode":C.CalcRefMode=Z;break;case"ForceFullCalculation":f.opts.FullCalc=Z;break;case"WsBool":Z.fDialog&&(h["!type"]="dialog"),Z.fBelow||((h["!outline"]||(h["!outline"]={})).above=!0),Z.fRight||((h["!outline"]||(h["!outline"]={})).left=!0);break;case"XF":k.push(Z);break;case"SupBook":L.push([Z]),L[L.length-1].XTI=[];break;case"ExternName":L[L.length-1].push(Z);break;case"Lbl":F={Name:Z.Name,Ref:Go(Z.rgce,0,null,L,C)},Z.itab>0&&(F.Sheet=Z.itab-1),L.names.push(F),L[0]||(L[0]=[],L[0].XTI=[]),L[L.length-1].push(Z),"_xlnm._FilterDatabase"==Z.Name&&Z.itab>0&&Z.rgce&&Z.rgce[0]&&Z.rgce[0][0]&&"PtgArea3d"==Z.rgce[0][0][0]&&(V[Z.itab-1]={ref:Qt(Z.rgce[0][0][1][2])});break;case"ExternCount":C.ExternCount=Z;break;case"ExternSheet":0==L.length&&(L[0]=[],L[0].XTI=[]),L[L.length-1].XTI=L[L.length-1].XTI.concat(Z),L.XTI=L.XTI.concat(Z);break;case"NameCmt":if(C.biff<8)break;null!=F&&(F.Comment=Z[1]);break;case"Protect":h["!protect"]=Z;break;case"Password":0!==Z&&C.WTF&&console.error("Password verifier: "+Z);break;case"BoundSheet8":d[Z.pos]=Z,C.snames.push(Z.name);break;case"EOF":if(--j)break;if(m.e){if(m.e.r>0&&m.e.c>0){if(m.e.r--,m.e.c--,h["!ref"]=Qt(m),t.sheetRows&&t.sheetRows<=m.e.r){var Q=m.e.r;m.e.r=t.sheetRows-1,h["!fullref"]=h["!ref"],h["!ref"]=Qt(m),m.e.r=Q}m.e.r++,m.e.c++}N.length>0&&(h["!merges"]=N),O.length>0&&(h["!objects"]=O),I.length>0&&(h["!cols"]=I),P.length>0&&(h["!rows"]=P),T.Sheets.push(A)}""===v?b=h:p[v]=h,h=t.dense?[]:{};break;case"BOF":if(8===C.biff&&(C.biff={9:2,521:3,1033:4}[H]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[Z.BIFFVer]||8),C.biffguess=0==Z.BIFFVer,0==Z.BIFFVer&&4096==Z.dt&&(C.biff=5,q=!0,c(C.codepage=28591)),8==C.biff&&0==Z.BIFFVer&&16==Z.dt&&(C.biff=2),j++)break;if(h=t.dense?[]:{},C.biff<8&&!q&&(q=!0,c(C.codepage=t.codepage||1252)),C.biff<5||0==Z.BIFFVer&&4096==Z.dt){""===v&&(v="Sheet1"),m={s:{r:0,c:0},e:{r:0,c:0}};var ee={pos:e.l-G,name:v};d[ee.pos]=ee,C.snames.push(v)}else v=(d[W]||{name:""}).name;32==Z.dt&&(h["!type"]="chart"),64==Z.dt&&(h["!type"]="macro"),N=[],O=[],C.arrayf=w=[],I=[],P=[],R=!1,A={Hidden:(d[W]||{hs:0}).hs,name:v};break;case"Number":case"BIFF2NUM":case"BIFF2INT":"chart"==h["!type"]&&(t.dense?(h[Z.r]||[])[Z.c]:h[Kt({c:Z.c,r:Z.r})])&&++Z.c,s={ixfe:Z.ixfe,XF:k[Z.ixfe]||{},v:Z.val,t:"n"},U>0&&(s.z=$[s.ixfe>>8&63]),Rl(s,t,f.opts.Date1904),M({c:Z.c,r:Z.r},s,t);break;case"BoolErr":s={ixfe:Z.ixfe,XF:k[Z.ixfe],v:Z.val,t:Z.t},U>0&&(s.z=$[s.ixfe>>8&63]),Rl(s,t,f.opts.Date1904),M({c:Z.c,r:Z.r},s,t);break;case"RK":s={ixfe:Z.ixfe,XF:k[Z.ixfe],v:Z.rknum,t:"n"},U>0&&(s.z=$[s.ixfe>>8&63]),Rl(s,t,f.opts.Date1904),M({c:Z.c,r:Z.r},s,t);break;case"MulRk":for(var te=Z.c;te<=Z.C;++te){var re=Z.rkrec[te-Z.c][0];s={ixfe:re,XF:k[re],v:Z.rkrec[te-Z.c][1],t:"n"},U>0&&(s.z=$[s.ixfe>>8&63]),Rl(s,t,f.opts.Date1904),M({c:te,r:Z.r},s,t)}break;case"Formula":if("String"==Z.val){g=Z;break}if((s=Ll(Z.val,Z.cell.ixfe,Z.tt)).XF=k[s.ixfe],t.cellFormula){var ne=Z.formula;if(ne&&ne[0]&&ne[0][0]&&"PtgExp"==ne[0][0][0]){var ae=ne[0][0][1][0],ie=ne[0][0][1][1],oe=Kt({r:ae,c:ie});_[oe]?s.f=""+Go(Z.formula,0,Z.cell,L,C):s.F=((t.dense?(h[ae]||[])[ie]:h[oe])||{}).F}else s.f=""+Go(Z.formula,0,Z.cell,L,C)}U>0&&(s.z=$[s.ixfe>>8&63]),Rl(s,t,f.opts.Date1904),M(Z.cell,s,t),g=Z;break;case"String":if(!g)throw new Error("String record expects Formula");g.val=Z,(s=Ll(Z,g.cell.ixfe,"s")).XF=k[s.ixfe],t.cellFormula&&(s.f=""+Go(g.formula,0,g.cell,L,C)),U>0&&(s.z=$[s.ixfe>>8&63]),Rl(s,t,f.opts.Date1904),M(g.cell,s,t),g=null;break;case"Array":w.push(Z);var se=Kt(Z[0].s);if(n=t.dense?(h[Z[0].s.r]||[])[Z[0].s.c]:h[se],t.cellFormula&&n){if(!g)break;if(!se||!n)break;n.f=""+Go(Z[1],0,Z[0],L,C),n.F=Qt(Z[0])}break;case"ShrFmla":if(!t.cellFormula)break;if(x){if(!g)break;_[Kt(g.cell)]=Z[0],((n=t.dense?(h[g.cell.r]||[])[g.cell.c]:h[Kt(g.cell)])||{}).f=""+Go(Z[0],0,r,L,C)}break;case"LabelSst":s=Ll(y[Z.isst].t,Z.ixfe,"s"),y[Z.isst].h&&(s.h=y[Z.isst].h),s.XF=k[s.ixfe],U>0&&(s.z=$[s.ixfe>>8&63]),Rl(s,t,f.opts.Date1904),M({c:Z.c,r:Z.r},s,t);break;case"Blank":t.sheetStubs&&(s={ixfe:Z.ixfe,XF:k[Z.ixfe],t:"z"},U>0&&(s.z=$[s.ixfe>>8&63]),Rl(s,t,f.opts.Date1904),M({c:Z.c,r:Z.r},s,t));break;case"MulBlank":if(t.sheetStubs)for(var le=Z.c;le<=Z.C;++le){var ce=Z.ixfe[le-Z.c];s={ixfe:ce,XF:k[ce],t:"z"},U>0&&(s.z=$[s.ixfe>>8&63]),Rl(s,t,f.opts.Date1904),M({c:le,r:Z.r},s,t)}break;case"RString":case"Label":case"BIFF2STR":(s=Ll(Z.val,Z.ixfe,"s")).XF=k[s.ixfe],U>0&&(s.z=$[s.ixfe>>8&63]),Rl(s,t,f.opts.Date1904),M({c:Z.c,r:Z.r},s,t);break;case"Dimensions":1===j&&(m=Z);break;case"SST":y=Z;break;case"Format":if(4==C.biff){$[U++]=Z[1];for(var ue=0;ue<U+163&&E._table[ue]!=Z[1];++ue);ue>=163&&E.load(Z[1],U+163)}else E.load(Z[1],Z[0]);break;case"BIFF2FORMAT":$[U++]=Z;for(var fe=0;fe<U+163&&E._table[fe]!=Z;++fe);fe>=163&&E.load(Z,U+163);break;case"MergeCells":N=N.concat(Z);break;case"Obj":O[Z.cmo[0]]=C.lastobj=Z;break;case"TxO":C.lastobj.TxO=Z;break;case"ImData":C.lastobj.ImData=Z;break;case"HLink":for(o=Z[0].s.r;o<=Z[0].e.r;++o)for(i=Z[0].s.c;i<=Z[0].e.c;++i)(n=t.dense?(h[o]||[])[i]:h[Kt({c:i,r:o})])&&(n.l=Z[1]);break;case"HLinkTooltip":for(o=Z[0].s.r;o<=Z[0].e.r;++o)for(i=Z[0].s.c;i<=Z[0].e.c;++i)(n=t.dense?(h[o]||[])[i]:h[Kt({c:i,r:o})])&&n.l&&(n.l.Tooltip=Z[1]);break;case"Note":if(C.biff<=5&&C.biff>=2)break;n=t.dense?(h[Z[0].r]||[])[Z[0].c]:h[Kt(Z[0])];var pe=O[Z[2]];n||(t.dense?(h[Z[0].r]||(h[Z[0].r]=[]),n=h[Z[0].r][Z[0].c]={t:"z"}):n=h[Kt(Z[0])]={t:"z"},m.e.r=Math.max(m.e.r,Z[0].r),m.s.r=Math.min(m.s.r,Z[0].r),m.e.c=Math.max(m.e.c,Z[0].c),m.s.c=Math.min(m.s.c,Z[0].c)),n.c||(n.c=[]),a={a:Z[1],t:pe.TxO.t},n.c.push(a);break;default:switch(X.n){case"ClrtClient":case"Selection":case"Header":case"Footer":case"HCenter":case"VCenter":case"Pls":case"GCW":case"LHRecord":case"DBCell":case"EntExU2":case"SxView":case"Sxvd":case"SXVI":case"SXVDEx":case"SxIvd":case"SXString":case"Sync":case"Addin":case"SXDI":case"SXLI":case"SXEx":case"QsiSXTag":case"Feat":case"FeatHdr":case"FeatHdr11":case"Feature11":case"Feature12":case"List12":case"RecalcId":case"DxGCol":case"Fbi":case"Fbi2":case"GelFrame":case"Font":case"XFCRC":case"Style":case"StyleExt":case"ScenarioProtect":case"ObjProtect":case"CondFmt12":case"Table":case"TableStyles":case"TableStyle":case"TableStyleElement":case"SXStreamID":case"SXVS":case"DConRef":case"SXAddl":case"DConBin":case"DConName":case"SXPI":case"SxFormat":case"SxSelect":case"SxRule":case"SxFilt":case"SxItm":case"SxDXF":case"ScenMan":case"DCon":case"CellWatch":case"PrintRowCol":case"PrintGrid":case"PrintSize":case"XCT":case"CRN":case"Scl":case"SheetExt":case"SheetExtOptional":case"ObNoMacros":case"ObProj":case"GUIDTypeLib":case"WOpt":case"PhoneticInfo":case"OleObjectSize":case"DXF":case"DXFN":case"DXFN12":case"DXFN12List":case"DXFN12NoCB":case"Dv":case"DVal":case"BRAI":case"Series":case"SeriesText":case"DConn":case"DbOrParamQry":case"DBQueryExt":case"OleDbConn":case"ExtString":case"IFmtRecord":case"CondFmt":case"CF":case"CF12":case"CFEx":case"Excel9File":case"Units":case"InterfaceHdr":case"Mms":case"InterfaceEnd":case"DSF":case"BuiltInFnGroupCount":case"Window1":case"HideObj":case"GridSet":case"Guts":case"UserBView":case"UserSViewBegin":case"UserSViewEnd":case"Pane":case"DefColWidth":break;case"XFExt":k[Z.ixfe],Z.ext.forEach((function(e){e[0]}));break;case"DefaultRowHeight":Z[1];break;case"ColInfo":if(!C.cellStyles)break;for(;Z.e>=Z.s;)I[Z.e--]={width:Z.w/256,level:Z.level||0,hidden:!!(1&Z.flags)},R||(R=!0,bi(Z.w/256)),xi(I[Z.e+1]);break;case"Row":var he={};null!=Z.level&&(P[Z.r]=he,he.level=Z.level),Z.hidden&&(P[Z.r]=he,he.hidden=!0),Z.hpt&&(P[Z.r]=he,he.hpt=Z.hpt,he.hpx=wi(Z.hpt));break;case"LeftMargin":case"RightMargin":case"TopMargin":case"BottomMargin":h["!margins"]||hs(h["!margins"]={}),h["!margins"][K.slice(0,-6).toLowerCase()]=Z;break;case"Setup":h["!margins"]||hs(h["!margins"]={}),h["!margins"].header=Z.header,h["!margins"].footer=Z.footer;break;case"Window2":Z.RTL&&(T.Views[0].RTL=!0);break;case"Country":l=Z;break;case"Palette":D=Z;break;case"Theme":u=Z;break;case"CodeName":v?A.CodeName=Z||A.name:T.WBProps.CodeName=Z||"ThisWorkbook";break;default:switch(X.n){case"Dat":case"Begin":case"End":case"StartBlock":case"EndBlock":case"Frame":case"Area":case"Axis":case"AxisLine":case"Tick":case"AxesUsed":case"CrtLayout12":case"CrtLayout12A":case"CrtLink":case"CrtLine":case"CrtMlFrt":case"CrtMlFrtContinue":case"LineFormat":case"AreaFormat":case"Chart":case"Chart3d":case"Chart3DBarShape":case"ChartFormat":case"ChartFrtInfo":case"PlotArea":case"PlotGrowth":case"SeriesList":case"SerParent":case"SerAuxTrend":case"DataFormat":case"SerToCrt":case"FontX":case"CatSerRange":case"AxcExt":case"SerFmt":case"ShtProps":case"DefaultText":case"Text":case"CatLab":case"DataLabExtContents":case"Legend":case"LegendException":case"Pie":case"Scatter":case"PieFormat":case"MarkerFormat":case"StartObject":case"EndObject":case"AlRuns":case"ObjectLink":case"SIIndex":case"AttachedLabel":case"YMult":case"Line":case"Bar":case"Surf":case"AxisParent":case"Pos":case"ValueRange":case"SXViewEx9":case"SXViewLink":case"PivotChartBits":case"SBaseRef":case"TextPropsStream":case"LnExt":case"MkrExt":case"CrtCoopt":case"Qsi":case"Qsif":case"Qsir":case"QsiSXTag":case"TxtQry":case"FilterMode":case"AutoFilter":case"AutoFilterInfo":case"AutoFilter12":case"DropDownObjIds":case"Sort":case"SortData":case"ShapePropsStream":case"MsoDrawing":case"MsoDrawingGroup":case"MsoDrawingSelection":case"WebPub":case"AutoWebPub":case"HeaderFooter":case"HFPicture":case"PLV":case"HorizontalPageBreaks":case"VerticalPageBreaks":case"Backup":case"CompressPictures":case"Compat12":case"Continue":case"ContinueFrt12":case"FrtFontList":case"FrtWrapper":break;default:switch(X.n){case"TabIdConf":case"Radar":case"RadarArea":case"DropBar":case"Intl":case"CoordList":case"SerAuxErrBar":case"BIFF2FONTCLR":case"BIFF2FMTCNT":case"BIFF2FONTXTRA":case"BIFF2XF":case"BIFF3XF":case"BIFF4XF":case"BIFF2XFINDEX":case"BIFF4FMTCNT":case"BIFF2ROW":case"BIFF2WINDOW2":case"SCENARIO":case"DConBin":case"PicF":case"DataLabExt":case"Lel":case"BopPop":case"BopPopCustom":case"RealTimeData":case"Name":case"LHNGraph":case"FnGroupName":case"AddMenu":case"LPr":case"ListObj":case"ListField":case"RRSort":case"BigName":case"ToolbarHdr":case"ToolbarEnd":case"DDEObjName":case"FRTArchId$":break;default:if(t.WTF)throw"Unrecognized Record "+X.n}}}}}else e.l+=G}return f.SheetNames=z(d).sort((function(e,t){return Number(e)-Number(t)})).map((function(e){return d[e].name})),t.bookSheets||(f.Sheets=p),!f.SheetNames.length&&b["!ref"]?(f.SheetNames.push("Sheet1"),f.Sheets&&(f.Sheets.Sheet1=b)):f.Preamble=b,f.Sheets&&V.forEach((function(e,t){f.Sheets[f.SheetNames[t]]["!autofilter"]=e})),f.Strings=y,f.SSF=E.get_table(),C.enc&&(f.Encryption=C.enc),u&&(f.Themes=u),f.Metadata={},void 0!==l&&(f.Metadata.Country=l),L.names.length>0&&(T.Names=L.names),f.Workbook=T,f}(n.content,t);else if((i=L.find(e,"PerfectOffice_MAIN"))&&i.content)a=Fa.to_workbook(i.content,(t.type=o,t));else{if(!(i=L.find(e,"NativeContent_MAIN"))||!i.content)throw new Error("Cannot find Workbook stream");a=Fa.to_workbook(i.content,(t.type=o,t))}t.bookVBA&&e.FullPaths&&L.find(e,"/_VBA_PROJECT_CUR/VBA/dir")&&(a.vbaraw=function(e){var t=L.utils.cfb_new({root:"R"});return e.FullPaths.forEach((function(r,n){if("/"!==r.slice(-1)&&r.match(/_VBA_PROJECT_CUR/)){var a=r.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");L.utils.cfb_add(t,a,e.FileIndex[n].content)}})),L.write(t)}(e))}var s={};return e.FullPaths&&function(e,t,r){var n=L.find(e,"!DocumentSummaryInformation");if(n&&n.size>0)try{var a=On(n,Pr,Bl);for(var i in a)t[i]=a[i]}catch(e){if(r.WTF)throw e}var o=L.find(e,"!SummaryInformation");if(o&&o.size>0)try{var s=On(o,Rr,Fl);for(var l in s)null==t[l]&&(t[l]=s[l])}catch(e){if(r.WTF)throw e}t.HeadingPairs&&t.TitlesOfParts&&(fn(t.HeadingPairs,t.TitlesOfParts,t,r),delete t.HeadingPairs,delete t.TitlesOfParts)}(e,s,t),a.Props=a.Custprops=s,t.bookFiles&&(a.cfb=e),a}var jl={0:{n:"BrtRowHdr",f:function(e,t){var r={},n=e.l+t;r.r=e.read_shift(4),e.l+=4;var a=e.read_shift(2);e.l+=1;var i=e.read_shift(1);return e.l=n,7&i&&(r.level=7&i),16&i&&(r.hidden=!0),32&i&&(r.hpt=a/20),r}},1:{n:"BrtCellBlank",f:function(e){return[fr(e)]}},2:{n:"BrtCellRk",f:function(e){return[fr(e),wr(e),"n"]}},3:{n:"BrtCellError",f:function(e){return[fr(e),e.read_shift(1),"e"]}},4:{n:"BrtCellBool",f:function(e){return[fr(e),e.read_shift(1),"b"]}},5:{n:"BrtCellReal",f:function(e){return[fr(e),Sr(e),"n"]}},6:{n:"BrtCellSt",f:function(e){return[fr(e),or(e),"str"]}},7:{n:"BrtCellIsst",f:function(e){return[fr(e),e.read_shift(4),"s"]}},8:{n:"BrtFmlaString",f:function(e,t,r){var n=e.l+t,a=fr(e);a.r=r["!row"];var i=[a,or(e),"str"];if(r.cellFormula){e.l+=2;var o=Qo(e,n-e.l,r);i[3]=Go(o,0,a,r.supbooks,r)}else e.l=n;return i}},9:{n:"BrtFmlaNum",f:function(e,t,r){var n=e.l+t,a=fr(e);a.r=r["!row"];var i=[a,Sr(e),"n"];if(r.cellFormula){e.l+=2;var o=Qo(e,n-e.l,r);i[3]=Go(o,0,a,r.supbooks,r)}else e.l=n;return i}},10:{n:"BrtFmlaBool",f:function(e,t,r){var n=e.l+t,a=fr(e);a.r=r["!row"];var i=[a,e.read_shift(1),"b"];if(r.cellFormula){e.l+=2;var o=Qo(e,n-e.l,r);i[3]=Go(o,0,a,r.supbooks,r)}else e.l=n;return i}},11:{n:"BrtFmlaError",f:function(e,t,r){var n=e.l+t,a=fr(e);a.r=r["!row"];var i=[a,e.read_shift(1),"e"];if(r.cellFormula){e.l+=2;var o=Qo(e,n-e.l,r);i[3]=Go(o,0,a,r.supbooks,r)}else e.l=n;return i}},12:{n:"BrtShortBlank",f:function(e){return[hr(e)]}},13:{n:"BrtShortRk",f:function(e){return[hr(e),wr(e),"n"]}},14:{n:"BrtShortError",f:function(e){return[hr(e),e.read_shift(1),"e"]}},15:{n:"BrtShortBool",f:function(e){return[hr(e),e.read_shift(1),"b"]}},16:{n:"BrtShortReal",f:Ws},17:{n:"BrtShortSt",f:function(e){return[hr(e),or(e),"str"]}},18:{n:"BrtShortIsst",f:function(e){return[hr(e),e.read_shift(4),"s"]}},19:{n:"BrtSSTItem",f:cr},20:{n:"BrtPCDIMissing"},21:{n:"BrtPCDINumber"},22:{n:"BrtPCDIBoolean"},23:{n:"BrtPCDIError"},24:{n:"BrtPCDIString"},25:{n:"BrtPCDIDatetime"},26:{n:"BrtPCDIIndex"},27:{n:"BrtPCDIAMissing"},28:{n:"BrtPCDIANumber"},29:{n:"BrtPCDIABoolean"},30:{n:"BrtPCDIAError"},31:{n:"BrtPCDIAString"},32:{n:"BrtPCDIADatetime"},33:{n:"BrtPCRRecord"},34:{n:"BrtPCRRecordDt"},35:{n:"BrtFRTBegin"},36:{n:"BrtFRTEnd"},37:{n:"BrtACBegin"},38:{n:"BrtACEnd"},39:{n:"BrtName",f:function(e,t,r){var n=e.l+t;e.l+=4,e.l+=1;var a=e.read_shift(4),i=br(e),o=es(e,0,r),s=yr(e);e.l=n;var l={Name:i,Ptg:o};return a<268435455&&(l.Sheet=a),s&&(l.Comment=s),l}},40:{n:"BrtIndexRowBlock"},42:{n:"BrtIndexBlock"},43:{n:"BrtFont",f:function(e,t,r){var n={};n.sz=e.read_shift(2)/20;var a=function(e){var t=e.read_shift(1);return e.l++,{fBold:1&t,fItalic:2&t,fUnderline:4&t,fStrikeout:8&t,fOutline:16&t,fShadow:32&t,fCondense:64&t,fExtend:128&t}}(e);switch(a.fItalic&&(n.italic=1),a.fCondense&&(n.condense=1),a.fExtend&&(n.extend=1),a.fShadow&&(n.shadow=1),a.fOutline&&(n.outline=1),a.fStrikeout&&(n.strike=1),700===e.read_shift(2)&&(n.bold=1),e.read_shift(2)){case 1:n.vertAlign="superscript";break;case 2:n.vertAlign="subscript"}var i=e.read_shift(1);0!=i&&(n.underline=i);var o=e.read_shift(1);o>0&&(n.family=o);var s=e.read_shift(1);switch(s>0&&(n.charset=s),e.l++,n.color=function(e){var t={},r=e.read_shift(1)>>>1,n=e.read_shift(1),a=e.read_shift(2,"i"),i=e.read_shift(1),o=e.read_shift(1),s=e.read_shift(1);switch(e.l++,r){case 0:t.auto=1;break;case 1:t.index=n;var l=jr[n];l&&(t.rgb=pi(l));break;case 2:t.rgb=pi([i,o,s]);break;case 3:t.theme=n}return 0!=a&&(t.tint=a>0?a/32767:a/32768),t}(e),e.read_shift(1)){case 1:n.scheme="major";break;case 2:n.scheme="minor"}return n.name=or(e),n}},44:{n:"BrtFmt",f:function(e,t){return[e.read_shift(2),or(e)]}},45:{n:"BrtFill",f:Li},46:{n:"BrtBorder",f:ji},47:{n:"BrtXF",f:function(e,t){var r=e.l+t,n=e.read_shift(2),a=e.read_shift(2);return e.l=r,{ixfe:n,numFmtId:a}}},48:{n:"BrtStyle"},49:{n:"BrtCellMeta"},50:{n:"BrtValueMeta"},51:{n:"BrtMdb"},52:{n:"BrtBeginFmd"},53:{n:"BrtEndFmd"},54:{n:"BrtBeginMdx"},55:{n:"BrtEndMdx"},56:{n:"BrtBeginMdxTuple"},57:{n:"BrtEndMdxTuple"},58:{n:"BrtMdxMbrIstr"},59:{n:"BrtStr"},60:{n:"BrtColInfo",f:Ma},62:{n:"BrtCellRString"},63:{n:"BrtCalcChainItem$",f:function(e){var t={};t.i=e.read_shift(4);var r={};r.r=e.read_shift(4),r.c=e.read_shift(4),t.r=Kt(r);var n=e.read_shift(1);return 2&n&&(t.l="1"),8&n&&(t.a="1"),t}},64:{n:"BrtDVal",f:function(){}},65:{n:"BrtSxvcellNum"},66:{n:"BrtSxvcellStr"},67:{n:"BrtSxvcellBool"},68:{n:"BrtSxvcellErr"},69:{n:"BrtSxvcellDate"},70:{n:"BrtSxvcellNil"},128:{n:"BrtFileVersion"},129:{n:"BrtBeginSheet"},130:{n:"BrtEndSheet"},131:{n:"BrtBeginBook",f:Ft,p:0},132:{n:"BrtEndBook"},133:{n:"BrtBeginWsViews"},134:{n:"BrtEndWsViews"},135:{n:"BrtBeginBookViews"},136:{n:"BrtEndBookViews"},137:{n:"BrtBeginWsView",f:function(e){var t=e.read_shift(2);return e.l+=28,{RTL:32&t}}},138:{n:"BrtEndWsView"},139:{n:"BrtBeginCsViews"},140:{n:"BrtEndCsViews"},141:{n:"BrtBeginCsView"},142:{n:"BrtEndCsView"},143:{n:"BrtBeginBundleShs"},144:{n:"BrtEndBundleShs"},145:{n:"BrtBeginSheetData"},146:{n:"BrtEndSheetData"},147:{n:"BrtWsProp",f:function(e,t){var r={},n=e[e.l];return++e.l,r.above=!(64&n),r.left=!(128&n),e.l+=18,r.name=mr(e,t-19),r}},148:{n:"BrtWsDim",f:Vs,p:16},151:{n:"BrtPane",f:function(){}},152:{n:"BrtSel"},153:{n:"BrtWbProp",f:function(e,t){var r={},n=e.read_shift(4);r.defaultThemeVersion=e.read_shift(4);var a=t>8?or(e):"";return a.length>0&&(r.CodeName=a),r.autoCompressPictures=!!(65536&n),r.backupFile=!!(64&n),r.checkCompatibility=!!(4096&n),r.date1904=!!(1&n),r.filterPrivacy=!!(8&n),r.hidePivotFieldList=!!(1024&n),r.promptedSolutions=!!(16&n),r.publishItems=!!(2048&n),r.refreshAllConnections=!!(262144&n),r.saveExternalLinkValues=!!(128&n),r.showBorderUnselectedTables=!!(4&n),r.showInkAnnotation=!!(32&n),r.showObjects=["all","placeholders","none"][n>>13&3],r.showPivotChartFilter=!!(32768&n),r.updateLinks=["userSet","never","always"][n>>8&3],r}},154:{n:"BrtWbFactoid"},155:{n:"BrtFileRecover"},156:{n:"BrtBundleSh",f:function(e,t){var r={};return r.Hidden=e.read_shift(4),r.iTabID=e.read_shift(4),r.strRelID=xr(e,t-8),r.name=or(e),r}},157:{n:"BrtCalcProp"},158:{n:"BrtBookView"},159:{n:"BrtBeginSst",f:function(e){return[e.read_shift(4),e.read_shift(4)]}},160:{n:"BrtEndSst"},161:{n:"BrtBeginAFilter",f:Tr},162:{n:"BrtEndAFilter"},163:{n:"BrtBeginFilterColumn"},164:{n:"BrtEndFilterColumn"},165:{n:"BrtBeginFilters"},166:{n:"BrtEndFilters"},167:{n:"BrtFilter"},168:{n:"BrtColorFilter"},169:{n:"BrtIconFilter"},170:{n:"BrtTop10Filter"},171:{n:"BrtDynamicFilter"},172:{n:"BrtBeginCustomFilters"},173:{n:"BrtEndCustomFilters"},174:{n:"BrtCustomFilter"},175:{n:"BrtAFilterDateGroupItem"},176:{n:"BrtMergeCell",f:Hs},177:{n:"BrtBeginMergeCells"},178:{n:"BrtEndMergeCells"},179:{n:"BrtBeginPivotCacheDef"},180:{n:"BrtEndPivotCacheDef"},181:{n:"BrtBeginPCDFields"},182:{n:"BrtEndPCDFields"},183:{n:"BrtBeginPCDField"},184:{n:"BrtEndPCDField"},185:{n:"BrtBeginPCDSource"},186:{n:"BrtEndPCDSource"},187:{n:"BrtBeginPCDSRange"},188:{n:"BrtEndPCDSRange"},189:{n:"BrtBeginPCDFAtbl"},190:{n:"BrtEndPCDFAtbl"},191:{n:"BrtBeginPCDIRun"},192:{n:"BrtEndPCDIRun"},193:{n:"BrtBeginPivotCacheRecords"},194:{n:"BrtEndPivotCacheRecords"},195:{n:"BrtBeginPCDHierarchies"},196:{n:"BrtEndPCDHierarchies"},197:{n:"BrtBeginPCDHierarchy"},198:{n:"BrtEndPCDHierarchy"},199:{n:"BrtBeginPCDHFieldsUsage"},200:{n:"BrtEndPCDHFieldsUsage"},201:{n:"BrtBeginExtConnection"},202:{n:"BrtEndExtConnection"},203:{n:"BrtBeginECDbProps"},204:{n:"BrtEndECDbProps"},205:{n:"BrtBeginECOlapProps"},206:{n:"BrtEndECOlapProps"},207:{n:"BrtBeginPCDSConsol"},208:{n:"BrtEndPCDSConsol"},209:{n:"BrtBeginPCDSCPages"},210:{n:"BrtEndPCDSCPages"},211:{n:"BrtBeginPCDSCPage"},212:{n:"BrtEndPCDSCPage"},213:{n:"BrtBeginPCDSCPItem"},214:{n:"BrtEndPCDSCPItem"},215:{n:"BrtBeginPCDSCSets"},216:{n:"BrtEndPCDSCSets"},217:{n:"BrtBeginPCDSCSet"},218:{n:"BrtEndPCDSCSet"},219:{n:"BrtBeginPCDFGroup"},220:{n:"BrtEndPCDFGroup"},221:{n:"BrtBeginPCDFGItems"},222:{n:"BrtEndPCDFGItems"},223:{n:"BrtBeginPCDFGRange"},224:{n:"BrtEndPCDFGRange"},225:{n:"BrtBeginPCDFGDiscrete"},226:{n:"BrtEndPCDFGDiscrete"},227:{n:"BrtBeginPCDSDTupleCache"},228:{n:"BrtEndPCDSDTupleCache"},229:{n:"BrtBeginPCDSDTCEntries"},230:{n:"BrtEndPCDSDTCEntries"},231:{n:"BrtBeginPCDSDTCEMembers"},232:{n:"BrtEndPCDSDTCEMembers"},233:{n:"BrtBeginPCDSDTCEMember"},234:{n:"BrtEndPCDSDTCEMember"},235:{n:"BrtBeginPCDSDTCQueries"},236:{n:"BrtEndPCDSDTCQueries"},237:{n:"BrtBeginPCDSDTCQuery"},238:{n:"BrtEndPCDSDTCQuery"},239:{n:"BrtBeginPCDSDTCSets"},240:{n:"BrtEndPCDSDTCSets"},241:{n:"BrtBeginPCDSDTCSet"},242:{n:"BrtEndPCDSDTCSet"},243:{n:"BrtBeginPCDCalcItems"},244:{n:"BrtEndPCDCalcItems"},245:{n:"BrtBeginPCDCalcItem"},246:{n:"BrtEndPCDCalcItem"},247:{n:"BrtBeginPRule"},248:{n:"BrtEndPRule"},249:{n:"BrtBeginPRFilters"},250:{n:"BrtEndPRFilters"},251:{n:"BrtBeginPRFilter"},252:{n:"BrtEndPRFilter"},253:{n:"BrtBeginPNames"},254:{n:"BrtEndPNames"},255:{n:"BrtBeginPName"},256:{n:"BrtEndPName"},257:{n:"BrtBeginPNPairs"},258:{n:"BrtEndPNPairs"},259:{n:"BrtBeginPNPair"},260:{n:"BrtEndPNPair"},261:{n:"BrtBeginECWebProps"},262:{n:"BrtEndECWebProps"},263:{n:"BrtBeginEcWpTables"},264:{n:"BrtEndECWPTables"},265:{n:"BrtBeginECParams"},266:{n:"BrtEndECParams"},267:{n:"BrtBeginECParam"},268:{n:"BrtEndECParam"},269:{n:"BrtBeginPCDKPIs"},270:{n:"BrtEndPCDKPIs"},271:{n:"BrtBeginPCDKPI"},272:{n:"BrtEndPCDKPI"},273:{n:"BrtBeginDims"},274:{n:"BrtEndDims"},275:{n:"BrtBeginDim"},276:{n:"BrtEndDim"},277:{n:"BrtIndexPartEnd"},278:{n:"BrtBeginStyleSheet"},279:{n:"BrtEndStyleSheet"},280:{n:"BrtBeginSXView"},281:{n:"BrtEndSXVI"},282:{n:"BrtBeginSXVI"},283:{n:"BrtBeginSXVIs"},284:{n:"BrtEndSXVIs"},285:{n:"BrtBeginSXVD"},286:{n:"BrtEndSXVD"},287:{n:"BrtBeginSXVDs"},288:{n:"BrtEndSXVDs"},289:{n:"BrtBeginSXPI"},290:{n:"BrtEndSXPI"},291:{n:"BrtBeginSXPIs"},292:{n:"BrtEndSXPIs"},293:{n:"BrtBeginSXDI"},294:{n:"BrtEndSXDI"},295:{n:"BrtBeginSXDIs"},296:{n:"BrtEndSXDIs"},297:{n:"BrtBeginSXLI"},298:{n:"BrtEndSXLI"},299:{n:"BrtBeginSXLIRws"},300:{n:"BrtEndSXLIRws"},301:{n:"BrtBeginSXLICols"},302:{n:"BrtEndSXLICols"},303:{n:"BrtBeginSXFormat"},304:{n:"BrtEndSXFormat"},305:{n:"BrtBeginSXFormats"},306:{n:"BrtEndSxFormats"},307:{n:"BrtBeginSxSelect"},308:{n:"BrtEndSxSelect"},309:{n:"BrtBeginISXVDRws"},310:{n:"BrtEndISXVDRws"},311:{n:"BrtBeginISXVDCols"},312:{n:"BrtEndISXVDCols"},313:{n:"BrtEndSXLocation"},314:{n:"BrtBeginSXLocation"},315:{n:"BrtEndSXView"},316:{n:"BrtBeginSXTHs"},317:{n:"BrtEndSXTHs"},318:{n:"BrtBeginSXTH"},319:{n:"BrtEndSXTH"},320:{n:"BrtBeginISXTHRws"},321:{n:"BrtEndISXTHRws"},322:{n:"BrtBeginISXTHCols"},323:{n:"BrtEndISXTHCols"},324:{n:"BrtBeginSXTDMPS"},325:{n:"BrtEndSXTDMPs"},326:{n:"BrtBeginSXTDMP"},327:{n:"BrtEndSXTDMP"},328:{n:"BrtBeginSXTHItems"},329:{n:"BrtEndSXTHItems"},330:{n:"BrtBeginSXTHItem"},331:{n:"BrtEndSXTHItem"},332:{n:"BrtBeginMetadata"},333:{n:"BrtEndMetadata"},334:{n:"BrtBeginEsmdtinfo"},335:{n:"BrtMdtinfo"},336:{n:"BrtEndEsmdtinfo"},337:{n:"BrtBeginEsmdb"},338:{n:"BrtEndEsmdb"},339:{n:"BrtBeginEsfmd"},340:{n:"BrtEndEsfmd"},341:{n:"BrtBeginSingleCells"},342:{n:"BrtEndSingleCells"},343:{n:"BrtBeginList"},344:{n:"BrtEndList"},345:{n:"BrtBeginListCols"},346:{n:"BrtEndListCols"},347:{n:"BrtBeginListCol"},348:{n:"BrtEndListCol"},349:{n:"BrtBeginListXmlCPr"},350:{n:"BrtEndListXmlCPr"},351:{n:"BrtListCCFmla"},352:{n:"BrtListTrFmla"},353:{n:"BrtBeginExternals"},354:{n:"BrtEndExternals"},355:{n:"BrtSupBookSrc",f:xr},357:{n:"BrtSupSelf"},358:{n:"BrtSupSame"},359:{n:"BrtSupTabs"},360:{n:"BrtBeginSupBook"},361:{n:"BrtPlaceholderName"},362:{n:"BrtExternSheet",f:ka},363:{n:"BrtExternTableStart"},364:{n:"BrtExternTableEnd"},366:{n:"BrtExternRowHdr"},367:{n:"BrtExternCellBlank"},368:{n:"BrtExternCellReal"},369:{n:"BrtExternCellBool"},370:{n:"BrtExternCellError"},371:{n:"BrtExternCellString"},372:{n:"BrtBeginEsmdx"},373:{n:"BrtEndEsmdx"},374:{n:"BrtBeginMdxSet"},375:{n:"BrtEndMdxSet"},376:{n:"BrtBeginMdxMbrProp"},377:{n:"BrtEndMdxMbrProp"},378:{n:"BrtBeginMdxKPI"},379:{n:"BrtEndMdxKPI"},380:{n:"BrtBeginEsstr"},381:{n:"BrtEndEsstr"},382:{n:"BrtBeginPRFItem"},383:{n:"BrtEndPRFItem"},384:{n:"BrtBeginPivotCacheIDs"},385:{n:"BrtEndPivotCacheIDs"},386:{n:"BrtBeginPivotCacheID"},387:{n:"BrtEndPivotCacheID"},388:{n:"BrtBeginISXVIs"},389:{n:"BrtEndISXVIs"},390:{n:"BrtBeginColInfos"},391:{n:"BrtEndColInfos"},392:{n:"BrtBeginRwBrk"},393:{n:"BrtEndRwBrk"},394:{n:"BrtBeginColBrk"},395:{n:"BrtEndColBrk"},396:{n:"BrtBrk"},397:{n:"BrtUserBookView"},398:{n:"BrtInfo"},399:{n:"BrtCUsr"},400:{n:"BrtUsr"},401:{n:"BrtBeginUsers"},403:{n:"BrtEOF"},404:{n:"BrtUCR"},405:{n:"BrtRRInsDel"},406:{n:"BrtRREndInsDel"},407:{n:"BrtRRMove"},408:{n:"BrtRREndMove"},409:{n:"BrtRRChgCell"},410:{n:"BrtRREndChgCell"},411:{n:"BrtRRHeader"},412:{n:"BrtRRUserView"},413:{n:"BrtRRRenSheet"},414:{n:"BrtRRInsertSh"},415:{n:"BrtRRDefName"},416:{n:"BrtRRNote"},417:{n:"BrtRRConflict"},418:{n:"BrtRRTQSIF"},419:{n:"BrtRRFormat"},420:{n:"BrtRREndFormat"},421:{n:"BrtRRAutoFmt"},422:{n:"BrtBeginUserShViews"},423:{n:"BrtBeginUserShView"},424:{n:"BrtEndUserShView"},425:{n:"BrtEndUserShViews"},426:{n:"BrtArrFmla",f:function(e,t,r){var n=e.l+t,a=Dr(e),i=e.read_shift(1),o=[a];if(o[2]=i,r.cellFormula){var s=Jo(e,n-e.l,r);o[1]=s}else e.l=n;return o}},427:{n:"BrtShrFmla",f:function(e,t,r){var n=e.l+t,a=[Tr(e,16)];if(r.cellFormula){var i=ts(e,n-e.l,r);a[1]=i,e.l=n}else e.l=n;return a}},428:{n:"BrtTable"},429:{n:"BrtBeginExtConnections"},430:{n:"BrtEndExtConnections"},431:{n:"BrtBeginPCDCalcMems"},432:{n:"BrtEndPCDCalcMems"},433:{n:"BrtBeginPCDCalcMem"},434:{n:"BrtEndPCDCalcMem"},435:{n:"BrtBeginPCDHGLevels"},436:{n:"BrtEndPCDHGLevels"},437:{n:"BrtBeginPCDHGLevel"},438:{n:"BrtEndPCDHGLevel"},439:{n:"BrtBeginPCDHGLGroups"},440:{n:"BrtEndPCDHGLGroups"},441:{n:"BrtBeginPCDHGLGroup"},442:{n:"BrtEndPCDHGLGroup"},443:{n:"BrtBeginPCDHGLGMembers"},444:{n:"BrtEndPCDHGLGMembers"},445:{n:"BrtBeginPCDHGLGMember"},446:{n:"BrtEndPCDHGLGMember"},447:{n:"BrtBeginQSI"},448:{n:"BrtEndQSI"},449:{n:"BrtBeginQSIR"},450:{n:"BrtEndQSIR"},451:{n:"BrtBeginDeletedNames"},452:{n:"BrtEndDeletedNames"},453:{n:"BrtBeginDeletedName"},454:{n:"BrtEndDeletedName"},455:{n:"BrtBeginQSIFs"},456:{n:"BrtEndQSIFs"},457:{n:"BrtBeginQSIF"},458:{n:"BrtEndQSIF"},459:{n:"BrtBeginAutoSortScope"},460:{n:"BrtEndAutoSortScope"},461:{n:"BrtBeginConditionalFormatting"},462:{n:"BrtEndConditionalFormatting"},463:{n:"BrtBeginCFRule"},464:{n:"BrtEndCFRule"},465:{n:"BrtBeginIconSet"},466:{n:"BrtEndIconSet"},467:{n:"BrtBeginDatabar"},468:{n:"BrtEndDatabar"},469:{n:"BrtBeginColorScale"},470:{n:"BrtEndColorScale"},471:{n:"BrtCFVO"},472:{n:"BrtExternValueMeta"},473:{n:"BrtBeginColorPalette"},474:{n:"BrtEndColorPalette"},475:{n:"BrtIndexedColor"},476:{n:"BrtMargins",f:function(e){var t={};return Xs.forEach((function(r){t[r]=Sr(e)})),t}},477:{n:"BrtPrintOptions"},478:{n:"BrtPageSetup"},479:{n:"BrtBeginHeaderFooter"},480:{n:"BrtEndHeaderFooter"},481:{n:"BrtBeginSXCrtFormat"},482:{n:"BrtEndSXCrtFormat"},483:{n:"BrtBeginSXCrtFormats"},484:{n:"BrtEndSXCrtFormats"},485:{n:"BrtWsFmtInfo",f:function(){}},486:{n:"BrtBeginMgs"},487:{n:"BrtEndMGs"},488:{n:"BrtBeginMGMaps"},489:{n:"BrtEndMGMaps"},490:{n:"BrtBeginMG"},491:{n:"BrtEndMG"},492:{n:"BrtBeginMap"},493:{n:"BrtEndMap"},494:{n:"BrtHLink",f:function(e,t){var r=e.l+t,n=Tr(e,16),a=yr(e),i=or(e),o=or(e),s=or(e);e.l=r;var l={rfx:n,relId:a,loc:i,display:s};return o&&(l.Tooltip=o),l}},495:{n:"BrtBeginDCon"},496:{n:"BrtEndDCon"},497:{n:"BrtBeginDRefs"},498:{n:"BrtEndDRefs"},499:{n:"BrtDRef"},500:{n:"BrtBeginScenMan"},501:{n:"BrtEndScenMan"},502:{n:"BrtBeginSct"},503:{n:"BrtEndSct"},504:{n:"BrtSlc"},505:{n:"BrtBeginDXFs"},506:{n:"BrtEndDXFs"},507:{n:"BrtDXF"},508:{n:"BrtBeginTableStyles"},509:{n:"BrtEndTableStyles"},510:{n:"BrtBeginTableStyle"},511:{n:"BrtEndTableStyle"},512:{n:"BrtTableStyleElement"},513:{n:"BrtTableStyleClient"},514:{n:"BrtBeginVolDeps"},515:{n:"BrtEndVolDeps"},516:{n:"BrtBeginVolType"},517:{n:"BrtEndVolType"},518:{n:"BrtBeginVolMain"},519:{n:"BrtEndVolMain"},520:{n:"BrtBeginVolTopic"},521:{n:"BrtEndVolTopic"},522:{n:"BrtVolSubtopic"},523:{n:"BrtVolRef"},524:{n:"BrtVolNum"},525:{n:"BrtVolErr"},526:{n:"BrtVolStr"},527:{n:"BrtVolBool"},528:{n:"BrtBeginCalcChain$"},529:{n:"BrtEndCalcChain$"},530:{n:"BrtBeginSortState"},531:{n:"BrtEndSortState"},532:{n:"BrtBeginSortCond"},533:{n:"BrtEndSortCond"},534:{n:"BrtBookProtection"},535:{n:"BrtSheetProtection"},536:{n:"BrtRangeProtection"},537:{n:"BrtPhoneticInfo"},538:{n:"BrtBeginECTxtWiz"},539:{n:"BrtEndECTxtWiz"},540:{n:"BrtBeginECTWFldInfoLst"},541:{n:"BrtEndECTWFldInfoLst"},542:{n:"BrtBeginECTwFldInfo"},548:{n:"BrtFileSharing"},549:{n:"BrtOleSize"},550:{n:"BrtDrawing",f:xr},551:{n:"BrtLegacyDrawing"},552:{n:"BrtLegacyDrawingHF"},553:{n:"BrtWebOpt"},554:{n:"BrtBeginWebPubItems"},555:{n:"BrtEndWebPubItems"},556:{n:"BrtBeginWebPubItem"},557:{n:"BrtEndWebPubItem"},558:{n:"BrtBeginSXCondFmt"},559:{n:"BrtEndSXCondFmt"},560:{n:"BrtBeginSXCondFmts"},561:{n:"BrtEndSXCondFmts"},562:{n:"BrtBkHim"},564:{n:"BrtColor"},565:{n:"BrtBeginIndexedColors"},566:{n:"BrtEndIndexedColors"},569:{n:"BrtBeginMRUColors"},570:{n:"BrtEndMRUColors"},572:{n:"BrtMRUColor"},573:{n:"BrtBeginDVals"},574:{n:"BrtEndDVals"},577:{n:"BrtSupNameStart"},578:{n:"BrtSupNameValueStart"},579:{n:"BrtSupNameValueEnd"},580:{n:"BrtSupNameNum"},581:{n:"BrtSupNameErr"},582:{n:"BrtSupNameSt"},583:{n:"BrtSupNameNil"},584:{n:"BrtSupNameBool"},585:{n:"BrtSupNameFmla"},586:{n:"BrtSupNameBits"},587:{n:"BrtSupNameEnd"},588:{n:"BrtEndSupBook"},589:{n:"BrtCellSmartTagProperty"},590:{n:"BrtBeginCellSmartTag"},591:{n:"BrtEndCellSmartTag"},592:{n:"BrtBeginCellSmartTags"},593:{n:"BrtEndCellSmartTags"},594:{n:"BrtBeginSmartTags"},595:{n:"BrtEndSmartTags"},596:{n:"BrtSmartTagType"},597:{n:"BrtBeginSmartTagTypes"},598:{n:"BrtEndSmartTagTypes"},599:{n:"BrtBeginSXFilters"},600:{n:"BrtEndSXFilters"},601:{n:"BrtBeginSXFILTER"},602:{n:"BrtEndSXFilter"},603:{n:"BrtBeginFills"},604:{n:"BrtEndFills"},605:{n:"BrtBeginCellWatches"},606:{n:"BrtEndCellWatches"},607:{n:"BrtCellWatch"},608:{n:"BrtBeginCRErrs"},609:{n:"BrtEndCRErrs"},610:{n:"BrtCrashRecErr"},611:{n:"BrtBeginFonts"},612:{n:"BrtEndFonts"},613:{n:"BrtBeginBorders"},614:{n:"BrtEndBorders"},615:{n:"BrtBeginFmts"},616:{n:"BrtEndFmts"},617:{n:"BrtBeginCellXFs"},618:{n:"BrtEndCellXFs"},619:{n:"BrtBeginStyles"},620:{n:"BrtEndStyles"},625:{n:"BrtBigName"},626:{n:"BrtBeginCellStyleXFs"},627:{n:"BrtEndCellStyleXFs"},628:{n:"BrtBeginComments"},629:{n:"BrtEndComments"},630:{n:"BrtBeginCommentAuthors"},631:{n:"BrtEndCommentAuthors"},632:{n:"BrtCommentAuthor",f:no},633:{n:"BrtBeginCommentList"},634:{n:"BrtEndCommentList"},635:{n:"BrtBeginComment",f:function(e){var t={};t.iauthor=e.read_shift(4);var r=Tr(e,16);return t.rfx=r.s,t.ref=Kt(r.s),e.l+=16,t}},636:{n:"BrtEndComment"},637:{n:"BrtCommentText",f:ur},638:{n:"BrtBeginOleObjects"},639:{n:"BrtOleObject"},640:{n:"BrtEndOleObjects"},641:{n:"BrtBeginSxrules"},642:{n:"BrtEndSxRules"},643:{n:"BrtBeginActiveXControls"},644:{n:"BrtActiveX"},645:{n:"BrtEndActiveXControls"},646:{n:"BrtBeginPCDSDTCEMembersSortBy"},648:{n:"BrtBeginCellIgnoreECs"},649:{n:"BrtCellIgnoreEC"},650:{n:"BrtEndCellIgnoreECs"},651:{n:"BrtCsProp",f:function(e,t){return e.l+=10,{name:or(e)}}},652:{n:"BrtCsPageSetup"},653:{n:"BrtBeginUserCsViews"},654:{n:"BrtEndUserCsViews"},655:{n:"BrtBeginUserCsView"},656:{n:"BrtEndUserCsView"},657:{n:"BrtBeginPcdSFCIEntries"},658:{n:"BrtEndPCDSFCIEntries"},659:{n:"BrtPCDSFCIEntry"},660:{n:"BrtBeginListParts"},661:{n:"BrtListPart"},662:{n:"BrtEndListParts"},663:{n:"BrtSheetCalcProp"},664:{n:"BrtBeginFnGroup"},665:{n:"BrtFnGroup"},666:{n:"BrtEndFnGroup"},667:{n:"BrtSupAddin"},668:{n:"BrtSXTDMPOrder"},669:{n:"BrtCsProtection"},671:{n:"BrtBeginWsSortMap"},672:{n:"BrtEndWsSortMap"},673:{n:"BrtBeginRRSort"},674:{n:"BrtEndRRSort"},675:{n:"BrtRRSortItem"},676:{n:"BrtFileSharingIso"},677:{n:"BrtBookProtectionIso"},678:{n:"BrtSheetProtectionIso"},679:{n:"BrtCsProtectionIso"},680:{n:"BrtRangeProtectionIso"},681:{n:"BrtDValList"},1024:{n:"BrtRwDescent"},1025:{n:"BrtKnownFonts"},1026:{n:"BrtBeginSXTupleSet"},1027:{n:"BrtEndSXTupleSet"},1028:{n:"BrtBeginSXTupleSetHeader"},1029:{n:"BrtEndSXTupleSetHeader"},1030:{n:"BrtSXTupleSetHeaderItem"},1031:{n:"BrtBeginSXTupleSetData"},1032:{n:"BrtEndSXTupleSetData"},1033:{n:"BrtBeginSXTupleSetRow"},1034:{n:"BrtEndSXTupleSetRow"},1035:{n:"BrtSXTupleSetRowItem"},1036:{n:"BrtNameExt"},1037:{n:"BrtPCDH14"},1038:{n:"BrtBeginPCDCalcMem14"},1039:{n:"BrtEndPCDCalcMem14"},1040:{n:"BrtSXTH14"},1041:{n:"BrtBeginSparklineGroup"},1042:{n:"BrtEndSparklineGroup"},1043:{n:"BrtSparkline"},1044:{n:"BrtSXDI14"},1045:{n:"BrtWsFmtInfoEx14"},1046:{n:"BrtBeginConditionalFormatting14"},1047:{n:"BrtEndConditionalFormatting14"},1048:{n:"BrtBeginCFRule14"},1049:{n:"BrtEndCFRule14"},1050:{n:"BrtCFVO14"},1051:{n:"BrtBeginDatabar14"},1052:{n:"BrtBeginIconSet14"},1053:{n:"BrtDVal14",f:function(){}},1054:{n:"BrtBeginDVals14"},1055:{n:"BrtColor14"},1056:{n:"BrtBeginSparklines"},1057:{n:"BrtEndSparklines"},1058:{n:"BrtBeginSparklineGroups"},1059:{n:"BrtEndSparklineGroups"},1061:{n:"BrtSXVD14"},1062:{n:"BrtBeginSXView14"},1063:{n:"BrtEndSXView14"},1064:{n:"BrtBeginSXView16"},1065:{n:"BrtEndSXView16"},1066:{n:"BrtBeginPCD14"},1067:{n:"BrtEndPCD14"},1068:{n:"BrtBeginExtConn14"},1069:{n:"BrtEndExtConn14"},1070:{n:"BrtBeginSlicerCacheIDs"},1071:{n:"BrtEndSlicerCacheIDs"},1072:{n:"BrtBeginSlicerCacheID"},1073:{n:"BrtEndSlicerCacheID"},1075:{n:"BrtBeginSlicerCache"},1076:{n:"BrtEndSlicerCache"},1077:{n:"BrtBeginSlicerCacheDef"},1078:{n:"BrtEndSlicerCacheDef"},1079:{n:"BrtBeginSlicersEx"},1080:{n:"BrtEndSlicersEx"},1081:{n:"BrtBeginSlicerEx"},1082:{n:"BrtEndSlicerEx"},1083:{n:"BrtBeginSlicer"},1084:{n:"BrtEndSlicer"},1085:{n:"BrtSlicerCachePivotTables"},1086:{n:"BrtBeginSlicerCacheOlapImpl"},1087:{n:"BrtEndSlicerCacheOlapImpl"},1088:{n:"BrtBeginSlicerCacheLevelsData"},1089:{n:"BrtEndSlicerCacheLevelsData"},1090:{n:"BrtBeginSlicerCacheLevelData"},1091:{n:"BrtEndSlicerCacheLevelData"},1092:{n:"BrtBeginSlicerCacheSiRanges"},1093:{n:"BrtEndSlicerCacheSiRanges"},1094:{n:"BrtBeginSlicerCacheSiRange"},1095:{n:"BrtEndSlicerCacheSiRange"},1096:{n:"BrtSlicerCacheOlapItem"},1097:{n:"BrtBeginSlicerCacheSelections"},1098:{n:"BrtSlicerCacheSelection"},1099:{n:"BrtEndSlicerCacheSelections"},1100:{n:"BrtBeginSlicerCacheNative"},1101:{n:"BrtEndSlicerCacheNative"},1102:{n:"BrtSlicerCacheNativeItem"},1103:{n:"BrtRangeProtection14"},1104:{n:"BrtRangeProtectionIso14"},1105:{n:"BrtCellIgnoreEC14"},1111:{n:"BrtList14"},1112:{n:"BrtCFIcon"},1113:{n:"BrtBeginSlicerCachesPivotCacheIDs"},1114:{n:"BrtEndSlicerCachesPivotCacheIDs"},1115:{n:"BrtBeginSlicers"},1116:{n:"BrtEndSlicers"},1117:{n:"BrtWbProp14"},1118:{n:"BrtBeginSXEdit"},1119:{n:"BrtEndSXEdit"},1120:{n:"BrtBeginSXEdits"},1121:{n:"BrtEndSXEdits"},1122:{n:"BrtBeginSXChange"},1123:{n:"BrtEndSXChange"},1124:{n:"BrtBeginSXChanges"},1125:{n:"BrtEndSXChanges"},1126:{n:"BrtSXTupleItems"},1128:{n:"BrtBeginSlicerStyle"},1129:{n:"BrtEndSlicerStyle"},1130:{n:"BrtSlicerStyleElement"},1131:{n:"BrtBeginStyleSheetExt14"},1132:{n:"BrtEndStyleSheetExt14"},1133:{n:"BrtBeginSlicerCachesPivotCacheID"},1134:{n:"BrtEndSlicerCachesPivotCacheID"},1135:{n:"BrtBeginConditionalFormattings"},1136:{n:"BrtEndConditionalFormattings"},1137:{n:"BrtBeginPCDCalcMemExt"},1138:{n:"BrtEndPCDCalcMemExt"},1139:{n:"BrtBeginPCDCalcMemsExt"},1140:{n:"BrtEndPCDCalcMemsExt"},1141:{n:"BrtPCDField14"},1142:{n:"BrtBeginSlicerStyles"},1143:{n:"BrtEndSlicerStyles"},1144:{n:"BrtBeginSlicerStyleElements"},1145:{n:"BrtEndSlicerStyleElements"},1146:{n:"BrtCFRuleExt"},1147:{n:"BrtBeginSXCondFmt14"},1148:{n:"BrtEndSXCondFmt14"},1149:{n:"BrtBeginSXCondFmts14"},1150:{n:"BrtEndSXCondFmts14"},1152:{n:"BrtBeginSortCond14"},1153:{n:"BrtEndSortCond14"},1154:{n:"BrtEndDVals14"},1155:{n:"BrtEndIconSet14"},1156:{n:"BrtEndDatabar14"},1157:{n:"BrtBeginColorScale14"},1158:{n:"BrtEndColorScale14"},1159:{n:"BrtBeginSxrules14"},1160:{n:"BrtEndSxrules14"},1161:{n:"BrtBeginPRule14"},1162:{n:"BrtEndPRule14"},1163:{n:"BrtBeginPRFilters14"},1164:{n:"BrtEndPRFilters14"},1165:{n:"BrtBeginPRFilter14"},1166:{n:"BrtEndPRFilter14"},1167:{n:"BrtBeginPRFItem14"},1168:{n:"BrtEndPRFItem14"},1169:{n:"BrtBeginCellIgnoreECs14"},1170:{n:"BrtEndCellIgnoreECs14"},1171:{n:"BrtDxf14"},1172:{n:"BrtBeginDxF14s"},1173:{n:"BrtEndDxf14s"},1177:{n:"BrtFilter14"},1178:{n:"BrtBeginCustomFilters14"},1180:{n:"BrtCustomFilter14"},1181:{n:"BrtIconFilter14"},1182:{n:"BrtPivotCacheConnectionName"},2048:{n:"BrtBeginDecoupledPivotCacheIDs"},2049:{n:"BrtEndDecoupledPivotCacheIDs"},2050:{n:"BrtDecoupledPivotCacheID"},2051:{n:"BrtBeginPivotTableRefs"},2052:{n:"BrtEndPivotTableRefs"},2053:{n:"BrtPivotTableRef"},2054:{n:"BrtSlicerCacheBookPivotTables"},2055:{n:"BrtBeginSxvcells"},2056:{n:"BrtEndSxvcells"},2057:{n:"BrtBeginSxRow"},2058:{n:"BrtEndSxRow"},2060:{n:"BrtPcdCalcMem15"},2067:{n:"BrtQsi15"},2068:{n:"BrtBeginWebExtensions"},2069:{n:"BrtEndWebExtensions"},2070:{n:"BrtWebExtension"},2071:{n:"BrtAbsPath15"},2072:{n:"BrtBeginPivotTableUISettings"},2073:{n:"BrtEndPivotTableUISettings"},2075:{n:"BrtTableSlicerCacheIDs"},2076:{n:"BrtTableSlicerCacheID"},2077:{n:"BrtBeginTableSlicerCache"},2078:{n:"BrtEndTableSlicerCache"},2079:{n:"BrtSxFilter15"},2080:{n:"BrtBeginTimelineCachePivotCacheIDs"},2081:{n:"BrtEndTimelineCachePivotCacheIDs"},2082:{n:"BrtTimelineCachePivotCacheID"},2083:{n:"BrtBeginTimelineCacheIDs"},2084:{n:"BrtEndTimelineCacheIDs"},2085:{n:"BrtBeginTimelineCacheID"},2086:{n:"BrtEndTimelineCacheID"},2087:{n:"BrtBeginTimelinesEx"},2088:{n:"BrtEndTimelinesEx"},2089:{n:"BrtBeginTimelineEx"},2090:{n:"BrtEndTimelineEx"},2091:{n:"BrtWorkBookPr15"},2092:{n:"BrtPCDH15"},2093:{n:"BrtBeginTimelineStyle"},2094:{n:"BrtEndTimelineStyle"},2095:{n:"BrtTimelineStyleElement"},2096:{n:"BrtBeginTimelineStylesheetExt15"},2097:{n:"BrtEndTimelineStylesheetExt15"},2098:{n:"BrtBeginTimelineStyles"},2099:{n:"BrtEndTimelineStyles"},2100:{n:"BrtBeginTimelineStyleElements"},2101:{n:"BrtEndTimelineStyleElements"},2102:{n:"BrtDxf15"},2103:{n:"BrtBeginDxfs15"},2104:{n:"brtEndDxfs15"},2105:{n:"BrtSlicerCacheHideItemsWithNoData"},2106:{n:"BrtBeginItemUniqueNames"},2107:{n:"BrtEndItemUniqueNames"},2108:{n:"BrtItemUniqueName"},2109:{n:"BrtBeginExtConn15"},2110:{n:"BrtEndExtConn15"},2111:{n:"BrtBeginOledbPr15"},2112:{n:"BrtEndOledbPr15"},2113:{n:"BrtBeginDataFeedPr15"},2114:{n:"BrtEndDataFeedPr15"},2115:{n:"BrtTextPr15"},2116:{n:"BrtRangePr15"},2117:{n:"BrtDbCommand15"},2118:{n:"BrtBeginDbTables15"},2119:{n:"BrtEndDbTables15"},2120:{n:"BrtDbTable15"},2121:{n:"BrtBeginDataModel"},2122:{n:"BrtEndDataModel"},2123:{n:"BrtBeginModelTables"},2124:{n:"BrtEndModelTables"},2125:{n:"BrtModelTable"},2126:{n:"BrtBeginModelRelationships"},2127:{n:"BrtEndModelRelationships"},2128:{n:"BrtModelRelationship"},2129:{n:"BrtBeginECTxtWiz15"},2130:{n:"BrtEndECTxtWiz15"},2131:{n:"BrtBeginECTWFldInfoLst15"},2132:{n:"BrtEndECTWFldInfoLst15"},2133:{n:"BrtBeginECTWFldInfo15"},2134:{n:"BrtFieldListActiveItem"},2135:{n:"BrtPivotCacheIdVersion"},2136:{n:"BrtSXDI15"},2137:{n:"BrtBeginModelTimeGroupings"},2138:{n:"BrtEndModelTimeGroupings"},2139:{n:"BrtBeginModelTimeGrouping"},2140:{n:"BrtEndModelTimeGrouping"},2141:{n:"BrtModelTimeGroupingCalcCol"},3072:{n:"BrtUid"},3073:{n:"BrtRevisionPtr"},5095:{n:"BrtBeginCalcFeatures"},5096:{n:"BrtEndCalcFeatures"},5097:{n:"BrtCalcFeature"},65535:{n:""}},Ul=j(jl,"n");Ul.BrtFRTArchID$=16;var $l={6:{n:"Formula",f:Zo},10:{n:"EOF",f:Pn},12:{n:"CalcCount",f:Fn},13:{n:"CalcMode",f:Fn},14:{n:"CalcPrecision",f:Rn},15:{n:"CalcRefMode",f:Rn},16:{n:"CalcDelta",f:Sr},17:{n:"CalcIter",f:Rn},18:{n:"Protect",f:Rn},19:{n:"Password",f:Fn},20:{n:"Header",f:ba},21:{n:"Footer",f:ba},23:{n:"ExternSheet",f:ka},24:{n:"Lbl",f:wa},25:{n:"WinProtect",f:Rn},26:{n:"VerticalPageBreaks"},27:{n:"HorizontalPageBreaks"},28:{n:"Note",f:function(e,t,r){return function(e,t,r){if(!(r.biff<8)){var n=e.read_shift(2),a=e.read_shift(2),i=e.read_shift(2),o=e.read_shift(2),s=Hn(e,0,r);return r.biff<8&&e.read_shift(1),[{r:n,c:a},s,o,i]}}(e,0,r)}},29:{n:"Selection"},34:{n:"Date1904",f:Rn},35:{n:"ExternName",f:xa},38:{n:"LeftMargin",f:Sr},39:{n:"RightMargin",f:Sr},40:{n:"TopMargin",f:Sr},41:{n:"BottomMargin",f:Sr},42:{n:"PrintRowCol",f:Rn},43:{n:"PrintGrid",f:Rn},47:{n:"FilePass",f:function(e,t,r){var n={Type:r.biff>=8?e.read_shift(2):0};return n.Type?function(e,t,r){var n=r||{};n.Info=e.read_shift(2),e.l-=2,1===n.Info?n.Data=function(e){var t={},r=t.EncryptionVersionInfo=Ja(e,4);if(1!=r.Major||1!=r.Minor)throw"unrecognized version code "+r.Major+" : "+r.Minor;return t.Salt=e.read_shift(16),t.EncryptedVerifier=e.read_shift(16),t.EncryptedVerifierHash=e.read_shift(16),t}(e):n.Data=function(e,t){var r={},n=r.EncryptionVersionInfo=Ja(e,4);if(t-=4,2!=n.Minor)throw new Error("unrecognized minor version code: "+n.Minor);if(n.Major>4||n.Major<2)throw new Error("unrecognized major version code: "+n.Major);r.Flags=e.read_shift(4),t-=4;var a=e.read_shift(4);return t-=4,r.EncryptionHeader=ei(e,a),t-=a,r.EncryptionVerifier=ti(e,t),r}(e,t)}(e,t-2,n):function(e,t,r,n){var a,i,o,s={key:Fn(e),verificationBytes:Fn(e)};r.password&&(s.verifier=ii(r.password)),n.valid=s.verificationBytes===s.verifier,n.valid&&(n.insitu=(a=r.password,i=0,o=ui(a),function(e){var t=function(e,t,r,n,a){var i,o;for(a||(a=t),n||(n=ui("")),i=0;i!=t.length;++i)o=t[i],o=255&((o^=n[r])>>5|o<<3),a[i]=o,++r;return[a,r,n]}(0,e,i,o);return i=t[1],t[0]}))}(e,r.biff,r,n),n}},49:{n:"Font",f:function(e,t,r){var n={dyHeight:e.read_shift(2),fl:e.read_shift(2)};switch(r&&r.biff||8){case 2:break;case 3:case 4:e.l+=2;break;default:e.l+=10}return n.name=Un(e,0,r),n}},51:{n:"PrintSize",f:Fn},60:{n:"Continue"},61:{n:"Window1",f:function(e){return{Pos:[e.read_shift(2),e.read_shift(2)],Dim:[e.read_shift(2),e.read_shift(2)],Flags:e.read_shift(2),CurTab:e.read_shift(2),FirstTab:e.read_shift(2),Selected:e.read_shift(2),TabRatio:e.read_shift(2)}}},64:{n:"Backup",f:Rn},65:{n:"Pane",f:function(){}},66:{n:"CodePage",f:Fn},77:{n:"Pls"},80:{n:"DCon"},81:{n:"DConRef"},82:{n:"DConName"},85:{n:"DefColWidth",f:Fn},89:{n:"XCT"},90:{n:"CRN"},91:{n:"FileSharing"},92:{n:"WriteAccess",f:function(e,t,r){if(r.enc)return e.l+=t,"";var n=e.l,a=Hn(e,0,r);return e.read_shift(t+n-e.l),a}},93:{n:"Obj",f:function(e,t,r){if(r&&r.biff<8)return function(e,t,r){e.l+=4;var n=e.read_shift(2),a=e.read_shift(2),i=e.read_shift(2);e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=6,t-=36;var o=[];return o.push((Ta[n]||Ft)(e,t,r)),{cmo:[a,n,i],ft:o}}(e,t,r);var n=sa(e),a=function(e,t){for(var r=e.l+t,n=[];e.l<r;){var a=e.read_shift(2);e.l-=2;try{n.push(ca[a](e,r-e.l))}catch(t){return e.l=r,n}}return e.l!=r&&(e.l=r),n}(e,t-22,n[1]);return{cmo:n,ft:a}}},94:{n:"Uncalced"},95:{n:"CalcSaveRecalc",f:Rn},96:{n:"Template"},97:{n:"Intl"},99:{n:"ObjProtect",f:Rn},125:{n:"ColInfo",f:Ma},128:{n:"Guts",f:function(e){e.l+=4;var t=[e.read_shift(2),e.read_shift(2)];if(0!==t[0]&&t[0]--,0!==t[1]&&t[1]--,t[0]>7||t[1]>7)throw new Error("Bad Gutters: "+t.join("|"));return t}},129:{n:"WsBool",f:function(e,t,r){var n=r&&8==r.biff||2==t?e.read_shift(2):(e.l+=t,0);return{fDialog:16&n,fBelow:64&n,fRight:128&n}}},130:{n:"GridSet",f:Fn},131:{n:"HCenter",f:Rn},132:{n:"VCenter",f:Rn},133:{n:"BoundSheet8",f:function(e,t,r){var n=e.read_shift(4),a=3&e.read_shift(1),i=e.read_shift(1);switch(i){case 0:i="Worksheet";break;case 1:i="Macrosheet";break;case 2:i="Chartsheet";break;case 6:i="VBAModule"}var o=Un(e,0,r);return 0===o.length&&(o="Sheet1"),{pos:n,hs:a,dt:i,name:o}}},134:{n:"WriteProtect"},140:{n:"Country",f:function(e){var t,r=[0,0];return t=e.read_shift(2),r[0]=Br[t]||t,t=e.read_shift(2),r[1]=Br[t]||t,r}},141:{n:"HideObj",f:Fn},144:{n:"Sort"},146:{n:"Palette",f:function(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(Jn(e));return r}},151:{n:"Sync"},152:{n:"LPr"},153:{n:"DxGCol"},154:{n:"FnGroupName"},155:{n:"FilterMode"},156:{n:"BuiltInFnGroupCount",f:Fn},157:{n:"AutoFilterInfo"},158:{n:"AutoFilter"},160:{n:"Scl",f:Ca},161:{n:"Setup",f:function(e,t){var r={};return t<32||(e.l+=16,r.header=Sr(e),r.footer=Sr(e),e.l+=2),r}},174:{n:"ScenMan"},175:{n:"SCENARIO"},176:{n:"SxView"},177:{n:"Sxvd"},178:{n:"SXVI"},180:{n:"SxIvd"},181:{n:"SXLI"},182:{n:"SXPI"},184:{n:"DocRoute"},185:{n:"RecipName"},189:{n:"MulRk",f:function(e,t){for(var r=e.l+t-2,n=e.read_shift(2),a=e.read_shift(2),i=[];e.l<r;)i.push(ra(e));if(e.l!==r)throw new Error("MulRK read error");var o=e.read_shift(2);if(i.length!=o-a+1)throw new Error("MulRK length mismatch");return{r:n,c:a,C:o,rkrec:i}}},190:{n:"MulBlank",f:function(e,t){for(var r=e.l+t-2,n=e.read_shift(2),a=e.read_shift(2),i=[];e.l<r;)i.push(e.read_shift(2));if(e.l!==r)throw new Error("MulBlank read error");var o=e.read_shift(2);if(i.length!=o-a+1)throw new Error("MulBlank length mismatch");return{r:n,c:a,C:o,ixfe:i}}},193:{n:"Mms",f:Pn},197:{n:"SXDI"},198:{n:"SXDB"},199:{n:"SXFDB"},200:{n:"SXDBB"},201:{n:"SXNum"},202:{n:"SxBool",f:Rn},203:{n:"SxErr"},204:{n:"SXInt"},205:{n:"SXString"},206:{n:"SXDtr"},207:{n:"SxNil"},208:{n:"SXTbl"},209:{n:"SXTBRGIITM"},210:{n:"SxTbpg"},211:{n:"ObProj"},213:{n:"SXStreamID"},215:{n:"DBCell"},216:{n:"SXRng"},217:{n:"SxIsxoper"},218:{n:"BookBool",f:Fn},220:{n:"DbOrParamQry"},221:{n:"ScenarioProtect",f:Rn},222:{n:"OleObjectSize"},224:{n:"XF",f:function(e,t,r){var n={};return n.ifnt=e.read_shift(2),n.numFmtId=e.read_shift(2),n.flags=e.read_shift(2),n.fStyle=n.flags>>2&1,n.data=function(e,t,r,n){var a={},i=e.read_shift(4),o=e.read_shift(4),s=e.read_shift(4),l=e.read_shift(2);return a.patternType=zr[s>>26],n.cellStyles?(a.alc=7&i,a.fWrap=i>>3&1,a.alcV=i>>4&7,a.fJustLast=i>>7&1,a.trot=i>>8&255,a.cIndent=i>>16&15,a.fShrinkToFit=i>>20&1,a.iReadOrder=i>>22&2,a.fAtrNum=i>>26&1,a.fAtrFnt=i>>27&1,a.fAtrAlc=i>>28&1,a.fAtrBdr=i>>29&1,a.fAtrPat=i>>30&1,a.fAtrProt=i>>31&1,a.dgLeft=15&o,a.dgRight=o>>4&15,a.dgTop=o>>8&15,a.dgBottom=o>>12&15,a.icvLeft=o>>16&127,a.icvRight=o>>23&127,a.grbitDiag=o>>30&3,a.icvTop=127&s,a.icvBottom=s>>7&127,a.icvDiag=s>>14&127,a.dgDiag=s>>21&15,a.icvFore=127&l,a.icvBack=l>>7&127,a.fsxButton=l>>14&1,a):a}(e,0,n.fStyle,r),n}},225:{n:"InterfaceHdr",f:function(e,t){return 0===t||e.read_shift(2),1200}},226:{n:"InterfaceEnd",f:Pn},227:{n:"SXVS"},229:{n:"MergeCells",f:function(e,t){for(var r=[],n=e.read_shift(2);n--;)r.push(na(e));return r}},233:{n:"BkHim"},235:{n:"MsoDrawingGroup"},236:{n:"MsoDrawing"},237:{n:"MsoDrawingSelection"},239:{n:"PhoneticInfo"},240:{n:"SxRule"},241:{n:"SXEx"},242:{n:"SxFilt"},244:{n:"SxDXF"},245:{n:"SxItm"},246:{n:"SxName"},247:{n:"SxSelect"},248:{n:"SXPair"},249:{n:"SxFmla"},251:{n:"SxFormat"},252:{n:"SST",f:function(e,t){for(var r=e.l+t,n=e.read_shift(4),a=e.read_shift(4),i=[],o=0;o!=a&&e.l<r;++o)i.push($n(e));return i.Count=n,i.Unique=a,i}},253:{n:"LabelSst",f:function(e){var t=Qn(e);return t.isst=e.read_shift(4),t}},255:{n:"ExtSST",f:function(e,t){var r={};return r.dsst=e.read_shift(2),e.l+=t-2,r}},256:{n:"SXVDEx"},259:{n:"SXFormula"},290:{n:"SXDBEx"},311:{n:"RRDInsDel"},312:{n:"RRDHead"},315:{n:"RRDChgCell"},317:{n:"RRTabId",f:zn},318:{n:"RRDRenSheet"},319:{n:"RRSort"},320:{n:"RRDMove"},330:{n:"RRFormat"},331:{n:"RRAutoFmt"},333:{n:"RRInsertSh"},334:{n:"RRDMoveBegin"},335:{n:"RRDMoveEnd"},336:{n:"RRDInsDelBegin"},337:{n:"RRDInsDelEnd"},338:{n:"RRDConflict"},339:{n:"RRDDefName"},340:{n:"RRDRstEtxp"},351:{n:"LRng"},352:{n:"UsesELFs",f:Rn},353:{n:"DSF",f:Pn},401:{n:"CUsr"},402:{n:"CbUsr"},403:{n:"UsrInfo"},404:{n:"UsrExcl"},405:{n:"FileLock"},406:{n:"RRDInfo"},407:{n:"BCUsrs"},408:{n:"UsrChk"},425:{n:"UserBView"},426:{n:"UserSViewBegin"},427:{n:"UserSViewEnd"},428:{n:"RRDUserView"},429:{n:"Qsi"},430:{n:"SupBook",f:function(e,t,r){var n=e.l+t,a=e.read_shift(2),i=e.read_shift(2);if(r.sbcch=i,1025==i||14849==i)return[i,a];if(i<1||i>255)throw new Error("Unexpected SupBook type: "+i);for(var o=qn(e,i),s=[];n>e.l;)s.push(Wn(e));return[i,a,o,s]}},431:{n:"Prot4Rev",f:Rn},432:{n:"CondFmt"},433:{n:"CF"},434:{n:"DVal"},437:{n:"DConBin"},438:{n:"TxO",f:function(e,t,r){var n=e.l,a="";try{e.l+=4;var i=(r.lastobj||{cmo:[0,0]}).cmo[1];-1==[0,5,7,11,12,14].indexOf(i)?e.l+=6:function(e){var t=e.read_shift(1);e.l++;var r=e.read_shift(2);e.l+=2}(e);var o=e.read_shift(2);e.read_shift(2),Fn(e);var s=e.read_shift(2);e.l+=s;for(var l=1;l<e.lens.length-1;++l){if(e.l-n!=e.lens[l])throw new Error("TxO: bad continue record");var c=e[e.l];if((a+=qn(e,e.lens[l+1]-e.lens[l]-1)).length>=(c?o:2*o))break}if(a.length!==o&&a.length!==2*o)throw new Error("cchText: "+o+" != "+a.length);return e.l=n+t,{t:a}}catch(r){return e.l=n+t,{t:a}}}},439:{n:"RefreshAll",f:Rn},440:{n:"HLink",f:function(e,t){var r=na(e);e.l+=16;var n=function(e,t){var r=e.l+t,n=e.read_shift(4);if(2!==n)throw new Error("Unrecognized streamVersion: "+n);var a=e.read_shift(2);e.l+=2;var i,o,s,l,c,u,f="";16&a&&(i=Xn(e,e.l)),128&a&&(o=Xn(e,e.l)),257==(257&a)&&(s=Xn(e,e.l)),1==(257&a)&&(l=function(e,t){var r=e.read_shift(16);switch(r){case"e0c9ea79f9bace118c8200aa004ba90b":return function(e){var t=e.read_shift(4),r=e.l,n=!1;t>24&&(e.l+=t-24,"795881f43b1d7f48af2c825dc4852763"===e.read_shift(16)&&(n=!0),e.l=r);var a=e.read_shift((n?t-24:t)>>1,"utf16le").replace(S,"");return n&&(e.l+=24),a}(e);case"0303000000000000c000000000000046":return function(e){for(var t=e.read_shift(2),r="";t-- >0;)r+="../";var n=e.read_shift(0,"lpstr-ansi");if(e.l+=2,57005!=e.read_shift(2))throw new Error("Bad FileMoniker");if(0===e.read_shift(4))return r+n.replace(/\\/g,"/");var a=e.read_shift(4);if(3!=e.read_shift(2))throw new Error("Bad FileMoniker");return r+e.read_shift(a>>1,"utf16le").replace(S,"")}(e);default:throw new Error("Unsupported Moniker "+r)}}(e,e.l)),8&a&&(f=Xn(e,e.l)),32&a&&(c=e.read_shift(16)),64&a&&(u=vn(e)),e.l=r;var p=o||s||l||"";p&&f&&(p+="#"+f),p||(p="#"+f),2&a&&"/"==p.charAt(0)&&"/"!=p.charAt(1)&&(p="file://"+p);var h={Target:p};return c&&(h.guid=c),u&&(h.time=u),i&&(h.Tooltip=i),h}(e,t-24);return[r,n]}},441:{n:"Lel"},442:{n:"CodeName",f:Wn},443:{n:"SXFDBType"},444:{n:"Prot4RevPass",f:Fn},445:{n:"ObNoMacros"},446:{n:"Dv"},448:{n:"Excel9File",f:Pn},449:{n:"RecalcId",f:function(e){return e.read_shift(2),e.read_shift(4)},r:2},450:{n:"EntExU2",f:Pn},512:{n:"Dimensions",f:ga},513:{n:"Blank",f:Ea},515:{n:"Number",f:function(e,t,r){r.biffguess&&2==r.biff&&(r.biff=5);var n=Qn(e),a=Sr(e);return n.val=a,n}},516:{n:"Label",f:function(e,t,r){r.biffguess&&2==r.biff&&(r.biff=5),e.l;var n=Qn(e);2==r.biff&&e.l++;var a=Wn(e,e.l,r);return n.val=a,n}},517:{n:"BoolErr",f:va},519:{n:"String",f:Na},520:{n:"Row",f:function(e){var t={};t.r=e.read_shift(2),t.c=e.read_shift(2),t.cnt=e.read_shift(2)-t.c;var r=e.read_shift(2);e.l+=4;var n=e.read_shift(1);return e.l+=3,7&n&&(t.level=7&n),32&n&&(t.hidden=!0),64&n&&(t.hpt=r/20),t}},523:{n:"Index"},545:{n:"Array",f:Da},549:{n:"DefaultRowHeight",f:ha},566:{n:"Table"},574:{n:"Window2",f:function(e,t,r){return r&&r.biff>=2&&r.biff<5?{}:{RTL:64&e.read_shift(2)}}},638:{n:"RK",f:function(e){var t=e.read_shift(2),r=e.read_shift(2),n=ra(e);return{r:t,c:r,ixfe:n[0],rknum:n[1]}}},659:{n:"Style"},1048:{n:"BigName"},1054:{n:"Format",f:function(e,t,r){return[e.read_shift(2),Hn(e,0,r)]}},1084:{n:"ContinueBigName"},1212:{n:"ShrFmla",f:function(e,t,r){var n=ia(e);e.l++;var a=e.read_shift(1);return[Yo(e,t-=8,r),a,n]}},2048:{n:"HLinkTooltip",f:function(e,t){e.read_shift(2);var r=na(e),n=e.read_shift((t-10)/2,"dbcs-cont");return[r,n=n.replace(S,"")]}},2049:{n:"WebPub"},2050:{n:"QsiSXTag"},2051:{n:"DBQueryExt"},2052:{n:"ExtString"},2053:{n:"TxtQry"},2054:{n:"Qsir"},2055:{n:"Qsif"},2056:{n:"RRDTQSIF"},2057:{n:"BOF",f:ua},2058:{n:"OleDbConn"},2059:{n:"WOpt"},2060:{n:"SXViewEx"},2061:{n:"SXTH"},2062:{n:"SXPIEx"},2063:{n:"SXVDTEx"},2064:{n:"SXViewEx9"},2066:{n:"ContinueFrt"},2067:{n:"RealTimeData"},2128:{n:"ChartFrtInfo"},2129:{n:"FrtWrapper"},2130:{n:"StartBlock"},2131:{n:"EndBlock"},2132:{n:"StartObject"},2133:{n:"EndObject"},2134:{n:"CatLab"},2135:{n:"YMult"},2136:{n:"SXViewLink"},2137:{n:"PivotChartBits"},2138:{n:"FrtFontList"},2146:{n:"SheetExt"},2147:{n:"BookExt",r:12},2148:{n:"SXAddl"},2149:{n:"CrErr"},2150:{n:"HFPicture"},2151:{n:"FeatHdr",f:Pn},2152:{n:"Feat"},2154:{n:"DataLabExt"},2155:{n:"DataLabExtContents"},2156:{n:"CellWatch"},2161:{n:"FeatHdr11"},2162:{n:"Feature11"},2164:{n:"DropDownObjIds"},2165:{n:"ContinueFrt11"},2166:{n:"DConn"},2167:{n:"List12"},2168:{n:"Feature12"},2169:{n:"CondFmt12"},2170:{n:"CF12"},2171:{n:"CFEx"},2172:{n:"XFCRC",f:function(e){e.l+=2;var t={cxfs:0,crc:0};return t.cxfs=e.read_shift(2),t.crc=e.read_shift(4),t},r:12},2173:{n:"XFExt",f:function(e,t){e.l,e.l+=2;var r=e.read_shift(2);e.l+=2;for(var n=e.read_shift(2),a=[];n-- >0;)a.push(Ji(e,e.l));return{ixfe:r,ext:a}},r:12},2174:{n:"AutoFilter12"},2175:{n:"ContinueFrt12"},2180:{n:"MDTInfo"},2181:{n:"MDXStr"},2182:{n:"MDXTuple"},2183:{n:"MDXSet"},2184:{n:"MDXProp"},2185:{n:"MDXKPI"},2186:{n:"MDB"},2187:{n:"PLV"},2188:{n:"Compat12",f:Rn,r:12},2189:{n:"DXF"},2190:{n:"TableStyles",r:12},2191:{n:"TableStyle"},2192:{n:"TableStyleElement"},2194:{n:"StyleExt"},2195:{n:"NamePublish"},2196:{n:"NameCmt",f:function(e,t,r){if(!(r.biff<8)){var n=e.read_shift(2),a=e.read_shift(2);return[qn(e,n,r),qn(e,a,r)]}e.l+=t},r:12},2197:{n:"SortData"},2198:{n:"Theme",f:function(e,t,r){var n=e.l+t;if(124226!==e.read_shift(4))if(r.cellStyles){var a,i=e.slice(e.l);e.l=n;try{a=de(i,{type:"array"})}catch(e){return}var o=fe(a,"theme/theme/theme1.xml",!0);if(o)return Zi(o,r)}else e.l=n},r:12},2199:{n:"GUIDTypeLib"},2200:{n:"FnGrp12"},2201:{n:"NameFnGrp12"},2202:{n:"MTRSettings",f:function(e){return[0!==e.read_shift(4),0!==e.read_shift(4),e.read_shift(4)]},r:12},2203:{n:"CompressPictures",f:Pn},2204:{n:"HeaderFooter"},2205:{n:"CrtLayout12"},2206:{n:"CrtMlFrt"},2207:{n:"CrtMlFrtContinue"},2211:{n:"ForceFullCalculation",f:function(e){var t=function(e){var t=e.read_shift(2),r=e.read_shift(2);return e.l+=8,{type:t,flags:r}}(e);if(2211!=t.type)throw new Error("Invalid Future Record "+t.type);return 0!==e.read_shift(4)}},2212:{n:"ShapePropsStream"},2213:{n:"TextPropsStream"},2214:{n:"RichTextStream"},2215:{n:"CrtLayout12A"},4097:{n:"Units"},4098:{n:"Chart"},4099:{n:"Series"},4102:{n:"DataFormat"},4103:{n:"LineFormat"},4105:{n:"MarkerFormat"},4106:{n:"AreaFormat"},4107:{n:"PieFormat"},4108:{n:"AttachedLabel"},4109:{n:"SeriesText"},4116:{n:"ChartFormat"},4117:{n:"Legend"},4118:{n:"SeriesList"},4119:{n:"Bar"},4120:{n:"Line"},4121:{n:"Pie"},4122:{n:"Area"},4123:{n:"Scatter"},4124:{n:"CrtLine"},4125:{n:"Axis"},4126:{n:"Tick"},4127:{n:"ValueRange"},4128:{n:"CatSerRange"},4129:{n:"AxisLine"},4130:{n:"CrtLink"},4132:{n:"DefaultText"},4133:{n:"Text"},4134:{n:"FontX",f:Fn},4135:{n:"ObjectLink"},4146:{n:"Frame"},4147:{n:"Begin"},4148:{n:"End"},4149:{n:"PlotArea"},4154:{n:"Chart3d"},4156:{n:"PicF"},4157:{n:"DropBar"},4158:{n:"Radar"},4159:{n:"Surf"},4160:{n:"RadarArea"},4161:{n:"AxisParent"},4163:{n:"LegendException"},4164:{n:"ShtProps",f:function(e,t,r){var n={area:!1};if(5!=r.biff)return e.l+=t,n;var a=e.read_shift(1);return e.l+=3,16&a&&(n.area=!0),n}},4165:{n:"SerToCrt"},4166:{n:"AxesUsed"},4168:{n:"SBaseRef"},4170:{n:"SerParent"},4171:{n:"SerAuxTrend"},4174:{n:"IFmtRecord"},4175:{n:"Pos"},4176:{n:"AlRuns"},4177:{n:"BRAI"},4187:{n:"SerAuxErrBar"},4188:{n:"ClrtClient",f:function(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(Jn(e));return r}},4189:{n:"SerFmt"},4191:{n:"Chart3DBarShape"},4192:{n:"Fbi"},4193:{n:"BopPop"},4194:{n:"AxcExt"},4195:{n:"Dat"},4196:{n:"PlotGrowth"},4197:{n:"SIIndex"},4198:{n:"GelFrame"},4199:{n:"BopPopCustom"},4200:{n:"Fbi2"},0:{n:"Dimensions",f:ga},1:{n:"BIFF2BLANK"},2:{n:"BIFF2INT",f:function(e){var t=Qn(e);++e.l;var r=e.read_shift(2);return t.t="n",t.val=r,t}},3:{n:"BIFF2NUM",f:function(e){var t=Qn(e);++e.l;var r=Sr(e);return t.t="n",t.val=r,t}},4:{n:"BIFF2STR",f:function(e,t,r){r.biffguess&&5==r.biff&&(r.biff=2);var n=Qn(e);++e.l;var a=Hn(e,0,r);return n.t="str",n.val=a,n}},5:{n:"BoolErr",f:va},7:{n:"String",f:function(e){var t=e.read_shift(1);return 0===t?(e.l++,""):e.read_shift(t,"sbcs-cont")}},8:{n:"BIFF2ROW"},9:{n:"BOF",f:ua},11:{n:"Index"},22:{n:"ExternCount",f:Fn},30:{n:"BIFF2FORMAT",f:ma},31:{n:"BIFF2FMTCNT"},32:{n:"BIFF2COLINFO"},33:{n:"Array",f:Da},36:{n:"COLWIDTH"},37:{n:"DefaultRowHeight",f:ha},50:{n:"BIFF2FONTXTRA",f:function(e,t){e.l+=6,e.l+=2,e.l+=1,e.l+=3,e.l+=1,e.l+=t-13}},62:{n:"BIFF2WINDOW2"},52:{n:"DDEObjName"},67:{n:"BIFF2XF"},68:{n:"BIFF2XFINDEX",f:Fn},69:{n:"BIFF2FONTCLR"},86:{n:"BIFF4FMTCNT"},126:{n:"RK"},127:{n:"ImData",f:function(e){var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(4),a={fmt:t,env:r,len:n,data:e.slice(e.l,e.l+n)};return e.l+=n,a}},135:{n:"Addin"},136:{n:"Edg"},137:{n:"Pub"},145:{n:"Sub"},148:{n:"LHRecord"},149:{n:"LHNGraph"},150:{n:"Sound"},169:{n:"CoordList"},171:{n:"GCW"},188:{n:"ShrFmla"},191:{n:"ToolbarHdr"},192:{n:"ToolbarEnd"},194:{n:"AddMenu"},195:{n:"DelMenu"},214:{n:"RString",f:function(e,t,r){var n=e.l+t,a=Qn(e),i=e.read_shift(2),o=qn(e,i,r);return e.l=n,a.t="str",a.val=o,a}},223:{n:"UDDesc"},234:{n:"TabIdConf"},354:{n:"XL5Modify"},421:{n:"FileSharing2"},518:{n:"Formula",f:Zo},521:{n:"BOF",f:ua},536:{n:"Lbl",f:wa},547:{n:"ExternName",f:xa},561:{n:"Font"},579:{n:"BIFF3XF"},1030:{n:"Formula",f:Zo},1033:{n:"BOF",f:ua},1091:{n:"BIFF4XF"},2157:{n:"FeatInfo"},2163:{n:"FeatInfo11"},2177:{n:"SXAddl12"},2240:{n:"AutoWebPub"},2241:{n:"ListObj"},2242:{n:"ListField"},2243:{n:"ListDV"},2244:{n:"ListCondFmt"},2245:{n:"ListCF"},2246:{n:"FMQry"},2247:{n:"FMSQry"},2248:{n:"PLV"},2249:{n:"LnExt"},2250:{n:"MkrExt"},2251:{n:"CrtCoopt"},2262:{n:"FRTArchId$",r:12},29282:{}},Vl=j($l,"n");function ql(e,t,r,n){var a="number"==typeof t?t:+t||+Vl[t];if(!isNaN(a)){var i=n||(r||[]).length||0,o=e.next(4);o.write_shift(2,a),o.write_shift(2,i),i>0&&Tt(r)&&e.push(r)}}function Wl(e,t,r){return e||(e=Bt(7)),e.write_shift(2,t),e.write_shift(2,r),e.write_shift(2,0),e.write_shift(1,0),e}function Hl(e,t,r,n){if(null!=t.v)switch(t.t){case"d":case"n":var a="d"==t.t?W(Q(t.v)):t.v;return void(a==(0|a)&&a>=0&&a<65536?ql(e,2,(i=r,o=n,s=a,l=Bt(9),Wl(l,i,o),l.write_shift(2,s),l)):ql(e,3,function(e,t,r){var n=Bt(15);return Wl(n,e,t),n.write_shift(8,r,"f"),n}(r,n,a)));case"b":case"e":return void ql(e,5,function(e,t,r,n){var a=Bt(9);return Wl(a,e,t),jn(r,n||"b",a),a}(r,n,t.v,t.t));case"s":case"str":return void ql(e,4,function(e,t,r){var n=Bt(8+2*r.length);return Wl(n,e,t),n.write_shift(1,r.length),n.write_shift(r.length,r,"sbcs"),n.l<n.length?n.slice(0,n.l):n}(r,n,(t.v||"").slice(0,255)))}var i,o,s,l;ql(e,1,Wl(null,r,n))}function Gl(e,t,r,n,a){var i=16+ds(a.cellXfs,t,a);if(null!=t.v||t.bf)if(t.bf)ql(e,"Formula",function(e,t,r,n,a){var i=ea(t,r,a),o=function(e){if(null==e){var t=Bt(8);return t.write_shift(1,3),t.write_shift(1,0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(2,65535),t}return Mr("number"==typeof e?e:0)}(e.v),s=Bt(6);s.write_shift(2,33),s.write_shift(4,0);for(var l=Bt(e.bf.length),c=0;c<e.bf.length;++c)l[c]=e.bf[c];return A([i,o,s,l])}(t,r,n,0,i));else switch(t.t){case"d":case"n":ql(e,"Number",function(e,t,r,n){var a=Bt(14);return ea(e,t,n,a),Mr(r,a),a}(r,n,"d"==t.t?W(Q(t.v)):t.v,i));break;case"b":case"e":ql(e,517,function(e,t,r,n,a,i){var o=Bt(8);return ea(e,t,n,o),jn(r,i,o),o}(r,n,t.v,i,0,t.t));break;case"s":case"str":a.bookSST?ql(e,"LabelSst",function(e,t,r,n){var a=Bt(10);return ea(e,t,n,a),a.write_shift(4,r),a}(r,n,fs(a.Strings,t.v,a.revStrings),i)):ql(e,"Label",function(e,t,r,n,a){var i=!a||8==a.biff,o=Bt(+i+8+(1+i)*r.length);return ea(e,t,n,o),o.write_shift(2,r.length),i&&o.write_shift(1,1),o.write_shift((1+i)*r.length,r,i?"utf16le":"sbcs"),o}(r,n,(t.v||"").slice(0,255),i,a));break;default:ql(e,"Blank",ea(r,n,i))}else ql(e,"Blank",ea(r,n,i))}function Xl(e,t,r){var n,a=jt(),i=r.SheetNames[e],o=r.Sheets[i]||{},s=(r||{}).Workbook||{},l=(s.Sheets||[])[e]||{},c=Array.isArray(o),u=8==t.biff,f="",p=[],h=er(o["!ref"]||"A1"),d=u?65536:16384;if(h.e.c>255||h.e.r>=d){if(t.WTF)throw new Error("Range "+(o["!ref"]||"A1")+" exceeds format limit A1:IV16384");h.e.c=Math.min(h.e.c,255),h.e.r=Math.min(h.e.c,d-1)}ql(a,2057,fa(0,16,t)),ql(a,"CalcMode",Bn(1)),ql(a,"CalcCount",Bn(100)),ql(a,"CalcRefMode",Ln(!0)),ql(a,"CalcIter",Ln(!1)),ql(a,"CalcDelta",Mr(.001)),ql(a,"CalcSaveRecalc",Ln(!0)),ql(a,"PrintRowCol",Ln(!1)),ql(a,"PrintGrid",Ln(!1)),ql(a,"GridSet",Bn(1)),ql(a,"Guts",function(e){var t=Bt(8);return t.write_shift(4,0),t.write_shift(2,e[0]?e[0]+1:0),t.write_shift(2,e[1]?e[1]+1:0),t}([0,0])),ql(a,"HCenter",Ln(!1)),ql(a,"VCenter",Ln(!1)),u&&function(e,t,r){if(t){var n=0;t.forEach((function(t,r){++n<=256&&t&&ql(e,"ColInfo",function(e,t){var r=Bt(12);r.write_shift(2,t),r.write_shift(2,t),r.write_shift(2,256*e.width),r.write_shift(2,0);var n=0;return e.hidden&&(n|=1),r.write_shift(1,n),n=e.level||0,r.write_shift(1,n),r.write_shift(2,0),r}(ps(r,t),r))}))}}(a,o["!cols"]),ql(a,512,function(e,t){var r=8!=t.biff&&t.biff?2:4,n=Bt(2*r+6);return n.write_shift(r,e.s.r),n.write_shift(r,e.e.r+1),n.write_shift(2,e.s.c),n.write_shift(2,e.e.c+1),n.write_shift(2,0),n}(h,t)),u&&(o["!links"]=[]);for(var m=h.s.r;m<=h.e.r;++m){f=Gt(m);for(var g=h.s.c;g<=h.e.c;++g){m===h.s.r&&(p[g]=Yt(g)),n=p[g]+f;var y=c?(o[m]||[])[g]:o[n];y&&(Gl(a,y,m,g,t),u&&y.l&&o["!links"].push([n,y.l]))}}var v=l.CodeName||l.name||i;return u&&ql(a,"Window2",function(e){var t=Bt(18),r=1718;return e&&e.RTL&&(r|=64),t.write_shift(2,r),t.write_shift(4,0),t.write_shift(4,64),t.write_shift(4,0),t.write_shift(4,0),t}((s.Views||[])[0])),u&&(o["!merges"]||[]).length&&ql(a,"MergeCells",function(e){var t=Bt(2+8*e.length);t.write_shift(2,e.length);for(var r=0;r<e.length;++r)aa(e[r],t);return t}(o["!merges"])),u&&function(e,t){for(var r=0;r<t["!links"].length;++r){var n=t["!links"][r];ql(e,"HLink",Aa(n)),n[1].Tooltip&&ql(e,"HLinkTooltip",Sa(n))}delete t["!links"]}(a,o),ql(a,"CodeName",Gn(v)),u&&function(e,t){var r=Bt(19);r.write_shift(4,2151),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,1),r.write_shift(4,0),ql(e,"FeatHdr",r),(r=Bt(39)).write_shift(4,2152),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,0),r.write_shift(4,0),r.write_shift(2,1),r.write_shift(4,4),r.write_shift(2,0),aa(er(t["!ref"]||"A1"),r),r.write_shift(4,4),ql(e,"Feat",r)}(a,o),ql(a,"EOF"),a.end()}function Yl(e,t,r){var n=jt(),a=(e||{}).Workbook||{},i=a.Sheets||[],o=a.WBProps||{},s=8==r.biff,l=5==r.biff;ql(n,2057,fa(0,5,r)),"xla"==r.bookType&&ql(n,"Addin"),ql(n,"InterfaceHdr",s?Bn(1200):null),ql(n,"Mms",function(e,t){t||(t=Bt(2));for(var r=0;r<2;++r)t.write_shift(1,0);return t}()),l&&ql(n,"ToolbarHdr"),l&&ql(n,"ToolbarEnd"),ql(n,"InterfaceEnd"),ql(n,"WriteAccess",function(e,t){var r=!t||8==t.biff,n=Bt(r?112:54);for(n.write_shift(8==t.biff?2:1,7),r&&n.write_shift(1,0),n.write_shift(4,859007059),n.write_shift(4,5458548|(r?0:536870912));n.l<n.length;)n.write_shift(1,r?0:32);return n}(0,r)),ql(n,"CodePage",Bn(s?1200:1252)),s&&ql(n,"DSF",Bn(0)),s&&ql(n,"Excel9File"),ql(n,"RRTabId",function(e){for(var t=Bt(2*e),r=0;r<e;++r)t.write_shift(2,r+1);return t}(e.SheetNames.length)),s&&e.vbaraw&&ql(n,"ObProj"),s&&e.vbaraw&&ql(n,"CodeName",Gn(o.CodeName||"ThisWorkbook")),ql(n,"BuiltInFnGroupCount",Bn(17)),ql(n,"WinProtect",Ln(!1)),ql(n,"Protect",Ln(!1)),ql(n,"Password",Bn(0)),s&&ql(n,"Prot4Rev",Ln(!1)),s&&ql(n,"Prot4RevPass",Bn(0)),ql(n,"Window1",function(){var e=Bt(18);return e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,29280),e.write_shift(2,17600),e.write_shift(2,56),e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,1),e.write_shift(2,500),e}()),ql(n,"Backup",Ln(!1)),ql(n,"HideObj",Bn(0)),ql(n,"Date1904",Ln("true"==function(e){return e.Workbook&&e.Workbook.WBProps&&Re(e.Workbook.WBProps.date1904)?"true":"false"}(e))),ql(n,"CalcPrecision",Ln(!0)),s&&ql(n,"RefreshAll",Ln(!1)),ql(n,"BookBool",Bn(0)),function(e,t,r){ql(e,"Font",function(e,t){var r=e.name||"Arial",n=t&&5==t.biff,a=Bt(n?15+r.length:16+2*r.length);return a.write_shift(2,20*(e.sz||12)),a.write_shift(4,0),a.write_shift(2,400),a.write_shift(4,0),a.write_shift(2,0),a.write_shift(1,r.length),n||a.write_shift(1,1),a.write_shift((n?1:2)*r.length,r,n?"sbcs":"utf16le"),a}({sz:12,color:{theme:1},name:"Arial",family:2,scheme:"minor"},r))}(n,0,r),function(e,t,r){t&&[[5,8],[23,26],[41,44],[50,392]].forEach((function(n){for(var a=n[0];a<=n[1];++a)null!=t[a]&&ql(e,"Format",da(a,t[a],r))}))}(n,e.SSF,r),function(e,t){for(var r=0;r<16;++r)ql(e,"XF",ya({numFmtId:0,style:!0},0,t));t.cellXfs.forEach((function(r){ql(e,"XF",ya(r,0,t))}))}(n,r),s&&ql(n,"UsesELFs",Ln(!1));var c=n.end(),u=jt();s&&ql(u,"Country",function(e){return e||(e=Bt(4)),e.write_shift(2,1),e.write_shift(2,1),e}()),s&&r.Strings&&function(e,t,r,n){var a=(r||[]).length||0;if(a<=8224)return ql(e,t,r,a);var i=+Vl.SST;if(!isNaN(i)){for(var o=r.parts||[],s=0,l=0,c=0;c+(o[s]||8224)<=8224;)c+=o[s]||8224,s++;var u=e.next(4);for(u.write_shift(2,i),u.write_shift(2,c),e.push(r.slice(l,l+c)),l+=c;l<a;){for((u=e.next(4)).write_shift(2,60),c=0;c+(o[s]||8224)<=8224;)c+=o[s]||8224,s++;u.write_shift(2,c),e.push(r.slice(l,l+c)),l+=c}}}(u,"SST",function(e,t){var r=Bt(8);r.write_shift(4,e.Count),r.write_shift(4,e.Unique);for(var n=[],a=0;a<e.length;++a)n[a]=Vn(e[a]);var i=A([r].concat(n));return i.parts=[r.length].concat(n.map((function(e){return e.length}))),i}(r.Strings)),ql(u,"EOF");var f=u.end(),p=jt(),h=0,d=0;for(d=0;d<e.SheetNames.length;++d)h+=(s?12:11)+(s?2:1)*e.SheetNames[d].length;var m=c.length+h+f.length;for(d=0;d<e.SheetNames.length;++d)ql(p,"BoundSheet8",pa({pos:m,hs:(i[d]||{}).Hidden||0,dt:0,name:e.SheetNames[d]},r)),m+=t[d].length;var g=p.end();if(h!=g.length)throw new Error("BS8 "+h+" != "+g.length);var y=[];return c.length&&y.push(c),g.length&&y.push(g),f.length&&y.push(f),st([y])}function Zl(e,t){var r=t||{};switch(r.biff||2){case 8:case 5:return function(e,t){var r=t||{},n=[];e&&!e.SSF&&(e.SSF=E.get_table()),e&&e.SSF&&(C(E),E.load_table(e.SSF),r.revssf=V(e.SSF),r.revssf[e.SSF[65535]]=0,r.ssf=e.SSF),r.Strings=[],r.Strings.Count=0,r.Strings.Unique=0,_c(r),r.cellXfs=[],ds(r.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={});for(var a=0;a<e.SheetNames.length;++a)n[n.length]=Xl(a,r,e);return n.unshift(Yl(e,n,r)),st([n])}(e,t);case 4:case 3:case 2:return function(e,t){for(var r=t||{},n=jt(),a=0,i=0;i<e.SheetNames.length;++i)e.SheetNames[i]==r.sheet&&(a=i);if(0==a&&r.sheet&&e.SheetNames[0]!=r.sheet)throw new Error("Sheet not found: "+r.sheet);return ql(n,4==r.biff?1033:3==r.biff?521:9,fa(0,16,r)),function(e,t,r,n){var a,i=Array.isArray(t),o=er(t["!ref"]||"A1"),s="",l=[];if(o.e.c>255||o.e.r>16383){if(n.WTF)throw new Error("Range "+(t["!ref"]||"A1")+" exceeds format limit A1:IV16384");o.e.c=Math.min(o.e.c,255),o.e.r=Math.min(o.e.c,16383),a=Qt(o)}for(var c=o.s.r;c<=o.e.r;++c){s=Gt(c);for(var u=o.s.c;u<=o.e.c;++u){c===o.s.r&&(l[u]=Yt(u)),a=l[u]+s;var f=i?(t[c]||[])[u]:t[a];f&&Hl(e,f,c,u)}}}(n,e.Sheets[e.SheetNames[a]],0,r),ql(n,10),n.end()}(e,t)}throw new Error("invalid type "+r.bookType+" for BIFF")}var Kl=function(){function e(e,t){var r=t||{},n=r.dense?[]:{},a=(e=e.replace(/<!--.*?-->/g,"")).match(/<table/i);if(!a)throw new Error("Invalid HTML: could not find <table>");var i=e.match(/<\/table/i),o=a.index,s=i&&i.index||e.length,l=function(e,t,r){if(oe||"string"==typeof t)return e.split(t);for(var n=e.split(t),a=[n[0]],i=1;i<n.length;++i)a.push("<tr>"),a.push(n[i]);return a}(e.slice(o,s),/(:?<tr[^>]*>)/i),c=-1,u=0,f=0,p=0,h={s:{r:1e7,c:1e7},e:{r:0,c:0}},d=[];for(o=0;o<l.length;++o){var m=l[o].trim(),g=m.slice(0,3).toLowerCase();if("<tr"!=g){if("<td"==g||"<th"==g){var y=m.split(/<\/t[dh]>/i);for(s=0;s<y.length;++s){var v=y[s].trim();if(v.match(/<t[dh]/i)){for(var b=v,x=0;"<"==b.charAt(0)&&(x=b.indexOf(">"))>-1;)b=b.slice(x+1);for(var _=0;_<d.length;++_){var w=d[_];w.s.c==u&&w.s.r<c&&c<=w.e.r&&(u=w.e.c+1,_=-1)}var k=_e(v.slice(0,v.indexOf(">")));p=k.colspan?+k.colspan:1,((f=+k.rowspan)>1||p>1)&&d.push({s:{r:c,c:u},e:{r:c+(f||1)-1,c:u+p-1}});var D=k.t||k["data-t"]||"";if(b.length){if(b=We(b),h.s.r>c&&(h.s.r=c),h.e.r<c&&(h.e.r=c),h.s.c>u&&(h.s.c=u),h.e.c<u&&(h.e.c=u),b.length){var T={t:"s",v:b};r.raw||!b.trim().length||"s"==D||("TRUE"===b?T={t:"b",v:!0}:"FALSE"===b?T={t:"b",v:!1}:isNaN(ne(b))?isNaN(ae(b).getDate())||(T={t:"d",v:Q(b)},r.cellDates||(T={t:"n",v:W(T.v)}),T.z=r.dateNF||E._table[14]):T={t:"n",v:ne(b)}),r.dense?(n[c]||(n[c]=[]),n[c][u]=T):n[Kt({r:c,c:u})]=T,u+=p}}else u+=p}}}}else{if(++c,r.sheetRows&&r.sheetRows<=c){--c;break}u=0}}return n["!ref"]=Qt(h),d.length&&(n["!merges"]=d),n}function t(e,t,r,n){for(var a=e["!merges"]||[],i=[],o=t.s.c;o<=t.e.c;++o){for(var s=0,l=0,c=0;c<a.length;++c)if(!(a[c].s.r>r||a[c].s.c>o||a[c].e.r<r||a[c].e.c<o)){if(a[c].s.r<r||a[c].s.c<o){s=-1;break}s=a[c].e.r-a[c].s.r+1,l=a[c].e.c-a[c].s.c+1;break}if(!(s<0)){var u=Kt({r,c:o}),f=n.dense?(e[r]||[])[o]:e[u],p=f&&null!=f.v&&(f.h||Ie(f.w||(tr(f),f.w)||""))||"",h={};s>1&&(h.rowspan=s),l>1&&(h.colspan=l),n.editable?p='<span contenteditable="true">'+p+"</span>":f&&(h["data-t"]=f&&f.t||"z",null!=f.v&&(h["data-v"]=f.v),null!=f.z&&(h["data-z"]=f.z),f.l&&"#"!=(f.l.Target||"#").charAt(0)&&(p='<a href="'+f.l.Target+'">'+p+"</a>")),h.id=(n.id||"sjs")+"-"+u,i.push(Qe("td",p,h))}}return"<tr>"+i.join("")+"</tr>"}function r(e,t,r){return[].join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}var n='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',a="</body></html>";return{to_workbook:function(t,r){var n=t.match(/<table.*?>[\s\S]*?<\/table>/gi);if(!n||0==n.length)throw new Error("Invalid HTML: could not find <table>");if(1==n.length)return rr(e(n[0],r),r);var a=Gc.book_new();return n.forEach((function(t,n){Gc.book_append_sheet(a,e(t,r),"Sheet"+(n+1))})),a},to_sheet:e,_row:t,BEGIN:n,END:a,_preamble:r,from_sheet:function(e,i){var o=i||{},s=null!=o.header?o.header:n,l=null!=o.footer?o.footer:a,c=[s],u=Jt(e["!ref"]);o.dense=Array.isArray(e),c.push(r(0,0,o));for(var f=u.s.r;f<=u.e.r;++f)c.push(t(e,u,f,o));return c.push("</table>"+l),c.join("")}}}();function Jl(e,t,r){var n=r||{},a=0,i=0;if(null!=n.origin)if("number"==typeof n.origin)a=n.origin;else{var o="string"==typeof n.origin?Zt(n.origin):n.origin;a=o.r,i=o.c}var s=t.getElementsByTagName("tr"),l=Math.min(n.sheetRows||1e7,s.length),c={s:{r:0,c:0},e:{r:a,c:i}};if(e["!ref"]){var u=Jt(e["!ref"]);c.s.r=Math.min(c.s.r,u.s.r),c.s.c=Math.min(c.s.c,u.s.c),c.e.r=Math.max(c.e.r,u.e.r),c.e.c=Math.max(c.e.c,u.e.c),-1==a&&(c.e.r=a=u.e.r+1)}var f=[],p=0,h=e["!rows"]||(e["!rows"]=[]),d=0,m=0,g=0,y=0,v=0,b=0;for(e["!cols"]||(e["!cols"]=[]);d<s.length&&m<l;++d){var x=s[d];if(ec(x)){if(n.display)continue;h[m]={hidden:!0}}var _=x.children;for(g=y=0;g<_.length;++g){var w=_[g];if(!n.display||!ec(w)){var k=w.hasAttribute("data-v")?w.getAttribute("data-v"):w.hasAttribute("v")?w.getAttribute("v"):We(w.innerHTML),D=w.getAttribute("data-z")||w.getAttribute("z");for(p=0;p<f.length;++p){var T=f[p];T.s.c==y+i&&T.s.r<m+a&&m+a<=T.e.r&&(y=T.e.c+1-i,p=-1)}b=+w.getAttribute("colspan")||1,((v=+w.getAttribute("rowspan")||1)>1||b>1)&&f.push({s:{r:m+a,c:y+i},e:{r:m+a+(v||1)-1,c:y+i+(b||1)-1}});var A={t:"s",v:k},S=w.getAttribute("data-t")||w.getAttribute("t")||"";null!=k&&(0==k.length?A.t=S||"z":n.raw||0==k.trim().length||"s"==S||("TRUE"===k?A={t:"b",v:!0}:"FALSE"===k?A={t:"b",v:!1}:isNaN(ne(k))?isNaN(ae(k).getDate())||(A={t:"d",v:Q(k)},n.cellDates||(A={t:"n",v:W(A.v)}),A.z=n.dateNF||E._table[14]):A={t:"n",v:ne(k)})),void 0===A.z&&null!=D&&(A.z=D);var M="",C=w.getElementsByTagName("A");if(C&&C.length)for(var N=0;N<C.length&&(!C[N].hasAttribute("href")||"#"==(M=C[N].getAttribute("href")).charAt(0));++N);M&&"#"!=M.charAt(0)&&(A.l={Target:M}),n.dense?(e[m+a]||(e[m+a]=[]),e[m+a][y+i]=A):e[Kt({c:y+i,r:m+a})]=A,c.e.c<y+i&&(c.e.c=y+i),y+=b}}++m}return f.length&&(e["!merges"]=(e["!merges"]||[]).concat(f)),c.e.r=Math.max(c.e.r,m-1+a),e["!ref"]=Qt(c),m>=l&&(e["!fullref"]=Qt((c.e.r=s.length-d+m-1+a,c))),e}function Ql(e,t){return Jl((t||{}).dense?[]:{},e,t)}function ec(e){var t="",r=function(e){return e.ownerDocument.defaultView&&"function"==typeof e.ownerDocument.defaultView.getComputedStyle?e.ownerDocument.defaultView.getComputedStyle:"function"==typeof getComputedStyle?getComputedStyle:null}(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style.display),"none"===t}var tc,rc=(tc={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']},function(e,t){var r,n,a,i,o,s,l,c=t||{},u=Tl(e),f=[],p={name:""},h="",d=0,m={},g=[],y=c.dense?[]:{},v={value:""},b="",x=0,_=[],w=-1,k=-1,D={s:{r:1e6,c:1e7},e:{r:0,c:0}},T=0,A={},S=[],M={},E=[],C=1,N=1,O=[],I={Names:[]},P={},R=["",""],L=[],F={},B="",z=0,j=!1,U=!1,$=0;for(Al.lastIndex=0,u=u.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");o=Al.exec(u);)switch(o[3]=o[3].replace(/_.*$/,"")){case"table":case"工作表":"/"===o[1]?(D.e.c>=D.s.c&&D.e.r>=D.s.r?y["!ref"]=Qt(D):y["!ref"]="A1:A1",c.sheetRows>0&&c.sheetRows<=D.e.r&&(y["!fullref"]=y["!ref"],D.e.r=c.sheetRows-1,y["!ref"]=Qt(D)),S.length&&(y["!merges"]=S),E.length&&(y["!rows"]=E),a.name=a["名称"]||a.name,"undefined"!=typeof JSON&&JSON.stringify(a),g.push(a.name),m[a.name]=y,U=!1):"/"!==o[0].charAt(o[0].length-2)&&(a=_e(o[0],!1),w=k=-1,D.s.r=D.s.c=1e7,D.e.r=D.e.c=0,y=c.dense?[]:{},S=[],E=[],U=!0);break;case"table-row-group":"/"===o[1]?--T:++T;break;case"table-row":case"行":if("/"===o[1]){w+=C,C=1;break}if((i=_e(o[0],!1))["行号"]?w=i["行号"]-1:-1==w&&(w=0),(C=+i["number-rows-repeated"]||1)<10)for($=0;$<C;++$)T>0&&(E[w+$]={level:T});k=-1;break;case"covered-table-cell":"/"!==o[1]&&++k,c.sheetStubs&&(c.dense?(y[w]||(y[w]=[]),y[w][k]={t:"z"}):y[Kt({r:w,c:k})]={t:"z"}),b="",_=[];break;case"table-cell":case"数据":if("/"===o[0].charAt(o[0].length-2))++k,v=_e(o[0],!1),N=parseInt(v["number-columns-repeated"]||"1",10),s={t:"z",v:null},v.formula&&0!=c.cellFormula&&(s.f=os(Se(v.formula))),"string"==(v["数据类型"]||v["value-type"])&&(s.t="s",s.v=Se(v["string-value"]||""),c.dense?(y[w]||(y[w]=[]),y[w][k]=s):y[Kt({r:w,c:k})]=s),k+=N-1;else if("/"!==o[1]){b="",x=0,_=[],N=1;var V=C?w+C-1:w;if(++k>D.e.c&&(D.e.c=k),k<D.s.c&&(D.s.c=k),w<D.s.r&&(D.s.r=w),V>D.e.r&&(D.e.r=V),L=[],F={},s={t:(v=_e(o[0],!1))["数据类型"]||v["value-type"],v:null},c.cellFormula)if(v.formula&&(v.formula=Se(v.formula)),v["number-matrix-columns-spanned"]&&v["number-matrix-rows-spanned"]&&(M={s:{r:w,c:k},e:{r:w+(parseInt(v["number-matrix-rows-spanned"],10)||0)-1,c:k+(parseInt(v["number-matrix-columns-spanned"],10)||0)-1}},s.F=Qt(M),O.push([M,s.F])),v.formula)s.f=os(v.formula);else for($=0;$<O.length;++$)w>=O[$][0].s.r&&w<=O[$][0].e.r&&k>=O[$][0].s.c&&k<=O[$][0].e.c&&(s.F=O[$][1]);switch((v["number-columns-spanned"]||v["number-rows-spanned"])&&(M={s:{r:w,c:k},e:{r:w+(parseInt(v["number-rows-spanned"],10)||0)-1,c:k+(parseInt(v["number-columns-spanned"],10)||0)-1}},S.push(M)),v["number-columns-repeated"]&&(N=parseInt(v["number-columns-repeated"],10)),s.t){case"boolean":s.t="b",s.v=Re(v["boolean-value"]);break;case"float":case"percentage":case"currency":s.t="n",s.v=parseFloat(v.value);break;case"date":s.t="d",s.v=Q(v["date-value"]),c.cellDates||(s.t="n",s.v=W(s.v)),s.z="m/d/yy";break;case"time":s.t="n",s.v=Z(v["time-value"])/86400,c.cellDates&&(s.t="d",s.v=Y(s.v)),s.z="HH:MM:SS";break;case"number":s.t="n",s.v=parseFloat(v["数据数值"]);break;default:if("string"!==s.t&&"text"!==s.t&&s.t)throw new Error("Unsupported value type "+s.t);s.t="s",null!=v["string-value"]&&(b=Se(v["string-value"]),_=[])}}else{if(j=!1,"s"===s.t&&(s.v=b||"",_.length&&(s.R=_),j=0==x),P.Target&&(s.l=P),L.length>0&&(s.c=L,L=[]),b&&!1!==c.cellText&&(s.w=b),j&&(s.t="z",delete s.v),(!j||c.sheetStubs)&&!(c.sheetRows&&c.sheetRows<=w))for(var q=0;q<C;++q){if(N=parseInt(v["number-columns-repeated"]||"1",10),c.dense)for(y[w+q]||(y[w+q]=[]),y[w+q][k]=0==q?s:te(s);--N>0;)y[w+q][k+N]=te(s);else for(y[Kt({r:w+q,c:k})]=s;--N>0;)y[Kt({r:w+q,c:k+N})]=te(s);D.e.c<=k&&(D.e.c=k)}k+=(N=parseInt(v["number-columns-repeated"]||"1",10))-1,N=0,s={},b="",_=[]}P={};break;case"document":case"document-content":case"电子表格文档":case"spreadsheet":case"主体":case"scripts":case"styles":case"font-face-decls":case"master-styles":if("/"===o[1]){if((r=f.pop())[0]!==o[3])throw"Bad state: "+r}else"/"!==o[0].charAt(o[0].length-2)&&f.push([o[3],!0]);break;case"annotation":if("/"===o[1]){if((r=f.pop())[0]!==o[3])throw"Bad state: "+r;F.t=b,_.length&&(F.R=_),F.a=B,L.push(F)}else"/"!==o[0].charAt(o[0].length-2)&&f.push([o[3],!1]);B="",z=0,b="",x=0,_=[];break;case"creator":"/"===o[1]?B=u.slice(z,o.index):z=o.index+o[0].length;break;case"meta":case"元数据":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if("/"===o[1]){if((r=f.pop())[0]!==o[3])throw"Bad state: "+r}else"/"!==o[0].charAt(o[0].length-2)&&f.push([o[3],!1]);b="",x=0,_=[];break;case"scientific-number":case"currency-symbol":case"currency-style":case"script":case"libraries":case"automatic-styles":case"default-style":case"page-layout":case"style":case"map":case"font-face":case"paragraph-properties":case"table-properties":case"table-column-properties":case"table-row-properties":case"table-cell-properties":case"fraction":case"boolean-style":case"boolean":case"text-style":case"text-content":case"text-properties":case"embedded-text":case"body":case"电子表格":case"forms":case"table-column":case"table-header-rows":case"table-rows":case"table-column-group":case"table-header-columns":case"table-columns":case"null-date":case"graphic-properties":case"calculation-settings":case"named-expressions":case"label-range":case"label-ranges":case"named-expression":case"sort":case"sort-by":case"sort-groups":case"tab":case"line-break":case"span":case"s":case"date":case"object":case"title":case"标题":case"desc":case"binary-data":case"table-source":case"scenario":case"iteration":case"content-validations":case"content-validation":case"help-message":case"error-message":case"database-ranges":case"filter":case"filter-and":case"filter-or":case"filter-condition":case"list-level-style-bullet":case"list-level-style-number":case"list-level-properties":case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":case"event-listener":case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":case"config-item":case"page-number":case"page-count":case"time":case"cell-range-source":case"detective":case"operation":case"highlighted-range":case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":case"rect":case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":case"properties":case"property":case"table-protection":case"data-pilot-grand-total":case"office-document-common-attrs":break;case"number-style":case"percentage-style":case"date-style":case"time-style":if("/"===o[1]){if(A[p.name]=h,(r=f.pop())[0]!==o[3])throw"Bad state: "+r}else"/"!==o[0].charAt(o[0].length-2)&&(h="",p=_e(o[0],!1),f.push([o[3],!0]));break;case"number":case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":switch(f[f.length-1][0]){case"time-style":case"date-style":n=_e(o[0],!1),h+=tc[o[3]]["long"===n.style?1:0]}break;case"text":if("/>"===o[0].slice(-2))break;if("/"===o[1])switch(f[f.length-1][0]){case"number-style":case"date-style":case"time-style":h+=u.slice(d,o.index)}else d=o.index+o[0].length;break;case"named-range":R=ss((n=_e(o[0],!1))["cell-range-address"]);var H={Name:n.name,Ref:R[0]+"!"+R[1]};U&&(H.Sheet=g.length),I.Names.push(H);break;case"p":case"文本串":if(["master-styles"].indexOf(f[f.length-1][0])>-1)break;if("/"!==o[1]||v&&v["string-value"])_e(o[0],!1),x=o.index+o[0].length;else{var G=(l=void 0,l=u.slice(x,o.index).replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,(function(e,t){return Array(parseInt(t,10)+1).join(" ")})).replace(/<text:tab[^>]*\/>/g,"\t").replace(/<text:line-break\/>/g,"\n"),[Se(l.replace(/<[^>]*>/g,""))]);b=(b.length>0?b+"\n":"")+G[0]}break;case"database-range":if("/"===o[1])break;try{m[(R=ss(_e(o[0])["target-range-address"]))[0]]["!autofilter"]={ref:R[1]}}catch(e){}break;case"a":if("/"!==o[1]){if(!(P=_e(o[0],!1)).href)break;P.Target=Se(P.href),delete P.href,"#"==P.Target.charAt(0)&&P.Target.indexOf(".")>-1?(R=ss(P.Target.slice(1)),P.Target="#"+R[0]+"!"+R[1]):P.Target.match(/^\.\.[\\\/]/)&&(P.Target=P.Target.slice(3))}break;default:switch(o[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"表:":case"字:":break;default:if(c.WTF)throw new Error(o)}}var X={Sheets:m,SheetNames:g,Workbook:I};return c.bookSheets&&delete X.Sheets,X});function nc(e,t){t=t||{},le(e,"META-INF/manifest.xml")&&function(e,t){for(var r,n,a=Tl(e);r=Al.exec(a);)switch(r[3]){case"manifest":break;case"file-entry":if("/"==(n=_e(r[0],!1)).path&&"application/vnd.oasis.opendocument.spreadsheet"!==n.type)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(t&&t.WTF)throw r}}(ue(e,"META-INF/manifest.xml"),t);var r=fe(e,"content.xml");if(!r)throw new Error("Missing content.xml in ODS / UOF file");var n=rc(Le(r),t);return le(e,"meta.xml")&&(n.Props=sn(ue(e,"meta.xml"))),n}function ac(e,t){return rc(e,t)}var ic=function(){var e="<office:document-styles "+Je({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","office:version":"1.2"})+'><office:master-styles><style:master-page style:name="mp1" style:page-layout-name="mp1"><style:header/><style:header-left style:display="false"/><style:footer/><style:footer-left style:display="false"/></style:master-page></office:master-styles></office:document-styles>';return function(){return ge+e}}(),oc=function(){var e="          <table:table-cell />\n",t=function(t,r,n){var a=[];a.push('      <table:table table:name="'+Ce(r.SheetNames[n])+'" table:style-name="ta1">\n');var i=0,o=0,s=Jt(t["!ref"]||"A1"),l=t["!merges"]||[],c=0,u=Array.isArray(t);if(t["!cols"])for(o=0;o<=s.e.c;++o)a.push("        <table:table-column"+(t["!cols"][o]?' table:style-name="co'+t["!cols"][o].ods+'"':"")+"></table:table-column>\n");var f="",p=t["!rows"]||[];for(i=0;i<s.s.r;++i)f=p[i]?' table:style-name="ro'+p[i].ods+'"':"",a.push("        <table:table-row"+f+"></table:table-row>\n");for(;i<=s.e.r;++i){for(f=p[i]?' table:style-name="ro'+p[i].ods+'"':"",a.push("        <table:table-row"+f+">\n"),o=0;o<s.s.c;++o)a.push(e);for(;o<=s.e.c;++o){var h=!1,d={},m="";for(c=0;c!=l.length;++c)if(!(l[c].s.c>o||l[c].s.r>i||l[c].e.c<o||l[c].e.r<i)){l[c].s.c==o&&l[c].s.r==i||(h=!0),d["table:number-columns-spanned"]=l[c].e.c-l[c].s.c+1,d["table:number-rows-spanned"]=l[c].e.r-l[c].s.r+1;break}if(h)a.push("          <table:covered-table-cell/>\n");else{var g=Kt({r:i,c:o}),y=u?(t[i]||[])[o]:t[g];if(y&&y.f&&(d["table:formula"]=Ce(("of:="+y.f.replace(so,"$1[.$2$3$4$5]").replace(/\]:\[/g,":")).replace(/;/g,"|").replace(/,/g,";")),y.F&&y.F.slice(0,g.length)==g)){var v=Jt(y.F);d["table:number-matrix-columns-spanned"]=v.e.c-v.s.c+1,d["table:number-matrix-rows-spanned"]=v.e.r-v.s.r+1}if(y){switch(y.t){case"b":m=y.v?"TRUE":"FALSE",d["office:value-type"]="boolean",d["office:boolean-value"]=y.v?"true":"false";break;case"n":m=y.w||String(y.v||0),d["office:value-type"]="float",d["office:value"]=y.v||0;break;case"s":case"str":m=null==y.v?"":y.v,d["office:value-type"]="string";break;case"d":m=y.w||Q(y.v).toISOString(),d["office:value-type"]="date",d["office:date-value"]=Q(y.v).toISOString(),d["table:style-name"]="ce1";break;default:a.push(e);continue}var b=Ce(m).replace(/  +/g,(function(e){return'<text:s text:c="'+e.length+'"/>'})).replace(/\t/g,"<text:tab/>").replace(/\n/g,"</text:p><text:p>").replace(/^ /,"<text:s/>").replace(/ $/,"<text:s/>");if(y.l&&y.l.Target){var x=y.l.Target;"#"==(x="#"==x.charAt(0)?"#"+x.slice(1).replace(/\./,"!"):x).charAt(0)||x.match(/^\w+:/)||(x="../"+x),b=Qe("text:a",b,{"xlink:href":x.replace(/&/g,"&amp;")})}a.push("          "+Qe("table:table-cell",Qe("text:p",b,{}),d)+"\n")}else a.push(e)}}a.push("        </table:table-row>\n")}return a.push("      </table:table>\n"),a.join("")};return function(e,r){var n=[ge],a=Je({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"}),i=Je({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});"fods"==r.bookType?(n.push("<office:document"+a+i+">\n"),n.push(nn().replace(/office:document-meta/g,"office:meta"))):n.push("<office:document-content"+a+">\n"),function(e,t){e.push(" <office:automatic-styles>\n"),e.push('  <number:date-style style:name="N37" number:automatic-order="true">\n'),e.push('   <number:month number:style="long"/>\n'),e.push("   <number:text>/</number:text>\n"),e.push('   <number:day number:style="long"/>\n'),e.push("   <number:text>/</number:text>\n"),e.push("   <number:year/>\n"),e.push("  </number:date-style>\n");var r=0;t.SheetNames.map((function(e){return t.Sheets[e]})).forEach((function(t){if(t&&t["!cols"])for(var n=0;n<t["!cols"].length;++n)if(t["!cols"][n]){var a=t["!cols"][n];if(null==a.width&&null==a.wpx&&null==a.wch)continue;xi(a),a.ods=r;var i=t["!cols"][n].wpx+"px";e.push('  <style:style style:name="co'+r+'" style:family="table-column">\n'),e.push('   <style:table-column-properties fo:break-before="auto" style:column-width="'+i+'"/>\n'),e.push("  </style:style>\n"),++r}}));var n=0;t.SheetNames.map((function(e){return t.Sheets[e]})).forEach((function(t){if(t&&t["!rows"])for(var r=0;r<t["!rows"].length;++r)if(t["!rows"][r]){t["!rows"][r].ods=n;var a=t["!rows"][r].hpx+"px";e.push('  <style:style style:name="ro'+n+'" style:family="table-row">\n'),e.push('   <style:table-row-properties fo:break-before="auto" style:row-height="'+a+'"/>\n'),e.push("  </style:style>\n"),++n}})),e.push('  <style:style style:name="ta1" style:family="table" style:master-page-name="mp1">\n'),e.push('   <style:table-properties table:display="true" style:writing-mode="lr-tb"/>\n'),e.push("  </style:style>\n"),e.push('  <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>\n'),e.push(" </office:automatic-styles>\n")}(n,e),n.push("  <office:body>\n"),n.push("    <office:spreadsheet>\n");for(var o=0;o!=e.SheetNames.length;++o)n.push(t(e.Sheets[e.SheetNames[o]],e,o));return n.push("    </office:spreadsheet>\n"),n.push("  </office:body>\n"),"fods"==r.bookType?n.push("</office:document>"):n.push("</office:document-content>"),n.join("")}}();function sc(e,t){if("fods"==t.bookType)return oc(e,t);var r=he(),n="",a=[],i=[];return pe(r,n="mimetype","application/vnd.oasis.opendocument.spreadsheet"),pe(r,n="content.xml",oc(e,t)),a.push([n,"text/xml"]),i.push([n,"ContentFile"]),pe(r,n="styles.xml",ic(e,t)),a.push([n,"text/xml"]),i.push([n,"StylesFile"]),pe(r,n="meta.xml",ge+nn()),a.push([n,"text/xml"]),i.push([n,"MetadataFile"]),pe(r,n="manifest.rdf",function(e){var t=[ge];t.push('<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n');for(var r=0;r!=e.length;++r)t.push(tn(e[r][0],e[r][1])),t.push(("",['  <rdf:Description rdf:about="">\n','    <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="'+e[r][0]+'"/>\n',"  </rdf:Description>\n"].join("")));return t.push(tn("","Document","pkg")),t.push("</rdf:RDF>"),t.join("")}(i)),a.push([n,"application/rdf+xml"]),pe(r,n="META-INF/manifest.xml",function(e){var t=[ge];t.push('<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">\n'),t.push('  <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>\n');for(var r=0;r<e.length;++r)t.push('  <manifest:file-entry manifest:full-path="'+e[r][0]+'" manifest:media-type="'+e[r][1]+'"/>\n');return t.push("</manifest:manifest>"),t.join("")}(a)),r}function lc(e){return function(t,r){var n=function(e,t){if(!t)return 0;var r=e.SheetNames.indexOf(t);if(-1==r)throw new Error("Sheet not found: "+t);return r}(t,r.sheet);return e.from_sheet(t.Sheets[t.SheetNames[n]],r,t)}}var cc=lc(Kl),uc=lc({from_sheet:$c}),fc=lc(void 0!==Ia?Ia:{}),pc=lc(void 0!==Pa?Pa:{}),hc=lc(void 0!==La?La:{}),dc=lc(void 0!==fi?fi:{}),mc=lc({from_sheet:Vc}),gc=lc(void 0!==Oa?Oa:{}),yc=lc(void 0!==Ra?Ra:{}),vc=lc(void 0!==Fa?{from_sheet:Fa.sheet_to_wk1}:{});function bc(e){return function(t){for(var r=0;r!=e.length;++r){var n=e[r];void 0===t[n[0]]&&(t[n[0]]=n[1]),"n"===n[2]&&(t[n[0]]=Number(t[n[0]]))}}}var xc=function(e){bc([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(e)},_c=bc([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]]);function wc(e,t,r,n,a,i,o,s,l,c,u,f){try{i[n]=Zr(fe(e,r,!0),t);var p,h=ue(e,t);switch(s){case"sheet":p=pl(h,t,a,l,i[n],c,u,f);break;case"chart":if(!(p=function(e,t,r,n,a,i,o,s){return".bin"===t.slice(-4)?function(e,t,r,n,a){if(!e)return e;n||(n={"!id":{}});var i={"!type":"chart","!drawel":null,"!rel":""},o=[],s=!1;return zt(e,(function(e,n,l){switch(l){case 550:i["!rel"]=e;break;case 651:a.Sheets[r]||(a.Sheets[r]={}),e.name&&(a.Sheets[r].CodeName=e.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:s=!0;break;case 36:s=!1;break;case 37:o.push(n);break;case 38:o.pop();break;default:if((n||"").indexOf("Begin")>0)o.push(n);else if((n||"").indexOf("End")>0)o.pop();else if(!s||t.WTF)throw new Error("Unexpected record "+l+" "+n)}}),t),n["!id"][i["!rel"]]&&(i["!drawel"]=n["!id"][i["!rel"]]),i}(e,n,r,a,i):function(e,t,r,n,a){if(!e)return e;n||(n={"!id":{}});var i,o={"!type":"chart","!drawel":null,"!rel":""},s=e.match(Ds);return s&&Ss(s[0],0,a,r),(i=e.match(/drawing r:id="(.*?)"/))&&(o["!rel"]=i[1]),n["!id"][o["!rel"]]&&(o["!drawel"]=n["!id"][o["!rel"]]),o}(e,0,r,a,i)}(h,t,a,l,i[n],c))||!p["!drawel"])break;var d=me(p["!drawel"].Target,t),m=Yr(d),g=function(e,t){if(!e)return"??";var r=(e.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return t["!id"][r].Target}(fe(e,d,!0),Zr(fe(e,m,!0),d)),y=me(g,d),v=Yr(y);p=function(e,t,r,n,a,i){var o=i||{"!type":"chart"};if(!e)return i;var s=0,l=0,c="A",u={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(e.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach((function(e){var t=function(e){var t,r=[],n=e.match(/^<c:numCache>/);(e.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/gm)||[]).forEach((function(e){var t=e.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);t&&(r[+t[1]]=n?+t[2]:t[2])}));var a=Se((e.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(e.match(/<c:f>(.*?)<\/c:f>/gm)||[]).forEach((function(e){t=e.replace(/<.*?>/g,"")})),[r,a,t]}(e);u.s.r=u.s.c=0,u.e.c=s,c=Yt(s),t[0].forEach((function(e,r){o[c+Gt(r)]={t:"n",v:e,z:t[1]},l=r})),u.e.r<l&&(u.e.r=l),++s})),s>0&&(o["!ref"]=Qt(u)),o}(fe(e,y,!0),0,0,Zr(fe(e,v,!0),y),0,p);break;case"macro":p=function(e,t,r,n,a,i,o,s){return t.slice(-4),{"!type":"macro"}}(0,t,0,0,i[n]);break;case"dialog":p=function(e,t,r,n,a,i,o,s){return t.slice(-4),{"!type":"dialog"}}(0,t,0,0,i[n]);break;default:throw new Error("Unrecognized sheet type "+s)}o[n]=p;var b=[];i&&i[n]&&z(i[n]).forEach((function(r){if(i[n][r].Type==Xr.CMNT){var a=me(i[n][r].Target,t);if(!(b=function(e,t,r){return".bin"===t.slice(-4)?function(e,t){var r=[],n=[],a={},i=!1;return zt(e,(function(e,o,s){switch(s){case 632:n.push(e);break;case 635:a=e;break;case 637:a.t=e.t,a.h=e.h,a.r=e.r;break;case 636:if(a.author=n[a.iauthor],delete a.iauthor,t.sheetRows&&a.rfx&&t.sheetRows<=a.rfx.r)break;a.t||(a.t=""),delete a.rfx,r.push(a);break;case 3072:case 37:case 38:break;case 35:i=!0;break;case 36:i=!1;break;default:if((o||"").indexOf("Begin")>0);else if((o||"").indexOf("End")>0);else if(!i||t.WTF)throw new Error("Unexpected record "+s+" "+o)}})),r}(e,r):function(e,t){if(e.match(/<(?:\w+:)?comments *\/>/))return[];var r=[],n=[],a=e.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);a&&a[1]&&a[1].split(/<\/\w*:?author>/).forEach((function(e){if(""!==e&&""!==e.trim()){var t=e.match(/<(?:\w+:)?author[^>]*>(.*)/);t&&r.push(t[1])}}));var i=e.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return i&&i[1]&&i[1].split(/<\/\w*:?comment>/).forEach((function(e){if(""!==e&&""!==e.trim()){var a=e.match(/<(?:\w+:)?comment[^>]*>/);if(a){var i=_e(a[0]),o={author:i.authorId&&r[i.authorId]||"sheetjsghost",ref:i.ref,guid:i.guid},s=Zt(i.ref);if(!(t.sheetRows&&t.sheetRows<=s.r)){var l=e.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),c=!!l&&!!l[1]&&Va(l[1])||{r:"",t:"",h:""};o.r=c.r,"<t></t>"==c.r&&(c.t=c.h=""),o.t=(c.t||"").replace(/\r\n/g,"\n").replace(/\r/g,"\n"),t.cellHTML&&(o.h=c.h),n.push(o)}}}})),n}(e,r)}(ue(e,a,!0),a,l))||!b.length)return;!function(e,t){var r,n=Array.isArray(e);t.forEach((function(t){var a=Zt(t.ref);if(n?(e[a.r]||(e[a.r]=[]),r=e[a.r][a.c]):r=e[t.ref],!r){r={t:"z"},n?e[a.r][a.c]=r:e[t.ref]=r;var i=er(e["!ref"]||"BDWGO1000001:A1");i.s.r>a.r&&(i.s.r=a.r),i.e.r<a.r&&(i.e.r=a.r),i.s.c>a.c&&(i.s.c=a.c),i.e.c<a.c&&(i.e.c=a.c);var o=Qt(i);o!==e["!ref"]&&(e["!ref"]=o)}r.c||(r.c=[]);var s={a:t.author,t:t.t,r:t.r};t.h&&(s.h=t.h),r.c.push(s)}))}(p,b)}}))}catch(e){if(l.WTF)throw e}}function kc(e){return"/"==e.charAt(0)?e.slice(1):e}function Dc(e,t){if(C(E),xc(t=t||{}),le(e,"META-INF/manifest.xml"))return nc(e,t);if(le(e,"objectdata.xml"))return nc(e,t);if(le(e,"Index/Document.iwa"))throw new Error("Unsupported NUMBERS file");var r,n,a=function(e){for(var t=e.FullPaths||z(e.files),r=[],n=0;n<t.length;++n)"/"!=t[n].slice(-1)&&r.push(t[n]);return r.sort()}(e),i=function(e){var t={workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],TODO:[],xmlns:""};if(!e||!e.match)return t;var r={};if((e.match(ve)||[]).forEach((function(e){var n=_e(e);switch(n[0].replace(be,"<")){case"<?xml":break;case"<Types":t.xmlns=n["xmlns"+(n[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":r[n.Extension]=n.ContentType;break;case"<Override":void 0!==t[Vr[n.ContentType]]&&t[Vr[n.ContentType]].push(n.PartName)}})),t.xmlns!==nt.CT)throw new Error("Unknown Namespace: "+t.xmlns);return t.calcchain=t.calcchains.length>0?t.calcchains[0]:"",t.sst=t.strs.length>0?t.strs[0]:"",t.style=t.styles.length>0?t.styles[0]:"",t.defaults=r,delete t.calcchains,t}(fe(e,"[Content_Types].xml")),o=!1;if(0===i.workbooks.length&&ue(e,n="xl/workbook.xml",!0)&&i.workbooks.push(n),0===i.workbooks.length){if(!ue(e,n="xl/workbook.bin",!0))throw new Error("Could not find workbook");i.workbooks.push(n),o=!0}"bin"==i.workbooks[0].slice(-3)&&(o=!0);var s={},l={};if(!t.bookSheets&&!t.bookProps){if(ls=[],i.sst)try{ls=function(e,t,r){return".bin"===t.slice(-4)?function(e,t){var r=[],n=!1;return zt(e,(function(e,a,i){switch(i){case 159:r.Count=e[0],r.Unique=e[1];break;case 19:r.push(e);break;case 160:return!0;case 35:n=!0;break;case 36:n=!1;break;default:if(a.indexOf("Begin")>0||a.indexOf("End"),!n||t.WTF)throw new Error("Unexpected record "+i+" "+a)}})),r}(e,r):function(e,t){var r=[],n="";if(!e)return r;var a=e.match(qa);if(a){n=a[2].replace(Wa,"").split(Ha);for(var i=0;i!=n.length;++i){var o=Va(n[i].trim(),t);null!=o&&(r[r.length]=o)}a=_e(a[1]),r.Count=a.count,r.Unique=a.uniqueCount}return r}(e,r)}(ue(e,kc(i.sst)),i.sst,t)}catch(e){if(t.WTF)throw e}t.cellStyles&&i.themes.length&&(s=function(e,t,r){return Zi(e,r)}(fe(e,i.themes[0].replace(/^\//,""),!0)||"",i.themes[0],t)),i.style&&(l=function(e,t,r,n){return".bin"===t.slice(-4)?function(e,t,r){var n={NumberFmt:[]};for(var a in E._table)n.NumberFmt[a]=E._table[a];n.CellXf=[],n.Fonts=[];var i=[],o=!1;return zt(e,(function(e,a,s){switch(s){case 44:n.NumberFmt[e[0]]=e[1],E.load(e[1],e[0]);break;case 43:n.Fonts.push(e),null!=e.color.theme&&t&&t.themeElements&&t.themeElements.clrScheme&&(e.color.rgb=hi(t.themeElements.clrScheme[e.color.theme].rgb,e.color.tint||0));break;case 1025:case 45:case 46:case 48:case 507:case 572:case 475:case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 47:"BrtBeginCellXFs"==i[i.length-1]&&n.CellXf.push(e);break;case 35:o=!0;break;case 36:o=!1;break;case 37:i.push(a),o=!0;break;case 38:i.pop(),o=!1;break;default:if((a||"").indexOf("Begin")>0)i.push(a);else if((a||"").indexOf("End")>0)i.pop();else if(!o||r.WTF&&"BrtACBegin"!=i[i.length-1])throw new Error("Unexpected record "+s+" "+a)}})),n}(e,r,n):Ni(e,r,n)}(ue(e,kc(i.style)),i.style,s,t))}i.links.map((function(r){try{return Zr(fe(e,Yr(kc(r))),r),function(e,t,r,n){if(".bin"===r.slice(-4))return function(e,t,r,n){if(!e)return e;var a=n||{},i=!1;zt(e,(function(e,t,r){switch(r){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:i=!0;break;case 36:i=!1;break;default:if((t||"").indexOf("Begin")>0);else if((t||"").indexOf("End")>0);else if(!i||a.WTF)throw new Error("Unexpected record "+r.toString(16)+" "+t)}}),a)}(e,0,0,n)}(ue(e,kc(r)),0,r,t)}catch(e){}}));var c=function(e,t,r){return".bin"===t.slice(-4)?function(e,t){var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},n=[],a=!1;t||(t={}),t.biff=12;var i=[],o=[[]];return o.SheetNames=[],o.XTI=[],jl[16]={n:"BrtFRTArchID$",f:ul},zt(e,(function(e,s,l){switch(l){case 156:o.SheetNames.push(e.name),r.Sheets.push(e);break;case 153:r.WBProps=e;break;case 39:null!=e.Sheet&&(t.SID=e.Sheet),e.Ref=Go(e.Ptg,0,null,o,t),delete t.SID,delete e.Ptg,i.push(e);break;case 1036:case 361:case 2071:case 158:case 143:case 664:case 353:case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:case 16:break;case 357:case 358:case 355:case 667:o[0].length?o.push([l,e]):o[0]=[l,e],o[o.length-1].XTI=[];break;case 362:0===o.length&&(o[0]=[],o[0].XTI=[]),o[o.length-1].XTI=o[o.length-1].XTI.concat(e),o.XTI=o.XTI.concat(e);break;case 35:case 37:n.push(s),a=!0;break;case 36:case 38:n.pop(),a=!1;break;default:if((s||"").indexOf("Begin")>0);else if((s||"").indexOf("End")>0);else if(!a||t.WTF&&"BrtACBegin"!=n[n.length-1]&&"BrtFRTBegin"!=n[n.length-1])throw new Error("Unexpected record "+l+" "+s)}}),t),nl(r),r.Names=i,r.supbooks=o,r}(e,r):function(e,t){if(!e)throw new Error("Could not find file");var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},n=!1,a="xmlns",i={},o=0;if(e.replace(ve,(function(s,l){var c=_e(s);switch(we(c[0])){case"<?xml":case"</workbook>":case"<fileVersion/>":case"</fileVersion>":case"<fileSharing":case"<fileSharing/>":case"</workbookPr>":case"<workbookProtection":case"<workbookProtection/>":case"<bookViews":case"<bookViews>":case"</bookViews>":case"</workbookView>":case"<sheets":case"<sheets>":case"</sheets>":case"</sheet>":case"<functionGroups":case"<functionGroups/>":case"<functionGroup":case"<externalReferences":case"</externalReferences>":case"<externalReferences>":case"<externalReference":case"<definedNames/>":case"<definedName/>":case"</calcPr>":case"<oleSize":case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":case"<customWorkbookView":case"</customWorkbookView>":case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":case"<pivotCache":case"<smartTagPr":case"<smartTagPr/>":case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":case"<smartTagType":case"<webPublishing":case"<webPublishing/>":case"<fileRecoveryPr":case"<fileRecoveryPr/>":case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":case"<webPublishObject":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":case"<ArchID":case"<revisionPtr":break;case"<workbook":s.match(ol)&&(a="xmlns"+s.match(/<(\w+):/)[1]),r.xmlns=c[a];break;case"<fileVersion":delete c[0],r.AppVersion=c;break;case"<workbookPr":case"<workbookPr/>":Ks.forEach((function(e){if(null!=c[e[0]])switch(e[2]){case"bool":r.WBProps[e[0]]=Re(c[e[0]]);break;case"int":r.WBProps[e[0]]=parseInt(c[e[0]],10);break;default:r.WBProps[e[0]]=c[e[0]]}})),c.codeName&&(r.WBProps.CodeName=Le(c.codeName));break;case"<workbookView":case"<workbookView/>":delete c[0],r.WBView.push(c);break;case"<sheet":switch(c.state){case"hidden":c.Hidden=1;break;case"veryHidden":c.Hidden=2;break;default:c.Hidden=0}delete c.state,c.name=Se(Le(c.name)),delete c[0],r.Sheets.push(c);break;case"<definedNames>":case"<definedNames":case"<ext":case"<AlternateContent":case"<AlternateContent>":n=!0;break;case"</definedNames>":case"</ext>":case"</AlternateContent>":n=!1;break;case"<definedName":(i={}).Name=Le(c.name),c.comment&&(i.Comment=c.comment),c.localSheetId&&(i.Sheet=+c.localSheetId),Re(c.hidden||"0")&&(i.Hidden=!0),o=l+s.length;break;case"</definedName>":i.Ref=Se(Le(e.slice(o,l))),r.Names.push(i);break;case"<calcPr":case"<calcPr/>":delete c[0],r.CalcPr=c;break;default:if(!n&&t.WTF)throw new Error("unrecognized "+c[0]+" in workbook")}return s})),-1===nt.main.indexOf(r.xmlns))throw new Error("Unknown Namespace: "+r.xmlns);return nl(r),r}(e,r)}(ue(e,kc(i.workbooks[0])),i.workbooks[0],t),u={},f="";i.coreprops.length&&((f=ue(e,kc(i.coreprops[0]),!0))&&(u=sn(f)),0!==i.extprops.length&&(f=ue(e,kc(i.extprops[0]),!0))&&function(e,t,r){var n={};t||(t={}),e=Le(e),un.forEach((function(r){var a=(e.match(qe(r[0]))||[])[1];switch(r[2]){case"string":a&&(t[r[1]]=Se(a));break;case"bool":t[r[1]]="true"===a;break;case"raw":var i=e.match(new RegExp("<"+r[0]+"[^>]*>([\\s\\S]*?)</"+r[0]+">"));i&&i.length>0&&(n[r[1]]=i[1])}})),n.HeadingPairs&&n.TitlesOfParts&&fn(n.HeadingPairs,n.TitlesOfParts,t,r)}(f,u,t));var p={};t.bookSheets&&!t.bookProps||0!==i.custprops.length&&(f=fe(e,kc(i.custprops[0]),!0))&&(p=function(e,t){var r={},n="",a=e.match(hn);if(a)for(var i=0;i!=a.length;++i){var o=a[i],s=_e(o);switch(s[0]){case"<?xml":case"<Properties":break;case"<property":n=Se(s.name);break;case"</property>":n=null;break;default:if(0===o.indexOf("<vt:")){var l=o.split(">"),c=l[0].slice(4),u=l[1];switch(c){case"lpstr":case"bstr":case"lpwstr":case"cy":case"error":r[n]=Se(u);break;case"bool":r[n]=Re(u);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":r[n]=parseInt(u,10);break;case"r4":case"r8":case"decimal":r[n]=parseFloat(u);break;case"filetime":case"date":r[n]=Q(u);break;default:if("/"==c.slice(-1))break;t.WTF&&"undefined"!=typeof console&&console.warn("Unexpected",o,c,l)}}else if("</"===o.slice(0,2));else if(t.WTF)throw new Error(o)}}return r}(f,t));var h={};if((t.bookSheets||t.bookProps)&&(c.Sheets?r=c.Sheets.map((function(e){return e.name})):u.Worksheets&&u.SheetNames.length>0&&(r=u.SheetNames),t.bookProps&&(h.Props=u,h.Custprops=p),t.bookSheets&&void 0!==r&&(h.SheetNames=r),t.bookSheets?h.SheetNames:t.bookProps))return h;r={};var d={};t.bookDeps&&i.calcchain&&(d=function(e,t,r){return".bin"===t.slice(-4)?function(e,t,r){var n=[];return zt(e,(function(e,t,r){if(63===r)n.push(e);else if((t||"").indexOf("Begin")>0);else if(!((t||"").indexOf("End")>0))throw new Error("Unexpected record "+r+" "+t)})),n}(e):function(e){var t=[];if(!e)return t;var r=1;return(e.match(ve)||[]).forEach((function(e){var n=_e(e);switch(n[0]){case"<?xml":case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete n[0],n.i?r=n.i:n.i=r,t.push(n)}})),t}(e)}(ue(e,kc(i.calcchain)),i.calcchain));var m,g,y=0,v={},b=c.Sheets;u.Worksheets=b.length,u.SheetNames=[];for(var x=0;x!=b.length;++x)u.SheetNames[x]=b[x].name;var _=o?"bin":"xml",w=i.workbooks[0].lastIndexOf("/"),k=(i.workbooks[0].slice(0,w+1)+"_rels/"+i.workbooks[0].slice(w+1)+".rels").replace(/^\//,"");le(e,k)||(k="xl/_rels/workbook."+_+".rels");var D=Zr(fe(e,k,!0),k);D&&(D=function(e,t){if(!e)return 0;try{e=t.map((function(t){return t.id||(t.id=t.strRelID),[t.name,e["!id"][t.id].Target,(r=e["!id"][t.id].Type,Xr.WS.indexOf(r)>-1?"sheet":Xr.CS&&r==Xr.CS?"chart":Xr.DS&&r==Xr.DS?"dialog":Xr.MS&&r==Xr.MS?"macro":r&&r.length?r:"sheet")];var r}))}catch(e){return null}return e&&0!==e.length?e:null}(D,c.Sheets));var T=ue(e,"xl/worksheets/sheet.xml",!0)?1:0;e:for(y=0;y!=u.Worksheets;++y){var A="sheet";if(D&&D[y]?(m="xl/"+D[y][1].replace(/[\/]?xl\//,""),le(e,m)||(m=D[y][1]),le(e,m)||(m=k.replace(/_rels\/.*$/,"")+D[y][1]),A=D[y][2]):m=(m="xl/worksheets/sheet"+(y+1-T)+"."+_).replace(/sheet0\./,"sheet."),g=m.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),t&&null!=t.sheets)switch(typeof t.sheets){case"number":if(y!=t.sheets)continue e;break;case"string":if(u.SheetNames[y].toLowerCase()!=t.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(t.sheets)){for(var S=!1,M=0;M!=t.sheets.length;++M)"number"==typeof t.sheets[M]&&t.sheets[M]==y&&(S=1),"string"==typeof t.sheets[M]&&t.sheets[M].toLowerCase()==u.SheetNames[y].toLowerCase()&&(S=1);if(!S)continue e}}wc(e,m,g,u.SheetNames[y],y,v,r,A,t,c,s,l)}return h={Directory:i,Workbook:c,Props:u,Custprops:p,Deps:d,Sheets:r,SheetNames:u.SheetNames,Strings:ls,Styles:l,Themes:s,SSF:E.get_table()},t&&t.bookFiles&&(e.files?(h.keys=a,h.files=e.files):(h.keys=[],h.files={},e.FullPaths.forEach((function(t,r){t=t.replace(/^Root Entry[\/]/,""),h.keys.push(t),h.files[t]=e.FileIndex[r]})))),t&&t.bookVBA&&(i.vba.length>0?h.vbaraw=ue(e,kc(i.vba[0]),!0):i.defaults&&"application/vnd.ms-office.vbaProject"===i.defaults.bin&&(h.vbaraw=ue(e,"xl/vbaProject.bin",!0))),h}function Tc(e,t){var r=t||{},n="Workbook",a=L.find(e,n);try{if(n="/!DataSpaces/Version",!(a=L.find(e,n))||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(function(e){var t={};t.id=e.read_shift(0,"lpp4"),t.R=Ja(e,4),t.U=Ja(e,4),t.W=Ja(e,4)}(a.content),n="/!DataSpaces/DataSpaceMap",!(a=L.find(e,n))||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);var i=function(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(Qa(e));return t}(a.content);if(1!==i.length||1!==i[0].comps.length||0!==i[0].comps[0].t||"StrongEncryptionDataSpace"!==i[0].name||"EncryptedPackage"!==i[0].comps[0].v)throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",!(a=L.find(e,n))||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);var o=function(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(e.read_shift(0,"lpp4"));return t}(a.content);if(1!=o.length||"StrongEncryptionTransform"!=o[0])throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",!(a=L.find(e,n))||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);!function(e){var t=function(e){var t={};return e.read_shift(4),e.l+=4,t.id=e.read_shift(0,"lpp4"),t.name=e.read_shift(0,"lpp4"),t.R=Ja(e,4),t.U=Ja(e,4),t.W=Ja(e,4),t}(e);if(t.ename=e.read_shift(0,"8lpp4"),t.blksz=e.read_shift(4),t.cmode=e.read_shift(4),4!=e.read_shift(4))throw new Error("Bad !Primary record")}(a.content)}catch(e){}if(n="/EncryptionInfo",!(a=L.find(e,n))||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);var s=function(e){var t=Ja(e);switch(t.Minor){case 2:return[t.Minor,ri(e)];case 3:return[t.Minor,ni()];case 4:return[t.Minor,ai(e)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+t.Minor)}(a.content);if(n="/EncryptedPackage",!(a=L.find(e,n))||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(4==s[0]&&"undefined"!=typeof decrypt_agile)return decrypt_agile(s[1],a.content,r.password||"",r);if(2==s[0]&&"undefined"!=typeof decrypt_std76)return decrypt_std76(s[1],a.content,r.password||"",r);throw new Error("File is password-protected")}function Ac(e,t){if(Qi=1024,"ods"==t.bookType)return sc(e,t);e&&!e.SSF&&(e.SSF=E.get_table()),e&&e.SSF&&(C(E),E.load_table(e.SSF),t.revssf=V(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,us?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r="xlsb"==t.bookType?"bin":"xml",n=io.indexOf(t.bookType)>-1,a={workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],TODO:[],xmlns:""};_c(t=t||{});var i=he(),o="",s=0;if(t.cellXfs=[],ds(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),pe(i,o="docProps/core.xml",function(e,t){var r=t||{},n=[ge,ln],a={};if(!e&&!r.Props)return n.join("");e&&(null!=e.CreatedDate&&cn("dcterms:created","string"==typeof e.CreatedDate?e.CreatedDate:et(e.CreatedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},n,a),null!=e.ModifiedDate&&cn("dcterms:modified","string"==typeof e.ModifiedDate?e.ModifiedDate:et(e.ModifiedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},n,a));for(var i=0;i!=an.length;++i){var o=an[i],s=r.Props&&null!=r.Props[o[1]]?r.Props[o[1]]:e?e[o[1]]:null;!0===s?s="1":!1===s?s="0":"number"==typeof s&&(s=String(s)),null!=s&&cn(o[0],s,null,n,a)}return n.length>2&&(n[n.length]="</cp:coreProperties>",n[1]=n[1].replace("/>",">")),n.join("")}(e.Props,t)),a.coreprops.push(o),en(t.rels,2,o,Xr.CORE_PROPS),o="docProps/app.xml",e.Props&&e.Props.SheetNames);else if(e.Workbook&&e.Workbook.Sheets){for(var l=[],c=0;c<e.SheetNames.length;++c)2!=(e.Workbook.Sheets[c]||{}).Hidden&&l.push(e.SheetNames[c]);e.Props.SheetNames=l}else e.Props.SheetNames=e.SheetNames;for(e.Props.Worksheets=e.Props.SheetNames.length,pe(i,o,function(e){var t=[],r=Qe;return e||(e={}),e.Application="SheetJS",t[t.length]=ge,t[t.length]=pn,un.forEach((function(n){if(void 0!==e[n[1]]){var a;switch(n[2]){case"string":a=Ce(String(e[n[1]]));break;case"bool":a=e[n[1]]?"true":"false"}void 0!==a&&(t[t.length]=r(n[0],a))}})),t[t.length]=r("HeadingPairs",r("vt:vector",r("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+r("vt:variant",r("vt:i4",String(e.Worksheets))),{size:2,baseType:"variant"})),t[t.length]=r("TitlesOfParts",r("vt:vector",e.SheetNames.map((function(e){return"<vt:lpstr>"+Ce(e)+"</vt:lpstr>"})).join(""),{size:e.Worksheets,baseType:"lpstr"})),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}(e.Props)),a.extprops.push(o),en(t.rels,3,o,Xr.EXT_PROPS),e.Custprops!==e.Props&&z(e.Custprops||{}).length>0&&(pe(i,o="docProps/custom.xml",function(e){var t=[ge,dn];if(!e)return t.join("");var r=1;return z(e).forEach((function(n){++r,t[t.length]=Qe("property",function(e,t){switch(typeof e){case"string":var r=Qe("vt:lpwstr",Ce(e));return r.replace(/&quot;/g,"_x0022_");case"number":return Qe((0|e)==e?"vt:i4":"vt:r8",Ce(String(e)));case"boolean":return Qe("vt:bool",e?"true":"false")}if(e instanceof Date)return Qe("vt:filetime",et(e));throw new Error("Unable to serialize "+e)}(e[n]),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:r,name:Ce(n)})})),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}(e.Custprops)),a.custprops.push(o),en(t.rels,4,o,Xr.CUST_PROPS)),s=1;s<=e.SheetNames.length;++s){var u={"!id":{}},f=e.Sheets[e.SheetNames[s-1]];if((f||{})["!type"],pe(i,o="xl/worksheets/sheet"+s+"."+r,dl(s-1,o,t,e,u)),a.sheets.push(o),en(t.wbrels,-1,"worksheets/sheet"+s+"."+r,Xr.WS[0]),f){var p=f["!comments"],h=!1;if(p&&p.length>0){var d="xl/comments"+s+"."+r;pe(i,d,gl(p,d,t)),a.comments.push(d),en(u,-1,"../comments"+s+"."+r,Xr.CMNT),h=!0}f["!legacy"]&&h&&pe(i,"xl/drawings/vmlDrawing"+s+".vml",eo(s,f["!comments"])),delete f["!comments"],delete f["!legacy"]}u["!id"].rId1&&pe(i,Yr(o),Jr(u))}return null!=t.Strings&&t.Strings.length>0&&(pe(i,o="xl/sharedStrings."+r,ml(t.Strings,o,t)),a.strs.push(o),en(t.wbrels,-1,"sharedStrings."+r,Xr.SST)),pe(i,o="xl/workbook."+r,hl(e,o,t)),a.workbooks.push(o),en(t.rels,1,o,Xr.WB),pe(i,o="xl/theme/theme1.xml",Ki(e.Themes,t)),a.themes.push(o),en(t.wbrels,-1,"theme/theme1.xml",Xr.THEME),pe(i,o="xl/styles."+r,function(e,t,r){return(".bin"===t.slice(-4)?Ui:Ii)(e,r)}(e,o,t)),a.styles.push(o),en(t.wbrels,-1,"styles."+r,Xr.STY),e.vbaraw&&n&&(pe(i,o="xl/vbaProject.bin",e.vbaraw),a.vba.push(o),en(t.wbrels,-1,"vbaProject.bin",Xr.VBA)),pe(i,"[Content_Types].xml",function(e,t){var r,n=[];n[n.length]=ge,n[n.length]=Hr,n=n.concat(Gr);var a=function(a){e[a]&&e[a].length>0&&(r=e[a][0],n[n.length]=Qe("Override",null,{PartName:("/"==r[0]?"":"/")+r,ContentType:qr[a][t.bookType||"xlsx"]}))},i=function(r){(e[r]||[]).forEach((function(e){n[n.length]=Qe("Override",null,{PartName:("/"==e[0]?"":"/")+e,ContentType:qr[r][t.bookType||"xlsx"]})}))},o=function(t){(e[t]||[]).forEach((function(e){n[n.length]=Qe("Override",null,{PartName:("/"==e[0]?"":"/")+e,ContentType:Wr[t][0]})}))};return a("workbooks"),i("sheets"),i("charts"),o("themes"),["strs","styles"].forEach(a),["coreprops","extprops","custprops"].forEach(o),o("vba"),o("comments"),o("drawings"),n.length>2&&(n[n.length]="</Types>",n[1]=n[1].replace("/>",">")),n.join("")}(a,t)),pe(i,"_rels/.rels",Jr(t.rels)),pe(i,"xl/_rels/workbook."+r+".rels",Jr(t.wbrels)),delete t.revssf,delete t.ssf,i}function Sc(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=g.decode(e.slice(0,12));break;case"binary":r=e;break;default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function Mc(e,t){var r=0;e:for(;r<e.length;)switch(e.charCodeAt(r)){case 10:case 13:case 32:++r;break;case 60:return Ml(e.slice(r),t);default:break e}return La.to_workbook(e,t)}function Ec(e,t,r,n){return n?(r.type="string",La.to_workbook(e,r)):La.to_workbook(t,r)}function Cc(e,t){u();var r=t||{};if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)return Cc(new Uint8Array(e),((r=te(r)).type="array",r));var n,a=e,i=!1;if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),cs={},r.dateNF&&(cs.dateNF=r.dateNF),r.type||(r.type=y&&Buffer.isBuffer(e)?"buffer":"base64"),"file"==r.type&&(r.type=y?"buffer":"binary",a=function(e){if(void 0!==R)return R.readFileSync(e);if("undefined"!=typeof $&&"undefined"!=typeof File&&"undefined"!=typeof Folder)try{var t=File(e);t.open("r"),t.encoding="binary";var r=t.read();return t.close(),r}catch(e){if(!e.message||!e.message.match(/onstruct/))throw e}throw new Error("Cannot access file "+e)}(e)),"string"==r.type&&(i=!0,r.type="binary",r.codepage=65001,a=function(e){return e.match(/[^\x00-\x7F]/)?Fe(e):e}(e)),"array"==r.type&&"undefined"!=typeof Uint8Array&&e instanceof Uint8Array&&"undefined"!=typeof ArrayBuffer){var o=new ArrayBuffer(3),s=new Uint8Array(o);if(s.foo="bar",!s.foo)return(r=te(r)).type="array",Cc(T(a),r)}switch((n=Sc(a,r))[0]){case 208:if(207===n[1]&&17===n[2]&&224===n[3]&&161===n[4]&&177===n[5]&&26===n[6]&&225===n[7])return function(e,t){return L.find(e,"EncryptedPackage")?Tc(e,t):zl(e,t)}(L.read(a,r),r);break;case 9:if(n[1]<=8)return zl(a,r);break;case 60:return Ml(a,r);case 73:if(73===n[1]&&42===n[2]&&0===n[3])throw new Error("TIFF Image File is not a spreadsheet");if(68===n[1])return function(e,t){var r=t||{},n=!!r.WTF;r.WTF=!0;try{var a=Ia.to_workbook(e,r);return r.WTF=n,a}catch(a){if(r.WTF=n,!a.message.match(/SYLK bad record ID/)&&n)throw a;return La.to_workbook(e,t)}}(a,r);break;case 84:if(65===n[1]&&66===n[2]&&76===n[3])return Pa.to_workbook(a,r);break;case 80:return 75===n[1]&&n[2]<9&&n[3]<9?function(e,t){var r=e,n=t||{};return n.type||(n.type=y&&Buffer.isBuffer(e)?"buffer":"base64"),Dc(de(r,n),n)}(a,r):Ec(e,a,r,i);case 239:return 60===n[3]?Ml(a,r):Ec(e,a,r,i);case 255:if(254===n[1])return function(e,t){var r=e;return"base64"==t.type&&(r=g.decode(r)),r=cptable.utils.decode(1200,r.slice(2),"str"),t.type="binary",Mc(r,t)}(a,r);break;case 0:if(0===n[1]&&n[2]>=2&&0===n[3])return Fa.to_workbook(a,r);break;case 3:case 131:case 139:case 140:return Oa.to_workbook(a,r);case 123:if(92===n[1]&&114===n[2]&&116===n[3])return fi.to_workbook(a,r);break;case 10:case 13:case 32:return function(e,t){var r="",n=Sc(e,t);switch(t.type){case"base64":r=g.decode(e);break;case"binary":r=e;break;case"buffer":r=e.toString("binary");break;case"array":r=ee(e);break;default:throw new Error("Unrecognized type "+t.type)}return 239==n[0]&&187==n[1]&&191==n[2]&&(r=Le(r)),Mc(r,t)}(a,r);case 137:if(80===n[1]&&78===n[2]&&71===n[3])throw new Error("PNG Image File is not a spreadsheet")}return Oa.versions.indexOf(n[0])>-1&&n[2]<=12&&n[3]<=31?Oa.to_workbook(a,r):Ec(e,a,r,i)}function Nc(e,t){var r=t||{};return r.type="file",Cc(e,r)}function Oc(e,t){switch(t.type){case"base64":case"binary":break;case"buffer":case"array":t.type="";break;case"file":return B(t.file,L.write(e,{type:y?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");default:throw new Error("Unrecognized type "+t.type)}return L.write(e,t)}function Ic(e,t,r){r||(r="");var n=r+e;switch(t.type){case"base64":return g.encode(Fe(n));case"binary":return Fe(n);case"string":return e;case"file":return B(t.file,n,"utf8");case"buffer":return y?v(n,"utf8"):Ic(n,{type:"binary"}).split("").map((function(e){return e.charCodeAt(0)}))}throw new Error("Unrecognized type "+t.type)}function Pc(e,t){switch(t.type){case"string":case"base64":case"binary":for(var r="",n=0;n<e.length;++n)r+=String.fromCharCode(e[n]);return"base64"==t.type?g.encode(r):"string"==t.type?Le(r):r;case"file":return B(t.file,e);case"buffer":return e;default:throw new Error("Unrecognized type "+t.type)}}function Rc(e,t){u(),function(e){if(!e||!e.SheetNames||!e.Sheets)throw new Error("Invalid Workbook");if(!e.SheetNames.length)throw new Error("Workbook is empty");var t,r,n,a=e.Workbook&&e.Workbook.Sheets||[];t=e.SheetNames,r=a,n=!!e.vbaraw,t.forEach((function(e,a){il(e);for(var i=0;i<a;++i)if(e==t[i])throw new Error("Duplicate Sheet Name: "+e);if(n){var o=r&&r[a]&&r[a].CodeName||e;if(95==o.charCodeAt(0)&&o.length>22)throw new Error("Bad Code Name: Worksheet"+o)}}));for(var i=0;i<e.SheetNames.length;++i)gs(e.Sheets[e.SheetNames[i]],e.SheetNames[i],i)}(e);var r=te(t||{});if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),"array"==r.type){r.type="binary";var n=Rc(e,r);return r.type="array",k(n)}switch(r.bookType||"xlsb"){case"xml":case"xlml":return Ic(Il(e,r),r);case"slk":case"sylk":return Ic(fc(e,r),r);case"htm":case"html":return Ic(cc(e,r),r);case"txt":return function(e,t){switch(t.type){case"base64":return g.encode(e);case"binary":case"string":return e;case"file":return B(t.file,e,"binary");case"buffer":return y?v(e,"binary"):e.split("").map((function(e){return e.charCodeAt(0)}))}throw new Error("Unrecognized type "+t.type)}(mc(e,r),r);case"csv":return Ic(uc(e,r),r,"\ufeff");case"dif":return Ic(pc(e,r),r);case"dbf":return Pc(gc(e,r),r);case"prn":return Ic(hc(e,r),r);case"rtf":return Ic(dc(e,r),r);case"eth":return Ic(yc(e,r),r);case"fods":return Ic(sc(e,r),r);case"wk1":return Pc(vc(e,r),r);case"wk3":return Pc(Fa.book_to_wk3(e,r),r);case"biff2":r.biff||(r.biff=2);case"biff3":r.biff||(r.biff=3);case"biff4":return r.biff||(r.biff=4),Pc(Zl(e,r),r);case"biff5":r.biff||(r.biff=5);case"biff8":case"xla":case"xls":return r.biff||(r.biff=8),function(e,t){var r=t||{};return Oc(function(e,t){var r=t||{},n=L.utils.cfb_new({root:"R"}),a="/Workbook";switch(r.bookType||"xls"){case"xls":r.bookType="biff8";case"xla":r.bookType||(r.bookType="xla");case"biff8":a="/Workbook",r.biff=8;break;case"biff5":a="/Book",r.biff=5;break;default:throw new Error("invalid type "+r.bookType+" for XLS CFB")}return L.utils.cfb_add(n,a,Zl(e,r)),8==r.biff&&(e.Props||e.Custprops)&&function(e,t){var r,n=[],a=[],i=[],o=0;if(e.Props)for(r=z(e.Props),o=0;o<r.length;++o)(Object.prototype.hasOwnProperty.call(Lr,r[o])?n:Object.prototype.hasOwnProperty.call(Fr,r[o])?a:i).push([r[o],e.Props[r[o]]]);if(e.Custprops)for(r=z(e.Custprops),o=0;o<r.length;++o)Object.prototype.hasOwnProperty.call(e.Props||{},r[o])||(Object.prototype.hasOwnProperty.call(Lr,r[o])?n:Object.prototype.hasOwnProperty.call(Fr,r[o])?a:i).push([r[o],e.Custprops[r[o]]]);var s=[];for(o=0;o<i.length;++o)En.indexOf(i[o][0])>-1||null!=i[o][1]&&s.push(i[o]);a.length&&L.utils.cfb_add(t,"/SummaryInformation",In(a,Fl,Fr,Rr)),(n.length||s.length)&&L.utils.cfb_add(t,"/DocumentSummaryInformation",In(n,Bl,Lr,Pr,s.length?s:null,"05d5cdd59c2e1b10939708002b2cf9ae"))}(e,n),8==r.biff&&e.vbaraw&&function(e,t){t.FullPaths.forEach((function(r,n){if(0!=n){var a=r.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");"/"!==a.slice(-1)&&L.utils.cfb_add(e,a,t.FileIndex[n].content)}}))}(n,L.read(e.vbaraw,{type:"string"==typeof e.vbaraw?"binary":"buffer"})),n}(e,r),r)}(e,r);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"ods":return function(e,t){var r=te(t||{}),n=Ac(e,r),a={};if(r.compression&&(a.compression="DEFLATE"),r.password)a.type=y?"nodebuffer":"string";else switch(r.type){case"base64":a.type="base64";break;case"binary":a.type="string";break;case"string":throw new Error("'string' output type invalid for '"+r.bookType+"' files");case"buffer":case"file":a.type=y?"nodebuffer":"string";break;default:throw new Error("Unrecognized type "+r.type)}var i=n.FullPaths?L.write(n,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[a.type]||a.type}):n.generate(a);return r.password&&"undefined"!=typeof encrypt_agile?Oc(encrypt_agile(i,r.password),r):"file"===r.type?B(r.file,i):"string"==r.type?Le(i):i}(e,r);default:throw new Error("Unrecognized bookType |"+r.bookType+"|")}}function Lc(e){if(!e.bookType){var t=e.file.slice(e.file.lastIndexOf(".")).toLowerCase();t.match(/^\.[a-z]+$/)&&(e.bookType=t.slice(1)),e.bookType={xls:"biff8",htm:"html",slk:"sylk",socialcalc:"eth",Sh33tJS:"WTF"}[e.bookType]||e.bookType}}function Fc(e,t,r){var n=r||{};return n.type="file",n.file=t,Lc(n),Rc(e,n)}function Bc(e,t,r,n,a,i,o,s){var l=Gt(r),c=s.defval,u=s.raw||!Object.prototype.hasOwnProperty.call(s,"raw"),f=!0,p=1===a?[]:{};if(1!==a)if(Object.defineProperty)try{Object.defineProperty(p,"__rowNum__",{value:r,enumerable:!1})}catch(e){p.__rowNum__=r}else p.__rowNum__=r;if(!o||e[r])for(var h=t.s.c;h<=t.e.c;++h){var d=o?e[r][h]:e[n[h]+l];if(void 0!==d&&void 0!==d.t){var m=d.v;switch(d.t){case"z":if(null==m)break;continue;case"e":m=0==m?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+d.t)}if(null!=i[h]){if(null==m)if("e"==d.t&&null===m)p[i[h]]=null;else if(void 0!==c)p[i[h]]=c;else{if(!u||null!==m)continue;p[i[h]]=null}else p[i[h]]=u||s.rawNumbers&&"n"==d.t?m:tr(d,m,s);null!=m&&(f=!1)}}else{if(void 0===c)continue;null!=i[h]&&(p[i[h]]=c)}}return{row:p,isempty:f}}function zc(e,t){if(null==e||null==e["!ref"])return[];var r={t:"n",v:0},n=0,a=1,i=[],o=0,s="",l={s:{r:0,c:0},e:{r:0,c:0}},c=t||{},u=null!=c.range?c.range:e["!ref"];switch(1===c.header?n=1:"A"===c.header?n=2:Array.isArray(c.header)?n=3:null==c.header&&(n=0),typeof u){case"string":l=er(u);break;case"number":(l=er(e["!ref"])).s.r=u;break;default:l=u}n>0&&(a=0);var f=Gt(l.s.r),p=[],h=[],d=0,m=0,g=Array.isArray(e),y=l.s.r,v=0,b=0;for(g&&!e[y]&&(e[y]=[]),v=l.s.c;v<=l.e.c;++v)switch(p[v]=Yt(v),r=g?e[y][v]:e[p[v]+f],n){case 1:i[v]=v-l.s.c;break;case 2:i[v]=p[v];break;case 3:i[v]=c.header[v-l.s.c];break;default:for(null==r&&(r={w:"__EMPTY",t:"s"}),s=o=tr(r,null,c),m=0,b=0;b<i.length;++b)i[b]==s&&(s=o+"_"+ ++m);i[v]=s}for(y=l.s.r+a;y<=l.e.r;++y){var x=Bc(e,l,y,p,n,i,g,c);(!1===x.isempty||(1===n?!1!==c.blankrows:c.blankrows))&&(h[d++]=x.row)}return h.length=d,h}var jc=/"/g;function Uc(e,t,r,n,a,i,o,s){for(var l=!0,c=[],u="",f=Gt(r),p=t.s.c;p<=t.e.c;++p)if(n[p]){var h=s.dense?(e[r]||[])[p]:e[n[p]+f];if(null==h)u="";else if(null!=h.v){l=!1,u=""+(s.rawNumbers&&"n"==h.t?h.v:tr(h,null,s));for(var d=0,m=0;d!==u.length;++d)if((m=u.charCodeAt(d))===a||m===i||34===m||s.forceQuotes){u='"'+u.replace(jc,'""')+'"';break}"ID"==u&&(u='"ID"')}else null==h.f||h.F?u="":(l=!1,(u="="+h.f).indexOf(",")>=0&&(u='"'+u.replace(jc,'""')+'"'));c.push(u)}return!1===s.blankrows&&l?null:c.join(o)}function $c(e,t){var r=[],n=null==t?{}:t;if(null==e||null==e["!ref"])return"";var a=er(e["!ref"]),i=void 0!==n.FS?n.FS:",",o=i.charCodeAt(0),s=void 0!==n.RS?n.RS:"\n",l=s.charCodeAt(0),c=new RegExp(("|"==i?"\\|":i)+"+$"),u="",f=[];n.dense=Array.isArray(e);for(var p=n.skipHidden&&e["!cols"]||[],h=n.skipHidden&&e["!rows"]||[],d=a.s.c;d<=a.e.c;++d)(p[d]||{}).hidden||(f[d]=Yt(d));for(var m=a.s.r;m<=a.e.r;++m)(h[m]||{}).hidden||null!=(u=Uc(e,a,m,f,o,l,i,n))&&(n.strip&&(u=u.replace(c,"")),r.push(u+s));return delete n.dense,r.join("")}function Vc(e,t){t||(t={}),t.FS="\t",t.RS="\n";var r=$c(e,t);if("undefined"==typeof cptable||"string"==t.type)return r;var n=cptable.utils.encode(1200,r,"str");return String.fromCharCode(255)+String.fromCharCode(254)+n}function qc(e){var t,r="",n="";if(null==e||null==e["!ref"])return[];var a,i=er(e["!ref"]),o="",s=[],l=[],c=Array.isArray(e);for(a=i.s.c;a<=i.e.c;++a)s[a]=Yt(a);for(var u=i.s.r;u<=i.e.r;++u)for(o=Gt(u),a=i.s.c;a<=i.e.c;++a)if(r=s[a]+o,n="",void 0!==(t=c?(e[u]||[])[a]:e[r])){if(null!=t.F){if(r=t.F,!t.f)continue;n=t.f,-1==r.indexOf(":")&&(r=r+":"+r)}if(null!=t.f)n=t.f;else{if("z"==t.t)continue;if("n"==t.t&&null!=t.v)n=""+t.v;else if("b"==t.t)n=t.v?"TRUE":"FALSE";else if(void 0!==t.w)n="'"+t.w;else{if(void 0===t.v)continue;n="s"==t.t?"'"+t.v:""+t.v}}l[l.length]=r+"="+n}return l}function Wc(e,t,r){var n,a=r||{},i=+!a.skipHeader,o=e||{},s=0,l=0;if(o&&null!=a.origin)if("number"==typeof a.origin)s=a.origin;else{var c="string"==typeof a.origin?Zt(a.origin):a.origin;s=c.r,l=c.c}var u={s:{c:0,r:0},e:{c:l,r:s+t.length-1+i}};if(o["!ref"]){var f=er(o["!ref"]);u.e.c=Math.max(u.e.c,f.e.c),u.e.r=Math.max(u.e.r,f.e.r),-1==s&&(s=f.e.r+1,u.e.r=s+t.length-1+i)}else-1==s&&(s=0,u.e.r=t.length-1+i);var p=a.header||[],h=0;t.forEach((function(e,t){z(e).forEach((function(r){-1==(h=p.indexOf(r))&&(p[h=p.length]=r);var c=e[r],u="z",f="",d=Kt({c:l+h,r:s+t+i});n=Gc.sheet_get_cell(o,d),!c||"object"!=typeof c||c instanceof Date?("number"==typeof c?u="n":"boolean"==typeof c?u="b":"string"==typeof c?u="s":c instanceof Date?(u="d",a.cellDates||(u="n",c=W(c)),f=a.dateNF||E._table[14]):null===c&&a.nullError&&(u="e",c=0),n?(n.t=u,n.v=c,delete n.w,delete n.R,f&&(n.z=f)):o[d]=n={t:u,v:c},f&&(n.z=f)):o[d]=c}))})),u.e.c=Math.max(u.e.c,l+p.length-1);var d=Gt(s);if(i)for(h=0;h<p.length;++h)o[Yt(h+l)+d]={t:"s",v:p[h]};return o["!ref"]=Qt(u),o}var Hc,Gc={encode_col:Yt,encode_row:Gt,encode_cell:Kt,encode_range:Qt,decode_col:Xt,decode_row:Ht,split_cell:function(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")},decode_cell:Zt,decode_range:Jt,format_cell:tr,get_formulae:qc,make_csv:$c,make_json:zc,make_formulae:qc,sheet_add_aoa:nr,sheet_add_json:Wc,sheet_add_dom:Jl,aoa_to_sheet:ar,json_to_sheet:function(e,t){return Wc(null,e,t)},table_to_sheet:Ql,table_to_book:function(e,t){return rr(Ql(e,t),t)},sheet_to_csv:$c,sheet_to_txt:Vc,sheet_to_json:zc,sheet_to_html:Kl.from_sheet,sheet_to_formulae:qc,sheet_to_row_object_array:zc};!function(e){function t(e,t,r){return null!=e[t]?e[t]:e[t]=r}function r(e,t,n){if("string"==typeof t){if(Array.isArray(e)){var a=Zt(t);return e[a.r]||(e[a.r]=[]),e[a.r][a.c]||(e[a.r][a.c]={t:"z"})}return e[t]||(e[t]={t:"z"})}return r(e,Kt("number"!=typeof t?t:{r:t,c:n||0}))}e.consts=e.consts||{},e.sheet_get_cell=r,e.book_new=function(){return{SheetNames:[],Sheets:{}}},e.book_append_sheet=function(e,t,r){if(!r)for(var n=1;n<=65535&&-1!=e.SheetNames.indexOf(r="Sheet"+n);++n,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(il(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");e.SheetNames.push(r),e.Sheets[r]=t},e.book_set_sheet_visibility=function(e,r,n){t(e,"Workbook",{}),t(e.Workbook,"Sheets",[]);var a=function(e,t){if("number"==typeof t){if(t>=0&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}if("string"==typeof t){var r=e.SheetNames.indexOf(t);if(r>-1)return r;throw new Error("Cannot find sheet name |"+t+"|")}throw new Error("Cannot find sheet |"+t+"|")}(e,r);switch(t(e.Workbook.Sheets,a,{}),n){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+n)}e.Workbook.Sheets[a].Hidden=n},[["SHEET_VISIBLE",0],["SHEET_HIDDEN",1],["SHEET_VERY_HIDDEN",2]].forEach((function(t){e.consts[t[0]]=t[1]})),e.cell_set_number_format=function(e,t){return e.z=t,e},e.cell_set_hyperlink=function(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e},e.cell_set_internal_link=function(t,r,n){return e.cell_set_hyperlink(t,"#"+r,n)},e.cell_add_comment=function(e,t,r){e.c||(e.c=[]),e.c.push({t,a:r||"SheetJS"})},e.sheet_set_array_formula=function(e,t,n){for(var a="string"!=typeof t?t:er(t),i="string"==typeof t?t:Qt(t),o=a.s.r;o<=a.e.r;++o)for(var s=a.s.c;s<=a.e.c;++s){var l=r(e,o,s);l.t="n",l.F=i,delete l.v,o==a.s.r&&s==a.s.c&&(l.f=n)}return e}}(Gc),y&&(Hc=r(5910).Readable,t.stream={to_json:function(e,t){var r=Hc({objectMode:!0});if(null==e||null==e["!ref"])return r.push(null),r;var n={t:"n",v:0},a=0,i=1,o=[],s=0,l="",c={s:{r:0,c:0},e:{r:0,c:0}},u=t||{},f=null!=u.range?u.range:e["!ref"];switch(1===u.header?a=1:"A"===u.header?a=2:Array.isArray(u.header)&&(a=3),typeof f){case"string":c=er(f);break;case"number":(c=er(e["!ref"])).s.r=f;break;default:c=f}a>0&&(i=0);var p=Gt(c.s.r),h=[],d=0,m=Array.isArray(e),g=c.s.r,y=0,v=0;for(m&&!e[g]&&(e[g]=[]),y=c.s.c;y<=c.e.c;++y)switch(h[y]=Yt(y),n=m?e[g][y]:e[h[y]+p],a){case 1:o[y]=y-c.s.c;break;case 2:o[y]=h[y];break;case 3:o[y]=u.header[y-c.s.c];break;default:for(null==n&&(n={w:"__EMPTY",t:"s"}),l=s=tr(n,null,u),d=0,v=0;v<o.length;++v)o[v]==l&&(l=s+"_"+ ++d);o[y]=l}return g=c.s.r+i,r._read=function(){if(g>c.e.r)return r.push(null);for(;g<=c.e.r;){var t=Bc(e,c,g,h,a,o,m,u);if(++g,!1===t.isempty||(1===a?!1!==u.blankrows:u.blankrows)){r.push(t.row);break}}},r},to_html:function(e,t){var r=Hc(),n=t||{},a=null!=n.header?n.header:Kl.BEGIN,i=null!=n.footer?n.footer:Kl.END;r.push(a);var o=Jt(e["!ref"]);n.dense=Array.isArray(e),r.push(Kl._preamble(e,o,n));var s=o.s.r,l=!1;return r._read=function(){if(s>o.e.r)return l||(l=!0,r.push("</table>"+i)),r.push(null);for(;s<=o.e.r;){r.push(Kl._row(e,o,s,n)),++s;break}},r},to_csv:function(e,t){var r=Hc(),n=null==t?{}:t;if(null==e||null==e["!ref"])return r.push(null),r;var a=er(e["!ref"]),i=void 0!==n.FS?n.FS:",",o=i.charCodeAt(0),s=void 0!==n.RS?n.RS:"\n",l=s.charCodeAt(0),c=new RegExp(("|"==i?"\\|":i)+"+$"),u="",f=[];n.dense=Array.isArray(e);for(var p=n.skipHidden&&e["!cols"]||[],h=n.skipHidden&&e["!rows"]||[],d=a.s.c;d<=a.e.c;++d)(p[d]||{}).hidden||(f[d]=Yt(d));var m=a.s.r,g=!1;return r._read=function(){if(!g)return g=!0,r.push("\ufeff");for(;m<=a.e.r;)if(++m,!(h[m-1]||{}).hidden&&null!=(u=Uc(e,a,m-1,f,o,l,i,n))){n.strip&&(u=u.replace(c,"")),r.push(u+s);break}return m>a.e.r?r.push(null):void 0},r}}),t.parse_xlscfb=zl,t.parse_zip=Dc,t.read=Cc,t.readFile=Nc,t.readFileSync=Nc,t.write=Rc,t.writeFile=Fc,t.writeFileSync=Fc,t.writeFileAsync=function(e,t,r,n){var a=r||{};a.type="file",a.file=e,Lc(a),a.type="buffer";var i=n;return i instanceof Function||(i=r),R.writeFile(e,Rc(t,a),i)},t.utils=Gc,t.SSF=E,void 0!==L&&(t.CFB=L)})(t),"undefined"==typeof window||window.XLSX||(window.XLSX={})},65942:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(r(5741)),s=r(52173),l=i(r(59853)),c=i(r(1847)),u=function(){function e(e,t,r,n,a){this.colDict={},this.keyToValue={},this.keyCol=e,this.data=t,this.columnName=r,this.colDtype=n,this.colIndex=a}return e.prototype.group=function(){var e,t=this,r={},n=null===(e=this.data)||void 0===e?void 0:e.reduce((function(e,n){var a=[];for(var i in t.colIndex){var o=t.colIndex[i];a.push(n[o])}var s=a.join("-");if(r[s]||(r[s]=a),e[s]){var l=e[s];for(var i in t.columnName)l[c=t.columnName[i]].push(n[i])}else for(var i in e[s]={},t.columnName){var c=t.columnName[i];e[s][c]=[n[i]]}return e}),{});return this.colDict=n,this.keyToValue=r,this},e.prototype.col=function(t){var r=this;void 0===t&&(t=this.columnName.filter((function(e,t){return!r.colIndex.includes(t)})));var a=this;t.forEach((function(e){if(!a.columnName.includes(e))throw new Error("Column "+e+" does not exist in groups")}));for(var i=n({},this.colDict),o=0,s=Object.entries(i);o<s.length;o++){var l=s[o],c=l[0],u=l[1],f={},p=n({},u);for(var h in t){var d=t[h];f[d]=p[d]}i[c]=f}var m=new e(this.keyCol,null,this.columnName,this.colDtype,this.colIndex);return m.colDict=i,m.groupColNames=t,m.keyToValue=this.keyToValue,m},e.prototype.arithemetic=function(e){var t=["mean","sum","count","mode","std","var","cumsum","cumprod","cummax","cummin","median","min","max"];if("string"==typeof e){if(!t.includes(e))throw new Error("group operation: "+e+" is not valid")}else Object.keys(e).forEach((function(r){var n=e[r];if(Array.isArray(n))for(var a=0,i=n;a<i.length;a++){var o=i[a];if(!t.includes(o))throw new Error("group operation: "+o+" for column "+r+" is not valid")}else if(!t.includes(n))throw new Error("group operation: "+n+" for column "+r+" is not valid")}));for(var r=n({},this.colDict),a=0,i=Object.entries(r);a<i.length;a++){for(var o=i[a],s=o[0],l=o[1],c={},u=n({},l),f=this.groupColNames,p=0;p<f.length;p++){var h=f[p],d=this.columnName.indexOf(h),m=this.colDtype[d],g="string"==typeof e?e:e[h];if("string"===m&&"count"!==g)throw new Error("Can't perform math operation on column "+h);if("string"==typeof e)c[h+"_"+e]=this.groupMathLog(u[h],e);else if(Array.isArray(e[h]))for(var y=0,v=e[h];y<v.length;y++){var b;c[h+"_"+(b=v[y])]=this.groupMathLog(u[h],b)}else c[h+"_"+(b=e[h])]=this.groupMathLog(u[h],b)}r[s]=c}return r},e.prototype.groupMathLog=function(e,t){var r=[];switch(t){case"max":var n=e.reduce((function(e,t){return e>t?e:t}));r.push(n);break;case"min":var a=e.reduce((function(e,t){return e<t?e:t}));r.push(a);break;case"sum":var i=e.reduce((function(e,t){return e+t}));r.push(i);break;case"count":r.push(e.length);break;case"mean":var o=e.reduce((function(e,t){return e+t}));r.push(o/e.length);break;case"std":r.push((0,s.std)(e));break;case"var":r.push((0,s.variance)(e));break;case"median":r.push((0,s.median)(e));break;case"mode":r.push((0,s.mode)(e));break;case"cumsum":e.reduce((function(e,t){var n=e+t;return r.push(n),n}),0);break;case"cummin":r=[e[0]],e.slice(1).reduce((function(e,t){return e<t?(r.push(e),e):(r.push(t),t)}),r[0]);break;case"cummax":r=[e[0]],e.slice(1).reduce((function(e,t){return e>t?(r.push(e),e):(r.push(t),t)}),r[0]);break;case"cumprod":e.reduce((function(e,t){var n=e*t;return r.push(n),n}),1)}return r},e.prototype.toDataFrame=function(e){for(var t={},r=0,i=this.colKeyDict(e);r<i.length;r++){var s=i[r],l=e[s],c={},u=Object.values(l)[0].length;for(var f in this.keyCol){var p=this.keyCol[f],h=this.keyToValue[s][f];c[p]=Array(u).fill(h)}var d=n(n({},c),l);if(Object.keys(t).length<1)t=d;else for(var m=0,g=Object.keys(t);m<g.length;m++){var y=g[m],v=d[y];t[y]=a(a([],t[y],!0),v,!0)}}return new o.default(t)},e.prototype.operations=function(e){if(!this.groupColNames){var t=this.col(void 0),r=t.arithemetic(e);return t.toDataFrame(r)}var n=this.arithemetic(e);return this.toDataFrame(n)},e.prototype.count=function(){return this.operations("count")},e.prototype.sum=function(){return this.operations("sum")},e.prototype.std=function(){return this.operations("std")},e.prototype.var=function(){return this.operations("var")},e.prototype.mean=function(){return this.operations("mean")},e.prototype.cumSum=function(){return this.operations("cumsum")},e.prototype.cumMax=function(){return this.operations("cummax")},e.prototype.cumProd=function(){return this.operations("cumprod")},e.prototype.cumMin=function(){return this.operations("cummin")},e.prototype.max=function(){return this.operations("max")},e.prototype.min=function(){return this.operations("min")},e.prototype.getGroup=function(e){var t=e.join("-"),r={};return r[t]=n({},this.colDict[t]),this.toDataFrame(r)},e.prototype.agg=function(e){var t=Object.keys(e),r=this.col(t),n=r.arithemetic(e);return r.toDataFrame(n)},e.prototype.apply=function(e){for(var t={},r=0,n=this.colKeyDict(this.colDict);r<n.length;r++){var a=n[r],i=new o.default(this.colDict[a]);t[a]=e(i)}return this.concatGroups(t)},e.prototype.concatGroups=function(e){for(var t=[],r=0,n=Object.entries(e);r<n.length;r++){var a=n[r],i=a[0],s=a[1],c=void 0;if(s instanceof o.default)c=s.copy();else{var u=s.index;u=u.length>1?u:["applyOps"],c=new o.default([s.values],{columns:u})}var f=c.shape[0],p=void 0;for(p in this.keyCol){var h=this.keyCol[p],d=this.keyToValue[i][p],m=Array(f).fill(d),g=parseInt(p);this.groupColNames?c.addColumn(h,m,{inplace:!0,atIndex:g}):c.addColumn(h+"_Group",m,{inplace:!0,atIndex:g})}t.push(c)}return(0,l.default)({dfList:t,axis:0})},Object.defineProperty(e.prototype,"ngroups",{get:function(){return Object.keys(this.colDict).length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groups",{get:function(){return this.colDict},enumerable:!1,configurable:!0}),e.prototype.first=function(){return this.apply((function(e){return e.head(1)}))},e.prototype.last=function(){return this.apply((function(e){return e.tail(1)}))},e.prototype.size=function(){return this.apply((function(e){return new c.default([e.shape[0]])}))},e.prototype.colKeyDict=function(e){for(var t={},r=0,n=Object.keys(e);r<n.length;r++){var a=(l=n[r]).split("-")[0];a in t?t[a].push(l):t[a]=[l]}for(var i=[],o=0,s=Object.keys(t);o<s.length;o++){var l=s[o];i.push.apply(i,t[l])}return i},e}();t.default=u},19253:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=new(n(r(62222)).default),i=function(){function e(e){var t=e.start,r=e.end,n=e.offset,a=e.freq,i=e.period;if(this.start=t,this.end=r,this.offset=n,this.freq=a||"D",this.period=i,this.freqList=["M","D","s","H","m","Y"],1==this.freq.length){if(!this.freqList.includes(this.freq))throw new Error("invalid freq "+this.freq)}else{if(this.offset=parseInt(this.freq.slice(0,-1)),!Number.isFinite(this.offset))throw new Error("invalid freq offset "+this.freq.slice(0,-1));if(this.freq=this.freq.slice(-1),!this.freqList.includes(this.freq))throw new Error("invalid freq "+this.freq)}}return e.prototype.range=function(){var e,t,r,n,i=this,o=this.start,s=this.period,l=this.end,c=this.offset;if(o&&l){e=new Date(o),r=this.freqType(e,this.freq),t=new Date(l),n=this.freqType(t,this.freq),e.getFullYear()<=t.getFullYear()&&e.getMonth()!==t.getMonth()&&("M"==this.freq?n=this.monthEnd(e,t):"D"===this.freq&&(n=this.dayEnd(e,t)-r));var u=a.range(r,n);c&&(u=this.offsetCount(u,c));var f=u.map((function(t){return i.setDateProps(e,i.freq,t)}));return f[f.length-1]=t,this.toLocalString(f)}if(o&&!l){e=new Date(o),s=s,(r=this.freqType(e,this.freq))>(n=c?s*c-1:s-1)&&(n+=r);var p=a.range(r,n);c&&(p=this.offsetCount(p,c));var h=p.map((function(t){return i.setDateProps(e,i.freq,t)}));return this.toLocalString(h)}t=new Date(l),r=(n=this.freqType(t,this.freq))-(s=s)+1;var d=a.range(r,n);c&&(d=this.offsetCount(d,c));var m=d.map((function(e){return i.setDateProps(t,i.freq,e)}));return this.toLocalString(m)},e.prototype.freqType=function(e,t){var r=0;switch(t){case"M":r=e.getMonth();break;case"Y":r=e.getFullYear();break;case"s":r=e.getSeconds();break;case"D":r=e.getDate();break;case"H":r=e.getHours();break;case"m":r=e.getMinutes()}return r},e.prototype.offsetCount=function(e,t){for(var r=[],n=0;n<e.length;n+=t)r.push(e[n]);return r},e.prototype.setDateProps=function(e,t,r){var n=new Date(e.valueOf());switch(t){case"M":Array.isArray(r)?(n.setFullYear(n.getFullYear()+r[0]),n.setMonth(r[1])):n.setMonth(r);break;case"Y":n.setFullYear(r);break;case"s":n.setSeconds(r);break;case"D":n.setDate(r);break;case"H":n.setHours(r);break;case"m":n.setMinutes(r)}return n},e.prototype.toLocalString=function(e){return e.map((function(e){return e.toLocaleString()}))},e.prototype.monthEnd=function(e,t){var r=t.getMonth();return 12*(t.getFullYear()-e.getFullYear())+r},e.prototype.monthRange=function(e){var t,r=0;return e.map((function(e){return e>11?e%12==0?[r=e/12,e-(t=e)]:[r,e-t]:[r,e]}))},e.prototype.dayEnd=function(e,t){for(var r=this.monthEnd(e,t),n=a.range(e.getMonth(),r),i=this.monthRange(n),o=0,s=0;s<i.length;s++){var l=i[s];o+=s===i.length-1?new Date(e.getUTCFullYear()+l[0],l[1],t.getDate()).getDate():new Date(e.getUTCFullYear()+l[0],l[1],0).getDate()}return o},e}();t.default=function(e){return new i(e).range()}},13381:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.toDateTime=void 0;var a=n(r(1847)),i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["January","February","March","April","May","June","July","August","September","October","November","December"],s=function(){function e(e){e instanceof a.default?this.$dateObjectArray=this.processData(e.values):this.$dateObjectArray=this.processData(e)}return e.prototype.processData=function(e){return e.map((function(e){return new Date(""+e)}))},e.prototype.month=function(){var e=this.$dateObjectArray.map((function(e){return e.getMonth()}));return new a.default(e)},e.prototype.dayOfWeek=function(){var e=this.$dateObjectArray.map((function(e){return e.getDay()}));return new a.default(e)},e.prototype.year=function(){var e=this.$dateObjectArray.map((function(e){return e.getFullYear()}));return new a.default(e)},e.prototype.monthName=function(){var e=this.$dateObjectArray.map((function(e){return o[e.getMonth()]}));return new a.default(e)},e.prototype.dayOfWeekName=function(){var e=this.$dateObjectArray.map((function(e){return i[e.getDay()]}));return new a.default(e)},e.prototype.dayOfMonth=function(){var e=this.$dateObjectArray.map((function(e){return e.getDate()}));return new a.default(e)},e.prototype.hours=function(){var e=this.$dateObjectArray.map((function(e){return e.getHours()}));return new a.default(e)},e.prototype.seconds=function(){var e=this.$dateObjectArray.map((function(e){return e.getSeconds()}));return new a.default(e)},e.prototype.minutes=function(){var e=this.$dateObjectArray.map((function(e){return e.getMinutes()}));return new a.default(e)},e.prototype.date=function(){var e=this.$dateObjectArray.map((function(e){return e.toLocaleString()}));return new a.default(e)},e}();t.default=s,t.toDateTime=function(e){return new s(e)}},5741:function(e,t,r){"use strict";var n,a=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function s(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},l=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=c(r(38159)),f=r(52173),p=c(r(22148)),h=r(67336),d=c(r(65942)),m=c(r(95528)),g=r(86698),y=c(r(62222)),v=c(r(19096)),b=r(3539),x=c(r(1847)),_=r(26784),w=new y.default,k=function(e){function t(t,r){void 0===r&&(r={});var n=this,a=r.index,i=r.columns,o=r.dtypes,s=r.config;return(n=e.call(this,{data:t,index:a,columns:i,dtypes:o,config:s,isSeries:!1})||this).$setInternalColumnDataProperty(),n}return a(t,e),t.prototype.$setInternalColumnDataProperty=function(e){var t=this;if(e&&"string"==typeof e)Object.defineProperty(t,e,{get:function(){return t.$getColumnData(e)},set:function(r){t.$setColumnData(e,r)}});else for(var r=this.columns,n=function(e){var n=r[e];Object.defineProperty(a,n,{get:function(){return t.$getColumnData(n)},set:function(e){t.$setColumnData(n,e)}})},a=this,i=0;i<r.length;i++)n(i)},t.prototype.$getColumnData=function(e,t){void 0===t&&(t=!0);var r=this.columns.indexOf(e);-1==r&&m.default.throwColumnNotFoundError(this);var n=[this.$dtypes[r]],a=l([],this.$index,!0),o=[e],s=i({},this.$config);if(this.$config.isLowMemoryMode){for(var c=[],u=0;u<this.values.length;u++){var f=this.values[u];c.push(f[r])}return t?new x.default(c,{dtypes:n,index:a,columns:o,config:s}):c}return c=this.$dataIncolumnFormat[r],t?new x.default(c,{dtypes:n,index:a,columns:o,config:s}):c},t.prototype.$setColumnData=function(e,t){var r,n=this.$columns.indexOf(e);if(-1==n)throw new Error("ParamError: column "+e+" not found in "+this.$columns+". If you need to add a new column, use the df.addColumn method. ");if(t instanceof x.default)r=t.values;else{if(!Array.isArray(t))throw new Error("ParamError: specified value not supported. It must either be an Array or a Series of the same length");r=t}if(r.length!==this.shape[0]&&m.default.throwColumnLengthError(this,r.length),this.$config.isLowMemoryMode){for(var a=0;a<this.$data.length;a++)this.$data[a][n]=r[a];this.$dtypes[n]=w.inferDtype(r)[0]}else{for(a=0;a<this.values.length;a++)this.$data[a][n]=r[a];this.$dataIncolumnFormat[n]=t,this.$dtypes[n]=w.inferDtype(r)[0]}},t.prototype.$getDataByAxisWithMissingValuesRemoved=function(e){for(var t=this.$getDataArraysByAxis(e),r=[],n=0;n<t.length;n++){var a=t[n];r.push(w.removeMissingValuesFromArray(a))}return r},t.prototype.$getDataArraysByAxis=function(e){return 1===e?this.values:this.config.isLowMemoryMode?w.transposeArray(this.values):this.$dataIncolumnFormat},t.prototype.$frameIsNotCompactibleForArithmeticOperation=function(){return this.dtypes.some((function(e){return"string"==e}))},t.prototype.$getTensorsForArithmeticOperationByAxis=function(e,r){if("number"==typeof e)return[this.tensor,p.default.scalar(e)];if(e instanceof t)return[this.tensor,e.tensor];if(e instanceof x.default)return 0===r?[this.tensor,p.default.tensor2d(e.values,[e.shape[0],1])]:[this.tensor,p.default.tensor2d(e.values,[e.shape[0],1]).transpose()];if(Array.isArray(e))return 0===r?[this.tensor,p.default.tensor2d(e,[e.length,1])]:[this.tensor,p.default.tensor2d(e,[e.length,1]).transpose()];throw new Error("ParamError: Invalid type for other parameter. other must be one of Series, DataFrame or number.")},t.prototype.$getColumnDtype=function(e){var t=this.columns.indexOf(e);if(-1===t)throw Error('ColumnNameError: Column "'+e+'" does not exist');return this.dtypes[t]},t.prototype.$logicalOps=function(e,r){var n=[];switch(r){case"gt":n=e[0].greater(e[1]).arraySync();break;case"lt":n=e[0].less(e[1]).arraySync();break;case"ge":n=e[0].greaterEqual(e[1]).arraySync();break;case"le":n=e[0].lessEqual(e[1]).arraySync();break;case"eq":n=e[0].equal(e[1]).arraySync();break;case"ne":n=e[0].notEqual(e[1]).arraySync()}return new t(w.mapIntegersToBooleans(n,2),{index:l([],this.index,!0),columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)})},t.prototype.$MathOps=function(e,r,n){var a;switch(r){case"add":a=e[0].add(e[1]);break;case"sub":a=e[0].sub(e[1]);break;case"pow":a=e[0].pow(e[1]);break;case"div":a=e[0].div(e[1]);break;case"divNoNan":a=e[0].divNoNan(e[1]);break;case"mul":a=e[0].mul(e[1]);break;case"mod":a=e[0].mod(e[1])}if(!n)return new t(a,{index:l([],this.index,!0),columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});var o=null==a?void 0:a.arraySync();this.$setValues(o)},t.prototype.iloc=function(e){var t=e.rows,r=e.columns;return(0,g._iloc)({ndFrame:this,rows:t,columns:r})},t.prototype.loc=function(e){var t=e.rows,r=e.columns;return(0,g._loc)({ndFrame:this,rows:t,columns:r})},t.prototype.toString=function(){var e=this.config.getMaxRow,t=this.config.getTableMaxColInConsole,r=[],n=this.columns.length,a=[];if(n>t){var o=this.columns.slice(0,4),s=this.columns.slice(n-3);a=l(l(l([""],o,!0),["..."],!1),s,!0);var c=void 0,u=void 0,f=void 0;if(this.values.length>e){var p=this.iloc({rows:["0:"+e],columns:["0:4"]}),h=this.iloc({rows:["0:"+e],columns:[n-3+":"]});c=this.index.slice(0,e),u=p.values,f=h.values}else p=this.iloc({columns:["0:4"]}),h=this.iloc({columns:[n-3+":"]}),c=this.index.slice(0,e),u=p.values,f=h.values;for(var d=0;d<c.length;d++){var m=c[d],g=l(l(l([m],u[d],!0),["..."],!1),f[d],!0);r.push(g)}}else{a=l([""],this.columns,!0),c=void 0;var y=void 0;if(this.values.length>e){var v=this.iloc({rows:["0:"+e]});c=v.index,y=v.values}else y=this.values,c=this.index;for(d=0;d<c.length;d++)m=c[d],g=l([m],y[d],!0),r.push(g)}for(var x={0:{width:10}},_=1;_<a.length;_++)x[_]={width:17,truncate:16};var w=l([a],r,!0);return(0,b.table)(w,i({columns:x},this.config.getTableDisplayConfig))},t.prototype.head=function(e){if(void 0===e&&(e=5),e<=0)throw new Error("ParamError: Number of rows cannot be less than 1");if(this.shape[0]<=e)return this.copy();if(this.shape[0]-e<0)throw new Error("ParamError: Number of rows cannot be greater than available rows in data");return this.iloc({rows:["0:"+e]})},t.prototype.tail=function(e){if(void 0===e&&(e=5),e<=0)throw new Error("ParamError: Number of rows cannot be less than 1");if(this.shape[0]<=e)return this.copy();if(this.shape[0]-e<0)throw new Error("ParamError: Number of rows cannot be greater than available rows in data");return e=this.shape[0]-e,this.iloc({rows:[e+":"]})},t.prototype.sample=function(e,t){return void 0===e&&(e=5),o(this,void 0,void 0,(function(){var r,n;return s(this,(function(a){switch(a.label){case 0:if(r=i({seed:1},t).seed,e>this.shape[0])throw new Error("ParamError: Sample size cannot be bigger than number of rows");if(e<=0)throw new Error("ParamError: Sample size cannot be less than 1");return[4,p.default.data.array(this.index).shuffle(e,""+r).take(e).toArray()];case 1:return n=a.sent(),[2,this.iloc({rows:n})]}}))}))},t.prototype.add=function(e,t){var r=i({inplace:!1,axis:1},t),n=r.inplace,a=r.axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: add operation is not supported for string dtypes");if(-1===[0,1].indexOf(a))throw Error("ParamError: Axis must be 0 or 1");var o=this.$getTensorsForArithmeticOperationByAxis(e,a);return this.$MathOps(o,"add",n)},t.prototype.sub=function(e,t){var r=i({inplace:!1,axis:1},t),n=r.inplace,a=r.axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: sub operation is not supported for string dtypes");if(-1===[0,1].indexOf(a))throw Error("ParamError: Axis must be 0 or 1");var o=this.$getTensorsForArithmeticOperationByAxis(e,a);return this.$MathOps(o,"sub",n)},t.prototype.mul=function(e,t){var r=i({inplace:!1,axis:1},t),n=r.inplace,a=r.axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: mul operation is not supported for string dtypes");if(-1===[0,1].indexOf(a))throw Error("ParamError: Axis must be 0 or 1");var o=this.$getTensorsForArithmeticOperationByAxis(e,a);return this.$MathOps(o,"mul",n)},t.prototype.div=function(e,t){var r=i({inplace:!1,axis:1},t),n=r.inplace,a=r.axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: div operation is not supported for string dtypes");if(-1===[0,1].indexOf(a))throw Error("ParamError: Axis must be 0 or 1");var o=this.$getTensorsForArithmeticOperationByAxis(e,a);return this.$MathOps(o,"div",n)},t.prototype.divNoNan=function(e,t){var r=i({inplace:!1,axis:1},t),n=r.inplace,a=r.axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: div operation is not supported for string dtypes");if(-1===[0,1].indexOf(a))throw Error("ParamError: Axis must be 0 or 1");var o=this.$getTensorsForArithmeticOperationByAxis(e,a);return this.$MathOps(o,"divNoNan",n)},t.prototype.pow=function(e,t){var r=i({inplace:!1,axis:1},t),n=r.inplace,a=r.axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: pow operation is not supported for string dtypes");if(-1===[0,1].indexOf(a))throw Error("ParamError: Axis must be 0 or 1");var o=this.$getTensorsForArithmeticOperationByAxis(e,a);return this.$MathOps(o,"pow",n)},t.prototype.mod=function(e,t){var r=i({inplace:!1,axis:1},t),n=r.inplace,a=r.axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: mod operation is not supported for string dtypes");if(-1===[0,1].indexOf(a))throw Error("ParamError: Axis must be 0 or 1");var o=this.$getTensorsForArithmeticOperationByAxis(e,a);return this.$MathOps(o,"mod",n)},t.prototype.mean=function(e){var t=i({axis:1},e).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: mean operation is not supported for string dtypes");if(-1===[0,1].indexOf(t))throw Error("ParamError: Axis must be 0 or 1");var r=this.$getDataByAxisWithMissingValuesRemoved(t).map((function(e){return e.reduce((function(e,t){return e+t}),0)/e.length}));return 0===t?new x.default(r,{index:this.columns}):new x.default(r,{index:this.index})},t.prototype.median=function(e){var t=i({axis:1},e).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: median operation is not supported for string dtypes");if(-1===[0,1].indexOf(t))throw Error("ParamError: Axis must be 0 or 1");var r=this.$getDataByAxisWithMissingValuesRemoved(t).map((function(e){return(0,f.median)(e)}));return 0===t?new x.default(r,{index:this.columns}):new x.default(r,{index:this.index})},t.prototype.mode=function(e){var t=i({axis:1,keep:0},e),r=t.axis,n=t.keep;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: mode operation is not supported for string dtypes");if(-1===[0,1].indexOf(r))throw Error("ParamError: Axis must be 0 or 1");var a=this.$getDataByAxisWithMissingValuesRemoved(r).map((function(e){var t=(0,f.mode)(e);return 1===t.length?t[0]:t[n]}));return 0===r?new x.default(a,{index:this.columns}):new x.default(a,{index:this.index})},t.prototype.min=function(e){var t=i({axis:1},e).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: min operation is not supported for string dtypes");if(-1===[0,1].indexOf(t))throw Error("ParamError: Axis must be 0 or 1");var r=this.$getDataByAxisWithMissingValuesRemoved(t).map((function(e){for(var t=e[0],r=0;r<e.length;r++)t=t<e[r]?t:e[r];return t}));return 0===t?new x.default(r,{index:this.columns}):new x.default(r,{index:this.index})},t.prototype.max=function(e){var t=i({axis:1},e).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: max operation is not supported for string dtypes");if(-1===[0,1].indexOf(t))throw Error("ParamError: Axis must be 0 or 1");var r=this.$getDataByAxisWithMissingValuesRemoved(t).map((function(e){for(var t=e[0],r=0;r<e.length;r++)t=t>e[r]?t:e[r];return t}));return 0===t?new x.default(r,{index:this.columns}):new x.default(r,{index:this.index})},t.prototype.std=function(e){var t=i({axis:1},e).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: std operation is not supported for string dtypes");if(-1===[0,1].indexOf(t))throw Error("ParamError: Axis must be 0 or 1");var r=this.$getDataByAxisWithMissingValuesRemoved(t).map((function(e){return(0,f.std)(e)}));return 0===t?new x.default(r,{index:this.columns}):new x.default(r,{index:this.index})},t.prototype.var=function(e){var t=i({axis:1},e).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: var operation is not supported for string dtypes");if(-1===[0,1].indexOf(t))throw Error("ParamError: Axis must be 0 or 1");var r=this.$getDataByAxisWithMissingValuesRemoved(t).map((function(e){return(0,f.variance)(e)}));return 0===t?new x.default(r,{index:this.columns}):new x.default(r,{index:this.index})},t.prototype.lt=function(e,t){var r=i({axis:1},t).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: lt operation is not supported for string dtypes");if(-1===[0,1].indexOf(r))throw Error("ParamError: Axis must be 0 or 1");var n=this.$getTensorsForArithmeticOperationByAxis(e,r);return this.$logicalOps(n,"lt")},t.prototype.gt=function(e,t){var r=i({axis:1},t).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: gt operation is not supported for string dtypes");if(-1===[0,1].indexOf(r))throw Error("ParamError: Axis must be 0 or 1");var n=this.$getTensorsForArithmeticOperationByAxis(e,r);return this.$logicalOps(n,"gt")},t.prototype.eq=function(e,t){var r=i({axis:1},t).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: eq operation is not supported for string dtypes");if(-1===[0,1].indexOf(r))throw Error("ParamError: Axis must be 0 or 1");var n=this.$getTensorsForArithmeticOperationByAxis(e,r);return this.$logicalOps(n,"eq")},t.prototype.ne=function(e,t){var r=i({axis:1},t).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: ne operation is not supported for string dtypes");if(-1===[0,1].indexOf(r))throw Error("ParamError: Axis must be 0 or 1");var n=this.$getTensorsForArithmeticOperationByAxis(e,r);return this.$logicalOps(n,"ne")},t.prototype.le=function(e,t){var r=i({axis:1},t).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: le operation is not supported for string dtypes");if(-1===[0,1].indexOf(r))throw Error("ParamError: Axis must be 0 or 1");var n=this.$getTensorsForArithmeticOperationByAxis(e,r);return this.$logicalOps(n,"le")},t.prototype.ge=function(e,t){var r=i({axis:1},t).axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: ge operation is not supported for string dtypes");if(-1===[0,1].indexOf(r))throw Error("ParamError: Axis must be 0 or 1");var n=this.$getTensorsForArithmeticOperationByAxis(e,r);return this.$logicalOps(n,"ge")},t.prototype.count=function(e){var t=i({axis:1},e).axis;if(-1===[0,1].indexOf(t))throw Error("ParamError: Axis must be 0 or 1");var r=this.$getDataByAxisWithMissingValuesRemoved(t).map((function(e){return e.length}));return 0===t?new x.default(r,{index:this.columns}):new x.default(r,{index:this.index})},t.prototype.sum=function(e){var t=i({axis:1},e).axis;if(-1===[0,1].indexOf(t))throw Error("ParamError: Axis must be 0 or 1");var r=this.$getDataByAxisWithMissingValuesRemoved(t).map((function(e){return e.reduce((function(e,t){return Number(e)+Number(t)}),0)}));return 0===t?new x.default(r,{index:l([],this.columns,!0)}):new x.default(r,{index:l([],this.index,!0)})},t.prototype.pctChange=function(e,r){var n=i({inplace:!1,axis:1},r),a=n.inplace,o=n.axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: pctChange operation is not supported for string dtypes");if(-1===[0,1].indexOf(o))throw Error("ParamError: Axis must be 0 or 1");if(0===e)return this;if("number"==typeof e){var s=this.copy();0===o&&(s=s.T);var l=s.tensor.clone(),c=new Array(l.shape[l.rank-1]).fill(NaN),u=l.arraySync();if(e>0)for(var f=0;f<e;f++)u.unshift(c),u.pop();else if(e<0)for(f=0;f>e;f--)u.push(c),u.shift();var h=p.default.tensor2d(u,l.shape),d=this.$MathOps([l,h],"divNoNan",a).sub(1);return 0===o?d.T:d}if(e instanceof t||e instanceof x.default){var m=this.$getTensorsForArithmeticOperationByAxis(e,o);return this.$MathOps(m,"divNoNan",a).sub(1)}},t.prototype.diff=function(e,r){var n=i({inplace:!1,axis:1},r),a=n.inplace,o=n.axis;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: diff operation is not supported for string dtypes");if(-1===[0,1].indexOf(o))throw Error("ParamError: Axis must be 0 or 1");if(0===e)return this;if("number"==typeof e){var s=this.copy();0===o&&(s=s.T);var l=s.tensor.clone(),c=new Array(l.shape[l.rank-1]).fill(NaN),u=l.arraySync();if(e>0)for(var f=0;f<e;f++)u.unshift(c),u.pop();else if(e<0)for(f=0;f>e;f--)u.push(c),u.shift();var h=p.default.tensor2d(u,l.shape),d=this.$MathOps([l,h],"sub",a);return 0===o?d.T:d}if(e instanceof t||e instanceof x.default){var m=this.$getTensorsForArithmeticOperationByAxis(e,o);return this.$MathOps(m,"sub",a)}},t.prototype.abs=function(e){var r=i({inplace:!1},e).inplace,n=this.values.map((function(e){return e.map((function(e){return Math.abs(e)}))}));if(!r)return new t(n,{index:l([],this.index,!0),columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setValues(n)},t.prototype.round=function(e,r){void 0===e&&(e=1);var n=i({inplace:!1},r).inplace;if(this.$frameIsNotCompactibleForArithmeticOperation())throw Error("TypeError: round operation is not supported for string dtypes");if("number"!=typeof e)throw Error("ParamError: dp must be a number");var a=w.round(this.values,e,!1);if(!n)return new t(a,{index:l([],this.index,!0),columns:l([],this.columns,!0),config:i({},this.config)});this.$setValues(a)},t.prototype.cumProd=function(e){var t=i({axis:1,inplace:!1},e),r=t.axis,n=t.inplace;return this.cumOps("prod",r,n)},t.prototype.cumSum=function(e){var t=i({axis:1,inplace:!1},e),r=t.axis,n=t.inplace;return this.cumOps("sum",r,n)},t.prototype.cumMin=function(e){var t=i({axis:1,inplace:!1},e),r=t.axis,n=t.inplace;return this.cumOps("min",r,n)},t.prototype.cumMax=function(e){var t=i({axis:1,inplace:!1},e),r=t.axis,n=t.inplace;return this.cumOps("max",r,n)},t.prototype.cumOps=function(e,r,n){this.dtypes.includes("string")&&m.default.throwStringDtypeOperationError(e);var a=this.$getDataByAxisWithMissingValuesRemoved(r).map((function(t){for(var r=t[0],n=[r],a=1;a<t.length;a++){var i=t[a];switch(e){case"max":i>r?(n.push(i),r=i):n.push(r);break;case"min":i<r?(n.push(i),r=i):n.push(r);break;case"sum":r+=i,n.push(r);break;case"prod":r*=i,n.push(r)}}return n}));if(0===r&&(a=w.transposeArray(a)),!n)return new t(a,{index:l([],this.index,!0),columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setValues(a)},t.prototype.describe=function(){for(var e=this,r=this.columns.filter((function(t){return"string"!==e.$getColumnDtype(t)})),n={},a=0;a<r.length;a++){var i=r[a],o=[this.$getColumnData(i).count(),(0,f.mean)(this.$getColumnData(i,!1)),(0,f.std)(this.$getColumnData(i,!1)),this.$getColumnData(i).min(),(0,f.median)(this.$getColumnData(i,!1)),this.$getColumnData(i).max(),(0,f.variance)(this.$getColumnData(i,!1))];n[i]=o}return new t(n,{index:["count","mean","std","min","median","max","variance"]})},t.prototype.dropNa=function(e){var r=i({axis:1,inplace:!1},e),n=r.axis,a=r.inplace;if(-1===[0,1].indexOf(n))throw Error("ParamError: Axis must be 0 or 1");var o=[];if(1==n){for(var s=[],c=this.values,u=0;u<c.length;u++)(d=c[u]).includes(NaN)||d.includes(void 0)||d.includes(null)||(s.push(d),o.push(this.index[u]));if(!a)return new t(s,{index:o,columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setValues(s,!1),this.$setIndex(o)}else{var f=[],p=[];c=[],c=this.config.isLowMemoryMode?w.transposeArray(this.values):this.$dataIncolumnFormat;var h=[];for(u=0;u<c.length;u++){var d;(d=c[u]).includes(NaN)||(h.push(d),f.push(this.columns[u]),p.push(this.dtypes[u]))}if(s=w.transposeArray(h),!a)return new t(s,{index:l([],this.index,!0),columns:f,dtypes:p,config:i({},this.config)});this.$setValues(s,!1,!1),this.$setColumnNames(f),this.$setDtypes(p)}},t.prototype.addColumn=function(e,r,n){var a=i({inplace:!1,atIndex:this.columns.length},n),o=a.inplace,s=a.atIndex;if("string"==typeof s){if(!this.columns.includes(s))throw new Error(s+" not a column");s=this.columns.indexOf(s)}if(!e)throw new Error("ParamError: column must be specified");if(!r)throw new Error("ParamError: values must be specified");if(-1===this.$columns.indexOf(e)){var c=void 0;if(r instanceof x.default)c=r.values;else{if(!Array.isArray(r))throw new Error("ParamError: specified value not supported. It must either be an Array or a Series of the same length");c=r}c.length!==this.shape[0]&&m.default.throwColumnLengthError(this,c.length);for(var u,f=[],p=this.$data,h=0;h<p.length;h++){var d=l([],p[h],!0);d.splice(s,0,c[h]),f.push(d)}if(!o)return(u=l([],this.columns,!0)).splice(s,0,e),new t(f,{index:l([],this.index,!0),columns:u,dtypes:l(l([],this.dtypes,!0),[w.inferDtype(c)[0]],!1),config:i({},this.$config)});this.$setValues(f,!0,!1),(u=l([],this.columns,!0)).splice(s,0,e),this.$setColumnNames(u),this.$setInternalColumnDataProperty(e)}else this.$setColumnData(e,r)},t.prototype.copy=function(){return new t(l([],this.$data,!0),{columns:l([],this.columns,!0),index:l([],this.index,!0),dtypes:l([],this.dtypes,!0),config:i({},this.$config)})},t.prototype.isNa=function(){for(var e=[],r=0;r<this.values.length;r++){var n=this.values[r].map((function(e){return!!w.isEmpty(e)}));e.push(n)}return new t(e,{index:l([],this.index,!0),columns:l([],this.columns,!0),config:i({},this.config)})},t.prototype.fillNa=function(e,r){var n=this,a=i({inplace:!1},r),o=a.columns,s=a.inplace;if(!e&&"boolean"!=typeof e&&"number"!=typeof e&&"string"!=typeof e)throw Error("ParamError: value must be specified");if(Array.isArray(e)){if(!Array.isArray(o))throw Error("ParamError: value is an array, hence columns must also be an array of same length");if(e.length!==o.length)throw Error("ParamError: specified column and values must have the same length");o.forEach((function(e){if(!n.columns.includes(e))throw Error('ValueError: Specified column "'+e+'" must be one of '+n.columns)}))}var c=[],u=l([],this.values,!0);if(o){var f=l([],this.values,!0);for(y=0;y<f.length;y++){for(var p=f[y],h=0;h<o.length;h++){var d=this.columns.indexOf(o[h]),m=Array.isArray(e)?e[h]:e;p[d]=w.isEmpty(p[d])?m:p[d]}c.push(p)}}else for(var g=function(t){var r=l([],u[t],!0).map((function(r){return w.isEmpty(r)?Array.isArray(e)?e[t]:e:r}));c.push(r)},y=0;y<u.length;y++)g(y);if(!s)return new t(c,{index:l([],this.index,!0),columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setValues(c)},t.prototype.drop=function(e){var r=i({inplace:!1},e),n=r.columns,a=r.index,o=r.inplace;if(!n&&!a)throw Error("ParamError: Must specify one of columns or index");if(n&&a)throw Error("ParamError: Can only specify one of columns or index");if(n){var s=[];if("string"==typeof n)s.push(this.columns.indexOf(n));else{if(!Array.isArray(n))throw Error("ParamError: columns must be an array of column names or a string of column name");for(var c=0,u=n;c<u.length;c++){var f=u[c];if(-1===this.columns.indexOf(f))throw Error('ParamError: specified column "'+f+'" not found in columns');s.push(this.columns.indexOf(f))}}for(var p=[],h=[],d=[],m=0;m<this.values.length;m++){for(var g=[],y=this.values[m],v=0;v<y.length;v++)s.includes(v)||g.push(y[v]);p.push(g)}for(m=0;m<this.columns.length;m++){var b=this.columns[m];n.includes(b)||(h.push(b),d.push(this.dtypes[m]))}if(!o)return new t(p,{index:l([],this.index,!0),columns:h,dtypes:d,config:i({},this.config)});this.$setValues(p,!0,!1),this.$setColumnNames(h)}if(a){var x=[];if("string"==typeof a||"number"==typeof a||"boolean"==typeof a)x.push(this.index.indexOf(a));else{if(!Array.isArray(a))throw Error("ParamError: index must be an array of indices or a scalar index");for(var _=0,w=a;_<w.length;_++){var k=w[_];if(-1===this.index.indexOf(k))throw Error('ParamError: specified index "'+k+'" not found in indices');x.push(this.index.indexOf(k))}}p=[];var D=[];for(m=0;m<this.values.length;m++)y=this.values[m],x.includes(m)||p.push(y);for(m=0;m<this.index.length;m++)k=this.index[m],a.includes(k)||D.push(k);if(!o)return new t(p,{index:D,columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setValues(p,!1),this.$setIndex(D)}},t.prototype.sortValues=function(e,t){var r=i({ascending:!0,inplace:!1},t),n=r.ascending,a=r.inplace;if(!e)throw Error("ParamError: must specify a column to sort by");if(-1===this.columns.indexOf(e))throw Error('ParamError: specified column "'+e+'" not found in columns');var o=this.$getColumnData(e,!1),s=l([],this.index,!0),c=o.map((function(e,t){return{index:s[t],value:e}})),u=w.sortObj(c,n).map((function(e){return e.index})),f=(0,g._loc)({ndFrame:this,rows:u});if(!a)return f;this.$setValues(f.values),this.$setIndex(f.index)},t.prototype.setIndex=function(e){var r=i({drop:!1,inplace:!1},e),n=r.index,a=r.column,o=r.drop,s=r.inplace;if(!n&&!a)throw new Error("ParamError: must specify either index or column");var c=[];if(n){if(!Array.isArray(n))throw Error("ParamError: index must be an array");if(n.length!==this.values.length)throw Error("ParamError: index must be the same length as the number of rows");c=n}if(a){if(-1===this.columns.indexOf(a))throw Error("ParamError: column not found in column names");c=this.$getColumnData(a,!1)}if(o){var u=this.drop({columns:[a]}),f=null==u?void 0:u.values,p=null==u?void 0:u.columns,h=null==u?void 0:u.dtypes;if(!s)return new t(f,{index:c,columns:p,dtypes:h,config:i({},this.config)});this.$setValues(f,!0,!1),this.$setIndex(c),this.$setColumnNames(p)}else{if(!s)return new t(this.values,{index:c,columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setIndex(c)}},t.prototype.resetIndex=function(e){if(!i({inplace:!1},e).inplace)return new t(this.values,{index:this.index.map((function(e,t){return t})),columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$resetIndex()},t.prototype.apply=function(e,r){var n=i({axis:1},r).axis;if(-1===[0,1].indexOf(n))throw Error("ParamError: axis must be 0 or 1");var a=this.$getDataByAxisWithMissingValuesRemoved(n).map((function(t){return e(t)}));return 0===n?w.is1DArray(a)?new x.default(a,{index:l([],this.columns,!0)}):new t(a,{index:l([],this.columns,!0),columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)}):w.is1DArray(a)?new x.default(a,{index:l([],this.index,!0)}):new t(a,{index:l([],this.index,!0),columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)})},t.prototype.applyMap=function(e,r){var n=i({inplace:!1},r).inplace,a=this.values.map((function(t){return t.map((function(t){return e(t)}))}));if(!n)return new t(a,{index:l([],this.index,!0),columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setValues(a)},t.prototype.column=function(e){return this.$getColumnData(e)},t.prototype.selectDtypes=function(e){var t=["float32","int32","string","boolean","undefined"];if(!1===Array.isArray(e))throw Error("ParamError: include must be an array");e.forEach((function(e){if(-1===t.indexOf(e))throw Error("ParamError: include must be an array of valid dtypes")}));for(var r=[],n=0;n<this.dtypes.length;n++)e.includes(this.dtypes[n])&&r.push(this.columns[n]);return this.loc({columns:r})},t.prototype.transpose=function(e){var r=i({inplace:!1},e).inplace,n=w.transposeArray(this.values),a=l([],this.index.map((function(e){return e.toString()})),!0);if(!r)return new t(n,{index:l([],this.columns,!0),columns:a,config:i({},this.config)});this.$setValues(n,!1,!1),this.$setIndex(l([],this.columns,!0)),this.$setColumnNames(a)},Object.defineProperty(t.prototype,"T",{get:function(){return new t(w.transposeArray(this.values),{index:l([],this.columns,!0),columns:l([],this.index.map((function(e){return e.toString()})),!0),config:i({},this.config)})},enumerable:!1,configurable:!0}),t.prototype.replace=function(e,r,n){var a=this,o=i({inplace:!1},n),s=o.columns,c=o.inplace;if(!e&&"boolean"!=typeof e)throw Error("Params Error: Must specify param 'oldValue' to replace");if(!r&&"boolean"!=typeof r)throw Error("Params Error: Must specify param 'newValue' to replace with");var u=[];if(s){if(!Array.isArray(s))throw Error("Params Error: column must be an array of column(s)");var f=[];s.forEach((function(e){var t=a.columns.indexOf(e);if(-1===t)throw Error("Params Error: column not found in columns");f.push(t)})),u=this.values.map((function(t){for(var n=t.slice(0),a=0,i=f;a<i.length;a++){var o=i[a];n[o]===e&&(n[o]=r)}return n}))}else u=this.values.map((function(t){return t.slice(0).map((function(t){return t===e?r:t}))}));if(!c)return new t(u,{index:l([],this.index,!0),columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setValues(u)},t.prototype.asType=function(e,r,n){var a=i({inplace:!1},n).inplace,o=this.columns.indexOf(e);if(-1===o)throw Error("Params Error: column not found in columns");if(!h.DATA_TYPES.includes(r))throw Error("dtype "+r+" not supported. dtype must be one of "+h.DATA_TYPES);var s=this.values.map((function(e){return"float32"===r?(e[o]=Number(e[o]),e):"int32"===r?(e[o]=parseInt(e[o]),e):"string"===r?(e[o]=e[o].toString(),e):"boolean"===r?(e[o]=Boolean(e[o]),e):void 0}));if(!a){var c=l([],this.dtypes,!0);return c[o]=r,new t(s,{index:l([],this.index,!0),columns:l([],this.columns,!0),dtypes:c,config:i({},this.config)})}this.$setValues(s)},t.prototype.nUnique=function(e){if(void 0===e&&(e=1),-1===[0,1].indexOf(e))throw Error("ParamError: axis must be 0 or 1");var t=this.$getDataArraysByAxis(e).map((function(e){return new Set(e).size}));return 0===e?new x.default(t,{index:l([],this.columns,!0),dtypes:["int32"]}):new x.default(t,{index:l([],this.index,!0),dtypes:["int32"]})},t.prototype.rename=function(e,r){var n=i({axis:1,inplace:!1},r),a=n.axis,o=n.inplace;if(-1===[0,1].indexOf(a))throw Error("ParamError: axis must be 0 or 1");if(1===a){var s=[],c=this.columns.map((function(t){if(void 0!==e[t]){var r=""+e[t];return s.push(r),r}return t}));if(!o)return new t(l([],this.values,!0),{index:l([],this.index,!0),columns:c,dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setColumnNames(c);for(var u=0,f=s;u<f.length;u++){var p=f[u];this.$setInternalColumnDataProperty(p)}}else{var h=this.index.map((function(t){return void 0!==e[t]?e[t]:t}));if(!o)return new t(l([],this.values,!0),{index:h,columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setIndex(h)}},t.prototype.sortIndex=function(e){var r=this,n=i({ascending:!0,inplace:!1},e),a=n.ascending,o=n.inplace,s=w.range(0,this.index.length-1),c=l([],this.index,!0),u=c.map((function(e,t){return{index:s[t],value:e}})),f=w.sortObj(u,a).map((function(e){return e.index})),p=f.map((function(e){return r.values[e]}));if(f=f.map((function(e){return c[e]})),!o)return new t(p,{index:f,columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setValues(p),this.$setIndex(f)},t.prototype.append=function(e,r,n){var a=i({inplace:!1},n).inplace;if(!e)throw Error("ParamError: newValues must be a Series, DataFrame or Array");if(!r)throw Error("ParamError: index must be specified");var o=[];if(e instanceof x.default){if(e.values.length!==this.shape[1])throw Error("ValueError: length of newValues must be the same as the number of columns.");o=[e.values]}else if(e instanceof t){if(e.shape[1]!==this.shape[1])throw Error("ValueError: length of newValues must be the same as the number of columns.");o=e.values}else{if(!Array.isArray(e))throw Error("ValueError: newValues must be a Series, DataFrame or Array");if((o=w.is1DArray(e)?[e]:e)[0].length!==this.shape[1])throw Error("ValueError: length of newValues must be the same as the number of columns.")}var s;if(s=Array.isArray(r)?r:[r],o.length!==s.length)throw Error("ParamError: index must contain the same number of values as newValues");var c=l([],this.values,!0),u=l([],this.index,!0);if(o.forEach((function(e,t){c.push(e),u.push(s[t])})),!a)return new t(c,{index:u,columns:l([],this.columns,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)});this.$setValues(c),this.$setIndex(u)},t.prototype.query=function(e,t){var r=i({inplace:!1},t).inplace;if(!e)throw new Error("ParamError: condition must be specified");var n=(0,g._iloc)({ndFrame:this,rows:e});if(!r)return n;this.$setValues(n.values,!1,!1),this.$setIndex(n.index)},Object.defineProperty(t.prototype,"ctypes",{get:function(){return new x.default(this.dtypes,{index:this.columns})},enumerable:!1,configurable:!0}),t.prototype.getDummies=function(e){var t=i({inplace:!1},e).inplace,r=(0,u.default)(this,e);if(!t)return r;this.$setValues(r.values,!1,!1),this.$setColumnNames(r.columns)},t.prototype.groupby=function(e){var t=this.columns,r=e.map((function(e){return t.indexOf(e)})),n=this.dtypes;return new d.default(e,this.values,t,n,r).group()},t.prototype.iat=function(e,t){if("string"==typeof e||"string"==typeof t)throw new Error("ParamError: row and column index must be an integer. Use .at to get a row or column by label.");return this.values[e][t]},t.prototype.at=function(e,t){if("string"!=typeof t)throw new Error("ParamError: column index must be a string. Use .iat to get a row or column by index.");return this.values[this.index.indexOf(e)][this.columns.indexOf(t)]},t.prototype.plot=function(e){if(w.isBrowserEnv())return new _.PlotlyLib(this,e);throw new Error("Not supported in NodeJS")},t}(v.default);t.default=k},19096:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=a(r(62222)),o=a(r(22487)),s=a(r(95528)),l=r(67336),c=a(r(22148)),u=new i.default,f=function(){function e(e){var t=e.data,r=e.index,a=e.columns,i=e.dtypes,f=e.config,p=e.isSeries;if(this.$dataIncolumnFormat=[],this.$index=[],this.$columns=[],this.$dtypes=[],this.$isSeries=p,this.$config=f?new o.default(n(n({},l.BASE_CONFIG),f)):new o.default(l.BASE_CONFIG),t instanceof c.default.Tensor&&(t=t.arraySync()),void 0===t||Array.isArray(t)&&0===t.length)void 0===a&&(a=[]),void 0===i&&(i=[]),0===a.length&&0!==i.length&&s.default.throwDtypeWithoutColumnError(),this.loadArrayIntoNdframe({data:[],index:[],columns:a,dtypes:i});else if(u.is1DArray(t))this.loadArrayIntoNdframe({data:t,index:r,columns:a,dtypes:i});else if(Array.isArray(t)&&u.isObject(t[0]))this.loadObjectIntoNdframe({data:t,type:1,index:r,columns:a,dtypes:i});else if(u.isObject(t))this.loadObjectIntoNdframe({data:t,type:2,index:r,columns:a,dtypes:i});else if(Array.isArray(t[0])||u.isNumber(t[0])||u.isString(t[0]))this.loadArrayIntoNdframe({data:t,index:r,columns:a,dtypes:i});else{if(!(Array.isArray(t)&&t.length>0&&u.isDate(t[0])))throw new Error("File format not supported!");this.loadArrayIntoNdframe({data:t,index:r,columns:a,dtypes:i})}}return e.prototype.loadArrayIntoNdframe=function(e){var t=e.data,r=e.index,n=e.columns,a=e.dtypes;this.$data=t,this.$config.isLowMemoryMode||(this.$dataIncolumnFormat=u.transposeArray(t)),this.$setIndex(r),this.$setDtypes(a),this.$setColumnNames(n)},e.prototype.loadObjectIntoNdframe=function(e){var t=e.data,r=e.type,n=e.index,a=e.columns,i=e.dtypes;if(1===r&&Array.isArray(t)){var o=t.map((function(e){return Object.values(e)})),s=void 0;s=a||Object.keys(t[0]),this.loadArrayIntoNdframe({data:o,index:n,columns:s,dtypes:i})}else{var l=u.getRowAndColValues(t),c=(o=l[0],l[1]);s=void 0,s=a||c,this.loadArrayIntoNdframe({data:o,index:n,columns:s,dtypes:i})}},Object.defineProperty(e.prototype,"tensor",{get:function(){return this.$isSeries?c.default.tensor1d(this.$data,this.$dtypes[0]):c.default.tensor2d(this.$data,this.shape,"float32")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dtypes",{get:function(){return this.$dtypes},enumerable:!1,configurable:!0}),e.prototype.$setDtypes=function(e){this.$isSeries?e?(0!=this.$data.length&&1!=e.length&&s.default.throwDtypesLengthError(this,e),l.DATA_TYPES.includes(""+e[0])||s.default.throwDtypeNotSupportedError(e[0]),this.$dtypes=e):this.$dtypes=u.inferDtype(this.$data):e?(0!=this.$data.length&&e.length!=this.shape[1]&&s.default.throwDtypesLengthError(this,e),0==this.$data.length&&0==e.length||e.forEach((function(e){l.DATA_TYPES.includes(e)||s.default.throwDtypeNotSupportedError(e)})),this.$dtypes=e):this.$dtypes=u.inferDtype(this.$data)},Object.defineProperty(e.prototype,"ndim",{get:function(){return this.$isSeries?1:2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"axis",{get:function(){return{index:this.$index,columns:this.$columns}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this.$config},enumerable:!1,configurable:!0}),e.prototype.$setConfig=function(e){this.$config=e},Object.defineProperty(e.prototype,"index",{get:function(){return this.$index},enumerable:!1,configurable:!0}),e.prototype.$setIndex=function(e){e?(0!=this.$data.length&&e.length!=this.shape[0]&&s.default.throwIndexLengthError(this,e),Array.from(new Set(e)).length!==this.shape[0]&&s.default.throwIndexDuplicateError(),this.$index=e):this.$index=u.range(0,this.shape[0]-1)},e.prototype.$resetIndex=function(){this.$index=u.range(0,this.shape[0]-1)},Object.defineProperty(e.prototype,"columns",{get:function(){return this.$columns},enumerable:!1,configurable:!0}),e.prototype.$setColumnNames=function(e){this.$isSeries?e?(0!=this.$data.length&&1!=e.length&&"string"!=typeof e&&s.default.throwColumnNamesLengthError(this,e),this.$columns=e):this.$columns=["0"]:e?(0!=this.$data.length&&e.length!=this.shape[1]&&s.default.throwColumnNamesLengthError(this,e),Array.from(new Set(e)).length!==e.length&&s.default.throwColumnDuplicateError(),this.$columns=e):this.$columns=u.range(0,this.shape[1]-1).map((function(e){return""+e}))},Object.defineProperty(e.prototype,"shape",{get:function(){return 0===this.$data.length?0===this.$columns.length?[0,0]:[0,this.$columns.length]:this.$isSeries?[this.$data.length,1]:[this.$data.length,this.$data[0].length]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this.$data},enumerable:!1,configurable:!0}),e.prototype.$setValues=function(e,t,r){var n=this;void 0===t&&(t=!0),void 0===r&&(r=!0),this.$isSeries?(t&&e.length!=this.shape[0]&&s.default.throwRowLengthError(this,e.length),this.$data=e,this.$dtypes=u.inferDtype(e),this.$config.isLowMemoryMode||(this.$dataIncolumnFormat=e)):(t&&e.length!=this.shape[0]&&s.default.throwRowLengthError(this,e.length),r&&e.forEach((function(t){t.length!=n.shape[1]&&s.default.throwColumnLengthError(n,e.length)})),this.$data=e,this.$dtypes=u.inferDtype(e),this.$config.isLowMemoryMode||(this.$dataIncolumnFormat=u.transposeArray(e)))},Object.defineProperty(e.prototype,"getColumnData",{get:function(){return this.config.isLowMemoryMode?u.transposeArray(this.values):this.$dataIncolumnFormat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.shape[0]*this.shape[1]},enumerable:!1,configurable:!0}),e.prototype.toCSV=function(e){throw new Error("`toCSV` function is deprecated. Use `toCSV` function directly instead. e.g. `dfd.toCSV(df)`")},e.prototype.toJSON=function(e){throw new Error("`toJSON` function is deprecated. Use `toJSON` function directly instead. e.g. `dfd.toJSON(df, { format: 'row' })`")},e.prototype.toExcel=function(e){throw new Error("Deprecated. Use `toExcel` function directly instead. e.g. `dfd.toExcel(df, {filePath: 'path/to/file.xlsx'})`")},e.prototype.print=function(){console.log(this+"")},e}();t.default=f},86698:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._loc=t._iloc=void 0;var a=n(r(1847)),i=n(r(62222)),o=n(r(5741)),s=new i.default;t._iloc=function(e){var t,r,n=e.ndFrame,i=e.rows,l=e.columns,c=n.values,u=n.index;if(i instanceof a.default&&(i=i.values),void 0!==i&&!Array.isArray(i))throw new Error('rows parameter must be an Array. For example: rows: [1,2] or rows: ["0:10"]');if(void 0!==l&&!Array.isArray(l))throw new Error('columns parameter must be an Array. For example: columns: [1,2] or columns: ["0:10"]');if(i)if(1==i.length&&"string"==typeof i[0]){var f=i[0].split(":");if(2!=f.length)throw new Error('Invalid row split parameter: If using row split string, it must be of the form; rows: ["start:end"]');if(isNaN(parseInt(f[0]))&&""!=f[0])throw new Error("Invalid row split parameter. Split parameter must be a number");if(isNaN(parseInt(f[1]))&&""!=f[1])throw new Error("Invalid row split parameter. Split parameter must be a number");var p=""==f[0]?0:parseInt(f[0]),h=""==f[1]?n.shape[0]:parseInt(f[1]);if(p<0)throw new Error("row slice [start] index cannot be less than 0");if(h>n.shape[0])throw new Error("row slice [end] index cannot be bigger than "+n.shape[0]);t=s.range(p,h-1)}else{for(var d=[],m=0;m<i.length;m++){if((y=i[m])>n.shape[0])throw new Error("Invalid row parameter: Specified index "+y+" cannot be bigger than index length "+n.shape[0]);if("number"!=typeof y&&"boolean"!=typeof y)throw new Error("Invalid row parameter: row index "+y+" must be a number or boolean");"boolean"==typeof y&&!0===y&&d.push(u[m]),"number"==typeof y&&d.push(y)}t=d}else t=s.range(0,n.shape[0]-1);if(l)if(1==l.length&&"string"==typeof l[0]){var g=l[0].split(":");if(2!=g.length)throw new Error('Invalid column split parameter: If using column split string, it must be of the form; columns: ["start:end"]');if(isNaN(parseInt(g[0]))&&""!=g[0])throw new Error("Invalid column split parameter. Split parameter must be a number");if(isNaN(parseInt(g[1]))&&""!=g[1])throw new Error("Invalid column split parameter. Split parameter must be a number");if(p=""==g[0]?0:parseInt(g[0]),h=""==g[1]?n.shape[1]:parseInt(g[1]),p<0)throw new Error("column slice [start] index cannot be less than 0");if(h>n.shape[1])throw new Error("column slice [end] index cannot be bigger than "+n.shape[1]);r=s.range(p,h-1)}else{for(m=0;m<l.length;m++){var y;if((y=l[m])>n.shape[1])throw new Error("Invalid column parameter: Specified index "+y+" cannot be bigger than index length "+n.shape[1]);if("number"!=typeof y)throw new Error("Invalid column parameter: column index "+y+" must be a number")}r=l}else r=s.range(0,n.shape[1]-1);if(n instanceof a.default){var v=[],b=[];for(m=0;m<t.length;m++){var x=t[m];v.push(c[x]),b.push(u[x])}return new a.default(v,{index:b,columns:n.columns,dtypes:n.dtypes,config:n.config})}v=[],b=[];var _=[],w=[];for(m=0;m<t.length;m++){for(var k=c[x=t[m]],D=[],T=0;T<r.length;T++){var A=r[T];D.push(k[A])}v.push(D),b.push(u[x])}for(m=0;m<r.length;m++)A=r[m],_.push(n.columns[A]),w.push(n.dtypes[A]);return new o.default(v,{index:b,columns:_,dtypes:w,config:n.config})},t._loc=function(e){var t,r,n=e.ndFrame,i=e.rows,s=e.columns,l=n.values,c=n.index;if(i instanceof a.default&&(i=i.values),void 0!==i&&!Array.isArray(i))throw new Error('rows parameter must be an Array. For example: rows: [1,2] or rows: ["0:10"]');if(void 0!==s&&!Array.isArray(s))throw new Error('columns parameter must be an Array. For example: columns: ["a","b"] or columns: ["a:c"]');if(i)if(1==i.length&&"string"==typeof i[0])if(-1===i[0].indexOf(":")){var u;if(-1===(u=i[0].startsWith('"')||i[0].startsWith("'")||i[0].startsWith("`")?c.indexOf(i[0].replace(/['"`]/g,"")):c.indexOf(Number(i[0]))))throw new Error("IndexError: Specified index ("+i[0]+") not found");t=[u]}else{var f=i[0].split(":");if(2!=f.length)throw new Error('Invalid row split parameter: If using row split string, it must be of the form; rows: ["start:end"]');var p=void 0,h=void 0;if(p=""===f[0]?c.indexOf(c[0]):f[0].startsWith('"')||f[0].startsWith("'")||f[0].startsWith("`")?c.indexOf(f[0].replace(/['"`]/g,"")):c.indexOf(Number(f[0])),h=""===f[1]?c.indexOf(c[c.length-1])+1:f[0].startsWith('"')||f[0].startsWith("'")||f[0].startsWith("`")?c.indexOf(f[1].replace(/['"`]/g,"")):c.indexOf(Number(f[1])),-1===p)throw new Error("IndexError: Specified start index not found");if(-1===h)throw new Error("IndexError: Specified end index not found");t=c.slice(p,h).map((function(e){return c.indexOf(e)}))}else{for(var d=[],m=0;m<i.length;m++){var g="boolean"==typeof i[m];if(g&&i[m]&&d.push(c.indexOf(c[m])),!g){var y=c.indexOf(i[m]);if(-1===y)throw new Error("IndexError: Specified index ("+i[m]+") not found");d.push(y)}}t=d}else t=c.map((function(e){return c.indexOf(e)}));var v=n.columns;if(s)if(1==s.length){if("string"!=typeof s[0])throw new Error('ColumnIndexError: columns parameter must be an array of a string name. For example: columns: ["b"]');if(-1==s[0].indexOf(":"))r=[v.indexOf(s[0])];else{var b=s[0].split(":");if(2!=b.length)throw new Error('ColumnIndexError: Invalid row split parameter. If using row split string, it must be of the form; rows: ["start:end"]');if(p=""==b[0]?v.indexOf(v[0]):v.indexOf(b[0]),h=""==b[1]?v.indexOf(v[v.length-1]):v.indexOf(b[1]),-1===p)throw new Error("ColumnIndexError: Specified start index not found");if(-1===h)throw new Error("ColumnIndexError: Specified end index not found");(r=v.slice(p,h+1).map((function(e){return v.indexOf(e)}))).pop()}}else{for(m=0;m<s.length;m++)if(-1===v.indexOf(s[m]))throw new Error("ColumnIndexError: Specified column ("+s[m]+") not found");r=s.map((function(e){return v.indexOf(e)}))}else r=v.map((function(e){return v.indexOf(e)}));if(n instanceof a.default){var x=[],_=[];for(m=0;m<t.length;m++){var w=t[m];x.push(l[w]),_.push(c[w])}return new a.default(x,{index:_,columns:n.columns,dtypes:n.dtypes,config:n.config})}x=[],_=[];var k=[],D=[];for(m=0;m<t.length;m++){for(var T=l[w=t[m]],A=[],S=0;S<r.length;S++){var M=r[S];A.push(T[M])}x.push(A),_.push(c[w])}for(m=0;m<r.length;m++)M=r[m],k.push(n.columns[M]),D.push(n.dtypes[M]);return new o.default(x,{index:_,columns:k,dtypes:D,config:n.config})}},72691:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._genericMathOp=void 0;var a=n(r(1847)),i=new(n(r(62222)).default);t._genericMathOp=function(e){var t=e.ndFrame,r=e.other,n=e.operation;if("number"==typeof r)switch(n){case"add":return t.values.map((function(e){return e+r}));case"sub":return t.values.map((function(e){return e-r}));case"mul":return t.values.map((function(e){return e*r}));case"div":return t.values.map((function(e){return e/r}));case"mod":return t.values.map((function(e){return e%r}));case"pow":return t.values.map((function(e){return Math.pow(e,r)}));case"minimum":return t.values.map((function(e){return Math.min(e,r)}));case"maximum":return t.values.map((function(e){return Math.max(e,r)}));default:throw new Error(n+" is not implemented")}else if(r instanceof a.default)switch(i.checkSeriesOpCompactibility({firstSeries:t,secondSeries:r,operation:n}),n){case"add":return t.values.map((function(e,t){return e+r.values[t]}));case"sub":return t.values.map((function(e,t){return e-r.values[t]}));case"mul":return t.values.map((function(e,t){return e*r.values[t]}));case"div":return t.values.map((function(e,t){return e/r.values[t]}));case"mod":return t.values.map((function(e,t){return e%r.values[t]}));case"pow":return t.values.map((function(e,t){return Math.pow(e,r.values[t])}));case"minimum":return t.values.map((function(e,t){return Math.min(e,r.values[t])}));case"maximum":return t.values.map((function(e,t){return Math.max(e,r.values[t])}));default:throw new Error(n+" is not implemented")}else{if(!Array.isArray(r))throw new Error("ParamError: value for other not supported. It must be either a scalar, Array or Series");if(r.length!==t.values.length)throw new Error("ParamError: Length of array must be equal to length of Series");switch(n){case"add":return t.values.map((function(e,t){return e+r[t]}));case"sub":return t.values.map((function(e,t){return e-r[t]}));case"mul":return t.values.map((function(e,t){return e*r[t]}));case"div":return t.values.map((function(e,t){return e/r[t]}));case"mod":return t.values.map((function(e,t){return e%r[t]}));case"pow":return t.values.map((function(e,t){return Math.pow(e,r[t])}));case"minimum":return t.values.map((function(e,t){return Math.min(e,r[t])}));case"maximum":return t.values.map((function(e,t){return Math.max(e,r[t])}))}}}},1847:function(e,t,r){"use strict";var n,a=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function s(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},l=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=c(r(38159)),f=r(52173),p=c(r(22148)),h=r(67336),d=r(72691),m=c(r(95528)),g=r(86698),y=c(r(62222)),v=c(r(19096)),b=r(3539),x=c(r(18271)),_=c(r(13381)),w=r(26784),k=new y.default,D=function(e){function t(t,r){void 0===t&&(t=[]),void 0===r&&(r={});var n=this,a=r.index,i=r.columns,o=r.dtypes,s=r.config;return Array.isArray(t[0])||k.isObject(t[0])?(t=k.convert2DArrayToSeriesArray(t),n=e.call(this,{data:t,index:a,columns:i,dtypes:o,config:s,isSeries:!0})||this):n=e.call(this,{data:t,index:a,columns:i,dtypes:o,config:s,isSeries:!0})||this,n}return a(t,e),t.prototype.iloc=function(e){return(0,g._iloc)({ndFrame:this,rows:e})},t.prototype.loc=function(e){return(0,g._loc)({ndFrame:this,rows:e})},t.prototype.head=function(e){if(void 0===e&&(e=5),e<=0)throw new Error("ParamError: Number of rows cannot be less than 1");if(this.shape[0]<=e)return this.copy();if(this.shape[0]-e<0)throw new Error("ParamError: Number of rows cannot be greater than available rows in data");return this.iloc(["0:"+e])},t.prototype.tail=function(e){if(void 0===e&&(e=5),e<=0)throw new Error("ParamError: Number of rows cannot be less than 1");if(this.shape[0]<=e)return this.copy();if(this.shape[0]-e<0)throw new Error("ParamError: Number of rows cannot be greater than available rows in data");var t=this.shape[0]-e;return this.iloc([t+":"])},t.prototype.sample=function(e,t){return void 0===e&&(e=5),o(this,void 0,void 0,(function(){var r,n;return s(this,(function(a){switch(a.label){case 0:if(r=i({seed:1},t).seed,e>this.shape[0])throw new Error("Sample size n cannot be bigger than size of dataset");if(e<-1||0==e)throw new Error("Sample size cannot be less than -1 or be equal to 0");return e=-1===e?this.shape[0]:e,[4,p.default.data.array(this.index).shuffle(e,""+r).take(e).toArray()];case 1:return n=a.sent(),[2,this.iloc(n)]}}))}))},t.prototype.add=function(e,t){var r=i({inplace:!1},t).inplace;"string"==this.dtypes[0]&&m.default.throwStringDtypeOperationError("add");var n=(0,d._genericMathOp)({ndFrame:this,other:e,operation:"add"});if(!r)return k.createNdframeFromNewDataWithOldProps({ndFrame:this,newData:n,isSeries:!0});this.$setValues(n)},t.prototype.sub=function(e,t){var r=i({inplace:!1},t).inplace;"string"==this.dtypes[0]&&m.default.throwStringDtypeOperationError("sub");var n=(0,d._genericMathOp)({ndFrame:this,other:e,operation:"sub"});if(!r)return k.createNdframeFromNewDataWithOldProps({ndFrame:this,newData:n,isSeries:!0});this.$setValues(n)},t.prototype.mul=function(e,t){var r=i({inplace:!1},t).inplace;"string"==this.dtypes[0]&&m.default.throwStringDtypeOperationError("mul");var n=(0,d._genericMathOp)({ndFrame:this,other:e,operation:"mul"});if(!r)return k.createNdframeFromNewDataWithOldProps({ndFrame:this,newData:n,isSeries:!0});this.$setValues(n)},t.prototype.div=function(e,t){var r=i({inplace:!1},t).inplace;"string"==this.dtypes[0]&&m.default.throwStringDtypeOperationError("div");var n=(0,d._genericMathOp)({ndFrame:this,other:e,operation:"div"});if(!r)return k.createNdframeFromNewDataWithOldProps({ndFrame:this,newData:n,isSeries:!0});this.$setValues(n)},t.prototype.pow=function(e,t){var r=i({inplace:!1},t).inplace;"string"==this.dtypes[0]&&m.default.throwStringDtypeOperationError("pow");var n=(0,d._genericMathOp)({ndFrame:this,other:e,operation:"pow"});if(!r)return k.createNdframeFromNewDataWithOldProps({ndFrame:this,newData:n,isSeries:!0});this.$setValues(n)},t.prototype.mod=function(e,t){var r=i({inplace:!1},t).inplace;"string"==this.dtypes[0]&&m.default.throwStringDtypeOperationError("mod");var n=(0,d._genericMathOp)({ndFrame:this,other:e,operation:"mod"});if(!r)return k.createNdframeFromNewDataWithOldProps({ndFrame:this,newData:n,isSeries:!0});this.$setValues(n)},t.prototype.$checkAndCleanValues=function(e,t){return"string"==this.dtypes[0]&&m.default.throwStringDtypeOperationError(t),e=k.removeMissingValuesFromArray(e),"boolean"==this.dtypes[0]&&(e=k.mapBooleansToIntegers(e,1)),e},t.prototype.mean=function(){var e=this.$checkAndCleanValues(this.values,"mean");return e.reduce((function(e,t){return e+t}))/e.length},t.prototype.median=function(){var e=this.$checkAndCleanValues(this.values,"median");return(0,f.median)(e)},t.prototype.mode=function(){var e=this.$checkAndCleanValues(this.values,"mode");return(0,f.mode)(e)},t.prototype.min=function(){for(var e=this.$checkAndCleanValues(this.values,"min"),t=e[0],r=0;r<e.length;r++)t=t<e[r]?t:e[r];return t},t.prototype.max=function(){for(var e=this.$checkAndCleanValues(this.values,"max"),t=e[0],r=0;r<e.length;r++)t=t>e[r]?t:e[r];return t},t.prototype.sum=function(){return this.$checkAndCleanValues(this.values,"sum").reduce((function(e,t){return e+t}),0)},t.prototype.count=function(){return k.removeMissingValuesFromArray(this.values).length},t.prototype.maximum=function(e){return"string"==this.dtypes[0]&&m.default.throwStringDtypeOperationError("maximum"),new t((0,d._genericMathOp)({ndFrame:this,other:e,operation:"maximum"}),{columns:this.columns,index:this.index})},t.prototype.minimum=function(e){return"string"==this.dtypes[0]&&m.default.throwStringDtypeOperationError("maximum"),new t((0,d._genericMathOp)({ndFrame:this,other:e,operation:"minimum"}),{columns:this.columns,index:this.index})},t.prototype.round=function(e,t){void 0===e&&(e=1);var r=i({inplace:!1},t).inplace;void 0===e&&(e=1);var n=k.round(this.values,e,!0);if(!r)return k.createNdframeFromNewDataWithOldProps({ndFrame:this,newData:n,isSeries:!0});this.$setValues(n)},t.prototype.std=function(){var e=this.$checkAndCleanValues(this.values,"max");return(0,f.std)(e)},t.prototype.var=function(){var e=this.$checkAndCleanValues(this.values,"max");return(0,f.variance)(e)},t.prototype.isNa=function(){return new t(this.values.map((function(e){return!!k.isEmpty(e)})),{index:this.index,dtypes:["boolean"],config:this.config})},t.prototype.fillNa=function(e,t){var r=i({inplace:!1},t).inplace;if(!e&&"boolean"!=typeof e&&"number"!=typeof e)throw Error("ParamError: value must be specified");var n=[];if(this.values.forEach((function(t){k.isEmpty(t)?n.push(e):n.push(t)})),!r)return k.createNdframeFromNewDataWithOldProps({ndFrame:this,newData:n,isSeries:!0});this.$setValues(n)},t.prototype.sortValues=function(e){for(var r=i({ascending:!0,inplace:!1},e),n=r.ascending,a=r.inplace,o=[],s=[],l=k.range(0,this.index.length-1),c=0,u=k.sortArrayByIndex(l,this.values,this.dtypes[0]);c<u.length;c++){var f=u[c];o.push(this.values[f]),s.push(this.index[f])}if(n&&(o=o.reverse(),s=s.reverse()),!a)return new t(o,{index:s,dtypes:this.dtypes,config:this.config});this.$setValues(o),this.$setIndex(s)},t.prototype.copy=function(){return new t(l([],this.values,!0),{columns:l([],this.columns,!0),index:l([],this.index,!0),dtypes:l([],this.dtypes,!0),config:i({},this.config)})},t.prototype.describe=function(){if("string"==this.dtypes[0])throw new Error("DType Error: Cannot generate descriptive statistics for Series with string dtype");return new t([this.count(),this.mean(),this.std(),this.min(),this.median(),this.max(),this.var()],{index:["count","mean","std","min","median","max","variance"]})},t.prototype.resetIndex=function(e){if(!i({inplace:!1},e).inplace){var t=this.copy();return t.$resetIndex(),t}this.$resetIndex()},t.prototype.setIndex=function(e,t){var r=i({inplace:!1},t).inplace;if(!e)throw Error("Param Error: Must specify index array");if(!r){var n=this.copy();return n.$setIndex(e),n}this.$setIndex(e)},t.prototype.map=function(e,t){var r=i({inplace:!1},t).inplace,n=k.isFunction(e),a=this.values.map((function(t,r){if(n)return e(t,r);if(k.isObject(e))return t in e?e[t]:t;throw new Error("Param Error: callable must either be a function or an object")}));if(!r){var o=this.copy();return o.$setValues(a),o}this.$setValues(a)},t.prototype.apply=function(e,t){var r=i({inplace:!1},t).inplace;if(!k.isFunction(e))throw new Error("Param Error: callable must be a function");var n=this.values.map((function(t){return e(t)}));if(!r){var a=this.copy();return a.$setValues(n),a}this.$setValues(n)},t.prototype.unique=function(){var e=new Set(this.values);return new t(Array.from(e))},t.prototype.nUnique=function(){return new Set(this.values).size},t.prototype.valueCounts=function(){for(var e=this.values,r={},n=0;n<e.length;n++){var a=e[n];r[""+a]=""+a in r?r[""+a]+1:1}var i=Object.keys(r).map((function(e){return parseInt(e)?parseInt(e):e}));return new t(Object.values(r),{index:i})},t.prototype.abs=function(e){var t,r=i({inplace:!1},e).inplace;if("string"==this.dtypes[0]&&m.default.throwStringDtypeOperationError("abs"),t=this.values.map((function(e){return Math.abs(e)})),!r){var n=this.copy();return n.$setValues(t),n}this.$setValues(t)},t.prototype.cumSum=function(e){var t=i({inplace:!1},e);return this.cumOps("sum",t)},t.prototype.cumMin=function(e){var t=i({inplace:!1},e);return this.cumOps("min",t)},t.prototype.cumMax=function(e){var t=i({inplace:!1},e);return this.cumOps("max",t)},t.prototype.cumProd=function(e){var t=i({inplace:!1},e);return this.cumOps("prod",t)},t.prototype.cumOps=function(e,r){"string"==this.dtypes[0]&&m.default.throwStringDtypeOperationError(e);for(var n=r.inplace,a=this.values,o=a[0],s=[o],l=1;l<a.length;l++){var c=a[l];switch(e){case"max":c>o?(s.push(c),o=c):s.push(o);break;case"min":c<o?(s.push(c),o=c):s.push(o);break;case"sum":o+=c,s.push(o);break;case"prod":o*=c,s.push(o)}}if(!n)return new t(s,{index:this.index,config:i({},this.config)});this.$setValues(s)},t.prototype.lt=function(e){return this.boolOps(e,"lt")},t.prototype.gt=function(e){return this.boolOps(e,"gt")},t.prototype.le=function(e){return this.boolOps(e,"le")},t.prototype.ge=function(e){return this.boolOps(e,"ge")},t.prototype.ne=function(e){return this.boolOps(e,"ne")},t.prototype.eq=function(e){return this.boolOps(e,"eq")},t.prototype.boolOps=function(e,r){var n,a=[],o=this.values;if("number"==typeof e)n=Array(this.values.length).fill(e);else if("string"==typeof e&&["eq","ne"].includes(r))n=Array(this.values.length).fill(e);else if(e instanceof t)n=e.values;else{if(!Array.isArray(e))throw new Error("ParamError: value for other not supported. It must be either a scalar, Array or Series");n=e}if(o.length!==n.length)throw new Error("LengthError: length of other must be equal to length of Series");for(var s=0;s<o.length;s++){var l=o[s],c=n[s],u=null;switch(r){case"lt":u=l<c,a.push(u);break;case"gt":u=l>c,a.push(u);break;case"le":u=l<=c,a.push(u);break;case"ge":u=l>=c,a.push(u);break;case"ne":u=l!==c,a.push(u);break;case"eq":u=l===c,a.push(u)}}return new t(a,{index:this.index,config:i({},this.config)})},t.prototype.replace=function(e,t,r){var n=i({inplace:!1},r).inplace;if(!e&&"boolean"!=typeof e)throw Error("Params Error: Must specify param 'oldValue' to replace");if(!t&&"boolean"!=typeof t)throw Error("Params Error: Must specify param 'newValue' to replace with");var a=l([],this.values,!0).map((function(r){return r===e?t:r}));if(!n){var o=this.copy();return o.$setValues(a),o}this.$setValues(a)},t.prototype.dropNa=function(e){var t=i({inplace:!1},e).inplace,r=this.values,n=this.index,a=[],o=[];if(this.isNa().values.forEach((function(e,t){e||(a.push(r[t]),o.push(n[t]))})),!t){var s=this.copy();return s.$setValues(a,!1),s.$setIndex(o),s}this.$setValues(a,!1),this.$setIndex(o)},t.prototype.argSort=function(e){var r=i({ascending:!0},e).ascending;return new t(this.sortValues({ascending:r}).index)},t.prototype.argMax=function(){return this.tensor.argMax().arraySync()},t.prototype.argMin=function(){return this.tensor.argMin().arraySync()},t.prototype.dropDuplicates=function(e){var t,r=i({keep:"first",inplace:!1},e),n=r.keep,a=r.inplace;if(!["first","last"].includes(n))throw Error("Params Error: Keep must be one of 'first' or 'last'");var o,s=[],l=[];if("last"===n?(t=this.values.reverse(),o=this.index.reverse()):(t=this.values,o=this.index),t.forEach((function(e,t){s.includes(e)||(l.push(o[t]),s.push(e))})),"last"===n&&(s=s.reverse(),l=l.reverse()),!a){var c=this.copy();return c.$setValues(s,!1),c.$setIndex(l),c}this.$setValues(s,!1),this.$setIndex(l)},t.prototype.asType=function(e,t){var r=i({inplace:!1},t).inplace;if(!e)throw Error("Param Error: Please specify dtype to cast to");if(!h.DATA_TYPES.includes(e))throw Error("dtype "+e+" not supported. dtype must be one of "+h.DATA_TYPES);var n=l([],this.values,!0),a=[];switch(e){case"float32":n.forEach((function(e){a.push(Number(e))}));break;case"int32":n.forEach((function(e){a.push(parseInt(e))}));break;case"string":n.forEach((function(e){a.push(String(e))}));break;case"boolean":n.forEach((function(e){a.push(Boolean(e))}));break;case"undefined":n.forEach((function(e){a.push(NaN)}))}if(!r){var o=this.copy();return o.$setValues(a,!1),o.$setDtypes([e]),o}this.$setValues(a,!1),this.$setDtypes([e])},t.prototype.append=function(e,r,n){var a=i({inplace:!1},n).inplace;if(!e&&"boolean"!=typeof e&&"number"!=typeof e)throw Error("Param Error: newValue cannot be null or undefined");if(!r)throw Error("Param Error: index cannot be null or undefined");var o=l([],this.values,!0),s=l([],this.index,!0);if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)throw Error("Param Error: Length of new values and index must be the same");e.forEach((function(e,t){o.push(e),s.push(r[t])}))}else if(e instanceof t){var c=e.values;if(!Array.isArray(r))throw Error("Param Error: index must be an array");if(r.length!==c.length)throw Error("Param Error: Length of new values and index must be the same");c.forEach((function(e,t){o.push(e),s.push(r[t])}))}else o.push(e),s.push(r);if(!a)return new t(o,{index:s,columns:this.columns,dtypes:this.dtypes,config:this.config});this.$setValues(o,!1),this.$setIndex(s)},Object.defineProperty(t.prototype,"dtype",{get:function(){return this.dtypes[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"str",{get:function(){if("string"==this.dtypes[0])return new x.default(this);throw new Error("Cannot call accessor str on non-string type")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dt",{get:function(){if(["string","datetime"].includes(this.dtypes[0]))return new _.default(this);throw new Error("Cannot call accessor dt on non-string type")},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var e,t=this.$config.getMaxRow,r=[];if(this.shape[0]>t){var n=this.iloc(["0:"+t]);e=n.index,r=n.values}else e=this.index,r=this.values;var a=r.map((function(t,r){return[e[r],t]}));return(0,b.table)(a)},t.prototype.and=function(e){if(void 0===e)throw new Error("Param Error: other cannot be undefined");var r=[];if(e instanceof t){if(this.dtypes[0]!==e.dtypes[0])throw new Error("Param Error: Series must be of same dtype");if(this.shape[0]!==e.shape[0])throw new Error("Param Error: Series must be of same shape");this.values.forEach((function(t,n){r.push(Boolean(t)&&Boolean(e.values[n]))}))}else if("boolean"==typeof e)this.values.forEach((function(t){r.push(Boolean(t)&&Boolean(e))}));else{if(!Array.isArray(e))throw new Error("Param Error: other must be a Series, Scalar, or Array of Scalars");this.values.forEach((function(t,n){r.push(Boolean(t)&&Boolean(e[n]))}))}return new t(r,{index:this.index,config:i({},this.config)})},t.prototype.or=function(e){if(void 0===e)throw new Error("Param Error: other cannot be undefined");var r=[];if(e instanceof t){if(this.dtypes[0]!==e.dtypes[0])throw new Error("Param Error: Series must be of same dtype");if(this.shape[0]!==e.shape[0])throw new Error("Param Error: Series must be of same shape");this.values.forEach((function(t,n){r.push(Boolean(t)||Boolean(e.values[n]))}))}else if("boolean"==typeof e)this.values.forEach((function(t){r.push(Boolean(t)||Boolean(e))}));else{if(!Array.isArray(e))throw new Error("Param Error: other must be a Series, Scalar, or Array of Scalars");this.values.forEach((function(t,n){r.push(Boolean(t)||Boolean(e[n]))}))}return new t(r,{index:this.index,config:i({},this.config)})},t.prototype.getDummies=function(e){return(0,u.default)(this,e)},t.prototype.iat=function(e){if("string"==typeof e)throw new Error("ParamError: row index must be an integer. Use .at to get a row by label.");return this.values[e]},t.prototype.at=function(e){if("string"!=typeof e)throw new Error("ParamError: row index must be a string. Use .iat to get a row by index.");return this.values[this.index.indexOf(e)]},t.prototype.plot=function(e){if(k.isBrowserEnv())return new w.PlotlyLib(this,e);throw new Error("Not supported in NodeJS")},t}(v.default);t.default=D},18271:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=new(a(r(62222)).default),o=function(){function e(e){this.series=e,this.values=e.values}return e.prototype.toLowerCase=function(e){var t=n({inplace:!1},e).inplace,r=[];if(this.values.map((function(e){i.isEmpty(e)?r.push(NaN):r.push((""+e).toLowerCase())})),!t){var a=this.series.copy();return a.$setValues(r),a}this.series.$setValues(r),this.series.print()},e.prototype.toUpperCase=function(e){var t=n({inplace:!1},e).inplace,r=[];if(this.values.map((function(e){i.isEmpty(e)?r.push(NaN):r.push((""+e).toUpperCase())})),!t){var a=this.series.copy();return a.$setValues(r),a}this.series.$setValues(r),this.series.print()},e.prototype.capitalize=function(e){var t=n({inplace:!1},e).inplace,r=[];if(this.values.map((function(e){if(i.isEmpty(e))r.push(NaN);else{var t=(""+e).slice(0,1),n=(""+e).slice(1),a=""+t.toUpperCase()+n.toLowerCase();r.push(a)}})),!t){var a=this.series.copy();return a.$setValues(r),a}this.series.$setValues(r),this.series.print()},e.prototype.charAt=function(e,t){void 0===e&&(e=0);var r=n({inplace:!1},t).inplace,a=[];if(this.values.map((function(t){i.isEmpty(t)?a.push(NaN):a.push((""+t).charAt(e))})),!r){var o=this.series.copy();return o.$setValues(a),o}this.series.$setValues(a),this.series.print()},e.prototype.concat=function(e,t,r){void 0===t&&(t=1);var a=n({inplace:!1},r).inplace,o=[];if(Array.isArray(e))for(var s=0;s<e.length;s++){var l=""+this.values[s],c=""+e[s];1==t?o.push(l.concat(c)):o.push(c.concat(l))}else this.values.map((function(r){1==t?i.isEmpty(r)?o.push(NaN):o.push((""+r).concat(""+e)):i.isEmpty(r)?o.push(NaN):o.push(e.concat(""+r))}));if(!a){var u=this.series.copy();return u.$setValues(o),u}this.series.$setValues(o),this.series.print()},e.prototype.startsWith=function(e,t){void 0===e&&(e="");var r=n({inplace:!1},t).inplace,a=[];if(this.values.forEach((function(t){i.isEmpty(t)?a.push(NaN):a.push((""+t).startsWith(e))})),!r){var o=this.series.copy();return o.$setValues(a),o}this.series.$setValues(a),this.series.print()},e.prototype.endsWith=function(e,t){void 0===e&&(e="");var r=n({inplace:!1},t).inplace,a=[];if(this.values.map((function(t){i.isEmpty(t)?a.push(NaN):a.push((""+t).endsWith(e))})),!r){var o=this.series.copy();return o.$setValues(a),o}this.series.$setValues(a),this.series.print()},e.prototype.includes=function(e,t){void 0===e&&(e="");var r=n({inplace:!1},t).inplace,a=[];if(this.values.map((function(t){i.isEmpty(t)?a.push(NaN):a.push((""+t).includes(e))})),!r){var o=this.series.copy();return o.$setValues(a),o}this.series.$setValues(a),this.series.print()},e.prototype.indexOf=function(e,t){void 0===e&&(e="");var r=n({inplace:!1},t).inplace,a=[];if(this.values.map((function(t){i.isEmpty(t)?a.push(NaN):a.push((""+t).indexOf(e))})),!r){var o=this.series.copy();return o.$setValues(a),o}this.series.$setValues(a),this.series.print()},e.prototype.lastIndexOf=function(e,t){void 0===e&&(e="");var r=n({inplace:!1},t).inplace,a=[];if(this.values.map((function(t){i.isEmpty(t)?a.push(NaN):a.push((""+t).lastIndexOf(e))})),!r){var o=this.series.copy();return o.$setValues(a),o}this.series.$setValues(a),this.series.print()},e.prototype.replace=function(e,t,r){void 0===e&&(e=""),void 0===t&&(t="");var a=n({inplace:!1},r).inplace,o=[];if(this.values.map((function(r){i.isEmpty(r)?o.push(NaN):o.push((""+r).replace(e,t))})),!a){var s=this.series.copy();return s.$setValues(o),s}this.series.$setValues(o),this.series.print()},e.prototype.repeat=function(e,t){void 0===e&&(e=1);var r=n({inplace:!1},t).inplace,a=[];if(this.values.map((function(t){i.isEmpty(t)?a.push(NaN):a.push((""+t).repeat(e))})),!r){var o=this.series.copy();return o.$setValues(a),o}this.series.$setValues(a),this.series.print()},e.prototype.search=function(e,t){void 0===e&&(e="");var r=n({inplace:!1},t).inplace,a=[];if(this.values.map((function(t){i.isEmpty(t)?a.push(NaN):a.push((""+t).search(e))})),!r){var o=this.series.copy();return o.$setValues(a),o}this.series.$setValues(a),this.series.print()},e.prototype.slice=function(e,t,r){void 0===e&&(e=0),void 0===t&&(t=1);var a=n({inplace:!1},r).inplace,o=[];if(this.values.map((function(r){i.isEmpty(r)?o.push(NaN):o.push((""+r).slice(e,t))})),!a){var s=this.series.copy();return s.$setValues(o),s}this.series.$setValues(o),this.series.print()},e.prototype.split=function(e,t){void 0===e&&(e=" ");var r=n({inplace:!1},t).inplace,a=[];if(this.values.map((function(t){i.isEmpty(t)?a.push(NaN):a.push(""+String(t).split(e))})),!r){var o=this.series.copy();return o.$setValues(a),o}this.series.$setValues(a),this.series.print()},e.prototype.substr=function(e,t,r){void 0===e&&(e=0),void 0===t&&(t=1);var a=n({inplace:!1},r).inplace,o=[];if(this.values.map((function(r){i.isEmpty(r)?o.push(NaN):o.push(""+String(r).substr(e,t))})),!a){var s=this.series.copy();return s.$setValues(o),s}this.series.$setValues(o),this.series.print()},e.prototype.substring=function(e,t,r){void 0===e&&(e=0),void 0===t&&(t=1);var a=n({inplace:!1},r).inplace,o=[];if(this.values.map((function(r){i.isEmpty(r)?o.push(NaN):o.push(""+String(r).substring(e,t))})),!a){var s=this.series.copy();return s.$setValues(o),s}this.series.$setValues(o),this.series.print()},e.prototype.trim=function(e){var t=n({inplace:!1},e).inplace,r=[];if(this.values.map((function(e){i.isEmpty(e)?r.push(NaN):r.push((""+e).trim())})),!t){var a=this.series.copy();return a.$setValues(r),a}this.series.$setValues(r),this.series.print()},e.prototype.join=function(e,t,r){void 0===e&&(e=""),void 0===t&&(t=" ");var a=n({inplace:!1},r).inplace,o=[];if(this.values.map((function(r){if(i.isEmpty(r))o.push(NaN);else{var n=""+r+t+e;o.push(n)}})),!a){var s=this.series.copy();return s.$setValues(o),s}this.series.$setValues(o),this.series.print()},e.prototype.len=function(e){var t=n({inplace:!1},e).inplace,r=[];if(this.values.map((function(e){i.isEmpty(e)?r.push(NaN):r.push((""+e).length)})),!t){var a=this.series.copy();return a.$setValues(r),a}this.series.$setValues(r),this.series.print()},e}();t.default=o},63457:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.__version=t.tensorflow=t.dateRange=t.merge=t.concat=t.getDummies=t.OneHotEncoder=t.LabelEncoder=t.StandardScaler=t.MinMaxScaler=t.DataFrame=t.Series=t.toDateTime=t.Dt=t.Str=t.Utils=t.Config=t.NDframe=void 0;var s=o(r(19096));t.NDframe=s.default;var l=o(r(22487));t.Config=l.default;var c=o(r(62222));t.Utils=c.default;var u=o(r(1847));t.Series=u.default;var f=o(r(5741));t.DataFrame=f.default;var p=o(r(18271));t.Str=p.default;var h=i(r(13381));t.Dt=h.default,Object.defineProperty(t,"toDateTime",{enumerable:!0,get:function(){return h.toDateTime}});var d=o(r(99907));t.MinMaxScaler=d.default;var m=o(r(7183));t.StandardScaler=m.default;var g=o(r(74304));t.LabelEncoder=g.default;var y=o(r(45360));t.OneHotEncoder=y.default;var v=o(r(38159));t.getDummies=v.default;var b=o(r(59853));t.concat=b.default;var x=o(r(12135));t.merge=x.default;var _=o(r(19253));t.dateRange=_.default;var w=o(r(22148));t.tensorflow=w.default,t.__version="1.1.2"},76579:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toExcelBrowser=t.readExcelBrowser=t.toJSONBrowser=t.readJSONBrowser=t.toCSVBrowser=t.streamCSVBrowser=t.readCSVBrowser=void 0;var n=r(50558);Object.defineProperty(t,"readCSVBrowser",{enumerable:!0,get:function(){return n.$readCSV}}),Object.defineProperty(t,"streamCSVBrowser",{enumerable:!0,get:function(){return n.$streamCSV}}),Object.defineProperty(t,"toCSVBrowser",{enumerable:!0,get:function(){return n.$toCSV}});var a=r(42493);Object.defineProperty(t,"readJSONBrowser",{enumerable:!0,get:function(){return a.$readJSON}}),Object.defineProperty(t,"toJSONBrowser",{enumerable:!0,get:function(){return a.$toJSON}});var i=r(12496);Object.defineProperty(t,"readExcelBrowser",{enumerable:!0,get:function(){return i.$readExcel}}),Object.defineProperty(t,"toExcelBrowser",{enumerable:!0,get:function(){return i.$toExcel}})},50558:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function s(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.$toCSV=t.$streamCSV=t.$readCSV=void 0;var s=r(63457),l=o(r(64409));t.$readCSV=function(e,t){return a(void 0,void 0,void 0,(function(){var r;return i(this,(function(a){return r=(null==t?void 0:t.frameConfig)||{},[2,new Promise((function(a){l.default.parse(e,n(n({header:!0,dynamicTyping:!0,skipEmptyLines:"greedy"},t),{download:!0,complete:function(e){var t=new s.DataFrame(e.data,r);a(t)}}))}))]}))}))},t.$streamCSV=function(e,t,r){return a(void 0,void 0,void 0,(function(){var a;return i(this,(function(i){return a=(null==r?void 0:r.frameConfig)||{},[2,new Promise((function(i){var o=0;l.default.parse(e,n(n({},r),{dynamicTyping:!0,header:!0,download:!0,step:function(e){var r=new s.DataFrame([e.data],n(n({},a),{index:[o++]}));t(r)},complete:function(){return i(null)}}))}))]}))}))},t.$toCSV=function(e,t){var r=n({fileName:"output.csv",sep:",",header:!0,download:!1},t),a=r.fileName,i=r.download,o=r.sep,s=r.header;if(e.$isSeries){var l=e.values.join(o);if(!i)return l;a.endsWith(".csv")||(a+=".csv"),c(l,a)}else{for(var u=e.values,f=!0===s?e.columns.join(o)+"\n":"",p=0;p<u.length;p++)f+=u[p].join(o)+"\n";if(!i)return f;a.endsWith(".csv")||(a+=".csv"),c(f,a)}};var c=function(e,t){var r=document.createElement("a");r.href="data:text/csv;charset=utf-8,"+encodeURI(e),r.target="_blank",r.download=t,r.click()}},12496:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function s(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.$toExcel=t.$readExcel=void 0;var s=r(63457),l=r(42695);t.$readExcel=function(e,t){return a(void 0,void 0,void 0,(function(){var r,a,o,c,u,f,p,h,d,m,g;return i(this,(function(i){switch(i.label){case 0:return r=n({sheet:0,method:"GET",headers:{},frameConfig:{},parsingOptions:{}},t),a=r.sheet,o=r.method,c=r.headers,u=r.frameConfig,f=r.parsingOptions,"string"==typeof e&&e.startsWith("http")?[2,new Promise((function(t){fetch(e,{method:o,headers:c}).then((function(r){if(200!==r.status)throw new Error("Failed to load "+e);r.arrayBuffer().then((function(e){var r=new Uint8Array(e),i=(0,l.read)(r,n({type:"array"},f)),o=i.Sheets[i.SheetNames[a]],c=l.utils.sheet_to_json(o),p=new s.DataFrame(c,u);t(p)}))})).catch((function(e){throw new Error(e)}))}))]:[3,1];case 1:return e instanceof File?[4,e.arrayBuffer()]:[3,3];case 2:return p=i.sent(),h=new Uint8Array(p),d=(0,l.read)(h,n({type:"array"},f)),m=d.Sheets[d.SheetNames[a]],g=l.utils.sheet_to_json(m),[2,new s.DataFrame(g,u)];case 3:throw new Error("ParamError: File not supported. file must be a url or an input File object")}}))}))},t.$toExcel=function(e,t){var r,a=n({fileName:"./output.xlsx",sheetName:"Sheet1"},t),i=a.fileName,s=a.sheetName,c=a.writingOptions;if(i.endsWith(".xlsx")||(i+=".xlsx"),e.$isSeries){var u=e.values,f=e.columns;r=o([f],u.map((function(e){return[e]})),!0)}else{u=e.values;var p=e.columns;r=o([p],u,!0)}var h=l.utils.aoa_to_sheet(r),d=l.utils.book_new();l.utils.book_append_sheet(d,h,s),(0,l.writeFile)(d,""+i,c)}},42493:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function s(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.$toJSON=t.$readJSON=void 0;var o=r(63457);t.$readJSON=function(e,t){return a(void 0,void 0,void 0,(function(){var r,a,s,l;return i(this,(function(i){if(r=n({method:"GET",headers:{},frameConfig:{}},t),a=r.method,s=r.headers,l=r.frameConfig,"string"==typeof e&&e.startsWith("http"))return[2,new Promise((function(t){fetch(e,{method:a,headers:s}).then((function(r){if(200!==r.status)throw new Error("Failed to load "+e);r.json().then((function(e){t(new o.DataFrame(e,l))}))})).catch((function(e){throw new Error(e)}))}))];if(e instanceof File)return[2,new Promise((function(t){var r=new FileReader;r.readAsText(e),r.onload=function(e){var r,n=JSON.parse(null===(r=null==e?void 0:e.target)||void 0===r?void 0:r.result);t(new o.DataFrame(n,l))}}))];throw new Error("ParamError: File not supported. file must be a url or an input File object")}))}))},t.$toJSON=function(e,t){var r=n({fileName:"output.json",download:!1,format:"column"},t),a=r.fileName,i=r.format,o=r.download;if(e.$isSeries){if((l={})[e.columns[0]]=e.values,!o)return l;a.endsWith(".json")||(a+=".json"),s(l,a)}else if("row"===i){for(var l={},c=0;c<e.columns.length;c++)l[e.columns[c]]=e.column(e.columns[c]).values;if(!o)return l;a.endsWith(".json")||(a+=".json"),s(l,a)}else{var u=e.values,f=e.columns,p=[];if(u.forEach((function(e){var t={};f.forEach((function(r,n){t[r]=e[n]})),p.push(t)})),!o)return p;a.endsWith(".json")||(a+=".json"),s(p,a)}};var s=function(e,t){var r=document.createElement("a");r.href="data:text/json;charset=utf-8,"+encodeURI(JSON.stringify(e)),r.target="_blank",r.download=t,r.click()}},26784:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlotlyLib=void 0;var n,a=r(16635);"undefined"!=typeof window&&(n=r(30363));var i=function(){function e(e,t){this.ndframe=e,this.divId=t}return e.prototype.getPlotConfig=function(e){return{config:e&&e.config?e.config:{},layout:e&&e.layout?e.layout:{}}},e.prototype.line=function(e){var t=this.getPlotConfig(e);(0,a.linePlot)(this.ndframe,this.divId,t,n)},e.prototype.bar=function(e){var t=this.getPlotConfig(e);(0,a.barPlot)(this.ndframe,this.divId,t,n)},e.prototype.scatter=function(e){var t=this.getPlotConfig(e);(0,a.scatterPlot)(this.ndframe,this.divId,t,n)},e.prototype.hist=function(e){var t=this.getPlotConfig(e);(0,a.histPlot)(this.ndframe,this.divId,t,n)},e.prototype.pie=function(e){var t=this.getPlotConfig(e);(0,a.piePlot)(this.ndframe,this.divId,t,n)},e.prototype.box=function(e){var t=this.getPlotConfig(e);(0,a.boxPlot)(this.ndframe,this.divId,t,n)},e.prototype.violin=function(e){var t=this.getPlotConfig(e);(0,a.violinPlot)(this.ndframe,this.divId,t,n)},e.prototype.table=function(e){var t=this.getPlotConfig(e);(0,a.tablePlot)(this.ndframe,this.divId,t,n)},e}();t.PlotlyLib=i},26594:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.barPlot=void 0;var i=a(r(1847)),o=r(38154);t.barPlot=function(e,t,r,a){var s=r.config,l=r.layout;if(e instanceof i.default){var c={x:e.index,y:e.values,type:"bar"};a.newPlot(t,[c],l,s)}else if(s.x&&s.y){(0,o.throwErrorOnWrongColName)(e,s.x),(0,o.throwErrorOnWrongColName)(e,s.y),c={x:e[s.x].values,y:e[s.y].values,type:"bar"};var u=n({xaxis:{title:s.x},yaxis:{title:s.y}},l);a.newPlot(t,[c],u,s)}else if(s.x||s.y)s.x&&((0,o.throwErrorOnWrongColName)(e,s.x),c={x:e[s.x].values,y:e.index,type:"bar"},u=n({xaxis:{title:s.x},yaxis:{title:"Index"}},l),a.newPlot(t,[c],u,s)),s.y&&((0,o.throwErrorOnWrongColName)(e,s.y),c={x:e.index,y:e[s.y].values,type:"bar"},u=n({xaxis:{title:"Index"},yaxis:{title:s.y}},l),a.newPlot(t,[c],u,s));else{var f=s.columns?(0,o.checkIfColsExist)(e,s.columns):e.columns,p=[];f.forEach((function(t){var r={x:e.index,y:e[t].values,name:t,type:"bar"};p.push(r)})),a.newPlot(t,p,l,s)}}},20974:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.boxPlot=void 0;var i=a(r(1847)),o=r(38154);t.boxPlot=function(e,t,r,a){var s=r.config,l=r.layout;if(e instanceof i.default){var c={y:e.values,type:"box"};a.newPlot(t,[c],l,s)}else if(s.x&&s.y){(0,o.throwErrorOnWrongColName)(e,s.x),(0,o.throwErrorOnWrongColName)(e,s.y),c={x:e[s.x].values,y:e[s.y].values,type:"box"};var u=n({xaxis:{title:s.x},yaxis:{title:s.y}},l);a.newPlot(t,[c],u,s)}else if(s.x||s.y)s.x&&((0,o.throwErrorOnWrongColName)(e,s.x),c={x:e[s.x].values,y:e.index,type:"box"},u=n({xaxis:{title:s.x},yaxis:{title:"Index"}},l),a.newPlot(t,[c],u,s)),s.y&&((0,o.throwErrorOnWrongColName)(e,s.y),c={x:e.index,y:e[s.y].values,type:"box"},u=n({xaxis:{title:"Index"},yaxis:{title:s.y}},l),a.newPlot(t,[c],u,s));else{var f=s.columns?(0,o.checkIfColsExist)(e,s.columns):e.columns,p=[];f.forEach((function(t){var r={y:e[t].values,name:t,type:"box"};p.push(r)})),a.newPlot(t,p,l,s)}}},80416:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.histPlot=void 0;var i=a(r(1847)),o=r(38154);t.histPlot=function(e,t,r,a){var s=r.config,l=r.layout;if(e instanceof i.default){var c={x:e.values,type:"histogram"};a.newPlot(t,[c],l,s)}else if(s.x||s.y){if(s.x){(0,o.throwErrorOnWrongColName)(e,s.x),c={x:e[s.x].values,type:"histogram"};var u=n({xaxis:{title:s.x}},l);a.newPlot(t,[c],u,s)}s.y&&((0,o.throwErrorOnWrongColName)(e,s.y),c={y:e[s.y].values,type:"histogram"},u=n({yaxis:{title:s.y}},l),a.newPlot(t,[c],u,s))}else{var f=s.columns?(0,o.checkIfColsExist)(e,s.columns):e.columns,p=[];f.forEach((function(t){var r=e.index,n={x:e[t].values,y:r,name:t,type:"histogram"};p.push(n)})),a.newPlot(t,p,l,s)}}},16635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tablePlot=t.violinPlot=t.boxPlot=t.piePlot=t.histPlot=t.scatterPlot=t.barPlot=t.linePlot=void 0;var n=r(56562);Object.defineProperty(t,"linePlot",{enumerable:!0,get:function(){return n.linePlot}});var a=r(26594);Object.defineProperty(t,"barPlot",{enumerable:!0,get:function(){return a.barPlot}});var i=r(565);Object.defineProperty(t,"scatterPlot",{enumerable:!0,get:function(){return i.scatterPlot}});var o=r(80416);Object.defineProperty(t,"histPlot",{enumerable:!0,get:function(){return o.histPlot}});var s=r(34885);Object.defineProperty(t,"piePlot",{enumerable:!0,get:function(){return s.piePlot}});var l=r(20974);Object.defineProperty(t,"boxPlot",{enumerable:!0,get:function(){return l.boxPlot}});var c=r(76282);Object.defineProperty(t,"violinPlot",{enumerable:!0,get:function(){return c.violinPlot}});var u=r(89115);Object.defineProperty(t,"tablePlot",{enumerable:!0,get:function(){return u.tablePlot}})},56562:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.linePlot=void 0;var i=a(r(1847)),o=r(38154);t.linePlot=function(e,t,r,a){var s=r.config,l=r.layout;if(e instanceof i.default){var c=e.values,u={x:e.index,y:c,type:"scatter",mode:"lines"};a.newPlot(t,[u],l,s)}else if(s.x&&s.y){(0,o.throwErrorOnWrongColName)(e,s.x),(0,o.throwErrorOnWrongColName)(e,s.y),u={x:e[s.x].values,y:c=e[s.y].values};var f=n({xaxis:{title:s.x},yaxis:{title:s.y}},l);a.newPlot(t,[u],f,s)}else if(s.x||s.y)s.x&&((0,o.throwErrorOnWrongColName)(e,s.x),u={x:e[s.x].values,y:c=e.index},f=n({xaxis:{title:s.x},yaxis:{title:"Index"}},l),a.newPlot(t,[u],f,s)),s.y&&((0,o.throwErrorOnWrongColName)(e,s.y),u={x:e.index,y:c=e[s.y].values},f=n({xaxis:{title:"Index"},yaxis:{title:s.y}},l),a.newPlot(t,[u],f,s));else{var p=s.columns?(0,o.checkIfColsExist)(e,s.columns):e.columns,h=[];p.forEach((function(t){var r={x:e.index,y:e[t].values,name:t};h.push(r)})),a.newPlot(t,h,l,s)}}},34885:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.piePlot=void 0;var i=a(r(1847)),o=r(38154);t.piePlot=function(e,t,r,a){var s=r.config,l=r.layout;if(e instanceof i.default){var c={values:e.values,labels:s.labels||e.index,type:"pie",name:s.labels,hoverinfo:"label+percent+name",automargin:!0};a.newPlot(t,[c],l,s)}else{if(!s.labels)throw new Error('Param Error: Please provide a column name for "labels" param');if(!e.columns.includes(s.labels))throw Error("Column Error: "+s.labels+' not found in columns. Param "labels" name must be one of [ '+e.columns+"]");if(s.values){if(!e.columns.includes(s.values))throw Error("Column Error: "+s.values+' not found in columns. Param "values" name must be one of [ '+e.columns+"]");c={values:e[s.values].values,labels:e[s.labels].values,type:"pie",name:s.labels,hoverinfo:"label+percent+name",automargin:!0},a.newPlot(t,[c],l,s)}else{var u=s.columns?(0,o.checkIfColsExist)(e,s.columns):e.columns;if(s.rowPositions){if(s.rowPositions.length!=u.length)throw Error("length of rowPositions array must be equal to number of columns. Got "+s.rowPositions.length+", expected "+(u.length-1))}else{for(var f=[],p=0;p<u.length-1;p++)f.push(0);s.rowPositions=f}if(s.columnPositions){if(s.columnPositions.length!=u.length)throw Error("length of columnPositions array must be equal to number of columns. Got "+s.columnPositions.length+", expected "+(u.length-1))}else{for(f=[],p=0;p<u.length-1;p++)f.push(p);s.columnPositions=f}var h=[];u.forEach((function(t,r){var n={labels:e[s.labels].values,values:e[t].values,name:t,type:"pie",domain:{row:s.rowPositions[r],column:s.columnPositions[r]},hoverinfo:"label+percent+name",automargin:!0,textposition:"outside"};h.push(n)}));var d=n({},l);if(s.grid)d.grid=s.grid;else{var m=Number((e.shape[1]/2).toFixed())+1;d.grid={rows:m,columns:m}}a.newPlot(t,h,d,s)}}}},565:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.scatterPlot=void 0;var i=a(r(1847)),o=r(38154);t.scatterPlot=function(e,t,r,a){var s=r.config,l=r.layout;if(e instanceof i.default){var c=e.values,u={x:e.index,y:c,type:"scatter",mode:"markers"};a.newPlot(t,[u],l,s)}else if(s.x&&s.y){(0,o.throwErrorOnWrongColName)(e,s.x),(0,o.throwErrorOnWrongColName)(e,s.y),u={x:e[s.x].values,y:c=e[s.y].values,type:"scatter",mode:"markers"};var f=n({xaxis:{title:s.x},yaxis:{title:s.y}},l);a.newPlot(t,[u],f,s)}else if(s.x||s.y)s.x&&((0,o.throwErrorOnWrongColName)(e,s.x),u={x:e[s.x].values,y:c=e.index,type:"scatter",mode:"markers"},f=n({xaxis:{title:s.x},yaxis:{title:"Index"}},l),a.newPlot(t,[u],f,s)),s.y&&((0,o.throwErrorOnWrongColName)(e,s.y),u={x:e.index,y:c=e[s.y].values,type:"scatter",mode:"markers"},f=n({xaxis:{title:"Index"},yaxis:{title:s.y}},l),a.newPlot(t,[u],f,s));else{var p=s.columns?(0,o.checkIfColsExist)(e,s.columns):e.columns,h=[];p.forEach((function(t){var r=e.index,n={x:e[t].values,y:r,name:t,type:"scatter",mode:"markers"};h.push(n)})),a.newPlot(t,h,l,s)}}},89115:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tablePlot=void 0,t.tablePlot=function(e,t,r,n){var a=r.config,i=r.layout,o={},s={},l=[],c=[];a.columns?(a.columns.forEach((function(t){if(!e.columns.includes(t))throw Error("Column Error: "+t+" not found in columns. Columns should be one of [ "+e.columns+" ]");var r=e.columns.indexOf(t);l.push(e.getColumnData[r])})),c=a.columns):(c=e.columns,l=e.getColumnData),o.values=c.map((function(e){return[e]})),s.values=l,a.tableHeaderStyle&&Object.keys(a.tableHeaderStyle).forEach((function(e){o[e]=a.tableHeaderStyle[e]})),a.tableCellStyle&&Object.keys(a.tableCellStyle).forEach((function(e){s[e]=a.tableCellStyle[e]}));var u={type:"table",header:o,cells:s};n.newPlot(t,[u],i,a)}},38154:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwErrorOnWrongColName=t.checkIfColsExist=void 0,t.checkIfColsExist=function(e,t){return t.forEach((function(t){if(!e.columns.includes(t))throw Error("Column Error: "+t+" not found in columns. Columns should be one of [ "+e.columns+" ]")})),t},t.throwErrorOnWrongColName=function(e,t){if(!e.columns.includes(t))throw Error("ParamError: specified column "+t+" not found in columns")}},76282:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.violinPlot=void 0;var i=a(r(1847)),o=r(38154);t.violinPlot=function(e,t,r,a){var s=r.config,l=r.layout;if(e instanceof i.default){var c={y:e.values,type:"violin"};a.newPlot(t,[c],l,s)}else if(s.x&&s.y){(0,o.throwErrorOnWrongColName)(e,s.x),(0,o.throwErrorOnWrongColName)(e,s.y),c={x:e[s.x].values,y:e[s.y].values,type:"violin"};var u=n({xaxis:{title:s.x},yaxis:{title:s.y}},l);a.newPlot(t,[c],u,s)}else if(s.x||s.y)s.x&&((0,o.throwErrorOnWrongColName)(e,s.x),c={x:e[s.x].values,y:e.index,type:"violin"},u=n({xaxis:{title:s.x},yaxis:{title:"Index"}},l),a.newPlot(t,[c],u,s)),s.y&&((0,o.throwErrorOnWrongColName)(e,s.y),c={x:e.index,y:e[s.y].values,type:"violin"},u=n({xaxis:{title:"Index"},yaxis:{title:s.y}},l),a.newPlot(t,[c],u,s));else{var f=s.columns?(0,o.checkIfColsExist)(e,s.columns):e.columns,p=[];f.forEach((function(t){var r={y:e[t].values,name:t,type:"violin"};p.push(r)})),a.newPlot(t,p,l,s)}}},22487:function(e,t){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){var t=r({tableDisplayConfig:{},tableMaxRow:10,tableMaxColInConsole:10,dtypeTestLim:500,lowMemoryMode:!1},e),n=t.tableDisplayConfig,a=t.tableMaxRow,i=t.tableMaxColInConsole,o=t.dtypeTestLim,s=t.lowMemoryMode;this.tableDisplayConfig=n,this.tableMaxRow=a,this.tableMaxColInConsole=i,this.dtypeTestLim=o,this.lowMemoryMode=s}return e.prototype.setTableDisplayConfig=function(e){this.tableDisplayConfig=e},Object.defineProperty(e.prototype,"getTableDisplayConfig",{get:function(){return this.tableDisplayConfig},enumerable:!1,configurable:!0}),e.prototype.setTableMaxColInConsole=function(e){this.tableMaxColInConsole=e},Object.defineProperty(e.prototype,"getTableMaxColInConsole",{get:function(){return this.tableMaxColInConsole},enumerable:!1,configurable:!0}),e.prototype.setMaxRow=function(e){this.tableMaxRow=e},Object.defineProperty(e.prototype,"getMaxRow",{get:function(){return this.tableMaxRow},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getDtypeTestLim",{get:function(){return this.dtypeTestLim},enumerable:!1,configurable:!0}),e.prototype.setDtypeTestLim=function(e){this.dtypeTestLim=e},Object.defineProperty(e.prototype,"isLowMemoryMode",{get:function(){return this.lowMemoryMode},enumerable:!1,configurable:!0}),e.prototype.setIsLowMemoryMode=function(e){this.lowMemoryMode=e},e}();t.default=n},67336:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DATA_TYPES=t.BASE_CONFIG=void 0,t.BASE_CONFIG={tableMaxRow:10,tableMaxColInConsole:10,dtypeTestLim:20,lowMemoryMode:!1},t.DATA_TYPES=["float32","int32","string","boolean","datetime","undefined"]},95528:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(67336);t.default=new function(){this.throwColumnNamesLengthError=function(e,t){var r="ParamError: Column names length mismatch. You provided a column of length "+t.length+" but Ndframe columns has length of "+e.shape[1];throw new Error(r)},this.throwIndexLengthError=function(e,t){var r="IndexError: You provided an index of length "+t.length+" but Ndframe rows has length of "+e.shape[0];throw new Error(r)},this.throwIndexDuplicateError=function(){throw new Error("IndexError: Row index must contain unique values")},this.throwColumnDuplicateError=function(){throw new Error("ColumnIndexError: Column index must contain unique values")},this.throwDtypesLengthError=function(e,t){var r="DtypeError: You provided a dtype array of length "+t.length+" but Ndframe columns has length of "+e.shape[1];throw new Error(r)},this.throwDtypeNotSupportedError=function(e){var t='DtypeError: Dtype "'+e+'" not supported. dtype must be one of "'+n.DATA_TYPES+'"';throw new Error(t)},this.throwDtypeWithoutColumnError=function(){throw new Error("DtypeError: columns parameter must be provided when dtypes parameter is provided")},this.throwColumnLengthError=function(e,t){var r="ParamError: Column data length mismatch. You provided data with length "+t+" but Ndframe has column of length "+e.shape[0];throw new Error(r)},this.throwRowLengthError=function(e,t){var r="ParamError: Row data length mismatch. You provided data with length "+t+" but Ndframe has row of length "+e.shape[0];throw new Error(r)},this.throwColumnNotFoundError=function(e){var t="ParamError: Column not found!. Column name must be one of "+e.columns;throw new Error(t)},this.throwNotImplementedError=function(){throw new Error("Method not implemented")},this.throwIlocRowIndexError=function(){throw new Error('ParamError: rows parameter must be a Array. For example: rows: [1,2] or rows: ["0:10"]')},this.throwIlocColumnsIndexError=function(){throw new Error('ParamError: columns parameter must be a Array. For example: columns: [1,2] or columns: ["0:10"]')},this.throwStringDtypeOperationError=function(e){throw new Error("DtypeError: String data type does not support "+e+" operation")},this.throwSeriesMathOpLengthError=function(e,t){var r="ParamError: Row length mismatch. Length of other ("+t.shape[0]+"), must be the same as Ndframe ("+e.shape[0]+")";throw new Error(r)}}},22148:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(58912);t.default=n},62222:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(67336),s=i(r(22487)),l=r(63457),c=r(63457),u=i(r(95528)),f=new s.default(o.BASE_CONFIG),p=function(){function e(){}return e.prototype.removeElementFromArray=function(e,t){return e.filter((function(e,r){return r!=t}))},e.prototype.isString=function(e){return"string"==typeof e},e.prototype.isNumber=function(e){return"number"==typeof e&&isFinite(e)},e.prototype.isObject=function(e){return e&&"object"==typeof e&&e.constructor&&"Object"===e.constructor.name},e.prototype.isNull=function(e){return null===e},e.prototype.isUndefined=function(e){return void 0===e},e.prototype.isEmpty=function(e){return null==e||isNaN(e)&&"string"!=typeof e},e.prototype.isDate=function(e){return e instanceof Date},e.prototype.range=function(e,t){if(t<e)throw new Error("ParamError: end must be greater than start");if(e===t)return[e];for(var r=[],n=e;n<=t;n++)r.push(n);return r},e.prototype.keyInObject=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.prototype.transposeArray=function(e){if(0===e.length)return e;var t=e.length;if(Array.isArray(e[0])){for(var r=e[0].length,n=[],a=0;a<=r-1;a++){for(var i=[],o=0;o<t;o++){var s=e[o][a];i.push(s)}n.push(i)}return n}return e},e.prototype.getRowAndColValues=function(e){var t=Object.keys(e),r=Object.values(e),n=r[0].length;return r.forEach((function(e){if(e.length!=n)throw Error("Length Error: Length of columns must be the same!")})),[this.transposeArray(r),t]},e.prototype.convert2DArrayToSeriesArray=function(e){var t=this;return e.map((function(e){return t.isObject(e)?JSON.stringify(e):""+e}))},e.prototype.replaceUndefinedWithNaN=function(e,t){if(0===e.length)return e;if(t&&Array.isArray(e))return e.map((function(e){return void 0===e?NaN:"number"!=typeof e||!isNaN(e)&&e!=1/0?null==e?NaN:e:NaN}));var r=[];if(Array.isArray(e))for(var n=0;n<e.length;n++){var a=e[n].map((function(e){return void 0===e?NaN:"number"!=typeof e||!isNaN(e)&&e!=1/0?null==e?NaN:e:NaN}));r.push(a)}return r},e.prototype.inferDtype=function(e){var t=this;return this.is1DArray(e)?[this.$typeChecker(e)]:this.transposeArray(e.slice(0,f.getDtypeTestLim)).map((function(e){return t.$typeChecker(e)}))},e.prototype.$typeChecker=function(e){var t,r=[],n=[],a=[],i=[],o=[];t=e.length<f.getDtypeTestLim?e.length:f.getDtypeTestLim;for(var s=e.slice(0,t),l=0;l<t;l++){var c=s[l];"boolean"==typeof c?(n.push(!1),r.push(!1),a.push(!1),i.push(!0),o.push(!1)):this.isEmpty(c)?(n.push(!0),r.push(!1),a.push(!1),i.push(!1),o.push(!1)):this.isDate(c)?(n.push(!1),r.push(!1),a.push(!1),i.push(!1),o.push(!0)):isNaN(Number(c))?(n.push(!1),r.push(!1),a.push(!0),i.push(!1),o.push(!1)):c.toString().includes(".")?(n.push(!0),r.push(!1),a.push(!1),i.push(!1),o.push(!1)):(n.push(!1),r.push(!0),a.push(!1),i.push(!1),o.push(!1))}var u=function(e){return 1==e};return a.some(u)?"string":n.some(u)?"float32":r.some(u)?"int32":i.some(u)?"boolean":o.some(u)?"datetime":"undefined"},e.prototype.unique=function(e){var t=new Set(e);return Array.from(t)},e.prototype.is1DArray=function(e){return"number"==typeof e[0]||"string"==typeof e[0]||"boolean"==typeof e[0]||null===e[0]},e.prototype.convertArrayToObject=function(e){for(var t={},r=0;r<e.length;r++)t[r]=e[r];return t},e.prototype.countNaNs=function(e,t,r){if(void 0===t&&(t=!0),r){for(var n=0,a=0,i=0;i<e.length;i++){var o=e[i];Number.isNaN(o)?n+=1:a+=1}return t?a:n}var s=[];for(i=0;i<e.length;i++){for(var l=e[i],c=(n=0,a=0,0);c<l.length;c++)o=l[c],Number.isNaN(o)?n+=1:a+=1;t?s.push(a):s.push(n)}return s},e.prototype.round=function(e,t,r){if(void 0===t&&(t=1),t<0&&(t=1),r){for(var n=[],a=0;a<e.length;a++)"number"!=typeof(l=e[a])||isNaN(l)||null==l?n.push(l):n.push(Number(l.toFixed(t)));return n}var i=[];for(a=0;a<e.length;a++){var o=e[a];if(n=[],Array.isArray(o)){for(var s=0;s<o.length;s++){var l;"number"!=typeof(l=o[s])||isNaN(l)||null==l?n.push(l):n.push(Number(l.toFixed(t)))}i.push(n)}else"number"!=typeof o||isNaN(o)||null==o?n.push(o):n.push(Number(o.toFixed(t)))}return i},e.prototype.isFunction=function(e){return"function"==typeof e},e.prototype.randNumberGenerator=function(e,t,r){var n=[];function a(e,t){return Math.floor(Math.random()*(t-e)+e)}function i(r,n){if(!n.includes(r))return r;i(r=a(e,t),n)}for(var o=0;o<r;o++){var s=i(a(e,t),n);n.push(s)}return n},e.prototype.throwErrorOnWrongParams=function(e,t){for(var r=Object.keys(e),n=[],a=0;a<r.length;a++)t.includes(r[a])?n.push(!0):n.push(!1);if(n.some((function(e){return 0==e})))throw Error("Params Error: Required parameter not found. Your params must include the following ["+t+"]")},e.prototype.mapIntegersToBooleans=function(e,t){if(2==t){var r=[];return e.map((function(e){var t=[];e.map((function(e){return t.push(1==e)})),r.push(t)})),r}var n=[];return e.map((function(e){return n.push(1==e)})),n},e.prototype.mapBooleansToIntegers=function(e,t){if(2==t){var r=[];return e.map((function(e){var t=[];e.map((function(e){return t.push(e?1:0)})),r.push(t)})),r}var n=[];return e.map((function(e){return n.push(e?1:0)})),n},e.prototype.zeros=function(e,t){for(var r=[],n=0;n<e;n++){for(var a=Array(t),i=0;i<t;i++)a[i]=0;r.push(a)}return r},e.prototype.shuffle=function(e,t){for(var r,n=e.length,a=0;n--;)a=Math.floor(Math.random()*(n+1)),r=e[n],e[n]=e[a],e[a]=r;return e.slice(0,t)},e.prototype.sort=function(e,t){return void 0===t&&(t=!0),a([],e,!0).sort((function(e,r){return t?"string"==typeof e&&"string"==typeof r?e.charCodeAt(0)-r.charCodeAt(0):e-r:"string"==typeof e&&"string"==typeof r?r.charCodeAt(0)-e.charCodeAt(0):r-e}))},e.prototype.isBrowserEnv=function(){return new Function("try {return this===window;}catch(e){ return false;}")()},e.prototype.isNodeEnv=function(){return new Function("try {return this===global;}catch(e){return false;}")()},e.prototype.removeMissingValuesFromArray=function(e){var t=this;return e.filter((function(e){return!t.isEmpty(e)}))},e.prototype.replaceNanWithNull=function(e){return e.map((function(e){return isNaN(e)?null:e}))},e.prototype.getDuplicate=function(e){for(var t={},r={},n=0;n<e.length;n++){var a=e[n];this.keyInObject(t,a)?(t[a].count+=1,t[a].index.push(n)):(t[a]={},t[a].count=1,t[a].index=[n])}for(var i in t)t[i].count>=2&&(r[i]={},r[i].count=t[i].count,r[i].index=t[i].index);return r},e.prototype.sortArrayByIndex=function(e,t,r){var n=e.map((function(e,r){return[t[r],e]}));return"string"==r?n.sort():n.sort((function(e,t){var r=e[0];return t[0]-r})),n.map((function(e){return e[1]}))},e.prototype.createNdframeFromNewDataWithOldProps=function(e){var t=e.ndFrame,r=e.newData;return e.isSeries?new l.Series(r,{index:a([],t.index,!0),columns:a([],t.columns,!0),dtypes:a([],t.dtypes,!0),config:n({},t.config)}):new c.DataFrame(r,{index:a([],t.index,!0),columns:a([],t.columns,!0),dtypes:a([],t.dtypes,!0),config:n({},t.config)})},e.prototype.checkSeriesOpCompactibility=function(e){var t=e.firstSeries,r=e.secondSeries,n=e.operation;t.shape[0]!=r.shape[0]&&u.default.throwSeriesMathOpLengthError(t,r),"string"!=t.dtypes[0]&&"string"!=r.dtypes[0]||u.default.throwStringDtypeOperationError(n)},e.prototype.sortObj=function(e,t){return e.sort((function(e,r){var n=r.value,a=e.value;return t?"string"==typeof n&&"string"==typeof a?(n=n.toUpperCase())>(a=a.toUpperCase())?-1:n<a?1:0:Number(a)-Number(n):"string"==typeof n&&"string"==typeof a?(n=n.toUpperCase())<(a=a.toUpperCase())?-1:n>a?1:0:Number(n)-Number(a)}))},e}();t.default=p},59853:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(r(1847)),i=n(r(5741));t.default=function(e){var t=e.dfList;return 1===e.axis?function(e,t){for(var r={},n={},a=0,o=0;o<e.length;o++){var s,l=e[o];s=l instanceof i.default?l.getColumnData:[l.values];for(var c=l.columns,u=0;u<c.length;u++){var f=c[u],p=s[u];p.length>a&&(a=p.length),f in r?(n[f]+=1,f+=n[f],r[f]=p):(r[f]=p,n[f]=0)}}return Object.keys(r).forEach((function(e){var t,n=r[e].length;if(n<a){var i=new Array(a-n).fill(NaN);(t=r[e]).push.apply(t,i)}})),new i.default(r)}(t):function(e,t){for(var r={},n=0,o=function(t){var a,o,s,l=e[t],c=l.columns;if(s=l instanceof i.default?l.getColumnData:[l.values],0===t)for(var u=0;u<c.length;u++){var f=c[u],p=s[u];r[f]=p}else{var h=Object.keys(r).filter((function(e){return!c.includes(e)}));for(u=0;u<c.length;u++)f=c[u],p=s[u],Object.keys(r).includes(f)?(a=r[f]).push.apply(a,p):((m=new Array(n).fill(NaN)).push.apply(m,p),r[f]=m);if(h.length>0){var d=s[0].length;for(u=0;u<h.length;u++){f=h[u];var m=new Array(d).fill(NaN);(o=r[f]).push.apply(o,m)}}}n+=s[0].length},s=0;s<e.length;s++)o(s);return 1===Object.keys(r).length?new a.default(Object.values(r)[0]):new i.default(r)}(t)}},38159:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(r(5741)),s=i(r(1847)),l=new(i(r(62222)).default);t.default=function(e,t){var r=n({columns:null,prefix:null,prefixSeparator:"_"},t),i=r.columns,c=r.prefix,u=r.prefixSeparator;if(!e)throw new Error("ParamError: data must be one of Array, Series or DataFrame");if(!(e instanceof s.default||e instanceof o.default))throw new Error("ParamError: data must be one of Array, Series or DataFrame");if(!i){var f=[];e.dtypes.forEach((function(t,r){"string"===t&&f.push(e.columns[r])})),i=f}if("string"==typeof i){if(i=[i],Array.isArray(c)&&1===c.length)c=c;else{if("string"!=typeof c)throw new Error("ParamError: prefix must be a string, or an array of same length as columns");c=[c]}if(Array.isArray(u)&&1===u.length)u=u;else{if("string"!=typeof u)throw new Error("ParamError: prefix must be a string, or an array of same length as columns");u=[u]}}else{if(!Array.isArray(i))throw new Error("ParamError: columns must be a string or an array of strings");if(c){if(Array.isArray(c)&&c.length!==i.length)throw new Error('ParamError: prefix and data array must be of the same length. If you need to use the same prefix, then pass a string param instead. e.g {prefix: "'+c+'"}');"string"==typeof c&&(c=i.map((function(e){return c})))}if(u){if(Array.isArray(u)&&u.length!==i.length)throw new Error('ParamError: prefixSeparator and data array must be of the same length. If you need to use the same prefix separator, then pass a string param instead. e.g {prefixSeparator: "'+u+'"}');"string"==typeof u&&(u=i.map((function(e){return u})))}}if(e instanceof s.default){for(var p=e.values,h=[],d=Array.from(new Set(p)),m=l.zeros(p.length,d.length),g=0;g<p.length;g++){var y=d.indexOf(p[g]);m[g][y]=1}for(g=0;g<d.length;g++){var v=c?c[0]:g;h.push(""+v+u[0]+d[g])}return new o.default(m,{columns:h})}var b=e.drop({columns:i}),x=null==b?void 0:b.values;for(h=null==b?void 0:b.columns,g=0;g<i.length;g++){for(var _=i[g],w=(p=e.column(_).values,d=Array.from(new Set(p)),m=l.zeros(p.length,d.length),0);w<p.length;w++){y=d.indexOf(p[w]),m[w][y]=1;var k=""+(v=c?c[g]:_)+u[g]+p[w];h.includes(k)||h.push(k)}for(var D=0;D<x.length;D++)x[D]=a(a([],x[D],!0),m[D],!0)}return new o.default(x,{columns:h})}},74304:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(r(22148)),i=n(r(1847)),o=new(n(r(62222)).default),s=function(){function e(){this.$labels={}}return e.prototype.$getData=function(e){var t;if(e instanceof Array){if(!o.is1DArray(e))throw new Error("ValueError: data must be a 1D array.");t=e}else if(e instanceof i.default)t=e.values;else{if(!(e instanceof a.default.Tensor))throw new Error("ParamError: data must be one of Array, 1d Tensor or Series.");t=e.arraySync()}return t},e.prototype.fit=function(e){var t=this.$getData(e),r=Array.from(new Set(t)),n={};return r.forEach((function(e,t){n[e]=t})),this.$labels=n,this},e.prototype.transform=function(e){var t=this,r=this.$getData(e).map((function(e){return void 0!==t.$labels[e]?t.$labels[e]:-1}));return e instanceof Array?r:e instanceof i.default?new i.default(r):a.default.tensor1d(r)},e.prototype.fitTransform=function(e){return this.fit(e),this.transform(e)},e.prototype.inverseTransform=function(e){var t=this,r=this.$getData(e).map((function(e){return Object.keys(t.$labels).find((function(r){return t.$labels[r]===e}))})).map((function(e){return isNaN(parseInt(e))?e:Number(e)}));return e instanceof Array?r:e instanceof i.default?new i.default(r):a.default.tensor1d(r)},Object.defineProperty(e.prototype,"nClasses",{get:function(){return Object.keys(this.$labels).length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classes",{get:function(){return this.$labels},enumerable:!1,configurable:!0}),e}();t.default=s},45360:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(r(5741)),i=n(r(22148)),o=n(r(1847)),s=new(n(r(62222)).default),l=function(){function e(){this.$labels=[]}return e.prototype.$getData=function(e){var t;if(e instanceof Array){if(!s.is1DArray(e))throw new Error("ValueError: data must be a 1D array.");t=e}else if(e instanceof o.default)t=e.values;else{if(!(e instanceof i.default.Tensor))throw new Error("ParamError: data must be one of Array, 1d Tensor or Series.");t=e.arraySync()}return t},e.prototype.fit=function(e){var t=this.$getData(e),r=Array.from(new Set(t));return this.$labels=r,this},e.prototype.transform=function(e){for(var t=this.$getData(e),r=s.zeros(t.length,this.$labels.length),n=0;n<t.length;n++){var l=this.$labels.indexOf(t[n]);r[n][l]=1}return e instanceof Array?r:e instanceof o.default?new a.default(r,{index:e.index}):i.default.tensor1d(r)},e.prototype.fitTransform=function(e){return this.fit(e),this.transform(e)},e}();t.default=l},12135:function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=a(r(5741)),o=new(a(r(62222)).default),s=function(){function e(e){var t=e.left,r=e.right,n=e.on,a=e.how;this.leftColIndex=[],this.rightColIndex=[],this.left=t,this.right=r,this.on=n,this.how=a;for(var i=0;i<this.on.length;i++){var o=this.on[i];if(this.left.columns.includes(o)&&this.right.columns.includes(o)){var s=this.left.columns.indexOf(o),l=this.right.columns.indexOf(o);this.leftColIndex.push(s),this.rightColIndex.push(l)}}}return e.prototype.generateKeyCombination=function(e,t){for(var r={},n=0;n<e.length;n++){for(var a=e[n],i=[],s=0;s<t.length;s++){var l=t[s];i.push(a[l])}var c=i.join("_"),u=a.filter((function(e,r){return!t.includes(r)}));o.keyInObject(r,c)?r[c].filters.push(u):r[c]={filters:[u],combValues:i}}return r},e.prototype.createColumns=function(){var e=this;this.leftCol=e.left.columns.filter((function(t,r){return!e.leftColIndex.includes(r)})),this.rightCol=e.right.columns.filter((function(t,r){return!e.rightColIndex.includes(r)})),this.columns=n([],this.on,!0);var t={},r=n([],this.leftCol,!0);r.push.apply(r,this.rightCol);for(var a=0;a<r.length;a++){var i=r[a];if(o.keyInObject(t,i)){var s=i+"_"+t[i];this.columns.push(s),t[i]+=1}else this.columns.push(i),t[i]=1}},e.prototype.basic=function(e,t,r){for(var n,a,i=[],s=0;s<e.length;s++){var l=e[s];if(o.keyInObject(t,l))for(var c=t[l].filters,u=t[l].combValues,f=0;f<c.length;f++){var p=c[f];if(o.keyInObject(r,l))for(var h=r[l].filters,d=0;d<h.length;d++){var m=h[d];(b=u.slice(0)).push.apply(b,p),b.push.apply(b,m),i.push(b)}else{var g=Array(null===(n=this.rightCol)||void 0===n?void 0:n.length).fill(NaN);(b=u.slice(0)).push.apply(b,p),b.push.apply(b,g),i.push(b)}}else{h=r[l].filters;for(var y=r[l].combValues,v=0;v<h.length;v++){var b;m=h[v],g=Array(null===(a=this.leftCol)||void 0===a?void 0:a.length).fill(NaN),(b=y.slice(0)).push.apply(b,g),b.push.apply(b,m),i.push(b)}}}return i},e.prototype.outer=function(e,t){var r=Object.keys(e);r.push.apply(r,Object.keys(t));var n=Array.from(new Set(r));return this.basic(n,e,t)},e.prototype.inner=function(e,t){var r=Object.keys(e),n=Object.keys(t),a=r.filter((function(e){return n.includes(e)}));return this.basic(a,e,t)},e.prototype.leftMerge=function(e,t){var r=Object.keys(e);return this.basic(r,e,t)},e.prototype.rightMerge=function(e,t){var r=Object.keys(t);return this.basic(r,e,t)},e.prototype.operation=function(){var e=this.left.values,t=this.right.values,r=this.generateKeyCombination(e,this.leftColIndex),a=this.generateKeyCombination(t,this.rightColIndex);this.createColumns();var o=[];switch(this.how){case"outer":o=this.outer(r,a);break;case"inner":o=this.inner(r,a);break;case"left":o=this.leftMerge(r,a);break;case"right":o=this.rightMerge(r,a)}var s=this.columns;return new i.default(o,{columns:n([],s,!0)})},e}();t.default=function(e){return new s(e).operation()}},99907:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=a(r(1847)),o=a(r(5741)),s=a(r(62222)),l=a(r(22148)),c=new s.default,u=function(){function e(){this.$max=l.default.tensor1d([]),this.$min=l.default.tensor1d([])}return e.prototype.$getTensor=function(e){var t;if(e instanceof Array)t=c.is1DArray(e)?l.default.tensor1d(e):l.default.tensor2d(e);else if(e instanceof o.default||e instanceof i.default)t=e.tensor;else{if(!(e instanceof l.default.Tensor))throw new Error("ParamError: data must be one of Array, Tensor, DataFrame or Series");t=e}return t},e.prototype.fit=function(e){var t=this.$getTensor(e);return this.$max=t.max(0),this.$min=t.min(0),this},e.prototype.transform=function(e){var t=this.$getTensor(e).sub(this.$min).div(this.$max.sub(this.$min));return Array.isArray(e)?t.arraySync():e instanceof i.default?new i.default(t,{index:e.index}):e instanceof o.default?new o.default(t,{index:e.index,columns:e.columns,config:n({},e.config)}):t},e.prototype.fitTransform=function(e){return this.fit(e),this.transform(e)},e.prototype.inverseTransform=function(e){var t=this.$getTensor(e).mul(this.$max.sub(this.$min)).add(this.$min);return Array.isArray(e)?t.arraySync():e instanceof i.default?new i.default(t,{index:e.index}):e instanceof o.default?new o.default(t,{index:e.index,columns:e.columns,config:n({},e.config)}):t},e}();t.default=u},7183:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=a(r(22148)),o=a(r(1847)),s=a(r(5741)),l=new(a(r(62222)).default),c=function(){function e(){this.$std=i.default.tensor1d([]),this.$mean=i.default.tensor1d([])}return e.prototype.$getTensor=function(e){var t;if(e instanceof Array)t=l.is1DArray(e)?i.default.tensor1d(e):i.default.tensor2d(e);else if(e instanceof s.default||e instanceof o.default)t=e.tensor;else{if(!(e instanceof i.default.Tensor))throw new Error("ParamError: data must be one of Array, DataFrame or Series");t=e}return t},e.prototype.fit=function(e){var t=this.$getTensor(e);return this.$std=i.default.moments(t,0).variance.sqrt(),this.$mean=t.mean(0),this},e.prototype.transform=function(e){var t=this.$getTensor(e).sub(this.$mean).div(this.$std);return Array.isArray(e)?t.arraySync():e instanceof o.default?new o.default(t,{index:e.index}):e instanceof s.default?new s.default(t,{index:e.index,columns:e.columns,config:n({},e.config)}):t},e.prototype.fitTransform=function(e){return this.fit(e),this.transform(e)},e.prototype.inverseTransform=function(e){var t=this.$getTensor(e).mul(this.$std).add(this.$mean);return Array.isArray(e)?t.arraySync():e instanceof o.default?new o.default(t,{index:e.index}):e instanceof s.default?new s.default(t,{index:e.index,columns:e.columns,config:n({},e.config)}):t},e}();t.default=c},62510:function(e,t,r){"use strict";var n,a=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){return void 0===r&&(r={}),e.call(this,t,r)||this}return a(t,e),t}(i(r(5741)).default);t.default=o},22248:function(e,t,r){"use strict";var n,a=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){return void 0===r&&(r={}),e.call(this,t,r)||this}return a(t,e),t}(i(r(1847)).default);t.default=o},80881:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.__version=t.tensorflow=t.dateRange=t.merge=t.concat=t.getDummies=t.OneHotEncoder=t.LabelEncoder=t.StandardScaler=t.MinMaxScaler=t.toExcel=t.readExcel=t.toJSON=t.readJSON=t.toCSV=t.streamCSV=t.readCSV=t.DataFrame=t.Series=t.toDateTime=t.Dt=t.Str=t.Utils=t.Config=t.NDframe=void 0;var a=r(63457);Object.defineProperty(t,"NDframe",{enumerable:!0,get:function(){return a.NDframe}}),Object.defineProperty(t,"Config",{enumerable:!0,get:function(){return a.Config}}),Object.defineProperty(t,"Utils",{enumerable:!0,get:function(){return a.Utils}}),Object.defineProperty(t,"Str",{enumerable:!0,get:function(){return a.Str}}),Object.defineProperty(t,"Dt",{enumerable:!0,get:function(){return a.Dt}}),Object.defineProperty(t,"MinMaxScaler",{enumerable:!0,get:function(){return a.MinMaxScaler}}),Object.defineProperty(t,"StandardScaler",{enumerable:!0,get:function(){return a.StandardScaler}}),Object.defineProperty(t,"LabelEncoder",{enumerable:!0,get:function(){return a.LabelEncoder}}),Object.defineProperty(t,"OneHotEncoder",{enumerable:!0,get:function(){return a.OneHotEncoder}}),Object.defineProperty(t,"getDummies",{enumerable:!0,get:function(){return a.getDummies}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return a.concat}}),Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return a.merge}}),Object.defineProperty(t,"toDateTime",{enumerable:!0,get:function(){return a.toDateTime}}),Object.defineProperty(t,"dateRange",{enumerable:!0,get:function(){return a.dateRange}}),Object.defineProperty(t,"tensorflow",{enumerable:!0,get:function(){return a.tensorflow}}),Object.defineProperty(t,"__version",{enumerable:!0,get:function(){return a.__version}});var i=r(76579);Object.defineProperty(t,"readCSV",{enumerable:!0,get:function(){return i.readCSVBrowser}}),Object.defineProperty(t,"streamCSV",{enumerable:!0,get:function(){return i.streamCSVBrowser}}),Object.defineProperty(t,"toCSV",{enumerable:!0,get:function(){return i.toCSVBrowser}}),Object.defineProperty(t,"readJSON",{enumerable:!0,get:function(){return i.readJSONBrowser}}),Object.defineProperty(t,"toJSON",{enumerable:!0,get:function(){return i.toJSONBrowser}}),Object.defineProperty(t,"readExcel",{enumerable:!0,get:function(){return i.readExcelBrowser}}),Object.defineProperty(t,"toExcel",{enumerable:!0,get:function(){return i.toExcelBrowser}});var o=n(r(62510));t.DataFrame=o.default;var s=n(r(22248));t.Series=s.default},80864:()=>{},65066:()=>{},88478:()=>{},31435:()=>{},59930:()=>{},84593:()=>{},6874:()=>{},22006:()=>{},260:()=>{},34684:()=>{},73118:()=>{},5910:()=>{},84467:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createVersion=t.createUppercasePi=t.createUppercaseE=t.createTrue=t.createTau=t.createSQRT2=t.createSQRT1_2=t.createPi=t.createPhi=t.createNull=t.createNaN=t.createLOG2E=t.createLOG10E=t.createLN2=t.createLN10=t.createInfinity=t.createI=t.createFalse=t.createE=void 0;var n=r(58450),a=r(65648),i=r(78981),o=r(18001),s=(0,n.factory)("true",[],(function(){return!0}));t.createTrue=s;var l=(0,n.factory)("false",[],(function(){return!1}));t.createFalse=l;var c=(0,n.factory)("null",[],(function(){return null}));t.createNull=c;var u=A("Infinity",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1/0):1/0}));t.createInfinity=u;var f=A("NaN",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(NaN):NaN}));t.createNaN=f;var p=A("pi",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?(0,i.createBigNumberPi)(r):o.pi}));t.createPi=p;var h=A("tau",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?(0,i.createBigNumberTau)(r):o.tau}));t.createTau=h;var d=A("e",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?(0,i.createBigNumberE)(r):o.e}));t.createE=d;var m=A("phi",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?(0,i.createBigNumberPhi)(r):o.phi}));t.createPhi=m;var g=A("LN2",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(2).ln():Math.LN2}));t.createLN2=g;var y=A("LN10",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(10).ln():Math.LN10}));t.createLN10=y;var v=A("LOG2E",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1).div(new r(2).ln()):Math.LOG2E}));t.createLOG2E=v;var b=A("LOG10E",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1).div(new r(10).ln()):Math.LOG10E}));t.createLOG10E=b;var x=A("SQRT1_2",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r("0.5").sqrt():Math.SQRT1_2}));t.createSQRT1_2=x;var _=A("SQRT2",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(2).sqrt():Math.SQRT2}));t.createSQRT2=_;var w=A("i",["Complex"],(function(e){return e.Complex.I}));t.createI=w;var k=(0,n.factory)("PI",["pi"],(function(e){return e.pi}));t.createUppercasePi=k;var D=(0,n.factory)("E",["e"],(function(e){return e.e}));t.createUppercaseE=D;var T=(0,n.factory)("version",[],(function(){return a.version}));function A(e,t,r){return(0,n.factory)(e,t,r,{recreateOnConfigChange:!0})}t.createVersion=T},82265:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CONFIG=void 0,t.DEFAULT_CONFIG={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null}},17901:(e,t,r)=>{"use strict";var n=r(22948),a=r(80812);Object.defineProperty(t,"__esModule",{value:!0}),t.create=function e(t,r){var n=(0,i.default)({},m.DEFAULT_CONFIG,r);if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var a=s.mixin({isNumber:f.isNumber,isComplex:f.isComplex,isBigNumber:f.isBigNumber,isFraction:f.isFraction,isUnit:f.isUnit,isString:f.isString,isArray:f.isArray,isMatrix:f.isMatrix,isCollection:f.isCollection,isDenseMatrix:f.isDenseMatrix,isSparseMatrix:f.isSparseMatrix,isRange:f.isRange,isIndex:f.isIndex,isBoolean:f.isBoolean,isResultSet:f.isResultSet,isHelp:f.isHelp,isFunction:f.isFunction,isDate:f.isDate,isRegExp:f.isRegExp,isObject:f.isObject,isNull:f.isNull,isUndefined:f.isUndefined,isAccessorNode:f.isAccessorNode,isArrayNode:f.isArrayNode,isAssignmentNode:f.isAssignmentNode,isBlockNode:f.isBlockNode,isConditionalNode:f.isConditionalNode,isConstantNode:f.isConstantNode,isFunctionAssignmentNode:f.isFunctionAssignmentNode,isFunctionNode:f.isFunctionNode,isIndexNode:f.isIndexNode,isNode:f.isNode,isObjectNode:f.isObjectNode,isOperatorNode:f.isOperatorNode,isParenthesisNode:f.isParenthesisNode,isRangeNode:f.isRangeNode,isSymbolNode:f.isSymbolNode,isChain:f.isChain});a.config=(0,c.configFactory)(n,a.emit),a.expression={transform:{},mathWithTransform:{config:a.config}};var g=[],y=[],v={},b=(0,l.importFactory)((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return a.typed.apply(a.typed,t)}),(function e(t){if((0,u.isFactory)(t))return t(a);var r=t[Object.keys(t)[0]];if((0,u.isFactory)(r))return r(a);if(!(0,o.isLegacyFactory)(t))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",t),new Error("Factory object with properties `type`, `name`, and `factory` expected");var i,s=g.indexOf(t);return-1===s?(i=!0===t.math?t.factory(a.type,n,e,a.typed,a):t.factory(a.type,n,e,a.typed),g.push(t),y.push(i)):i=y[s],i}),a,v);return a.import=b,a.on("config",(function(){(0,o.values)(v).forEach((function(e){e&&e.meta&&e.meta.recreateOnConfigChange&&b(e,{override:!0})}))})),a.create=e.bind(null,t),a.factory=u.factory,a.import((0,o.values)((0,o.deepFlatten)(t))),a.ArgumentsError=p.ArgumentsError,a.DimensionError=h.DimensionError,a.IndexError=d.IndexError,a};var i=n(r(9917));r(81882);var o=r(54699),s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var r=g(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(37039)),l=r(60358),c=r(72958),u=r(58450),f=r(57237),p=r(91245),h=r(12906),d=r(14452),m=r(82265);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(g=function(e){return e?r:t})(e)}},72958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NUMBER_OPTIONS=t.MATRIX_OPTIONS=void 0,t.configFactory=function(e,t){function r(r){if(r){var a=(0,n.mapObject)(e,n.clone);s(r,"matrix",i),s(r,"number",o),(0,n.deepExtend)(e,r);var l=(0,n.mapObject)(e,n.clone),c=(0,n.mapObject)(r,n.clone);return t("config",l,a,c),l}return(0,n.mapObject)(e,n.clone)}return r.MATRIX_OPTIONS=i,r.NUMBER_OPTIONS=o,Object.keys(a.DEFAULT_CONFIG).forEach((function(t){Object.defineProperty(r,t,{get:function(){return e[t]},enumerable:!0,configurable:!0})})),r};var n=r(54699),a=r(82265),i=["Matrix","Array"];t.MATRIX_OPTIONS=i;var o=["number","BigNumber","Fraction"];function s(e,t,r){var n,a;void 0!==e[t]&&(n=r,a=e[t],-1===n.indexOf(a))&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map((function(e){return JSON.stringify(e)})).join(", ")+".")}t.NUMBER_OPTIONS=o},60358:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.importFactory=function(e,t,r,n){function f(t,i,o){var s;if(o.wrap&&"function"==typeof i&&(i=function(e){var t=function(){for(var t=[],n=0,a=arguments.length;n<a;n++){var i=arguments[n];t[n]=i&&i.valueOf()}return e.apply(r,t)};return e.transform&&(t.transform=e.transform),t}(i)),"function"==typeof(s=i)&&"string"==typeof s.signature&&(i=e(t,(0,a.default)({},i.signature,i))),g(r[t])&&g(i))return i=o.override?e(t,i.signatures):e(r[t],i),r[t]=i,delete n[t],p(t,i),void r.emit("import",t,(function(){return i}));if(void 0===r[t]||o.override)return r[t]=i,delete n[t],p(t,i),void r.emit("import",t,(function(){return i}));if(!o.silent)throw new Error('Cannot import "'+t+'": already exists')}function p(e,t){t&&"function"==typeof t.transform?(r.expression.transform[e]=t.transform,y(e)&&(r.expression.mathWithTransform[e]=t.transform)):(delete r.expression.transform[e],y(e)&&(r.expression.mathWithTransform[e]=t))}function h(e){delete r.expression.transform[e],y(e)?r.expression.mathWithTransform[e]=r[e]:delete r.expression.mathWithTransform[e]}function d(t,a){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.fn;if((0,c.contains)(i,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(i));var o=b(t)?r.expression.transform:r,u=i in r.expression.transform,f=(0,l.hasOwnProperty)(o,i)?o[i]:void 0,p=function(){var n={};t.dependencies.map(s.stripOptionalNotation).forEach((function(e){if((0,c.contains)(e,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?n.math=r:"mathWithTransform"===e?n.mathWithTransform=r.expression.mathWithTransform:"classes"===e?n.classes=r:n[e]=r[e]}));var o=t(n);if(o&&"function"==typeof o.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===f||a.override)return o;if(g(f)&&g(o))return e(f,o);if(a.silent)return f;throw new Error('Cannot import "'+i+'": already exists')};t.meta&&!1===t.meta.lazy?(o[i]=p(),f&&u?h(i):(b(t)||v(t))&&(0,l.lazy)(r.expression.mathWithTransform,i,(function(){return o[i]}))):((0,l.lazy)(o,i,p),f&&u?h(i):(b(t)||v(t))&&(0,l.lazy)(r.expression.mathWithTransform,i,(function(){return o[i]}))),n[i]=t,r.emit("import",i,p)}function m(e){return"function"==typeof e||"number"==typeof e||"string"==typeof e||"boolean"==typeof e||null===e||(0,o.isUnit)(e)||(0,o.isComplex)(e)||(0,o.isBigNumber)(e)||(0,o.isFraction)(e)||(0,o.isMatrix)(e)||Array.isArray(e)}function g(e){return"function"==typeof e&&"object"===(0,i.default)(e.signatures)}function y(e){return!(0,l.hasOwnProperty)(x,e)}function v(e){return!(-1!==e.fn.indexOf(".")||(0,l.hasOwnProperty)(x,e.fn)||e.meta&&e.meta.isClass)}function b(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}var x={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(e,t){var r=arguments.length;if(1!==r&&2!==r)throw new u.ArgumentsError("import",r,1,2);function n(e,r,a){if(Array.isArray(r))r.forEach((function(t){return n(e,t)}));else if("object"===(0,i.default)(r))for(var o in r)(0,l.hasOwnProperty)(r,o)&&n(e,r[o],o);else if((0,s.isFactory)(r)||void 0!==a){var c=(0,s.isFactory)(r)?b(r)?r.fn+".transform":r.fn:a;if((0,l.hasOwnProperty)(e,c)&&e[c]!==r&&!t.silent)throw new Error('Cannot import "'+c+'" twice');e[c]=r}else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}t||(t={});var a={};for(var o in n(a,e),a)if((0,l.hasOwnProperty)(a,o)){var c=a[o];if((0,s.isFactory)(c))d(c,t);else if(m(c))f(o,c,t);else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}}};var a=n(r(44024)),i=n(r(80812)),o=r(57237),s=r(58450),l=r(54699),c=r(70517),u=r(91245)},92814:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createTyped=void 0;var a=r(57237),i=n(r(54116)),o=r(49473),s=r(58450),l=r(84146),c=function(){return c=i.default.create,i.default},u=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],f=(0,s.factory)("typed",u,(function(e){var t=e.BigNumber,r=e.Complex,n=e.DenseMatrix,i=e.Fraction,s=c();return s.types=[{name:"number",test:a.isNumber},{name:"Complex",test:a.isComplex},{name:"BigNumber",test:a.isBigNumber},{name:"Fraction",test:a.isFraction},{name:"Unit",test:a.isUnit},{name:"string",test:a.isString},{name:"Chain",test:a.isChain},{name:"Array",test:a.isArray},{name:"Matrix",test:a.isMatrix},{name:"DenseMatrix",test:a.isDenseMatrix},{name:"SparseMatrix",test:a.isSparseMatrix},{name:"Range",test:a.isRange},{name:"Index",test:a.isIndex},{name:"boolean",test:a.isBoolean},{name:"ResultSet",test:a.isResultSet},{name:"Help",test:a.isHelp},{name:"function",test:a.isFunction},{name:"Date",test:a.isDate},{name:"RegExp",test:a.isRegExp},{name:"null",test:a.isNull},{name:"undefined",test:a.isUndefined},{name:"AccessorNode",test:a.isAccessorNode},{name:"ArrayNode",test:a.isArrayNode},{name:"AssignmentNode",test:a.isAssignmentNode},{name:"BlockNode",test:a.isBlockNode},{name:"ConditionalNode",test:a.isConditionalNode},{name:"ConstantNode",test:a.isConstantNode},{name:"FunctionNode",test:a.isFunctionNode},{name:"FunctionAssignmentNode",test:a.isFunctionAssignmentNode},{name:"IndexNode",test:a.isIndexNode},{name:"Node",test:a.isNode},{name:"ObjectNode",test:a.isObjectNode},{name:"OperatorNode",test:a.isOperatorNode},{name:"ParenthesisNode",test:a.isParenthesisNode},{name:"RangeNode",test:a.isRangeNode},{name:"SymbolNode",test:a.isSymbolNode},{name:"Map",test:l.isMap},{name:"Object",test:a.isObject}],s.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(t||p(e),(0,o.digits)(e)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return r||h(e),new r(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return r||h(e),new r(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return r||h(e),new r(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||d(e);var t=new i(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||p(e);try{return new t(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){i||d(e);try{return new i(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){r||h(e);try{return new r(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||p(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||d(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return n||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new n(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],s}));function p(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function h(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function d(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}t.createTyped=f},15320:(e,t,r)=>{"use strict";var n=r(80812);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.all=void 0;var i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(59884));t.all=i},39006:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0;var a=n(r(9917)),i=r(82265),o=r(72958),s=function(e){if(e)throw new Error("The global config is readonly. \nPlease create a mathjs instance if you want to change the default configuration. \nExample:\n\n  import { create, all } from 'mathjs';\n  const mathjs = create(all);\n  mathjs.config({ number: 'BigNumber' });\n");return Object.freeze(i.DEFAULT_CONFIG)};t.config=s,(0,a.default)(s,i.DEFAULT_CONFIG,{MATRIX_OPTIONS:o.MATRIX_OPTIONS,NUMBER_OPTIONS:o.NUMBER_OPTIONS})},33765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AccessorNodeDependencies",{enumerable:!0,get:function(){return a.AccessorNodeDependencies}}),Object.defineProperty(t,"ArrayNodeDependencies",{enumerable:!0,get:function(){return y.ArrayNodeDependencies}}),Object.defineProperty(t,"AssignmentNodeDependencies",{enumerable:!0,get:function(){return w.AssignmentNodeDependencies}}),Object.defineProperty(t,"BigNumberDependencies",{enumerable:!0,get:function(){return E.BigNumberDependencies}}),Object.defineProperty(t,"BlockNodeDependencies",{enumerable:!0,get:function(){return L.BlockNodeDependencies}}),Object.defineProperty(t,"ChainDependencies",{enumerable:!0,get:function(){return W.ChainDependencies}}),Object.defineProperty(t,"ComplexDependencies",{enumerable:!0,get:function(){return ne.ComplexDependencies}}),Object.defineProperty(t,"ConditionalNodeDependencies",{enumerable:!0,get:function(){return se.ConditionalNodeDependencies}}),Object.defineProperty(t,"ConstantNodeDependencies",{enumerable:!0,get:function(){return ue.ConstantNodeDependencies}}),Object.defineProperty(t,"DenseMatrixDependencies",{enumerable:!0,get:function(){return De.DenseMatrixDependencies}}),Object.defineProperty(t,"EDependencies",{enumerable:!0,get:function(){return ei.EDependencies}}),Object.defineProperty(t,"FibonacciHeapDependencies",{enumerable:!0,get:function(){return rt.FibonacciHeapDependencies}}),Object.defineProperty(t,"FractionDependencies",{enumerable:!0,get:function(){return dt.FractionDependencies}}),Object.defineProperty(t,"FunctionAssignmentNodeDependencies",{enumerable:!0,get:function(){return mt.FunctionAssignmentNodeDependencies}}),Object.defineProperty(t,"FunctionNodeDependencies",{enumerable:!0,get:function(){return gt.FunctionNodeDependencies}}),Object.defineProperty(t,"HelpDependencies",{enumerable:!0,get:function(){return At.HelpDependencies}}),Object.defineProperty(t,"ImmutableDenseMatrixDependencies",{enumerable:!0,get:function(){return Ot.ImmutableDenseMatrixDependencies}}),Object.defineProperty(t,"IndexDependencies",{enumerable:!0,get:function(){return Pt.IndexDependencies}}),Object.defineProperty(t,"IndexNodeDependencies",{enumerable:!0,get:function(){return Rt.IndexNodeDependencies}}),Object.defineProperty(t,"InfinityDependencies",{enumerable:!0,get:function(){return Ft.InfinityDependencies}}),Object.defineProperty(t,"LN10Dependencies",{enumerable:!0,get:function(){return Kt.LN10Dependencies}}),Object.defineProperty(t,"LN2Dependencies",{enumerable:!0,get:function(){return Jt.LN2Dependencies}}),Object.defineProperty(t,"LOG10EDependencies",{enumerable:!0,get:function(){return Qt.LOG10EDependencies}}),Object.defineProperty(t,"LOG2EDependencies",{enumerable:!0,get:function(){return er.LOG2EDependencies}}),Object.defineProperty(t,"MatrixDependencies",{enumerable:!0,get:function(){return xr.MatrixDependencies}}),Object.defineProperty(t,"NaNDependencies",{enumerable:!0,get:function(){return jr.NaNDependencies}}),Object.defineProperty(t,"NodeDependencies",{enumerable:!0,get:function(){return $r.NodeDependencies}}),Object.defineProperty(t,"ObjectNodeDependencies",{enumerable:!0,get:function(){return Kr.ObjectNodeDependencies}}),Object.defineProperty(t,"OperatorNodeDependencies",{enumerable:!0,get:function(){return en.OperatorNodeDependencies}}),Object.defineProperty(t,"PIDependencies",{enumerable:!0,get:function(){return ti.PIDependencies}}),Object.defineProperty(t,"ParenthesisNodeDependencies",{enumerable:!0,get:function(){return rn.ParenthesisNodeDependencies}}),Object.defineProperty(t,"ParserDependencies",{enumerable:!0,get:function(){return on.ParserDependencies}}),Object.defineProperty(t,"RangeDependencies",{enumerable:!0,get:function(){return Mn.RangeDependencies}}),Object.defineProperty(t,"RangeNodeDependencies",{enumerable:!0,get:function(){return En.RangeNodeDependencies}}),Object.defineProperty(t,"RelationalNodeDependencies",{enumerable:!0,get:function(){return Pn.RelationalNodeDependencies}}),Object.defineProperty(t,"ResultSetDependencies",{enumerable:!0,get:function(){return Bn.ResultSetDependencies}}),Object.defineProperty(t,"SQRT1_2Dependencies",{enumerable:!0,get:function(){return Xn.SQRT1_2Dependencies}}),Object.defineProperty(t,"SQRT2Dependencies",{enumerable:!0,get:function(){return Yn.SQRT2Dependencies}}),Object.defineProperty(t,"SpaDependencies",{enumerable:!0,get:function(){return ba.SpaDependencies}}),Object.defineProperty(t,"SparseMatrixDependencies",{enumerable:!0,get:function(){return _a.SparseMatrixDependencies}}),Object.defineProperty(t,"SymbolNodeDependencies",{enumerable:!0,get:function(){return Ba.SymbolNodeDependencies}}),Object.defineProperty(t,"UnitDependencies",{enumerable:!0,get:function(){return Ja.UnitDependencies}}),Object.defineProperty(t,"absDependencies",{enumerable:!0,get:function(){return n.absDependencies}}),Object.defineProperty(t,"acosDependencies",{enumerable:!0,get:function(){return i.acosDependencies}}),Object.defineProperty(t,"acoshDependencies",{enumerable:!0,get:function(){return o.acoshDependencies}}),Object.defineProperty(t,"acotDependencies",{enumerable:!0,get:function(){return s.acotDependencies}}),Object.defineProperty(t,"acothDependencies",{enumerable:!0,get:function(){return l.acothDependencies}}),Object.defineProperty(t,"acscDependencies",{enumerable:!0,get:function(){return c.acscDependencies}}),Object.defineProperty(t,"acschDependencies",{enumerable:!0,get:function(){return u.acschDependencies}}),Object.defineProperty(t,"addDependencies",{enumerable:!0,get:function(){return f.addDependencies}}),Object.defineProperty(t,"addScalarDependencies",{enumerable:!0,get:function(){return p.addScalarDependencies}}),Object.defineProperty(t,"all",{enumerable:!0,get:function(){return hi.all}}),Object.defineProperty(t,"andDependencies",{enumerable:!0,get:function(){return h.andDependencies}}),Object.defineProperty(t,"applyDependencies",{enumerable:!0,get:function(){return d.applyDependencies}}),Object.defineProperty(t,"applyTransformDependencies",{enumerable:!0,get:function(){return m.applyTransformDependencies}}),Object.defineProperty(t,"argDependencies",{enumerable:!0,get:function(){return g.argDependencies}}),Object.defineProperty(t,"asecDependencies",{enumerable:!0,get:function(){return v.asecDependencies}}),Object.defineProperty(t,"asechDependencies",{enumerable:!0,get:function(){return b.asechDependencies}}),Object.defineProperty(t,"asinDependencies",{enumerable:!0,get:function(){return x.asinDependencies}}),Object.defineProperty(t,"asinhDependencies",{enumerable:!0,get:function(){return _.asinhDependencies}}),Object.defineProperty(t,"atan2Dependencies",{enumerable:!0,get:function(){return D.atan2Dependencies}}),Object.defineProperty(t,"atanDependencies",{enumerable:!0,get:function(){return k.atanDependencies}}),Object.defineProperty(t,"atanhDependencies",{enumerable:!0,get:function(){return T.atanhDependencies}}),Object.defineProperty(t,"atomicMassDependencies",{enumerable:!0,get:function(){return A.atomicMassDependencies}}),Object.defineProperty(t,"avogadroDependencies",{enumerable:!0,get:function(){return S.avogadroDependencies}}),Object.defineProperty(t,"bellNumbersDependencies",{enumerable:!0,get:function(){return M.bellNumbersDependencies}}),Object.defineProperty(t,"bignumberDependencies",{enumerable:!0,get:function(){return C.bignumberDependencies}}),Object.defineProperty(t,"binDependencies",{enumerable:!0,get:function(){return N.binDependencies}}),Object.defineProperty(t,"bitAndDependencies",{enumerable:!0,get:function(){return O.bitAndDependencies}}),Object.defineProperty(t,"bitNotDependencies",{enumerable:!0,get:function(){return I.bitNotDependencies}}),Object.defineProperty(t,"bitOrDependencies",{enumerable:!0,get:function(){return P.bitOrDependencies}}),Object.defineProperty(t,"bitXorDependencies",{enumerable:!0,get:function(){return R.bitXorDependencies}}),Object.defineProperty(t,"bohrMagnetonDependencies",{enumerable:!0,get:function(){return F.bohrMagnetonDependencies}}),Object.defineProperty(t,"bohrRadiusDependencies",{enumerable:!0,get:function(){return B.bohrRadiusDependencies}}),Object.defineProperty(t,"boltzmannDependencies",{enumerable:!0,get:function(){return z.boltzmannDependencies}}),Object.defineProperty(t,"booleanDependencies",{enumerable:!0,get:function(){return j.booleanDependencies}}),Object.defineProperty(t,"catalanDependencies",{enumerable:!0,get:function(){return U.catalanDependencies}}),Object.defineProperty(t,"cbrtDependencies",{enumerable:!0,get:function(){return $.cbrtDependencies}}),Object.defineProperty(t,"ceilDependencies",{enumerable:!0,get:function(){return V.ceilDependencies}}),Object.defineProperty(t,"chainDependencies",{enumerable:!0,get:function(){return q.chainDependencies}}),Object.defineProperty(t,"classicalElectronRadiusDependencies",{enumerable:!0,get:function(){return H.classicalElectronRadiusDependencies}}),Object.defineProperty(t,"cloneDependencies",{enumerable:!0,get:function(){return G.cloneDependencies}}),Object.defineProperty(t,"columnDependencies",{enumerable:!0,get:function(){return X.columnDependencies}}),Object.defineProperty(t,"columnTransformDependencies",{enumerable:!0,get:function(){return Y.columnTransformDependencies}}),Object.defineProperty(t,"combinationsDependencies",{enumerable:!0,get:function(){return Z.combinationsDependencies}}),Object.defineProperty(t,"combinationsWithRepDependencies",{enumerable:!0,get:function(){return K.combinationsWithRepDependencies}}),Object.defineProperty(t,"compareDependencies",{enumerable:!0,get:function(){return J.compareDependencies}}),Object.defineProperty(t,"compareNaturalDependencies",{enumerable:!0,get:function(){return Q.compareNaturalDependencies}}),Object.defineProperty(t,"compareTextDependencies",{enumerable:!0,get:function(){return ee.compareTextDependencies}}),Object.defineProperty(t,"compileDependencies",{enumerable:!0,get:function(){return te.compileDependencies}}),Object.defineProperty(t,"complexDependencies",{enumerable:!0,get:function(){return re.complexDependencies}}),Object.defineProperty(t,"compositionDependencies",{enumerable:!0,get:function(){return ae.compositionDependencies}}),Object.defineProperty(t,"concatDependencies",{enumerable:!0,get:function(){return ie.concatDependencies}}),Object.defineProperty(t,"concatTransformDependencies",{enumerable:!0,get:function(){return oe.concatTransformDependencies}}),Object.defineProperty(t,"conductanceQuantumDependencies",{enumerable:!0,get:function(){return le.conductanceQuantumDependencies}}),Object.defineProperty(t,"conjDependencies",{enumerable:!0,get:function(){return ce.conjDependencies}}),Object.defineProperty(t,"cosDependencies",{enumerable:!0,get:function(){return fe.cosDependencies}}),Object.defineProperty(t,"coshDependencies",{enumerable:!0,get:function(){return pe.coshDependencies}}),Object.defineProperty(t,"cotDependencies",{enumerable:!0,get:function(){return he.cotDependencies}}),Object.defineProperty(t,"cothDependencies",{enumerable:!0,get:function(){return de.cothDependencies}}),Object.defineProperty(t,"coulombDependencies",{enumerable:!0,get:function(){return me.coulombDependencies}}),Object.defineProperty(t,"countDependencies",{enumerable:!0,get:function(){return ge.countDependencies}}),Object.defineProperty(t,"createUnitDependencies",{enumerable:!0,get:function(){return ye.createUnitDependencies}}),Object.defineProperty(t,"crossDependencies",{enumerable:!0,get:function(){return ve.crossDependencies}}),Object.defineProperty(t,"cscDependencies",{enumerable:!0,get:function(){return be.cscDependencies}}),Object.defineProperty(t,"cschDependencies",{enumerable:!0,get:function(){return xe.cschDependencies}}),Object.defineProperty(t,"ctransposeDependencies",{enumerable:!0,get:function(){return _e.ctransposeDependencies}}),Object.defineProperty(t,"cubeDependencies",{enumerable:!0,get:function(){return we.cubeDependencies}}),Object.defineProperty(t,"deepEqualDependencies",{enumerable:!0,get:function(){return ke.deepEqualDependencies}}),Object.defineProperty(t,"derivativeDependencies",{enumerable:!0,get:function(){return Te.derivativeDependencies}}),Object.defineProperty(t,"detDependencies",{enumerable:!0,get:function(){return Ae.detDependencies}}),Object.defineProperty(t,"deuteronMassDependencies",{enumerable:!0,get:function(){return Se.deuteronMassDependencies}}),Object.defineProperty(t,"diagDependencies",{enumerable:!0,get:function(){return Me.diagDependencies}}),Object.defineProperty(t,"diffDependencies",{enumerable:!0,get:function(){return Ee.diffDependencies}}),Object.defineProperty(t,"diffTransformDependencies",{enumerable:!0,get:function(){return Ce.diffTransformDependencies}}),Object.defineProperty(t,"distanceDependencies",{enumerable:!0,get:function(){return Ne.distanceDependencies}}),Object.defineProperty(t,"divideDependencies",{enumerable:!0,get:function(){return Oe.divideDependencies}}),Object.defineProperty(t,"divideScalarDependencies",{enumerable:!0,get:function(){return Ie.divideScalarDependencies}}),Object.defineProperty(t,"dotDependencies",{enumerable:!0,get:function(){return Pe.dotDependencies}}),Object.defineProperty(t,"dotDivideDependencies",{enumerable:!0,get:function(){return Re.dotDivideDependencies}}),Object.defineProperty(t,"dotMultiplyDependencies",{enumerable:!0,get:function(){return Le.dotMultiplyDependencies}}),Object.defineProperty(t,"dotPowDependencies",{enumerable:!0,get:function(){return Fe.dotPowDependencies}}),Object.defineProperty(t,"eDependencies",{enumerable:!0,get:function(){return Be.eDependencies}}),Object.defineProperty(t,"efimovFactorDependencies",{enumerable:!0,get:function(){return ze.efimovFactorDependencies}}),Object.defineProperty(t,"eigsDependencies",{enumerable:!0,get:function(){return je.eigsDependencies}}),Object.defineProperty(t,"electricConstantDependencies",{enumerable:!0,get:function(){return Ue.electricConstantDependencies}}),Object.defineProperty(t,"electronMassDependencies",{enumerable:!0,get:function(){return $e.electronMassDependencies}}),Object.defineProperty(t,"elementaryChargeDependencies",{enumerable:!0,get:function(){return Ve.elementaryChargeDependencies}}),Object.defineProperty(t,"equalDependencies",{enumerable:!0,get:function(){return qe.equalDependencies}}),Object.defineProperty(t,"equalScalarDependencies",{enumerable:!0,get:function(){return We.equalScalarDependencies}}),Object.defineProperty(t,"equalTextDependencies",{enumerable:!0,get:function(){return He.equalTextDependencies}}),Object.defineProperty(t,"erfDependencies",{enumerable:!0,get:function(){return Ge.erfDependencies}}),Object.defineProperty(t,"evaluateDependencies",{enumerable:!0,get:function(){return Xe.evaluateDependencies}}),Object.defineProperty(t,"expDependencies",{enumerable:!0,get:function(){return Ye.expDependencies}}),Object.defineProperty(t,"expm1Dependencies",{enumerable:!0,get:function(){return Ke.expm1Dependencies}}),Object.defineProperty(t,"expmDependencies",{enumerable:!0,get:function(){return Ze.expmDependencies}}),Object.defineProperty(t,"factorialDependencies",{enumerable:!0,get:function(){return Je.factorialDependencies}}),Object.defineProperty(t,"falseDependencies",{enumerable:!0,get:function(){return Qe.falseDependencies}}),Object.defineProperty(t,"faradayDependencies",{enumerable:!0,get:function(){return et.faradayDependencies}}),Object.defineProperty(t,"fermiCouplingDependencies",{enumerable:!0,get:function(){return tt.fermiCouplingDependencies}}),Object.defineProperty(t,"filterDependencies",{enumerable:!0,get:function(){return nt.filterDependencies}}),Object.defineProperty(t,"filterTransformDependencies",{enumerable:!0,get:function(){return at.filterTransformDependencies}}),Object.defineProperty(t,"fineStructureDependencies",{enumerable:!0,get:function(){return it.fineStructureDependencies}}),Object.defineProperty(t,"firstRadiationDependencies",{enumerable:!0,get:function(){return ot.firstRadiationDependencies}}),Object.defineProperty(t,"fixDependencies",{enumerable:!0,get:function(){return st.fixDependencies}}),Object.defineProperty(t,"flattenDependencies",{enumerable:!0,get:function(){return lt.flattenDependencies}}),Object.defineProperty(t,"floorDependencies",{enumerable:!0,get:function(){return ct.floorDependencies}}),Object.defineProperty(t,"forEachDependencies",{enumerable:!0,get:function(){return ut.forEachDependencies}}),Object.defineProperty(t,"forEachTransformDependencies",{enumerable:!0,get:function(){return ft.forEachTransformDependencies}}),Object.defineProperty(t,"formatDependencies",{enumerable:!0,get:function(){return pt.formatDependencies}}),Object.defineProperty(t,"fractionDependencies",{enumerable:!0,get:function(){return ht.fractionDependencies}}),Object.defineProperty(t,"gammaDependencies",{enumerable:!0,get:function(){return yt.gammaDependencies}}),Object.defineProperty(t,"gasConstantDependencies",{enumerable:!0,get:function(){return vt.gasConstantDependencies}}),Object.defineProperty(t,"gcdDependencies",{enumerable:!0,get:function(){return bt.gcdDependencies}}),Object.defineProperty(t,"getMatrixDataTypeDependencies",{enumerable:!0,get:function(){return xt.getMatrixDataTypeDependencies}}),Object.defineProperty(t,"gravitationConstantDependencies",{enumerable:!0,get:function(){return _t.gravitationConstantDependencies}}),Object.defineProperty(t,"gravityDependencies",{enumerable:!0,get:function(){return wt.gravityDependencies}}),Object.defineProperty(t,"hartreeEnergyDependencies",{enumerable:!0,get:function(){return kt.hartreeEnergyDependencies}}),Object.defineProperty(t,"hasNumericValueDependencies",{enumerable:!0,get:function(){return Dt.hasNumericValueDependencies}}),Object.defineProperty(t,"helpDependencies",{enumerable:!0,get:function(){return Tt.helpDependencies}}),Object.defineProperty(t,"hexDependencies",{enumerable:!0,get:function(){return St.hexDependencies}}),Object.defineProperty(t,"hypotDependencies",{enumerable:!0,get:function(){return Mt.hypotDependencies}}),Object.defineProperty(t,"iDependencies",{enumerable:!0,get:function(){return Et.iDependencies}}),Object.defineProperty(t,"identityDependencies",{enumerable:!0,get:function(){return Ct.identityDependencies}}),Object.defineProperty(t,"imDependencies",{enumerable:!0,get:function(){return Nt.imDependencies}}),Object.defineProperty(t,"indexDependencies",{enumerable:!0,get:function(){return It.indexDependencies}}),Object.defineProperty(t,"indexTransformDependencies",{enumerable:!0,get:function(){return Lt.indexTransformDependencies}}),Object.defineProperty(t,"intersectDependencies",{enumerable:!0,get:function(){return Bt.intersectDependencies}}),Object.defineProperty(t,"invDependencies",{enumerable:!0,get:function(){return zt.invDependencies}}),Object.defineProperty(t,"inverseConductanceQuantumDependencies",{enumerable:!0,get:function(){return jt.inverseConductanceQuantumDependencies}}),Object.defineProperty(t,"isIntegerDependencies",{enumerable:!0,get:function(){return Ut.isIntegerDependencies}}),Object.defineProperty(t,"isNaNDependencies",{enumerable:!0,get:function(){return $t.isNaNDependencies}}),Object.defineProperty(t,"isNegativeDependencies",{enumerable:!0,get:function(){return Vt.isNegativeDependencies}}),Object.defineProperty(t,"isNumericDependencies",{enumerable:!0,get:function(){return qt.isNumericDependencies}}),Object.defineProperty(t,"isPositiveDependencies",{enumerable:!0,get:function(){return Wt.isPositiveDependencies}}),Object.defineProperty(t,"isPrimeDependencies",{enumerable:!0,get:function(){return Ht.isPrimeDependencies}}),Object.defineProperty(t,"isZeroDependencies",{enumerable:!0,get:function(){return Gt.isZeroDependencies}}),Object.defineProperty(t,"kldivergenceDependencies",{enumerable:!0,get:function(){return Xt.kldivergenceDependencies}}),Object.defineProperty(t,"klitzingDependencies",{enumerable:!0,get:function(){return Yt.klitzingDependencies}}),Object.defineProperty(t,"kronDependencies",{enumerable:!0,get:function(){return Zt.kronDependencies}}),Object.defineProperty(t,"largerDependencies",{enumerable:!0,get:function(){return tr.largerDependencies}}),Object.defineProperty(t,"largerEqDependencies",{enumerable:!0,get:function(){return rr.largerEqDependencies}}),Object.defineProperty(t,"lcmDependencies",{enumerable:!0,get:function(){return nr.lcmDependencies}}),Object.defineProperty(t,"leftShiftDependencies",{enumerable:!0,get:function(){return ar.leftShiftDependencies}}),Object.defineProperty(t,"log10Dependencies",{enumerable:!0,get:function(){return or.log10Dependencies}}),Object.defineProperty(t,"log1pDependencies",{enumerable:!0,get:function(){return sr.log1pDependencies}}),Object.defineProperty(t,"log2Dependencies",{enumerable:!0,get:function(){return lr.log2Dependencies}}),Object.defineProperty(t,"logDependencies",{enumerable:!0,get:function(){return ir.logDependencies}}),Object.defineProperty(t,"loschmidtDependencies",{enumerable:!0,get:function(){return cr.loschmidtDependencies}}),Object.defineProperty(t,"lsolveAllDependencies",{enumerable:!0,get:function(){return fr.lsolveAllDependencies}}),Object.defineProperty(t,"lsolveDependencies",{enumerable:!0,get:function(){return ur.lsolveDependencies}}),Object.defineProperty(t,"lupDependencies",{enumerable:!0,get:function(){return pr.lupDependencies}}),Object.defineProperty(t,"lusolveDependencies",{enumerable:!0,get:function(){return hr.lusolveDependencies}}),Object.defineProperty(t,"madDependencies",{enumerable:!0,get:function(){return dr.madDependencies}}),Object.defineProperty(t,"magneticConstantDependencies",{enumerable:!0,get:function(){return mr.magneticConstantDependencies}}),Object.defineProperty(t,"magneticFluxQuantumDependencies",{enumerable:!0,get:function(){return gr.magneticFluxQuantumDependencies}}),Object.defineProperty(t,"mapDependencies",{enumerable:!0,get:function(){return yr.mapDependencies}}),Object.defineProperty(t,"mapTransformDependencies",{enumerable:!0,get:function(){return vr.mapTransformDependencies}}),Object.defineProperty(t,"matrixDependencies",{enumerable:!0,get:function(){return br.matrixDependencies}}),Object.defineProperty(t,"matrixFromColumnsDependencies",{enumerable:!0,get:function(){return _r.matrixFromColumnsDependencies}}),Object.defineProperty(t,"matrixFromFunctionDependencies",{enumerable:!0,get:function(){return wr.matrixFromFunctionDependencies}}),Object.defineProperty(t,"matrixFromRowsDependencies",{enumerable:!0,get:function(){return kr.matrixFromRowsDependencies}}),Object.defineProperty(t,"maxDependencies",{enumerable:!0,get:function(){return Dr.maxDependencies}}),Object.defineProperty(t,"maxTransformDependencies",{enumerable:!0,get:function(){return Tr.maxTransformDependencies}}),Object.defineProperty(t,"meanDependencies",{enumerable:!0,get:function(){return Ar.meanDependencies}}),Object.defineProperty(t,"meanTransformDependencies",{enumerable:!0,get:function(){return Sr.meanTransformDependencies}}),Object.defineProperty(t,"medianDependencies",{enumerable:!0,get:function(){return Mr.medianDependencies}}),Object.defineProperty(t,"minDependencies",{enumerable:!0,get:function(){return Er.minDependencies}}),Object.defineProperty(t,"minTransformDependencies",{enumerable:!0,get:function(){return Cr.minTransformDependencies}}),Object.defineProperty(t,"modDependencies",{enumerable:!0,get:function(){return Nr.modDependencies}}),Object.defineProperty(t,"modeDependencies",{enumerable:!0,get:function(){return Or.modeDependencies}}),Object.defineProperty(t,"molarMassC12Dependencies",{enumerable:!0,get:function(){return Pr.molarMassC12Dependencies}}),Object.defineProperty(t,"molarMassDependencies",{enumerable:!0,get:function(){return Ir.molarMassDependencies}}),Object.defineProperty(t,"molarPlanckConstantDependencies",{enumerable:!0,get:function(){return Rr.molarPlanckConstantDependencies}}),Object.defineProperty(t,"molarVolumeDependencies",{enumerable:!0,get:function(){return Lr.molarVolumeDependencies}}),Object.defineProperty(t,"multinomialDependencies",{enumerable:!0,get:function(){return Fr.multinomialDependencies}}),Object.defineProperty(t,"multiplyDependencies",{enumerable:!0,get:function(){return Br.multiplyDependencies}}),Object.defineProperty(t,"multiplyScalarDependencies",{enumerable:!0,get:function(){return zr.multiplyScalarDependencies}}),Object.defineProperty(t,"neutronMassDependencies",{enumerable:!0,get:function(){return Ur.neutronMassDependencies}}),Object.defineProperty(t,"normDependencies",{enumerable:!0,get:function(){return Vr.normDependencies}}),Object.defineProperty(t,"notDependencies",{enumerable:!0,get:function(){return qr.notDependencies}}),Object.defineProperty(t,"nthRootDependencies",{enumerable:!0,get:function(){return Wr.nthRootDependencies}}),Object.defineProperty(t,"nthRootsDependencies",{enumerable:!0,get:function(){return Hr.nthRootsDependencies}}),Object.defineProperty(t,"nuclearMagnetonDependencies",{enumerable:!0,get:function(){return Gr.nuclearMagnetonDependencies}}),Object.defineProperty(t,"nullDependencies",{enumerable:!0,get:function(){return Xr.nullDependencies}}),Object.defineProperty(t,"numberDependencies",{enumerable:!0,get:function(){return Yr.numberDependencies}}),Object.defineProperty(t,"numericDependencies",{enumerable:!0,get:function(){return Zr.numericDependencies}}),Object.defineProperty(t,"octDependencies",{enumerable:!0,get:function(){return Jr.octDependencies}}),Object.defineProperty(t,"onesDependencies",{enumerable:!0,get:function(){return Qr.onesDependencies}}),Object.defineProperty(t,"orDependencies",{enumerable:!0,get:function(){return tn.orDependencies}}),Object.defineProperty(t,"parseDependencies",{enumerable:!0,get:function(){return nn.parseDependencies}}),Object.defineProperty(t,"parserDependencies",{enumerable:!0,get:function(){return an.parserDependencies}}),Object.defineProperty(t,"partitionSelectDependencies",{enumerable:!0,get:function(){return sn.partitionSelectDependencies}}),Object.defineProperty(t,"permutationsDependencies",{enumerable:!0,get:function(){return ln.permutationsDependencies}}),Object.defineProperty(t,"phiDependencies",{enumerable:!0,get:function(){return cn.phiDependencies}}),Object.defineProperty(t,"piDependencies",{enumerable:!0,get:function(){return un.piDependencies}}),Object.defineProperty(t,"pickRandomDependencies",{enumerable:!0,get:function(){return fn.pickRandomDependencies}}),Object.defineProperty(t,"planckChargeDependencies",{enumerable:!0,get:function(){return pn.planckChargeDependencies}}),Object.defineProperty(t,"planckConstantDependencies",{enumerable:!0,get:function(){return hn.planckConstantDependencies}}),Object.defineProperty(t,"planckLengthDependencies",{enumerable:!0,get:function(){return dn.planckLengthDependencies}}),Object.defineProperty(t,"planckMassDependencies",{enumerable:!0,get:function(){return mn.planckMassDependencies}}),Object.defineProperty(t,"planckTemperatureDependencies",{enumerable:!0,get:function(){return gn.planckTemperatureDependencies}}),Object.defineProperty(t,"planckTimeDependencies",{enumerable:!0,get:function(){return yn.planckTimeDependencies}}),Object.defineProperty(t,"powDependencies",{enumerable:!0,get:function(){return vn.powDependencies}}),Object.defineProperty(t,"printDependencies",{enumerable:!0,get:function(){return bn.printDependencies}}),Object.defineProperty(t,"prodDependencies",{enumerable:!0,get:function(){return xn.prodDependencies}}),Object.defineProperty(t,"protonMassDependencies",{enumerable:!0,get:function(){return _n.protonMassDependencies}}),Object.defineProperty(t,"qrDependencies",{enumerable:!0,get:function(){return wn.qrDependencies}}),Object.defineProperty(t,"quantileSeqDependencies",{enumerable:!0,get:function(){return kn.quantileSeqDependencies}}),Object.defineProperty(t,"quantumOfCirculationDependencies",{enumerable:!0,get:function(){return Dn.quantumOfCirculationDependencies}}),Object.defineProperty(t,"randomDependencies",{enumerable:!0,get:function(){return Tn.randomDependencies}}),Object.defineProperty(t,"randomIntDependencies",{enumerable:!0,get:function(){return An.randomIntDependencies}}),Object.defineProperty(t,"rangeDependencies",{enumerable:!0,get:function(){return Sn.rangeDependencies}}),Object.defineProperty(t,"rangeTransformDependencies",{enumerable:!0,get:function(){return Cn.rangeTransformDependencies}}),Object.defineProperty(t,"rationalizeDependencies",{enumerable:!0,get:function(){return Nn.rationalizeDependencies}}),Object.defineProperty(t,"reDependencies",{enumerable:!0,get:function(){return On.reDependencies}}),Object.defineProperty(t,"reducedPlanckConstantDependencies",{enumerable:!0,get:function(){return In.reducedPlanckConstantDependencies}}),Object.defineProperty(t,"replacerDependencies",{enumerable:!0,get:function(){return Rn.replacerDependencies}}),Object.defineProperty(t,"reshapeDependencies",{enumerable:!0,get:function(){return Ln.reshapeDependencies}}),Object.defineProperty(t,"resizeDependencies",{enumerable:!0,get:function(){return Fn.resizeDependencies}}),Object.defineProperty(t,"reviverDependencies",{enumerable:!0,get:function(){return zn.reviverDependencies}}),Object.defineProperty(t,"rightArithShiftDependencies",{enumerable:!0,get:function(){return jn.rightArithShiftDependencies}}),Object.defineProperty(t,"rightLogShiftDependencies",{enumerable:!0,get:function(){return Un.rightLogShiftDependencies}}),Object.defineProperty(t,"rotateDependencies",{enumerable:!0,get:function(){return $n.rotateDependencies}}),Object.defineProperty(t,"rotationMatrixDependencies",{enumerable:!0,get:function(){return Vn.rotationMatrixDependencies}}),Object.defineProperty(t,"roundDependencies",{enumerable:!0,get:function(){return qn.roundDependencies}}),Object.defineProperty(t,"rowDependencies",{enumerable:!0,get:function(){return Wn.rowDependencies}}),Object.defineProperty(t,"rowTransformDependencies",{enumerable:!0,get:function(){return Hn.rowTransformDependencies}}),Object.defineProperty(t,"rydbergDependencies",{enumerable:!0,get:function(){return Gn.rydbergDependencies}}),Object.defineProperty(t,"sackurTetrodeDependencies",{enumerable:!0,get:function(){return Zn.sackurTetrodeDependencies}}),Object.defineProperty(t,"secDependencies",{enumerable:!0,get:function(){return Kn.secDependencies}}),Object.defineProperty(t,"sechDependencies",{enumerable:!0,get:function(){return Jn.sechDependencies}}),Object.defineProperty(t,"secondRadiationDependencies",{enumerable:!0,get:function(){return Qn.secondRadiationDependencies}}),Object.defineProperty(t,"setCartesianDependencies",{enumerable:!0,get:function(){return ea.setCartesianDependencies}}),Object.defineProperty(t,"setDifferenceDependencies",{enumerable:!0,get:function(){return ta.setDifferenceDependencies}}),Object.defineProperty(t,"setDistinctDependencies",{enumerable:!0,get:function(){return ra.setDistinctDependencies}}),Object.defineProperty(t,"setIntersectDependencies",{enumerable:!0,get:function(){return na.setIntersectDependencies}}),Object.defineProperty(t,"setIsSubsetDependencies",{enumerable:!0,get:function(){return aa.setIsSubsetDependencies}}),Object.defineProperty(t,"setMultiplicityDependencies",{enumerable:!0,get:function(){return ia.setMultiplicityDependencies}}),Object.defineProperty(t,"setPowersetDependencies",{enumerable:!0,get:function(){return oa.setPowersetDependencies}}),Object.defineProperty(t,"setSizeDependencies",{enumerable:!0,get:function(){return sa.setSizeDependencies}}),Object.defineProperty(t,"setSymDifferenceDependencies",{enumerable:!0,get:function(){return la.setSymDifferenceDependencies}}),Object.defineProperty(t,"setUnionDependencies",{enumerable:!0,get:function(){return ca.setUnionDependencies}}),Object.defineProperty(t,"signDependencies",{enumerable:!0,get:function(){return ua.signDependencies}}),Object.defineProperty(t,"simplifyDependencies",{enumerable:!0,get:function(){return fa.simplifyDependencies}}),Object.defineProperty(t,"sinDependencies",{enumerable:!0,get:function(){return pa.sinDependencies}}),Object.defineProperty(t,"sinhDependencies",{enumerable:!0,get:function(){return ha.sinhDependencies}}),Object.defineProperty(t,"sizeDependencies",{enumerable:!0,get:function(){return da.sizeDependencies}}),Object.defineProperty(t,"sluDependencies",{enumerable:!0,get:function(){return ma.sluDependencies}}),Object.defineProperty(t,"smallerDependencies",{enumerable:!0,get:function(){return ga.smallerDependencies}}),Object.defineProperty(t,"smallerEqDependencies",{enumerable:!0,get:function(){return ya.smallerEqDependencies}}),Object.defineProperty(t,"sortDependencies",{enumerable:!0,get:function(){return va.sortDependencies}}),Object.defineProperty(t,"sparseDependencies",{enumerable:!0,get:function(){return xa.sparseDependencies}}),Object.defineProperty(t,"speedOfLightDependencies",{enumerable:!0,get:function(){return wa.speedOfLightDependencies}}),Object.defineProperty(t,"splitUnitDependencies",{enumerable:!0,get:function(){return ka.splitUnitDependencies}}),Object.defineProperty(t,"sqrtDependencies",{enumerable:!0,get:function(){return Da.sqrtDependencies}}),Object.defineProperty(t,"sqrtmDependencies",{enumerable:!0,get:function(){return Ta.sqrtmDependencies}}),Object.defineProperty(t,"squareDependencies",{enumerable:!0,get:function(){return Aa.squareDependencies}}),Object.defineProperty(t,"squeezeDependencies",{enumerable:!0,get:function(){return Sa.squeezeDependencies}}),Object.defineProperty(t,"stdDependencies",{enumerable:!0,get:function(){return Ma.stdDependencies}}),Object.defineProperty(t,"stdTransformDependencies",{enumerable:!0,get:function(){return Ea.stdTransformDependencies}}),Object.defineProperty(t,"stefanBoltzmannDependencies",{enumerable:!0,get:function(){return Ca.stefanBoltzmannDependencies}}),Object.defineProperty(t,"stirlingS2Dependencies",{enumerable:!0,get:function(){return Na.stirlingS2Dependencies}}),Object.defineProperty(t,"stringDependencies",{enumerable:!0,get:function(){return Oa.stringDependencies}}),Object.defineProperty(t,"subsetDependencies",{enumerable:!0,get:function(){return Ia.subsetDependencies}}),Object.defineProperty(t,"subsetTransformDependencies",{enumerable:!0,get:function(){return Pa.subsetTransformDependencies}}),Object.defineProperty(t,"subtractDependencies",{enumerable:!0,get:function(){return Ra.subtractDependencies}}),Object.defineProperty(t,"sumDependencies",{enumerable:!0,get:function(){return La.sumDependencies}}),Object.defineProperty(t,"sumTransformDependencies",{enumerable:!0,get:function(){return Fa.sumTransformDependencies}}),Object.defineProperty(t,"tanDependencies",{enumerable:!0,get:function(){return za.tanDependencies}}),Object.defineProperty(t,"tanhDependencies",{enumerable:!0,get:function(){return ja.tanhDependencies}}),Object.defineProperty(t,"tauDependencies",{enumerable:!0,get:function(){return Ua.tauDependencies}}),Object.defineProperty(t,"thomsonCrossSectionDependencies",{enumerable:!0,get:function(){return $a.thomsonCrossSectionDependencies}}),Object.defineProperty(t,"toDependencies",{enumerable:!0,get:function(){return Va.toDependencies}}),Object.defineProperty(t,"traceDependencies",{enumerable:!0,get:function(){return qa.traceDependencies}}),Object.defineProperty(t,"transposeDependencies",{enumerable:!0,get:function(){return Wa.transposeDependencies}}),Object.defineProperty(t,"trueDependencies",{enumerable:!0,get:function(){return Ha.trueDependencies}}),Object.defineProperty(t,"typeOfDependencies",{enumerable:!0,get:function(){return Ga.typeOfDependencies}}),Object.defineProperty(t,"typedDependencies",{enumerable:!0,get:function(){return Xa.typedDependencies}}),Object.defineProperty(t,"unaryMinusDependencies",{enumerable:!0,get:function(){return Ya.unaryMinusDependencies}}),Object.defineProperty(t,"unaryPlusDependencies",{enumerable:!0,get:function(){return Za.unaryPlusDependencies}}),Object.defineProperty(t,"unequalDependencies",{enumerable:!0,get:function(){return Ka.unequalDependencies}}),Object.defineProperty(t,"unitDependencies",{enumerable:!0,get:function(){return Qa.unitDependencies}}),Object.defineProperty(t,"usolveAllDependencies",{enumerable:!0,get:function(){return ni.usolveAllDependencies}}),Object.defineProperty(t,"usolveDependencies",{enumerable:!0,get:function(){return ri.usolveDependencies}}),Object.defineProperty(t,"vacuumImpedanceDependencies",{enumerable:!0,get:function(){return ai.vacuumImpedanceDependencies}}),Object.defineProperty(t,"varianceDependencies",{enumerable:!0,get:function(){return ii.varianceDependencies}}),Object.defineProperty(t,"varianceTransformDependencies",{enumerable:!0,get:function(){return oi.varianceTransformDependencies}}),Object.defineProperty(t,"versionDependencies",{enumerable:!0,get:function(){return si.versionDependencies}}),Object.defineProperty(t,"weakMixingAngleDependencies",{enumerable:!0,get:function(){return li.weakMixingAngleDependencies}}),Object.defineProperty(t,"wienDisplacementDependencies",{enumerable:!0,get:function(){return ci.wienDisplacementDependencies}}),Object.defineProperty(t,"xgcdDependencies",{enumerable:!0,get:function(){return ui.xgcdDependencies}}),Object.defineProperty(t,"xorDependencies",{enumerable:!0,get:function(){return fi.xorDependencies}}),Object.defineProperty(t,"zerosDependencies",{enumerable:!0,get:function(){return pi.zerosDependencies}});var n=r(14126),a=r(19683),i=r(14288),o=r(38280),s=r(26818),l=r(49190),c=r(82899),u=r(94020),f=r(25540),p=r(33237),h=r(67409),d=r(69979),m=r(50403),g=r(16847),y=r(87439),v=r(98377),b=r(20553),x=r(96200),_=r(38466),w=r(95571),k=r(21642),D=r(62138),T=r(52367),A=r(12063),S=r(95887),M=r(99867),E=r(67080),C=r(24785),N=r(91251),O=r(69828),I=r(37112),P=r(58063),R=r(93294),L=r(41789),F=r(12218),B=r(80306),z=r(89169),j=r(88067),U=r(20059),$=r(84972),V=r(48194),q=r(15017),W=r(74941),H=r(73278),G=r(4211),X=r(24436),Y=r(76480),Z=r(41467),K=r(65859),J=r(44070),Q=r(18103),ee=r(59792),te=r(81119),re=r(85103),ne=r(84011),ae=r(36250),ie=r(25590),oe=r(38057),se=r(13769),le=r(70262),ce=r(19620),ue=r(78321),fe=r(23511),pe=r(50188),he=r(93355),de=r(82267),me=r(81314),ge=r(67968),ye=r(84562),ve=r(70201),be=r(85636),xe=r(62691),_e=r(57097),we=r(40515),ke=r(5315),De=r(55511),Te=r(45064),Ae=r(1849),Se=r(65063),Me=r(15038),Ee=r(53449),Ce=r(46977),Ne=r(59849),Oe=r(62640),Ie=r(68115),Pe=r(42752),Re=r(57924),Le=r(29762),Fe=r(42407),Be=r(88775),ze=r(32061),je=r(44765),Ue=r(89411),$e=r(67375),Ve=r(99999),qe=r(45405),We=r(41498),He=r(5831),Ge=r(2909),Xe=r(72704),Ye=r(91578),Ze=r(74262),Ke=r(48346),Je=r(21574),Qe=r(15942),et=r(23099),tt=r(13116),rt=r(13835),nt=r(56089),at=r(47887),it=r(22041),ot=r(65002),st=r(57195),lt=r(59779),ct=r(72720),ut=r(29838),ft=r(82123),pt=r(20178),ht=r(99656),dt=r(57068),mt=r(10722),gt=r(51580),yt=r(73965),vt=r(66879),bt=r(20865),xt=r(34064),_t=r(51671),wt=r(3868),kt=r(55291),Dt=r(29483),Tt=r(14087),At=r(33159),St=r(36481),Mt=r(51378),Et=r(17776),Ct=r(52977),Nt=r(34317),Ot=r(52350),It=r(30514),Pt=r(60755),Rt=r(22497),Lt=r(26591),Ft=r(40302),Bt=r(8908),zt=r(73336),jt=r(80263),Ut=r(19313),$t=r(52601),Vt=r(20962),qt=r(96617),Wt=r(61089),Ht=r(3677),Gt=r(20713),Xt=r(42823),Yt=r(18476),Zt=r(97912),Kt=r(10571),Jt=r(31179),Qt=r(73825),er=r(48063),tr=r(57568),rr=r(29521),nr=r(88519),ar=r(94361),ir=r(72089),or=r(76426),sr=r(92205),lr=r(14954),cr=r(44266),ur=r(18155),fr=r(12759),pr=r(72369),hr=r(38646),dr=r(66403),mr=r(83784),gr=r(92474),yr=r(94604),vr=r(93753),br=r(23058),xr=r(1017),_r=r(29691),wr=r(75191),kr=r(26823),Dr=r(14244),Tr=r(72692),Ar=r(71246),Sr=r(31672),Mr=r(4291),Er=r(22329),Cr=r(61590),Nr=r(12344),Or=r(69629),Ir=r(16082),Pr=r(60928),Rr=r(91966),Lr=r(82018),Fr=r(41080),Br=r(54779),zr=r(96062),jr=r(89801),Ur=r(77965),$r=r(36991),Vr=r(81347),qr=r(19352),Wr=r(24745),Hr=r(90541),Gr=r(71931),Xr=r(95177),Yr=r(42885),Zr=r(47046),Kr=r(72556),Jr=r(36623),Qr=r(28469),en=r(65392),tn=r(21273),rn=r(55911),nn=r(13386),an=r(33571),on=r(84789),sn=r(37219),ln=r(41811),cn=r(63511),un=r(9764),fn=r(3843),pn=r(39723),hn=r(42576),dn=r(52522),mn=r(70967),gn=r(64987),yn=r(83743),vn=r(6817),bn=r(82762),xn=r(7555),_n=r(80509),wn=r(47268),kn=r(92312),Dn=r(98429),Tn=r(28448),An=r(11729),Sn=r(25169),Mn=r(97243),En=r(17771),Cn=r(37893),Nn=r(59578),On=r(22264),In=r(117),Pn=r(76805),Rn=r(29611),Ln=r(56205),Fn=r(68040),Bn=r(42267),zn=r(82159),jn=r(52342),Un=r(64617),$n=r(80618),Vn=r(15099),qn=r(58684),Wn=r(37128),Hn=r(61741),Gn=r(9539),Xn=r(57125),Yn=r(73184),Zn=r(8707),Kn=r(71563),Jn=r(14681),Qn=r(83381),ea=r(9522),ta=r(71459),ra=r(40399),na=r(67160),aa=r(46776),ia=r(66949),oa=r(44731),sa=r(45594),la=r(3290),ca=r(65709),ua=r(48482),fa=r(73879),pa=r(6860),ha=r(15848),da=r(51931),ma=r(25213),ga=r(11041),ya=r(34652),va=r(59205),ba=r(11856),xa=r(12400),_a=r(29027),wa=r(40552),ka=r(90824),Da=r(26786),Ta=r(87456),Aa=r(67654),Sa=r(6034),Ma=r(24757),Ea=r(44609),Ca=r(52931),Na=r(36010),Oa=r(76738),Ia=r(10847),Pa=r(59190),Ra=r(53885),La=r(71675),Fa=r(73493),Ba=r(72457),za=r(15668),ja=r(28422),Ua=r(86666),$a=r(53254),Va=r(45457),qa=r(62763),Wa=r(2246),Ha=r(5793),Ga=r(99916),Xa=r(34931),Ya=r(63697),Za=r(22640),Ka=r(82889),Ja=r(51455),Qa=r(58696),ei=r(1955),ti=r(6842),ri=r(98221),ni=r(99401),ai=r(7512),ii=r(46811),oi=r(38022),si=r(53681),li=r(33794),ci=r(9738),ui=r(67259),fi=r(11030),pi=r(89767),hi=r(15320)},14126:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.absDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createAbs:a.createAbs};t.absDependencies=i},19683:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessorNodeDependencies=void 0;var n=r(36991),a=r(10847),i=r(59884),o={NodeDependencies:n.NodeDependencies,subsetDependencies:a.subsetDependencies,createAccessorNode:i.createAccessorNode};t.AccessorNodeDependencies=o},14288:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acosDependencies=void 0;var n=r(84011),a=r(34931),i=r(59884),o={ComplexDependencies:n.ComplexDependencies,typedDependencies:a.typedDependencies,createAcos:i.createAcos};t.acosDependencies=o},38280:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acoshDependencies=void 0;var n=r(84011),a=r(34931),i=r(59884),o={ComplexDependencies:n.ComplexDependencies,typedDependencies:a.typedDependencies,createAcosh:i.createAcosh};t.acoshDependencies=o},26818:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acotDependencies=void 0;var n=r(67080),a=r(34931),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:a.typedDependencies,createAcot:i.createAcot};t.acotDependencies=o},49190:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acothDependencies=void 0;var n=r(67080),a=r(84011),i=r(34931),o=r(59884),s={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:a.ComplexDependencies,typedDependencies:i.typedDependencies,createAcoth:o.createAcoth};t.acothDependencies=s},82899:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acscDependencies=void 0;var n=r(67080),a=r(84011),i=r(34931),o=r(59884),s={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:a.ComplexDependencies,typedDependencies:i.typedDependencies,createAcsc:o.createAcsc};t.acscDependencies=s},94020:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acschDependencies=void 0;var n=r(67080),a=r(34931),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:a.typedDependencies,createAcsch:i.createAcsch};t.acschDependencies=o},25540:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDependencies=void 0;var n=r(55511),a=r(29027),i=r(33237),o=r(41498),s=r(23058),l=r(34931),c=r(59884),u={DenseMatrixDependencies:n.DenseMatrixDependencies,SparseMatrixDependencies:a.SparseMatrixDependencies,addScalarDependencies:i.addScalarDependencies,equalScalarDependencies:o.equalScalarDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:l.typedDependencies,createAdd:c.createAdd};t.addDependencies=u},33237:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addScalarDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createAddScalar:a.createAddScalar};t.addScalarDependencies=i},67409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.andDependencies=void 0;var n=r(41498),a=r(23058),i=r(19352),o=r(34931),s=r(89767),l=r(59884),c={equalScalarDependencies:n.equalScalarDependencies,matrixDependencies:a.matrixDependencies,notDependencies:i.notDependencies,typedDependencies:o.typedDependencies,zerosDependencies:s.zerosDependencies,createAnd:l.createAnd};t.andDependencies=c},69979:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyDependencies=void 0;var n=r(19313),a=r(34931),i=r(59884),o={isIntegerDependencies:n.isIntegerDependencies,typedDependencies:a.typedDependencies,createApply:i.createApply};t.applyDependencies=o},50403:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyTransformDependencies=void 0;var n=r(19313),a=r(34931),i=r(59884),o={isIntegerDependencies:n.isIntegerDependencies,typedDependencies:a.typedDependencies,createApplyTransform:i.createApplyTransform};t.applyTransformDependencies=o},16847:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createArg:a.createArg};t.argDependencies=i},87439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayNodeDependencies=void 0;var n=r(36991),a=r(59884),i={NodeDependencies:n.NodeDependencies,createArrayNode:a.createArrayNode};t.ArrayNodeDependencies=i},98377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asecDependencies=void 0;var n=r(67080),a=r(84011),i=r(34931),o=r(59884),s={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:a.ComplexDependencies,typedDependencies:i.typedDependencies,createAsec:o.createAsec};t.asecDependencies=s},20553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asechDependencies=void 0;var n=r(67080),a=r(84011),i=r(34931),o=r(59884),s={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:a.ComplexDependencies,typedDependencies:i.typedDependencies,createAsech:o.createAsech};t.asechDependencies=s},96200:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asinDependencies=void 0;var n=r(84011),a=r(34931),i=r(59884),o={ComplexDependencies:n.ComplexDependencies,typedDependencies:a.typedDependencies,createAsin:i.createAsin};t.asinDependencies=o},38466:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asinhDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createAsinh:a.createAsinh};t.asinhDependencies=i},95571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AssignmentNodeDependencies=void 0;var n=r(23058),a=r(36991),i=r(10847),o=r(59884),s={matrixDependencies:n.matrixDependencies,NodeDependencies:a.NodeDependencies,subsetDependencies:i.subsetDependencies,createAssignmentNode:o.createAssignmentNode};t.AssignmentNodeDependencies=s},21642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atanDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createAtan:a.createAtan};t.atanDependencies=i},62138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atan2Dependencies=void 0;var n=r(67080),a=r(55511),i=r(41498),o=r(23058),s=r(34931),l=r(59884),c={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:a.DenseMatrixDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:s.typedDependencies,createAtan2:l.createAtan2};t.atan2Dependencies=c},52367:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atanhDependencies=void 0;var n=r(84011),a=r(34931),i=r(59884),o={ComplexDependencies:n.ComplexDependencies,typedDependencies:a.typedDependencies,createAtanh:i.createAtanh};t.atanhDependencies=o},12063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atomicMassDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createAtomicMass:i.createAtomicMass};t.atomicMassDependencies=o},95887:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.avogadroDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createAvogadro:i.createAvogadro};t.avogadroDependencies=o},99867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bellNumbersDependencies=void 0;var n=r(33237),a=r(19313),i=r(20962),o=r(36010),s=r(34931),l=r(59884),c={addScalarDependencies:n.addScalarDependencies,isIntegerDependencies:a.isIntegerDependencies,isNegativeDependencies:i.isNegativeDependencies,stirlingS2Dependencies:o.stirlingS2Dependencies,typedDependencies:s.typedDependencies,createBellNumbers:l.createBellNumbers};t.bellNumbersDependencies=c},67080:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BigNumberDependencies=void 0;var n={createBigNumberClass:r(59884).createBigNumberClass};t.BigNumberDependencies=n},24785:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bignumberDependencies=void 0;var n=r(67080),a=r(34931),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:a.typedDependencies,createBignumber:i.createBignumber};t.bignumberDependencies=o},91251:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.binDependencies=void 0;var n=r(20178),a=r(34931),i=r(59884),o={formatDependencies:n.formatDependencies,typedDependencies:a.typedDependencies,createBin:i.createBin};t.binDependencies=o},69828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitAndDependencies=void 0;var n=r(41498),a=r(23058),i=r(34931),o=r(59884),s={equalScalarDependencies:n.equalScalarDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createBitAnd:o.createBitAnd};t.bitAndDependencies=s},37112:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitNotDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createBitNot:a.createBitNot};t.bitNotDependencies=i},58063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitOrDependencies=void 0;var n=r(55511),a=r(41498),i=r(23058),o=r(34931),s=r(59884),l={DenseMatrixDependencies:n.DenseMatrixDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:o.typedDependencies,createBitOr:s.createBitOr};t.bitOrDependencies=l},93294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitXorDependencies=void 0;var n=r(55511),a=r(23058),i=r(34931),o=r(59884),s={DenseMatrixDependencies:n.DenseMatrixDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createBitXor:o.createBitXor};t.bitXorDependencies=s},41789:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlockNodeDependencies=void 0;var n=r(36991),a=r(42267),i=r(59884),o={NodeDependencies:n.NodeDependencies,ResultSetDependencies:a.ResultSetDependencies,createBlockNode:i.createBlockNode};t.BlockNodeDependencies=o},12218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bohrMagnetonDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createBohrMagneton:i.createBohrMagneton};t.bohrMagnetonDependencies=o},80306:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bohrRadiusDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createBohrRadius:i.createBohrRadius};t.bohrRadiusDependencies=o},89169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boltzmannDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createBoltzmann:i.createBoltzmann};t.boltzmannDependencies=o},88067:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.booleanDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createBoolean:a.createBoolean};t.booleanDependencies=i},20059:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catalanDependencies=void 0;var n=r(33237),a=r(41467),i=r(68115),o=r(19313),s=r(20962),l=r(96062),c=r(34931),u=r(59884),f={addScalarDependencies:n.addScalarDependencies,combinationsDependencies:a.combinationsDependencies,divideScalarDependencies:i.divideScalarDependencies,isIntegerDependencies:o.isIntegerDependencies,isNegativeDependencies:s.isNegativeDependencies,multiplyScalarDependencies:l.multiplyScalarDependencies,typedDependencies:c.typedDependencies,createCatalan:u.createCatalan};t.catalanDependencies=f},84972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cbrtDependencies=void 0;var n=r(67080),a=r(84011),i=r(57068),o=r(20962),s=r(23058),l=r(34931),c=r(63697),u=r(59884),f={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:a.ComplexDependencies,FractionDependencies:i.FractionDependencies,isNegativeDependencies:o.isNegativeDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:l.typedDependencies,unaryMinusDependencies:c.unaryMinusDependencies,createCbrt:u.createCbrt};t.cbrtDependencies=f},48194:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ceilDependencies=void 0;var n=r(41498),a=r(23058),i=r(58684),o=r(34931),s=r(59884),l={equalScalarDependencies:n.equalScalarDependencies,matrixDependencies:a.matrixDependencies,roundDependencies:i.roundDependencies,typedDependencies:o.typedDependencies,createCeil:s.createCeil};t.ceilDependencies=l},15017:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.chainDependencies=void 0;var n=r(74941),a=r(34931),i=r(59884),o={ChainDependencies:n.ChainDependencies,typedDependencies:a.typedDependencies,createChain:i.createChain};t.chainDependencies=o},74941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChainDependencies=void 0;var n={createChainClass:r(59884).createChainClass};t.ChainDependencies=n},73278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.classicalElectronRadiusDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createClassicalElectronRadius:i.createClassicalElectronRadius};t.classicalElectronRadiusDependencies=o},4211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createClone:a.createClone};t.cloneDependencies=i},24436:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.columnDependencies=void 0;var n=r(60755),a=r(23058),i=r(25169),o=r(34931),s=r(59884),l={IndexDependencies:n.IndexDependencies,matrixDependencies:a.matrixDependencies,rangeDependencies:i.rangeDependencies,typedDependencies:o.typedDependencies,createColumn:s.createColumn};t.columnDependencies=l},76480:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.columnTransformDependencies=void 0;var n=r(60755),a=r(23058),i=r(25169),o=r(34931),s=r(59884),l={IndexDependencies:n.IndexDependencies,matrixDependencies:a.matrixDependencies,rangeDependencies:i.rangeDependencies,typedDependencies:o.typedDependencies,createColumnTransform:s.createColumnTransform};t.columnTransformDependencies=l},41467:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combinationsDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createCombinations:a.createCombinations};t.combinationsDependencies=i},65859:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combinationsWithRepDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createCombinationsWithRep:a.createCombinationsWithRep};t.combinationsWithRepDependencies=i},44070:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareDependencies=void 0;var n=r(67080),a=r(55511),i=r(57068),o=r(41498),s=r(23058),l=r(34931),c=r(59884),u={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:a.DenseMatrixDependencies,FractionDependencies:i.FractionDependencies,equalScalarDependencies:o.equalScalarDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:l.typedDependencies,createCompare:c.createCompare};t.compareDependencies=u},18103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareNaturalDependencies=void 0;var n=r(44070),a=r(34931),i=r(59884),o={compareDependencies:n.compareDependencies,typedDependencies:a.typedDependencies,createCompareNatural:i.createCompareNatural};t.compareNaturalDependencies=o},59792:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareTextDependencies=void 0;var n=r(23058),a=r(34931),i=r(59884),o={matrixDependencies:n.matrixDependencies,typedDependencies:a.typedDependencies,createCompareText:i.createCompareText};t.compareTextDependencies=o},81119:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileDependencies=void 0;var n=r(13386),a=r(34931),i=r(59884),o={parseDependencies:n.parseDependencies,typedDependencies:a.typedDependencies,createCompile:i.createCompile};t.compileDependencies=o},85103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.complexDependencies=void 0;var n=r(84011),a=r(34931),i=r(59884),o={ComplexDependencies:n.ComplexDependencies,typedDependencies:a.typedDependencies,createComplex:i.createComplex};t.complexDependencies=o},84011:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComplexDependencies=void 0;var n={createComplexClass:r(59884).createComplexClass};t.ComplexDependencies=n},36250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compositionDependencies=void 0;var n=r(33237),a=r(41467),i=r(19313),o=r(20962),s=r(61089),l=r(57568),c=r(34931),u=r(59884),f={addScalarDependencies:n.addScalarDependencies,combinationsDependencies:a.combinationsDependencies,isIntegerDependencies:i.isIntegerDependencies,isNegativeDependencies:o.isNegativeDependencies,isPositiveDependencies:s.isPositiveDependencies,largerDependencies:l.largerDependencies,typedDependencies:c.typedDependencies,createComposition:u.createComposition};t.compositionDependencies=f},25590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatDependencies=void 0;var n=r(19313),a=r(23058),i=r(34931),o=r(59884),s={isIntegerDependencies:n.isIntegerDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createConcat:o.createConcat};t.concatDependencies=s},38057:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatTransformDependencies=void 0;var n=r(19313),a=r(23058),i=r(34931),o=r(59884),s={isIntegerDependencies:n.isIntegerDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createConcatTransform:o.createConcatTransform};t.concatTransformDependencies=s},13769:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConditionalNodeDependencies=void 0;var n=r(36991),a=r(59884),i={NodeDependencies:n.NodeDependencies,createConditionalNode:a.createConditionalNode};t.ConditionalNodeDependencies=i},70262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conductanceQuantumDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createConductanceQuantum:i.createConductanceQuantum};t.conductanceQuantumDependencies=o},19620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conjDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createConj:a.createConj};t.conjDependencies=i},78321:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConstantNodeDependencies=void 0;var n=r(36991),a=r(59884),i={NodeDependencies:n.NodeDependencies,createConstantNode:a.createConstantNode};t.ConstantNodeDependencies=i},23511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cosDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createCos:a.createCos};t.cosDependencies=i},50188:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coshDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createCosh:a.createCosh};t.coshDependencies=i},93355:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cotDependencies=void 0;var n=r(67080),a=r(34931),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:a.typedDependencies,createCot:i.createCot};t.cotDependencies=o},82267:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cothDependencies=void 0;var n=r(67080),a=r(34931),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:a.typedDependencies,createCoth:i.createCoth};t.cothDependencies=o},81314:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coulombDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createCoulomb:i.createCoulomb};t.coulombDependencies=o},67968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.countDependencies=void 0;var n=r(7555),a=r(51931),i=r(34931),o=r(59884),s={prodDependencies:n.prodDependencies,sizeDependencies:a.sizeDependencies,typedDependencies:i.typedDependencies,createCount:o.createCount};t.countDependencies=s},84562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnitDependencies=void 0;var n=r(51455),a=r(34931),i=r(59884),o={UnitDependencies:n.UnitDependencies,typedDependencies:a.typedDependencies,createCreateUnit:i.createCreateUnit};t.createUnitDependencies=o},70201:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crossDependencies=void 0;var n=r(23058),a=r(54779),i=r(53885),o=r(34931),s=r(59884),l={matrixDependencies:n.matrixDependencies,multiplyDependencies:a.multiplyDependencies,subtractDependencies:i.subtractDependencies,typedDependencies:o.typedDependencies,createCross:s.createCross};t.crossDependencies=l},85636:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cscDependencies=void 0;var n=r(67080),a=r(34931),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:a.typedDependencies,createCsc:i.createCsc};t.cscDependencies=o},62691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cschDependencies=void 0;var n=r(67080),a=r(34931),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:a.typedDependencies,createCsch:i.createCsch};t.cschDependencies=o},57097:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ctransposeDependencies=void 0;var n=r(19620),a=r(2246),i=r(34931),o=r(59884),s={conjDependencies:n.conjDependencies,transposeDependencies:a.transposeDependencies,typedDependencies:i.typedDependencies,createCtranspose:o.createCtranspose};t.ctransposeDependencies=s},40515:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cubeDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createCube:a.createCube};t.cubeDependencies=i},5315:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqualDependencies=void 0;var n=r(45405),a=r(34931),i=r(59884),o={equalDependencies:n.equalDependencies,typedDependencies:a.typedDependencies,createDeepEqual:i.createDeepEqual};t.deepEqualDependencies=o},55511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DenseMatrixDependencies=void 0;var n=r(1017),a=r(59884),i={MatrixDependencies:n.MatrixDependencies,createDenseMatrixClass:a.createDenseMatrixClass};t.DenseMatrixDependencies=i},45064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.derivativeDependencies=void 0;var n=r(78321),a=r(51580),i=r(65392),o=r(55911),s=r(72457),l=r(45405),c=r(20713),u=r(47046),f=r(13386),p=r(73879),h=r(34931),d=r(59884),m={ConstantNodeDependencies:n.ConstantNodeDependencies,FunctionNodeDependencies:a.FunctionNodeDependencies,OperatorNodeDependencies:i.OperatorNodeDependencies,ParenthesisNodeDependencies:o.ParenthesisNodeDependencies,SymbolNodeDependencies:s.SymbolNodeDependencies,equalDependencies:l.equalDependencies,isZeroDependencies:c.isZeroDependencies,numericDependencies:u.numericDependencies,parseDependencies:f.parseDependencies,simplifyDependencies:p.simplifyDependencies,typedDependencies:h.typedDependencies,createDerivative:d.createDerivative};t.derivativeDependencies=m},1849:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.detDependencies=void 0;var n=r(72369),a=r(23058),i=r(54779),o=r(53885),s=r(34931),l=r(63697),c=r(59884),u={lupDependencies:n.lupDependencies,matrixDependencies:a.matrixDependencies,multiplyDependencies:i.multiplyDependencies,subtractDependencies:o.subtractDependencies,typedDependencies:s.typedDependencies,unaryMinusDependencies:l.unaryMinusDependencies,createDet:c.createDet};t.detDependencies=u},65063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deuteronMassDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createDeuteronMass:i.createDeuteronMass};t.deuteronMassDependencies=o},15038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diagDependencies=void 0;var n=r(55511),a=r(29027),i=r(23058),o=r(34931),s=r(59884),l={DenseMatrixDependencies:n.DenseMatrixDependencies,SparseMatrixDependencies:a.SparseMatrixDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:o.typedDependencies,createDiag:s.createDiag};t.diagDependencies=l},53449:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffDependencies=void 0;var n=r(23058),a=r(42885),i=r(53885),o=r(34931),s=r(59884),l={matrixDependencies:n.matrixDependencies,numberDependencies:a.numberDependencies,subtractDependencies:i.subtractDependencies,typedDependencies:o.typedDependencies,createDiff:s.createDiff};t.diffDependencies=l},46977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffTransformDependencies=void 0;var n=r(24785),a=r(23058),i=r(42885),o=r(53885),s=r(34931),l=r(59884),c={bignumberDependencies:n.bignumberDependencies,matrixDependencies:a.matrixDependencies,numberDependencies:i.numberDependencies,subtractDependencies:o.subtractDependencies,typedDependencies:s.typedDependencies,createDiffTransform:l.createDiffTransform};t.diffTransformDependencies=c},59849:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distanceDependencies=void 0;var n=r(14126),a=r(33237),i=r(68115),o=r(96062),s=r(26786),l=r(53885),c=r(34931),u=r(63697),f=r(59884),p={absDependencies:n.absDependencies,addScalarDependencies:a.addScalarDependencies,divideScalarDependencies:i.divideScalarDependencies,multiplyScalarDependencies:o.multiplyScalarDependencies,sqrtDependencies:s.sqrtDependencies,subtractDependencies:l.subtractDependencies,typedDependencies:c.typedDependencies,unaryMinusDependencies:u.unaryMinusDependencies,createDistance:f.createDistance};t.distanceDependencies=p},62640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.divideDependencies=void 0;var n=r(68115),a=r(41498),i=r(73336),o=r(23058),s=r(54779),l=r(34931),c=r(59884),u={divideScalarDependencies:n.divideScalarDependencies,equalScalarDependencies:a.equalScalarDependencies,invDependencies:i.invDependencies,matrixDependencies:o.matrixDependencies,multiplyDependencies:s.multiplyDependencies,typedDependencies:l.typedDependencies,createDivide:c.createDivide};t.divideDependencies=u},68115:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.divideScalarDependencies=void 0;var n=r(47046),a=r(34931),i=r(59884),o={numericDependencies:n.numericDependencies,typedDependencies:a.typedDependencies,createDivideScalar:i.createDivideScalar};t.divideScalarDependencies=o},42752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotDependencies=void 0;var n=r(33237),a=r(19620),i=r(96062),o=r(51931),s=r(34931),l=r(59884),c={addScalarDependencies:n.addScalarDependencies,conjDependencies:a.conjDependencies,multiplyScalarDependencies:i.multiplyScalarDependencies,sizeDependencies:o.sizeDependencies,typedDependencies:s.typedDependencies,createDot:l.createDot};t.dotDependencies=c},57924:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotDivideDependencies=void 0;var n=r(55511),a=r(68115),i=r(41498),o=r(23058),s=r(34931),l=r(59884),c={DenseMatrixDependencies:n.DenseMatrixDependencies,divideScalarDependencies:a.divideScalarDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:s.typedDependencies,createDotDivide:l.createDotDivide};t.dotDivideDependencies=c},29762:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotMultiplyDependencies=void 0;var n=r(41498),a=r(23058),i=r(96062),o=r(34931),s=r(59884),l={equalScalarDependencies:n.equalScalarDependencies,matrixDependencies:a.matrixDependencies,multiplyScalarDependencies:i.multiplyScalarDependencies,typedDependencies:o.typedDependencies,createDotMultiply:s.createDotMultiply};t.dotMultiplyDependencies=l},42407:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotPowDependencies=void 0;var n=r(55511),a=r(41498),i=r(23058),o=r(6817),s=r(34931),l=r(59884),c={DenseMatrixDependencies:n.DenseMatrixDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:i.matrixDependencies,powDependencies:o.powDependencies,typedDependencies:s.typedDependencies,createDotPow:l.createDotPow};t.dotPowDependencies=c},88775:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.eDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createE:a.createE};t.eDependencies=i},32061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.efimovFactorDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createEfimovFactor:a.createEfimovFactor};t.efimovFactorDependencies=i},44765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.eigsDependencies=void 0;var n=r(14126),a=r(25540),i=r(33237),o=r(21642),s=r(24785),l=r(24436),c=r(85103),u=r(23511),f=r(15038),p=r(68115),h=r(42752),d=r(45405),m=r(59779),g=r(34317),y=r(73336),v=r(57568),b=r(23058),x=r(29691),_=r(54779),w=r(96062),k=r(42885),D=r(47268),T=r(22264),A=r(6860),S=r(11041),M=r(26786),E=r(53885),C=r(34931),N=r(98221),O=r(99401),I=r(59884),P={absDependencies:n.absDependencies,addDependencies:a.addDependencies,addScalarDependencies:i.addScalarDependencies,atanDependencies:o.atanDependencies,bignumberDependencies:s.bignumberDependencies,columnDependencies:l.columnDependencies,complexDependencies:c.complexDependencies,cosDependencies:u.cosDependencies,diagDependencies:f.diagDependencies,divideScalarDependencies:p.divideScalarDependencies,dotDependencies:h.dotDependencies,equalDependencies:d.equalDependencies,flattenDependencies:m.flattenDependencies,imDependencies:g.imDependencies,invDependencies:y.invDependencies,largerDependencies:v.largerDependencies,matrixDependencies:b.matrixDependencies,matrixFromColumnsDependencies:x.matrixFromColumnsDependencies,multiplyDependencies:_.multiplyDependencies,multiplyScalarDependencies:w.multiplyScalarDependencies,numberDependencies:k.numberDependencies,qrDependencies:D.qrDependencies,reDependencies:T.reDependencies,sinDependencies:A.sinDependencies,smallerDependencies:S.smallerDependencies,sqrtDependencies:M.sqrtDependencies,subtractDependencies:E.subtractDependencies,typedDependencies:C.typedDependencies,usolveDependencies:N.usolveDependencies,usolveAllDependencies:O.usolveAllDependencies,createEigs:I.createEigs};t.eigsDependencies=P},89411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.electricConstantDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createElectricConstant:i.createElectricConstant};t.electricConstantDependencies=o},67375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.electronMassDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createElectronMass:i.createElectronMass};t.electronMassDependencies=o},99999:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementaryChargeDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createElementaryCharge:i.createElementaryCharge};t.elementaryChargeDependencies=o},45405:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equalDependencies=void 0;var n=r(55511),a=r(41498),i=r(23058),o=r(34931),s=r(59884),l={DenseMatrixDependencies:n.DenseMatrixDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:o.typedDependencies,createEqual:s.createEqual};t.equalDependencies=l},41498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equalScalarDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createEqualScalar:a.createEqualScalar};t.equalScalarDependencies=i},5831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equalTextDependencies=void 0;var n=r(59792),a=r(20713),i=r(34931),o=r(59884),s={compareTextDependencies:n.compareTextDependencies,isZeroDependencies:a.isZeroDependencies,typedDependencies:i.typedDependencies,createEqualText:o.createEqualText};t.equalTextDependencies=s},2909:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.erfDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createErf:a.createErf};t.erfDependencies=i},72704:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateDependencies=void 0;var n=r(13386),a=r(34931),i=r(59884),o={parseDependencies:n.parseDependencies,typedDependencies:a.typedDependencies,createEvaluate:i.createEvaluate};t.evaluateDependencies=o},91578:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createExp:a.createExp};t.expDependencies=i},74262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expmDependencies=void 0;var n=r(14126),a=r(25540),i=r(52977),o=r(73336),s=r(54779),l=r(34931),c=r(59884),u={absDependencies:n.absDependencies,addDependencies:a.addDependencies,identityDependencies:i.identityDependencies,invDependencies:o.invDependencies,multiplyDependencies:s.multiplyDependencies,typedDependencies:l.typedDependencies,createExpm:c.createExpm};t.expmDependencies=u},48346:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expm1Dependencies=void 0;var n=r(84011),a=r(34931),i=r(59884),o={ComplexDependencies:n.ComplexDependencies,typedDependencies:a.typedDependencies,createExpm1:i.createExpm1};t.expm1Dependencies=o},21574:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.factorialDependencies=void 0;var n=r(73965),a=r(34931),i=r(59884),o={gammaDependencies:n.gammaDependencies,typedDependencies:a.typedDependencies,createFactorial:i.createFactorial};t.factorialDependencies=o},15942:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.falseDependencies=void 0;var n={createFalse:r(59884).createFalse};t.falseDependencies=n},23099:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.faradayDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createFaraday:i.createFaraday};t.faradayDependencies=o},13116:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fermiCouplingDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createFermiCoupling:i.createFermiCoupling};t.fermiCouplingDependencies=o},13835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FibonacciHeapDependencies=void 0;var n=r(57568),a=r(11041),i=r(59884),o={largerDependencies:n.largerDependencies,smallerDependencies:a.smallerDependencies,createFibonacciHeapClass:i.createFibonacciHeapClass};t.FibonacciHeapDependencies=o},56089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createFilter:a.createFilter};t.filterDependencies=i},47887:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterTransformDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createFilterTransform:a.createFilterTransform};t.filterTransformDependencies=i},22041:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fineStructureDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createFineStructure:a.createFineStructure};t.fineStructureDependencies=i},65002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firstRadiationDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createFirstRadiation:i.createFirstRadiation};t.firstRadiationDependencies=o},57195:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fixDependencies=void 0;var n=r(84011),a=r(48194),i=r(72720),o=r(23058),s=r(34931),l=r(59884),c={ComplexDependencies:n.ComplexDependencies,ceilDependencies:a.ceilDependencies,floorDependencies:i.floorDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:s.typedDependencies,createFix:l.createFix};t.fixDependencies=c},59779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenDependencies=void 0;var n=r(23058),a=r(34931),i=r(59884),o={matrixDependencies:n.matrixDependencies,typedDependencies:a.typedDependencies,createFlatten:i.createFlatten};t.flattenDependencies=o},72720:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.floorDependencies=void 0;var n=r(41498),a=r(23058),i=r(58684),o=r(34931),s=r(59884),l={equalScalarDependencies:n.equalScalarDependencies,matrixDependencies:a.matrixDependencies,roundDependencies:i.roundDependencies,typedDependencies:o.typedDependencies,createFloor:s.createFloor};t.floorDependencies=l},29838:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forEachDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createForEach:a.createForEach};t.forEachDependencies=i},82123:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forEachTransformDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createForEachTransform:a.createForEachTransform};t.forEachTransformDependencies=i},20178:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createFormat:a.createFormat};t.formatDependencies=i},99656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fractionDependencies=void 0;var n=r(57068),a=r(34931),i=r(59884),o={FractionDependencies:n.FractionDependencies,typedDependencies:a.typedDependencies,createFraction:i.createFraction};t.fractionDependencies=o},57068:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FractionDependencies=void 0;var n={createFractionClass:r(59884).createFractionClass};t.FractionDependencies=n},10722:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FunctionAssignmentNodeDependencies=void 0;var n=r(36991),a=r(34931),i=r(59884),o={NodeDependencies:n.NodeDependencies,typedDependencies:a.typedDependencies,createFunctionAssignmentNode:i.createFunctionAssignmentNode};t.FunctionAssignmentNodeDependencies=o},51580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FunctionNodeDependencies=void 0;var n=r(36991),a=r(72457),i=r(59884),o={NodeDependencies:n.NodeDependencies,SymbolNodeDependencies:a.SymbolNodeDependencies,createFunctionNode:i.createFunctionNode};t.FunctionNodeDependencies=o},73965:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gammaDependencies=void 0;var n=r(67080),a=r(84011),i=r(96062),o=r(6817),s=r(34931),l=r(59884),c={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:a.ComplexDependencies,multiplyScalarDependencies:i.multiplyScalarDependencies,powDependencies:o.powDependencies,typedDependencies:s.typedDependencies,createGamma:l.createGamma};t.gammaDependencies=c},66879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gasConstantDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createGasConstant:i.createGasConstant};t.gasConstantDependencies=o},20865:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gcdDependencies=void 0;var n=r(67080),a=r(55511),i=r(41498),o=r(23058),s=r(34931),l=r(59884),c={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:a.DenseMatrixDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:s.typedDependencies,createGcd:l.createGcd};t.gcdDependencies=c},34064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMatrixDataTypeDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createGetMatrixDataType:a.createGetMatrixDataType};t.getMatrixDataTypeDependencies=i},51671:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gravitationConstantDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createGravitationConstant:i.createGravitationConstant};t.gravitationConstantDependencies=o},3868:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gravityDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createGravity:i.createGravity};t.gravityDependencies=o},55291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hartreeEnergyDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createHartreeEnergy:i.createHartreeEnergy};t.hartreeEnergyDependencies=o},29483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasNumericValueDependencies=void 0;var n=r(96617),a=r(34931),i=r(59884),o={isNumericDependencies:n.isNumericDependencies,typedDependencies:a.typedDependencies,createHasNumericValue:i.createHasNumericValue};t.hasNumericValueDependencies=o},14087:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpDependencies=void 0;var n=r(33159),a=r(34931),i=r(59884),o={HelpDependencies:n.HelpDependencies,typedDependencies:a.typedDependencies,createHelp:i.createHelp};t.helpDependencies=o},33159:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HelpDependencies=void 0;var n=r(13386),a=r(59884),i={parseDependencies:n.parseDependencies,createHelpClass:a.createHelpClass};t.HelpDependencies=i},36481:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexDependencies=void 0;var n=r(20178),a=r(34931),i=r(59884),o={formatDependencies:n.formatDependencies,typedDependencies:a.typedDependencies,createHex:i.createHex};t.hexDependencies=o},51378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hypotDependencies=void 0;var n=r(14126),a=r(33237),i=r(68115),o=r(61089),s=r(96062),l=r(11041),c=r(26786),u=r(34931),f=r(59884),p={absDependencies:n.absDependencies,addScalarDependencies:a.addScalarDependencies,divideScalarDependencies:i.divideScalarDependencies,isPositiveDependencies:o.isPositiveDependencies,multiplyScalarDependencies:s.multiplyScalarDependencies,smallerDependencies:l.smallerDependencies,sqrtDependencies:c.sqrtDependencies,typedDependencies:u.typedDependencies,createHypot:f.createHypot};t.hypotDependencies=p},17776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iDependencies=void 0;var n=r(84011),a=r(59884),i={ComplexDependencies:n.ComplexDependencies,createI:a.createI};t.iDependencies=i},52977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identityDependencies=void 0;var n=r(67080),a=r(55511),i=r(29027),o=r(23058),s=r(34931),l=r(59884),c={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:a.DenseMatrixDependencies,SparseMatrixDependencies:i.SparseMatrixDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:s.typedDependencies,createIdentity:l.createIdentity};t.identityDependencies=c},34317:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createIm:a.createIm};t.imDependencies=i},52350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImmutableDenseMatrixDependencies=void 0;var n=r(55511),a=r(11041),i=r(59884),o={DenseMatrixDependencies:n.DenseMatrixDependencies,smallerDependencies:a.smallerDependencies,createImmutableDenseMatrixClass:i.createImmutableDenseMatrixClass};t.ImmutableDenseMatrixDependencies=o},30514:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indexDependencies=void 0;var n=r(60755),a=r(34931),i=r(59884),o={IndexDependencies:n.IndexDependencies,typedDependencies:a.typedDependencies,createIndex:i.createIndex};t.indexDependencies=o},60755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndexDependencies=void 0;var n=r(52350),a=r(59884),i={ImmutableDenseMatrixDependencies:n.ImmutableDenseMatrixDependencies,createIndexClass:a.createIndexClass};t.IndexDependencies=i},22497:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndexNodeDependencies=void 0;var n=r(36991),a=r(97243),i=r(51931),o=r(59884),s={NodeDependencies:n.NodeDependencies,RangeDependencies:a.RangeDependencies,sizeDependencies:i.sizeDependencies,createIndexNode:o.createIndexNode};t.IndexNodeDependencies=s},26591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indexTransformDependencies=void 0;var n=r(60755),a=r(59884),i={IndexDependencies:n.IndexDependencies,createIndexTransform:a.createIndexTransform};t.indexTransformDependencies=i},40302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfinityDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createInfinity:a.createInfinity};t.InfinityDependencies=i},8908:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.intersectDependencies=void 0;var n=r(14126),a=r(25540),i=r(33237),o=r(68115),s=r(41498),l=r(59779),c=r(23058),u=r(54779),f=r(96062),p=r(11041),h=r(53885),d=r(34931),m=r(59884),g={absDependencies:n.absDependencies,addDependencies:a.addDependencies,addScalarDependencies:i.addScalarDependencies,divideScalarDependencies:o.divideScalarDependencies,equalScalarDependencies:s.equalScalarDependencies,flattenDependencies:l.flattenDependencies,matrixDependencies:c.matrixDependencies,multiplyDependencies:u.multiplyDependencies,multiplyScalarDependencies:f.multiplyScalarDependencies,smallerDependencies:p.smallerDependencies,subtractDependencies:h.subtractDependencies,typedDependencies:d.typedDependencies,createIntersect:m.createIntersect};t.intersectDependencies=g},73336:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invDependencies=void 0;var n=r(14126),a=r(33237),i=r(1849),o=r(68115),s=r(52977),l=r(23058),c=r(54779),u=r(34931),f=r(63697),p=r(59884),h={absDependencies:n.absDependencies,addScalarDependencies:a.addScalarDependencies,detDependencies:i.detDependencies,divideScalarDependencies:o.divideScalarDependencies,identityDependencies:s.identityDependencies,matrixDependencies:l.matrixDependencies,multiplyDependencies:c.multiplyDependencies,typedDependencies:u.typedDependencies,unaryMinusDependencies:f.unaryMinusDependencies,createInv:p.createInv};t.invDependencies=h},80263:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inverseConductanceQuantumDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createInverseConductanceQuantum:i.createInverseConductanceQuantum};t.inverseConductanceQuantumDependencies=o},19313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIntegerDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createIsInteger:a.createIsInteger};t.isIntegerDependencies=i},52601:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNaNDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createIsNaN:a.createIsNaN};t.isNaNDependencies=i},20962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNegativeDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createIsNegative:a.createIsNegative};t.isNegativeDependencies=i},96617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNumericDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createIsNumeric:a.createIsNumeric};t.isNumericDependencies=i},61089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPositiveDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createIsPositive:a.createIsPositive};t.isPositiveDependencies=i},3677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPrimeDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createIsPrime:a.createIsPrime};t.isPrimeDependencies=i},20713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createIsZero:a.createIsZero};t.isZeroDependencies=i},42823:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.kldivergenceDependencies=void 0;var n=r(62640),a=r(57924),i=r(96617),o=r(72089),s=r(23058),l=r(54779),c=r(71675),u=r(34931),f=r(59884),p={divideDependencies:n.divideDependencies,dotDivideDependencies:a.dotDivideDependencies,isNumericDependencies:i.isNumericDependencies,logDependencies:o.logDependencies,matrixDependencies:s.matrixDependencies,multiplyDependencies:l.multiplyDependencies,sumDependencies:c.sumDependencies,typedDependencies:u.typedDependencies,createKldivergence:f.createKldivergence};t.kldivergenceDependencies=p},18476:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.klitzingDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createKlitzing:i.createKlitzing};t.klitzingDependencies=o},97912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.kronDependencies=void 0;var n=r(23058),a=r(96062),i=r(34931),o=r(59884),s={matrixDependencies:n.matrixDependencies,multiplyScalarDependencies:a.multiplyScalarDependencies,typedDependencies:i.typedDependencies,createKron:o.createKron};t.kronDependencies=s},10571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LN10Dependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createLN10:a.createLN10};t.LN10Dependencies=i},31179:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LN2Dependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createLN2:a.createLN2};t.LN2Dependencies=i},73825:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOG10EDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createLOG10E:a.createLOG10E};t.LOG10EDependencies=i},48063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOG2EDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createLOG2E:a.createLOG2E};t.LOG2EDependencies=i},57568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.largerDependencies=void 0;var n=r(55511),a=r(23058),i=r(34931),o=r(59884),s={DenseMatrixDependencies:n.DenseMatrixDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createLarger:o.createLarger};t.largerDependencies=s},29521:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.largerEqDependencies=void 0;var n=r(55511),a=r(23058),i=r(34931),o=r(59884),s={DenseMatrixDependencies:n.DenseMatrixDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createLargerEq:o.createLargerEq};t.largerEqDependencies=s},88519:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lcmDependencies=void 0;var n=r(41498),a=r(23058),i=r(34931),o=r(59884),s={equalScalarDependencies:n.equalScalarDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createLcm:o.createLcm};t.lcmDependencies=s},94361:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftShiftDependencies=void 0;var n=r(55511),a=r(41498),i=r(23058),o=r(34931),s=r(89767),l=r(59884),c={DenseMatrixDependencies:n.DenseMatrixDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:o.typedDependencies,zerosDependencies:s.zerosDependencies,createLeftShift:l.createLeftShift};t.leftShiftDependencies=c},72089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logDependencies=void 0;var n=r(84011),a=r(68115),i=r(34931),o=r(59884),s={ComplexDependencies:n.ComplexDependencies,divideScalarDependencies:a.divideScalarDependencies,typedDependencies:i.typedDependencies,createLog:o.createLog};t.logDependencies=s},76426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log10Dependencies=void 0;var n=r(84011),a=r(34931),i=r(59884),o={ComplexDependencies:n.ComplexDependencies,typedDependencies:a.typedDependencies,createLog10:i.createLog10};t.log10Dependencies=o},92205:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log1pDependencies=void 0;var n=r(84011),a=r(68115),i=r(72089),o=r(34931),s=r(59884),l={ComplexDependencies:n.ComplexDependencies,divideScalarDependencies:a.divideScalarDependencies,logDependencies:i.logDependencies,typedDependencies:o.typedDependencies,createLog1p:s.createLog1p};t.log1pDependencies=l},14954:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log2Dependencies=void 0;var n=r(84011),a=r(34931),i=r(59884),o={ComplexDependencies:n.ComplexDependencies,typedDependencies:a.typedDependencies,createLog2:i.createLog2};t.log2Dependencies=o},44266:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loschmidtDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createLoschmidt:i.createLoschmidt};t.loschmidtDependencies=o},18155:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lsolveDependencies=void 0;var n=r(55511),a=r(68115),i=r(41498),o=r(23058),s=r(96062),l=r(53885),c=r(34931),u=r(59884),f={DenseMatrixDependencies:n.DenseMatrixDependencies,divideScalarDependencies:a.divideScalarDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:o.matrixDependencies,multiplyScalarDependencies:s.multiplyScalarDependencies,subtractDependencies:l.subtractDependencies,typedDependencies:c.typedDependencies,createLsolve:u.createLsolve};t.lsolveDependencies=f},12759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lsolveAllDependencies=void 0;var n=r(55511),a=r(68115),i=r(41498),o=r(23058),s=r(96062),l=r(53885),c=r(34931),u=r(59884),f={DenseMatrixDependencies:n.DenseMatrixDependencies,divideScalarDependencies:a.divideScalarDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:o.matrixDependencies,multiplyScalarDependencies:s.multiplyScalarDependencies,subtractDependencies:l.subtractDependencies,typedDependencies:c.typedDependencies,createLsolveAll:u.createLsolveAll};t.lsolveAllDependencies=f},72369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lupDependencies=void 0;var n=r(55511),a=r(11856),i=r(29027),o=r(14126),s=r(33237),l=r(68115),c=r(41498),u=r(57568),f=r(23058),p=r(96062),h=r(53885),d=r(34931),m=r(63697),g=r(59884),y={DenseMatrixDependencies:n.DenseMatrixDependencies,SpaDependencies:a.SpaDependencies,SparseMatrixDependencies:i.SparseMatrixDependencies,absDependencies:o.absDependencies,addScalarDependencies:s.addScalarDependencies,divideScalarDependencies:l.divideScalarDependencies,equalScalarDependencies:c.equalScalarDependencies,largerDependencies:u.largerDependencies,matrixDependencies:f.matrixDependencies,multiplyScalarDependencies:p.multiplyScalarDependencies,subtractDependencies:h.subtractDependencies,typedDependencies:d.typedDependencies,unaryMinusDependencies:m.unaryMinusDependencies,createLup:g.createLup};t.lupDependencies=y},38646:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lusolveDependencies=void 0;var n=r(55511),a=r(18155),i=r(72369),o=r(23058),s=r(25213),l=r(34931),c=r(98221),u=r(59884),f={DenseMatrixDependencies:n.DenseMatrixDependencies,lsolveDependencies:a.lsolveDependencies,lupDependencies:i.lupDependencies,matrixDependencies:o.matrixDependencies,sluDependencies:s.sluDependencies,typedDependencies:l.typedDependencies,usolveDependencies:c.usolveDependencies,createLusolve:u.createLusolve};t.lusolveDependencies=f},66403:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.madDependencies=void 0;var n=r(14126),a=r(94604),i=r(4291),o=r(53885),s=r(34931),l=r(59884),c={absDependencies:n.absDependencies,mapDependencies:a.mapDependencies,medianDependencies:i.medianDependencies,subtractDependencies:o.subtractDependencies,typedDependencies:s.typedDependencies,createMad:l.createMad};t.madDependencies=c},83784:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.magneticConstantDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createMagneticConstant:i.createMagneticConstant};t.magneticConstantDependencies=o},92474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.magneticFluxQuantumDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createMagneticFluxQuantum:i.createMagneticFluxQuantum};t.magneticFluxQuantumDependencies=o},94604:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createMap:a.createMap};t.mapDependencies=i},93753:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTransformDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createMapTransform:a.createMapTransform};t.mapTransformDependencies=i},23058:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixDependencies=void 0;var n=r(55511),a=r(1017),i=r(29027),o=r(34931),s=r(59884),l={DenseMatrixDependencies:n.DenseMatrixDependencies,MatrixDependencies:a.MatrixDependencies,SparseMatrixDependencies:i.SparseMatrixDependencies,typedDependencies:o.typedDependencies,createMatrix:s.createMatrix};t.matrixDependencies=l},1017:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MatrixDependencies=void 0;var n={createMatrixClass:r(59884).createMatrixClass};t.MatrixDependencies=n},29691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromColumnsDependencies=void 0;var n=r(59779),a=r(23058),i=r(51931),o=r(34931),s=r(59884),l={flattenDependencies:n.flattenDependencies,matrixDependencies:a.matrixDependencies,sizeDependencies:i.sizeDependencies,typedDependencies:o.typedDependencies,createMatrixFromColumns:s.createMatrixFromColumns};t.matrixFromColumnsDependencies=l},75191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromFunctionDependencies=void 0;var n=r(20713),a=r(23058),i=r(34931),o=r(59884),s={isZeroDependencies:n.isZeroDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createMatrixFromFunction:o.createMatrixFromFunction};t.matrixFromFunctionDependencies=s},26823:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromRowsDependencies=void 0;var n=r(59779),a=r(23058),i=r(51931),o=r(34931),s=r(59884),l={flattenDependencies:n.flattenDependencies,matrixDependencies:a.matrixDependencies,sizeDependencies:i.sizeDependencies,typedDependencies:o.typedDependencies,createMatrixFromRows:s.createMatrixFromRows};t.matrixFromRowsDependencies=l},14244:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.maxDependencies=void 0;var n=r(57568),a=r(47046),i=r(34931),o=r(59884),s={largerDependencies:n.largerDependencies,numericDependencies:a.numericDependencies,typedDependencies:i.typedDependencies,createMax:o.createMax};t.maxDependencies=s},72692:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.maxTransformDependencies=void 0;var n=r(57568),a=r(47046),i=r(34931),o=r(59884),s={largerDependencies:n.largerDependencies,numericDependencies:a.numericDependencies,typedDependencies:i.typedDependencies,createMaxTransform:o.createMaxTransform};t.maxTransformDependencies=s},71246:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.meanDependencies=void 0;var n=r(25540),a=r(62640),i=r(34931),o=r(59884),s={addDependencies:n.addDependencies,divideDependencies:a.divideDependencies,typedDependencies:i.typedDependencies,createMean:o.createMean};t.meanDependencies=s},31672:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.meanTransformDependencies=void 0;var n=r(25540),a=r(62640),i=r(34931),o=r(59884),s={addDependencies:n.addDependencies,divideDependencies:a.divideDependencies,typedDependencies:i.typedDependencies,createMeanTransform:o.createMeanTransform};t.meanTransformDependencies=s},4291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.medianDependencies=void 0;var n=r(25540),a=r(44070),i=r(62640),o=r(37219),s=r(34931),l=r(59884),c={addDependencies:n.addDependencies,compareDependencies:a.compareDependencies,divideDependencies:i.divideDependencies,partitionSelectDependencies:o.partitionSelectDependencies,typedDependencies:s.typedDependencies,createMedian:l.createMedian};t.medianDependencies=c},22329:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.minDependencies=void 0;var n=r(47046),a=r(11041),i=r(34931),o=r(59884),s={numericDependencies:n.numericDependencies,smallerDependencies:a.smallerDependencies,typedDependencies:i.typedDependencies,createMin:o.createMin};t.minDependencies=s},61590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.minTransformDependencies=void 0;var n=r(47046),a=r(11041),i=r(34931),o=r(59884),s={numericDependencies:n.numericDependencies,smallerDependencies:a.smallerDependencies,typedDependencies:i.typedDependencies,createMinTransform:o.createMinTransform};t.minTransformDependencies=s},12344:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modDependencies=void 0;var n=r(55511),a=r(41498),i=r(23058),o=r(34931),s=r(59884),l={DenseMatrixDependencies:n.DenseMatrixDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:o.typedDependencies,createMod:s.createMod};t.modDependencies=l},69629:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modeDependencies=void 0;var n=r(52601),a=r(96617),i=r(34931),o=r(59884),s={isNaNDependencies:n.isNaNDependencies,isNumericDependencies:a.isNumericDependencies,typedDependencies:i.typedDependencies,createMode:o.createMode};t.modeDependencies=s},16082:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.molarMassDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createMolarMass:i.createMolarMass};t.molarMassDependencies=o},60928:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.molarMassC12Dependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createMolarMassC12:i.createMolarMassC12};t.molarMassC12Dependencies=o},91966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.molarPlanckConstantDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createMolarPlanckConstant:i.createMolarPlanckConstant};t.molarPlanckConstantDependencies=o},82018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.molarVolumeDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createMolarVolume:i.createMolarVolume};t.molarVolumeDependencies=o},41080:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multinomialDependencies=void 0;var n=r(25540),a=r(62640),i=r(21574),o=r(19313),s=r(61089),l=r(54779),c=r(34931),u=r(59884),f={addDependencies:n.addDependencies,divideDependencies:a.divideDependencies,factorialDependencies:i.factorialDependencies,isIntegerDependencies:o.isIntegerDependencies,isPositiveDependencies:s.isPositiveDependencies,multiplyDependencies:l.multiplyDependencies,typedDependencies:c.typedDependencies,createMultinomial:u.createMultinomial};t.multinomialDependencies=f},54779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiplyDependencies=void 0;var n=r(33237),a=r(42752),i=r(41498),o=r(23058),s=r(96062),l=r(34931),c=r(59884),u={addScalarDependencies:n.addScalarDependencies,dotDependencies:a.dotDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:o.matrixDependencies,multiplyScalarDependencies:s.multiplyScalarDependencies,typedDependencies:l.typedDependencies,createMultiply:c.createMultiply};t.multiplyDependencies=u},96062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiplyScalarDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createMultiplyScalar:a.createMultiplyScalar};t.multiplyScalarDependencies=i},89801:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NaNDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createNaN:a.createNaN};t.NaNDependencies=i},77965:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.neutronMassDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createNeutronMass:i.createNeutronMass};t.neutronMassDependencies=o},36991:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeDependencies=void 0;var n={createNode:r(59884).createNode};t.NodeDependencies=n},81347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normDependencies=void 0;var n=r(14126),a=r(25540),i=r(19620),o=r(57097),s=r(44765),l=r(41498),c=r(57568),u=r(23058),f=r(54779),p=r(6817),h=r(11041),d=r(26786),m=r(34931),g=r(59884),y={absDependencies:n.absDependencies,addDependencies:a.addDependencies,conjDependencies:i.conjDependencies,ctransposeDependencies:o.ctransposeDependencies,eigsDependencies:s.eigsDependencies,equalScalarDependencies:l.equalScalarDependencies,largerDependencies:c.largerDependencies,matrixDependencies:u.matrixDependencies,multiplyDependencies:f.multiplyDependencies,powDependencies:p.powDependencies,smallerDependencies:h.smallerDependencies,sqrtDependencies:d.sqrtDependencies,typedDependencies:m.typedDependencies,createNorm:g.createNorm};t.normDependencies=y},19352:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createNot:a.createNot};t.notDependencies=i},24745:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nthRootDependencies=void 0;var n=r(67080),a=r(41498),i=r(23058),o=r(34931),s=r(59884),l={BigNumberDependencies:n.BigNumberDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:o.typedDependencies,createNthRoot:s.createNthRoot};t.nthRootDependencies=l},90541:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nthRootsDependencies=void 0;var n=r(84011),a=r(68115),i=r(34931),o=r(59884),s={ComplexDependencies:n.ComplexDependencies,divideScalarDependencies:a.divideScalarDependencies,typedDependencies:i.typedDependencies,createNthRoots:o.createNthRoots};t.nthRootsDependencies=s},71931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nuclearMagnetonDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createNuclearMagneton:i.createNuclearMagneton};t.nuclearMagnetonDependencies=o},95177:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nullDependencies=void 0;var n={createNull:r(59884).createNull};t.nullDependencies=n},42885:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numberDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createNumber:a.createNumber};t.numberDependencies=i},47046:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numericDependencies=void 0;var n=r(24785),a=r(99656),i=r(42885),o=r(59884),s={bignumberDependencies:n.bignumberDependencies,fractionDependencies:a.fractionDependencies,numberDependencies:i.numberDependencies,createNumeric:o.createNumeric};t.numericDependencies=s},72556:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectNodeDependencies=void 0;var n=r(36991),a=r(59884),i={NodeDependencies:n.NodeDependencies,createObjectNode:a.createObjectNode};t.ObjectNodeDependencies=i},36623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.octDependencies=void 0;var n=r(20178),a=r(34931),i=r(59884),o={formatDependencies:n.formatDependencies,typedDependencies:a.typedDependencies,createOct:i.createOct};t.octDependencies=o},28469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onesDependencies=void 0;var n=r(67080),a=r(23058),i=r(34931),o=r(59884),s={BigNumberDependencies:n.BigNumberDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createOnes:o.createOnes};t.onesDependencies=s},65392:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorNodeDependencies=void 0;var n=r(36991),a=r(59884),i={NodeDependencies:n.NodeDependencies,createOperatorNode:a.createOperatorNode};t.OperatorNodeDependencies=i},21273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orDependencies=void 0;var n=r(55511),a=r(41498),i=r(23058),o=r(34931),s=r(59884),l={DenseMatrixDependencies:n.DenseMatrixDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:o.typedDependencies,createOr:s.createOr};t.orDependencies=l},55911:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParenthesisNodeDependencies=void 0;var n=r(36991),a=r(59884),i={NodeDependencies:n.NodeDependencies,createParenthesisNode:a.createParenthesisNode};t.ParenthesisNodeDependencies=i},13386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseDependencies=void 0;var n=r(19683),a=r(87439),i=r(95571),o=r(41789),s=r(13769),l=r(78321),c=r(10722),u=r(51580),f=r(22497),p=r(72556),h=r(65392),d=r(55911),m=r(17771),g=r(76805),y=r(72457),v=r(47046),b=r(34931),x=r(59884),_={AccessorNodeDependencies:n.AccessorNodeDependencies,ArrayNodeDependencies:a.ArrayNodeDependencies,AssignmentNodeDependencies:i.AssignmentNodeDependencies,BlockNodeDependencies:o.BlockNodeDependencies,ConditionalNodeDependencies:s.ConditionalNodeDependencies,ConstantNodeDependencies:l.ConstantNodeDependencies,FunctionAssignmentNodeDependencies:c.FunctionAssignmentNodeDependencies,FunctionNodeDependencies:u.FunctionNodeDependencies,IndexNodeDependencies:f.IndexNodeDependencies,ObjectNodeDependencies:p.ObjectNodeDependencies,OperatorNodeDependencies:h.OperatorNodeDependencies,ParenthesisNodeDependencies:d.ParenthesisNodeDependencies,RangeNodeDependencies:m.RangeNodeDependencies,RelationalNodeDependencies:g.RelationalNodeDependencies,SymbolNodeDependencies:y.SymbolNodeDependencies,numericDependencies:v.numericDependencies,typedDependencies:b.typedDependencies,createParse:x.createParse};t.parseDependencies=_},33571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parserDependencies=void 0;var n=r(84789),a=r(34931),i=r(59884),o={ParserDependencies:n.ParserDependencies,typedDependencies:a.typedDependencies,createParser:i.createParser};t.parserDependencies=o},84789:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParserDependencies=void 0;var n=r(72704),a=r(59884),i={evaluateDependencies:n.evaluateDependencies,createParserClass:a.createParserClass};t.ParserDependencies=i},37219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partitionSelectDependencies=void 0;var n=r(44070),a=r(52601),i=r(96617),o=r(34931),s=r(59884),l={compareDependencies:n.compareDependencies,isNaNDependencies:a.isNaNDependencies,isNumericDependencies:i.isNumericDependencies,typedDependencies:o.typedDependencies,createPartitionSelect:s.createPartitionSelect};t.partitionSelectDependencies=l},41811:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.permutationsDependencies=void 0;var n=r(21574),a=r(34931),i=r(59884),o={factorialDependencies:n.factorialDependencies,typedDependencies:a.typedDependencies,createPermutations:i.createPermutations};t.permutationsDependencies=o},63511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.phiDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createPhi:a.createPhi};t.phiDependencies=i},9764:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.piDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createPi:a.createPi};t.piDependencies=i},3843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickRandomDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createPickRandom:a.createPickRandom};t.pickRandomDependencies=i},39723:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckChargeDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createPlanckCharge:i.createPlanckCharge};t.planckChargeDependencies=o},42576:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckConstantDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createPlanckConstant:i.createPlanckConstant};t.planckConstantDependencies=o},52522:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckLengthDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createPlanckLength:i.createPlanckLength};t.planckLengthDependencies=o},70967:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckMassDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createPlanckMass:i.createPlanckMass};t.planckMassDependencies=o},64987:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckTemperatureDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createPlanckTemperature:i.createPlanckTemperature};t.planckTemperatureDependencies=o},83743:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckTimeDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createPlanckTime:i.createPlanckTime};t.planckTimeDependencies=o},6817:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.powDependencies=void 0;var n=r(84011),a=r(99656),i=r(52977),o=r(23058),s=r(54779),l=r(42885),c=r(34931),u=r(59884),f={ComplexDependencies:n.ComplexDependencies,fractionDependencies:a.fractionDependencies,identityDependencies:i.identityDependencies,matrixDependencies:o.matrixDependencies,multiplyDependencies:s.multiplyDependencies,numberDependencies:l.numberDependencies,typedDependencies:c.typedDependencies,createPow:u.createPow};t.powDependencies=f},82762:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createPrint:a.createPrint};t.printDependencies=i},7555:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prodDependencies=void 0;var n=r(96062),a=r(47046),i=r(34931),o=r(59884),s={multiplyScalarDependencies:n.multiplyScalarDependencies,numericDependencies:a.numericDependencies,typedDependencies:i.typedDependencies,createProd:o.createProd};t.prodDependencies=s},80509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.protonMassDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createProtonMass:i.createProtonMass};t.protonMassDependencies=o},47268:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.qrDependencies=void 0;var n=r(33237),a=r(85103),i=r(19620),o=r(68115),s=r(45405),l=r(52977),c=r(20713),u=r(23058),f=r(96062),p=r(48482),h=r(26786),d=r(53885),m=r(34931),g=r(63697),y=r(89767),v=r(59884),b={addScalarDependencies:n.addScalarDependencies,complexDependencies:a.complexDependencies,conjDependencies:i.conjDependencies,divideScalarDependencies:o.divideScalarDependencies,equalDependencies:s.equalDependencies,identityDependencies:l.identityDependencies,isZeroDependencies:c.isZeroDependencies,matrixDependencies:u.matrixDependencies,multiplyScalarDependencies:f.multiplyScalarDependencies,signDependencies:p.signDependencies,sqrtDependencies:h.sqrtDependencies,subtractDependencies:d.subtractDependencies,typedDependencies:m.typedDependencies,unaryMinusDependencies:g.unaryMinusDependencies,zerosDependencies:y.zerosDependencies,createQr:v.createQr};t.qrDependencies=b},92312:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.quantileSeqDependencies=void 0;var n=r(25540),a=r(44070),i=r(54779),o=r(37219),s=r(34931),l=r(59884),c={addDependencies:n.addDependencies,compareDependencies:a.compareDependencies,multiplyDependencies:i.multiplyDependencies,partitionSelectDependencies:o.partitionSelectDependencies,typedDependencies:s.typedDependencies,createQuantileSeq:l.createQuantileSeq};t.quantileSeqDependencies=c},98429:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.quantumOfCirculationDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createQuantumOfCirculation:i.createQuantumOfCirculation};t.quantumOfCirculationDependencies=o},28448:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createRandom:a.createRandom};t.randomDependencies=i},11729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomIntDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createRandomInt:a.createRandomInt};t.randomIntDependencies=i},25169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rangeDependencies=void 0;var n=r(24785),a=r(23058),i=r(57568),o=r(29521),s=r(11041),l=r(34652),c=r(34931),u=r(59884),f={bignumberDependencies:n.bignumberDependencies,matrixDependencies:a.matrixDependencies,largerDependencies:i.largerDependencies,largerEqDependencies:o.largerEqDependencies,smallerDependencies:s.smallerDependencies,smallerEqDependencies:l.smallerEqDependencies,typedDependencies:c.typedDependencies,createRange:u.createRange};t.rangeDependencies=f},97243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RangeDependencies=void 0;var n={createRangeClass:r(59884).createRangeClass};t.RangeDependencies=n},17771:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RangeNodeDependencies=void 0;var n=r(36991),a=r(59884),i={NodeDependencies:n.NodeDependencies,createRangeNode:a.createRangeNode};t.RangeNodeDependencies=i},37893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rangeTransformDependencies=void 0;var n=r(24785),a=r(23058),i=r(57568),o=r(29521),s=r(11041),l=r(34652),c=r(34931),u=r(59884),f={bignumberDependencies:n.bignumberDependencies,matrixDependencies:a.matrixDependencies,largerDependencies:i.largerDependencies,largerEqDependencies:o.largerEqDependencies,smallerDependencies:s.smallerDependencies,smallerEqDependencies:l.smallerEqDependencies,typedDependencies:c.typedDependencies,createRangeTransform:u.createRangeTransform};t.rangeTransformDependencies=f},59578:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rationalizeDependencies=void 0;var n=r(24785),a=r(99656),i=r(78321),o=r(51580),s=r(65392),l=r(55911),c=r(72457),u=r(25540),f=r(62640),p=r(45405),h=r(20713),d=r(54779),m=r(13386),g=r(6817),y=r(73879),v=r(53885),b=r(34931),x=r(59884),_={bignumberDependencies:n.bignumberDependencies,fractionDependencies:a.fractionDependencies,ConstantNodeDependencies:i.ConstantNodeDependencies,FunctionNodeDependencies:o.FunctionNodeDependencies,OperatorNodeDependencies:s.OperatorNodeDependencies,ParenthesisNodeDependencies:l.ParenthesisNodeDependencies,SymbolNodeDependencies:c.SymbolNodeDependencies,addDependencies:u.addDependencies,divideDependencies:f.divideDependencies,equalDependencies:p.equalDependencies,isZeroDependencies:h.isZeroDependencies,multiplyDependencies:d.multiplyDependencies,parseDependencies:m.parseDependencies,powDependencies:g.powDependencies,simplifyDependencies:y.simplifyDependencies,subtractDependencies:v.subtractDependencies,typedDependencies:b.typedDependencies,createRationalize:x.createRationalize};t.rationalizeDependencies=_},22264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createRe:a.createRe};t.reDependencies=i},117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reducedPlanckConstantDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createReducedPlanckConstant:i.createReducedPlanckConstant};t.reducedPlanckConstantDependencies=o},76805:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationalNodeDependencies=void 0;var n=r(36991),a=r(59884),i={NodeDependencies:n.NodeDependencies,createRelationalNode:a.createRelationalNode};t.RelationalNodeDependencies=i},29611:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.replacerDependencies=void 0;var n={createReplacer:r(59884).createReplacer};t.replacerDependencies=n},56205:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reshapeDependencies=void 0;var n=r(19313),a=r(23058),i=r(34931),o=r(59884),s={isIntegerDependencies:n.isIntegerDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createReshape:o.createReshape};t.reshapeDependencies=s},68040:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeDependencies=void 0;var n=r(23058),a=r(59884),i={matrixDependencies:n.matrixDependencies,createResize:a.createResize};t.resizeDependencies=i},42267:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResultSetDependencies=void 0;var n={createResultSet:r(59884).createResultSet};t.ResultSetDependencies=n},82159:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviverDependencies=void 0;var n={createReviver:r(59884).createReviver};t.reviverDependencies=n},52342:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightArithShiftDependencies=void 0;var n=r(55511),a=r(41498),i=r(23058),o=r(34931),s=r(89767),l=r(59884),c={DenseMatrixDependencies:n.DenseMatrixDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:o.typedDependencies,zerosDependencies:s.zerosDependencies,createRightArithShift:l.createRightArithShift};t.rightArithShiftDependencies=c},64617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightLogShiftDependencies=void 0;var n=r(55511),a=r(41498),i=r(23058),o=r(34931),s=r(89767),l=r(59884),c={DenseMatrixDependencies:n.DenseMatrixDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:o.typedDependencies,zerosDependencies:s.zerosDependencies,createRightLogShift:l.createRightLogShift};t.rightLogShiftDependencies=c},80618:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rotateDependencies=void 0;var n=r(54779),a=r(15099),i=r(34931),o=r(59884),s={multiplyDependencies:n.multiplyDependencies,rotationMatrixDependencies:a.rotationMatrixDependencies,typedDependencies:i.typedDependencies,createRotate:o.createRotate};t.rotateDependencies=s},15099:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rotationMatrixDependencies=void 0;var n=r(67080),a=r(55511),i=r(29027),o=r(33237),s=r(23511),l=r(23058),c=r(96062),u=r(81347),f=r(6860),p=r(34931),h=r(63697),d=r(59884),m={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:a.DenseMatrixDependencies,SparseMatrixDependencies:i.SparseMatrixDependencies,addScalarDependencies:o.addScalarDependencies,cosDependencies:s.cosDependencies,matrixDependencies:l.matrixDependencies,multiplyScalarDependencies:c.multiplyScalarDependencies,normDependencies:u.normDependencies,sinDependencies:f.sinDependencies,typedDependencies:p.typedDependencies,unaryMinusDependencies:h.unaryMinusDependencies,createRotationMatrix:d.createRotationMatrix};t.rotationMatrixDependencies=m},58684:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.roundDependencies=void 0;var n=r(67080),a=r(55511),i=r(41498),o=r(23058),s=r(34931),l=r(89767),c=r(59884),u={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:a.DenseMatrixDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:s.typedDependencies,zerosDependencies:l.zerosDependencies,createRound:c.createRound};t.roundDependencies=u},37128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rowDependencies=void 0;var n=r(60755),a=r(23058),i=r(25169),o=r(34931),s=r(59884),l={IndexDependencies:n.IndexDependencies,matrixDependencies:a.matrixDependencies,rangeDependencies:i.rangeDependencies,typedDependencies:o.typedDependencies,createRow:s.createRow};t.rowDependencies=l},61741:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rowTransformDependencies=void 0;var n=r(60755),a=r(23058),i=r(25169),o=r(34931),s=r(59884),l={IndexDependencies:n.IndexDependencies,matrixDependencies:a.matrixDependencies,rangeDependencies:i.rangeDependencies,typedDependencies:o.typedDependencies,createRowTransform:s.createRowTransform};t.rowTransformDependencies=l},9539:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rydbergDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createRydberg:i.createRydberg};t.rydbergDependencies=o},57125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SQRT1_2Dependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createSQRT1_2:a.createSQRT1_2};t.SQRT1_2Dependencies=i},73184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SQRT2Dependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createSQRT2:a.createSQRT2};t.SQRT2Dependencies=i},8707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sackurTetrodeDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createSackurTetrode:a.createSackurTetrode};t.sackurTetrodeDependencies=i},71563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.secDependencies=void 0;var n=r(67080),a=r(34931),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:a.typedDependencies,createSec:i.createSec};t.secDependencies=o},14681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sechDependencies=void 0;var n=r(67080),a=r(34931),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:a.typedDependencies,createSech:i.createSech};t.sechDependencies=o},83381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.secondRadiationDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createSecondRadiation:i.createSecondRadiation};t.secondRadiationDependencies=o},9522:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setCartesianDependencies=void 0;var n=r(55511),a=r(60755),i=r(18103),o=r(51931),s=r(10847),l=r(34931),c=r(59884),u={DenseMatrixDependencies:n.DenseMatrixDependencies,IndexDependencies:a.IndexDependencies,compareNaturalDependencies:i.compareNaturalDependencies,sizeDependencies:o.sizeDependencies,subsetDependencies:s.subsetDependencies,typedDependencies:l.typedDependencies,createSetCartesian:c.createSetCartesian};t.setCartesianDependencies=u},71459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDifferenceDependencies=void 0;var n=r(55511),a=r(60755),i=r(18103),o=r(51931),s=r(10847),l=r(34931),c=r(59884),u={DenseMatrixDependencies:n.DenseMatrixDependencies,IndexDependencies:a.IndexDependencies,compareNaturalDependencies:i.compareNaturalDependencies,sizeDependencies:o.sizeDependencies,subsetDependencies:s.subsetDependencies,typedDependencies:l.typedDependencies,createSetDifference:c.createSetDifference};t.setDifferenceDependencies=u},40399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDistinctDependencies=void 0;var n=r(55511),a=r(60755),i=r(18103),o=r(51931),s=r(10847),l=r(34931),c=r(59884),u={DenseMatrixDependencies:n.DenseMatrixDependencies,IndexDependencies:a.IndexDependencies,compareNaturalDependencies:i.compareNaturalDependencies,sizeDependencies:o.sizeDependencies,subsetDependencies:s.subsetDependencies,typedDependencies:l.typedDependencies,createSetDistinct:c.createSetDistinct};t.setDistinctDependencies=u},67160:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setIntersectDependencies=void 0;var n=r(55511),a=r(60755),i=r(18103),o=r(51931),s=r(10847),l=r(34931),c=r(59884),u={DenseMatrixDependencies:n.DenseMatrixDependencies,IndexDependencies:a.IndexDependencies,compareNaturalDependencies:i.compareNaturalDependencies,sizeDependencies:o.sizeDependencies,subsetDependencies:s.subsetDependencies,typedDependencies:l.typedDependencies,createSetIntersect:c.createSetIntersect};t.setIntersectDependencies=u},46776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setIsSubsetDependencies=void 0;var n=r(60755),a=r(18103),i=r(51931),o=r(10847),s=r(34931),l=r(59884),c={IndexDependencies:n.IndexDependencies,compareNaturalDependencies:a.compareNaturalDependencies,sizeDependencies:i.sizeDependencies,subsetDependencies:o.subsetDependencies,typedDependencies:s.typedDependencies,createSetIsSubset:l.createSetIsSubset};t.setIsSubsetDependencies=c},66949:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setMultiplicityDependencies=void 0;var n=r(60755),a=r(18103),i=r(51931),o=r(10847),s=r(34931),l=r(59884),c={IndexDependencies:n.IndexDependencies,compareNaturalDependencies:a.compareNaturalDependencies,sizeDependencies:i.sizeDependencies,subsetDependencies:o.subsetDependencies,typedDependencies:s.typedDependencies,createSetMultiplicity:l.createSetMultiplicity};t.setMultiplicityDependencies=c},44731:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setPowersetDependencies=void 0;var n=r(60755),a=r(18103),i=r(51931),o=r(10847),s=r(34931),l=r(59884),c={IndexDependencies:n.IndexDependencies,compareNaturalDependencies:a.compareNaturalDependencies,sizeDependencies:i.sizeDependencies,subsetDependencies:o.subsetDependencies,typedDependencies:s.typedDependencies,createSetPowerset:l.createSetPowerset};t.setPowersetDependencies=c},45594:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSizeDependencies=void 0;var n=r(18103),a=r(34931),i=r(59884),o={compareNaturalDependencies:n.compareNaturalDependencies,typedDependencies:a.typedDependencies,createSetSize:i.createSetSize};t.setSizeDependencies=o},3290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSymDifferenceDependencies=void 0;var n=r(60755),a=r(25590),i=r(71459),o=r(51931),s=r(10847),l=r(34931),c=r(59884),u={IndexDependencies:n.IndexDependencies,concatDependencies:a.concatDependencies,setDifferenceDependencies:i.setDifferenceDependencies,sizeDependencies:o.sizeDependencies,subsetDependencies:s.subsetDependencies,typedDependencies:l.typedDependencies,createSetSymDifference:c.createSetSymDifference};t.setSymDifferenceDependencies=u},65709:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setUnionDependencies=void 0;var n=r(60755),a=r(25590),i=r(67160),o=r(3290),s=r(51931),l=r(10847),c=r(34931),u=r(59884),f={IndexDependencies:n.IndexDependencies,concatDependencies:a.concatDependencies,setIntersectDependencies:i.setIntersectDependencies,setSymDifferenceDependencies:o.setSymDifferenceDependencies,sizeDependencies:s.sizeDependencies,subsetDependencies:l.subsetDependencies,typedDependencies:c.typedDependencies,createSetUnion:u.createSetUnion};t.setUnionDependencies=f},48482:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signDependencies=void 0;var n=r(67080),a=r(57068),i=r(85103),o=r(34931),s=r(59884),l={BigNumberDependencies:n.BigNumberDependencies,FractionDependencies:a.FractionDependencies,complexDependencies:i.complexDependencies,typedDependencies:o.typedDependencies,createSign:s.createSign};t.signDependencies=l},73879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifyDependencies=void 0;var n=r(24785),a=r(99656),i=r(78321),o=r(51580),s=r(65392),l=r(55911),c=r(72457),u=r(25540),f=r(62640),p=r(45405),h=r(20713),d=r(54779),m=r(13386),g=r(6817),y=r(53885),v=r(34931),b=r(59884),x={bignumberDependencies:n.bignumberDependencies,fractionDependencies:a.fractionDependencies,ConstantNodeDependencies:i.ConstantNodeDependencies,FunctionNodeDependencies:o.FunctionNodeDependencies,OperatorNodeDependencies:s.OperatorNodeDependencies,ParenthesisNodeDependencies:l.ParenthesisNodeDependencies,SymbolNodeDependencies:c.SymbolNodeDependencies,addDependencies:u.addDependencies,divideDependencies:f.divideDependencies,equalDependencies:p.equalDependencies,isZeroDependencies:h.isZeroDependencies,multiplyDependencies:d.multiplyDependencies,parseDependencies:m.parseDependencies,powDependencies:g.powDependencies,subtractDependencies:y.subtractDependencies,typedDependencies:v.typedDependencies,createSimplify:b.createSimplify};t.simplifyDependencies=x},6860:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sinDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createSin:a.createSin};t.sinDependencies=i},15848:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sinhDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createSinh:a.createSinh};t.sinhDependencies=i},51931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sizeDependencies=void 0;var n=r(23058),a=r(34931),i=r(59884),o={matrixDependencies:n.matrixDependencies,typedDependencies:a.typedDependencies,createSize:i.createSize};t.sizeDependencies=o},25213:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sluDependencies=void 0;var n=r(29027),a=r(14126),i=r(25540),o=r(68115),s=r(57568),l=r(29521),c=r(54779),u=r(53885),f=r(2246),p=r(34931),h=r(59884),d={SparseMatrixDependencies:n.SparseMatrixDependencies,absDependencies:a.absDependencies,addDependencies:i.addDependencies,divideScalarDependencies:o.divideScalarDependencies,largerDependencies:s.largerDependencies,largerEqDependencies:l.largerEqDependencies,multiplyDependencies:c.multiplyDependencies,subtractDependencies:u.subtractDependencies,transposeDependencies:f.transposeDependencies,typedDependencies:p.typedDependencies,createSlu:h.createSlu};t.sluDependencies=d},11041:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smallerDependencies=void 0;var n=r(55511),a=r(23058),i=r(34931),o=r(59884),s={DenseMatrixDependencies:n.DenseMatrixDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createSmaller:o.createSmaller};t.smallerDependencies=s},34652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smallerEqDependencies=void 0;var n=r(55511),a=r(23058),i=r(34931),o=r(59884),s={DenseMatrixDependencies:n.DenseMatrixDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createSmallerEq:o.createSmallerEq};t.smallerEqDependencies=s},59205:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortDependencies=void 0;var n=r(44070),a=r(18103),i=r(23058),o=r(34931),s=r(59884),l={compareDependencies:n.compareDependencies,compareNaturalDependencies:a.compareNaturalDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:o.typedDependencies,createSort:s.createSort};t.sortDependencies=l},11856:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpaDependencies=void 0;var n=r(13835),a=r(33237),i=r(41498),o=r(59884),s={FibonacciHeapDependencies:n.FibonacciHeapDependencies,addScalarDependencies:a.addScalarDependencies,equalScalarDependencies:i.equalScalarDependencies,createSpaClass:o.createSpaClass};t.SpaDependencies=s},12400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sparseDependencies=void 0;var n=r(29027),a=r(34931),i=r(59884),o={SparseMatrixDependencies:n.SparseMatrixDependencies,typedDependencies:a.typedDependencies,createSparse:i.createSparse};t.sparseDependencies=o},29027:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SparseMatrixDependencies=void 0;var n=r(1017),a=r(41498),i=r(34931),o=r(59884),s={MatrixDependencies:n.MatrixDependencies,equalScalarDependencies:a.equalScalarDependencies,typedDependencies:i.typedDependencies,createSparseMatrixClass:o.createSparseMatrixClass};t.SparseMatrixDependencies=s},40552:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.speedOfLightDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createSpeedOfLight:i.createSpeedOfLight};t.speedOfLightDependencies=o},90824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitUnitDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createSplitUnit:a.createSplitUnit};t.splitUnitDependencies=i},26786:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sqrtDependencies=void 0;var n=r(84011),a=r(34931),i=r(59884),o={ComplexDependencies:n.ComplexDependencies,typedDependencies:a.typedDependencies,createSqrt:i.createSqrt};t.sqrtDependencies=o},87456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sqrtmDependencies=void 0;var n=r(14126),a=r(25540),i=r(52977),o=r(73336),s=r(14244),l=r(54779),c=r(51931),u=r(26786),f=r(53885),p=r(34931),h=r(59884),d={absDependencies:n.absDependencies,addDependencies:a.addDependencies,identityDependencies:i.identityDependencies,invDependencies:o.invDependencies,maxDependencies:s.maxDependencies,multiplyDependencies:l.multiplyDependencies,sizeDependencies:c.sizeDependencies,sqrtDependencies:u.sqrtDependencies,subtractDependencies:f.subtractDependencies,typedDependencies:p.typedDependencies,createSqrtm:h.createSqrtm};t.sqrtmDependencies=d},67654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.squareDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createSquare:a.createSquare};t.squareDependencies=i},6034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.squeezeDependencies=void 0;var n=r(23058),a=r(34931),i=r(59884),o={matrixDependencies:n.matrixDependencies,typedDependencies:a.typedDependencies,createSqueeze:i.createSqueeze};t.squeezeDependencies=o},24757:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stdDependencies=void 0;var n=r(26786),a=r(34931),i=r(46811),o=r(59884),s={sqrtDependencies:n.sqrtDependencies,typedDependencies:a.typedDependencies,varianceDependencies:i.varianceDependencies,createStd:o.createStd};t.stdDependencies=s},44609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stdTransformDependencies=void 0;var n=r(26786),a=r(34931),i=r(46811),o=r(59884),s={sqrtDependencies:n.sqrtDependencies,typedDependencies:a.typedDependencies,varianceDependencies:i.varianceDependencies,createStdTransform:o.createStdTransform};t.stdTransformDependencies=s},52931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stefanBoltzmannDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createStefanBoltzmann:i.createStefanBoltzmann};t.stefanBoltzmannDependencies=o},36010:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stirlingS2Dependencies=void 0;var n=r(33237),a=r(41467),i=r(68115),o=r(21574),s=r(19313),l=r(20962),c=r(57568),u=r(96062),f=r(6817),p=r(53885),h=r(34931),d=r(59884),m={addScalarDependencies:n.addScalarDependencies,combinationsDependencies:a.combinationsDependencies,divideScalarDependencies:i.divideScalarDependencies,factorialDependencies:o.factorialDependencies,isIntegerDependencies:s.isIntegerDependencies,isNegativeDependencies:l.isNegativeDependencies,largerDependencies:c.largerDependencies,multiplyScalarDependencies:u.multiplyScalarDependencies,powDependencies:f.powDependencies,subtractDependencies:p.subtractDependencies,typedDependencies:h.typedDependencies,createStirlingS2:d.createStirlingS2};t.stirlingS2Dependencies=m},76738:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createString:a.createString};t.stringDependencies=i},10847:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subsetDependencies=void 0;var n=r(23058),a=r(34931),i=r(59884),o={matrixDependencies:n.matrixDependencies,typedDependencies:a.typedDependencies,createSubset:i.createSubset};t.subsetDependencies=o},59190:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subsetTransformDependencies=void 0;var n=r(23058),a=r(34931),i=r(59884),o={matrixDependencies:n.matrixDependencies,typedDependencies:a.typedDependencies,createSubsetTransform:i.createSubsetTransform};t.subsetTransformDependencies=o},53885:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subtractDependencies=void 0;var n=r(55511),a=r(33237),i=r(41498),o=r(23058),s=r(34931),l=r(63697),c=r(59884),u={DenseMatrixDependencies:n.DenseMatrixDependencies,addScalarDependencies:a.addScalarDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:s.typedDependencies,unaryMinusDependencies:l.unaryMinusDependencies,createSubtract:c.createSubtract};t.subtractDependencies=u},71675:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sumDependencies=void 0;var n=r(25540),a=r(47046),i=r(34931),o=r(59884),s={addDependencies:n.addDependencies,numericDependencies:a.numericDependencies,typedDependencies:i.typedDependencies,createSum:o.createSum};t.sumDependencies=s},73493:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sumTransformDependencies=void 0;var n=r(25540),a=r(47046),i=r(34931),o=r(59884),s={addDependencies:n.addDependencies,numericDependencies:a.numericDependencies,typedDependencies:i.typedDependencies,createSumTransform:o.createSumTransform};t.sumTransformDependencies=s},72457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolNodeDependencies=void 0;var n=r(51455),a=r(36991),i=r(59884),o={UnitDependencies:n.UnitDependencies,NodeDependencies:a.NodeDependencies,createSymbolNode:i.createSymbolNode};t.SymbolNodeDependencies=o},15668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tanDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createTan:a.createTan};t.tanDependencies=i},28422:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tanhDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createTanh:a.createTanh};t.tanhDependencies=i},86666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tauDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createTau:a.createTau};t.tauDependencies=i},53254:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.thomsonCrossSectionDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createThomsonCrossSection:i.createThomsonCrossSection};t.thomsonCrossSectionDependencies=o},45457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toDependencies=void 0;var n=r(23058),a=r(34931),i=r(59884),o={matrixDependencies:n.matrixDependencies,typedDependencies:a.typedDependencies,createTo:i.createTo};t.toDependencies=o},62763:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.traceDependencies=void 0;var n=r(25540),a=r(23058),i=r(34931),o=r(59884),s={addDependencies:n.addDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createTrace:o.createTrace};t.traceDependencies=s},2246:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transposeDependencies=void 0;var n=r(23058),a=r(34931),i=r(59884),o={matrixDependencies:n.matrixDependencies,typedDependencies:a.typedDependencies,createTranspose:i.createTranspose};t.transposeDependencies=o},5793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trueDependencies=void 0;var n={createTrue:r(59884).createTrue};t.trueDependencies=n},99916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeOfDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createTypeOf:a.createTypeOf};t.typeOfDependencies=i},34931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typedDependencies=void 0;var n=r(67080),a=r(84011),i=r(55511),o=r(57068),s=r(59884),l={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:a.ComplexDependencies,DenseMatrixDependencies:i.DenseMatrixDependencies,FractionDependencies:o.FractionDependencies,createTyped:s.createTyped};t.typedDependencies=l},63697:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unaryMinusDependencies=void 0;var n=r(34931),a=r(59884),i={typedDependencies:n.typedDependencies,createUnaryMinus:a.createUnaryMinus};t.unaryMinusDependencies=i},22640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unaryPlusDependencies=void 0;var n=r(67080),a=r(34931),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:a.typedDependencies,createUnaryPlus:i.createUnaryPlus};t.unaryPlusDependencies=o},82889:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unequalDependencies=void 0;var n=r(55511),a=r(41498),i=r(23058),o=r(34931),s=r(59884),l={DenseMatrixDependencies:n.DenseMatrixDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:o.typedDependencies,createUnequal:s.createUnequal};t.unequalDependencies=l},51455:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnitDependencies=void 0;var n=r(67080),a=r(84011),i=r(57068),o=r(14126),s=r(33237),l=r(68115),c=r(45405),u=r(57195),f=r(20178),p=r(96617),h=r(96062),d=r(42885),m=r(6817),g=r(58684),y=r(53885),v=r(59884),b={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:a.ComplexDependencies,FractionDependencies:i.FractionDependencies,absDependencies:o.absDependencies,addScalarDependencies:s.addScalarDependencies,divideScalarDependencies:l.divideScalarDependencies,equalDependencies:c.equalDependencies,fixDependencies:u.fixDependencies,formatDependencies:f.formatDependencies,isNumericDependencies:p.isNumericDependencies,multiplyScalarDependencies:h.multiplyScalarDependencies,numberDependencies:d.numberDependencies,powDependencies:m.powDependencies,roundDependencies:g.roundDependencies,subtractDependencies:y.subtractDependencies,createUnitClass:v.createUnitClass};t.UnitDependencies=b},58696:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unitDependencies=void 0;var n=r(51455),a=r(34931),i=r(59884),o={UnitDependencies:n.UnitDependencies,typedDependencies:a.typedDependencies,createUnitFunction:i.createUnitFunction};t.unitDependencies=o},1955:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EDependencies=void 0;var n=r(88775),a=r(59884),i={eDependencies:n.eDependencies,createUppercaseE:a.createUppercaseE};t.EDependencies=i},6842:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PIDependencies=void 0;var n=r(9764),a=r(59884),i={piDependencies:n.piDependencies,createUppercasePi:a.createUppercasePi};t.PIDependencies=i},98221:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usolveDependencies=void 0;var n=r(55511),a=r(68115),i=r(41498),o=r(23058),s=r(96062),l=r(53885),c=r(34931),u=r(59884),f={DenseMatrixDependencies:n.DenseMatrixDependencies,divideScalarDependencies:a.divideScalarDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:o.matrixDependencies,multiplyScalarDependencies:s.multiplyScalarDependencies,subtractDependencies:l.subtractDependencies,typedDependencies:c.typedDependencies,createUsolve:u.createUsolve};t.usolveDependencies=f},99401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usolveAllDependencies=void 0;var n=r(55511),a=r(68115),i=r(41498),o=r(23058),s=r(96062),l=r(53885),c=r(34931),u=r(59884),f={DenseMatrixDependencies:n.DenseMatrixDependencies,divideScalarDependencies:a.divideScalarDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:o.matrixDependencies,multiplyScalarDependencies:s.multiplyScalarDependencies,subtractDependencies:l.subtractDependencies,typedDependencies:c.typedDependencies,createUsolveAll:u.createUsolveAll};t.usolveAllDependencies=f},7512:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.vacuumImpedanceDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createVacuumImpedance:i.createVacuumImpedance};t.vacuumImpedanceDependencies=o},46811:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.varianceDependencies=void 0;var n=r(25540),a=r(69979),i=r(62640),o=r(52601),s=r(54779),l=r(53885),c=r(34931),u=r(59884),f={addDependencies:n.addDependencies,applyDependencies:a.applyDependencies,divideDependencies:i.divideDependencies,isNaNDependencies:o.isNaNDependencies,multiplyDependencies:s.multiplyDependencies,subtractDependencies:l.subtractDependencies,typedDependencies:c.typedDependencies,createVariance:u.createVariance};t.varianceDependencies=f},38022:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.varianceTransformDependencies=void 0;var n=r(25540),a=r(69979),i=r(62640),o=r(52601),s=r(54779),l=r(53885),c=r(34931),u=r(59884),f={addDependencies:n.addDependencies,applyDependencies:a.applyDependencies,divideDependencies:i.divideDependencies,isNaNDependencies:o.isNaNDependencies,multiplyDependencies:s.multiplyDependencies,subtractDependencies:l.subtractDependencies,typedDependencies:c.typedDependencies,createVarianceTransform:u.createVarianceTransform};t.varianceTransformDependencies=f},53681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.versionDependencies=void 0;var n={createVersion:r(59884).createVersion};t.versionDependencies=n},33794:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.weakMixingAngleDependencies=void 0;var n=r(67080),a=r(59884),i={BigNumberDependencies:n.BigNumberDependencies,createWeakMixingAngle:a.createWeakMixingAngle};t.weakMixingAngleDependencies=i},9738:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wienDisplacementDependencies=void 0;var n=r(67080),a=r(51455),i=r(59884),o={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:a.UnitDependencies,createWienDisplacement:i.createWienDisplacement};t.wienDisplacementDependencies=o},67259:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xgcdDependencies=void 0;var n=r(67080),a=r(23058),i=r(34931),o=r(59884),s={BigNumberDependencies:n.BigNumberDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createXgcd:o.createXgcd};t.xgcdDependencies=s},11030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xorDependencies=void 0;var n=r(55511),a=r(23058),i=r(34931),o=r(59884),s={DenseMatrixDependencies:n.DenseMatrixDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createXor:o.createXor};t.xorDependencies=s},89767:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zerosDependencies=void 0;var n=r(67080),a=r(23058),i=r(34931),o=r(59884),s={BigNumberDependencies:n.BigNumberDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:i.typedDependencies,createZeros:o.createZeros};t.zerosDependencies=s},17876:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.derivative=t.compile=t.chain=t.SymbolNode=t.RelationalNode=t.RangeNode=t.Parser=t.ParenthesisNode=t.OperatorNode=t.ObjectNode=t.Node=t.IndexNode=t.Help=t.FunctionNode=t.FunctionAssignmentNode=t.ConstantNode=t.ConditionalNode=t.Chain=t.BlockNode=t.AssignmentNode=t.ArrayNode=t.AccessorNode=void 0,Object.defineProperty(t,"docs",{enumerable:!0,get:function(){return l.embeddedDocs}}),t.simplify=t.reviver=t.rationalize=t.parser=t.parse=t.help=t.evaluate=void 0;var a=n(r(9917)),i=r(39006),o=r(59884),s=r(32876),l=r(3399),c={},u={},f={},p=(0,o.createChainClass)({math:c});t.Chain=p;var h=(0,o.createNode)({mathWithTransform:u});t.Node=h;var d=(0,o.createObjectNode)({Node:h});t.ObjectNode=d;var m=(0,o.createOperatorNode)({Node:h});t.OperatorNode=m;var g=(0,o.createParenthesisNode)({Node:h});t.ParenthesisNode=g;var y=(0,o.createRelationalNode)({Node:h});t.RelationalNode=y;var v=(0,o.createArrayNode)({Node:h});t.ArrayNode=v;var b=(0,o.createBlockNode)({Node:h,ResultSet:s.ResultSet});t.BlockNode=b;var x=(0,o.createConditionalNode)({Node:h});t.ConditionalNode=x;var _=(0,o.createConstantNode)({Node:h});t.ConstantNode=_;var w=(0,o.createRangeNode)({Node:h});t.RangeNode=w;var k=(0,o.createReviver)({classes:f});t.reviver=k;var D=(0,o.createChain)({Chain:p,typed:s.typed});t.chain=D;var T=(0,o.createFunctionAssignmentNode)({Node:h,typed:s.typed});t.FunctionAssignmentNode=T;var A=(0,o.createAccessorNode)({Node:h,subset:s.subset});t.AccessorNode=A;var S=(0,o.createAssignmentNode)({matrix:s.matrix,Node:h,subset:s.subset});t.AssignmentNode=S;var M=(0,o.createIndexNode)({Node:h,Range:s.Range,size:s.size});t.IndexNode=M;var E=(0,o.createSymbolNode)({Unit:s.Unit,Node:h,math:c});t.SymbolNode=E;var C=(0,o.createFunctionNode)({Node:h,SymbolNode:E,math:c});t.FunctionNode=C;var N=(0,o.createParse)({AccessorNode:A,ArrayNode:v,AssignmentNode:S,BlockNode:b,ConditionalNode:x,ConstantNode:_,FunctionAssignmentNode:T,FunctionNode:C,IndexNode:M,ObjectNode:d,OperatorNode:m,ParenthesisNode:g,RangeNode:w,RelationalNode:y,SymbolNode:E,config:i.config,numeric:s.numeric,typed:s.typed});t.parse=N;var O=(0,o.createCompile)({parse:N,typed:s.typed});t.compile=O;var I=(0,o.createEvaluate)({parse:N,typed:s.typed});t.evaluate=I;var P=(0,o.createHelpClass)({parse:N});t.Help=P;var R=(0,o.createParserClass)({evaluate:I});t.Parser=R;var L=(0,o.createParser)({Parser:R,typed:s.typed});t.parser=L;var F=(0,o.createSimplify)({bignumber:s.bignumber,fraction:s.fraction,ConstantNode:_,FunctionNode:C,OperatorNode:m,ParenthesisNode:g,SymbolNode:E,add:s.add,config:i.config,divide:s.divide,equal:s.equal,isZero:s.isZero,mathWithTransform:u,multiply:s.multiply,parse:N,pow:s.pow,subtract:s.subtract,typed:s.typed});t.simplify=F;var B=(0,o.createDerivative)({ConstantNode:_,FunctionNode:C,OperatorNode:m,ParenthesisNode:g,SymbolNode:E,config:i.config,equal:s.equal,isZero:s.isZero,numeric:s.numeric,parse:N,simplify:F,typed:s.typed});t.derivative=B;var z=(0,o.createHelp)({Help:P,mathWithTransform:u,typed:s.typed});t.help=z;var j=(0,o.createRationalize)({bignumber:s.bignumber,fraction:s.fraction,ConstantNode:_,FunctionNode:C,OperatorNode:m,ParenthesisNode:g,SymbolNode:E,add:s.add,config:i.config,divide:s.divide,equal:s.equal,isZero:s.isZero,mathWithTransform:u,multiply:s.multiply,parse:N,pow:s.pow,simplify:F,subtract:s.subtract,typed:s.typed});t.rationalize=j,(0,a.default)(c,{e:s.e,false:s._false,fineStructure:s.fineStructure,i:s.i,Infinity:s._Infinity,LN10:s.LN10,LOG10E:s.LOG10E,NaN:s._NaN,null:s._null,phi:s.phi,SQRT1_2:s.SQRT1_2,sackurTetrode:s.sackurTetrode,tau:s.tau,true:s._true,E:s.e,version:s.version,efimovFactor:s.efimovFactor,LN2:s.LN2,pi:s.pi,replacer:s.replacer,reviver:k,SQRT2:s.SQRT2,typed:s.typed,unaryPlus:s.unaryPlus,PI:s.pi,weakMixingAngle:s.weakMixingAngle,abs:s.abs,acos:s.acos,acot:s.acot,acsc:s.acsc,addScalar:s.addScalar,arg:s.arg,asech:s.asech,asinh:s.asinh,atan:s.atan,atanh:s.atanh,bignumber:s.bignumber,bitNot:s.bitNot,boolean:s.boolean,chain:D,clone:s.clone,combinations:s.combinations,complex:s.complex,conj:s.conj,cosh:s.cosh,coth:s.coth,csc:s.csc,cube:s.cube,equalScalar:s.equalScalar,erf:s.erf,exp:s.exp,expm1:s.expm1,filter:s.filter,forEach:s.forEach,format:s.format,getMatrixDataType:s.getMatrixDataType,hex:s.hex,im:s.im,isInteger:s.isInteger,isNegative:s.isNegative,isPositive:s.isPositive,isZero:s.isZero,LOG2E:s.LOG2E,log10:s.log10,log2:s.log2,map:s.map,multiplyScalar:s.multiplyScalar,not:s.not,number:s.number,oct:s.oct,pickRandom:s.pickRandom,print:s.print,random:s.random,re:s.re,sec:s.sec,sign:s.sign,sin:s.sin,splitUnit:s.splitUnit,square:s.square,string:s.string,tan:s.tan,typeOf:s.typeOf,acosh:s.acosh,acsch:s.acsch,apply:s.apply,asec:s.asec,bin:s.bin,combinationsWithRep:s.combinationsWithRep,cos:s.cos,csch:s.csch,isNaN:s.isNaN,isPrime:s.isPrime,randomInt:s.randomInt,sech:s.sech,sinh:s.sinh,sparse:s.sparse,sqrt:s.sqrt,tanh:s.tanh,unaryMinus:s.unaryMinus,acoth:s.acoth,cot:s.cot,fraction:s.fraction,isNumeric:s.isNumeric,matrix:s.matrix,matrixFromFunction:s.matrixFromFunction,mod:s.mod,nthRoot:s.nthRoot,numeric:s.numeric,or:s.or,prod:s.prod,reshape:s.reshape,size:s.size,smaller:s.smaller,squeeze:s.squeeze,subset:s.subset,subtract:s.subtract,to:s.to,transpose:s.transpose,xgcd:s.xgcd,zeros:s.zeros,and:s.and,bitAnd:s.bitAnd,bitXor:s.bitXor,cbrt:s.cbrt,compare:s.compare,compareText:s.compareText,concat:s.concat,count:s.count,ctranspose:s.ctranspose,diag:s.diag,divideScalar:s.divideScalar,dotDivide:s.dotDivide,equal:s.equal,flatten:s.flatten,gcd:s.gcd,hasNumericValue:s.hasNumericValue,hypot:s.hypot,kron:s.kron,largerEq:s.largerEq,leftShift:s.leftShift,lsolve:s.lsolve,matrixFromColumns:s.matrixFromColumns,min:s.min,mode:s.mode,nthRoots:s.nthRoots,ones:s.ones,partitionSelect:s.partitionSelect,resize:s.resize,rightLogShift:s.rightLogShift,round:s.round,smallerEq:s.smallerEq,unequal:s.unequal,usolve:s.usolve,xor:s.xor,add:s.add,atan2:s.atan2,bitOr:s.bitOr,catalan:s.catalan,compareNatural:s.compareNatural,deepEqual:s.deepEqual,diff:s.diff,dot:s.dot,equalText:s.equalText,floor:s.floor,identity:s.identity,larger:s.larger,log:s.log,lsolveAll:s.lsolveAll,matrixFromRows:s.matrixFromRows,multiply:s.multiply,pow:s.pow,qr:s.qr,range:s.range,rightArithShift:s.rightArithShift,row:s.row,setCartesian:s.setCartesian,setDistinct:s.setDistinct,setIsSubset:s.setIsSubset,setPowerset:s.setPowerset,slu:s.slu,sum:s.sum,trace:s.trace,usolveAll:s.usolveAll,asin:s.asin,ceil:s.ceil,column:s.column,composition:s.composition,cross:s.cross,distance:s.distance,dotMultiply:s.dotMultiply,fix:s.fix,gamma:s.gamma,index:s.index,lcm:s.lcm,max:s.max,quantileSeq:s.quantileSeq,setDifference:s.setDifference,setMultiplicity:s.setMultiplicity,setSymDifference:s.setSymDifference,sort:s.sort,vacuumImpedance:s.vacuumImpedance,wienDisplacement:s.wienDisplacement,atomicMass:s.atomicMass,bohrMagneton:s.bohrMagneton,boltzmann:s.boltzmann,conductanceQuantum:s.conductanceQuantum,createUnit:s.createUnit,deuteronMass:s.deuteronMass,dotPow:s.dotPow,electricConstant:s.electricConstant,elementaryCharge:s.elementaryCharge,factorial:s.factorial,fermiCoupling:s.fermiCoupling,gasConstant:s.gasConstant,gravity:s.gravity,intersect:s.intersect,inverseConductanceQuantum:s.inverseConductanceQuantum,klitzing:s.klitzing,loschmidt:s.loschmidt,magneticConstant:s.magneticConstant,molarMass:s.molarMass,molarPlanckConstant:s.molarPlanckConstant,neutronMass:s.neutronMass,nuclearMagneton:s.nuclearMagneton,permutations:s.permutations,planckConstant:s.planckConstant,planckMass:s.planckMass,planckTime:s.planckTime,quantumOfCirculation:s.quantumOfCirculation,reducedPlanckConstant:s.reducedPlanckConstant,rydberg:s.rydberg,setIntersect:s.setIntersect,setUnion:s.setUnion,stefanBoltzmann:s.stefanBoltzmann,unit:s.unit,avogadro:s.avogadro,bohrRadius:s.bohrRadius,coulomb:s.coulomb,electronMass:s.electronMass,faraday:s.faraday,hartreeEnergy:s.hartreeEnergy,log1p:s.log1p,magneticFluxQuantum:s.magneticFluxQuantum,molarMassC12:s.molarMassC12,parse:N,planckCharge:s.planckCharge,planckTemperature:s.planckTemperature,secondRadiation:s.secondRadiation,speedOfLight:s.speedOfLight,stirlingS2:s.stirlingS2,bellNumbers:s.bellNumbers,compile:O,evaluate:I,firstRadiation:s.firstRadiation,lup:s.lup,molarVolume:s.molarVolume,protonMass:s.protonMass,setSize:s.setSize,thomsonCrossSection:s.thomsonCrossSection,classicalElectronRadius:s.classicalElectronRadius,det:s.det,gravitationConstant:s.gravitationConstant,inv:s.inv,lusolve:s.lusolve,parser:L,sqrtm:s.sqrtm,divide:s.divide,expm:s.expm,kldivergence:s.kldivergence,mean:s.mean,median:s.median,planckLength:s.planckLength,simplify:F,variance:s.variance,derivative:B,help:z,rationalize:j,std:s.std,eigs:s.eigs,multinomial:s.multinomial,mad:s.mad,norm:s.norm,rotationMatrix:s.rotationMatrix,rotate:s.rotate,config:i.config}),(0,a.default)(u,c,{filter:(0,o.createFilterTransform)({typed:s.typed}),forEach:(0,o.createForEachTransform)({typed:s.typed}),map:(0,o.createMapTransform)({typed:s.typed}),apply:(0,o.createApplyTransform)({isInteger:s.isInteger,typed:s.typed}),diff:(0,o.createDiffTransform)({bignumber:s.bignumber,matrix:s.matrix,number:s.number,subtract:s.subtract,typed:s.typed}),index:(0,o.createIndexTransform)({Index:s.Index}),subset:(0,o.createSubsetTransform)({matrix:s.matrix,typed:s.typed}),concat:(0,o.createConcatTransform)({isInteger:s.isInteger,matrix:s.matrix,typed:s.typed}),max:(0,o.createMaxTransform)({config:i.config,larger:s.larger,numeric:s.numeric,typed:s.typed}),min:(0,o.createMinTransform)({config:i.config,numeric:s.numeric,smaller:s.smaller,typed:s.typed}),range:(0,o.createRangeTransform)({bignumber:s.bignumber,matrix:s.matrix,config:i.config,larger:s.larger,largerEq:s.largerEq,smaller:s.smaller,smallerEq:s.smallerEq,typed:s.typed}),row:(0,o.createRowTransform)({Index:s.Index,matrix:s.matrix,range:s.range,typed:s.typed}),sum:(0,o.createSumTransform)({add:s.add,config:i.config,numeric:s.numeric,typed:s.typed}),column:(0,o.createColumnTransform)({Index:s.Index,matrix:s.matrix,range:s.range,typed:s.typed}),mean:(0,o.createMeanTransform)({add:s.add,divide:s.divide,typed:s.typed}),variance:(0,o.createVarianceTransform)({add:s.add,apply:s.apply,divide:s.divide,isNaN:s.isNaN,multiply:s.multiply,subtract:s.subtract,typed:s.typed}),std:(0,o.createStdTransform)({sqrt:s.sqrt,typed:s.typed,variance:s.variance})}),(0,a.default)(f,{BigNumber:s.BigNumber,Chain:p,Complex:s.Complex,Fraction:s.Fraction,Matrix:s.Matrix,Node:h,ObjectNode:d,OperatorNode:m,ParenthesisNode:g,Range:s.Range,RelationalNode:y,ResultSet:s.ResultSet,ArrayNode:v,BlockNode:b,ConditionalNode:x,ConstantNode:_,DenseMatrix:s.DenseMatrix,RangeNode:w,FunctionAssignmentNode:T,SparseMatrix:s.SparseMatrix,AccessorNode:A,AssignmentNode:S,ImmutableDenseMatrix:s.ImmutableDenseMatrix,Index:s.Index,IndexNode:M,FibonacciHeap:s.FibonacciHeap,Unit:s.Unit,Spa:s.Spa,SymbolNode:E,FunctionNode:C,Help:P,Parser:R}),p.createProxy(c)},7649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={config:!0,IndexError:!0,DimensionError:!0,ArgumentsError:!0,create:!0,factory:!0};Object.defineProperty(t,"ArgumentsError",{enumerable:!0,get:function(){return u.ArgumentsError}}),Object.defineProperty(t,"DimensionError",{enumerable:!0,get:function(){return c.DimensionError}}),Object.defineProperty(t,"IndexError",{enumerable:!0,get:function(){return l.IndexError}}),Object.defineProperty(t,"config",{enumerable:!0,get:function(){return a.config}}),Object.defineProperty(t,"create",{enumerable:!0,get:function(){return h.create}}),Object.defineProperty(t,"factory",{enumerable:!0,get:function(){return d.factory}});var a=r(39006),i=r(32876);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}));var o=r(17876);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var s=r(14893);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var l=r(14452),c=r(12906),u=r(91245),f=r(33765);Object.keys(f).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===f[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return f[e]}}))}));var p=r(59884);Object.keys(p).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===p[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return p[e]}}))}));var h=r(17901),d=r(58450)},32876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.electricConstant=t.eigs=t.efimovFactor=t.e=t.dotPow=t.dotMultiply=t.dotDivide=t.dot=t.divideScalar=t.divide=t.distance=t.diff=t.diag=t.deuteronMass=t.det=t.deepEqual=t.cube=t.ctranspose=t.csch=t.csc=t.cross=t.createUnit=t.count=t.coulomb=t.coth=t.cot=t.cosh=t.cos=t.conj=t.conductanceQuantum=t.concat=t.composition=t.complex=t.compareText=t.compareNatural=t.compare=t.combinationsWithRep=t.combinations=t.column=t.clone=t.classicalElectronRadius=t.ceil=t.cbrt=t.catalan=t.boolean=t.boltzmann=t.bohrRadius=t.bohrMagneton=t.bitXor=t.bitOr=t.bitNot=t.bitAnd=t.bin=t.bignumber=t.bellNumbers=t.avogadro=t.atomicMass=t.atanh=t.atan2=t.atan=t.asinh=t.asin=t.asech=t.asec=t.arg=t.apply=t.and=t.addScalar=t.add=t.acsch=t.acsc=t.acoth=t.acot=t.acosh=t.acos=t.abs=t._true=t._null=t._false=t._NaN=t._Infinity=t.Unit=t.SparseMatrix=t.Spa=t.SQRT2=t.SQRT1_2=t.ResultSet=t.Range=t.Matrix=t.LOG2E=t.LOG10E=t.LN2=t.LN10=t.Index=t.ImmutableDenseMatrix=t.Fraction=t.FibonacciHeap=t.DenseMatrix=t.Complex=t.BigNumber=void 0,t.planckConstant=t.planckCharge=t.pickRandom=t.pi=t.phi=t.permutations=t.partitionSelect=t.or=t.ones=t.oct=t.numeric=t.number=t.nuclearMagneton=t.nthRoots=t.nthRoot=t.not=t.norm=t.neutronMass=t.multiplyScalar=t.multiply=t.multinomial=t.molarVolume=t.molarPlanckConstant=t.molarMassC12=t.molarMass=t.mode=t.mod=t.min=t.median=t.mean=t.max=t.matrixFromRows=t.matrixFromFunction=t.matrixFromColumns=t.matrix=t.map=t.magneticFluxQuantum=t.magneticConstant=t.mad=t.lusolve=t.lup=t.lsolveAll=t.lsolve=t.loschmidt=t.log2=t.log1p=t.log10=t.log=t.leftShift=t.lcm=t.largerEq=t.larger=t.kron=t.klitzing=t.kldivergence=t.isZero=t.isPrime=t.isPositive=t.isNumeric=t.isNegative=t.isNaN=t.isInteger=t.inverseConductanceQuantum=t.inv=t.intersect=t.index=t.im=t.identity=t.i=t.hypot=t.hex=t.hasNumericValue=t.hartreeEnergy=t.gravity=t.gravitationConstant=t.getMatrixDataType=t.gcd=t.gasConstant=t.gamma=t.fraction=t.format=t.forEach=t.floor=t.flatten=t.fix=t.firstRadiation=t.fineStructure=t.filter=t.fermiCoupling=t.faraday=t.factorial=t.expm1=t.expm=t.exp=t.erf=t.equalText=t.equalScalar=t.equal=t.elementaryCharge=t.electronMass=t.electricConstant=t.eigs=t.efimovFactor=t.e=t.dotPow=t.dotMultiply=t.dotDivide=t.dot=t.divideScalar=t.divide=t.distance=t.diff=t.diag=t.deuteronMass=t.det=t.deepEqual=t.cube=t.ctranspose=t.csch=t.csc=t.cross=t.createUnit=t.count=t.coulomb=t.coth=t.cot=t.cosh=t.cos=t.conj=t.conductanceQuantum=t.concat=t.composition=t.complex=t.compareText=t.compareNatural=t.compare=t.combinationsWithRep=t.combinations=t.column=t.clone=t.classicalElectronRadius=t.ceil=t.cbrt=t.catalan=t.boolean=t.boltzmann=t.bohrRadius=t.bohrMagneton=t.bitXor=t.bitOr=t.bitNot=t.bitAnd=t.bin=t.bignumber=t.bellNumbers=t.avogadro=t.atomicMass=t.atanh=t.atan2=t.atan=t.asinh=t.asin=t.asech=t.asec=t.arg=t.apply=t.and=t.addScalar=t.add=t.acsch=t.acsc=t.acoth=t.acot=t.acosh=t.acos=t.abs=t._true=t._null=t._false=t._NaN=t._Infinity=t.Unit=t.SparseMatrix=t.Spa=t.SQRT2=t.SQRT1_2=t.ResultSet=t.Range=t.Matrix=t.LOG2E=t.LOG10E=t.LN2=t.LN10=t.Index=t.ImmutableDenseMatrix=t.Fraction=t.FibonacciHeap=t.DenseMatrix=t.Complex=t.BigNumber=void 0,t.zeros=t.xor=t.xgcd=t.wienDisplacement=t.weakMixingAngle=t.version=t.variance=t.vacuumImpedance=t.usolveAll=t.usolve=t.unit=t.unequal=t.unaryPlus=t.unaryMinus=t.typed=t.typeOf=t.transpose=t.trace=t.to=t.thomsonCrossSection=t.tau=t.tanh=t.tan=t.sum=t.subtract=t.subset=t.string=t.stirlingS2=t.stefanBoltzmann=t.std=t.squeeze=t.square=t.sqrtm=t.sqrt=t.splitUnit=t.speedOfLight=t.sparse=t.sort=t.smallerEq=t.smaller=t.slu=t.size=t.sinh=t.sin=t.sign=t.setUnion=t.setSymDifference=t.setSize=t.setPowerset=t.setMultiplicity=t.setIsSubset=t.setIntersect=t.setDistinct=t.setDifference=t.setCartesian=t.secondRadiation=t.sech=t.sec=t.sackurTetrode=t.rydberg=t.row=t.round=t.rotationMatrix=t.rotate=t.rightLogShift=t.rightArithShift=t.resize=t.reshape=t.replacer=t.reducedPlanckConstant=t.re=t.range=t.randomInt=t.random=t.quantumOfCirculation=t.quantileSeq=t.qr=t.protonMass=t.prod=t.print=t.pow=t.planckTime=t.planckTemperature=t.planckMass=t.planckLength=t.planckConstant=t.planckCharge=t.pickRandom=t.pi=t.phi=t.permutations=t.partitionSelect=t.or=t.ones=t.oct=t.numeric=t.number=t.nuclearMagneton=t.nthRoots=t.nthRoot=t.not=t.norm=t.neutronMass=t.multiplyScalar=t.multiply=t.multinomial=t.molarVolume=t.molarPlanckConstant=t.molarMassC12=t.molarMass=t.mode=t.mod=t.min=t.median=t.mean=t.max=t.matrixFromRows=t.matrixFromFunction=t.matrixFromColumns=t.matrix=t.map=t.magneticFluxQuantum=t.magneticConstant=t.mad=t.lusolve=t.lup=t.lsolveAll=t.lsolve=t.loschmidt=t.log2=t.log1p=t.log10=t.log=t.leftShift=t.lcm=t.largerEq=t.larger=t.kron=t.klitzing=t.kldivergence=t.isZero=t.isPrime=t.isPositive=t.isNumeric=t.isNegative=t.isNaN=t.isInteger=t.inverseConductanceQuantum=t.inv=t.intersect=t.index=t.im=t.identity=t.i=t.hypot=t.hex=t.hasNumericValue=t.hartreeEnergy=t.gravity=t.gravitationConstant=t.getMatrixDataType=t.gcd=t.gasConstant=t.gamma=t.fraction=t.format=t.forEach=t.floor=t.flatten=t.fix=t.firstRadiation=t.fineStructure=t.filter=t.fermiCoupling=t.faraday=t.factorial=t.expm1=t.expm=t.exp=t.erf=t.equalText=t.equalScalar=t.equal=t.elementaryCharge=t.electronMass=t.electricConstant=t.eigs=t.efimovFactor=t.e=t.dotPow=t.dotMultiply=t.dotDivide=t.dot=t.divideScalar=t.divide=t.distance=t.diff=t.diag=t.deuteronMass=t.det=t.deepEqual=t.cube=t.ctranspose=t.csch=t.csc=t.cross=t.createUnit=t.count=t.coulomb=t.coth=t.cot=t.cosh=t.cos=t.conj=t.conductanceQuantum=t.concat=t.composition=t.complex=t.compareText=t.compareNatural=t.compare=t.combinationsWithRep=t.combinations=t.column=t.clone=t.classicalElectronRadius=t.ceil=t.cbrt=t.catalan=t.boolean=t.boltzmann=t.bohrRadius=t.bohrMagneton=t.bitXor=t.bitOr=t.bitNot=t.bitAnd=t.bin=t.bignumber=t.bellNumbers=t.avogadro=t.atomicMass=t.atanh=t.atan2=t.atan=t.asinh=t.asin=t.asech=t.asec=t.arg=t.apply=t.and=t.addScalar=t.add=t.acsch=t.acsc=t.acoth=t.acot=t.acosh=t.acos=t.abs=t._true=t._null=t._false=t._NaN=t._Infinity=t.Unit=t.SparseMatrix=t.Spa=t.SQRT2=t.SQRT1_2=t.ResultSet=t.Range=t.Matrix=t.LOG2E=t.LOG10E=t.LN2=t.LN10=t.Index=t.ImmutableDenseMatrix=t.Fraction=t.FibonacciHeap=t.DenseMatrix=t.Complex=t.BigNumber=void 0;var n=r(39006),a=r(59884),i=(0,a.createBigNumberClass)({config:n.config});t.BigNumber=i;var o=(0,a.createComplexClass)({});t.Complex=o;var s=(0,a.createE)({BigNumber:i,config:n.config});t.e=s;var l=(0,a.createFalse)({});t._false=l;var c=(0,a.createFineStructure)({BigNumber:i,config:n.config});t.fineStructure=c;var u=(0,a.createFractionClass)({});t.Fraction=u;var f=(0,a.createI)({Complex:o});t.i=f;var p=(0,a.createInfinity)({BigNumber:i,config:n.config});t._Infinity=p;var h=(0,a.createLN10)({BigNumber:i,config:n.config});t.LN10=h;var d=(0,a.createLOG10E)({BigNumber:i,config:n.config});t.LOG10E=d;var m=(0,a.createMatrixClass)({});t.Matrix=m;var g=(0,a.createNaN)({BigNumber:i,config:n.config});t._NaN=g;var y=(0,a.createNull)({});t._null=y;var v=(0,a.createPhi)({BigNumber:i,config:n.config});t.phi=v;var b=(0,a.createRangeClass)({});t.Range=b;var x=(0,a.createResultSet)({});t.ResultSet=x;var _=(0,a.createSQRT1_2)({BigNumber:i,config:n.config});t.SQRT1_2=_;var w=(0,a.createSackurTetrode)({BigNumber:i,config:n.config});t.sackurTetrode=w;var k=(0,a.createTau)({BigNumber:i,config:n.config});t.tau=k;var D=(0,a.createTrue)({});t._true=D;var T=(0,a.createVersion)({});t.version=T;var A=(0,a.createDenseMatrixClass)({Matrix:m});t.DenseMatrix=A;var S=(0,a.createEfimovFactor)({BigNumber:i,config:n.config});t.efimovFactor=S;var M=(0,a.createLN2)({BigNumber:i,config:n.config});t.LN2=M;var E=(0,a.createPi)({BigNumber:i,config:n.config});t.pi=E;var C=(0,a.createReplacer)({});t.replacer=C;var N=(0,a.createSQRT2)({BigNumber:i,config:n.config});t.SQRT2=N;var O=(0,a.createTyped)({BigNumber:i,Complex:o,DenseMatrix:A,Fraction:u});t.typed=O;var I=(0,a.createUnaryPlus)({BigNumber:i,config:n.config,typed:O});t.unaryPlus=I;var P=(0,a.createWeakMixingAngle)({BigNumber:i,config:n.config});t.weakMixingAngle=P;var R=(0,a.createAbs)({typed:O});t.abs=R;var L=(0,a.createAcos)({Complex:o,config:n.config,typed:O});t.acos=L;var F=(0,a.createAcot)({BigNumber:i,typed:O});t.acot=F;var B=(0,a.createAcsc)({BigNumber:i,Complex:o,config:n.config,typed:O});t.acsc=B;var z=(0,a.createAddScalar)({typed:O});t.addScalar=z;var j=(0,a.createArg)({typed:O});t.arg=j;var U=(0,a.createAsech)({BigNumber:i,Complex:o,config:n.config,typed:O});t.asech=U;var $=(0,a.createAsinh)({typed:O});t.asinh=$;var V=(0,a.createAtan)({typed:O});t.atan=V;var q=(0,a.createAtanh)({Complex:o,config:n.config,typed:O});t.atanh=q;var W=(0,a.createBignumber)({BigNumber:i,typed:O});t.bignumber=W;var H=(0,a.createBitNot)({typed:O});t.bitNot=H;var G=(0,a.createBoolean)({typed:O});t.boolean=G;var X=(0,a.createClone)({typed:O});t.clone=X;var Y=(0,a.createCombinations)({typed:O});t.combinations=Y;var Z=(0,a.createComplex)({Complex:o,typed:O});t.complex=Z;var K=(0,a.createConj)({typed:O});t.conj=K;var J=(0,a.createCosh)({typed:O});t.cosh=J;var Q=(0,a.createCoth)({BigNumber:i,typed:O});t.coth=Q;var ee=(0,a.createCsc)({BigNumber:i,typed:O});t.csc=ee;var te=(0,a.createCube)({typed:O});t.cube=te;var re=(0,a.createEqualScalar)({config:n.config,typed:O});t.equalScalar=re;var ne=(0,a.createErf)({typed:O});t.erf=ne;var ae=(0,a.createExp)({typed:O});t.exp=ae;var ie=(0,a.createExpm1)({Complex:o,typed:O});t.expm1=ie;var oe=(0,a.createFilter)({typed:O});t.filter=oe;var se=(0,a.createForEach)({typed:O});t.forEach=se;var le=(0,a.createFormat)({typed:O});t.format=le;var ce=(0,a.createGetMatrixDataType)({typed:O});t.getMatrixDataType=ce;var ue=(0,a.createHex)({format:le,typed:O});t.hex=ue;var fe=(0,a.createIm)({typed:O});t.im=fe;var pe=(0,a.createIsInteger)({typed:O});t.isInteger=pe;var he=(0,a.createIsNegative)({typed:O});t.isNegative=he;var de=(0,a.createIsPositive)({typed:O});t.isPositive=de;var me=(0,a.createIsZero)({typed:O});t.isZero=me;var ge=(0,a.createLOG2E)({BigNumber:i,config:n.config});t.LOG2E=ge;var ye=(0,a.createLog10)({Complex:o,config:n.config,typed:O});t.log10=ye;var ve=(0,a.createLog2)({Complex:o,config:n.config,typed:O});t.log2=ve;var be=(0,a.createMap)({typed:O});t.map=be;var xe=(0,a.createMultiplyScalar)({typed:O});t.multiplyScalar=xe;var _e=(0,a.createNot)({typed:O});t.not=_e;var we=(0,a.createNumber)({typed:O});t.number=we;var ke=(0,a.createOct)({format:le,typed:O});t.oct=ke;var De=(0,a.createPickRandom)({config:n.config,typed:O});t.pickRandom=De;var Te=(0,a.createPrint)({typed:O});t.print=Te;var Ae=(0,a.createRandom)({config:n.config,typed:O});t.random=Ae;var Se=(0,a.createRe)({typed:O});t.re=Se;var Me=(0,a.createSec)({BigNumber:i,typed:O});t.sec=Me;var Ee=(0,a.createSign)({BigNumber:i,Fraction:u,complex:Z,typed:O});t.sign=Ee;var Ce=(0,a.createSin)({typed:O});t.sin=Ce;var Ne=(0,a.createSparseMatrixClass)({Matrix:m,equalScalar:re,typed:O});t.SparseMatrix=Ne;var Oe=(0,a.createSplitUnit)({typed:O});t.splitUnit=Oe;var Ie=(0,a.createSquare)({typed:O});t.square=Ie;var Pe=(0,a.createString)({typed:O});t.string=Pe;var Re=(0,a.createTan)({typed:O});t.tan=Re;var Le=(0,a.createTypeOf)({typed:O});t.typeOf=Le;var Fe=(0,a.createAcosh)({Complex:o,config:n.config,typed:O});t.acosh=Fe;var Be=(0,a.createAcsch)({BigNumber:i,typed:O});t.acsch=Be;var ze=(0,a.createApply)({isInteger:pe,typed:O});t.apply=ze;var je=(0,a.createAsec)({BigNumber:i,Complex:o,config:n.config,typed:O});t.asec=je;var Ue=(0,a.createBin)({format:le,typed:O});t.bin=Ue;var $e=(0,a.createCombinationsWithRep)({typed:O});t.combinationsWithRep=$e;var Ve=(0,a.createCos)({typed:O});t.cos=Ve;var qe=(0,a.createCsch)({BigNumber:i,typed:O});t.csch=qe;var We=(0,a.createIsNaN)({typed:O});t.isNaN=We;var He=(0,a.createIsPrime)({typed:O});t.isPrime=He;var Ge=(0,a.createRandomInt)({config:n.config,typed:O});t.randomInt=Ge;var Xe=(0,a.createSech)({BigNumber:i,typed:O});t.sech=Xe;var Ye=(0,a.createSinh)({typed:O});t.sinh=Ye;var Ze=(0,a.createSparse)({SparseMatrix:Ne,typed:O});t.sparse=Ze;var Ke=(0,a.createSqrt)({Complex:o,config:n.config,typed:O});t.sqrt=Ke;var Je=(0,a.createTanh)({typed:O});t.tanh=Je;var Qe=(0,a.createUnaryMinus)({typed:O});t.unaryMinus=Qe;var et=(0,a.createAcoth)({BigNumber:i,Complex:o,config:n.config,typed:O});t.acoth=et;var tt=(0,a.createCot)({BigNumber:i,typed:O});t.cot=tt;var rt=(0,a.createFraction)({Fraction:u,typed:O});t.fraction=rt;var nt=(0,a.createIsNumeric)({typed:O});t.isNumeric=nt;var at=(0,a.createMatrix)({DenseMatrix:A,Matrix:m,SparseMatrix:Ne,typed:O});t.matrix=at;var it=(0,a.createMatrixFromFunction)({isZero:me,matrix:at,typed:O});t.matrixFromFunction=it;var ot=(0,a.createMod)({DenseMatrix:A,equalScalar:re,matrix:at,typed:O});t.mod=ot;var st=(0,a.createNthRoot)({BigNumber:i,equalScalar:re,matrix:at,typed:O});t.nthRoot=st;var lt=(0,a.createNumeric)({bignumber:W,fraction:rt,number:we});t.numeric=lt;var ct=(0,a.createOr)({DenseMatrix:A,equalScalar:re,matrix:at,typed:O});t.or=ct;var ut=(0,a.createProd)({config:n.config,multiplyScalar:xe,numeric:lt,typed:O});t.prod=ut;var ft=(0,a.createReshape)({isInteger:pe,matrix:at,typed:O});t.reshape=ft;var pt=(0,a.createSize)({matrix:at,config:n.config,typed:O});t.size=pt;var ht=(0,a.createSmaller)({DenseMatrix:A,config:n.config,matrix:at,typed:O});t.smaller=ht;var dt=(0,a.createSqueeze)({matrix:at,typed:O});t.squeeze=dt;var mt=(0,a.createSubset)({matrix:at,typed:O});t.subset=mt;var gt=(0,a.createSubtract)({DenseMatrix:A,addScalar:z,equalScalar:re,matrix:at,typed:O,unaryMinus:Qe});t.subtract=gt;var yt=(0,a.createTo)({matrix:at,typed:O});t.to=yt;var vt=(0,a.createTranspose)({matrix:at,typed:O});t.transpose=vt;var bt=(0,a.createXgcd)({BigNumber:i,config:n.config,matrix:at,typed:O});t.xgcd=bt;var xt=(0,a.createZeros)({BigNumber:i,config:n.config,matrix:at,typed:O});t.zeros=xt;var _t=(0,a.createAnd)({equalScalar:re,matrix:at,not:_e,typed:O,zeros:xt});t.and=_t;var wt=(0,a.createBitAnd)({equalScalar:re,matrix:at,typed:O});t.bitAnd=wt;var kt=(0,a.createBitXor)({DenseMatrix:A,matrix:at,typed:O});t.bitXor=kt;var Dt=(0,a.createCbrt)({BigNumber:i,Complex:o,Fraction:u,config:n.config,isNegative:he,matrix:at,typed:O,unaryMinus:Qe});t.cbrt=Dt;var Tt=(0,a.createCompare)({BigNumber:i,DenseMatrix:A,Fraction:u,config:n.config,equalScalar:re,matrix:at,typed:O});t.compare=Tt;var At=(0,a.createCompareText)({matrix:at,typed:O});t.compareText=At;var St=(0,a.createConcat)({isInteger:pe,matrix:at,typed:O});t.concat=St;var Mt=(0,a.createCount)({prod:ut,size:pt,typed:O});t.count=Mt;var Et=(0,a.createCtranspose)({conj:K,transpose:vt,typed:O});t.ctranspose=Et;var Ct=(0,a.createDiag)({DenseMatrix:A,SparseMatrix:Ne,matrix:at,typed:O});t.diag=Ct;var Nt=(0,a.createDivideScalar)({numeric:lt,typed:O});t.divideScalar=Nt;var Ot=(0,a.createDotDivide)({DenseMatrix:A,divideScalar:Nt,equalScalar:re,matrix:at,typed:O});t.dotDivide=Ot;var It=(0,a.createEqual)({DenseMatrix:A,equalScalar:re,matrix:at,typed:O});t.equal=It;var Pt=(0,a.createFlatten)({matrix:at,typed:O});t.flatten=Pt;var Rt=(0,a.createGcd)({BigNumber:i,DenseMatrix:A,equalScalar:re,matrix:at,typed:O});t.gcd=Rt;var Lt=(0,a.createHasNumericValue)({isNumeric:nt,typed:O});t.hasNumericValue=Lt;var Ft=(0,a.createHypot)({abs:R,addScalar:z,divideScalar:Nt,isPositive:de,multiplyScalar:xe,smaller:ht,sqrt:Ke,typed:O});t.hypot=Ft;var Bt=(0,a.createImmutableDenseMatrixClass)({DenseMatrix:A,smaller:ht});t.ImmutableDenseMatrix=Bt;var zt=(0,a.createIndexClass)({ImmutableDenseMatrix:Bt});t.Index=zt;var jt=(0,a.createKron)({matrix:at,multiplyScalar:xe,typed:O});t.kron=jt;var Ut=(0,a.createLargerEq)({DenseMatrix:A,config:n.config,matrix:at,typed:O});t.largerEq=Ut;var $t=(0,a.createLeftShift)({DenseMatrix:A,equalScalar:re,matrix:at,typed:O,zeros:xt});t.leftShift=$t;var Vt=(0,a.createLsolve)({DenseMatrix:A,divideScalar:Nt,equalScalar:re,matrix:at,multiplyScalar:xe,subtract:gt,typed:O});t.lsolve=Vt;var qt=(0,a.createMatrixFromColumns)({flatten:Pt,matrix:at,size:pt,typed:O});t.matrixFromColumns=qt;var Wt=(0,a.createMin)({config:n.config,numeric:lt,smaller:ht,typed:O});t.min=Wt;var Ht=(0,a.createMode)({isNaN:We,isNumeric:nt,typed:O});t.mode=Ht;var Gt=(0,a.createNthRoots)({Complex:o,config:n.config,divideScalar:Nt,typed:O});t.nthRoots=Gt;var Xt=(0,a.createOnes)({BigNumber:i,config:n.config,matrix:at,typed:O});t.ones=Xt;var Yt=(0,a.createPartitionSelect)({compare:Tt,isNaN:We,isNumeric:nt,typed:O});t.partitionSelect=Yt;var Zt=(0,a.createResize)({config:n.config,matrix:at});t.resize=Zt;var Kt=(0,a.createRightLogShift)({DenseMatrix:A,equalScalar:re,matrix:at,typed:O,zeros:xt});t.rightLogShift=Kt;var Jt=(0,a.createRound)({BigNumber:i,DenseMatrix:A,equalScalar:re,matrix:at,typed:O,zeros:xt});t.round=Jt;var Qt=(0,a.createSmallerEq)({DenseMatrix:A,config:n.config,matrix:at,typed:O});t.smallerEq=Qt;var er=(0,a.createUnequal)({DenseMatrix:A,config:n.config,equalScalar:re,matrix:at,typed:O});t.unequal=er;var tr=(0,a.createUsolve)({DenseMatrix:A,divideScalar:Nt,equalScalar:re,matrix:at,multiplyScalar:xe,subtract:gt,typed:O});t.usolve=tr;var rr=(0,a.createXor)({DenseMatrix:A,matrix:at,typed:O});t.xor=rr;var nr=(0,a.createAdd)({DenseMatrix:A,SparseMatrix:Ne,addScalar:z,equalScalar:re,matrix:at,typed:O});t.add=nr;var ar=(0,a.createAtan2)({BigNumber:i,DenseMatrix:A,equalScalar:re,matrix:at,typed:O});t.atan2=ar;var ir=(0,a.createBitOr)({DenseMatrix:A,equalScalar:re,matrix:at,typed:O});t.bitOr=ir;var or=(0,a.createCatalan)({addScalar:z,combinations:Y,divideScalar:Nt,isInteger:pe,isNegative:he,multiplyScalar:xe,typed:O});t.catalan=or;var sr=(0,a.createCompareNatural)({compare:Tt,typed:O});t.compareNatural=sr;var lr=(0,a.createDeepEqual)({equal:It,typed:O});t.deepEqual=lr;var cr=(0,a.createDiff)({matrix:at,number:we,subtract:gt,typed:O});t.diff=cr;var ur=(0,a.createDot)({addScalar:z,conj:K,multiplyScalar:xe,size:pt,typed:O});t.dot=ur;var fr=(0,a.createEqualText)({compareText:At,isZero:me,typed:O});t.equalText=fr;var pr=(0,a.createFloor)({config:n.config,equalScalar:re,matrix:at,round:Jt,typed:O});t.floor=pr;var hr=(0,a.createIdentity)({BigNumber:i,DenseMatrix:A,SparseMatrix:Ne,config:n.config,matrix:at,typed:O});t.identity=hr;var dr=(0,a.createLarger)({DenseMatrix:A,config:n.config,matrix:at,typed:O});t.larger=dr;var mr=(0,a.createLog)({Complex:o,config:n.config,divideScalar:Nt,typed:O});t.log=mr;var gr=(0,a.createLsolveAll)({DenseMatrix:A,divideScalar:Nt,equalScalar:re,matrix:at,multiplyScalar:xe,subtract:gt,typed:O});t.lsolveAll=gr;var yr=(0,a.createMatrixFromRows)({flatten:Pt,matrix:at,size:pt,typed:O});t.matrixFromRows=yr;var vr=(0,a.createMultiply)({addScalar:z,dot:ur,equalScalar:re,matrix:at,multiplyScalar:xe,typed:O});t.multiply=vr;var br=(0,a.createPow)({Complex:o,config:n.config,fraction:rt,identity:hr,matrix:at,multiply:vr,number:we,typed:O});t.pow=br;var xr=(0,a.createQr)({addScalar:z,complex:Z,conj:K,divideScalar:Nt,equal:It,identity:hr,isZero:me,matrix:at,multiplyScalar:xe,sign:Ee,sqrt:Ke,subtract:gt,typed:O,unaryMinus:Qe,zeros:xt});t.qr=xr;var _r=(0,a.createRange)({bignumber:W,matrix:at,config:n.config,larger:dr,largerEq:Ut,smaller:ht,smallerEq:Qt,typed:O});t.range=_r;var wr=(0,a.createRightArithShift)({DenseMatrix:A,equalScalar:re,matrix:at,typed:O,zeros:xt});t.rightArithShift=wr;var kr=(0,a.createRow)({Index:zt,matrix:at,range:_r,typed:O});t.row=kr;var Dr=(0,a.createSetCartesian)({DenseMatrix:A,Index:zt,compareNatural:sr,size:pt,subset:mt,typed:O});t.setCartesian=Dr;var Tr=(0,a.createSetDistinct)({DenseMatrix:A,Index:zt,compareNatural:sr,size:pt,subset:mt,typed:O});t.setDistinct=Tr;var Ar=(0,a.createSetIsSubset)({Index:zt,compareNatural:sr,size:pt,subset:mt,typed:O});t.setIsSubset=Ar;var Sr=(0,a.createSetPowerset)({Index:zt,compareNatural:sr,size:pt,subset:mt,typed:O});t.setPowerset=Sr;var Mr=(0,a.createSlu)({SparseMatrix:Ne,abs:R,add:nr,divideScalar:Nt,larger:dr,largerEq:Ut,multiply:vr,subtract:gt,transpose:vt,typed:O});t.slu=Mr;var Er=(0,a.createSum)({add:nr,config:n.config,numeric:lt,typed:O});t.sum=Er;var Cr=(0,a.createTrace)({add:nr,matrix:at,typed:O});t.trace=Cr;var Nr=(0,a.createUsolveAll)({DenseMatrix:A,divideScalar:Nt,equalScalar:re,matrix:at,multiplyScalar:xe,subtract:gt,typed:O});t.usolveAll=Nr;var Or=(0,a.createAsin)({Complex:o,config:n.config,typed:O});t.asin=Or;var Ir=(0,a.createCeil)({config:n.config,equalScalar:re,matrix:at,round:Jt,typed:O});t.ceil=Ir;var Pr=(0,a.createColumn)({Index:zt,matrix:at,range:_r,typed:O});t.column=Pr;var Rr=(0,a.createComposition)({addScalar:z,combinations:Y,isInteger:pe,isNegative:he,isPositive:de,larger:dr,typed:O});t.composition=Rr;var Lr=(0,a.createCross)({matrix:at,multiply:vr,subtract:gt,typed:O});t.cross=Lr;var Fr=(0,a.createDistance)({abs:R,addScalar:z,divideScalar:Nt,multiplyScalar:xe,sqrt:Ke,subtract:gt,typed:O,unaryMinus:Qe});t.distance=Fr;var Br=(0,a.createDotMultiply)({equalScalar:re,matrix:at,multiplyScalar:xe,typed:O});t.dotMultiply=Br;var zr=(0,a.createFibonacciHeapClass)({larger:dr,smaller:ht});t.FibonacciHeap=zr;var jr=(0,a.createFix)({Complex:o,ceil:Ir,floor:pr,matrix:at,typed:O});t.fix=jr;var Ur=(0,a.createGamma)({BigNumber:i,Complex:o,config:n.config,multiplyScalar:xe,pow:br,typed:O});t.gamma=Ur;var $r=(0,a.createIndex)({Index:zt,typed:O});t.index=$r;var Vr=(0,a.createLcm)({equalScalar:re,matrix:at,typed:O});t.lcm=Vr;var qr=(0,a.createMax)({config:n.config,larger:dr,numeric:lt,typed:O});t.max=qr;var Wr=(0,a.createQuantileSeq)({add:nr,compare:Tt,multiply:vr,partitionSelect:Yt,typed:O});t.quantileSeq=Wr;var Hr=(0,a.createSetDifference)({DenseMatrix:A,Index:zt,compareNatural:sr,size:pt,subset:mt,typed:O});t.setDifference=Hr;var Gr=(0,a.createSetMultiplicity)({Index:zt,compareNatural:sr,size:pt,subset:mt,typed:O});t.setMultiplicity=Gr;var Xr=(0,a.createSetSymDifference)({Index:zt,concat:St,setDifference:Hr,size:pt,subset:mt,typed:O});t.setSymDifference=Xr;var Yr=(0,a.createSort)({compare:Tt,compareNatural:sr,matrix:at,typed:O});t.sort=Yr;var Zr=(0,a.createUnitClass)({BigNumber:i,Complex:o,Fraction:u,abs:R,addScalar:z,config:n.config,divideScalar:Nt,equal:It,fix:jr,format:le,isNumeric:nt,multiplyScalar:xe,number:we,pow:br,round:Jt,subtract:gt});t.Unit=Zr;var Kr=(0,a.createVacuumImpedance)({BigNumber:i,Unit:Zr,config:n.config});t.vacuumImpedance=Kr;var Jr=(0,a.createWienDisplacement)({BigNumber:i,Unit:Zr,config:n.config});t.wienDisplacement=Jr;var Qr=(0,a.createAtomicMass)({BigNumber:i,Unit:Zr,config:n.config});t.atomicMass=Qr;var en=(0,a.createBohrMagneton)({BigNumber:i,Unit:Zr,config:n.config});t.bohrMagneton=en;var tn=(0,a.createBoltzmann)({BigNumber:i,Unit:Zr,config:n.config});t.boltzmann=tn;var rn=(0,a.createConductanceQuantum)({BigNumber:i,Unit:Zr,config:n.config});t.conductanceQuantum=rn;var nn=(0,a.createCreateUnit)({Unit:Zr,typed:O});t.createUnit=nn;var an=(0,a.createDeuteronMass)({BigNumber:i,Unit:Zr,config:n.config});t.deuteronMass=an;var on=(0,a.createDotPow)({DenseMatrix:A,equalScalar:re,matrix:at,pow:br,typed:O});t.dotPow=on;var sn=(0,a.createElectricConstant)({BigNumber:i,Unit:Zr,config:n.config});t.electricConstant=sn;var ln=(0,a.createElementaryCharge)({BigNumber:i,Unit:Zr,config:n.config});t.elementaryCharge=ln;var cn=(0,a.createFactorial)({gamma:Ur,typed:O});t.factorial=cn;var un=(0,a.createFermiCoupling)({BigNumber:i,Unit:Zr,config:n.config});t.fermiCoupling=un;var fn=(0,a.createGasConstant)({BigNumber:i,Unit:Zr,config:n.config});t.gasConstant=fn;var pn=(0,a.createGravity)({BigNumber:i,Unit:Zr,config:n.config});t.gravity=pn;var hn=(0,a.createIntersect)({abs:R,add:nr,addScalar:z,config:n.config,divideScalar:Nt,equalScalar:re,flatten:Pt,matrix:at,multiply:vr,multiplyScalar:xe,smaller:ht,subtract:gt,typed:O});t.intersect=hn;var dn=(0,a.createInverseConductanceQuantum)({BigNumber:i,Unit:Zr,config:n.config});t.inverseConductanceQuantum=dn;var mn=(0,a.createKlitzing)({BigNumber:i,Unit:Zr,config:n.config});t.klitzing=mn;var gn=(0,a.createLoschmidt)({BigNumber:i,Unit:Zr,config:n.config});t.loschmidt=gn;var yn=(0,a.createMagneticConstant)({BigNumber:i,Unit:Zr,config:n.config});t.magneticConstant=yn;var vn=(0,a.createMolarMass)({BigNumber:i,Unit:Zr,config:n.config});t.molarMass=vn;var bn=(0,a.createMolarPlanckConstant)({BigNumber:i,Unit:Zr,config:n.config});t.molarPlanckConstant=bn;var xn=(0,a.createNeutronMass)({BigNumber:i,Unit:Zr,config:n.config});t.neutronMass=xn;var _n=(0,a.createNuclearMagneton)({BigNumber:i,Unit:Zr,config:n.config});t.nuclearMagneton=_n;var wn=(0,a.createPermutations)({factorial:cn,typed:O});t.permutations=wn;var kn=(0,a.createPlanckConstant)({BigNumber:i,Unit:Zr,config:n.config});t.planckConstant=kn;var Dn=(0,a.createPlanckMass)({BigNumber:i,Unit:Zr,config:n.config});t.planckMass=Dn;var Tn=(0,a.createPlanckTime)({BigNumber:i,Unit:Zr,config:n.config});t.planckTime=Tn;var An=(0,a.createQuantumOfCirculation)({BigNumber:i,Unit:Zr,config:n.config});t.quantumOfCirculation=An;var Sn=(0,a.createReducedPlanckConstant)({BigNumber:i,Unit:Zr,config:n.config});t.reducedPlanckConstant=Sn;var Mn=(0,a.createRydberg)({BigNumber:i,Unit:Zr,config:n.config});t.rydberg=Mn;var En=(0,a.createSetIntersect)({DenseMatrix:A,Index:zt,compareNatural:sr,size:pt,subset:mt,typed:O});t.setIntersect=En;var Cn=(0,a.createSetUnion)({Index:zt,concat:St,setIntersect:En,setSymDifference:Xr,size:pt,subset:mt,typed:O});t.setUnion=Cn;var Nn=(0,a.createSpaClass)({FibonacciHeap:zr,addScalar:z,equalScalar:re});t.Spa=Nn;var On=(0,a.createStefanBoltzmann)({BigNumber:i,Unit:Zr,config:n.config});t.stefanBoltzmann=On;var In=(0,a.createUnitFunction)({Unit:Zr,typed:O});t.unit=In;var Pn=(0,a.createAvogadro)({BigNumber:i,Unit:Zr,config:n.config});t.avogadro=Pn;var Rn=(0,a.createBohrRadius)({BigNumber:i,Unit:Zr,config:n.config});t.bohrRadius=Rn;var Ln=(0,a.createCoulomb)({BigNumber:i,Unit:Zr,config:n.config});t.coulomb=Ln;var Fn=(0,a.createElectronMass)({BigNumber:i,Unit:Zr,config:n.config});t.electronMass=Fn;var Bn=(0,a.createFaraday)({BigNumber:i,Unit:Zr,config:n.config});t.faraday=Bn;var zn=(0,a.createHartreeEnergy)({BigNumber:i,Unit:Zr,config:n.config});t.hartreeEnergy=zn;var jn=(0,a.createLog1p)({Complex:o,config:n.config,divideScalar:Nt,log:mr,typed:O});t.log1p=jn;var Un=(0,a.createMagneticFluxQuantum)({BigNumber:i,Unit:Zr,config:n.config});t.magneticFluxQuantum=Un;var $n=(0,a.createMolarMassC12)({BigNumber:i,Unit:Zr,config:n.config});t.molarMassC12=$n;var Vn=(0,a.createPlanckCharge)({BigNumber:i,Unit:Zr,config:n.config});t.planckCharge=Vn;var qn=(0,a.createPlanckTemperature)({BigNumber:i,Unit:Zr,config:n.config});t.planckTemperature=qn;var Wn=(0,a.createSecondRadiation)({BigNumber:i,Unit:Zr,config:n.config});t.secondRadiation=Wn;var Hn=(0,a.createSpeedOfLight)({BigNumber:i,Unit:Zr,config:n.config});t.speedOfLight=Hn;var Gn=(0,a.createStirlingS2)({addScalar:z,combinations:Y,divideScalar:Nt,factorial:cn,isInteger:pe,isNegative:he,larger:dr,multiplyScalar:xe,pow:br,subtract:gt,typed:O});t.stirlingS2=Gn;var Xn=(0,a.createBellNumbers)({addScalar:z,isInteger:pe,isNegative:he,stirlingS2:Gn,typed:O});t.bellNumbers=Xn;var Yn=(0,a.createFirstRadiation)({BigNumber:i,Unit:Zr,config:n.config});t.firstRadiation=Yn;var Zn=(0,a.createLup)({DenseMatrix:A,Spa:Nn,SparseMatrix:Ne,abs:R,addScalar:z,divideScalar:Nt,equalScalar:re,larger:dr,matrix:at,multiplyScalar:xe,subtract:gt,typed:O,unaryMinus:Qe});t.lup=Zn;var Kn=(0,a.createMolarVolume)({BigNumber:i,Unit:Zr,config:n.config});t.molarVolume=Kn;var Jn=(0,a.createProtonMass)({BigNumber:i,Unit:Zr,config:n.config});t.protonMass=Jn;var Qn=(0,a.createSetSize)({compareNatural:sr,typed:O});t.setSize=Qn;var ea=(0,a.createThomsonCrossSection)({BigNumber:i,Unit:Zr,config:n.config});t.thomsonCrossSection=ea;var ta=(0,a.createClassicalElectronRadius)({BigNumber:i,Unit:Zr,config:n.config});t.classicalElectronRadius=ta;var ra=(0,a.createDet)({lup:Zn,matrix:at,multiply:vr,subtract:gt,typed:O,unaryMinus:Qe});t.det=ra;var na=(0,a.createGravitationConstant)({BigNumber:i,Unit:Zr,config:n.config});t.gravitationConstant=na;var aa=(0,a.createInv)({abs:R,addScalar:z,det:ra,divideScalar:Nt,identity:hr,matrix:at,multiply:vr,typed:O,unaryMinus:Qe});t.inv=aa;var ia=(0,a.createLusolve)({DenseMatrix:A,lsolve:Vt,lup:Zn,matrix:at,slu:Mr,typed:O,usolve:tr});t.lusolve=ia;var oa=(0,a.createSqrtm)({abs:R,add:nr,identity:hr,inv:aa,max:qr,multiply:vr,size:pt,sqrt:Ke,subtract:gt,typed:O});t.sqrtm=oa;var sa=(0,a.createDivide)({divideScalar:Nt,equalScalar:re,inv:aa,matrix:at,multiply:vr,typed:O});t.divide=sa;var la=(0,a.createExpm)({abs:R,add:nr,identity:hr,inv:aa,multiply:vr,typed:O});t.expm=la;var ca=(0,a.createKldivergence)({divide:sa,dotDivide:Ot,isNumeric:nt,log:mr,matrix:at,multiply:vr,sum:Er,typed:O});t.kldivergence=ca;var ua=(0,a.createMean)({add:nr,divide:sa,typed:O});t.mean=ua;var fa=(0,a.createMedian)({add:nr,compare:Tt,divide:sa,partitionSelect:Yt,typed:O});t.median=fa;var pa=(0,a.createPlanckLength)({BigNumber:i,Unit:Zr,config:n.config});t.planckLength=pa;var ha=(0,a.createVariance)({add:nr,apply:ze,divide:sa,isNaN:We,multiply:vr,subtract:gt,typed:O});t.variance=ha;var da=(0,a.createStd)({sqrt:Ke,typed:O,variance:ha});t.std=da;var ma=(0,a.createEigs)({abs:R,add:nr,addScalar:z,atan:V,bignumber:W,column:Pr,complex:Z,config:n.config,cos:Ve,diag:Ct,divideScalar:Nt,dot:ur,equal:It,flatten:Pt,im:fe,inv:aa,larger:dr,matrix:at,matrixFromColumns:qt,multiply:vr,multiplyScalar:xe,number:we,qr:xr,re:Se,sin:Ce,smaller:ht,sqrt:Ke,subtract:gt,typed:O,usolve:tr,usolveAll:Nr});t.eigs=ma;var ga=(0,a.createMultinomial)({add:nr,divide:sa,factorial:cn,isInteger:pe,isPositive:de,multiply:vr,typed:O});t.multinomial=ga;var ya=(0,a.createMad)({abs:R,map:be,median:fa,subtract:gt,typed:O});t.mad=ya;var va=(0,a.createNorm)({abs:R,add:nr,conj:K,ctranspose:Et,eigs:ma,equalScalar:re,larger:dr,matrix:at,multiply:vr,pow:br,smaller:ht,sqrt:Ke,typed:O});t.norm=va;var ba=(0,a.createRotationMatrix)({BigNumber:i,DenseMatrix:A,SparseMatrix:Ne,addScalar:z,config:n.config,cos:Ve,matrix:at,multiplyScalar:xe,norm:va,sin:Ce,typed:O,unaryMinus:Qe});t.rotationMatrix=ba;var xa=(0,a.createRotate)({multiply:vr,rotationMatrix:ba,typed:O});t.rotate=xa},14893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isAccessorNode",{enumerable:!0,get:function(){return n.isAccessorNode}}),Object.defineProperty(t,"isArray",{enumerable:!0,get:function(){return n.isArray}}),Object.defineProperty(t,"isArrayNode",{enumerable:!0,get:function(){return n.isArrayNode}}),Object.defineProperty(t,"isAssignmentNode",{enumerable:!0,get:function(){return n.isAssignmentNode}}),Object.defineProperty(t,"isBigNumber",{enumerable:!0,get:function(){return n.isBigNumber}}),Object.defineProperty(t,"isBlockNode",{enumerable:!0,get:function(){return n.isBlockNode}}),Object.defineProperty(t,"isBoolean",{enumerable:!0,get:function(){return n.isBoolean}}),Object.defineProperty(t,"isChain",{enumerable:!0,get:function(){return n.isChain}}),Object.defineProperty(t,"isCollection",{enumerable:!0,get:function(){return n.isCollection}}),Object.defineProperty(t,"isComplex",{enumerable:!0,get:function(){return n.isComplex}}),Object.defineProperty(t,"isConditionalNode",{enumerable:!0,get:function(){return n.isConditionalNode}}),Object.defineProperty(t,"isConstantNode",{enumerable:!0,get:function(){return n.isConstantNode}}),Object.defineProperty(t,"isDate",{enumerable:!0,get:function(){return n.isDate}}),Object.defineProperty(t,"isDenseMatrix",{enumerable:!0,get:function(){return n.isDenseMatrix}}),Object.defineProperty(t,"isFraction",{enumerable:!0,get:function(){return n.isFraction}}),Object.defineProperty(t,"isFunction",{enumerable:!0,get:function(){return n.isFunction}}),Object.defineProperty(t,"isFunctionAssignmentNode",{enumerable:!0,get:function(){return n.isFunctionAssignmentNode}}),Object.defineProperty(t,"isFunctionNode",{enumerable:!0,get:function(){return n.isFunctionNode}}),Object.defineProperty(t,"isHelp",{enumerable:!0,get:function(){return n.isHelp}}),Object.defineProperty(t,"isIndex",{enumerable:!0,get:function(){return n.isIndex}}),Object.defineProperty(t,"isIndexNode",{enumerable:!0,get:function(){return n.isIndexNode}}),Object.defineProperty(t,"isMatrix",{enumerable:!0,get:function(){return n.isMatrix}}),Object.defineProperty(t,"isNode",{enumerable:!0,get:function(){return n.isNode}}),Object.defineProperty(t,"isNull",{enumerable:!0,get:function(){return n.isNull}}),Object.defineProperty(t,"isNumber",{enumerable:!0,get:function(){return n.isNumber}}),Object.defineProperty(t,"isObject",{enumerable:!0,get:function(){return n.isObject}}),Object.defineProperty(t,"isObjectNode",{enumerable:!0,get:function(){return n.isObjectNode}}),Object.defineProperty(t,"isOperatorNode",{enumerable:!0,get:function(){return n.isOperatorNode}}),Object.defineProperty(t,"isParenthesisNode",{enumerable:!0,get:function(){return n.isParenthesisNode}}),Object.defineProperty(t,"isRange",{enumerable:!0,get:function(){return n.isRange}}),Object.defineProperty(t,"isRangeNode",{enumerable:!0,get:function(){return n.isRangeNode}}),Object.defineProperty(t,"isRegExp",{enumerable:!0,get:function(){return n.isRegExp}}),Object.defineProperty(t,"isResultSet",{enumerable:!0,get:function(){return n.isResultSet}}),Object.defineProperty(t,"isSparseMatrix",{enumerable:!0,get:function(){return n.isSparseMatrix}}),Object.defineProperty(t,"isString",{enumerable:!0,get:function(){return n.isString}}),Object.defineProperty(t,"isSymbolNode",{enumerable:!0,get:function(){return n.isSymbolNode}}),Object.defineProperty(t,"isUndefined",{enumerable:!0,get:function(){return n.isUndefined}}),Object.defineProperty(t,"isUnit",{enumerable:!0,get:function(){return n.isUnit}});var n=r(57237)},91245:(e,t)=>{"use strict";function r(e,t,n,a){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=a,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(null!=a?"-"+a:"")+" expected)",this.stack=(new Error).stack}Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentsError=r,r.prototype=new Error,r.prototype.constructor=Error,r.prototype.name="ArgumentsError",r.prototype.isArgumentsError=!0},12906:(e,t)=>{"use strict";function r(e,t,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}Object.defineProperty(t,"__esModule",{value:!0}),t.DimensionError=r,r.prototype=new RangeError,r.prototype.constructor=RangeError,r.prototype.name="DimensionError",r.prototype.isDimensionError=!0},14452:(e,t)=>{"use strict";function r(e,t,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}Object.defineProperty(t,"__esModule",{value:!0}),t.IndexError=r,r.prototype=new RangeError,r.prototype.constructor=RangeError,r.prototype.name="IndexError",r.prototype.isIndexError=!0},45278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHelpClass=void 0;var n=r(57237),a=r(54699),i=r(59398),o=["parse"],s=(0,r(58450).factory)("Help",o,(function(e){var t=e.parse;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var e=this.doc||{},r="\n";if(e.name&&(r+="Name: "+e.name+"\n\n"),e.category&&(r+="Category: "+e.category+"\n\n"),e.description&&(r+="Description:\n    "+e.description+"\n\n"),e.syntax&&(r+="Syntax:\n    "+e.syntax.join("\n    ")+"\n\n"),e.examples){r+="Examples:\n";for(var a={},o=0;o<e.examples.length;o++){var s=e.examples[o];r+="    "+s+"\n";var l=void 0;try{l=t(s).compile().evaluate(a)}catch(e){l=e}void 0===l||(0,n.isHelp)(l)||(r+="        "+(0,i.format)(l,{precision:14})+"\n")}r+="\n"}return e.seealso&&e.seealso.length&&(r+="See also: "+e.seealso.join(", ")+"\n"),r},r.prototype.toJSON=function(){var e=(0,a.clone)(this.doc);return e.mathjs="Help",e},r.fromJSON=function(e){var t={};return Object.keys(e).filter((function(e){return"mathjs"!==e})).forEach((function(r){t[r]=e[r]})),new r(t)},r.prototype.valueOf=r.prototype.toString,r}),{isClass:!0});t.createHelpClass=s},60307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParserClass=void 0;var n=r(58450),a=r(84146),i=["evaluate"],o=(0,n.factory)("Parser",i,(function(e){var t=e.evaluate;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:(0,a.createEmptyMap)(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(e){return t(e,this.scope)},r.prototype.get=function(e){if(this.scope.has(e))return this.scope.get(e)},r.prototype.getAll=function(){return(0,a.toObject)(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(e,t){return this.scope.set(e,t),t},r.prototype.remove=function(e){this.scope.delete(e)},r.prototype.clear=function(){this.scope.clear()},r}),{isClass:!0});t.createParserClass=o},5837:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfinityDocs=void 0,t.InfinityDocs={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]}},14701:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LN10Docs=void 0,t.LN10Docs={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]}},55369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LN2Docs=void 0,t.LN2Docs={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]}},80561:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOG10EDocs=void 0,t.LOG10EDocs={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]}},30619:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOG2EDocs=void 0,t.LOG2EDocs={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]}},66436:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NaNDocs=void 0,t.NaNDocs={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]}},84163:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SQRT12Docs=void 0,t.SQRT12Docs={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]}},90614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SQRT2Docs=void 0,t.SQRT2Docs={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]}},62867:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.eDocs=void 0,t.eDocs={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]}},45086:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.falseDocs=void 0,t.falseDocs={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]}},59399:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iDocs=void 0,t.iDocs={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]}},96586:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nullDocs=void 0,t.nullDocs={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]}},77856:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.phiDocs=void 0,t.phiDocs={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]}},29660:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.piDocs=void 0,t.piDocs={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]}},16117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tauDocs=void 0,t.tauDocs={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]}},54549:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trueDocs=void 0,t.trueDocs={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]}},48042:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.versionDocs=void 0,t.versionDocs={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]}},59592:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bignumberDocs=void 0,t.bignumberDocs={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]}},12654:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.booleanDocs=void 0,t.booleanDocs={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]}},35011:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.complexDocs=void 0,t.complexDocs={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]}},39172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnitDocs=void 0,t.createUnitDocs={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]}},46250:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fractionDocs=void 0,t.fractionDocs={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(num,den)"],description:"Create a fraction from a number or from a numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]}},3390:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indexDocs=void 0,t.indexDocs={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["[]","[1, 2, 3]","A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[0:2, 0:2] = ones(2, 2)"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]}},26090:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixDocs=void 0,t.matrixDocs={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]}},14130:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numberDocs=void 0,t.numberDocs={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]}},41386:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sparseDocs=void 0,t.sparseDocs={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]}},31873:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitUnitDocs=void 0,t.splitUnitDocs={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]}},53112:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringDocs=void 0,t.stringDocs={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]}},97446:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unitDocs=void 0,t.unitDocs={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]}},82215:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.configDocs=void 0,t.configDocs={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]}},31295:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.importDocs=void 0,t.importDocs={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]}},33776:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typedDocs=void 0,t.typedDocs={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number, number": f(x)=x+x })',"double(2)",'double("hello")'],seealso:[]}},3399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.embeddedDocs=void 0;var n=r(59592),a=r(60255),i=r(76865),o=r(49850),s=r(26248),l=r(71474),c=r(88001),u=r(36013),f=r(48072),p=r(48393),h=r(7443),d=r(42011),m=r(96687),g=r(88985),y=r(65188),v=r(25780),b=r(10792),x=r(40956),_=r(50567),w=r(36175),k=r(32517),D=r(14784),T=r(10370),A=r(52718),S=r(48972),M=r(2685),E=r(52442),C=r(23894),N=r(27032),O=r(73154),I=r(71520),P=r(7743),R=r(77122),L=r(25920),F=r(98661),B=r(70607),z=r(41529),j=r(62955),U=r(24e3),$=r(84676),V=r(42988),q=r(7220),W=r(88323),H=r(2997),G=r(474),X=r(29939),Y=r(719),Z=r(73124),K=r(90518),J=r(9565),Q=r(51648),ee=r(50005),te=r(90445),re=r(99231),ne=r(35129),ae=r(25721),ie=r(50964),oe=r(84971),se=r(24213),le=r(80810),ce=r(76049),ue=r(43665),fe=r(88848),pe=r(83092),he=r(86158),de=r(67532),me=r(52593),ge=r(80126),ye=r(99421),ve=r(23990),be=r(49898),xe=r(74680),_e=r(47824),we=r(30421),ke=r(36564),De=r(75833),Te=r(59837),Ae=r(18302),Se=r(14364),Me=r(52749),Ee=r(85909),Ce=r(39525),Ne=r(23941),Oe=r(9524),Ie=r(95773),Pe=r(81220),Re=r(8954),Le=r(18231),Fe=r(19317),Be=r(53273),ze=r(1595),je=r(87655),Ue=r(22004),$e=r(44679),Ve=r(35245),qe=r(28205),We=r(43650),He=r(70633),Ge=r(7289),Xe=r(37635),Ye=r(37265),Ze=r(60770),Ke=r(18928),Je=r(58453),Qe=r(76494),et=r(7634),tt=r(4872),rt=r(32974),nt=r(35044),at=r(57046),it=r(41199),ot=r(27489),st=r(74149),lt=r(6059),ct=r(63668),ut=r(23479),ft=r(2765),pt=r(2569),ht=r(49061),dt=r(48520),mt=r(90178),gt=r(59566),yt=r(33776),vt=r(31295),bt=r(82215),xt=r(43911),_t=r(95562),wt=r(31534),kt=r(48674),Dt=r(83952),Tt=r(68384),At=r(51730),St=r(60671),Mt=r(84962),Et=r(12801),Ct=r(42898),Nt=r(72432),Ot=r(2327),It=r(27812),Pt=r(82613),Rt=r(52310),Lt=r(55905),Ft=r(66067),Bt=r(46766),zt=r(30403),jt=r(88990),Ut=r(7754),$t=r(69335),Vt=r(7569),qt=r(28335),Wt=r(88833),Ht=r(33027),Gt=r(82912),Xt=r(727),Yt=r(73806),Zt=r(55737),Kt=r(81270),Jt=r(50389),Qt=r(27262),er=r(73689),tr=r(55663),rr=r(74094),nr=r(16972),ar=r(32126),ir=r(68314),or=r(66782),sr=r(16384),lr=r(85930),cr=r(5742),ur=r(71999),fr=r(3637),pr=r(55237),hr=r(37629),dr=r(55181),mr=r(67677),gr=r(82888),yr=r(10495),vr=r(94406),br=r(90222),xr=r(26508),_r=r(66580),wr=r(48042),kr=r(54549),Dr=r(16117),Tr=r(90614),Ar=r(84163),Sr=r(77856),Mr=r(29660),Er=r(96586),Cr=r(66436),Nr=r(80561),Or=r(30619),Ir=r(14701),Pr=r(55369),Rr=r(5837),Lr=r(59399),Fr=r(45086),Br=r(62867),zr=r(97446),jr=r(53112),Ur=r(31873),$r=r(41386),Vr=r(14130),qr=r(26090),Wr=r(98347),Hr=r(83037),Gr=r(43646),Xr=r(3390),Yr=r(46250),Zr=r(39172),Kr=r(35011),Jr=r(12654),Qr=r(33135),en=r(73060),tn=r(19835),rn=r(71279),nn=r(92472),an=r(31761),on=r(43130),sn=r(70473),ln=r(75391),cn=r(57560),un={bignumber:n.bignumberDocs,boolean:Jr.booleanDocs,complex:Kr.complexDocs,createUnit:Zr.createUnitDocs,fraction:Yr.fractionDocs,index:Xr.indexDocs,matrix:qr.matrixDocs,number:Vr.numberDocs,sparse:$r.sparseDocs,splitUnit:Ur.splitUnitDocs,string:jr.stringDocs,unit:zr.unitDocs,e:Br.eDocs,E:Br.eDocs,false:Fr.falseDocs,i:Lr.iDocs,Infinity:Rr.InfinityDocs,LN2:Pr.LN2Docs,LN10:Ir.LN10Docs,LOG2E:Or.LOG2EDocs,LOG10E:Nr.LOG10EDocs,NaN:Cr.NaNDocs,null:Er.nullDocs,pi:Mr.piDocs,PI:Mr.piDocs,phi:Sr.phiDocs,SQRT1_2:Ar.SQRT12Docs,SQRT2:Tr.SQRT2Docs,tau:Dr.tauDocs,true:kr.trueDocs,version:wr.versionDocs,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:_r.derivativeDocs,lsolve:br.lsolveDocs,lsolveAll:xr.lsolveAllDocs,lup:vr.lupDocs,lusolve:en.lusolveDocs,simplify:yr.simplifyDocs,rationalize:gr.rationalizeDocs,slu:mr.sluDocs,usolve:hr.usolveDocs,usolveAll:dr.usolveAllDocs,qr:pr.qrDocs,abs:fr.absDocs,add:ur.addDocs,cbrt:cr.cbrtDocs,ceil:lr.ceilDocs,cube:sr.cubeDocs,divide:or.divideDocs,dotDivide:ir.dotDivideDocs,dotMultiply:ar.dotMultiplyDocs,dotPow:Qr.dotPowDocs,exp:nr.expDocs,expm:tr.expmDocs,expm1:er.expm1Docs,fix:Qt.fixDocs,floor:Jt.floorDocs,gcd:Kt.gcdDocs,hypot:Zt.hypotDocs,lcm:Yt.lcmDocs,log:Xt.logDocs,log2:Gt.log2Docs,log1p:Ht.log1pDocs,log10:Wt.log10Docs,mod:qt.modDocs,multiply:Vt.multiplyDocs,norm:$t.normDocs,nthRoot:Ut.nthRootDocs,nthRoots:jt.nthRootsDocs,pow:zt.powDocs,round:Bt.roundDocs,sign:Ft.signDocs,sqrt:Lt.sqrtDocs,sqrtm:Rt.sqrtmDocs,square:Pt.squareDocs,subtract:tn.subtractDocs,unaryMinus:It.unaryMinusDocs,unaryPlus:Ot.unaryPlusDocs,xgcd:Nt.xgcdDocs,bitAnd:Ct.bitAndDocs,bitNot:Et.bitNotDocs,bitOr:Mt.bitOrDocs,bitXor:St.bitXorDocs,leftShift:At.leftShiftDocs,rightArithShift:Tt.rightArithShiftDocs,rightLogShift:Dt.rightLogShiftDocs,bellNumbers:kt.bellNumbersDocs,catalan:wt.catalanDocs,composition:_t.compositionDocs,stirlingS2:xt.stirlingS2Docs,config:bt.configDocs,import:vt.importDocs,typed:yt.typedDocs,arg:gt.argDocs,conj:mt.conjDocs,re:dt.reDocs,im:ht.imDocs,evaluate:pt.evaluateDocs,help:ft.helpDocs,distance:ut.distanceDocs,intersect:ct.intersectDocs,and:lt.andDocs,not:st.notDocs,or:ot.orDocs,xor:it.xorDocs,concat:nt.concatDocs,count:at.countDocs,cross:rt.crossDocs,column:on.columnDocs,ctranspose:tt.ctransposeDocs,det:et.detDocs,diag:Qe.diagDocs,diff:Be.diffDocs,dot:Je.dotDocs,getMatrixDataType:Ke.getMatrixDataTypeDocs,identity:Ze.identityDocs,filter:Ye.filterDocs,flatten:Xe.flattenDocs,forEach:Ge.forEachDocs,inv:He.invDocs,eigs:rr.eigsDocs,kron:We.kronDocs,matrixFromFunction:Wr.matrixFromFunctionDocs,matrixFromRows:Hr.matrixFromRowsDocs,matrixFromColumns:Gr.matrixFromColumnsDocs,map:qe.mapDocs,ones:Ve.onesDocs,partitionSelect:$e.partitionSelectDocs,range:Ue.rangeDocs,resize:je.resizeDocs,reshape:ze.reshapeDocs,rotate:cn.rotateDocs,rotationMatrix:ln.rotationMatrixDocs,row:sn.rowDocs,size:Fe.sizeDocs,sort:Le.sortDocs,squeeze:Re.squeezeDocs,subset:Pe.subsetDocs,trace:Ie.traceDocs,transpose:Oe.transposeDocs,zeros:Ne.zerosDocs,combinations:Ee.combinationsDocs,combinationsWithRep:Ce.combinationsWithRepDocs,factorial:Me.factorialDocs,gamma:Se.gammaDocs,kldivergence:Ae.kldivergenceDocs,multinomial:Te.multinomialDocs,permutations:De.permutationsDocs,pickRandom:ke.pickRandomDocs,random:we.randomDocs,randomInt:_e.randomIntDocs,compare:xe.compareDocs,compareNatural:be.compareNaturalDocs,compareText:ve.compareTextDocs,deepEqual:ye.deepEqualDocs,equal:ge.equalDocs,equalText:me.equalTextDocs,larger:de.largerDocs,largerEq:he.largerEqDocs,smaller:pe.smallerDocs,smallerEq:fe.smallerEqDocs,unequal:ue.unequalDocs,setCartesian:ce.setCartesianDocs,setDifference:le.setDifferenceDocs,setDistinct:se.setDistinctDocs,setIntersect:oe.setIntersectDocs,setIsSubset:ie.setIsSubsetDocs,setMultiplicity:ae.setMultiplicityDocs,setPowerset:ne.setPowersetDocs,setSize:re.setSizeDocs,setSymDifference:te.setSymDifferenceDocs,setUnion:ee.setUnionDocs,erf:Q.erfDocs,mad:J.madDocs,max:K.maxDocs,mean:Z.meanDocs,median:Y.medianDocs,min:X.minDocs,mode:G.modeDocs,prod:H.prodDocs,quantileSeq:W.quantileSeqDocs,std:q.stdDocs,sum:V.sumDocs,variance:rn.varianceDocs,acos:$.acosDocs,acosh:U.acoshDocs,acot:j.acotDocs,acoth:z.acothDocs,acsc:B.acscDocs,acsch:F.acschDocs,asec:L.asecDocs,asech:R.asechDocs,asin:P.asinDocs,asinh:I.asinhDocs,atan:O.atanDocs,atanh:N.atanhDocs,atan2:C.atan2Docs,cos:E.cosDocs,cosh:M.coshDocs,cot:S.cotDocs,coth:A.cothDocs,csc:T.cscDocs,csch:D.cschDocs,sec:k.secDocs,sech:w.sechDocs,sin:nn.sinDocs,sinh:_.sinhDocs,tan:x.tanDocs,tanh:b.tanhDocs,to:v.toDocs,clone:y.cloneDocs,format:h.formatDocs,bin:d.binDocs,oct:m.octDocs,hex:g.hexDocs,isNaN:p.isNaNDocs,isInteger:f.isIntegerDocs,isNegative:u.isNegativeDocs,isNumeric:l.isNumericDocs,hasNumericValue:c.hasNumericValueDocs,isPositive:s.isPositiveDocs,isPrime:o.isPrimeDocs,isZero:i.isZeroDocs,typeOf:a.typeOfDocs,numeric:an.numericDocs};t.embeddedDocs=un},66580:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.derivativeDocs=void 0,t.derivativeDocs={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]}},90222:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lsolveDocs=void 0,t.lsolveDocs={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]}},26508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lsolveAllDocs=void 0,t.lsolveAllDocs={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]}},94406:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lupDocs=void 0,t.lupDocs={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]}},73060:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lusolveDocs=void 0,t.lusolveDocs={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]}},55237:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.qrDocs=void 0,t.qrDocs={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1,  4], [1,  4, -2], [1,  4,  2], [1,  -1, 0]])"],seealso:["lup","slu","matrix"]}},82888:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rationalizeDocs=void 0,t.rationalizeDocs={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]}},10495:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifyDocs=void 0,t.simplifyDocs={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["derivative","parse","evaluate"]}},67677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sluDocs=void 0,t.sluDocs={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]}},37629:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usolveDocs=void 0,t.usolveDocs={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]}},55181:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usolveAllDocs=void 0,t.usolveAllDocs={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]}},3637:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.absDocs=void 0,t.absDocs={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]}},71999:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDocs=void 0,t.addDocs={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]}},5742:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cbrtDocs=void 0,t.cbrtDocs={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]}},85930:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ceilDocs=void 0,t.ceilDocs={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]}},16384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cubeDocs=void 0,t.cubeDocs={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]}},66782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.divideDocs=void 0,t.divideDocs={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]}},68314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotDivideDocs=void 0,t.dotDivideDocs={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]}},32126:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotMultiplyDocs=void 0,t.dotMultiplyDocs={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]}},33135:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotPowDocs=void 0,t.dotPowDocs={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]}},16972:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expDocs=void 0,t.expDocs={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x))   # Euler's formula"],seealso:["expm","expm1","pow","log"]}},55663:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expmDocs=void 0,t.expmDocs={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]}},73689:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expm1Docs=void 0,t.expm1Docs={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]}},27262:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fixDocs=void 0,t.fixDocs={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]}},50389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.floorDocs=void 0,t.floorDocs={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]}},81270:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gcdDocs=void 0,t.gcdDocs={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]}},55737:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hypotDocs=void 0,t.hypotDocs={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]}},73806:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lcmDocs=void 0,t.lcmDocs={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]}},727:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logDocs=void 0,t.logDocs={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]}},88833:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log10Docs=void 0,t.log10Docs={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]}},33027:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log1pDocs=void 0,t.log1pDocs={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]}},82912:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log2Docs=void 0,t.log2Docs={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]}},28335:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modDocs=void 0,t.modDocs={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]}},7569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiplyDocs=void 0,t.multiplyDocs={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]}},69335:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normDocs=void 0,t.normDocs={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']}},7754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nthRootDocs=void 0,t.nthRootDocs={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]}},88990:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nthRootsDocs=void 0,t.nthRootsDocs={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]}},30403:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.powDocs=void 0,t.powDocs={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]}},46766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.roundDocs=void 0,t.roundDocs={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)"],seealso:["ceil","floor","fix"]}},66067:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signDocs=void 0,t.signDocs={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]}},55905:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sqrtDocs=void 0,t.sqrtDocs={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]}},52310:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sqrtmDocs=void 0,t.sqrtmDocs={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[1, 2], [3, 4]])"],seealso:["sqrt","abs","square","multiply"]}},82613:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.squareDocs=void 0,t.squareDocs={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]}},19835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subtractDocs=void 0,t.subtractDocs={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]}},27812:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unaryMinusDocs=void 0,t.unaryMinusDocs={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]}},2327:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unaryPlusDocs=void 0,t.unaryPlusDocs={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]}},72432:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xgcdDocs=void 0,t.xgcdDocs={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]}},42898:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitAndDocs=void 0,t.bitAndDocs={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]}},12801:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitNotDocs=void 0,t.bitNotDocs={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]}},84962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitOrDocs=void 0,t.bitOrDocs={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]}},60671:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitXorDocs=void 0,t.bitXorDocs={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]}},51730:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftShiftDocs=void 0,t.leftShiftDocs={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]}},68384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightArithShiftDocs=void 0,t.rightArithShiftDocs={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]}},83952:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightLogShiftDocs=void 0,t.rightLogShiftDocs={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]}},48674:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bellNumbersDocs=void 0,t.bellNumbersDocs={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]}},31534:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catalanDocs=void 0,t.catalanDocs={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]}},95562:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compositionDocs=void 0,t.compositionDocs={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]}},43911:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stirlingS2Docs=void 0,t.stirlingS2Docs={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]}},59566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argDocs=void 0,t.argDocs={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]}},90178:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conjDocs=void 0,t.conjDocs={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]}},49061:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imDocs=void 0,t.imDocs={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]}},48520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reDocs=void 0,t.reDocs={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]}},2569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateDocs=void 0,t.evaluateDocs={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate([expr1, expr2, expr3, ...])"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(" + 4 + ")")'],seealso:[]}},2765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpDocs=void 0,t.helpDocs={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]}},23479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distanceDocs=void 0,t.distanceDocs={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]}},63668:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.intersectDocs=void 0,t.intersectDocs={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1],  [4, -2, 2], [1, 1, 1, 6])"],seealso:[]}},6059:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.andDocs=void 0,t.andDocs={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]}},74149:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notDocs=void 0,t.notDocs={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]}},27489:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orDocs=void 0,t.orDocs={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]}},41199:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xorDocs=void 0,t.xorDocs={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]}},43130:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.columnDocs=void 0,t.columnDocs={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]}},35044:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatDocs=void 0,t.concatDocs={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]}},57046:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.countDocs=void 0,t.countDocs={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]}},32974:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crossDocs=void 0,t.crossDocs={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0],  [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4],  [5, 6, 7])"],seealso:["multiply","dot"]}},4872:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ctransposeDocs=void 0,t.ctransposeDocs={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]}},7634:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.detDocs=void 0,t.detDocs={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]}},76494:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diagDocs=void 0,t.diagDocs={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]}},53273:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffDocs=void 0,t.diffDocs={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["diff([1, 2, 4, 7, 0])","diff([1, 2, 4, 7, 0], 0)","diff(matrix([1, 2, 4, 7, 0]))","diff([[1, 2], [3, 4]])","diff([[1, 2], [3, 4]], 0)","diff([[1, 2], [3, 4]], 1)","diff([[1, 2], [3, 4]], bignumber(1))","diff(matrix([[1, 2], [3, 4]]), 1)","diff([[1, 2], matrix([3, 4])], 1)"],seealso:["subtract","partitionSelect"]}},58453:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotDocs=void 0,t.dotDocs={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]}},74094:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.eigsDocs=void 0,t.eigsDocs={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and eigenvectors of a real symmetric matrix",examples:["eigs([[5, 2.3], [2.3, 1]])"],seealso:["inv"]}},37265:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterDocs=void 0,t.filterDocs={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]}},37635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenDocs=void 0,t.flattenDocs={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]}},7289:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forEachDocs=void 0,t.forEachDocs={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["forEach([1, 2, 3], function(val) { console.log(val) })"],seealso:["map","sort","filter"]}},18928:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMatrixDataTypeDocs=void 0,t.getMatrixDataTypeDocs={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]}},60770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identityDocs=void 0,t.identityDocs={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]}},70633:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invDocs=void 0,t.invDocs={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]}},43650:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.kronDocs=void 0,t.kronDocs={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]}},28205:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapDocs=void 0,t.mapDocs={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]}},43646:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromColumnsDocs=void 0,t.matrixFromColumnsDocs={name:"matrixFromColumns",category:"Matrix",syntax:["math.matrixFromColumns(...arr)","math.matrixFromColumns(row1, row2)","math.matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]}},98347:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromFunctionDocs=void 0,t.matrixFromFunctionDocs={name:"matrixFromFunction",category:"Matrix",syntax:["math.matrixFromFunction(size, fn)","math.matrixFromFunction(size, fn, format)","math.matrixFromFunction(size, fn, format, datatype)","math.matrixFromFunction(size, format, fn)","math.matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]}},83037:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromRowsDocs=void 0,t.matrixFromRowsDocs={name:"matrixFromRows",category:"Matrix",syntax:["math.matrixFromRows(...arr)","math.matrixFromRows(row1, row2)","math.matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]}},35245:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onesDocs=void 0,t.onesDocs={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]}},44679:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partitionSelectDocs=void 0,t.partitionSelectDocs={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1)'],seealso:["sort"]}},22004:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rangeDocs=void 0,t.rangeDocs={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]}},1595:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reshapeDocs=void 0,t.reshapeDocs={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])"],seealso:["size","squeeze","resize"]}},87655:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeDocs=void 0,t.resizeDocs={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]}},57560:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rotateDocs=void 0,t.rotateDocs={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], math.pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]}},75391:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rotationMatrixDocs=void 0,t.rotationMatrixDocs={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]}},70473:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rowDocs=void 0,t.rowDocs={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]}},19317:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sizeDocs=void 0,t.sizeDocs={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]}},18231:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortDocs=void 0,t.sortDocs={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"])',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]}},8954:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.squeezeDocs=void 0,t.squeezeDocs={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]}},81220:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subsetDocs=void 0,t.subsetDocs={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of a matrix or string. Indexes are one-based. Both the ranges lower-bound and upper-bound are included.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]}},95773:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.traceDocs=void 0,t.traceDocs={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]}},9524:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transposeDocs=void 0,t.transposeDocs={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]}},23941:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zerosDocs=void 0,t.zerosDocs={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]}},85909:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combinationsDocs=void 0,t.combinationsDocs={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]}},39525:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combinationsWithRepDocs=void 0,t.combinationsWithRepDocs={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]}},52749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.factorialDocs=void 0,t.factorialDocs={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]}},14364:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gammaDocs=void 0,t.gammaDocs={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]}},18302:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.kldivergenceDocs=void 0,t.kldivergenceDocs={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence  between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]}},59837:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multinomialDocs=void 0,t.multinomialDocs={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]}},75833:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.permutationsDocs=void 0,t.permutationsDocs={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]}},36564:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickRandomDocs=void 0,t.pickRandomDocs={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]}},30421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomDocs=void 0,t.randomDocs={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]}},47824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomIntDocs=void 0,t.randomIntDocs={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]}},74680:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareDocs=void 0,t.compareDocs={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]}},49898:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareNaturalDocs=void 0,t.compareNaturalDocs={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]}},23990:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareTextDocs=void 0,t.compareTextDocs={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]}},99421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqualDocs=void 0,t.deepEqualDocs={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]}},80126:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equalDocs=void 0,t.equalDocs={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]}},52593:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equalTextDocs=void 0,t.equalTextDocs={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]}},67532:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.largerDocs=void 0,t.largerDocs={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]}},86158:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.largerEqDocs=void 0,t.largerEqDocs={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]}},83092:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smallerDocs=void 0,t.smallerDocs={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]}},88848:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smallerEqDocs=void 0,t.smallerEqDocs={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]}},43665:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unequalDocs=void 0,t.unequalDocs={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]}},76049:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setCartesianDocs=void 0,t.setCartesianDocs={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]}},80810:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDifferenceDocs=void 0,t.setDifferenceDocs={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]}},24213:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDistinctDocs=void 0,t.setDistinctDocs={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]}},84971:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setIntersectDocs=void 0,t.setIntersectDocs={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]}},50964:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setIsSubsetDocs=void 0,t.setIsSubsetDocs={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]}},25721:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setMultiplicityDocs=void 0,t.setMultiplicityDocs={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]}},35129:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setPowersetDocs=void 0,t.setPowersetDocs={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]}},99231:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSizeDocs=void 0,t.setSizeDocs={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]}},90445:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSymDifferenceDocs=void 0,t.setSymDifferenceDocs={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]}},50005:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setUnionDocs=void 0,t.setUnionDocs={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]}},51648:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.erfDocs=void 0,t.erfDocs={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]}},9565:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.madDocs=void 0,t.madDocs={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]}},90518:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.maxDocs=void 0,t.maxDocs={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dim)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]}},73124:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.meanDocs=void 0,t.meanDocs={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dim)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]}},719:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.medianDocs=void 0,t.medianDocs={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]}},29939:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.minDocs=void 0,t.minDocs={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dim)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]}},474:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modeDocs=void 0,t.modeDocs={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]}},2997:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prodDocs=void 0,t.prodDocs={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]}},88323:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.quantileSeqDocs=void 0,t.quantileSeqDocs={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:"Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.",examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]}},7220:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stdDocs=void 0,t.stdDocs={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]}},42988:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sumDocs=void 0,t.sumDocs={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]}},71279:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.varianceDocs=void 0,t.varianceDocs={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]}},84676:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acosDocs=void 0,t.acosDocs={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]}},24e3:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acoshDocs=void 0,t.acoshDocs={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]}},62955:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acotDocs=void 0,t.acotDocs={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]}},41529:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acothDocs=void 0,t.acothDocs={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]}},70607:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acscDocs=void 0,t.acscDocs={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]}},98661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acschDocs=void 0,t.acschDocs={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]}},25920:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asecDocs=void 0,t.asecDocs={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]}},77122:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asechDocs=void 0,t.asechDocs={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]}},7743:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asinDocs=void 0,t.asinDocs={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]}},71520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asinhDocs=void 0,t.asinhDocs={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]}},73154:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atanDocs=void 0,t.atanDocs={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]}},23894:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atan2Docs=void 0,t.atan2Docs={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]}},27032:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atanhDocs=void 0,t.atanhDocs={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]}},52442:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cosDocs=void 0,t.cosDocs={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]}},2685:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coshDocs=void 0,t.coshDocs={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]}},48972:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cotDocs=void 0,t.cotDocs={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]}},52718:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cothDocs=void 0,t.cothDocs={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]}},10370:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cscDocs=void 0,t.cscDocs={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]}},14784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cschDocs=void 0,t.cschDocs={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]}},32517:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.secDocs=void 0,t.secDocs={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]}},36175:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sechDocs=void 0,t.sechDocs={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]}},92472:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sinDocs=void 0,t.sinDocs={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]}},50567:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sinhDocs=void 0,t.sinhDocs={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]}},40956:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tanDocs=void 0,t.tanDocs={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]}},10792:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tanhDocs=void 0,t.tanhDocs={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]}},25780:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toDocs=void 0,t.toDocs={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]}},42011:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.binDocs=void 0,t.binDocs={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]}},65188:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneDocs=void 0,t.cloneDocs={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]}},7443:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatDocs=void 0,t.formatDocs={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]}},88001:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasNumericValueDocs=void 0,t.hasNumericValueDocs={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]}},88985:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexDocs=void 0,t.hexDocs={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]}},48072:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIntegerDocs=void 0,t.isIntegerDocs={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]}},48393:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNaNDocs=void 0,t.isNaNDocs={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]}},36013:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNegativeDocs=void 0,t.isNegativeDocs={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]}},71474:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNumericDocs=void 0,t.isNumericDocs={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]}},26248:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPositiveDocs=void 0,t.isPositiveDocs={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]}},49850:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPrimeDocs=void 0,t.isPrimeDocs={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]}},76865:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroDocs=void 0,t.isZeroDocs={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]}},31761:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numericDocs=void 0,t.numericDocs={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction)','numeric(4, "Fraction")','numeric(fraction(2, 5), "number)'],seealso:["number","fraction","bignumber","string","format"]}},96687:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.octDocs=void 0,t.octDocs={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]}},60255:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeOfDocs=void 0,t.typeOfDocs={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]}},86482:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCompile=void 0;var n=r(30401),a=r(58450),i="compile",o=["typed","parse"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.parse;return t(i,{string:function(e){return r(e).compile()},"Array | Matrix":function(e){return(0,n.deepMap)(e,(function(e){return r(e).compile()}))}})}));t.createCompile=s},9571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEvaluate=void 0;var n=r(30401),a=r(58450),i=r(84146),o="evaluate",s=["typed","parse"],l=(0,a.factory)(o,s,(function(e){var t=e.typed,r=e.parse;return t(o,{string:function(e){var t=(0,i.createEmptyMap)();return r(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return r(e).compile().evaluate(t)},"Array | Matrix":function(e){var t=(0,i.createEmptyMap)();return(0,n.deepMap)(e,(function(e){return r(e).compile().evaluate(t)}))},"Array | Matrix, Map | Object":function(e,t){return(0,n.deepMap)(e,(function(e){return r(e).compile().evaluate(t)}))}})}));t.createEvaluate=l},62186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHelp=void 0;var n=r(58450),a=r(27807),i=r(3399),o=r(54699),s="help",l=["typed","mathWithTransform","Help"],c=(0,n.factory)(s,l,(function(e){var t=e.typed,r=e.mathWithTransform,n=e.Help;return t(s,{any:function(e){var t,s=e;if("string"!=typeof e)for(t in r)if((0,o.hasOwnProperty)(r,t)&&e===r[t]){s=t;break}var l=(0,a.getSafeProperty)(i.embeddedDocs,s);if(!l){var c="function"==typeof s?s.name:s;throw new Error('No documentation found on "'+c+'"')}return new n(l)}})}));t.createHelp=c},44983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParser=void 0;var n=r(58450),a="parser",i=["typed","Parser"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.Parser;return t(a,{"":function(){return new r}})}));t.createParser=o},74559:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keywords=void 0;var r=new Set(["end"]);t.keywords=r},91044:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAccessorNode=void 0;var n=r(57237),a=r(27807),i=r(58450),o=r(32870),s=["subset","Node"],l=(0,i.factory)("AccessorNode",s,(function(e){var t=e.subset,r=e.Node,i=(0,o.accessFactory)({subset:t});function s(e,t){if(!(this instanceof s))throw new SyntaxError("Constructor must be called with the new operator");if(!(0,n.isNode)(e))throw new TypeError('Node expected for parameter "object"');if(!(0,n.isIndexNode)(t))throw new TypeError('IndexNode expected for parameter "index"');this.object=e||null,this.index=t,Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function l(e){return!((0,n.isAccessorNode)(e)||(0,n.isArrayNode)(e)||(0,n.isConstantNode)(e)||(0,n.isFunctionNode)(e)||(0,n.isObjectNode)(e)||(0,n.isParenthesisNode)(e)||(0,n.isSymbolNode)(e))}return s.prototype=new r,s.prototype.type="AccessorNode",s.prototype.isAccessorNode=!0,s.prototype._compile=function(e,t){var r=this.object._compile(e,t),n=this.index._compile(e,t);if(this.index.isObjectProperty()){var o=this.index.getObjectProperty();return function(e,t,n){return(0,a.getSafeProperty)(r(e,t,n),o)}}return function(e,t,a){var o=r(e,t,a),s=n(e,t,o);return i(o,s)}},s.prototype.forEach=function(e){e(this.object,"object",this),e(this.index,"index",this)},s.prototype.map=function(e){return new s(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)))},s.prototype.clone=function(){return new s(this.object,this.index)},s.prototype._toString=function(e){var t=this.object.toString(e);return l(this.object)&&(t="("+t+")"),t+this.index.toString(e)},s.prototype.toHTML=function(e){var t=this.object.toHTML(e);return l(this.object)&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+this.index.toHTML(e)},s.prototype._toTex=function(e){var t=this.object.toTex(e);return l(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)},s.prototype.toJSON=function(){return{mathjs:"AccessorNode",object:this.object,index:this.index}},s.fromJSON=function(e){return new s(e.object,e.index)},s}),{isClass:!0,isNode:!0});t.createAccessorNode=l},24834:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createArrayNode=void 0;var n=r(57237),a=r(70517),i=["Node"],o=(0,r(58450).factory)("ArrayNode",i,(function(e){var t=e.Node;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(this.items=e||[],!Array.isArray(this.items)||!this.items.every(n.isNode))throw new TypeError("Array containing Nodes expected")}return r.prototype=new t,r.prototype.type="ArrayNode",r.prototype.isArrayNode=!0,r.prototype._compile=function(e,t){var r=(0,a.map)(this.items,(function(r){return r._compile(e,t)}));if("Array"!==e.config.matrix){var n=e.matrix;return function(e,t,i){return n((0,a.map)(r,(function(r){return r(e,t,i)})))}}return function(e,t,n){return(0,a.map)(r,(function(r){return r(e,t,n)}))}},r.prototype.forEach=function(e){for(var t=0;t<this.items.length;t++)e(this.items[t],"items["+t+"]",this)},r.prototype.map=function(e){for(var t=[],n=0;n<this.items.length;n++)t[n]=this._ifNode(e(this.items[n],"items["+n+"]",this));return new r(t)},r.prototype.clone=function(){return new r(this.items.slice(0))},r.prototype._toString=function(e){return"["+this.items.map((function(t){return t.toString(e)})).join(", ")+"]"},r.prototype.toJSON=function(){return{mathjs:"ArrayNode",items:this.items}},r.fromJSON=function(e){return new r(e.items)},r.prototype.toHTML=function(e){return'<span class="math-parenthesis math-square-parenthesis">[</span>'+this.items.map((function(t){return t.toHTML(e)})).join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'},r.prototype._toTex=function(e){return function t(r,a){var i=r.some(n.isArrayNode)&&!r.every(n.isArrayNode),o=a||i,s=o?"&":"\\\\",l=r.map((function(r){return r.items?t(r.items,!a):r.toTex(e)})).join(s);return i||!o||o&&!a?"\\begin{bmatrix}"+l+"\\end{bmatrix}":l}(this.items,!1)},r}),{isClass:!0,isNode:!0});t.createArrayNode=o},14090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAssignmentNode=void 0;var n=r(57237),a=r(27807),i=r(58450),o=r(32870),s=r(19424),l=r(17715),c=["subset","?matrix","Node"],u=(0,i.factory)("AssignmentNode",c,(function(e){var t=e.subset,r=e.matrix,i=e.Node,c=(0,o.accessFactory)({subset:t}),u=(0,s.assignFactory)({subset:t,matrix:r});function f(e,t,r){if(!(this instanceof f))throw new SyntaxError("Constructor must be called with the new operator");if(this.object=e,this.index=r?t:null,this.value=r||t,!(0,n.isSymbolNode)(e)&&!(0,n.isAccessorNode)(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if((0,n.isSymbolNode)(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!(0,n.isIndexNode)(this.index))throw new TypeError('IndexNode expected as "index"');if(!(0,n.isNode)(this.value))throw new TypeError('Node expected as "value"');Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function p(e,t){t||(t="keep");var r=(0,l.getPrecedence)(e,t),n=(0,l.getPrecedence)(e.value,t);return"all"===t||null!==n&&n<=r}return f.prototype=new i,f.prototype.type="AssignmentNode",f.prototype.isAssignmentNode=!0,f.prototype._compile=function(e,t){var r=this.object._compile(e,t),i=this.index?this.index._compile(e,t):null,o=this.value._compile(e,t),s=this.object.name;if(this.index){if(this.index.isObjectProperty()){var l=this.index.getObjectProperty();return function(e,t,n){var i=r(e,t,n),s=o(e,t,n);return(0,a.setSafeProperty)(i,l,s),s}}if((0,n.isSymbolNode)(this.object))return function(e,t,n){var a=r(e,t,n),l=o(e,t,n),c=i(e,t,a);return e.set(s,u(a,c,l)),l};var f=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var p=this.object.index.getObjectProperty();return function(e,t,r){var n=f(e,t,r),s=(0,a.getSafeProperty)(n,p),l=i(e,t,s),c=o(e,t,r);return(0,a.setSafeProperty)(n,p,u(s,l,c)),c}}var h=this.object.index._compile(e,t);return function(e,t,r){var n=f(e,t,r),a=h(e,t,n),s=c(n,a),l=i(e,t,s),p=o(e,t,r);return u(n,a,u(s,l,p)),p}}if(!(0,n.isSymbolNode)(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,r){var n=o(e,t,r);return e.set(s,n),n}},f.prototype.forEach=function(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)},f.prototype.map=function(e){return new f(this._ifNode(e(this.object,"object",this)),this.index?this._ifNode(e(this.index,"index",this)):null,this._ifNode(e(this.value,"value",this)))},f.prototype.clone=function(){return new f(this.object,this.index,this.value)},f.prototype._toString=function(e){var t=this.object.toString(e),r=this.index?this.index.toString(e):"",n=this.value.toString(e);return p(this,e&&e.parenthesis)&&(n="("+n+")"),t+r+" = "+n},f.prototype.toJSON=function(){return{mathjs:"AssignmentNode",object:this.object,index:this.index,value:this.value}},f.fromJSON=function(e){return new f(e.object,e.index,e.value)},f.prototype.toHTML=function(e){var t=this.object.toHTML(e),r=this.index?this.index.toHTML(e):"",n=this.value.toHTML(e);return p(this,e&&e.parenthesis)&&(n='<span class="math-paranthesis math-round-parenthesis">(</span>'+n+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+r+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+n},f.prototype._toTex=function(e){var t=this.object.toTex(e),r=this.index?this.index.toTex(e):"",n=this.value.toTex(e);return p(this,e&&e.parenthesis)&&(n="\\left(".concat(n,"\\right)")),t+r+":="+n},f}),{isClass:!0,isNode:!0});t.createAssignmentNode=u},81524:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBlockNode=void 0;var n=r(57237),a=r(70517),i=["ResultSet","Node"],o=(0,r(58450).factory)("BlockNode",i,(function(e){var t=e.ResultSet,r=e.Node;function i(e){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map((function(e){var t=e&&e.node,r=!e||void 0===e.visible||e.visible;if(!(0,n.isNode)(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof r)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:r}}))}return i.prototype=new r,i.prototype.type="BlockNode",i.prototype.isBlockNode=!0,i.prototype._compile=function(e,r){var n=(0,a.map)(this.blocks,(function(t){return{evaluate:t.node._compile(e,r),visible:t.visible}}));return function(e,r,i){var o=[];return(0,a.forEach)(n,(function(t){var n=t.evaluate(e,r,i);t.visible&&o.push(n)})),new t(o)}},i.prototype.forEach=function(e){for(var t=0;t<this.blocks.length;t++)e(this.blocks[t].node,"blocks["+t+"].node",this)},i.prototype.map=function(e){for(var t=[],r=0;r<this.blocks.length;r++){var n=this.blocks[r],a=this._ifNode(e(n.node,"blocks["+r+"].node",this));t[r]={node:a,visible:n.visible}}return new i(t)},i.prototype.clone=function(){return new i(this.blocks.map((function(e){return{node:e.node,visible:e.visible}})))},i.prototype._toString=function(e){return this.blocks.map((function(t){return t.node.toString(e)+(t.visible?"":";")})).join("\n")},i.prototype.toJSON=function(){return{mathjs:"BlockNode",blocks:this.blocks}},i.fromJSON=function(e){return new i(e.blocks)},i.prototype.toHTML=function(e){return this.blocks.map((function(t){return t.node.toHTML(e)+(t.visible?"":'<span class="math-separator">;</span>')})).join('<span class="math-separator"><br /></span>')},i.prototype._toTex=function(e){return this.blocks.map((function(t){return t.node.toTex(e)+(t.visible?"":";")})).join("\\;\\;\n")},i}),{isClass:!0,isNode:!0});t.createBlockNode=o},77621:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConditionalNode=void 0;var n=r(57237),a=r(58450),i=r(17715),o=["Node"],s=(0,a.factory)("ConditionalNode",o,(function(e){var t=e.Node;function r(e,t,a){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!(0,n.isNode)(e))throw new TypeError("Parameter condition must be a Node");if(!(0,n.isNode)(t))throw new TypeError("Parameter trueExpr must be a Node");if(!(0,n.isNode)(a))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=a}return r.prototype=new t,r.prototype.type="ConditionalNode",r.prototype.isConditionalNode=!0,r.prototype._compile=function(e,t){var r=this.condition._compile(e,t),a=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,o){return function(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return!!e;if(e){if((0,n.isBigNumber)(e))return!e.isZero();if((0,n.isComplex)(e))return!(!e.re&&!e.im);if((0,n.isUnit)(e))return!!e.value}if(null==e)return!1;throw new TypeError('Unsupported type of condition "'+(0,n.typeOf)(e)+'"')}(r(e,t,o))?a(e,t,o):i(e,t,o)}},r.prototype.forEach=function(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)},r.prototype.map=function(e){return new r(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))},r.prototype.clone=function(){return new r(this.condition,this.trueExpr,this.falseExpr)},r.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=(0,i.getPrecedence)(this,t),n=this.condition.toString(e),a=(0,i.getPrecedence)(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==a&&a<=r)&&(n="("+n+")");var o=this.trueExpr.toString(e),s=(0,i.getPrecedence)(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==s&&s<=r)&&(o="("+o+")");var l=this.falseExpr.toString(e),c=(0,i.getPrecedence)(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==c&&c<=r)&&(l="("+l+")"),n+" ? "+o+" : "+l},r.prototype.toJSON=function(){return{mathjs:"ConditionalNode",condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}},r.fromJSON=function(e){return new r(e.condition,e.trueExpr,e.falseExpr)},r.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=(0,i.getPrecedence)(this,t),n=this.condition.toHTML(e),a=(0,i.getPrecedence)(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==a&&a<=r)&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>');var o=this.trueExpr.toHTML(e),s=(0,i.getPrecedence)(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==s&&s<=r)&&(o='<span class="math-parenthesis math-round-parenthesis">(</span>'+o+'<span class="math-parenthesis math-round-parenthesis">)</span>');var l=this.falseExpr.toHTML(e),c=(0,i.getPrecedence)(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==c&&c<=r)&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),n+'<span class="math-operator math-conditional-operator">?</span>'+o+'<span class="math-operator math-conditional-operator">:</span>'+l},r.prototype._toTex=function(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"},r}),{isClass:!0,isNode:!0});t.createConditionalNode=s},47788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConstantNode=void 0;var n=r(59398),a=r(57237),i=r(46),o=["Node"],s=(0,r(58450).factory)("ConstantNode",o,(function(e){var t=e.Node;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.value=e}return r.prototype=new t,r.prototype.type="ConstantNode",r.prototype.isConstantNode=!0,r.prototype._compile=function(e,t){var r=this.value;return function(){return r}},r.prototype.forEach=function(e){},r.prototype.map=function(e){return this.clone()},r.prototype.clone=function(){return new r(this.value)},r.prototype._toString=function(e){return(0,n.format)(this.value,e)},r.prototype.toHTML=function(e){var t=this._toString(e);switch((0,a.typeOf)(this.value)){case"number":case"BigNumber":case"Fraction":return'<span class="math-number">'+t+"</span>";case"string":return'<span class="math-string">'+t+"</span>";case"boolean":return'<span class="math-boolean">'+t+"</span>";case"null":return'<span class="math-null-symbol">'+t+"</span>";case"undefined":return'<span class="math-undefined">'+t+"</span>";default:return'<span class="math-symbol">'+t+"</span>"}},r.prototype.toJSON=function(){return{mathjs:"ConstantNode",value:this.value}},r.fromJSON=function(e){return new r(e.value)},r.prototype._toTex=function(e){var t=this._toString(e);switch((0,a.typeOf)(this.value)){case"string":return"\\mathtt{"+(0,i.escapeLatex)(t)+"}";case"number":case"BigNumber":if(!isFinite(this.value))return this.value.valueOf()<0?"-\\infty":"\\infty";var r=t.toLowerCase().indexOf("e");return-1!==r?t.substring(0,r)+"\\cdot10^{"+t.substring(r+1)+"}":t;case"Fraction":return this.value.toLatex();default:return t}},r}),{isClass:!0,isNode:!0});t.createConstantNode=s},15427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFunctionAssignmentNode=void 0;var n=r(57237),a=r(74559),i=r(59398),o=r(70517),s=r(46),l=r(17715),c=["typed","Node"],u=(0,r(58450).factory)("FunctionAssignmentNode",c,(function(e){var t=e.typed,r=e.Node;function c(e,t,r){if(!(this instanceof c))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!(0,n.isNode)(r))throw new TypeError('Node expected for parameter "expr"');if(a.keywords.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');this.name=e,this.params=t.map((function(e){return e&&e.name||e})),this.types=t.map((function(e){return e&&e.type||"any"})),this.expr=r}function u(e,t){var r=(0,l.getPrecedence)(e,t),n=(0,l.getPrecedence)(e.expr,t);return"all"===t||null!==n&&n<=r}return c.prototype=new r,c.prototype.type="FunctionAssignmentNode",c.prototype.isFunctionAssignmentNode=!0,c.prototype._compile=function(e,r){var n=Object.create(r);(0,o.forEach)(this.params,(function(e){n[e]=!0}));var a=this.expr._compile(e,n),i=this.name,s=this.params,l=(0,o.join)(this.types,","),c=i+"("+(0,o.join)(this.params,", ")+")";return function(e,r,n){var o={};o[l]=function(){for(var t=Object.create(r),i=0;i<s.length;i++)t[s[i]]=arguments[i];return a(e,t,n)};var u=t(i,o);return u.syntax=c,e.set(i,u),u}},c.prototype.forEach=function(e){e(this.expr,"expr",this)},c.prototype.map=function(e){var t=this._ifNode(e(this.expr,"expr",this));return new c(this.name,this.params.slice(0),t)},c.prototype.clone=function(){return new c(this.name,this.params.slice(0),this.expr)},c.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=this.expr.toString(e);return u(this,t)&&(r="("+r+")"),this.name+"("+this.params.join(", ")+") = "+r},c.prototype.toJSON=function(){var e=this.types;return{mathjs:"FunctionAssignmentNode",name:this.name,params:this.params.map((function(t,r){return{name:t,type:e[r]}})),expr:this.expr}},c.fromJSON=function(e){return new c(e.name,e.params,e.expr)},c.prototype.toHTML=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=[],n=0;n<this.params.length;n++)r.push('<span class="math-symbol math-parameter">'+(0,i.escape)(this.params[n])+"</span>");var a=this.expr.toHTML(e);return u(this,t)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+(0,i.escape)(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+r.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+a},c.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=this.expr.toTex(e);return u(this,t)&&(r="\\left(".concat(r,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(s.toSymbol).join(",")+"\\right):="+r},c}),{isClass:!0,isNode:!0});t.createFunctionAssignmentNode=u},20948:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createFunctionNode=void 0;var a=n(r(80812)),i=n(r(34906)),o=r(57237),s=r(59398),l=r(54699),c=r(27807),u=r(67797),f=r(58450),p=r(46),h=["math","Node","SymbolNode"],d=(0,f.factory)("FunctionNode",h,(function(e){var t=e.math,r=e.Node,n=e.SymbolNode;function f(e,t){if(!(this instanceof f))throw new SyntaxError("Constructor must be called with the new operator");if("string"==typeof e&&(e=new n(e)),!(0,o.isNode)(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(o.isNode))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=t||[],Object.defineProperty(this,"name",{get:function(){return this.fn.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}f.prototype=new r,f.prototype.type="FunctionNode",f.prototype.isFunctionNode=!0,f.prototype._compile=function(e,t){if(!(this instanceof f))throw new TypeError("No valid FunctionNode");var r=this.args.map((function(r){return r._compile(e,t)}));if(!(0,o.isSymbolNode)(this.fn)){if((0,o.isAccessorNode)(this.fn)&&(0,o.isIndexNode)(this.fn.index)&&this.fn.index.isObjectProperty()){var n=this.fn.object._compile(e,t),a=this.fn.index.getObjectProperty(),s=this.args;return function(t,i,o){var l=n(t,i,o);if((0,c.validateSafeMethod)(l,a),l[a]&&l[a].rawArgs)return l[a](s,e,(0,u.createSubScope)(t,i),t);var f=r.map((function(e){return e(t,i,o)}));return l[a].apply(l,f)}}var l=this.fn._compile(e,t),p=this.args;return function(t,n,a){var i=l(t,n,a);if(i&&i.rawArgs)return i(p,e,(0,u.createSubScope)(t,n),t);var o=r.map((function(e){return e(t,n,a)}));return i.apply(i,o)}}var h=this.fn.name,d=h in e?(0,c.getSafeProperty)(e,h):void 0,m="function"==typeof d&&!0===d.rawArgs,g=function(t){return t.has(h)?t.get(h):h in e?(0,c.getSafeProperty)(e,h):f.onUndefinedFunction(h)};if(m){var y=this.args;return function(t,r,n){return g(t)(y,e,(0,u.createSubScope)(t,r),t)}}switch(r.length){case 0:return function(e,t,r){return g(e)()};case 1:return function(e,t,n){return g(e)((0,r[0])(e,t,n))};case 2:return function(e,t,n){var a=g(e),i=r[0],o=r[1];return a(i(e,t,n),o(e,t,n))};default:return function(e,t,n){var a=g(e),o=r.map((function(r){return r(e,t,n)}));return a.apply(void 0,(0,i.default)(o))}}},f.prototype.forEach=function(e){e(this.fn,"fn",this);for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)},f.prototype.map=function(e){for(var t=this._ifNode(e(this.fn,"fn",this)),r=[],n=0;n<this.args.length;n++)r[n]=this._ifNode(e(this.args[n],"args["+n+"]",this));return new f(t,r)},f.prototype.clone=function(){return new f(this.fn,this.args.slice(0))},f.onUndefinedFunction=function(e){throw new Error("Undefined function "+e)};var h=f.prototype.toString;function d(e,t,r){for(var n,i="",s=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,l=0;null!==(n=s.exec(e));)if(i+=e.substring(l,n.index),l=n.index,"$$"===n[0])i+="$",l++;else{l+=n[0].length;var c=t[n[1]];if(!c)throw new ReferenceError("Template: Property "+n[1]+" does not exist.");if(void 0===n[2])switch((0,a.default)(c)){case"string":i+=c;break;case"object":if((0,o.isNode)(c))i+=c.toTex(r);else{if(!Array.isArray(c))throw new TypeError("Template: "+n[1]+" has to be a Node, String or array of Nodes");i+=c.map((function(e,t){if((0,o.isNode)(e))return e.toTex(r);throw new TypeError("Template: "+n[1]+"["+t+"] is not a Node.")})).join(",")}break;default:throw new TypeError("Template: "+n[1]+" has to be a Node, String or array of Nodes")}else{if(!(0,o.isNode)(c[n[2]]&&c[n[2]]))throw new TypeError("Template: "+n[1]+"["+n[2]+"] is not a Node.");i+=c[n[2]].toTex(r)}}return i+e.slice(l)}f.prototype.toString=function(e){var t,r=this.fn.toString(e);return e&&"object"===(0,a.default)(e.handler)&&(0,l.hasOwnProperty)(e.handler,r)&&(t=e.handler[r](this,e)),void 0!==t?t:h.call(this,e)},f.prototype._toString=function(e){var t=this.args.map((function(t){return t.toString(e)}));return((0,o.isFunctionAssignmentNode)(this.fn)?"("+this.fn.toString(e)+")":this.fn.toString(e))+"("+t.join(", ")+")"},f.prototype.toJSON=function(){return{mathjs:"FunctionNode",fn:this.fn,args:this.args}},f.fromJSON=function(e){return new f(e.fn,e.args)},f.prototype.toHTML=function(e){var t=this.args.map((function(t){return t.toHTML(e)}));return'<span class="math-function">'+(0,s.escape)(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'};var m=f.prototype.toTex;return f.prototype.toTex=function(e){var t;return e&&"object"===(0,a.default)(e.handler)&&(0,l.hasOwnProperty)(e.handler,this.name)&&(t=e.handler[this.name](this,e)),void 0!==t?t:m.call(this,e)},f.prototype._toTex=function(e){var r,n,i=this.args.map((function(t){return t.toTex(e)}));switch(p.latexFunctions[this.name]&&(r=p.latexFunctions[this.name]),!t[this.name]||"function"!=typeof t[this.name].toTex&&"object"!==(0,a.default)(t[this.name].toTex)&&"string"!=typeof t[this.name].toTex||(r=t[this.name].toTex),(0,a.default)(r)){case"function":n=r(this,e);break;case"string":n=d(r,this,e);break;case"object":switch((0,a.default)(r[i.length])){case"function":n=r[i.length](this,e);break;case"string":n=d(r[i.length],this,e)}}return void 0!==n?n:d(p.defaultTemplate,this,e)},f.prototype.getIdentifier=function(){return this.type+":"+this.name},f}),{isClass:!0,isNode:!0});t.createFunctionNode=d},85458:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createIndexNode=void 0;var a=n(r(34906)),i=r(57237),o=r(70517),s=r(59398),l=r(58450),c=r(27807),u=["Range","Node","size"],f=(0,l.factory)("IndexNode",u,(function(e){var t=e.Range,r=e.Node,n=e.size;function l(e,t){if(!(this instanceof l))throw new SyntaxError("Constructor must be called with the new operator");if(this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(i.isNode))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}function u(e,r,n){return new t((0,i.isBigNumber)(e)?e.toNumber():e,(0,i.isBigNumber)(r)?r.toNumber():r,(0,i.isBigNumber)(n)?n.toNumber():n)}return l.prototype=new r,l.prototype.type="IndexNode",l.prototype.isIndexNode=!0,l.prototype._compile=function(e,t){var r=(0,o.map)(this.dimensions,(function(r,a){if((0,i.isRangeNode)(r)){if(r.needsEnd()){var o=Object.create(t);o.end=!0;var s=r.start._compile(e,o),l=r.end._compile(e,o),c=r.step?r.step._compile(e,o):function(){return 1};return function(e,t,r){var i=n(r).valueOf(),o=Object.create(t);return o.end=i[a],u(s(e,o,r),l(e,o,r),c(e,o,r))}}var f=r.start._compile(e,t),p=r.end._compile(e,t),h=r.step?r.step._compile(e,t):function(){return 1};return function(e,t,r){return u(f(e,t,r),p(e,t,r),h(e,t,r))}}if((0,i.isSymbolNode)(r)&&"end"===r.name){var d=Object.create(t);d.end=!0;var m=r._compile(e,d);return function(e,t,r){var i=n(r).valueOf(),o=Object.create(t);return o.end=i[a],m(e,o,r)}}var g=r._compile(e,t);return function(e,t,r){return g(e,t,r)}})),s=(0,c.getSafeProperty)(e,"index");return function(e,t,n){var i=(0,o.map)(r,(function(r){return r(e,t,n)}));return s.apply(void 0,(0,a.default)(i))}},l.prototype.forEach=function(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)},l.prototype.map=function(e){for(var t=[],r=0;r<this.dimensions.length;r++)t[r]=this._ifNode(e(this.dimensions[r],"dimensions["+r+"]",this));return new l(t,this.dotNotation)},l.prototype.clone=function(){return new l(this.dimensions.slice(0),this.dotNotation)},l.prototype.isObjectProperty=function(){return 1===this.dimensions.length&&(0,i.isConstantNode)(this.dimensions[0])&&"string"==typeof this.dimensions[0].value},l.prototype.getObjectProperty=function(){return this.isObjectProperty()?this.dimensions[0].value:null},l.prototype._toString=function(e){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"},l.prototype.toJSON=function(){return{mathjs:"IndexNode",dimensions:this.dimensions,dotNotation:this.dotNotation}},l.fromJSON=function(e){return new l(e.dimensions,e.dotNotation)},l.prototype.toHTML=function(e){for(var t=[],r=0;r<this.dimensions.length;r++)t[r]=this.dimensions[r].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+(0,s.escape)(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'},l.prototype._toTex=function(e){var t=this.dimensions.map((function(t){return t.toTex(e)}));return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"},l}),{isClass:!0,isNode:!0});t.createIndexNode=f},58352:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createNode=void 0;var a=n(r(34906)),i=n(r(80812)),o=r(57237),s=r(74559),l=r(54699),c=r(58450),u=r(84146),f=["mathWithTransform"],p=(0,c.factory)("Node",f,(function(e){var t=e.mathWithTransform;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator")}return r.prototype.evaluate=function(e){return this.compile().evaluate(e)},r.prototype.type="Node",r.prototype.isNode=!0,r.prototype.comment="",r.prototype.compile=function(){var e=this._compile(t,{}),r={};return{evaluate:function(t){var n=(0,u.createMap)(t);return function(e){for(var t=0,r=(0,a.default)(s.keywords);t<r.length;t++){var n=r[t];if(e.has(n))throw new Error('Scope contains an illegal symbol, "'+n+'" is a reserved keyword')}}(n),e(n,r,null)}}},r.prototype._compile=function(e,t){throw new Error("Method _compile should be implemented by type "+this.type)},r.prototype.forEach=function(e){throw new Error("Cannot run forEach on a Node interface")},r.prototype.map=function(e){throw new Error("Cannot run map on a Node interface")},r.prototype._ifNode=function(e){if(!(0,o.isNode)(e))throw new TypeError("Callback function must return a Node");return e},r.prototype.traverse=function(e){e(this,null,null),function e(t,r){t.forEach((function(t,n,a){r(t,n,a),e(t,r)}))}(this,e)},r.prototype.transform=function(e){return function t(r,n,a){var i=e(r,n,a);return i!==r?i:r.map(t)}(this,null,null)},r.prototype.filter=function(e){var t=[];return this.traverse((function(r,n,a){e(r,n,a)&&t.push(r)})),t},r.prototype.clone=function(){throw new Error("Cannot clone a Node interface")},r.prototype.cloneDeep=function(){return this.map((function(e){return e.cloneDeep()}))},r.prototype.equals=function(e){return!!e&&(0,l.deepStrictEqual)(this,e)},r.prototype.toString=function(e){var t=this._getCustomString(e);return void 0!==t?t:this._toString(e)},r.prototype.toJSON=function(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)},r.prototype.toHTML=function(e){var t=this._getCustomString(e);return void 0!==t?t:this.toHTML(e)},r.prototype._toString=function(){throw new Error("_toString not implemented for "+this.type)},r.prototype.toTex=function(e){var t=this._getCustomString(e);return void 0!==t?t:this._toTex(e)},r.prototype._toTex=function(e){throw new Error("_toTex not implemented for "+this.type)},r.prototype._getCustomString=function(e){if(e&&"object"===(0,i.default)(e))switch((0,i.default)(e.handler)){case"object":case"undefined":return;case"function":return e.handler(this,e);default:throw new TypeError("Object or function expected as callback")}},r.prototype.getIdentifier=function(){return this.type},r.prototype.getContent=function(){return this},r}),{isClass:!0,isNode:!0});t.createNode=p},56763:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createObjectNode=void 0;var a=n(r(80812)),i=r(57237),o=r(59398),s=r(27807),l=r(54699),c=["Node"],u=(0,r(58450).factory)("ObjectNode",c,(function(e){var t=e.Node;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(this.properties=e||{},e&&("object"!==(0,a.default)(e)||!Object.keys(e).every((function(t){return(0,i.isNode)(e[t])}))))throw new TypeError("Object containing Nodes expected")}return r.prototype=new t,r.prototype.type="ObjectNode",r.prototype.isObjectNode=!0,r.prototype._compile=function(e,t){var r={};for(var n in this.properties)if((0,l.hasOwnProperty)(this.properties,n)){var a=(0,o.stringify)(n),i=JSON.parse(a);if(!(0,s.isSafeProperty)(this.properties,i))throw new Error('No access to property "'+i+'"');r[i]=this.properties[n]._compile(e,t)}return function(e,t,n){var a={};for(var i in r)(0,l.hasOwnProperty)(r,i)&&(a[i]=r[i](e,t,n));return a}},r.prototype.forEach=function(e){for(var t in this.properties)(0,l.hasOwnProperty)(this.properties,t)&&e(this.properties[t],"properties["+(0,o.stringify)(t)+"]",this)},r.prototype.map=function(e){var t={};for(var n in this.properties)(0,l.hasOwnProperty)(this.properties,n)&&(t[n]=this._ifNode(e(this.properties[n],"properties["+(0,o.stringify)(n)+"]",this)));return new r(t)},r.prototype.clone=function(){var e={};for(var t in this.properties)(0,l.hasOwnProperty)(this.properties,t)&&(e[t]=this.properties[t]);return new r(e)},r.prototype._toString=function(e){var t=[];for(var r in this.properties)(0,l.hasOwnProperty)(this.properties,r)&&t.push((0,o.stringify)(r)+": "+this.properties[r].toString(e));return"{"+t.join(", ")+"}"},r.prototype.toJSON=function(){return{mathjs:"ObjectNode",properties:this.properties}},r.fromJSON=function(e){return new r(e.properties)},r.prototype.toHTML=function(e){var t=[];for(var r in this.properties)(0,l.hasOwnProperty)(this.properties,r)&&t.push('<span class="math-symbol math-property">'+(0,o.escape)(r)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[r].toHTML(e));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'},r.prototype._toTex=function(e){var t=[];for(var r in this.properties)(0,l.hasOwnProperty)(this.properties,r)&&t.push("\\mathbf{"+r+":} & "+this.properties[r].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}".concat(t.join("\n"),"\\end{array}\\right\\}")},r}),{isClass:!0,isNode:!0});t.createObjectNode=u},43144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOperatorNode=void 0;var n=r(57237),a=r(70517),i=r(59398),o=r(27807),s=r(17715),l=r(46),c=["Node"],u=(0,r(58450).factory)("OperatorNode",c,(function(e){var t=e.Node;function r(e,t,a,i,o){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof e)throw new TypeError('string expected for parameter "op"');if("string"!=typeof t)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(a)||!a.every(n.isNode))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===i,this.isPercentage=!0===o,this.op=e,this.fn=t,this.args=a||[]}function c(e,t,r,n,a){var i,o=(0,s.getPrecedence)(e,t),l=(0,s.getAssociativity)(e,t);if("all"===t||n.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return n.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));switch(n.length){case 0:i=[];break;case 1:var c=(0,s.getPrecedence)(n[0],t);if(a&&null!==c){var u,f;if("keep"===t?(u=n[0].getIdentifier(),f=e.getIdentifier()):(u=n[0].getContent().getIdentifier(),f=e.getContent().getIdentifier()),!1===s.properties[o][f].latexLeftParens){i=[!1];break}if(!1===s.properties[c][u].latexParens){i=[!1];break}}if(null===c){i=[!1];break}if(c<=o){i=[!0];break}i=[!1];break;case 2:var p,h,d=(0,s.getPrecedence)(n[0],t),m=(0,s.isAssociativeWith)(e,n[0],t);p=null!==d&&(d===o&&"right"===l&&!m||d<o);var g,y,v,b=(0,s.getPrecedence)(n[1],t),x=(0,s.isAssociativeWith)(e,n[1],t);h=null!==b&&(b===o&&"left"===l&&!x||b<o),a&&("keep"===t?(g=e.getIdentifier(),y=e.args[0].getIdentifier(),v=e.args[1].getIdentifier()):(g=e.getContent().getIdentifier(),y=e.args[0].getContent().getIdentifier(),v=e.args[1].getContent().getIdentifier()),null!==d&&(!1===s.properties[o][g].latexLeftParens&&(p=!1),!1===s.properties[d][y].latexParens&&(p=!1)),null!==b&&(!1===s.properties[o][g].latexRightParens&&(h=!1),!1===s.properties[b][v].latexParens&&(h=!1))),i=[p,h];break;default:"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier()||(i=n.map((function(r){var n=(0,s.getPrecedence)(r,t),a=(0,s.isAssociativeWith)(e,r,t),i=(0,s.getAssociativity)(r,t);return null!==n&&(o===n&&l===i&&!a||n<o)})))}return n.length>=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"auto"===t&&"hide"===r&&(i=n.map((function(e,t){var r="ParenthesisNode"===e.getIdentifier();return!(!i[t]&&!r)}))),i}return r.prototype=new t,r.prototype.type="OperatorNode",r.prototype.isOperatorNode=!0,r.prototype._compile=function(e,t){if("string"!=typeof this.fn||!(0,o.isSafeMethod)(e,this.fn))throw e[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var r=(0,o.getSafeProperty)(e,this.fn),n=(0,a.map)(this.args,(function(r){return r._compile(e,t)}));if(1===n.length){var i=n[0];return function(e,t,n){return r(i(e,t,n))}}if(2===n.length){var s=n[0],l=n[1];return function(e,t,n){return r(s(e,t,n),l(e,t,n))}}return function(e,t,i){return r.apply(null,(0,a.map)(n,(function(r){return r(e,t,i)})))}},r.prototype.forEach=function(e){for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)},r.prototype.map=function(e){for(var t=[],n=0;n<this.args.length;n++)t[n]=this._ifNode(e(this.args[n],"args["+n+"]",this));return new r(this.op,this.fn,t,this.implicit,this.isPercentage)},r.prototype.clone=function(){return new r(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)},r.prototype.isUnary=function(){return 1===this.args.length},r.prototype.isBinary=function(){return 2===this.args.length},r.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",n=this.args,a=c(this,t,r,n,!1);if(1===n.length){var i=(0,s.getAssociativity)(this,t),o=n[0].toString(e);a[0]&&(o="("+o+")");var l=/[a-zA-Z]+/.test(this.op);return"right"===i?this.op+(l?" ":"")+o:"left"===i?o+(l?" ":"")+this.op:o+this.op}if(2===n.length){var u=n[0].toString(e),f=n[1].toString(e);return a[0]&&(u="("+u+")"),a[1]&&(f="("+f+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?u+" "+f:u+" "+this.op+" "+f}if(n.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var p=n.map((function(t,r){return t=t.toString(e),a[r]&&(t="("+t+")"),t}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?p.join(" "):p.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"},r.prototype.toJSON=function(){return{mathjs:"OperatorNode",op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}},r.fromJSON=function(e){return new r(e.op,e.fn,e.args,e.implicit,e.isPercentage)},r.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",n=this.args,a=c(this,t,r,n,!1);if(1===n.length){var o=(0,s.getAssociativity)(this,t),l=n[0].toHTML(e);return a[0]&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===o?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+(0,i.escape)(this.op)+"</span>"+l:l+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+(0,i.escape)(this.op)+"</span>"}if(2===n.length){var u=n[0].toHTML(e),f=n[1].toHTML(e);return a[0]&&(u='<span class="math-parenthesis math-round-parenthesis">(</span>'+u+'<span class="math-parenthesis math-round-parenthesis">)</span>'),a[1]&&(f='<span class="math-parenthesis math-round-parenthesis">(</span>'+f+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?u+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+f:u+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+(0,i.escape)(this.op)+"</span>"+f}var p=n.map((function(t,r){return t=t.toHTML(e),a[r]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t}));return n.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?p.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):p.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+(0,i.escape)(this.op)+"</span>"):'<span class="math-function">'+(0,i.escape)(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+p.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'},r.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",n=this.args,a=c(this,t,r,n,!0),i=l.latexOperators[this.fn];if(i=void 0===i?this.op:i,1===n.length){var o=(0,s.getAssociativity)(this,t),u=n[0].toTex(e);return a[0]&&(u="\\left(".concat(u,"\\right)")),"right"===o?i+u:u+i}if(2===n.length){var f=n[0],p=f.toTex(e);a[0]&&(p="\\left(".concat(p,"\\right)"));var h,d=n[1].toTex(e);switch(a[1]&&(d="\\left(".concat(d,"\\right)")),h="keep"===t?f.getIdentifier():f.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return i+"{"+p+"}{"+d+"}";case"OperatorNode:pow":switch(p="{"+p+"}",d="{"+d+"}",h){case"ConditionalNode":case"OperatorNode:divide":p="\\left(".concat(p,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===r)return p+"~"+d}return p+i+d}if(n.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var m=n.map((function(t,r){return t=t.toTex(e),a[r]&&(t="\\left(".concat(t,"\\right)")),t}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit?m.join("~"):m.join(i)}return"\\mathrm{"+this.fn+"}\\left("+n.map((function(t){return t.toTex(e)})).join(",")+"\\right)"},r.prototype.getIdentifier=function(){return this.type+":"+this.fn},r}),{isClass:!0,isNode:!0});t.createOperatorNode=u},95454:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParenthesisNode=void 0;var n=r(57237),a=["Node"],i=(0,r(58450).factory)("ParenthesisNode",a,(function(e){var t=e.Node;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!(0,n.isNode)(e))throw new TypeError('Node expected for parameter "content"');this.content=e}return r.prototype=new t,r.prototype.type="ParenthesisNode",r.prototype.isParenthesisNode=!0,r.prototype._compile=function(e,t){return this.content._compile(e,t)},r.prototype.getContent=function(){return this.content.getContent()},r.prototype.forEach=function(e){e(this.content,"content",this)},r.prototype.map=function(e){return new r(e(this.content,"content",this))},r.prototype.clone=function(){return new r(this.content)},r.prototype._toString=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)},r.prototype.toJSON=function(){return{mathjs:"ParenthesisNode",content:this.content}},r.fromJSON=function(e){return new r(e.content)},r.prototype.toHTML=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(e)},r.prototype._toTex=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)},r}),{isClass:!0,isNode:!0});t.createParenthesisNode=i},11032:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRangeNode=void 0;var n=r(57237),a=r(58450),i=r(17715),o=["Node"],s=(0,a.factory)("RangeNode",o,(function(e){var t=e.Node;function r(e,t,a){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!(0,n.isNode)(e))throw new TypeError("Node expected");if(!(0,n.isNode)(t))throw new TypeError("Node expected");if(a&&!(0,n.isNode)(a))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=a||null}function a(e,t){var r=(0,i.getPrecedence)(e,t),n={},a=(0,i.getPrecedence)(e.start,t);if(n.start=null!==a&&a<=r||"all"===t,e.step){var o=(0,i.getPrecedence)(e.step,t);n.step=null!==o&&o<=r||"all"===t}var s=(0,i.getPrecedence)(e.end,t);return n.end=null!==s&&s<=r||"all"===t,n}return r.prototype=new t,r.prototype.type="RangeNode",r.prototype.isRangeNode=!0,r.prototype.needsEnd=function(){return this.filter((function(e){return(0,n.isSymbolNode)(e)&&"end"===e.name})).length>0},r.prototype._compile=function(e,t){var r=e.range,n=this.start._compile(e,t),a=this.end._compile(e,t);if(this.step){var i=this.step._compile(e,t);return function(e,t,o){return r(n(e,t,o),a(e,t,o),i(e,t,o))}}return function(e,t,i){return r(n(e,t,i),a(e,t,i))}},r.prototype.forEach=function(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)},r.prototype.map=function(e){return new r(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))},r.prototype.clone=function(){return new r(this.start,this.end,this.step&&this.step)},r.prototype._toString=function(e){var t,r=a(this,e&&e.parenthesis?e.parenthesis:"keep"),n=this.start.toString(e);if(r.start&&(n="("+n+")"),t=n,this.step){var i=this.step.toString(e);r.step&&(i="("+i+")"),t+=":"+i}var o=this.end.toString(e);return r.end&&(o="("+o+")"),t+":"+o},r.prototype.toJSON=function(){return{mathjs:"RangeNode",start:this.start,end:this.end,step:this.step}},r.fromJSON=function(e){return new r(e.start,e.end,e.step)},r.prototype.toHTML=function(e){var t,r=a(this,e&&e.parenthesis?e.parenthesis:"keep"),n=this.start.toHTML(e);if(r.start&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t=n,this.step){var i=this.step.toHTML(e);r.step&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+='<span class="math-operator math-range-operator">:</span>'+i}var o=this.end.toHTML(e);return r.end&&(o='<span class="math-parenthesis math-round-parenthesis">(</span>'+o+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+'<span class="math-operator math-range-operator">:</span>'+o},r.prototype._toTex=function(e){var t=a(this,e&&e.parenthesis?e.parenthesis:"keep"),r=this.start.toTex(e);if(t.start&&(r="\\left(".concat(r,"\\right)")),this.step){var n=this.step.toTex(e);t.step&&(n="\\left(".concat(n,"\\right)")),r+=":"+n}var i=this.end.toTex(e);return t.end&&(i="\\left(".concat(i,"\\right)")),r+":"+i},r}),{isClass:!0,isNode:!0});t.createRangeNode=s},15198:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRelationalNode=void 0;var n=r(17715),a=r(59398),i=r(27807),o=r(46),s=["Node"],l=(0,r(58450).factory)("RelationalNode",s,(function(e){var t=e.Node;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}return r.prototype=new t,r.prototype.type="RelationalNode",r.prototype.isRelationalNode=!0,r.prototype._compile=function(e,t){var r=this,n=this.params.map((function(r){return r._compile(e,t)}));return function(t,a,o){for(var s,l=n[0](t,a,o),c=0;c<r.conditionals.length;c++)if(s=l,l=n[c+1](t,a,o),!(0,i.getSafeProperty)(e,r.conditionals[c])(s,l))return!1;return!0}},r.prototype.forEach=function(e){var t=this;this.params.forEach((function(r,n){return e(r,"params["+n+"]",t)}),this)},r.prototype.map=function(e){var t=this;return new r(this.conditionals.slice(),this.params.map((function(r,n){return t._ifNode(e(r,"params["+n+"]",t))}),this))},r.prototype.clone=function(){return new r(this.conditionals,this.params)},r.prototype._toString=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=(0,n.getPrecedence)(this,t),a=this.params.map((function(a,i){var o=(0,n.getPrecedence)(a,t);return"all"===t||null!==o&&o<=r?"("+a.toString(e)+")":a.toString(e)})),i={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},o=a[0],s=0;s<this.conditionals.length;s++)o+=" "+i[this.conditionals[s]]+" "+a[s+1];return o},r.prototype.toJSON=function(){return{mathjs:"RelationalNode",conditionals:this.conditionals,params:this.params}},r.fromJSON=function(e){return new r(e.conditionals,e.params)},r.prototype.toHTML=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=(0,n.getPrecedence)(this,t),i=this.params.map((function(a,i){var o=(0,n.getPrecedence)(a,t);return"all"===t||null!==o&&o<=r?'<span class="math-parenthesis math-round-parenthesis">(</span>'+a.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':a.toHTML(e)})),o={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},s=i[0],l=0;l<this.conditionals.length;l++)s+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+(0,a.escape)(o[this.conditionals[l]])+"</span>"+i[l+1];return s},r.prototype._toTex=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=(0,n.getPrecedence)(this,t),a=this.params.map((function(a,i){var o=(0,n.getPrecedence)(a,t);return"all"===t||null!==o&&o<=r?"\\left("+a.toTex(e)+"\right)":a.toTex(e)})),i=a[0],s=0;s<this.conditionals.length;s++)i+=o.latexOperators[this.conditionals[s]]+a[s+1];return i},r}),{isClass:!0,isNode:!0});t.createRelationalNode=l},95802:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSymbolNode=void 0;var n=r(59398),a=r(27807),i=r(58450),o=r(46),s=["math","?Unit","Node"],l=(0,i.factory)("SymbolNode",s,(function(e){var t=e.math,r=e.Unit,i=e.Node;function s(e){return!!r&&r.isValuelessUnit(e)}function l(e){if(!(this instanceof l))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}return l.prototype=new i,l.prototype.type="SymbolNode",l.prototype.isSymbolNode=!0,l.prototype._compile=function(e,t){var n=this.name;if(!0===t[n])return function(e,t,r){return t[n]};if(n in e)return function(t,r,i){return t.has(n)?t.get(n):(0,a.getSafeProperty)(e,n)};var i=s(n);return function(e,t,a){return e.has(n)?e.get(n):i?new r(null,n):l.onUndefinedSymbol(n)}},l.prototype.forEach=function(e){},l.prototype.map=function(e){return this.clone()},l.onUndefinedSymbol=function(e){throw new Error("Undefined symbol "+e)},l.prototype.clone=function(){return new l(this.name)},l.prototype._toString=function(e){return this.name},l.prototype.toHTML=function(e){var t=(0,n.escape)(this.name);return"true"===t||"false"===t?'<span class="math-symbol math-boolean">'+t+"</span>":"i"===t?'<span class="math-symbol math-imaginary-symbol">'+t+"</span>":"Infinity"===t?'<span class="math-symbol math-infinity-symbol">'+t+"</span>":"NaN"===t?'<span class="math-symbol math-nan-symbol">'+t+"</span>":"null"===t?'<span class="math-symbol math-null-symbol">'+t+"</span>":"undefined"===t?'<span class="math-symbol math-undefined-symbol">'+t+"</span>":'<span class="math-symbol">'+t+"</span>"},l.prototype.toJSON=function(){return{mathjs:"SymbolNode",name:this.name}},l.fromJSON=function(e){return new l(e.name)},l.prototype._toTex=function(e){var r=!1;void 0===t[this.name]&&s(this.name)&&(r=!0);var n=(0,o.toSymbol)(this.name,r);return"\\"===n[0]?n:" "+n},l}),{isClass:!0,isNode:!0});t.createSymbolNode=l},32870:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.accessFactory=function(e){var t=e.subset;return function(e,r){try{if(Array.isArray(e))return t(e,r);if(e&&"function"==typeof e.subset)return e.subset(r);if("string"==typeof e)return t(e,r);if("object"===(0,a.default)(e)){if(!r.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return(0,o.getSafeProperty)(e,r.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw(0,i.errorTransform)(e)}}};var a=n(r(80812)),i=r(2008),o=r(27807)},19424:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.assignFactory=function(e){var t=e.subset,r=e.matrix;return function(e,n,s){try{if(Array.isArray(e))return r(e).subset(n,s).valueOf();if(e&&"function"==typeof e.subset)return e.subset(n,s);if("string"==typeof e)return t(e,n,s);if("object"===(0,a.default)(e)){if(!n.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return(0,o.setSafeProperty)(e,n.getObjectProperty(),s),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw(0,i.errorTransform)(e)}}};var a=n(r(80812)),i=r(2008),o=r(27807)},17715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAssociativity=function(e,t){var r=e;"keep"!==t&&(r=e.getContent());var o=r.getIdentifier(),s=i(r,t);if(null===s)return null;var l=a[s][o];if((0,n.hasOwnProperty)(l,"associativity")){if("left"===l.associativity)return"left";if("right"===l.associativity)return"right";throw Error("'"+o+"' has the invalid associativity '"+l.associativity+"'.")}return null},t.getPrecedence=i,t.isAssociativeWith=function(e,t,r){var o="keep"!==r?e.getContent():e,s="keep"!==r?e.getContent():t,l=o.getIdentifier(),c=s.getIdentifier(),u=i(o,r);if(null===u)return null;var f=a[u][l];if((0,n.hasOwnProperty)(f,"associativeWith")&&f.associativeWith instanceof Array){for(var p=0;p<f.associativeWith.length;p++)if(f.associativeWith[p]===c)return!0;return!1}return null},t.properties=void 0;var n=r(54699),a=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{associativity:"left",associativeWith:[]}},{"OperatorNode:and":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{associativity:"left",associativeWith:[]},"OperatorNode:unequal":{associativity:"left",associativeWith:[]},"OperatorNode:smaller":{associativity:"left",associativeWith:[]},"OperatorNode:larger":{associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{associativity:"left",associativeWith:[]}},{"OperatorNode:to":{associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{associativity:"left",associativeWith:[]},"OperatorNode:mod":{associativity:"left",associativeWith:[]}},{"OperatorNode:unaryPlus":{associativity:"right"},"OperatorNode:unaryMinus":{associativity:"right"},"OperatorNode:bitNot":{associativity:"right"},"OperatorNode:not":{associativity:"right"}},{"OperatorNode:pow":{associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{associativity:"left"}},{"OperatorNode:transpose":{associativity:"left"}}];function i(e,t){var r=e;"keep"!==t&&(r=e.getContent());for(var n=r.getIdentifier(),i=0;i<a.length;i++)if(n in a[i])return i;return null}t.properties=a},84918:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createParse=void 0;var a=n(r(9917)),i=r(58450),o=r(57237),s=r(30401),l=r(54699),c="parse",u=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],f=(0,i.factory)(c,u,(function(e){var t=e.typed,r=e.numeric,n=e.config,i=e.AccessorNode,u=e.ArrayNode,f=e.AssignmentNode,p=e.BlockNode,h=e.ConditionalNode,d=e.ConstantNode,m=e.FunctionAssignmentNode,g=e.FunctionNode,y=e.IndexNode,v=e.ObjectNode,b=e.OperatorNode,x=e.ParenthesisNode,_=e.RangeNode,w=e.RelationalNode,k=e.SymbolNode,D=t(c,{string:function(e){return z(e,{})},"Array | Matrix":function(e){return T(e,{})},"string, Object":function(e,t){return z(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":T});function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=void 0!==t.nodes?t.nodes:{};return(0,s.deepMap)(e,(function(e){if("string"!=typeof e)throw new TypeError("String expected");return z(e,r)}))}var A={",":!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,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},S={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},M={true:!0,false:!1,null:null,undefined:void 0},E=["NaN","Infinity"];function C(e,t){return e.expression.substr(e.index,t)}function N(e){return C(e,1)}function O(e){e.index++}function I(e){return e.expression.charAt(e.index-1)}function P(e){return e.expression.charAt(e.index+1)}function R(e){for(e.tokenType=0,e.token="",e.comment="";D.isWhitespace(N(e),e.nestingLevel);)O(e);if("#"===N(e))for(;"\n"!==N(e)&&""!==N(e);)e.comment+=N(e),O(e);if(""!==N(e)){if("\n"===N(e)&&!e.nestingLevel)return e.tokenType=1,e.token=N(e),void O(e);var t=N(e),r=C(e,2),n=C(e,3);if(3===n.length&&A[n])return e.tokenType=1,e.token=n,O(e),O(e),void O(e);if(2===r.length&&A[r])return e.tokenType=1,e.token=r,O(e),void O(e);if(A[t])return e.tokenType=1,e.token=t,void O(e);if(D.isDigitDot(t)){e.tokenType=2;var a=C(e,2);if("0b"===a||"0o"===a||"0x"===a){for(e.token+=N(e),O(e),e.token+=N(e),O(e);D.isHexDigit(N(e));)e.token+=N(e),O(e);if("."===N(e))for(e.token+=".",O(e);D.isHexDigit(N(e));)e.token+=N(e),O(e);else if("i"===N(e))for(e.token+="i",O(e);D.isDigit(N(e));)e.token+=N(e),O(e);return}if("."===N(e)){if(e.token+=N(e),O(e),!D.isDigit(N(e)))return void(e.tokenType=1)}else{for(;D.isDigit(N(e));)e.token+=N(e),O(e);D.isDecimalMark(N(e),P(e))&&(e.token+=N(e),O(e))}for(;D.isDigit(N(e));)e.token+=N(e),O(e);if("E"===N(e)||"e"===N(e))if(D.isDigit(P(e))||"-"===P(e)||"+"===P(e)){if(e.token+=N(e),O(e),"+"!==N(e)&&"-"!==N(e)||(e.token+=N(e),O(e)),!D.isDigit(N(e)))throw se(e,'Digit expected, got "'+N(e)+'"');for(;D.isDigit(N(e));)e.token+=N(e),O(e);if(D.isDecimalMark(N(e),P(e)))throw se(e,'Digit expected, got "'+N(e)+'"')}else if("."===P(e))throw O(e),se(e,'Digit expected, got "'+N(e)+'"')}else{if(!D.isAlpha(N(e),I(e),P(e))){for(e.tokenType=4;""!==N(e);)e.token+=N(e),O(e);throw se(e,'Syntax error in part "'+e.token+'"')}for(;D.isAlpha(N(e),I(e),P(e))||D.isDigit(N(e));)e.token+=N(e),O(e);(0,l.hasOwnProperty)(S,e.token)?e.tokenType=1:e.tokenType=3}}else e.tokenType=1}function L(e){do{R(e)}while("\n"===e.token)}function F(e){e.nestingLevel++}function B(e){e.nestingLevel--}function z(e,t){var r={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:0,nestingLevel:0,conditionalLevel:null};(0,a.default)(r,{expression:e,extraNodes:t}),R(r);var n=function(e){var t,r,n=[];for(""!==e.token&&"\n"!==e.token&&";"!==e.token&&((t=j(e)).comment=e.comment);"\n"===e.token||";"===e.token;)0===n.length&&t&&(r=";"!==e.token,n.push({node:t,visible:r})),R(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&((t=j(e)).comment=e.comment,r=";"!==e.token,n.push({node:t,visible:r}));return n.length>0?new p(n):(t||((t=new d(void 0)).comment=e.comment),t)}(r);if(""!==r.token)throw 1===r.tokenType?le(r,"Unexpected operator "+r.token):se(r,'Unexpected part "'+r.token+'"');return n}function j(e){var t,r,n,a,i=function(e){for(var t=function(e){for(var t=U(e);"or"===e.token;)L(e),t=new b("or","or",[t,U(e)]);return t}(e);"?"===e.token;){var r=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,L(e);var n=t,a=j(e);if(":"!==e.token)throw se(e,"False part of conditional expression expected");e.conditionalLevel=null,L(e);var i=j(e);t=new h(n,a,i),e.conditionalLevel=r}return t}(e);if("="===e.token){if((0,o.isSymbolNode)(i))return t=i.name,L(e),n=j(e),new f(new k(t),n);if((0,o.isAccessorNode)(i))return L(e),n=j(e),new f(i.object,i.index,n);if((0,o.isFunctionNode)(i)&&(0,o.isSymbolNode)(i.fn)&&(a=!0,r=[],t=i.name,i.args.forEach((function(e,t){(0,o.isSymbolNode)(e)?r[t]=e.name:a=!1})),a))return L(e),n=j(e),new m(t,r,n);throw se(e,"Invalid left hand side of assignment operator =")}return i}function U(e){for(var t=$(e);"xor"===e.token;)L(e),t=new b("xor","xor",[t,$(e)]);return t}function $(e){for(var t=V(e);"and"===e.token;)L(e),t=new b("and","and",[t,V(e)]);return t}function V(e){for(var t=q(e);"|"===e.token;)L(e),t=new b("|","bitOr",[t,q(e)]);return t}function q(e){for(var t=W(e);"^|"===e.token;)L(e),t=new b("^|","bitXor",[t,W(e)]);return t}function W(e){for(var t=H(e);"&"===e.token;)L(e),t=new b("&","bitAnd",[t,H(e)]);return t}function H(e){for(var t=[G(e)],r=[],n={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};(0,l.hasOwnProperty)(n,e.token);){var a={name:e.token,fn:n[e.token]};r.push(a),L(e),t.push(G(e))}return 1===t.length?t[0]:2===t.length?new b(r[0].name,r[0].fn,t):new w(r.map((function(e){return e.fn})),t)}function G(e){var t,r,n,a;t=X(e);for(var i={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};(0,l.hasOwnProperty)(i,e.token);)n=i[r=e.token],L(e),a=[t,X(e)],t=new b(r,n,a);return t}function X(e){var t,r,n,a;t=Y(e);for(var i={to:"to",in:"to"};(0,l.hasOwnProperty)(i,e.token);)n=i[r=e.token],L(e),"in"===r&&""===e.token?t=new b("*","multiply",[t,new k("in")],!0):(a=[t,Y(e)],t=new b(r,n,a));return t}function Y(e){var t,r=[];if(t=":"===e.token?new d(1):Z(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(r.push(t);":"===e.token&&r.length<3;)L(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?r.push(new k("end")):r.push(Z(e));t=3===r.length?new _(r[0],r[2],r[1]):new _(r[0],r[1])}return t}function Z(e){var t,r,n,a;t=K(e);for(var i={"+":"add","-":"subtract"};(0,l.hasOwnProperty)(i,e.token);){n=i[r=e.token],L(e);var o=K(e);a=o.isPercentage?[t,new b("*","multiply",[t,o])]:[t,o],t=new b(r,n,a)}return t}function K(e){var t,r,n,a;r=t=J(e);for(var i={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};(0,l.hasOwnProperty)(i,e.token);)a=i[n=e.token],L(e),r=J(e),t=new b(n,a,[t,r]);return t}function J(e){var t,r;for(r=t=Q(e);3===e.tokenType||"in"===e.token&&(0,o.isConstantNode)(t)||!(2!==e.tokenType||(0,o.isConstantNode)(r)||(0,o.isOperatorNode)(r)&&"!"!==r.op)||"("===e.token;)r=Q(e),t=new b("*","multiply",[t,r],!0);return t}function Q(e){for(var t=ee(e),r=t,n=[];"/"===e.token&&(0,o.isConstantNode)(r);){if(n.push((0,a.default)({},e)),L(e),2!==e.tokenType){(0,a.default)(e,n.pop());break}if(n.push((0,a.default)({},e)),L(e),3!==e.tokenType&&"("!==e.token){n.pop(),(0,a.default)(e,n.pop());break}(0,a.default)(e,n.pop()),n.pop(),r=ee(e),t=new b("/","divide",[t,r])}return t}function ee(e){var t,r,n,a;t=te(e);for(var i={"%":"mod",mod:"mod"};(0,l.hasOwnProperty)(i,e.token);)n=i[r=e.token],L(e),"%"===r&&1===e.tokenType&&"("!==e.token?t=new b("/","divide",[t,new d(100)],!1,!0):(a=[t,te(e)],t=new b(r,n,a));return t}function te(e){var t,a,i,o={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return(0,l.hasOwnProperty)(o,e.token)?(i=o[e.token],t=e.token,L(e),a=[te(e)],new b(t,i,a)):function(e){var t,a,i,o;return t=function(e){var t,a,i;t=function(e){var t=[];if(3===e.tokenType&&(0,l.hasOwnProperty)(e.extraNodes,e.token)){var a=e.extraNodes[e.token];if(R(e),"("===e.token){if(t=[],F(e),R(e),")"!==e.token)for(t.push(j(e));","===e.token;)R(e),t.push(j(e));if(")"!==e.token)throw se(e,"Parenthesis ) expected");B(e),R(e)}return new a(t)}return function(e){var t;return 3===e.tokenType||1===e.tokenType&&e.token in S?(t=e.token,R(e),re(e,(0,l.hasOwnProperty)(M,t)?new d(M[t]):-1!==E.indexOf(t)?new d(r(t,"number")):new k(t))):function(e){var t;return'"'===e.token?(t=ne(e),re(e,new d(t))):function(e){var t;return"'"===e.token?(t=ae(e),re(e,new d(t))):function(e){var t,a,i,o;if("["===e.token){if(F(e),R(e),"]"!==e.token){var s=ie(e);if(";"===e.token){for(i=1,a=[s];";"===e.token;)R(e),a[i]=ie(e),i++;if("]"!==e.token)throw se(e,"End of matrix ] expected");B(e),R(e),o=a[0].items.length;for(var l=1;l<i;l++)if(a[l].items.length!==o)throw le(e,"Column dimensions mismatch ("+a[l].items.length+" !== "+o+")");t=new u(a)}else{if("]"!==e.token)throw se(e,"End of matrix ] expected");B(e),R(e),t=s}}else B(e),R(e),t=new u([]);return re(e,t)}return function(e){if("{"===e.token){var t;F(e);var a={};do{if(R(e),"}"!==e.token){if('"'===e.token)t=ne(e);else if("'"===e.token)t=ae(e);else{if(!(3===e.tokenType||1===e.tokenType&&e.token in S))throw se(e,"Symbol or string expected as object key");t=e.token,R(e)}if(":"!==e.token)throw se(e,"Colon : expected after object key");R(e),a[t]=j(e)}}while(","===e.token);if("}"!==e.token)throw se(e,"Comma , or bracket } expected after object value");B(e),R(e);var i=new v(a);return re(e,i)}return function(e){var t;return 2===e.tokenType?(t=e.token,R(e),new d(r(t,n.number))):function(e){var t;if("("===e.token){if(F(e),R(e),t=j(e),")"!==e.token)throw se(e,"Parenthesis ) expected");return B(e),R(e),re(e,t=new x(t))}return function(e){throw""===e.token?se(e,"Unexpected end of expression"):se(e,"Value expected")}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(e);for(var o={"!":"factorial","'":"ctranspose"};(0,l.hasOwnProperty)(o,e.token);)i=o[a=e.token],R(e),t=re(e,t=new b(a,i,[t]));return t}(e),("^"===e.token||".^"===e.token)&&(i="^"===(a=e.token)?"pow":"dotPow",L(e),o=[t,te(e)],t=new b(a,i,o)),t}(e)}function re(e,t,r){for(var n;!("("!==e.token&&"["!==e.token&&"."!==e.token||r&&-1===r.indexOf(e.token));)if(n=[],"("===e.token){if(!(0,o.isSymbolNode)(t)&&!(0,o.isAccessorNode)(t))return t;if(F(e),R(e),")"!==e.token)for(n.push(j(e));","===e.token;)R(e),n.push(j(e));if(")"!==e.token)throw se(e,"Parenthesis ) expected");B(e),R(e),t=new g(t,n)}else if("["===e.token){if(F(e),R(e),"]"!==e.token)for(n.push(j(e));","===e.token;)R(e),n.push(j(e));if("]"!==e.token)throw se(e,"Parenthesis ] expected");B(e),R(e),t=new i(t,new y(n))}else{if(R(e),3!==e.tokenType)throw se(e,"Property name expected after dot");n.push(new d(e.token)),R(e),t=new i(t,new y(n,!0))}return t}function ne(e){for(var t="";""!==N(e)&&'"'!==N(e);)"\\"===N(e)&&(t+=N(e),O(e)),t+=N(e),O(e);if(R(e),'"'!==e.token)throw se(e,'End of string " expected');return R(e),JSON.parse('"'+t+'"')}function ae(e){for(var t="";""!==N(e)&&"'"!==N(e);)"\\"===N(e)&&(t+=N(e),O(e)),t+=N(e),O(e);if(R(e),"'"!==e.token)throw se(e,"End of string ' expected");return R(e),JSON.parse('"'+t+'"')}function ie(e){for(var t=[j(e)],r=1;","===e.token;)R(e),t[r]=j(e),r++;return new u(t)}function oe(e){return e.index-e.token.length+1}function se(e,t){var r=oe(e),n=new SyntaxError(t+" (char "+r+")");return n.char=r,n}function le(e,t){var r=oe(e),n=new SyntaxError(t+" (char "+r+")");return n.char=r,n}return D.isAlpha=function(e,t,r){return D.isValidLatinOrGreek(e)||D.isValidMathSymbol(e,r)||D.isValidMathSymbol(t,e)},D.isValidLatinOrGreek=function(e){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(e)},D.isValidMathSymbol=function(e,t){return/^[\uD835]$/.test(e)&&/^[\uDC00-\uDFFF]$/.test(t)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(t)},D.isWhitespace=function(e,t){return" "===e||"\t"===e||"\n"===e&&t>0},D.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},D.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},D.isDigit=function(e){return e>="0"&&e<="9"},D.isHexDigit=function(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"},D}));t.createParse=f},96270:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createApplyTransform=void 0;var n=r(2008),a=r(58450),i=r(91794),o=r(57237),s=["typed","isInteger"],l=(0,a.factory)("apply",s,(function(e){var t=e.typed,r=e.isInteger,a=(0,i.createApply)({typed:t,isInteger:r});return t("apply",{"...any":function(e){var t=e[1];(0,o.isNumber)(t)?e[1]=t-1:(0,o.isBigNumber)(t)&&(e[1]=t.minus(1));try{return a.apply(null,e)}catch(e){throw(0,n.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createApplyTransform=l},21863:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createColumnTransform=void 0;var n=r(2008),a=r(58450),i=r(25120),o=r(57237),s=["typed","Index","matrix","range"],l=(0,a.factory)("column",s,(function(e){var t=e.typed,r=e.Index,a=e.matrix,s=e.range,l=(0,i.createColumn)({typed:t,Index:r,matrix:a,range:s});return t("column",{"...any":function(e){var t=e.length-1,r=e[t];(0,o.isNumber)(r)&&(e[t]=r-1);try{return l.apply(null,e)}catch(e){throw(0,n.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createColumnTransform=l},21712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConcatTransform=void 0;var n=r(57237),a=r(2008),i=r(58450),o=r(46545),s=["typed","matrix","isInteger"],l=(0,i.factory)("concat",s,(function(e){var t=e.typed,r=e.matrix,i=e.isInteger,s=(0,o.createConcat)({typed:t,matrix:r,isInteger:i});return t("concat",{"...any":function(e){var t=e.length-1,r=e[t];(0,n.isNumber)(r)?e[t]=r-1:(0,n.isBigNumber)(r)&&(e[t]=r.minus(1));try{return s.apply(null,e)}catch(e){throw(0,a.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createConcatTransform=l},93489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDiffTransform=void 0;var n=r(58450),a=r(2008),i=r(27598),o=r(22186),s="diff",l=["typed","matrix","subtract","number","bignumber"],c=(0,n.factory)(s,l,(function(e){var t=e.typed,r=e.matrix,n=e.subtract,l=e.number,c=e.bignumber,u=(0,i.createDiff)({typed:t,matrix:r,subtract:n,number:l,bignumber:c});return t(s,{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return u.apply(null,e)}catch(e){throw(0,a.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createDiffTransform=c},92536:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFilterTransform=void 0;var n=r(57237),a=r(70517),i=r(46054),o=r(22560),s=["typed"],l=(0,r(58450).factory)("filter",s,(function(e){var t=e.typed;function r(e,t,r){var a,s;return e[0]&&(a=e[0].compile().evaluate(r)),e[1]&&(s=(0,n.isSymbolNode)(e[1])||(0,n.isFunctionAssignmentNode)(e[1])?e[1].compile().evaluate(r):(0,o.compileInlineExpression)(e[1],t,r)),i(a,s)}r.rawArgs=!0;var i=t("filter",{"Array, function":c,"Matrix, function":function(e,t){return e.create(c(e.toArray(),t))},"Array, RegExp":a.filterRegExp,"Matrix, RegExp":function(e,t){return e.create((0,a.filterRegExp)(e.toArray(),t))}});return r}),{isTransformFunction:!0});function c(e,t){var r=(0,i.maxArgumentCount)(t);return(0,a.filter)(e,(function(e,n,a){return 1===r?t(e):2===r?t(e,[n+1]):t(e,[n+1],a)}))}t.createFilterTransform=l},36177:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createForEachTransform=void 0;var n=r(57237),a=r(46054),i=r(70517),o=r(58450),s=r(22560),l=["typed"],c=(0,o.factory)("forEach",l,(function(e){var t=e.typed;function r(e,t,r){var a,i;return e[0]&&(a=e[0].compile().evaluate(r)),e[1]&&(i=(0,n.isSymbolNode)(e[1])||(0,n.isFunctionAssignmentNode)(e[1])?e[1].compile().evaluate(r):(0,s.compileInlineExpression)(e[1],t,r)),o(a,i)}r.rawArgs=!0;var o=t("forEach",{"Array | Matrix, function":function(e,t){var r=(0,a.maxArgumentCount)(t);!function n(a,o){Array.isArray(a)?(0,i.forEach)(a,(function(e,t){n(e,o.concat(t+1))})):1===r?t(a):2===r?t(a,o):t(a,o,e)}(e.valueOf(),[])}});return r}),{isTransformFunction:!0});t.createForEachTransform=c},99702:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIndexTransform=void 0;var n=r(57237),a=["Index"],i=(0,r(58450).factory)("index",a,(function(e){var t=e.Index;return function(){for(var e=[],r=0,a=arguments.length;r<a;r++){var i=arguments[r];if((0,n.isRange)(i))i.start--,i.end-=i.step>0?0:2;else if(i&&!0===i.isSet)i=i.map((function(e){return e-1}));else if((0,n.isArray)(i)||(0,n.isMatrix)(i))i=i.map((function(e){return e-1}));else if((0,n.isNumber)(i))i--;else if((0,n.isBigNumber)(i))i=i.toNumber()-1;else if("string"!=typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[r]=i}var o=new t;return t.apply(o,e),o}}),{isTransformFunction:!0});t.createIndexTransform=i},56381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMapTransform=void 0;var n=r(57237),a=r(46054),i=r(70517),o=r(58450),s=r(22560),l=["typed"],c=(0,o.factory)("map",l,(function(e){var t=e.typed;function r(e,t,r){var i,o;return e[0]&&(i=e[0].compile().evaluate(r)),e[1]&&(o=(0,n.isSymbolNode)(e[1])||(0,n.isFunctionAssignmentNode)(e[1])?e[1].compile().evaluate(r):(0,s.compileInlineExpression)(e[1],t,r)),a(i,o)}r.rawArgs=!0;var a=t("map",{"Array, function":function(e,t){return u(e,t,e)},"Matrix, function":function(e,t){return e.create(u(e.valueOf(),t,e))}});return r}),{isTransformFunction:!0});function u(e,t,r){var n=(0,a.maxArgumentCount)(t);return function e(a,o){return Array.isArray(a)?(0,i.map)(a,(function(t,r){return e(t,o.concat(r+1))})):1===n?t(a):2===n?t(a,o):t(a,o,r)}(e,[])}t.createMapTransform=c},68350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMaxTransform=void 0;var n=r(58450),a=r(2008),i=r(37223),o=r(22186),s=["typed","config","numeric","larger"],l=(0,n.factory)("max",s,(function(e){var t=e.typed,r=e.config,n=e.numeric,s=e.larger,l=(0,i.createMax)({typed:t,config:r,numeric:n,larger:s});return t("max",{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return l.apply(null,e)}catch(e){throw(0,a.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createMaxTransform=l},21050:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMeanTransform=void 0;var n=r(58450),a=r(2008),i=r(74250),o=r(22186),s=["typed","add","divide"],l=(0,n.factory)("mean",s,(function(e){var t=e.typed,r=e.add,n=e.divide,s=(0,i.createMean)({typed:t,add:r,divide:n});return t("mean",{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return s.apply(null,e)}catch(e){throw(0,a.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createMeanTransform=l},70638:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMinTransform=void 0;var n=r(58450),a=r(2008),i=r(38252),o=r(22186),s=["typed","config","numeric","smaller"],l=(0,n.factory)("min",s,(function(e){var t=e.typed,r=e.config,n=e.numeric,s=e.smaller,l=(0,i.createMin)({typed:t,config:r,numeric:n,smaller:s});return t("min",{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return l.apply(null,e)}catch(e){throw(0,a.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createMinTransform=l},70547:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRangeTransform=void 0;var n=r(58450),a=r(5941),i=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq"],o=(0,n.factory)("range",i,(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.bignumber,o=e.smaller,s=e.smallerEq,l=e.larger,c=e.largerEq,u=(0,a.createRange)({typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:s,larger:l,largerEq:c});return t("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),u.apply(null,e)}})}),{isTransformFunction:!0});t.createRangeTransform=o},12208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRowTransform=void 0;var n=r(58450),a=r(92124),i=r(2008),o=r(57237),s=["typed","Index","matrix","range"],l=(0,n.factory)("row",s,(function(e){var t=e.typed,r=e.Index,n=e.matrix,s=e.range,l=(0,a.createRow)({typed:t,Index:r,matrix:n,range:s});return t("row",{"...any":function(e){var t=e.length-1,r=e[t];(0,o.isNumber)(r)&&(e[t]=r-1);try{return l.apply(null,e)}catch(e){throw(0,i.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createRowTransform=l},14907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createStdTransform=void 0;var n=r(58450),a=r(27512),i=r(2008),o=r(22186),s=["typed","sqrt","variance"],l=(0,n.factory)("std",s,(function(e){var t=e.typed,r=e.sqrt,n=e.variance,s=(0,a.createStd)({typed:t,sqrt:r,variance:n});return t("std",{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return s.apply(null,e)}catch(e){throw(0,i.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createStdTransform=l},39576:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSubsetTransform=void 0;var n=r(58450),a=r(2008),i=r(63451),o=["typed","matrix"],s=(0,n.factory)("subset",o,(function(e){var t=e.typed,r=e.matrix,n=(0,i.createSubset)({typed:t,matrix:r});return t("subset",{"...any":function(e){try{return n.apply(null,e)}catch(e){throw(0,a.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createSubsetTransform=s},56063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSumTransform=void 0;var n=r(58450),a=r(2008),i=r(16299),o=r(22186),s=["typed","config","add","numeric"],l=(0,n.factory)("sum",s,(function(e){var t=e.typed,r=e.config,n=e.add,s=e.numeric,l=(0,i.createSum)({typed:t,config:r,add:n,numeric:s});return t("sum",{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return l.apply(null,e)}catch(e){throw(0,a.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createSumTransform=l},22560:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileInlineExpression=function(e,t,r){var i=e.filter((function(e){return(0,n.isSymbolNode)(e)&&!(e.name in t)&&!r.has(e.name)}))[0];if(!i)throw new Error('No undefined variable found in inline expression "'+e+'"');var o=i.name,s=(0,a.createSubScope)(r),l=e.compile();return function(e){return s.set(o,e),l.evaluate(s)}};var n=r(57237),a=r(67797)},2008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorTransform=function(e){return e&&e.isIndexError?new n.IndexError(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e};var n=r(14452)},22186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastDimToZeroBase=function(e){if(2===e.length&&(0,n.isCollection)(e[0])){var t=(e=e.slice())[1];(0,n.isNumber)(t)?e[1]=t-1:(0,n.isBigNumber)(t)&&(e[1]=t.minus(1))}return e};var n=r(57237)},79191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createVarianceTransform=void 0;var n=r(58450),a=r(2008),i=r(99026),o=r(22186),s="variance",l=["typed","add","subtract","multiply","divide","apply","isNaN"],c=(0,n.factory)(s,l,(function(e){var t=e.typed,r=e.add,n=e.subtract,l=e.multiply,c=e.divide,u=e.apply,f=e.isNaN,p=(0,i.createVariance)({typed:t,add:r,subtract:n,multiply:l,divide:c,apply:u,isNaN:f});return t(s,{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return p.apply(null,e)}catch(e){throw(0,a.errorTransform)(e)}}})}),{isTransformFunction:!0});t.createVarianceTransform=c},59884:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createAbs",{enumerable:!0,get:function(){return R.createAbs}}),Object.defineProperty(t,"createAccessorNode",{enumerable:!0,get:function(){return Ar.createAccessorNode}}),Object.defineProperty(t,"createAcos",{enumerable:!0,get:function(){return Bt.createAcos}}),Object.defineProperty(t,"createAcosh",{enumerable:!0,get:function(){return zt.createAcosh}}),Object.defineProperty(t,"createAcot",{enumerable:!0,get:function(){return jt.createAcot}}),Object.defineProperty(t,"createAcoth",{enumerable:!0,get:function(){return Ut.createAcoth}}),Object.defineProperty(t,"createAcsc",{enumerable:!0,get:function(){return $t.createAcsc}}),Object.defineProperty(t,"createAcsch",{enumerable:!0,get:function(){return Vt.createAcsch}}),Object.defineProperty(t,"createAdd",{enumerable:!0,get:function(){return br.createAdd}}),Object.defineProperty(t,"createAddScalar",{enumerable:!0,get:function(){return F.createAddScalar}}),Object.defineProperty(t,"createAnd",{enumerable:!0,get:function(){return dt.createAnd}}),Object.defineProperty(t,"createApply",{enumerable:!0,get:function(){return L.createApply}}),Object.defineProperty(t,"createApplyTransform",{enumerable:!0,get:function(){return Fn.createApplyTransform}}),Object.defineProperty(t,"createArg",{enumerable:!0,get:function(){return ce.createArg}}),Object.defineProperty(t,"createArrayNode",{enumerable:!0,get:function(){return Sr.createArrayNode}}),Object.defineProperty(t,"createAsec",{enumerable:!0,get:function(){return qt.createAsec}}),Object.defineProperty(t,"createAsech",{enumerable:!0,get:function(){return Wt.createAsech}}),Object.defineProperty(t,"createAsin",{enumerable:!0,get:function(){return Ht.createAsin}}),Object.defineProperty(t,"createAsinh",{enumerable:!0,get:function(){return Gt.createAsinh}}),Object.defineProperty(t,"createAssignmentNode",{enumerable:!0,get:function(){return Mr.createAssignmentNode}}),Object.defineProperty(t,"createAtan",{enumerable:!0,get:function(){return Xt.createAtan}}),Object.defineProperty(t,"createAtan2",{enumerable:!0,get:function(){return Yt.createAtan2}}),Object.defineProperty(t,"createAtanh",{enumerable:!0,get:function(){return Zt.createAtanh}}),Object.defineProperty(t,"createAtomicMass",{enumerable:!0,get:function(){return Ln.createAtomicMass}}),Object.defineProperty(t,"createAvogadro",{enumerable:!0,get:function(){return Ln.createAvogadro}}),Object.defineProperty(t,"createBellNumbers",{enumerable:!0,get:function(){return Sn.createBellNumbers}}),Object.defineProperty(t,"createBigNumberClass",{enumerable:!0,get:function(){return i.createBigNumberClass}}),Object.defineProperty(t,"createBignumber",{enumerable:!0,get:function(){return T.createBignumber}}),Object.defineProperty(t,"createBin",{enumerable:!0,get:function(){return He.createBin}}),Object.defineProperty(t,"createBitAnd",{enumerable:!0,get:function(){return ie.createBitAnd}}),Object.defineProperty(t,"createBitNot",{enumerable:!0,get:function(){return oe.createBitNot}}),Object.defineProperty(t,"createBitOr",{enumerable:!0,get:function(){return se.createBitOr}}),Object.defineProperty(t,"createBitXor",{enumerable:!0,get:function(){return le.createBitXor}}),Object.defineProperty(t,"createBlockNode",{enumerable:!0,get:function(){return Er.createBlockNode}}),Object.defineProperty(t,"createBohrMagneton",{enumerable:!0,get:function(){return Ln.createBohrMagneton}}),Object.defineProperty(t,"createBohrRadius",{enumerable:!0,get:function(){return Ln.createBohrRadius}}),Object.defineProperty(t,"createBoltzmann",{enumerable:!0,get:function(){return Ln.createBoltzmann}}),Object.defineProperty(t,"createBoolean",{enumerable:!0,get:function(){return D.createBoolean}}),Object.defineProperty(t,"createCatalan",{enumerable:!0,get:function(){return Mn.createCatalan}}),Object.defineProperty(t,"createCbrt",{enumerable:!0,get:function(){return B.createCbrt}}),Object.defineProperty(t,"createCeil",{enumerable:!0,get:function(){return z.createCeil}}),Object.defineProperty(t,"createChain",{enumerable:!0,get:function(){return Qr.createChain}}),Object.defineProperty(t,"createChainClass",{enumerable:!0,get:function(){return Kr.createChainClass}}),Object.defineProperty(t,"createClassicalElectronRadius",{enumerable:!0,get:function(){return Ln.createClassicalElectronRadius}}),Object.defineProperty(t,"createClone",{enumerable:!0,get:function(){return f.createClone}}),Object.defineProperty(t,"createColumn",{enumerable:!0,get:function(){return ye.createColumn}}),Object.defineProperty(t,"createColumnTransform",{enumerable:!0,get:function(){return Bn.createColumnTransform}}),Object.defineProperty(t,"createCombinations",{enumerable:!0,get:function(){return gn.createCombinations}}),Object.defineProperty(t,"createCombinationsWithRep",{enumerable:!0,get:function(){return yn.createCombinationsWithRep}}),Object.defineProperty(t,"createCompare",{enumerable:!0,get:function(){return mt.createCompare}}),Object.defineProperty(t,"createCompareNatural",{enumerable:!0,get:function(){return gt.createCompareNatural}}),Object.defineProperty(t,"createCompareText",{enumerable:!0,get:function(){return yt.createCompareText}}),Object.defineProperty(t,"createCompile",{enumerable:!0,get:function(){return $r.createCompile}}),Object.defineProperty(t,"createComplex",{enumerable:!0,get:function(){return A.createComplex}}),Object.defineProperty(t,"createComplexClass",{enumerable:!0,get:function(){return o.createComplexClass}}),Object.defineProperty(t,"createComposition",{enumerable:!0,get:function(){return En.createComposition}}),Object.defineProperty(t,"createConcat",{enumerable:!0,get:function(){return ge.createConcat}}),Object.defineProperty(t,"createConcatTransform",{enumerable:!0,get:function(){return Yn.createConcatTransform}}),Object.defineProperty(t,"createConditionalNode",{enumerable:!0,get:function(){return Cr.createConditionalNode}}),Object.defineProperty(t,"createConductanceQuantum",{enumerable:!0,get:function(){return Ln.createConductanceQuantum}}),Object.defineProperty(t,"createConj",{enumerable:!0,get:function(){return ue.createConj}}),Object.defineProperty(t,"createConstantNode",{enumerable:!0,get:function(){return Nr.createConstantNode}}),Object.defineProperty(t,"createCos",{enumerable:!0,get:function(){return Kt.createCos}}),Object.defineProperty(t,"createCosh",{enumerable:!0,get:function(){return Jt.createCosh}}),Object.defineProperty(t,"createCot",{enumerable:!0,get:function(){return Qt.createCot}}),Object.defineProperty(t,"createCoth",{enumerable:!0,get:function(){return er.createCoth}}),Object.defineProperty(t,"createCoulomb",{enumerable:!0,get:function(){return Ln.createCoulomb}}),Object.defineProperty(t,"createCount",{enumerable:!0,get:function(){return ve.createCount}}),Object.defineProperty(t,"createCreateUnit",{enumerable:!0,get:function(){return Ft.createCreateUnit}}),Object.defineProperty(t,"createCross",{enumerable:!0,get:function(){return be.createCross}}),Object.defineProperty(t,"createCsc",{enumerable:!0,get:function(){return tr.createCsc}}),Object.defineProperty(t,"createCsch",{enumerable:!0,get:function(){return rr.createCsch}}),Object.defineProperty(t,"createCtranspose",{enumerable:!0,get:function(){return je.createCtranspose}}),Object.defineProperty(t,"createCube",{enumerable:!0,get:function(){return j.createCube}}),Object.defineProperty(t,"createDeepEqual",{enumerable:!0,get:function(){return Dt.createDeepEqual}}),Object.defineProperty(t,"createDenseMatrixClass",{enumerable:!0,get:function(){return u.createDenseMatrixClass}}),Object.defineProperty(t,"createDerivative",{enumerable:!0,get:function(){return Nn.createDerivative}}),Object.defineProperty(t,"createDet",{enumerable:!0,get:function(){return en.createDet}}),Object.defineProperty(t,"createDeuteronMass",{enumerable:!0,get:function(){return Ln.createDeuteronMass}}),Object.defineProperty(t,"createDiag",{enumerable:!0,get:function(){return xe.createDiag}}),Object.defineProperty(t,"createDiff",{enumerable:!0,get:function(){return Me.createDiff}}),Object.defineProperty(t,"createDiffTransform",{enumerable:!0,get:function(){return Zn.createDiffTransform}}),Object.defineProperty(t,"createDistance",{enumerable:!0,get:function(){return sn.createDistance}}),Object.defineProperty(t,"createDivide",{enumerable:!0,get:function(){return on.createDivide}}),Object.defineProperty(t,"createDivideScalar",{enumerable:!0,get:function(){return Qe.createDivideScalar}}),Object.defineProperty(t,"createDot",{enumerable:!0,get:function(){return wr.createDot}}),Object.defineProperty(t,"createDotDivide",{enumerable:!0,get:function(){return ot.createDotDivide}}),Object.defineProperty(t,"createDotMultiply",{enumerable:!0,get:function(){return ae.createDotMultiply}}),Object.defineProperty(t,"createDotPow",{enumerable:!0,get:function(){return it.createDotPow}}),Object.defineProperty(t,"createE",{enumerable:!0,get:function(){return Rn.createE}}),Object.defineProperty(t,"createEfimovFactor",{enumerable:!0,get:function(){return Ln.createEfimovFactor}}),Object.defineProperty(t,"createEigs",{enumerable:!0,get:function(){return rn.createEigs}}),Object.defineProperty(t,"createElectricConstant",{enumerable:!0,get:function(){return Ln.createElectricConstant}}),Object.defineProperty(t,"createElectronMass",{enumerable:!0,get:function(){return Ln.createElectronMass}}),Object.defineProperty(t,"createElementaryCharge",{enumerable:!0,get:function(){return Ln.createElementaryCharge}}),Object.defineProperty(t,"createEqual",{enumerable:!0,get:function(){return vt.createEqual}}),Object.defineProperty(t,"createEqualScalar",{enumerable:!0,get:function(){return x.createEqualScalar}}),Object.defineProperty(t,"createEqualText",{enumerable:!0,get:function(){return bt.createEqualText}}),Object.defineProperty(t,"createErf",{enumerable:!0,get:function(){return $e.createErf}}),Object.defineProperty(t,"createEvaluate",{enumerable:!0,get:function(){return Vr.createEvaluate}}),Object.defineProperty(t,"createExp",{enumerable:!0,get:function(){return U.createExp}}),Object.defineProperty(t,"createExpm",{enumerable:!0,get:function(){return nn.createExpm}}),Object.defineProperty(t,"createExpm1",{enumerable:!0,get:function(){return $.createExpm1}}),Object.defineProperty(t,"createFactorial",{enumerable:!0,get:function(){return bn.createFactorial}}),Object.defineProperty(t,"createFalse",{enumerable:!0,get:function(){return Rn.createFalse}}),Object.defineProperty(t,"createFaraday",{enumerable:!0,get:function(){return Ln.createFaraday}}),Object.defineProperty(t,"createFermiCoupling",{enumerable:!0,get:function(){return Ln.createFermiCoupling}}),Object.defineProperty(t,"createFibonacciHeapClass",{enumerable:!0,get:function(){return Ot.createFibonacciHeapClass}}),Object.defineProperty(t,"createFilter",{enumerable:!0,get:function(){return _e.createFilter}}),Object.defineProperty(t,"createFilterTransform",{enumerable:!0,get:function(){return zn.createFilterTransform}}),Object.defineProperty(t,"createFineStructure",{enumerable:!0,get:function(){return Ln.createFineStructure}}),Object.defineProperty(t,"createFirstRadiation",{enumerable:!0,get:function(){return Ln.createFirstRadiation}}),Object.defineProperty(t,"createFix",{enumerable:!0,get:function(){return V.createFix}}),Object.defineProperty(t,"createFlatten",{enumerable:!0,get:function(){return we.createFlatten}}),Object.defineProperty(t,"createFloor",{enumerable:!0,get:function(){return q.createFloor}}),Object.defineProperty(t,"createForEach",{enumerable:!0,get:function(){return ke.createForEach}}),Object.defineProperty(t,"createForEachTransform",{enumerable:!0,get:function(){return jn.createForEachTransform}}),Object.defineProperty(t,"createFormat",{enumerable:!0,get:function(){return We.createFormat}}),Object.defineProperty(t,"createFraction",{enumerable:!0,get:function(){return S.createFraction}}),Object.defineProperty(t,"createFractionClass",{enumerable:!0,get:function(){return s.createFractionClass}}),Object.defineProperty(t,"createFunctionAssignmentNode",{enumerable:!0,get:function(){return Or.createFunctionAssignmentNode}}),Object.defineProperty(t,"createFunctionNode",{enumerable:!0,get:function(){return jr.createFunctionNode}}),Object.defineProperty(t,"createGamma",{enumerable:!0,get:function(){return vn.createGamma}}),Object.defineProperty(t,"createGasConstant",{enumerable:!0,get:function(){return Ln.createGasConstant}}),Object.defineProperty(t,"createGcd",{enumerable:!0,get:function(){return W.createGcd}}),Object.defineProperty(t,"createGetMatrixDataType",{enumerable:!0,get:function(){return De.createGetMatrixDataType}}),Object.defineProperty(t,"createGravitationConstant",{enumerable:!0,get:function(){return Ln.createGravitationConstant}}),Object.defineProperty(t,"createGravity",{enumerable:!0,get:function(){return Ln.createGravity}}),Object.defineProperty(t,"createHartreeEnergy",{enumerable:!0,get:function(){return Ln.createHartreeEnergy}}),Object.defineProperty(t,"createHasNumericValue",{enumerable:!0,get:function(){return m.createHasNumericValue}}),Object.defineProperty(t,"createHelp",{enumerable:!0,get:function(){return Jr.createHelp}}),Object.defineProperty(t,"createHelpClass",{enumerable:!0,get:function(){return Zr.createHelpClass}}),Object.defineProperty(t,"createHex",{enumerable:!0,get:function(){return Xe.createHex}}),Object.defineProperty(t,"createHypot",{enumerable:!0,get:function(){return xr.createHypot}}),Object.defineProperty(t,"createI",{enumerable:!0,get:function(){return Rn.createI}}),Object.defineProperty(t,"createIdentity",{enumerable:!0,get:function(){return Te.createIdentity}}),Object.defineProperty(t,"createIm",{enumerable:!0,get:function(){return fe.createIm}}),Object.defineProperty(t,"createImmutableDenseMatrixClass",{enumerable:!0,get:function(){return Ct.createImmutableDenseMatrixClass}}),Object.defineProperty(t,"createIndex",{enumerable:!0,get:function(){return Dr.createIndex}}),Object.defineProperty(t,"createIndexClass",{enumerable:!0,get:function(){return Nt.createIndexClass}}),Object.defineProperty(t,"createIndexNode",{enumerable:!0,get:function(){return Ir.createIndexNode}}),Object.defineProperty(t,"createIndexTransform",{enumerable:!0,get:function(){return Un.createIndexTransform}}),Object.defineProperty(t,"createInfinity",{enumerable:!0,get:function(){return Rn.createInfinity}}),Object.defineProperty(t,"createIntersect",{enumerable:!0,get:function(){return ln.createIntersect}}),Object.defineProperty(t,"createInv",{enumerable:!0,get:function(){return tn.createInv}}),Object.defineProperty(t,"createInverseConductanceQuantum",{enumerable:!0,get:function(){return Ln.createInverseConductanceQuantum}}),Object.defineProperty(t,"createIsInteger",{enumerable:!0,get:function(){return p.createIsInteger}}),Object.defineProperty(t,"createIsNaN",{enumerable:!0,get:function(){return v.createIsNaN}}),Object.defineProperty(t,"createIsNegative",{enumerable:!0,get:function(){return h.createIsNegative}}),Object.defineProperty(t,"createIsNumeric",{enumerable:!0,get:function(){return d.createIsNumeric}}),Object.defineProperty(t,"createIsPositive",{enumerable:!0,get:function(){return g.createIsPositive}}),Object.defineProperty(t,"createIsPrime",{enumerable:!0,get:function(){return Ke.createIsPrime}}),Object.defineProperty(t,"createIsZero",{enumerable:!0,get:function(){return y.createIsZero}}),Object.defineProperty(t,"createKldivergence",{enumerable:!0,get:function(){return xn.createKldivergence}}),Object.defineProperty(t,"createKlitzing",{enumerable:!0,get:function(){return Ln.createKlitzing}}),Object.defineProperty(t,"createKron",{enumerable:!0,get:function(){return Ae.createKron}}),Object.defineProperty(t,"createLN10",{enumerable:!0,get:function(){return Rn.createLN10}}),Object.defineProperty(t,"createLN2",{enumerable:!0,get:function(){return Rn.createLN2}}),Object.defineProperty(t,"createLOG10E",{enumerable:!0,get:function(){return Rn.createLOG10E}}),Object.defineProperty(t,"createLOG2E",{enumerable:!0,get:function(){return Rn.createLOG2E}}),Object.defineProperty(t,"createLarger",{enumerable:!0,get:function(){return wt.createLarger}}),Object.defineProperty(t,"createLargerEq",{enumerable:!0,get:function(){return kt.createLargerEq}}),Object.defineProperty(t,"createLcm",{enumerable:!0,get:function(){return H.createLcm}}),Object.defineProperty(t,"createLeftShift",{enumerable:!0,get:function(){return ft.createLeftShift}}),Object.defineProperty(t,"createLog",{enumerable:!0,get:function(){return rt.createLog}}),Object.defineProperty(t,"createLog10",{enumerable:!0,get:function(){return G.createLog10}}),Object.defineProperty(t,"createLog1p",{enumerable:!0,get:function(){return nt.createLog1p}}),Object.defineProperty(t,"createLog2",{enumerable:!0,get:function(){return X.createLog2}}),Object.defineProperty(t,"createLoschmidt",{enumerable:!0,get:function(){return Ln.createLoschmidt}}),Object.defineProperty(t,"createLsolve",{enumerable:!0,get:function(){return st.createLsolve}}),Object.defineProperty(t,"createLsolveAll",{enumerable:!0,get:function(){return ct.createLsolveAll}}),Object.defineProperty(t,"createLup",{enumerable:!0,get:function(){return Hr.createLup}}),Object.defineProperty(t,"createLusolve",{enumerable:!0,get:function(){return Yr.createLusolve}}),Object.defineProperty(t,"createMad",{enumerable:!0,get:function(){return pn.createMad}}),Object.defineProperty(t,"createMagneticConstant",{enumerable:!0,get:function(){return Ln.createMagneticConstant}}),Object.defineProperty(t,"createMagneticFluxQuantum",{enumerable:!0,get:function(){return Ln.createMagneticFluxQuantum}}),Object.defineProperty(t,"createMap",{enumerable:!0,get:function(){return Se.createMap}}),Object.defineProperty(t,"createMapTransform",{enumerable:!0,get:function(){return $n.createMapTransform}}),Object.defineProperty(t,"createMatrix",{enumerable:!0,get:function(){return M.createMatrix}}),Object.defineProperty(t,"createMatrixClass",{enumerable:!0,get:function(){return c.createMatrixClass}}),Object.defineProperty(t,"createMatrixFromColumns",{enumerable:!0,get:function(){return N.createMatrixFromColumns}}),Object.defineProperty(t,"createMatrixFromFunction",{enumerable:!0,get:function(){return E.createMatrixFromFunction}}),Object.defineProperty(t,"createMatrixFromRows",{enumerable:!0,get:function(){return C.createMatrixFromRows}}),Object.defineProperty(t,"createMax",{enumerable:!0,get:function(){return Mt.createMax}}),Object.defineProperty(t,"createMaxTransform",{enumerable:!0,get:function(){return Vn.createMaxTransform}}),Object.defineProperty(t,"createMean",{enumerable:!0,get:function(){return un.createMean}}),Object.defineProperty(t,"createMeanTransform",{enumerable:!0,get:function(){return qn.createMeanTransform}}),Object.defineProperty(t,"createMedian",{enumerable:!0,get:function(){return fn.createMedian}}),Object.defineProperty(t,"createMin",{enumerable:!0,get:function(){return Et.createMin}}),Object.defineProperty(t,"createMinTransform",{enumerable:!0,get:function(){return Wn.createMinTransform}}),Object.defineProperty(t,"createMod",{enumerable:!0,get:function(){return Y.createMod}}),Object.defineProperty(t,"createMode",{enumerable:!0,get:function(){return Ve.createMode}}),Object.defineProperty(t,"createMolarMass",{enumerable:!0,get:function(){return Ln.createMolarMass}}),Object.defineProperty(t,"createMolarMassC12",{enumerable:!0,get:function(){return Ln.createMolarMassC12}}),Object.defineProperty(t,"createMolarPlanckConstant",{enumerable:!0,get:function(){return Ln.createMolarPlanckConstant}}),Object.defineProperty(t,"createMolarVolume",{enumerable:!0,get:function(){return Ln.createMolarVolume}}),Object.defineProperty(t,"createMultinomial",{enumerable:!0,get:function(){return _n.createMultinomial}}),Object.defineProperty(t,"createMultiply",{enumerable:!0,get:function(){return K.createMultiply}}),Object.defineProperty(t,"createMultiplyScalar",{enumerable:!0,get:function(){return Z.createMultiplyScalar}}),Object.defineProperty(t,"createNaN",{enumerable:!0,get:function(){return Rn.createNaN}}),Object.defineProperty(t,"createNeutronMass",{enumerable:!0,get:function(){return Ln.createNeutronMass}}),Object.defineProperty(t,"createNode",{enumerable:!0,get:function(){return Tr.createNode}}),Object.defineProperty(t,"createNorm",{enumerable:!0,get:function(){return _r.createNorm}}),Object.defineProperty(t,"createNot",{enumerable:!0,get:function(){return he.createNot}}),Object.defineProperty(t,"createNthRoot",{enumerable:!0,get:function(){return J.createNthRoot}}),Object.defineProperty(t,"createNthRoots",{enumerable:!0,get:function(){return at.createNthRoots}}),Object.defineProperty(t,"createNuclearMagneton",{enumerable:!0,get:function(){return Ln.createNuclearMagneton}}),Object.defineProperty(t,"createNull",{enumerable:!0,get:function(){return Rn.createNull}}),Object.defineProperty(t,"createNumber",{enumerable:!0,get:function(){return w.createNumber}}),Object.defineProperty(t,"createNumeric",{enumerable:!0,get:function(){return Je.createNumeric}}),Object.defineProperty(t,"createObjectNode",{enumerable:!0,get:function(){return Pr.createObjectNode}}),Object.defineProperty(t,"createOct",{enumerable:!0,get:function(){return Ge.createOct}}),Object.defineProperty(t,"createOnes",{enumerable:!0,get:function(){return Ee.createOnes}}),Object.defineProperty(t,"createOperatorNode",{enumerable:!0,get:function(){return Rr.createOperatorNode}}),Object.defineProperty(t,"createOr",{enumerable:!0,get:function(){return de.createOr}}),Object.defineProperty(t,"createParenthesisNode",{enumerable:!0,get:function(){return Lr.createParenthesisNode}}),Object.defineProperty(t,"createParse",{enumerable:!0,get:function(){return Ur.createParse}}),Object.defineProperty(t,"createParser",{enumerable:!0,get:function(){return Wr.createParser}}),Object.defineProperty(t,"createParserClass",{enumerable:!0,get:function(){return qr.createParserClass}}),Object.defineProperty(t,"createPartitionSelect",{enumerable:!0,get:function(){return At.createPartitionSelect}}),Object.defineProperty(t,"createPermutations",{enumerable:!0,get:function(){return wn.createPermutations}}),Object.defineProperty(t,"createPhi",{enumerable:!0,get:function(){return Rn.createPhi}}),Object.defineProperty(t,"createPi",{enumerable:!0,get:function(){return Rn.createPi}}),Object.defineProperty(t,"createPickRandom",{enumerable:!0,get:function(){return kn.createPickRandom}}),Object.defineProperty(t,"createPlanckCharge",{enumerable:!0,get:function(){return Ln.createPlanckCharge}}),Object.defineProperty(t,"createPlanckConstant",{enumerable:!0,get:function(){return Ln.createPlanckConstant}}),Object.defineProperty(t,"createPlanckLength",{enumerable:!0,get:function(){return Ln.createPlanckLength}}),Object.defineProperty(t,"createPlanckMass",{enumerable:!0,get:function(){return Ln.createPlanckMass}}),Object.defineProperty(t,"createPlanckTemperature",{enumerable:!0,get:function(){return Ln.createPlanckTemperature}}),Object.defineProperty(t,"createPlanckTime",{enumerable:!0,get:function(){return Ln.createPlanckTime}}),Object.defineProperty(t,"createPow",{enumerable:!0,get:function(){return et.createPow}}),Object.defineProperty(t,"createPrint",{enumerable:!0,get:function(){return Ye.createPrint}}),Object.defineProperty(t,"createProd",{enumerable:!0,get:function(){return qe.createProd}}),Object.defineProperty(t,"createProtonMass",{enumerable:!0,get:function(){return Ln.createProtonMass}}),Object.defineProperty(t,"createQr",{enumerable:!0,get:function(){return Gr.createQr}}),Object.defineProperty(t,"createQuantileSeq",{enumerable:!0,get:function(){return dn.createQuantileSeq}}),Object.defineProperty(t,"createQuantumOfCirculation",{enumerable:!0,get:function(){return Ln.createQuantumOfCirculation}}),Object.defineProperty(t,"createRandom",{enumerable:!0,get:function(){return Dn.createRandom}}),Object.defineProperty(t,"createRandomInt",{enumerable:!0,get:function(){return Tn.createRandomInt}}),Object.defineProperty(t,"createRange",{enumerable:!0,get:function(){return Ce.createRange}}),Object.defineProperty(t,"createRangeClass",{enumerable:!0,get:function(){return l.createRangeClass}}),Object.defineProperty(t,"createRangeNode",{enumerable:!0,get:function(){return Fr.createRangeNode}}),Object.defineProperty(t,"createRangeTransform",{enumerable:!0,get:function(){return Hn.createRangeTransform}}),Object.defineProperty(t,"createRationalize",{enumerable:!0,get:function(){return On.createRationalize}}),Object.defineProperty(t,"createRe",{enumerable:!0,get:function(){return pe.createRe}}),Object.defineProperty(t,"createReducedPlanckConstant",{enumerable:!0,get:function(){return Ln.createReducedPlanckConstant}}),Object.defineProperty(t,"createRelationalNode",{enumerable:!0,get:function(){return Br.createRelationalNode}}),Object.defineProperty(t,"createReplacer",{enumerable:!0,get:function(){return Pn.createReplacer}}),Object.defineProperty(t,"createReshape",{enumerable:!0,get:function(){return Ne.createReshape}}),Object.defineProperty(t,"createResize",{enumerable:!0,get:function(){return Oe.createResize}}),Object.defineProperty(t,"createResultSet",{enumerable:!0,get:function(){return a.createResultSet}}),Object.defineProperty(t,"createReviver",{enumerable:!0,get:function(){return In.createReviver}}),Object.defineProperty(t,"createRightArithShift",{enumerable:!0,get:function(){return pt.createRightArithShift}}),Object.defineProperty(t,"createRightLogShift",{enumerable:!0,get:function(){return ht.createRightLogShift}}),Object.defineProperty(t,"createRotate",{enumerable:!0,get:function(){return Ie.createRotate}}),Object.defineProperty(t,"createRotationMatrix",{enumerable:!0,get:function(){return Pe.createRotationMatrix}}),Object.defineProperty(t,"createRound",{enumerable:!0,get:function(){return tt.createRound}}),Object.defineProperty(t,"createRow",{enumerable:!0,get:function(){return Re.createRow}}),Object.defineProperty(t,"createRowTransform",{enumerable:!0,get:function(){return Gn.createRowTransform}}),Object.defineProperty(t,"createRydberg",{enumerable:!0,get:function(){return Ln.createRydberg}}),Object.defineProperty(t,"createSQRT1_2",{enumerable:!0,get:function(){return Rn.createSQRT1_2}}),Object.defineProperty(t,"createSQRT2",{enumerable:!0,get:function(){return Rn.createSQRT2}}),Object.defineProperty(t,"createSackurTetrode",{enumerable:!0,get:function(){return Ln.createSackurTetrode}}),Object.defineProperty(t,"createSec",{enumerable:!0,get:function(){return nr.createSec}}),Object.defineProperty(t,"createSech",{enumerable:!0,get:function(){return ar.createSech}}),Object.defineProperty(t,"createSecondRadiation",{enumerable:!0,get:function(){return Ln.createSecondRadiation}}),Object.defineProperty(t,"createSetCartesian",{enumerable:!0,get:function(){return cr.createSetCartesian}}),Object.defineProperty(t,"createSetDifference",{enumerable:!0,get:function(){return ur.createSetDifference}}),Object.defineProperty(t,"createSetDistinct",{enumerable:!0,get:function(){return fr.createSetDistinct}}),Object.defineProperty(t,"createSetIntersect",{enumerable:!0,get:function(){return pr.createSetIntersect}}),Object.defineProperty(t,"createSetIsSubset",{enumerable:!0,get:function(){return hr.createSetIsSubset}}),Object.defineProperty(t,"createSetMultiplicity",{enumerable:!0,get:function(){return dr.createSetMultiplicity}}),Object.defineProperty(t,"createSetPowerset",{enumerable:!0,get:function(){return mr.createSetPowerset}}),Object.defineProperty(t,"createSetSize",{enumerable:!0,get:function(){return gr.createSetSize}}),Object.defineProperty(t,"createSetSymDifference",{enumerable:!0,get:function(){return yr.createSetSymDifference}}),Object.defineProperty(t,"createSetUnion",{enumerable:!0,get:function(){return vr.createSetUnion}}),Object.defineProperty(t,"createSign",{enumerable:!0,get:function(){return Q.createSign}}),Object.defineProperty(t,"createSimplify",{enumerable:!0,get:function(){return Cn.createSimplify}}),Object.defineProperty(t,"createSin",{enumerable:!0,get:function(){return ir.createSin}}),Object.defineProperty(t,"createSinh",{enumerable:!0,get:function(){return or.createSinh}}),Object.defineProperty(t,"createSize",{enumerable:!0,get:function(){return Le.createSize}}),Object.defineProperty(t,"createSlu",{enumerable:!0,get:function(){return Xr.createSlu}}),Object.defineProperty(t,"createSmaller",{enumerable:!0,get:function(){return xt.createSmaller}}),Object.defineProperty(t,"createSmallerEq",{enumerable:!0,get:function(){return _t.createSmallerEq}}),Object.defineProperty(t,"createSort",{enumerable:!0,get:function(){return St.createSort}}),Object.defineProperty(t,"createSpaClass",{enumerable:!0,get:function(){return It.createSpaClass}}),Object.defineProperty(t,"createSparse",{enumerable:!0,get:function(){return Lt.createSparse}}),Object.defineProperty(t,"createSparseMatrixClass",{enumerable:!0,get:function(){return _.createSparseMatrixClass}}),Object.defineProperty(t,"createSpeedOfLight",{enumerable:!0,get:function(){return Ln.createSpeedOfLight}}),Object.defineProperty(t,"createSplitUnit",{enumerable:!0,get:function(){return O.createSplitUnit}}),Object.defineProperty(t,"createSqrt",{enumerable:!0,get:function(){return ee.createSqrt}}),Object.defineProperty(t,"createSqrtm",{enumerable:!0,get:function(){return an.createSqrtm}}),Object.defineProperty(t,"createSquare",{enumerable:!0,get:function(){return te.createSquare}}),Object.defineProperty(t,"createSqueeze",{enumerable:!0,get:function(){return Fe.createSqueeze}}),Object.defineProperty(t,"createStd",{enumerable:!0,get:function(){return mn.createStd}}),Object.defineProperty(t,"createStdTransform",{enumerable:!0,get:function(){return Kn.createStdTransform}}),Object.defineProperty(t,"createStefanBoltzmann",{enumerable:!0,get:function(){return Ln.createStefanBoltzmann}}),Object.defineProperty(t,"createStirlingS2",{enumerable:!0,get:function(){return An.createStirlingS2}}),Object.defineProperty(t,"createString",{enumerable:!0,get:function(){return k.createString}}),Object.defineProperty(t,"createSubset",{enumerable:!0,get:function(){return Be.createSubset}}),Object.defineProperty(t,"createSubsetTransform",{enumerable:!0,get:function(){return Xn.createSubsetTransform}}),Object.defineProperty(t,"createSubtract",{enumerable:!0,get:function(){return re.createSubtract}}),Object.defineProperty(t,"createSum",{enumerable:!0,get:function(){return cn.createSum}}),Object.defineProperty(t,"createSumTransform",{enumerable:!0,get:function(){return Jn.createSumTransform}}),Object.defineProperty(t,"createSymbolNode",{enumerable:!0,get:function(){return zr.createSymbolNode}}),Object.defineProperty(t,"createTan",{enumerable:!0,get:function(){return sr.createTan}}),Object.defineProperty(t,"createTanh",{enumerable:!0,get:function(){return lr.createTanh}}),Object.defineProperty(t,"createTau",{enumerable:!0,get:function(){return Rn.createTau}}),Object.defineProperty(t,"createThomsonCrossSection",{enumerable:!0,get:function(){return Ln.createThomsonCrossSection}}),Object.defineProperty(t,"createTo",{enumerable:!0,get:function(){return Ze.createTo}}),Object.defineProperty(t,"createTrace",{enumerable:!0,get:function(){return kr.createTrace}}),Object.defineProperty(t,"createTranspose",{enumerable:!0,get:function(){return ze.createTranspose}}),Object.defineProperty(t,"createTrue",{enumerable:!0,get:function(){return Rn.createTrue}}),Object.defineProperty(t,"createTypeOf",{enumerable:!0,get:function(){return b.createTypeOf}}),Object.defineProperty(t,"createTyped",{enumerable:!0,get:function(){return n.createTyped}}),Object.defineProperty(t,"createUnaryMinus",{enumerable:!0,get:function(){return I.createUnaryMinus}}),Object.defineProperty(t,"createUnaryPlus",{enumerable:!0,get:function(){return P.createUnaryPlus}}),Object.defineProperty(t,"createUnequal",{enumerable:!0,get:function(){return Tt.createUnequal}}),Object.defineProperty(t,"createUnitClass",{enumerable:!0,get:function(){return Pt.createUnitClass}}),Object.defineProperty(t,"createUnitFunction",{enumerable:!0,get:function(){return Rt.createUnitFunction}}),Object.defineProperty(t,"createUppercaseE",{enumerable:!0,get:function(){return Rn.createUppercaseE}}),Object.defineProperty(t,"createUppercasePi",{enumerable:!0,get:function(){return Rn.createUppercasePi}}),Object.defineProperty(t,"createUsolve",{enumerable:!0,get:function(){return lt.createUsolve}}),Object.defineProperty(t,"createUsolveAll",{enumerable:!0,get:function(){return ut.createUsolveAll}}),Object.defineProperty(t,"createVacuumImpedance",{enumerable:!0,get:function(){return Ln.createVacuumImpedance}}),Object.defineProperty(t,"createVariance",{enumerable:!0,get:function(){return hn.createVariance}}),Object.defineProperty(t,"createVarianceTransform",{enumerable:!0,get:function(){return Qn.createVarianceTransform}}),Object.defineProperty(t,"createVersion",{enumerable:!0,get:function(){return Rn.createVersion}}),Object.defineProperty(t,"createWeakMixingAngle",{enumerable:!0,get:function(){return Ln.createWeakMixingAngle}}),Object.defineProperty(t,"createWienDisplacement",{enumerable:!0,get:function(){return Ln.createWienDisplacement}}),Object.defineProperty(t,"createXgcd",{enumerable:!0,get:function(){return ne.createXgcd}}),Object.defineProperty(t,"createXor",{enumerable:!0,get:function(){return me.createXor}}),Object.defineProperty(t,"createZeros",{enumerable:!0,get:function(){return Ue.createZeros}});var n=r(92814),a=r(3574),i=r(31002),o=r(99409),s=r(73639),l=r(38382),c=r(8797),u=r(47392),f=r(12558),p=r(46950),h=r(6299),d=r(70353),m=r(65582),g=r(69402),y=r(70562),v=r(19454),b=r(36039),x=r(50828),_=r(43031),w=r(35074),k=r(55081),D=r(54872),T=r(10307),A=r(59252),S=r(84558),M=r(73458),E=r(70889),C=r(80929),N=r(1766),O=r(91406),I=r(87611),P=r(94994),R=r(80118),L=r(91794),F=r(44512),B=r(20548),z=r(62069),j=r(52073),U=r(77199),$=r(40725),V=r(83367),q=r(26822),W=r(61016),H=r(9077),G=r(76577),X=r(53532),Y=r(89640),Z=r(34912),K=r(68889),J=r(50661),Q=r(2814),ee=r(88772),te=r(84627),re=r(28697),ne=r(73717),ae=r(79881),ie=r(25345),oe=r(63430),se=r(29563),le=r(78893),ce=r(52012),ue=r(14161),fe=r(89584),pe=r(93246),he=r(44505),de=r(93763),me=r(17513),ge=r(46545),ye=r(25120),ve=r(88558),be=r(22490),xe=r(26004),_e=r(7833),we=r(12645),ke=r(14179),De=r(89711),Te=r(76787),Ae=r(41859),Se=r(36463),Me=r(27598),Ee=r(96653),Ce=r(5941),Ne=r(50578),Oe=r(21112),Ie=r(41831),Pe=r(7442),Re=r(92124),Le=r(78525),Fe=r(80418),Be=r(63451),ze=r(35329),je=r(70185),Ue=r(5668),$e=r(71770),Ve=r(57813),qe=r(1058),We=r(64924),He=r(849),Ge=r(68848),Xe=r(76276),Ye=r(36332),Ze=r(84583),Ke=r(91059),Je=r(79847),Qe=r(8102),et=r(78629),tt=r(41300),rt=r(36083),nt=r(46137),at=r(94743),it=r(82785),ot=r(33984),st=r(33806),lt=r(16113),ct=r(82085),ut=r(49193),ft=r(43707),pt=r(89796),ht=r(40550),dt=r(87226),mt=r(75575),gt=r(54675),yt=r(15667),vt=r(13422),bt=r(79794),xt=r(80086),_t=r(73062),wt=r(91013),kt=r(29540),Dt=r(70794),Tt=r(52109),At=r(82859),St=r(22927),Mt=r(37223),Et=r(38252),Ct=r(21551),Nt=r(51450),Ot=r(88525),It=r(38173),Pt=r(53504),Rt=r(61867),Lt=r(71824),Ft=r(44193),Bt=r(52669),zt=r(98936),jt=r(59793),Ut=r(6912),$t=r(93302),Vt=r(88879),qt=r(18863),Wt=r(22355),Ht=r(40950),Gt=r(71411),Xt=r(94306),Yt=r(47154),Zt=r(6205),Kt=r(13045),Jt=r(5286),Qt=r(7812),er=r(72115),tr=r(96738),rr=r(70222),nr=r(98675),ar=r(34817),ir=r(36527),or=r(41537),sr=r(83117),lr=r(3405),cr=r(31686),ur=r(42340),fr=r(19412),pr=r(96716),hr=r(79703),dr=r(75941),mr=r(25858),gr=r(6463),yr=r(94139),vr=r(60936),br=r(5644),xr=r(12166),_r=r(76334),wr=r(10815),kr=r(43227),Dr=r(94647),Tr=r(58352),Ar=r(91044),Sr=r(24834),Mr=r(14090),Er=r(81524),Cr=r(77621),Nr=r(47788),Or=r(15427),Ir=r(85458),Pr=r(56763),Rr=r(43144),Lr=r(95454),Fr=r(11032),Br=r(15198),zr=r(95802),jr=r(20948),Ur=r(84918),$r=r(86482),Vr=r(9571),qr=r(60307),Wr=r(44983),Hr=r(53243),Gr=r(69834),Xr=r(15324),Yr=r(29286),Zr=r(45278),Kr=r(39436),Jr=r(62186),Qr=r(22782),en=r(98686),tn=r(75667),rn=r(9923),nn=r(28964),an=r(40428),on=r(18093),sn=r(7632),ln=r(99449),cn=r(16299),un=r(74250),fn=r(40329),pn=r(47008),hn=r(99026),dn=r(25015),mn=r(27512),gn=r(31469),yn=r(38900),vn=r(68793),bn=r(43523),xn=r(58566),_n=r(54075),wn=r(43658),kn=r(18309),Dn=r(92999),Tn=r(79854),An=r(43279),Sn=r(66042),Mn=r(60666),En=r(7789),Cn=r(97016),Nn=r(49387),On=r(55963),In=r(98071),Pn=r(70041),Rn=r(84467),Ln=r(12976),Fn=r(96270),Bn=r(21863),zn=r(92536),jn=r(36177),Un=r(99702),$n=r(56381),Vn=r(68350),qn=r(21050),Wn=r(70638),Hn=r(70547),Gn=r(12208),Xn=r(39576),Yn=r(21712),Zn=r(93489),Kn=r(14907),Jn=r(56063),Qn=r(79191)},53243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLup=void 0;var n=r(54699),a=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtract","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],i=(0,r(58450).factory)("lup",a,(function(e){var t=e.typed,r=e.matrix,a=e.abs,i=e.addScalar,o=e.divideScalar,s=e.multiplyScalar,l=e.subtract,c=e.larger,u=e.equalScalar,f=e.unaryMinus,p=e.DenseMatrix,h=e.SparseMatrix,d=e.Spa;return t("lup",{DenseMatrix:function(e){return m(e)},SparseMatrix:function(e){return function(e){var t,r,n,i=e._size[0],l=e._size[1],p=Math.min(i,l),m=e._values,g=e._index,y=e._ptr,v=[],b=[],x=[],_=[i,p],w=[],k=[],D=[],T=[p,l],A=[],S=[];for(t=0;t<i;t++)A[t]=t,S[t]=t;var M=function(){var e=new d;r<i&&(x.push(v.length),v.push(1),b.push(r)),D.push(w.length);var l=y[r],p=y[r+1];for(n=l;n<p;n++)t=g[n],e.set(A[t],m[n]);r>0&&e.forEach(0,r-1,(function(t,r){h._forEachRow(t,v,b,x,(function(n,a){n>t&&e.accumulate(n,f(s(a,r)))}))}));var M,E,C,N,O=r,I=e.get(r),P=a(I);e.forEach(r+1,i-1,(function(e,t){var r=a(t);c(r,P)&&(O=e,P=r,I=t)})),r!==O&&(h._swapRows(r,O,_[1],v,b,x),h._swapRows(r,O,T[1],w,k,D),e.swap(r,O),E=O,C=S[M=r],N=S[E],A[C]=E,A[N]=M,S[M]=N,S[E]=C),e.forEach(0,i-1,(function(e,t){e<=r?(w.push(t),k.push(e)):(t=o(t,I),u(t,0)||(v.push(t),b.push(e)))}))};for(r=0;r<l;r++)M();return D.push(w.length),x.push(v.length),{L:new h({values:v,index:b,ptr:x,size:_}),U:new h({values:w,index:k,ptr:D,size:T}),p:A,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}(e)},Array:function(e){var t=m(r(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function m(e){var t,r,f,h=e._size[0],d=e._size[1],m=Math.min(h,d),g=(0,n.clone)(e._data),y=[],v=[h,m],b=[],x=[m,d],_=[];for(t=0;t<h;t++)_[t]=t;for(r=0;r<d;r++){if(r>0)for(t=0;t<h;t++){var w=Math.min(t,r),k=0;for(f=0;f<w;f++)k=i(k,s(g[t][f],g[f][r]));g[t][r]=l(g[t][r],k)}var D=r,T=0,A=0;for(t=r;t<h;t++){var S=g[t][r],M=a(S);c(M,T)&&(D=t,T=M,A=S)}if(r!==D&&(_[r]=[_[D],_[D]=_[r]][0],p._swapRows(r,D,g)),r<h)for(t=r+1;t<h;t++){var E=g[t][r];u(E,0)||(g[t][r]=o(g[t][r],A))}}for(r=0;r<d;r++)for(t=0;t<h;t++)0===r&&(t<d&&(b[t]=[]),y[t]=[]),t<r?(t<d&&(b[t][r]=g[t][r]),r<h&&(y[t][r]=0)):t!==r?(t<d&&(b[t][r]=0),r<h&&(y[t][r]=g[t][r])):(t<d&&(b[t][r]=g[t][r]),r<h&&(y[t][r]=1));var C=new p({data:y,size:v}),N=new p({data:b,size:x}),O=[];for(t=0,m=_.length;t<m;t++)O[_[t]]=t;return{L:C,U:N,p:O,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}}));t.createLup=i},69834:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createQr=void 0;var a=n(r(9917)),i=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtract","complex"],o=(0,r(58450).factory)("qr",i,(function(e){var t=e.typed,r=e.matrix,n=e.zeros,i=e.identity,o=e.isZero,s=e.equal,l=e.sign,c=e.sqrt,u=e.conj,f=e.unaryMinus,p=e.addScalar,h=e.divideScalar,d=e.multiplyScalar,m=e.subtract,g=e.complex;return(0,a.default)(t("qr",{DenseMatrix:function(e){return v(e)},SparseMatrix:function(e){return function(e){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){var t=v(r(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:y});function y(e){var t,r,a,g=e._size[0],y=e._size[1],v=i([g],"dense"),b=v._data,x=e.clone(),_=x._data,w=n([g],"");for(a=0;a<Math.min(y,g);++a){var k=_[a][a],D=f(s(k,0)?1:l(k)),T=u(D),A=0;for(t=a;t<g;t++)A=p(A,d(_[t][a],u(_[t][a])));var S=d(D,c(A));if(!o(S)){var M=m(k,S);for(w[a]=1,t=a+1;t<g;t++)w[t]=h(_[t][a],M);var E=f(u(h(M,S))),C=void 0;for(r=a;r<y;r++){for(C=0,t=a;t<g;t++)C=p(C,d(u(w[t]),_[t][r]));for(C=d(C,E),t=a;t<g;t++)_[t][r]=d(m(_[t][r],d(w[t],C)),T)}for(t=0;t<g;t++){for(C=0,r=a;r<g;r++)C=p(C,d(b[t][r],w[r]));for(C=d(C,E),r=a;r<g;++r)b[t][r]=h(m(b[t][r],d(C,u(w[r]))),T)}}}return{Q:v,R:x,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}function v(e){var t=y(e),r=t.R._data;if(e._data.length>0)for(var n="Complex"===r[0][0].type?g(0):0,a=0;a<r.length;++a)for(var i=0;i<a&&i<(r[0]||[]).length;++i)r[a][i]=n;return t}}));t.createQr=o},15324:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSlu=void 0;var n=r(49473),a=r(58450),i=r(33538),o=r(83362),s=["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],l=(0,a.factory)("slu",s,(function(e){var t=e.typed,r=e.abs,a=e.add,s=e.multiply,l=e.transpose,c=e.divideScalar,u=e.subtract,f=e.larger,p=e.largerEq,h=e.SparseMatrix,d=(0,i.createCsSqr)({add:a,multiply:s,transpose:l}),m=(0,o.createCsLu)({abs:r,divideScalar:c,multiply:s,subtract:u,larger:f,largerEq:p,SparseMatrix:h});return t("slu",{"SparseMatrix, number, number":function(e,t,r){if(!(0,n.isInteger)(t)||t<0||t>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(r<0||r>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var a=d(t,e,!1),i=m(e,a,r);return{L:i.L,U:i.U,p:i.pinv,q:a.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})}));t.createSlu=l},49387:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDerivative=void 0;var n=r(57237),a=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],i=(0,r(58450).factory)("derivative",a,(function(e){var t=e.typed,r=e.config,a=e.parse,i=e.simplify,o=e.equal,s=e.isZero,l=e.numeric,c=e.ConstantNode,u=e.FunctionNode,f=e.OperatorNode,p=e.ParenthesisNode,h=e.SymbolNode,d=t("derivative",{"Node, SymbolNode, Object":function(e,t,r){var n={};g(n,e,t.name);var a=y(e,n);return r.simplify?i(a):a},"Node, SymbolNode":function(e,t){return this(e,t,{simplify:!0})},"string, SymbolNode":function(e,t){return this(a(e),t)},"string, SymbolNode, Object":function(e,t,r){return this(a(e),t,r)},"string, string":function(e,t){return this(a(e),a(t))},"string, string, Object":function(e,t,r){return this(a(e),a(t),r)},"Node, string":function(e,t){return this(e,a(t))},"Node, string, Object":function(e,t,r){return this(e,a(t),r)}});d._simplify=!0,d.toTex=function(e){return m.apply(null,e.args)};var m=t("_derivTex",{"Node, SymbolNode":function(e,t){return(0,n.isConstantNode)(e)&&"string"===(0,n.typeOf)(e.value)?m(a(e.value).toString(),t.toString(),1):m(e.toString(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===(0,n.typeOf)(t.value))return m(e,a(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,r){return m(e.toString(),t.name,r.value)},"string, string, number":function(e,t,r){return(1===r?"{d\\over d"+t+"}":"{d^{"+r+"}\\over d"+t+"^{"+r+"}}")+"\\left[".concat(e,"\\right]")}}),g=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0,!0},"Object, SymbolNode, string":function(e,t,r){return t.name!==r&&(e[t]=!0,!0)},"Object, ParenthesisNode, string":function(e,t,r){return g(e,t.content,r)},"Object, FunctionAssignmentNode, string":function(e,t,r){return-1===t.params.indexOf(r)?(e[t]=!0,!0):g(e,t.expr,r)},"Object, FunctionNode | OperatorNode, string":function(e,t,r){if(t.args.length>0){for(var n=g(e,t.args[0],r),a=1;a<t.args.length;++a)n=g(e,t.args[a],r)&&n;if(n)return e[t]=!0,!0}return!1}}),y=t("_derivative",{"ConstantNode, Object":function(e){return v(0)},"SymbolNode, Object":function(e,t){return void 0!==t[e]?v(0):v(1)},"ParenthesisNode, Object":function(e,t){return new p(y(e.content,t))},"FunctionAssignmentNode, Object":function(e,t){return void 0!==t[e]?v(0):y(e.expr,t)},"FunctionNode, Object":function(e,t){if(1!==e.args.length&&function(e){if("log"!==e.name&&"nthRoot"!==e.name&&"pow"!==e.name||2!==e.args.length){for(var t=0;t<e.args.length;++t)e.args[t]=v(0);throw e.compile().evaluate(),new Error("Expected TypeError, but none found")}}(e),void 0!==t[e])return v(0);var r,n,a,i,o=e.args[0],s=!1,l=!1;switch(e.name){case"cbrt":s=!0,n=new f("*","multiply",[v(3),new f("^","pow",[o,new f("/","divide",[v(2),v(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)s=!0,n=new f("*","multiply",[v(2),new u("sqrt",[o])]);else if(2===e.args.length)return t[r=new f("/","divide",[v(1),e.args[1]])]=t[e.args[1]],y(new f("^","pow",[o,r]),t);break;case"log10":r=v(10);case"log":if(r||1!==e.args.length){if(1===e.args.length&&r||2===e.args.length&&void 0!==t[e.args[1]])n=new f("*","multiply",[o.clone(),new u("log",[r||e.args[1]])]),s=!0;else if(2===e.args.length)return y(new f("/","divide",[new u("log",[o]),new u("log",[e.args[1]])]),t)}else n=o.clone(),s=!0;break;case"pow":return t[r]=t[e.args[1]],y(new f("^","pow",[o,e.args[1]]),t);case"exp":n=new u("exp",[o.clone()]);break;case"sin":n=new u("cos",[o.clone()]);break;case"cos":n=new f("-","unaryMinus",[new u("sin",[o.clone()])]);break;case"tan":n=new f("^","pow",[new u("sec",[o.clone()]),v(2)]);break;case"sec":n=new f("*","multiply",[e,new u("tan",[o.clone()])]);break;case"csc":l=!0,n=new f("*","multiply",[e,new u("cot",[o.clone()])]);break;case"cot":l=!0,n=new f("^","pow",[new u("csc",[o.clone()]),v(2)]);break;case"asin":s=!0,n=new u("sqrt",[new f("-","subtract",[v(1),new f("^","pow",[o.clone(),v(2)])])]);break;case"acos":s=!0,l=!0,n=new u("sqrt",[new f("-","subtract",[v(1),new f("^","pow",[o.clone(),v(2)])])]);break;case"atan":s=!0,n=new f("+","add",[new f("^","pow",[o.clone(),v(2)]),v(1)]);break;case"asec":s=!0,n=new f("*","multiply",[new u("abs",[o.clone()]),new u("sqrt",[new f("-","subtract",[new f("^","pow",[o.clone(),v(2)]),v(1)])])]);break;case"acsc":s=!0,l=!0,n=new f("*","multiply",[new u("abs",[o.clone()]),new u("sqrt",[new f("-","subtract",[new f("^","pow",[o.clone(),v(2)]),v(1)])])]);break;case"acot":s=!0,l=!0,n=new f("+","add",[new f("^","pow",[o.clone(),v(2)]),v(1)]);break;case"sinh":n=new u("cosh",[o.clone()]);break;case"cosh":n=new u("sinh",[o.clone()]);break;case"tanh":n=new f("^","pow",[new u("sech",[o.clone()]),v(2)]);break;case"sech":l=!0,n=new f("*","multiply",[e,new u("tanh",[o.clone()])]);break;case"csch":l=!0,n=new f("*","multiply",[e,new u("coth",[o.clone()])]);break;case"coth":l=!0,n=new f("^","pow",[new u("csch",[o.clone()]),v(2)]);break;case"asinh":s=!0,n=new u("sqrt",[new f("+","add",[new f("^","pow",[o.clone(),v(2)]),v(1)])]);break;case"acosh":s=!0,n=new u("sqrt",[new f("-","subtract",[new f("^","pow",[o.clone(),v(2)]),v(1)])]);break;case"atanh":s=!0,n=new f("-","subtract",[v(1),new f("^","pow",[o.clone(),v(2)])]);break;case"asech":s=!0,l=!0,n=new f("*","multiply",[o.clone(),new u("sqrt",[new f("-","subtract",[v(1),new f("^","pow",[o.clone(),v(2)])])])]);break;case"acsch":s=!0,l=!0,n=new f("*","multiply",[new u("abs",[o.clone()]),new u("sqrt",[new f("+","add",[new f("^","pow",[o.clone(),v(2)]),v(1)])])]);break;case"acoth":s=!0,l=!0,n=new f("-","subtract",[v(1),new f("^","pow",[o.clone(),v(2)])]);break;case"abs":n=new f("/","divide",[new u(new h("abs"),[o.clone()]),o.clone()]);break;default:throw new Error('Function "'+e.name+'" is not supported by derivative, or a wrong number of arguments is passed')}s?(a="/",i="divide"):(a="*",i="multiply");var c=y(o,t);return l&&(c=new f("-","unaryMinus",[c])),new f(a,i,[c,n])},"OperatorNode, Object":function(e,t){if(void 0!==t[e])return v(0);if("+"===e.op)return new f(e.op,e.fn,e.args.map((function(e){return y(e,t)})));if("-"===e.op){if(e.isUnary())return new f(e.op,e.fn,[y(e.args[0],t)]);if(e.isBinary())return new f(e.op,e.fn,[y(e.args[0],t),y(e.args[1],t)])}if("*"===e.op){var r=e.args.filter((function(e){return void 0!==t[e]}));if(r.length>0){var a=e.args.filter((function(e){return void 0===t[e]})),i=1===a.length?a[0]:new f("*","multiply",a),l=r.concat(y(i,t));return new f("*","multiply",l)}return new f("+","add",e.args.map((function(r){return new f("*","multiply",e.args.map((function(e){return e===r?y(e,t):e.clone()})))})))}if("/"===e.op&&e.isBinary()){var c=e.args[0],p=e.args[1];return void 0!==t[p]?new f("/","divide",[y(c,t),p]):void 0!==t[c]?new f("*","multiply",[new f("-","unaryMinus",[c]),new f("/","divide",[y(p,t),new f("^","pow",[p.clone(),v(2)])])]):new f("/","divide",[new f("-","subtract",[new f("*","multiply",[y(c,t),p.clone()]),new f("*","multiply",[c.clone(),y(p,t)])]),new f("^","pow",[p.clone(),v(2)])])}if("^"===e.op&&e.isBinary()){var h=e.args[0],d=e.args[1];if(void 0!==t[h])return(0,n.isConstantNode)(h)&&(s(h.value)||o(h.value,1))?v(0):new f("*","multiply",[e,new f("*","multiply",[new u("log",[h.clone()]),y(d.clone(),t)])]);if(void 0!==t[d]){if((0,n.isConstantNode)(d)){if(s(d.value))return v(0);if(o(d.value,1))return y(h,t)}var m=new f("^","pow",[h.clone(),new f("-","subtract",[d,v(1)])]);return new f("*","multiply",[d.clone(),new f("*","multiply",[y(h,t),m])])}return new f("*","multiply",[new f("^","pow",[h.clone(),d.clone()]),new f("+","add",[new f("*","multiply",[y(h,t),new f("/","divide",[d.clone(),h.clone()])]),new f("*","multiply",[y(d,t),new u("log",[h.clone()])])])])}throw new Error('Operator "'+e.op+'" is not supported by derivative, or a wrong number of arguments is passed')}});function v(e,t){return new c(l(e,t||r.number))}return d}));t.createDerivative=i},55963:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRationalize=void 0;var n=r(49473),a=r(58450),i=r(65812),o=r(81021),s="rationalize",l=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplify","?bignumber","?fraction","mathWithTransform","ConstantNode","OperatorNode","FunctionNode","SymbolNode","ParenthesisNode"],c=(0,a.factory)(s,l,(function(e){var t=e.config,r=e.typed,a=e.equal,l=e.isZero,c=e.add,u=e.subtract,f=e.multiply,p=e.divide,h=e.pow,d=e.parse,m=e.simplify,g=e.fraction,y=e.bignumber,v=e.mathWithTransform,b=e.ConstantNode,x=e.OperatorNode,_=e.FunctionNode,w=e.SymbolNode,k=e.ParenthesisNode,D=(0,i.createSimplifyConstant)({typed:r,config:t,mathWithTransform:v,fraction:g,bignumber:y,ConstantNode:b,OperatorNode:x,FunctionNode:_,SymbolNode:w}),T=(0,o.createSimplifyCore)({equal:a,isZero:l,add:c,subtract:u,multiply:f,divide:p,pow:h,ConstantNode:b,OperatorNode:x,FunctionNode:_,ParenthesisNode:k});return r(s,{string:function(e){return this(d(e),{},!1)},"string, boolean":function(e,t){return this(d(e),{},t)},"string, Object":function(e,t){return this(d(e),t,!1)},"string, Object, boolean":function(e,t,r){return this(d(e),t,r)},Node:function(e){return this(e,{},!1)},"Node, boolean":function(e,t){return this(e,{},t)},"Node, Object":function(e,t){return this(e,t,!1)},"Node, Object, boolean":function(e,t,r){var a=function(){var e=[T,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},D,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],t=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],r=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],n={};return n.firstRules=e.concat(t,r),n.distrDivRules=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],n.sucDivRules=r,n.firstRulesAgain=e.concat(t),n.finalRules=[T,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},D,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],n}(),i=function(e,t,r,a){var i=[],o=m(e,a,t,{exactFractions:!1}),s="+-*"+((r=!!r)?"/":"");!function e(t){var r=t.type;if("FunctionNode"===r)throw new Error("There is an unsolved function call");if("OperatorNode"===r)if("^"===t.op){if("ConstantNode"!==t.args[1].type||!(0,n.isInteger)(parseFloat(t.args[1].value)))throw new Error("There is a non-integer exponent");e(t.args[0])}else{if(-1===s.indexOf(t.op))throw new Error("Operator "+t.op+" invalid in polynomial expression");for(var a=0;a<t.args.length;a++)e(t.args[a])}else if("SymbolNode"===r){var o=t.name;-1===i.indexOf(o)&&i.push(o)}else if("ParenthesisNode"===r)e(t.content);else if("ConstantNode"!==r)throw new Error("type "+r+" is not allowed in polynomial expression")}(o);var l={};return l.expression=o,l.variables=i,l}(e,t,!0,a.firstRules),o=i.variables.length;if(e=i.expression,o>=1){var s,l;e=A(e);var c,u=!0,f=!1;for(e=m(e,a.firstRules,{},{exactFractions:!1});l=u?a.distrDivRules:a.sucDivRules,u=!u,(c=(e=m(e,l)).toString())!==s;)f=!0,s=c;f&&(e=m(e,a.firstRulesAgain,{},{exactFractions:!1})),e=m(e,a.finalRules,{},{exactFractions:!1})}var p=[],h={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===o&&(e.args[0]=S(e.args[0],p),e.args[1]=S(e.args[1])),r&&(h.numerator=e.args[0],h.denominator=e.args[1])):(1===o&&(e=S(e,p)),r&&(h.numerator=e,h.denominator=null)),r?(h.coefficients=p,h.variables=i.variables,h.expression=e,h):e}});function A(e,t,r){var a=e.type,i=arguments.length>1;if("OperatorNode"===a&&e.isBinary()){var o,s=!1;if("^"===e.op&&("ParenthesisNode"!==e.args[0].type&&"OperatorNode"!==e.args[0].type||"ConstantNode"!==e.args[1].type||(s=(o=parseFloat(e.args[1].value))>=2&&(0,n.isInteger)(o))),s){if(o>2){var l=e.args[0],c=new x("^","pow",[e.args[0].cloneDeep(),new b(o-1)]);e=new x("*","multiply",[l,c])}else e=new x("*","multiply",[e.args[0],e.args[0].cloneDeep()]);i&&("content"===r?t.content=e:t.args[r]=e)}}if("ParenthesisNode"===a)A(e.content,e,"content");else if("ConstantNode"!==a&&"SymbolNode"!==a)for(var u=0;u<e.args.length;u++)A(e.args[u],e,u);if(!i)return e}function S(e,t){void 0===t&&(t=[]),t[0]=0;var r=0,a="";!function e(i,o,s){var l=i.type;if("FunctionNode"===l)throw new Error("There is an unsolved function call");if("OperatorNode"===l){if(-1==="+-*^".indexOf(i.op))throw new Error("Operator "+i.op+" invalid");if(null!==o){if(("unaryMinus"===i.fn||"pow"===i.fn)&&"add"!==o.fn&&"subtract"!==o.fn&&"multiply"!==o.fn)throw new Error("Invalid "+i.op+" placing");if(("subtract"===i.fn||"add"===i.fn||"multiply"===i.fn)&&"add"!==o.fn&&"subtract"!==o.fn)throw new Error("Invalid "+i.op+" placing");if(("subtract"===i.fn||"add"===i.fn||"unaryMinus"===i.fn)&&0!==s.noFil)throw new Error("Invalid "+i.op+" placing")}"^"!==i.op&&"*"!==i.op||(s.fire=i.op);for(var c=0;c<i.args.length;c++)"unaryMinus"===i.fn&&(s.oper="-"),"+"!==i.op&&"subtract"!==i.fn||(s.fire="",s.cte=1,s.oper=0===c?"+":i.op),s.noFil=c,e(i.args[c],i,s)}else if("SymbolNode"===l){if(i.name!==a&&""!==a)throw new Error("There is more than one variable");if(a=i.name,null===o)return void(t[1]=1);if("^"===o.op&&0!==s.noFil)throw new Error("In power the variable should be the first parameter");if("*"===o.op&&1!==s.noFil)throw new Error("In multiply the variable should be the second parameter");""!==s.fire&&"*"!==s.fire||(r<1&&(t[1]=0),t[1]+=s.cte*("+"===s.oper?1:-1),r=Math.max(1,r))}else{if("ConstantNode"!==l)throw new Error("Type "+l+" is not allowed");var u=parseFloat(i.value);if(null===o)return void(t[0]=u);if("^"===o.op){if(1!==s.noFil)throw new Error("Constant cannot be powered");if(!(0,n.isInteger)(u)||u<=0)throw new Error("Non-integer exponent is not allowed");for(var f=r+1;f<u;f++)t[f]=0;return u>r&&(t[u]=0),t[u]+=s.cte*("+"===s.oper?1:-1),void(r=Math.max(u,r))}s.cte=u,""===s.fire&&(t[0]+=s.cte*("+"===s.oper?1:-1))}}(e,null,{cte:1,oper:"+",fire:""});for(var i,o=!0,s=r=t.length-1;s>=0;s--)if(0!==t[s]){var l=new b(o?t[s]:Math.abs(t[s])),c=t[s]<0?"-":"+";if(s>0){var u=new w(a);if(s>1){var f=new b(s);u=new x("^","pow",[u,f])}l=-1===t[s]&&o?new x("-","unaryMinus",[u]):1===Math.abs(t[s])?u:new x("*","multiply",[l,u])}i=o?l:"+"===c?new x("+","add",[i,l]):new x("-","subtract",[i,l]),o=!1}return o?new b(0):i}}));t.createRationalize=c},97016:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createSimplify=void 0;var a=n(r(80812)),i=r(57237),o=r(58450),s=r(51918),l=r(81021),c=r(65812),u=r(33459),f=r(54699),p=r(84146),h=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","?fraction","?bignumber","mathWithTransform","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],d=(0,o.factory)("simplify",h,(function(e){var t=e.config,r=e.typed,n=e.parse,o=e.add,h=e.subtract,d=e.multiply,m=e.divide,g=e.pow,y=e.isZero,v=e.equal,b=e.fraction,x=e.bignumber,_=e.mathWithTransform,w=e.ConstantNode,k=e.FunctionNode,D=e.OperatorNode,T=e.ParenthesisNode,A=e.SymbolNode,S=(0,c.createSimplifyConstant)({typed:r,config:t,mathWithTransform:_,fraction:b,bignumber:x,ConstantNode:w,OperatorNode:D,FunctionNode:k,SymbolNode:A}),M=(0,l.createSimplifyCore)({equal:v,isZero:y,add:o,subtract:h,multiply:d,divide:m,pow:g,ConstantNode:w,OperatorNode:D,FunctionNode:k,ParenthesisNode:T}),E=(0,u.createResolve)({parse:n,FunctionNode:k,OperatorNode:D,ParenthesisNode:T}),C=(0,s.createUtil)({FunctionNode:k,OperatorNode:D,SymbolNode:A}),N=C.isCommutative,O=C.isAssociative,I=C.flatten,P=C.unflattenr,R=C.unflattenl,L=C.createMakeNodeFunction,F=r("simplify",{string:function(e){return this(n(e),this.rules,(0,p.createEmptyMap)(),{})},"string, Map | Object":function(e,t){return this(n(e),this.rules,t,{})},"string, Map | Object, Object":function(e,t,r){return this(n(e),this.rules,t,r)},"string, Array":function(e,t){return this(n(e),t,(0,p.createEmptyMap)(),{})},"string, Array, Map | Object":function(e,t,r){return this(n(e),t,r,{})},"string, Array, Map | Object, Object":function(e,t,r,a){return this(n(e),t,r,a)},"Node, Map | Object":function(e,t){return this(e,this.rules,t,{})},"Node, Map | Object, Object":function(e,t,r){return this(e,this.rules,t,r)},Node:function(e){return this(e,this.rules,(0,p.createEmptyMap)(),{})},"Node, Array":function(e,t){return this(e,t,(0,p.createEmptyMap)(),{})},"Node, Array, Map | Object":function(e,t,r){return this(e,t,r,{})},"Node, Array, Object, Object":function(e,t,r,n){return this(e,t,(0,p.createMap)(r),n)},"Node, Array, Map, Object":function(e,t,r,i){t=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r],o=void 0,s=(0,a.default)(i);switch(s){case"string":var l=i.split("->");if(2!==l.length)throw SyntaxError("Could not parse rule: "+i);i={l:l[0],r:l[1]};case"object":if(o={l:B(n(i.l)),r:B(n(i.r))},i.context&&(o.evaluate=i.context),i.evaluate&&(o.evaluate=n(i.evaluate)),O(o.l)){var c=L(o.l),u=new A("_p"+j++);o.expanded={},o.expanded.l=c([o.l.clone(),u]),I(o.expanded.l),P(o.expanded.l),o.expanded.r=c([o.r,u])}break;case"function":o=i;break;default:throw TypeError("Unsupported type of rule: "+s)}t.push(o)}return t}(t);for(var o=E(e,r),s={},l=(o=B(o)).toString({parenthesis:"all"});!s[l];){s[l]=!0,j=0;for(var c=0;c<t.length;c++)"function"==typeof t[c]?o=t[c](o,i):(I(o),o=U(o,t[c])),R(o);l=o.toString({parenthesis:"all"})}return o}});function B(e){return e.transform((function(e,t,r){return(0,i.isParenthesisNode)(e)?B(e.content):e}))}F.simplifyCore=M,F.resolve=E;var z={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};F.rules=[M,{l:"log(e)",r:"1"},{l:"n-n1",r:"n+-n1"},{l:"-(c*v)",r:"(-c) * v"},{l:"-v",r:"(-1) * v"},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{l:"(n ^ n1) ^ n2",r:"n ^ (n1 * n2)"},{l:"n*n",r:"n^2"},{l:"n * n^n1",r:"n^(n1+1)"},{l:"n^n1 * n^n2",r:"n^(n1+n2)"},{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},{l:"n1*n2 + n2",r:"(n1+1)*n2"},{l:"n1*n3 + n2*n3",r:"(n1+n2)*n3"},{l:"n1 + -1 * (n2 + n3)",r:"n1 + -1 * n2 + -1 * n3"},S,{l:"(-n)*n1",r:"-(n*n1)"},{l:"c+v",r:"v+c",context:{add:{commutative:!1}}},{l:"v*c",r:"c*v",context:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"n-(n1+n2)",r:"n-n1-n2"},{l:"1*n",r:"n"},{l:"n1/(n2/n3)",r:"(n1*n3)/n2"}];var j=0;var U=r("applyRule",{"Node, Object":function(e,t){var r=e;if(r instanceof D||r instanceof k){if(r.args)for(var n=0;n<r.args.length;n++)r.args[n]=U(r.args[n],t)}else r instanceof T&&r.content&&(r.content=U(r.content,t));var a=t.r,i=q(t.l,r)[0];if(!i&&t.expanded&&(a=t.expanded.r,i=q(t.expanded.l,r)[0]),i){var o=r.implicit;r=a.clone(),o&&"implicit"in a&&(r.implicit=!0),r=r.transform((function(e){return e.isSymbolNode&&(0,f.hasOwnProperty)(i.placeholders,e.name)?i.placeholders[e.name].clone():e}))}return r}});function $(e,t){var r={placeholders:{}};if(!e.placeholders&&!t.placeholders)return r;if(!e.placeholders)return t;if(!t.placeholders)return e;for(var n in e.placeholders)if((0,f.hasOwnProperty)(e.placeholders,n)&&(r.placeholders[n]=e.placeholders[n],(0,f.hasOwnProperty)(t.placeholders,n)&&!W(e.placeholders[n],t.placeholders[n])))return null;for(var a in t.placeholders)(0,f.hasOwnProperty)(t.placeholders,a)&&(r.placeholders[a]=t.placeholders[a]);return r}function V(e,t){var r,n=[];if(0===e.length||0===t.length)return n;for(var a=0;a<e.length;a++)for(var i=0;i<t.length;i++)(r=$(e[a],t[i]))&&n.push(r);return n}function q(e,t,r){var n=[{placeholders:{}}];if(e instanceof D&&t instanceof D||e instanceof k&&t instanceof k){if(e instanceof D){if(e.op!==t.op||e.fn!==t.fn)return[]}else if(e instanceof k&&e.name!==t.name)return[];if(!(1===t.args.length&&1===e.args.length||!O(t)&&t.args.length===e.args.length||r)){if(t.args.length>=2&&2===e.args.length){for(var a=function(e,t){var r,n,a=[],i=L(e);if(N(e,t))for(var o=0;o<e.args.length;o++)(n=e.args.slice(0)).splice(o,1),r=1===n.length?n[0]:i(n),a.push(i([e.args[o],r]));else r=1===(n=e.args.slice(1)).length?n[0]:i(n),a.push(i([e.args[0],r]));return a}(t,e.context),o=[],s=0;s<a.length;s++){var l=q(e,a[s],!0);o=o.concat(l)}return o}if(e.args.length>2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}for(var c=[],u=0;u<e.args.length;u++){var f=q(e.args[u],t.args[u]);if(0===f.length)return[];c.push(f)}n=function(e){if(0===e.length)return e;for(var t=e.reduce(V),r=[],n={},a=0;a<t.length;a++){var i=JSON.stringify(t[a]);n[i]||(n[i]=!0,r.push(t[a]))}return r}(c)}else if(e instanceof A){if(0===e.name.length)throw new Error("Symbol in rule has 0 length...!?");if(z[e.name]){if(e.name!==t.name)return[]}else if("n"===e.name[0]||"_p"===e.name.substring(0,2))n[0].placeholders[e.name]=t;else if("v"===e.name[0]){if((0,i.isConstantNode)(t))return[];n[0].placeholders[e.name]=t}else{if("c"!==e.name[0])throw new Error("Invalid symbol in rule: "+e.name);if(!(t instanceof w))return[];n[0].placeholders[e.name]=t}}else{if(!(e instanceof w))return[];if(!v(e.value,t.value))return[]}return n}function W(e,t){if(e instanceof w&&t instanceof w){if(!v(e.value,t.value))return!1}else if(e instanceof A&&t instanceof A){if(e.name!==t.name)return!1}else{if(!(e instanceof D&&t instanceof D||e instanceof k&&t instanceof k))return!1;if(e instanceof D){if(e.op!==t.op||e.fn!==t.fn)return!1}else if(e instanceof k&&e.name!==t.name)return!1;if(e.args.length!==t.args.length)return!1;for(var r=0;r<e.args.length;r++)if(!W(e.args[r],t.args[r]))return!1}return!0}return F}));t.createSimplify=d},33459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createResolve=void 0;var n=r(84146),a=r(57237),i=["parse","FunctionNode","OperatorNode","ParenthesisNode"],o=(0,r(58450).factory)("resolve",i,(function(e){var t=e.parse,r=e.FunctionNode,i=e.OperatorNode,o=e.ParenthesisNode;return function e(s,l){if(!l)return s;if((0,n.isMap)(l)||(l=(0,n.createMap)(l)),(0,a.isSymbolNode)(s)){var c=l.get(s.name);if((0,a.isNode)(c))return e(c,l);if("number"==typeof c)return t(String(c))}else{if((0,a.isOperatorNode)(s)){var u=s.args.map((function(t){return e(t,l)}));return new i(s.op,s.fn,u,s.implicit)}if((0,a.isParenthesisNode)(s))return new o(e(s.content,l));if((0,a.isFunctionNode)(s)){var f=s.args.map((function(t){return e(t,l)}));return new r(s.name,f)}}return s}}));t.createResolve=o},65812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSimplifyConstant=void 0;var n=r(57237),a=r(58450),i=r(51918),o=r(10935),s=["typed","config","mathWithTransform","?fraction","?bignumber","ConstantNode","OperatorNode","FunctionNode","SymbolNode"],l=(0,a.factory)("simplifyConstant",s,(function(e){var t=e.typed,r=e.config,a=e.mathWithTransform,s=e.fraction,l=e.bignumber,c=e.ConstantNode,u=e.OperatorNode,f=e.FunctionNode,p=e.SymbolNode,h=(0,i.createUtil)({FunctionNode:f,OperatorNode:u,SymbolNode:p}),d=h.isCommutative,m=h.isAssociative,g=h.allChildren,y=h.createMakeNodeFunction;function v(e,t,r){try{return _(a[e].apply(null,t),r)}catch(i){return t=t.map((function(e){return(0,n.isFraction)(e)?e.valueOf():e})),_(a[e].apply(null,t),r)}}var b=t({Fraction:function(e){var t,r=e.s*e.n;return t=r<0?new u("-","unaryMinus",[new c(-r)]):new c(r),1===e.d?t:new u("/","divide",[t,new c(e.d)])},number:function(e){return e<0?w(new c(-e)):new c(e)},BigNumber:function(e){return e<0?w(new c(-e)):new c(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")}});function x(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&s){var r=s(e),n=t&&"number"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(r.valueOf()===e&&r.n<n&&r.d<n)return r}return e}var _=t({"string, Object":function(e,t){return"BigNumber"===r.number?(void 0===l&&(0,o.noBignumber)(),l(e)):"Fraction"===r.number?(void 0===s&&(0,o.noFraction)(),s(e)):x(parseFloat(e),t)},"Fraction, Object":function(e,t){return e},"BigNumber, Object":function(e,t){return e},"number, Object":function(e,t){return x(e,t)},"Complex, Object":function(e,t){return 0!==e.im?e:x(e.re,t)}});function w(e){return new u("-","unaryMinus",[e])}function k(e,t,r,a){return t.reduce((function(t,i){if((0,n.isNode)(t)||(0,n.isNode)(i))(0,n.isNode)(t)?(0,n.isNode)(i)||(i=b(i)):t=b(t);else{try{return v(e,[t,i],a)}catch(e){}t=b(t),i=b(i)}return r([t,i])}))}function D(e,t){switch(e.type){case"SymbolNode":return e;case"ConstantNode":return"number"!=typeof e.value&&isNaN(e.value)?e:_(e.value,t);case"FunctionNode":if(a[e.name]&&a[e.name].rawArgs)return e;if(-1===["add","multiply"].indexOf(e.name)){var r=e.args.map((function(e){return D(e,t)}));if(!r.some(n.isNode))try{return v(e.name,r,t)}catch(e){}return r=r.map((function(e){return(0,n.isNode)(e)?e:b(e)})),new f(e.name,r)}case"OperatorNode":var i,o,s=e.fn.toString(),l=y(e);if((0,n.isOperatorNode)(e)&&e.isUnary())i=[D(e.args[0],t)],o=(0,n.isNode)(i[0])?l(i):v(s,i,t);else if(m(e))if(i=(i=g(e)).map((function(e){return D(e,t)})),d(s)){for(var c=[],u=[],p=0;p<i.length;p++)(0,n.isNode)(i[p])?u.push(i[p]):c.push(i[p]);c.length>1?(o=k(s,c,l,t),u.unshift(o),o=k(s,u,l,t)):o=k(s,i,l,t)}else o=k(s,i,l,t);else o=k(s,i=e.args.map((function(e){return D(e,t)})),l,t);return o;case"ParenthesisNode":return D(e.content,t);default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(e.type))}}return function(e,t){var r=D(e,t);return(0,n.isNode)(r)?r:b(r)}}));t.createSimplifyConstant=l},81021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSimplifyCore=void 0;var n=r(57237),a=["equal","isZero","add","subtract","multiply","divide","pow","ConstantNode","OperatorNode","FunctionNode","ParenthesisNode"],i=(0,r(58450).factory)("simplifyCore",a,(function(e){var t=e.equal,r=e.isZero,a=e.add,i=e.subtract,o=e.multiply,s=e.divide,l=e.pow,c=e.ConstantNode,u=e.OperatorNode,f=e.FunctionNode,p=e.ParenthesisNode,h=new c(0),d=new c(1);return function e(m){if((0,n.isOperatorNode)(m)&&m.isUnary()){var g=e(m.args[0]);if("+"===m.op)return g;if("-"===m.op){if((0,n.isOperatorNode)(g)){if(g.isUnary()&&"-"===g.op)return g.args[0];if(g.isBinary()&&"subtract"===g.fn)return new u("-","subtract",[g.args[1],g.args[0]])}return new u(m.op,m.fn,[g])}}else if((0,n.isOperatorNode)(m)&&m.isBinary()){var y=e(m.args[0]),v=e(m.args[1]);if("+"===m.op){if((0,n.isConstantNode)(y)){if(r(y.value))return v;if((0,n.isConstantNode)(v))return new c(a(y.value,v.value))}return(0,n.isConstantNode)(v)&&r(v.value)?y:(0,n.isOperatorNode)(v)&&v.isUnary()&&"-"===v.op?new u("-","subtract",[y,v.args[0]]):new u(m.op,m.fn,v?[y,v]:[y])}if("-"===m.op){if((0,n.isConstantNode)(y)&&v){if((0,n.isConstantNode)(v))return new c(i(y.value,v.value));if(r(y.value))return new u("-","unaryMinus",[v])}if("subtract"===m.fn)return(0,n.isConstantNode)(v)&&r(v.value)?y:(0,n.isOperatorNode)(v)&&v.isUnary()&&"-"===v.op?e(new u("+","add",[y,v.args[0]])):new u(m.op,m.fn,[y,v])}else{if("*"===m.op){if((0,n.isConstantNode)(y)){if(r(y.value))return h;if(t(y.value,1))return v;if((0,n.isConstantNode)(v))return new c(o(y.value,v.value))}if((0,n.isConstantNode)(v)){if(r(v.value))return h;if(t(v.value,1))return y;if((0,n.isOperatorNode)(y)&&y.isBinary()&&y.op===m.op){var b=y.args[0];if((0,n.isConstantNode)(b)){var x=new c(o(b.value,v.value));return new u(m.op,m.fn,[x,y.args[1]],m.implicit)}}return new u(m.op,m.fn,[v,y],m.implicit)}return new u(m.op,m.fn,[y,v],m.implicit)}if("/"===m.op){if((0,n.isConstantNode)(y)){if(r(y.value))return h;if((0,n.isConstantNode)(v)&&(t(v.value,1)||t(v.value,2)||t(v.value,4)))return new c(s(y.value,v.value))}return new u(m.op,m.fn,[y,v])}if("^"===m.op){if((0,n.isConstantNode)(v)){if(r(v.value))return d;if(t(v.value,1))return y;if((0,n.isConstantNode)(y))return new c(l(y.value,v.value));if((0,n.isOperatorNode)(y)&&y.isBinary()&&"^"===y.op){var _=y.args[1];if((0,n.isConstantNode)(_))return new u(m.op,m.fn,[y.args[0],new c(o(_.value,v.value))])}}return new u(m.op,m.fn,[y,v])}}}else{if((0,n.isParenthesisNode)(m)){var w=e(m.content);return(0,n.isParenthesisNode)(w)||(0,n.isSymbolNode)(w)||(0,n.isConstantNode)(w)?w:new p(w)}if((0,n.isFunctionNode)(m)){var k=m.args.map(e).map((function(e){return(0,n.isParenthesisNode)(e)?e.content:e}));return new f(e(m.fn),k)}}return m}}));t.createSimplifyCore=i},51918:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUtil=void 0;var n=r(57237),a=r(58450),i=r(54699),o=["FunctionNode","OperatorNode","SymbolNode"],s=(0,a.factory)("simplifyUtil",o,(function(e){var t=e.FunctionNode,r=e.OperatorNode,a=e.SymbolNode,o={add:!0,multiply:!0},s={add:!0,multiply:!0};function l(e,t){if(!(0,n.isOperatorNode)(e))return!1;var r=e.fn.toString();return t&&(0,i.hasOwnProperty)(t,r)&&(0,i.hasOwnProperty)(t[r],"associative")?t[r].associative:s[r]||!1}function c(e){var t,r=[];return l(e)?(t=e.op,function e(a){for(var i=0;i<a.args.length;i++){var o=a.args[i];(0,n.isOperatorNode)(o)&&t===o.op?e(o):r.push(o)}}(e),r):e.args}function u(e){return(0,n.isOperatorNode)(e)?function(t){try{return new r(e.op,e.fn,t,e.implicit)}catch(e){return console.error(e),[]}}:function(r){return new t(new a(e.name),r)}}return{createMakeNodeFunction:u,isCommutative:function(e,t){if(!(0,n.isOperatorNode)(e))return!0;var r=e.fn.toString();return t&&(0,i.hasOwnProperty)(t,r)&&(0,i.hasOwnProperty)(t[r],"commutative")?t[r].commutative:o[r]||!1},isAssociative:l,flatten:function e(t){if(!t.args||0===t.args.length)return t;t.args=c(t);for(var r=0;r<t.args.length;r++)e(t.args[r])},allChildren:c,unflattenr:function e(t){if(t.args&&0!==t.args.length){for(var r=u(t),n=t.args.length,a=0;a<n;a++)e(t.args[a]);if(n>2&&l(t)){for(var i=t.args.pop();t.args.length>0;)i=r([t.args.pop(),i]);t.args=i.args}}},unflattenl:function e(t){if(t.args&&0!==t.args.length){for(var r=u(t),n=t.args.length,a=0;a<n;a++)e(t.args[a]);if(n>2&&l(t)){for(var i=t.args.shift();t.args.length>0;)i=r([i,t.args.shift()]);t.args=i.args}}}}}));t.createUtil=s},33806:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLsolve=void 0;var n=r(58450),a=r(78503),i="lsolve",o=["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,o=e.multiplyScalar,s=e.subtract,l=e.equalScalar,c=e.DenseMatrix,u=(0,a.createSolveValidation)({DenseMatrix:c});return t(i,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=(t=u(e,t,!0))._data,a=e._size[0],i=e._size[1],f=e._values,p=e._index,h=e._ptr,d=[],m=0;m<i;m++){var g=r[m][0]||0;if(l(g,0))d[m]=[0];else{for(var y=0,v=[],b=[],x=h[m],_=h[m+1],w=x;w<_;w++){var k=p[w];k===m?y=f[w]:k>m&&(v.push(f[w]),b.push(k))}if(l(y,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var D=n(g,y),T=0,A=b.length;T<A;T++){var S=b[T];r[S]=[s(r[S][0]||0,o(D,v[T]))]}d[m]=[D]}}return new c({data:d,size:[a,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return f(e,t)},"Array, Array | Matrix":function(e,t){return f(r(e),t).valueOf()}});function f(e,t){for(var r=(t=u(e,t,!0))._data,a=e._size[0],i=e._size[1],f=[],p=e._data,h=0;h<i;h++){var d=r[h][0]||0,m=void 0;if(l(d,0))m=0;else{var g=p[h][h];if(l(g,0))throw new Error("Linear system cannot be solved since matrix is singular");m=n(d,g);for(var y=h+1;y<a;y++)r[y]=[s(r[y][0]||0,o(m,p[y][h]))]}f[h]=[m]}return new c({data:f,size:[a,1]})}}));t.createLsolve=s},82085:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createLsolveAll=void 0;var a=n(r(34906)),i=r(58450),o=r(78503),s="lsolveAll",l=["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],c=(0,i.factory)(s,l,(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.multiplyScalar,l=e.subtract,c=e.equalScalar,u=e.DenseMatrix,f=(0,o.createSolveValidation)({DenseMatrix:u});return t(s,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=[f(e,t,!0)._data.map((function(e){return e[0]}))],o=e._size[0],s=e._size[1],p=e._values,h=e._index,d=e._ptr,m=0;m<s;m++)for(var g=r.length,y=0;y<g;y++){for(var v=r[y],b=[],x=[],_=d[m],w=d[m+1],k=0,D=_;D<w;D++){var T=h[D];T===m?k=p[D]:T>m&&(b.push(p[D]),x.push(T))}if(c(k,0))if(c(v[m],0)){if(0===y){var A=(0,a.default)(v);A[m]=1;for(var S=0,M=x.length;S<M;S++){var E=x[S];A[E]=l(A[E],b[S])}r.push(A)}}else{if(0===y)return[];r.splice(y,1),y-=1,g-=1}else{v[m]=n(v[m],k);for(var C=0,N=x.length;C<N;C++){var O=x[C];v[O]=l(v[O],i(v[m],b[C]))}}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[o,1]})}))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return p(e,t)},"Array, Array | Matrix":function(e,t){return p(r(e),t).map((function(e){return e.valueOf()}))}});function p(e,t){for(var r=[f(e,t,!0)._data.map((function(e){return e[0]}))],o=e._data,s=e._size[0],p=e._size[1],h=0;h<p;h++)for(var d=r.length,m=0;m<d;m++){var g=r[m];if(c(o[h][h],0))if(c(g[h],0)){if(0===m){var y=(0,a.default)(g);y[h]=1;for(var v=h+1;v<p;v++)y[v]=l(y[v],o[v][h]);r.push(y)}}else{if(0===m)return[];r.splice(m,1),m-=1,d-=1}else{g[h]=n(g[h],o[h][h]);for(var b=h+1;b<p;b++)g[b]=l(g[b],i(g[h],o[b][h]))}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[s,1]})}))}}));t.createLsolveAll=c},29286:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLusolve=void 0;var n=r(57237),a=r(58450),i=r(78503),o=r(65938),s="lusolve",l=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],c=(0,a.factory)(s,l,(function(e){var t=e.typed,r=e.matrix,a=e.lup,l=e.slu,c=e.usolve,u=e.lsolve,f=e.DenseMatrix,p=(0,i.createSolveValidation)({DenseMatrix:f});return t(s,{"Array, Array | Matrix":function(e,t){e=r(e);var n=a(e);return d(n.L,n.U,n.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){var r=a(e);return d(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){var r=a(e);return d(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,r,n){var a=l(e,r,n);return d(a.L,a.U,a.p,a.q,t)},"Object, Array | Matrix":function(e,t){return d(e.L,e.U,e.p,e.q,t)}});function h(e){if((0,n.isMatrix)(e))return e;if((0,n.isArray)(e))return r(e);throw new TypeError("Invalid Matrix LU decomposition")}function d(e,t,r,n,a){e=h(e),t=h(t),r&&((a=p(e,a,!0))._data=(0,o.csIpvec)(r,a._data));var i=u(e,a),s=c(t,i);return n&&(s._data=(0,o.csIpvec)(n,s._data)),s}}));t.createLusolve=c},16113:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUsolve=void 0;var n=r(58450),a=r(78503),i="usolve",o=["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,o=e.multiplyScalar,s=e.subtract,l=e.equalScalar,c=e.DenseMatrix,u=(0,a.createSolveValidation)({DenseMatrix:c});return t(i,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=(t=u(e,t,!0))._data,a=e._size[0],i=e._size[1],f=e._values,p=e._index,h=e._ptr,d=[],m=i-1;m>=0;m--){var g=r[m][0]||0;if(l(g,0))d[m]=[0];else{for(var y=0,v=[],b=[],x=h[m],_=h[m+1]-1;_>=x;_--){var w=p[_];w===m?y=f[_]:w<m&&(v.push(f[_]),b.push(w))}if(l(y,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var k=n(g,y),D=0,T=b.length;D<T;D++){var A=b[D];r[A]=[s(r[A][0],o(k,v[D]))]}d[m]=[k]}}return new c({data:d,size:[a,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return f(e,t)},"Array, Array | Matrix":function(e,t){return f(r(e),t).valueOf()}});function f(e,t){for(var r=(t=u(e,t,!0))._data,a=e._size[0],i=e._size[1],f=[],p=e._data,h=i-1;h>=0;h--){var d=r[h][0]||0,m=void 0;if(l(d,0))m=0;else{var g=p[h][h];if(l(g,0))throw new Error("Linear system cannot be solved since matrix is singular");m=n(d,g);for(var y=h-1;y>=0;y--)r[y]=[s(r[y][0]||0,o(m,p[y][h]))]}f[h]=[m]}return new c({data:f,size:[a,1]})}}));t.createUsolve=s},49193:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createUsolveAll=void 0;var a=n(r(34906)),i=r(58450),o=r(78503),s="usolveAll",l=["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],c=(0,i.factory)(s,l,(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.multiplyScalar,l=e.subtract,c=e.equalScalar,u=e.DenseMatrix,f=(0,o.createSolveValidation)({DenseMatrix:u});return t(s,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=[f(e,t,!0)._data.map((function(e){return e[0]}))],o=e._size[0],s=e._size[1],p=e._values,h=e._index,d=e._ptr,m=s-1;m>=0;m--)for(var g=r.length,y=0;y<g;y++){for(var v=r[y],b=[],x=[],_=d[m],w=0,k=d[m+1]-1;k>=_;k--){var D=h[k];D===m?w=p[k]:D<m&&(b.push(p[k]),x.push(D))}if(c(w,0))if(c(v[m],0)){if(0===y){var T=(0,a.default)(v);T[m]=1;for(var A=0,S=x.length;A<S;A++){var M=x[A];T[M]=l(T[M],b[A])}r.push(T)}}else{if(0===y)return[];r.splice(y,1),y-=1,g-=1}else{v[m]=n(v[m],w);for(var E=0,C=x.length;E<C;E++){var N=x[E];v[N]=l(v[N],i(v[m],b[E]))}}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[o,1]})}))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return p(e,t)},"Array, Array | Matrix":function(e,t){return p(r(e),t).map((function(e){return e.valueOf()}))}});function p(e,t){for(var r=[f(e,t,!0)._data.map((function(e){return e[0]}))],o=e._data,s=e._size[0],p=e._size[1]-1;p>=0;p--)for(var h=r.length,d=0;d<h;d++){var m=r[d];if(c(o[p][p],0))if(c(m[p],0)){if(0===d){var g=(0,a.default)(m);g[p]=1;for(var y=p-1;y>=0;y--)g[y]=l(g[y],o[y][p]);r.push(g)}}else{if(0===d)return[];r.splice(d,1),d-=1,h-=1}else{m[p]=n(m[p],o[p][p]);for(var v=p-1;v>=0;v--)m[v]=l(m[v],i(m[p],o[v][p]))}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[s,1]})}))}}));t.createUsolveAll=c},78503:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSolveValidation=function(e){var t=e.DenseMatrix;return function(e,r,o){var s=e.size();if(2!==s.length)throw new RangeError("Matrix must be two dimensional (size: "+(0,i.format)(s)+")");var l=s[0];if(l!==s[1])throw new RangeError("Matrix must be square (size: "+(0,i.format)(s)+")");var c=[];if((0,n.isMatrix)(r)){var u=r.size(),f=r._data;if(1===u.length){if(u[0]!==l)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var p=0;p<l;p++)c[p]=[f[p]];return new t({data:c,size:[l,1],datatype:r._datatype})}if(2===u.length){if(u[0]!==l||1!==u[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if((0,n.isDenseMatrix)(r)){if(o){c=[];for(var h=0;h<l;h++)c[h]=[f[h][0]];return new t({data:c,size:[l,1],datatype:r._datatype})}return r}if((0,n.isSparseMatrix)(r)){for(var d=0;d<l;d++)c[d]=[0];for(var m=r._values,g=r._index,y=r._ptr,v=y[1],b=y[0];b<v;b++)c[g[b]][0]=m[b];return new t({data:c,size:[l,1],datatype:r._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if((0,n.isArray)(r)){var x=(0,a.arraySize)(r);if(1===x.length){if(x[0]!==l)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var _=0;_<l;_++)c[_]=[r[_]];return new t({data:c,size:[l,1]})}if(2===x.length){if(x[0]!==l||1!==x[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var w=0;w<l;w++)c[w]=[r[w][0]];return new t({data:c,size:[l,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}};var n=r(57237),a=r(70517),i=r(59398)},59664:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsAmd=void 0;var n=r(58450),a=r(11367),i=r(66290),o=r(11863),s=["add","multiply","transpose"],l=(0,n.factory)("csAmd",s,(function(e){var t=e.add,r=e.multiply,n=e.transpose;return function(e,c){if(!c||e<=0||e>3)return null;var u=c._size,f=u[0],p=u[1],h=0,d=Math.max(16,10*Math.sqrt(p)),m=function(e,a,i,o,s){var l=n(a);if(1===e&&o===i)return t(a,l);if(2===e){for(var c=l._index,u=l._ptr,f=0,p=0;p<i;p++){var h=u[p];if(u[p]=f,!(u[p+1]-h>s))for(var d=u[p+1];h<d;h++)c[f++]=c[h]}return u[i]=f,a=n(l),r(l,a)}return r(l,a)}(e,c,f,p,d=Math.min(p-2,d));(0,a.csFkeep)(m,l,null);for(var g,y,v,b,x,_,w,k,D,T,A,S,M,E,C,N,O=m._index,I=m._ptr,P=I[p],R=[],L=[],F=p+1,B=2*(p+1),z=3*(p+1),j=4*(p+1),U=5*(p+1),$=6*(p+1),V=7*(p+1),q=R,W=function(e,t,r,n,a,i,o,l,c,u,f,p){for(var h=0;h<e;h++)r[0+h]=t[h+1]-t[h];r[0+e]=0;for(var d=0;d<=e;d++)r[a+d]=-1,i[d]=-1,r[o+d]=-1,r[l+d]=-1,r[c+d]=1,r[u+d]=1,r[f+d]=0,r[p+d]=r[0+d];var m=s(0,0,r,u,e);return r[f+e]=-2,t[e]=-1,r[u+e]=0,m}(p,I,L,0,z,q,B,V,F,$,j,U),H=function(e,t,r,n,a,o,s,l,c,u,f){for(var p=0,h=0;h<e;h++){var d=r[n+h];if(0===d)r[a+h]=-2,p++,t[h]=-1,r[o+h]=0;else if(d>s)r[l+h]=0,r[a+h]=-1,p++,t[h]=(0,i.csFlip)(e),r[l+e]++;else{var m=r[c+d];-1!==m&&(u[m]=h),r[f+h]=r[c+d],r[c+d]=h}}return p}(p,I,L,U,j,$,d,F,z,q,B),G=0;H<p;){for(v=-1;G<p&&-1===(v=L[z+G]);G++);-1!==L[B+v]&&(q[L[B+v]]=-1),L[z+G]=L[B+v];var X=L[j+v],Y=L[F+v];H+=Y;var Z=0;L[F+v]=-Y;var K=I[v],J=0===X?K:P,Q=J;for(b=1;b<=X+1;b++){for(b>X?(_=v,w=K,k=L[0+v]-X):(w=I[_=O[K++]],k=L[0+_]),x=1;x<=k;x++)(D=L[F+(g=O[w++])])<=0||(Z+=D,L[F+g]=-D,O[Q++]=g,-1!==L[B+g]&&(q[L[B+g]]=q[g]),-1!==q[g]?L[B+q[g]]=L[B+g]:L[z+L[U+g]]=L[B+g]);_!==v&&(I[_]=(0,i.csFlip)(v),L[$+_]=0)}for(0!==X&&(P=Q),L[U+v]=Z,I[v]=J,L[0+v]=Q-J,L[j+v]=-2,W=s(W,h,L,$,p),T=J;T<Q;T++)if(!((A=L[j+(g=O[T])])<=0)){var ee=W-(D=-L[F+g]);for(K=I[g],S=I[g]+A-1;K<=S;K++)L[$+(_=O[K])]>=W?L[$+_]-=D:0!==L[$+_]&&(L[$+_]=L[U+_]+ee)}for(T=J;T<Q;T++){for(M=(S=I[g=O[T]])+L[j+g]-1,E=S,C=0,N=0,K=S;K<=M;K++)if(0!==L[$+(_=O[K])]){var te=L[$+_]-W;te>0?(N+=te,O[E++]=_,C+=_):(I[_]=(0,i.csFlip)(v),L[$+_]=0)}L[j+g]=E-S+1;var re=E,ne=S+L[0+g];for(K=M+1;K<ne;K++){var ae=L[F+(y=O[K])];ae<=0||(N+=ae,O[E++]=y,C+=y)}0===N?(I[g]=(0,i.csFlip)(v),Z-=D=-L[F+g],Y+=D,H+=D,L[F+g]=0,L[j+g]=-1):(L[U+g]=Math.min(L[U+g],N),O[E]=O[re],O[re]=O[S],O[S]=v,L[0+g]=E-S+1,C=(C<0?-C:C)%p,L[B+g]=L[V+C],L[V+C]=g,q[g]=C)}for(L[U+v]=Z,W=s(W+(h=Math.max(h,Z)),h,L,$,p),T=J;T<Q;T++)if(!(L[F+(g=O[T])]>=0))for(g=L[V+(C=q[g])],L[V+C]=-1;-1!==g&&-1!==L[B+g];g=L[B+g],W++){for(k=L[0+g],A=L[j+g],K=I[g]+1;K<=I[g]+k-1;K++)L[$+O[K]]=W;var ie=g;for(y=L[B+g];-1!==y;){var oe=L[0+y]===k&&L[j+y]===A;for(K=I[y]+1;oe&&K<=I[y]+k-1;K++)L[$+O[K]]!==W&&(oe=0);oe?(I[y]=(0,i.csFlip)(g),L[F+g]+=L[F+y],L[F+y]=0,L[j+y]=-1,y=L[B+y],L[B+ie]=y):(ie=y,y=L[B+y])}}for(K=J,T=J;T<Q;T++)(D=-L[F+(g=O[T])])<=0||(L[F+g]=D,N=L[U+g]+Z-D,-1!==L[z+(N=Math.min(N,p-H-D))]&&(q[L[z+N]]=g),L[B+g]=L[z+N],q[g]=-1,L[z+N]=g,G=Math.min(G,N),L[U+g]=N,O[K++]=g);L[F+v]=Y,0==(L[0+v]=K-J)&&(I[v]=-1,L[$+v]=0),0!==X&&(P=K)}for(g=0;g<p;g++)I[g]=(0,i.csFlip)(I[g]);for(y=0;y<=p;y++)L[z+y]=-1;for(y=p;y>=0;y--)L[F+y]>0||(L[B+y]=L[z+I[y]],L[z+I[y]]=y);for(_=p;_>=0;_--)L[F+_]<=0||-1!==I[_]&&(L[B+_]=L[z+I[_]],L[z+I[_]]=_);for(v=0,g=0;g<=p;g++)-1===I[g]&&(v=(0,o.csTdfs)(g,v,L,z,B,R,$));return R.splice(R.length-1,1),R};function s(e,t,r,n,a){if(e<2||e+t<0){for(var i=0;i<a;i++)0!==r[n+i]&&(r[n+i]=1);e=2}return e}function l(e,t){return e!==t}}));t.createCsAmd=l},56246:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsCounts=void 0;var n=r(58450),a=r(11486),i=["transpose"],o=(0,n.factory)("csCounts",i,(function(e){var t=e.transpose;return function(e,r,n,i){if(!e||!r||!n)return null;var o,s,l,c,u,f,p,h=e._size,d=h[0],m=h[1],g=4*m+(i?m+d+1:0),y=[],v=m,b=2*m,x=3*m,_=4*m,w=5*m+1;for(l=0;l<g;l++)y[l]=-1;var k=[],D=t(e),T=D._index,A=D._ptr;for(l=0;l<m;l++)for(k[s=n[l]]=-1===y[x+s]?1:0;-1!==s&&-1===y[x+s];s=r[s])y[x+s]=l;if(i){for(l=0;l<m;l++)y[n[l]]=l;for(o=0;o<d;o++){for(l=m,f=A[o],p=A[o+1],u=f;u<p;u++)l=Math.min(l,y[T[u]]);y[w+o]=y[_+l],y[_+l]=o}}for(o=0;o<m;o++)y[0+o]=o;for(l=0;l<m;l++){for(-1!==r[s=n[l]]&&k[r[s]]--,c=i?y[_+l]:s;-1!==c;c=i?y[w+c]:-1)for(u=A[c];u<A[c+1];u++){o=T[u];var S=(0,a.csLeaf)(o,s,y,x,v,b,0);S.jleaf>=1&&k[s]++,2===S.jleaf&&k[S.q]--}-1!==r[s]&&(y[0+s]=r[s])}for(s=0;s<m;s++)-1!==r[s]&&(k[r[s]]+=k[s]);return k}}));t.createCsCounts=o},11430:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csDfs=function(e,t,r,o,s){var l,c,u,f=t._index,p=t._ptr,h=t._size[1],d=0;for(o[0]=e;d>=0;){e=o[d];var m=s?s[e]:e;(0,n.csMarked)(p,e)||((0,a.csMark)(p,e),o[h+d]=m<0?0:(0,i.csUnflip)(p[m]));var g=1;for(c=o[h+d],u=m<0?0:(0,i.csUnflip)(p[m+1]);c<u;c++)if(l=f[c],!(0,n.csMarked)(p,l)){o[h+d]=c,o[++d]=l,g=0;break}g&&(d--,o[--r]=e)}return r};var n=r(13559),a=r(36920),i=r(17732)},65978:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csEtree=function(e,t){if(!e)return null;var r,n,a=e._index,i=e._ptr,o=e._size,s=o[0],l=o[1],c=[],u=[],f=l;if(t)for(r=0;r<s;r++)u[f+r]=-1;for(var p=0;p<l;p++){c[p]=-1,u[0+p]=-1;for(var h=i[p],d=i[p+1],m=h;m<d;m++){var g=a[m];for(r=t?u[f+g]:g;-1!==r&&r<p;r=n)n=u[0+r],u[0+r]=p,-1===n&&(c[r]=p);t&&(u[f+g]=p)}}return c}},11367:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csFkeep=function(e,t,r){for(var n=e._values,a=e._index,i=e._ptr,o=e._size[1],s=0,l=0;l<o;l++){var c=i[l];for(i[l]=s;c<i[l+1];c++)t(a[c],l,n?n[c]:1,r)&&(a[s]=a[c],n&&(n[s]=n[c]),s++)}return i[o]=s,a.splice(s,a.length-s),n&&n.splice(s,n.length-s),s}},66290:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csFlip=function(e){return-e-2}},65938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csIpvec=function(e,t){var r,n=t.length,a=[];if(e)for(r=0;r<n;r++)a[e[r]]=t[r];else for(r=0;r<n;r++)a[r]=t[r];return a}},11486:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csLeaf=function(e,t,r,n,a,i,o){var s,l,c,u=0;if(e<=t||r[n+t]<=r[a+e])return-1;r[a+e]=r[n+t];var f=r[i+e];if(r[i+e]=t,-1===f)u=1,c=e;else{for(u=2,c=f;c!==r[o+c];c=r[o+c]);for(s=f;s!==c;s=l)l=r[o+s],r[o+s]=c}return{jleaf:u,q:c}}},83362:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsLu=void 0;var n=r(58450),a=r(88104),i=["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],o=(0,n.factory)("csLu",i,(function(e){var t=e.abs,r=e.divideScalar,n=e.multiply,i=e.subtract,o=e.larger,s=e.largerEq,l=e.SparseMatrix,c=(0,a.createCsSpsolve)({divideScalar:r,multiply:n,subtract:i});return function(e,a,i){if(!e)return null;var u,f=e._size[1],p=100,h=100;a&&(u=a.q,p=a.lnz||p,h=a.unz||h);var d,m,g=[],y=[],v=[],b=new l({values:g,index:y,ptr:v,size:[f,f]}),x=[],_=[],w=[],k=new l({values:x,index:_,ptr:w,size:[f,f]}),D=[],T=[],A=[];for(d=0;d<f;d++)T[d]=0,D[d]=-1,v[d+1]=0;p=0,h=0;for(var S=0;S<f;S++){v[S]=p,w[S]=h;var M=u?u[S]:S,E=c(b,e,M,A,T,D,1),C=-1,N=-1;for(m=E;m<f;m++)if(D[d=A[m]]<0){var O=t(T[d]);o(O,N)&&(N=O,C=d)}else _[h]=D[d],x[h++]=T[d];if(-1===C||N<=0)return null;D[M]<0&&s(t(T[M]),n(N,i))&&(C=M);var I=T[C];for(_[h]=S,x[h++]=I,D[C]=S,y[p]=C,g[p++]=1,m=E;m<f;m++)D[d=A[m]]<0&&(y[p]=d,g[p++]=r(T[d],I)),T[d]=0}for(v[f]=p,w[f]=h,m=0;m<p;m++)y[m]=D[y[m]];return g.splice(p,g.length-p),y.splice(p,y.length-p),x.splice(h,x.length-h),_.splice(h,_.length-h),{L:b,U:k,pinv:D}}}));t.createCsLu=o},36920:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csMark=function(e,t){e[t]=(0,n.csFlip)(e[t])};var n=r(66290)},13559:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csMarked=function(e,t){return e[t]<0}},71056:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csPermute=function(e,t,r,n){for(var a=e._values,i=e._index,o=e._ptr,s=e._size,l=e._datatype,c=s[0],u=s[1],f=n&&e._values?[]:null,p=[],h=[],d=0,m=0;m<u;m++){h[m]=d;for(var g=r?r[m]:m,y=o[g],v=o[g+1],b=y;b<v;b++){var x=t?t[i[b]]:i[b];p[d]=x,f&&(f[d]=a[b]),d++}}return h[u]=d,e.createSparseMatrix({values:f,index:p,ptr:h,size:[c,u],datatype:l})}},18823:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csPost=function(e,t){if(!e)return null;var r,a=0,i=[],o=[],s=t,l=2*t;for(r=0;r<t;r++)o[0+r]=-1;for(r=t-1;r>=0;r--)-1!==e[r]&&(o[s+r]=o[0+e[r]],o[0+e[r]]=r);for(r=0;r<t;r++)-1===e[r]&&(a=(0,n.csTdfs)(r,a,o,0,s,i,l));return i};var n=r(11863)},90406:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csReach=function(e,t,r,o,s){var l,c,u,f=e._ptr,p=e._size,h=t._index,d=t._ptr,m=p[1],g=m;for(c=d[r],u=d[r+1],l=c;l<u;l++){var y=h[l];(0,n.csMarked)(f,y)||(g=(0,i.csDfs)(y,e,g,o,s))}for(l=g;l<m;l++)(0,a.csMark)(f,o[l]);return g};var n=r(13559),a=r(36920),i=r(11430)},88104:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsSpsolve=void 0;var n=r(90406),a=["divideScalar","multiply","subtract"],i=(0,r(58450).factory)("csSpsolve",a,(function(e){var t=e.divideScalar,r=e.multiply,a=e.subtract;return function(e,i,o,s,l,c,u){var f,p,h,d,m=e._values,g=e._index,y=e._ptr,v=e._size[1],b=i._values,x=i._index,_=i._ptr,w=(0,n.csReach)(e,i,o,s,c);for(f=w;f<v;f++)l[s[f]]=0;for(p=_[o],h=_[o+1],f=p;f<h;f++)l[x[f]]=b[f];for(var k=w;k<v;k++){var D=s[k],T=c?c[D]:D;if(!(T<0))for(p=y[T],h=y[T+1],l[D]=t(l[D],m[u?p:h-1]),f=u?p+1:p,d=u?h:h-1;f<d;f++){var A=g[f];l[A]=a(l[A],r(m[f],l[D]))}}return w}}));t.createCsSpsolve=i},33538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsSqr=void 0;var n=r(71056),a=r(18823),i=r(65978),o=r(59664),s=r(56246),l=["add","multiply","transpose"],c=(0,r(58450).factory)("csSqr",l,(function(e){var t=e.add,r=e.multiply,l=e.transpose,c=(0,o.createCsAmd)({add:t,multiply:r,transpose:l}),u=(0,s.createCsCounts)({transpose:l});return function(e,t,r){var o,s=t._ptr,l=t._size[1],f={};if(f.q=c(e,t),e&&!f.q)return null;if(r){var p=e?(0,n.csPermute)(t,null,f.q,0):t;f.parent=(0,i.csEtree)(p,1);var h=(0,a.csPost)(f.parent,l);if(f.cp=u(p,f.parent,h,1),p&&f.parent&&f.cp&&function(e,t){var r=e._ptr,n=e._index,a=e._size,i=a[0],o=a[1];t.pinv=[],t.leftmost=[];var s,l,c,u,f,p=t.parent,h=t.pinv,d=t.leftmost,m=[],g=i,y=i+o,v=i+2*o;for(l=0;l<o;l++)m[g+l]=-1,m[y+l]=-1,m[v+l]=0;for(s=0;s<i;s++)d[s]=-1;for(l=o-1;l>=0;l--)for(u=r[l],f=r[l+1],c=u;c<f;c++)d[n[c]]=l;for(s=i-1;s>=0;s--)h[s]=-1,-1!==(l=d[s])&&(0==m[v+l]++&&(m[y+l]=s),m[0+s]=m[g+l],m[g+l]=s);for(t.lnz=0,t.m2=i,l=0;l<o;l++)if(s=m[g+l],t.lnz++,s<0&&(s=t.m2++),h[s]=l,!(--v[l]<=0)){t.lnz+=m[v+l];var b=p[l];-1!==b&&(0===m[v+b]&&(m[y+b]=m[y+l]),m[0+m[y+l]]=m[g+b],m[g+b]=m[0+s],m[v+b]+=m[v+l])}for(s=0;s<i;s++)h[s]<0&&(h[s]=l++);return!0}(p,f))for(f.unz=0,o=0;o<l;o++)f.unz+=f.cp[o]}else f.unz=4*s[l]+l,f.lnz=f.unz;return f}}));t.createCsSqr=c},11863:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csTdfs=function(e,t,r,n,a,i,o){var s=0;for(r[o]=e;s>=0;){var l=r[o+s],c=r[n+l];-1===c?(s--,i[t++]=l):(r[n+l]=r[a+c],r[o+ ++s]=c)}return t}},17732:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csUnflip=function(e){return e<0?(0,n.csFlip)(e):e};var n=r(66290)},80118:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAbs=void 0;var n=r(58450),a=r(30401),i=r(18001),o=["typed"],s=(0,n.factory)("abs",o,(function(e){return(0,e.typed)("abs",{number:i.absNumber,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},Fraction:function(e){return e.abs()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)},Unit:function(e){return e.abs()}})}));t.createAbs=s},5644:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAdd=void 0;var n=r(58450),a=r(54699),i=r(40154),o=r(51691),s=r(39032),l=r(46752),c=r(99826),u=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix"],f=(0,n.factory)("add",u,(function(e){var t=e.typed,r=e.matrix,n=e.addScalar,u=e.equalScalar,f=e.DenseMatrix,p=(e.SparseMatrix,(0,i.createAlgorithm01)({typed:t})),h=(0,o.createAlgorithm04)({typed:t,equalScalar:u}),d=(0,s.createAlgorithm10)({typed:t,DenseMatrix:f}),m=(0,l.createAlgorithm13)({typed:t}),g=(0,c.createAlgorithm14)({typed:t});return t("add",(0,a.extend)({"DenseMatrix, DenseMatrix":function(e,t){return m(e,t,n)},"DenseMatrix, SparseMatrix":function(e,t){return p(e,t,n,!1)},"SparseMatrix, DenseMatrix":function(e,t){return p(t,e,n,!0)},"SparseMatrix, SparseMatrix":function(e,t){return h(e,t,n)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"DenseMatrix, any":function(e,t){return g(e,t,n,!1)},"SparseMatrix, any":function(e,t){return d(e,t,n,!1)},"any, DenseMatrix":function(e,t){return g(t,e,n,!0)},"any, SparseMatrix":function(e,t){return d(t,e,n,!0)},"Array, any":function(e,t){return g(r(e),t,n,!1).valueOf()},"any, Array":function(e,t){return g(r(t),e,n,!0).valueOf()},"any, any":n,"any, any, ...any":function(e,t,r){for(var n=this(e,t),a=0;a<r.length;a++)n=this(n,r[a]);return n}},n.signatures))}));t.createAdd=f},44512:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAddScalar=void 0;var n=r(58450),a=r(18001),i="addScalar",o=["typed"],s=(0,n.factory)(i,o,(function(e){return(0,e.typed)(i,{"number, number":a.addNumber,"Complex, Complex":function(e,t){return e.add(t)},"BigNumber, BigNumber":function(e,t){return e.plus(t)},"Fraction, Fraction":function(e,t){return e.add(t)},"Unit, Unit":function(e,t){if(null===e.value||void 0===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===t.value||void 0===t.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(t))throw new Error("Units do not match");var r=e.clone();return r.value=this(r.value,t.value),r.fixPrefix=!1,r}})}));t.createAddScalar=s},20548:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCbrt=void 0;var n=r(58450),a=r(57237),i=r(30401),o=r(18001),s="cbrt",l=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],c=(0,n.factory)(s,l,(function(e){var t=e.config,r=e.typed,n=e.isNegative,l=e.unaryMinus,c=e.matrix,u=e.Complex,f=e.BigNumber,p=e.Fraction;return r(s,{number:o.cbrtNumber,Complex:h,"Complex, boolean":h,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&(0,a.isComplex)(e.value)){var t=e.clone();return t.value=1,(t=t.pow(1/3)).value=h(e.value),t}var r,i=n(e.value);i&&(e.value=l(e.value)),r=(0,a.isBigNumber)(e.value)?new f(1).div(3):(0,a.isFraction)(e.value)?new p(1,3):1/3;var o=e.pow(r);return i&&(o.value=l(o.value)),o},"Array | Matrix":function(e){return(0,i.deepMap)(e,this,!0)}});function h(e,r){var n=e.arg()/3,a=e.abs(),i=new u((0,o.cbrtNumber)(a),0).mul(new u(0,n).exp());if(r){var s=[i,new u((0,o.cbrtNumber)(a),0).mul(new u(0,n+2*Math.PI/3).exp()),new u((0,o.cbrtNumber)(a),0).mul(new u(0,n-2*Math.PI/3).exp())];return"Array"===t.matrix?s:c(s)}return i}}));t.createCbrt=c},62069:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createCeil=void 0;var a=n(r(16592)),i=n(r(46962)),o=r(58450),s=r(30401),l=r(49473),c=r(30585),u=r(18001),f=r(34623),p=r(99826),h=["typed","config","round","matrix","equalScalar"],d=(0,o.factory)("ceil",h,(function(e){var t=e.typed,r=e.config,n=e.round,o=e.matrix,h=e.equalScalar,d=(0,f.createAlgorithm11)({typed:t,equalScalar:h}),m=(0,p.createAlgorithm14)({typed:t});return t("ceil",{number:function(e){return(0,l.nearlyEqual)(e,n(e),r.epsilon)?n(e):(0,u.ceilNumber)(e)},"number, number":function(e,t){if((0,l.nearlyEqual)(e,n(e,t),r.epsilon))return n(e,t);var i="".concat(e,"e").split("e"),o=(0,a.default)(i,2),s=o[0],c=o[1],u=Math.ceil(Number("".concat(s,"e").concat(Number(c)+t))),f="".concat(u,"e").split("e"),p=(0,a.default)(f,2);return s=p[0],c=p[1],Number("".concat(s,"e").concat(Number(c)-t))},Complex:function(e){return e.ceil()},"Complex, number":function(e,t){return e.ceil(t)},BigNumber:function(e){return(0,c.nearlyEqual)(e,n(e),r.epsilon)?n(e):e.ceil()},"BigNumber, BigNumber":function(e,t){return(0,c.nearlyEqual)(e,n(e,t),r.epsilon)?n(e,t):e.toDecimalPlaces(t.toNumber(),i.default.ROUND_CEIL)},Fraction:function(e){return e.ceil()},"Fraction, number":function(e,t){return e.ceil(t)},"Array | Matrix":function(e){return(0,s.deepMap)(e,this,!0)},"Array | Matrix, number":function(e,t){var r=this;return(0,s.deepMap)(e,(function(e){return r(e,t)}),!0)},"SparseMatrix, number | BigNumber":function(e,t){return d(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return m(e,t,this,!1)},"number | Complex | BigNumber, Array":function(e,t){return m(o(t),e,this,!0).valueOf()}})}));t.createCeil=d},52073:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCube=void 0;var n=r(58450),a=r(30401),i=r(18001),o="cube",s=["typed"],l=(0,n.factory)(o,s,(function(e){return(0,e.typed)(o,{number:i.cubeNumber,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},Fraction:function(e){return e.pow(3)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)},Unit:function(e){return e.pow(3)}})}));t.createCube=l},18093:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDivide=void 0;var n=r(58450),a=r(54699),i=r(34623),o=r(99826),s=["typed","matrix","multiply","equalScalar","divideScalar","inv"],l=(0,n.factory)("divide",s,(function(e){var t=e.typed,r=e.matrix,n=e.multiply,s=e.equalScalar,l=e.divideScalar,c=e.inv,u=(0,i.createAlgorithm11)({typed:t,equalScalar:s}),f=(0,o.createAlgorithm14)({typed:t});return t("divide",(0,a.extend)({"Array | Matrix, Array | Matrix":function(e,t){return n(e,c(t))},"DenseMatrix, any":function(e,t){return f(e,t,l,!1)},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"Array, any":function(e,t){return f(r(e),t,l,!1).valueOf()},"any, Array | Matrix":function(e,t){return n(e,c(t))}},l.signatures))}));t.createDivide=l},8102:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDivideScalar=void 0;var n=r(58450),a=r(57237),i="divideScalar",o=["typed","numeric"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.numeric;return t(i,{"number, number":function(e,t){return e/t},"Complex, Complex":function(e,t){return e.div(t)},"BigNumber, BigNumber":function(e,t){return e.div(t)},"Fraction, Fraction":function(e,t){return e.div(t)},"Unit, number | Fraction | BigNumber":function(e,t){var n=e.clone(),i=r(1,(0,a.typeOf)(t));return n.value=this(null===n.value?n._normalize(i):n.value,t),n},"number | Fraction | BigNumber, Unit":function(e,t){var n=t.clone();n=n.pow(-1);var i=r(1,(0,a.typeOf)(e));return n.value=this(e,null===t.value?t._normalize(i):t.value),n},"Unit, Unit":function(e,t){return e.divide(t)}})}));t.createDivideScalar=s},33984:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDotDivide=void 0;var n=r(58450),a=r(343),i=r(72177),o=r(24692),s=r(34623),l=r(68311),c=r(46752),u=r(99826),f="dotDivide",p=["typed","matrix","equalScalar","divideScalar","DenseMatrix"],h=(0,n.factory)(f,p,(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,p=e.divideScalar,h=e.DenseMatrix,d=(0,a.createAlgorithm02)({typed:t,equalScalar:n}),m=(0,i.createAlgorithm03)({typed:t}),g=(0,o.createAlgorithm07)({typed:t,DenseMatrix:h}),y=(0,s.createAlgorithm11)({typed:t,equalScalar:n}),v=(0,l.createAlgorithm12)({typed:t,DenseMatrix:h}),b=(0,c.createAlgorithm13)({typed:t}),x=(0,u.createAlgorithm14)({typed:t});return t(f,{"any, any":p,"SparseMatrix, SparseMatrix":function(e,t){return g(e,t,p,!1)},"SparseMatrix, DenseMatrix":function(e,t){return d(t,e,p,!0)},"DenseMatrix, SparseMatrix":function(e,t){return m(e,t,p,!1)},"DenseMatrix, DenseMatrix":function(e,t){return b(e,t,p)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return y(e,t,p,!1)},"DenseMatrix, any":function(e,t){return x(e,t,p,!1)},"any, SparseMatrix":function(e,t){return v(t,e,p,!0)},"any, DenseMatrix":function(e,t){return x(t,e,p,!0)},"Array, any":function(e,t){return x(r(e),t,p,!1).valueOf()},"any, Array":function(e,t){return x(r(t),e,p,!0).valueOf()}})}));t.createDotDivide=h},79881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDotMultiply=void 0;var n=r(58450),a=r(343),i=r(93799),o=r(34623),s=r(46752),l=r(99826),c="dotMultiply",u=["typed","matrix","equalScalar","multiplyScalar"],f=(0,n.factory)(c,u,(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,u=e.multiplyScalar,f=(0,a.createAlgorithm02)({typed:t,equalScalar:n}),p=(0,i.createAlgorithm09)({typed:t,equalScalar:n}),h=(0,o.createAlgorithm11)({typed:t,equalScalar:n}),d=(0,s.createAlgorithm13)({typed:t}),m=(0,l.createAlgorithm14)({typed:t});return t(c,{"any, any":u,"SparseMatrix, SparseMatrix":function(e,t){return p(e,t,u,!1)},"SparseMatrix, DenseMatrix":function(e,t){return f(t,e,u,!0)},"DenseMatrix, SparseMatrix":function(e,t){return f(e,t,u,!1)},"DenseMatrix, DenseMatrix":function(e,t){return d(e,t,u)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return h(e,t,u,!1)},"DenseMatrix, any":function(e,t){return m(e,t,u,!1)},"any, SparseMatrix":function(e,t){return h(t,e,u,!0)},"any, DenseMatrix":function(e,t){return m(t,e,u,!0)},"Array, any":function(e,t){return m(r(e),t,u,!1).valueOf()},"any, Array":function(e,t){return m(r(t),e,u,!0).valueOf()}})}));t.createDotMultiply=f},82785:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDotPow=void 0;var n=r(58450),a=r(72177),i=r(24692),o=r(34623),s=r(68311),l=r(46752),c=r(99826),u="dotPow",f=["typed","equalScalar","matrix","pow","DenseMatrix"],p=(0,n.factory)(u,f,(function(e){var t=e.typed,r=e.equalScalar,n=e.matrix,f=e.pow,p=e.DenseMatrix,h=(0,a.createAlgorithm03)({typed:t}),d=(0,i.createAlgorithm07)({typed:t,DenseMatrix:p}),m=(0,o.createAlgorithm11)({typed:t,equalScalar:r}),g=(0,s.createAlgorithm12)({typed:t,DenseMatrix:p}),y=(0,l.createAlgorithm13)({typed:t}),v=(0,c.createAlgorithm14)({typed:t});return t(u,{"any, any":f,"SparseMatrix, SparseMatrix":function(e,t){return d(e,t,f,!1)},"SparseMatrix, DenseMatrix":function(e,t){return h(t,e,f,!0)},"DenseMatrix, SparseMatrix":function(e,t){return h(e,t,f,!1)},"DenseMatrix, DenseMatrix":function(e,t){return y(e,t,f)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return m(e,t,this,!1)},"DenseMatrix, any":function(e,t){return v(e,t,this,!1)},"any, SparseMatrix":function(e,t){return g(t,e,this,!0)},"any, DenseMatrix":function(e,t){return v(t,e,this,!0)},"Array, any":function(e,t){return v(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return v(n(t),e,this,!0).valueOf()}})}));t.createDotPow=p},77199:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createExp=void 0;var n=r(58450),a=r(30401),i=r(18001),o=["typed"],s=(0,n.factory)("exp",o,(function(e){return(0,e.typed)("exp",{number:i.expNumber,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createExp=s},40725:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createExpm1=void 0;var n=r(58450),a=r(30401),i=r(18001),o="expm1",s=["typed","Complex"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.Complex;return t(o,{number:i.expm1Number,Complex:function(e){var t=Math.exp(e.re);return new r(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createExpm1=l},83367:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFix=void 0;var n=r(58450),a=r(30401),i=r(99826),o=["typed","Complex","matrix","ceil","floor"],s=(0,n.factory)("fix",o,(function(e){var t=e.typed,r=e.Complex,n=e.matrix,o=e.ceil,s=e.floor,l=(0,i.createAlgorithm14)({typed:t});return t("fix",{number:function(e){return e>0?s(e):o(e)},"number, number | BigNumber":function(e,t){return e>0?s(e,t):o(e,t)},Complex:function(e){return new r(e.re>0?Math.floor(e.re):Math.ceil(e.re),e.im>0?Math.floor(e.im):Math.ceil(e.im))},"Complex, number | BigNumber":function(e,t){return new r(e.re>0?s(e.re,t):o(e.re,t),e.im>0?s(e.im,t):o(e.im,t))},BigNumber:function(e){return e.isNegative()?o(e):s(e)},"BigNumber, number | BigNumber":function(e,t){return e.isNegative()?o(e,t):s(e,t)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<0?e.ceil(t):e.floor(t)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)},"Array | Matrix, number | BigNumber":function(e,t){var r=this;return(0,a.deepMap)(e,(function(e){return r(e,t)}),!0)},"number | Complex | BigNumber, Array":function(e,t){return l(n(t),e,this,!0).valueOf()}})}));t.createFix=s},26822:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createFloor=void 0;var a=n(r(16592)),i=n(r(46962)),o=r(58450),s=r(30401),l=r(49473),c=r(30585),u=r(34623),f=r(99826),p=["typed","config","round","matrix","equalScalar"],h=(0,o.factory)("floor",p,(function(e){var t=e.typed,r=e.config,n=e.round,o=e.matrix,p=e.equalScalar,h=(0,u.createAlgorithm11)({typed:t,equalScalar:p}),d=(0,f.createAlgorithm14)({typed:t});return t("floor",{number:function(e){return(0,l.nearlyEqual)(e,n(e),r.epsilon)?n(e):Math.floor(e)},"number, number":function(e,t){if((0,l.nearlyEqual)(e,n(e,t),r.epsilon))return n(e,t);var i="".concat(e,"e").split("e"),o=(0,a.default)(i,2),s=o[0],c=o[1],u=Math.floor(Number("".concat(s,"e").concat(Number(c)+t))),f="".concat(u,"e").split("e"),p=(0,a.default)(f,2);return s=p[0],c=p[1],Number("".concat(s,"e").concat(Number(c)-t))},Complex:function(e){return e.floor()},"Complex, number":function(e,t){return e.floor(t)},BigNumber:function(e){return(0,c.nearlyEqual)(e,n(e),r.epsilon)?n(e):e.floor()},"BigNumber, BigNumber":function(e,t){return(0,c.nearlyEqual)(e,n(e,t),r.epsilon)?n(e,t):e.toDecimalPlaces(t.toNumber(),i.default.ROUND_FLOOR)},Fraction:function(e){return e.floor()},"Fraction, number":function(e,t){return e.floor(t)},"Array | Matrix":function(e){return(0,s.deepMap)(e,this,!0)},"Array | Matrix, number":function(e,t){var r=this;return(0,s.deepMap)(e,(function(e){return r(e,t)}),!0)},"SparseMatrix, number | BigNumber":function(e,t){return h(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return d(e,t,this,!1)},"number | Complex | BigNumber, Array":function(e,t){return d(o(t),e,this,!0).valueOf()}})}));t.createFloor=h},61016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGcd=void 0;var n=r(58450),a=r(40154),i=r(51691),o=r(39032),s=r(46752),l=r(99826),c=r(18001),u=["typed","matrix","equalScalar","BigNumber","DenseMatrix"],f=(0,n.factory)("gcd",u,(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,u=e.BigNumber,f=e.DenseMatrix,p=(0,a.createAlgorithm01)({typed:t}),h=(0,i.createAlgorithm04)({typed:t,equalScalar:n}),d=(0,o.createAlgorithm10)({typed:t,DenseMatrix:f}),m=(0,s.createAlgorithm13)({typed:t}),g=(0,l.createAlgorithm14)({typed:t});return t("gcd",{"number, number":c.gcdNumber,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var r=new u(0);!t.isZero();){var n=e.mod(t);e=t,t=n}return e.lt(r)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)},"SparseMatrix, SparseMatrix":function(e,t){return h(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return p(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return p(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return m(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return d(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return g(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return d(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return g(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return g(r(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return g(r(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,r){for(var n=this(e,t),a=0;a<r.length;a++)n=this(n,r[a]);return n}})}));t.createGcd=f},12166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHypot=void 0;var n=r(58450),a=r(70517),i="hypot",o=["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.abs,n=e.addScalar,o=e.divideScalar,s=e.multiplyScalar,l=e.sqrt,c=e.smaller,u=e.isPositive;return t(i,{"... number | BigNumber":function(e){for(var t=0,a=0,i=0;i<e.length;i++){var f=r(e[i]);c(a,f)?(t=s(t,s(o(a,f),o(a,f))),t=n(t,1),a=f):t=n(t,u(f)?s(o(f,a),o(f,a)):f)}return s(a,l(t))},Array:function(e){return this.apply(this,(0,a.flatten)(e))},Matrix:function(e){return this.apply(this,(0,a.flatten)(e.toArray()))}})}));t.createHypot=s},9077:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLcm=void 0;var n=r(58450),a=r(343),i=r(99970),o=r(34623),s=r(46752),l=r(99826),c=r(18001),u=["typed","matrix","equalScalar"],f=(0,n.factory)("lcm",u,(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,u=(0,a.createAlgorithm02)({typed:t,equalScalar:n}),f=(0,i.createAlgorithm06)({typed:t,equalScalar:n}),p=(0,o.createAlgorithm11)({typed:t,equalScalar:n}),h=(0,s.createAlgorithm13)({typed:t}),d=(0,l.createAlgorithm14)({typed:t});return t("lcm",{"number, number":c.lcmNumber,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(e.isZero())return e;if(t.isZero())return t;for(var r=e.times(t);!t.isZero();){var n=t;t=e.mod(n),e=n}return r.div(e).abs()},"Fraction, Fraction":function(e,t){return e.lcm(t)},"SparseMatrix, SparseMatrix":function(e,t){return f(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return u(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return h(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return p(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return d(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return p(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return d(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return d(r(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return d(r(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,r){for(var n=this(e,t),a=0;a<r.length;a++)n=this(n,r[a]);return n}})}));t.createLcm=f},36083:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLog=void 0;var n=r(58450),a=r(30401),i=r(18001),o=["config","typed","divideScalar","Complex"],s=(0,n.factory)("log",o,(function(e){var t=e.typed,r=e.config,n=e.divideScalar,o=e.Complex;return t("log",{number:function(e){return e>=0||r.predictable?(0,i.logNumber)(e):new o(e,0).log()},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||r.predictable?e.ln():new o(e.toNumber(),0).log()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)},"any, any":function(e,t){return n(this(e),this(t))}})}));t.createLog=s},76577:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLog10=void 0;var n=r(58450),a=r(30401),i=r(18001),o="log10",s=["typed","config","Complex"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(o,{number:function(e){return e>=0||r.predictable?(0,i.log10Number)(e):new n(e,0).log().div(Math.LN10)},Complex:function(e){return new n(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():new n(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createLog10=l},46137:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLog1p=void 0;var n=r(58450),a=r(30401),i=r(49473),o="log1p",s=["typed","config","divideScalar","log","Complex"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.config,n=e.divideScalar,s=e.log,l=e.Complex;return t(o,{number:function(e){return e>=-1||r.predictable?(0,i.log1p)(e):c(new l(e,0))},Complex:c,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||r.predictable?t.ln():c(new l(e.toNumber(),0))},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)},"any, any":function(e,t){return n(this(e),s(t))}});function c(e){var t=e.re+1;return new l(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}}));t.createLog1p=l},53532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLog2=void 0;var n=r(58450),a=r(30401),i=r(18001),o="log2",s=["typed","config","Complex"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(o,{number:function(e){return e>=0||r.predictable?(0,i.log2Number)(e):s(new n(e,0))},Complex:s,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log(2):s(new n(e.toNumber(),0))},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}});function s(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new n(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}}));t.createLog2=l},89640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMod=void 0;var n=r(58450),a=r(343),i=r(72177),o=r(6272),s=r(34623),l=r(68311),c=r(46752),u=r(99826),f=r(18001),p=["typed","matrix","equalScalar","DenseMatrix"],h=(0,n.factory)("mod",p,(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,p=e.DenseMatrix,h=(0,a.createAlgorithm02)({typed:t,equalScalar:n}),d=(0,i.createAlgorithm03)({typed:t}),m=(0,o.createAlgorithm05)({typed:t,equalScalar:n}),g=(0,s.createAlgorithm11)({typed:t,equalScalar:n}),y=(0,l.createAlgorithm12)({typed:t,DenseMatrix:p}),v=(0,c.createAlgorithm13)({typed:t}),b=(0,u.createAlgorithm14)({typed:t});return t("mod",{"number, number":f.modNumber,"BigNumber, BigNumber":function(e,t){if(t.isNeg())throw new Error("Cannot calculate mod for a negative divisor");return t.isZero()?e:e.mod(t)},"Fraction, Fraction":function(e,t){if(t.compare(0)<0)throw new Error("Cannot calculate mod for a negative divisor");return e.compare(0)>=0?e.mod(t):e.mod(t).add(t).mod(t)},"SparseMatrix, SparseMatrix":function(e,t){return m(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return h(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return d(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return v(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return g(e,t,this,!1)},"DenseMatrix, any":function(e,t){return b(e,t,this,!1)},"any, SparseMatrix":function(e,t){return y(t,e,this,!0)},"any, DenseMatrix":function(e,t){return b(t,e,this,!0)},"Array, any":function(e,t){return b(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return b(r(t),e,this,!0).valueOf()}})}));t.createMod=h},68889:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMultiply=void 0;var n=r(58450),a=r(57237),i=r(54699),o=r(70517),s=r(34623),l=r(99826),c="multiply",u=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],f=(0,n.factory)(c,u,(function(e){var t=e.typed,r=e.matrix,n=e.addScalar,u=e.multiplyScalar,f=e.equalScalar,p=e.dot,h=(0,s.createAlgorithm11)({typed:t,equalScalar:f}),d=(0,l.createAlgorithm14)({typed:t});function m(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;case 2:switch(t.length){case 1:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+t[0]+")");break;case 2:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}var g=t("_multiplyMatrixVector",{"DenseMatrix, any":function(e,r){var a,i=e._data,o=e._size,s=e._datatype,l=r._data,c=r._datatype,f=o[0],p=o[1],h=n,d=u;s&&c&&s===c&&"string"==typeof s&&(a=s,h=t.find(n,[a,a]),d=t.find(u,[a,a]));for(var m=[],g=0;g<f;g++){for(var y=i[g],v=d(y[0],l[0]),b=1;b<p;b++)v=h(v,d(y[b],l[b]));m[g]=v}return e.createDenseMatrix({data:m,size:[f],datatype:a})},"SparseMatrix, any":function(e,r){var a=e._values,i=e._index,o=e._ptr,s=e._datatype;if(!a)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var l,c=r._data,p=r._datatype,h=e._size[0],d=r._size[0],m=[],g=[],y=[],v=n,b=u,x=f,_=0;s&&p&&s===p&&"string"==typeof s&&(l=s,v=t.find(n,[l,l]),b=t.find(u,[l,l]),x=t.find(f,[l,l]),_=t.convert(0,l));var w=[],k=[];y[0]=0;for(var D=0;D<d;D++){var T=c[D];if(!x(T,_))for(var A=o[D],S=o[D+1],M=A;M<S;M++){var E=i[M];k[E]?w[E]=v(w[E],b(T,a[M])):(k[E]=!0,g.push(E),w[E]=b(T,a[M]))}}for(var C=g.length,N=0;N<C;N++){var O=g[N];m[N]=w[O]}return y[1]=g.length,e.createSparseMatrix({values:m,index:g,ptr:y,size:[h,1],datatype:l})}}),y=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(e,r){var a,i=e._data,o=e._size,s=e._datatype,l=r._data,c=r._size,f=r._datatype,p=o[0],h=o[1],d=c[1],m=n,g=u;s&&f&&s===f&&"string"==typeof s&&(a=s,m=t.find(n,[a,a]),g=t.find(u,[a,a]));for(var y=[],v=0;v<p;v++){var b=i[v];y[v]=[];for(var x=0;x<d;x++){for(var _=g(b[0],l[0][x]),w=1;w<h;w++)_=m(_,g(b[w],l[w][x]));y[v][x]=_}}return e.createDenseMatrix({data:y,size:[p,d],datatype:a})},"DenseMatrix, SparseMatrix":function(e,r){var a=e._data,i=e._size,o=e._datatype,s=r._values,l=r._index,c=r._ptr,p=r._size,h=r._datatype;if(!s)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var d,m=i[0],g=p[1],y=n,v=u,b=f,x=0;o&&h&&o===h&&"string"==typeof o&&(d=o,y=t.find(n,[d,d]),v=t.find(u,[d,d]),b=t.find(f,[d,d]),x=t.convert(0,d));for(var _=[],w=[],k=[],D=r.createSparseMatrix({values:_,index:w,ptr:k,size:[m,g],datatype:d}),T=0;T<g;T++){k[T]=w.length;var A=c[T],S=c[T+1];if(S>A)for(var M=0,E=0;E<m;E++){for(var C=E+1,N=void 0,O=A;O<S;O++){var I=l[O];M!==C?(N=v(a[E][I],s[O]),M=C):N=y(N,v(a[E][I],s[O]))}M!==C||b(N,x)||(w.push(E),_.push(N))}}return k[g]=w.length,D},"SparseMatrix, DenseMatrix":function(e,r){var a=e._values,i=e._index,o=e._ptr,s=e._datatype;if(!a)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var l,c=r._data,p=r._datatype,h=e._size[0],d=r._size[0],m=r._size[1],g=n,y=u,v=f,b=0;s&&p&&s===p&&"string"==typeof s&&(l=s,g=t.find(n,[l,l]),y=t.find(u,[l,l]),v=t.find(f,[l,l]),b=t.convert(0,l));for(var x=[],_=[],w=[],k=e.createSparseMatrix({values:x,index:_,ptr:w,size:[h,m],datatype:l}),D=[],T=[],A=0;A<m;A++){w[A]=_.length;for(var S=A+1,M=0;M<d;M++){var E=c[M][A];if(!v(E,b))for(var C=o[M],N=o[M+1],O=C;O<N;O++){var I=i[O];T[I]!==S?(T[I]=S,_.push(I),D[I]=y(E,a[O])):D[I]=g(D[I],y(E,a[O]))}}for(var P=w[A],R=_.length,L=P;L<R;L++){var F=_[L];x[L]=D[F]}}return w[m]=_.length,k},"SparseMatrix, SparseMatrix":function(e,r){var a,i=e._values,o=e._index,s=e._ptr,l=e._datatype,c=r._values,f=r._index,p=r._ptr,h=r._datatype,d=e._size[0],m=r._size[1],g=i&&c,y=n,v=u;l&&h&&l===h&&"string"==typeof l&&(a=l,y=t.find(n,[a,a]),v=t.find(u,[a,a]));for(var b,x,_,w,k,D,T,A,S=g?[]:void 0,M=[],E=[],C=e.createSparseMatrix({values:S,index:M,ptr:E,size:[d,m],datatype:a}),N=g?[]:void 0,O=[],I=0;I<m;I++){E[I]=M.length;var P=I+1;for(k=p[I],D=p[I+1],w=k;w<D;w++)if(A=f[w],g)for(x=s[A],_=s[A+1],b=x;b<_;b++)O[T=o[b]]!==P?(O[T]=P,M.push(T),N[T]=v(c[w],i[b])):N[T]=y(N[T],v(c[w],i[b]));else for(x=s[A],_=s[A+1],b=x;b<_;b++)O[T=o[b]]!==P&&(O[T]=P,M.push(T));if(g)for(var R=E[I],L=M.length,F=R;F<L;F++){var B=M[F];S[F]=N[B]}}return E[m]=M.length,C}});return t(c,(0,i.extend)({"Array, Array":function(e,t){m((0,o.arraySize)(e),(0,o.arraySize)(t));var n=this(r(e),r(t));return(0,a.isMatrix)(n)?n.valueOf():n},"Matrix, Matrix":function(e,r){var a=e.size(),i=r.size();return m(a,i),1===a.length?1===i.length?function(e,t,r){if(0===r)throw new Error("Cannot multiply two empty vectors");return p(e,t)}(e,r,a[0]):function(e,r){if("dense"!==r.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,r){var a,i=e._data,o=e._size,s=e._datatype,l=r._data,c=r._size,f=r._datatype,p=o[0],h=c[1],d=n,m=u;s&&f&&s===f&&"string"==typeof s&&(a=s,d=t.find(n,[a,a]),m=t.find(u,[a,a]));for(var g=[],y=0;y<h;y++){for(var v=m(i[0],l[0][y]),b=1;b<p;b++)v=d(v,m(i[b],l[b][y]));g[y]=v}return e.createDenseMatrix({data:g,size:[h],datatype:a})}(e,r)}(e,r):1===i.length?g(e,r):y(e,r)},"Matrix, Array":function(e,t){return this(e,r(t))},"Array, Matrix":function(e,t){return this(r(e,t.storage()),t)},"SparseMatrix, any":function(e,t){return h(e,t,u,!1)},"DenseMatrix, any":function(e,t){return d(e,t,u,!1)},"any, SparseMatrix":function(e,t){return h(t,e,u,!0)},"any, DenseMatrix":function(e,t){return d(t,e,u,!0)},"Array, any":function(e,t){return d(r(e),t,u,!1).valueOf()},"any, Array":function(e,t){return d(r(t),e,u,!0).valueOf()},"any, any":u,"any, any, ...any":function(e,t,r){for(var n=this(e,t),a=0;a<r.length;a++)n=this(n,r[a]);return n}},u.signatures))}));t.createMultiply=f},34912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMultiplyScalar=void 0;var n=r(58450),a=r(18001),i=["typed"],o=(0,n.factory)("multiplyScalar",i,(function(e){return(0,e.typed)("multiplyScalar",{"number, number":a.multiplyNumber,"Complex, Complex":function(e,t){return e.mul(t)},"BigNumber, BigNumber":function(e,t){return e.times(t)},"Fraction, Fraction":function(e,t){return e.mul(t)},"number | Fraction | BigNumber | Complex, Unit":function(e,t){var r=t.clone();return r.value=null===r.value?r._normalize(e):this(r.value,e),r},"Unit, number | Fraction | BigNumber | Complex":function(e,t){var r=e.clone();return r.value=null===r.value?r._normalize(t):this(r.value,t),r},"Unit, Unit":function(e,t){return e.multiply(t)}})}));t.createMultiplyScalar=o},76334:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNorm=void 0;var n=r(58450),a="norm",i=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.abs,n=e.add,i=e.pow,o=e.conj,s=e.sqrt,l=e.multiply,c=e.equalScalar,u=e.larger,f=e.smaller,p=e.matrix,h=e.ctranspose,d=e.eigs;return t(a,{number:Math.abs,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},boolean:function(e){return Math.abs(e)},Array:function(e){return m(p(e),2)},Matrix:function(e){return m(e,2)},"number | Complex | BigNumber | boolean, number | BigNumber | string":function(e){return this(e)},"Array, number | BigNumber | string":function(e,t){return m(p(e),t)},"Matrix, number | BigNumber | string":function(e,t){return m(e,t)}});function m(e,t){var a=e.size();if(1===a.length)return function(e,t){if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=0;return e.forEach((function(e){var n=r(e);u(n,t)&&(t=n)}),!0),t}(e);if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return function(e){var t;return e.forEach((function(e){var n=r(e);t&&!f(n,t)||(t=n)}),!0),t||0}(e);if("fro"===t)return m(e,2);if("number"==typeof t&&!isNaN(t)){if(!c(t,0)){var a=0;return e.forEach((function(e){a=n(i(r(e),t),a)}),!0),i(a,1/t)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}(e,t);if(2===a.length){if(a[0]&&a[1])return function(e,t){if(1===t)return function(e){var t=[],a=0;return e.forEach((function(e,i){var o=i[1],s=n(t[o]||0,r(e));u(s,a)&&(a=s),t[o]=s}),!0),a}(e);if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=[],a=0;return e.forEach((function(e,i){var o=i[0],s=n(t[o]||0,r(e));u(s,a)&&(a=s),t[o]=s}),!0),a}(e);if("fro"===t)return function(e){var t=0;return e.forEach((function(e,r){t=n(t,l(e,o(e)))})),r(s(t))}(e);if(2===t)return function(e){var t=e.size();if(t[0]!==t[1])throw new RangeError("Invalid matrix dimensions");var n=h(e),a=l(n,e),i=d(a).values.toArray(),o=i[i.length-1];return r(s(o))}(e);throw new Error("Unsupported parameter value "+t)}(e,t);throw new RangeError("Invalid matrix dimensions")}}}));t.createNorm=o},50661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNthRootNumber=t.createNthRoot=void 0;var n=r(58450),a=r(40154),i=r(343),o=r(99970),s=r(34623),l=r(46752),c=r(99826),u=r(18001),f="nthRoot",p=["typed","matrix","equalScalar","BigNumber"],h=(0,n.factory)(f,p,(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,p=e.BigNumber,h=(0,a.createAlgorithm01)({typed:t}),d=(0,i.createAlgorithm02)({typed:t,equalScalar:n}),m=(0,o.createAlgorithm06)({typed:t,equalScalar:n}),g=(0,s.createAlgorithm11)({typed:t,equalScalar:n}),y=(0,l.createAlgorithm13)({typed:t}),v=(0,c.createAlgorithm14)({typed:t}),b="Complex number not supported in function nthRoot. Use nthRoots instead.";return t(f,{number:function(e){return(0,u.nthRootNumber)(e,2)},"number, number":u.nthRootNumber,BigNumber:function(e){return x(e,new p(2))},Complex:function(e){throw new Error(b)},"Complex, number":function(e,t){throw new Error(b)},"BigNumber, BigNumber":x,"Array | Matrix":function(e){return this(e,2)},"SparseMatrix, SparseMatrix":function(e,t){if(1===t.density())return m(e,t,this);throw new Error("Root must be non-zero")},"SparseMatrix, DenseMatrix":function(e,t){return d(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){if(1===t.density())return h(e,t,this,!1);throw new Error("Root must be non-zero")},"DenseMatrix, DenseMatrix":function(e,t){return y(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return g(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return v(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){if(1===t.density())return g(t,e,this,!0);throw new Error("Root must be non-zero")},"number | BigNumber, DenseMatrix":function(e,t){return v(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(r(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,r(t)).valueOf()}});function x(e,t){var r=p.precision,n=p.clone({precision:r+2}),a=new p(0),i=new n(1),o=t.isNegative();if(o&&(t=t.neg()),t.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return o?new n(1/0):0;if(!e.isFinite())return o?a:e;var s=e.abs().pow(i.div(t));return s=e.isNeg()?s.neg():s,new p((o?i.div(s):s).toPrecision(r))}}));t.createNthRoot=h;var d=(0,n.factory)(f,["typed"],(function(e){return(0,e.typed)(f,{number:u.nthRootNumber,"number, number":u.nthRootNumber})}));t.createNthRootNumber=d},94743:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNthRoots=void 0;var n=r(58450),a="nthRoots",i=["config","typed","divideScalar","Complex"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=(e.config,e.divideScalar,e.Complex),n=[function(e){return new r(e,0)},function(e){return new r(0,e)},function(e){return new r(-e,0)},function(e){return new r(0,-e)}];function i(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[new r(0,0)];var a,i="number"==typeof e;(i||0===e.re||0===e.im)&&(a=i?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);for(var o=e.arg(),s=e.abs(),l=[],c=Math.pow(s,1/t),u=0;u<t;u++){var f=(a+4*u)/t;f!==Math.round(f)?l.push(new r({r:c,phi:(o+2*Math.PI*u)/t})):l.push(n[f%4](c))}return l}return t(a,{Complex:function(e){return i(e,2)},"Complex, number":i})}));t.createNthRoots=o},78629:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPow=void 0;var n=r(58450),a=r(49473),i=r(70517),o=r(18001),s=["typed","config","identity","multiply","matrix","fraction","number","Complex"],l=(0,n.factory)("pow",s,(function(e){var t=e.typed,r=e.config,n=e.identity,s=e.multiply,l=e.matrix,c=e.number,u=e.fraction,f=e.Complex;return t("pow",{"number, number":p,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||r.predictable?e.pow(t):new f(e.toNumber(),0).pow(t.toNumber(),0)},"Fraction, Fraction":function(e,t){var n=e.pow(t);if(null!=n)return n;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return p(e.valueOf(),t.valueOf())},"Array, number":h,"Array, BigNumber":function(e,t){return h(e,t.toNumber())},"Matrix, number":d,"Matrix, BigNumber":function(e,t){return d(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function p(e,t){if(r.predictable&&!(0,a.isInteger)(t)&&e<0)try{var n=u(t),i=c(n);if((t===i||Math.abs((t-i)/t)<1e-14)&&n.d%2==1)return(n.n%2==0?1:-1)*Math.pow(-e,t)}catch(e){}return r.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:(0,a.isInteger)(t)||e>=0||r.predictable?(0,o.powNumber)(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new f(e,0).pow(t,0)}function h(e,t){if(!(0,a.isInteger)(t)||t<0)throw new TypeError("For A^b, b must be a positive integer (value is "+t+")");var r=(0,i.arraySize)(e);if(2!==r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!==r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");for(var o=n(r[0]).valueOf(),l=e;t>=1;)1==(1&t)&&(o=s(l,o)),t>>=1,l=s(l,l);return o}function d(e,t){return l(h(e.valueOf(),t))}}));t.createPow=l},41300:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createRoundNumber=t.createRound=void 0;var a=n(r(44024)),i=r(58450),o=r(30401),s=r(49473),l=r(34623),c=r(68311),u=r(99826),f=r(18001);function p(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 h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){(0,a.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d="Number of decimals in function round must be an integer",m="round",g=["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],y=(0,i.factory)(m,g,(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,a=e.zeros,i=e.BigNumber,s=e.DenseMatrix,f=(0,l.createAlgorithm11)({typed:t,equalScalar:n}),p=(0,c.createAlgorithm12)({typed:t,DenseMatrix:s}),g=(0,u.createAlgorithm14)({typed:t});return t(m,h(h({},v),{},{Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(d);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(d);var r=t.toNumber();return e.round(r)},"number, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(d);return new i(e).toDecimalPlaces(t.toNumber())},BigNumber:function(e){return e.toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(d);return e.toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(d);return e.round(t)},"Array | Matrix":function(e){return(0,o.deepMap)(e,this,!0)},"SparseMatrix, number | BigNumber":function(e,t){return f(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return g(e,t,this,!1)},"number | Complex | BigNumber, SparseMatrix":function(e,t){return n(e,0)?a(t.size(),t.storage()):p(t,e,this,!0)},"number | Complex | BigNumber, DenseMatrix":function(e,t){return n(e,0)?a(t.size(),t.storage()):g(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return g(r(e),t,this,!1).valueOf()},"number | Complex | BigNumber, Array":function(e,t){return g(r(t),e,this,!0).valueOf()}}))}));t.createRound=y;var v={number:f.roundNumber,"number, number":function(e,t){if(!(0,s.isInteger)(t))throw new TypeError(d);if(t<0||t>15)throw new Error("Number of decimals in function round must be in the range of 0-15");return(0,f.roundNumber)(e,t)}},b=(0,i.factory)(m,["typed"],(function(e){return(0,e.typed)(m,v)}));t.createRoundNumber=b},2814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSign=void 0;var n=r(58450),a=r(30401),i=r(18001),o="sign",s=["typed","BigNumber","Fraction","complex"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.BigNumber,n=e.complex,s=e.Fraction;return t(o,{number:i.signNumber,Complex:function(e){return 0===e.im?n((0,i.signNumber)(e.re)):e.sign()},BigNumber:function(e){return new r(e.cmp(0))},Fraction:function(e){return new s(e.s,1)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)},Unit:function(e){return this(e.value)}})}));t.createSign=l},88772:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSqrt=void 0;var n=r(58450),a=r(30401),i=["config","typed","Complex"],o=(0,n.factory)("sqrt",i,(function(e){var t=e.config,r=e.typed,n=e.Complex;return r("sqrt",{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():i(e.toNumber())},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:e>=0||t.predictable?Math.sqrt(e):new n(e,0).sqrt()}}));t.createSqrt=o},84627:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSquare=void 0;var n=r(58450),a=r(30401),i=r(18001),o="square",s=["typed"],l=(0,n.factory)(o,s,(function(e){return(0,e.typed)(o,{number:i.squareNumber,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},Fraction:function(e){return e.mul(e)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)},Unit:function(e){return e.pow(2)}})}));t.createSquare=l},28697:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSubtract=void 0;var n=r(58450),a=r(12906),i=r(40154),o=r(72177),s=r(6272),l=r(39032),c=r(46752),u=r(99826),f="subtract",p=["typed","matrix","equalScalar","addScalar","unaryMinus","DenseMatrix"],h=(0,n.factory)(f,p,(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,a=e.addScalar,p=e.unaryMinus,h=e.DenseMatrix,m=(0,i.createAlgorithm01)({typed:t}),g=(0,o.createAlgorithm03)({typed:t}),y=(0,s.createAlgorithm05)({typed:t,equalScalar:n}),v=(0,l.createAlgorithm10)({typed:t,DenseMatrix:h}),b=(0,c.createAlgorithm13)({typed:t}),x=(0,u.createAlgorithm14)({typed:t});return t(f,{"number, number":function(e,t){return e-t},"Complex, Complex":function(e,t){return e.sub(t)},"BigNumber, BigNumber":function(e,t){return e.minus(t)},"Fraction, Fraction":function(e,t){return e.sub(t)},"Unit, Unit":function(e,t){if(null===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===t.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(t))throw new Error("Units do not match");var r=e.clone();return r.value=this(r.value,t.value),r.fixPrefix=!1,r},"SparseMatrix, SparseMatrix":function(e,t){return d(e,t),y(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return d(e,t),g(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return d(e,t),m(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return d(e,t),b(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return v(e,p(t),a)},"DenseMatrix, any":function(e,t){return x(e,t,this)},"any, SparseMatrix":function(e,t){return v(t,e,this,!0)},"any, DenseMatrix":function(e,t){return x(t,e,this,!0)},"Array, any":function(e,t){return x(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return x(r(t),e,this,!0).valueOf()}})}));function d(e,t){var r=e.size(),n=t.size();if(r.length!==n.length)throw new a.DimensionError(r.length,n.length)}t.createSubtract=h},87611:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnaryMinus=void 0;var n=r(58450),a=r(30401),i=r(18001),o="unaryMinus",s=["typed"],l=(0,n.factory)(o,s,(function(e){return(0,e.typed)(o,{number:i.unaryMinusNumber,Complex:function(e){return e.neg()},BigNumber:function(e){return e.neg()},Fraction:function(e){return e.neg()},Unit:function(e){var t=e.clone();return t.value=this(e.value),t},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)}})}));t.createUnaryMinus=l},94994:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnaryPlus=void 0;var n=r(58450),a=r(30401),i=r(18001),o="unaryPlus",s=["typed","config","BigNumber"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.config,n=e.BigNumber;return t(o,{number:i.unaryPlusNumber,Complex:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)},"boolean | string":function(e){return"BigNumber"===r.number?new n(+e):+e}})}));t.createUnaryPlus=l},73717:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createXgcd=void 0;var n=r(58450),a=r(18001),i="xgcd",o=["typed","config","matrix","BigNumber"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.config,n=e.matrix,o=e.BigNumber;return t(i,{"number, number":function(e,t){var i=(0,a.xgcdNumber)(e,t);return"Array"===r.matrix?i:n(i)},"BigNumber, BigNumber":function(e,t){var a,i,s,l,c=new o(0),u=new o(1),f=c,p=u,h=u,d=c;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)i=e.div(t).floor(),s=e.mod(t),a=f,f=p.minus(i.times(f)),p=a,a=h,h=d.minus(i.times(h)),d=a,e=t,t=s;return l=e.lt(c)?[e.neg(),p.neg(),d.neg()]:[e,e.isZero()?0:p,d],"Array"===r.matrix?l:n(l)}})}));t.createXgcd=s},25345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBitAnd=void 0;var n=r(90226),a=r(343),i=r(34623),o=r(46752),s=r(99826),l=r(99970),c=r(58450),u=r(18001),f="bitAnd",p=["typed","matrix","equalScalar"],h=(0,c.factory)(f,p,(function(e){var t=e.typed,r=e.matrix,c=e.equalScalar,p=(0,a.createAlgorithm02)({typed:t,equalScalar:c}),h=(0,l.createAlgorithm06)({typed:t,equalScalar:c}),d=(0,i.createAlgorithm11)({typed:t,equalScalar:c}),m=(0,o.createAlgorithm13)({typed:t}),g=(0,s.createAlgorithm14)({typed:t});return t(f,{"number, number":u.bitAndNumber,"BigNumber, BigNumber":n.bitAndBigNumber,"SparseMatrix, SparseMatrix":function(e,t){return h(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return p(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return p(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return m(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return d(e,t,this,!1)},"DenseMatrix, any":function(e,t){return g(e,t,this,!1)},"any, SparseMatrix":function(e,t){return d(t,e,this,!0)},"any, DenseMatrix":function(e,t){return g(t,e,this,!0)},"Array, any":function(e,t){return g(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return g(r(t),e,this,!0).valueOf()}})}));t.createBitAnd=h},63430:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBitNot=void 0;var n=r(90226),a=r(30401),i=r(58450),o=r(18001),s="bitNot",l=["typed"],c=(0,i.factory)(s,l,(function(e){return(0,e.typed)(s,{number:o.bitNotNumber,BigNumber:n.bitNotBigNumber,"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createBitNot=c},29563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBitOr=void 0;var n=r(90226),a=r(58450),i=r(99826),o=r(46752),s=r(39032),l=r(51691),c=r(40154),u=r(18001),f="bitOr",p=["typed","matrix","equalScalar","DenseMatrix"],h=(0,a.factory)(f,p,(function(e){var t=e.typed,r=e.matrix,a=e.equalScalar,p=e.DenseMatrix,h=(0,c.createAlgorithm01)({typed:t}),d=(0,l.createAlgorithm04)({typed:t,equalScalar:a}),m=(0,s.createAlgorithm10)({typed:t,DenseMatrix:p}),g=(0,o.createAlgorithm13)({typed:t}),y=(0,i.createAlgorithm14)({typed:t});return t(f,{"number, number":u.bitOrNumber,"BigNumber, BigNumber":n.bitOrBigNumber,"SparseMatrix, SparseMatrix":function(e,t){return d(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return h(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return h(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return g(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return m(e,t,this,!1)},"DenseMatrix, any":function(e,t){return y(e,t,this,!1)},"any, SparseMatrix":function(e,t){return m(t,e,this,!0)},"any, DenseMatrix":function(e,t){return y(t,e,this,!0)},"Array, any":function(e,t){return y(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return y(r(t),e,this,!0).valueOf()}})}));t.createBitOr=h},78893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBitXor=void 0;var n=r(90226),a=r(72177),i=r(24692),o=r(68311),s=r(46752),l=r(99826),c=r(58450),u=r(18001),f="bitXor",p=["typed","matrix","DenseMatrix"],h=(0,c.factory)(f,p,(function(e){var t=e.typed,r=e.matrix,c=e.DenseMatrix,p=(0,a.createAlgorithm03)({typed:t}),h=(0,i.createAlgorithm07)({typed:t,DenseMatrix:c}),d=(0,o.createAlgorithm12)({typed:t,DenseMatrix:c}),m=(0,s.createAlgorithm13)({typed:t}),g=(0,l.createAlgorithm14)({typed:t});return t(f,{"number, number":u.bitXorNumber,"BigNumber, BigNumber":n.bitXor,"SparseMatrix, SparseMatrix":function(e,t){return h(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return p(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return p(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return m(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return d(e,t,this,!1)},"DenseMatrix, any":function(e,t){return g(e,t,this,!1)},"any, SparseMatrix":function(e,t){return d(t,e,this,!0)},"any, DenseMatrix":function(e,t){return g(t,e,this,!0)},"Array, any":function(e,t){return g(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return g(r(t),e,this,!0).valueOf()}})}));t.createBitXor=h},43707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLeftShift=void 0;var n=r(343),a=r(34623),i=r(46752),o=r(99826),s=r(40154),l=r(39032),c=r(38128),u=r(58450),f=r(18001),p=r(90226),h="leftShift",d=["typed","matrix","equalScalar","zeros","DenseMatrix"],m=(0,u.factory)(h,d,(function(e){var t=e.typed,r=e.matrix,u=e.equalScalar,d=e.zeros,m=e.DenseMatrix,g=(0,s.createAlgorithm01)({typed:t}),y=(0,n.createAlgorithm02)({typed:t,equalScalar:u}),v=(0,c.createAlgorithm08)({typed:t,equalScalar:u}),b=(0,l.createAlgorithm10)({typed:t,DenseMatrix:m}),x=(0,a.createAlgorithm11)({typed:t,equalScalar:u}),_=(0,i.createAlgorithm13)({typed:t}),w=(0,o.createAlgorithm14)({typed:t});return t(h,{"number, number":f.leftShiftNumber,"BigNumber, BigNumber":p.leftShiftBigNumber,"SparseMatrix, SparseMatrix":function(e,t){return v(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return y(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return g(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return _(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return u(t,0)?e.clone():x(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return u(t,0)?e.clone():w(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return u(e,0)?d(t.size(),t.storage()):b(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return u(e,0)?d(t.size(),t.storage()):w(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(r(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,r(t)).valueOf()}})}));t.createLeftShift=m},89796:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRightArithShift=void 0;var n=r(90226),a=r(343),i=r(34623),o=r(46752),s=r(99826),l=r(40154),c=r(39032),u=r(38128),f=r(58450),p=r(18001),h="rightArithShift",d=["typed","matrix","equalScalar","zeros","DenseMatrix"],m=(0,f.factory)(h,d,(function(e){var t=e.typed,r=e.matrix,f=e.equalScalar,d=e.zeros,m=e.DenseMatrix,g=(0,l.createAlgorithm01)({typed:t}),y=(0,a.createAlgorithm02)({typed:t,equalScalar:f}),v=(0,u.createAlgorithm08)({typed:t,equalScalar:f}),b=(0,c.createAlgorithm10)({typed:t,DenseMatrix:m}),x=(0,i.createAlgorithm11)({typed:t,equalScalar:f}),_=(0,o.createAlgorithm13)({typed:t}),w=(0,s.createAlgorithm14)({typed:t});return t(h,{"number, number":p.rightArithShiftNumber,"BigNumber, BigNumber":n.rightArithShiftBigNumber,"SparseMatrix, SparseMatrix":function(e,t){return v(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return y(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return g(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return _(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return f(t,0)?e.clone():x(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return f(t,0)?e.clone():w(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return f(e,0)?d(t.size(),t.storage()):b(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return f(e,0)?d(t.size(),t.storage()):w(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(r(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,r(t)).valueOf()}})}));t.createRightArithShift=m},40550:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRightLogShift=void 0;var n=r(343),a=r(34623),i=r(46752),o=r(99826),s=r(40154),l=r(39032),c=r(38128),u=r(58450),f=r(18001),p="rightLogShift",h=["typed","matrix","equalScalar","zeros","DenseMatrix"],d=(0,u.factory)(p,h,(function(e){var t=e.typed,r=e.matrix,u=e.equalScalar,h=e.zeros,d=e.DenseMatrix,m=(0,s.createAlgorithm01)({typed:t}),g=(0,n.createAlgorithm02)({typed:t,equalScalar:u}),y=(0,c.createAlgorithm08)({typed:t,equalScalar:u}),v=(0,l.createAlgorithm10)({typed:t,DenseMatrix:d}),b=(0,a.createAlgorithm11)({typed:t,equalScalar:u}),x=(0,i.createAlgorithm13)({typed:t}),_=(0,o.createAlgorithm14)({typed:t});return t(p,{"number, number":f.rightLogShiftNumber,"SparseMatrix, SparseMatrix":function(e,t){return y(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return g(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return m(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return x(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return u(t,0)?e.clone():b(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return u(t,0)?e.clone():_(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return u(e,0)?h(t.size(),t.storage()):v(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return u(e,0)?h(t.size(),t.storage()):_(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(r(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,r(t)).valueOf()}})}));t.createRightLogShift=d},66042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBellNumbers=void 0;var n=r(58450),a="bellNumbers",i=["typed","addScalar","isNegative","isInteger","stirlingS2"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.addScalar,n=e.isNegative,i=e.isInteger,o=e.stirlingS2;return t(a,{"number | BigNumber":function(e){if(!i(e)||n(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var t=0,a=0;a<=e;a++)t=r(t,o(e,a));return t}})}));t.createBellNumbers=o},60666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCatalan=void 0;var n=r(58450),a="catalan",i=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.addScalar,n=e.divideScalar,i=e.multiplyScalar,o=e.combinations,s=e.isNegative,l=e.isInteger;return t(a,{"number | BigNumber":function(e){if(!l(e)||s(e))throw new TypeError("Non-negative integer value expected in function catalan");return n(o(i(e,2),e),r(e,1))}})}));t.createCatalan=o},7789:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createComposition=void 0;var n=r(58450),a="composition",i=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.addScalar,n=e.combinations,i=e.isPositive,o=(e.isNegative,e.isInteger),s=e.larger;return t(a,{"number | BigNumber, number | BigNumber":function(e,t){if(!(o(e)&&i(e)&&o(t)&&i(t)))throw new TypeError("Positive integer value expected in function composition");if(s(t,e))throw new TypeError("k must be less than or equal to n in function composition");return n(r(e,-1),r(t,-1))}})}));t.createComposition=o},43279:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createStirlingS2=void 0;var n=r(58450),a="stirlingS2",i=["typed","addScalar","subtract","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","larger"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.addScalar,n=e.subtract,i=e.multiplyScalar,o=e.divideScalar,s=e.pow,l=e.factorial,c=e.combinations,u=e.isNegative,f=e.isInteger,p=e.larger;return t(a,{"number | BigNumber, number | BigNumber":function(e,t){if(!f(e)||u(e)||!f(t)||u(t))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(p(t,e))throw new TypeError("k must be less than or equal to n in function stirlingS2");for(var a=l(t),h=0,d=0;d<=t;d++){var m=s(-1,n(t,d)),g=c(t,d),y=s(d,e);h=r(h,i(i(g,y),m))}return o(h,a)}})}));t.createStirlingS2=o},52012:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createArg=void 0;var n=r(58450),a=r(30401),i=["typed"],o=(0,n.factory)("arg",i,(function(e){return(0,e.typed)("arg",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return e.constructor.atan2(0,e)},Complex:function(e){return e.arg()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createArg=o},14161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConj=void 0;var n=r(58450),a=r(30401),i="conj",o=["typed"],s=(0,n.factory)(i,o,(function(e){return(0,e.typed)(i,{number:function(e){return e},BigNumber:function(e){return e},Complex:function(e){return e.conjugate()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createConj=s},89584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIm=void 0;var n=r(58450),a=r(30401),i=["typed"],o=(0,n.factory)("im",i,(function(e){return(0,e.typed)("im",{number:function(e){return 0},BigNumber:function(e){return e.mul(0)},Fraction:function(e){return e.mul(0)},Complex:function(e){return e.im},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createIm=o},93246:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRe=void 0;var n=r(58450),a=r(30401),i=["typed"],o=(0,n.factory)("re",i,(function(e){return(0,e.typed)("re",{number:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Complex:function(e){return e.re},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createRe=o},7632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDistance=void 0;var n=r(57237),a=r(58450),i="distance",o=["typed","addScalar","subtract","divideScalar","multiplyScalar","unaryMinus","sqrt","abs"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.addScalar,a=e.subtract,o=e.multiplyScalar,s=e.divideScalar,l=e.unaryMinus,c=e.sqrt,u=e.abs;return t(i,{"Array, Array, Array":function(e,t,r){if(2===e.length&&2===t.length&&2===r.length){if(!p(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!p(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");var n=s(a(r[1],r[0]),a(t[1],t[0])),i=o(o(n,n),t[0]),c=l(o(n,t[0])),u=e[1];return y(e[0],e[1],i,c,u)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,r){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(r).length){if(!p(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!p(r))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in r&&"lineTwoPtY"in r){var n=s(a(r.lineTwoPtY,r.lineTwoPtX),a(t.lineOnePtY,t.lineOnePtX)),i=o(o(n,n),t.lineOnePtX),c=l(o(n,t.lineOnePtX)),u=e.pointX;return y(e.pointX,e.pointY,i,c,u)}throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!p(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!h(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!h(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!m(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return v(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5])}if(e.length===t.length&&e.length>0){if(!d(e))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!d(t))throw new TypeError("All values of an array should be numbers or BigNumbers");return b(e,t)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!p(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!h(t))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"xCoeffLine"in t&&"yCoeffLine"in t&&"constant"in t)return y(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!h(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!m(t))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"x0"in t&&"y0"in t&&"z0"in t&&"a"in t&&"b"in t&&"c"in t)return v(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!p(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!p(t))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointTwoX"in t&&"pointTwoY"in t)return b([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&3===Object.keys(t).length){if(!h(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!h(t))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointOneZ"in e&&"pointTwoX"in t&&"pointTwoY"in t&&"pointTwoZ"in t)return b([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},Array:function(e){if(!function(e){if(2===e[0].length&&f(e[0][0])&&f(e[0][1])){if(e.some((function(e){return 2!==e.length||!f(e[0])||!f(e[1])})))return!1}else{if(!(3===e[0].length&&f(e[0][0])&&f(e[0][1])&&f(e[0][2])))return!1;if(e.some((function(e){return 3!==e.length||!f(e[0])||!f(e[1])||!f(e[2])})))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var t=[],r=[],n=[],a=0;a<e.length-1;a++)for(var i=a+1;i<e.length;i++)2===e[0].length?(r=[e[a][0],e[a][1]],n=[e[i][0],e[i][1]]):3===e[0].length&&(r=[e[a][0],e[a][1],e[a][2]],n=[e[i][0],e[i][1],e[i][2]]),t.push(b(r,n));return t}(e)}});function f(e){return"number"==typeof e||(0,n.isBigNumber)(e)}function p(e){return e.constructor!==Array&&(e=g(e)),f(e[0])&&f(e[1])}function h(e){return e.constructor!==Array&&(e=g(e)),f(e[0])&&f(e[1])&&f(e[2])}function d(e){return Array.isArray(e)||(e=g(e)),e.every(f)}function m(e){return e.constructor!==Array&&(e=g(e)),f(e[0])&&f(e[1])&&f(e[2])&&f(e[3])&&f(e[4])&&f(e[5])}function g(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;n++)r.push(e[t[n]]);return r}function y(e,t,n,a,i){var l=u(r(r(o(n,e),o(a,t)),i)),f=c(r(o(n,n),o(a,a)));return s(l,f)}function v(e,t,n,i,l,u,f,p,h){var d=[a(o(a(l,t),h),o(a(u,n),p)),a(o(a(u,n),f),o(a(i,e),h)),a(o(a(i,e),p),o(a(l,t),f))];d=c(r(r(o(d[0],d[0]),o(d[1],d[1])),o(d[2],d[2])));var m=c(r(r(o(f,f),o(p,p)),o(h,h)));return s(d,m)}function b(e,t){for(var n=e.length,i=0,s=0,l=0;l<n;l++)s=a(e[l],t[l]),i=r(o(s,s),i);return c(i)}}));t.createDistance=s},99449:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIntersect=void 0;var n=r(57237),a=["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten"],i=(0,r(58450).factory)("intersect",a,(function(e){var t=e.typed,r=e.config,a=e.abs,i=e.add,o=e.addScalar,s=e.matrix,l=e.multiply,c=e.multiplyScalar,u=e.divideScalar,f=e.subtract,p=e.smaller,h=e.equalScalar,d=e.flatten;return t("intersect",{"Array, Array, Array":m,"Array, Array, Array, Array":g,"Matrix, Matrix, Matrix":function(e,t,r){var n=m(e.valueOf(),t.valueOf(),r.valueOf());return null===n?null:s(n)},"Matrix, Matrix, Matrix, Matrix":function(e,t,r,n){var a=g(e.valueOf(),t.valueOf(),r.valueOf(),n.valueOf());return null===a?null:s(a)}});function m(e,t,r){if(e=y(e),t=y(t),r=y(r),!x(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!x(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(e){return 4===e.length&&v(e[0])&&v(e[1])&&v(e[2])&&v(e[3])}(r))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,r,n,a,i,s,l,p,h){var d=c(e,s),m=c(n,s),g=c(t,l),y=c(a,l),v=c(r,p),b=c(i,p),x=f(f(f(h,d),g),v),_=f(f(f(o(o(m,y),b),d),g),v),w=u(x,_);return[o(e,c(w,f(n,e))),o(t,c(w,f(a,t))),o(r,c(w,f(i,r)))]}(e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],r[3])}function g(e,t,n,s){if(e=y(e),t=y(t),n=y(n),s=y(s),2===e.length){if(!b(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(n))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(s))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,n,s){var h=e,d=n,m=f(h,t),g=f(d,s),y=f(c(m[0],g[1]),c(g[0],m[1]));if(p(a(y),r.epsilon))return null;var v=c(g[0],h[1]),b=c(g[1],h[0]),x=c(g[0],d[1]),_=c(g[1],d[0]),w=u(o(f(f(v,b),x),_),y);return i(l(m,w),h)}(e,t,n,s)}if(3===e.length){if(!x(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!x(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!x(n))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!x(s))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return d=e[0],m=e[1],g=e[2],v=t[0],w=t[1],k=t[2],D=n[0],T=n[1],A=n[2],C=_(d,D,S=s[0],D,m,T,M=s[1],T,g,A,E=s[2],A),N=_(S,D,v,d,M,T,w,m,E,A,k,g),O=_(d,D,v,d,m,T,w,m,g,A,k,g),I=_(S,D,S,D,M,T,M,T,E,A,E,A),P=_(v,d,v,d,w,m,w,m,k,g,k,g),R=u(f(c(C,N),c(O,I)),f(c(P,I),c(N,N))),L=u(o(C,c(R,N)),I),F=o(d,c(R,f(v,d))),B=o(m,c(R,f(w,m))),z=o(g,c(R,f(k,g))),j=o(D,c(L,f(S,D))),U=o(T,c(L,f(M,T))),$=o(A,c(L,f(E,A))),h(F,j)&&h(B,U)&&h(z,$)?[F,B,z]:null}throw new TypeError("Arrays with two or thee dimensional points expected");var d,m,g,v,w,k,D,T,A,S,M,E,C,N,O,I,P,R,L,F,B,z,j,U,$}function y(e){return 1===e.length?e[0]:e.length>1&&Array.isArray(e[0])&&e.every((function(e){return Array.isArray(e)&&1===e.length}))?d(e):e}function v(e){return"number"==typeof e||(0,n.isBigNumber)(e)}function b(e){return 2===e.length&&v(e[0])&&v(e[1])}function x(e){return 3===e.length&&v(e[0])&&v(e[1])&&v(e[2])}function _(e,t,r,n,a,i,s,l,u,p,h,d){var m=c(f(e,t),f(r,n)),g=c(f(a,i),f(s,l)),y=c(f(u,p),f(h,d));return o(o(m,g),y)}}));t.createIntersect=i},87226:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAnd=void 0;var n=r(343),a=r(34623),i=r(46752),o=r(99826),s=r(99970),l=r(58450),c=r(18001),u=["typed","matrix","equalScalar","zeros","not"],f=(0,l.factory)("and",u,(function(e){var t=e.typed,r=e.matrix,l=e.equalScalar,u=e.zeros,f=e.not,p=(0,n.createAlgorithm02)({typed:t,equalScalar:l}),h=(0,s.createAlgorithm06)({typed:t,equalScalar:l}),d=(0,a.createAlgorithm11)({typed:t,equalScalar:l}),m=(0,i.createAlgorithm13)({typed:t}),g=(0,o.createAlgorithm14)({typed:t});return t("and",{"number, number":c.andNumber,"Complex, Complex":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},"BigNumber, BigNumber":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},"Unit, Unit":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return h(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return p(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return p(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return m(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return f(t)?u(e.size(),e.storage()):d(e,t,this,!1)},"DenseMatrix, any":function(e,t){return f(t)?u(e.size(),e.storage()):g(e,t,this,!1)},"any, SparseMatrix":function(e,t){return f(e)?u(e.size(),e.storage()):d(t,e,this,!0)},"any, DenseMatrix":function(e,t){return f(e)?u(e.size(),e.storage()):g(t,e,this,!0)},"Array, any":function(e,t){return this(r(e),t).valueOf()},"any, Array":function(e,t){return this(e,r(t)).valueOf()}})}));t.createAnd=f},44505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNot=void 0;var n=r(30401),a=r(58450),i=r(18001),o=["typed"],s=(0,a.factory)("not",o,(function(e){return(0,e.typed)("not",{number:i.notNumber,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},Unit:function(e){return null===e.value||this(e.value)},"Array | Matrix":function(e){return(0,n.deepMap)(e,this)}})}));t.createNot=s},93763:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOr=void 0;var n=r(72177),a=r(68311),i=r(46752),o=r(99826),s=r(6272),l=r(58450),c=r(18001),u=["typed","matrix","equalScalar","DenseMatrix"],f=(0,l.factory)("or",u,(function(e){var t=e.typed,r=e.matrix,l=e.equalScalar,u=e.DenseMatrix,f=(0,n.createAlgorithm03)({typed:t}),p=(0,s.createAlgorithm05)({typed:t,equalScalar:l}),h=(0,a.createAlgorithm12)({typed:t,DenseMatrix:u}),d=(0,i.createAlgorithm13)({typed:t}),m=(0,o.createAlgorithm14)({typed:t});return t("or",{"number, number":c.orNumber,"Complex, Complex":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"Unit, Unit":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return p(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return f(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return f(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return d(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return h(e,t,this,!1)},"DenseMatrix, any":function(e,t){return m(e,t,this,!1)},"any, SparseMatrix":function(e,t){return h(t,e,this,!0)},"any, DenseMatrix":function(e,t){return m(t,e,this,!0)},"Array, any":function(e,t){return m(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return m(r(t),e,this,!0).valueOf()}})}));t.createOr=f},17513:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createXor=void 0;var n=r(72177),a=r(24692),i=r(68311),o=r(46752),s=r(99826),l=r(58450),c=r(18001),u=["typed","matrix","DenseMatrix"],f=(0,l.factory)("xor",u,(function(e){var t=e.typed,r=e.matrix,l=e.DenseMatrix,u=(0,n.createAlgorithm03)({typed:t}),f=(0,a.createAlgorithm07)({typed:t,DenseMatrix:l}),p=(0,i.createAlgorithm12)({typed:t,DenseMatrix:l}),h=(0,o.createAlgorithm13)({typed:t}),d=(0,s.createAlgorithm14)({typed:t});return t("xor",{"number, number":c.xorNumber,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return f(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return u(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return h(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return p(e,t,this,!1)},"DenseMatrix, any":function(e,t){return d(e,t,this,!1)},"any, SparseMatrix":function(e,t){return p(t,e,this,!0)},"any, DenseMatrix":function(e,t){return d(t,e,this,!0)},"Array, any":function(e,t){return d(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return d(r(t),e,this,!0).valueOf()}})}));t.createXor=f},91794:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createApply=void 0;var n=r(58450),a=r(70517),i=r(57237),o=r(14452),s="apply",l=["typed","isInteger"],c=(0,n.factory)(s,l,(function(e){var t=e.typed,r=e.isInteger;return t(s,{"Array | Matrix, number | BigNumber, function":function(e,t,n){if(!r(t))throw new TypeError("Integer number expected for dimension");var s=Array.isArray(e)?(0,a.arraySize)(e):e.size();if(t<0||t>=s.length)throw new o.IndexError(t,s.length);return(0,i.isMatrix)(e)?e.create(u(e.valueOf(),t,n)):u(e,t,n)}})}));function u(e,t,r){var n,a,i;if(t<=0){if(Array.isArray(e[0])){for(i=function(e){var t,r,n=e.length,a=e[0].length,i=[];for(r=0;r<a;r++){var o=[];for(t=0;t<n;t++)o.push(e[t][r]);i.push(o)}return i}(e),a=[],n=0;n<i.length;n++)a[n]=u(i[n],t-1,r);return a}return r(e)}for(a=[],n=0;n<e.length;n++)a[n]=u(e[n],t-1,r);return a}t.createApply=c},25120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createColumn=void 0;var n=r(58450),a=r(54699),i=r(70517),o="column",s=["typed","Index","matrix","range"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.Index,n=e.matrix,s=e.range;return t(o,{"Matrix, number":l,"Array, number":function(e,t){return l(n((0,a.clone)(e)),t).valueOf()}});function l(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");(0,i.validateIndex)(t,e.size()[1]);var n=s(0,e.size()[0]),a=new r(n,t);return e.subset(a)}}));t.createColumn=l},46545:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConcat=void 0;var n=r(57237),a=r(54699),i=r(70517),o=r(14452),s=r(12906),l=r(58450),c="concat",u=["typed","matrix","isInteger"],f=(0,l.factory)(c,u,(function(e){var t=e.typed,r=e.matrix,l=e.isInteger;return t(c,{"...Array | Matrix | number | BigNumber":function(e){var t,c,u=e.length,f=-1,h=!1,d=[];for(t=0;t<u;t++){var m=e[t];if((0,n.isMatrix)(m)&&(h=!0),(0,n.isNumber)(m)||(0,n.isBigNumber)(m)){if(t!==u-1)throw new Error("Dimension must be specified as last argument");if(c=f,f=m.valueOf(),!l(f))throw new TypeError("Integer number expected for dimension");if(f<0||t>0&&f>c)throw new o.IndexError(f,c+1)}else{var g=(0,a.clone)(m).valueOf(),y=(0,i.arraySize)(g);if(d[t]=g,c=f,f=y.length-1,t>0&&f!==c)throw new s.DimensionError(c+1,f+1)}}if(0===d.length)throw new SyntaxError("At least one matrix expected");for(var v=d.shift();d.length;)v=p(v,d.shift(),f,0);return h?r(v):v},"...string":function(e){return e.join("")}})}));function p(e,t,r,n){if(n<r){if(e.length!==t.length)throw new s.DimensionError(e.length,t.length);for(var a=[],i=0;i<e.length;i++)a[i]=p(e[i],t[i],r,n+1);return a}return e.concat(t)}t.createConcat=f},88558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCount=void 0;var n=r(58450),a="count",i=["typed","size","prod"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.size,n=e.prod;return t(a,{string:function(e){return e.length},"Matrix | Array":function(e){return n(r(e))}})}));t.createCount=o},22490:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCross=void 0;var n=r(70517),a=r(58450),i="cross",o=["typed","matrix","subtract","multiply"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.matrix,a=e.subtract,o=e.multiply;return t(i,{"Matrix, Matrix":function(e,t){return r(s(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(s(e.toArray(),t))},"Array, Matrix":function(e,t){return r(s(e,t.toArray()))},"Array, Array":s});function s(e,t){var r=Math.max((0,n.arraySize)(e).length,(0,n.arraySize)(t).length);e=(0,n.squeeze)(e),t=(0,n.squeeze)(t);var i=(0,n.arraySize)(e),s=(0,n.arraySize)(t);if(1!==i.length||1!==s.length||3!==i[0]||3!==s[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+i.join(", ")+"], B = ["+s.join(", ")+"])");var l=[a(o(e[1],t[2]),o(e[2],t[1])),a(o(e[2],t[0]),o(e[0],t[2])),a(o(e[0],t[1]),o(e[1],t[0]))];return r>1?[l]:l}}));t.createCross=s},70185:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCtranspose=void 0;var n=r(58450),a="ctranspose",i=["typed","transpose","conj"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.transpose,n=e.conj;return t(a,{any:function(e){return n(r(e))}})}));t.createCtranspose=o},98686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDet=void 0;var n=r(57237),a=r(54699),i=r(59398),o=["typed","matrix","subtract","multiply","unaryMinus","lup"],s=(0,r(58450).factory)("det",o,(function(e){var t=e.typed,r=e.matrix,o=e.subtract,s=e.multiply,l=e.unaryMinus,c=e.lup;return t("det",{any:function(e){return(0,a.clone)(e)},"Array | Matrix":function(e){var t;switch((t=(0,n.isMatrix)(e)?e.size():Array.isArray(e)?(e=r(e)).size():[]).length){case 0:return(0,a.clone)(e);case 1:if(1===t[0])return(0,a.clone)(e.valueOf()[0]);throw new RangeError("Matrix must be square (size: "+(0,i.format)(t)+")");case 2:var u=t[0];if(u===t[1])return function(e,t,r){if(1===t)return(0,a.clone)(e[0][0]);if(2===t)return o(s(e[0][0],e[1][1]),s(e[1][0],e[0][1]));for(var n=c(e),i=n.U[0][0],u=1;u<t;u++)i=s(i,n.U[u][u]);for(var f=0,p=0,h=[];;){for(;h[p];)p++;if(p>=t)break;for(var d=p,m=0;!h[n.p[d]];)h[n.p[d]]=!0,d=n.p[d],m++;m%2==0&&f++}return f%2==0?i:l(i)}(e.clone().valueOf(),u);throw new RangeError("Matrix must be square (size: "+(0,i.format)(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+(0,i.format)(t)+")")}}})}));t.createDet=s},26004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDiag=void 0;var n=r(57237),a=r(70517),i=r(49473),o=r(58450),s="diag",l=["typed","matrix","DenseMatrix","SparseMatrix"],c=(0,o.factory)(s,l,(function(e){var t=e.typed,r=e.matrix,o=e.DenseMatrix,l=e.SparseMatrix;return t(s,{Array:function(e){return c(e,0,(0,a.arraySize)(e),null)},"Array, number":function(e,t){return c(e,t,(0,a.arraySize)(e),null)},"Array, BigNumber":function(e,t){return c(e,t.toNumber(),(0,a.arraySize)(e),null)},"Array, string":function(e,t){return c(e,0,(0,a.arraySize)(e),t)},"Array, number, string":function(e,t,r){return c(e,t,(0,a.arraySize)(e),r)},"Array, BigNumber, string":function(e,t,r){return c(e,t.toNumber(),(0,a.arraySize)(e),r)},Matrix:function(e){return c(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return c(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return c(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return c(e,0,e.size(),t)},"Matrix, number, string":function(e,t,r){return c(e,t,e.size(),r)},"Matrix, BigNumber, string":function(e,t,r){return c(e,t.toNumber(),e.size(),r)}});function c(e,t,a,s){if(!(0,i.isInteger)(t))throw new TypeError("Second parameter in function diag must be an integer");var c=t>0?t:0,u=t<0?-t:0;switch(a.length){case 1:return function(e,t,r,n,a,i){var s=[n+a,n+i];if(r&&"sparse"!==r&&"dense"!==r)throw new TypeError("Unknown matrix type ".concat(r,'"'));var c="sparse"===r?l.diagonal(s,e,t):o.diagonal(s,e,t);return null!==r?c:c.valueOf()}(e,t,s,a[0],u,c);case 2:return function(e,t,a,i,o,s){if((0,n.isMatrix)(e)){var l=e.diagonal(t);return null!==a?a!==l.storage()?r(l,a):l:l.valueOf()}for(var c=Math.min(i[0]-o,i[1]-s),u=[],f=0;f<c;f++)u[f]=e[f+o][f+s];return null!==a?r(u):u}(e,t,s,a,u,c)}throw new RangeError("Matrix for function diag must be 2 dimensional")}}));t.createDiag=c},27598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDiff=void 0;var n=r(58450),a=r(49473),i=r(57237),o="diff",s=["typed","matrix","subtract","number"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.matrix,n=e.subtract,s=e.number;return t(o,{"Array | Matrix":function(e){return(0,i.isMatrix)(e)?r(c(e.toArray())):c(e)},"Array | Matrix, number":function(e,t){if(!(0,a.isInteger)(t))throw new RangeError("Dimension must be a whole number");return(0,i.isMatrix)(e)?r(l(e.toArray(),t)):l(e,t)},"Array | Matrix, BigNumber":function(e,t){return this(e,s(t))}});function l(e,t){if((0,i.isMatrix)(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");if(t>0){var r=[];return e.forEach((function(e){r.push(l(e,t-1))})),r}if(0===t)return c(e);throw RangeError("Cannot have negative dimension")}function c(e){var t=[],r=e.length;if(r<2)return e;for(var n=1;n<r;n++)t.push(u(e[n-1],e[n]));return t}function u(e,t){(0,i.isMatrix)(e)&&(e=e.toArray()),(0,i.isMatrix)(t)&&(t=t.toArray());var r=Array.isArray(e),a=Array.isArray(t);if(r&&a)return function(e,t){if(e.length!==t.length)throw RangeError("Not all sub-arrays have the same length");for(var r=[],n=e.length,a=0;a<n;a++)r.push(u(e[a],t[a]));return r}(e,t);if(!r&&!a)return n(t,e);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}}));t.createDiff=l},10815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDot=void 0;var n=r(58450),a=r(57237),i=["typed","addScalar","multiplyScalar","conj","size"],o=(0,n.factory)("dot",i,(function(e){var t=e.typed,r=e.addScalar,n=e.multiplyScalar,i=e.conj,o=e.size;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,o){var c=s(e,o),u=(0,a.isMatrix)(e)?e._data:e,f=(0,a.isMatrix)(e)?e._datatype:void 0,p=(0,a.isMatrix)(o)?o._data:o,h=(0,a.isMatrix)(o)?o._datatype:void 0,d=2===l(e).length,m=2===l(o).length,g=r,y=n;if(f&&h&&f===h&&"string"==typeof f){var v=f;g=t.find(r,[v,v]),y=t.find(n,[v,v])}if(!d&&!m){for(var b=y(i(u[0]),p[0]),x=1;x<c;x++)b=g(b,y(i(u[x]),p[x]));return b}if(!d&&m){for(var _=y(i(u[0]),p[0][0]),w=1;w<c;w++)_=g(_,y(i(u[w]),p[w][0]));return _}if(d&&!m){for(var k=y(i(u[0][0]),p[0]),D=1;D<c;D++)k=g(k,y(i(u[D][0]),p[D]));return k}if(d&&m){for(var T=y(i(u[0][0]),p[0][0]),A=1;A<c;A++)T=g(T,y(i(u[A][0]),p[A][0]));return T}},"SparseMatrix, SparseMatrix":function(e,t){s(e,t);for(var a=e._index,i=e._values,o=t._index,l=t._values,c=0,u=r,f=n,p=0,h=0;p<a.length&&h<o.length;){var d=a[p],m=o[h];d<m?p++:d>m?h++:d===m&&(c=u(c,f(i[p],l[h])),p++,h++)}return c}});function s(e,t){var r,n,a=l(e),i=l(t);if(1===a.length)r=a[0];else{if(2!==a.length||1!==a[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+a.join(", ")+")");r=a[0]}if(1===i.length)n=i[0];else{if(2!==i.length||1!==i[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");n=i[0]}if(r!==n)throw new RangeError("Vectors must have equal length ("+r+" != "+n+")");if(0===r)throw new RangeError("Cannot calculate the dot product of empty vectors");return r}function l(e){return(0,a.isMatrix)(e)?e.size():o(e)}}));t.createDot=o},9923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEigs=void 0;var n=r(58450),a=r(59398),i=r(618),o=r(43037),s=r(57237),l=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],c=(0,n.factory)("eigs",l,(function(e){var t=e.config,r=e.typed,n=e.matrix,l=e.addScalar,c=e.subtract,u=e.equal,f=e.abs,p=e.atan,h=e.cos,d=e.sin,m=e.multiplyScalar,g=e.divideScalar,y=e.inv,v=e.bignumber,b=e.multiply,x=e.add,_=e.larger,w=e.column,k=e.flatten,D=e.number,T=e.complex,A=e.sqrt,S=e.diag,M=e.qr,E=e.usolve,C=e.usolveAll,N=e.im,O=e.re,I=e.smaller,P=e.matrixFromColumns,R=e.dot,L=(0,o.createRealSymmetric)({config:t,addScalar:l,subtract:c,column:w,flatten:k,equal:u,abs:f,atan:p,cos:h,sin:d,multiplyScalar:m,inv:y,bignumber:v,complex:T,multiply:b,add:x}),F=(0,i.createComplexEigs)({config:t,addScalar:l,subtract:c,multiply:b,multiplyScalar:m,flatten:k,divideScalar:g,sqrt:A,abs:f,bignumber:v,diag:S,qr:M,inv:y,usolve:E,usolveAll:C,equal:u,complex:T,larger:_,smaller:I,matrixFromColumns:P,dot:R});return r("eigs",{Array:function(e){return B(n(e))},"Array, number|BigNumber":function(e,t){return B(n(e),t)},Matrix:function(e){var t=B(e),r=t.values,a=t.vectors;return{values:n(r),vectors:n(a)}},"Matrix, number|BigNumber":function(e,t){var r=B(e,t),a=r.values,i=r.vectors;return{values:n(a),vectors:n(i)}}});function B(e,r){void 0===r&&(r=t.epsilon);var n=e.size();if(2!==n.length||n[0]!==n[1])throw new RangeError("Matrix must be square (size: "+(0,a.format)(n)+")");var i=e.toArray(),o=n[0];if(function(e,t,r){for(var n=0;n<t;n++)for(var a=0;a<t;a++)if(_(v(f(N(e[n][a]))),r))return!1;return!0}(i,o,r)&&(function(e,t){for(var r=0;r<t;r++)for(var n=0;n<t;n++)e[r][n]=O(e[r][n])}(i,o),function(e,t,r){for(var n=0;n<t;n++)for(var a=n;a<t;a++)if(_(v(f(c(e[n][a],e[a][n]))),r))return!1;return!0}(i,o,r))){var s=z(e,i,o);return L(i,o,r,s)}var l=z(e,i,o);return F(i,o,r,l)}function z(e,t,r){var n=e.datatype();if("number"===n||"BigNumber"===n||"Complex"===n)return n;for(var a=!1,i=!1,o=!1,l=0;l<r;l++)for(var c=0;c<r;c++){var u=t[l][c];if((0,s.isNumber)(u)||(0,s.isFraction)(u))a=!0;else if((0,s.isBigNumber)(u))i=!0;else{if(!(0,s.isComplex)(u))throw TypeError("Unsupported type in Matrix: "+(0,s.typeOf)(u));o=!0}}if(i&&o&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),o){for(var f=0;f<r;f++)for(var p=0;p<r;p++)t[f][p]=T(t[f][p]);return"Complex"}if(i){for(var h=0;h<r;h++)for(var d=0;d<r;d++)t[h][d]=v(t[h][d]);return"BigNumber"}if(a){for(var m=0;m<r;m++)for(var g=0;g<r;g++)t[m][g]=D(t[m][g]);return"number"}throw TypeError("Matrix contains unsupported types only.")}}));t.createEigs=c},618:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createComplexEigs=function(e){var t=e.addScalar,r=e.subtract,n=e.flatten,s=e.multiply,l=e.multiplyScalar,c=e.divideScalar,u=e.sqrt,f=e.abs,p=e.bignumber,h=e.diag,d=e.inv,m=e.qr,g=e.usolve,y=e.usolveAll,v=e.equal,b=e.complex,x=e.larger,_=e.smaller,w=e.matrixFromColumns,k=e.dot;function D(e,t,n,a,i,o,s,l){var c="BigNumber"===l,u="Complex"===l,h=c?p(0):u?b(0):0,d=c?p(1):u?b(1):1;if(_(f(n),s))return[[d,h],[h,d]];if(x(f(r(i,o)),s))return[[r(i,a),r(o,a)],[n,n]];var m=r(e,i),g=r(t,i),y=r(n,i),v=r(a,i);return _(f(g),s)?[[m,d],[y,h]]:[[g,h],[v,d]]}function T(e,t){for(var r=0;r<e.length;r++){var n;(n=e[r]).push.apply(n,(0,a.default)(Array(t-e[r].length).fill(0)))}for(var i=e.length;i<t;i++)e.push(Array(t).fill(0)),e[i][i]=1;return e}function A(e,t,r){for(var n=0;n<e.length;n++)if(r(e[n],t))return n;return-1}function S(e,t,r,n,a){for(var i,o="BigNumber"===a?p(1e3):1e3,s=0;i=M(t,r,a),i=g(e,i),!x(C(i),o);)if(++s>=5)return null;for(s=0;;){var l=g(e,i);if(_(C(E(i,[l])),n))break;if(++s>=10)return null;i=N(l)}return i}function M(e,t,r){var n="BigNumber"===r,a="Complex"===r,i=Array(e).fill(0).map((function(e){return 2*Math.random()-1}));return n&&(i=i.map((function(e){return p(e)}))),a&&(i=i.map((function(e){return b(e)}))),N(i=E(i,t),r)}function E(e,t){var n,a=o(t);try{for(a.s();!(n=a.n()).done;){var i=n.value;e=r(e,s(c(k(i,e),k(i,i)),i))}}catch(e){a.e(e)}finally{a.f()}return e}function C(e){return f(u(k(e,e)))}function N(e,t){var r="Complex"===t,n="BigNumber"===t?p(1):r?b(1):1;return s(c(n,C(e)),e)}return function(e,g,k,M,E){void 0===E&&(E=!0);var C=function(e,r,n,a,i){var o,s="BigNumber"===a,u="Complex"===a,d=s?p(0):u?b(0):0,m=s?p(1):u?b(1):1,g=s?p(10):2,y=l(g,g);i&&(o=Array(r).fill(m));for(var w=!1;!w;){w=!0;for(var k=0;k<r;k++){for(var D=d,T=d,A=0;A<r;A++)if(k!==A){var S=f(e[k][A]);D=t(D,S),T=t(T,S)}if(!v(D,0)&&!v(T,0)){for(var M=m,E=D,C=c(T,g),N=l(T,g);_(E,C);)E=l(E,y),M=l(M,g);for(;x(E,N);)E=c(E,y),M=c(M,g);if(_(c(t(E,T),M),l(t(D,T),.95))){w=!1;for(var O=c(1,M),I=0;I<r;I++)k!==I&&(e[k][I]=l(e[k][I],M),e[I][k]=l(e[I][k],O));i&&(o[k]=l(o[k],M))}}}}return h(o)}(e,g,0,M,E);!function(e,n,a,i,o,s){var u="BigNumber"===i,h="Complex"===i,d=u?p(0):h?b(0):0;u&&(a=p(a));for(var m=0;m<n-2;m++){for(var g=0,y=d,v=m+1;v<n;v++){var x=e[v][m];_(f(y),f(x))&&(y=x,g=v)}if(!_(f(y),a)){if(g!==m+1){var w=e[g];e[g]=e[m+1],e[m+1]=w;for(var k=0;k<n;k++){var D=e[k][g];e[k][g]=e[k][m+1],e[k][m+1]=D}if(o){var T=s[g];s[g]=s[m+1],s[m+1]=T}}for(var A=m+2;A<n;A++){var S=c(e[A][m],y);if(0!==S){for(var M=0;M<n;M++)e[A][M]=r(e[A][M],l(S,e[m+1][M]));for(var E=0;E<n;E++)e[E][m+1]=t(e[E][m+1],l(S,e[E][A]));if(o)for(var C=0;C<n;C++)s[A][C]=r(s[A][C],l(S,s[m+1][C]))}}}}}(e,g,k,M,E,C);var N,O=function(e,n,c,d,g){var y,v,x,w,k,A,S,M,E="BigNumber"===d,C="Complex"===d,N=E?p(1):C?b(1):1;E&&(c=p(c));for(var O=(0,i.clone)(e),I=[],P=n,R=[],L=g?h(Array(n).fill(N)):void 0,F=g?h(Array(P).fill(N)):void 0,B=0;B<=100;){B+=1;for(var z=0;z<P;z++)O[z][z]=r(O[z][z],0);var j=m(O),U=j.Q,$=j.R;O=s($,U);for(var V=0;V<P;V++)O[V][V]=t(O[V][V],0);if(g&&(F=s(F,U)),1===P||_(f(O[P-1][P-2]),c)){B=0,I.push(O[P-1][P-1]),g&&(R.unshift([[1]]),T(F,n),L=s(L,F),P>1&&(F=h(Array(P-1).fill(N)))),P-=1,O.pop();for(var q=0;q<P;q++)O[q].pop()}else if(2===P||_(f(O[P-2][P-3]),c)){B=0;var W=(y=O[P-2][P-2],v=O[P-2][P-1],x=O[P-1][P-2],w=O[P-1][P-1],k=void 0,A=void 0,S=void 0,M=void 0,k=t(y,w),A=r(l(y,w),l(v,x)),S=l(k,.5),M=l(u(r(l(k,k),l(4,A))),.5),[t(S,M),r(S,M)]);I.push.apply(I,(0,a.default)(W)),g&&(R.unshift(D(O[P-2][P-2],O[P-2][P-1],O[P-1][P-2],O[P-1][P-1],W[0],W[1],c,d)),T(F,n),L=s(L,F),P>2&&(F=h(Array(P-2).fill(N)))),P-=2,O.pop(),O.pop();for(var H=0;H<P;H++)O[H].pop(),O[H].pop()}if(0===P)break}if(I.sort((function(e,t){return+r(f(e),f(t))})),B>100){var G=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+I.join(", "));throw G.values=I,G.vectors=[],G}var X=g?s(L,function(e,t){for(var r=[],n=0;n<t;n++)r[n]=Array(t).fill(0);var a,i=0,s=o(e);try{for(s.s();!(a=s.n()).done;){for(var l=a.value,c=l.length,u=0;u<c;u++)for(var f=0;f<c;f++)r[i+u][i+f]=l[u][f];i+=c}}catch(e){s.e(e)}finally{s.f()}return r}(R,n)):void 0;return{values:I,C:X}}(e,g,k,M,E),I=O.values,P=O.C;return P=s(d(C),P),E&&(N=function(e,t,i,l,c,u){var f,m=d(i),g=s(m,e,i),x="BigNumber"===u,_="Complex"===u,w=x?p(0):_?b(0):0,k=x?p(1):_?b(1):1,D=[],T=[],M=o(l);try{for(M.s();!(f=M.n()).done;){var E=f.value,C=A(D,E,v);-1===C?(D.push(E),T.push(1)):T[C]+=1}}catch(U){M.e(U)}finally{M.f()}for(var N=[],O=D.length,I=Array(t).fill(w),P=h(Array(t).fill(k)),R=[],L=0;L<O;L++){var F=D[L],B=r(g,s(F,P)),z=y(B,I);for((z=z.map((function(e){return s(i,e)}))).shift();z.length<T[L];){var j=S(B,t,z,c,u);if(null==j){R.push(F);break}z.push(j)}N.push.apply(N,(0,a.default)(z.map((function(e){return n(e)}))))}if(0!==R.length){var U=new Error("Failed to find eigenvectors for the following eigenvalues: "+R.join(", "));throw U.values=l,U.vectors=N,U}return N}(e,g,P,I,k,M),N=w.apply(void 0,(0,a.default)(N))),{values:I,vectors:N}}};var a=n(r(34906)),i=r(54699);function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(l)throw i}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},43037:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRealSymmetric=function(e){var t=e.config,r=e.addScalar,a=e.subtract,i=e.abs,o=e.atan,s=e.cos,l=e.sin,c=e.multiplyScalar,u=e.inv,f=e.bignumber,p=e.multiply,h=e.add;function d(e,r){for(var a,i=e.length,o=Math.abs(r/i),s=new Array(i),l=0;l<i;l++)s[l]=k(i,0),s[l][l]=1;for(var c=x(e);Math.abs(c[1])>=Math.abs(o);){var u=c[0][0],f=c[0][1];e=b(e,(p=e[u][u],h=e[f][f],d=e[u][f],m=void 0,m=h-p,a=Math.abs(m)<=t.epsilon?Math.PI/4:.5*Math.atan(2*d/(h-p))),u,f),s=g(s,a,u,f),c=x(e)}for(var p,h,d,m,y=k(i,0),v=0;v<i;v++)y[v]=e[v][v];return w((0,n.clone)(y),(0,n.clone)(s))}function m(e,r){for(var s,l=e.length,h=i(r/l),d=new Array(l),m=0;m<l;m++)d[m]=k(l,0),d[m][m]=1;for(var g=_(e);i(g[1])>=i(h);){var b=g[0][0],x=g[0][1];e=v(e,(D=e[b][b],T=e[x][x],A=e[b][x],S=void 0,S=a(T,D),s=i(S)<=t.epsilon?f(-1).acos().div(4):c(.5,o(p(2,A,u(S))))),b,x),d=y(d,s,b,x),g=_(e)}for(var D,T,A,S,M=k(l,0),E=0;E<l;E++)M[E]=e[E][E];return w((0,n.clone)(M),(0,n.clone)(d))}function g(e,t,r,n){for(var a=e.length,i=Math.cos(t),o=Math.sin(t),s=k(a,0),l=k(a,0),c=0;c<a;c++)s[c]=i*e[c][r]-o*e[c][n],l[c]=o*e[c][r]+i*e[c][n];for(var u=0;u<a;u++)e[u][r]=s[u],e[u][n]=l[u];return e}function y(e,t,n,i){for(var o=e.length,u=s(t),p=l(t),h=k(o,f(0)),d=k(o,f(0)),m=0;m<o;m++)h[m]=a(c(u,e[m][n]),c(p,e[m][i])),d[m]=r(c(p,e[m][n]),c(u,e[m][i]));for(var g=0;g<o;g++)e[g][n]=h[g],e[g][i]=d[g];return e}function v(e,t,n,i){for(var o=e.length,u=f(s(t)),d=f(l(t)),m=c(u,u),g=c(d,d),y=k(o,f(0)),v=k(o,f(0)),b=p(f(2),u,d,e[n][i]),x=r(a(c(m,e[n][n]),b),c(g,e[i][i])),_=h(c(g,e[n][n]),b,c(m,e[i][i])),w=0;w<o;w++)y[w]=a(c(u,e[n][w]),c(d,e[i][w])),v[w]=r(c(d,e[n][w]),c(u,e[i][w]));e[n][n]=x,e[i][i]=_,e[n][i]=f(0),e[i][n]=f(0);for(var D=0;D<o;D++)D!==n&&D!==i&&(e[n][D]=y[D],e[D][n]=y[D],e[i][D]=v[D],e[D][i]=v[D]);return e}function b(e,t,r,n){for(var a=e.length,i=Math.cos(t),o=Math.sin(t),s=i*i,l=o*o,c=k(a,0),u=k(a,0),f=s*e[r][r]-2*i*o*e[r][n]+l*e[n][n],p=l*e[r][r]+2*i*o*e[r][n]+s*e[n][n],h=0;h<a;h++)c[h]=i*e[r][h]-o*e[n][h],u[h]=o*e[r][h]+i*e[n][h];e[r][r]=f,e[n][n]=p,e[r][n]=0,e[n][r]=0;for(var d=0;d<a;d++)d!==r&&d!==n&&(e[r][d]=c[d],e[d][r]=c[d],e[n][d]=u[d],e[d][n]=u[d]);return e}function x(e){for(var t=e.length,r=0,n=[0,1],a=0;a<t;a++)for(var i=a+1;i<t;i++)Math.abs(r)<Math.abs(e[a][i])&&(r=Math.abs(e[a][i]),n=[a,i]);return[n,r]}function _(e){for(var t=e.length,r=0,n=[0,1],a=0;a<t;a++)for(var o=a+1;o<t;o++)i(r)<i(e[a][o])&&(r=i(e[a][o]),n=[a,o]);return[n,r]}function w(e,t){for(var r=e.length,n=Array(r),a=Array(r),o=0;o<r;o++)a[o]=Array(r);for(var s=0;s<r;s++){for(var l=0,c=e[0],u=0;u<e.length;u++)i(e[u])<i(c)&&(c=e[l=u]);n[s]=e.splice(l,1)[0];for(var f=0;f<r;f++)a[f][s]=t[f][l],t[f].splice(l,1)}return{values:n,vectors:a}}function k(e,t){for(var r=new Array(e),n=0;n<e;n++)r[n]=t;return r}return function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.epsilon,a=arguments.length>3?arguments[3]:void 0;if("number"===a)return d(e,n);if("BigNumber"===a)return m(e,n);throw TypeError("Unsupported data type: "+a)}};var n=r(54699)},28964:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createExpm=void 0;var n=r(57237),a=r(59398),i=r(58450),o="expm",s=["typed","abs","add","identity","inv","multiply"],l=(0,i.factory)(o,s,(function(e){var t=e.typed,r=e.abs,i=e.add,s=e.identity,l=e.inv,c=e.multiply;return t(o,{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+(0,a.format)(t)+")");for(var o=t[0],f=function(e){for(var t=e.size()[0],n=0,a=0;a<t;a++){for(var i=0,o=0;o<t;o++)i+=r(e.get([a,o]));n=Math.max(i,n)}return n}(e),p=function(e,t){for(var r=0;r<30;r++)for(var n=0;n<=r;n++){var a=r-n;if(u(e,n,a)<1e-15)return{q:n,j:a}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(f),h=p.q,d=p.j,m=c(e,Math.pow(2,-d)),g=s(o),y=s(o),v=1,b=m,x=-1,_=1;_<=h;_++)_>1&&(b=c(b,m),x=-x),g=i(g,c(v=v*(h-_+1)/((2*h-_+1)*_),b)),y=i(y,c(v*x,b));for(var w=c(l(y),g),k=0;k<d;k++)w=c(w,w);return(0,n.isSparseMatrix)(e)?e.createSparseMatrix(w):w}});function u(e,t,r){for(var n=1,a=2;a<=t;a++)n*=a;for(var i=n,o=t+1;o<=2*t;o++)i*=o;var s=i*(2*t+1);return 8*Math.pow(e/Math.pow(2,r),2*t)*n*n/(i*s)}}));t.createExpm=l},7833:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFilter=void 0;var n=r(70517),a=r(46054),i=["typed"],o=(0,r(58450).factory)("filter",i,(function(e){return(0,e.typed)("filter",{"Array, function":s,"Matrix, function":function(e,t){return e.create(s(e.toArray(),t))},"Array, RegExp":n.filterRegExp,"Matrix, RegExp":function(e,t){return e.create((0,n.filterRegExp)(e.toArray(),t))}})}));function s(e,t){var r=(0,a.maxArgumentCount)(t);return(0,n.filter)(e,(function(e,n,a){return 1===r?t(e):2===r?t(e,[n]):t(e,[n],a)}))}t.createFilter=o},12645:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFlatten=void 0;var n=r(54699),a=r(70517),i=r(58450),o="flatten",s=["typed","matrix"],l=(0,i.factory)(o,s,(function(e){var t=e.typed,r=e.matrix;return t(o,{Array:function(e){return(0,a.flatten)((0,n.clone)(e))},Matrix:function(e){var t=(0,a.flatten)((0,n.clone)(e.toArray()));return r(t)}})}));t.createFlatten=l},14179:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createForEach=void 0;var n=r(46054),a=r(70517),i=r(58450),o="forEach",s=["typed"],l=(0,i.factory)(o,s,(function(e){return(0,e.typed)(o,{"Array, function":c,"Matrix, function":function(e,t){return e.forEach(t)}})}));function c(e,t){var r=(0,n.maxArgumentCount)(t);!function n(i,o){Array.isArray(i)?(0,a.forEach)(i,(function(e,t){n(e,o.concat(t))})):1===r?t(i):2===r?t(i,o):t(i,o,e)}(e,[])}t.createForEach=l},89711:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGetMatrixDataType=void 0;var n=r(58450),a=r(70517),i=r(57237),o="getMatrixDataType",s=["typed"],l=(0,n.factory)(o,s,(function(e){return(0,e.typed)(o,{Array:function(e){return(0,a.getArrayDataType)(e,i.typeOf)},Matrix:function(e){return e.getDataType()}})}));t.createGetMatrixDataType=l},76787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIdentity=void 0;var n=r(57237),a=r(70517),i=r(49473),o=r(58450),s="identity",l=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],c=(0,o.factory)(s,l,(function(e){var t=e.typed,r=e.config,o=e.matrix,l=e.BigNumber,c=e.DenseMatrix,u=e.SparseMatrix;return t(s,{"":function(){return"Matrix"===r.matrix?o([]):[]},string:function(e){return o(e)},"number | BigNumber":function(e){return p(e,e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, string":function(e,t){return p(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return p(e,t,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,r){return p(e,t,r)},Array:function(e){return f(e)},"Array, string":function(e,t){return f(e,t)},Matrix:function(e){return f(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return f(e.valueOf(),t)}});function f(e,t){switch(e.length){case 0:return t?o(t):[];case 1:return p(e[0],e[0],t);case 2:return p(e[0],e[1],t);default:throw new Error("Vector containing two values expected")}}function p(e,t,r){var o=(0,n.isBigNumber)(e)||(0,n.isBigNumber)(t)?l:null;if((0,n.isBigNumber)(e)&&(e=e.toNumber()),(0,n.isBigNumber)(t)&&(t=t.toNumber()),!(0,i.isInteger)(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!(0,i.isInteger)(t)||t<1)throw new Error("Parameters in function identity must be positive integers");var s=o?new l(1):1,f=o?new o(0):0,p=[e,t];if(r){if("sparse"===r)return u.diagonal(p,s,0,f);if("dense"===r)return c.diagonal(p,s,0,f);throw new TypeError('Unknown matrix type "'.concat(r,'"'))}for(var h=(0,a.resize)([],p,f),d=e<t?e:t,m=0;m<d;m++)h[m][m]=s;return h}}));t.createIdentity=c},75667:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInv=void 0;var n=r(57237),a=r(70517),i=r(58450),o=r(59398),s=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],l=(0,i.factory)("inv",s,(function(e){var t=e.typed,r=e.matrix,i=e.divideScalar,s=e.addScalar,l=e.multiply,c=e.unaryMinus,u=e.det,f=e.identity,p=e.abs;return t("inv",{"Array | Matrix":function(e){var t=(0,n.isMatrix)(e)?e.size():(0,a.arraySize)(e);switch(t.length){case 1:if(1===t[0])return(0,n.isMatrix)(e)?r([i(1,e.valueOf()[0])]):[i(1,e[0])];throw new RangeError("Matrix must be square (size: "+(0,o.format)(t)+")");case 2:var s=t[0],l=t[1];if(s===l)return(0,n.isMatrix)(e)?r(h(e.valueOf(),s,l),e.storage()):h(e,s,l);throw new RangeError("Matrix must be square (size: "+(0,o.format)(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+(0,o.format)(t)+")")}},any:function(e){return i(1,e)}});function h(e,t,r){var n,a,o,h,d;if(1===t){if(0===(h=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[i(1,h)]]}if(2===t){var m=u(e);if(0===m)throw Error("Cannot calculate inverse, determinant is zero");return[[i(e[1][1],m),i(c(e[0][1]),m)],[i(c(e[1][0]),m),i(e[0][0],m)]]}var g=e.concat();for(n=0;n<t;n++)g[n]=g[n].concat();for(var y=f(t).valueOf(),v=0;v<r;v++){var b=p(g[v][v]),x=v;for(n=v+1;n<t;)p(g[n][v])>b&&(b=p(g[n][v]),x=n),n++;if(0===b)throw Error("Cannot calculate inverse, determinant is zero");(n=x)!==v&&(d=g[v],g[v]=g[n],g[n]=d,d=y[v],y[v]=y[n],y[n]=d);var _=g[v],w=y[v];for(n=0;n<t;n++){var k=g[n],D=y[n];if(n!==v){if(0!==k[v]){for(o=i(c(k[v]),_[v]),a=v;a<r;a++)k[a]=s(k[a],l(o,_[a]));for(a=0;a<r;a++)D[a]=s(D[a],l(o,w[a]))}}else{for(o=_[v],a=v;a<r;a++)k[a]=i(k[a],o);for(a=0;a<r;a++)D[a]=i(D[a],o)}}}return y}}));t.createInv=l},41859:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createKron=void 0;var n=r(70517),a=r(58450),i="kron",o=["typed","matrix","multiplyScalar"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.matrix,a=e.multiplyScalar;return t(i,{"Matrix, Matrix":function(e,t){return r(o(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(o(e.toArray(),t))},"Array, Matrix":function(e,t){return r(o(e,t.toArray()))},"Array, Array":o});function o(e,t){if(1===(0,n.arraySize)(e).length&&(e=[e]),1===(0,n.arraySize)(t).length&&(t=[t]),(0,n.arraySize)(e).length>2||(0,n.arraySize)(t).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(e.length)+", y = "+JSON.stringify(t.length)+")");var r=[],i=[];return e.map((function(e){return t.map((function(t){return i=[],r.push(i),e.map((function(e){return t.map((function(t){return i.push(a(e,t))}))}))}))}))&&r}}));t.createKron=s},36463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMap=void 0;var n=r(46054),a=["typed"],i=(0,r(58450).factory)("map",a,(function(e){return(0,e.typed)("map",{"Array, function":o,"Matrix, function":function(e,t){return e.map(t)}})}));function o(e,t){var r=(0,n.maxArgumentCount)(t);return function n(a,i){return Array.isArray(a)?a.map((function(e,t){return n(e,i.concat(t))})):1===r?t(a):2===r?t(a,i):t(a,i,e)}(e,[])}t.createMap=i},1766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatrixFromColumns=void 0;var n=r(58450);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var i="matrixFromColumns",o=["typed","matrix","flatten","size"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.matrix,n=e.flatten,o=e.size;return t(i,{"...Array":function(e){return s(e)},"...Matrix":function(e){return r(s(e.map((function(e){return e.toArray()}))))}});function s(e){if(0===e.length)throw new TypeError("At least one column is needed to construct a matrix.");for(var t=l(e[0]),r=[],i=0;i<t;i++)r[i]=[];var o,s=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw o}}}}(e);try{for(s.s();!(o=s.n()).done;){var c=o.value,u=l(c);if(u!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|u));for(var f=n(c),p=0;p<t;p++)r[p].push(f[p])}}catch(e){s.e(e)}finally{s.f()}return r}function l(e){var t=o(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}}));t.createMatrixFromColumns=s},70889:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatrixFromFunction=void 0;var n=r(58450),a="matrixFromFunction",i=["typed","matrix","isZero"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.matrix,n=e.isZero;return t(a,{"Array | Matrix, function, string, string":function(e,t,r,n){return i(e,t,r,n)},"Array | Matrix, function, string":function(e,t,r){return i(e,t,r)},"Matrix, function":function(e,t){return i(e,t,"dense")},"Array, function":function(e,t){return i(e,t,"dense").toArray()},"Array | Matrix, string, function":function(e,t,r){return i(e,r,t)},"Array | Matrix, string, string, function":function(e,t,r,n){return i(e,n,t,r)}});function i(e,t,a,i){var o;return(o=void 0!==i?r(a,i):r(a)).resize(e),o.forEach((function(e,r){var a=t(r);n(a)||o.set(r,a)})),o}}));t.createMatrixFromFunction=o},80929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatrixFromRows=void 0;var n=r(58450);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var i="matrixFromRows",o=["typed","matrix","flatten","size"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.matrix,n=e.flatten,o=e.size;return t(i,{"...Array":function(e){return s(e)},"...Matrix":function(e){return r(s(e.map((function(e){return e.toArray()}))))}});function s(e){if(0===e.length)throw new TypeError("At least one row is needed to construct a matrix.");var t,r=l(e[0]),i=[],o=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw o}}}}(e);try{for(o.s();!(t=o.n()).done;){var s=t.value,c=l(s);if(c!==r)throw new TypeError("The vectors had different length: "+(0|r)+" ≠ "+(0|c));i.push(n(s))}}catch(e){o.e(e)}finally{o.f()}return i}function l(e){var t=o(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}}));t.createMatrixFromRows=s},96653:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOnes=void 0;var n=r(57237),a=r(49473),i=r(70517),o=["typed","config","matrix","BigNumber"],s=(0,r(58450).factory)("ones",o,(function(e){var t=e.typed,r=e.config,o=e.matrix,s=e.BigNumber;return t("ones",{"":function(){return"Array"===r.matrix?l([]):l([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return l(e,t)}return"Array"===r.matrix?l(e):l(e,"default")},Array:l,Matrix:function(e){var t=e.storage();return l(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return l(e.valueOf(),t)}});function l(e,t){var r=function(e){var t=!1;return e.forEach((function(e,r,a){(0,n.isBigNumber)(e)&&(t=!0,a[r]=e.toNumber())})),t}(e),l=r?new s(1):1;if(function(e){e.forEach((function(e){if("number"!=typeof e||!(0,a.isInteger)(e)||e<0)throw new Error("Parameters in function ones must be positive integers")}))}(e),t){var c=o(t);return e.length>0?c.resize(e,l):c}var u=[];return e.length>0?(0,i.resize)(u,e,l):u}}));t.createOnes=s},82859:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPartitionSelect=void 0;var n=r(57237),a=r(49473),i=r(58450),o="partitionSelect",s=["typed","isNumeric","isNaN","compare"],l=(0,i.factory)(o,s,(function(e){var t=e.typed,r=e.isNumeric,i=e.isNaN,s=e.compare,l=s,c=function(e,t){return-s(e,t)};return t(o,{"Array | Matrix, number":function(e,t){return u(e,t,l)},"Array | Matrix, number, string":function(e,t,r){if("asc"===r)return u(e,t,l);if("desc"===r)return u(e,t,c);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(e,t,r){if(!(0,a.isInteger)(t)||t<0)throw new Error("k must be a non-negative integer");if((0,n.isMatrix)(e)){if(e.size().length>1)throw new Error("Only one dimensional matrices supported");return f(e.valueOf(),t,r)}if(Array.isArray(e))return f(e,t,r)}function f(e,t,n){if(t>=e.length)throw new Error("k out of bounds");for(var a=0;a<e.length;a++)if(r(e[a])&&i(e[a]))return e[a];for(var o=0,s=e.length-1;o<s;){for(var l=o,c=s,u=e[Math.floor(Math.random()*(s-o+1))+o];l<c;)if(n(e[l],u)>=0){var f=e[c];e[c]=e[l],e[l]=f,--c}else++l;n(e[l],u)>0&&--l,t<=l?s=l:o=l+1}return e[t]}}));t.createPartitionSelect=l},5941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRange=void 0;var n=r(58450),a=r(10935),i="range",o=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.config,n=e.matrix,o=e.bignumber,s=e.smaller,l=e.smallerEq,c=e.larger,u=e.largerEq;return t(i,{string:p,"string, boolean":p,"number, number":function(e,t){return f(h(e,t,1))},"number, number, number":function(e,t,r){return f(h(e,t,r))},"number, number, boolean":function(e,t,r){return f(r?d(e,t,1):h(e,t,1))},"number, number, number, boolean":function(e,t,r,n){return f(n?d(e,t,r):h(e,t,r))},"BigNumber, BigNumber":function(e,t){return f(m(e,t,new(0,e.constructor)(1)))},"BigNumber, BigNumber, BigNumber":function(e,t,r){return f(m(e,t,r))},"BigNumber, BigNumber, boolean":function(e,t,r){var n=e.constructor;return f(r?g(e,t,new n(1)):m(e,t,new n(1)))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,r,n){return f(n?g(e,t,r):m(e,t,r))}});function f(e){return"Matrix"===r.matrix?n?n(e):(0,a.noMatrix)():e}function p(e,t){var n=function(e){var t=e.split(":").map((function(e){return Number(e)}));if(t.some((function(e){return isNaN(e)})))return null;switch(t.length){case 2:return{start:t[0],end:t[1],step:1};case 3:return{start:t[0],end:t[2],step:t[1]};default:return null}}(e);if(!n)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===r.number?(void 0===o&&(0,a.noBignumber)(),f((t?g:m)(o(n.start),o(n.end),o(n.step)))):f((t?d:h)(n.start,n.end,n.step))}function h(e,t,r){var n=[],a=e;if(r>0)for(;s(a,t);)n.push(a),a+=r;else if(r<0)for(;c(a,t);)n.push(a),a+=r;return n}function d(e,t,r){var n=[],a=e;if(r>0)for(;l(a,t);)n.push(a),a+=r;else if(r<0)for(;u(a,t);)n.push(a),a+=r;return n}function m(e,t,r){var n=o(0),a=[],i=e;if(r.gt(n))for(;s(i,t);)a.push(i),i=i.plus(r);else if(r.lt(n))for(;c(i,t);)a.push(i),i=i.plus(r);return a}function g(e,t,r){var n=o(0),a=[],i=e;if(r.gt(n))for(;l(i,t);)a.push(i),i=i.plus(r);else if(r.lt(n))for(;u(i,t);)a.push(i),i=i.plus(r);return a}}));t.createRange=s},50578:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createReshape=void 0;var n=r(70517),a=r(58450),i="reshape",o=["typed","isInteger","matrix"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.isInteger;return t(i,{"Matrix, Array":function(e,t){return e.reshape(t)},"Array, Array":function(e,t){return t.forEach((function(e){if(!r(e))throw new TypeError("Invalid size for dimension: "+e)})),(0,n.reshape)(e,t)}})}));t.createReshape=s},21112:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createResize=void 0;var n=r(57237),a=r(12906),i=r(91245),o=r(49473),s=r(59398),l=r(54699),c=r(70517),u=["config","matrix"],f=(0,r(58450).factory)("resize",u,(function(e){var t=e.config,r=e.matrix;return function(e,a,o){if(2!==arguments.length&&3!==arguments.length)throw new i.ArgumentsError("resize",arguments.length,2,3);if((0,n.isMatrix)(a)&&(a=a.valueOf()),(0,n.isBigNumber)(a[0])&&(a=a.map((function(e){return(0,n.isBigNumber)(e)?e.toNumber():e}))),(0,n.isMatrix)(e))return e.resize(a,o,!0);if("string"==typeof e)return u(e,a,o);var s=!Array.isArray(e)&&"Array"!==t.matrix;if(0===a.length){for(;Array.isArray(e);)e=e[0];return(0,l.clone)(e)}Array.isArray(e)||(e=[e]),e=(0,l.clone)(e);var f=(0,c.resize)(e,a,o);return s?r(f):f};function u(e,t,r){if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";if(1!==t.length)throw new a.DimensionError(t.length,1);var n=t[0];if("number"!=typeof n||!(0,o.isInteger)(n))throw new TypeError("Invalid size, must contain positive integers (size: "+(0,s.format)(t)+")");if(e.length>n)return e.substring(0,n);if(e.length<n){for(var i=e,l=0,c=n-e.length;l<c;l++)i+=r;return i}return e}}));t.createResize=f},41831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRotate=void 0;var n=r(58450),a=r(70517),i="rotate",o=["typed","multiply","rotationMatrix"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.multiply,n=e.rotationMatrix;return t(i,{"Array , number | BigNumber | Complex | Unit":function(e,t){return o(e,2),r(n(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return o(e,2),r(n(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return o(e,3),r(n(t,a),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return o(e,3),r(n(t,a),e)}});function o(e,t){var r=Array.isArray(e)?(0,a.arraySize)(e):e.size();if(r.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(t));if(2===r.length&&1!==r[1])throw new RangeError("Vector must be of dimensions 1x".concat(t));if(r[0]!==t)throw new RangeError("Vector must be of dimensions 1x".concat(t))}}));t.createRotate=s},7442:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRotationMatrix=void 0;var n=r(57237),a=r(58450),i="rotationMatrix",o=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.config,a=e.multiplyScalar,o=e.addScalar,s=e.unaryMinus,l=e.norm,c=e.BigNumber,u=e.matrix,f=e.DenseMatrix,p=e.SparseMatrix,h=e.cos,d=e.sin;return t(i,{"":function(){return"Matrix"===r.matrix?u([]):[]},string:function(e){return u(e)},"number | BigNumber | Complex | Unit":function(e){return m(e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(e,t){return m(e,t)},"number | BigNumber | Complex | Unit, Array":function(e,t){var r=u(t);return g(r),b(e,r,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){g(t);var n=t.storage()||("Matrix"===r.matrix?"dense":void 0);return b(e,t,n)},"number | BigNumber | Complex | Unit, Array, string":function(e,t,r){var n=u(t);return g(n),b(e,n,r)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,r){return g(t),b(e,t,r)}});function m(e,t){var r=(0,n.isBigNumber)(e)?new c(-1):-1,i=h(e),o=d(e);return v([[i,a(r,o)],[o,i]],t)}function g(e){var t=e.size();if(t.length<1||3!==t[0])throw new RangeError("Vector must be of dimensions 1x3")}function y(e){return e.reduce((function(e,t){return a(e,t)}))}function v(e,t){if(t){if("sparse"===t)return new p(e);if("dense"===t)return new f(e);throw new TypeError('Unknown matrix type "'.concat(t,'"'))}return e}function b(e,t,r){var a=l(t);if(0===a)throw new RangeError("Rotation around zero vector");var i=(0,n.isBigNumber)(e)?c:null,u=i?new i(1):1,f=i?new i(-1):-1,p=i?new i(t.get([0])/a):t.get([0])/a,m=i?new i(t.get([1])/a):t.get([1])/a,g=i?new i(t.get([2])/a):t.get([2])/a,b=h(e),x=o(u,s(b)),_=d(e);return v([[o(b,y([p,p,x])),o(y([p,m,x]),y([f,g,_])),o(y([p,g,x]),y([m,_]))],[o(y([p,m,x]),y([g,_])),o(b,y([m,m,x])),o(y([m,g,x]),y([f,p,_]))],[o(y([p,g,x]),y([f,m,_])),o(y([m,g,x]),y([p,_])),o(b,y([g,g,x]))]],r)}}));t.createRotationMatrix=s},92124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRow=void 0;var n=r(58450),a=r(54699),i=r(70517),o=["typed","Index","matrix","range"],s=(0,n.factory)("row",o,(function(e){var t=e.typed,r=e.Index,n=e.matrix,o=e.range;return t("row",{"Matrix, number":s,"Array, number":function(e,t){return s(n((0,a.clone)(e)),t).valueOf()}});function s(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");(0,i.validateIndex)(t,e.size()[0]);var n=o(0,e.size()[1]),a=new r(t,n);return e.subset(a)}}));t.createRow=s},78525:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSize=void 0;var n=r(70517),a=r(58450),i=r(10935),o="size",s=["typed","config","?matrix"],l=(0,a.factory)(o,s,(function(e){var t=e.typed,r=e.config,a=e.matrix;return t(o,{Matrix:function(e){return e.create(e.size())},Array:n.arraySize,string:function(e){return"Array"===r.matrix?[e.length]:a([e.length])},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===r.matrix?[]:a?a([]):(0,i.noMatrix)()}})}));t.createSize=l},22927:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSort=void 0;var n=r(70517),a=r(58450),i="sort",o=["typed","matrix","compare","compareNatural"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.matrix,a=e.compare,o=e.compareNatural,s=a,l=function(e,t){return-a(e,t)};return t(i,{Array:function(e){return u(e),e.sort(s)},Matrix:function(e){return f(e),r(e.toArray().sort(s),e.storage())},"Array, function":function(e,t){return u(e),e.sort(t)},"Matrix, function":function(e,t){return f(e),r(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return u(e),e.sort(c(t))},"Matrix, string":function(e,t){return f(e),r(e.toArray().sort(c(t)),e.storage())}});function c(e){if("asc"===e)return s;if("desc"===e)return l;if("natural"===e)return o;throw new Error('String "asc", "desc", or "natural" expected')}function u(e){if(1!==(0,n.arraySize)(e).length)throw new Error("One dimensional array expected")}function f(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}}));t.createSort=s},40428:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSqrtm=void 0;var n=r(57237),a=r(59398),i=r(70517),o=r(58450),s="sqrtm",l=["typed","abs","add","multiply","sqrt","subtract","inv","size","max","identity"],c=(0,o.factory)(s,l,(function(e){var t=e.typed,r=e.abs,o=e.add,l=e.multiply,c=e.sqrt,u=e.subtract,f=e.inv,p=e.size,h=e.max,d=e.identity,m=1e-6;function g(e){var t,n=0,a=e,i=d(p(e));do{var s=a;if(a=l(.5,o(s,f(i))),i=l(.5,o(i,f(s))),(t=h(r(u(a,s))))>m&&++n>1e3)throw new Error("computing square root of matrix: iterative method could not converge")}while(t>m);return a}return t(s,{"Array | Matrix":function(e){var t=(0,n.isMatrix)(e)?e.size():(0,i.arraySize)(e);switch(t.length){case 1:if(1===t[0])return c(e);throw new RangeError("Matrix must be square (size: "+(0,a.format)(t)+")");case 2:if(t[0]===t[1])return g(e);throw new RangeError("Matrix must be square (size: "+(0,a.format)(t)+")");default:throw new RangeError("Matrix must be at most two dimensional (size: "+(0,a.format)(t)+")")}}})}));t.createSqrtm=c},80418:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSqueeze=void 0;var n=r(54699),a=r(70517),i=r(58450),o="squeeze",s=["typed","matrix"],l=(0,i.factory)(o,s,(function(e){var t=e.typed,r=e.matrix;return t(o,{Array:function(e){return(0,a.squeeze)((0,n.clone)(e))},Matrix:function(e){var t=(0,a.squeeze)(e.toArray());return Array.isArray(t)?r(t):t},any:function(e){return(0,n.clone)(e)}})}));t.createSqueeze=l},63451:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSubset=void 0;var n=r(57237),a=r(54699),i=r(70517),o=r(27807),s=r(12906),l=r(58450),c="subset",u=["typed","matrix"],f=(0,l.factory)(c,u,(function(e){var t=e.typed,r=e.matrix;return t(c,{"Array, Index":function(e,t){var n=r(e).subset(t);return t.isScalar()?n:n.valueOf()},"Matrix, Index":function(e,t){return e.subset(t)},"Object, Index":d,"string, Index":p,"Array, Index, any":function(e,t,n){return r((0,a.clone)(e)).subset(t,n,void 0).valueOf()},"Array, Index, any, any":function(e,t,n,i){return r((0,a.clone)(e)).subset(t,n,i).valueOf()},"Matrix, Index, any":function(e,t,r){return e.clone().subset(t,r)},"Matrix, Index, any, any":function(e,t,r,n){return e.clone().subset(t,r,n)},"string, Index, string":h,"string, Index, string, string":h,"Object, Index, any":m})}));function p(e,t){if(!(0,n.isIndex)(t))throw new TypeError("Index expected");if(1!==t.size().length)throw new s.DimensionError(t.size().length,1);var r=e.length;(0,i.validateIndex)(t.min()[0],r),(0,i.validateIndex)(t.max()[0],r);var a=t.dimension(0),o="";return a.forEach((function(t){o+=e.charAt(t)})),o}function h(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if(1!==t.size().length)throw new s.DimensionError(t.size().length,1);if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";var a=t.dimension(0);if(a.size()[0]!==r.length)throw new s.DimensionError(a.size()[0],r.length);var o=e.length;(0,i.validateIndex)(t.min()[0]),(0,i.validateIndex)(t.max()[0]);for(var l=[],c=0;c<o;c++)l[c]=e.charAt(c);if(a.forEach((function(e,t){l[e]=r.charAt(t[0])})),l.length>o)for(var u=o-1,f=l.length;u<f;u++)l[u]||(l[u]=n);return l.join("")}function d(e,t){if(1!==t.size().length)throw new s.DimensionError(t.size(),1);var r=t.dimension(0);if("string"!=typeof r)throw new TypeError("String expected as index to retrieve an object property");return(0,o.getSafeProperty)(e,r)}function m(e,t,r){if(1!==t.size().length)throw new s.DimensionError(t.size(),1);var n=t.dimension(0);if("string"!=typeof n)throw new TypeError("String expected as index to retrieve an object property");var i=(0,a.clone)(e);return(0,o.setSafeProperty)(i,n,r),i}t.createSubset=f},43227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTrace=void 0;var n=r(54699),a=r(59398),i=["typed","matrix","add"],o=(0,r(58450).factory)("trace",i,(function(e){var t=e.typed,r=e.matrix,i=e.add;return t("trace",{Array:function(e){return o(r(e))},SparseMatrix:function(e){var t=e._values,r=e._index,n=e._ptr,o=e._size,s=o[0],l=o[1];if(s===l){var c=0;if(t.length>0)for(var u=0;u<l;u++)for(var f=n[u],p=n[u+1],h=f;h<p;h++){var d=r[h];if(d===u){c=i(c,t[h]);break}if(d>u)break}return c}throw new RangeError("Matrix must be square (size: "+(0,a.format)(o)+")")},DenseMatrix:o,any:n.clone});function o(e){var t=e._size,r=e._data;switch(t.length){case 1:if(1===t[0])return(0,n.clone)(r[0]);throw new RangeError("Matrix must be square (size: "+(0,a.format)(t)+")");case 2:var o=t[0];if(o===t[1]){for(var s=0,l=0;l<o;l++)s=i(s,r[l][l]);return s}throw new RangeError("Matrix must be square (size: "+(0,a.format)(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+(0,a.format)(t)+")")}}}));t.createTrace=o},35329:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTranspose=void 0;var n=r(54699),a=r(59398),i=["typed","matrix"],o=(0,r(58450).factory)("transpose",i,(function(e){var t=e.typed,r=e.matrix;return t("transpose",{Array:function(e){return this(r(e)).valueOf()},Matrix:function(e){var t,r=e.size();switch(r.length){case 1:t=e.clone();break;case 2:var i=r[0],o=r[1];if(0===o)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+(0,a.format)(r)+")");switch(e.storage()){case"dense":t=function(e,t,r){for(var a,i=e._data,o=[],s=0;s<r;s++){a=o[s]=[];for(var l=0;l<t;l++)a[l]=(0,n.clone)(i[l][s])}return e.createDenseMatrix({data:o,size:[r,t],datatype:e._datatype})}(e,i,o);break;case"sparse":t=function(e,t,r){for(var a,i,o,s=e._values,l=e._index,c=e._ptr,u=s?[]:void 0,f=[],p=[],h=[],d=0;d<t;d++)h[d]=0;for(a=0,i=l.length;a<i;a++)h[l[a]]++;for(var m=0,g=0;g<t;g++)p.push(m),m+=h[g],h[g]=p[g];for(p.push(m),o=0;o<r;o++)for(var y=c[o],v=c[o+1],b=y;b<v;b++){var x=h[l[b]]++;f[x]=o,s&&(u[x]=(0,n.clone)(s[b]))}return e.createSparseMatrix({values:u,index:f,ptr:p,size:[r,t],datatype:e._datatype})}(e,i,o)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+(0,a.format)(this._size)+")")}return t},any:function(e){return(0,n.clone)(e)}})}));t.createTranspose=o},5668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createZeros=void 0;var n=r(57237),a=r(49473),i=r(70517),o=r(58450),s="zeros",l=["typed","config","matrix","BigNumber"],c=(0,o.factory)(s,l,(function(e){var t=e.typed,r=e.config,o=e.matrix,l=e.BigNumber;return t(s,{"":function(){return"Array"===r.matrix?c([]):c([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return c(e,t)}return"Array"===r.matrix?c(e):c(e,"default")},Array:c,Matrix:function(e){var t=e.storage();return c(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return c(e.valueOf(),t)}});function c(e,t){var r=function(e){var t=!1;return e.forEach((function(e,r,a){(0,n.isBigNumber)(e)&&(t=!0,a[r]=e.toNumber())})),t}(e),s=r?new l(0):0;if(function(e){e.forEach((function(e){if("number"!=typeof e||!(0,a.isInteger)(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")}))}(e),t){var c=o(t);return e.length>0?c.resize(e,s):c}var u=[];return e.length>0?(0,i.resize)(u,e,s):u}}));t.createZeros=c},31469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCombinations=void 0;var n=r(58450),a=r(67276),i="combinations",o=["typed"],s=(0,n.factory)(i,o,(function(e){return(0,e.typed)(i,{"number, number":a.combinationsNumber,"BigNumber, BigNumber":function(e,t){var r,n,a=e.constructor,i=e.minus(t),o=new a(1);if(!l(e)||!l(t))throw new TypeError("Positive integer value expected in function combinations");if(t.gt(e))throw new TypeError("k must be less than n in function combinations");if(r=o,t.lt(i))for(n=o;n.lte(i);n=n.plus(o))r=r.times(t.plus(n)).dividedBy(n);else for(n=o;n.lte(t);n=n.plus(o))r=r.times(i.plus(n)).dividedBy(n);return r}})}));function l(e){return e.isInteger()&&e.gte(0)}t.createCombinations=s},38900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCombinationsWithRep=void 0;var n=r(58450),a=r(49473),i=r(7852),o="combinationsWithRep",s=["typed"],l=(0,n.factory)(o,s,(function(e){return(0,e.typed)(o,{"number, number":function(e,t){if(!(0,a.isInteger)(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!(0,a.isInteger)(t)||t<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw new TypeError("k must be less than or equal to n + k - 1");return t<e-1?(0,i.product)(e,e+t-1)/(0,i.product)(1,t):(0,i.product)(t+1,e+t-1)/(0,i.product)(1,e-1)},"BigNumber, BigNumber":function(e,t){var r,n,a=new(0,e.constructor)(1),i=e.minus(a);if(!c(e)||!c(t))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e.lt(a))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(r=a,t.lt(i))for(n=a;n.lte(i);n=n.plus(a))r=r.times(t.plus(n)).dividedBy(n);else for(n=a;n.lte(t);n=n.plus(a))r=r.times(i.plus(n)).dividedBy(n);return r}})}));function c(e){return e.isInteger()&&e.gte(0)}t.createCombinationsWithRep=l},43523:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFactorial=void 0;var n=r(30401),a=r(58450),i="factorial",o=["typed","gamma"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.gamma;return t(i,{number:function(e){if(e<0)throw new Error("Value must be non-negative");return r(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return r(e.plus(1))},"Array | Matrix":function(e){return(0,n.deepMap)(e,this)}})}));t.createFactorial=s},68793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGamma=void 0;var n=r(30401),a=r(58450),i=r(18001),o="gamma",s=["typed","config","multiplyScalar","pow","BigNumber","Complex"],l=(0,a.factory)(o,s,(function(e){var t=e.typed,r=e.config,a=e.multiplyScalar,s=e.pow,l=e.BigNumber,c=e.Complex;return t(o,{number:i.gammaNumber,Complex:function(e){if(0===e.im)return this(e.re);e=new c(e.re-1,e.im);for(var t=new c(i.gammaP[0],0),r=1;r<i.gammaP.length;++r){var n=e.re+r,o=n*n+e.im*e.im;0!==o?(t.re+=i.gammaP[r]*n/o,t.im+=-i.gammaP[r]*e.im/o):t.re=i.gammaP[r]<0?-1/0:1/0}var l=new c(e.re+i.gammaG+.5,e.im),u=Math.sqrt(2*Math.PI);e.re+=.5;var f=s(l,e);0===f.im?f.re*=u:(0===f.re||(f.re*=u),f.im*=u);var p=Math.exp(-l.re);return l.re=p*Math.cos(-l.im),l.im=p*Math.sin(-l.im),a(a(f,l),t)},BigNumber:function(e){if(e.isInteger())return e.isNegative()||e.isZero()?new l(1/0):u(e.minus(1));if(!e.isFinite())return new l(e.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")},"Array | Matrix":function(e){return(0,n.deepMap)(e,this)}});function u(e){if(e<8)return new l([1,1,2,6,24,120,720,5040][e]);var t=r.precision+(0|Math.log(e.toNumber())),n=l.clone({precision:t});if(e%2==1)return e.times(u(new l(e-1)));for(var a=e,i=new n(e),o=e.toNumber();a>2;)o+=a-=2,i=i.times(o);return new l(i.toPrecision(l.precision))}}));t.createGamma=l},58566:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createKldivergence=void 0;var n=r(58450),a="kldivergence",i=["typed","matrix","divide","sum","multiply","dotDivide","log","isNumeric"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.matrix,n=e.divide,i=e.sum,o=e.multiply,s=e.dotDivide,l=e.log,c=e.isNumeric;return t(a,{"Array, Array":function(e,t){return u(r(e),r(t))},"Matrix, Array":function(e,t){return u(e,r(t))},"Array, Matrix":function(e,t){return u(r(e),t)},"Matrix, Matrix":function(e,t){return u(e,t)}});function u(e,t){var r=t.size().length,a=e.size().length;if(r>1)throw new Error("first object must be one dimensional");if(a>1)throw new Error("second object must be one dimensional");if(r!==a)throw new Error("Length of two vectors must be equal");if(0===i(e))throw new Error("Sum of elements in first object must be non zero");if(0===i(t))throw new Error("Sum of elements in second object must be non zero");var u=n(e,i(e)),f=n(t,i(t)),p=i(o(u,l(s(u,f))));return c(p)?p:Number.NaN}}));t.createKldivergence=o},54075:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMultinomial=void 0;var n=r(30401),a=r(58450),i="multinomial",o=["typed","add","divide","multiply","factorial","isInteger","isPositive"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.add,a=e.divide,o=e.multiply,s=e.factorial,l=e.isInteger,c=e.isPositive;return t(i,{"Array | Matrix":function(e){var t=0,i=1;return(0,n.deepForEach)(e,(function(e){if(!l(e)||!c(e))throw new TypeError("Positive integer value expected in function multinomial");t=r(t,e),i=o(i,s(e))})),a(s(t),i)}})}));t.createMultinomial=s},43658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPermutations=void 0;var n=r(49473),a=r(7852),i=r(58450),o="permutations",s=["typed","factorial"],l=(0,i.factory)(o,s,(function(e){var t=e.typed,r=e.factorial;return t(o,{"number | BigNumber":r,"number, number":function(e,t){if(!(0,n.isInteger)(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!(0,n.isInteger)(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>e)throw new TypeError("second argument k must be less than or equal to first argument n");return(0,a.product)(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var r,n;if(!c(e)||!c(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(r=e.mul(0).add(1),n=e.minus(t).plus(1);n.lte(e);n=n.plus(1))r=r.times(n);return r}})}));function c(e){return e.isInteger()&&e.gte(0)}t.createPermutations=l},18309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPickRandom=void 0;var n=r(70517),a=r(58450),i=r(57237),o=r(24605),s="pickRandom",l=["typed","config","?on"],c=(0,a.factory)(s,l,(function(e){var t=e.typed,r=e.config,a=e.on,l=(0,o.createRng)(r.randomSeed);return a&&a("config",(function(e,t){e.randomSeed!==t.randomSeed&&(l=(0,o.createRng)(e.randomSeed))})),t(s,{"Array | Matrix":function(e){return c(e,{})},"Array | Matrix, Object":function(e,t){return c(e,t)},"Array | Matrix, number":function(e,t){return c(e,{number:t})},"Array | Matrix, Array | Matrix":function(e,t){return c(e,{weights:t})},"Array | Matrix, Array | Matrix, number":function(e,t,r){return c(e,{number:r,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,r){return c(e,{number:t,weights:r})}});function c(e,t){var r=t.number,a=t.weights,o=t.elementWise,s=void 0===o||o,c=void 0===r;c&&(r=1);var u=(0,i.isMatrix)(e)?e.create:(0,i.isMatrix)(a)?a.create:null;e=e.valueOf(),a&&(a=a.valueOf()),!0===s&&(e=(0,n.flatten)(e),a=(0,n.flatten)(a));var f=0;if(void 0!==a){if(a.length!==e.length)throw new Error("Weights must have the same length as possibles");for(var p=0,h=a.length;p<h;p++){if(!(0,i.isNumber)(a[p])||a[p]<0)throw new Error("Weights must be an array of positive numbers");f+=a[p]}}for(var d,m=e.length,g=[];g.length<r;){if(void 0===a)d=e[Math.floor(l()*m)];else for(var y=l()*f,v=0,b=e.length;v<b;v++)if((y-=a[v])<0){d=e[v];break}g.push(d)}return c?g[0]:u?u(g):g}}));t.createPickRandom=c},92999:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRandomNumber=t.createRandom=void 0;var n=r(58450),a=r(57237),i=r(24605),o=r(1890),s="random",l=["typed","config","?on"],c=(0,n.factory)(s,l,(function(e){var t=e.typed,r=e.config,n=e.on,l=(0,i.createRng)(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(l=(0,i.createRng)(e.randomSeed))})),t(s,{"":function(){return u(0,1)},number:function(e){return u(0,e)},"number, number":function(e,t){return u(e,t)},"Array | Matrix":function(e){return c(e,0,1)},"Array | Matrix, number":function(e,t){return c(e,0,t)},"Array | Matrix, number, number":function(e,t,r){return c(e,t,r)}});function c(e,t,r){var n=(0,o.randomMatrix)(e.valueOf(),(function(){return u(t,r)}));return(0,a.isMatrix)(e)?e.create(n):n}function u(e,t){return e+l()*(t-e)}}));t.createRandom=c;var u=(0,n.factory)(s,["typed","config","?on"],(function(e){var t=e.typed,r=e.config,n=e.on,a=(e.matrix,(0,i.createRng)(r.randomSeed));return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(a=(0,i.createRng)(e.randomSeed))})),t(s,{"":function(){return o(0,1)},number:function(e){return o(0,e)},"number, number":function(e,t){return o(e,t)}});function o(e,t){return e+a()*(t-e)}}));t.createRandomNumber=u},79854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRandomInt=void 0;var n=r(58450),a=r(1890),i=r(24605),o=r(57237),s="randomInt",l=["typed","config","?on"],c=(0,n.factory)(s,l,(function(e){var t=e.typed,r=e.config,n=e.on,l=(0,i.createRng)(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(l=(0,i.createRng)(e.randomSeed))})),t(s,{"":function(){return u(0,1)},number:function(e){return u(0,e)},"number, number":function(e,t){return u(e,t)},"Array | Matrix":function(e){return c(e,0,1)},"Array | Matrix, number":function(e,t){return c(e,0,t)},"Array | Matrix, number, number":function(e,t,r){return c(e,t,r)}});function c(e,t,r){var n=(0,a.randomMatrix)(e.valueOf(),(function(){return u(t,r)}));return(0,o.isMatrix)(e)?e.create(n):n}function u(e,t){return Math.floor(e+l()*(t-e))}}));t.createRandomInt=c},1890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomMatrix=function e(t,r){var n=[];if((t=t.slice(0)).length>1)for(var a=0,i=t.shift();a<i;a++)n.push(e(t,r));else for(var o=0,s=t.shift();o<s;o++)n.push(r());return n}},24605:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createRng=function(e){var t,r;return t=null===(r=e)?i:(0,a.default)(String(r)),function(){return t()}};var a=n(r(51506)),i=(0,a.default)(Date.now())},75575:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCompareNumber=t.createCompare=void 0;var n=r(30585),a=r(49473),i=r(58450),o=r(72177),s=r(68311),l=r(99826),c=r(46752),u=r(6272),f="compare",p=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix"],h=(0,i.factory)(f,p,(function(e){var t=e.typed,r=e.config,i=e.equalScalar,p=e.matrix,h=e.BigNumber,d=e.Fraction,m=e.DenseMatrix,g=(0,o.createAlgorithm03)({typed:t}),y=(0,u.createAlgorithm05)({typed:t,equalScalar:i}),v=(0,s.createAlgorithm12)({typed:t,DenseMatrix:m}),b=(0,c.createAlgorithm13)({typed:t}),x=(0,l.createAlgorithm14)({typed:t});return t(f,{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"number, number":function(e,t){return(0,a.nearlyEqual)(e,t,r.epsilon)?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return(0,n.nearlyEqual)(e,t,r.epsilon)?new h(0):new h(e.cmp(t))},"Fraction, Fraction":function(e,t){return new d(e.compare(t))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return y(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return g(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return g(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return b(e,t,this)},"Array, Array":function(e,t){return this(p(e),p(t)).valueOf()},"Array, Matrix":function(e,t){return this(p(e),t)},"Matrix, Array":function(e,t){return this(e,p(t))},"SparseMatrix, any":function(e,t){return v(e,t,this,!1)},"DenseMatrix, any":function(e,t){return x(e,t,this,!1)},"any, SparseMatrix":function(e,t){return v(t,e,this,!0)},"any, DenseMatrix":function(e,t){return x(t,e,this,!0)},"Array, any":function(e,t){return x(p(e),t,this,!1).valueOf()},"any, Array":function(e,t){return x(p(t),e,this,!0).valueOf()}})}));t.createCompare=h;var d=(0,i.factory)(f,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(f,{"number, number":function(e,t){return(0,a.nearlyEqual)(e,t,r.epsilon)?0:e>t?1:-1}})}));t.createCompareNumber=d},54675:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createCompareNatural=void 0;var a=n(r(7215)),i=r(57237),o=r(58450),s="compareNatural",l=["typed","compare"],c=(0,o.factory)(s,l,(function(e){var t=e.typed,r=e.compare,n=r.signatures["boolean,boolean"];return t(s,{"any, any":function(e,t){var s,c=(0,i.typeOf)(e),u=(0,i.typeOf)(t);if(!("number"!==c&&"BigNumber"!==c&&"Fraction"!==c||"number"!==u&&"BigNumber"!==u&&"Fraction"!==u))return"0"!==(s=r(e,t)).toString()?s>0?1:-1:(0,a.default)(c,u);if("Array"===c||"Matrix"===c||"Array"===u||"Matrix"===u)return 0!==(s=o(this,e,t))?s:(0,a.default)(c,u);if(c!==u)return(0,a.default)(c,u);if("Complex"===c)return function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0}(e,t);if("Unit"===c)return e.equalBase(t)?this(e.value,t.value):l(this,e.formatUnits(),t.formatUnits());if("boolean"===c)return n(e,t);if("string"===c)return(0,a.default)(e,t);if("Object"===c)return function(e,t,r){var n=Object.keys(t),i=Object.keys(r);n.sort(a.default),i.sort(a.default);var o=l(e,n,i);if(0!==o)return o;for(var s=0;s<n.length;s++){var c=e(t[n[s]],r[i[s]]);if(0!==c)return c}return 0}(this,e,t);if("null"===c)return 0;if("undefined"===c)return 0;throw new TypeError('Unsupported type of value "'+c+'"')}});function o(e,t,r){return(0,i.isSparseMatrix)(t)&&(0,i.isSparseMatrix)(r)?l(e,t.toJSON().values,r.toJSON().values):(0,i.isSparseMatrix)(t)?o(e,t.toArray(),r):(0,i.isSparseMatrix)(r)?o(e,t,r.toArray()):(0,i.isDenseMatrix)(t)?o(e,t.toJSON().data,r):(0,i.isDenseMatrix)(r)?o(e,t,r.toJSON().data):Array.isArray(t)?Array.isArray(r)?l(e,t,r):o(e,t,[r]):o(e,[t],r)}function l(e,t,r){for(var n=0,a=Math.min(t.length,r.length);n<a;n++){var i=e(t[n],r[n]);if(0!==i)return i}return t.length>r.length?1:t.length<r.length?-1:0}}));t.createCompareNatural=c},15667:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCompareTextNumber=t.createCompareText=void 0;var n=r(59398),a=r(58450),i=r(99826),o=r(46752),s="compareText",l=["typed","matrix"],c=(0,a.factory)(s,l,(function(e){var t=e.typed,r=e.matrix,a=(0,o.createAlgorithm13)({typed:t}),l=(0,i.createAlgorithm14)({typed:t});return t(s,{"any, any":n.compareText,"DenseMatrix, DenseMatrix":function(e,t){return a(e,t,n.compareText)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"DenseMatrix, any":function(e,t){return l(e,t,n.compareText,!1)},"any, DenseMatrix":function(e,t){return l(t,e,n.compareText,!0)},"Array, any":function(e,t){return l(r(e),t,n.compareText,!1).valueOf()},"any, Array":function(e,t){return l(r(t),e,n.compareText,!0).valueOf()}})}));t.createCompareText=c;var u=(0,a.factory)(s,["typed"],(function(e){return(0,e.typed)(s,{"any, any":n.compareText})}));t.createCompareTextNumber=u},70794:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDeepEqual=void 0;var n=r(58450),a="deepEqual",i=["typed","equal"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.equal;return t(a,{"any, any":function(e,t){return n(e.valueOf(),t.valueOf())}});function n(e,t){if(Array.isArray(e)){if(Array.isArray(t)){var a=e.length;if(a!==t.length)return!1;for(var i=0;i<a;i++)if(!n(e[i],t[i]))return!1;return!0}return!1}return!Array.isArray(t)&&r(e,t)}}));t.createDeepEqual=o},13422:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEqualNumber=t.createEqual=void 0;var n=r(58450),a=r(72177),i=r(24692),o=r(68311),s=r(46752),l=r(99826),c="equal",u=["typed","matrix","equalScalar","DenseMatrix"],f=(0,n.factory)(c,u,(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,u=e.DenseMatrix,f=(0,a.createAlgorithm03)({typed:t}),p=(0,i.createAlgorithm07)({typed:t,DenseMatrix:u}),h=(0,o.createAlgorithm12)({typed:t,DenseMatrix:u}),d=(0,s.createAlgorithm13)({typed:t}),m=(0,l.createAlgorithm14)({typed:t});return t(c,{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:n(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return p(e,t,n)},"SparseMatrix, DenseMatrix":function(e,t){return f(t,e,n,!0)},"DenseMatrix, SparseMatrix":function(e,t){return f(e,t,n,!1)},"DenseMatrix, DenseMatrix":function(e,t){return d(e,t,n)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return h(e,t,n,!1)},"DenseMatrix, any":function(e,t){return m(e,t,n,!1)},"any, SparseMatrix":function(e,t){return h(t,e,n,!0)},"any, DenseMatrix":function(e,t){return m(t,e,n,!0)},"Array, any":function(e,t){return m(r(e),t,n,!1).valueOf()},"any, Array":function(e,t){return m(r(t),e,n,!0).valueOf()}})}));t.createEqual=f;var p=(0,n.factory)(c,["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return t(c,{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:r(e,t)}})}));t.createEqualNumber=p},50828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEqualScalarNumber=t.createEqualScalar=void 0;var n=r(30585),a=r(49473),i=r(58450),o=r(31625),s="equalScalar",l=["typed","config"],c=(0,i.factory)(s,l,(function(e){var t=e.typed,r=e.config;return t(s,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return(0,a.nearlyEqual)(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||(0,n.nearlyEqual)(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return(0,o.complexEquals)(e,t,r.epsilon)},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)}})}));t.createEqualScalar=c;var u=(0,i.factory)(s,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(s,{"number, number":function(e,t){return(0,a.nearlyEqual)(e,t,r.epsilon)}})}));t.createEqualScalarNumber=u},79794:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEqualText=void 0;var n=r(58450),a="equalText",i=["typed","compareText","isZero"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.compareText,n=e.isZero;return t(a,{"any, any":function(e,t){return n(r(e,t))}})}));t.createEqualText=o},91013:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLargerNumber=t.createLarger=void 0;var n=r(30585),a=r(49473),i=r(58450),o=r(72177),s=r(24692),l=r(68311),c=r(99826),u=r(46752),f="larger",p=["typed","config","matrix","DenseMatrix"],h=(0,i.factory)(f,p,(function(e){var t=e.typed,r=e.config,i=e.matrix,p=e.DenseMatrix,h=(0,o.createAlgorithm03)({typed:t}),d=(0,s.createAlgorithm07)({typed:t,DenseMatrix:p}),m=(0,l.createAlgorithm12)({typed:t,DenseMatrix:p}),g=(0,u.createAlgorithm13)({typed:t}),y=(0,c.createAlgorithm14)({typed:t});return t(f,{"boolean, boolean":function(e,t){return e>t},"number, number":function(e,t){return e>t&&!(0,a.nearlyEqual)(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.gt(t)&&!(0,n.nearlyEqual)(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return 1===e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return d(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return h(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return h(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return g(e,t,this)},"Array, Array":function(e,t){return this(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return this(i(e),t)},"Matrix, Array":function(e,t){return this(e,i(t))},"SparseMatrix, any":function(e,t){return m(e,t,this,!1)},"DenseMatrix, any":function(e,t){return y(e,t,this,!1)},"any, SparseMatrix":function(e,t){return m(t,e,this,!0)},"any, DenseMatrix":function(e,t){return y(t,e,this,!0)},"Array, any":function(e,t){return y(i(e),t,this,!1).valueOf()},"any, Array":function(e,t){return y(i(t),e,this,!0).valueOf()}})}));t.createLarger=h;var d=(0,i.factory)(f,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(f,{"number, number":function(e,t){return e>t&&!(0,a.nearlyEqual)(e,t,r.epsilon)}})}));t.createLargerNumber=d},29540:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLargerEqNumber=t.createLargerEq=void 0;var n=r(30585),a=r(49473),i=r(58450),o=r(72177),s=r(24692),l=r(68311),c=r(99826),u=r(46752),f="largerEq",p=["typed","config","matrix","DenseMatrix"],h=(0,i.factory)(f,p,(function(e){var t=e.typed,r=e.config,i=e.matrix,p=e.DenseMatrix,h=(0,o.createAlgorithm03)({typed:t}),d=(0,s.createAlgorithm07)({typed:t,DenseMatrix:p}),m=(0,l.createAlgorithm12)({typed:t,DenseMatrix:p}),g=(0,u.createAlgorithm13)({typed:t}),y=(0,c.createAlgorithm14)({typed:t});return t(f,{"boolean, boolean":function(e,t){return e>=t},"number, number":function(e,t){return e>=t||(0,a.nearlyEqual)(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.gte(t)||(0,n.nearlyEqual)(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return-1!==e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return d(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return h(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return h(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return g(e,t,this)},"Array, Array":function(e,t){return this(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return this(i(e),t)},"Matrix, Array":function(e,t){return this(e,i(t))},"SparseMatrix, any":function(e,t){return m(e,t,this,!1)},"DenseMatrix, any":function(e,t){return y(e,t,this,!1)},"any, SparseMatrix":function(e,t){return m(t,e,this,!0)},"any, DenseMatrix":function(e,t){return y(t,e,this,!0)},"Array, any":function(e,t){return y(i(e),t,this,!1).valueOf()},"any, Array":function(e,t){return y(i(t),e,this,!0).valueOf()}})}));t.createLargerEq=h;var d=(0,i.factory)(f,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(f,{"number, number":function(e,t){return e>=t||(0,a.nearlyEqual)(e,t,r.epsilon)}})}));t.createLargerEqNumber=d},80086:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSmallerNumber=t.createSmaller=void 0;var n=r(30585),a=r(49473),i=r(58450),o=r(72177),s=r(24692),l=r(68311),c=r(99826),u=r(46752),f="smaller",p=["typed","config","matrix","DenseMatrix"],h=(0,i.factory)(f,p,(function(e){var t=e.typed,r=e.config,i=e.matrix,p=e.DenseMatrix,h=(0,o.createAlgorithm03)({typed:t}),d=(0,s.createAlgorithm07)({typed:t,DenseMatrix:p}),m=(0,l.createAlgorithm12)({typed:t,DenseMatrix:p}),g=(0,u.createAlgorithm13)({typed:t}),y=(0,c.createAlgorithm14)({typed:t});return t(f,{"boolean, boolean":function(e,t){return e<t},"number, number":function(e,t){return e<t&&!(0,a.nearlyEqual)(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.lt(t)&&!(0,n.nearlyEqual)(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return-1===e.compare(t)},"Complex, Complex":function(e,t){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return d(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return h(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return h(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return g(e,t,this)},"Array, Array":function(e,t){return this(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return this(i(e),t)},"Matrix, Array":function(e,t){return this(e,i(t))},"SparseMatrix, any":function(e,t){return m(e,t,this,!1)},"DenseMatrix, any":function(e,t){return y(e,t,this,!1)},"any, SparseMatrix":function(e,t){return m(t,e,this,!0)},"any, DenseMatrix":function(e,t){return y(t,e,this,!0)},"Array, any":function(e,t){return y(i(e),t,this,!1).valueOf()},"any, Array":function(e,t){return y(i(t),e,this,!0).valueOf()}})}));t.createSmaller=h;var d=(0,i.factory)(f,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(f,{"number, number":function(e,t){return e<t&&!(0,a.nearlyEqual)(e,t,r.epsilon)}})}));t.createSmallerNumber=d},73062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSmallerEqNumber=t.createSmallerEq=void 0;var n=r(30585),a=r(49473),i=r(58450),o=r(72177),s=r(24692),l=r(68311),c=r(99826),u=r(46752),f="smallerEq",p=["typed","config","matrix","DenseMatrix"],h=(0,i.factory)(f,p,(function(e){var t=e.typed,r=e.config,i=e.matrix,p=e.DenseMatrix,h=(0,o.createAlgorithm03)({typed:t}),d=(0,s.createAlgorithm07)({typed:t,DenseMatrix:p}),m=(0,l.createAlgorithm12)({typed:t,DenseMatrix:p}),g=(0,u.createAlgorithm13)({typed:t}),y=(0,c.createAlgorithm14)({typed:t});return t(f,{"boolean, boolean":function(e,t){return e<=t},"number, number":function(e,t){return e<=t||(0,a.nearlyEqual)(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.lte(t)||(0,n.nearlyEqual)(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return 1!==e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return d(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return h(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return h(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return g(e,t,this)},"Array, Array":function(e,t){return this(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return this(i(e),t)},"Matrix, Array":function(e,t){return this(e,i(t))},"SparseMatrix, any":function(e,t){return m(e,t,this,!1)},"DenseMatrix, any":function(e,t){return y(e,t,this,!1)},"any, SparseMatrix":function(e,t){return m(t,e,this,!0)},"any, DenseMatrix":function(e,t){return y(t,e,this,!0)},"Array, any":function(e,t){return y(i(e),t,this,!1).valueOf()},"any, Array":function(e,t){return y(i(t),e,this,!0).valueOf()}})}));t.createSmallerEq=h;var d=(0,i.factory)(f,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(f,{"number, number":function(e,t){return e<=t||(0,a.nearlyEqual)(e,t,r.epsilon)}})}));t.createSmallerEqNumber=d},52109:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnequalNumber=t.createUnequal=void 0;var n=r(58450),a=r(72177),i=r(24692),o=r(68311),s=r(99826),l=r(46752),c="unequal",u=["typed","config","equalScalar","matrix","DenseMatrix"],f=(0,n.factory)(c,u,(function(e){var t=e.typed,r=(e.config,e.equalScalar),n=e.matrix,c=e.DenseMatrix,u=(0,a.createAlgorithm03)({typed:t}),f=(0,i.createAlgorithm07)({typed:t,DenseMatrix:c}),p=(0,o.createAlgorithm12)({typed:t,DenseMatrix:c}),h=(0,l.createAlgorithm13)({typed:t}),d=(0,s.createAlgorithm14)({typed:t});return t("unequal",{"any, any":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:m(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return f(e,t,m)},"SparseMatrix, DenseMatrix":function(e,t){return u(t,e,m,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,m,!1)},"DenseMatrix, DenseMatrix":function(e,t){return h(e,t,m)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return p(e,t,m,!1)},"DenseMatrix, any":function(e,t){return d(e,t,m,!1)},"any, SparseMatrix":function(e,t){return p(t,e,m,!0)},"any, DenseMatrix":function(e,t){return d(t,e,m,!0)},"Array, any":function(e,t){return d(n(e),t,m,!1).valueOf()},"any, Array":function(e,t){return d(n(t),e,m,!0).valueOf()}});function m(e,t){return!r(e,t)}}));t.createUnequal=f;var p=(0,n.factory)(c,["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return t(c,{"any, any":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:!r(e,t)}})}));t.createUnequalNumber=p},31686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetCartesian=void 0;var n=r(70517),a=r(58450),i="setCartesian",o=["typed","size","subset","compareNatural","Index","DenseMatrix"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.size,a=e.subset,o=e.compareNatural,s=e.Index,l=e.DenseMatrix;return t(i,{"Array | Matrix, Array | Matrix":function(e,t){var i=[];if(0!==a(r(e),new s(0))&&0!==a(r(t),new s(0))){var c=(0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o),u=(0,n.flatten)(Array.isArray(t)?t:t.toArray()).sort(o);i=[];for(var f=0;f<c.length;f++)for(var p=0;p<u.length;p++)i.push([c[f],u[p]])}return Array.isArray(e)&&Array.isArray(t)?i:new l(i)}})}));t.createSetCartesian=s},42340:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetDifference=void 0;var n=r(70517),a=r(58450),i="setDifference",o=["typed","size","subset","compareNatural","Index","DenseMatrix"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.size,a=e.subset,o=e.compareNatural,s=e.Index,l=e.DenseMatrix;return t(i,{"Array | Matrix, Array | Matrix":function(e,t){var i;if(0===a(r(e),new s(0)))i=[];else{if(0===a(r(t),new s(0)))return(0,n.flatten)(e.toArray());var c,u=(0,n.identify)((0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o)),f=(0,n.identify)((0,n.flatten)(Array.isArray(t)?t:t.toArray()).sort(o));i=[];for(var p=0;p<u.length;p++){c=!1;for(var h=0;h<f.length;h++)if(0===o(u[p].value,f[h].value)&&u[p].identifier===f[h].identifier){c=!0;break}c||i.push(u[p])}}return Array.isArray(e)&&Array.isArray(t)?(0,n.generalize)(i):new l((0,n.generalize)(i))}})}));t.createSetDifference=s},19412:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetDistinct=void 0;var n=r(70517),a=r(58450),i="setDistinct",o=["typed","size","subset","compareNatural","Index","DenseMatrix"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.size,a=e.subset,o=e.compareNatural,s=e.Index,l=e.DenseMatrix;return t(i,{"Array | Matrix":function(e){var t;if(0===a(r(e),new s(0)))t=[];else{var i=(0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o);(t=[]).push(i[0]);for(var c=1;c<i.length;c++)0!==o(i[c],i[c-1])&&t.push(i[c])}return Array.isArray(e)?t:new l(t)}})}));t.createSetDistinct=s},96716:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetIntersect=void 0;var n=r(70517),a=r(58450),i="setIntersect",o=["typed","size","subset","compareNatural","Index","DenseMatrix"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.size,a=e.subset,o=e.compareNatural,s=e.Index,l=e.DenseMatrix;return t(i,{"Array | Matrix, Array | Matrix":function(e,t){var i;if(0===a(r(e),new s(0))||0===a(r(t),new s(0)))i=[];else{var c=(0,n.identify)((0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o)),u=(0,n.identify)((0,n.flatten)(Array.isArray(t)?t:t.toArray()).sort(o));i=[];for(var f=0;f<c.length;f++)for(var p=0;p<u.length;p++)if(0===o(c[f].value,u[p].value)&&c[f].identifier===u[p].identifier){i.push(c[f]);break}}return Array.isArray(e)&&Array.isArray(t)?(0,n.generalize)(i):new l((0,n.generalize)(i))}})}));t.createSetIntersect=s},79703:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetIsSubset=void 0;var n=r(70517),a=r(58450),i="setIsSubset",o=["typed","size","subset","compareNatural","Index"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.size,a=e.subset,o=e.compareNatural,s=e.Index;return t(i,{"Array | Matrix, Array | Matrix":function(e,t){if(0===a(r(e),new s(0)))return!0;if(0===a(r(t),new s(0)))return!1;for(var i,l=(0,n.identify)((0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o)),c=(0,n.identify)((0,n.flatten)(Array.isArray(t)?t:t.toArray()).sort(o)),u=0;u<l.length;u++){i=!1;for(var f=0;f<c.length;f++)if(0===o(l[u].value,c[f].value)&&l[u].identifier===c[f].identifier){i=!0;break}if(!1===i)return!1}return!0}})}));t.createSetIsSubset=s},75941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetMultiplicity=void 0;var n=r(70517),a=r(58450),i="setMultiplicity",o=["typed","size","subset","compareNatural","Index"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.size,a=e.subset,o=e.compareNatural,s=e.Index;return t(i,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===a(r(t),new s(0)))return 0;for(var i=(0,n.flatten)(Array.isArray(t)?t:t.toArray()),l=0,c=0;c<i.length;c++)0===o(i[c],e)&&l++;return l}})}));t.createSetMultiplicity=s},25858:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetPowerset=void 0;var n=r(70517),a=r(58450),i="setPowerset",o=["typed","size","subset","compareNatural","Index"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.size,a=e.subset,o=e.compareNatural,s=e.Index;return t(i,{"Array | Matrix":function(e){if(0===a(r(e),new s(0)))return[];for(var t=(0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o),i=[],c=0;c.toString(2).length<=t.length;)i.push(l(t,c.toString(2).split("").reverse())),c++;return function(e){for(var t=[],r=e.length-1;r>0;r--)for(var n=0;n<r;n++)e[n].length>e[n+1].length&&(t=e[n],e[n]=e[n+1],e[n+1]=t);return e}(i)}});function l(e,t){for(var r=[],n=0;n<t.length;n++)"1"===t[n]&&r.push(e[n]);return r}}));t.createSetPowerset=s},6463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetSize=void 0;var n=r(70517),a=r(58450),i="setSize",o=["typed","compareNatural"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.compareNatural;return t(i,{"Array | Matrix":function(e){return Array.isArray(e)?(0,n.flatten)(e).length:(0,n.flatten)(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?(0,n.flatten)(e).length:(0,n.flatten)(e.toArray()).length;for(var a=(0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(r),i=1,o=1;o<a.length;o++)0!==r(a[o],a[o-1])&&i++;return i}})}));t.createSetSize=s},94139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetSymDifference=void 0;var n=r(70517),a=r(58450),i="setSymDifference",o=["typed","size","concat","subset","setDifference","Index"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.size,a=e.concat,o=e.subset,s=e.setDifference,l=e.Index;return t(i,{"Array | Matrix, Array | Matrix":function(e,t){if(0===o(r(e),new l(0)))return(0,n.flatten)(t);if(0===o(r(t),new l(0)))return(0,n.flatten)(e);var i=(0,n.flatten)(e),c=(0,n.flatten)(t);return a(s(i,c),s(c,i))}})}));t.createSetSymDifference=s},60936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetUnion=void 0;var n=r(70517),a=r(58450),i="setUnion",o=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.size,a=e.concat,o=e.subset,s=e.setIntersect,l=e.setSymDifference,c=e.Index;return t(i,{"Array | Matrix, Array | Matrix":function(e,t){if(0===o(r(e),new c(0)))return(0,n.flatten)(t);if(0===o(r(t),new c(0)))return(0,n.flatten)(e);var i=(0,n.flatten)(e),u=(0,n.flatten)(t);return a(l(i,u),s(i,u))}})}));t.createSetUnion=s},71770:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErf=void 0;var n=r(30401),a=r(49473),i=["typed"],o=(0,r(58450).factory)("erf",i,(function(e){return(0,e.typed)("name",{number:function(e){var t=Math.abs(e);return t>=f?(0,a.sign)(e):t<=s?(0,a.sign)(e)*function(e){var t,r=e*e,n=c[0][4]*r,a=r;for(t=0;t<3;t+=1)n=(n+c[0][t])*r,a=(a+u[0][t])*r;return e*(n+c[0][3])/(a+u[0][3])}(t):t<=4?(0,a.sign)(e)*(1-function(e){var t,r=c[1][8]*e,n=e;for(t=0;t<7;t+=1)r=(r+c[1][t])*e,n=(n+u[1][t])*e;var a=(r+c[1][7])/(n+u[1][7]),i=parseInt(16*e)/16,o=(e-i)*(e+i);return Math.exp(-i*i)*Math.exp(-o)*a}(t)):(0,a.sign)(e)*(1-function(e){var t,r=1/(e*e),n=c[2][5]*r,a=r;for(t=0;t<4;t+=1)n=(n+c[2][t])*r,a=(a+u[2][t])*r;var i=r*(n+c[2][4])/(a+u[2][4]);i=(l-i)/e;var o=(e-(r=parseInt(16*e)/16))*(e+r);return Math.exp(-r*r)*Math.exp(-o)*i}(t))},"Array | Matrix":function(e){return(0,n.deepMap)(e,this)}})}));t.createErf=o;var s=.46875,l=.5641895835477563,c=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],u=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],f=Math.pow(2,53)},47008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMad=void 0;var n=r(70517),a=r(58450),i=r(28211),o=["typed","abs","map","median","subtract"],s=(0,a.factory)("mad",o,(function(e){var t=e.typed,r=e.abs,a=e.map,o=e.median,s=e.subtract;return t("mad",{"Array | Matrix":l,"...":function(e){return l(e)}});function l(e){if(0===(e=(0,n.flatten)(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=o(e);return o(a(e,(function(e){return r(s(e,t))})))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf("median")?new TypeError(e.message.replace("median","mad")):(0,i.improveErrorMessage)(e,"mad")}}}));t.createMad=s},37223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMax=void 0;var n=r(30401),a=r(58450),i=r(28211),o=["typed","config","numeric","larger"],s=(0,a.factory)("max",o,(function(e){var t=e.typed,r=e.config,a=e.numeric,o=e.larger;return t("max",{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(e,t){return(0,n.reduce)(e,t.valueOf(),s)},"...":function(e){if((0,n.containsCollections)(e))throw new TypeError("Scalar values expected in function max");return l(e)}});function s(e,t){try{return o(e,t)?e:t}catch(e){throw(0,i.improveErrorMessage)(e,"max",t)}}function l(e){var t;if((0,n.deepForEach)(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||o(e,t))&&(t=e)}catch(t){throw(0,i.improveErrorMessage)(t,"max",e)}})),void 0===t)throw new Error("Cannot calculate max of an empty array");return"string"==typeof t&&(t=a(t,r.number)),t}}));t.createMax=s},74250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMean=void 0;var n=r(30401),a=r(70517),i=r(58450),o=r(28211),s="mean",l=["typed","add","divide"],c=(0,i.factory)(s,l,(function(e){var t=e.typed,r=e.add,i=e.divide;return t(s,{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(e,t){try{var s=(0,n.reduce)(e,t,r),l=Array.isArray(e)?(0,a.arraySize)(e):e.size();return i(s,l[t])}catch(e){throw(0,o.improveErrorMessage)(e,"mean")}},"...":function(e){if((0,n.containsCollections)(e))throw new TypeError("Scalar values expected in function mean");return l(e)}});function l(e){var t,a=0;if((0,n.deepForEach)(e,(function(e){try{t=void 0===t?e:r(t,e),a++}catch(t){throw(0,o.improveErrorMessage)(t,"mean",e)}})),0===a)throw new Error("Cannot calculate the mean of an empty array");return i(t,a)}}));t.createMean=c},40329:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMedian=void 0;var n=r(30401),a=r(70517),i=r(58450),o=r(28211),s="median",l=["typed","add","divide","compare","partitionSelect"],c=(0,i.factory)(s,l,(function(e){var t=e.typed,r=e.add,i=e.divide,l=e.compare,c=e.partitionSelect;function u(e){try{var t=(e=(0,a.flatten)(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){for(var r=t/2-1,n=c(e,r+1),i=e[r],s=0;s<r;++s)l(e[s],i)>0&&(i=e[s]);return p(i,n)}var u=c(e,(t-1)/2);return f(u)}catch(e){throw(0,o.improveErrorMessage)(e,"median")}}var f=t({"number | BigNumber | Complex | Unit":function(e){return e}}),p=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return i(r(e,t),2)}});return t(s,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if((0,n.containsCollections)(e))throw new TypeError("Scalar values expected in function median");return u(e)}})}));t.createMedian=c},38252:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMin=void 0;var n=r(30401),a=r(58450),i=r(28211),o=["typed","config","numeric","smaller"],s=(0,a.factory)("min",o,(function(e){var t=e.typed,r=e.config,a=e.numeric,o=e.smaller;return t("min",{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(e,t){return(0,n.reduce)(e,t.valueOf(),s)},"...":function(e){if((0,n.containsCollections)(e))throw new TypeError("Scalar values expected in function min");return l(e)}});function s(e,t){try{return o(e,t)?e:t}catch(e){throw(0,i.improveErrorMessage)(e,"min",t)}}function l(e){var t;if((0,n.deepForEach)(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||o(e,t))&&(t=e)}catch(t){throw(0,i.improveErrorMessage)(t,"min",e)}})),void 0===t)throw new Error("Cannot calculate min of an empty array");return"string"==typeof t&&(t=a(t,r.number)),t}}));t.createMin=s},57813:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMode=void 0;var n=r(70517),a=r(58450),i="mode",o=["typed","isNaN","isNumeric"],s=(0,a.factory)(i,o,(function(e){var t=e.typed,r=e.isNaN,a=e.isNumeric;return t(i,{"Array | Matrix":o,"...":function(e){return o(e)}});function o(e){if(0===(e=(0,n.flatten)(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var t={},i=[],o=0,s=0;s<e.length;s++){var l=e[s];if(a(l)&&r(l))throw new Error("Cannot calculate mode of an array containing NaN values");l in t||(t[l]=0),t[l]++,t[l]===o?i.push(l):t[l]>o&&(o=t[l],i=[l])}return i}}));t.createMode=s},1058:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createProd=void 0;var n=r(30401),a=r(58450),i=r(28211),o="prod",s=["typed","config","multiplyScalar","numeric"],l=(0,a.factory)(o,s,(function(e){var t=e.typed,r=e.config,a=e.multiplyScalar,s=e.numeric;return t(o,{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return l(e)}});function l(e){var t;if((0,n.deepForEach)(e,(function(e){try{t=void 0===t?e:a(t,e)}catch(t){throw(0,i.improveErrorMessage)(t,"prod",e)}})),"string"==typeof t&&(t=s(t,r.number)),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}}));t.createProd=l},25015:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createQuantileSeq=void 0;var n=r(57237),a=r(49473),i=r(70517),o=["typed","add","multiply","partitionSelect","compare"],s=(0,r(58450).factory)("quantileSeq",o,(function(e){var t=e.typed,r=e.add,o=e.multiply,s=e.partitionSelect,l=e.compare;function c(e,t,a){var c=(0,i.flatten)(e),f=c.length;if(0===f)throw new Error("Cannot calculate quantile of an empty sequence");if((0,n.isNumber)(t)){var p=t*(f-1),h=p%1;if(0===h){var d=a?c[p]:s(c,p);return u(d),d}var m,g,y=Math.floor(p);if(a)m=c[y],g=c[y+1];else{g=s(c,y+1),m=c[y];for(var v=0;v<y;++v)l(c[v],m)>0&&(m=c[v])}return u(m),u(g),r(o(m,1-h),o(g,h))}var b=t.times(f-1);if(b.isInteger()){b=b.toNumber();var x=a?c[b]:s(c,b);return u(x),x}var _,w,k=b.floor(),D=b.minus(k),T=k.toNumber();if(a)_=c[T],w=c[T+1];else{w=s(c,T+1),_=c[T];for(var A=0;A<T;++A)l(c[A],_)>0&&(_=c[A])}u(_),u(w);var S=new D.constructor(1);return r(o(_,S.minus(D)),o(w,D))}var u=t({"number | BigNumber | Unit":function(e){return e}});return function(e,t,r){var i,o,s;if(arguments.length<2||arguments.length>3)throw new SyntaxError("Function quantileSeq requires two or three parameters");if((0,n.isCollection)(e)){if("boolean"==typeof(r=r||!1)){if(o=e.valueOf(),(0,n.isNumber)(t)){if(t<0)throw new Error("N/prob must be non-negative");if(t<=1)return c(o,t,r);if(t>1){if(!(0,a.isInteger)(t))throw new Error("N must be a positive integer");var l=t+1;i=new Array(t);for(var u=0;u<t;)i[u]=c(o,++u/l,r);return i}}if((0,n.isBigNumber)(t)){var f=t.constructor;if(t.isNegative())throw new Error("N/prob must be non-negative");if(s=new f(1),t.lte(s))return new f(c(o,t,r));if(t.gt(s)){if(!t.isInteger())throw new Error("N must be a positive integer");var p=t.toNumber();if(p>4294967295)throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var h=new f(p+1);i=new Array(p);for(var d=0;d<p;)i[d]=new f(c(o,new f(++d).div(h),r));return i}}if(Array.isArray(t)){i=new Array(t.length);for(var m=0;m<i.length;++m){var g=t[m];if((0,n.isNumber)(g)){if(g<0||g>1)throw new Error("Probability must be between 0 and 1, inclusive")}else{if(!(0,n.isBigNumber)(g))throw new TypeError("Unexpected type of argument in function quantileSeq");if(s=new g.constructor(1),g.isNegative()||g.gt(s))throw new Error("Probability must be between 0 and 1, inclusive")}i[m]=c(o,g,r)}return i}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}}));t.createQuantileSeq=s},27512:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createStd=void 0;var n=["typed","sqrt","variance"],a=(0,r(58450).factory)("std",n,(function(e){var t=e.typed,r=e.sqrt,n=e.variance;return t("std",{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(e){return a(e)}});function a(e,t){if(0===e.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{return r(n.apply(null,arguments))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf(" variance")?new TypeError(e.message.replace(" variance"," std")):e}}}));t.createStd=a},16299:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSum=void 0;var n=r(30401),a=r(58450),i=r(28211),o=["typed","config","add","numeric"],s=(0,a.factory)("sum",o,(function(e){var t=e.typed,r=e.config,a=e.add,o=e.numeric;return t("sum",{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(e,t){try{return(0,n.reduce)(e,t,a)}catch(e){throw(0,i.improveErrorMessage)(e,"sum")}},"...":function(e){if((0,n.containsCollections)(e))throw new TypeError("Scalar values expected in function sum");return s(e)}});function s(e){var t;return(0,n.deepForEach)(e,(function(e){try{t=void 0===t?e:a(t,e)}catch(t){throw(0,i.improveErrorMessage)(t,"sum",e)}})),void 0===t&&(t=o(0,r.number)),"string"==typeof t&&(t=o(t,r.number)),t}}));t.createSum=s},28211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.improveErrorMessage=function(e,t,r){var a;return-1!==String(e).indexOf("Unexpected type")?(a=arguments.length>2?" (type: "+(0,n.typeOf)(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+a)):-1!==String(e).indexOf("complex numbers")?(a=arguments.length>2?" (type: "+(0,n.typeOf)(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+a)):e};var n=r(57237)},99026:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createVariance=void 0;var n=r(30401),a=r(57237),i=r(58450),o=r(28211),s="unbiased",l="variance",c=["typed","add","subtract","multiply","divide","apply","isNaN"],u=(0,i.factory)(l,c,(function(e){var t=e.typed,r=e.add,i=e.subtract,c=e.multiply,u=e.divide,f=e.apply,p=e.isNaN;return t(l,{"Array | Matrix":function(e){return h(e,s)},"Array | Matrix, string":h,"Array | Matrix, number | BigNumber":function(e,t){return d(e,t,s)},"Array | Matrix, number | BigNumber, string":d,"...":function(e){return h(e,s)}});function h(e,t){var s,l=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if((0,n.deepForEach)(e,(function(e){try{s=void 0===s?e:r(s,e),l++}catch(t){throw(0,o.improveErrorMessage)(t,"variance",e)}})),0===l)throw new Error("Cannot calculate variance of an empty array");var f=u(s,l);if(s=void 0,(0,n.deepForEach)(e,(function(e){var t=i(e,f);s=void 0===s?c(t,t):r(s,c(t,t))})),p(s))return s;switch(t){case"uncorrected":return u(s,l);case"biased":return u(s,l+1);case"unbiased":var h=(0,a.isBigNumber)(s)?s.mul(0):0;return 1===l?h:u(s,l-1);default:throw new Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function d(e,t,r){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return f(e,t,(function(e){return h(e,r)}))}catch(e){throw(0,o.improveErrorMessage)(e,"variance")}}}));t.createVariance=u},849:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBin=void 0;var n=(0,r(58450).factory)("bin",["typed","format"],(function(e){var t=e.typed,r=e.format;return t("bin",{"number | BigNumber":function(e){return r(e,{notation:"bin"})},"number | BigNumber, number":function(e,t){return r(e,{notation:"bin",wordSize:t})}})}));t.createBin=n},64924:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFormat=void 0;var n=r(59398),a=r(58450),i="format",o=["typed"],s=(0,a.factory)(i,o,(function(e){return(0,e.typed)(i,{any:n.format,"any, Object | function | number":n.format})}));t.createFormat=s},76276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHex=void 0;var n=(0,r(58450).factory)("hex",["typed","format"],(function(e){var t=e.typed,r=e.format;return t("hex",{"number | BigNumber":function(e){return r(e,{notation:"hex"})},"number | BigNumber, number":function(e,t){return r(e,{notation:"hex",wordSize:t})}})}));t.createHex=n},68848:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOct=void 0;var n=(0,r(58450).factory)("oct",["typed","format"],(function(e){var t=e.typed,r=e.format;return t("oct",{"number | BigNumber":function(e){return r(e,{notation:"oct"})},"number | BigNumber, number":function(e,t){return r(e,{notation:"oct",wordSize:t})}})}));t.createOct=n},36332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPrint=void 0;var n=r(59398),a=r(57237),i=r(58450),o="print",s=["typed"],l=(0,i.factory)(o,s,(function(e){return(0,e.typed)(o,{"string, Object | Array":c,"string, Object | Array, number | Object":c})}));function c(e,t,r){return e.replace(/\$([\w.]+)/g,(function(e,i){for(var o=i.split("."),s=t[o.shift()];o.length&&void 0!==s;){var l=o.shift();s=l?s[l]:s+"."}return void 0!==s?(0,a.isString)(s)?s:(0,n.format)(s,r):e}))}t.createPrint=l},52669:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcos=void 0;var n=r(58450),a=r(30401),i="acos",o=["typed","config","Complex"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(i,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.acos(e):new n(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createAcos=s},98936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcosh=void 0;var n=r(58450),a=r(30401),i=r(18001),o="acosh",s=["typed","config","Complex"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(o,{number:function(e){return e>=1||r.predictable?(0,i.acoshNumber)(e):e<=-1?new n(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new n(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createAcosh=l},59793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcot=void 0;var n=r(58450),a=r(30401),i=r(18001),o="acot",s=["typed","BigNumber"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.BigNumber;return t(o,{number:i.acotNumber,Complex:function(e){return e.acot()},BigNumber:function(e){return new r(1).div(e).atan()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createAcot=l},6912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcoth=void 0;var n=r(58450),a=r(30401),i=r(18001),o="acoth",s=["typed","config","Complex","BigNumber"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.config,n=e.Complex,s=e.BigNumber;return t(o,{number:function(e){return e>=1||e<=-1||r.predictable?(0,i.acothNumber)(e):new n(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new s(1).div(e).atanh()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createAcoth=l},93302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcsc=void 0;var n=r(58450),a=r(30401),i=r(18001),o="acsc",s=["typed","config","Complex","BigNumber"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.config,n=e.Complex,s=e.BigNumber;return t(o,{number:function(e){return e<=-1||e>=1||r.predictable?(0,i.acscNumber)(e):new n(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new s(1).div(e).asin()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createAcsc=l},88879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcsch=void 0;var n=r(58450),a=r(30401),i=r(18001),o="acsch",s=["typed","BigNumber"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.BigNumber;return t(o,{number:i.acschNumber,Complex:function(e){return e.acsch()},BigNumber:function(e){return new r(1).div(e).asinh()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createAcsch=l},18863:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAsec=void 0;var n=r(58450),a=r(30401),i=r(18001),o="asec",s=["typed","config","Complex","BigNumber"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.config,n=e.Complex,s=e.BigNumber;return t(o,{number:function(e){return e<=-1||e>=1||r.predictable?(0,i.asecNumber)(e):new n(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new s(1).div(e).acos()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createAsec=l},22355:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAsech=void 0;var n=r(58450),a=r(30401),i=r(18001),o="asech",s=["typed","config","Complex","BigNumber"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.config,n=e.Complex,s=e.BigNumber;return t(o,{number:function(e){if(e<=1&&e>=-1||r.predictable){var t=1/e;if(t>0||r.predictable)return(0,i.asechNumber)(e);var a=Math.sqrt(t*t-1);return new n(Math.log(a-t),Math.PI)}return new n(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new s(1).div(e).acosh()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createAsech=l},40950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAsin=void 0;var n=r(58450),a=r(30401),i="asin",o=["typed","config","Complex"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(i,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.asin(e):new n(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)}})}));t.createAsin=s},71411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAsinh=void 0;var n=r(58450),a=r(30401),i=r(18001),o=["typed"],s=(0,n.factory)("asinh",o,(function(e){return(0,e.typed)("asinh",{number:i.asinhNumber,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)}})}));t.createAsinh=s},94306:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAtan=void 0;var n=r(58450),a=r(30401),i=["typed"],o=(0,n.factory)("atan",i,(function(e){return(0,e.typed)("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)}})}));t.createAtan=o},47154:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAtan2=void 0;var n=r(58450),a=r(343),i=r(72177),o=r(93799),s=r(34623),l=r(68311),c=r(46752),u=r(99826),f="atan2",p=["typed","matrix","equalScalar","BigNumber","DenseMatrix"],h=(0,n.factory)(f,p,(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,p=e.BigNumber,h=e.DenseMatrix,d=(0,a.createAlgorithm02)({typed:t,equalScalar:n}),m=(0,i.createAlgorithm03)({typed:t}),g=(0,o.createAlgorithm09)({typed:t,equalScalar:n}),y=(0,s.createAlgorithm11)({typed:t,equalScalar:n}),v=(0,l.createAlgorithm12)({typed:t,DenseMatrix:h}),b=(0,c.createAlgorithm13)({typed:t}),x=(0,u.createAlgorithm14)({typed:t});return t(f,{"number, number":Math.atan2,"BigNumber, BigNumber":function(e,t){return p.atan2(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return g(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return d(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return m(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return b(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return y(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return x(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return v(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return x(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return x(r(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return x(r(t),e,this,!0).valueOf()}})}));t.createAtan2=h},6205:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAtanh=void 0;var n=r(58450),a=r(30401),i=r(18001),o="atanh",s=["typed","config","Complex"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(o,{number:function(e){return e<=1&&e>=-1||r.predictable?(0,i.atanhNumber)(e):new n(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)}})}));t.createAtanh=l},13045:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCos=void 0;var n=r(58450),a=r(30401),i=["typed"],o=(0,n.factory)("cos",i,(function(e){return(0,e.typed)("cos",{number:Math.cos,Complex:function(e){return e.cos()},BigNumber:function(e){return e.cos()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cos is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createCos=o},5286:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCosh=void 0;var n=r(58450),a=r(30401),i=r(49473),o="cosh",s=["typed"],l=(0,n.factory)(o,s,(function(e){return(0,e.typed)(o,{number:i.cosh,Complex:function(e){return e.cosh()},BigNumber:function(e){return e.cosh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cosh is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createCosh=l},7812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCot=void 0;var n=r(58450),a=r(30401),i=r(18001),o=["typed","BigNumber"],s=(0,n.factory)("cot",o,(function(e){var t=e.typed,r=e.BigNumber;return t("cot",{number:i.cotNumber,Complex:function(e){return e.cot()},BigNumber:function(e){return new r(1).div(e.tan())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createCot=s},72115:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCoth=void 0;var n=r(58450),a=r(30401),i=r(18001),o="coth",s=["typed","BigNumber"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.BigNumber;return t(o,{number:i.cothNumber,Complex:function(e){return e.coth()},BigNumber:function(e){return new r(1).div(e.tanh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function coth is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createCoth=l},96738:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsc=void 0;var n=r(58450),a=r(30401),i=r(18001),o=["typed","BigNumber"],s=(0,n.factory)("csc",o,(function(e){var t=e.typed,r=e.BigNumber;return t("csc",{number:i.cscNumber,Complex:function(e){return e.csc()},BigNumber:function(e){return new r(1).div(e.sin())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csc is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createCsc=s},70222:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsch=void 0;var n=r(58450),a=r(30401),i=r(18001),o="csch",s=["typed","BigNumber"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.BigNumber;return t(o,{number:i.cschNumber,Complex:function(e){return e.csch()},BigNumber:function(e){return new r(1).div(e.sinh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csch is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createCsch=l},98675:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSec=void 0;var n=r(58450),a=r(30401),i=r(18001),o=["typed","BigNumber"],s=(0,n.factory)("sec",o,(function(e){var t=e.typed,r=e.BigNumber;return t("sec",{number:i.secNumber,Complex:function(e){return e.sec()},BigNumber:function(e){return new r(1).div(e.cos())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sec is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createSec=s},34817:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSech=void 0;var n=r(58450),a=r(30401),i=r(18001),o="sech",s=["typed","BigNumber"],l=(0,n.factory)(o,s,(function(e){var t=e.typed,r=e.BigNumber;return t(o,{number:i.sechNumber,Complex:function(e){return e.sech()},BigNumber:function(e){return new r(1).div(e.cosh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sech is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createSech=l},36527:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSin=void 0;var n=r(58450),a=r(30401),i=["typed"],o=(0,n.factory)("sin",i,(function(e){return(0,e.typed)("sin",{number:Math.sin,Complex:function(e){return e.sin()},BigNumber:function(e){return e.sin()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sin is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)}})}));t.createSin=o},41537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSinh=void 0;var n=r(58450),a=r(30401),i=r(18001),o="sinh",s=["typed"],l=(0,n.factory)(o,s,(function(e){return(0,e.typed)(o,{number:i.sinhNumber,Complex:function(e){return e.sinh()},BigNumber:function(e){return e.sinh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sinh is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)}})}));t.createSinh=l},83117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTan=void 0;var n=r(58450),a=r(30401),i=["typed"],o=(0,n.factory)("tan",i,(function(e){return(0,e.typed)("tan",{number:Math.tan,Complex:function(e){return e.tan()},BigNumber:function(e){return e.tan()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tan is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)}})}));t.createTan=o},3405:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTanh=void 0;var n=r(58450),a=r(30401),i=r(49473),o=["typed"],s=(0,n.factory)("tanh",o,(function(e){return(0,e.typed)("tanh",{number:i.tanh,Complex:function(e){return e.tanh()},BigNumber:function(e){return e.tanh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tanh is no angle");return this(e.value)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this,!0)}})}));t.createTanh=s},84583:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTo=void 0;var n=r(58450),a=r(46752),i=r(99826),o=["typed","matrix"],s=(0,n.factory)("to",o,(function(e){var t=e.typed,r=e.matrix,n=(0,a.createAlgorithm13)({typed:t}),o=(0,i.createAlgorithm14)({typed:t});return t("to",{"Unit, Unit | string":function(e,t){return e.to(t)},"Matrix, Matrix":function(e,t){return n(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"Matrix, any":function(e,t){return o(e,t,this,!1)},"any, Matrix":function(e,t){return o(t,e,this,!0)},"Array, any":function(e,t){return o(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return o(r(t),e,this,!0).valueOf()}})}));t.createTo=s},12558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createClone=void 0;var n=r(54699),a=r(58450),i="clone",o=["typed"],s=(0,a.factory)(i,o,(function(e){return(0,e.typed)(i,{any:n.clone})}));t.createClone=s},65582:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHasNumericValue=void 0;var n=r(58450),a="hasNumericValue",i=["typed","isNumeric"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.isNumeric;return t(a,{string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return r(e)}})}));t.createHasNumericValue=o},46950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsInteger=void 0;var n=r(30401),a=r(49473),i=r(58450),o="isInteger",s=["typed"],l=(0,i.factory)(o,s,(function(e){return(0,e.typed)(o,{number:a.isInteger,BigNumber:function(e){return e.isInt()},Fraction:function(e){return 1===e.d&&isFinite(e.n)},"Array | Matrix":function(e){return(0,n.deepMap)(e,this)}})}));t.createIsInteger=l},19454:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsNaN=void 0;var n=r(30401),a=r(58450),i=r(18001),o="isNaN",s=["typed"],l=(0,a.factory)(o,s,(function(e){return(0,e.typed)(o,{number:i.isNaNNumber,BigNumber:function(e){return e.isNaN()},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},"Array | Matrix":function(e){return(0,n.deepMap)(e,Number.isNaN)}})}));t.createIsNaN=l},6299:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsNegative=void 0;var n=r(30401),a=r(58450),i=r(18001),o="isNegative",s=["typed"],l=(0,a.factory)(o,s,(function(e){return(0,e.typed)(o,{number:i.isNegativeNumber,BigNumber:function(e){return e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s<0},Unit:function(e){return this(e.value)},"Array | Matrix":function(e){return(0,n.deepMap)(e,this)}})}));t.createIsNegative=l},70353:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsNumeric=void 0;var n=r(30401),a=r(58450),i="isNumeric",o=["typed"],s=(0,a.factory)(i,o,(function(e){return(0,e.typed)(i,{"number | BigNumber | Fraction | boolean":function(){return!0},"Complex | Unit | string | null | undefined | Node":function(){return!1},"Array | Matrix":function(e){return(0,n.deepMap)(e,this)}})}));t.createIsNumeric=s},69402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsPositive=void 0;var n=r(30401),a=r(58450),i=r(18001),o="isPositive",s=["typed"],l=(0,a.factory)(o,s,(function(e){return(0,e.typed)(o,{number:i.isPositiveNumber,BigNumber:function(e){return!e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s>0&&e.n>0},Unit:function(e){return this(e.value)},"Array | Matrix":function(e){return(0,n.deepMap)(e,this)}})}));t.createIsPositive=l},91059:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsPrime=void 0;var n=r(30401),a=r(58450),i="isPrime",o=["typed"],s=(0,a.factory)(i,o,(function(e){return(0,e.typed)(i,{number:function(e){if(0*e!=0)return!1;if(e<=3)return e>1;if(e%2==0||e%3==0)return!1;for(var t=5;t*t<=e;t+=6)if(e%t==0||e%(t+2)==0)return!1;return!0},BigNumber:function(e){if(0*e.toNumber()!=0)return!1;if(e.lte(3))return e.gt(1);if(e.mod(2).eq(0)||e.mod(3).eq(0))return!1;if(e.lt(Math.pow(2,32))){for(var t=e.toNumber(),r=5;r*r<=t;r+=6)if(t%r==0||t%(r+2)==0)return!1;return!0}function n(e,t,r){for(var n=1;!t.eq(0);)t.mod(2).eq(0)?(t=t.div(2),e=e.mul(e).mod(r)):(t=t.sub(1),n=e.mul(n).mod(r));return n}for(var a=e.constructor.clone({precision:2*e.toFixed(0).length}),i=0,o=(e=new a(e)).sub(1);o.mod(2).eq(0);)o=o.div(2),i+=1;var s=null;if(e.lt("3317044064679887385961981"))s=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter((function(t){return t<e}));else{var l=Math.min(e.toNumber()-2,Math.floor(2*Math.pow(e.toFixed(0).length*Math.log(10),2)));s=[];for(var c=2;c<=l;c+=1)s.push(l)}for(var u=0;u<s.length;u+=1){var f=s[u],p=n(e.sub(e).add(f),o,e);if(!p.eq(1))for(var h=0,d=p;!d.eq(e.sub(1));h+=1,d=d.mul(d).mod(e))if(h===i-1)return!1}return!0},"Array | Matrix":function(e){return(0,n.deepMap)(e,this)}})}));t.createIsPrime=s},70562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsZero=void 0;var n=r(30401),a=r(58450),i=r(18001),o="isZero",s=["typed"],l=(0,a.factory)(o,s,(function(e){return(0,e.typed)(o,{number:i.isZeroNumber,BigNumber:function(e){return e.isZero()},Complex:function(e){return 0===e.re&&0===e.im},Fraction:function(e){return 1===e.d&&0===e.n},Unit:function(e){return this(e.value)},"Array | Matrix":function(e){return(0,n.deepMap)(e,this)}})}));t.createIsZero=l},79847:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNumeric=void 0;var n=r(57237),a=r(58450),i=r(10935),o=["number","?bignumber","?fraction"],s=(0,a.factory)("numeric",o,(function(e){var t=e.number,r=e.bignumber,a=e.fraction,o={string:!0,number:!0,BigNumber:!0,Fraction:!0},s={number:function(e){return t(e)},BigNumber:r?function(e){return r(e)}:i.noBignumber,Fraction:a?function(e){return a(e)}:i.noFraction};return function(e,t){var r=(0,n.typeOf)(e);if(!(r in o))throw new TypeError("Cannot convert "+e+' of type "'+r+'"; valid input types are '+Object.keys(o).join(", "));if(!(t in s))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(s).join(", "));return t===r?e:s[t](e)}}));t.createNumeric=s},36039:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTypeOf=void 0;var n=r(58450),a=r(57237),i="typeOf",o=["typed"],s=(0,n.factory)(i,o,(function(e){return(0,e.typed)(i,{any:a.typeOf})}));t.createTypeOf=s},52173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7649);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))}))},70041:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createReplacer=void 0;var n=[],a=(0,r(58450).factory)("replacer",n,(function(){return function(e,t){return"number"!=typeof t||isFinite(t)&&!isNaN(t)?t:{mathjs:"number",value:String(t)}}}));t.createReplacer=a},98071:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createReviver=void 0;var n=["classes"],a=(0,r(58450).factory)("reviver",n,(function(e){var t=e.classes;return function(e,r){var n=t[r&&r.mathjs];return n&&"function"==typeof n.fromJSON?n.fromJSON(r):r}}));t.createReviver=a},92385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.absNumber=o,t.addNumber=s,t.cbrtNumber=h,t.ceilNumber=d,t.cubeNumber=m,t.divideNumber=u,t.expNumber=g,t.expm1Number=y,t.fixNumber=v,t.floorNumber=b,t.gcdNumber=x,t.lcmNumber=_,t.log10Number=k,t.log1pNumber=T,t.log2Number=D,t.logNumber=w,t.modNumber=A,t.multiplyNumber=c,t.normNumber=P,t.nthRootNumber=S,t.powNumber=O,t.roundNumber=I,t.signNumber=M,t.sqrtNumber=E,t.squareNumber=C,t.subtractNumber=l,t.unaryMinusNumber=f,t.unaryPlusNumber=p,t.xgcdNumber=N;var n=r(49473),a="number",i="number, number";function o(e){return Math.abs(e)}function s(e,t){return e+t}function l(e,t){return e-t}function c(e,t){return e*t}function u(e,t){return e/t}function f(e){return-e}function p(e){return e}function h(e){return(0,n.cbrt)(e)}function d(e){return Math.ceil(e)}function m(e){return e*e*e}function g(e){return Math.exp(e)}function y(e){return(0,n.expm1)(e)}function v(e){return e>0?Math.floor(e):Math.ceil(e)}function b(e){return Math.floor(e)}function x(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Parameters in function gcd must be integer numbers");for(var r;0!==t;)r=e%t,e=t,t=r;return e<0?-e:e}function _(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var r,a=e*t;0!==t;)t=e%(r=t),e=r;return Math.abs(a/e)}function w(e){return Math.log(e)}function k(e){return(0,n.log10)(e)}function D(e){return(0,n.log2)(e)}function T(e){return(0,n.log1p)(e)}function A(e,t){if(t>0)return e-t*Math.floor(e/t);if(0===t)return e;throw new Error("Cannot calculate mod for a negative divisor")}function S(e,t){var r=t<0;if(r&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function M(e){return(0,n.sign)(e)}function E(e){return Math.sqrt(e)}function C(e){return e*e}function N(e,t){var r,a,i,o=0,s=1,l=1,c=0;if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)i=e-(a=Math.floor(e/t))*t,r=o,o=s-a*o,s=r,r=l,l=c-a*l,c=r,e=t,t=i;return e<0?[-e,-s,-c]:[e,e?s:0,c]}function O(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return parseFloat((0,n.toFixed)(e,t))}function P(e){return Math.abs(e)}o.signature=a,s.signature=i,l.signature=i,c.signature=i,u.signature=i,f.signature=a,p.signature=a,h.signature=a,d.signature=a,m.signature=a,g.signature=a,y.signature=a,v.signature=a,b.signature=a,x.signature=i,_.signature=i,w.signature=a,k.signature=a,D.signature=a,T.signature=a,A.signature=i,S.signature=i,M.signature=a,E.signature=a,C.signature=a,N.signature=i,O.signature=i,I.signature=i,P.signature=a},1216:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitAndNumber=i,t.bitNotNumber=o,t.bitOrNumber=s,t.bitXorNumber=l,t.leftShiftNumber=c,t.rightArithShiftNumber=u,t.rightLogShiftNumber=f;var n=r(49473),a="number, number";function i(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function bitAnd");return e&t}function o(e){if(!(0,n.isInteger)(e))throw new Error("Integer expected in function bitNot");return~e}function s(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function bitOr");return e|t}function l(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function bitXor");return e^t}function c(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function leftShift");return e<<t}function u(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function rightArithShift");return e>>t}function f(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}i.signature=a,o.signature="number",s.signature=a,l.signature=a,c.signature=a,u.signature=a,f.signature=a},67276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combinationsNumber=i;var n=r(49473),a=r(7852);function i(e,t){if(!(0,n.isInteger)(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!(0,n.isInteger)(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");var r=e-t;return t<r?(0,a.product)(r+1,e)/(0,a.product)(1,t):(0,a.product)(t+1,e)/(0,a.product)(1,r)}i.signature="number, number"},27841:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tau=t.pi=t.phi=t.e=void 0;var r=Math.PI;t.pi=r;var n=2*Math.PI;t.tau=n;var a=Math.E;t.e=a,t.phi=1.618033988749895},18001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(92385);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))}));var a=r(1216);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var i=r(67276);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}));var o=r(27841);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var s=r(17878);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var l=r(21960);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))}));var c=r(78577);Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))}));var u=r(70167);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===u[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}}))}));var f=r(73298);Object.keys(f).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===f[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return f[e]}}))}))},17878:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.andNumber=o,t.notNumber=n,t.orNumber=a,t.xorNumber=i;var r="number, number";function n(e){return!e}function a(e,t){return!(!e&&!t)}function i(e,t){return!!e!=!!t}function o(e,t){return!(!e||!t)}n.signature="number",a.signature=r,i.signature=r,o.signature=r},78577:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gammaG=void 0,t.gammaNumber=i,t.gammaP=void 0;var n=r(49473),a=r(7852);function i(e){var t;if((0,n.isInteger)(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:(0,a.product)(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*i(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,l=r*e,c=l*e,u=c*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*l)-571/(2488320*c)+163879/(209018880*u)+5246819/(75246796800*u*e))}--e,t=s[0];for(var f=1;f<s.length;++f)t+=s[f]/(e+f);var p=e+o+.5;return Math.sqrt(2*Math.PI)*Math.pow(p,e+.5)*Math.exp(-p)*t}i.signature="number";var o=4.7421875;t.gammaG=o;var s=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];t.gammaP=s},21960:()=>{},70167:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acosNumber=i,t.acoshNumber=o,t.acotNumber=s,t.acothNumber=l,t.acscNumber=c,t.acschNumber=u,t.asecNumber=f,t.asechNumber=p,t.asinNumber=h,t.asinhNumber=d,t.atan2Number=g,t.atanNumber=m,t.atanhNumber=y,t.cosNumber=v,t.coshNumber=b,t.cotNumber=x,t.cothNumber=_,t.cscNumber=w,t.cschNumber=k,t.secNumber=D,t.sechNumber=T,t.sinNumber=A,t.sinhNumber=S,t.tanNumber=M,t.tanhNumber=E;var n=r(49473),a="number";function i(e){return Math.acos(e)}function o(e){return(0,n.acosh)(e)}function s(e){return Math.atan(1/e)}function l(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function c(e){return Math.asin(1/e)}function u(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function f(e){return Math.acos(1/e)}function p(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}function h(e){return Math.asin(e)}function d(e){return(0,n.asinh)(e)}function m(e){return Math.atan(e)}function g(e,t){return Math.atan2(e,t)}function y(e){return(0,n.atanh)(e)}function v(e){return Math.cos(e)}function b(e){return(0,n.cosh)(e)}function x(e){return 1/Math.tan(e)}function _(e){var t=Math.exp(2*e);return(t+1)/(t-1)}function w(e){return 1/Math.sin(e)}function k(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*(0,n.sign)(e)}function D(e){return 1/Math.cos(e)}function T(e){return 2/(Math.exp(e)+Math.exp(-e))}function A(e){return Math.sin(e)}function S(e){return(0,n.sinh)(e)}function M(e){return Math.tan(e)}function E(e){return(0,n.tanh)(e)}i.signature=a,o.signature=a,s.signature=a,l.signature=a,c.signature=a,u.signature=a,f.signature=a,p.signature=a,h.signature=a,d.signature=a,m.signature=a,g.signature="number, number",y.signature=a,v.signature=a,b.signature=a,x.signature=a,_.signature=a,w.signature=a,k.signature=a,D.signature=a,T.signature=a,A.signature=a,S.signature=a,M.signature=a,E.signature=a},73298:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIntegerNumber=i,t.isNaNNumber=c,t.isNegativeNumber=o,t.isPositiveNumber=s,t.isZeroNumber=l;var n=r(49473),a="number";function i(e){return(0,n.isInteger)(e)}function o(e){return e<0}function s(e){return e>0}function l(e){return 0===e}function c(e){return Number.isNaN(e)}i.signature=a,o.signature=a,s.signature=a,l.signature=a,c.signature=a},31002:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createBigNumberClass=void 0;var a=n(r(46962)),i=["?on","config"],o=(0,r(58450).factory)("BigNumber",i,(function(e){var t=e.on,r=e.config,n=a.default.clone({precision:r.precision,modulo:a.default.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(e){return new n(e.value)},t&&t("config",(function(e,t){e.precision!==t.precision&&n.config({precision:e.precision})})),n}),{isClass:!0});t.createBigNumberClass=o},10307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBignumber=void 0;var n=r(58450),a=r(30401),i=["typed","BigNumber"],o=(0,n.factory)("bignumber",i,(function(e){var t=e.typed,r=e.BigNumber;return t("bignumber",{"":function(){return new r(0)},number:function(e){return new r(e+"")},string:function(e){var t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){var n=t[2],a=r(t[1]),i=new r(2).pow(Number(n));if(a.gt(i.sub(1)))throw new SyntaxError('String "'.concat(e,'" is out of range'));var o=new r(2).pow(Number(n)-1);return a.gte(o)?a.sub(i):a}return new r(e)},BigNumber:function(e){return e},Fraction:function(e){return new r(e.n).div(e.d).times(e.s)},null:function(e){return new r(0)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createBignumber=o},54872:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBoolean=void 0;var n=r(58450),a=r(30401),i="boolean",o=["typed"],s=(0,n.factory)(i,o,(function(e){return(0,e.typed)(i,{"":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){var t=e.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;var r=Number(e);if(""!==e&&!isNaN(r))return!!r;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createBoolean=s},39436:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createChainClass=void 0;var n=r(57237),a=r(59398),i=r(54699),o=["?on","math"],s=(0,r(58450).factory)("Chain",o,(function(e){var t=e.on,r=e.math;function o(e){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");(0,n.isChain)(e)?this.value=e.value:this.value=e}function s(e,t){(0,i.lazy)(o.prototype,e,(function(){var e=t();if("function"==typeof e)return l(e)}))}function l(e){return function(){for(var t=[this.value],r=0;r<arguments.length;r++)t[r+1]=arguments[r];return new o(e.apply(e,t))}}o.prototype.type="Chain",o.prototype.isChain=!0,o.prototype.done=function(){return this.value},o.prototype.valueOf=function(){return this.value},o.prototype.toString=function(){return(0,a.format)(this.value)},o.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},o.fromJSON=function(e){return new o(e.value)},o.createProxy=function(e,t){if("string"==typeof e)!function(e,t){"function"==typeof t&&(o.prototype[e]=l(t))}(e,t);else{var r=function(t){(0,i.hasOwnProperty)(e,t)&&void 0===c[t]&&s(t,(function(){return e[t]}))};for(var n in e)r(n)}};var c={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return o.createProxy(r),t&&t("import",(function(e,t,r){r||s(e,t)})),o}),{isClass:!0});t.createChainClass=s},22782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createChain=void 0;var n=r(58450),a="chain",i=["typed","Chain"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.Chain;return t(a,{"":function(){return new r},any:function(e){return new r(e)}})}));t.createChain=o},99409:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createComplexClass=void 0;var a=n(r(80812)),i=n(r(90914)),o=r(49473),s=r(57237),l=[],c=(0,r(58450).factory)("Complex",l,(function(){return i.default.prototype.type="Complex",i.default.prototype.isComplex=!0,i.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},i.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},i.default.prototype.format=function(e){var t=this.im,r=this.re,n=(0,o.format)(this.re,e),a=(0,o.format)(this.im,e),i=(0,s.isNumber)(e)?e:e?e.precision:null;if(null!==i){var l=Math.pow(10,-i);Math.abs(r/t)<l&&(r=0),Math.abs(t/r)<l&&(t=0)}return 0===t?n:0===r?1===t?"i":-1===t?"-i":a+"i":t<0?-1===t?n+" - i":n+" - "+a.substring(1)+"i":1===t?n+" + i":n+" + "+a+"i"},i.default.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"===(0,a.default)(t))return(0,i.default)(t);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var r=arguments[0],n=arguments[1];if((0,s.isNumber)(r)){if((0,s.isUnit)(n)&&n.hasBase("ANGLE")&&(n=n.toNumber("rad")),(0,s.isNumber)(n))return new i.default({r,phi:n});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},i.default.prototype.valueOf=i.default.prototype.toString,i.default.fromJSON=function(e){return new i.default(e)},i.default.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},i.default}),{isClass:!0});t.createComplexClass=c},59252:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createComplex=void 0;var n=r(58450),a=r(30401),i=["typed","Complex"],o=(0,n.factory)("complex",i,(function(e){var t=e.typed,r=e.Complex;return t("complex",{"":function(){return r.ZERO},number:function(e){return new r(e,0)},"number, number":function(e,t){return new r(e,t)},"BigNumber, BigNumber":function(e,t){return new r(e.toNumber(),t.toNumber())},Fraction:function(e){return new r(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return r(e)},null:function(e){return r(0)},Object:function(e){if("re"in e&&"im"in e)return new r(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new r(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createComplex=o},73639:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createFractionClass=void 0;var a=n(r(91621)),i=[],o=(0,r(58450).factory)("Fraction",i,(function(){return a.default.prototype.type="Fraction",a.default.prototype.isFraction=!0,a.default.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},a.default.fromJSON=function(e){return new a.default(e)},a.default}),{isClass:!0});t.createFractionClass=o},84558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFraction=void 0;var n=r(58450),a=r(30401),i=["typed","Fraction"],o=(0,n.factory)("fraction",i,(function(e){var t=e.typed,r=e.Fraction;return t("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new r(e)},string:function(e){return new r(e)},"number, number":function(e,t){return new r(e,t)},null:function(e){return new r(0)},BigNumber:function(e){return new r(e.toString())},Fraction:function(e){return e},Object:function(e){return new r(e)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createFraction=o},47392:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createDenseMatrixClass=void 0;var a=n(r(28962)),i=r(57237),o=r(70517),s=r(59398),l=r(49473),c=r(54699),u=r(12906);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var p=["Matrix"],h=(0,r(58450).factory)("DenseMatrix",p,(function(e){var t=e.Matrix;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!(0,i.isString)(t))throw new Error("Invalid datatype: "+t);if((0,i.isMatrix)(e))"DenseMatrix"===e.type?(this._data=(0,c.clone)(e._data),this._size=(0,c.clone)(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&(0,i.isArray)(e.data)&&(0,i.isArray)(e.size))this._data=e.data,this._size=e.size,(0,o.validate)(this._data,this._size),this._datatype=t||e.datatype;else if((0,i.isArray)(e))this._data=y(e),this._size=(0,o.arraySize)(this._data),(0,o.validate)(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+(0,i.typeOf)(e)+")");this._data=[],this._size=[0],this._datatype=t}}function n(e,t){if(!(0,i.isIndex)(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var n=t.size();if(n.length!==e._size.length)throw new u.DimensionError(n.length,e._size.length);for(var a=t.min(),s=t.max(),l=0,c=e._size.length;l<c;l++)(0,o.validateIndex)(a[l],e._size[l]),(0,o.validateIndex)(s[l],e._size[l]);return new r(p(e._data,t,n.length,0),e._datatype)}function p(e,t,r,n){var a=n===r-1,i=t.dimension(n);return a?i.map((function(t){return(0,o.validateIndex)(t,e.length),e[t]})).valueOf():i.map((function(a){return(0,o.validateIndex)(a,e.length),p(e[a],t,r,n+1)})).valueOf()}function h(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var a,s=t.size(),l=t.isScalar();if((0,i.isMatrix)(r)?(a=r.size(),r=r.valueOf()):a=(0,o.arraySize)(r),l){if(0!==a.length)throw new TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(s.length<e._size.length)throw new u.DimensionError(s.length,e._size.length,"<");if(a.length<s.length){for(var f=0,p=0;1===s[f]&&1===a[f];)f++;for(;1===s[f];)p++,f++;r=(0,o.unsqueeze)(r,s.length,p,a)}if(!(0,c.deepStrictEqual)(s,a))throw new u.DimensionError(s,a,">");var h=t.max().map((function(e){return e+1}));g(e,h,n);var m=s.length;d(e._data,t,r,m,0)}return e}function d(e,t,r,n,a){var i=a===n-1,s=t.dimension(a);i?s.forEach((function(t,n){(0,o.validateIndex)(t),e[t]=r[n[0]]})):s.forEach((function(i,s){(0,o.validateIndex)(i),d(e[i],t,r[s[0]],n,a+1)}))}function m(e,t,r){if(0===t.length){for(var n=e._data;(0,i.isArray)(n);)n=n[0];return n}return e._size=t.slice(0),e._data=(0,o.resize)(e._data,e._size,r),e}function g(e,t,r){for(var n=e._size.slice(0),a=!1;n.length<t.length;)n.push(0),a=!0;for(var i=0,o=t.length;i<o;i++)t[i]>n[i]&&(n[i]=t[i],a=!0);a&&m(e,n,r)}function y(e){for(var t=0,r=e.length;t<r;t++){var n=e[t];(0,i.isArray)(n)?e[t]=y(n):n&&!0===n.isMatrix&&(e[t]=y(n.valueOf()))}return e}return r.prototype=new t,r.prototype.createDenseMatrix=function(e,t){return new r(e,t)},r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return(0,o.getArrayDataType)(this._data,i.typeOf)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(e,t){return new r(e,t)},r.prototype.subset=function(e,t,r){switch(arguments.length){case 1:return n(this,e);case 2:case 3:return h(this,e,t,r);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(e){if(!(0,i.isArray)(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new u.DimensionError(e.length,this._size.length);for(var t=0;t<e.length;t++)(0,o.validateIndex)(e[t],this._size[t]);for(var r=this._data,n=0,a=e.length;n<a;n++){var s=e[n];(0,o.validateIndex)(s,r.length),r=r[s]}return r},r.prototype.set=function(e,t,r){if(!(0,i.isArray)(e))throw new TypeError("Array expected");if(e.length<this._size.length)throw new u.DimensionError(e.length,this._size.length,"<");var n,a,s,l=e.map((function(e){return e+1}));g(this,l,r);var c=this._data;for(n=0,a=e.length-1;n<a;n++)s=e[n],(0,o.validateIndex)(s,c.length),c=c[s];return s=e[e.length-1],(0,o.validateIndex)(s,c.length),c[s]=t,this},r.prototype.resize=function(e,t,r){if(!(0,i.isCollection)(e))throw new TypeError("Array or Matrix expected");var n=e.valueOf().map((function(e){return Array.isArray(e)&&1===e.length?e[0]:e}));return m(r?this.clone():this,n,t)},r.prototype.reshape=function(e,t){var r=t?this.clone():this;r._data=(0,o.reshape)(r._data,e);var n=r._size.reduce((function(e,t){return e*t}));return r._size=(0,o.processSizesWildcard)(e,n),r},r.prototype.clone=function(){return new r({data:(0,c.clone)(this._data),size:(0,c.clone)(this._size),datatype:this._datatype})},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(e){var t=this,n=function r(n,a){return(0,i.isArray)(n)?n.map((function(e,t){return r(e,a.concat(t))})):e(n,a,t)}(this._data,[]);return new r(n,void 0!==this._datatype?(0,o.getArrayDataType)(n,i.typeOf):void 0)},r.prototype.forEach=function(e){var t=this;!function r(n,a){(0,i.isArray)(n)?n.forEach((function(e,t){r(e,a.concat(t))})):e(n,a,t)}(this._data,[])},r.prototype[Symbol.iterator]=a.default.mark((function e(){var t;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.default.mark((function e(t,r){var n;return a.default.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!(0,i.isArray)(t)){a.next=9;break}n=0;case 2:if(!(n<t.length)){a.next=7;break}return a.delegateYield(e(t[n],r.concat(n)),"t0",4);case 4:n++,a.next=2;break;case 7:a.next=11;break;case 9:return a.next=11,{value:t,index:r};case 11:case"end":return a.stop()}}),e)})),e.delegateYield(t(this._data,[]),"t0",2);case 2:case"end":return e.stop()}}),e,this)})),r.prototype.rows=function(){var e=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");var t,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}(this._data);try{for(n.s();!(t=n.n()).done;){var a=t.value;e.push(new r([a],this._datatype))}}catch(e){n.e(e)}finally{n.f()}return e},r.prototype.columns=function(){var e=this,t=[],n=this.size();if(2!==n.length)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var a=this._data,i=function(n){var i=a.map((function(e){return[e[n]]}));t.push(new r(i,e._datatype))},o=0;o<n[1];o++)i(o);return t},r.prototype.toArray=function(){return(0,c.clone)(this._data)},r.prototype.valueOf=function(){return this._data},r.prototype.format=function(e){return(0,s.format)(this._data,e)},r.prototype.toString=function(){return(0,s.format)(this._data)},r.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(e){if(e){if((0,i.isBigNumber)(e)&&(e=e.toNumber()),!(0,i.isNumber)(e)||!(0,l.isInteger)(e))throw new TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,n=e<0?-e:0,a=this._size[0],o=this._size[1],s=Math.min(a-n,o-t),c=[],u=0;u<s;u++)c[u]=this._data[u+n][u+t];return new r({data:c,size:[s],datatype:this._datatype})},r.diagonal=function(e,t,n,a){if(!(0,i.isArray)(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if((0,i.isBigNumber)(e)&&(e=e.toNumber()),!(0,i.isNumber)(e)||!(0,l.isInteger)(e)||e<1)throw new Error("Size values must be positive integers");return e})),n){if((0,i.isBigNumber)(n)&&(n=n.toNumber()),!(0,i.isNumber)(n)||!(0,l.isInteger)(n))throw new TypeError("The parameter k must be an integer number")}else n=0;var s,c=n>0?n:0,u=n<0?-n:0,f=e[0],p=e[1],h=Math.min(f-u,p-c);if((0,i.isArray)(t)){if(t.length!==h)throw new Error("Invalid value array length");s=function(e){return t[e]}}else if((0,i.isMatrix)(t)){var d=t.size();if(1!==d.length||d[0]!==h)throw new Error("Invalid matrix length");s=function(e){return t.get([e])}}else s=function(){return t};a||(a=(0,i.isBigNumber)(s(0))?s(0).mul(0):0);var m=[];if(e.length>0){m=(0,o.resize)(m,e,a);for(var g=0;g<h;g++)m[g+u][g+c]=s(g)}return new r({data:m,size:[f,p]})},r.fromJSON=function(e){return new r(e)},r.prototype.swapRows=function(e,t){if(!((0,i.isNumber)(e)&&(0,l.isInteger)(e)&&(0,i.isNumber)(t)&&(0,l.isInteger)(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return(0,o.validateIndex)(e,this._size[0]),(0,o.validateIndex)(t,this._size[0]),r._swapRows(e,t,this._data),this},r._swapRows=function(e,t,r){var n=r[e];r[e]=r[t],r[t]=n},r}),{isClass:!0});t.createDenseMatrixClass=h},88525:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFibonacciHeapClass=void 0;var n=["smaller","larger"],a=(0,r(58450).factory)("FibonacciHeap",n,(function(e){var t=e.smaller,r=e.larger,n=1/Math.log((1+Math.sqrt(5))/2);function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function i(e,t,r){t.left.right=t.right,t.right.left=t.left,r.degree--,r.child===t&&(r.child=t.right),0===r.degree&&(r.child=null),t.left=e,t.right=e.right,e.right=t,t.right.left=t,t.parent=null,t.mark=!1}function o(e,t){var r=t.parent;r&&(t.mark?(i(e,t,r),o(r)):t.mark=!0)}a.prototype.type="FibonacciHeap",a.prototype.isFibonacciHeap=!0,a.prototype.insert=function(e,r){var n={key:e,value:r,degree:0};if(this._minimum){var a=this._minimum;n.left=a,n.right=a.right,a.right=n,n.right.left=n,t(e,a.key)&&(this._minimum=n)}else n.left=n,n.right=n,this._minimum=n;return this._size++,n},a.prototype.size=function(){return this._size},a.prototype.clear=function(){this._minimum=null,this._size=0},a.prototype.isEmpty=function(){return 0===this._size},a.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var a=this._minimum,i=e.degree,o=e.child;i>0;){var l=o.right;o.left.right=o.right,o.right.left=o.left,o.left=a,o.right=a.right,a.right=o,o.right.left=o,o.parent=null,o=l,i--}return e.left.right=e.right,e.right.left=e.left,a=e===e.right?null:function(e,a){var i,o=Math.floor(Math.log(a)*n)+1,l=new Array(o),c=0,u=e;if(u)for(c++,u=u.right;u!==e;)c++,u=u.right;for(;c>0;){for(var f=u.degree,p=u.right;i=l[f];){if(r(u.key,i.key)){var h=i;i=u,u=h}s(i,u),l[f]=null,f++}l[f]=u,u=p,c--}e=null;for(var d=0;d<o;d++)(i=l[d])&&(e?(i.left.right=i.right,i.right.left=i.left,i.left=e,i.right=e.right,e.right=i,i.right.left=i,t(i.key,e.key)&&(e=i)):e=i);return e}(a=e.right,this._size),this._size--,this._minimum=a,e},a.prototype.remove=function(e){this._minimum=function(e,r,n){r.key=-1;var a=r.parent;return a&&t(r.key,a.key)&&(i(e,r,a),o(e,a)),t(r.key,e.key)&&(e=r),e}(this._minimum,e),this.extractMinimum()};var s=function(e,t){e.left.right=e.right,e.right.left=e.left,e.parent=t,t.child?(e.left=t.child,e.right=t.child.right,t.child.right=e,e.right.left=e):(t.child=e,e.right=e,e.left=e),t.degree++,e.mark=!1};return a}),{isClass:!0});t.createFibonacciHeapClass=a},21551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createImmutableDenseMatrixClass=void 0;var n=r(57237),a=r(54699),i=["smaller","DenseMatrix"],o=(0,r(58450).factory)("ImmutableDenseMatrix",i,(function(e){var t=e.smaller,r=e.DenseMatrix;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!(0,n.isString)(t))throw new Error("Invalid datatype: "+t);if((0,n.isMatrix)(e)||(0,n.isArray)(e)){var a=new r(e,t);this._data=a._data,this._size=a._size,this._datatype=a._datatype,this._min=null,this._max=null}else if(e&&(0,n.isArray)(e.data)&&(0,n.isArray)(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+(0,n.typeOf)(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return i.prototype=new r,i.prototype.type="ImmutableDenseMatrix",i.prototype.isImmutableDenseMatrix=!0,i.prototype.subset=function(e){switch(arguments.length){case 1:var t=r.prototype.subset.call(this,e);return(0,n.isMatrix)(t)?new i({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},i.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},i.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},i.prototype.clone=function(){return new i({data:(0,a.clone)(this._data),size:(0,a.clone)(this._size),datatype:this._datatype})},i.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},i.fromJSON=function(e){return new i(e)},i.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},i.prototype.min=function(){if(null===this._min){var e=null;this.forEach((function(r){(null===e||t(r,e))&&(e=r)})),this._min=null!==e?e:void 0}return this._min},i.prototype.max=function(){if(null===this._max){var e=null;this.forEach((function(r){(null===e||t(e,r))&&(e=r)})),this._max=null!==e?e:void 0}return this._max},i}),{isClass:!0});t.createImmutableDenseMatrixClass=o},8797:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatrixClass=void 0;var n=[],a=(0,r(58450).factory)("Matrix",n,(function(){function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e}),{isClass:!0});t.createMatrixClass=a},51450:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIndexClass=void 0;var n=r(57237),a=r(54699),i=r(49473),o=["ImmutableDenseMatrix"],s=(0,r(58450).factory)("Index",o,(function(e){var t=e.ImmutableDenseMatrix;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._isScalar=!0;for(var t=0,a=arguments.length;t<a;t++){var i=arguments[t];if((0,n.isRange)(i))this._dimensions.push(i),this._isScalar=!1;else if(Array.isArray(i)||(0,n.isMatrix)(i)){var s=o(i.valueOf());this._dimensions.push(s);var l=s.size();1===l.length&&1===l[0]||(this._isScalar=!1)}else if("number"==typeof i)this._dimensions.push(o([i]));else{if("string"!=typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._dimensions.push(i)}}}function o(e){for(var r=0,n=e.length;r<n;r++)if("number"!=typeof e[r]||!(0,i.isInteger)(e[r]))throw new TypeError("Index parameters must be positive integer numbers");return new t(e)}return r.prototype.type="Index",r.prototype.isIndex=!0,r.prototype.clone=function(){var e=new r;return e._dimensions=(0,a.clone)(this._dimensions),e._isScalar=this._isScalar,e},r.create=function(e){var t=new r;return r.apply(t,e),t},r.prototype.size=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?1:n.size()[0]}return e},r.prototype.max=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?n:n.max()}return e},r.prototype.min=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?n:n.min()}return e},r.prototype.forEach=function(e){for(var t=0,r=this._dimensions.length;t<r;t++)e(this._dimensions[t],t,this)},r.prototype.dimension=function(e){return this._dimensions[e]||null},r.prototype.isObjectProperty=function(){return 1===this._dimensions.length&&"string"==typeof this._dimensions[0]},r.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},r.prototype.isScalar=function(){return this._isScalar},r.prototype.toArray=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e.push("string"==typeof n?n:n.toArray())}return e},r.prototype.valueOf=r.prototype.toArray,r.prototype.toString=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];"string"==typeof n?e.push(JSON.stringify(n)):e.push(n.toString())}return"["+e.join(", ")+"]"},r.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},r.fromJSON=function(e){return r.create(e.dimensions)},r}),{isClass:!0});t.createIndexClass=s},38382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRangeClass=void 0;var n=r(57237),a=r(49473),i=[],o=(0,r(58450).factory)("Range",i,(function(){function e(t,r,a){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=null!=t,o=null!=r,s=null!=a;if(i)if((0,n.isBigNumber)(t))t=t.toNumber();else if("number"!=typeof t)throw new TypeError("Parameter start must be a number");if(o)if((0,n.isBigNumber)(r))r=r.toNumber();else if("number"!=typeof r)throw new TypeError("Parameter end must be a number");if(s)if((0,n.isBigNumber)(a))a=a.toNumber();else if("number"!=typeof a)throw new TypeError("Parameter step must be a number");this.start=i?parseFloat(t):0,this.end=o?parseFloat(r):0,this.step=s?parseFloat(a):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if("string"!=typeof t)return null;var r=t.split(":").map((function(e){return parseFloat(e)}));if(r.some((function(e){return isNaN(e)})))return null;switch(r.length){case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[2],r[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var e=0,t=this.start,r=this.step,n=this.end-t;return(0,a.sign)(r)===(0,a.sign)(n)?e=Math.ceil(n/r):0===n&&(e=0),isNaN(e)&&(e=0),[e]},e.prototype.min=function(){var e=this.size()[0];return e>0?this.step>0?this.start:this.start+(e-1)*this.step:void 0},e.prototype.max=function(){var e=this.size()[0];return e>0?this.step>0?this.start+(e-1)*this.step:this.start:void 0},e.prototype.forEach=function(e){var t=this.start,r=this.step,n=this.end,a=0;if(r>0)for(;t<n;)e(t,[a],this),t+=r,a++;else if(r<0)for(;t>n;)e(t,[a],this),t+=r,a++},e.prototype.map=function(e){var t=[];return this.forEach((function(r,n,a){t[n[0]]=e(r,n,a)})),t},e.prototype.toArray=function(){var e=[];return this.forEach((function(t,r){e[r[0]]=t})),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){var t=(0,a.format)(this.start,e);return 1!==this.step&&(t+=":"+(0,a.format)(this.step,e)),t+":"+(0,a.format)(this.end,e)},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e}),{isClass:!0});t.createRangeClass=o},38173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSpaClass=void 0;var n=["addScalar","equalScalar","FibonacciHeap"],a=(0,r(58450).factory)("Spa",n,(function(e){var t=e.addScalar,r=e.equalScalar,n=e.FibonacciHeap;function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return a.prototype.type="Spa",a.prototype.isSpa=!0,a.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{var r=this._heap.insert(e,t);this._values[e]=r}},a.prototype.get=function(e){var t=this._values[e];return t?t.value:0},a.prototype.accumulate=function(e,r){var n=this._values[e];n?n.value=t(n.value,r):(n=this._heap.insert(e,r),this._values[e]=n)},a.prototype.forEach=function(e,t,n){var a=this._heap,i=this._values,o=[],s=a.extractMinimum();for(s&&o.push(s);s&&s.key<=t;)s.key>=e&&(r(s.value,0)||n(s.key,s.value,this)),(s=a.extractMinimum())&&o.push(s);for(var l=0;l<o.length;l++){var c=o[l];i[(s=a.insert(c.key,c.value)).key]=s}},a.prototype.swap=function(e,t){var r=this._values[e],n=this._values[t];if(!r&&n)r=this._heap.insert(e,n.value),this._heap.remove(n),this._values[e]=r,this._values[t]=void 0;else if(r&&!n)n=this._heap.insert(t,r.value),this._heap.remove(r),this._values[t]=n,this._values[e]=void 0;else if(r&&n){var a=r.value;r.value=n.value,n.value=a}},a}),{isClass:!0});t.createSpaClass=a},43031:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createSparseMatrixClass=void 0;var a=n(r(28962)),i=r(57237),o=r(49473),s=r(59398),l=r(54699),c=r(70517),u=r(58450),f=r(12906),p=["typed","equalScalar","Matrix"],h=(0,u.factory)("SparseMatrix",p,(function(e){var t=e.typed,r=e.equalScalar,n=e.Matrix;function u(e,t){if(!(this instanceof u))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!(0,i.isString)(t))throw new Error("Invalid datatype: "+t);if((0,i.isMatrix)(e))!function(e,t,r){"SparseMatrix"===t.type?(e._values=t._values?(0,l.clone)(t._values):void 0,e._index=(0,l.clone)(t._index),e._ptr=(0,l.clone)(t._ptr),e._size=(0,l.clone)(t._size),e._datatype=r||t._datatype):p(e,t.valueOf(),r||t._datatype)}(this,e,t);else if(e&&(0,i.isArray)(e.index)&&(0,i.isArray)(e.ptr)&&(0,i.isArray)(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if((0,i.isArray)(e))p(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+(0,i.typeOf)(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function p(e,n,a){e._values=[],e._index=[],e._ptr=[],e._datatype=a;var o=n.length,s=0,l=r,c=0;if((0,i.isString)(a)&&(l=t.find(r,[a,a])||r,c=t.convert(0,a)),o>0){var u=0;do{e._ptr.push(e._index.length);for(var f=0;f<o;f++){var p=n[f];if((0,i.isArray)(p)){if(0===u&&s<p.length&&(s=p.length),u<p.length){var h=p[u];l(h,c)||(e._values.push(h),e._index.push(f))}}else 0===u&&s<1&&(s=1),l(p,c)||(e._values.push(p),e._index.push(f))}u++}while(u<s)}e._ptr.push(e._index.length),e._size=[o,s]}function h(e,t){if(!(0,i.isIndex)(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r,n,a,o,s=t.size();if(s.length!==e._size.length)throw new f.DimensionError(s.length,e._size.length);var l=t.min(),p=t.max();for(r=0,n=e._size.length;r<n;r++)(0,c.validateIndex)(l[r],e._size[r]),(0,c.validateIndex)(p[r],e._size[r]);var h=e._values,d=e._index,m=e._ptr,g=t.dimension(0),y=t.dimension(1),v=[],b=[];g.forEach((function(e,t){b[e]=t[0],v[e]=!0}));var x=h?[]:void 0,_=[],w=[];return y.forEach((function(e){for(w.push(_.length),a=m[e],o=m[e+1];a<o;a++)r=d[a],!0===v[r]&&(_.push(b[r]),x&&x.push(h[a]))})),w.push(_.length),new u({values:x,index:_,ptr:w,size:s,datatype:e._datatype})}function d(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var a,o=t.size(),s=t.isScalar();if((0,i.isMatrix)(r)?(a=r.size(),r=r.toArray()):a=(0,c.arraySize)(r),s){if(0!==a.length)throw new TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(1!==o.length&&2!==o.length)throw new f.DimensionError(o.length,e._size.length,"<");if(a.length<o.length){for(var u=0,p=0;1===o[u]&&1===a[u];)u++;for(;1===o[u];)p++,u++;r=(0,c.unsqueeze)(r,o.length,p,a)}if(!(0,l.deepStrictEqual)(o,a))throw new f.DimensionError(o,a,">");for(var h=t.min()[0],d=t.min()[1],m=a[0],g=a[1],y=0;y<m;y++)for(var v=0;v<g;v++){var b=r[y][v];e.set([y+h,v+d],b,n)}}return e}function m(e,t,r,n){if(r-t==0)return r;for(var a=t;a<r;a++)if(n[a]===e)return a;return t}function g(e,t,r,n,a,i,o){a.splice(e,0,n),i.splice(e,0,t);for(var s=r+1;s<o.length;s++)o[s]++}function y(e,n,a,o){var s=o||0,l=r,c=0;(0,i.isString)(e._datatype)&&(l=t.find(r,[e._datatype,e._datatype])||r,c=t.convert(0,e._datatype),s=t.convert(s,e._datatype));var u,f,p,h=!l(s,c),d=e._size[0],m=e._size[1];if(a>m){for(f=m;f<a;f++)if(e._ptr[f]=e._values.length,h)for(u=0;u<d;u++)e._values.push(s),e._index.push(u);e._ptr[a]=e._values.length}else a<m&&(e._ptr.splice(a+1,m-a),e._values.splice(e._ptr[a],e._values.length),e._index.splice(e._ptr[a],e._index.length));if(m=a,n>d){if(h){var g=0;for(f=0;f<m;f++){e._ptr[f]=e._ptr[f]+g,p=e._ptr[f+1]+g;var y=0;for(u=d;u<n;u++,y++)e._values.splice(p+y,0,s),e._index.splice(p+y,0,u),g++}e._ptr[m]=e._values.length}}else if(n<d){var v=0;for(f=0;f<m;f++){e._ptr[f]=e._ptr[f]-v;var b=e._ptr[f],x=e._ptr[f+1]-v;for(p=b;p<x;p++)(u=e._index[p])>n-1&&(e._values.splice(p,1),e._index.splice(p,1),v++)}e._ptr[f]=e._values.length}return e._size[0]=n,e._size[1]=a,e}function v(e,t,r,n,a){var i,o,s=n[0],c=n[1],u=[];for(i=0;i<s;i++)for(u[i]=[],o=0;o<c;o++)u[i][o]=0;for(o=0;o<c;o++)for(var f=r[o],p=r[o+1],h=f;h<p;h++)u[i=t[h]][o]=e?a?(0,l.clone)(e[h]):e[h]:1;return u}return u.prototype=new n,u.prototype.createSparseMatrix=function(e,t){return new u(e,t)},u.prototype.type="SparseMatrix",u.prototype.isSparseMatrix=!0,u.prototype.getDataType=function(){return(0,c.getArrayDataType)(this._values,i.typeOf)},u.prototype.storage=function(){return"sparse"},u.prototype.datatype=function(){return this._datatype},u.prototype.create=function(e,t){return new u(e,t)},u.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},u.prototype.subset=function(e,t,r){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return h(this,e);case 2:case 3:return d(this,e,t,r);default:throw new SyntaxError("Wrong number of arguments")}},u.prototype.get=function(e){if(!(0,i.isArray)(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new f.DimensionError(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var t=e[0],r=e[1];(0,c.validateIndex)(t,this._size[0]),(0,c.validateIndex)(r,this._size[1]);var n=m(t,this._ptr[r],this._ptr[r+1],this._index);return n<this._ptr[r+1]&&this._index[n]===t?this._values[n]:0},u.prototype.set=function(e,n,a){if(!(0,i.isArray)(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new f.DimensionError(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var o=e[0],s=e[1],l=this._size[0],u=this._size[1],p=r,h=0;(0,i.isString)(this._datatype)&&(p=t.find(r,[this._datatype,this._datatype])||r,h=t.convert(0,this._datatype)),(o>l-1||s>u-1)&&(y(this,Math.max(o+1,l),Math.max(s+1,u),a),l=this._size[0],u=this._size[1]),(0,c.validateIndex)(o,l),(0,c.validateIndex)(s,u);var d=m(o,this._ptr[s],this._ptr[s+1],this._index);return d<this._ptr[s+1]&&this._index[d]===o?p(n,h)?function(e,t,r,n,a){r.splice(e,1),n.splice(e,1);for(var i=t+1;i<a.length;i++)a[i]--}(d,s,this._values,this._index,this._ptr):this._values[d]=n:g(d,o,s,n,this._values,this._index,this._ptr),this},u.prototype.resize=function(e,t,r){if(!(0,i.isCollection)(e))throw new TypeError("Array or Matrix expected");var n=e.valueOf().map((function(e){return Array.isArray(e)&&1===e.length?e[0]:e}));if(2!==n.length)throw new Error("Only two dimensions matrix are supported");return n.forEach((function(e){if(!(0,i.isNumber)(e)||!(0,o.isInteger)(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+(0,s.format)(n)+")")})),y(r?this.clone():this,n[0],n[1],t)},u.prototype.reshape=function(e,t){if(!(0,i.isArray)(e))throw new TypeError("Array expected");if(2!==e.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");e.forEach((function(t){if(!(0,i.isNumber)(t)||!(0,o.isInteger)(t)||t<=-2||0===t)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+(0,s.format)(e)+")")}));var r=this._size[0]*this._size[1];if(r!==(e=(0,c.processSizesWildcard)(e,r))[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var n=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return n;for(var a=[],l=0;l<n._ptr.length;l++)for(var u=0;u<n._ptr[l+1]-n._ptr[l];u++)a.push(l);for(var f=n._values.slice(),p=n._index.slice(),h=0;h<n._index.length;h++){var d=p[h],y=a[h],v=d*n._size[1]+y;a[h]=v%e[1],p[h]=Math.floor(v/e[1])}n._values.length=0,n._index.length=0,n._ptr.length=e[1]+1,n._size=e.slice();for(var b=0;b<n._ptr.length;b++)n._ptr[b]=0;for(var x=0;x<f.length;x++){var _=p[x],w=a[x],k=f[x];g(m(_,n._ptr[w],n._ptr[w+1],n._index),_,w,k,n._values,n._index,n._ptr)}return n},u.prototype.clone=function(){return new u({values:this._values?(0,l.clone)(this._values):void 0,index:(0,l.clone)(this._index),ptr:(0,l.clone)(this._ptr),size:(0,l.clone)(this._size),datatype:this._datatype})},u.prototype.size=function(){return this._size.slice(0)},u.prototype.map=function(e,n){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var a=this;return function(e,n,a,o,s,l,c){var f=[],p=[],h=[],d=r,m=0;(0,i.isString)(e._datatype)&&(d=t.find(r,[e._datatype,e._datatype])||r,m=t.convert(0,e._datatype));for(var g=function(e,t,r){e=l(e,t,r),d(e,m)||(f.push(e),p.push(t))},y=0;y<=s;y++){h.push(f.length);var v=e._ptr[y],b=e._ptr[y+1];if(c)for(var x=v;x<b;x++){var _=e._index[x];_>=0&&_<=a&&g(e._values[x],_-0,y-0)}else{for(var w={},k=v;k<b;k++)w[e._index[k]]=e._values[k];for(var D=0;D<=a;D++)g(D in w?w[D]:0,D-0,y-0)}}return h.push(f.length),new u({values:f,index:p,ptr:h,size:[a-0+1,s-0+1]})}(this,0,this._size[0]-1,0,this._size[1]-1,(function(t,r,n){return e(t,[r,n],a)}),n)},u.prototype.forEach=function(e,t){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var r=this._size[0],n=this._size[1],a=0;a<n;a++){var i=this._ptr[a],o=this._ptr[a+1];if(t)for(var s=i;s<o;s++){var l=this._index[s];e(this._values[s],[l,a],this)}else{for(var c={},u=i;u<o;u++)c[this._index[u]]=this._values[u];for(var f=0;f<r;f++)e(f in c?c[f]:0,[f,a],this)}}},u.prototype[Symbol.iterator]=a.default.mark((function e(){var t,r,n,i,o,s;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._values){e.next=2;break}throw new Error("Cannot iterate a Pattern only matrix");case 2:t=this._size[1],r=0;case 4:if(!(r<t)){e.next=18;break}n=this._ptr[r],i=this._ptr[r+1],o=n;case 8:if(!(o<i)){e.next=15;break}return s=this._index[o],e.next=12,{value:this._values[o],index:[s,r]};case 12:o++,e.next=8;break;case 15:r++,e.next=4;break;case 18:case"end":return e.stop()}}),e,this)})),u.prototype.toArray=function(){return v(this._values,this._index,this._ptr,this._size,!0)},u.prototype.valueOf=function(){return v(this._values,this._index,this._ptr,this._size,!1)},u.prototype.format=function(e){for(var t=this._size[0],r=this._size[1],n=this.density(),a="Sparse Matrix ["+(0,s.format)(t,e)+" x "+(0,s.format)(r,e)+"] density: "+(0,s.format)(n,e)+"\n",i=0;i<r;i++)for(var o=this._ptr[i],l=this._ptr[i+1],c=o;c<l;c++){var u=this._index[c];a+="\n    ("+(0,s.format)(u,e)+", "+(0,s.format)(i,e)+") ==> "+(this._values?(0,s.format)(this._values[c],e):"X")}return a},u.prototype.toString=function(){return(0,s.format)(this.toArray())},u.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},u.prototype.diagonal=function(e){if(e){if((0,i.isBigNumber)(e)&&(e=e.toNumber()),!(0,i.isNumber)(e)||!(0,o.isInteger)(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,r=e<0?-e:0,n=this._size[0],a=this._size[1],s=Math.min(n-r,a-t),l=[],c=[],f=[];f[0]=0;for(var p=t;p<a&&l.length<s;p++)for(var h=this._ptr[p],d=this._ptr[p+1],m=h;m<d;m++){var g=this._index[m];if(g===p-t+r){l.push(this._values[m]),c[l.length-1]=g-r;break}}return f.push(l.length),new u({values:l,index:c,ptr:f,size:[s,1]})},u.fromJSON=function(e){return new u(e)},u.diagonal=function(e,n,a,s,l){if(!(0,i.isArray)(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if((0,i.isBigNumber)(e)&&(e=e.toNumber()),!(0,i.isNumber)(e)||!(0,o.isInteger)(e)||e<1)throw new Error("Size values must be positive integers");return e})),a){if((0,i.isBigNumber)(a)&&(a=a.toNumber()),!(0,i.isNumber)(a)||!(0,o.isInteger)(a))throw new TypeError("The parameter k must be an integer number")}else a=0;var c=r,f=0;(0,i.isString)(l)&&(c=t.find(r,[l,l])||r,f=t.convert(0,l));var p,h=a>0?a:0,d=a<0?-a:0,m=e[0],g=e[1],y=Math.min(m-d,g-h);if((0,i.isArray)(n)){if(n.length!==y)throw new Error("Invalid value array length");p=function(e){return n[e]}}else if((0,i.isMatrix)(n)){var v=n.size();if(1!==v.length||v[0]!==y)throw new Error("Invalid matrix length");p=function(e){return n.get([e])}}else p=function(){return n};for(var b=[],x=[],_=[],w=0;w<g;w++){_.push(b.length);var k=w-h;if(k>=0&&k<y){var D=p(k);c(D,f)||(x.push(k+d),b.push(D))}}return _.push(b.length),new u({values:b,index:x,ptr:_,size:[m,g]})},u.prototype.swapRows=function(e,t){if(!((0,i.isNumber)(e)&&(0,o.isInteger)(e)&&(0,i.isNumber)(t)&&(0,o.isInteger)(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return(0,c.validateIndex)(e,this._size[0]),(0,c.validateIndex)(t,this._size[0]),u._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},u._forEachRow=function(e,t,r,n,a){for(var i=n[e],o=n[e+1],s=i;s<o;s++)a(r[s],t[s])},u._swapRows=function(e,t,r,n,a,i){for(var o=0;o<r;o++){var s=i[o],l=i[o+1],c=m(e,s,l,a),u=m(t,s,l,a);if(c<l&&u<l&&a[c]===e&&a[u]===t){if(n){var f=n[c];n[c]=n[u],n[u]=f}}else if(c<l&&a[c]===e&&(u>=l||a[u]!==t)){var p=n?n[c]:void 0;a.splice(u,0,t),n&&n.splice(u,0,p),a.splice(u<=c?c+1:c,1),n&&n.splice(u<=c?c+1:c,1)}else if(u<l&&a[u]===t&&(c>=l||a[c]!==e)){var h=n?n[u]:void 0;a.splice(c,0,e),n&&n.splice(c,0,h),a.splice(c<=u?u+1:u,1),n&&n.splice(c<=u?u+1:u,1)}}},u}),{isClass:!0});t.createSparseMatrixClass=h},94647:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIndex=void 0;var n=r(58450),a=r(57237),i="index",o=["typed","Index"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.Index;return t(i,{"...number | string | BigNumber | Range | Array | Matrix":function(e){var t=e.map((function(e){return(0,a.isBigNumber)(e)?e.toNumber():Array.isArray(e)||(0,a.isMatrix)(e)?e.map((function(e){return(0,a.isBigNumber)(e)?e.toNumber():e})):e})),n=new r;return r.apply(n,t),n}})}));t.createIndex=s},73458:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatrix=void 0;var n=r(58450),a="matrix",i=["typed","Matrix","DenseMatrix","SparseMatrix"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=(e.Matrix,e.DenseMatrix),n=e.SparseMatrix;return t(a,{"":function(){return i([])},string:function(e){return i([],e)},"string, string":function(e,t){return i([],e,t)},Array:function(e){return i(e)},Matrix:function(e){return i(e,e.storage())},"Array | Matrix, string":i,"Array | Matrix, string, string":i});function i(e,t,a){if("dense"===t||"default"===t||void 0===t)return new r(e,a);if("sparse"===t)return new n(e,a);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}}));t.createMatrix=o},71824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSparse=void 0;var n=r(58450),a="sparse",i=["typed","SparseMatrix"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.SparseMatrix;return t(a,{"":function(){return new r([])},string:function(e){return new r([],e)},"Array | Matrix":function(e){return new r(e)},"Array | Matrix, string":function(e,t){return new r(e,t)}})}));t.createSparse=o},40154:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm01=void 0;var n=r(58450),a=r(12906),i=["typed"],o=(0,n.factory)("algorithm01",i,(function(e){var t=e.typed;return function(e,r,n,i){var o=e._data,s=e._size,l=e._datatype,c=r._values,u=r._index,f=r._ptr,p=r._size,h=r._datatype;if(s.length!==p.length)throw new a.DimensionError(s.length,p.length);if(s[0]!==p[0]||s[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d,m,g=s[0],y=s[1],v="string"==typeof l&&l===h?l:void 0,b=v?t.find(n,[v,v]):n,x=[];for(d=0;d<g;d++)x[d]=[];var _=[],w=[];for(m=0;m<y;m++){for(var k=m+1,D=f[m],T=f[m+1],A=D;A<T;A++)_[d=u[A]]=i?b(c[A],o[d][m]):b(o[d][m],c[A]),w[d]=k;for(d=0;d<g;d++)w[d]===k?x[d][m]=_[d]:x[d][m]=o[d][m]}return e.createDenseMatrix({data:x,size:[g,y],datatype:v})}}));t.createAlgorithm01=o},343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm02=void 0;var n=r(58450),a=r(12906),i=["typed","equalScalar"],o=(0,n.factory)("algorithm02",i,(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i,o){var s=e._data,l=e._size,c=e._datatype,u=n._values,f=n._index,p=n._ptr,h=n._size,d=n._datatype;if(l.length!==h.length)throw new a.DimensionError(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m,g=l[0],y=l[1],v=r,b=0,x=i;"string"==typeof c&&c===d&&(m=c,v=t.find(r,[m,m]),b=t.convert(0,m),x=t.find(i,[m,m]));for(var _=[],w=[],k=[],D=0;D<y;D++){k[D]=w.length;for(var T=p[D],A=p[D+1],S=T;S<A;S++){var M=f[S],E=o?x(u[S],s[M][D]):x(s[M][D],u[S]);v(E,b)||(w.push(M),_.push(E))}}return k[y]=w.length,n.createSparseMatrix({values:_,index:w,ptr:k,size:[g,y],datatype:m})}}));t.createAlgorithm02=o},72177:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm03=void 0;var n=r(58450),a=r(12906),i=["typed"],o=(0,n.factory)("algorithm03",i,(function(e){var t=e.typed;return function(e,r,n,i){var o=e._data,s=e._size,l=e._datatype,c=r._values,u=r._index,f=r._ptr,p=r._size,h=r._datatype;if(s.length!==p.length)throw new a.DimensionError(s.length,p.length);if(s[0]!==p[0]||s[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d,m=s[0],g=s[1],y=0,v=n;"string"==typeof l&&l===h&&(d=l,y=t.convert(0,d),v=t.find(n,[d,d]));for(var b=[],x=0;x<m;x++)b[x]=[];for(var _=[],w=[],k=0;k<g;k++){for(var D=k+1,T=f[k],A=f[k+1],S=T;S<A;S++){var M=u[S];_[M]=i?v(c[S],o[M][k]):v(o[M][k],c[S]),w[M]=D}for(var E=0;E<m;E++)w[E]===D?b[E][k]=_[E]:b[E][k]=i?v(y,o[E][k]):v(o[E][k],y)}return e.createDenseMatrix({data:b,size:[m,g],datatype:d})}}));t.createAlgorithm03=o},51691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm04=void 0;var n=r(58450),a=r(12906),i=["typed","equalScalar"],o=(0,n.factory)("algorithm04",i,(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var o=e._values,s=e._index,l=e._ptr,c=e._size,u=e._datatype,f=n._values,p=n._index,h=n._ptr,d=n._size,m=n._datatype;if(c.length!==d.length)throw new a.DimensionError(c.length,d.length);if(c[0]!==d[0]||c[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+d+")");var g,y=c[0],v=c[1],b=r,x=0,_=i;"string"==typeof u&&u===m&&(g=u,b=t.find(r,[g,g]),x=t.convert(0,g),_=t.find(i,[g,g]));var w,k,D,T,A,S=o&&f?[]:void 0,M=[],E=[],C=o&&f?[]:void 0,N=o&&f?[]:void 0,O=[],I=[];for(k=0;k<v;k++){E[k]=M.length;var P=k+1;for(T=l[k],A=l[k+1],D=T;D<A;D++)w=s[D],M.push(w),O[w]=P,C&&(C[w]=o[D]);for(T=h[k],A=h[k+1],D=T;D<A;D++)if(O[w=p[D]]===P){if(C){var R=_(C[w],f[D]);b(R,x)?O[w]=null:C[w]=R}}else M.push(w),I[w]=P,N&&(N[w]=f[D]);if(C&&N)for(D=E[k];D<M.length;)O[w=M[D]]===P?(S[D]=C[w],D++):I[w]===P?(S[D]=N[w],D++):M.splice(D,1)}return E[v]=M.length,e.createSparseMatrix({values:S,index:M,ptr:E,size:[y,v],datatype:g})}}));t.createAlgorithm04=o},6272:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm05=void 0;var n=r(58450),a=r(12906),i=["typed","equalScalar"],o=(0,n.factory)("algorithm05",i,(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var o=e._values,s=e._index,l=e._ptr,c=e._size,u=e._datatype,f=n._values,p=n._index,h=n._ptr,d=n._size,m=n._datatype;if(c.length!==d.length)throw new a.DimensionError(c.length,d.length);if(c[0]!==d[0]||c[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+d+")");var g,y=c[0],v=c[1],b=r,x=0,_=i;"string"==typeof u&&u===m&&(g=u,b=t.find(r,[g,g]),x=t.convert(0,g),_=t.find(i,[g,g]));var w,k,D,T,A=o&&f?[]:void 0,S=[],M=[],E=A?[]:void 0,C=A?[]:void 0,N=[],O=[];for(k=0;k<v;k++){M[k]=S.length;var I=k+1;for(D=l[k],T=l[k+1];D<T;D++)w=s[D],S.push(w),N[w]=I,E&&(E[w]=o[D]);for(D=h[k],T=h[k+1];D<T;D++)N[w=p[D]]!==I&&S.push(w),O[w]=I,C&&(C[w]=f[D]);if(A)for(D=M[k];D<S.length;){var P=N[w=S[D]],R=O[w];if(P===I||R===I){var L=_(P===I?E[w]:x,R===I?C[w]:x);b(L,x)?S.splice(D,1):(A.push(L),D++)}}}return M[v]=S.length,e.createSparseMatrix({values:A,index:S,ptr:M,size:[y,v],datatype:g})}}));t.createAlgorithm05=o},99970:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm06=void 0;var n=r(58450),a=r(12906),i=r(30401),o=["typed","equalScalar"],s=(0,n.factory)("algorithm06",o,(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,o){var s=e._values,l=e._size,c=e._datatype,u=n._values,f=n._size,p=n._datatype;if(l.length!==f.length)throw new a.DimensionError(l.length,f.length);if(l[0]!==f[0]||l[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");var h,d=l[0],m=l[1],g=r,y=0,v=o;"string"==typeof c&&c===p&&(h=c,g=t.find(r,[h,h]),y=t.convert(0,h),v=t.find(o,[h,h]));for(var b=s&&u?[]:void 0,x=[],_=[],w=b?[]:void 0,k=[],D=[],T=0;T<m;T++){_[T]=x.length;var A=T+1;if((0,i.scatter)(e,T,k,w,D,A,x,v),(0,i.scatter)(n,T,k,w,D,A,x,v),w)for(var S=_[T];S<x.length;){var M=x[S];if(D[M]===A){var E=w[M];g(E,y)?x.splice(S,1):(b.push(E),S++)}else x.splice(S,1)}else for(var C=_[T];C<x.length;)D[x[C]]!==A?x.splice(C,1):C++}return _[m]=x.length,e.createSparseMatrix({values:b,index:x,ptr:_,size:[d,m],datatype:h})}}));t.createAlgorithm06=s},24692:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm07=void 0;var n=r(58450),a=r(12906),i=["typed","DenseMatrix"],o=(0,n.factory)("algorithm07",i,(function(e){var t=e.typed,r=e.DenseMatrix;return function(e,i,o){var s=e._size,l=e._datatype,c=i._size,u=i._datatype;if(s.length!==c.length)throw new a.DimensionError(s.length,c.length);if(s[0]!==c[0]||s[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+c+")");var f,p,h,d=s[0],m=s[1],g=0,y=o;"string"==typeof l&&l===u&&(f=l,g=t.convert(0,f),y=t.find(o,[f,f]));var v=[];for(p=0;p<d;p++)v[p]=[];var b=[],x=[],_=[],w=[];for(h=0;h<m;h++){var k=h+1;for(n(e,h,_,b,k),n(i,h,w,x,k),p=0;p<d;p++){var D=_[p]===k?b[p]:g,T=w[p]===k?x[p]:g;v[p][h]=y(D,T)}}return new r({data:v,size:[d,m],datatype:f})};function n(e,t,r,n,a){for(var i=e._values,o=e._index,s=e._ptr,l=s[t],c=s[t+1];l<c;l++){var u=o[l];r[u]=a,n[u]=i[l]}}}));t.createAlgorithm07=o},38128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm08=void 0;var n=r(58450),a=r(12906),i=["typed","equalScalar"],o=(0,n.factory)("algorithm08",i,(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var o=e._values,s=e._index,l=e._ptr,c=e._size,u=e._datatype,f=n._values,p=n._index,h=n._ptr,d=n._size,m=n._datatype;if(c.length!==d.length)throw new a.DimensionError(c.length,d.length);if(c[0]!==d[0]||c[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+d+")");if(!o||!f)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var g,y=c[0],v=c[1],b=r,x=0,_=i;"string"==typeof u&&u===m&&(g=u,b=t.find(r,[g,g]),x=t.convert(0,g),_=t.find(i,[g,g]));for(var w,k,D,T,A=[],S=[],M=[],E=[],C=[],N=0;N<v;N++){M[N]=S.length;var O=N+1;for(k=l[N],D=l[N+1],w=k;w<D;w++)C[T=s[w]]=O,E[T]=o[w],S.push(T);for(k=h[N],D=h[N+1],w=k;w<D;w++)C[T=p[w]]===O&&(E[T]=_(E[T],f[w]));for(w=M[N];w<S.length;){var I=E[T=S[w]];b(I,x)?S.splice(w,1):(A.push(I),w++)}}return M[v]=S.length,e.createSparseMatrix({values:A,index:S,ptr:M,size:[y,v],datatype:g})}}));t.createAlgorithm08=o},93799:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm09=void 0;var n=r(58450),a=r(12906),i=["typed","equalScalar"],o=(0,n.factory)("algorithm09",i,(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var o=e._values,s=e._index,l=e._ptr,c=e._size,u=e._datatype,f=n._values,p=n._index,h=n._ptr,d=n._size,m=n._datatype;if(c.length!==d.length)throw new a.DimensionError(c.length,d.length);if(c[0]!==d[0]||c[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+d+")");var g,y=c[0],v=c[1],b=r,x=0,_=i;"string"==typeof u&&u===m&&(g=u,b=t.find(r,[g,g]),x=t.convert(0,g),_=t.find(i,[g,g]));var w,k,D,T,A,S=o&&f?[]:void 0,M=[],E=[],C=S?[]:void 0,N=[];for(k=0;k<v;k++){E[k]=M.length;var O=k+1;if(C)for(T=h[k],A=h[k+1],D=T;D<A;D++)N[w=p[D]]=O,C[w]=f[D];for(T=l[k],A=l[k+1],D=T;D<A;D++)if(w=s[D],C){var I=N[w]===O?C[w]:x,P=_(o[D],I);b(P,x)||(M.push(w),S.push(P))}else M.push(w)}return E[v]=M.length,e.createSparseMatrix({values:S,index:M,ptr:E,size:[y,v],datatype:g})}}));t.createAlgorithm09=o},39032:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm10=void 0;var n=["typed","DenseMatrix"],a=(0,r(58450).factory)("algorithm10",n,(function(e){var t=e.typed,r=e.DenseMatrix;return function(e,n,a,i){var o=e._values,s=e._index,l=e._ptr,c=e._size,u=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f,p=c[0],h=c[1],d=a;"string"==typeof u&&(f=u,n=t.convert(n,f),d=t.find(a,[f,f]));for(var m=[],g=[],y=[],v=0;v<h;v++){for(var b=v+1,x=l[v],_=l[v+1],w=x;w<_;w++){var k=s[w];g[k]=o[w],y[k]=b}for(var D=0;D<p;D++)0===v&&(m[D]=[]),y[D]===b?m[D][v]=i?d(n,g[D]):d(g[D],n):m[D][v]=n}return new r({data:m,size:[p,h],datatype:f})}}));t.createAlgorithm10=a},34623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm11=void 0;var n=["typed","equalScalar"],a=(0,r(58450).factory)("algorithm11",n,(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,a,i){var o=e._values,s=e._index,l=e._ptr,c=e._size,u=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f,p=c[0],h=c[1],d=r,m=0,g=a;"string"==typeof u&&(f=u,d=t.find(r,[f,f]),m=t.convert(0,f),n=t.convert(n,f),g=t.find(a,[f,f]));for(var y=[],v=[],b=[],x=0;x<h;x++){b[x]=v.length;for(var _=l[x],w=l[x+1],k=_;k<w;k++){var D=s[k],T=i?g(n,o[k]):g(o[k],n);d(T,m)||(v.push(D),y.push(T))}}return b[h]=v.length,e.createSparseMatrix({values:y,index:v,ptr:b,size:[p,h],datatype:f})}}));t.createAlgorithm11=a},68311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm12=void 0;var n=["typed","DenseMatrix"],a=(0,r(58450).factory)("algorithm12",n,(function(e){var t=e.typed,r=e.DenseMatrix;return function(e,n,a,i){var o=e._values,s=e._index,l=e._ptr,c=e._size,u=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f,p=c[0],h=c[1],d=a;"string"==typeof u&&(f=u,n=t.convert(n,f),d=t.find(a,[f,f]));for(var m=[],g=[],y=[],v=0;v<h;v++){for(var b=v+1,x=l[v],_=l[v+1],w=x;w<_;w++){var k=s[w];g[k]=o[w],y[k]=b}for(var D=0;D<p;D++)0===v&&(m[D]=[]),y[D]===b?m[D][v]=i?d(n,g[D]):d(g[D],n):m[D][v]=i?d(n,0):d(0,n)}return new r({data:m,size:[p,h],datatype:f})}}));t.createAlgorithm12=a},46752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm13=void 0;var n=r(58450),a=r(12906),i=["typed"],o=(0,n.factory)("algorithm13",i,(function(e){var t=e.typed;return function(e,n,i){var o,s=e._data,l=e._size,c=e._datatype,u=n._data,f=n._size,p=n._datatype,h=[];if(l.length!==f.length)throw new a.DimensionError(l.length,f.length);for(var d=0;d<l.length;d++){if(l[d]!==f[d])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");h[d]=l[d]}var m=i;"string"==typeof c&&c===p&&(o=c,m=t.find(i,[o,o]));var g=h.length>0?r(m,0,h,h[0],s,u):[];return e.createDenseMatrix({data:g,size:h,datatype:o})};function r(e,t,n,a,i,o){var s=[];if(t===n.length-1)for(var l=0;l<a;l++)s[l]=e(i[l],o[l]);else for(var c=0;c<a;c++)s[c]=r(e,t+1,n,n[t+1],i[c],o[c]);return s}}));t.createAlgorithm13=o},99826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgorithm14=void 0;var n=r(58450),a=r(54699),i=["typed"],o=(0,n.factory)("algorithm14",i,(function(e){var t=e.typed;return function(e,n,i,o){var s,l=e._data,c=e._size,u=e._datatype,f=i;"string"==typeof u&&(s=u,n=t.convert(n,s),f=t.find(i,[s,s]));var p=c.length>0?r(f,0,c,c[0],l,n,o):[];return e.createDenseMatrix({data:p,size:(0,a.clone)(c),datatype:s})};function r(e,t,n,a,i,o,s){var l=[];if(t===n.length-1)for(var c=0;c<a;c++)l[c]=s?e(o,i[c]):e(i[c],o);else for(var u=0;u<a;u++)l[u]=r(e,t+1,n,n[t+1],i[u],o,s);return l}}));t.createAlgorithm14=o},35074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNumber=void 0;var n=r(58450),a=r(30401),i=["typed"],o=(0,n.factory)("number",i,(function(e){var t=(0,e.typed)("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t,r,n=(r=(t=e).match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/))?{input:t,radix:{"0b":2,"0o":8,"0x":16}[r[1]],integerPart:r[2],fractionalPart:r[3]}:null;if(n)return function(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n<e.fractionalPart.length;n++)r+=parseInt(e.fractionalPart[n],e.radix)/Math.pow(e.radix,n+1);var a=t+r;if(isNaN(a))throw new SyntaxError('String "'+e.input+'" is no valid number');return a}(n);var a=0,i=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);i&&(a=Number(i[2]),e=i[1]);var o=Number(e);if(isNaN(o))throw new SyntaxError('String "'+e+'" is no valid number');if(i){if(o>Math.pow(2,a)-1)throw new SyntaxError('String "'.concat(e,'" is out of range'));o>=Math.pow(2,a-1)&&(o-=Math.pow(2,a))}return o},BigNumber:function(e){return e.toNumber()},Fraction:function(e){return e.valueOf()},Unit:function(e){throw new Error("Second argument with valueless unit expected")},null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}});return t.fromJSON=function(e){return parseFloat(e.value)},t}));t.createNumber=o},3574:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createResultSet=void 0;var n=[],a=(0,r(58450).factory)("ResultSet",n,(function(){function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e}),{isClass:!0});t.createResultSet=a},55081:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createString=void 0;var n=r(58450),a=r(30401),i=r(49473),o="string",s=["typed"],l=(0,n.factory)(o,s,(function(e){return(0,e.typed)(o,{"":function(){return""},number:i.format,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)},any:function(e){return String(e)}})}));t.createString=l},53504:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.createUnitClass=void 0;var a=n(r(80812)),i=n(r(9917)),o=n(r(44024)),s=r(57237),l=r(58450),c=r(46054),u=r(59398),f=r(54699),p=r(78981);function h(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 d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){(0,o.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var m=["?on","config","addScalar","subtract","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],g=(0,l.factory)("Unit",m,(function(e){var t,r,n,o=e.on,l=e.config,h=e.addScalar,m=e.subtract,g=e.multiplyScalar,y=e.divideScalar,v=e.pow,b=e.abs,x=e.fix,_=e.round,w=e.equal,k=e.isNumeric,D=e.format,T=e.number,A=e.Complex,S=e.BigNumber,M=e.Fraction,E=T;function C(e,t){if(!(this instanceof C))throw new Error("Constructor must be called with the new operator");if(null!=e&&!k(e)&&!(0,s.isComplex)(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(void 0!==t&&("string"!=typeof t||""===t))throw new TypeError("Second parameter in Unit constructor must be a string");if(void 0!==t){var r=C.parse(t);this.units=r.units,this.dimensions=r.dimensions}else{this.units=[{unit:q,prefix:j.NONE,power:0}],this.dimensions=[];for(var n=0;n<U.length;n++)this.dimensions[n]=0}this.value=null!=e?this._normalize(e):null,this.fixPrefix=!1,this.skipAutomaticSimplification=!0}function N(){for(;" "===n||"\t"===n;)I()}function O(e){return e>="0"&&e<="9"}function I(){r++,n=t.charAt(r)}function P(e){r=e,n=t.charAt(r)}function R(){var e="",t=r;if("+"===n?I():"-"===n&&(e+=n,I()),!function(e){return e>="0"&&e<="9"||"."===e}(n))return P(t),null;if("."===n){if(e+=n,I(),!O(n))return P(t),null}else{for(;O(n);)e+=n,I();"."===n&&(e+=n,I())}for(;O(n);)e+=n,I();if("E"===n||"e"===n){var a="",i=r;if(a+=n,I(),"+"!==n&&"-"!==n||(a+=n,I()),!O(n))return P(i),e;for(e+=a;O(n);)e+=n,I()}return e}function L(){for(var e="";O(n)||C.isValidAlpha(n);)e+=n,I();var t=e.charAt(0);return C.isValidAlpha(t)?e:null}function F(e){return n===e?(I(),e):null}C.prototype.type="Unit",C.prototype.isUnit=!0,C.parse=function(e,a){if(a=a||{},r=-1,n="","string"!=typeof(t=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var i=new C;i.units=[];var o=1,s=!1;I(),N();var c=R(),u=null;if(c){if("BigNumber"===l.number)u=new S(c);else if("Fraction"===l.number)try{u=new M(c)}catch(e){u=parseFloat(c)}else u=parseFloat(c);N(),F("*")?(o=1,s=!0):F("/")&&(o=-1,s=!0)}for(var f=[],p=1;;){for(N();"("===n;)f.push(o),p*=o,o=1,I(),N();var h;if(!n)break;var d=n;if(null===(h=L()))throw new SyntaxError('Unexpected "'+d+'" in "'+t+'" at index '+r.toString());var m=B(h);if(null===m)throw new SyntaxError('Unit "'+h+'" not found.');var g=o*p;if(N(),F("^")){N();var y=R();if(null===y)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');g*=y}i.units.push({unit:m.unit,prefix:m.prefix,power:g});for(var v=0;v<U.length;v++)i.dimensions[v]+=(m.unit.dimensions[v]||0)*g;for(N();")"===n;){if(0===f.length)throw new SyntaxError('Unmatched ")" in "'+t+'" at index '+r.toString());p/=f.pop(),I(),N()}if(s=!1,F("*")?(o=1,s=!0):F("/")?(o=-1,s=!0):o=1,m.unit.base){var b=m.unit.base.key;X.auto[b]={unit:m.unit,prefix:m.prefix}}}if(N(),n)throw new SyntaxError('Could not parse: "'+e+'"');if(s)throw new SyntaxError('Trailing characters: "'+e+'"');if(0!==f.length)throw new SyntaxError('Unmatched "(" in "'+t+'"');if(0===i.units.length&&!a.allowNoUnits)throw new SyntaxError('"'+e+'" contains no units');return i.value=void 0!==u?i._normalize(u):null,i},C.prototype.clone=function(){var e=new C;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=(0,f.clone)(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var r in e.units[t]={},this.units[t])(0,f.hasOwnProperty)(this.units[t],r)&&(e.units[t][r]=this.units[t][r]);return e},C.prototype._isDerived=function(){return 0!==this.units.length&&(this.units.length>1||Math.abs(this.units[0].power-1)>1e-15)},C.prototype._normalize=function(e){var t,r,n,a,i;if(null==e||0===this.units.length)return e;if(this._isDerived()){var o=e;i=C._getNumberConverter((0,s.typeOf)(e));for(var l=0;l<this.units.length;l++)t=i(this.units[l].unit.value),a=i(this.units[l].prefix.value),n=i(this.units[l].power),o=g(o,v(g(t,a),n));return o}return t=(i=C._getNumberConverter((0,s.typeOf)(e)))(this.units[0].unit.value),r=i(this.units[0].unit.offset),a=i(this.units[0].prefix.value),g(h(e,r),g(t,a))},C.prototype._denormalize=function(e,t){var r,n,a,i,o;if(null==e||0===this.units.length)return e;if(this._isDerived()){var l=e;o=C._getNumberConverter((0,s.typeOf)(e));for(var c=0;c<this.units.length;c++)r=o(this.units[c].unit.value),i=o(this.units[c].prefix.value),a=o(this.units[c].power),l=y(l,v(g(r,i),a));return l}return r=(o=C._getNumberConverter((0,s.typeOf)(e)))(this.units[0].unit.value),i=o(this.units[0].prefix.value),n=o(this.units[0].unit.offset),m(y(y(e,r),null==t?i:t),n)};var B=(0,c.memoize)((function(e){if((0,f.hasOwnProperty)(W,e)){var t=W[e];return{unit:t,prefix:t.prefixes[""]}}for(var r in W)if((0,f.hasOwnProperty)(W,r)&&(0,u.endsWith)(e,r)){var n=W[r],a=e.length-r.length,i=e.substring(0,a),o=(0,f.hasOwnProperty)(n.prefixes,i)?n.prefixes[i]:void 0;if(void 0!==o)return{unit:n,prefix:o}}return null}),{hasher:function(e){return e[0]},limit:100});function z(e){return e.equalBase($.NONE)&&null!==e.value&&!l.predictable?e.value:e}C.isValuelessUnit=function(e){return null!==B(e)},C.prototype.hasBase=function(e){if("string"==typeof e&&(e=$[e]),!e)return!1;for(var t=0;t<U.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},C.prototype.equalBase=function(e){for(var t=0;t<U.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},C.prototype.equals=function(e){return this.equalBase(e)&&w(this.value,e.value)},C.prototype.multiply=function(e){for(var t=this.clone(),r=0;r<U.length;r++)t.dimensions[r]=(this.dimensions[r]||0)+(e.dimensions[r]||0);for(var n=0;n<e.units.length;n++){var a=d({},e.units[n]);t.units.push(a)}if(null!==this.value||null!==e.value){var i=null===this.value?this._normalize(1):this.value,o=null===e.value?e._normalize(1):e.value;t.value=g(i,o)}else t.value=null;return t.skipAutomaticSimplification=!1,z(t)},C.prototype.divide=function(e){for(var t=this.clone(),r=0;r<U.length;r++)t.dimensions[r]=(this.dimensions[r]||0)-(e.dimensions[r]||0);for(var n=0;n<e.units.length;n++){var a=d(d({},e.units[n]),{},{power:-e.units[n].power});t.units.push(a)}if(null!==this.value||null!==e.value){var i=null===this.value?this._normalize(1):this.value,o=null===e.value?e._normalize(1):e.value;t.value=y(i,o)}else t.value=null;return t.skipAutomaticSimplification=!1,z(t)},C.prototype.pow=function(e){for(var t=this.clone(),r=0;r<U.length;r++)t.dimensions[r]=(this.dimensions[r]||0)*e;for(var n=0;n<t.units.length;n++)t.units[n].power*=e;return null!==t.value?t.value=v(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,z(t)},C.prototype.abs=function(){var e=this.clone();for(var t in e.value=null!==e.value?b(e.value):null,e.units)"VA"!==e.units[t].unit.name&&"VAR"!==e.units[t].unit.name||(e.units[t].unit=W.W);return e},C.prototype.to=function(e){var t,r=null===this.value?this._normalize(1):this.value;if("string"==typeof e){if(t=C.parse(e),!this.equalBase(t))throw new Error("Units do not match ('".concat(t.toString(),"' != '").concat(this.toString(),"')"));if(null!==t.value)throw new Error("Cannot convert to a unit with a value");return t.value=(0,f.clone)(r),t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t}if((0,s.isUnit)(e)){if(!this.equalBase(e))throw new Error("Units do not match ('".concat(e.toString(),"' != '").concat(this.toString(),"')"));if(null!==e.value)throw new Error("Cannot convert to a unit with a value");return(t=e.clone()).value=(0,f.clone)(r),t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t}throw new Error("String or Unit expected as parameter")},C.prototype.toNumber=function(e){return E(this.toNumeric(e))},C.prototype.toNumeric=function(e){var t;return(t=e?this.to(e):this.clone())._isDerived()||0===t.units.length?t._denormalize(t.value):t._denormalize(t.value,t.units[0].prefix.value)},C.prototype.toString=function(){return this.format()},C.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.formatUnits(),fixPrefix:this.fixPrefix}},C.fromJSON=function(e){var t=new C(e.value,e.unit);return t.fixPrefix=e.fixPrefix||!1,t},C.prototype.valueOf=C.prototype.toString,C.prototype.simplify=function(){var e,t,r=this.clone(),n=[];for(var a in Y)if((0,f.hasOwnProperty)(Y,a)&&r.hasBase($[a])){e=a;break}if("NONE"===e)r.units=[];else if(e&&(0,f.hasOwnProperty)(Y,e)&&(t=Y[e]),t)r.units=[{unit:t.unit,prefix:t.prefix,power:1}];else{for(var i=!1,o=0;o<U.length;o++){var s=U[o];Math.abs(r.dimensions[o]||0)>1e-12&&((0,f.hasOwnProperty)(Y,s)?n.push({unit:Y[s].unit,prefix:Y[s].prefix,power:r.dimensions[o]||0}):i=!0)}n.length<r.units.length&&!i&&(r.units=n)}return r},C.prototype.toSI=function(){for(var e=this.clone(),t=[],r=0;r<U.length;r++){var n=U[r];if(Math.abs(e.dimensions[r]||0)>1e-12){if(!(0,f.hasOwnProperty)(X.si,n))throw new Error("Cannot express custom unit "+n+" in SI units");t.push({unit:X.si[n].unit,prefix:X.si[n].prefix,power:e.dimensions[r]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e},C.prototype.formatUnits=function(){for(var e="",t="",r=0,n=0,a=0;a<this.units.length;a++)this.units[a].power>0?(r++,e+=" "+this.units[a].prefix.name+this.units[a].unit.name,Math.abs(this.units[a].power-1)>1e-15&&(e+="^"+this.units[a].power)):this.units[a].power<0&&n++;if(n>0)for(var i=0;i<this.units.length;i++)this.units[i].power<0&&(r>0?(t+=" "+this.units[i].prefix.name+this.units[i].unit.name,Math.abs(this.units[i].power+1)>1e-15&&(t+="^"+-this.units[i].power)):(t+=" "+this.units[i].prefix.name+this.units[i].unit.name,t+="^"+this.units[i].power));e=e.substr(1),t=t.substr(1),r>1&&n>0&&(e="("+e+")"),n>1&&r>0&&(t="("+t+")");var o=e;return r>0&&n>0&&(o+=" / "),o+t},C.prototype.format=function(e){var t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),r=!1;for(var n in void 0!==t.value&&null!==t.value&&(0,s.isComplex)(t.value)&&(r=Math.abs(t.value.re)<1e-14),t.units)(0,f.hasOwnProperty)(t.units,n)&&t.units[n].unit&&("VA"===t.units[n].unit.name&&r?t.units[n].unit=W.VAR:"VAR"!==t.units[n].unit.name||r||(t.units[n].unit=W.VA));1!==t.units.length||t.fixPrefix||Math.abs(t.units[0].power-Math.round(t.units[0].power))<1e-14&&(t.units[0].prefix=t._bestPrefix());var a=t._denormalize(t.value),i=null!==t.value?D(a,e||{}):"",o=t.formatUnits();return t.value&&(0,s.isComplex)(t.value)&&(i="("+i+")"),o.length>0&&i.length>0&&(i+=" "),i+o},C.prototype._bestPrefix=function(){if(1!==this.units.length)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var e=null!==this.value?b(this.value):0,t=b(this.units[0].unit.value),r=this.units[0].prefix;if(0===e)return r;var n=this.units[0].power,a=Math.log(e/Math.pow(r.value*t,n))/Math.LN10-1.2;if(a>-2.200001&&a<1.800001)return r;a=Math.abs(a);var i=this.units[0].unit.prefixes;for(var o in i)if((0,f.hasOwnProperty)(i,o)){var s=i[o];if(s.scientific){var l=Math.abs(Math.log(e/Math.pow(s.value*t,n))/Math.LN10-1.2);(l<a||l===a&&s.name.length<r.name.length)&&(r=s,a=l)}}return r},C.prototype.splitUnit=function(e){for(var t=this.clone(),r=[],n=0;n<e.length&&(t=t.to(e[n]),n!==e.length-1);n++){var a=t.toNumeric(),i=_(a),o=new C(w(i,a)?i:x(t.toNumeric()),e[n].toString());r.push(o),t=m(t,o)}for(var s=0,l=0;l<r.length;l++)s=h(s,r[l].value);return w(s,this.value)&&(t.value=0),r.push(t),r};var j={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!1},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};j.SHORTLONG=(0,i.default)({},j.SHORT,j.LONG),j.BINARY_SHORT=(0,i.default)({},j.BINARY_SHORT_SI,j.BINARY_SHORT_IEC),j.BINARY_LONG=(0,i.default)({},j.BINARY_LONG_SI,j.BINARY_LONG_IEC);var U=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],$={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var V in $)(0,f.hasOwnProperty)($,V)&&($[V].key=V);var q={name:"",base:{},value:1,offset:0,dimensions:U.map((function(e){return 0}))},W={meter:{name:"meter",base:$.LENGTH,prefixes:j.LONG,value:1,offset:0},inch:{name:"inch",base:$.LENGTH,prefixes:j.NONE,value:.0254,offset:0},foot:{name:"foot",base:$.LENGTH,prefixes:j.NONE,value:.3048,offset:0},yard:{name:"yard",base:$.LENGTH,prefixes:j.NONE,value:.9144,offset:0},mile:{name:"mile",base:$.LENGTH,prefixes:j.NONE,value:1609.344,offset:0},link:{name:"link",base:$.LENGTH,prefixes:j.NONE,value:.201168,offset:0},rod:{name:"rod",base:$.LENGTH,prefixes:j.NONE,value:5.0292,offset:0},chain:{name:"chain",base:$.LENGTH,prefixes:j.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:$.LENGTH,prefixes:j.NONE,value:1e-10,offset:0},m:{name:"m",base:$.LENGTH,prefixes:j.SHORT,value:1,offset:0},in:{name:"in",base:$.LENGTH,prefixes:j.NONE,value:.0254,offset:0},ft:{name:"ft",base:$.LENGTH,prefixes:j.NONE,value:.3048,offset:0},yd:{name:"yd",base:$.LENGTH,prefixes:j.NONE,value:.9144,offset:0},mi:{name:"mi",base:$.LENGTH,prefixes:j.NONE,value:1609.344,offset:0},li:{name:"li",base:$.LENGTH,prefixes:j.NONE,value:.201168,offset:0},rd:{name:"rd",base:$.LENGTH,prefixes:j.NONE,value:5.02921,offset:0},ch:{name:"ch",base:$.LENGTH,prefixes:j.NONE,value:20.1168,offset:0},mil:{name:"mil",base:$.LENGTH,prefixes:j.NONE,value:254e-7,offset:0},m2:{name:"m2",base:$.SURFACE,prefixes:j.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:$.SURFACE,prefixes:j.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:$.SURFACE,prefixes:j.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:$.SURFACE,prefixes:j.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:$.SURFACE,prefixes:j.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:$.SURFACE,prefixes:j.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:$.SURFACE,prefixes:j.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:$.SURFACE,prefixes:j.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:$.SURFACE,prefixes:j.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:$.SURFACE,prefixes:j.NONE,value:1e4,offset:0},m3:{name:"m3",base:$.VOLUME,prefixes:j.CUBIC,value:1,offset:0},L:{name:"L",base:$.VOLUME,prefixes:j.SHORT,value:.001,offset:0},l:{name:"l",base:$.VOLUME,prefixes:j.SHORT,value:.001,offset:0},litre:{name:"litre",base:$.VOLUME,prefixes:j.LONG,value:.001,offset:0},cuin:{name:"cuin",base:$.VOLUME,prefixes:j.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:$.VOLUME,prefixes:j.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:$.VOLUME,prefixes:j.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:$.VOLUME,prefixes:j.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:$.VOLUME,prefixes:j.NONE,value:15e-6,offset:0},drop:{name:"drop",base:$.VOLUME,prefixes:j.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:$.VOLUME,prefixes:j.NONE,value:5e-8,offset:0},minim:{name:"minim",base:$.VOLUME,prefixes:j.NONE,value:6.161152e-8,offset:0},fluiddram:{name:"fluiddram",base:$.VOLUME,prefixes:j.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:$.VOLUME,prefixes:j.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:$.VOLUME,prefixes:j.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:$.VOLUME,prefixes:j.NONE,value:1e-6,offset:0},cup:{name:"cup",base:$.VOLUME,prefixes:j.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:$.VOLUME,prefixes:j.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:$.VOLUME,prefixes:j.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:$.VOLUME,prefixes:j.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:$.VOLUME,prefixes:j.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:$.VOLUME,prefixes:j.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:$.VOLUME,prefixes:j.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:$.VOLUME,prefixes:j.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:$.VOLUME,prefixes:j.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:$.VOLUME,prefixes:j.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:$.VOLUME,prefixes:j.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:$.VOLUME,prefixes:j.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:$.VOLUME,prefixes:j.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:$.VOLUME,prefixes:j.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:$.VOLUME,prefixes:j.NONE,value:.1173478,offset:0},obl:{name:"obl",base:$.VOLUME,prefixes:j.NONE,value:.1589873,offset:0},g:{name:"g",base:$.MASS,prefixes:j.SHORT,value:.001,offset:0},gram:{name:"gram",base:$.MASS,prefixes:j.LONG,value:.001,offset:0},ton:{name:"ton",base:$.MASS,prefixes:j.SHORT,value:907.18474,offset:0},t:{name:"t",base:$.MASS,prefixes:j.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:$.MASS,prefixes:j.LONG,value:1e3,offset:0},grain:{name:"grain",base:$.MASS,prefixes:j.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:$.MASS,prefixes:j.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:$.MASS,prefixes:j.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:$.MASS,prefixes:j.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:$.MASS,prefixes:j.NONE,value:45.359237,offset:0},stick:{name:"stick",base:$.MASS,prefixes:j.NONE,value:.115,offset:0},stone:{name:"stone",base:$.MASS,prefixes:j.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:$.MASS,prefixes:j.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:$.MASS,prefixes:j.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:$.MASS,prefixes:j.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:$.MASS,prefixes:j.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:$.MASS,prefixes:j.NONE,value:45.359237,offset:0},s:{name:"s",base:$.TIME,prefixes:j.SHORT,value:1,offset:0},min:{name:"min",base:$.TIME,prefixes:j.NONE,value:60,offset:0},h:{name:"h",base:$.TIME,prefixes:j.NONE,value:3600,offset:0},second:{name:"second",base:$.TIME,prefixes:j.LONG,value:1,offset:0},sec:{name:"sec",base:$.TIME,prefixes:j.LONG,value:1,offset:0},minute:{name:"minute",base:$.TIME,prefixes:j.NONE,value:60,offset:0},hour:{name:"hour",base:$.TIME,prefixes:j.NONE,value:3600,offset:0},day:{name:"day",base:$.TIME,prefixes:j.NONE,value:86400,offset:0},week:{name:"week",base:$.TIME,prefixes:j.NONE,value:604800,offset:0},month:{name:"month",base:$.TIME,prefixes:j.NONE,value:2629800,offset:0},year:{name:"year",base:$.TIME,prefixes:j.NONE,value:31557600,offset:0},decade:{name:"decade",base:$.TIME,prefixes:j.NONE,value:315576e3,offset:0},century:{name:"century",base:$.TIME,prefixes:j.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:$.TIME,prefixes:j.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:$.FREQUENCY,prefixes:j.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:$.FREQUENCY,prefixes:j.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:$.ANGLE,prefixes:j.SHORT,value:1,offset:0},radian:{name:"radian",base:$.ANGLE,prefixes:j.LONG,value:1,offset:0},deg:{name:"deg",base:$.ANGLE,prefixes:j.SHORT,value:null,offset:0},degree:{name:"degree",base:$.ANGLE,prefixes:j.LONG,value:null,offset:0},grad:{name:"grad",base:$.ANGLE,prefixes:j.SHORT,value:null,offset:0},gradian:{name:"gradian",base:$.ANGLE,prefixes:j.LONG,value:null,offset:0},cycle:{name:"cycle",base:$.ANGLE,prefixes:j.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:$.ANGLE,prefixes:j.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:$.ANGLE,prefixes:j.NONE,value:null,offset:0},A:{name:"A",base:$.CURRENT,prefixes:j.SHORT,value:1,offset:0},ampere:{name:"ampere",base:$.CURRENT,prefixes:j.LONG,value:1,offset:0},K:{name:"K",base:$.TEMPERATURE,prefixes:j.NONE,value:1,offset:0},degC:{name:"degC",base:$.TEMPERATURE,prefixes:j.NONE,value:1,offset:273.15},degF:{name:"degF",base:$.TEMPERATURE,prefixes:j.NONE,value:1/1.8,offset:459.67},degR:{name:"degR",base:$.TEMPERATURE,prefixes:j.NONE,value:1/1.8,offset:0},kelvin:{name:"kelvin",base:$.TEMPERATURE,prefixes:j.NONE,value:1,offset:0},celsius:{name:"celsius",base:$.TEMPERATURE,prefixes:j.NONE,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:$.TEMPERATURE,prefixes:j.NONE,value:1/1.8,offset:459.67},rankine:{name:"rankine",base:$.TEMPERATURE,prefixes:j.NONE,value:1/1.8,offset:0},mol:{name:"mol",base:$.AMOUNT_OF_SUBSTANCE,prefixes:j.SHORT,value:1,offset:0},mole:{name:"mole",base:$.AMOUNT_OF_SUBSTANCE,prefixes:j.LONG,value:1,offset:0},cd:{name:"cd",base:$.LUMINOUS_INTENSITY,prefixes:j.SHORT,value:1,offset:0},candela:{name:"candela",base:$.LUMINOUS_INTENSITY,prefixes:j.LONG,value:1,offset:0},N:{name:"N",base:$.FORCE,prefixes:j.SHORT,value:1,offset:0},newton:{name:"newton",base:$.FORCE,prefixes:j.LONG,value:1,offset:0},dyn:{name:"dyn",base:$.FORCE,prefixes:j.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:$.FORCE,prefixes:j.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:$.FORCE,prefixes:j.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:$.FORCE,prefixes:j.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:$.FORCE,prefixes:j.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:$.FORCE,prefixes:j.NONE,value:9.80665,offset:0},J:{name:"J",base:$.ENERGY,prefixes:j.SHORT,value:1,offset:0},joule:{name:"joule",base:$.ENERGY,prefixes:j.SHORT,value:1,offset:0},erg:{name:"erg",base:$.ENERGY,prefixes:j.NONE,value:1e-7,offset:0},Wh:{name:"Wh",base:$.ENERGY,prefixes:j.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:$.ENERGY,prefixes:j.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:$.ENERGY,prefixes:j.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:$.ENERGY,prefixes:j.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:$.POWER,prefixes:j.SHORT,value:1,offset:0},watt:{name:"watt",base:$.POWER,prefixes:j.LONG,value:1,offset:0},hp:{name:"hp",base:$.POWER,prefixes:j.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:$.POWER,prefixes:j.SHORT,value:A.I,offset:0},VA:{name:"VA",base:$.POWER,prefixes:j.SHORT,value:1,offset:0},Pa:{name:"Pa",base:$.PRESSURE,prefixes:j.SHORT,value:1,offset:0},psi:{name:"psi",base:$.PRESSURE,prefixes:j.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:$.PRESSURE,prefixes:j.NONE,value:101325,offset:0},bar:{name:"bar",base:$.PRESSURE,prefixes:j.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:$.PRESSURE,prefixes:j.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:$.PRESSURE,prefixes:j.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:$.PRESSURE,prefixes:j.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:$.PRESSURE,prefixes:j.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:$.ELECTRIC_CHARGE,prefixes:j.LONG,value:1,offset:0},C:{name:"C",base:$.ELECTRIC_CHARGE,prefixes:j.SHORT,value:1,offset:0},farad:{name:"farad",base:$.ELECTRIC_CAPACITANCE,prefixes:j.LONG,value:1,offset:0},F:{name:"F",base:$.ELECTRIC_CAPACITANCE,prefixes:j.SHORT,value:1,offset:0},volt:{name:"volt",base:$.ELECTRIC_POTENTIAL,prefixes:j.LONG,value:1,offset:0},V:{name:"V",base:$.ELECTRIC_POTENTIAL,prefixes:j.SHORT,value:1,offset:0},ohm:{name:"ohm",base:$.ELECTRIC_RESISTANCE,prefixes:j.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:$.ELECTRIC_INDUCTANCE,prefixes:j.LONG,value:1,offset:0},H:{name:"H",base:$.ELECTRIC_INDUCTANCE,prefixes:j.SHORT,value:1,offset:0},siemens:{name:"siemens",base:$.ELECTRIC_CONDUCTANCE,prefixes:j.LONG,value:1,offset:0},S:{name:"S",base:$.ELECTRIC_CONDUCTANCE,prefixes:j.SHORT,value:1,offset:0},weber:{name:"weber",base:$.MAGNETIC_FLUX,prefixes:j.LONG,value:1,offset:0},Wb:{name:"Wb",base:$.MAGNETIC_FLUX,prefixes:j.SHORT,value:1,offset:0},tesla:{name:"tesla",base:$.MAGNETIC_FLUX_DENSITY,prefixes:j.LONG,value:1,offset:0},T:{name:"T",base:$.MAGNETIC_FLUX_DENSITY,prefixes:j.SHORT,value:1,offset:0},b:{name:"b",base:$.BIT,prefixes:j.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:$.BIT,prefixes:j.BINARY_LONG,value:1,offset:0},B:{name:"B",base:$.BIT,prefixes:j.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:$.BIT,prefixes:j.BINARY_LONG,value:8,offset:0}},H={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function G(e){if("BigNumber"===e.number){var t=(0,p.createBigNumberPi)(S);W.rad.value=new S(1),W.deg.value=t.div(180),W.grad.value=t.div(200),W.cycle.value=t.times(2),W.arcsec.value=t.div(648e3),W.arcmin.value=t.div(10800)}else W.rad.value=1,W.deg.value=Math.PI/180,W.grad.value=Math.PI/200,W.cycle.value=2*Math.PI,W.arcsec.value=Math.PI/648e3,W.arcmin.value=Math.PI/10800;W.radian.value=W.rad.value,W.degree.value=W.deg.value,W.gradian.value=W.grad.value}G(l),o&&o("config",(function(e,t){e.number!==t.number&&G(e)}));var X={si:{NONE:{unit:q,prefix:j.NONE[""]},LENGTH:{unit:W.m,prefix:j.SHORT[""]},MASS:{unit:W.g,prefix:j.SHORT.k},TIME:{unit:W.s,prefix:j.SHORT[""]},CURRENT:{unit:W.A,prefix:j.SHORT[""]},TEMPERATURE:{unit:W.K,prefix:j.SHORT[""]},LUMINOUS_INTENSITY:{unit:W.cd,prefix:j.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:W.mol,prefix:j.SHORT[""]},ANGLE:{unit:W.rad,prefix:j.SHORT[""]},BIT:{unit:W.bits,prefix:j.SHORT[""]},FORCE:{unit:W.N,prefix:j.SHORT[""]},ENERGY:{unit:W.J,prefix:j.SHORT[""]},POWER:{unit:W.W,prefix:j.SHORT[""]},PRESSURE:{unit:W.Pa,prefix:j.SHORT[""]},ELECTRIC_CHARGE:{unit:W.C,prefix:j.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:W.F,prefix:j.SHORT[""]},ELECTRIC_POTENTIAL:{unit:W.V,prefix:j.SHORT[""]},ELECTRIC_RESISTANCE:{unit:W.ohm,prefix:j.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:W.H,prefix:j.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:W.S,prefix:j.SHORT[""]},MAGNETIC_FLUX:{unit:W.Wb,prefix:j.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:W.T,prefix:j.SHORT[""]},FREQUENCY:{unit:W.Hz,prefix:j.SHORT[""]}}};X.cgs=JSON.parse(JSON.stringify(X.si)),X.cgs.LENGTH={unit:W.m,prefix:j.SHORT.c},X.cgs.MASS={unit:W.g,prefix:j.SHORT[""]},X.cgs.FORCE={unit:W.dyn,prefix:j.SHORT[""]},X.cgs.ENERGY={unit:W.erg,prefix:j.NONE[""]},X.us=JSON.parse(JSON.stringify(X.si)),X.us.LENGTH={unit:W.ft,prefix:j.NONE[""]},X.us.MASS={unit:W.lbm,prefix:j.NONE[""]},X.us.TEMPERATURE={unit:W.degF,prefix:j.NONE[""]},X.us.FORCE={unit:W.lbf,prefix:j.NONE[""]},X.us.ENERGY={unit:W.BTU,prefix:j.BTU[""]},X.us.POWER={unit:W.hp,prefix:j.NONE[""]},X.us.PRESSURE={unit:W.psi,prefix:j.NONE[""]},X.auto=JSON.parse(JSON.stringify(X.si));var Y=X.auto;for(var Z in C.setUnitSystem=function(e){if(!(0,f.hasOwnProperty)(X,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(X).join(", "));Y=X[e]},C.getUnitSystem=function(){for(var e in X)if((0,f.hasOwnProperty)(X,e)&&X[e]===Y)return e},C.typeConverters={BigNumber:function(e){return new S(e+"")},Fraction:function(e){return new M(e)},Complex:function(e){return e},number:function(e){return e}},C._getNumberConverter=function(e){if(!C.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return C.typeConverters[e]},W)if((0,f.hasOwnProperty)(W,Z)){var K=W[Z];K.dimensions=K.base.dimensions}for(var J in H)if((0,f.hasOwnProperty)(H,J)){var Q=W[H[J]],ee={};for(var te in Q)(0,f.hasOwnProperty)(Q,te)&&(ee[te]=Q[te]);ee.name=J,W[J]=ee}return C.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},C.createUnit=function(e,t){if("object"!==(0,a.default)(e))throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override)for(var r in e)if((0,f.hasOwnProperty)(e,r)&&C.deleteUnit(r),e[r].aliases)for(var n=0;n<e[r].aliases.length;n++)C.deleteUnit(e[r].aliases[n]);var i;for(var o in e)(0,f.hasOwnProperty)(e,o)&&(i=C.createUnitSingle(o,e[o]));return i},C.createUnitSingle=function(e,t,r){if(null==t&&(t={}),"string"!=typeof e)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if((0,f.hasOwnProperty)(W,e))throw new Error('Cannot create unit "'+e+'": a unit with that name already exists');!function(e){for(var t=0;t<e.length;t++){if(n=e.charAt(t),0===t&&!C.isValidAlpha(n))throw new Error('Invalid unit name (must begin with alpha character): "'+e+'"');if(t>0&&!C.isValidAlpha(n)&&!O(n))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);var i,o,s,l=null,c=[],u=0;if(t&&"Unit"===t.type)l=t.clone();else if("string"==typeof t)""!==t&&(i=t);else{if("object"!==(0,a.default)(t))throw new TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');i=t.definition,o=t.prefixes,u=t.offset,s=t.baseName,t.aliases&&(c=t.aliases.valueOf())}if(c)for(var p=0;p<c.length;p++)if((0,f.hasOwnProperty)(W,c[p]))throw new Error('Cannot create alias "'+c[p]+'": a unit with that name already exists');if(i&&"string"==typeof i&&!l)try{l=C.parse(i,{allowNoUnits:!0})}catch(t){throw t.message='Could not create unit "'+e+'" from "'+i+'": '+t.message,t}else i&&"Unit"===i.type&&(l=i.clone());c=c||[],u=u||0,o=o&&o.toUpperCase&&j[o.toUpperCase()]||j.NONE;var h={};if(l){h={name:e,value:l.value,dimensions:l.dimensions.slice(0),prefixes:o,offset:u};var d=!1;for(var m in $)if((0,f.hasOwnProperty)($,m)){for(var g=!0,y=0;y<U.length;y++)if(Math.abs((h.dimensions[y]||0)-($[m].dimensions[y]||0))>1e-12){g=!1;break}if(g){d=!0,h.base=$[m];break}}if(!d){s=s||e+"_STUFF";var v={dimensions:l.dimensions.slice(0)};v.key=s,$[s]=v,Y[s]={unit:h,prefix:j.NONE[""]},h.base=$[s]}}else{if(s=s||e+"_STUFF",U.indexOf(s)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var b in U.push(s),$)(0,f.hasOwnProperty)($,b)&&($[b].dimensions[U.length-1]=0);for(var x={dimensions:[]},_=0;_<U.length;_++)x.dimensions[_]=0;x.dimensions[U.length-1]=1,x.key=s,$[s]=x,h={name:e,value:1,dimensions:$[s].dimensions.slice(0),prefixes:o,offset:u,base:$[s]},Y[s]={unit:h,prefix:j.NONE[""]}}C.UNITS[e]=h;for(var w=0;w<c.length;w++){var k=c[w],D={};for(var T in h)(0,f.hasOwnProperty)(h,T)&&(D[T]=h[T]);D.name=k,C.UNITS[k]=D}return delete B.cache,new C(null,e)},C.deleteUnit=function(e){delete C.UNITS[e]},C.PREFIXES=j,C.BASE_DIMENSIONS=U,C.BASE_UNITS=$,C.UNIT_SYSTEMS=X,C.UNITS=W,C}),{isClass:!0});t.createUnitClass=g},44193:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCreateUnit=void 0;var n=r(58450),a="createUnit",i=["typed","Unit"],o=(0,n.factory)(a,i,(function(e){var t=e.typed,r=e.Unit;return t(a,{"Object, Object":function(e,t){return r.createUnit(e,t)},Object:function(e){return r.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,n){var a={};return a[e]=t,r.createUnit(a,n)},"string, Unit | string | Object":function(e,t){var n={};return n[e]=t,r.createUnit(n,{})},string:function(e){var t={};return t[e]={},r.createUnit(t,{})}})}));t.createCreateUnit=o},91406:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSplitUnit=void 0;var n=r(58450),a="splitUnit",i=["typed"],o=(0,n.factory)(a,i,(function(e){return(0,e.typed)(a,{"Unit, Array":function(e,t){return e.splitUnit(t)}})}));t.createSplitUnit=o},61867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnitFunction=void 0;var n=r(58450),a=r(30401),i="unit",o=["typed","Unit"],s=(0,n.factory)(i,o,(function(e){var t=e.typed,r=e.Unit;return t(i,{Unit:function(e){return e.clone()},string:function(e){return r.isValuelessUnit(e)?new r(null,e):r.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string":function(e,t){return new r(e,t)},"Array | Matrix":function(e){return(0,a.deepMap)(e,this)}})}));t.createUnitFunction=s},12976:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createWienDisplacement=t.createWeakMixingAngle=t.createVacuumImpedance=t.createThomsonCrossSection=t.createStefanBoltzmann=t.createSpeedOfLight=t.createSecondRadiation=t.createSackurTetrode=t.createRydberg=t.createReducedPlanckConstant=t.createQuantumOfCirculation=t.createProtonMass=t.createPlanckTime=t.createPlanckTemperature=t.createPlanckMass=t.createPlanckLength=t.createPlanckConstant=t.createPlanckCharge=t.createNuclearMagneton=t.createNeutronMass=t.createMolarVolume=t.createMolarPlanckConstant=t.createMolarMassC12=t.createMolarMass=t.createMagneticFluxQuantum=t.createMagneticConstant=t.createLoschmidt=t.createKlitzing=t.createJosephson=t.createInverseConductanceQuantum=t.createHartreeEnergy=t.createGravity=t.createGravitationConstant=t.createGasConstant=t.createFirstRadiation=t.createFineStructure=t.createFermiCoupling=t.createFaraday=t.createElementaryCharge=t.createElectronMass=t.createElectricConstant=t.createEfimovFactor=t.createDeuteronMass=t.createCoulomb=t.createConductanceQuantum=t.createClassicalElectronRadius=t.createBoltzmann=t.createBohrRadius=t.createBohrMagneton=t.createAvogadro=t.createAtomicMass=void 0;var n=r(58450),a=te("speedOfLight","299792458","m s^-1");t.createSpeedOfLight=a;var i=te("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2");t.createGravitationConstant=i;var o=te("planckConstant","6.62607015e-34","J s");t.createPlanckConstant=o;var s=te("reducedPlanckConstant","1.0545718176461565e-34","J s");t.createReducedPlanckConstant=s;var l=te("magneticConstant","1.25663706212e-6","N A^-2");t.createMagneticConstant=l;var c=te("electricConstant","8.8541878128e-12","F m^-1");t.createElectricConstant=c;var u=te("vacuumImpedance","376.730313667","ohm");t.createVacuumImpedance=u;var f=te("coulomb","8.987551792261171e9","N m^2 C^-2");t.createCoulomb=f;var p=te("elementaryCharge","1.602176634e-19","C");t.createElementaryCharge=p;var h=te("bohrMagneton","9.2740100783e-24","J T^-1");t.createBohrMagneton=h;var d=te("conductanceQuantum","7.748091729863649e-5","S");t.createConductanceQuantum=d;var m=te("inverseConductanceQuantum","12906.403729652257","ohm");t.createInverseConductanceQuantum=m;var g=te("magneticFluxQuantum","2.0678338484619295e-15","Wb");t.createMagneticFluxQuantum=g;var y=te("nuclearMagneton","5.0507837461e-27","J T^-1");t.createNuclearMagneton=y;var v=te("klitzing","25812.807459304513","ohm");t.createKlitzing=v;var b=te("josephson","4.835978484169836e14 Hz V","Hz V^-1");t.createJosephson=b;var x=te("bohrRadius","5.29177210903e-11","m");t.createBohrRadius=x;var _=te("classicalElectronRadius","2.8179403262e-15","m");t.createClassicalElectronRadius=_;var w=te("electronMass","9.1093837015e-31","kg");t.createElectronMass=w;var k=te("fermiCoupling","1.1663787e-5","GeV^-2");t.createFermiCoupling=k;var D=re("fineStructure",.0072973525693);t.createFineStructure=D;var T=te("hartreeEnergy","4.3597447222071e-18","J");t.createHartreeEnergy=T;var A=te("protonMass","1.67262192369e-27","kg");t.createProtonMass=A;var S=te("deuteronMass","3.3435830926e-27","kg");t.createDeuteronMass=S;var M=te("neutronMass","1.6749271613e-27","kg");t.createNeutronMass=M;var E=te("quantumOfCirculation","3.6369475516e-4","m^2 s^-1");t.createQuantumOfCirculation=E;var C=te("rydberg","10973731.568160","m^-1");t.createRydberg=C;var N=te("thomsonCrossSection","6.6524587321e-29","m^2");t.createThomsonCrossSection=N;var O=re("weakMixingAngle",.2229);t.createWeakMixingAngle=O;var I=re("efimovFactor",22.7);t.createEfimovFactor=I;var P=te("atomicMass","1.66053906660e-27","kg");t.createAtomicMass=P;var R=te("avogadro","6.02214076e23","mol^-1");t.createAvogadro=R;var L=te("boltzmann","1.380649e-23","J K^-1");t.createBoltzmann=L;var F=te("faraday","96485.33212331001","C mol^-1");t.createFaraday=F;var B=te("firstRadiation","3.7417718521927573e-16","W m^2");t.createFirstRadiation=B;var z=te("loschmidt","2.686780111798444e25","m^-3");t.createLoschmidt=z;var j=te("gasConstant","8.31446261815324","J K^-1 mol^-1");t.createGasConstant=j;var U=te("molarPlanckConstant","3.990312712893431e-10","J s mol^-1");t.createMolarPlanckConstant=U;var $=te("molarVolume","0.022413969545014137","m^3 mol^-1");t.createMolarVolume=$;var V=re("sackurTetrode",-1.16487052358);t.createSackurTetrode=V;var q=te("secondRadiation","0.014387768775039337","m K");t.createSecondRadiation=q;var W=te("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4");t.createStefanBoltzmann=W;var H=te("wienDisplacement","2.897771955e-3","m K");t.createWienDisplacement=H;var G=te("molarMass","0.99999999965e-3","kg mol^-1");t.createMolarMass=G;var X=te("molarMassC12","11.9999999958e-3","kg mol^-1");t.createMolarMassC12=X;var Y=te("gravity","9.80665","m s^-2");t.createGravity=Y;var Z=te("planckLength","1.616255e-35","m");t.createPlanckLength=Z;var K=te("planckMass","2.176435e-8","kg");t.createPlanckMass=K;var J=te("planckTime","5.391245e-44","s");t.createPlanckTime=J;var Q=te("planckCharge","1.87554603778e-18","C");t.createPlanckCharge=Q;var ee=te("planckTemperature","1.416785e+32","K");function te(e,t,r){return(0,n.factory)(e,["config","Unit","BigNumber"],(function(e){var n=e.config,a=e.Unit,i=e.BigNumber,o=new a("BigNumber"===n.number?new i(t):parseFloat(t),r);return o.fixPrefix=!0,o}))}function re(e,t){return(0,n.factory)(e,["config","BigNumber"],(function(e){var r=e.config,n=e.BigNumber;return"BigNumber"===r.number?new n(t):t}))}t.createPlanckTemperature=ee},70517:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arraySize=l,t.contains=function(e,t){return-1!==e.indexOf(t)},t.filter=function(e,t){if(1!==l(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)},t.filterRegExp=function(e,t){if(1!==l(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,(function(e){return t.test(e)}))},t.flatten=m,t.forEach=function(e,t){Array.prototype.forEach.call(e,t)},t.generalize=function(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;for(var t=[],r=0;r<e.length;r++)t.push(e[r].value);return t},t.getArrayDataType=function e(t,r){for(var n,a=0,i=0;i<t.length;i++){var o=t[i],s=Array.isArray(o);if(0===i&&s&&(a=o.length),s&&o.length!==a)return;var l=s?e(o,r):r(o);if(void 0===n)n=l;else if(n!==l)return"mixed"}return n},t.identify=function(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n<e.length;n++)e[n]===e[n-1]?r++:r=0,t.push({value:e[n],identifier:r});return t},t.initial=function(e){return e.slice(0,e.length-1)},t.join=function(e,t){return Array.prototype.join.call(e,t)},t.last=function(e){return e[e.length-1]},t.map=function(e,t){return Array.prototype.map.call(e,t)},t.processSizesWildcard=f,t.reshape=function(e,t){var r=m(e),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new o.DimensionError(0,n,"!=");var a=p(t=f(t,n));if(n!==a)throw new o.DimensionError(a,n,"!=");try{return function(e,t){for(var r,n=e,a=t.length-1;a>0;a--){var i=t[a];r=[];for(var o=n.length/i,s=0;s<o;s++)r.push(n.slice(s*i,(s+1)*i));n=r}return n}(r,t)}catch(e){if(e instanceof o.DimensionError)throw new o.DimensionError(a,n,"!=");throw e}},t.resize=function(e,t,r){if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new Error("Resizing to scalar is not supported");return t.forEach((function(e){if(!(0,a.isNumber)(e)||!(0,n.isInteger)(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+(0,i.format)(t)+")")})),u(e,t,0,void 0!==r?r:0),e},t.squeeze=function(e,t){for(var r=t||l(e);Array.isArray(e)&&1===e.length;)e=e[0],r.shift();for(var n=r.length;1===r[n-1];)n--;return n<r.length&&(e=h(e,n,0),r.length=n),e},t.unsqueeze=function(e,t,r,n){var a=n||l(e);if(r)for(var i=0;i<r;i++)e=[e],a.unshift(1);for(e=d(e,t,0);a.length<t;)a.push(1);return e},t.validate=function(e,t){if(0===t.length){if(Array.isArray(e))throw new o.DimensionError(e.length,0)}else c(e,t,0)},t.validateIndex=function(e,t){if(!(0,a.isNumber)(e)||!(0,n.isInteger)(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new s.IndexError(e,t)};var n=r(49473),a=r(57237),i=r(59398),o=r(12906),s=r(14452);function l(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function c(e,t,r){var n,a=e.length;if(a!==t[r])throw new o.DimensionError(a,t[r]);if(r<t.length-1){var i=r+1;for(n=0;n<a;n++){var s=e[n];if(!Array.isArray(s))throw new o.DimensionError(t.length-1,t.length,"<");c(e[n],t,i)}}else for(n=0;n<a;n++)if(Array.isArray(e[n]))throw new o.DimensionError(t.length+1,t.length,">")}function u(e,t,r,n){var a,i,o=e.length,s=t[r],l=Math.min(o,s);if(e.length=s,r<t.length-1){var c=r+1;for(a=0;a<l;a++)i=e[a],Array.isArray(i)||(i=[i],e[a]=i),u(i,t,c,n);for(a=l;a<s;a++)i=[],e[a]=i,u(i,t,c,n)}else{for(a=0;a<l;a++)for(;Array.isArray(e[a]);)e[a]=e[a][0];for(a=l;a<s;a++)e[a]=n}}function f(e,t){var r=p(e),n=e.slice(),a=e.indexOf(-1);if(e.indexOf(-1,a+1)>=0)throw new Error("More than one wildcard in sizes");if(a>=0){if(t%r!=0)throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);n[a]=-t/r}return n}function p(e){return e.reduce((function(e,t){return e*t}),1)}function h(e,t,r){var n,a;if(r<t){var i=r+1;for(n=0,a=e.length;n<a;n++)e[n]=h(e[n],t,i)}else for(;Array.isArray(e);)e=e[0];return e}function d(e,t,r){var n,a;if(Array.isArray(e)){var i=r+1;for(n=0,a=e.length;n<a;n++)e[n]=d(e[n],t,i)}else for(var o=r;o<t;o++)e=[e];return e}function m(e){if(!Array.isArray(e))return e;var t=[];return e.forEach((function e(r){Array.isArray(r)?r.forEach(e):t.push(r)})),t}},90226:(e,t)=>{"use strict";function r(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function n(e,t,n){var i,o,s,l,c,u=e.constructor,f=+(e.s<0),p=+(t.s<0);if(f){i=a(r(e));for(var h=0;h<i.length;++h)i[h]^=1}else i=a(e);if(p){o=a(r(t));for(var d=0;d<o.length;++d)o[d]^=1}else o=a(t);i.length<=o.length?(s=i,l=o,c=f):(s=o,l=i,c=p);var m=s.length,g=l.length,y=1^n(f,p),v=new u(1^y),b=new u(1),x=new u(2),_=u.precision;for(u.config({precision:1e9});m>0;)n(s[--m],l[--g])===y&&(v=v.plus(b)),b=b.times(x);for(;g>0;)n(c,l[--g])===y&&(v=v.plus(b)),b=b.times(x);return u.config({precision:_}),0===y&&(v.s=-v.s),v}function a(e){for(var t=e.d,r=t[0]+"",n=1;n<t.length;++n){for(var a=t[n]+"",i=7-a.length;i--;)a="0"+a;r+=a}for(var o=r.length;"0"===r.charAt(o);)o--;var s=e.e,l=r.slice(0,o+1||1),c=l.length;if(s>0)if(++s>c)for(s-=c;s--;)l+="0";else s<c&&(l=l.slice(0,s)+"."+l.slice(s));for(var u=[0],f=0;f<l.length;){for(var p=u.length;p--;)u[p]*=10;u[0]+=parseInt(l.charAt(f++));for(var h=0;h<u.length;++h)u[h]>1&&(null!==u[h+1]&&void 0!==u[h+1]||(u[h+1]=0),u[h+1]+=u[h]>>1,u[h]&=1)}return u.reverse()}Object.defineProperty(t,"__esModule",{value:!0}),t.bitAndBigNumber=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return n(e,t,(function(e,t){return e&t}))},t.bitNotBigNumber=r,t.bitOrBigNumber=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var a=new r(-1);return e.isZero()||t.eq(a)||e.eq(t)?t:t.isZero()||e.eq(a)?e:e.isFinite()&&t.isFinite()?n(e,t,(function(e,t){return e|t})):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?a:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e},t.bitXor=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var a=e.constructor;if(e.isNaN()||t.isNaN())return new a(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new a(0);var i=new a(-1);return e.eq(i)?r(t):t.eq(i)?r(e):e.isFinite()&&t.isFinite()?n(e,t,(function(e,t){return e^t})):e.isFinite()||t.isFinite()?new a(e.isNegative()===t.isNegative()?1/0:-1/0):i},t.bitwise=n,t.leftShiftBigNumber=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t)):new r(NaN)},t.rightArithShiftBigNumber=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}},78981:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBigNumberTau=t.createBigNumberPi=t.createBigNumberPhi=t.createBigNumberE=void 0;var n=r(46054),a=(0,n.memoize)((function(e){return new e(1).exp()}),{hasher:l});t.createBigNumberE=a;var i=(0,n.memoize)((function(e){return new e(1).plus(new e(5).sqrt()).div(2)}),{hasher:l});t.createBigNumberPhi=i;var o=(0,n.memoize)((function(e){return e.acos(-1)}),{hasher:l});t.createBigNumberPi=o;var s=(0,n.memoize)((function(e){return o(e).times(2)}),{hasher:l});function l(e){return e[0].precision}t.createBigNumberTau=s},5035:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.format=function(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var r,n,l="auto";if(void 0!==t&&(t.notation&&(l=t.notation),"number"==typeof t?r=t:t.precision&&(r=t.precision),t.wordSize&&"number"!=typeof(n=t.wordSize)))throw new Error('Option "wordSize" must be a number');switch(l){case"fixed":return s(e,r);case"exponential":return o(e,r);case"engineering":return i(e,r);case"bin":return a(e,2,n);case"oct":return a(e,8,n);case"hex":return a(e,16,n);case"auto":var c=t&&void 0!==t.lowerExp?t.lowerExp:-3,u=t&&void 0!==t.upperExp?t.upperExp:5;if(e.isZero())return"0";var f=e.toSignificantDigits(r),p=f.e;return(p>=c&&p<u?f.toFixed():o(e,r)).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+l+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}},t.toEngineering=i,t.toExponential=o,t.toFixed=s;var n=r(49473);function a(e,t,r){var a=new(0,e.constructor)(2),i="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!(0,n.isInteger)(r))throw new Error("size must be an integer");if(e.greaterThan(a.pow(r-1).sub(1))||e.lessThan(a.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(a.pow(r))),i="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(t," not supported "))}}function i(e,t){var r=e.e,n=r%3==0?r:r<0?r-3-r%3:r-r%3,a=e.mul(Math.pow(10,-n)),i=a.toPrecision(t);return-1!==i.indexOf("e")&&(i=a.toString()),i+"e"+(r>=0?"+":"")+n.toString()}function o(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function s(e,t){return e.toFixed(t)}},30585:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nearlyEqual=function(e,t,r){if(null==r)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var n=e.minus(t).abs();if(n.isZero())return!0;var a=e.constructor.max(e.abs(),t.abs());return n.lte(a.times(r))}return!1}},30401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.containsCollections=function(e){for(var t=0;t<e.length;t++)if((0,n.isCollection)(e[t]))return!0;return!1},t.deepForEach=function e(t,r){(0,n.isMatrix)(t)&&(t=t.valueOf());for(var a=0,i=t.length;a<i;a++){var o=t[a];Array.isArray(o)?e(o,r):r(o)}},t.deepMap=function e(t,r,n){return t&&"function"==typeof t.map?t.map((function(t){return e(t,r,n)})):r(t)},t.reduce=function(e,t,r){var s=Array.isArray(e)?(0,i.arraySize)(e):e.size();if(t<0||t>=s.length)throw new a.IndexError(t,s.length);return(0,n.isMatrix)(e)?e.create(o(e.valueOf(),t,r)):o(e,t,r)},t.scatter=function(e,t,r,n,a,i,o,s,l,c,u){var f,p,h,d,m=e._values,g=e._index,y=e._ptr;if(n)for(p=y[t],h=y[t+1],f=p;f<h;f++)r[d=g[f]]!==i?(r[d]=i,o.push(d),c?(n[d]=l?s(m[f],u):s(u,m[f]),a[d]=i):n[d]=m[f]):(n[d]=l?s(m[f],n[d]):s(n[d],m[f]),a[d]=i);else for(p=y[t],h=y[t+1],f=p;f<h;f++)r[d=g[f]]!==i?(r[d]=i,o.push(d)):a[d]=i};var n=r(57237),a=r(14452),i=r(70517);function o(e,t,r){var n,a,i,s;if(t<=0){if(Array.isArray(e[0])){for(s=function(e){var t,r,n=e.length,a=e[0].length,i=[];for(r=0;r<a;r++){var o=[];for(t=0;t<n;t++)o.push(e[t][r]);i.push(o)}return i}(e),a=[],n=0;n<s.length;n++)a[n]=o(s[n],t-1,r);return a}for(i=e[0],n=1;n<e.length;n++)i=r(i,e[n]);return i}for(a=[],n=0;n<e.length;n++)a[n]=o(e[n],t-1,r);return a}},31625:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.complexEquals=function(e,t,r){return(0,n.nearlyEqual)(e.re,t.re,r)&&(0,n.nearlyEqual)(e.im,t.im,r)};var n=r(49473)},27807:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.getSafeProperties=function(e){return Object.keys(e).filter((function(t){return(0,i.hasOwnProperty)(e,t)}))},t.getSafeProperty=function(e,t){if(l(e)&&o(e,t))return e[t];if("function"==typeof e[t]&&s(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')},t.hasSafeProperty=function(e,t){return t in e},t.isPlainObject=l,t.isSafeMethod=s,t.isSafeProperty=o,t.setSafeProperty=function(e,t,r){if(l(e)&&o(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')},t.validateSafeMethod=function(e,t){if(!s(e,t))throw new Error('No access to method "'+t+'"')};var a=n(r(80812)),i=r(54699);function o(e,t){return!(!e||"object"!==(0,a.default)(e)||!(0,i.hasOwnProperty)(c,t)&&(t in Object.prototype||t in Function.prototype))}function s(e,t){return!(null==e||"function"!=typeof e[t]||(0,i.hasOwnProperty)(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)||!(0,i.hasOwnProperty)(u,t)&&(t in Object.prototype||t in Function.prototype))}function l(e){return"object"===(0,a.default)(e)&&e&&e.constructor===Object}var c={length:!0,name:!0},u={toString:!0,valueOf:!0,toLocaleString:!0}},37039:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.mixin=function(e){var t=new a.default;return e.on=t.on.bind(t),e.off=t.off.bind(t),e.once=t.once.bind(t),e.emit=t.emit.bind(t),e};var a=n(r(7906))},58450:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertDependencies=s,t.create=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(e).forEach((function(e){return e(t)})),t},t.factory=function(e,t,r,n){function i(n){var i=(0,a.pickShallow)(n,t.map(c));return s(e,t,n),r(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i},t.isFactory=o,t.isOptionalDependency=l,t.sortFactories=i,t.stripOptionalNotation=c;var n=r(70517),a=r(54699);function i(e){var t={};function r(e,a){if(o(e)){if((0,n.contains)(e.dependencies,a.fn||a.name))return!0;if(e.dependencies.some((function(e){return r(t[e],a)})))return!0}return!1}e.forEach((function(e){t[e.fn]=e}));var a=[];function i(e){for(var t=0;t<a.length&&!r(a[t],e);)t++;a.splice(t,0,e)}return e.filter(o).forEach(i),e.filter((function(e){return!o(e)})).forEach(i),a}function o(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function s(e,t,r){if(!t.filter((function(e){return!l(e)})).every((function(e){return void 0!==r[e]}))){var n=t.filter((function(e){return void 0===r[e]}));throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(n.map((function(e){return'"'.concat(e,'"')})).join(", "),"."))}}function l(e){return e&&"?"===e[0]}function c(e){return e&&"?"===e[0]?e.slice(1):e}},46054:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.maxArgumentCount=function(e){return Object.keys(e.signatures||{}).reduce((function(e,t){var r=(t.match(/,/g)||[]).length+1;return Math.max(e,r)}),-1)},t.memoize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.hasher,n=t.limit;return n=null==n?Number.POSITIVE_INFINITY:n,r=null==r?JSON.stringify:r,function t(){"object"!==(0,a.default)(t.cache)&&(t.cache={values:new Map,lru:(0,i.lruQueue)(n||Number.POSITIVE_INFINITY)});for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var l=r(o);if(t.cache.values.has(l))return t.cache.lru.hit(l),t.cache.values.get(l);var c=e.apply(e,o);return t.cache.values.set(l,c),t.cache.values.delete(t.cache.lru.hit(l)),c}},t.memoizeCompare=function(e,t){var r=function r(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];for(var i=0;i<r.cache.length;i++){var o=r.cache[i];if(t(n,o.args))return o.res}var s=e.apply(e,n);return r.cache.unshift({args:n,res:s}),s};return r.cache=[],r};var a=n(r(80812)),i=r(68401)},57237:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.isAccessorNode=function(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1},t.isArray=void 0,t.isArrayNode=function(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1},t.isAssignmentNode=function(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1},t.isBigNumber=i,t.isBlockNode=function(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1},t.isBoolean=function(e){return"boolean"==typeof e},t.isChain=g,t.isCollection=function(e){return Array.isArray(e)||u(e)},t.isComplex=o,t.isConditionalNode=function(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1},t.isConstantNode=function(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1},t.isDate=function(e){return e instanceof Date},t.isDenseMatrix=function(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1},t.isFraction=s,t.isFunction=function(e){return"function"==typeof e},t.isFunctionAssignmentNode=function(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1},t.isFunctionNode=function(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1},t.isHelp=d,t.isIndex=p,t.isIndexNode=function(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1},t.isMatrix=u,t.isNode=m,t.isNull=function(e){return null===e},t.isNumber=function(e){return"number"==typeof e},t.isObject=function(e){return!(!e||"object"!==(0,a.default)(e)||e.constructor!==Object||o(e)||s(e))},t.isObjectNode=function(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1},t.isOperatorNode=function(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1},t.isParenthesisNode=function(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1},t.isRange=f,t.isRangeNode=function(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1},t.isRegExp=function(e){return e instanceof RegExp},t.isResultSet=h,t.isSparseMatrix=function(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1},t.isString=function(e){return"string"==typeof e},t.isSymbolNode=function(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1},t.isUndefined=function(e){return void 0===e},t.isUnit=l,t.typeOf=function(e){var t=(0,a.default)(e);return"object"===t?null===e?"null":Array.isArray(e)?"Array":e instanceof Date?"Date":e instanceof RegExp?"RegExp":i(e)?"BigNumber":o(e)?"Complex":s(e)?"Fraction":u(e)?"Matrix":l(e)?"Unit":p(e)?"Index":f(e)?"Range":h(e)?"ResultSet":m(e)?e.type:g(e)?"Chain":d(e)?"Help":"Object":"function"===t?"Function":t};var a=n(r(80812));function i(e){return!(!e||"object"!==(0,a.default)(e)||"function"!=typeof e.constructor)&&(!0===e.isBigNumber&&"object"===(0,a.default)(e.constructor.prototype)&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function o(e){return e&&"object"===(0,a.default)(e)&&!0===Object.getPrototypeOf(e).isComplex||!1}function s(e){return e&&"object"===(0,a.default)(e)&&!0===Object.getPrototypeOf(e).isFraction||!1}function l(e){return e&&!0===e.constructor.prototype.isUnit||!1}var c=Array.isArray;function u(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function f(e){return e&&!0===e.constructor.prototype.isRange||!1}function p(e){return e&&!0===e.constructor.prototype.isIndex||!1}function h(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function d(e){return e&&!0===e.constructor.prototype.isHelp||!1}function m(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function g(e){return e&&!0===e.constructor.prototype.isChain||!1}t.isArray=c},46:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTemplate=void 0,t.escapeLatex=u,t.latexSymbols=t.latexOperators=t.latexFunctions=void 0,t.toSymbol=function(e,t){return(t=void 0!==t&&t)?(0,i.hasOwnProperty)(c,e)?c[e]:"\\mathrm{"+u(e)+"}":(0,i.hasOwnProperty)(o,e)?o[e]:u(e)};var a=n(r(49217)),i=r(54699),o={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"};t.latexSymbols=o;var s={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"};t.latexOperators=s;var l={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(s.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(s.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(s.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(s.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(s.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(s.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(s.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(s.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(s.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(s.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(s.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(s.bitAnd,"${args[1]}\\right)")},bitNot:{1:s.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(s.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(s.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(s.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(s.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(s.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(s.and,"${args[1]}\\right)")},not:{1:s.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(s.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(s.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(s.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},sqrtm:{1:"{${args[0]}}".concat(s.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(s.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(s.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(s.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(s.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(s.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(s.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(s.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(s.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(s.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(o.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}};t.latexFunctions=l,t.defaultTemplate="\\mathrm{${name}}\\left(${args}\\right)";var c={deg:"^\\circ"};function u(e){return(0,a.default)(e,{preserveFormatting:!0})}},68401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lruQueue=function(e){var t=0,r=1,n=Object.create(null),a=Object.create(null),i=0,o=function(e){var o=a[e];if(o&&(delete n[o],delete a[e],--t,r===o)){if(!t)return i=0,void(r=1);for(;!hasOwnProperty.call(n,++r););}};return e=Math.abs(e),{hit:function(s){var l=a[s],c=++i;if(n[c]=s,a[s]=c,!l){if(++t<=e)return;return s=n[r],o(s),s}if(delete n[l],r===l)for(;!hasOwnProperty.call(n,++r););},delete:o,clear:function(){t=i=0,r=1,n=Object.create(null),a=Object.create(null)}}}},84146:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectWrappingMap=void 0,t.assign=function(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 a=0,i=r;a<i.length;a++){var o=i[a];if(o)if(p(o)){var c,u=l(o.keys());try{for(u.s();!(c=u.n()).done;){var f=c.value;e.set(f,o.get(f))}}catch(e){u.e(e)}finally{u.f()}}else if((0,s.isObject)(o))for(var h=0,d=Object.keys(o);h<d.length;h++){var m=d[h];e.set(m,o[m])}}return e},t.createEmptyMap=f,t.createMap=function(e){if(!e)return f();if(p(e))return e;if((0,s.isObject)(e))return new u(e);throw new Error("createMap can create maps from objects or Maps")},t.isMap=p,t.toObject=function(e){if(e instanceof u)return e.wrappedObject;var t,r={},n=l(e.keys());try{for(n.s();!(t=n.n()).done;){var a=t.value,i=e.get(a);(0,o.setSafeProperty)(r,a,i)}}catch(e){n.e(e)}finally{n.f()}return r};var a=n(r(96388)),i=n(r(99640)),o=r(27807),s=r(57237);function l(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var u=function(){function e(t){(0,a.default)(this,e),this.wrappedObject=t}return(0,i.default)(e,[{key:"keys",value:function(){return Object.keys(this.wrappedObject)}},{key:"get",value:function(e){return(0,o.getSafeProperty)(this.wrappedObject,e)}},{key:"set",value:function(e,t){return(0,o.setSafeProperty)(this.wrappedObject,e,t),this}},{key:"has",value:function(e){return(0,o.hasSafeProperty)(this.wrappedObject,e)}}]),e}();function f(){return new Map}function p(e){return!!e&&(e instanceof Map||e instanceof u||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}t.ObjectWrappingMap=u},10935:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noBignumber=function(){throw new Error('No "bignumber" implementation available')},t.noFraction=function(){throw new Error('No "fraction" implementation available')},t.noIndex=function(){throw new Error('No "index" implementation available')},t.noMatrix=function(){throw new Error('No "matrix" implementation available')},t.noSubset=function(){throw new Error('No "matrix" implementation available')}},49473:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cosh=t.cbrt=t.atanh=t.asinh=t.acosh=t.DBL_EPSILON=void 0,t.digits=function(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length},t.expm1=void 0,t.format=function(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var r,a,i="auto";if(t&&(t.notation&&(i=t.notation),(0,n.isNumber)(t)?r=t:(0,n.isNumber)(t.precision)&&(r=t.precision),t.wordSize&&"number"!=typeof(a=t.wordSize)))throw new Error('Option "wordSize" must be a number');switch(i){case"fixed":return d(e,r);case"exponential":return m(e,r);case"engineering":return h(e,r);case"bin":return f(e,2,a);case"oct":return f(e,8,a);case"hex":return f(e,16,a);case"auto":return g(e,r,t&&t).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+i+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}},t.isInteger=a,t.log2=t.log1p=t.log10=void 0,t.nearlyEqual=function(e,t,r){if(null==r)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var n=Math.abs(e-t);return n<b||n<=Math.max(Math.abs(e),Math.abs(t))*r}return!1},t.roundDigits=y,t.sinh=t.sign=void 0,t.splitNumber=p,t.tanh=void 0,t.toEngineering=h,t.toExponential=m,t.toFixed=d,t.toPrecision=g;var n=r(57237);function a(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}var i=Math.sign||function(e){return e>0?1:e<0?-1:0};t.sign=i;var o=Math.log2||function(e){return Math.log(e)/Math.LN2};t.log2=o;var s=Math.log10||function(e){return Math.log(e)/Math.LN10};t.log10=s;var l=Math.log1p||function(e){return Math.log(e+1)};t.log1p=l;var c=Math.cbrt||function(e){if(0===e)return e;var t,r=e<0;return r&&(e=-e),t=isFinite(e)?(e/((t=Math.exp(Math.log(e)/3))*t)+2*t)/3:e,r?-t:t};t.cbrt=c;var u=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function f(e,t,r){var n={2:"0b",8:"0o",16:"0x"}[t],i="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!a(r))throw new Error("size must be an integer");if(e>Math.pow(2,r-1)-1||e<-Math.pow(2,r-1))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!a(e))throw new Error("Value must be an integer");e<0&&(e+=Math.pow(2,r)),i="i".concat(r)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(n).concat(e.toString(t)).concat(i)}function p(e){var t=String(e).toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],a=parseFloat(t[4]||"0"),i=n.indexOf(".");a+=-1!==i?i-1:n.length-1;var o=n.replace(".","").replace(/^0*/,(function(e){return a-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===o.length&&(o.push(0),a++),{sign:r,coefficients:o,exponent:a}}function h(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=y(p(e),t),a=r.exponent,i=r.coefficients,o=a%3==0?a:a<0?a-3-a%3:a-a%3;if((0,n.isNumber)(t))for(;t>i.length||a-o+1>i.length;)i.push(0);else for(var s=Math.abs(a-o)-(i.length-1),l=0;l<s;l++)i.push(0);for(var c=Math.abs(a-o),u=1;c>0;)u++,c--;var f=i.slice(u).join(""),h=(0,n.isNumber)(t)&&f.length||f.match(/[1-9]/)?"."+f:"",d=i.slice(0,u).join("")+h+"e"+(a>=0?"+":"")+o.toString();return r.sign+d}function d(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=p(e),n="number"==typeof t?y(r,r.exponent+1+t):r,a=n.coefficients,i=n.exponent+1,o=i+(t||0);return a.length<o&&(a=a.concat(v(o-a.length))),i<0&&(a=v(1-i).concat(a),i=1),i<a.length&&a.splice(i,0,0===i?"0.":"."),n.sign+a.join("")}function m(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=p(e),n=t?y(r,t):r,a=n.coefficients,i=n.exponent;a.length<t&&(a=a.concat(v(t-a.length)));var o=a.shift();return n.sign+o+(a.length>0?"."+a.join(""):"")+"e"+(i>=0?"+":"")+i}function g(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=r&&void 0!==r.lowerExp?r.lowerExp:-3,a=r&&void 0!==r.upperExp?r.upperExp:5,i=p(e),o=t?y(i,t):i;if(o.exponent<n||o.exponent>=a)return m(e,t);var s=o.coefficients,l=o.exponent;s.length<t&&(s=s.concat(v(t-s.length))),s=s.concat(v(l-s.length+1+(s.length<t?t-s.length:0)));var c=l>0?l:0;return c<(s=v(-l).concat(s)).length-1&&s.splice(c+1,0,"."),o.sign+s.join("")}function y(e,t){for(var r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t&&n.splice(t,n.length-t)[0]>=5){var a=t-1;for(n[a]++;10===n[a];)n.pop(),0===a&&(n.unshift(0),r.exponent++,a++),n[--a]++}return r}function v(e){for(var t=[],r=0;r<e;r++)t.push(0);return t}t.expm1=u;var b=Number.EPSILON||2220446049250313e-31;t.DBL_EPSILON=b;var x=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)};t.acosh=x;var _=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)};t.asinh=_;var w=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2};t.atanh=w;var k=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2};t.cosh=k;var D=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2};t.sinh=D;var T=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};t.tanh=T},54699:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.canDefineProperty=function(){try{if(Object.defineProperty)return Object.defineProperty({},"x",{get:function(){}}),!0}catch(e){}return!1},t.clone=function e(t){var r=(0,a.default)(t);if("number"===r||"string"===r||"boolean"===r||null==t)return t;if("function"==typeof t.clone)return t.clone();if(Array.isArray(t))return t.map((function(t){return e(t)}));if(t instanceof Date)return new Date(t.valueOf());if((0,i.isBigNumber)(t))return t;if(t instanceof RegExp)throw new TypeError("Cannot clone "+t);return o(t,e)},t.deepExtend=function e(t,r){if(Array.isArray(r))throw new TypeError("Arrays are not supported by deepExtend");for(var n in r)if(l(r,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(r[n]&&r[n].constructor===Object)void 0===t[n]&&(t[n]={}),t[n]&&t[n].constructor===Object?e(t[n],r[n]):t[n]=r[n];else{if(Array.isArray(r[n]))throw new TypeError("Arrays are not supported by deepExtend");t[n]=r[n]}return t},t.deepFlatten=function(e){var t={};return s(e,t),t},t.deepStrictEqual=function e(t,r){var n,a,i;if(Array.isArray(t)){if(!Array.isArray(r))return!1;if(t.length!==r.length)return!1;for(a=0,i=t.length;a<i;a++)if(!e(t[a],r[a]))return!1;return!0}if("function"==typeof t)return t===r;if(t instanceof Object){if(Array.isArray(r)||!(r instanceof Object))return!1;for(n in t)if(!(n in r)||!e(t[n],r[n]))return!1;for(n in r)if(!(n in t))return!1;return!0}return t===r},t.extend=function(e,t){for(var r in t)l(t,r)&&(e[r]=t[r]);return e},t.get=c,t.hasOwnProperty=l,t.isLegacyFactory=function(e){return e&&"function"==typeof e.factory},t.lazy=function(e,t,r){var n,a=!0;Object.defineProperty(e,t,{get:function(){return a&&(n=r(),a=!1),n},set:function(e){n=e,a=!1},configurable:!0,enumerable:!0})},t.mapObject=o,t.pick=function(e,t,r){for(var n={},a=0;a<t.length;a++){var i=t[a],o=c(e,i);void 0!==o&&u(n,i,r?r(o,i):o)}return n},t.pickShallow=function(e,t){for(var r={},n=0;n<t.length;n++){var a=t[n],i=e[a];void 0!==i&&(r[a]=i)}return r},t.set=u,t.traverse=function e(t,r){if(r&&"string"==typeof r)return e(t,r.split("."));var n=t;if(r)for(var a=0;a<r.length;a++){var i=r[a];i in n||(n[i]={}),n=n[i]}return n},t.values=function(e){return Object.keys(e).map((function(t){return e[t]}))};var a=n(r(80812)),i=r(57237);function o(e,t){var r={};for(var n in e)l(e,n)&&(r[n]=t(e[n]));return r}function s(e,t){for(var r in e)if(l(e,r)){var n=e[r];"object"===(0,a.default)(n)&&null!==n?s(n,t):t[r]=n}}function l(e,t){return e&&Object.hasOwnProperty.call(e,t)}function c(e,t){if("string"==typeof t)return f(t)?c(e,t.split(".")):e[t];for(var r=e,n=0;n<t.length;n++){var a=t[n];r=r?r[a]:void 0}return r}function u(e,t,r){if("string"==typeof t)return f(t)?u(e,t.split("."),r):(e[t]=r,e);for(var n=e,a=0;a<t.length-1;a++){var i=t[a];void 0===n[i]&&(n[i]={}),n=n[i]}return t.length>0&&(n[t[t.length-1]]=r),e}function f(e){return-1!==e.indexOf(".")}},81882:()=>{"use strict";Number.isFinite=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},Number.isNaN=Number.isNaN||function(e){return e!=e}},7852:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.product=function e(t,r){if(r<t)return 1;if(r===t)return r;var n=r+t>>1;return e(t,n)*e(n+1,r)}},67797:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSubScope=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];return"function"==typeof e.createSubScope?n.assign.apply(void 0,[e.createSubScope()].concat(r)):n.assign.apply(void 0,[(0,n.createEmptyMap)(),e].concat(r))};var n=r(84146)},59398:(e,t,r)=>{"use strict";var n=r(22948);Object.defineProperty(t,"__esModule",{value:!0}),t.compareText=function(e,t){if(!(0,i.isString)(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+(0,i.typeOf)(e)+", index: 0)");if(!(0,i.isString)(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+(0,i.typeOf)(t)+", index: 1)");return e===t?0:e>t?1:-1},t.endsWith=function(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t},t.escape=function(e){var t=String(e);return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},t.format=l,t.stringify=function(e){for(var t=String(e),r="",n=0;n<t.length;){var a=t.charAt(n);"\\"===a?(r+=a,n++,""!==(a=t.charAt(n))&&-1!=='"\\/bfnrtu'.indexOf(a)||(r+="\\"),r+=a):r+='"'===a?'\\"':a,n++}return'"'+r+'"'};var a=n(r(80812)),i=r(57237),o=r(49473),s=r(5035);function l(e,t){return"number"==typeof e?(0,o.format)(e,t):(0,i.isBigNumber)(e)?(0,s.format)(e,t):function(e){return e&&"object"===(0,a.default)(e)&&"number"==typeof e.s&&"number"==typeof e.n&&"number"==typeof e.d||!1}(e)?t&&"decimal"===t.fraction?e.toString():e.s*e.n+"/"+e.d:Array.isArray(e)?c(e,t):(0,i.isString)(e)?'"'+e+'"':"function"==typeof e?e.syntax?String(e.syntax):"function":e&&"object"===(0,a.default)(e)?"function"==typeof e.format?e.format(t):e&&e.toString(t)!=={}.toString()?e.toString(t):"{"+Object.keys(e).map((function(r){return'"'+r+'": '+l(e[r],t)})).join(", ")+"}":String(e)}function c(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,a=0;a<n;a++)0!==a&&(r+=", "),r+=c(e[a],t);return r+"]"}return l(e,t)}},65648:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="10.0.0"}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n=r(80881);dfd=n})();
//# sourceMappingURL=bundle.js.map</script><script>function render(zero=false){const frame=new dfd.DataFrame({inspection:['A','B','C'],readings:[6,zero?0:NaN,4]});const counts=frame.isNa().sum({axis:0});const values=frame.values.map(row=>row[1]),supplied=values.filter(Number.isFinite);window.reading={columns:frame.columns,missing:counts.values,sourceRows:frame.shape[0],supplied:supplied.length,knownTotal:supplied.reduce((a,b)=>a+b,0),rows:values.map(v=>Number.isFinite(v)?v:'Not supplied')};document.querySelector('#reading').textContent=JSON.stringify(reading,null,2);}document.querySelector('#zero').onclick=()=>render(true);document.querySelector('#restore').onclick=()=>render();render();</script></html>