-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeck2gislayer.js
More file actions
1 lines (1 loc) · 89.3 KB
/
deck2gislayer.js
File metadata and controls
1 lines (1 loc) · 89.3 KB
1
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var r in i)("object"==typeof exports?exports:t)[r]=i[r]}}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i(i.s=10)}([function(t,e,i){"use strict";function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}i.d(e,"a",(function(){return r}))},function(t,e,i){"use strict";(function(t,r){i.d(e,"b",(function(){return s})),i.d(e,"a",(function(){return o}));const n={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document,process:"object"==typeof r&&r},s=(globalThis,n.window||n.self||n.global),o=n.process||{};console}).call(this,i(9),i(3))},,function(t,e){var i,r,n=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var h,c=[],u=!1,l=-1;function p(){u&&h&&(u=!1,h.length?c=h.concat(c):l=-1,c.length&&g())}function g(){if(!u){var t=a(p);u=!0;for(var e=c.length;e;){for(h=c,c=[];++l<e;)h&&h[l].run();l=-1,e=c.length}h=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function f(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];c.push(new d(t,e)),1!==c.length||u||a(g)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=f,n.addListener=f,n.once=f,n.off=f,n.removeListener=f,n.removeAllListeners=f,n.emit=f,n.prependListener=f,n.prependOnceListener=f,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},,function(t,e){},function(t,e,i){"use strict";(function(t){i.d(e,"a",(function(){return n}));var r=i(7);function n(){return!("object"==typeof t&&"[object process]"===String(t)&&!t.browser)||Object(r.a)()}}).call(this,i(3))},function(t,e,i){"use strict";(function(t){function r(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if(void 0!==t&&"object"==typeof t.versions&&Boolean(t.versions.electron))return!0;const i="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||i;return!!(r&&r.indexOf("Electron")>=0)}i.d(e,"a",(function(){return r}))}).call(this,i(3))},,function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";i.r(e),i.d(e,"Deck2gisLayer",(function(){return ye})),i.d(e,"initDeck2gisProps",(function(){return Ee}));var r=i(0),n=new(i(12).a)({id:"deck"});new class{constructor(t={}){Object(r.a)(this,"_pool",[]),Object(r.a)(this,"opts",{overAlloc:2,poolSize:100}),this.setOptions(t)}setOptions(t){Object.assign(this.opts,t)}allocate(t,e,{size:i=1,type:r,padding:n=0,copy:s=!1,initialize:o=!1,maxCount:a}){const h=r||t&&t.constructor||Float32Array,c=e*i+n;if(ArrayBuffer.isView(t)){if(c<=t.length)return t;if(c*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new h(t.buffer,0,c)}let u=1/0;a&&(u=a*i+n);const l=this._allocate(h,c,o,u);return t&&s?l.set(t):o||l.fill(0,0,4),this._release(t),l}release(t){this._release(t)}_allocate(t,e,i,r){let n=Math.max(Math.ceil(e*this.opts.overAlloc),1);n>r&&(n=r);const s=this._pool,o=t.BYTES_PER_ELEMENT*n,a=s.findIndex(t=>t.byteLength>=o);if(a>=0){const e=new t(s.splice(a,1)[0],0,n);return i&&e.fill(0),e}return new t(n)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:i}=t,{byteLength:r}=i,n=e.findIndex(t=>t.byteLength>=r);n<0?e.push(i):(n>0||e.length<this.opts.poolSize)&&e.splice(n,0,i),e.length>this.opts.poolSize&&e.shift()}};function s(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}Math.PI,Math.PI;const o={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function a(t,{precision:e=o.precision}={}){return t=function(t){return Math.round(t/o.EPSILON)*o.EPSILON}(t),"".concat(parseFloat(t.toPrecision(e)))}function h(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function c(t,e,i){return p(t,t=>Math.max(e,Math.min(i,t)))}function u(t,e,i){return h(t)?t.map((t,r)=>u(t,e[r],i)):i*e+(1-i)*t}function l(t,e,i){const r=o.EPSILON;i&&(o.EPSILON=i);try{if(t===e)return!0;if(h(t)&&h(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!l(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):"number"==typeof t&&"number"==typeof e&&Math.abs(t-e)<=o.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{o.EPSILON=r}}function p(t,e,i){if(h(t)){const r=t;i=i||function(t){return t.clone?t.clone():new Array(t.length)}(r);for(let n=0;n<i.length&&n<r.length;++n)i[n]=e(t[n],n,i);return i}return e(t)}class g extends(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array)){clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){for(let i=0;i<this.ELEMENTS;++i)this[i]=t[i+e];return this.check()}toArray(t=[],e=0){for(let i=0;i<this.ELEMENTS;++i)t[e+i]=this[i];return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:h(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(o)}formatString(t){let e="";for(let i=0;i<this.ELEMENTS;++i)e+=(i>0?", ":"")+a(this[i],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!l(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,i){if(void 0===i)return this.lerp(this,t,e);for(let r=0;r<this.ELEMENTS;++r){const n=t[r];this[r]=n+i*(e[r]-n)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],t[i]),e[i]);return this.check()}add(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]+=e[t];return this.check()}subtract(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]-=e[t];return this.check()}scale(t){if("number"==typeof t)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(o.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],t),e);return this.check()}get elements(){return this}}function d(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function f(t,e,i=""){if(o.debug&&!function(t,e){if(t.length!==e)return!1;for(let e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}(t,e))throw new Error("math.gl: ".concat(i," some fields set to invalid numbers'"));return t}class m extends g{get x(){return this[0]}set x(t){this[0]=d(t)}get y(){return this[1]}set y(t){this[1]=d(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let i=0;i<this.ELEMENTS;++i){const r=this[i]-t[i];e+=r*r}return d(e)}dot(t){let e=0;for(let i=0;i<this.ELEMENTS;++i)e+=this[i]*t[i];return d(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e[t];return this.check()}divide(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return s(t>=0&&t<this.ELEMENTS,"index is out of range"),d(this[t])}setComponent(t,e){return s(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}var _=1e-6,b="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function v(t,e,i){var r=e[0],n=e[1],s=e[2],o=i[3]*r+i[7]*n+i[11]*s+i[15];return o=o||1,t[0]=(i[0]*r+i[4]*n+i[8]*s+i[12])/o,t[1]=(i[1]*r+i[5]*n+i[9]*s+i[13])/o,t[2]=(i[2]*r+i[6]*n+i[10]*s+i[14])/o,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var E,w;E=new b(3),b!=Float32Array&&(E[0]=0,E[1]=0,E[2]=0),w=E;function P(t,e,i){const r=e[0],n=e[1],s=e[2],o=i[3]*r+i[7]*n+i[11]*s||1;return t[0]=(i[0]*r+i[4]*n+i[8]*s)/o,t[1]=(i[1]*r+i[5]*n+i[9]*s)/o,t[2]=(i[2]*r+i[6]*n+i[10]*s)/o,t}const M=[0,0,0];let S;class y extends m{static get ZERO(){return S||(S=new y(0,0,0),Object.freeze(S)),S}constructor(t=0,e=0,i=0){super(-0,-0,-0),1===arguments.length&&h(t)?this.copy(t):(o.debug&&(d(t),d(e),d(i)),this[0]=t,this[1]=e,this[2]=i)}set(t,e,i){return this[0]=t,this[1]=e,this[2]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return o.debug&&(d(t.x),d(t.y),d(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=d(t)}angle(t){return i=t,r=(e=this)[0],n=e[1],s=e[2],o=i[0],a=i[1],h=i[2],c=Math.sqrt(r*r+n*n+s*s)*Math.sqrt(o*o+a*a+h*h),u=c&&function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}(e,i)/c,Math.acos(Math.min(Math.max(u,-1),1));var e,i,r,n,s,o,a,h,c,u}cross(t){return function(t,e,i){var r=e[0],n=e[1],s=e[2],o=i[0],a=i[1],h=i[2];t[0]=n*h-s*a,t[1]=s*o-r*h,t[2]=r*a-n*o}(this,this,t),this.check()}rotateX({radians:t,origin:e=M}){return function(t,e,i,r){var n=[],s=[];n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],s[0]=n[0],s[1]=n[1]*Math.cos(r)-n[2]*Math.sin(r),s[2]=n[1]*Math.sin(r)+n[2]*Math.cos(r),t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2]}(this,this,e,t),this.check()}rotateY({radians:t,origin:e=M}){return function(t,e,i,r){var n=[],s=[];n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],s[0]=n[2]*Math.sin(r)+n[0]*Math.cos(r),s[1]=n[1],s[2]=n[2]*Math.cos(r)-n[0]*Math.sin(r),t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2]}(this,this,e,t),this.check()}rotateZ({radians:t,origin:e=M}){return function(t,e,i,r){var n=[],s=[];n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],s[0]=n[0]*Math.cos(r)-n[1]*Math.sin(r),s[1]=n[0]*Math.sin(r)+n[1]*Math.cos(r),s[2]=n[2],t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2]}(this,this,e,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return v(this,this,t),this.check()}transformAsVector(t){return P(this,this,t),this.check()}transformByMatrix3(t){return function(t,e,i){var r=e[0],n=e[1],s=e[2];t[0]=r*i[0]+n*i[3]+s*i[6],t[1]=r*i[1]+n*i[4]+s*i[7],t[2]=r*i[2]+n*i[5]+s*i[8]}(this,this,t),this.check()}transformByMatrix2(t){return function(t,e,i){const r=e[0],n=e[1];t[0]=i[0]*r+i[2]*n,t[1]=i[1]*r+i[3]*n,t[2]=e[2]}(this,this,t),this.check()}transformByQuaternion(t){return function(t,e,i){var r=i[0],n=i[1],s=i[2],o=i[3],a=e[0],h=e[1],c=e[2],u=n*c-s*h,l=s*a-r*c,p=r*h-n*a,g=n*p-s*l,d=s*u-r*p,f=r*l-n*u,m=2*o;u*=m,l*=m,p*=m,g*=2,d*=2,f*=2,t[0]=a+u+g,t[1]=h+l+d,t[2]=c+p+f}(this,this,t),this.check()}}const T=new y;function x(t,e,i,r){T.set(t,e,i);const n=T.len();return{distance:r/n,normal:new y(-t/n,-e/n,-i/n)}}class O extends g{toString(){let t="[";if(o.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let i=0;i<this.RANK;++i)t+=" ".concat(this[i*this.RANK+e])}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=" ".concat(this[e])}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,i){return this[e*this.RANK+t]=d(i),this}getColumn(t,e=new Array(this.RANK).fill(-0)){const i=t*this.RANK;for(let t=0;t<this.RANK;++t)e[t]=this[i+t];return e}setColumn(t,e){const i=t*this.RANK;for(let t=0;t<this.RANK;++t)this[i+t]=e[t];return this}}function R(t,e){var i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],h=e[6],c=e[7],u=e[8],l=e[9],p=e[10],g=e[11],d=e[12],f=e[13],m=e[14],_=e[15],b=i*a-r*o,v=i*h-n*o,E=i*c-s*o,w=r*h-n*a,P=r*c-s*a,M=n*c-s*h,S=u*f-l*d,y=u*m-p*d,T=u*_-g*d,x=l*m-p*f,O=l*_-g*f,R=p*_-g*m,L=b*R-v*O+E*x+w*T-P*y+M*S;return L?(L=1/L,t[0]=(a*R-h*O+c*x)*L,t[1]=(n*O-r*R-s*x)*L,t[2]=(f*M-m*P+_*w)*L,t[3]=(p*P-l*M-g*w)*L,t[4]=(h*T-o*R-c*y)*L,t[5]=(i*R-n*T+s*y)*L,t[6]=(m*E-d*M-_*v)*L,t[7]=(u*M-p*E+g*v)*L,t[8]=(o*O-a*T+c*S)*L,t[9]=(r*T-i*O-s*S)*L,t[10]=(d*P-f*E+_*b)*L,t[11]=(l*E-u*P-g*b)*L,t[12]=(a*y-o*x-h*S)*L,t[13]=(i*x-r*y+n*S)*L,t[14]=(f*v-d*w-m*b)*L,t[15]=(u*w-l*v+p*b)*L,t):null}function L(t,e,i){var r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],h=e[5],c=e[6],u=e[7],l=e[8],p=e[9],g=e[10],d=e[11],f=e[12],m=e[13],_=e[14],b=e[15],v=i[0],E=i[1],w=i[2],P=i[3];return t[0]=v*r+E*a+w*l+P*f,t[1]=v*n+E*h+w*p+P*m,t[2]=v*s+E*c+w*g+P*_,t[3]=v*o+E*u+w*d+P*b,v=i[4],E=i[5],w=i[6],P=i[7],t[4]=v*r+E*a+w*l+P*f,t[5]=v*n+E*h+w*p+P*m,t[6]=v*s+E*c+w*g+P*_,t[7]=v*o+E*u+w*d+P*b,v=i[8],E=i[9],w=i[10],P=i[11],t[8]=v*r+E*a+w*l+P*f,t[9]=v*n+E*h+w*p+P*m,t[10]=v*s+E*c+w*g+P*_,t[11]=v*o+E*u+w*d+P*b,v=i[12],E=i[13],w=i[14],P=i[15],t[12]=v*r+E*a+w*l+P*f,t[13]=v*n+E*h+w*p+P*m,t[14]=v*s+E*c+w*g+P*_,t[15]=v*o+E*u+w*d+P*b,t}function A(t,e,i){var r,n,s,o,a,h,c,u,l,p,g,d,f=i[0],m=i[1],_=i[2];return e===t?(t[12]=e[0]*f+e[4]*m+e[8]*_+e[12],t[13]=e[1]*f+e[5]*m+e[9]*_+e[13],t[14]=e[2]*f+e[6]*m+e[10]*_+e[14],t[15]=e[3]*f+e[7]*m+e[11]*_+e[15]):(r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],h=e[5],c=e[6],u=e[7],l=e[8],p=e[9],g=e[10],d=e[11],t[0]=r,t[1]=n,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=c,t[7]=u,t[8]=l,t[9]=p,t[10]=g,t[11]=d,t[12]=r*f+a*m+l*_+e[12],t[13]=n*f+h*m+p*_+e[13],t[14]=s*f+c*m+g*_+e[14],t[15]=o*f+u*m+d*_+e[15]),t}function j(t,e,i){var r=i[0],n=i[1],s=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function F(t,e,i){var r=Math.sin(i),n=Math.cos(i),s=e[4],o=e[5],a=e[6],h=e[7],c=e[8],u=e[9],l=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*n+c*r,t[5]=o*n+u*r,t[6]=a*n+l*r,t[7]=h*n+p*r,t[8]=c*n-s*r,t[9]=u*n-o*r,t[10]=l*n-a*r,t[11]=p*n-h*r,t}function C(t,e,i){var r=Math.sin(i),n=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],c=e[4],u=e[5],l=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*n+c*r,t[1]=o*n+u*r,t[2]=a*n+l*r,t[3]=h*n+p*r,t[4]=c*n-s*r,t[5]=u*n-o*r,t[6]=l*n-a*r,t[7]=p*n-h*r,t}var N=function(t,e,i,r,n){var s,o=1/Math.tan(e/2);return t[0]=o/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0?(s=1/(r-n),t[10]=(n+r)*s,t[14]=2*n*r*s):(t[10]=-1,t[14]=-2*r),t};var I=function(t,e,i,r,n,s,o){var a=1/(e-i),h=1/(r-n),c=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*a,t[13]=(n+r)*h,t[14]=(o+s)*c,t[15]=1,t};function D(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function B(t,e){return t[0]=-e[0],t[1]=-e[1],t}function k(t,e,i,r){var n=e[0],s=e[1];return t[0]=n+r*(i[0]-n),t[1]=s+r*(i[1]-s),t}!function(){var t=function(){var t=new b(2);return b!=Float32Array&&(t[0]=0,t[1]=0),t}()}();function V(t,e,i){var r=e[0],n=e[1],s=e[2],o=e[3];return t[0]=i[0]*r+i[4]*n+i[8]*s+i[12]*o,t[1]=i[1]*r+i[5]*n+i[9]*s+i[13]*o,t[2]=i[2]*r+i[6]*n+i[10]*s+i[14]*o,t[3]=i[3]*r+i[7]*n+i[11]*s+i[15]*o,t}var U;!function(){var t=function(){var t=new b(4);return b!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"}(U||(U={}));const z=45*Math.PI/180,W=1,G=.1,Z=500,q=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class X extends O{static get IDENTITY(){return function(){H||(H=new X,Object.freeze(H));return H}()}static get ZERO(){return function(){Y||(Y=new X([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Y));return Y}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return U}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,i,r,n,s,o,a,h,c,u,l,p,g,d,f){return this[0]=t,this[1]=e,this[2]=i,this[3]=r,this[4]=n,this[5]=s,this[6]=o,this[7]=a,this[8]=h,this[9]=c,this[10]=u,this[11]=l,this[12]=p,this[13]=g,this[14]=d,this[15]=f,this.check()}setRowMajor(t,e,i,r,n,s,o,a,h,c,u,l,p,g,d,f){return this[0]=t,this[1]=n,this[2]=h,this[3]=p,this[4]=e,this[5]=s,this[6]=c,this[7]=g,this[8]=i,this[9]=o,this[10]=u,this[11]=d,this[12]=r,this[13]=a,this[14]=l,this[15]=f,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(q)}fromObject(t){return this.check()}fromQuaternion(t){return function(t,e){var i=e[0],r=e[1],n=e[2],s=e[3],o=i+i,a=r+r,h=n+n,c=i*o,u=r*o,l=r*a,p=n*o,g=n*a,d=n*h,f=s*o,m=s*a,_=s*h;t[0]=1-l-d,t[1]=u+_,t[2]=p-m,t[3]=0,t[4]=u-_,t[5]=1-c-d,t[6]=g+f,t[7]=0,t[8]=p+m,t[9]=g-f,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(this,t),this.check()}frustum(t){const{left:e,right:i,bottom:r,top:n,near:s=G,far:o=Z}=t;return o===1/0?function(t,e,i,r,n,s){const o=2*s/(i-e),a=2*s/(n-r),h=(i+e)/(i-e),c=(n+r)/(n-r),u=-2*s;t[0]=o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=h,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0}(this,e,i,r,n,s):function(t,e,i,r,n,s,o){var a=1/(i-e),h=1/(n-r),c=1/(s-o);t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(i+e)*a,t[9]=(n+r)*h,t[10]=(o+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*c,t[15]=0}(this,e,i,r,n,s,o),this.check()}lookAt(t){const{eye:e,center:i=[0,0,0],up:r=[0,1,0]}=t;return function(t,e,i,r){var n,s,o,a,h,c,u,l,p,g,d=e[0],f=e[1],m=e[2],b=r[0],v=r[1],E=r[2],w=i[0],P=i[1],M=i[2];Math.abs(d-w)<_&&Math.abs(f-P)<_&&Math.abs(m-M)<_?function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t):(u=d-w,l=f-P,p=m-M,n=v*(p*=g=1/Math.hypot(u,l,p))-E*(l*=g),s=E*(u*=g)-b*p,o=b*l-v*u,(g=Math.hypot(n,s,o))?(n*=g=1/g,s*=g,o*=g):(n=0,s=0,o=0),a=l*o-p*s,h=p*n-u*o,c=u*s-l*n,(g=Math.hypot(a,h,c))?(a*=g=1/g,h*=g,c*=g):(a=0,h=0,c=0),t[0]=n,t[1]=a,t[2]=u,t[3]=0,t[4]=s,t[5]=h,t[6]=l,t[7]=0,t[8]=o,t[9]=c,t[10]=p,t[11]=0,t[12]=-(n*d+s*f+o*m),t[13]=-(a*d+h*f+c*m),t[14]=-(u*d+l*f+p*m),t[15]=1)}(this,e,i,r),this.check()}ortho(t){const{left:e,right:i,bottom:r,top:n,near:s=G,far:o=Z}=t;return I(this,e,i,r,n,s,o),this.check()}orthographic(t){const{fovy:e=z,aspect:i=W,focalDistance:r=1,near:n=G,far:s=Z}=t;K(e);const o=e/2,a=r*Math.tan(o),h=a*i;return this.ortho({left:-h,right:h,bottom:-a,top:a,near:n,far:s})}perspective(t){const{fovy:e=45*Math.PI/180,aspect:i=1,near:r=.1,far:n=500}=t;return K(e),N(this,e,i,r,n),this.check()}determinant(){return e=(t=this)[0],i=t[1],r=t[2],n=t[3],s=t[4],o=t[5],a=t[6],h=t[7],c=t[8],u=t[9],l=t[10],p=t[11],g=t[12],d=t[13],f=t[14],m=t[15],(e*o-i*s)*(l*m-p*f)-(e*a-r*s)*(u*m-p*d)+(e*h-n*s)*(u*f-l*d)+(i*a-r*o)*(c*m-p*g)-(i*h-n*o)*(c*f-l*g)+(r*h-n*a)*(c*d-u*g);var t,e,i,r,n,s,o,a,h,c,u,l,p,g,d,f,m}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const i=this.getScale(e),r=1/i[0],n=1/i[1],s=1/i[2];return t[0]=this[0]*r,t[1]=this[1]*n,t[2]=this[2]*s,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*n,t[6]=this[6]*s,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*n,t[10]=this[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const i=this.getScale(e),r=1/i[0],n=1/i[1],s=1/i[2];return t[0]=this[0]*r,t[1]=this[1]*n,t[2]=this[2]*s,t[3]=this[4]*r,t[4]=this[5]*n,t[5]=this[6]*s,t[6]=this[8]*r,t[7]=this[9]*n,t[8]=this[10]*s,t}transpose(){return function(t,e){if(t===e){var i=e[1],r=e[2],n=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=s,t[11]=e[14],t[12]=n,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]}(this,this),this.check()}invert(){return R(this,this),this.check()}multiplyLeft(t){return L(this,t,this),this.check()}multiplyRight(t){return L(this,this,t),this.check()}rotateX(t){return F(this,this,t),this.check()}rotateY(t){return function(t,e,i){var r=Math.sin(i),n=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],c=e[8],u=e[9],l=e[10],p=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*n-c*r,t[1]=o*n-u*r,t[2]=a*n-l*r,t[3]=h*n-p*r,t[8]=s*r+c*n,t[9]=o*r+u*n,t[10]=a*r+l*n,t[11]=h*r+p*n}(this,this,t),this.check()}rotateZ(t){return C(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return function(t,e,i,r){var n,s,o,a,h,c,u,l,p,g,d,f,m,b,v,E,w,P,M,S,y,T,x,O,R=r[0],L=r[1],A=r[2],j=Math.hypot(R,L,A);j<_||(R*=j=1/j,L*=j,A*=j,n=Math.sin(i),o=1-(s=Math.cos(i)),a=e[0],h=e[1],c=e[2],u=e[3],l=e[4],p=e[5],g=e[6],d=e[7],f=e[8],m=e[9],b=e[10],v=e[11],E=R*R*o+s,w=L*R*o+A*n,P=A*R*o-L*n,M=R*L*o-A*n,S=L*L*o+s,y=A*L*o+R*n,T=R*A*o+L*n,x=L*A*o-R*n,O=A*A*o+s,t[0]=a*E+l*w+f*P,t[1]=h*E+p*w+m*P,t[2]=c*E+g*w+b*P,t[3]=u*E+d*w+v*P,t[4]=a*M+l*S+f*y,t[5]=h*M+p*S+m*y,t[6]=c*M+g*S+b*y,t[7]=u*M+d*S+v*y,t[8]=a*T+l*x+f*O,t[9]=h*T+p*x+m*O,t[10]=c*T+g*x+b*O,t[11]=u*T+d*x+v*O,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]))}(this,this,t,e),this.check()}scale(t){return j(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return A(this,this,t),this.check()}transform(t,e){return 4===t.length?(f(e=V(e||[-0,-0,-0,-0],t,this),4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:i}=t;let r;switch(i){case 2:r=function(t,e,i){var r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t}(e||[-0,-0],t,this);break;case 3:r=v(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return f(r,t.length),r}transformAsVector(t,e){let i;switch(t.length){case 2:i=function(t,e,i){const r=e[0],n=e[1],s=i[3]*r+i[7]*n||1;return t[0]=(i[0]*r+i[4]*n)/s,t[1]=(i[1]*r+i[5]*n)/s,t}(e||[-0,-0],t,this);break;case 3:i=P(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return f(i,t.length),i}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,i){return this.identity().translate([t,e,i])}}let Y,H;function K(t){if(t>2*Math.PI)throw Error("expected radians")}function Q(t,e){const i=V([],e,t);return function(t,e,i){t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i}(i,i,1/i[3]),i}function J(t,e){const i=t%e;return i<0?e+i:i}function $(t,e,i){return t<e?e:t>i?i:t}const tt=Math.log2||function(t){return Math.log(t)*Math.LOG2E};function et(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const it=Math.PI,rt=it/4,nt=it/180,st=180/it,ot=1.5;function at(t){return tt(t)}function ht(t){const[e,i]=t;et(Number.isFinite(e)),et(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude");const r=i*nt;return[512*(e*nt+it)/(2*it),512*(it+Math.log(Math.tan(rt+.5*r)))/(2*it)]}function ct(t){const[e,i]=t,r=e/512*(2*it)-it,n=2*(Math.atan(Math.exp(i/512*(2*it)-it))-rt);return[r*st,n*st]}function ut(t){const{latitude:e,longitude:i,highPrecision:r=!1}=t;et(Number.isFinite(e)&&Number.isFinite(i));const n=Math.cos(e*nt),s=512/360/n,o=512/4003e4/n,a={unitsPerMeter:[o,o,o],metersPerUnit:[1/o,1/o,1/o],unitsPerDegree:[512/360,s,o],degreesPerUnit:[.703125,1/s,1/o]};if(r){const t=nt*Math.tan(e*nt)/n,i=512/360*t/2,r=512/4003e4*t,h=r/s*o;a.unitsPerDegree2=[0,i,r],a.unitsPerMeter2=[h,0,h]}return a}function lt(t){const{height:e,pitch:i,bearing:r,altitude:n,scale:s,center:o}=t,a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];A(a,a,[0,0,-n]),F(a,a,-i*nt),C(a,a,r*nt);const h=s/e;return j(a,a,[h,h,h]),o&&A(a,a,function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}([],o)),a}function pt(t){const{width:e,height:i,altitude:r,pitch:n=0,offset:s,center:o,scale:a,nearZMultiplier:h=1,farZMultiplier:c=1}=t;let{fovy:u=gt(ot)}=t;void 0!==r&&(u=gt(r));const l=u*nt,p=n*nt,g=dt(u);let d=g;o&&(d+=o[2]*a/Math.cos(p)/i);const f=l*(.5+(s?s[1]:0)/i),m=Math.sin(f)*d/Math.sin($(Math.PI/2-p-f,.01,Math.PI-.01)),_=Math.sin(p)*m+d,b=10*d;return{fov:l,aspect:e/i,focalDistance:g,near:h,far:Math.min(_*c,b)}}function gt(t){return 2*Math.atan(.5/t)*st}function dt(t){return.5/Math.tan(.5*t*nt)}function ft(t,e){const[i,r,n=0]=t;return et(Number.isFinite(i)&&Number.isFinite(r)&&Number.isFinite(n)),Q(e,[i,r,n,1])}function mt(t,e,i=0){const[r,n,s]=t;if(et(Number.isFinite(r)&&Number.isFinite(n),"invalid pixel coordinate"),Number.isFinite(s)){return Q(e,[r,n,s,1])}const o=Q(e,[r,n,0,1]),a=Q(e,[r,n,1,1]),h=o[2],c=a[2];return k([],o,a,h===c?0:((i||0)-h)/(c-h))}function _t(t){const{width:e,height:i,bounds:r,minExtent:n=0,maxZoom:s=24,offset:o=[0,0]}=t,[[a,h],[c,u]]=r,l=function(t=0){if("number"==typeof t)return{top:t,bottom:t,left:t,right:t};return et(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t}(t.padding),p=ht([a,$(u,-85.051129,85.051129)]),g=ht([c,$(h,-85.051129,85.051129)]),d=[Math.max(Math.abs(g[0]-p[0]),n),Math.max(Math.abs(g[1]-p[1]),n)],f=[e-l.left-l.right-2*Math.abs(o[0]),i-l.top-l.bottom-2*Math.abs(o[1])];et(f[0]>0&&f[1]>0);const m=f[0]/d[0],_=f[1]/d[1],b=(l.right-l.left)/2/m,v=(l.top-l.bottom)/2/_,E=ct([(g[0]+p[0])/2+b,(g[1]+p[1])/2+v]),w=Math.min(s,tt(Math.abs(Math.min(m,_))));return et(Number.isFinite(w)),{longitude:E[0],latitude:E[1],zoom:w}}const bt=Math.PI/180;function vt(t,e=0){const{width:i,height:r,unproject:n}=t,s={targetZ:e},o=n([0,r],s),a=n([i,r],s);let h,c;return(t.fovy?.5*t.fovy*bt:Math.atan(.5/t.altitude))>(90-t.pitch)*bt-.01?(h=Et(t,0,e),c=Et(t,i,e)):(h=n([0,0],s),c=n([i,0],s)),[o,a,c,h]}function Et(t,e,i){const{pixelUnprojectionMatrix:r}=t,n=Q(r,[e,0,1,1]),s=Q(r,[e,t.height,1,1]),o=ct(k([],n,s,(i*t.distanceScales.unitsPerMeter[2]-n[2])/(s[2]-n[2])));return o.push(i),o}Object.defineProperty({DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0},"IDENTITY",{get:()=>(n.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const wt=1,Pt=4,Mt=0,St=Math.PI/180,yt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Tt=[0,0,0],xt={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};class Ot{constructor(t={}){Object(r.a)(this,"id",void 0),Object(r.a)(this,"x",void 0),Object(r.a)(this,"y",void 0),Object(r.a)(this,"width",void 0),Object(r.a)(this,"height",void 0),Object(r.a)(this,"isGeospatial",void 0),Object(r.a)(this,"zoom",void 0),Object(r.a)(this,"focalDistance",void 0),Object(r.a)(this,"position",void 0),Object(r.a)(this,"modelMatrix",void 0),Object(r.a)(this,"distanceScales",void 0),Object(r.a)(this,"scale",void 0),Object(r.a)(this,"center",void 0),Object(r.a)(this,"cameraPosition",void 0),Object(r.a)(this,"projectionMatrix",void 0),Object(r.a)(this,"viewMatrix",void 0),Object(r.a)(this,"viewMatrixUncentered",void 0),Object(r.a)(this,"viewMatrixInverse",void 0),Object(r.a)(this,"viewProjectionMatrix",void 0),Object(r.a)(this,"pixelProjectionMatrix",void 0),Object(r.a)(this,"pixelUnprojectionMatrix",void 0),Object(r.a)(this,"resolution",void 0),Object(r.a)(this,"_frustumPlanes",{}),this.id=t.id||this.constructor.displayName||"viewport",this.x=t.x||0,this.y=t.y||0,this.width=t.width||1,this.height=t.height||1,this.zoom=t.zoom||0,this.distanceScales=t.distanceScales||xt,this.focalDistance=t.focalDistance||1,this.position=t.position||Tt,this.modelMatrix=t.modelMatrix||null;const{longitude:e,latitude:i}=t;this.isGeospatial=Number.isFinite(i)&&Number.isFinite(e),this._initProps(t),this._initMatrices(t),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?wt:Pt:Mt}equals(t){return t instanceof Ot&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&l(t.projectionMatrix,this.projectionMatrix)&&l(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const i=ft(this.projectPosition(t),this.pixelProjectionMatrix),[r,n]=i,s=e?n:this.height-n;return 2===t.length?[r,s]:[r,s,i[2]]}unproject(t,{topLeft:e=!0,targetZ:i}={}){const[r,n,s]=t,o=e?n:this.height-n,a=i&&i*this.distanceScales.unitsPerMeter[2],h=mt([r,o,s],this.pixelUnprojectionMatrix,a),[c,u,l]=this.unprojectPosition(h);return Number.isFinite(s)?[c,u,l]:Number.isFinite(i)?[c,u,i]:[c,u]}projectPosition(t){const[e,i]=this.projectFlat(t);return[e,i,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,i]=this.unprojectFlat(t);return[e,i,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){if(this.isGeospatial){const e=ht(t);return e[1]=c(e[1],-318,830),e}return t}unprojectFlat(t){return this.isGeospatial?ct(t):t}getBounds(t={}){const e={targetZ:t.z||0},i=this.unproject([0,0],e),r=this.unproject([this.width,0],e),n=this.unproject([0,this.height],e),s=this.unproject([this.width,this.height],e);return[Math.min(i[0],r[0],n[0],s[0]),Math.min(i[1],r[1],n[1],s[1]),Math.max(i[0],r[0],n[0],s[0]),Math.max(i[1],r[1],n[1],s[1])]}getDistanceScales(t){return t?ut({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:e,width:i=1,height:r=1}){return t<this.x+this.width&&this.x<t+i&&e<this.y+this.height&&this.y<e+r}getFrustumPlanes(){return this._frustumPlanes.near||Object.assign(this._frustumPlanes,{left:x((t=this.viewProjectionMatrix)[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:x(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:x(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:x(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:x(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:x(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}),this._frustumPlanes;var t}panByPosition(t,e){return null}_initProps(t){const e=t.longitude,i=t.latitude;this.isGeospatial&&(Number.isFinite(t.zoom)||(this.zoom=function(t){const{latitude:e}=t;return et(Number.isFinite(e)),at(4003e4*Math.cos(e*nt))-9}({latitude:i})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||ut({latitude:i,longitude:e}));const r=Math.pow(2,this.zoom);this.scale=r;const{position:n,modelMatrix:s}=t;let o=Tt;if(n&&(o=s?new X(s).transformAsVector(n,[]):n),this.isGeospatial){const t=this.projectPosition([e,i,0]);this.center=new y(o).scale(this.distanceScales.unitsPerMeter).add(t)}else this.center=this.projectPosition(o)}_initMatrices(t){const{viewMatrix:e=yt,projectionMatrix:i=null,orthographic:r=!1,fovyRadians:s,fovy:o=75,near:a=.1,far:h=1e3,padding:u=null,focalDistance:l=1}=t;this.viewMatrixUncentered=e,this.viewMatrix=(new X).multiplyRight(e).translate(new y(this.center).negate()),this.projectionMatrix=i||function({width:t,height:e,orthographic:i,fovyRadians:r,focalDistance:n,padding:s,near:o,far:a}){const h=t/e,u=i?(new X).orthographic({fovy:r,aspect:h,focalDistance:n,near:o,far:a}):(new X).perspective({fovy:r,aspect:h,near:o,far:a});if(s){const{left:i=0,right:r=0,top:n=0,bottom:o=0}=s,a=c((i+t-r)/2,0,t)-t/2,h=c((n+e-o)/2,0,e)-e/2;u[8]-=2*a/t,u[9]+=2*h/e}return u}({width:this.width,height:this.height,orthographic:r,fovyRadians:s||o*St,focalDistance:l,padding:u,near:a,far:h});const p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var g;L(p,p,this.projectionMatrix),L(p,p,this.viewMatrix),this.viewProjectionMatrix=p,this.viewMatrixInverse=R([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=[(g=this.viewMatrixInverse)[12],g[13],g[14]];const d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];j(d,d,[this.width/2,-this.height/2,1]),A(d,d,[1,-1,0]),L(f,d,this.viewProjectionMatrix),this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=R([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||n.warn("Pixel project matrix not invertible")()}}Object(r.a)(Ot,"displayName","Viewport");const Rt=/([0-9]+\.?[0-9]*)(%|px)/;function Lt(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=Rt.exec(t);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(t))}}function At(t,e){return t.relative?Math.round(t.position*e):t.position}function jt(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}const Ft=Math.PI/180;function Ct(t){return 512/4003e4/Math.cos(t*Ft)}class Nt extends Ot{constructor(t={}){const{latitude:e=0,longitude:i=0,zoom:n=0,pitch:s=0,bearing:o=0,nearZMultiplier:a=.1,farZMultiplier:h=1.01,orthographic:c=!1,projectionMatrix:u,repeat:l=!1,worldOffset:p=0,legacyMeterSizes:g=!1}=t;let{width:d,height:f,altitude:m=1.5}=t;const _=Math.pow(2,n);let b;d=d||1,f=f||1;let v=null;u?(m=u[5]/2,b=gt(m)):(t.fovy?(b=t.fovy,m=dt(b)):b=gt(m),v=pt({width:d,height:f,pitch:s,fovy:b,nearZMultiplier:a,farZMultiplier:h}));let E=lt({height:f,pitch:s,bearing:o,scale:_,altitude:m});if(p){E=(new X).translate([512*p,0,0]).multiplyLeft(E)}super({...t,width:d,height:f,viewMatrix:E,longitude:i,latitude:e,zoom:n,...v,fovy:b,focalDistance:m}),Object(r.a)(this,"longitude",void 0),Object(r.a)(this,"latitude",void 0),Object(r.a)(this,"pitch",void 0),Object(r.a)(this,"bearing",void 0),Object(r.a)(this,"altitude",void 0),Object(r.a)(this,"fovy",void 0),Object(r.a)(this,"orthographic",void 0),Object(r.a)(this,"_subViewports",void 0),Object(r.a)(this,"_pseudoMeters",void 0),this.latitude=e,this.longitude=i,this.zoom=n,this.pitch=s,this.bearing=o,this.altitude=m,this.fovy=b,this.orthographic=c,this._subViewports=l?[]:null,this._pseudoMeters=g,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),e=Math.floor((t[0]+180)/360),i=Math.ceil((t[2]-180)/360);for(let t=e;t<=i;t++){const e=t?new Nt({...this,worldOffset:t}):this;this._subViewports.push(e)}}return this._subViewports}projectPosition(t){if(this._pseudoMeters)return super.projectPosition(t);const[e,i]=this.projectFlat(t);return[e,i,(t[2]||0)*Ct(t[1])]}unprojectPosition(t){if(this._pseudoMeters)return super.unprojectPosition(t);const[e,i]=this.unprojectFlat(t);return[e,i,(t[2]||0)/Ct(i)]}addMetersToLngLat(t,e){return function(t,e){const[i,r,n]=t,[s,o,a]=e,{unitsPerMeter:h,unitsPerMeter2:c}=ut({longitude:i,latitude:r,highPrecision:!0}),u=ht(t);u[0]+=s*(h[0]+c[0]*o),u[1]+=o*(h[1]+c[1]*o);const l=ct(u),p=(n||0)+(a||0);return Number.isFinite(n)||Number.isFinite(a)?[l[0],l[1],p]:l}(t,e)}panByPosition(t,e){const i=mt(e,this.pixelUnprojectionMatrix),r=D([],this.projectFlat(t),B([],i)),n=D([],this.center,r),[s,o]=this.unprojectFlat(n);return{longitude:s,latitude:o}}getBounds(t={}){const e=vt(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(t,e={}){const{width:i,height:r}=this,{longitude:n,latitude:s,zoom:o}=_t({width:i,height:r,bounds:t,...e});return new Nt({width:i,height:r,longitude:n,latitude:s,zoom:o})}}Object(r.a)(Nt,"displayName","WebMercatorViewport");class It{constructor(t){Object(r.a)(this,"_inProgress",void 0),Object(r.a)(this,"_handle",void 0),Object(r.a)(this,"_timeline",void 0),Object(r.a)(this,"time",void 0),Object(r.a)(this,"settings",void 0),this._inProgress=!1,this._handle=null,this._timeline=t,this.time=0,this.settings={duration:0}}get inProgress(){return this._inProgress}start(t){var e,i;this.cancel(),this.settings=t,this._inProgress=!0,null===(e=(i=this.settings).onStart)||void 0===e||e.call(i,this)}end(){var t,e;this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,null===(t=(e=this.settings).onEnd)||void 0===t||t.call(e,this))}cancel(){var t,e;this._inProgress&&(null===(t=(e=this.settings).onInterrupt)||void 0===t||t.call(e,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){var t,e;if(!this._inProgress)return!1;if(null===this._handle){const{_timeline:t,settings:e}=this;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),null===(t=(e=this.settings).onUpdate)||void 0===t||t.call(e,this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const Dt=()=>{},Bt=2,kt=3,Vt=t=>t,Ut=1;class zt{constructor(t){Object(r.a)(this,"getControllerState",void 0),Object(r.a)(this,"props",void 0),Object(r.a)(this,"propsInTransition",void 0),Object(r.a)(this,"transition",void 0),Object(r.a)(this,"onViewStateChange",void 0),Object(r.a)(this,"onStateChange",void 0),Object(r.a)(this,"_onTransitionUpdate",t=>{const{time:e,settings:{interpolator:i,startProps:r,endProps:n,duration:s,easing:o}}=t,a=o(e/s),h=i.interpolateProps(r,n,a);this.propsInTransition=this.getControllerState({...this.props,...h}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}),this.getControllerState=t.getControllerState,this.propsInTransition=null,this.transition=new It(t.timeline),this.onViewStateChange=t.onViewStateChange||Dt,this.onStateChange=t.onStateChange||Dt}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(t){let e=!1;const i=this.props;if(this.props=t,!i||this._shouldIgnoreViewportChange(i,t))return!1;if(this._isTransitionEnabled(t)){let r=i;if(this.transition.inProgress){const{interruption:t,endProps:e}=this.transition.settings;r={...i,...t===Bt?e:this.propsInTransition||i}}this._triggerTransition(r,t),e=!0}else this.transition.cancel();return e}updateTransition(){this.transition.update()}_isTransitionEnabled(t){const{transitionDuration:e,transitionInterpolator:i}=t;return(e>0||"auto"===e)&&Boolean(i)}_isUpdateDueToCurrentTransition(t){return!(!this.transition.inProgress||!this.propsInTransition)&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}_shouldIgnoreViewportChange(t,e){return this.transition.inProgress?this.transition.settings.interruption===kt||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}_triggerTransition(t,e){const i=this.getControllerState(t),r=this.getControllerState(e).shortestPathFrom(i),n=e.transitionInterpolator,s=n.getDuration?n.getDuration(t,e):e.transitionDuration;if(0===s)return;const o=n.initializeProps(t,r);this.propsInTransition={};const a={duration:s,easing:e.transitionEasing||Vt,interpolator:n,interruption:e.transitionInterruption||Ut,startProps:o.start,endProps:o.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)};this.transition.start(a),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(t){return e=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),null==t||t(e)}}}const Wt=["longitude","latitude","zoom","bearing","pitch"],Gt=["longitude","latitude","zoom"];class Zt extends class{constructor(t){Object(r.a)(this,"_propsToCompare",void 0),Object(r.a)(this,"_propsToExtract",void 0),Object(r.a)(this,"_requiredProps",void 0);const{compare:e,extract:i,required:n}=t;this._propsToCompare=e,this._propsToExtract=i||e,this._requiredProps=n}arePropsEqual(t,e){for(const i of this._propsToCompare)if(!(i in t)||!(i in e)||!l(t[i],e[i]))return!1;return!0}initializeProps(t,e){const i={},r={};for(const n of this._propsToExtract)(n in t||n in e)&&(i[n]=t[n],r[n]=e[n]);return this._checkRequiredProps(i),this._checkRequiredProps(r),{start:i,end:r}}getDuration(t,e){return e.transitionDuration}_checkRequiredProps(t){this._requiredProps&&this._requiredProps.forEach(e=>{const i=t[e];jt(Number.isFinite(i)||Array.isArray(i),"".concat(e," is required for transition"))})}}{constructor(t={}){const e=Array.isArray(t)?t:t.transitionProps,i=Array.isArray(t)?{}:t;i.transitionProps=Array.isArray(e)?{compare:e,required:e}:e||{compare:Wt,required:Gt},super(i.transitionProps),Object(r.a)(this,"opts",void 0),this.opts=i}initializeProps(t,e){const i=super.initializeProps(t,e),{makeViewport:r,around:n}=this.opts;if(r&&n){const s=r(t),o=r(e),a=s.unproject(n);i.start.around=n,Object.assign(i.end,{around:o.project(a),aroundPosition:a,width:e.width,height:e.height})}return i}interpolateProps(t,e,i){const r={};for(const n of this._propsToExtract)r[n]=u(t[n]||0,e[n]||0,i);if(e.aroundPosition&&this.opts.makeViewport){const n=this.opts.makeViewport({...e,...r});Object.assign(r,n.panByPosition(e.aroundPosition,u(t.around,e.around,i)))}return r}}const qt={transitionDuration:0},Xt=t=>1-(1-t)*(1-t),Yt=["wheel"],Ht=["panstart","panmove","panend"],Kt=["pinchstart","pinchmove","pinchend"],Qt=["tripanstart","tripanmove","tripanend"],Jt=["doubletap"],$t=["keydown"],te={};class ee extends class{constructor(t,e){Object(r.a)(this,"_viewportProps",void 0),Object(r.a)(this,"_state",void 0),this._viewportProps=this.applyConstraints(t),this._state=e}getViewportProps(){return this._viewportProps}getState(){return this._state}}{constructor(t){const{width:e,height:i,latitude:n,longitude:s,zoom:o,bearing:a=0,pitch:h=0,altitude:c=1.5,position:u=[0,0,0],maxZoom:l=20,minZoom:p=0,maxPitch:g=60,minPitch:d=0,startPanLngLat:f,startZoomLngLat:m,startRotatePos:_,startBearing:b,startPitch:v,startZoom:E,normalize:w=!0}=t;jt(Number.isFinite(s)),jt(Number.isFinite(n)),jt(Number.isFinite(o)),super({width:e,height:i,latitude:n,longitude:s,zoom:o,bearing:a,pitch:h,altitude:c,maxZoom:l,minZoom:p,maxPitch:g,minPitch:d,normalize:w,position:u},{startPanLngLat:f,startZoomLngLat:m,startRotatePos:_,startBearing:b,startPitch:v,startZoom:E}),Object(r.a)(this,"makeViewport",void 0),this.makeViewport=t.makeViewport}panStart({pos:t}){return this._getUpdatedState({startPanLngLat:this._unproject(t)})}pan({pos:t,startPos:e}){const i=this.getState().startPanLngLat||this._unproject(e);if(!i)return this;const r=this.makeViewport(this.getViewportProps()).panByPosition(i,t);return this._getUpdatedState(r)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:n,startPitch:s}=this.getState();if(!r||void 0===n||void 0===s)return this;let o;return o=t?this._getNewRotation(t,r,s,n):{bearing:n+e,pitch:s+i},this._getUpdatedState(o)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:t}){return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this.getViewportProps().zoom})}zoom({pos:t,startPos:e,scale:i}){let{startZoom:r,startZoomLngLat:n}=this.getState();if(n||(r=this.getViewportProps().zoom,n=this._unproject(e)||this._unproject(t)),!n)return this;const{maxZoom:s,minZoom:o}=this.getViewportProps();let a=r+Math.log2(i);a=c(a,o,s);const h=this.makeViewport({...this.getViewportProps(),zoom:a});return this._getUpdatedState({zoom:a,...h.panByPosition(n,t)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(t=2){return this._zoomFromCenter(t)}zoomOut(t=2){return this._zoomFromCenter(1/t)}moveLeft(t=100){return this._panFromCenter([t,0])}moveRight(t=100){return this._panFromCenter([-t,0])}moveUp(t=100){return this._panFromCenter([0,t])}moveDown(t=100){return this._panFromCenter([0,-t])}rotateLeft(t=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-t})}rotateRight(t=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+t})}rotateUp(t=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+t})}rotateDown(t=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-t})}shortestPathFrom(t){const e=t.getViewportProps(),i={...this.getViewportProps()},{bearing:r,longitude:n}=i;return Math.abs(r-e.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(n-e.longitude)>180&&(i.longitude=n<0?n+360:n-360),i}applyConstraints(t){const{maxZoom:e,minZoom:i,zoom:r}=t;t.zoom=c(r,i,e);const{maxPitch:n,minPitch:s,pitch:o}=t;t.pitch=c(o,s,n);const{normalize:a=!0}=t;return a&&Object.assign(t,function(t){const{width:e,height:i,pitch:r=0}=t;let{longitude:n,latitude:s,zoom:o,bearing:a=0}=t;(n<-180||n>180)&&(n=J(n+180,360)-180),(a<-180||a>180)&&(a=J(a+180,360)-180);const h=tt(i/512);if(o<=h)o=h,s=0;else{const t=i/2/Math.pow(2,o),e=ct([0,t])[1];if(s<e)s=e;else{const e=ct([0,512-t])[1];s>e&&(s=e)}}return{width:e,height:i,longitude:n,latitude:s,zoom:o,pitch:r,bearing:a}}(t)),t}_zoomFromCenter(t){const{width:e,height:i}=this.getViewportProps();return this.zoom({pos:[e/2,i/2],scale:t})}_panFromCenter(t){const{width:e,height:i}=this.getViewportProps();return this.pan({startPos:[e/2,i/2],pos:[e/2+t[0],i/2+t[1]]})}_getUpdatedState(t){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}_unproject(t){const e=this.makeViewport(this.getViewportProps());return t&&e.unproject(t)}_getNewRotation(t,e,i,r){const n=t[0]-e[0],s=t[1]-e[1],o=t[1],a=e[1],{width:h,height:u}=this.getViewportProps(),l=n/h;let p=0;s>0?Math.abs(u-a)>5&&(p=s/(a-u)*1.2):s<0&&a>5&&(p=1-o/a),p=c(p,-1,1);const{minPitch:g,maxPitch:d}=this.getViewportProps();let f=i;return p>0?f=i+p*(d-i):p<0&&(f=i-p*(g-i)),{pitch:f,bearing:r+180*l}}}class ie extends class{constructor(t){Object(r.a)(this,"props",void 0),Object(r.a)(this,"state",{}),Object(r.a)(this,"transitionManager",void 0),Object(r.a)(this,"eventManager",void 0),Object(r.a)(this,"onViewStateChange",void 0),Object(r.a)(this,"onStateChange",void 0),Object(r.a)(this,"makeViewport",void 0),Object(r.a)(this,"_controllerState",void 0),Object(r.a)(this,"_events",{}),Object(r.a)(this,"_interactionState",{isDragging:!1}),Object(r.a)(this,"_customEvents",[]),Object(r.a)(this,"_eventStartBlocked",null),Object(r.a)(this,"_panMove",!1),Object(r.a)(this,"invertPan",!1),Object(r.a)(this,"dragMode","rotate"),Object(r.a)(this,"inertia",0),Object(r.a)(this,"scrollZoom",!0),Object(r.a)(this,"dragPan",!0),Object(r.a)(this,"dragRotate",!0),Object(r.a)(this,"doubleClickZoom",!0),Object(r.a)(this,"touchZoom",!0),Object(r.a)(this,"touchRotate",!1),Object(r.a)(this,"keyboard",!0),this.transitionManager=new zt({...t,getControllerState:t=>new this.ControllerState(t),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=t.eventManager,this.onViewStateChange=t.onViewStateChange||(()=>{}),this.onStateChange=t.onStateChange||(()=>{}),this.makeViewport=t.makeViewport}set events(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.props&&this.setProps(this.props)}finalize(){for(const e in this._events){var t;if(this._events[e])null===(t=this.eventManager)||void 0===t||t.off(e,this.handleEvent)}this.transitionManager.finalize()}handleEvent(t){this._controllerState=void 0;const e=this._eventStartBlocked;switch(t.type){case"panstart":return!e&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!e&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!e&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(t){const{x:e,y:i}=this.props,{offsetCenter:r}=t;return[r.x-e,r.y-i]}isPointInBounds(t,e){const{width:i,height:r}=this.props;if(e&&e.handled)return!1;const n=t[0]>=0&&t[0]<=i&&t[1]>=0&&t[1]<=r;return n&&e&&e.stopPropagation(),n}isFunctionKeyPressed(t){const{srcEvent:e}=t;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(t){const e=setTimeout(()=>{this._eventStartBlocked===e&&(this._eventStartBlocked=null)},t);this._eventStartBlocked=e}setProps(t){t.dragMode&&(this.dragMode=t.dragMode),this.props=t,"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);const{inertia:e}=t;this.inertia=Number.isFinite(e)?e:!0===e?300:0;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:n=!0,doubleClickZoom:s=!0,touchZoom:o=!0,touchRotate:a=!1,keyboard:h=!0}=t,c=Boolean(this.onViewStateChange);this.toggleEvents(Yt,c&&i),this.toggleEvents(Ht,c&&(r||n)),this.toggleEvents(Kt,c&&(o||a)),this.toggleEvents(Qt,c&&a),this.toggleEvents(Jt,c&&s),this.toggleEvents($t,c&&h),this.scrollZoom=i,this.dragPan=r,this.dragRotate=n,this.doubleClickZoom=s,this.touchZoom=o,this.touchRotate=a,this.keyboard=h}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(t,e){this.eventManager&&t.forEach(t=>{this._events[t]!==e&&(this._events[t]=e,e?this.eventManager.on(t,this.handleEvent):this.eventManager.off(t,this.handleEvent))})}updateViewport(t,e=null,i={}){const r={...t.getViewportProps(),...e},n=this.controllerState!==t;if(this.state=t.getState(),this._setInteractionState(i),n){const t=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:t})}}_onTransition(t){this.onViewStateChange({...t,interactionState:this._interactionState})}_setInteractionState(t){Object.assign(this._interactionState,t),this.onStateChange(this._interactionState)}_onPanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;let i=this.isFunctionKeyPressed(t)||t.rightButton||!1;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:e});return this._panMove=i,this.updateViewport(r,qt,{isDragging:!0}),!0}_onPan(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}_onPanEnd(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}_onPanMove(t){if(!this.dragPan)return!1;const e=this.getCenter(t),i=this.controllerState.pan({pos:e});return this.updateViewport(i,qt,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(t){const{inertia:e}=this;if(this.dragPan&&e&&t.velocity){const i=this.getCenter(t),r=[i[0]+t.velocityX*e/2,i[1]+t.velocityY*e/2],n=this.controllerState.pan({pos:r}).panEnd();this.updateViewport(n,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:Xt},{isDragging:!1,isPanning:!0})}else{const t=this.controllerState.panEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(t){if(!this.dragRotate)return!1;const e=this.getCenter(t),i=this.controllerState.rotate({pos:e});return this.updateViewport(i,qt,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(t){const{inertia:e}=this;if(this.dragRotate&&e&&t.velocity){const i=this.getCenter(t),r=[i[0]+t.velocityX*e/2,i[1]+t.velocityY*e/2],n=this.controllerState.rotate({pos:r}).rotateEnd();this.updateViewport(n,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:Xt},{isDragging:!1,isRotating:!0})}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(t){if(!this.scrollZoom)return!1;t.srcEvent.preventDefault();const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const{speed:i=.01,smooth:r=!1}=!0===this.scrollZoom?{}:this.scrollZoom,{delta:n}=t;let s=2/(1+Math.exp(-Math.abs(n*i)));n<0&&0!==s&&(s=1/s);const o=this.controllerState.zoom({pos:e,scale:s});return this.updateViewport(o,{...this._getTransitionProps({around:e}),transitionDuration:r?250:1},{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const i=this.controllerState.rotateStart({pos:e});return this.updateViewport(i,qt,{isDragging:!0}),!0}_onTriplePan(t){if(!this.touchRotate)return!1;if(!this.isDragging())return!1;const e=this.getCenter(t);e[0]-=t.deltaX;const i=this.controllerState.rotate({pos:e});return this.updateViewport(i,qt,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this;if(this.touchRotate&&e&&t.velocityY){const i=this.getCenter(t),r=[i[0],i[1]+=t.velocityY*e/2],n=this.controllerState.rotate({pos:r});this.updateViewport(n,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:Xt},{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const i=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return te._startPinchRotation=t.rotation,te._lastPinchEvent=t,this.updateViewport(i,qt,{isDragging:!0}),!0}_onPinch(t){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;let e=this.controllerState;if(this.touchZoom){const{scale:i}=t,r=this.getCenter(t);e=e.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=t;e=e.rotate({deltaAngleX:te._startPinchRotation-i})}return this.updateViewport(e,qt,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),te._lastPinchEvent=t,!0}_onPinchEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this,{_lastPinchEvent:i}=te;if(this.touchZoom&&e&&i&&t.scale!==i.scale){const r=this.getCenter(t);let n=this.controllerState.rotateEnd();const s=Math.log2(t.scale),o=(s-Math.log2(i.scale))/(t.deltaTime-i.deltaTime),a=Math.pow(2,s+o*e/2);n=n.zoom({pos:r,scale:a}).zoomEnd(),this.updateViewport(n,{...this._getTransitionProps({around:r}),transitionDuration:e,transitionEasing:Xt},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{const t=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return te._startPinchRotation=null,te._lastPinchEvent=null,!0}_onDoubleTap(t){if(!this.doubleClickZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const i=this.isFunctionKeyPressed(t),r=this.controllerState.zoom({pos:e,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(t){if(!this.keyboard)return!1;const e=this.isFunctionKeyPressed(t),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:n,rotateSpeedY:s}=!0===this.keyboard?{}:this.keyboard,{controllerState:o}=this;let a;const h={};switch(t.srcEvent.code){case"Minus":a=e?o.zoomOut(i).zoomOut(i):o.zoomOut(i),h.isZooming=!0;break;case"Equal":a=e?o.zoomIn(i).zoomIn(i):o.zoomIn(i),h.isZooming=!0;break;case"ArrowLeft":e?(a=o.rotateLeft(n),h.isRotating=!0):(a=o.moveLeft(r),h.isPanning=!0);break;case"ArrowRight":e?(a=o.rotateRight(n),h.isRotating=!0):(a=o.moveRight(r),h.isPanning=!0);break;case"ArrowUp":e?(a=o.rotateUp(s),h.isRotating=!0):(a=o.moveUp(r),h.isPanning=!0);break;case"ArrowDown":e?(a=o.rotateDown(s),h.isRotating=!0):(a=o.moveDown(r),h.isPanning=!0);break;default:return!1}return this.updateViewport(a,this._getTransitionProps(),h),!0}_getTransitionProps(t){const{transition:e}=this;return e&&e.transitionInterpolator?t?{...e,transitionInterpolator:new Zt({...t,...e.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:e:qt}}{constructor(...t){super(...t),Object(r.a)(this,"ControllerState",ee),Object(r.a)(this,"transition",{transitionDuration:300,transitionInterpolator:new Zt({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})}),Object(r.a)(this,"dragMode","pan")}setProps(t){t.position=t.position||[0,0,0];const e=this.props;super.setProps(t);(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...t,...this.state}))}}class re extends class{constructor(t){Object(r.a)(this,"id",void 0),Object(r.a)(this,"viewportInstance",void 0),Object(r.a)(this,"_x",void 0),Object(r.a)(this,"_y",void 0),Object(r.a)(this,"_width",void 0),Object(r.a)(this,"_height",void 0),Object(r.a)(this,"_padding",void 0),Object(r.a)(this,"props",void 0);const{id:e,x:i=0,y:n=0,width:s="100%",height:o="100%",padding:a=null,viewportInstance:h}=t||{};jt(!h||h instanceof Ot),this.viewportInstance=h,this.id=e||this.constructor.displayName||"view",this.props={...t,id:this.id},this._x=Lt(i),this._y=Lt(n),this._width=Lt(s),this._height=Lt(o),this._padding=a&&{left:Lt(a.left||0),right:Lt(a.right||0),top:Lt(a.top||0),bottom:Lt(a.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(t){return this===t||(this.viewportInstance?!!t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):this.ViewportType===t.ViewportType&&function t(e,i){if(e===i)return!0;if(!e||!i)return!1;for(const r in e){const n=e[r],s=i[r];if(!(n===s||Array.isArray(n)&&Array.isArray(s)&&t(n,s)))return!1}return!0}(this.props,t.props))}makeViewport({width:t,height:e,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:t,height:e});return new this.ViewportType({...i,...this.props,...r})}getViewStateId(){const{viewState:t}=this.props;return"string"==typeof t?t:(null==t?void 0:t.id)||this.id}filterViewState(t){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const e={...t};for(const t in this.props.viewState)"id"!==t&&(e[t]=this.props.viewState[t]);return e}return t}getDimensions({width:t,height:e}){const i={x:At(this._x,t),y:At(this._y,e),width:At(this._width,t),height:At(this._height,e)};return this._padding&&(i.padding={left:At(this._padding.left,t),top:At(this._padding.top,e),right:At(this._padding.right,t),bottom:At(this._padding.bottom,e)}),i}get controller(){const t=this.props.controller;return t?!0===t?{type:this.ControllerType}:"function"==typeof t?{type:t}:{type:this.ControllerType,...t}:null}}{get ViewportType(){return Nt}get ControllerType(){return ie}}Object(r.a)(re,"displayName","MapView");class ne extends Nt{constructor(t){const[e,i]=t.getSize();super(Object.assign({id:"2gis",x:0,y:0,width:e,height:i},se(t),{nearZMultiplier:1/(i||1)}))}get projectionMode(){return 4}}function se(t){const[e,i]=t.getCenter();return{longitude:(e+540)%360-180,latitude:i,zoom:oe(t),bearing:ae(t),pitch:t.getPitch(),padding:t.getPadding(),repeat:!1,fovy:he(t,60,!0)}}function oe(t){return t.getZoom()-1}function ae(t){return-t.getRotation()}function he(t,e,i){if(!i)return e;const r={fov:e,near:1e3},{fov:n}=r,s=function(t){const{size:e,pitch:i,padding:r}=t,n=Math.max(0,r.top-r.bottom)*Math.tan(i),s=function(t){return Math.max(t,1e3)}(e[1])+n;return(r.bottom-r.top)/2+(s-e[1])/2}(t._impl.state);return s>100?100/s*n:e}var ce=class{constructor(t,e={}){this._vao=null,this._attributes=e,this._shaderProgram=t,this._ext=null}bind(t){const e=t.extensions.OES_vertex_array_object;return e?this._bind(t.gl,e):this._shaderProgram.bind(t.gl,null,this._attributes),this}unbind(){return this._ext&&this._ext.bindVertexArrayOES(null),this}remove(){return this._vao&&this._ext.deleteVertexArrayOES(this._vao),this}_bind(t,e){this._vao?e.bindVertexArrayOES(this._vao):this._prepare(t,e)}_prepare(t,e){this._ext=e,this._vao=e.createVertexArrayOES(),e.bindVertexArrayOES(this._vao);const i=this._shaderProgram.attributes,r=this._attributes;for(const e in r){const n=i[e];!0!==n.index&&t.enableVertexAttribArray(n.location),r[e].bind(t,n.location)}}};class ue{constructor(t,e){this._initData=t,this.byteLength=void 0!==t.byteLength?t.byteLength:t,this.type=ue.ArrayBuffer,this.drawType=ue.StaticDraw,this.options=Object.assign({},ue.defaultOptions,e),this._glBuffer=null,this._glContext=null}bind(t,e,i){return this._glBuffer||this.prepare(t),this.type===ue.ArrayBuffer?(t.bindBuffer(t.ARRAY_BUFFER,this._glBuffer),i=i||this.options,t.vertexAttribPointer(e,i.itemSize,this._toGlParam(t,i.dataType),i.normalized,i.stride,i.offset)):this.type===ue.ElementArrayBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this._glBuffer),this}remove(){return this._unprepare(),this}subData(t,e,i){return t.bindBuffer(this._toGlParam(t,this.type),this._glBuffer),t.bufferSubData(this._toGlParam(t,this.type),e,i),this}prepare(t){return this._glContext=t,this._glBuffer=t.createBuffer(),t.bindBuffer(this._toGlParam(t,this.type),this._glBuffer),t.bufferData(this._toGlParam(t,this.type),this._initData,this._toGlParam(t,this.drawType)),this._initData=null,this}_unprepare(){this._glBuffer&&(this._glContext.deleteBuffer(this._glBuffer),this._glBuffer=null,this._glContext=null)}_toGlParam(t,e){return e===ue.ArrayBuffer?t.ARRAY_BUFFER:e===ue.ElementArrayBuffer?t.ELEMENT_ARRAY_BUFFER:e===ue.StaticDraw?t.STATIC_DRAW:e===ue.DynamicDraw?t.DYNAMIC_DRAW:e===ue.Byte?t.BYTE:e===ue.Short?t.SHORT:e===ue.Int?t.INT:e===ue.Float?t.FLOAT:e===ue.UnsignedByte?t.UNSIGNED_BYTE:e===ue.UnsignedShort?t.UNSIGNED_SHORT:e===ue.UnsignedInt?t.UNSIGNED_INT:null}}ue.ArrayBuffer=1,ue.ElementArrayBuffer=2,ue.StaticDraw=10,ue.DynamicDraw=11,ue.Float=20,ue.UnsignedByte=21,ue.UnsignedShort=22,ue.UnsignedInt=23,ue.Byte=24,ue.Short=25,ue.Int=26,ue.defaultOptions={itemSize:3,dataType:ue.Float,stride:0,offset:0,normalized:!1};var le=ue;var pe=class{constructor(t){this.name=t.name,this.index=t.index,this.location=void 0!==t.location?t.location:-1,this._enable=!1}bindLocation(t,e){return-1!==this.location&&!0!==this.index&&t.bindAttribLocation(e,this.location,this.name),this}getLocation(t,e){return-1===this.location&&!0!==this.index&&(this.location=t.getAttribLocation(e,this.name)),this}bind(t,e){return this._enable||!0===this.index||(t.enableVertexAttribArray(this.location),this._enable=!0),e.bind(t,this.location),this}disable(t){return this._enable&&!0!==this.index&&(t.disableVertexAttribArray(this.location),this._enable=!1),this}};var ge=class{constructor(t){this.name=t.name,this.type=t.type,this.location=-1}getLocation(t,e){return this.location=t.getUniformLocation(e,this.name),this}bind(t,e){const i=this.type;return"mat2"===i?t.uniformMatrix2fv(this.location,!1,e):"mat3"===i?t.uniformMatrix3fv(this.location,!1,e):"mat4"===i?t.uniformMatrix4fv(this.location,!1,e):"2f"===i?t.uniform2f(this.location,e[0],e[1]):"3f"===i?t.uniform3f(this.location,e[0],e[1],e[2]):"4f"===i?t.uniform4f(this.location,e[0],e[1],e[2],e[3]):"2i"===i?t.uniform2i(this.location,e[0],e[1]):"3i"===i?t.uniform3i(this.location,e[0],e[1],e[2]):"4i"===i?t.uniform4i(this.location,e[0],e[1],e[2],e[3]):t["uniform"+i](this.location,e),this}};var de=class{constructor(t){t=t||{},this._vertexShader=t.vertex,this._fragmentShader=t.fragment,this.uniforms={},t.uniforms=t.uniforms||[],t.uniforms.forEach(t=>{this.uniforms[t.name]=new ge(t)}),this.attributes={},t.attributes=t.attributes||[],t.attributes.forEach(t=>{this.attributes[t.name]=new pe(t)}),this._linked=!1,this._located=!1,this._error=!1}enable(t){return this._error?this:(this.link(t),this.locate(t),this._error||t.useProgram(this._webglProgram),this)}bind(t,e,i){if(this._error)return this;if(e)for(const i in e)this.uniforms[i].bind(t,e[i]);if(i)for(const e in i)this.attributes[e].bind(t,i[e]);return this}disable(t){if(this._error)return this;for(const e in this.attributes)this.attributes[e].disable(t);return this}link(t){if(this._linked||this._error)return this;try{this._webglProgram=t.createProgram(),this._vertexShader&&t.attachShader(this._webglProgram,this._vertexShader.get(t)),this._fragmentShader&&t.attachShader(this._webglProgram,this._fragmentShader.get(t));for(const e in this.attributes)this.attributes[e].bindLocation(t,this._webglProgram);if(t.linkProgram(this._webglProgram),!t.getProgramParameter(this._webglProgram,t.LINK_STATUS))throw new Error(t.getProgramInfoLog(this._webglProgram));this._linked=!0}catch(t){throw this._error=!0,t}return this}locate(t){if(this._located||this._error)return this;for(const e in this.attributes)this.attributes[e].getLocation(t,this._webglProgram);for(const e in this.uniforms)this.uniforms[e].getLocation(t,this._webglProgram);return this._located=!0,this}};class fe{constructor(t,e,i=[]){this.type="vertex"===t?fe.Vertex:fe.Fragment,this._code=Array.isArray(e)?e.join("\n"):e||"",this._code=i.map(t=>void 0!==t.value?"#define "+t.type+" "+t.value:"#define "+t.type).join("\n")+"\n"+this._code}get(t){return this._shader||this._compile(t),this._shader}remove(t){this._shader&&t.deleteShader(this._shader)}_compile(t){const e=this.type===fe.Vertex?t.VERTEX_SHADER:t.FRAGMENT_SHADER,i=this._shader=t.createShader(e);if(!i||t.isContextLost())throw new Error(`[2gl] Failed to create shader. Shader is null: ${!i}. Context is lost: ${t.isContextLost()}`);if(t.shaderSource(i,this._code),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(i))}}fe.Vertex=1,fe.Fragment=2;var me=fe;function _e({map:t,gl:e,deck:i,renderTarget:r}){var n;if(t.__deck)return t.__deck;const s=i&&(null===(n=null==i?void 0:i.props)||void 0===n?void 0:n._customRender),o=new de({vertex:new me("vertex","precision mediump float;\n#define GLSLIFY 1\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\nuniform vec2 iResolution;\nattribute vec2 position;\nvarying vec2 vUv;\nvoid texcoords_1_0(vec2 fragCoord, vec2 resolution,\nout vec2 v_rgbNW, out vec2 v_rgbNE,\nout vec2 v_rgbSW, out vec2 v_rgbSE,\nout vec2 v_rgbM) {\nvec2 inverseVP = 1.0 / resolution.xy;\nv_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\nv_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\nv_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\nv_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\nv_rgbM = vec2(fragCoord * inverseVP);\n}\nvoid main(void) {\n gl_Position = vec4(position, 1.0, 1.0);\n \n \n vUv = (position + 1.0) * 0.5;\n vUv.y = vUv.y;\n vec2 fragCoord = vUv * iResolution;\n texcoords_1_0(fragCoord, iResolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}"),fragment:new me("fragment","precision mediump float;\n#define GLSLIFY 1\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\nvarying vec2 vUv;\nuniform vec2 iResolution;\nuniform sampler2D iChannel0;\nuniform bool enabled;\n#ifndef FXAA_REDUCE_MIN\n #define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n #define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n #define FXAA_SPAN_MAX 8.0\n#endif\nvec4 fxaa_1_0(sampler2D tex, vec2 fragCoord, vec2 resolution,\n vec2 v_rgbNW, vec2 v_rgbNE, \n vec2 v_rgbSW, vec2 v_rgbSE, \n vec2 v_rgbM) {\n vec4 color;\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n \n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n \n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n \n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n \n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\nvoid main() {\n \n mediump vec2 fragCoord = vUv * iResolution; \n vec4 color;\n if (enabled) {\n color = fxaa_1_0(iChannel0, fragCoord, iResolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n } else {\n color = texture2D(iChannel0, vUv);\n }\n gl_FragColor = color;\n}\n"),uniforms:[{name:"iResolution",type:"2f"},{name:"iChannel0",type:"1i"},{name:"enabled",type:"1i"}],attributes:[{name:"position",location:0}]}),a=function(t){return new ce(t,{position:new le(new Int8Array([-1,-1,1,-1,1,1,-1,-1,1,1,-1,1]),{itemSize:2,dataType:le.Byte,stride:0,offset:0,normalized:!1})})}(o),h={useDevicePixels:!0,_2gisFramestart:!1,_2glRenderTarget:r,_2glProgram:o,_2glVao:a,_framebuffer:r._frameBuffer,_customRender:e=>{t.triggerRerender(),null==s||s(e)}},c=Ee(t,h);let u;return i&&i.props.gl!==e||(Object.assign(c,{gl:e,width:!1,height:!1,touchAction:"unset",viewState:se(t)}),t.on("move",()=>function(t,e){t.setProps({viewState:se(e)}),t.needsRedraw({clearRedrawFlags:!0})}(u,t))),i?(u=i,u.setProps(c),t._impl.on("frameend",()=>u.props._2gisData._2gisCurrentViewport=null),t._impl.on("framestart",()=>i.props._2gisData._2gisFramestart=!0),t.on("resize",()=>function(t,e,i){const r=t.getSize(),n=t.getWebGLContext(),s=[r[0]*window.devicePixelRatio,r[1]*window.devicePixelRatio];i.setSize(s),i.bind(n),e.props._framebuffer=i._frameBuffer,i.unbind(n)}(t,i,r)),t.__deck=u,u):null}function be(t,e,i){if(!t.layerManager)return;let r=t.props._2gisData._2gisCurrentViewport;r||(r=function(t){if(!t)return;return new ne(t)}(e),t.props._2gisData._2gisCurrentViewport=r),function(t,e){var i,r;const n=t.getWebGLContext();(null===(r=null===(i=e.props)||void 0===i?void 0:i.parameters)||void 0===r?void 0:r.cullFaceEnabled)||n.disable(n.CULL_FACE);n.clearDepth(1),n.clear(n.DEPTH_BUFFER_BIT)}(e,i),t._drawLayers("2gis-repaint",{viewports:[r],layerFilter:({layer:t})=>i.id===t.id,clearCanvas:!1})}function ve(t){const e=[];let i=0;t.props._2gisData._2gisCustomLayers.forEach(t=>{const r=new(0,t.props.type)(t.props,{_offset:i++});e.push(r)}),t.setProps({layers:e})}function Ee(t,e){const i=t.getWebGLContext(),r=Object.assign(Object.assign({},e),{parameters:{depthMask:!0,depthTest:!0,blend:!0,blendFunc:[i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA],polygonOffsetFill:!0,depthFunc:i.LEQUAL,blendEquation:i.FUNC_ADD},_2gisData:{_2gisCustomLayers:new Set,_2gisMap:t},views:[new re({id:"2gis"})]});return Object.assign(r,{gl:i,width:null,height:null,touchAction:"unset",viewState:se(t)}),r}class we{constructor(t,e={}){this._src=t||null,this.options=Object.assign({},we.defaultOptions,e),this._glContext=null}enable(t,e){const i=void 0!==e?e:this.options.unit;return void 0!==i&&t.activeTexture(t.TEXTURE0+i),this._texture||this.prepare(t),t.bindTexture(t.TEXTURE_2D,this._texture),this}remove(){return this._texture&&(this._glContext.deleteTexture(this._texture),this._glContext=null,this._texture=null),this}getTexture(){return this._texture}subImage(t,e,i,r){return t.bindTexture(t.TEXTURE_2D,this._texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,this.options.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.options.premultiplyAlpha),t.texSubImage2D(t.TEXTURE_2D,0,i,r,this._toGlParam(t,this.options.format),this._toGlParam(t,this.options.type),e),this}prepare(t){return this._glContext=t,this._texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this._texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,this.options.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.options.premultiplyAlpha),this.options.size?t.texImage2D(t.TEXTURE_2D,0,this._toGlParam(t,this.options.format),this.options.size[0],this.options.size[1],0,this._toGlParam(t,this.options.format),this._toGlParam(t,this.options.type),this._src):t.texImage2D(t.TEXTURE_2D,0,this._toGlParam(t,this.options.format),this._toGlParam(t,this.options.format),this._toGlParam(t,this.options.type),this._src),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this._toGlParam(t,this.options.wrapS)),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this._toGlParam(t,this.options.wrapT)),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this._toGlParam(t,this.options.magFilter)),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this._toGlParam(t,this.options.minFilter)),this.options.generateMipmaps&&this.options.minFilter!==we.NearestFilter&&this.options.minFilter!==we.LinearFilter&&t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null),this}_toGlParam(t,e){return e===we.ClampToEdgeWrapping?t.CLAMP_TO_EDGE:e===we.Repeat?t.REPEAT:e===we.MirroredRepeat?t.MIRRORED_REPEAT:e===we.NearestFilter?t.NEAREST:e===we.NearestMipMapNearestFilter?t.NEAREST_MIPMAP_NEAREST:e===we.NearestMipMapLinearFilter?t.NEAREST_MIPMAP_LINEAR:e===we.LinearFilter?t.LINEAR:e===we.LinearMipMapNearestFilter?t.LINEAR_MIPMAP_NEAREST:e===we.LinearMipMapLinearFilter?t.LINEAR_MIPMAP_LINEAR:e===we.RgbaFormat?t.RGBA:e===we.AlphaFormat?t.ALPHA:e===we.RgbFormat?t.RGB:e===we.UnsignedByte?t.UNSIGNED_BYTE:e===we.Float?t.FLOAT:null}}we.ClampToEdgeWrapping=8,we.Repeat=9,we.MirroredRepeat=10,we.NearestFilter=1,we.NearestMipMapNearestFilter=2,we.NearestMipMapLinearFilter=3,we.LinearFilter=4,we.LinearMipMapNearestFilter=5,we.LinearMipMapLinearFilter=6,we.RgbaFormat=11,we.AlphaFormat=12,we.RgbFormat=13,we.UnsignedByte=14,we.Float=15,we.defaultOptions={magFilter:we.LinearFilter,minFilter:we.LinearMipMapLinearFilter,wrapS:we.ClampToEdgeWrapping,wrapT:we.ClampToEdgeWrapping,format:we.RgbaFormat,generateMipmaps:!0,flipY:!0,premultiplyAlpha:!0,type:we.UnsignedByte};var Pe=we;class Me{constructor(t={}){this.options=Object.assign({},Me.defaultOptions,t),this._texture=new Pe(null,this.options),this._glContext=null}bind(t){return this._frameBuffer||this._prepare(t),t.bindFramebuffer(t.FRAMEBUFFER,this._frameBuffer),this}unbind(t){return t.bindFramebuffer(t.FRAMEBUFFER,null),this}remove(){return this._unprepare(),this}setSize(t){return this.options.size=t,this._unprepare(),this}getTexture(){return this._texture}_prepare(t){this._glContext=t,this._texture||(this._texture=new Pe(null,this.options)),this._texture.prepare(t),this._frameBuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this._frameBuffer),this._renderBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this._renderBuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,this.options.size[0],this.options.size[1]),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this._texture.getTexture(),0),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,this._renderBuffer),this._checkComplete(t),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null)}_unprepare(){this._texture&&(this._texture.remove(this._glContext),this._texture=null),this._frameBuffer&&(this._glContext.deleteFramebuffer(this._frameBuffer),this._glContext.deleteRenderbuffer(this._renderBuffer),this._frameBuffer=null,this._renderBuffer=null)}_checkComplete(t){const e=t.checkFramebufferStatus(t.FRAMEBUFFER);e!==t.FRAMEBUFFER_COMPLETE&&(e===t.FRAMEBUFFER_UNSUPPORTED?console.log("Framebuffer is unsupported"):e===t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT?console.log("Framebuffer incomplete attachment"):e===t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS?console.log("Framebuffer incomplete dimensions"):e===t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT?console.log("Framebuffer incomplete missing attachment"):console.log("Unexpected framebuffer status: "+e))}}Me.defaultOptions=Object.assign({},Pe.defaultOptions,{size:[0,0],generateMipmaps:!1});var Se=Me;class ye{constructor(t){if(this.onAdd=()=>{if(!this.map&&this.props.deck){const t=this.props.deck.props._2gisData._2gisMap;this.map=t;const e=this.gl=t.getWebGLContext();if(t.__deck&&(this.deck=t.__deck,this.frameBuffer=this.deck.props._2glRenderTarget),!this.frameBuffer||!this.deck){const i=t.getSize();this.frameBuffer=new Se({size:[Math.ceil(i[0]*window.devicePixelRatio),Math.ceil(i[1]*window.devicePixelRatio)],magFilter:Pe.LinearFilter,minFilter:Pe.LinearFilter,wrapS:Pe.ClampToEdgeWrapping,wrapT:Pe.ClampToEdgeWrapping});const r=this.frameBuffer.bind(e);this.frameBuffer.unbind(e),this.deck=_e({map:t,gl:e,deck:this.props.deck,renderTarget:r})}this.program=this.deck.props._2glProgram,this.vao=this.deck.props._2glVao}var t,e;this.deck&&(t=this.deck,e=this,t.props._2gisData._2gisCustomLayers.add(e),ve(t))},this.onRemove=()=>{var t,e;this.deck&&(t=this.deck,e=this,t.props._2gisData._2gisCustomLayers.delete(e),ve(t))},this.render=()=>{if(!(this.deck&&this.map&&this.frameBuffer&&this.program&&this.vao&&this.gl))return;const{_2gisData:t,skipResizeRenderer:e}=this.deck.props,i=this.gl;this.frameBuffer.bind(i),i.clearColor(1,1,1,0),t._2gisFramestart?(i.clear(i.COLOR_BUFFER_BIT|i.DEPTH_BUFFER_BIT),t._2gisFramestart=!1):i.clear(i.COLOR_BUFFER_BIT),this.frameBuffer.unbind(i);const r=this.map.getSize();if(!e||this.deck.width===r[0]&&this.deck.height===r[1]){be(this.deck,this.map,this),i.bindFramebuffer(i.FRAMEBUFFER,null);this.frameBuffer.getTexture().enable(i,0),this.program.enable(i),this.program.bind(i,{iResolution:[r[0]*window.devicePixelRatio,r[1]*window.devicePixelRatio],iChannel0:0,enabled:Number(this.antialiasing)}),this.vao.bind({gl:i,extensions:{OES_vertex_array_object:i.getExtension("OES_vertex_array_object")}}),i.disable(i.CULL_FACE),i.drawArrays(i.TRIANGLES,0,6)}},!t.id)throw new Error("Layer must have a unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t,this.antialiasing=Boolean(t.antialiasing)}setProps(t){Object.assign(this.props,t,{id:this.id}),this.antialiasing=Boolean(t.antialiasing),this.deck&&ve(this.deck)}}ye.initDeck2gisProps=(t,e)=>Ee(t,e),"undefined"!=typeof window&&("mapgl"in window?mapgl.Deck2gisLayer=ye:(window.__mapglPlugins||(window.__mapglPlugins={}),window.__mapglPlugins.Deck2gisLayer=ye))},,function(t,e,i){"use strict";i.d(e,"a",(function(){return v}));var r=i(0),n=i(6);const s="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";Object(n.a)();class o{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(r.a)(this,"storage",void 0),Object(r.a)(this,"id",void 0),Object(r.a)(this,"config",{}),this.storage=function(t){try{const e=window[t],i="__storage_test__";return e.setItem(i,i),e.removeItem(i),e}catch(t){return null}}(i),this.id=t,this.config={},Object.assign(this.config,e),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){return this.config={},this.updateConfiguration(t)}updateConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function a(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const n=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>r&&(i=Math.min(i,r/t.width));const s=t.width*i,o=t.height*i,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(n,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}let h;function c(t){return"string"==typeof t?h[t.toUpperCase()]||h.WHITE:t}function u(t,e){if(!t)throw new Error(e||"Assertion failed")}!function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(h||(h={}));var l=i(1);function p(){let t;var e,i;if(n.a&&"performance"in l.b)t=null===l.b||void 0===l.b||null===(e=l.b.performance)||void 0===e||null===(i=e.now)||void 0===i?void 0:i.call(e);else if("hrtime"in l.a){var r;const e=null===l.a||void 0===l.a||null===(r=l.a.hrtime)||void 0===r?void 0:r.call(l.a);t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}var g=i(5);const d={debug:n.a&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},f={enabled:!0,level:0};function m(){}const _={},b={once:!0};class v{constructor(){let{id:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};Object(r.a)(this,"id",void 0),Object(r.a)(this,"VERSION",s),Object(r.a)(this,"_startTs",p()),Object(r.a)(this,"_deltaTs",p()),Object(r.a)(this,"_storage",void 0),Object(r.a)(this,"userData",{}),Object(r.a)(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this._storage=new o("__probe-".concat(this.id,"__"),f),this.userData={},this.timeStamp("".concat(this.id," started")),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const i=Object.getPrototypeOf(t),r=Object.getOwnPropertyNames(i);for(const i of r)"function"==typeof t[i]&&(e.find(t=>i===t)||(t[i]=t[i].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((p()-this._startTs).toPrecision(10))}getDelta(){return Number((p()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.updateConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){u(t,e)}warn(t){return this._getLogFunction(0,t,d.warn,arguments,b)}error(t){return this._getLogFunction(0,t,d.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,d.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,d.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){for(var i=arguments.length,r=new Array(i>2?i-2:0),n=2;n<i;n++)r[n-2]=arguments[n];return this._getLogFunction(t,e,d.debug||d.info,arguments,b)}table(t,e,i){return e?this._getLogFunction(t,e,console.table||m,i&&[i],{tag:P(e)}):m}image(t){let{logLevel:e,priority:i,image:r,message:s="",scale:o=1}=t;return this._shouldLog(e||i)?n.a?function(t){let{image:e,message:i="",scale:r=1}=t;if("string"==typeof e){const t=new Image;return t.onload=()=>{const e=a(t,i,r);console.log(...e)},t.src=e,m}const n=e.nodeName||"";if("img"===n.toLowerCase())return console.log(...a(e,i,r)),m;if("canvas"===n.toLowerCase()){const t=new Image;return t.onload=()=>console.log(...a(t,i,r)),t.src=e.toDataURL(),m}return m}({image:r,message:s,scale:o}):function(t){let{image:e,message:i="",scale:r=1}=t;return g.nodeAsciifyImage({image:e,message:i,scale:r}),m}({image:r,message:s,scale:o}):m}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||m)}group(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const r=w({logLevel:t,message:e,opts:i}),{collapsed:n}=i;return r.method=(n?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},i,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||m)}withGroup(t,e,i){this.group(t,e)();try{i()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=E(t)}_getLogFunction(t,e,i,r,s){if(this._shouldLog(t)){s=w({logLevel:t,message:e,args:r,opts:s}),u(i=i||s.method),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=p();const o=s.tag||s.message;if(s.once){if(_[o])return m;_[o]=p()}return e=function(t,e,i){if("string"==typeof e){const a=i.time?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const i=Math.max(e-t.length,0);return"".concat(" ".repeat(i)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(i.total)):"";e=i.time?"".concat(t,": ").concat(a," ").concat(e):"".concat(t,": ").concat(e),r=e,s=i.color,o=i.background,n.a||"string"!=typeof r||(s&&(s=c(s),r="[".concat(s,"m").concat(r,"[39m")),o&&(s=c(o),r="[".concat(o+10,"m").concat(r,"[49m"))),e=r}var r,s,o;return e}(this.id,s.message,s),i.bind(console,e,...s.args)}return m}}function E(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return u(Number.isFinite(e)&&e>=0),e}function w(t){const{logLevel:e,message:i}=t;t.logLevel=E(e);const r=t.args?Array.from(t.args):[];for(;r.length&&r.shift()!==i;);switch(typeof e){case"string":case"function":void 0!==i&&r.unshift(i),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());const n=typeof t.message;return u("string"===n||"object"===n),Object.assign(t,{args:r},t.opts)}function P(t){for(const e in t)for(const i in t[e])return i||"untitled";return"empty"}Object(r.a)(v,"VERSION",s)}])}));