Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@deck.gl/mesh-layers

Package Overview
Dependencies
Maintainers
9
Versions
402
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deck.gl/mesh-layers - npm Package Compare versions

Comparing version 7.1.0-alpha.1 to 7.1.0-alpha.2

2

dist.min.js

@@ -1,1 +0,1 @@

!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("luma"),require("deck"));else if("function"==typeof define&&define.amd)define(["luma","deck"],e);else{var n="object"==typeof exports?e(require("luma"),require("deck")):e(t.luma,t.deck);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=20)}([function(t,e,n){t.exports=n(28)},function(e,n){e.exports=t},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){t.exports=n(26)},function(t,e){},function(t,n){t.exports=e},function(t,e){"undefined"==typeof TextDecoder?t.exports={}:t.exports={TextEncoder:TextEncoder,TextDecoder:TextDecoder}},function(t,e,n){n(2);var r=n(24);function o(e,n,i){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=o=Reflect.get:t.exports=o=function(t,e,n){var o=r(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(n):i.value}},o(e,n,i||e)}t.exports=o},function(t,e,n){"use strict";(function(t,r){n.d(e,"a",function(){return i});var o=n(13),i="object"!==(void 0===t?"undefined":Object(o.a)(t))||"[object process]"!==String(t)||t.browser;"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document}).call(this,n(29),n(16))},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){var r=n(22),o=n(23);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?o(t):e}},function(t,e,n){var r=n(25);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return(o="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)})(t)}n.d(e,"a",function(){return o})},function(t,e){},function(t,e){},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){(function(e){const r=n(30),o=("undefined"==typeof window?e:window).deck||{};if(!o.Layer)throw new Error("@deck.gl/core is not found");t.exports=Object.assign(o,r)}).call(this,n(16))},,function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){var r=n(2);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e,n){var r=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(27),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";var n,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",u="object"==typeof t,f=e.regeneratorRuntime;if(f)u&&(t.exports=f);else{(f=e.regeneratorRuntime=u?t.exports:{}).wrap=w;var l="suspendedStart",p="suspendedYield",h="executing",y="completed",v={},d={};d[a]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(j([])));g&&g!==r&&o.call(g,a)&&(d=g);var b=k.prototype=_.prototype=Object.create(d);S.prototype=b.constructor=k,k.constructor=S,k[c]=S.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===S||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,k):(t.__proto__=k,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(b),t},f.awrap=function(t){return{__await:t}},P(O.prototype),O.prototype[s]=function(){return this},f.AsyncIterator=O,f.async=function(t,e,n,r){var o=new O(w(t,e,n,r));return f.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},P(b),b[c]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},f.values=j,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return s.type="throw",s.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function w(t,e,n,r){var o=e&&e.prototype instanceof _?e:_,i=Object.create(o.prototype),a=new C(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===h)throw new Error("Generator is already running");if(r===y){if("throw"===o)throw i;return E()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var c=x(t,e,n);if("normal"===c.type){if(r=n.done?y:p,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=y,n.method="throw",n.arg=c.arg)}}}(t,n,a),i}function x(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function _(){}function S(){}function k(){}function P(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function O(t){var e;this._invoke=function(n,r){function i(){return new Promise(function(e,i){!function e(n,r,i,a){var s=x(t[n],t,r);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&o.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(u).then(function(t){c.value=t,i(c)},function(t){return e("throw",t,i,a)})}a(s.arg)}(n,r,e,i)})}return e=e?e.then(i,i):i()}}function T(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,T(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=x(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function j(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return i.next=i}}return{next:E}}function E(){return{value:n,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,n,r){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),a=new T(r||[]);return i._invoke=function(t,e,n){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return A()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=u(t,e,n);if("normal"===c.type){if(r=n.done?h:l,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f="suspendedStart",l="suspendedYield",p="executing",h="completed",y={};function v(){}function d(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(L([])));w&&w!==n&&r.call(w,i)&&(g=w);var x=m.prototype=v.prototype=Object.create(g);function _(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function S(t){var e;this._invoke=function(n,o){function i(){return new Promise(function(e,i){!function e(n,o,i,a){var s=u(t[n],t,o);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?Promise.resolve(f.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(f).then(function(t){c.value=t,i(c)},function(t){return e("throw",t,i,a)})}a(s.arg)}(n,o,e,i)})}return e=e?e.then(i,i):i()}}function k(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,k(t,n),"throw"===n.method))return y;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=u(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:A}}function A(){return{value:e,done:!0}}return d.prototype=x.constructor=m,m.constructor=d,m[s]=d.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},_(S.prototype),S.prototype[a]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,o){var i=new S(c(e,n,r,o));return t.isGeneratorFunction(n)?i:i.next().then(function(t){return t.done?t.value:i.next()})},_(x),x[s]="Generator",x[i]=function(){return this},x.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=L,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,u=[],f=!1,l=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):l=-1,u.length&&h())}function h(){if(!f){var t=s(p);f=!0;for(var e=u.length;e;){for(c=u,u=[];++l<e;)c&&c[l].run();l=-1,e=u.length}c=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!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 y(t,e){this.fun=t,this.array=e}function v(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new y(t,e)),1!==u.length||f||s(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";n.r(e);var r=n(9),o=n.n(r),i=n(10),a=n.n(i),s=n(11),c=n.n(s),u=n(2),f=n.n(u),l=n(7),p=n.n(l),h=n(12),y=n.n(h),v=n(5),d=n(1),m=n.n(d),g=n(0),b=n.n(g);function w(t,e,n,r,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,o)}function x(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){w(i,r,o,a,s,"next",t)}function s(t){w(i,r,o,a,s,"throw",t)}a(void 0)})}}var _=n(8);function S(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){S(t,e,n[e])})}return t}function P(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function T(t,e,n){return e&&O(t.prototype,e),n&&O(t,n),t}var L=n(4),A=n.n(L),C=n(14),j=n.n(C),E=n(15),M=n.n(E),I=n(19),N=n.n(I);function F(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var z=n(6),R=function(t){return t&&t instanceof ArrayBuffer},U=function(t){return t&&t instanceof Buffer};function B(t){if(R(t))return t;if(U(t))return new Uint8Array(t).buffer;if(ArrayBuffer.isView(t))return t.buffer;if("string"==typeof t){var e=t;return(new z.TextEncoder).encode(e).buffer}return F(!1)}function D(t){this.wrapped=t}function G(t){var e,n;function r(e,n){try{var i=t[e](n),a=i.value,s=a instanceof D;Promise.resolve(s?a.wrapped:a).then(function(t){s?r("next",t):o(i.done?"return":"normal",t)},function(t){r("throw",t)})}catch(t){o("throw",t)}}function o(t,o){switch(t){case"return":e.resolve({value:o,done:!0});break;case"throw":e.reject(o);break;default:e.resolve({value:o,done:!1})}(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(t,o){return new Promise(function(i,a){var s={key:t,arg:o,resolve:i,reject:a,next:null};n?n=n.next=s:(e=n=s,r(t,o))})},"function"!=typeof t.return&&(this.return=void 0)}function H(t){var e=new ArrayBuffer,n="";return new Promise(function(r,o){t.data(function(t){var r,o,i,a,s;"string"==typeof t?n+=t:(o=t,i=(r=e)instanceof ArrayBuffer?new Uint8Array(r):r,a=o instanceof ArrayBuffer?new Uint8Array(o):o,(s=new Uint8Array(i.byteLength+a.byteLength)).set(i,0),s.set(a,i.byteLength),e=s)}),t.on("error",function(t){return o(t)}),t.on("end",function(){t.complete?r(e||n):o("The connection was terminated while the message was still being sent")})})}function V(t){var e,n,r=t.indexOf(",");return";base64"===t.slice(r-7,r)?(e=new Buffer(t.slice(r+1),"base64"),n=t.slice(5,r-7).trim()):(e=new Buffer(decodeURIComponent(t.slice(r+1))),n=t.slice(5,r).trim()),n?";"===n[0]&&(n="text/plain".concat(n)):n="text/plain;charset=US-ASCII",{buffer:e,mimeType:n}}"function"==typeof Symbol&&Symbol.asyncIterator&&(G.prototype[Symbol.asyncIterator]=function(){return this}),G.prototype.next=function(t){return this._invoke("next",t)},G.prototype.throw=function(t){return this._invoke("throw",t)},G.prototype.return=function(t){return this._invoke("return",t)};var q={dataType:"arrayBuffer"},W=(Boolean(A.a&&A.a.readFile),function(t){return t.startsWith("data:")}),X=function(t){return t.startsWith("http:")||t.startsWith("https:")},Y=function(){function t(e){P(this,t),this.reponse=e}return T(t,[{key:"get",value:function(t){if(this.response.httpResponse)return this.response.httpResponse.getHeaders()[t];switch(t){case"Content-Length":return this._getContentLength()}}},{key:"_getContentLength",value:function(){return this._contentLength}}]),t}(),$=function(){function t(e,n){P(this,t),this.url=e,this.options=n,this.bodyUsed=!1,this._headers=null}return T(t,[{key:"arrayBuffer",value:function(){var t=x(b.a.mark(function t(){return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.bodyUsed=!0,t.abrupt("return",K(this.url,this.options));case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"text",value:function(){var t=x(b.a.mark(function t(){var e,n;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.arrayBuffer();case 2:return e=t.sent,n=new z.TextDecoder,t.abrupt("return",n.decode(e));case 5:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"json",value:function(){var t=x(b.a.mark(function t(){var e;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.text();case 2:return e=t.sent,t.abrupt("return",JSON.parse(e));case 4:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"_getHeaders",value:function(){return X(this.url)?new Y(this):W(this.url)?{"Content-Length":this.url.length}:X(this.repsonse.url)?{}:{"Content-Length":A.a.statSync(this.response.url).size}}},{key:"headers",get:function(){this._headers=this._headers||this._getHeaders()}},{key:"body",get:function(){var t=this.url,e=this.options;return this.bodyUsed=!0,tt(t,e)}}]),t}();function J(t,e){return Q.apply(this,arguments)}function Q(){return(Q=x(b.a.mark(function t(e,n){return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new $(e,n));case 1:case"end":return t.stop()}},t)}))).apply(this,arguments)}function K(t){return Z.apply(this,arguments)}function Z(){return(Z=x(b.a.mark(function t(e){var n,r,o,i=arguments;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=nt(n=i.length>1&&void 0!==i[1]?i[1]:{}),!W(e)){t.next=4;break}return t.abrupt("return",Promise.resolve(V(e)));case 4:if(!X(e)){t.next=6;break}return t.abrupt("return",new Promise(function(t,r){n=k({},new URL(e),n),(e.startsWith("https:")?M.a.request:j.a.request)(e,function(e){return H(e).then(t,r)})}));case 6:return r=N.a.promisify(A.a.readFile),t.next=9,r(e,n);case 9:return o=t.sent,t.abrupt("return",o instanceof Buffer?B(o):o);case 11:case"end":return t.stop()}},t)}))).apply(this,arguments)}function tt(t,e){return et.apply(this,arguments)}function et(){return(et=x(b.a.mark(function t(e,n){return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!W(e)){t.next=2;break}return t.abrupt("return",V(e));case 2:if(X(e)){t.next=4;break}return t.abrupt("return",A.a.createReadStream(e,n));case 4:return t.abrupt("return",new Promise(function(t,r){n=k({},new URL(e),n),(e.startsWith("https:")?M.a.request:j.a.request)(e,function(e){return t(e)})}));case 5:case"end":return t.stop()}},t)}))).apply(this,arguments)}function nt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(t=Object.assign({},q,t)).responseType=t.responseType||t.dataType,A.a&&(t.encoding=t.encoding||("text"===t.dataType?"utf8":null)),t}function rt(t,e){return ot.apply(this,arguments)}function ot(){return(ot=x(b.a.mark(function t(e,n){return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e,n);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}))).apply(this,arguments)}var it="",at={};function st(t){for(var e in at)if(t.startsWith(e)){var n=at[e];return t.replace(e,n)}return t+=it}function ct(t,e){return ut.apply(this,arguments)}function ut(){return(ut=x(b.a.mark(function t(e,n){var r;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=st(e),r=_.a?rt:J,t.abrupt("return",r(e,n));case 3:case"end":return t.stop()}},t)}))).apply(this,arguments)}function ft(t){return!!t&&(Array.isArray(t)&&(t=t[0]),t.parseTextSync||t.parseSync||t.parse||t.loadAndParse||t.parseStream||t.parseInBatches||t.worker)}function lt(t){var e;return F(ft(t)),Array.isArray(t)&&(e=(t=t[0])[1],t=k({},t,{options:k({},t.options,{options:e})})),t.extension&&(t.extensions=t.extensions||[t.extension],delete t.extension),Array.isArray(t.extensions)||(t.extensions=[t.extensions]),F(t.extensions&&t.extensions.length>0&&t.extensions[0]),t.parseTextSync&&(t.text=!0),t.text||(t.binary=!0),t}var pt=/[^\.]+$/;function ht(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=t.match(pt);if(r&&r[0]){var o=function(t,e){e=e.toLowerCase();var n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;lt(s);var c=!0,u=!1,f=void 0;try{for(var l,p=s.extensions[Symbol.iterator]();!(c=(l=p.next()).done);c=!0){var h=l.value;if(h.toLowerCase()===e)return s}}catch(t){u=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(u)throw f}}}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return null}(n,r[0]);if(o)return o}var i=function(t,e){var n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;if(s.testText&&s.testText(e))return s}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return null}(n,e);return i||null}var yt=function(){function t(){P(this,t)}return T(t,[{key:"log",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}}]),t}(),vt={};function dt(){return Object.values(vt)}var mt=new Map;function gt(t,e,n){var r=function(t){var e=mt.get(t);if(!e){var n=new Blob([t],{type:"application/javascript"});e=URL.createObjectURL(n),mt.set(t,e)}return new Worker(e)}(t);n=function(t){null!==(t=Object.assign({},t)).log&&delete t.log;return t}(n);var o=function(t,e){return new Promise(function(n,o){r.onmessage=function(t){switch(t.data.type){case"done":n(t.data.result),r.terminate();break;case"error":o(new Error(t.data.message))}};var i=B(t);r.postMessage({arraybuffer:i,opts:e},[i])})};return e?o(e,n):o}n(13);var bt=function(t){return"undefined"!=typeof window&&t instanceof window.Response||t.arrayBuffer&&t.json&&t.body},wt="Cannot convert supplied data type";function xt(t){return bt(t)?t.url:null}function _t(t,e){if(e.text&&"string"==typeof t)return t;if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){var n=t.buffer||t;return e.text&&!e.binary?new z.TextDecoder("utf8").decode(n):n}throw new Error(wt)}function St(t,e){return kt.apply(this,arguments)}function kt(){return(kt=x(b.a.mark(function t(e,n){var r;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:if(e=t.sent,r=e instanceof ArrayBuffer||ArrayBuffer.isView(e),"string"!=typeof e&&!r){t.next=6;break}return t.abrupt("return",_t(e,n));case 6:if(!bt(e)){t.next=15;break}if(!n.binary){t.next=13;break}return t.next=10,e.arrayBuffer();case 10:t.t0=t.sent,t.next=14;break;case 13:t.t0=e.text();case 14:return t.abrupt("return",t.t0);case 15:throw new Error(wt);case 16:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Pt(t,e){return Ot.apply(this,arguments)}function Ot(){return(Ot=x(b.a.mark(function t(e,n){var r,o,i=arguments;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},o=(o=i.length>3?i[3]:void 0)||xt(e),t.next=5,St(e,n);case 5:if(e=t.sent,!n.parseTextSync||"string"!=typeof e){t.next=9;break}return r.dataType="text",t.abrupt("return",n.parseTextSync(e,r,o,n));case 9:if(!n.parseSync){t.next=11;break}return t.abrupt("return",n.parseSync(e,r,o,n));case 11:if(!n.parse){t.next=15;break}return t.next=14,n.parse(e,r,o,n);case 14:return t.abrupt("return",t.sent);case 15:if(!n.worker){t.next=19;break}return t.next=18,gt(n.worker,e,r);case 18:return t.abrupt("return",t.sent);case 19:return t.abrupt("return",F(!1));case 20:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Tt(t,e,n,r){return Lt.apply(this,arguments)}function Lt(){return(Lt=x(b.a.mark(function t(e,n,r,o){var i;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(Array.isArray(n)||ft(n)||(o=r,r=n,n=null),n=n||dt(),i=Array.isArray(n)?ht(o,e,n):n){t.next=5;break}return t.abrupt("return",null);case 5:return lt(i),r=At(r,i),t.next=9,Pt(e,i,r,o);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t)}))).apply(this,arguments)}function At(t,e){return null===(t=Object.assign({},e.DEFAULT_OPTIONS,e.options,t,{dataType:"arraybuffer"})).log&&(t.log=new yt),"log"in t||(t.log=console),t}function Ct(t,e,n){return jt.apply(this,arguments)}function jt(){return(jt=x(b.a.mark(function t(e,n,r){var o,i;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(Array.isArray(n)||ft(n)||(r=n,n=null),n=n||dt(),!(o=Array.isArray(n)?ht(e,null,n):n)||!o.loadAndParse){t.next=7;break}return t.next=6,o.loadAndParse(e,r);case 6:return t.abrupt("return",t.sent);case 7:return t.next=9,ct(e,r);case 9:return i=t.sent,t.abrupt("return",Tt(i,n,r,e));case 11:case"end":return t.stop()}},t)}))).apply(this,arguments)}var Et=n(3),Mt=n.n(Et);function It(t,e,n,r,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,o)}function Nt(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){It(i,r,o,a,s,"next",t)}function s(t){It(i,r,o,a,s,"throw",t)}a(void 0)})}}var Ft=n(17),zt=n.n(Ft),Rt=n(18),Ut=n.n(Rt);function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Dt(t){return Buffer.isBuffer(t)?new Uint8Array(t).buffer:t}var Gt=!1,Ht=!0,Vt=new Map([["image/png",function(t){var e=Yt(t);if(e.byteLength<24||2303741511!==e.getUint32(0,Gt))return null;return{width:e.getUint32(16,Gt),height:e.getUint32(20,Gt)}}],["image/jpeg",function(t){var e=Yt(t);if(e.byteLength<2||65496!==e.getUint16(0,Gt))return null;var n=function(){for(var t=new Set([65499,65476,65484,65501,65534]),e=65504;e<65520;++e)t.add(e);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:n}}(),r=n.tableMarkers,o=n.sofMarkers,i=2;for(;i<e.byteLength;){var a=e.getUint16(i,Gt);if(o.has(a))return{height:e.getUint16(i+5,Gt),width:e.getUint16(i+7,Gt)};if(!r.has(a))return null;i+=2,i+=e.getUint16(i,Gt)}return null}],["image/gif",function(t){var e=Yt(t);if(e.byteLength<10||1195984440!==e.getUint32(0,Gt))return null;return{width:e.getUint16(6,Ht),height:e.getUint16(8,Ht)}}],["image/bmp",function(t){var e=Yt(t);if(16973!==e.getUint16(0,Gt))return null;return{width:e.getUint32(18,Ht),height:e.getUint32(22,Ht)}}]]),qt="Invalid MIME type. Supported MIME types are: ".concat(Array.from(Vt.keys()).join(", "));function Wt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){var n=Vt.get(e);if(!n)throw new Error(qt);var r=n(t);if(!r)throw new Error("invalid image data for type: ".concat(e));return r}var o=Xt(t,e);if(!o)throw new Error(qt);return o}function Xt(t,e){var n=!0,r=!1,o=void 0;try{for(var i,a=Vt.entries()[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=Bt(i.value,2),c=s[0],u=(0,s[1])(t);if(u)return u.mimeType=c,u}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return null}function Yt(t){if(Dt&&(t=Dt(t)),t instanceof ArrayBuffer||ArrayBuffer.isView(t))return new DataView(t.buffer||t);throw new Error("toDataView")}function $t(t,e){return Jt.apply(this,arguments)}function Jt(){return(Jt=Nt(Mt.a.mark(function t(e,n){var r,o,i,a,s;return Mt.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=Ut.a.promisify(zt.a),o=Wt(e),i=o.mimeType,a=e instanceof Buffer?e:Buffer.from(e),t.next=5,r(a,i);case 5:return s=t.sent,t.abrupt("return",{width:s.shape[0],height:s.shape[1],data:s.data});case 7:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Qt(t,e){return $t?$t(t,e):function(t){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var e=new Blob([new Uint8Array(t)]);return createImageBitmap(e)}(t)}function Kt(){return(Kt=Nt(Mt.a.mark(function t(e,n){var r,o;return Mt.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"!=typeof Image){t.next=8;break}return t.next=3,fetch(e,n);case 3:return r=t.sent,t.next=6,r.arrayBuffer();case 6:return o=t.sent,t.abrupt("return",Qt(o));case 8:return t.next=10,Zt(e,n);case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Zt(t,e){return te.apply(this,arguments)}function te(){return(te=Nt(Mt.a.mark(function t(e,n){var r,o,i;return Mt.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!/\.svg((\?|#).*)?$/.test(e)){t.next=10;break}return t.next=3,fetch(e,n);case 3:return o=t.sent,t.next=6,o.text();case 6:i=t.sent,r="data:image/svg+xml;base64,".concat(btoa(i)),t.next=13;break;case 10:return t.next=12,e;case 12:r=t.sent;case 13:return t.next=15,new Promise(function(t,o){try{var i=new Image;i.onload=function(){return t(i)},i.onerror=function(t){return o(new Error("Could not load image ".concat(e,": ").concat(t)))},i.crossOrigin=n&&n.crossOrigin||"anonymous",i.src=r}catch(t){o(t)}});case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}},t)}))).apply(this,arguments)}var ee=Math.PI/180,ne=new Float32Array(16),re=new Float32Array(12);function oe(t,e,n){var r=e[0]*ee,o=e[1]*ee,i=e[2]*ee,a=Math.sin(i),s=Math.sin(r),c=Math.sin(o),u=Math.cos(i),f=Math.cos(r),l=Math.cos(o),p=n[0],h=n[1],y=n[2];t[0]=p*l*f,t[1]=p*c*f,t[2]=p*-s,t[3]=h*(-c*u+l*s*a),t[4]=h*(l*u+c*s*a),t[5]=h*f*a,t[6]=y*(c*a+l*s*u),t[7]=y*(-l*a+c*s*u),t[8]=y*f*u}function ie(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}var ae={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(t){var e=this.props,n=e.data,r=e.getOrientation,o=e.getScale,i=e.getTranslation,a=e.getTransformMatrix,s=Array.isArray(a),c=s&&16===a.length,u=Array.isArray(o),f=Array.isArray(r),l=Array.isArray(i),p=c||!s&&Boolean(a(n[0]));t.constant=p?c:f&&u&&l;var h=t.value;if(t.constant){var y;if(p)ne.set(a),y=ie(ne);else oe(y=re,r,o),y.set(i,9);t.value=new Float32Array(y)}else{var d=0,m=Object(v.createIterable)(n),g=m.iterable,b=m.objectInfo,w=!0,x=!1,_=void 0;try{for(var S,k=g[Symbol.iterator]();!(w=(S=k.next()).done);w=!0){var P=S.value;b.index++;var O=void 0;if(p)ne.set(c?a:a(P,b)),O=ie(ne);else oe(O=re,f?r:r(P,b),u?o:o(P,b)),O.set(l?i:i(P,b),9);h[d++]=O[0],h[d++]=O[1],h[d++]=O[2],h[d++]=O[3],h[d++]=O[4],h[d++]=O[5],h[d++]=O[6],h[d++]=O[7],h[d++]=O[8],h[d++]=O[9],h[d++]=O[10],h[d++]=O[11]}}catch(t){x=!0,_=t}finally{try{w||null==k.return||k.return()}finally{if(x)throw _}}}}},se=d.fp64.fp64LowPart;function ce(t,e,n){return"string"==typeof e?function(t,e){return Kt.apply(this,arguments)}(e).then(function(e){return ue(t,e,n)}).catch(function(t){throw new Error("Could not load texture from ".concat(e,": ").concat(t))}):new Promise(function(r){return r(ue(t,e,n))})}function ue(t,e,n){return e instanceof d.Texture2D?e:new d.Texture2D(t,Object.assign({data:e},n))}function fe(t){!function(t,e){if(!t)throw new Error("deck.gl: ".concat(e))}(t.positions||t.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function le(t){if(t.attributes)return fe(t.attributes),t instanceof d.Geometry?t:new d.Geometry(t);if(t.positions||t.POSITION)return fe(t),new d.Geometry({attributes:t});throw Error("Invalid mesh")}var pe=new d.PhongMaterial,he={fetch:function(t){function e(e,n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t,e){return"mesh"===e.propName?Ct(t):fetch(t).then(function(t){return t.json()})}),mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:m.a.LEQUAL},fp64:!1,wireframe:!1,material:pe,getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},ye=function(t){function e(){return o()(this,e),c()(this,f()(e).apply(this,arguments))}return y()(e,t),a()(e,[{key:"getShaders",value:function(){var t=this.use64bitProjection()?"project64":"project32",e=Object(d.isWebGL2)(this.context.gl);return{vs:e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\n\n// Instance attributes\nin vec3 instancePositions;\nin vec2 instancePositions64xy;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\n\n// Outputs to fragment shader\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n picking_setPickingColor(instancePickingColors);\n}\n",fs:e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor / 255., color.a);\n\n // use highlight color if this fragment belongs to the selected object.\n fragColor = picking_filterHighlightColor(fragColor);\n\n // use picking color if rendering to picking FBO.\n fragColor = picking_filterPickingColor(fragColor);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor / 255., color.a);\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[t,"phong-lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,size:3,accessor:"getPosition"},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{transition:!0,size:4,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:ae}),this.setState({emptyTexture:new d.Texture2D(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(t){var n=t.props,r=t.oldProps,o=t.changeFlags;if(p()(f()(e.prototype),"updateState",this).call(this,{props:n,oldProps:r,changeFlags:o}),n.mesh!==r.mesh||n.fp64!==r.fp64){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var i=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(i.NORMAL||i.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==r.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?m.a.LINE_STRIP:m.a.TRIANGLES)}},{key:"finalizeState",value:function(){p()(f()(e.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(t){var e=t.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},e,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(t){var e=new d.Model(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:le(t),isInstanced:!0,shaderCache:this.context.shaderCache}));return this.state.texture?e.setUniforms({sampler:this.state.texture,hasTexture:1}):e.setUniforms({sampler:this.state.emptyTexture,hasTexture:0}),e}},{key:"setTexture",value:function(t){var e=this,n=this.context.gl,r=this.state.emptyTexture;this.state.texture&&this.state.texture.delete(),t?ce(n,t).then(function(t){e.setState({texture:t}),e.state.model&&e.state.model.setUniforms({sampler:e.state.texture,hasTexture:1})}):(this.setState({texture:null}),this.state.model&&this.state.model.setUniforms({sampler:r,hasTexture:0}))}},{key:"calculateInstancePositions64xyLow",value:function(t){var e=this.use64bitPositions();if(t.constant=!e,e){var n=this.props,r=n.data,o=n.getPosition,i=t.value,a=0,s=Object(v.createIterable)(r),c=s.iterable,u=s.objectInfo,f=!0,l=!1,p=void 0;try{for(var h,y=c[Symbol.iterator]();!(f=(h=y.next()).done);f=!0){var d=h.value;u.index++;var m=o(d,u);i[a++]=se(m[0]),i[a++]=se(m[1])}}catch(t){l=!0,p=t}finally{try{f||null==y.return||y.return()}finally{if(l)throw p}}}else t.value=new Float32Array(2)}}]),e}(v.Layer);ye.layerName="SimpleMeshLayer",ye.defaultProps=he;var ve=d.fp64.fp64LowPart,de=[255,255,255,255],me={scenegraph:{type:"object",value:null,async:!0},fetch:function(t){function e(e,n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t,e){var n=e.propName,r=e.layer;return"scenegraph"===n?Ct(t,r.getLoadOptions()):fetch(t).then(function(t){return t.json()})}),getScene:function(t){return t&&t.scenes?t.scenes[0]:t},getAnimator:function(t){return t&&t.animator},sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:de},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},ge=function(t){function e(){return o()(this,e),c()(this,f()(e).apply(this,arguments))}return y()(e,t),a()(e,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,accessor:"getPosition",transition:!0},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{size:4,accessor:"getColor",defaultValue:de,transition:!0},instanceModelMatrix:ae})}},{key:"calculateInstancePositions64xyLow",value:function(t){var e=this.use64bitPositions();if(t.constant=!e,e){var n=this.props,r=n.data,o=n.getPosition,i=t.value,a=0,s=!0,c=!1,u=void 0;try{for(var f,l=r[Symbol.iterator]();!(s=(f=l.next()).done);s=!0){var p=o(f.value);i[a++]=ve(p[0]),i[a++]=ve(p[1])}}catch(t){c=!0,u=t}finally{try{s||null==l.return||l.return()}finally{if(c)throw u}}}else t.value=new Float32Array(2)}},{key:"updateState",value:function(t){p()(f()(e.prototype),"updateState",this).call(this,t);var n=t.props,r=t.oldProps;if(n.scenegraph!==r.scenegraph){var o=n.getScene(n.scenegraph),i=n.getAnimator(n.scenegraph);o instanceof d.ScenegraphNode?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,i,n._animations),this.setState({scenegraph:o,animator:i})):null!==o&&d.log.warn("invalid scenegraph:",o)()}else n._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){this._deleteScenegraph()}},{key:"_applyAllAttributes",value:function(t){var e=this,n=this.getAttributeManager().getAttributes();t.traverse(function(t){e._setModelAttributes(t.model,n)})}},{key:"_applyAnimationsProp",value:function(t,e,n){if(t&&e&&n){var r=e.getAnimations();Object.keys(n).forEach(function(t){var e=n[t];if("*"===t)r.forEach(function(t){Object.assign(t,e)});else if(Number.isFinite(Number(t))){var o=Number(t);o>=0&&o<r.length?Object.assign(r[o],e):d.log.warn("animation ".concat(t," not found"))()}else{var i=r.find(function(e){return e.name===t});i?Object.assign(i,e):d.log.warn("animation ".concat(t," not found"))()}})}}},{key:"_deleteScenegraph",value:function(){var t=this.state.scenegraph;t instanceof d.ScenegraphNode&&t.delete()}},{key:"getLoadOptions",value:function(){return{gl:this.context.gl,waitForFullLoad:!0,modelOptions:{vs:"// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Uniforms\nuniform float sizeScale;\nuniform mat4 sceneModelMatrix;\n\n// Attributes\nattribute vec4 POSITION;\n\n#ifdef HAS_UV\n attribute vec2 TEXCOORD_0;\n varying vec2 vTEXCOORD_0;\n#endif\nvarying vec4 vColor;\n\nvoid main(void) {\n #ifdef HAS_UV\n vTEXCOORD_0 = TEXCOORD_0;\n #endif\n vColor = instanceColors;\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#ifdef HAS_UV\n varying vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n#endif\nvarying vec4 vColor;\n\nvoid main(void) {\n #ifdef HAS_UV\n gl_FragColor = (vColor / 255.) * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n #else\n gl_FragColor = vColor / 255.;\n #endif\n\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:["project32","picking"],isInstanced:!0}}}},{key:"updateAttributes",value:function(t){var n=this;if(p()(f()(e.prototype),"updateAttributes",this).call(this,t),this.state.scenegraph){var r=this.getAttributeManager().getChangedAttributes({clearChangedFlags:!0});this.state.scenegraph.traverse(function(t){n._setModelAttributes(t.model,r)})}}},{key:"draw",value:function(t){var e=t.moduleParameters,n=void 0===e?null:e,r=t.parameters,o=void 0===r?{}:r,i=t.context;if(this.state.scenegraph){this.props._animations&&this.state.animator&&this.state.animator.animate(i.animationProps.time);var a=this.props.sizeScale,s=this.getNumInstances();this.state.scenegraph.traverse(function(t,e){var r=e.worldMatrix;t.model.setInstanceCount(s),t.updateModuleSettings(n),t.draw({parameters:o,uniforms:{sizeScale:a,sceneModelMatrix:r}})})}}}]),e}(v.Layer);ge.layerName="ScenegraphLayer",ge.defaultProps=me,n.d(e,"SimpleMeshLayer",function(){return ye}),n.d(e,"ScenegraphLayer",function(){return ge})}])});
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("luma"),require("deck"));else if("function"==typeof define&&define.amd)define(["luma","deck"],e);else{var n="object"==typeof exports?e(require("luma"),require("deck")):e(t.luma,t.deck);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=20)}([function(t,e,n){t.exports=n(28)},function(e,n){e.exports=t},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,n){t.exports=e},function(t,e,n){t.exports=n(26)},function(t,e){},function(t,e){"undefined"==typeof TextDecoder?t.exports={}:t.exports={TextEncoder:TextEncoder,TextDecoder:TextDecoder}},function(t,e,n){n(2);var r=n(24);function o(e,n,i){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=o=Reflect.get:t.exports=o=function(t,e,n){var o=r(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(n):i.value}},o(e,n,i||e)}t.exports=o},function(t,e,n){"use strict";(function(t,r){n.d(e,"a",function(){return i});var o=n(13),i="object"!==(void 0===t?"undefined":Object(o.a)(t))||"[object process]"!==String(t)||t.browser;"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document}).call(this,n(29),n(16))},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){var r=n(22),o=n(23);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?o(t):e}},function(t,e,n){var r=n(25);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return(o="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)})(t)}n.d(e,"a",function(){return o})},function(t,e){},function(t,e){},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){(function(e){const r=n(30),o=("undefined"==typeof window?e:window).deck||{};if(!o.Layer)throw new Error("@deck.gl/core is not found");t.exports=Object.assign(o,r)}).call(this,n(16))},,function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){var r=n(2);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e,n){var r=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(27),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";var n,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",u="object"==typeof t,f=e.regeneratorRuntime;if(f)u&&(t.exports=f);else{(f=e.regeneratorRuntime=u?t.exports:{}).wrap=x;var l="suspendedStart",p="suspendedYield",h="executing",y="completed",d={},v={};v[a]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(C([])));g&&g!==r&&o.call(g,a)&&(v=g);var b=O.prototype=_.prototype=Object.create(v);S.prototype=b.constructor=O,O.constructor=S,O[c]=S.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===S||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(b),t},f.awrap=function(t){return{__await:t}},P(A.prototype),A.prototype[s]=function(){return this},f.AsyncIterator=A,f.async=function(t,e,n,r){var o=new A(x(t,e,n,r));return f.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},P(b),b[c]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},f.values=C,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return s.type="throw",s.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),d}}}function x(t,e,n,r){var o=e&&e.prototype instanceof _?e:_,i=Object.create(o.prototype),a=new E(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===h)throw new Error("Generator is already running");if(r===y){if("throw"===o)throw i;return M()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var c=w(t,e,n);if("normal"===c.type){if(r=n.done?y:p,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=y,n.method="throw",n.arg=c.arg)}}}(t,n,a),i}function w(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function _(){}function S(){}function O(){}function P(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function A(t){var e;this._invoke=function(n,r){function i(){return new Promise(function(e,i){!function e(n,r,i,a){var s=w(t[n],t,r);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&o.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(u).then(function(t){c.value=t,i(c)},function(t){return e("throw",t,i,a)})}a(s.arg)}(n,r,e,i)})}return e=e?e.then(i,i):i()}}function T(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,T(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=w(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return i.next=i}}return{next:M}}function M(){return{value:n,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,i=Object.create(o.prototype),a=new T(r||[]);return i._invoke=function(t,e,n){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return L()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=O(a,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=u(t,e,n);if("normal"===c.type){if(r=n.done?h:l,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f="suspendedStart",l="suspendedYield",p="executing",h="completed",y={};function d(){}function v(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(k([])));x&&x!==n&&r.call(x,i)&&(g=x);var w=m.prototype=d.prototype=Object.create(g);function _(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function S(t){var e;this._invoke=function(n,o){function i(){return new Promise(function(e,i){!function e(n,o,i,a){var s=u(t[n],t,o);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?Promise.resolve(f.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(f).then(function(t){c.value=t,i(c)},function(t){return e("throw",t,i,a)})}a(s.arg)}(n,o,e,i)})}return e=e?e.then(i,i):i()}}function O(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method))return y;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=u(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function k(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:L}}function L(){return{value:e,done:!0}}return v.prototype=w.constructor=m,m.constructor=v,m[s]=v.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},_(S.prototype),S.prototype[a]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,o){var i=new S(c(e,n,r,o));return t.isGeneratorFunction(n)?i:i.next().then(function(t){return t.done?t.value:i.next()})},_(w),w[s]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=k,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,u=[],f=!1,l=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):l=-1,u.length&&h())}function h(){if(!f){var t=s(p);f=!0;for(var e=u.length;e;){for(c=u,u=[];++l<e;)c&&c[l].run();l=-1,e=u.length}c=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!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 y(t,e){this.fun=t,this.array=e}function d(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new y(t,e)),1!==u.length||f||s(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=d,o.addListener=d,o.once=d,o.off=d,o.removeListener=d,o.removeAllListeners=d,o.emit=d,o.prependListener=d,o.prependOnceListener=d,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";n.r(e);var r=n(9),o=n.n(r),i=n(10),a=n.n(i),s=n(11),c=n.n(s),u=n(2),f=n.n(u),l=n(7),p=n.n(l),h=n(12),y=n.n(h),d=n(3),v=n(1),m=n.n(v),g=n(0),b=n.n(g);function x(t,e,n,r,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,o)}function w(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){x(i,r,o,a,s,"next",t)}function s(t){x(i,r,o,a,s,"throw",t)}a(void 0)})}}var _=n(8);function S(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){S(t,e,n[e])})}return t}function P(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function T(t,e,n){return e&&A(t.prototype,e),n&&A(t,n),t}var k=n(5),L=n.n(k),E=n(14),C=n.n(E),M=n(15),j=n.n(M),N=n(19),R=n.n(N);function I(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var U=n(6),z=function(t){return t&&t instanceof ArrayBuffer},B=function(t){return t&&t instanceof Buffer};function D(t){if(z(t))return t;if(B(t))return new Uint8Array(t).buffer;if(ArrayBuffer.isView(t))return t.buffer;if("string"==typeof t){var e=t;return(new U.TextEncoder).encode(e).buffer}return I(!1)}function F(t){this.wrapped=t}function G(t){var e,n;function r(e,n){try{var i=t[e](n),a=i.value,s=a instanceof F;Promise.resolve(s?a.wrapped:a).then(function(t){s?r("next",t):o(i.done?"return":"normal",t)},function(t){r("throw",t)})}catch(t){o("throw",t)}}function o(t,o){switch(t){case"return":e.resolve({value:o,done:!0});break;case"throw":e.reject(o);break;default:e.resolve({value:o,done:!1})}(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(t,o){return new Promise(function(i,a){var s={key:t,arg:o,resolve:i,reject:a,next:null};n?n=n.next=s:(e=n=s,r(t,o))})},"function"!=typeof t.return&&(this.return=void 0)}function H(t){var e=new ArrayBuffer,n="";return new Promise(function(r,o){t.data(function(t){var r,o,i,a,s;"string"==typeof t?n+=t:(o=t,i=(r=e)instanceof ArrayBuffer?new Uint8Array(r):r,a=o instanceof ArrayBuffer?new Uint8Array(o):o,(s=new Uint8Array(i.byteLength+a.byteLength)).set(i,0),s.set(a,i.byteLength),e=s)}),t.on("error",function(t){return o(t)}),t.on("end",function(){t.complete?r(e||n):o("The connection was terminated while the message was still being sent")})})}function V(t){var e,n,r=t.indexOf(",");return";base64"===t.slice(r-7,r)?(e=new Buffer(t.slice(r+1),"base64"),n=t.slice(5,r-7).trim()):(e=new Buffer(decodeURIComponent(t.slice(r+1))),n=t.slice(5,r).trim()),n?";"===n[0]&&(n="text/plain".concat(n)):n="text/plain;charset=US-ASCII",{buffer:e,mimeType:n}}"function"==typeof Symbol&&Symbol.asyncIterator&&(G.prototype[Symbol.asyncIterator]=function(){return this}),G.prototype.next=function(t){return this._invoke("next",t)},G.prototype.throw=function(t){return this._invoke("throw",t)},G.prototype.return=function(t){return this._invoke("return",t)};var W={dataType:"arrayBuffer"},q=(Boolean(L.a&&L.a.readFile),function(t){return t.startsWith("data:")}),X=function(t){return t.startsWith("http:")||t.startsWith("https:")},Y=function(){function t(e){P(this,t),this.reponse=e}return T(t,[{key:"get",value:function(t){if(this.response.httpResponse)return this.response.httpResponse.getHeaders()[t];switch(t){case"Content-Length":return this._getContentLength()}}},{key:"_getContentLength",value:function(){return this._contentLength}}]),t}(),$=function(){function t(e,n){P(this,t),this.url=e,this.options=n,this.bodyUsed=!1,this._headers=null}return T(t,[{key:"arrayBuffer",value:function(){var t=w(b.a.mark(function t(){return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.bodyUsed=!0,t.abrupt("return",K(this.url,this.options));case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"text",value:function(){var t=w(b.a.mark(function t(){var e,n;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.arrayBuffer();case 2:return e=t.sent,n=new U.TextDecoder,t.abrupt("return",n.decode(e));case 5:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"json",value:function(){var t=w(b.a.mark(function t(){var e;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.text();case 2:return e=t.sent,t.abrupt("return",JSON.parse(e));case 4:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"_getHeaders",value:function(){return X(this.url)?new Y(this):q(this.url)?{"Content-Length":this.url.length}:X(this.repsonse.url)?{}:{"Content-Length":L.a.statSync(this.response.url).size}}},{key:"headers",get:function(){this._headers=this._headers||this._getHeaders()}},{key:"body",get:function(){var t=this.url,e=this.options;return this.bodyUsed=!0,tt(t,e)}}]),t}();function J(t,e){return Q.apply(this,arguments)}function Q(){return(Q=w(b.a.mark(function t(e,n){return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new $(e,n));case 1:case"end":return t.stop()}},t)}))).apply(this,arguments)}function K(t){return Z.apply(this,arguments)}function Z(){return(Z=w(b.a.mark(function t(e){var n,r,o,i=arguments;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=nt(n=i.length>1&&void 0!==i[1]?i[1]:{}),!q(e)){t.next=4;break}return t.abrupt("return",Promise.resolve(V(e)));case 4:if(!X(e)){t.next=6;break}return t.abrupt("return",new Promise(function(t,r){n=O({},new URL(e),n),(e.startsWith("https:")?j.a.request:C.a.request)(e,function(e){return H(e).then(t,r)})}));case 6:return r=R.a.promisify(L.a.readFile),t.next=9,r(e,n);case 9:return o=t.sent,t.abrupt("return",o instanceof Buffer?D(o):o);case 11:case"end":return t.stop()}},t)}))).apply(this,arguments)}function tt(t,e){return et.apply(this,arguments)}function et(){return(et=w(b.a.mark(function t(e,n){return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!q(e)){t.next=2;break}return t.abrupt("return",V(e));case 2:if(X(e)){t.next=4;break}return t.abrupt("return",L.a.createReadStream(e,n));case 4:return t.abrupt("return",new Promise(function(t,r){n=O({},new URL(e),n),(e.startsWith("https:")?j.a.request:C.a.request)(e,function(e){return t(e)})}));case 5:case"end":return t.stop()}},t)}))).apply(this,arguments)}function nt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(t=Object.assign({},W,t)).responseType=t.responseType||t.dataType,L.a&&(t.encoding=t.encoding||("text"===t.dataType?"utf8":null)),t}function rt(t,e){return ot.apply(this,arguments)}function ot(){return(ot=w(b.a.mark(function t(e,n){return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e,n);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}))).apply(this,arguments)}var it="",at={};function st(t){for(var e in at)if(t.startsWith(e)){var n=at[e];return t.replace(e,n)}return t+=it}function ct(t,e){return ut.apply(this,arguments)}function ut(){return(ut=w(b.a.mark(function t(e,n){var r;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=st(e),r=_.a?rt:J,t.abrupt("return",r(e,n));case 3:case"end":return t.stop()}},t)}))).apply(this,arguments)}function ft(t){return!!t&&(Array.isArray(t)&&(t=t[0]),t.parseTextSync||t.parseSync||t.parse||t.loadAndParse||t.parseStream||t.parseInBatches||t.worker)}function lt(t){var e;return I(ft(t)),Array.isArray(t)&&(e=(t=t[0])[1],t=O({},t,{options:O({},t.options,{options:e})})),t.extension&&(t.extensions=t.extensions||[t.extension],delete t.extension),Array.isArray(t.extensions)||(t.extensions=[t.extensions]),I(t.extensions&&t.extensions.length>0&&t.extensions[0]),t.parseTextSync&&(t.text=!0),t.text||(t.binary=!0),t}var pt=/[^\.]+$/;function ht(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=t.match(pt);if(r&&r[0]){var o=function(t,e){e=e.toLowerCase();var n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;lt(s);var c=!0,u=!1,f=void 0;try{for(var l,p=s.extensions[Symbol.iterator]();!(c=(l=p.next()).done);c=!0){var h=l.value;if(h.toLowerCase()===e)return s}}catch(t){u=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(u)throw f}}}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return null}(n,r[0]);if(o)return o}var i=function(t,e){var n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;if(s.testText&&s.testText(e))return s}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return null}(n,e);return i||null}var yt=function(){function t(){P(this,t)}return T(t,[{key:"log",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}}]),t}(),dt={};function vt(){return Object.values(dt)}var mt=new Map;function gt(t,e,n){var r=function(t){var e=mt.get(t);if(!e){var n=new Blob([t],{type:"application/javascript"});e=URL.createObjectURL(n),mt.set(t,e)}return new Worker(e)}(t);n=function(t){null!==(t=Object.assign({},t)).log&&delete t.log;return t}(n);var o=function(t,e){return new Promise(function(n,o){r.onmessage=function(t){switch(t.data.type){case"done":n(t.data.result),r.terminate();break;case"error":o(new Error(t.data.message))}};var i=D(t);r.postMessage({arraybuffer:i,opts:e},[i])})};return e?o(e,n):o}n(13);var bt=function(t){return"undefined"!=typeof window&&t instanceof window.Response||t.arrayBuffer&&t.json&&t.body},xt="Cannot convert supplied data type";function wt(t){return bt(t)?t.url:null}function _t(t,e){if(e.text&&"string"==typeof t)return t;if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){var n=t.buffer||t;return e.text&&!e.binary?new U.TextDecoder("utf8").decode(n):n}throw new Error(xt)}function St(t,e){return Ot.apply(this,arguments)}function Ot(){return(Ot=w(b.a.mark(function t(e,n){var r;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:if(e=t.sent,r=e instanceof ArrayBuffer||ArrayBuffer.isView(e),"string"!=typeof e&&!r){t.next=6;break}return t.abrupt("return",_t(e,n));case 6:if(!bt(e)){t.next=15;break}if(!n.binary){t.next=13;break}return t.next=10,e.arrayBuffer();case 10:t.t0=t.sent,t.next=14;break;case 13:t.t0=e.text();case 14:return t.abrupt("return",t.t0);case 15:throw new Error(xt);case 16:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Pt(t,e){return At.apply(this,arguments)}function At(){return(At=w(b.a.mark(function t(e,n){var r,o,i=arguments;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},o=(o=i.length>3?i[3]:void 0)||wt(e),t.next=5,St(e,n);case 5:if(e=t.sent,!n.parseTextSync||"string"!=typeof e){t.next=9;break}return r.dataType="text",t.abrupt("return",n.parseTextSync(e,r,o,n));case 9:if(!n.parseSync){t.next=11;break}return t.abrupt("return",n.parseSync(e,r,o,n));case 11:if(!n.parse){t.next=15;break}return t.next=14,n.parse(e,r,o,n);case 14:return t.abrupt("return",t.sent);case 15:if(!n.worker){t.next=19;break}return t.next=18,gt(n.worker,e,r);case 18:return t.abrupt("return",t.sent);case 19:return t.abrupt("return",I(!1));case 20:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Tt(t,e,n,r){return kt.apply(this,arguments)}function kt(){return(kt=w(b.a.mark(function t(e,n,r,o){var i;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(Array.isArray(n)||ft(n)||(o=r,r=n,n=null),n=n||vt(),i=Array.isArray(n)?ht(o,e,n):n){t.next=5;break}return t.abrupt("return",null);case 5:return lt(i),r=Lt(r,i),t.next=9,Pt(e,i,r,o);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Lt(t,e){return null===(t=Object.assign({},e.DEFAULT_OPTIONS,e.options,t,{dataType:"arraybuffer"})).log&&(t.log=new yt),"log"in t||(t.log=console),t}function Et(t,e,n){return Ct.apply(this,arguments)}function Ct(){return(Ct=w(b.a.mark(function t(e,n,r){var o,i;return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(Array.isArray(n)||ft(n)||(r=n,n=null),n=n||vt(),!(o=Array.isArray(n)?ht(e,null,n):n)||!o.loadAndParse){t.next=7;break}return t.next=6,o.loadAndParse(e,r);case 6:return t.abrupt("return",t.sent);case 7:return t.next=9,ct(e,r);case 9:return i=t.sent,t.abrupt("return",Tt(i,n,r,e));case 11:case"end":return t.stop()}},t)}))).apply(this,arguments)}var Mt=n(4),jt=n.n(Mt);function Nt(t,e,n,r,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,o)}function Rt(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){Nt(i,r,o,a,s,"next",t)}function s(t){Nt(i,r,o,a,s,"throw",t)}a(void 0)})}}var It=n(17),Ut=n.n(It),zt=n(18),Bt=n.n(zt);function Dt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Ft(t){return Buffer.isBuffer(t)?new Uint8Array(t).buffer:t}var Gt=!1,Ht=!0,Vt=new Map([["image/png",function(t){var e=Yt(t);if(e.byteLength<24||2303741511!==e.getUint32(0,Gt))return null;return{width:e.getUint32(16,Gt),height:e.getUint32(20,Gt)}}],["image/jpeg",function(t){var e=Yt(t);if(e.byteLength<2||65496!==e.getUint16(0,Gt))return null;var n=function(){for(var t=new Set([65499,65476,65484,65501,65534]),e=65504;e<65520;++e)t.add(e);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:n}}(),r=n.tableMarkers,o=n.sofMarkers,i=2;for(;i<e.byteLength;){var a=e.getUint16(i,Gt);if(o.has(a))return{height:e.getUint16(i+5,Gt),width:e.getUint16(i+7,Gt)};if(!r.has(a))return null;i+=2,i+=e.getUint16(i,Gt)}return null}],["image/gif",function(t){var e=Yt(t);if(e.byteLength<10||1195984440!==e.getUint32(0,Gt))return null;return{width:e.getUint16(6,Ht),height:e.getUint16(8,Ht)}}],["image/bmp",function(t){var e=Yt(t);if(16973!==e.getUint16(0,Gt))return null;return{width:e.getUint32(18,Ht),height:e.getUint32(22,Ht)}}]]),Wt="Invalid MIME type. Supported MIME types are: ".concat(Array.from(Vt.keys()).join(", "));function qt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){var n=Vt.get(e);if(!n)throw new Error(Wt);var r=n(t);if(!r)throw new Error("invalid image data for type: ".concat(e));return r}var o=Xt(t,e);if(!o)throw new Error(Wt);return o}function Xt(t,e){var n=!0,r=!1,o=void 0;try{for(var i,a=Vt.entries()[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=Dt(i.value,2),c=s[0],u=(0,s[1])(t);if(u)return u.mimeType=c,u}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return null}function Yt(t){if(Ft&&(t=Ft(t)),t instanceof ArrayBuffer||ArrayBuffer.isView(t))return new DataView(t.buffer||t);throw new Error("toDataView")}function $t(t,e){return Jt.apply(this,arguments)}function Jt(){return(Jt=Rt(jt.a.mark(function t(e,n){var r,o,i,a,s;return jt.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=Bt.a.promisify(Ut.a),o=qt(e),i=o.mimeType,a=e instanceof Buffer?e:Buffer.from(e),t.next=5,r(a,i);case 5:return s=t.sent,t.abrupt("return",{width:s.shape[0],height:s.shape[1],data:s.data});case 7:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Qt(t,e){return $t?$t(t,e):function(t){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var e=new Blob([new Uint8Array(t)]);return createImageBitmap(e)}(t)}function Kt(){return(Kt=Rt(jt.a.mark(function t(e,n){var r,o;return jt.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"!=typeof Image){t.next=8;break}return t.next=3,fetch(e,n);case 3:return r=t.sent,t.next=6,r.arrayBuffer();case 6:return o=t.sent,t.abrupt("return",Qt(o));case 8:return t.next=10,Zt(e,n);case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Zt(t,e){return te.apply(this,arguments)}function te(){return(te=Rt(jt.a.mark(function t(e,n){var r,o,i;return jt.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!/\.svg((\?|#).*)?$/.test(e)){t.next=10;break}return t.next=3,fetch(e,n);case 3:return o=t.sent,t.next=6,o.text();case 6:i=t.sent,r="data:image/svg+xml;base64,".concat(btoa(i)),t.next=13;break;case 10:return t.next=12,e;case 12:r=t.sent;case 13:return t.next=15,new Promise(function(t,o){try{var i=new Image;i.onload=function(){return t(i)},i.onerror=function(t){return o(new Error("Could not load image ".concat(e,": ").concat(t)))},i.crossOrigin=n&&n.crossOrigin||"anonymous",i.src=r}catch(t){o(t)}});case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}},t)}))).apply(this,arguments)}var ee=Math.PI/180,ne=new Float32Array(16),re=new Float32Array(12);function oe(t,e,n){var r=e[0]*ee,o=e[1]*ee,i=e[2]*ee,a=Math.sin(i),s=Math.sin(r),c=Math.sin(o),u=Math.cos(i),f=Math.cos(r),l=Math.cos(o),p=n[0],h=n[1],y=n[2];t[0]=p*l*f,t[1]=p*c*f,t[2]=p*-s,t[3]=h*(-c*u+l*s*a),t[4]=h*(l*u+c*s*a),t[5]=h*f*a,t[6]=y*(c*a+l*s*u),t[7]=y*(-l*a+c*s*u),t[8]=y*f*u}function ie(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}var ae={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(t,e){var n=e.startRow,r=e.endRow,o=this.props,i=o.data,a=o.getOrientation,s=o.getScale,c=o.getTranslation,u=o.getTransformMatrix,f=Array.isArray(u),l=f&&16===u.length,p=Array.isArray(s),h=Array.isArray(a),y=Array.isArray(c),v=l||!f&&Boolean(u(i[0]));t.constant=v?l:h&&p&&y;var m=t.value;if(t.constant){var g;if(v)ne.set(u),g=ie(ne);else oe(g=re,a,s),g.set(c,9);t.value=new Float32Array(g)}else{var b=n*t.size,x=Object(d.createIterable)(i,n,r),w=x.iterable,_=x.objectInfo,S=!0,O=!1,P=void 0;try{for(var A,T=w[Symbol.iterator]();!(S=(A=T.next()).done);S=!0){var k=A.value;_.index++;var L=void 0;if(v)ne.set(l?u:u(k,_)),L=ie(ne);else oe(L=re,h?a:a(k,_),p?s:s(k,_)),L.set(y?c:c(k,_),9);m[b++]=L[0],m[b++]=L[1],m[b++]=L[2],m[b++]=L[3],m[b++]=L[4],m[b++]=L[5],m[b++]=L[6],m[b++]=L[7],m[b++]=L[8],m[b++]=L[9],m[b++]=L[10],m[b++]=L[11]}}catch(t){O=!0,P=t}finally{try{S||null==T.return||T.return()}finally{if(O)throw P}}}}},se=v.fp64.fp64LowPart;function ce(t,e,n){return"string"==typeof e?function(t,e){return Kt.apply(this,arguments)}(e).then(function(e){return ue(t,e,n)}).catch(function(t){throw new Error("Could not load texture from ".concat(e,": ").concat(t))}):new Promise(function(r){return r(ue(t,e,n))})}function ue(t,e,n){return e instanceof v.Texture2D?e:new v.Texture2D(t,Object.assign({data:e},n))}function fe(t){!function(t,e){if(!t)throw new Error("deck.gl: ".concat(e))}(t.positions||t.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function le(t){if(t.attributes)return fe(t.attributes),t instanceof v.Geometry?t:new v.Geometry(t);if(t.positions||t.POSITION)return fe(t),new v.Geometry({attributes:t});throw Error("Invalid mesh")}var pe=new v.PhongMaterial,he={fetch:function(t){function e(e,n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t,e){return"mesh"===e.propName?Et(t):fetch(t).then(function(t){return t.json()})}),mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:m.a.LEQUAL},fp64:!1,wireframe:!1,material:pe,getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},ye=function(t){function e(){return o()(this,e),c()(this,f()(e).apply(this,arguments))}return y()(e,t),a()(e,[{key:"getShaders",value:function(){var t=this.use64bitProjection()?"project64":"project32",e=Object(v.isWebGL2)(this.context.gl);return{vs:e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\n\n// Instance attributes\nin vec3 instancePositions;\nin vec2 instancePositions64xy;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\n\n// Outputs to fragment shader\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n picking_setPickingColor(instancePickingColors);\n}\n",fs:e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor / 255., color.a);\n\n // use highlight color if this fragment belongs to the selected object.\n fragColor = picking_filterHighlightColor(fragColor);\n\n // use picking color if rendering to picking FBO.\n fragColor = picking_filterPickingColor(fragColor);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor / 255., color.a);\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[t,"phong-lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,size:3,accessor:"getPosition"},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{transition:!0,size:4,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:ae}),this.setState({emptyTexture:new v.Texture2D(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(t){var n=t.props,r=t.oldProps,o=t.changeFlags;if(p()(f()(e.prototype),"updateState",this).call(this,{props:n,oldProps:r,changeFlags:o}),n.mesh!==r.mesh||n.fp64!==r.fp64){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var i=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(i.NORMAL||i.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==r.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?m.a.LINE_STRIP:m.a.TRIANGLES)}},{key:"finalizeState",value:function(){p()(f()(e.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(t){var e=t.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},e,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(t){var e=new v.Model(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:le(t),isInstanced:!0,shaderCache:this.context.shaderCache}));return this.state.texture?e.setUniforms({sampler:this.state.texture,hasTexture:1}):e.setUniforms({sampler:this.state.emptyTexture,hasTexture:0}),e}},{key:"setTexture",value:function(t){var e=this,n=this.context.gl,r=this.state.emptyTexture;this.state.texture&&this.state.texture.delete(),t?ce(n,t).then(function(t){e.setState({texture:t}),e.state.model&&e.state.model.setUniforms({sampler:e.state.texture,hasTexture:1})}):(this.setState({texture:null}),this.state.model&&this.state.model.setUniforms({sampler:r,hasTexture:0}))}},{key:"calculateInstancePositions64xyLow",value:function(t,e){var n=e.startRow,r=e.endRow,o=this.use64bitPositions();if(t.constant=!o,o){var i=this.props,a=i.data,s=i.getPosition,c=t.value,u=n*t.size,f=Object(d.createIterable)(a,n,r),l=f.iterable,p=f.objectInfo,h=!0,y=!1,v=void 0;try{for(var m,g=l[Symbol.iterator]();!(h=(m=g.next()).done);h=!0){var b=m.value;p.index++;var x=s(b,p);c[u++]=se(x[0]),c[u++]=se(x[1])}}catch(t){y=!0,v=t}finally{try{h||null==g.return||g.return()}finally{if(y)throw v}}}else t.value=new Float32Array(2)}}]),e}(d.Layer);ye.layerName="SimpleMeshLayer",ye.defaultProps=he;var de=v.fp64.fp64LowPart,ve=[255,255,255,255],me={scenegraph:{type:"object",value:null,async:!0},fetch:function(t){function e(e,n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t,e){var n=e.propName,r=e.layer;return"scenegraph"===n?Et(t,r.getLoadOptions()):fetch(t).then(function(t){return t.json()})}),getScene:function(t){return t&&t.scenes?t.scenes[0]:t},getAnimator:function(t){return t&&t.animator},sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:ve},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},ge=function(t){function e(){return o()(this,e),c()(this,f()(e).apply(this,arguments))}return y()(e,t),a()(e,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,accessor:"getPosition",transition:!0},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{size:4,accessor:"getColor",defaultValue:ve,transition:!0},instanceModelMatrix:ae})}},{key:"calculateInstancePositions64xyLow",value:function(t,e){var n=e.startRow,r=e.endRow,o=this.use64bitPositions();if(t.constant=!o,o){var i=this.props,a=i.data,s=i.getPosition,c=t.value,u=n*t.size,f=Object(d.createIterable)(a,n,r),l=f.iterable,p=f.objectInfo,h=!0,y=!1,v=void 0;try{for(var m,g=l[Symbol.iterator]();!(h=(m=g.next()).done);h=!0){var b=m.value;p.index++;var x=s(b,p);c[u++]=de(x[0]),c[u++]=de(x[1])}}catch(t){y=!0,v=t}finally{try{h||null==g.return||g.return()}finally{if(y)throw v}}}else t.value=new Float32Array(2)}},{key:"updateState",value:function(t){p()(f()(e.prototype),"updateState",this).call(this,t);var n=t.props,r=t.oldProps;if(n.scenegraph!==r.scenegraph){var o=n.getScene(n.scenegraph),i=n.getAnimator(n.scenegraph);o instanceof v.ScenegraphNode?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,i,n._animations),this.setState({scenegraph:o,animator:i})):null!==o&&v.log.warn("invalid scenegraph:",o)()}else n._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){this._deleteScenegraph()}},{key:"_applyAllAttributes",value:function(t){var e=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();t.traverse(function(t){e._setModelAttributes(t.model,n)})}}},{key:"_applyAnimationsProp",value:function(t,e,n){if(t&&e&&n){var r=e.getAnimations();Object.keys(n).forEach(function(t){var e=n[t];if("*"===t)r.forEach(function(t){Object.assign(t,e)});else if(Number.isFinite(Number(t))){var o=Number(t);o>=0&&o<r.length?Object.assign(r[o],e):v.log.warn("animation ".concat(t," not found"))()}else{var i=r.find(function(e){return e.name===t});i?Object.assign(i,e):v.log.warn("animation ".concat(t," not found"))()}})}}},{key:"_deleteScenegraph",value:function(){var t=this.state.scenegraph;t instanceof v.ScenegraphNode&&t.delete()}},{key:"addVersionToShader",value:function(t){return Object(v.isWebGL2)(this.context.gl)?"#version 300 es\n".concat(t):t}},{key:"getLoadOptions",value:function(){var t=["project32","picking"],e=this.props,n=e._lighting,r=e._imageBasedLightingEnvironment;"pbr"===n&&t.push(v.pbr);var o=null;return r&&(o="function"==typeof r?r({gl:this.context.gl,layer:this}):r),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:o,modelOptions:{vs:this.addVersionToShader("#if (__VERSION__ < 300)\n #define _attribute attribute\n #define _varying varying\n#else\n #define _attribute in\n#define _varying out\n#endif\n\n// Instance attributes\n_attribute vec3 instancePositions;\n_attribute vec2 instancePositions64xy;\n_attribute vec4 instanceColors;\n_attribute vec3 instancePickingColors;\n_attribute mat3 instanceModelMatrix;\n_attribute vec3 instanceTranslation;\n\n// Uniforms\nuniform float sizeScale;\nuniform mat4 sceneModelMatrix;\n\n// Attributes\n_attribute vec4 POSITION;\n\n#ifdef HAS_UV\n _attribute vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n _attribute vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attribute vec4 TANGENT;\n #endif\n#endif\n\n// Varying\n// MODULE_PBR contains all the varying definitions needed\n#ifndef MODULE_PBR\n _varying vec4 vColor;\n\n #ifdef HAS_UV\n _varying vec2 vTEXCOORD_0;\n #endif\n#endif\n\n// Utils\n#if defined(HAS_NORMALS) && defined(MODULE_PBR)\n vec3 getProjectedNormal() {\n return project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n }\n#endif\n\n\n// Main\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n #endif\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n #ifdef MODULE_PBR\n // set PBR data\n pbr_vPosition = position_commonspace.xyz;\n\n #ifdef HAS_NORMALS\n #ifdef HAS_TANGENTS___TODO_FIX_ME___\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(NORMAL.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(TANGENT.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * TANGENT.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n #else // HAS_TANGENTS != 1\n // pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(NORMAL.xyz, 0.0)));\n // TODO: Check this\n pbr_vNormal = getProjectedNormal();\n #endif\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n #else\n // Flat shading\n vColor = instanceColors / 255.0;\n #endif\n\n picking_setPickingColor(instancePickingColors);\n}\n"),fs:this.addVersionToShader("#if (__VERSION__ < 300)\n #define _varying varying\n #define _texture2D texture2D\n #define fragmentColor gl_FragColor\n#else\n #define _varying in\n #define _texture2D texture\n out vec4 fragmentColor;\n#endif\n\n// Uniforms\n// none\n\n// Varying\n// MODULE_PBR contains all the varying definitions needed\n#ifndef MODULE_PBR\n _varying vec4 vColor;\n\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n _varying vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = pbr_filterColor(vec4(0));\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * _texture2D(u_BaseColorSampler, vTEXCOORD_0);\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor = picking_filterPickingColor(fragmentColor);\n}\n"),modules:t,isInstanced:!0}}}},{key:"updateAttributes",value:function(t){var n=this;if(p()(f()(e.prototype),"updateAttributes",this).call(this,t),this.setState({attributesAvailable:!0}),this.state.scenegraph){var r=this.getAttributeManager().getChangedAttributes({clearChangedFlags:!0});this.state.scenegraph.traverse(function(t){n._setModelAttributes(t.model,r)})}}},{key:"draw",value:function(t){var e=t.moduleParameters,n=void 0===e?null:e,r=t.parameters,o=void 0===r?{}:r,i=t.context;if(this.state.scenegraph){this.props._animations&&this.state.animator&&this.state.animator.animate(i.animationProps.time);var a=this.props.sizeScale,s=this.getNumInstances();this.state.scenegraph.traverse(function(t,e){var r=e.worldMatrix;t.model.setInstanceCount(s),t.updateModuleSettings(n),t.draw({parameters:o,uniforms:{sizeScale:a,sceneModelMatrix:r,u_Camera:t.model.program.uniforms.project_uCameraPosition}})})}}}]),e}(d.Layer);ge.layerName="ScenegraphLayer",ge.defaultProps=me,n.d(e,"SimpleMeshLayer",function(){return ye}),n.d(e,"ScenegraphLayer",function(){return ge})}])});

@@ -7,4 +7,4 @@ "use strict";

exports.default = void 0;
var _default = "#ifdef HAS_UV\n varying vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n#endif\nvarying vec4 vColor;\n\nvoid main(void) {\n #ifdef HAS_UV\n gl_FragColor = (vColor / 255.) * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n #else\n gl_FragColor = vColor / 255.;\n #endif\n\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n";
var _default = "#if (__VERSION__ < 300)\n #define _varying varying\n #define _texture2D texture2D\n #define fragmentColor gl_FragColor\n#else\n #define _varying in\n #define _texture2D texture\n out vec4 fragmentColor;\n#endif\n#ifndef MODULE_PBR\n _varying vec4 vColor;\n\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n _varying vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = pbr_filterColor(vec4(0));\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * _texture2D(u_BaseColorSampler, vTEXCOORD_0);\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor = picking_filterPickingColor(fragmentColor);\n}\n";
exports.default = _default;
//# sourceMappingURL=scenegraph-layer-fragment.glsl.js.map

@@ -7,4 +7,4 @@ "use strict";

exports.default = void 0;
var _default = "\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\nuniform float sizeScale;\nuniform mat4 sceneModelMatrix;\nattribute vec4 POSITION;\n\n#ifdef HAS_UV\n attribute vec2 TEXCOORD_0;\n varying vec2 vTEXCOORD_0;\n#endif\nvarying vec4 vColor;\n\nvoid main(void) {\n #ifdef HAS_UV\n vTEXCOORD_0 = TEXCOORD_0;\n #endif\n vColor = instanceColors;\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n picking_setPickingColor(instancePickingColors);\n}\n";
var _default = "#if (__VERSION__ < 300)\n #define _attribute attribute\n #define _varying varying\n#else\n #define _attribute in\n#define _varying out\n#endif\n_attribute vec3 instancePositions;\n_attribute vec2 instancePositions64xy;\n_attribute vec4 instanceColors;\n_attribute vec3 instancePickingColors;\n_attribute mat3 instanceModelMatrix;\n_attribute vec3 instanceTranslation;\nuniform float sizeScale;\nuniform mat4 sceneModelMatrix;\n_attribute vec4 POSITION;\n\n#ifdef HAS_UV\n _attribute vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n _attribute vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attribute vec4 TANGENT;\n #endif\n#endif\n#ifndef MODULE_PBR\n _varying vec4 vColor;\n\n #ifdef HAS_UV\n _varying vec2 vTEXCOORD_0;\n #endif\n#endif\n#if defined(HAS_NORMALS) && defined(MODULE_PBR)\n vec3 getProjectedNormal() {\n return project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n }\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n #endif\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n #ifdef MODULE_PBR\n pbr_vPosition = position_commonspace.xyz;\n\n #ifdef HAS_NORMALS\n #ifdef HAS_TANGENTS___TODO_FIX_ME___\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(NORMAL.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(TANGENT.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * TANGENT.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n #else\n pbr_vNormal = getProjectedNormal();\n #endif\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n #else\n vColor = instanceColors / 255.0;\n #endif\n\n picking_setPickingColor(instancePickingColors);\n}\n";
exports.default = _default;
//# sourceMappingURL=scenegraph-layer-vertex.glsl.js.map

@@ -85,2 +85,4 @@ "use strict";

},
_lighting: 'flat',
_imageBasedLightingEnvironment: null,
getOrientation: {

@@ -138,3 +140,5 @@ type: 'accessor',

key: "calculateInstancePositions64xyLow",
value: function calculateInstancePositions64xyLow(attribute) {
value: function calculateInstancePositions64xyLow(attribute, _ref2) {
var startRow = _ref2.startRow,
endRow = _ref2.endRow;
var isFP64 = this.use64bitPositions();

@@ -151,4 +155,10 @@ attribute.constant = !isFP64;

getPosition = _this$props.getPosition;
var value = attribute.value;
var i = 0;
var value = attribute.value,
size = attribute.size;
var i = startRow * size;
var _createIterable = (0, _core.createIterable)(data, startRow, endRow),
iterable = _createIterable.iterable,
objectInfo = _createIterable.objectInfo;
var _iteratorNormalCompletion = true;

@@ -159,5 +169,6 @@ var _didIteratorError = false;

try {
for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
for (var _iterator = iterable[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var point = _step.value;
var position = getPosition(point);
objectInfo.index++;
var position = getPosition(point, objectInfo);
value[i++] = fp64LowPart(position[0]);

@@ -220,6 +231,8 @@ value[i++] = fp64LowPart(position[1]);

var allAttributes = this.getAttributeManager().getAttributes();
scenegraph.traverse(function (model) {
_this._setModelAttributes(model.model, allAttributes);
});
if (this.state.attributesAvailable) {
var allAttributes = this.getAttributeManager().getAttributes();
scenegraph.traverse(function (model) {
_this._setModelAttributes(model.model, allAttributes);
});
}
}

@@ -250,4 +263,4 @@ }, {

} else {
var findResult = animations.find(function (_ref2) {
var name = _ref2.name;
var findResult = animations.find(function (_ref3) {
var name = _ref3.name;
return name === key;

@@ -274,11 +287,43 @@ });

}, {
key: "addVersionToShader",
value: function addVersionToShader(source) {
if ((0, _core2.isWebGL2)(this.context.gl)) {
return "#version 300 es\n".concat(source);
}
return source;
}
}, {
key: "getLoadOptions",
value: function getLoadOptions() {
var modules = ['project32', 'picking'];
var _this$props2 = this.props,
_lighting = _this$props2._lighting,
_imageBasedLightingEnvironment = _this$props2._imageBasedLightingEnvironment;
if (_lighting === 'pbr') {
modules.push(_core2.pbr);
}
var env = null;
if (_imageBasedLightingEnvironment) {
if (typeof _imageBasedLightingEnvironment === 'function') {
env = _imageBasedLightingEnvironment({
gl: this.context.gl,
layer: this
});
} else {
env = _imageBasedLightingEnvironment;
}
}
return {
gl: this.context.gl,
waitForFullLoad: true,
imageBasedLightingEnvironment: env,
modelOptions: {
vs: _scenegraphLayerVertex.default,
fs: _scenegraphLayerFragment.default,
modules: ['project32', 'picking'],
vs: this.addVersionToShader(_scenegraphLayerVertex.default),
fs: this.addVersionToShader(_scenegraphLayerFragment.default),
modules: modules,
isInstanced: true

@@ -294,2 +339,5 @@ }

(0, _get2.default)((0, _getPrototypeOf2.default)(ScenegraphLayer.prototype), "updateAttributes", this).call(this, props);
this.setState({
attributesAvailable: true
});
if (!this.state.scenegraph) return;

@@ -306,8 +354,8 @@ var attributeManager = this.getAttributeManager();

key: "draw",
value: function draw(_ref3) {
var _ref3$moduleParameter = _ref3.moduleParameters,
moduleParameters = _ref3$moduleParameter === void 0 ? null : _ref3$moduleParameter,
_ref3$parameters = _ref3.parameters,
parameters = _ref3$parameters === void 0 ? {} : _ref3$parameters,
context = _ref3.context;
value: function draw(_ref4) {
var _ref4$moduleParameter = _ref4.moduleParameters,
moduleParameters = _ref4$moduleParameter === void 0 ? null : _ref4$moduleParameter,
_ref4$parameters = _ref4.parameters,
parameters = _ref4$parameters === void 0 ? {} : _ref4$parameters,
context = _ref4.context;
if (!this.state.scenegraph) return;

@@ -321,4 +369,4 @@

var numInstances = this.getNumInstances();
this.state.scenegraph.traverse(function (model, _ref4) {
var worldMatrix = _ref4.worldMatrix;
this.state.scenegraph.traverse(function (model, _ref5) {
var worldMatrix = _ref5.worldMatrix;
model.model.setInstanceCount(numInstances);

@@ -330,3 +378,4 @@ model.updateModuleSettings(moduleParameters);

sizeScale: sizeScale,
sceneModelMatrix: worldMatrix
sceneModelMatrix: worldMatrix,
u_Camera: model.model.program.uniforms.project_uCameraPosition
}

@@ -333,0 +382,0 @@ });

@@ -346,3 +346,5 @@ "use strict";

key: "calculateInstancePositions64xyLow",
value: function calculateInstancePositions64xyLow(attribute) {
value: function calculateInstancePositions64xyLow(attribute, _ref4) {
var startRow = _ref4.startRow,
endRow = _ref4.endRow;
var isFP64 = this.use64bitPositions();

@@ -359,6 +361,7 @@ attribute.constant = !isFP64;

getPosition = _this$props.getPosition;
var value = attribute.value;
var i = 0;
var value = attribute.value,
size = attribute.size;
var i = startRow * size;
var _createIterable = (0, _core.createIterable)(data),
var _createIterable = (0, _core.createIterable)(data, startRow, endRow),
iterable = _createIterable.iterable,

@@ -365,0 +368,0 @@ objectInfo = _createIterable.objectInfo;

@@ -79,3 +79,5 @@ "use strict";

},
update: function update(attribute) {
update: function update(attribute, _ref) {
var startRow = _ref.startRow,
endRow = _ref.endRow;
var _this$props = this.props,

@@ -118,5 +120,5 @@ data = _this$props.data,

} else {
var i = 0;
var i = startRow * attribute.size;
var _createIterable = (0, _core.createIterable)(data),
var _createIterable = (0, _core.createIterable)(data, startRow, endRow),
iterable = _createIterable.iterable,

@@ -123,0 +125,0 @@ objectInfo = _createIterable.objectInfo;

export default `\
#ifdef HAS_UV
varying vec2 vTEXCOORD_0;
uniform sampler2D u_BaseColorSampler;
#if (__VERSION__ < 300)
#define _varying varying
#define _texture2D texture2D
#define fragmentColor gl_FragColor
#else
#define _varying in
#define _texture2D texture
out vec4 fragmentColor;
#endif
varying vec4 vColor;
// Uniforms
// none
// Varying
// MODULE_PBR contains all the varying definitions needed
#ifndef MODULE_PBR
_varying vec4 vColor;
#if defined(HAS_UV) && defined(HAS_BASECOLORMAP)
_varying vec2 vTEXCOORD_0;
uniform sampler2D u_BaseColorSampler;
#endif
#endif
void main(void) {
#ifdef HAS_UV
gl_FragColor = (vColor / 255.) * texture2D(u_BaseColorSampler, vTEXCOORD_0);
#ifdef MODULE_PBR
fragmentColor = pbr_filterColor(vec4(0));
#else
gl_FragColor = vColor / 255.;
#if defined(HAS_UV) && defined(HAS_BASECOLORMAP)
fragmentColor = vColor * _texture2D(u_BaseColorSampler, vTEXCOORD_0);
#else
fragmentColor = vColor;
#endif
#endif
gl_FragColor = picking_filterPickingColor(gl_FragColor);
fragmentColor = picking_filterPickingColor(fragmentColor);
}
`;
//# sourceMappingURL=scenegraph-layer-fragment.glsl.js.map
export default `\
#if (__VERSION__ < 300)
#define _attribute attribute
#define _varying varying
#else
#define _attribute in
#define _varying out
#endif
// Instance attributes
attribute vec3 instancePositions;
attribute vec2 instancePositions64xy;
attribute vec4 instanceColors;
attribute vec3 instancePickingColors;
attribute mat3 instanceModelMatrix;
attribute vec3 instanceTranslation;
_attribute vec3 instancePositions;
_attribute vec2 instancePositions64xy;
_attribute vec4 instanceColors;
_attribute vec3 instancePickingColors;
_attribute mat3 instanceModelMatrix;
_attribute vec3 instanceTranslation;

@@ -15,15 +23,41 @@ // Uniforms

// Attributes
attribute vec4 POSITION;
_attribute vec4 POSITION;
#ifdef HAS_UV
attribute vec2 TEXCOORD_0;
varying vec2 vTEXCOORD_0;
_attribute vec2 TEXCOORD_0;
#endif
varying vec4 vColor;
#ifdef MODULE_PBR
#ifdef HAS_NORMALS
_attribute vec4 NORMAL;
#endif
#ifdef HAS_TANGENTS
_attribute vec4 TANGENT;
#endif
#endif
// Varying
// MODULE_PBR contains all the varying definitions needed
#ifndef MODULE_PBR
_varying vec4 vColor;
#ifdef HAS_UV
_varying vec2 vTEXCOORD_0;
#endif
#endif
// Utils
#if defined(HAS_NORMALS) && defined(MODULE_PBR)
vec3 getProjectedNormal() {
return project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);
}
#endif
// Main
void main(void) {
#ifdef HAS_UV
#if defined(HAS_UV) && !defined(MODULE_PBR)
vTEXCOORD_0 = TEXCOORD_0;
#endif
vColor = instanceColors;

@@ -35,2 +69,30 @@ vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale + instanceTranslation;

gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);
#ifdef MODULE_PBR
// set PBR data
pbr_vPosition = position_commonspace.xyz;
#ifdef HAS_NORMALS
#ifdef HAS_TANGENTS___TODO_FIX_ME___
vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(NORMAL.xyz, 0.0)));
vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(TANGENT.xyz, 0.0)));
vec3 bitangentW = cross(normalW, tangentW) * TANGENT.w;
pbr_vTBN = mat3(tangentW, bitangentW, normalW);
#else // HAS_TANGENTS != 1
// pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(NORMAL.xyz, 0.0)));
// TODO: Check this
pbr_vNormal = getProjectedNormal();
#endif
#endif
#ifdef HAS_UV
pbr_vUV = TEXCOORD_0;
#else
pbr_vUV = vec2(0., 0.);
#endif
#else
// Flat shading
vColor = instanceColors / 255.0;
#endif
picking_setPickingColor(instancePickingColors);

@@ -37,0 +99,0 @@ }

@@ -1,3 +0,3 @@

import { Layer } from '@deck.gl/core';
import { fp64, ScenegraphNode, log } from '@luma.gl/core';
import { Layer, createIterable } from '@deck.gl/core';
import { fp64, ScenegraphNode, isWebGL2, pbr, log } from '@luma.gl/core';
import { load } from '@loaders.gl/core';

@@ -50,2 +50,4 @@ import { MATRIX_ATTRIBUTES } from '../utils/matrix';

},
_lighting: 'flat',
_imageBasedLightingEnvironment: null,
getOrientation: {

@@ -92,3 +94,5 @@ type: 'accessor',

calculateInstancePositions64xyLow(attribute) {
calculateInstancePositions64xyLow(attribute, _ref2) {
let startRow = _ref2.startRow,
endRow = _ref2.endRow;
const isFP64 = this.use64bitPositions();

@@ -105,7 +109,13 @@ attribute.constant = !isFP64;

getPosition = _this$props.getPosition;
const value = attribute.value;
let i = 0;
const value = attribute.value,
size = attribute.size;
let i = startRow * size;
for (const point of data) {
const position = getPosition(point);
const _createIterable = createIterable(data, startRow, endRow),
iterable = _createIterable.iterable,
objectInfo = _createIterable.objectInfo;
for (const point of iterable) {
objectInfo.index++;
const position = getPosition(point, objectInfo);
value[i++] = fp64LowPart(position[0]);

@@ -149,6 +159,8 @@ value[i++] = fp64LowPart(position[1]);

_applyAllAttributes(scenegraph) {
const allAttributes = this.getAttributeManager().getAttributes();
scenegraph.traverse(model => {
this._setModelAttributes(model.model, allAttributes);
});
if (this.state.attributesAvailable) {
const allAttributes = this.getAttributeManager().getAttributes();
scenegraph.traverse(model => {
this._setModelAttributes(model.model, allAttributes);
});
}
}

@@ -178,4 +190,4 @@

} else {
const findResult = animations.find((_ref2) => {
let name = _ref2.name;
const findResult = animations.find((_ref3) => {
let name = _ref3.name;
return name === key;

@@ -201,10 +213,41 @@ });

addVersionToShader(source) {
if (isWebGL2(this.context.gl)) {
return `#version 300 es\n${source}`;
}
return source;
}
getLoadOptions() {
const modules = ['project32', 'picking'];
const _this$props2 = this.props,
_lighting = _this$props2._lighting,
_imageBasedLightingEnvironment = _this$props2._imageBasedLightingEnvironment;
if (_lighting === 'pbr') {
modules.push(pbr);
}
let env = null;
if (_imageBasedLightingEnvironment) {
if (typeof _imageBasedLightingEnvironment === 'function') {
env = _imageBasedLightingEnvironment({
gl: this.context.gl,
layer: this
});
} else {
env = _imageBasedLightingEnvironment;
}
}
return {
gl: this.context.gl,
waitForFullLoad: true,
imageBasedLightingEnvironment: env,
modelOptions: {
vs,
fs,
modules: ['project32', 'picking'],
vs: this.addVersionToShader(vs),
fs: this.addVersionToShader(fs),
modules,
isInstanced: true

@@ -217,2 +260,5 @@ }

super.updateAttributes(props);
this.setState({
attributesAvailable: true
});
if (!this.state.scenegraph) return;

@@ -228,8 +274,8 @@ const attributeManager = this.getAttributeManager();

draw(_ref3) {
let _ref3$moduleParameter = _ref3.moduleParameters,
moduleParameters = _ref3$moduleParameter === void 0 ? null : _ref3$moduleParameter,
_ref3$parameters = _ref3.parameters,
parameters = _ref3$parameters === void 0 ? {} : _ref3$parameters,
context = _ref3.context;
draw(_ref4) {
let _ref4$moduleParameter = _ref4.moduleParameters,
moduleParameters = _ref4$moduleParameter === void 0 ? null : _ref4$moduleParameter,
_ref4$parameters = _ref4.parameters,
parameters = _ref4$parameters === void 0 ? {} : _ref4$parameters,
context = _ref4.context;
if (!this.state.scenegraph) return;

@@ -243,4 +289,4 @@

const numInstances = this.getNumInstances();
this.state.scenegraph.traverse((model, _ref4) => {
let worldMatrix = _ref4.worldMatrix;
this.state.scenegraph.traverse((model, _ref5) => {
let worldMatrix = _ref5.worldMatrix;
model.model.setInstanceCount(numInstances);

@@ -252,3 +298,4 @@ model.updateModuleSettings(moduleParameters);

sizeScale,
sceneModelMatrix: worldMatrix
sceneModelMatrix: worldMatrix,
u_Camera: model.model.program.uniforms.project_uCameraPosition
}

@@ -255,0 +302,0 @@ });

@@ -289,3 +289,5 @@ import { Layer, createIterable } from '@deck.gl/core';

calculateInstancePositions64xyLow(attribute) {
calculateInstancePositions64xyLow(attribute, _ref4) {
let startRow = _ref4.startRow,
endRow = _ref4.endRow;
const isFP64 = this.use64bitPositions();

@@ -302,6 +304,7 @@ attribute.constant = !isFP64;

getPosition = _this$props.getPosition;
const value = attribute.value;
let i = 0;
const value = attribute.value,
size = attribute.size;
let i = startRow * size;
const _createIterable = createIterable(data),
const _createIterable = createIterable(data, startRow, endRow),
iterable = _createIterable.iterable,

@@ -308,0 +311,0 @@ objectInfo = _createIterable.objectInfo;

@@ -72,3 +72,5 @@ import { createIterable } from '@deck.gl/core';

update(attribute) {
update(attribute, _ref) {
let startRow = _ref.startRow,
endRow = _ref.endRow;
const _this$props = this.props,

@@ -111,5 +113,5 @@ data = _this$props.data,

} else {
let i = 0;
let i = startRow * attribute.size;
const _createIterable = createIterable(data),
const _createIterable = createIterable(data, startRow, endRow),
iterable = _createIterable.iterable,

@@ -116,0 +118,0 @@ objectInfo = _createIterable.objectInfo;

@@ -1,2 +0,2 @@

export default "#ifdef HAS_UV\n varying vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n#endif\nvarying vec4 vColor;\n\nvoid main(void) {\n #ifdef HAS_UV\n gl_FragColor = (vColor / 255.) * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n #else\n gl_FragColor = vColor / 255.;\n #endif\n\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n";
export default "#if (__VERSION__ < 300)\n #define _varying varying\n #define _texture2D texture2D\n #define fragmentColor gl_FragColor\n#else\n #define _varying in\n #define _texture2D texture\n out vec4 fragmentColor;\n#endif\n#ifndef MODULE_PBR\n _varying vec4 vColor;\n\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n _varying vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = pbr_filterColor(vec4(0));\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * _texture2D(u_BaseColorSampler, vTEXCOORD_0);\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor = picking_filterPickingColor(fragmentColor);\n}\n";
//# sourceMappingURL=scenegraph-layer-fragment.glsl.js.map

@@ -1,2 +0,2 @@

export default "\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\nuniform float sizeScale;\nuniform mat4 sceneModelMatrix;\nattribute vec4 POSITION;\n\n#ifdef HAS_UV\n attribute vec2 TEXCOORD_0;\n varying vec2 vTEXCOORD_0;\n#endif\nvarying vec4 vColor;\n\nvoid main(void) {\n #ifdef HAS_UV\n vTEXCOORD_0 = TEXCOORD_0;\n #endif\n vColor = instanceColors;\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n picking_setPickingColor(instancePickingColors);\n}\n";
export default "#if (__VERSION__ < 300)\n #define _attribute attribute\n #define _varying varying\n#else\n #define _attribute in\n#define _varying out\n#endif\n_attribute vec3 instancePositions;\n_attribute vec2 instancePositions64xy;\n_attribute vec4 instanceColors;\n_attribute vec3 instancePickingColors;\n_attribute mat3 instanceModelMatrix;\n_attribute vec3 instanceTranslation;\nuniform float sizeScale;\nuniform mat4 sceneModelMatrix;\n_attribute vec4 POSITION;\n\n#ifdef HAS_UV\n _attribute vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n _attribute vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attribute vec4 TANGENT;\n #endif\n#endif\n#ifndef MODULE_PBR\n _varying vec4 vColor;\n\n #ifdef HAS_UV\n _varying vec2 vTEXCOORD_0;\n #endif\n#endif\n#if defined(HAS_NORMALS) && defined(MODULE_PBR)\n vec3 getProjectedNormal() {\n return project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n }\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n #endif\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n #ifdef MODULE_PBR\n pbr_vPosition = position_commonspace.xyz;\n\n #ifdef HAS_NORMALS\n #ifdef HAS_TANGENTS___TODO_FIX_ME___\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(NORMAL.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(TANGENT.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * TANGENT.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n #else\n pbr_vNormal = getProjectedNormal();\n #endif\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n #else\n vColor = instanceColors / 255.0;\n #endif\n\n picking_setPickingColor(instancePickingColors);\n}\n";
//# sourceMappingURL=scenegraph-layer-vertex.glsl.js.map

@@ -7,4 +7,4 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";

import _inherits from "@babel/runtime/helpers/esm/inherits";
import { Layer } from '@deck.gl/core';
import { fp64, ScenegraphNode, log } from '@luma.gl/core';
import { Layer, createIterable } from '@deck.gl/core';
import { fp64, ScenegraphNode, isWebGL2, pbr, log } from '@luma.gl/core';
import { load } from '@loaders.gl/core';

@@ -65,2 +65,4 @@ import { MATRIX_ATTRIBUTES } from '../utils/matrix';

},
_lighting: 'flat',
_imageBasedLightingEnvironment: null,
getOrientation: {

@@ -119,3 +121,5 @@ type: 'accessor',

key: "calculateInstancePositions64xyLow",
value: function calculateInstancePositions64xyLow(attribute) {
value: function calculateInstancePositions64xyLow(attribute, _ref2) {
var startRow = _ref2.startRow,
endRow = _ref2.endRow;
var isFP64 = this.use64bitPositions();

@@ -132,4 +136,10 @@ attribute.constant = !isFP64;

getPosition = _this$props.getPosition;
var value = attribute.value;
var i = 0;
var value = attribute.value,
size = attribute.size;
var i = startRow * size;
var _createIterable = createIterable(data, startRow, endRow),
iterable = _createIterable.iterable,
objectInfo = _createIterable.objectInfo;
var _iteratorNormalCompletion = true;

@@ -140,5 +150,6 @@ var _didIteratorError = false;

try {
for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
for (var _iterator = iterable[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var point = _step.value;
var position = getPosition(point);
objectInfo.index++;
var position = getPosition(point, objectInfo);
value[i++] = fp64LowPart(position[0]);

@@ -202,6 +213,8 @@ value[i++] = fp64LowPart(position[1]);

var allAttributes = this.getAttributeManager().getAttributes();
scenegraph.traverse(function (model) {
_this._setModelAttributes(model.model, allAttributes);
});
if (this.state.attributesAvailable) {
var allAttributes = this.getAttributeManager().getAttributes();
scenegraph.traverse(function (model) {
_this._setModelAttributes(model.model, allAttributes);
});
}
}

@@ -232,4 +245,4 @@ }, {

} else {
var findResult = animations.find(function (_ref2) {
var name = _ref2.name;
var findResult = animations.find(function (_ref3) {
var name = _ref3.name;
return name === key;

@@ -256,11 +269,43 @@ });

}, {
key: "addVersionToShader",
value: function addVersionToShader(source) {
if (isWebGL2(this.context.gl)) {
return "#version 300 es\n".concat(source);
}
return source;
}
}, {
key: "getLoadOptions",
value: function getLoadOptions() {
var modules = ['project32', 'picking'];
var _this$props2 = this.props,
_lighting = _this$props2._lighting,
_imageBasedLightingEnvironment = _this$props2._imageBasedLightingEnvironment;
if (_lighting === 'pbr') {
modules.push(pbr);
}
var env = null;
if (_imageBasedLightingEnvironment) {
if (typeof _imageBasedLightingEnvironment === 'function') {
env = _imageBasedLightingEnvironment({
gl: this.context.gl,
layer: this
});
} else {
env = _imageBasedLightingEnvironment;
}
}
return {
gl: this.context.gl,
waitForFullLoad: true,
imageBasedLightingEnvironment: env,
modelOptions: {
vs: vs,
fs: fs,
modules: ['project32', 'picking'],
vs: this.addVersionToShader(vs),
fs: this.addVersionToShader(fs),
modules: modules,
isInstanced: true

@@ -277,2 +322,5 @@ }

this.setState({
attributesAvailable: true
});
if (!this.state.scenegraph) return;

@@ -289,8 +337,8 @@ var attributeManager = this.getAttributeManager();

key: "draw",
value: function draw(_ref3) {
var _ref3$moduleParameter = _ref3.moduleParameters,
moduleParameters = _ref3$moduleParameter === void 0 ? null : _ref3$moduleParameter,
_ref3$parameters = _ref3.parameters,
parameters = _ref3$parameters === void 0 ? {} : _ref3$parameters,
context = _ref3.context;
value: function draw(_ref4) {
var _ref4$moduleParameter = _ref4.moduleParameters,
moduleParameters = _ref4$moduleParameter === void 0 ? null : _ref4$moduleParameter,
_ref4$parameters = _ref4.parameters,
parameters = _ref4$parameters === void 0 ? {} : _ref4$parameters,
context = _ref4.context;
if (!this.state.scenegraph) return;

@@ -304,4 +352,4 @@

var numInstances = this.getNumInstances();
this.state.scenegraph.traverse(function (model, _ref4) {
var worldMatrix = _ref4.worldMatrix;
this.state.scenegraph.traverse(function (model, _ref5) {
var worldMatrix = _ref5.worldMatrix;
model.model.setInstanceCount(numInstances);

@@ -313,3 +361,4 @@ model.updateModuleSettings(moduleParameters);

sizeScale: sizeScale,
sceneModelMatrix: worldMatrix
sceneModelMatrix: worldMatrix,
u_Camera: model.model.program.uniforms.project_uCameraPosition
}

@@ -316,0 +365,0 @@ });

@@ -325,3 +325,5 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";

key: "calculateInstancePositions64xyLow",
value: function calculateInstancePositions64xyLow(attribute) {
value: function calculateInstancePositions64xyLow(attribute, _ref4) {
var startRow = _ref4.startRow,
endRow = _ref4.endRow;
var isFP64 = this.use64bitPositions();

@@ -338,6 +340,7 @@ attribute.constant = !isFP64;

getPosition = _this$props.getPosition;
var value = attribute.value;
var i = 0;
var value = attribute.value,
size = attribute.size;
var i = startRow * size;
var _createIterable = createIterable(data),
var _createIterable = createIterable(data, startRow, endRow),
iterable = _createIterable.iterable,

@@ -344,0 +347,0 @@ objectInfo = _createIterable.objectInfo;

@@ -71,3 +71,5 @@ import { createIterable } from '@deck.gl/core';

},
update: function update(attribute) {
update: function update(attribute, _ref) {
var startRow = _ref.startRow,
endRow = _ref.endRow;
var _this$props = this.props,

@@ -110,5 +112,5 @@ data = _this$props.data,

} else {
var i = 0;
var i = startRow * attribute.size;
var _createIterable = createIterable(data),
var _createIterable = createIterable(data, startRow, endRow),
iterable = _createIterable.iterable,

@@ -115,0 +117,0 @@ objectInfo = _createIterable.objectInfo;

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "7.1.0-alpha.1",
"version": "7.1.0-alpha.2",
"publishConfig": {

@@ -8,0 +8,0 @@ "access": "public"

export default `\
#ifdef HAS_UV
varying vec2 vTEXCOORD_0;
uniform sampler2D u_BaseColorSampler;
#if (__VERSION__ < 300)
#define _varying varying
#define _texture2D texture2D
#define fragmentColor gl_FragColor
#else
#define _varying in
#define _texture2D texture
out vec4 fragmentColor;
#endif
varying vec4 vColor;
// Uniforms
// none
// Varying
// MODULE_PBR contains all the varying definitions needed
#ifndef MODULE_PBR
_varying vec4 vColor;
#if defined(HAS_UV) && defined(HAS_BASECOLORMAP)
_varying vec2 vTEXCOORD_0;
uniform sampler2D u_BaseColorSampler;
#endif
#endif
void main(void) {
#ifdef HAS_UV
gl_FragColor = (vColor / 255.) * texture2D(u_BaseColorSampler, vTEXCOORD_0);
#ifdef MODULE_PBR
fragmentColor = pbr_filterColor(vec4(0));
#else
gl_FragColor = vColor / 255.;
#if defined(HAS_UV) && defined(HAS_BASECOLORMAP)
fragmentColor = vColor * _texture2D(u_BaseColorSampler, vTEXCOORD_0);
#else
fragmentColor = vColor;
#endif
#endif
gl_FragColor = picking_filterPickingColor(gl_FragColor);
fragmentColor = picking_filterPickingColor(fragmentColor);
}
`;
export default `\
#if (__VERSION__ < 300)
#define _attribute attribute
#define _varying varying
#else
#define _attribute in
#define _varying out
#endif
// Instance attributes
attribute vec3 instancePositions;
attribute vec2 instancePositions64xy;
attribute vec4 instanceColors;
attribute vec3 instancePickingColors;
attribute mat3 instanceModelMatrix;
attribute vec3 instanceTranslation;
_attribute vec3 instancePositions;
_attribute vec2 instancePositions64xy;
_attribute vec4 instanceColors;
_attribute vec3 instancePickingColors;
_attribute mat3 instanceModelMatrix;
_attribute vec3 instanceTranslation;

@@ -15,15 +23,41 @@ // Uniforms

// Attributes
attribute vec4 POSITION;
_attribute vec4 POSITION;
#ifdef HAS_UV
attribute vec2 TEXCOORD_0;
varying vec2 vTEXCOORD_0;
_attribute vec2 TEXCOORD_0;
#endif
varying vec4 vColor;
#ifdef MODULE_PBR
#ifdef HAS_NORMALS
_attribute vec4 NORMAL;
#endif
#ifdef HAS_TANGENTS
_attribute vec4 TANGENT;
#endif
#endif
// Varying
// MODULE_PBR contains all the varying definitions needed
#ifndef MODULE_PBR
_varying vec4 vColor;
#ifdef HAS_UV
_varying vec2 vTEXCOORD_0;
#endif
#endif
// Utils
#if defined(HAS_NORMALS) && defined(MODULE_PBR)
vec3 getProjectedNormal() {
return project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);
}
#endif
// Main
void main(void) {
#ifdef HAS_UV
#if defined(HAS_UV) && !defined(MODULE_PBR)
vTEXCOORD_0 = TEXCOORD_0;
#endif
vColor = instanceColors;

@@ -35,4 +69,32 @@ vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale + instanceTranslation;

gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);
#ifdef MODULE_PBR
// set PBR data
pbr_vPosition = position_commonspace.xyz;
#ifdef HAS_NORMALS
#ifdef HAS_TANGENTS___TODO_FIX_ME___
vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(NORMAL.xyz, 0.0)));
vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(TANGENT.xyz, 0.0)));
vec3 bitangentW = cross(normalW, tangentW) * TANGENT.w;
pbr_vTBN = mat3(tangentW, bitangentW, normalW);
#else // HAS_TANGENTS != 1
// pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(NORMAL.xyz, 0.0)));
// TODO: Check this
pbr_vNormal = getProjectedNormal();
#endif
#endif
#ifdef HAS_UV
pbr_vUV = TEXCOORD_0;
#else
pbr_vUV = vec2(0., 0.);
#endif
#else
// Flat shading
vColor = instanceColors / 255.0;
#endif
picking_setPickingColor(instancePickingColors);
}
`;

@@ -22,5 +22,4 @@ // Copyright (c) 2019 Uber Technologies, Inc.

/* global fetch */
import {Layer} from '@deck.gl/core';
import {fp64, ScenegraphNode, log} from '@luma.gl/core';
import {Layer, createIterable} from '@deck.gl/core';
import {fp64, ScenegraphNode, isWebGL2, pbr, log} from '@luma.gl/core';
import {load} from '@loaders.gl/core';

@@ -55,2 +54,7 @@

// flat or pbr
_lighting: 'flat',
// _lighting must be pbr for this to work
_imageBasedLightingEnvironment: null,
// yaw, pitch and roll are in degrees

@@ -90,3 +94,3 @@ // https://en.wikipedia.org/wiki/Euler_angles

calculateInstancePositions64xyLow(attribute) {
calculateInstancePositions64xyLow(attribute, {startRow, endRow}) {
const isFP64 = this.use64bitPositions();

@@ -101,6 +105,8 @@ attribute.constant = !isFP64;

const {data, getPosition} = this.props;
const {value} = attribute;
let i = 0;
for (const point of data) {
const position = getPosition(point);
const {value, size} = attribute;
let i = startRow * size;
const {iterable, objectInfo} = createIterable(data, startRow, endRow);
for (const point of iterable) {
objectInfo.index++;
const position = getPosition(point, objectInfo);
value[i++] = fp64LowPart(position[0]);

@@ -137,6 +143,8 @@ value[i++] = fp64LowPart(position[1]);

_applyAllAttributes(scenegraph) {
const allAttributes = this.getAttributeManager().getAttributes();
scenegraph.traverse(model => {
this._setModelAttributes(model.model, allAttributes);
});
if (this.state.attributesAvailable) {
const allAttributes = this.getAttributeManager().getAttributes();
scenegraph.traverse(model => {
this._setModelAttributes(model.model, allAttributes);
});
}
}

@@ -187,10 +195,35 @@

addVersionToShader(source) {
if (isWebGL2(this.context.gl)) {
return `#version 300 es\n${source}`;
}
return source;
}
getLoadOptions() {
const modules = ['project32', 'picking'];
const {_lighting, _imageBasedLightingEnvironment} = this.props;
if (_lighting === 'pbr') {
modules.push(pbr);
}
let env = null;
if (_imageBasedLightingEnvironment) {
if (typeof _imageBasedLightingEnvironment === 'function') {
env = _imageBasedLightingEnvironment({gl: this.context.gl, layer: this});
} else {
env = _imageBasedLightingEnvironment;
}
}
return {
gl: this.context.gl,
waitForFullLoad: true,
imageBasedLightingEnvironment: env,
modelOptions: {
vs,
fs,
modules: ['project32', 'picking'],
vs: this.addVersionToShader(vs),
fs: this.addVersionToShader(fs),
modules,
isInstanced: true

@@ -203,2 +236,3 @@ }

super.updateAttributes(props);
this.setState({attributesAvailable: true});
if (!this.state.scenegraph) return;

@@ -229,3 +263,5 @@

sizeScale,
sceneModelMatrix: worldMatrix
sceneModelMatrix: worldMatrix,
// Needed for PBR (TODO: find better way to get it)
u_Camera: model.model.program.uniforms.project_uCameraPosition
}

@@ -232,0 +268,0 @@ });

@@ -283,3 +283,3 @@ // Note: This file will either be moved back to deck.gl or reformatted to web-monorepo standards

calculateInstancePositions64xyLow(attribute) {
calculateInstancePositions64xyLow(attribute, {startRow, endRow}) {
const isFP64 = this.use64bitPositions();

@@ -294,5 +294,5 @@ attribute.constant = !isFP64;

const {data, getPosition} = this.props;
const {value} = attribute;
let i = 0;
const {iterable, objectInfo} = createIterable(data);
const {value, size} = attribute;
let i = startRow * size;
const {iterable, objectInfo} = createIterable(data, startRow, endRow);
for (const object of iterable) {

@@ -299,0 +299,0 @@ objectInfo.index++;

@@ -79,3 +79,3 @@ import {createIterable} from '@deck.gl/core';

update(attribute) {
update(attribute, {startRow, endRow}) {
// NOTE(Tarek): "this" will be bound to a layer!

@@ -118,4 +118,4 @@ const {data, getOrientation, getScale, getTranslation, getTransformMatrix} = this.props;

} else {
let i = 0;
const {iterable, objectInfo} = createIterable(data);
let i = startRow * attribute.size;
const {iterable, objectInfo} = createIterable(data, startRow, endRow);
for (const object of iterable) {

@@ -122,0 +122,0 @@ objectInfo.index++;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc