From 5b6e7b0512c4286544710af7f40eb9140c149cb7 Mon Sep 17 00:00:00 2001 From: Tariq Soliman Date: Mon, 6 Dec 2021 18:04:48 -0800 Subject: [PATCH 1/7] #2 Add Model Layer part 1 --- dist/lithosphere.js | 2254 +++++++++++++++++++++++++++++++++++- dist/src/layers/index.d.ts | 3 + dist/src/layers/model.d.ts | 13 + examples/example.html | 32 +- package.json | 2 +- src/layers/index.ts | 6 + src/layers/model.ts | 275 +++++ 7 files changed, 2579 insertions(+), 6 deletions(-) diff --git a/dist/lithosphere.js b/dist/lithosphere.js index 0d12886..5eca489 100644 --- a/dist/lithosphere.js +++ b/dist/lithosphere.js @@ -1 +1,2253 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("LithoSphere",[],e):"object"==typeof exports?exports.LithoSphere=e():t.LithoSphere=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.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 i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));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="C:\\Users\\tsoliman\\Documents\\Projects\\LithoSphere\\dist/",n(n.s=14)}([function(t,e,n){"use strict";n.r(e),n.d(e,"earthRadius",(function(){return r})),n.d(e,"factors",(function(){return i})),n.d(e,"unitsFactors",(function(){return o})),n.d(e,"areaFactors",(function(){return s})),n.d(e,"feature",(function(){return a})),n.d(e,"geometry",(function(){return l})),n.d(e,"point",(function(){return c})),n.d(e,"points",(function(){return u})),n.d(e,"polygon",(function(){return h})),n.d(e,"polygons",(function(){return f})),n.d(e,"lineString",(function(){return d})),n.d(e,"lineStrings",(function(){return p})),n.d(e,"featureCollection",(function(){return m})),n.d(e,"multiLineString",(function(){return g})),n.d(e,"multiPoint",(function(){return v})),n.d(e,"multiPolygon",(function(){return y})),n.d(e,"geometryCollection",(function(){return b})),n.d(e,"round",(function(){return _})),n.d(e,"radiansToLength",(function(){return x})),n.d(e,"lengthToRadians",(function(){return w})),n.d(e,"lengthToDegrees",(function(){return M})),n.d(e,"bearingToAzimuth",(function(){return S})),n.d(e,"radiansToDegrees",(function(){return E})),n.d(e,"degreesToRadians",(function(){return T})),n.d(e,"convertLength",(function(){return C})),n.d(e,"convertArea",(function(){return A})),n.d(e,"isNumber",(function(){return P})),n.d(e,"isObject",(function(){return L})),n.d(e,"validateBBox",(function(){return R})),n.d(e,"validateId",(function(){return O}));var r=6371008.8,i={centimeters:100*r,centimetres:100*r,degrees:r/111325,feet:3.28084*r,inches:39.37*r,kilometers:r/1e3,kilometres:r/1e3,meters:r,metres:r,miles:r/1609.344,millimeters:1e3*r,millimetres:1e3*r,nauticalmiles:r/1852,radians:1,yards:r/1.0936},o={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r,yards:1/1.0936},s={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function a(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function l(t,e,n){switch(void 0===n&&(n={}),t){case"Point":return c(e).geometry;case"LineString":return d(e).geometry;case"Polygon":return h(e).geometry;case"MultiPoint":return v(e).geometry;case"MultiLineString":return g(e).geometry;case"MultiPolygon":return y(e).geometry;default:throw new Error(t+" is invalid")}}function c(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(t[0])||!P(t[1]))throw new Error("coordinates must contain numbers");return a({type:"Point",coordinates:t},e,n)}function u(t,e,n){return void 0===n&&(n={}),m(t.map((function(t){return c(t,e)})),n)}function h(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function x(t,e){void 0===e&&(e="kilometers");var n=i[e];if(!n)throw new Error(e+" units is invalid");return t*n}function w(t,e){void 0===e&&(e="kilometers");var n=i[e];if(!n)throw new Error(e+" units is invalid");return t/n}function M(t,e){return E(w(t,e))}function S(t){var e=t%360;return e<0&&(e+=360),e}function E(t){return 180*(t%(2*Math.PI))/Math.PI}function T(t){return t%360*Math.PI/180}function C(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return x(w(t,e),n)}function A(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var r=s[e];if(!r)throw new Error("invalid original units");var i=s[n];if(!i)throw new Error("invalid final units");return t/r*i}function P(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function L(t){return!!t&&t.constructor===Object}function R(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!P(t))throw new Error("bbox must only contain numbers")}))}function O(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},function(t,e,n){"use strict";n.r(e),n.d(e,"coordEach",(function(){return i})),n.d(e,"coordReduce",(function(){return o})),n.d(e,"propEach",(function(){return s})),n.d(e,"propReduce",(function(){return a})),n.d(e,"featureEach",(function(){return l})),n.d(e,"featureReduce",(function(){return c})),n.d(e,"coordAll",(function(){return u})),n.d(e,"geomEach",(function(){return h})),n.d(e,"geomReduce",(function(){return f})),n.d(e,"flattenEach",(function(){return d})),n.d(e,"flattenReduce",(function(){return p})),n.d(e,"segmentEach",(function(){return m})),n.d(e,"segmentReduce",(function(){return g})),n.d(e,"lineEach",(function(){return v})),n.d(e,"lineReduce",(function(){return y})),n.d(e,"findSegment",(function(){return b})),n.d(e,"findPoint",(function(){return _}));var r=n(0);function i(t,e,n){if(null!==t)for(var r,o,s,a,l,c,u,h,f=0,d=0,p=t.type,m="FeatureCollection"===p,g="Feature"===p,v=m?t.features.length:1,y=0;yc||d>u||p>h)return l=i,c=n,u=d,h=p,void(s=0);var m=Object(r.lineString)([l,i],t.properties);if(!1===e(m,n,o,p,s))return!1;s++,l=i}))&&void 0}}}))}function g(t,e,n){var r=n,i=!1;return m(t,(function(t,o,s,a,l){r=!1===i&&void 0===n?t:e(r,t,o,s,a,l),i=!0})),r}function v(t,e){if(!t)throw new Error("geojson is required");d(t,(function(t,n,i){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,n,i,0,0))return!1;break;case"Polygon":for(var a=0;a=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(e=s+"/"+e,i="/"===s.charAt(0))}return(i?"/":"")+(e=n(r(e.split("/"),(function(t){return!!t})),!i).join("/"))||"."},e.normalize=function(t){var o=e.isAbsolute(t),s="/"===i(t,-1);return(t=n(r(t.split("/"),(function(t){return!!t})),!o).join("/"))||o||(t="."),t&&s&&(t+="/"),(o?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(r(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var i=r(t.split("/")),o=r(n.split("/")),s=Math.min(i.length,o.length),a=s,l=0;l=1;--o)if(47===(e=t.charCodeAt(o))){if(!i){r=o;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":t.slice(0,r)},e.basename=function(t,e){var n=function(t){"string"!=typeof t&&(t+="");var e,n=0,r=-1,i=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!i){n=e+1;break}}else-1===r&&(i=!1,r=e+1);return-1===r?"":t.slice(n,r)}(t);return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,n=0,r=-1,i=!0,o=0,s=t.length-1;s>=0;--s){var a=t.charCodeAt(s);if(47!==a)-1===r&&(i=!1,r=s+1),46===a?-1===e?e=s:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){n=s+1;break}}return-1===e||-1===r||0===o||1===o&&e===r-1&&e===n+1?"":t.slice(e,r)};var i="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n(10))},function(t,e,n){parcelRequire=function(e,r,i,o){var s,a="function"==typeof parcelRequire&&parcelRequire;function l(t,i){if(!r[t]){if(!e[t]){var o="function"==typeof parcelRequire&&parcelRequire;if(!i&&o)return o(t,!0);if(a)return a(t,!0);if("string"==typeof t)return n(6)(t);var s=new Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}u.resolve=function(n){return e[t][1][n]||n},u.cache={};var c=r[t]=new l.Module(t);e[t][0].call(c.exports,u,c,c.exports,this)}return r[t].exports;function u(t){return l(u.resolve(t))}}l.isParcelRequire=!0,l.Module=function(t){this.id=t,this.bundle=l,this.exports={}},l.modules=e,l.cache=r,l.parent=a,l.register=function(t,n){e[t]=[function(t,e){e.exports=n},{}]};for(var c=0;c=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var l=r.call(s,"catchLoc"),c=r.call(s,"finallyLoc");if(l&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),p}},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 i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:A(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}("object"==typeof e?e.exports:{});try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},{}],PMvg:[function(t,e,n){e.exports=t("regenerator-runtime")},{"regenerator-runtime":"QVnC"}],IxO8:[function(t,e,n){e.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},{}],OUZ9:[function(t,e,n){e.exports=function(t){if(Array.isArray(t))return t}},{}],vKPt:[function(t,e,n){e.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return n}}},{}],NVR6:[function(t,e,n){e.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n>23&511;return s[n]+((8388607&e)>>a[n])},n.convertToNumber=function(t){const e=t>>10;return o[0]=l[u[e]+(1023&t)]+c[e],i[0]};const r=new ArrayBuffer(4),i=new Float32Array(r),o=new Uint32Array(r),s=new Uint32Array(512),a=new Uint32Array(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(s[0|t]=0,s[256|t]=32768,a[0|t]=24,a[256|t]=24):e<-14?(s[0|t]=1024>>-e-14,s[256|t]=1024>>-e-14|32768,a[0|t]=-e-1,a[256|t]=-e-1):e<=15?(s[0|t]=e+15<<10,s[256|t]=e+15<<10|32768,a[0|t]=13,a[256|t]=13):e<128?(s[0|t]=31744,s[256|t]=64512,a[0|t]=24,a[256|t]=24):(s[0|t]=31744,s[256|t]=64512,a[0|t]=13,a[256|t]=13)}const l=new Uint32Array(2048),c=new Uint32Array(64),u=new Uint32Array(64);l[0]=0;for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;0==(8388608&e);)n-=8388608,e<<=1;e&=-8388609,n+=947912704,l[t]=e|n}for(let t=1024;t<2048;++t)l[t]=939524096+(t-1024<<13);c[0]=0;for(let t=1;t<31;++t)c[t]=t<<23;c[31]=1199570944,c[32]=2147483648;for(let t=33;t<63;++t)c[t]=2147483648+(t-32<<23);c[63]=3347054592,u[0]=0;for(let t=1;t<64;++t)u[t]=32===t?0:1024},{}],G4sf:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){if(t=Number(t),!Number.isFinite(t)||0===t)return t;const e=(0,r.roundToFloat16Bits)(t);return(0,r.convertToNumber)(e)};var r=t("./lib")},{"./lib":"GG94"}],xQUP:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ToInteger=function(t){return"number"!=typeof t&&(t=Number(t)),Number.isNaN(t)&&(t=0),Math.trunc(t)},n.defaultCompareFunction=function(t,e){const[n,r]=[Number.isNaN(t),Number.isNaN(e)];if(n&&r)return 0;if(n)return 1;if(r)return-1;if(te)return 1;if(0===t&&0===e){const[n,r]=[Object.is(t,0),Object.is(e,0)];if(!n&&r)return-1;if(n&&!r)return 1}return 0}},{}],iJ7y:[function(t,e,n){var r=arguments[3];Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i="object"==typeof r&&r&&r.Object===Object&&r,o=i;n.default=o},{}],ygki:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./_freeGlobal.js")),i="object"==typeof self&&self&&self.Object===Object&&self,o=r.default||i||Function("return this")();n.default=o},{"./_freeGlobal.js":"iJ7y"}],Oi8n:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./_root.js")).default.Symbol;n.default=r},{"./_root.js":"ygki"}],InRc:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./_Symbol.js")),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r.default?r.default.toStringTag:void 0;n.default=function(t){var e=o.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var i=s.call(t);return r&&(e?t[a]=n:delete t[a]),i}},{"./_Symbol.js":"Oi8n"}],iwg4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=Object.prototype.toString;n.default=function(t){return r.call(t)}},{}],svpX:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=s(t("./_Symbol.js")),i=s(t("./_getRawTag.js")),o=s(t("./_objectToString.js"));function s(t){return t&&t.__esModule?t:{default:t}}var a=r.default?r.default.toStringTag:void 0;n.default=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?(0,i.default)(t):(0,o.default)(t)}},{"./_Symbol.js":"Oi8n","./_getRawTag.js":"InRc","./_objectToString.js":"iwg4"}],UKR9:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(t){return null!=t&&"object"==typeof t}},{}],MYZg:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(t("./_baseGetTag.js")),i=o(t("./isObjectLike.js"));function o(t){return t&&t.__esModule?t:{default:t}}n.default=function(t){return(0,i.default)(t)&&"[object ArrayBuffer]"==(0,r.default)(t)}},{"./_baseGetTag.js":"svpX","./isObjectLike.js":"UKR9"}],pmj6:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(t){return function(e){return t(e)}}},{}],oPFz:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./_freeGlobal.js")),i="object"==typeof n&&n&&!n.nodeType&&n,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=o&&o.exports===i&&r.default.process,a=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(t){}}();n.default=a},{"./_freeGlobal.js":"iJ7y"}],rXXV:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=s(t("./_baseIsArrayBuffer.js")),i=s(t("./_baseUnary.js")),o=s(t("./_nodeUtil.js"));function s(t){return t&&t.__esModule?t:{default:t}}var a=o.default&&o.default.isArrayBuffer,l=a?(0,i.default)(a):r.default;n.default=l},{"./_baseIsArrayBuffer.js":"MYZg","./_baseUnary.js":"pmj6","./_nodeUtil.js":"oPFz"}],XYHx:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isDataView=function(t){return t instanceof DataView},n.isStringNumberKey=function(t){return"string"==typeof t&&t===(0,r.ToInteger)(t)+""},Object.defineProperty(n,"isArrayBuffer",{enumerable:!0,get:function(){return i.default}});var r=t("./spec"),i=function(t){return t&&t.__esModule?t:{default:t}}(t("lodash-es/isArrayBuffer"))},{"./spec":"xQUP","lodash-es/isArrayBuffer":"rXXV"}],EEXG:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createPrivateStorage=function(){const t=new WeakMap;return e=>{let n=t.get(e);return n||(n=Object.create(null),t.set(e,n),n)}}},{}],DTZk:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},{}],tWvT:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(t("./_baseGetTag.js")),i=o(t("./isObject.js"));function o(t){return t&&t.__esModule?t:{default:t}}n.default=function(t){if(!(0,i.default)(t))return!1;var e=(0,r.default)(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},{"./_baseGetTag.js":"svpX","./isObject.js":"DTZk"}],xFkS:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./_root.js")).default["__core-js_shared__"];n.default=r},{"./_root.js":"ygki"}],pULC:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./_coreJsData.js")),i=function(){var t=/[^.]+$/.exec(r.default&&r.default.keys&&r.default.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();n.default=function(t){return!!i&&i in t}},{"./_coreJsData.js":"xFkS"}],UKJK:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=Function.prototype.toString;n.default=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},{}],Zczf:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(t("./isFunction.js")),i=a(t("./_isMasked.js")),o=a(t("./isObject.js")),s=a(t("./_toSource.js"));function a(t){return t&&t.__esModule?t:{default:t}}var l=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,h=c.toString,f=u.hasOwnProperty,d=RegExp("^"+h.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");n.default=function(t){return!(!(0,o.default)(t)||(0,i.default)(t))&&((0,r.default)(t)?d:l).test((0,s.default)(t))}},{"./isFunction.js":"tWvT","./_isMasked.js":"pULC","./isObject.js":"DTZk","./_toSource.js":"UKJK"}],ZVQn:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(t,e){return null==t?void 0:t[e]}},{}],tx41:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(t("./_baseIsNative.js")),i=o(t("./_getValue.js"));function o(t){return t&&t.__esModule?t:{default:t}}n.default=function(t,e){var n=(0,i.default)(t,e);return(0,r.default)(n)?n:void 0}},{"./_baseIsNative.js":"Zczf","./_getValue.js":"ZVQn"}],YsDH:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=(0,function(t){return t&&t.__esModule?t:{default:t}}(t("./_getNative.js")).default)(Object,"create");n.default=r},{"./_getNative.js":"tx41"}],sJnX:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./_nativeCreate.js"));n.default=function(){this.__data__=r.default?(0,r.default)(null):{},this.size=0}},{"./_nativeCreate.js":"YsDH"}],c9sB:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},{}],zYTU:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./_nativeCreate.js")),i=Object.prototype.hasOwnProperty;n.default=function(t){var e=this.__data__;if(r.default){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},{"./_nativeCreate.js":"YsDH"}],ZFwF:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./_nativeCreate.js")),i=Object.prototype.hasOwnProperty;n.default=function(t){var e=this.__data__;return r.default?void 0!==e[t]:i.call(e,t)}},{"./_nativeCreate.js":"YsDH"}],i3LK:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./_nativeCreate.js"));n.default=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r.default&&void 0===e?"__lodash_hash_undefined__":e,this}},{"./_nativeCreate.js":"YsDH"}],tE4I:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(t("./_hashClear.js")),i=l(t("./_hashDelete.js")),o=l(t("./_hashGet.js")),s=l(t("./_hashHas.js")),a=l(t("./_hashSet.js"));function l(t){return t&&t.__esModule?t:{default:t}}function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1}},{"./_assocIndexOf.js":"Hp84"}],GGNI:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./_assocIndexOf.js"));n.default=function(t,e){var n=this.__data__,i=(0,r.default)(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},{"./_assocIndexOf.js":"Hp84"}],UlXa:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(t("./_listCacheClear.js")),i=l(t("./_listCacheDelete.js")),o=l(t("./_listCacheGet.js")),s=l(t("./_listCacheHas.js")),a=l(t("./_listCacheSet.js"));function l(t){return t&&t.__esModule?t:{default:t}}function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++eu(e)&&function(t){return"function"==typeof t&&v.has(t)}(t)?Reflect.apply(t,c(e).target,n):Reflect.apply(t,e,n)},p={get(t,e){let n=null;if(l.isTypedArrayIndexedPropertyWritable||(t=c(n=t).target),(0,i.isStringNumberKey)(e))return Reflect.has(t,e)?(0,a.convertToNumber)(Reflect.get(t,e)):void 0;{const r=null!==n&&Reflect.has(n,e)?Reflect.get(n,e):Reflect.get(t,e);if("function"!=typeof r)return r;let i=c(r).proxy;return void 0===i&&(i=c(r).proxy=new Proxy(r,d)),i}},set(t,e,n){let r=null;return l.isTypedArrayIndexedPropertyWritable||(t=c(r=t).target),(0,i.isStringNumberKey)(e)?Reflect.set(t,e,(0,a.roundToFloat16Bits)(n)):null===r||Reflect.has(t,e)&&!Object.isFrozen(r)?Reflect.set(t,e,n):Reflect.set(r,e,n)}};l.isTypedArrayIndexedPropertyWritable||(p.getPrototypeOf=t=>Reflect.getPrototypeOf(c(t).target),p.setPrototypeOf=(t,e)=>Reflect.setPrototypeOf(c(t).target,e),p.defineProperty=(t,e,n)=>{const r=c(t).target;return!Reflect.has(r,e)||Object.isFrozen(t)?Reflect.defineProperty(t,e,n):Reflect.defineProperty(r,e,n)},p.deleteProperty=(t,e)=>{const n=c(t).target;return Reflect.has(t,e)?Reflect.deleteProperty(t,e):Reflect.deleteProperty(n,e)},p.has=(t,e)=>Reflect.has(t,e)||Reflect.has(c(t).target,e),p.isExtensible=t=>Reflect.isExtensible(t),p.preventExtensions=t=>Reflect.preventExtensions(t),p.getOwnPropertyDescriptor=(t,e)=>Reflect.getOwnPropertyDescriptor(t,e),p.ownKeys=t=>Reflect.ownKeys(t));class m extends Uint16Array{constructor(t,e,n){if(u(t))super(c(t).target);else if(null===t||"object"!=typeof t||(0,i.isArrayBuffer)(t))switch(arguments.length){case 0:super();break;case 1:super(t);break;case 2:super(t,e);break;case 3:super(t,e,n);break;default:super(...arguments)}else{const e=Reflect.has(t,"length")||void 0===t[Symbol.iterator]?t:[...t],n=e.length;super(n);for(let t=0;te(n(t),n(r))),c(this).proxy}slice(...t){let e;h(this);try{e=super.slice(...t)}catch(n){if(!(n instanceof TypeError))throw n;e=new Uint16Array(this.buffer,this.byteOffset,this.length).slice(...t)}return new m(e.buffer)}subarray(...t){let e;h(this);try{e=super.subarray(...t)}catch(n){if(!(n instanceof TypeError))throw n;e=new Uint16Array(this.buffer,this.byteOffset,this.length).subarray(...t)}return new m(e.buffer,e.byteOffset,e.length)}indexOf(t,...e){h(this);const n=this.length;let i=(0,r.ToInteger)(e[0]);i<0&&(i+=n)<0&&(i=0);for(let e=i,r=n;e=0?i=i0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,function(t){console&&console.warn&&console.warn(t)}(a)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function p(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var c=l.length,u=g(l,c);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},{}],ExO1:[function(t,e,n){e.exports=t("events").EventEmitter},{events:"FRpO"}],yh9p:[function(t,e,n){"use strict";n.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},n.toByteArray=function(t){var e,n,r=c(t),s=r[0],a=r[1],l=new o(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),u=0,h=a>0?s-4:s;for(n=0;n>16&255,l[u++]=e>>8&255,l[u++]=255&e;return 2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,l[u++]=255&e),1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e),l},n.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;sa?a:s+16383));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function h(t,e,n){for(var r,i=[],o=e;o>1,u=-7,h=n?i-1:0,f=n?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=f,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;u>0;s=256*s+t[e+h],h+=f,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=c}return(d?-1:1)*s*Math.pow(2,o-r)},n.write=function(t,e,n,r,i,o){var s,a,l,c=8*o-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*l-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[n+d]=255&s,d+=p,s/=256,c-=8);t[n+d-p]|=128*m}},{}],REa7:[function(t,e,n){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],dskh:[function(t,e,n){var r=arguments[3],i=t("base64-js"),o=t("ieee754"),s=t("isarray");function a(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function l(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(t,e){if(l()=l())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l().toString(16)+" bytes");return 0|t}function _(t){return+t!=t&&(t=0),u.alloc(+t)}function x(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return tt(t).length;default:if(r)return K(t).length;e=(""+e).toLowerCase(),r=!0}}function w(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return F(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return N(this,e,n);case"latin1":case"binary":return j(this,e,n);case"base64":return O(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function M(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function S(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:E(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):E(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function E(t,e,n,r,i){var o,s=1,a=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var u=-1;for(o=n;oa&&(n=a-l),o=n;o>=0;o--){for(var h=!0,f=0;fi&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(o=t[i+1]))&&(l=(31&c)<<6|63&o)>127&&(u=l);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(l=(15&c)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=h}return D(r)}n.Buffer=u,n.SlowBuffer=_,n.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==r.TYPED_ARRAY_SUPPORT?r.TYPED_ARRAY_SUPPORT:a(),n.kMaxLength=l(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return h(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return d(null,t,e,n)},u.allocUnsafe=function(t){return p(null,t)},u.allocUnsafeSlow=function(t){return p(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),l=this.slice(r,i),c=t.slice(e,n),h=0;hi)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return T(this,t,e,n);case"utf8":case"utf-8":return C(this,t,e,n);case"ascii":return A(this,t,e,n);case"latin1":case"binary":return P(this,t,e,n);case"base64":return L(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function D(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function U(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function H(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function G(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function W(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(t,e,n,r,i){return i||W(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function q(t,e,n,r,i){return i||W(t,0,n,8),o.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||z(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||z(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||z(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||z(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||z(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||z(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||z(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||z(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||z(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||z(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||z(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||z(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||z(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){t=+t,e|=0,n|=0,r||U(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||U(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||U(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):H(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||U(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):H(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||U(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):G(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||U(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):G(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);U(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);U(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||U(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||U(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):H(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||U(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):H(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||U(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):G(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||U(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):G(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return V(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return V(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return q(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return q(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Q(t){for(var e=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function tt(t){return i.toByteArray(Y(t))}function et(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function nt(t){return t!=t}},{"base64-js":"yh9p",ieee754:"JgNJ",isarray:"REa7",buffer:"dskh"}],VCcH:[function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(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,e){for(var n=0;n0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e=s.allocUnsafe(t>>>0),n=this.head,r=0;n;)c(n.data,e,r),r+=n.data.length,n=n.next;return e}},{key:"consume",value:function(t,e){var n;return ti.length?i.length:t;if(o===i.length?r+=i:r+=i.slice(0,t),0==(t-=o)){o===i.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),n=this.head,r=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var i=n.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,e}},{key:l,value:function(t,e){return a(this,function(t){for(var e=1;e1)for(var n=1;n2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}o("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,o;if("string"==typeof e&&function(t,e,n){return t.substr(0,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))o="The ".concat(t," ").concat(i," ").concat(s(e,"type"));else{var a=function(t,e,n){return"number"!=typeof n&&(n=0),!(n+".".length>t.length)&&-1!==t.indexOf(".",n)}(t)?"property":"argument";o='The "'.concat(t,'" ').concat(a," ").concat(i," ").concat(s(e,"type"))}return o+". Received type ".concat(r(n))}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},{}],TWVJ:[function(t,e,n){"use strict";var r=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,n,i){var o=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},{"../../../errors":"Yj9o"}],Bm0n:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},{}],yM1o:[function(t,e,n){var r=arguments[3];function i(t,e){if(o("noDeprecation"))return t;var n=!1;return function(){if(!n){if(o("throwDeprecation"))throw new Error(e);o("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}function o(t){try{if(!r.localStorage)return!1}catch(t){return!1}var e=r.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}e.exports=i},{}],WSyY:[function(t,e,n){t("process");var r,i=arguments[3],o=t("process");function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){q(e,t)}}e.exports=P,P.WritableState=A;var a={deprecate:t("util-deprecate")},l=t("./internal/streams/stream"),c=t("buffer").Buffer,u=i.Uint8Array||function(){};function h(t){return c.from(t)}function f(t){return c.isBuffer(t)||t instanceof u}var d,p=t("./internal/streams/destroy"),m=t("./internal/streams/state"),g=m.getHighWaterMark,v=t("../errors").codes,y=v.ERR_INVALID_ARG_TYPE,b=v.ERR_METHOD_NOT_IMPLEMENTED,_=v.ERR_MULTIPLE_CALLBACK,x=v.ERR_STREAM_CANNOT_PIPE,w=v.ERR_STREAM_DESTROYED,M=v.ERR_STREAM_NULL_VALUES,S=v.ERR_STREAM_WRITE_AFTER_END,E=v.ERR_UNKNOWN_ENCODING,T=p.errorOrDestroy;function C(){}function A(e,n,i){r=r||t("./_stream_duplex"),e=e||{},"boolean"!=typeof i&&(i=n instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=g(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){j(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function P(e){var n=this instanceof(r=r||t("./_stream_duplex"));if(!n&&!d.call(P,this))return new P(e);this._writableState=new A(e,this,n),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function L(t,e){var n=new S;T(t,n),o.nextTick(e,n)}function R(t,e,n,r){var i;return null===n?i=new M:"string"==typeof n||e.objectMode||(i=new y("chunk",["string","Buffer"],n)),!i||(T(t,i),o.nextTick(r,i),!1)}function O(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,n)),e}function k(t,e,n,r,i,o){if(!n){var s=O(e,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=e.objectMode?1:r.length;e.length+=a;var l=e.length-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(P.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(P.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),P.prototype._write=function(t,e,n){n(new b("_write()"))},P.prototype._writev=null,P.prototype.end=function(t,e,n){var r=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||V(this,r,n),this},Object.defineProperty(P.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),P.prototype.destroy=p.destroy,P.prototype._undestroy=p.undestroy,P.prototype._destroy=function(t,e){e(t)}},{"util-deprecate":"yM1o","./internal/streams/stream":"ExO1",buffer:"dskh","./internal/streams/destroy":"GRUB","./internal/streams/state":"TWVJ","../errors":"Yj9o",inherits:"Bm0n","./_stream_duplex":"Hba0",process:"pBGv"}],Hba0:[function(t,e,n){t("process");var r=t("process"),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};e.exports=u;var o=t("./_stream_readable"),s=t("./_stream_writable");t("inherits")(u,o);for(var a=i(s.prototype),l=0;l>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}n.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(t.lastNeed=i-1),i):--r=0?(i>0&&(t.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":"Wugr"}],mrEY:[function(t,e,n){"use strict";var r=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function t(e,n,o){if("function"==typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=u(e)),r)s.endEmitted?T(t,new E):O(t,s,e,!0);else if(s.ended)T(t,new M);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?O(t,s,e,!1):z(t,s)):O(t,s,e,!1)}else r||(s.reading=!1,z(t,s));return!s.ended&&(s.length=I?t=I:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function N(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=D(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function j(t,e){if(f("onEofChunk"),!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?F(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,B(t)))}}function F(t){var e=t._readableState;f("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,o.nextTick(B,t))}function B(t){var e=t._readableState;f("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,X(t)}function z(t,e){e.readingMore||(e.readingMore=!0,o.nextTick(U,t,e))}function U(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function W(t){f("readable nexttick read 0"),t.read(0)}function V(t,e){e.resumeScheduled||(e.resumeScheduled=!0,o.nextTick(q,t,e))}function q(t,e){f("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),X(t),e.flowing&&!e.reading&&t.read(0)}function X(t){var e=t._readableState;for(f("flow",e.flowing);e.flowing&&null!==t.read(););}function Y(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function Z(t){var e=t._readableState;f("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,o.nextTick(J,e,t))}function J(t,e){if(f("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function K(t,e){for(var n=0,r=t.length;n=e.highWaterMark:e.length>0)||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?Z(this):F(this),null;if(0===(t=N(t,e))&&e.ended)return 0===e.length&&Z(this),null;var r,i=e.needReadable;return f("need readable",i),(0===e.length||e.length-t0?Y(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&Z(this)),null!==r&&this.emit("data",r),r},L.prototype._read=function(t){T(this,new S("_read()"))},L.prototype.pipe=function(t,e){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,f("pipe count=%d opts=%j",r.pipesCount,e);var i=e&&!1===e.end||t===o.stdout||t===o.stderr?m:a;function a(){f("onend"),t.end()}r.endEmitted?o.nextTick(i):n.once("end",i),t.on("unpipe",(function e(i,o){f("onunpipe"),i===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,f("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",l),t.removeListener("error",h),t.removeListener("unpipe",e),n.removeListener("end",a),n.removeListener("end",m),n.removeListener("data",u),c=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}));var l=H(n);t.on("drain",l);var c=!1;function u(e){f("ondata");var i=t.write(e);f("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==K(r.pipes,t))&&!c&&(f("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function h(e){f("onerror",e),m(),t.removeListener("error",h),0===s(t,"error")&&T(t,e)}function d(){t.removeListener("finish",p),m()}function p(){f("onfinish"),t.removeListener("close",d),m()}function m(){f("unpipe"),n.unpipe(t)}return n.on("data",u),A(t,"error",h),t.once("close",d),t.once("finish",p),t.emit("pipe",n),r.flowing||(f("pipe resume"),n.resume()),t},L.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==r.flowing&&this.resume()):"readable"===t&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,f("on readable",r.length,r.reading),r.length?F(this):r.reading||o.nextTick(W,this))),n},L.prototype.addListener=L.prototype.on,L.prototype.removeListener=function(t,e){var n=a.prototype.removeListener.call(this,t,e);return"readable"===t&&o.nextTick(G,this),n},L.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||o.nextTick(G,this),e},L.prototype.resume=function(){var t=this._readableState;return t.flowing||(f("resume"),t.flowing=!t.readableListening,V(this,t)),t.paused=!1,this},L.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},L.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",(function(){if(f("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){f("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o0,(function(t){r||(r=t),t&&s.forEach(c),o||(s.forEach(c),i(r))}))}));return e.reduce(u)}},{"../../../errors":"Yj9o","./end-of-stream":"mrEY"}],tzeh:[function(t,e,n){(n=e.exports=t("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=t("./lib/_stream_writable.js"),n.Duplex=t("./lib/_stream_duplex.js"),n.Transform=t("./lib/_stream_transform.js"),n.PassThrough=t("./lib/_stream_passthrough.js"),n.finished=t("./lib/internal/streams/end-of-stream.js"),n.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_readable.js":"DHrQ","./lib/_stream_writable.js":"WSyY","./lib/_stream_duplex.js":"Hba0","./lib/_stream_transform.js":"tlBz","./lib/_stream_passthrough.js":"nwyA","./lib/internal/streams/end-of-stream.js":"mrEY","./lib/internal/streams/pipeline.js":"AJFC"}],vexR:[function(t,e,n){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],tcrG:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],gfUn:[function(t,e,n){t("process");var r=t("process"),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}})),a=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(e)?r.showHidden=e:e&&n._extend(r,e),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),h(r,t,r.depth)}function c(t,e){var n=l.styles[e];return n?"["+l.colors[n][0]+"m"+t+"["+l.colors[n][1]+"m":t}function u(t,e){return t}function h(t,e,r){if(t.customInspect&&e&&E(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return b(i)||(i=h(t,i,r)),i}var o=f(t,e);if(o)return o;var s=Object.keys(e),a=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),S(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return d(e);if(0===s.length){if(E(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(M(e))return t.stylize(Date.prototype.toString.call(e),"date");if(S(e))return d(e)}var c,u="",g=!1,v=["{","}"];return m(e)&&(g=!0,v=["[","]"]),E(e)&&(u=" [Function"+(e.name?": "+e.name:"")+"]"),x(e)&&(u=" "+RegExp.prototype.toString.call(e)),M(e)&&(u=" "+Date.prototype.toUTCString.call(e)),S(e)&&(u=" "+d(e)),0!==s.length||g&&0!=e.length?r<0?x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=g?function(t,e,n,r,i){for(var o=[],s=0,a=e.length;s60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}(c,u,v)):v[0]+u+v[1]}function f(t,e){if(_(e))return t.stylize("undefined","undefined");if(b(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return y(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,r,i,o){var s,a,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(a=t.stylize("[Setter]","special")),L(r,i)||(s="["+i+"]"),a||(t.seen.indexOf(l.value)<0?(a=v(n)?h(t,l.value,null):h(t,l.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),_(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function m(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function v(t){return null===t}function y(t){return"number"==typeof t}function b(t){return"string"==typeof t}function _(t){return void 0===t}function x(t){return w(t)&&"[object RegExp]"===T(t)}function w(t){return"object"==typeof t&&null!==t}function M(t){return w(t)&&"[object Date]"===T(t)}function S(t){return w(t)&&("[object Error]"===T(t)||t instanceof Error)}function E(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function C(t){return t<10?"0"+t.toString(10):t.toString(10)}n.debuglog=function(t){if(_(s)&&(s=""),t=t.toUpperCase(),!a[t])if(new RegExp("\\b"+t+"\\b","i").test(s)){var e=r.pid;a[t]=function(){var r=n.format.apply(n,arguments);console.error("%s %d: %s",t,e,r)}}else a[t]=function(){};return a[t]},n.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=m,n.isBoolean=g,n.isNull=v,n.isNullOrUndefined=function(t){return null==t},n.isNumber=y,n.isString=b,n.isSymbol=function(t){return"symbol"==typeof t},n.isUndefined=_,n.isRegExp=x,n.isObject=w,n.isDate=M,n.isError=S,n.isFunction=E,n.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},n.isBuffer=t("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var t=new Date,e=[C(t.getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":");return[t.getDate(),A[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n.log=function(){console.log("%s - %s",P(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!w(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}n.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(R&&t[R]){var e;if("function"!=typeof(e=t[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,n,r=new Promise((function(t,r){e=t,n=r})),i=[],o=0;o".charCodeAt(0),s="-".charCodeAt(0),a="/".charCodeAt(0),l="!".charCodeAt(0),c="'".charCodeAt(0),u='"'.charCodeAt(0);function h(){for(var e=[];t[n];)if(t.charCodeAt(n)==i){if(t.charCodeAt(n+1)===a)return(n=t.indexOf(">",n))+1&&(n+=1),e;if(t.charCodeAt(n+1)===l){if(t.charCodeAt(n+2)==s){for(;-1!==n&&(t.charCodeAt(n)!==o||t.charCodeAt(n-1)!=s||t.charCodeAt(n-2)!=s||-1==n);)n=t.indexOf(">",n+1);-1===n&&(n=t.length)}else for(n+=2;t.charCodeAt(n)!==o&&t[n];)n++;n++;continue}var r=m();e.push(r)}else{var c=f();c.trim().length>0&&e.push(c),n++}return e}function f(){var e=n;return-2==(n=t.indexOf("<",n)-1)&&(n=t.length),t.slice(e,n+1)}function d(){for(var e=n;-1==="\n\t>/= ".indexOf(t[n])&&t[n];)n++;return t.slice(e,n)}var p=e.noChildNodes||["img","br","input","meta","link"];function m(){n++;const e=d(),r={};let i=[];for(;t.charCodeAt(n)!==o&&t[n];){var s=t.charCodeAt(n);if(s>64&&s<91||s>96&&s<123){for(var l=d(),f=t.charCodeAt(n);f&&f!==c&&f!==u&&!(f>64&&f<91||f>96&&f<123)&&f!==o;)n++,f=t.charCodeAt(n);if(f===c||f===u){var m=g();if(-1===n)return{tagName:e,attributes:r,children:i}}else m=null,n--;r[l]=m}n++}if(t.charCodeAt(n-1)!==a)if("script"==e){var v=n+1;n=t.indexOf("<\/script>",n),i=[t.slice(v,n-1)],n+=9}else"style"==e?(v=n+1,n=t.indexOf("",n),i=[t.slice(v,n-1)],n+=8):-1==p.indexOf(e)&&(n++,i=h());else n++;return{tagName:e,attributes:r,children:i}}function g(){var e=t[n],r=++n;return n=t.indexOf(e,r),t.slice(r,n)}var v,y=null;if(void 0!==e.attrValue)for(e.attrName=e.attrName||"id",y=[];-1!==(v=new RegExp("\\s"+e.attrName+"\\s*=['\"]"+e.attrValue+"['\"]").exec(t),n=v?v.index:-1);)-1!==(n=t.lastIndexOf("<",n))&&y.push(m()),t=t.substr(n),n=0;else y=e.parseNode?m():h();return e.filter&&(y=r.filter(y,e.filter)),e.setPos&&(y.pos=n),y}r.simplify=function(t){var e={};if(!t.length)return"";if(1===t.length&&"string"==typeof t[0])return t[0];for(var n in t.forEach((function(t){if("object"==typeof t){e[t.tagName]||(e[t.tagName]=[]);var n=r.simplify(t.children||[]);e[t.tagName].push(n),t.attributes&&(n._attributes=t.attributes)}})),e)1==e[n].length&&(e[n]=e[n][0]);return e},r.filter=function(t,e){var n=[];return t.forEach((function(t){if("object"==typeof t&&e(t)&&n.push(t),t.children){var i=r.filter(t.children,e);n=n.concat(i)}})),n},r.stringify=function(t){var e="";function n(t){if(t)for(var n=0;n"}return n(t),e},r.toContentString=function(t){if(Array.isArray(t)){var e="";return t.forEach((function(t){e=(e+=" "+r.toContentString(t)).trim()})),e}return"object"==typeof t?r.toContentString(t.children):" "+t},r.getElementById=function(t,e,n){var i=r(t,{attrValue:e});return n?r.simplify(i):i[0]},r.getElementsByClassName=function(t,e,n){const i=r(t,{attrName:"class",attrValue:"[a-zA-Z0-9-s ]*"+e+"[a-zA-Z0-9-s ]*"});return n?r.simplify(i):i},r.parseStream=function(e,n){if("string"==typeof n&&(n=n.length+2),"string"==typeof e){var i=t("fs");e=i.createReadStream(e,{start:n}),n=0}var o=n,s="";return e.on("data",(function(t){s+=t;for(var n=0;;){if(!(o=s.indexOf("<",o)+1))return void(o=n);if("/"!==s[o+1]){var i=r(s,{pos:o-1,parseNode:!0,setPos:!0});if((o=i.pos)>s.length-1||oo.length-1||i>24)/500+s,l=s-(t[i+2]<<24>>24)/200,c=void 0,u=void 0,h=void 0;u=-.9689*(a=.95047*(a*a*a>.008856?a*a*a:(a-16/116)/7.787))+1.8758*(s=1*(s*s*s>.008856?s*s*s:(s-16/116)/7.787))+.0415*(l=1.08883*(l*l*l>.008856?l*l*l:(l-16/116)/7.787)),h=.0557*a+-.204*s+1.057*l,c=(c=3.2406*a+-1.5372*s+-.4986*l)>.0031308?1.055*Math.pow(c,1/2.4)-.055:12.92*c,u=u>.0031308?1.055*Math.pow(u,1/2.4)-.055:12.92*u,h=h>.0031308?1.055*Math.pow(h,1/2.4)-.055:12.92*h,r[o]=255*Math.max(0,Math.min(1,c)),r[o+1]=255*Math.max(0,Math.min(1,u)),r[o+2]=255*Math.max(0,Math.min(1,h))}return r}},{}],IKSA:[function(t,e,n){"use strict";function r(t,e){var n=t.length-e,r=0;do{for(var i=e;i>0;i--)t[r+e]+=t[r],r++;n-=e}while(n>0)}function i(t,e,n){for(var r=0,i=t.length,o=i/n;i>e;){for(var s=e;s>0;--s)t[r+e]+=t[r],++r;i-=e}for(var a=t.slice(),l=0;l=t.byteLength);++h){var f=void 0;if(2===e){switch(s[0]){case 8:f=new Uint8Array(t,h*u*n*c,u*n*c);break;case 16:f=new Uint16Array(t,h*u*n*c,u*n*c/2);break;case 32:f=new Uint32Array(t,h*u*n*c,u*n*c/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(s[0]," bits per sample."))}r(f,u)}else 3===e&&i(f=new Uint8Array(t,h*u*n*c,u*n*c),u,c)}return t}},{}],FJDe:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(t("@babel/runtime/regenerator")),i=l(t("@babel/runtime/helpers/asyncToGenerator")),o=l(t("@babel/runtime/helpers/classCallCheck")),s=l(t("@babel/runtime/helpers/createClass")),a=t("../predictor");function l(t){return t&&t.__esModule?t:{default:t}}var c=function(){function t(){(0,o.default)(this,t)}return(0,s.default)(t,[{key:"decode",value:function(){var t=(0,i.default)(r.default.mark((function t(e,n){var i,o,s,l,c;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.decodeBlock(n);case 2:if(i=t.sent,1===(o=e.Predictor||1)){t.next=9;break}return s=!e.StripOffsets,l=s?e.TileWidth:e.ImageWidth,c=s?e.TileLength:e.RowsPerStrip||e.ImageLength,t.abrupt("return",(0,a.applyPredictor)(i,o,l,c,e.BitsPerSample,e.PlanarConfiguration));case 9:return t.abrupt("return",i);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()}]),t}();n.default=c},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","../predictor":"IKSA"}],V9bQ:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(t("@babel/runtime/helpers/classCallCheck")),i=l(t("@babel/runtime/helpers/createClass")),o=l(t("@babel/runtime/helpers/inherits")),s=l(t("@babel/runtime/helpers/possibleConstructorReturn")),a=l(t("@babel/runtime/helpers/getPrototypeOf"));function l(t){return t&&t.__esModule?t:{default:t}}var c=function(t){(0,o.default)(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,a.default)(t);if(e){var i=(0,a.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}(n);function n(){return(0,r.default)(this,n),e.apply(this,arguments)}return(0,i.default)(n,[{key:"decodeBlock",value:function(t){return t}}]),n}(l(t("./basedecoder")).default);n.default=c},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./basedecoder":"FJDe"}],tcId:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(t("@babel/runtime/helpers/classCallCheck")),i=l(t("@babel/runtime/helpers/createClass")),o=l(t("@babel/runtime/helpers/inherits")),s=l(t("@babel/runtime/helpers/possibleConstructorReturn")),a=l(t("@babel/runtime/helpers/getPrototypeOf"));function l(t){return t&&t.__esModule?t:{default:t}}function c(t,e){for(var n=e.length-1;n>=0;n--)t.push(e[n]);return t}var u=function(t){(0,o.default)(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,a.default)(t);if(e){var i=(0,a.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}(n);function n(){return(0,r.default)(this,n),e.apply(this,arguments)}return(0,i.default)(n,[{key:"decodeBlock",value:function(t){return function(t){for(var e=new Uint16Array(4093),n=new Uint8Array(4093),r=0;r<=257;r++)e[r]=4096,n[r]=r;var i=258,o=9,s=0;function a(){i=258,o=9}function l(t){var e=function(t,e,n){var r=e%8,i=Math.floor(e/8),o=8-r,s=e+n-8*(i+1),a=8*(i+2)-(e+n),l=8*(i+2)-e;if(a=Math.max(0,a),i>=t.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var c=t[i]&Math.pow(2,8-r)-1,u=c<<=n-o;if(i+1>>a;u+=h<<=Math.max(0,n-l)}if(s>8&&i+2>>f}return u}(t,s,o);return s+=o,e}function u(t,r){return n[i]=r,e[i]=t,++i-1}function h(t){for(var r=[],i=t;4096!==i;i=e[i])r.push(n[i]);return r}var f=[];a();for(var d,p=new Uint8Array(t),m=l(p);257!==m;){if(256===m){for(a(),m=l(p);256===m;)m=l(p);if(257===m)break;if(m>256)throw new Error("corrupted code at scanline ".concat(m));c(f,h(m)),d=m}else if(m=Math.pow(2,o)&&(12===o?d=void 0:o++),m=l(p)}return new Uint8Array(f)}(t).buffer}}]),n}(l(t("./basedecoder")).default);n.default=u},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./basedecoder":"FJDe"}],J7kk:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=u(t("@babel/runtime/helpers/inherits")),i=u(t("@babel/runtime/helpers/possibleConstructorReturn")),o=u(t("@babel/runtime/helpers/getPrototypeOf")),s=u(t("@babel/runtime/helpers/classCallCheck")),a=u(t("@babel/runtime/helpers/createClass")),l=u(t("@babel/runtime/helpers/typeof")),c=u(t("./basedecoder"));function u(t){return t&&t.__esModule?t:{default:t}}var h=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),f=4017,d=799,p=3406,m=2276,g=1567,v=3784,y=5793,b=2896;function _(t,e){for(var n=0,r=[],i=16;i>0&&!t[i-1];)--i;r.push({children:[],index:0});for(var o,s=r[0],a=0;a0;)s=r.pop();for(s.index++,r.push(s);r.length<=a;)r.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;n++}a+10)return m>>--g&1;if(255===(m=t[p++])){var e=t[p++];if(e)throw new Error("unexpected marker: ".concat((m<<8|e).toString(16)))}return g=7,m>>>7}function y(t){for(var e,n=t;null!==(e=v());){if("number"==typeof(n=n[e]))return n;if("object"!==(0,l.default)(n))throw new Error("invalid huffman sequence")}return null}function b(t){for(var e=t,n=0;e>0;){var r=v();if(null===r)return;n=n<<1|r,--e}return n}function _(t){var e=b(t);return e>=1<0)w--;else for(var n=o,r=s;n<=r;){var i=y(t.huffmanTableAC),a=15&i,l=i>>4;if(0===a){if(l<15){w=b(l)+(1<>4,0===f)i<15?(w=b(i)+(1<>4;if(0===s){if(a<15)break;i+=16}else e[h[i+=a]]=_(s),i++}};var k,I,D=0;I=1===O?r[0].blocksPerLine*r[0].blocksPerColumn:u*n.mcusPerColumn;for(var N=i||I;D=65488&&k<=65495))break;p+=2}return p-d}function w(t,e){var n=[],r=e.blocksPerLine,i=e.blocksPerColumn,o=r<<3,s=new Int32Array(64),a=new Uint8Array(64);function l(t,n,r){var i,o,s,a,l,c,u,h,_,x,w=e.quantizationTable,M=r;for(x=0;x<64;x++)M[x]=t[x]*w[x];for(x=0;x<8;++x){var S=8*x;0!==M[1+S]||0!==M[2+S]||0!==M[3+S]||0!==M[4+S]||0!==M[5+S]||0!==M[6+S]||0!==M[7+S]?(i=y*M[0+S]+128>>8,o=y*M[4+S]+128>>8,s=M[2+S],a=M[6+S],l=b*(M[1+S]-M[7+S])+128>>8,h=b*(M[1+S]+M[7+S])+128>>8,c=M[3+S]<<4,u=M[5+S]<<4,_=i-o+1>>1,i=i+o+1>>1,o=_,_=s*v+a*g+128>>8,s=s*g-a*v+128>>8,a=_,_=l-u+1>>1,l=l+u+1>>1,u=_,_=h+c+1>>1,c=h-c+1>>1,h=_,_=i-a+1>>1,i=i+a+1>>1,a=_,_=o-s+1>>1,o=o+s+1>>1,s=_,_=l*m+h*p+2048>>12,l=l*p-h*m+2048>>12,h=_,_=c*d+u*f+2048>>12,c=c*f-u*d+2048>>12,u=_,M[0+S]=i+h,M[7+S]=i-h,M[1+S]=o+u,M[6+S]=o-u,M[2+S]=s+c,M[5+S]=s-c,M[3+S]=a+l,M[4+S]=a-l):(_=y*M[0+S]+512>>10,M[0+S]=_,M[1+S]=_,M[2+S]=_,M[3+S]=_,M[4+S]=_,M[5+S]=_,M[6+S]=_,M[7+S]=_)}for(x=0;x<8;++x){var E=x;0!==M[8+E]||0!==M[16+E]||0!==M[24+E]||0!==M[32+E]||0!==M[40+E]||0!==M[48+E]||0!==M[56+E]?(i=y*M[0+E]+2048>>12,o=y*M[32+E]+2048>>12,s=M[16+E],a=M[48+E],l=b*(M[8+E]-M[56+E])+2048>>12,h=b*(M[8+E]+M[56+E])+2048>>12,c=M[24+E],u=M[40+E],_=i-o+1>>1,i=i+o+1>>1,o=_,_=s*v+a*g+2048>>12,s=s*g-a*v+2048>>12,a=_,_=l-u+1>>1,l=l+u+1>>1,u=_,_=h+c+1>>1,c=h-c+1>>1,h=_,_=i-a+1>>1,i=i+a+1>>1,a=_,_=o-s+1>>1,o=o+s+1>>1,s=_,_=l*m+h*p+2048>>12,l=l*p-h*m+2048>>12,h=_,_=c*d+u*f+2048>>12,c=c*f-u*d+2048>>12,u=_,M[0+E]=i+h,M[56+E]=i-h,M[8+E]=o+u,M[48+E]=o-u,M[16+E]=s+c,M[40+E]=s-c,M[24+E]=a+l,M[32+E]=a-l):(_=y*r[x+0]+8192>>14,M[0+E]=_,M[8+E]=_,M[16+E]=_,M[24+E]=_,M[32+E]=_,M[40+E]=_,M[48+E]=_,M[56+E]=_)}for(x=0;x<64;++x){var T=128+(M[x]+8>>4);n[x]=T<0?0:T>255?255:T}}for(var c=0;c>4==0)for(var f=0;f<64;f++)u[h[f]]=t[e++];else{if(c>>4!=1)throw new Error("DQT: invalid table spec");for(var d=0;d<64;d++)u[h[d]]=n()}this.quantizationTables[15&c]=u}break;case 65472:case 65473:case 65474:n();for(var p={extended:65473===s,progressive:65474===s,precision:t[e++],scanLines:n(),samplesPerLine:n(),components:{},componentsOrder:[]},m=t[e++],g=void 0,v=0;v>4,b=15&t[e+1],w=t[e+2];p.componentsOrder.push(g),p.components[g]={h:y,v:b,quantizationIdx:w},e+=3}r(p),this.frames.push(p);break;case 65476:for(var M=n(),S=2;S>4==0?this.huffmanTablesDC[15&E]=_(T,P):this.huffmanTablesAC[15&E]=_(T,P)}break;case 65501:n(),this.resetInterval=n();break;case 65498:n();for(var R=t[e++],O=[],k=this.frames[0],I=0;I>4],D.huffmanTableAC=this.huffmanTablesAC[15&N],O.push(D)}var j=t[e++],F=t[e++],B=t[e++],z=x(t,e,k,O,this.resetInterval,j,F,B>>4,15&B);e+=z;break;case 65535:255!==t[e]&&e--;break;default:if(255===t[e-3]&&t[e-2]>=192&&t[e-2]<=254){e-=3;break}throw new Error("unknown JPEG marker ".concat(s.toString(16)))}s=n()}}},{key:"getResult",value:function(){var t=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var e=0;e>>16&65535|0,s=0;0!==n;){n-=s=n>2e3?2e3:n;do{o=o+(i=i+e[r++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16|0}},{}],X4kj:[function(t,e,n){"use strict";var r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,i){var o=r,s=i+n;t^=-1;for(var a=i;a>>8^o[255&(t^e[a])];return-1^t}},{}],LP5M:[function(t,e,n){"use strict";e.exports=function(t,e){var n,r,i,o,s,a,l,c,u,h,f,d,p,m,g,v,y,b,_,x,w,M,S,E,T;n=t.state,r=t.next_in,E=t.input,i=r+(t.avail_in-5),o=t.next_out,T=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),l=n.dmax,c=n.wsize,u=n.whave,h=n.wnext,f=n.window,d=n.hold,p=n.bits,m=n.lencode,g=n.distcode,v=(1<>>=_=b>>>24,p-=_,0==(_=b>>>16&255))T[o++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=m[(65535&b)+(d&(1<<_)-1)];continue e}if(32&_){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}x=65535&b,(_&=15)&&(p<_&&(d+=E[r++]<>>=_,p-=_),p<15&&(d+=E[r++]<>>=_=b>>>24,p-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=g[(65535&b)+(d&(1<<_)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(w=65535&b,p<(_&=15)&&(d+=E[r++]<l){t.msg="invalid distance too far back",n.mode=30;break t}if(d>>>=_,p-=_,w>(_=o-s)){if((_=w-_)>u&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(M=0,S=f,0===h){if(M+=c-_,_2;)T[o++]=S[M++],T[o++]=S[M++],T[o++]=S[M++],x-=3;x&&(T[o++]=S[M++],x>1&&(T[o++]=S[M++]))}else{M=o-w;do{T[o++]=T[M++],T[o++]=T[M++],T[o++]=T[M++],x-=3}while(x>2);x&&(T[o++]=T[M++],x>1&&(T[o++]=T[M++]))}break}}break}}while(r>3,d&=(1<<(p-=x<<3))-1,t.next_in=r,t.next_out=o,t.avail_in=r=1&&0===D[T];T--);if(C>T&&(C=T),0===T)return c[u++]=20971520,c[u++]=20971520,f.bits=1,0;for(E=1;E0&&(0===t||1!==T))return-1;for(N[1]=0,M=1;M<15;M++)N[M+1]=N[M]+D[M];for(S=0;S852||2===t&&R>592)return 1;for(;;){b=M-P,h[S]y?(_=j[F+h[S]],x=k[I+h[S]]):(_=96,x=0),d=1<>P)+(p-=d)]=b<<24|_<<16|x|0}while(0!==p);for(d=1<>=1;if(0!==d?(O&=d-1,O+=d):O=0,S++,0==--D[M]){if(M===T)break;M=e[n+h[S]]}if(M>C&&(O&g)!==m){for(0===P&&(P=C),v+=E,L=1<<(A=M-P);A+P852||2===t&&R>592)return 1;c[m=O&g]=C<<24|A<<16|v-u|0}}return 0!==O&&(c[v+O]=M-P<<24|64<<16|0),f.bits=C,0}},{"../utils/common":"tbG5"}],GIDK:[function(t,e,n){"use strict";var r=t("../utils/common"),i=t("./adler32"),o=t("./crc32"),s=t("./inffast"),a=t("./inftrees"),l=-2,c=12,u=30;function h(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function f(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(852),e.distcode=e.distdyn=new r.Buf32(592),e.sane=1,e.back=-1,0):l}function p(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,d(t)):l}function m(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?l:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,p(t))):l}function g(t,e){var n,r;return t?(r=new f,t.state=r,r.window=null,0!==(n=m(t,e))&&(t.state=null),n):l}var v,y,b=!0;function _(t){if(b){var e;for(v=new r.Buf32(512),y=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,v,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,y,0,t.work,{bits:5}),b=!1}t.lencode=v,t.lenbits=9,t.distcode=y,t.distbits=5}function x(t,e,n,i){var o,s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(r.arraySet(s.window,e,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),r.arraySet(s.window,e,n-i,o,s.wnext),(i-=o)?(r.arraySet(s.window,e,n-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,n.check=o(n.check,F,2,0),y=0,b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&y)<<8)+(y>>8))%31){t.msg="incorrect header check",n.mode=u;break}if(8!=(15&y)){t.msg="unknown compression method",n.mode=u;break}if(b-=4,k=8+(15&(y>>>=4)),0===n.wbits)n.wbits=k;else if(k>n.wbits){t.msg="invalid window size",n.mode=u;break}n.dmax=1<>8&1),512&n.flags&&(F[0]=255&y,F[1]=y>>>8&255,n.check=o(n.check,F,2,0)),y=0,b=0,n.mode=3;case 3:for(;b<32;){if(0===g)break t;g--,y+=f[p++]<>>8&255,F[2]=y>>>16&255,F[3]=y>>>24&255,n.check=o(n.check,F,4,0)),y=0,b=0,n.mode=4;case 4:for(;b<16;){if(0===g)break t;g--,y+=f[p++]<>8),512&n.flags&&(F[0]=255&y,F[1]=y>>>8&255,n.check=o(n.check,F,2,0)),y=0,b=0,n.mode=5;case 5:if(1024&n.flags){for(;b<16;){if(0===g)break t;g--,y+=f[p++]<>>8&255,n.check=o(n.check,F,2,0)),y=0,b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((S=n.length)>g&&(S=g),S&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,f,p,S,k)),512&n.flags&&(n.check=o(n.check,f,S,p)),g-=S,p+=S,n.length-=S),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===g)break t;S=0;do{k=f[p+S++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k))}while(k&&S>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=c;break;case 10:for(;b<32;){if(0===g)break t;g--,y+=f[p++]<>>=7&b,b-=7&b,n.mode=27;break}for(;b<3;){if(0===g)break t;g--,y+=f[p++]<>>=1)){case 0:n.mode=14;break;case 1:if(_(n),n.mode=20,6===e){y>>>=2,b-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=u}y>>>=2,b-=2;break;case 14:for(y>>>=7&b,b-=7&b;b<32;){if(0===g)break t;g--,y+=f[p++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=u;break}if(n.length=65535&y,y=0,b=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(S=n.length){if(S>g&&(S=g),S>v&&(S=v),0===S)break t;r.arraySet(d,f,p,S,m),g-=S,p+=S,v-=S,m+=S,n.length-=S;break}n.mode=c;break;case 17:for(;b<14;){if(0===g)break t;g--,y+=f[p++]<>>=5,b-=5,n.ndist=1+(31&y),y>>>=5,b-=5,n.ncode=4+(15&y),y>>>=4,b-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=u;break}n.have=0,n.mode=18;case 18:for(;n.have>>=3,b-=3}for(;n.have<19;)n.lens[B[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,D={bits:n.lenbits},I=a(0,n.lens,0,19,n.lencode,0,n.work,D),n.lenbits=D.bits,I){t.msg="invalid code lengths set",n.mode=u;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,P=65535&j,!((C=j>>>24)<=b);){if(0===g)break t;g--,y+=f[p++]<>>=C,b-=C,n.lens[n.have++]=P;else{if(16===P){for(N=C+2;b>>=C,b-=C,0===n.have){t.msg="invalid bit length repeat",n.mode=u;break}k=n.lens[n.have-1],S=3+(3&y),y>>>=2,b-=2}else if(17===P){for(N=C+3;b>>=C)),y>>>=3,b-=3}else{for(N=C+7;b>>=C)),y>>>=7,b-=7}if(n.have+S>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=u;break}for(;S--;)n.lens[n.have++]=k}}if(n.mode===u)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=u;break}if(n.lenbits=9,D={bits:n.lenbits},I=a(1,n.lens,0,n.nlen,n.lencode,0,n.work,D),n.lenbits=D.bits,I){t.msg="invalid literal/lengths set",n.mode=u;break}if(n.distbits=6,n.distcode=n.distdyn,D={bits:n.distbits},I=a(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,D),n.distbits=D.bits,I){t.msg="invalid distances set",n.mode=u;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(g>=6&&v>=258){t.next_out=m,t.avail_out=v,t.next_in=p,t.avail_in=g,n.hold=y,n.bits=b,s(t,M),m=t.next_out,d=t.output,v=t.avail_out,p=t.next_in,f=t.input,g=t.avail_in,y=n.hold,b=n.bits,n.mode===c&&(n.back=-1);break}for(n.back=0;A=(j=n.lencode[y&(1<>>16&255,P=65535&j,!((C=j>>>24)<=b);){if(0===g)break t;g--,y+=f[p++]<>L)])>>>16&255,P=65535&j,!(L+(C=j>>>24)<=b);){if(0===g)break t;g--,y+=f[p++]<>>=L,b-=L,n.back+=L}if(y>>>=C,b-=C,n.back+=C,n.length=P,0===A){n.mode=26;break}if(32&A){n.back=-1,n.mode=c;break}if(64&A){t.msg="invalid literal/length code",n.mode=u;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(N=n.extra;b>>=n.extra,b-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(j=n.distcode[y&(1<>>16&255,P=65535&j,!((C=j>>>24)<=b);){if(0===g)break t;g--,y+=f[p++]<>L)])>>>16&255,P=65535&j,!(L+(C=j>>>24)<=b);){if(0===g)break t;g--,y+=f[p++]<>>=L,b-=L,n.back+=L}if(y>>>=C,b-=C,n.back+=C,64&A){t.msg="invalid distance code",n.mode=u;break}n.offset=P,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(N=n.extra;b>>=n.extra,b-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=u;break}n.mode=25;case 25:if(0===v)break t;if(S=M-v,n.offset>S){if((S=n.offset-S)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=u;break}S>n.wnext?(S-=n.wnext,E=n.wsize-S):E=n.wnext-S,S>n.length&&(S=n.length),T=n.window}else T=d,E=m-n.offset,S=n.length;S>v&&(S=v),v-=S,n.length-=S;do{d[m++]=T[E++]}while(--S);0===n.length&&(n.mode=21);break;case 26:if(0===v)break t;d[m++]=n.length,v--,n.mode=21;break;case 27:if(n.wrap){for(;b<32;){if(0===g)break t;g--,y|=f[p++]<=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function l(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var n="",s=0;s>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},n.buf2binstring=function(t){return l(t,t.length)},n.binstring2buf=function(t){for(var e=new r.Buf8(t.length),n=0,i=e.length;n4)c[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&n1?c[r++]=65533:i<65536?c[r++]=i:(i-=65536,c[r++]=55296|i>>10&1023,c[r++]=56320|1023&i)}return l(c,r)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+s[t[n]]>e?n:e}},{"./common":"tbG5"}],xUUw:[function(t,e,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],gMAY:[function(t,e,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],bdtv:[function(t,e,n){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],WIli:[function(t,e,n){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],faQk:[function(t,e,n){"use strict";var r=t("./zlib/inflate"),i=t("./utils/common"),o=t("./utils/strings"),s=t("./zlib/constants"),a=t("./zlib/messages"),l=t("./zlib/zstream"),c=t("./zlib/gzheader"),u=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,e.windowBits);if(n!==s.Z_OK)throw new Error(a[n]);if(this.header=new c,r.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=r.inflateSetDictionary(this.strm,e.dictionary))!==s.Z_OK))throw new Error(a[n])}function f(t,e){var n=new h(e);if(n.push(t,!0),n.err)throw n.msg||a[n.err];return n.result}h.prototype.push=function(t,e){var n,a,l,c,h,f=this.strm,d=this.options.chunkSize,p=this.options.dictionary,m=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?f.input=o.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(d),f.next_out=0,f.avail_out=d),(n=r.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&p&&(n=r.inflateSetDictionary(this.strm,p)),n===s.Z_BUF_ERROR&&!0===m&&(n=s.Z_OK,m=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&n!==s.Z_STREAM_END&&(0!==f.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(f.output,f.next_out),c=f.next_out-l,h=o.buf2string(f.output,l),f.next_out=c,f.avail_out=d-c,c&&i.arraySet(f.output,f.output,l,c,0),this.onData(h)):this.onData(i.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(m=!0)}while((f.avail_in>0||0===f.avail_out)&&n!==s.Z_STREAM_END);return n===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),f.avail_out=0,!0)},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=h,n.inflate=f,n.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},n.ungzip=f},{"./zlib/inflate":"GIDK","./utils/common":"tbG5","./utils/strings":"Q3ZD","./zlib/constants":"xUUw","./zlib/messages":"gMAY","./zlib/zstream":"bdtv","./zlib/gzheader":"WIli"}],JAiC:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=c(t("@babel/runtime/helpers/classCallCheck")),i=c(t("@babel/runtime/helpers/createClass")),o=c(t("@babel/runtime/helpers/inherits")),s=c(t("@babel/runtime/helpers/possibleConstructorReturn")),a=c(t("@babel/runtime/helpers/getPrototypeOf")),l=t("pako/lib/inflate");function c(t){return t&&t.__esModule?t:{default:t}}var u=function(t){(0,o.default)(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,a.default)(t);if(e){var i=(0,a.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}(n);function n(){return(0,r.default)(this,n),e.apply(this,arguments)}return(0,i.default)(n,[{key:"decodeBlock",value:function(t){return(0,l.inflate)(new Uint8Array(t)).buffer}}]),n}(c(t("./basedecoder")).default);n.default=u},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","pako/lib/inflate":"faQk","./basedecoder":"FJDe"}],OcPz:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(t("@babel/runtime/helpers/classCallCheck")),i=l(t("@babel/runtime/helpers/createClass")),o=l(t("@babel/runtime/helpers/inherits")),s=l(t("@babel/runtime/helpers/possibleConstructorReturn")),a=l(t("@babel/runtime/helpers/getPrototypeOf"));function l(t){return t&&t.__esModule?t:{default:t}}var c=function(t){(0,o.default)(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,a.default)(t);if(e){var i=(0,a.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}(n);function n(){return(0,r.default)(this,n),e.apply(this,arguments)}return(0,i.default)(n,[{key:"decodeBlock",value:function(t){for(var e=new DataView(t),n=[],r=0;r3&&void 0!==arguments[3]?arguments[3]:1;return new(Object.getPrototypeOf(t).constructor)(e*n*r)}function i(t,e,n,i,o){var s=e/i,a=n/o;return t.map((function(t){for(var l=r(t,i,o),c=0;c5&&void 0!==arguments[5]?arguments[5]:"nearest";switch(a.toLowerCase()){case"nearest":return i(t,e,n,r,o);case"bilinear":case"linear":return s(t,e,n,r,o);default:throw new Error("Unsupported resampling method: '".concat(a,"'"))}},n.resampleNearestInterleaved=a,n.resampleBilinearInterleaved=l,n.resampleInterleaved=function(t,e,n,r,i,o){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"nearest";switch(s.toLowerCase()){case"nearest":return a(t,e,n,r,i,o);case"bilinear":case"linear":return l(t,e,n,r,i,o);default:throw new Error("Unsupported resampling method: '".concat(s,"'"))}}},{}],eOWo:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=p(t("@babel/runtime/helpers/slicedToArray")),i=p(t("@babel/runtime/regenerator")),o=p(t("@babel/runtime/helpers/asyncToGenerator")),s=p(t("@babel/runtime/helpers/classCallCheck")),a=p(t("@babel/runtime/helpers/createClass")),l=t("@petamoriken/float16"),c=p(t("txml")),u=t("./globals"),h=t("./rgb"),f=t("./compression"),d=t("./resample");function p(t){return t&&t.__esModule?t:{default:t}}function m(t,e,n){for(var r=0,i=e;i>8-i-x&u;else if(x+i<=16)c[b]=a.getUint16(_)>>16-i-x&u;else if(x+i<=24){var w=a.getUint16(_)<<8|a.getUint8(_+2);c[b]=w>>24-i-x&u}else c[b]=a.getUint32(_)>>32-i-x&u}}return c.buffer}var b=function(){function t(e,n,r,i,o,a){(0,s.default)(this,t),this.fileDirectory=e,this.geoKeys=n,this.dataView=r,this.littleEndian=i,this.tiles=o?{}:null,this.isTiled=!e.StripOffsets;var l=e.PlanarConfiguration;if(this.planarConfiguration=void 0===l?1:l,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=a}return(0,a.default)(t,[{key:"getFileDirectory",value:function(){return this.fileDirectory}},{key:"getGeoKeys",value:function(){return this.geoKeys}},{key:"getWidth",value:function(){return this.fileDirectory.ImageWidth}},{key:"getHeight",value:function(){return this.fileDirectory.ImageLength}},{key:"getSamplesPerPixel",value:function(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}},{key:"getTileWidth",value:function(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}},{key:"getTileHeight",value:function(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}},{key:"getBlockWidth",value:function(){return this.getTileWidth()}},{key:"getBlockHeight",value:function(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}},{key:"getBytesPerPixel",value:function(){for(var t=0,e=0;e=this.fileDirectory.BitsPerSample.length)throw new RangeError("Sample index ".concat(t," is out of range."));return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}},{key:"getReaderForSample",value:function(t){var e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,n=this.fileDirectory.BitsPerSample[t];switch(e){case 1:if(n<=8)return DataView.prototype.getUint8;if(n<=16)return DataView.prototype.getUint16;if(n<=32)return DataView.prototype.getUint32;break;case 2:if(n<=8)return DataView.prototype.getInt8;if(n<=16)return DataView.prototype.getInt16;if(n<=32)return DataView.prototype.getInt32;break;case 3:switch(n){case 16:return function(t,e){return(0,l.getFloat16)(this,t,e)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}},{key:"getSampleFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}},{key:"getBitsPerSample",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.BitsPerSample[t]}},{key:"getArrayForSample",value:function(t,e){return g(this.getSampleFormat(t),this.getBitsPerSample(t),e)}},{key:"getTileOrStrip",value:function(){var t=(0,o.default)(i.default.mark((function t(e,n,r,s,a){var l,c,u,h,f,d,p,m,g=this;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l=Math.ceil(this.getWidth()/this.getTileWidth()),c=Math.ceil(this.getHeight()/this.getTileHeight()),h=this.tiles,1===this.planarConfiguration?u=n*l+e:2===this.planarConfiguration&&(u=r*l*c+n*l+e),this.isTiled?(f=this.fileDirectory.TileOffsets[u],d=this.fileDirectory.TileByteCounts[u]):(f=this.fileDirectory.StripOffsets[u],d=this.fileDirectory.StripByteCounts[u]),t.next=7,this.source.fetch([{offset:f,length:d}],a);case 7:return p=t.sent[0],null!==h&&h[u]?m=h[u]:(m=(0,o.default)(i.default.mark((function t(){var e,r,o;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.decode(g.fileDirectory,p);case 2:return e=t.sent,r=g.getSampleFormat(),o=g.getBitsPerSample(),v(r,o)&&(e=y(e,r,g.planarConfiguration,g.getSamplesPerPixel(),o,g.getTileWidth(),g.getBlockHeight(n))),t.abrupt("return",e);case 7:case"end":return t.stop()}}),t)})))(),null!==h&&(h[u]=m)),t.t0=e,t.t1=n,t.t2=r,t.next=14,m;case 14:return t.t3=t.sent,t.abrupt("return",{x:t.t0,y:t.t1,sample:t.t2,data:t.t3});case 16:case"end":return t.stop()}}),t,this)})));return function(e,n,r,i,o){return t.apply(this,arguments)}}()},{key:"_readRaster",value:function(){var t=(0,o.default)(i.default.mark((function t(e,n,r,o,s,a,l,c,u){var h,f,p,g,v,y,b,_,x,w,M,S,E,T,C,A,P,L,R=this;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(h=this.getTileWidth(),f=this.getTileHeight(),p=Math.max(Math.floor(e[0]/h),0),g=Math.min(Math.ceil(e[2]/h),Math.ceil(this.getWidth()/this.getTileWidth())),v=Math.max(Math.floor(e[1]/f),0),y=Math.min(Math.ceil(e[3]/f),Math.ceil(this.getHeight()/this.getTileHeight())),b=e[2]-e[0],_=this.getBytesPerPixel(),x=[],w=[],M=0;M0&&void 0!==L[0]?L[0]:{},n=e.window,r=e.samples,o=void 0===r?[]:r,s=e.interleave,a=e.pool,l=void 0===a?null:a,c=e.width,u=e.height,h=e.resampleMethod,d=e.fillValue,p=e.signal,!((m=n||[0,0,this.getWidth(),this.getHeight()])[0]>m[2]||m[1]>m[3])){t.next=4;break}throw new Error("Invalid subsets");case 4:if(v=m[2]-m[0],y=m[3]-m[1],b=v*y,_=this.getSamplesPerPixel(),o&&o.length){t.next=12;break}for(x=0;x<_;++x)o.push(x);t.next=19;break;case 12:w=0;case 13:if(!(w=_)){t.next=16;break}return t.abrupt("return",Promise.reject(new RangeError("Invalid sample index '".concat(o[w],"'."))));case 16:++w,t.next=13;break;case 19:if(s)S=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,E=Math.max.apply(null,this.fileDirectory.BitsPerSample),M=g(S,E,b*o.length),d&&M.fill(d);else for(M=[],T=0;T0&&void 0!==S[0]?S[0]:{},n=e.window,r=e.pool,o=void 0===r?null:r,s=e.width,a=e.height,l=e.resampleMethod,c=e.enableAlpha,f=void 0!==c&&c,d=e.signal,!((p=n||[0,0,this.getWidth(),this.getHeight()])[0]>p[2]||p[1]>p[3])){t.next=4;break}throw new Error("Invalid subsets");case 4:if((m=this.fileDirectory.PhotometricInterpretation)!==u.photometricInterpretations.RGB){t.next=9;break}if(g=[0,1,2],this.fileDirectory.ExtraSamples!==u.ExtraSamplesValues.Unspecified&&f)for(g=[],v=0;v0&&void 0!==arguments[0]?arguments[0]:null,e={};if(!this.fileDirectory.GDAL_METADATA)return null;var n=this.fileDirectory.GDAL_METADATA,r=(0,c.default)(n.substring(0,n.length-1));if(!r[0].tagName)throw new Error("Failed to parse GDAL metadata XML.");var i=r[0];if("GDALMetadata"!==i.tagName)throw new Error("Unexpected GDAL metadata XML tag.");var o=i.children.filter((function(t){return"Item"===t.tagName}));null!==t&&(o=o.filter((function(e){return Number(e.attributes.sample)===t})));for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:null,e=this.fileDirectory.ModelPixelScale,n=this.fileDirectory.ModelTransformation;if(e)return[e[0],-e[1],e[2]];if(n)return[n[0],n[5],n[10]];if(t){var i=t.getResolution(),o=(0,r.default)(i,3),s=o[0],a=o[1],l=o[2];return[s*t.getWidth()/this.getWidth(),a*t.getHeight()/this.getHeight(),l*t.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}},{key:"pixelIsArea",value:function(){return 1===this.geoKeys.GTRasterTypeGeoKey}},{key:"getBoundingBox",value:function(){var t=this.getOrigin(),e=this.getResolution(),n=t[0],r=t[1],i=n+e[0]*this.getWidth(),o=r+e[1]*this.getHeight();return[Math.min(n,i),Math.min(r,o),Math.max(n,i),Math.max(r,o)]}}]),t}();n.default=b},{"@babel/runtime/helpers/slicedToArray":"HETk","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@petamoriken/float16":"Stm8",txml:"JO74","./globals":"j27V","./rgb":"fpBl","./compression":"FGCZ","./resample":"OQju"}],dqpX:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=s(t("@babel/runtime/helpers/classCallCheck")),i=s(t("@babel/runtime/helpers/createClass")),o=t("@petamoriken/float16");function s(t){return t&&t.__esModule?t:{default:t}}var a=function(){function t(e){(0,r.default)(this,t),this._dataView=new DataView(e)}return(0,i.default)(t,[{key:"getUint64",value:function(t,e){var n,r=this.getUint32(t,e),i=this.getUint32(t+4,e);if(e){if(n=r+Math.pow(2,32)*i,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return n}if(n=Math.pow(2,32)*r+i,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return n}},{key:"getInt64",value:function(t,e){for(var n=0,r=(128&this._dataView.getUint8(t+(e?7:0)))>0,i=!0,o=0;o<8;o++){var s=this._dataView.getUint8(t+(e?o:7-o));r&&(i?0!==s&&(s=255&~(s-1),i=!1):s=255&~s),n+=s*Math.pow(256,o)}return r&&(n=-n),n}},{key:"getUint8",value:function(t,e){return this._dataView.getUint8(t,e)}},{key:"getInt8",value:function(t,e){return this._dataView.getInt8(t,e)}},{key:"getUint16",value:function(t,e){return this._dataView.getUint16(t,e)}},{key:"getInt16",value:function(t,e){return this._dataView.getInt16(t,e)}},{key:"getUint32",value:function(t,e){return this._dataView.getUint32(t,e)}},{key:"getInt32",value:function(t,e){return this._dataView.getInt32(t,e)}},{key:"getFloat16",value:function(t,e){return(0,o.getFloat16)(this._dataView,e)}},{key:"getFloat32",value:function(t,e){return this._dataView.getFloat32(t,e)}},{key:"getFloat64",value:function(t,e){return this._dataView.getFloat64(t,e)}},{key:"buffer",get:function(){return this._dataView.buffer}}]),t}();n.default=a},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@petamoriken/float16":"Stm8"}],dGLV:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(t("@babel/runtime/helpers/classCallCheck")),i=o(t("@babel/runtime/helpers/createClass"));function o(t){return t&&t.__esModule?t:{default:t}}var s=function(){function t(e,n,i,o){(0,r.default)(this,t),this._dataView=new DataView(e),this._sliceOffset=n,this._littleEndian=i,this._bigTiff=o}return(0,i.default)(t,[{key:"covers",value:function(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}},{key:"readUint8",value:function(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}},{key:"readInt8",value:function(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}},{key:"readUint16",value:function(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}},{key:"readInt16",value:function(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}},{key:"readUint32",value:function(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}},{key:"readInt32",value:function(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}},{key:"readFloat32",value:function(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}},{key:"readFloat64",value:function(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}},{key:"readUint64",value:function(t){var e,n=this.readUint32(t),r=this.readUint32(t+4);if(this._littleEndian){if(e=n+Math.pow(2,32)*r,!Number.isSafeInteger(e))throw new Error("".concat(e," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return e}if(e=Math.pow(2,32)*n+r,!Number.isSafeInteger(e))throw new Error("".concat(e," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return e}},{key:"readInt64",value:function(t){for(var e=0,n=(128&this._dataView.getUint8(t+(this._littleEndian?7:0)))>0,r=!0,i=0;i<8;i++){var o=this._dataView.getUint8(t+(this._littleEndian?i:7-i));n&&(r?0!==o&&(o=255&~(o-1),r=!1):o=255&~o),e+=o*Math.pow(256,i)}return n&&(e=-e),e}},{key:"readOffset",value:function(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}},{key:"sliceOffset",get:function(){return this._sliceOffset}},{key:"sliceTop",get:function(){return this._sliceOffset+this.buffer.byteLength}},{key:"littleEndian",get:function(){return this._littleEndian}},{key:"bigTiff",get:function(){return this._bigTiff}},{key:"buffer",get:function(){return this._dataView.buffer}}]),t}();n.default=s},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW"}],z2GM:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.extendSerializer=function(t,e){const n=t.deserialize.bind(t),r=t.serialize.bind(t);return{deserialize:t=>e.deserialize(t,n),serialize:t=>e.serialize(t,r)}},n.DefaultSerializer=void 0;const r={deserialize:t=>(t=>t&&"object"==typeof t&&"__error_marker"in t&&"$$error"===t.__error_marker)(t)?(t=>Object.assign(Error(t.message),{name:t.name,stack:t.stack}))(t):t,serialize:t=>t instanceof Error?(t=>({__error_marker:"$$error",message:t.message,name:t.name,stack:t.stack}))(t):t};n.DefaultSerializer=r},{}],kdjL:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.registerSerializer=function(t){i=(0,r.extendSerializer)(i,t)},n.deserialize=function(t){return i.deserialize(t)},n.serialize=function(t){return i.serialize(t)};var r=t("./serializers");let i=r.DefaultSerializer},{"./serializers":"z2GM"}],LQHy:[function(t,e,n){"use strict";let r;function i(t){return(""+t).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}Object.defineProperty(n,"__esModule",{value:!0}),n.getBaseURL=i,n.getBundleURL=function(){return r||(r=function(){try{throw new Error}catch(t){const e=(""+t.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(e)return i(e[0])}return"/"}()),r}},{}],XK2w:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.selectWorkerImplementation=function(){return"undefined"==typeof Worker?class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}}:class extends Worker{constructor(t,e){"string"==typeof t&&e&&e._baseURL?t=new URL(t,e._baseURL):"string"==typeof t&&!o(t)&&(0,r.getBundleURL)().match(/^file:\/\//i)&&(t=new URL(t,(0,r.getBundleURL)().replace(/\/[^\/]+$/,"/")),t=s(`importScripts(${JSON.stringify(t)});`)),"string"==typeof t&&o(t)&&(t=s(`importScripts(${JSON.stringify(t)});`)),super(t,e)}}},n.defaultPoolSize=void 0;var r=t("./get-bundle-url.browser");const i="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;n.defaultPoolSize=i;const o=t=>/^(file|https?:)?\/\//i.test(t);function s(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}},{"./get-bundle-url.browser":"LQHy"}],IAgR:[function(t,e,n){var r=1e3,i=6e4,o=60*i,s=24*o;function a(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}e.exports=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return 6048e5*n;case"days":case"day":case"d":return n*s;case"hours":case"hour":case"hrs":case"hr":case"h":return n*o;case"minutes":case"minute":case"mins":case"min":case"m":return n*i;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(t);if("number"===n&&isFinite(t))return e.long?function(t){var e=Math.abs(t);return e>=s?a(t,e,s,"day"):e>=o?a(t,e,o,"hour"):e>=i?a(t,e,i,"minute"):e>=r?a(t,e,r,"second"):t+" ms"}(t):function(t){var e=Math.abs(t);return e>=s?Math.round(t/s)+"d":e>=o?Math.round(t/o)+"h":e>=i?Math.round(t/i)+"m":e>=r?Math.round(t/r)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],Kest:[function(t,e,n){e.exports=function(e){function n(t){let e=0;for(let n=0;n{if("%%"===e)return e;a++;const o=r.formatters[i];if("function"==typeof o){const r=t[a];e=o.call(n,r),t.splice(a,1),a--}return e}),r.formatArgs.call(n,t),(n.log||r.log).apply(n,t)}return s.namespace=t,s.enabled=r.enabled(t),s.useColors=r.useColors(),s.color=n(t),s.destroy=i,s.extend=o,"function"==typeof r.init&&r.init(s),r.instances.push(s),s}function i(){const t=r.instances.indexOf(this);return-1!==t&&(r.instances.splice(t,1),!0)}function o(t,e){const n=r(this.namespace+(void 0===e?":":e)+t);return n.log=this.log,n}function s(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(t){return t instanceof Error?t.stack||t.message:t},r.disable=function(){const t=[...r.names.map(s),...r.skips.map(s).map(t=>"-"+t)].join(",");return r.enable(""),t},r.enable=function(t){let e;r.save(t),r.names=[],r.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(e=0;e{r[t]=e[t]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=n,r.enable(r.load()),r}},{ms:"IAgR"}],jcLW:[function(t,e,n){t("process");var r=t("process");n.log=function(...t){return"object"==typeof console&&console.log&&console.log(...t)},n.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))}),t.splice(i,0,n)},n.save=function(t){try{t?n.storage.setItem("debug",t):n.storage.removeItem("debug")}catch(t){}},n.load=function(){let t;try{t=n.storage.getItem("debug")}catch(t){}return!t&&void 0!==r&&"env"in r&&(t=void 0),t},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(t){}}(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=t("./common")(n);const{formatters:i}=e.exports;i.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},{"./common":"Kest",process:"pBGv"}],sfrJ:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.AsyncSerialScheduler=void 0,n.AsyncSerialScheduler=class{constructor(t){this._baseObserver=t,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then(()=>this._baseObserver.complete()).catch(t=>this._baseObserver.error(t))}error(t){this._baseObserver.error(t)}schedule(t){const e=Promise.all(this._pendingPromises),n=[],r=t=>n.push(t),i=Promise.resolve().then(()=>function(t,e,n,r){return new(n||(n=Promise))((function(e,i){function o(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?e(t.value):new n((function(e){e(t.value)})).then(o,s)}a((r=r.apply(t,[])).next())}))}(this,0,void 0,(function*(){yield e,yield t(r),this._pendingPromises.delete(i);for(const t of n)this._baseObserver.next(t)}))).catch(t=>{this._pendingPromises.delete(i),this._baseObserver.error(t)});this._pendingPromises.add(i)}}},{}],lj3f:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.registerObservableSymbol=function(){r()&&!i("observable")&&(Symbol.observable=Symbol("observable"))},n.getSymbol=n.hasSymbol=n.hasSymbols=void 0;const r=()=>"function"==typeof Symbol;n.hasSymbols=r;const i=t=>r()&&Boolean(Symbol[t]);n.hasSymbol=i,n.getSymbol=t=>i(t)?Symbol[t]:"@@"+t,i("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"))},{}],B9l3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Observable=n.SubscriptionObserver=n.Subscription=void 0;var r=t("./_symbols");const i=(0,r.getSymbol)("iterator"),o=(0,r.getSymbol)("observable"),s=(0,r.getSymbol)("species");function a(t,e){const n=t[e];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function l(t){let e=t.constructor;return void 0!==e&&null===(e=e[s])&&(e=void 0),void 0!==e?e:v}function c(t){c.log?c.log(t):setTimeout(()=>{throw t},0)}function u(t){Promise.resolve().then(()=>{try{t()}catch(t){c(t)}})}function h(t){const e=t._cleanup;if(void 0!==e&&(t._cleanup=void 0,e))try{if("function"==typeof e)e();else{const t=a(e,"unsubscribe");t&&t.call(e)}}catch(t){c(t)}}function f(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function d(t,e,n){t._state="running";const r=t._observer;try{const i=r?a(r,e):void 0;switch(e){case"next":i&&i.call(r,n);break;case"error":if(f(t),!i)throw n;i.call(r,n);break;case"complete":f(t),i&&i.call(r)}}catch(t){c(t)}"closed"===t._state?h(t):"running"===t._state&&(t._state="ready")}function p(t,e,n){if("closed"!==t._state)return"buffering"===t._state?(t._queue=t._queue||[],void t._queue.push({type:e,value:n})):"ready"!==t._state?(t._state="buffering",t._queue=[{type:e,value:n}],void u(()=>function(t){const e=t._queue;if(e){t._queue=void 0,t._state="ready";for(const n of e)if(d(t,n.type,n.value),"closed"===t._state)break}}(t))):void d(t,e,n)}class m{constructor(t,e){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";const n=new g(this);try{this._cleanup=e.call(void 0,n)}catch(t){n.error(t)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(f(this),h(this))}}n.Subscription=m;class g{constructor(t){this._subscription=t}get closed(){return"closed"===this._subscription._state}next(t){p(this._subscription,"next",t)}error(t){p(this._subscription,"error",t)}complete(){p(this._subscription,"complete")}}n.SubscriptionObserver=g;class v{constructor(t){if(!(this instanceof v))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}subscribe(t,e,n){return"object"==typeof t&&null!==t||(t={next:t,error:e,complete:n}),new m(t,this._subscriber)}pipe(t,...e){let n=this;for(const r of[t,...e])n=r(n);return n}tap(t,e,n){const r="object"!=typeof t||null===t?{next:t,error:e,complete:n}:t;return new v(t=>this.subscribe({next(e){r.next&&r.next(e),t.next(e)},error(e){r.error&&r.error(e),t.error(e)},complete(){r.complete&&r.complete(),t.complete()},start(t){r.start&&r.start(t)}}))}forEach(t){return new Promise((e,n)=>{if("function"!=typeof t)return void n(new TypeError(t+" is not a function"));function r(){i.unsubscribe(),e()}const i=this.subscribe({next(e){try{t(e,r)}catch(t){n(t),i.unsubscribe()}},error:n,complete:e})})}map(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return new(l(this))(e=>this.subscribe({next(n){let r=n;try{r=t(n)}catch(t){return e.error(t)}e.next(r)},error(t){e.error(t)},complete(){e.complete()}}))}filter(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return new(l(this))(e=>this.subscribe({next(n){try{if(!t(n))return}catch(t){return e.error(t)}e.next(n)},error(t){e.error(t)},complete(){e.complete()}}))}reduce(t,e){if("function"!=typeof t)throw new TypeError(t+" is not a function");const n=l(this),r=arguments.length>1;let i=!1,o=e;return new n(e=>this.subscribe({next(n){const s=!i;if(i=!0,!s||r)try{o=t(o,n)}catch(t){return e.error(t)}else o=n},error(t){e.error(t)},complete(){if(!i&&!r)return e.error(new TypeError("Cannot reduce an empty sequence"));e.next(o),e.complete()}}))}concat(...t){const e=l(this);return new e(n=>{let r,i=0;return function o(s){r=s.subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){i===t.length?(r=void 0,n.complete()):o(e.from(t[i++]))}})}(this),()=>{r&&(r.unsubscribe(),r=void 0)}})}flatMap(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=l(this);return new e(n=>{const r=[],i=this.subscribe({next(i){let s;if(t)try{s=t(i)}catch(t){return n.error(t)}else s=i;const a=e.from(s).subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){const t=r.indexOf(a);t>=0&&r.splice(t,1),o()}});r.push(a)},error(t){n.error(t)},complete(){o()}});function o(){i.closed&&0===r.length&&n.complete()}return()=>{r.forEach(t=>t.unsubscribe()),i.unsubscribe()}})}[o](){return this}static from(t){const e="function"==typeof this?this:v;if(null==t)throw new TypeError(t+" is not an object");const n=a(t,o);if(n){const r=n.call(t);if(Object(r)!==r)throw new TypeError(r+" is not an object");return function(t){return t instanceof v}(r)&&r.constructor===e?r:new e(t=>r.subscribe(t))}if((0,r.hasSymbol)("iterator")){const n=a(t,i);if(n)return new e(e=>{u(()=>{if(!e.closed){for(const r of n.call(t))if(e.next(r),e.closed)return;e.complete()}})})}if(Array.isArray(t))return new e(e=>{u(()=>{if(!e.closed){for(const n of t)if(e.next(n),e.closed)return;e.complete()}})});throw new TypeError(t+" is not observable")}static of(...t){return new("function"==typeof this?this:v)(e=>{u(()=>{if(!e.closed){for(const n of t)if(e.next(n),e.closed)return;e.complete()}})})}static get[s](){return this}}n.Observable=v,(0,r.hasSymbols)()&&Object.defineProperty(v,Symbol("extensions"),{value:{symbol:o,hostReportError:c},configurable:!0});var y=v;n.default=y},{"./_symbols":"lj3f"}],QC75:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(t){"function"==typeof t?t():t&&"function"==typeof t.unsubscribe&&t.unsubscribe()}},{}],apmd:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=t("./_scheduler"),i=s(t("./observable")),o=s(t("./unsubscribe"));function s(t){return t&&t.__esModule?t:{default:t}}n.default=function(t){return e=>new i.default(n=>{const i=new r.AsyncSerialScheduler(n),s=e.subscribe({complete(){i.complete()},error(t){i.error(t)},next(e){i.schedule(n=>function(t,e,n,r){return new(n||(n=Promise))((function(e,i){function o(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?e(t.value):new n((function(e){e(t.value)})).then(o,s)}a((r=r.apply(t,[])).next())}))}(this,0,void 0,(function*(){(yield t(e))&&n(e)})))}});return()=>(0,o.default)(s)})}},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],FgiE:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isAsyncIterator=function(t){return t&&(0,r.hasSymbol)("asyncIterator")&&t[Symbol.asyncIterator]},n.isIterator=function(t){return t&&(0,r.hasSymbol)("iterator")&&t[Symbol.iterator]};var r=t("./_symbols")},{"./_symbols":"lj3f"}],ltny:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=t("./_scheduler"),i=t("./_util"),o=a(t("./observable")),s=a(t("./unsubscribe"));function a(t){return t&&t.__esModule?t:{default:t}}n.default=function(t){return e=>new o.default(n=>{const o=new r.AsyncSerialScheduler(n),a=e.subscribe({complete(){o.complete()},error(t){o.error(t)},next(e){o.schedule(n=>function(t,e,n,r){return new(n||(n=Promise))((function(e,i){function o(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?e(t.value):new n((function(e){e(t.value)})).then(o,s)}a((r=r.apply(t,[])).next())}))}(this,0,void 0,(function*(){var r,o;const s=yield t(e);if((0,i.isIterator)(s)||(0,i.isAsyncIterator)(s))try{for(var a,l=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){!function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}(r,i,(e=t[n](e)).done,e.value)}))}}}(s);!(a=yield l.next()).done;){const t=a.value;n(t)}}catch(t){r={error:t}}finally{try{a&&!a.done&&(o=l.return)&&(yield o.call(l))}finally{if(r)throw r.error}}else s.map(t=>n(t))})))}});return()=>(0,s.default)(a)})}},{"./_scheduler":"sfrJ","./_util":"FgiE","./observable":"B9l3","./unsubscribe":"QC75"}],jAhG:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){return new r.Observable(e=>{let n=0;const r=setInterval(()=>{e.next(n++)},t);return()=>clearInterval(r)})};var r=t("./observable")},{"./observable":"B9l3"}],aP59:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=t("./_scheduler"),i=s(t("./observable")),o=s(t("./unsubscribe"));function s(t){return t&&t.__esModule?t:{default:t}}n.default=function(t){return e=>new i.default(n=>{const i=new r.AsyncSerialScheduler(n),s=e.subscribe({complete(){i.complete()},error(t){i.error(t)},next(e){i.schedule(n=>function(t,e,n,r){return new(n||(n=Promise))((function(e,i){function o(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?e(t.value):new n((function(e){e(t.value)})).then(o,s)}a((r=r.apply(t,[])).next())}))}(this,0,void 0,(function*(){const r=yield t(e);n(r)})))}});return()=>(0,o.default)(s)})}},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],Rg1v:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=t("./observable"),i=function(t){return t&&t.__esModule?t:{default:t}}(t("./unsubscribe"));n.default=function(...t){return 0===t.length?r.Observable.from([]):new r.Observable(e=>{let n=0;const r=t.map(r=>r.subscribe({error(t){e.error(t),o()},next(t){e.next(t)},complete(){++n===t.length&&(e.complete(),o())}})),o=()=>{r.forEach(t=>(0,i.default)(t))};return o})}},{"./observable":"B9l3","./unsubscribe":"QC75"}],wtHd:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("./observable"));class i extends r.default{constructor(){super(t=>(this._observers.add(t),()=>this._observers.delete(t))),this._observers=new Set}next(t){for(const e of this._observers)e.next(t)}error(t){for(const e of this._observers)e.error(t)}complete(){for(const t of this._observers)t.complete()}}var o=i;n.default=o},{"./observable":"B9l3"}],NgdC:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=s(t("./observable")),i=s(t("./subject")),o=s(t("./unsubscribe"));function s(t){return t&&t.__esModule?t:{default:t}}n.default=function(t){const e=new i.default;let n,s=0;return new r.default(r=>{n||(n=t.subscribe(e));const i=e.subscribe(r);return s++,()=>{s--,i.unsubscribe(),0===s&&((0,o.default)(n),n=void 0)}})}},{"./observable":"B9l3","./subject":"wtHd","./unsubscribe":"QC75"}],b7o0:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=t("./_scheduler"),i=s(t("./observable")),o=s(t("./unsubscribe"));function s(t){return t&&t.__esModule?t:{default:t}}n.default=function(t,e){return n=>new i.default(i=>{let s,a=0;const l=new r.AsyncSerialScheduler(i),c=n.subscribe({complete(){l.complete()},error(t){l.error(t)},next(n){l.schedule(r=>function(t,e,n,r){return new(n||(n=Promise))((function(e,i){function o(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?e(t.value):new n((function(e){e(t.value)})).then(o,s)}a((r=r.apply(t,[])).next())}))}(this,0,void 0,(function*(){const i=0===a?void 0===e?n:e:s;s=yield t(i,n,a++),r(s)})))}});return()=>(0,o.default)(c)})}},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],cyO3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"filter",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"flatMap",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"interval",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"map",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"merge",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"multicast",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"Observable",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(n,"scan",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"Subject",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(n,"unsubscribe",{enumerable:!0,get:function(){return f.default}});var r=d(t("./filter")),i=d(t("./flatMap")),o=d(t("./interval")),s=d(t("./map")),a=d(t("./merge")),l=d(t("./multicast")),c=d(t("./observable")),u=d(t("./scan")),h=d(t("./subject")),f=d(t("./unsubscribe"));function d(t){return t&&t.__esModule?t:{default:t}}},{"./filter":"apmd","./flatMap":"ltny","./interval":"jAhG","./map":"aP59","./merge":"Rg1v","./multicast":"NgdC","./observable":"B9l3","./scan":"b7o0","./subject":"wtHd","./unsubscribe":"QC75"}],vpgy:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.allSettled=function(t){return Promise.all(t.map(t=>{const e=t=>({status:"fulfilled",value:t}),n=t=>({status:"rejected",reason:t}),r=Promise.resolve(t);try{return r.then(e,n)}catch(t){return Promise.reject(t)}}))}},{}],UYCO:[function(t,e,n){"use strict";var r;Object.defineProperty(n,"__esModule",{value:!0}),n.PoolEventType=void 0,n.PoolEventType=r,function(t){t.initialized="initialized",t.taskCanceled="taskCanceled",t.taskCompleted="taskCompleted",t.taskFailed="taskFailed",t.taskQueued="taskQueued",t.taskQueueDrained="taskQueueDrained",t.taskStart="taskStart",t.terminated="terminated"}(r||(n.PoolEventType=r={}))},{}],fmdM:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.$worker=n.$transferable=n.$terminate=n.$events=n.$errors=void 0;const r=Symbol("thread.errors");n.$errors=r;const i=Symbol("thread.events");n.$events=i;const o=Symbol("thread.terminate");n.$terminate=o;const s=Symbol("thread.transferable");n.$transferable=s;const a=Symbol("thread.worker");n.$worker=a},{}],LBuu:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Thread=void 0;var r=t("../symbols");function i(t){throw Error(t)}const o={errors:t=>t[r.$errors]||i("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:t=>t[r.$events]||i("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:t=>t[r.$terminate]()};n.Thread=o},{"../symbols":"fmdM"}],EB3M:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PoolEventType",{enumerable:!0,get:function(){return a.PoolEventType}}),Object.defineProperty(n,"Thread",{enumerable:!0,get:function(){return l.Thread}}),n.Pool=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("debug")),i=t("observable-fns"),o=t("../ponyfills"),s=t("./implementation"),a=t("./pool-types"),l=t("./thread"),c=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};let u=1;class h{constructor(t,e){this.eventSubject=new i.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const n="number"==typeof e?{size:e}:e||{},{size:o=s.defaultPoolSize}=n;this.debug=(0,r.default)("threads:pool:"+function(t){return t.replace(/\W/g," ").trim().replace(/\s+/g,"-")}(n.name||String(u++))),this.options=n,this.workers=function(t,e){return function(t){const e=[];for(let n=0;n({init:t(),runningTasks:[]}))}(t,o),this.eventObservable=(0,i.multicast)(i.Observable.from(this.eventSubject)),Promise.all(this.workers.map(t=>t.init)).then(()=>this.eventSubject.next({type:a.PoolEventType.initialized,size:this.workers.length}),t=>{this.debug("Error while initializing pool worker:",t),this.eventSubject.error(t),this.initErrors.push(t)})}findIdlingWorker(){const{concurrency:t=1}=this.options;return this.workers.find(e=>e.runningTasks.lengthc(this,void 0,void 0,(function*(){yield new Promise(t=>setTimeout(t,0));try{yield this.runPoolTask(t,e)}finally{t.runningTasks=t.runningTasks.filter(t=>t!==n),this.isClosing||this.scheduleWork()}})))();t.runningTasks.push(n)}))}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const t=this.findIdlingWorker();if(!t)return;const e=this.taskQueue.shift();if(!e)return this.debug("Task queue is empty"),void this.eventSubject.next({type:a.PoolEventType.taskQueueDrained});this.run(t,e)}taskCompletion(t){return new Promise((e,n)=>{const r=this.events().subscribe(i=>{i.type===a.PoolEventType.taskCompleted&&i.taskID===t?(r.unsubscribe(),e(i.returnValue)):i.type===a.PoolEventType.taskFailed&&i.taskID===t?(r.unsubscribe(),n(i.error)):i.type===a.PoolEventType.terminated&&(r.unsubscribe(),n(Error("Pool has been terminated before task was run.")))})})}settled(t=!1){return c(this,void 0,void 0,(function*(){const e=()=>function(t,e){return t.reduce((t,n)=>[...t,...e(n)],[])}(this.workers,t=>t.runningTasks),n=[],r=this.eventObservable.subscribe(t=>{t.type===a.PoolEventType.taskFailed&&n.push(t.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):t&&0===this.taskQueue.length?(yield(0,o.allSettled)(e()),n):(yield new Promise((t,e)=>{const n=this.eventObservable.subscribe({next(e){e.type===a.PoolEventType.taskQueueDrained&&(n.unsubscribe(),t())},error:e})}),yield(0,o.allSettled)(e()),r.unsubscribe(),n)}))}completed(t=!1){return c(this,void 0,void 0,(function*(){const e=this.settled(t),n=new Promise((t,n)=>{const r=this.eventObservable.subscribe({next(i){i.type===a.PoolEventType.taskQueueDrained?(r.unsubscribe(),t(e)):i.type===a.PoolEventType.taskFailed&&(r.unsubscribe(),n(i.error))},error:n})}),r=yield Promise.race([e,n]);if(r.length>0)throw r[0]}))}events(){return this.eventObservable}queue(t){const{maxQueuedJobs:e=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const n=()=>this.taskCompletion(i.id);let r;const i={id:this.nextTaskID++,run:t,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter(t=>t!==i),this.eventSubject.next({type:a.PoolEventType.taskCanceled,taskID:i.id}))},get then(){if(!r){const t=n();r=t.then.bind(t)}return r}};if(this.taskQueue.length>=e)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:a.PoolEventType.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(t){return c(this,void 0,void 0,(function*(){this.isClosing=!0,t||(yield this.completed(!0)),this.eventSubject.next({type:a.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(t=>c(this,void 0,void 0,(function*(){return l.Thread.terminate(yield t.init)}))))}))}}function f(t,e){return new h(t,e)}h.EventType=a.PoolEventType,f.EventType=a.PoolEventType;const d=f;n.Pool=d},{debug:"jcLW","observable-fns":"cyO3","../ponyfills":"vpgy","./implementation":"XK2w","./pool-types":"UYCO","./thread":"LBuu"}],PRGP:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createPromiseWithResolver=function(){let t,e=!1,n=r;return[new Promise(r=>{e?r(t):n=r}),r=>{e=!0,t=r,n()}]};const r=()=>{}},{}],ZLGT:[function(t,e,n){"use strict";var r;Object.defineProperty(n,"__esModule",{value:!0}),n.WorkerEventType=void 0,t("../symbols"),n.WorkerEventType=r,function(t){t.internalError="internalError",t.message="message",t.termination="termination"}(r||(n.WorkerEventType=r={}))},{"../symbols":"fmdM"}],zXl4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ObservablePromise=void 0;var r=t("observable-fns");const i=()=>{},o=t=>t,s=t=>Promise.resolve().then(t);function a(t){throw t}class l extends r.Observable{constructor(t){super(e=>{const n=this,r=Object.assign(Object.assign({},e),{complete(){e.complete(),n.onCompletion()},error(t){e.error(t),n.onError(t)},next(t){e.next(t),n.onNext(t)}});try{return this.initHasRun=!0,t(r)}catch(t){r.error(t)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(t){this.firstValueSet||(this.firstValue=t,this.firstValueSet=!0)}onError(t){this.state="rejected",this.rejection=t;for(const e of this.rejectionCallbacks)s(()=>e(t))}onCompletion(){this.state="fulfilled";for(const t of this.fulfillmentCallbacks)s(()=>t(this.firstValue))}then(t,e){const n=t||o,r=e||a;let i=!1;return new Promise((t,e)=>{const o=n=>{if(!i){i=!0;try{t(r(n))}catch(t){e(t)}}};return this.initHasRun||this.subscribe({error:o}),"fulfilled"===this.state?t(n(this.firstValue)):"rejected"===this.state?(i=!0,t(r(this.rejection))):(this.fulfillmentCallbacks.push(e=>{try{t(n(e))}catch(t){o(t)}}),void this.rejectionCallbacks.push(o))})}catch(t){return this.then(void 0,t)}finally(t){const e=t||i;return this.then(t=>(e(),t),()=>e())}static from(t){return function(t){return t&&"function"==typeof t.then}(t)?new l(e=>{t.then(t=>{e.next(t),e.complete()},t=>{e.error(t)})}):super.from(t)}}n.ObservablePromise=l},{"observable-fns":"cyO3"}],qW1u:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isTransferDescriptor=function(t){return t&&"object"==typeof t&&t[r.$transferable]},n.Transfer=function(t,e){if(!e){if(!function(t){return!(!t||"object"!=typeof t)}(t))throw Error();e=[t]}return{[r.$transferable]:!0,send:t,transferables:e}};var r=t("./symbols")},{"./symbols":"fmdM"}],fUdt:[function(t,e,n){"use strict";var r,i;Object.defineProperty(n,"__esModule",{value:!0}),n.WorkerMessageType=n.MasterMessageType=void 0,n.MasterMessageType=r,function(t){t.run="run"}(r||(n.MasterMessageType=r={})),n.WorkerMessageType=i,function(t){t.error="error",t.init="init",t.result="result",t.running="running",t.uncaughtError="uncaughtError"}(i||(n.WorkerMessageType=i={}))},{}],iMbm:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createProxyFunction=p,n.createProxyModule=function(t,e){const n={};for(const r of e)n[r]=p(t,r);return n};var r=function(t){return t&&t.__esModule?t:{default:t}}(t("debug")),i=t("observable-fns"),o=t("../common"),s=t("../observable-promise"),a=t("../transferable"),l=t("../types/messages");const c=(0,r.default)("threads:master:messages");let u=1;const h=t=>Array.from(new Set(t));function f(t,e){return new i.Observable(n=>{let r;const i=s=>{if(c("Message from worker:",s.data),s.data&&s.data.uid===e)if((t=>t&&t.type===l.WorkerMessageType.running)(s.data))r=s.data.resultType;else if((t=>t&&t.type===l.WorkerMessageType.result)(s.data))"promise"===r?(void 0!==s.data.payload&&n.next((0,o.deserialize)(s.data.payload)),n.complete(),t.removeEventListener("message",i)):(s.data.payload&&n.next((0,o.deserialize)(s.data.payload)),s.data.complete&&(n.complete(),t.removeEventListener("message",i)));else if((t=>t&&t.type===l.WorkerMessageType.error)(s.data)){const e=(0,o.deserialize)(s.data.error);n.error(e),t.removeEventListener("message",i)}};return t.addEventListener("message",i),()=>t.removeEventListener("message",i)})}function d(t){if(0===t.length)return{args:[],transferables:[]};const e=[],n=[];for(const r of t)(0,a.isTransferDescriptor)(r)?(e.push((0,o.serialize)(r.send)),n.push(...r.transferables)):e.push((0,o.serialize)(r));return{args:e,transferables:0===n.length?n:h(n)}}function p(t,e){return(...n)=>{const r=u++,{args:o,transferables:a}=d(n),h={type:l.MasterMessageType.run,uid:r,method:e,args:o};c("Sending command to run function to worker:",h);try{t.postMessage(h,a)}catch(t){return s.ObservablePromise.from(Promise.reject(t))}return s.ObservablePromise.from((0,i.multicast)(f(t,r)))}}},{debug:"jcLW","observable-fns":"cyO3","../common":"kdjL","../observable-promise":"zXl4","../transferable":"qW1u","../types/messages":"fUdt"}],a83E:[function(t,e,n){t("process"),t("process"),Object.defineProperty(n,"__esModule",{value:!0}),n.spawn=function(t,e){return u(this,void 0,void 0,(function*(){f("Initializing new thread");const n=(yield function(t,e,n){return u(this,void 0,void 0,(function*(){let n;const r=new Promise((t,r)=>{n=setTimeout(()=>r(Error("Timeout: Did not receive an init message from worker after 10000ms. Make sure the worker calls expose().")),e)}),i=yield Promise.race([t,r]);return clearTimeout(n),i}))}(p(t),e&&e.timeout?e.timeout:1e4)).exposed,{termination:r,terminate:i}=function(t){const[e,n]=(0,s.createPromiseWithResolver)();return{terminate:()=>u(this,void 0,void 0,(function*(){d("Terminating worker"),yield t.terminate(),n()})),termination:e}}(t),o=m(t,r);if("function"===n.type)return g((0,c.createProxyFunction)(t),t,o,i);if("module"===n.type)return g((0,c.createProxyModule)(t,n.methods),t,o,i);{const t=n.type;throw Error("Worker init message states unexpected type of expose(): "+t)}}))};var r=function(t){return t&&t.__esModule?t:{default:t}}(t("debug")),i=t("observable-fns"),o=t("../common"),s=t("../promise"),a=t("../symbols"),l=t("../types/master"),c=t("./invocation-proxy"),u=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const h=(0,r.default)("threads:master:messages"),f=(0,r.default)("threads:master:spawn"),d=(0,r.default)("threads:master:thread-utils");function p(t){return new Promise((e,n)=>{const r=i=>{h("Message from worker before finishing initialization:",i.data),(t=>t&&"init"===t.type)(i.data)?(t.removeEventListener("message",r),e(i.data)):(t=>t&&"uncaughtError"===t.type)(i.data)&&(t.removeEventListener("message",r),n((0,o.deserialize)(i.data.error)))};t.addEventListener("message",r)})}function m(t,e){return new i.Observable(n=>{const r=t=>{const e={type:l.WorkerEventType.message,data:t.data};n.next(e)},i=t=>{d("Unhandled promise rejection event in thread:",t);const e={type:l.WorkerEventType.internalError,error:Error(t.reason)};n.next(e)};t.addEventListener("message",r),t.addEventListener("unhandledrejection",i),e.then(()=>{const e={type:l.WorkerEventType.termination};t.removeEventListener("message",r),t.removeEventListener("unhandledrejection",i),n.next(e),n.complete()})})}function g(t,e,n,r){const i=n.filter(t=>t.type===l.WorkerEventType.internalError).map(t=>t.error);return Object.assign(t,{[a.$errors]:i,[a.$events]:n,[a.$terminate]:r,[a.$worker]:e})}},{debug:"jcLW","observable-fns":"cyO3","../common":"kdjL","../promise":"PRGP","../symbols":"fmdM","../types/master":"ZLGT","./invocation-proxy":"iMbm",process:"pBGv"}],HfK0:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Pool",{enumerable:!0,get:function(){return i.Pool}}),Object.defineProperty(n,"spawn",{enumerable:!0,get:function(){return o.spawn}}),Object.defineProperty(n,"Thread",{enumerable:!0,get:function(){return s.Thread}}),n.Worker=void 0;var r=t("./implementation"),i=t("./pool"),o=t("./spawn"),s=t("./thread");const a=(0,r.selectWorkerImplementation)();n.Worker=a},{"./implementation":"XK2w","./pool":"EB3M","./spawn":"a83E","./thread":"LBuu"}],JZ8d:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}},{}],LkZ7:[function(t,e,n){var r=arguments[3];Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,o=s(t("./ponyfill.js"));function s(t){return t&&t.__esModule?t:{default:t}}i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:void 0!==e?e:Function("return this")();var a=(0,o.default)(i),l=a;n.default=l},{"./ponyfill.js":"JZ8d"}],UALh:[function(t,e,n){"use strict";const r=t("symbol-observable").default;e.exports=t=>Boolean(t&&t[r]&&t===t[r]())},{"symbol-observable":"LkZ7"}],AZa4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r={isWorkerRuntime:function(){return!("undefined"==typeof self||!self.postMessage)},postMessageToMaster:function(t,e){self.postMessage(t,e)},subscribeToMasterMessages:function(t){const e=e=>{t(e.data)};return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}};n.default=r},{}],l5pR:[function(t,e,n){t("process");var r=t("process");Object.defineProperty(n,"__esModule",{value:!0}),n.expose=function(t){if(!l.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(u)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(u=!0,"function"==typeof t)l.default.subscribeToMasterMessages(e=>{h(e)&&!e.method&&v(e.uid,t,e.args.map(o.deserialize))}),function(){const t={type:a.WorkerMessageType.init,exposed:{type:"function"}};l.default.postMessageToMaster(t)}();else{if("object"!=typeof t||!t)throw Error("Invalid argument passed to expose(). Expected a function or an object, got: "+t);l.default.subscribeToMasterMessages(e=>{h(e)&&e.method&&v(e.uid,t[e.method],e.args.map(o.deserialize))}),function(t){const e={type:a.WorkerMessageType.init,exposed:{type:"module",methods:t}};l.default.postMessageToMaster(e)}(Object.keys(t).filter(e=>"function"==typeof t[e]))}},Object.defineProperty(n,"registerSerializer",{enumerable:!0,get:function(){return o.registerSerializer}}),Object.defineProperty(n,"Transfer",{enumerable:!0,get:function(){return s.Transfer}});var i=c(t("is-observable")),o=t("../common"),s=t("../transferable"),a=t("../types/messages"),l=c(t("./implementation"));function c(t){return t&&t.__esModule?t:{default:t}}let u=!1;const h=t=>t&&t.type===a.MasterMessageType.run,f=t=>(0,i.default)(t)||function(t){return t&&"object"==typeof t&&"function"==typeof t.subscribe}(t);function d(t){return(0,s.isTransferDescriptor)(t)?{payload:t.send,transferables:t.transferables}:{payload:t,transferables:void 0}}function p(t,e){const{payload:n,transferables:r}=d(e),i={type:a.WorkerMessageType.error,uid:t,error:(0,o.serialize)(n)};l.default.postMessageToMaster(i,r)}function m(t,e,n){const{payload:r,transferables:i}=d(n),o={type:a.WorkerMessageType.result,uid:t,complete:!!e||void 0,payload:r};l.default.postMessageToMaster(o,i)}function g(t){try{const e={type:a.WorkerMessageType.uncaughtError,error:(0,o.serialize)(t)};l.default.postMessageToMaster(e)}catch(e){console.error("Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\nLatest error:",e,"\nOriginal error:",t)}}function v(t,e,n){return function(t,e,n,r){return new(n||(n=Promise))((function(e,i){function o(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(t){t(r)}))).then(o,s)}a((r=r.apply(t,[])).next())}))}(this,0,void 0,(function*(){let r;try{r=e(...n)}catch(e){return p(t,e)}const i=f(r)?"observable":"promise";if(function(t,e){const n={type:a.WorkerMessageType.running,uid:t,resultType:e};l.default.postMessageToMaster(n)}(t,i),f(r))r.subscribe(e=>m(t,!1,(0,o.serialize)(e)),e=>p(t,(0,o.serialize)(e)),()=>m(t,!0));else try{const e=yield r;m(t,!0,(0,o.serialize)(e))}catch(e){p(t,(0,o.serialize)(e))}}))}"undefined"!=typeof self&&"function"==typeof self.addEventListener&&l.default.isWorkerRuntime()&&(self.addEventListener("error",t=>{setTimeout(()=>g(t.error||t),250)}),self.addEventListener("unhandledrejection",t=>{const e=t.reason;e&&"string"==typeof e.message&&setTimeout(()=>g(e),250)})),void 0!==r&&"function"==typeof r.on&&l.default.isWorkerRuntime()&&(r.on("uncaughtException",t=>{setTimeout(()=>g(t),250)}),r.on("unhandledRejection",t=>{t&&"string"==typeof t.message&&setTimeout(()=>g(t),250)}))},{"is-observable":"UALh","../common":"kdjL","../transferable":"qW1u","../types/messages":"fUdt","./implementation":"AZa4",process:"pBGv"}],CqwR:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={registerSerializer:!0,expose:!0,DefaultSerializer:!0,Transfer:!0};Object.defineProperty(n,"registerSerializer",{enumerable:!0,get:function(){return i.registerSerializer}}),Object.defineProperty(n,"expose",{enumerable:!0,get:function(){return s.expose}}),Object.defineProperty(n,"DefaultSerializer",{enumerable:!0,get:function(){return a.DefaultSerializer}}),Object.defineProperty(n,"Transfer",{enumerable:!0,get:function(){return l.Transfer}});var i=t("./common"),o=t("./master/index");Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(r,t)||Object.defineProperty(n,t,{enumerable:!0,get:function(){return o[t]}}))}));var s=t("./worker/index"),a=t("./serializers"),l=t("./transferable")},{"./common":"kdjL","./master/index":"HfK0","./worker/index":"l5pR","./serializers":"z2GM","./transferable":"qW1u"}],dHPO:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(t("@babel/runtime/regenerator")),i=l(t("@babel/runtime/helpers/asyncToGenerator")),o=l(t("@babel/runtime/helpers/classCallCheck")),s=l(t("@babel/runtime/helpers/createClass")),a=t("threads");function l(t){return t&&t.__esModule?t:{default:t}}var c="undefined"!=typeof navigator?navigator.hardwareConcurrency:null,u=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new a.Worker("decoder.worker.1936c0d9.js");(0,o.default)(this,t),this.pool=(0,a.Pool)((function(){return(0,a.spawn)(n)}),e)}return(0,s.default)(t,[{key:"decode",value:function(){var t=(0,i.default)(r.default.mark((function t(e,n){var o=this;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,s){o.pool.queue(function(){var o=(0,i.default)(r.default.mark((function i(o){var l;return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,o(e,(0,a.Transfer)(n));case 3:l=r.sent,t(l),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),s(r.t0);case 10:case"end":return r.stop()}}),i,null,[[0,7]])})));return function(t){return o.apply(this,arguments)}}())})));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"destroy",value:function(){this.pool.terminate(!0)}}]),t}();n.default=u},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW",threads:"CqwR","./decoder.worker.js":[["decoder.worker.1936c0d9.js","LHx9"],"decoder.worker.1936c0d9.js.map","LHx9"]}],t2zx:[function(t,e,n){e.exports=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}},{}],U8F3:[function(t,e,n){var r=t("./objectWithoutPropertiesLoose");e.exports=function(t,e){if(null==t)return{};var n,i,o=r(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}},{"./objectWithoutPropertiesLoose":"t2zx"}],OMTj:[function(t,e,n){e.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},{}],kQhN:[function(t,e,n){var r=t("./arrayWithHoles"),i=t("./iterableToArray"),o=t("./unsupportedIterableToArray"),s=t("./nonIterableRest");e.exports=function(t){return r(t)||i(t)||o(t)||s()}},{"./arrayWithHoles":"OUZ9","./iterableToArray":"OMTj","./unsupportedIterableToArray":"UyFj","./nonIterableRest":"Rom6"}],ZJpj:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.parseContentType=function(t){var e=t.split(";").map((function(t){return t.trim()})),n=(0,r.default)(e);return{type:n[0],params:u(n.slice(1).map((function(t){return t.split("=")})))}},n.parseContentRange=f,n.parseByteRanges=function(t,e){for(var n=null,r=new TextDecoder("ascii"),i=[],o="--".concat(e),s="".concat(o,"--"),a=0;a<10;++a)r.decode(new Uint8Array(t,a,o.length))===o&&(n=a);if(null===n)throw new Error("Could not find initial boundary");for(;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw o}}}}function a(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==o[1]?o[1]:void 0,t.next=3,Promise.all(e.map((function(t){return i.fetchSlice(t,n)})));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"fetchSlice",value:function(){var t=(0,i.default)(r.default.mark((function t(e){return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("fetching of slice ".concat(e," not possible, not implemented"));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"close",value:function(){var t=(0,i.default)(r.default.mark((function t(){return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"fileSize",get:function(){return null}}]),t}();n.BaseSource=l},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW"}],eMzk:[function(t,e,n){"use strict";e.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},{}],sfWH:[function(t,e,n){"use strict";function r(t){var e=this;if(e instanceof r||(e=new r),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=t(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=t(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},r.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},r.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new r;if(ethis.length&&(e=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(e=this.length);for(var i=this.length,o=this.tail;null!==o&&i>e;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,o=this.head;null!==o&&rthis[s])return x(this,this[p].get(t)),!1;var o=this[p].get(t).value;return this[h]&&(this[f]||this[h](t,o.value)),o.now=r,o.maxAge=n,o.value=e,this[a]+=i-o.length,o.length=i,this.get(t),_(this),!0}var c=new w(t,e,i,r,n);return c.length>this[s]?(this[h]&&this[h](t,e),!1):(this[a]+=c.length,this[d].unshift(c),this[p].set(t,this[d].head),_(this),!0)}},{key:"has",value:function(t){if(!this[p].has(t))return!1;var e=this[p].get(t).value;return!b(this,e)}},{key:"get",value:function(t){return y(this,t,!0)}},{key:"peek",value:function(t){return y(this,t,!1)}},{key:"pop",value:function(){var t=this[d].tail;return t?(x(this,t),t.value):null}},{key:"del",value:function(t){x(this,this[p].get(t))}},{key:"load",value:function(t){this.reset();for(var e=Date.now(),n=t.length-1;n>=0;n--){var r=t[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-e;o>0&&this.set(r.k,r.v,o)}}}},{key:"prune",value:function(){var t=this;this[p].forEach((function(e,n){return y(t,n,!1)}))}},{key:"max",set:function(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[s]=t||1/0,_(this)},get:function(){return this[s]}},{key:"allowStale",set:function(t){this[c]=!!t},get:function(){return this[c]}},{key:"maxAge",set:function(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[u]=t,_(this)},get:function(){return this[u]}},{key:"lengthCalculator",set:function(t){var e=this;"function"!=typeof t&&(t=g),t!==this[l]&&(this[l]=t,this[a]=0,this[d].forEach((function(t){t.length=e[l](t.value,t.key),e[a]+=t.length}))),_(this)},get:function(){return this[l]}},{key:"length",get:function(){return this[a]}},{key:"itemCount",get:function(){return this[d].length}}]),t}(),y=function(t,e,n){var r=t[p].get(e);if(r){var i=r.value;if(b(t,i)){if(x(t,r),!t[c])return}else n&&(t[m]&&(r.value.now=Date.now()),t[d].unshiftNode(r));return i.value}},b=function(t,e){if(!e||!e.maxAge&&!t[u])return!1;var n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[u]&&n>t[u]},_=function(t){if(t[a]>t[s])for(var e=t[d].tail;t[a]>t[s]&&null!==e;){var n=e.prev;x(t,e),e=n}},x=function(t,e){if(e){var n=e.value;t[h]&&t[h](n.key,n.value),t[a]-=n.length,t[p].delete(n.key),t[d].removeNode(e)}},w=function t(e,n,i,o,s){r(this,t),this.key=e,this.value=n,this.length=i,this.now=o,this.maxAge=s||0},M=function(t,e,n,r){var i=n.value;b(t,i)&&(x(t,n),t[c]||(i=void 0)),i&&e.call(r,i.value,i.key,t)};e.exports=v},{yallist:"sfWH"}],FOZT:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.assign=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},n.chunk=function(t,e){for(var n=[],r=t.length,i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;(0,c.default)(this,t),this.offset=e,this.length=n,this.data=r}return(0,u.default)(t,[{key:"top",get:function(){return this.offset+this.length}}]),t}(),y=function t(e,n,r){(0,c.default)(this,t),this.offset=e,this.length=n,this.blockIds=r},b=function(t){(0,s.default)(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.default)(t);if(e){var i=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.default)(this,n)}}(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.blockSize,s=void 0===o?65536:o,a=i.cacheSize,l=void 0===a?100:a;return(0,c.default)(this,n),(r=e.call(this)).source=t,r.blockSize=s,r.blockCache=new h.default({max:l}),r.blockRequests=new Map,r.blockIdsToFetch=new Set,r}return(0,u.default)(n,[{key:"fetch",value:function(){var t=(0,o.default)(r.default.mark((function t(e,n){var o,s,a,l,c,u,h,f,p,g,v,y,b,_,x,w,M,S,E,T,C,A,P,L,R,O,k,I,D,N,j,F,B,z,U,H,G,W;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=new Map,s=new Map,a=new Set,l=m(e);try{for(l.s();!(c=l.n()).done;)for(u=c.value,h=u.offset,f=u.length,p=h+f,null!==(g=this.fileSize)&&(p=Math.min(p,g)),v=Math.floor(h/this.blockSize)*this.blockSize,y=v;y0)){t.next=65;break}this.fetchBlocks(n),I=m(T),t.prev=44,I.s();case 46:if((D=I.n()).done){t.next=54;break}if(N=D.value,j=this.blockRequests.get(N)){t.next=51;break}throw new Error("Block ".concat(N," is not in the block requests"));case 51:s.set(N,j);case 52:t.next=46;break;case 54:t.next=59;break;case 56:t.prev=56,t.t1=t.catch(44),I.e(t.t1);case 59:return t.prev=59,I.f(),t.finish(59);case 62:return t.next=64,Promise.allSettled(Array.from(s.values()));case 64:E=t.sent;case 65:if(!E.some((function(t){return"rejected"===t.status}))){t.next=69;break}if(!n||!n.aborted){t.next=68;break}throw new d.AbortError("Request was aborted");case 68:throw new d.AggregateError(E.filter((function(t){return"rejected"===t.status})).map((function(t){return t.reason})),"Request failed");case 69:F=E.map((function(t){return t.value})),B=new Map((0,d.zip)(Array.from(s.keys()),F)),z=m(o);try{for(z.s();!(U=z.n()).done;)H=(0,i.default)(U.value,2),G=H[0],W=H[1],B.set(G,W)}catch(t){z.e(t)}finally{z.f()}return t.abrupt("return",this.readSliceData(e,B));case 74:case"end":return t.stop()}}),t,this,[[9,28,31,34],[44,56,59,62]])})));return function(e,n){return t.apply(this,arguments)}}()},{key:"fetchBlocks",value:function(t){var e=this;this.blockIdsToFetch.size>0&&function(){for(var n=e.groupBlocks(e.blockIdsToFetch),i=e.source.fetch(n,t),s=function(s){var a,l=m(n[s].blockIds);try{var c=function(){var n=a.value,l=(0,o.default)(r.default.mark((function o(){var a,l,c,u,h,f;return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,i;case 3:return r.t0=s,a=r.sent[r.t0],l=n*e.blockSize,c=l-a.offset,u=Math.min(c+e.blockSize,a.data.byteLength),h=a.data.slice(c,u),f=new v(l,h.byteLength,h),e.blockCache.set(n,f),r.abrupt("return",f);case 14:throw r.prev=14,r.t1=r.catch(0),"AbortError"===r.t1.name&&(r.t1.signal=t),r.t1;case 18:return r.prev=18,e.blockRequests.delete(n),r.finish(18);case 21:case"end":return r.stop()}}),o,null,[[0,14,18,21]])})))();e.blockRequests.set(n,l)};for(l.s();!(a=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}},a=0;a0&&(d=h),c=u.top-r<0?u.length-f:r-u.offset-f;var p=new Uint8Array(u.data,f,c);a.set(p,d)}return s}))}},{key:"fileSize",get:function(){return this.source.fileSize}}]),n}(f.BaseSource);n.BlockedSource=b},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/slicedToArray":"HETk","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","lru-cache":"tpff","./basesource":"LzCD","../utils":"FOZT"}],uL1U:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BaseClient=n.BaseResponse=void 0;var r=a(t("@babel/runtime/regenerator")),i=a(t("@babel/runtime/helpers/asyncToGenerator")),o=a(t("@babel/runtime/helpers/classCallCheck")),s=a(t("@babel/runtime/helpers/createClass"));function a(t){return t&&t.__esModule?t:{default:t}}var l=function(){function t(){(0,o.default)(this,t)}return(0,s.default)(t,[{key:"getHeader",value:function(t){throw new Error("not implemented")}},{key:"getData",value:function(){var t=(0,i.default)(r.default.mark((function t(){return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("not implemented");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"ok",get:function(){return this.status>=200&&this.status<=299}},{key:"status",get:function(){throw new Error("not implemented")}}]),t}();n.BaseResponse=l;var c=function(){function t(e){(0,o.default)(this,t),this.url=e}return(0,s.default)(t,[{key:"request",value:function(){var t=(0,i.default)(r.default.mark((function t(){var e,n=arguments;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw(e=n.length>0&&void 0!==n[0]?n[0]:{}).headers,e.credentials,e.signal,new Error("request is not implemented");case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}]),t}();n.BaseClient=c},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW"}],Un5s:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.FetchClient=void 0;var r=h(t("@babel/runtime/regenerator")),i=h(t("@babel/runtime/helpers/asyncToGenerator")),o=h(t("@babel/runtime/helpers/classCallCheck")),s=h(t("@babel/runtime/helpers/createClass")),a=h(t("@babel/runtime/helpers/inherits")),l=h(t("@babel/runtime/helpers/possibleConstructorReturn")),c=h(t("@babel/runtime/helpers/getPrototypeOf")),u=t("./base");function h(t){return t&&t.__esModule?t:{default:t}}function f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,c.default)(t);if(e){var i=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}var d=function(t){(0,a.default)(n,t);var e=f(n);function n(t){var r;return(0,o.default)(this,n),(r=e.call(this)).response=t,r}return(0,s.default)(n,[{key:"getHeader",value:function(t){return this.response.headers.get(t)}},{key:"getData",value:function(){var t=(0,i.default)(r.default.mark((function t(){var e;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.response.arrayBuffer){t.next=6;break}return t.next=3,this.response.arrayBuffer();case 3:t.t0=t.sent,t.next=9;break;case 6:return t.next=8,this.response.buffer();case 8:t.t0=t.sent.buffer;case 9:return e=t.t0,t.abrupt("return",e);case 11:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"status",get:function(){return this.response.status}}]),n}(u.BaseResponse),p=function(t){(0,a.default)(n,t);var e=f(n);function n(t,r){var i;return(0,o.default)(this,n),(i=e.call(this,t)).credentials=r,i}return(0,s.default)(n,[{key:"request",value:function(){var t=(0,i.default)(r.default.mark((function t(){var e,n,i,o,s,a=arguments;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=a.length>0&&void 0!==a[0]?a[0]:{},n=e.headers,i=e.credentials,o=e.signal,t.next=3,fetch(this.url,{headers:n,credentials:i,signal:o});case 3:return s=t.sent,t.abrupt("return",new d(s));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),n}(u.BaseClient);n.FetchClient=p},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./base":"uL1U"}],hvgd:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.XHRClient=void 0;var r=d(t("@babel/runtime/helpers/slicedToArray")),i=d(t("@babel/runtime/regenerator")),o=d(t("@babel/runtime/helpers/asyncToGenerator")),s=d(t("@babel/runtime/helpers/classCallCheck")),a=d(t("@babel/runtime/helpers/createClass")),l=d(t("@babel/runtime/helpers/inherits")),c=d(t("@babel/runtime/helpers/possibleConstructorReturn")),u=d(t("@babel/runtime/helpers/getPrototypeOf")),h=t("./base"),f=t("../../utils");function d(t){return t&&t.__esModule?t:{default:t}}function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.default)(t);if(e){var i=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var m=function(t){(0,l.default)(n,t);var e=p(n);function n(t,r){var i;return(0,s.default)(this,n),(i=e.call(this)).xhr=t,i.data=r,i}return(0,a.default)(n,[{key:"getHeader",value:function(t){return this.xhr.getResponseHeader(t)}},{key:"getData",value:function(){var t=(0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.data);case 1:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"status",get:function(){return this.xhr.status}}]),n}(h.BaseResponse),g=function(t){(0,l.default)(n,t);var e=p(n);function n(){return(0,s.default)(this,n),e.apply(this,arguments)}return(0,a.default)(n,[{key:"constructRequest",value:function(t,e){var n=this;return new Promise((function(i,o){var s=new XMLHttpRequest;s.open("GET",n.url),s.responseType="arraybuffer";for(var a=0,l=Object.entries(t);a0&&void 0!==s[0]?s[0]:{},n=e.headers,r=e.signal,t.next=3,this.constructRequest(n,r);case 3:return o=t.sent,t.abrupt("return",o);case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),n}(h.BaseClient);n.XHRClient=g},{"@babel/runtime/helpers/slicedToArray":"HETk","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./base":"uL1U","../../utils":"FOZT"}],p5a1:[function(t,e,n){var r,i=arguments[3];n.fetch=c(i.fetch)&&c(i.ReadableStream),n.writableStream=c(i.WritableStream),n.abortController=c(i.AbortController),n.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),n.blobConstructor=!0}catch(t){}function o(){if(void 0!==r)return r;if(i.XMLHttpRequest){r=new i.XMLHttpRequest;try{r.open("GET",i.XDomainRequest?"/":"https://example.com")}catch(t){r=null}}else r=null;return r}function s(t){var e=o();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}var a=void 0!==i.ArrayBuffer,l=a&&c(i.ArrayBuffer.prototype.slice);function c(t){return"function"==typeof t}n.arraybuffer=n.fetch||a&&s("arraybuffer"),n.msstream=!n.fetch&&l&&s("ms-stream"),n.mozchunkedarraybuffer=!n.fetch&&a&&s("moz-chunked-arraybuffer"),n.overrideMimeType=n.fetch||!!o()&&c(o().overrideMimeType),n.vbArray=c(i.VBArray),r=null},{}],Yj0v:[function(t,e,n){t("process");var r=t("process");void 0===r||!r.version||0===r.version.indexOf("v0.")||0===r.version.indexOf("v1.")&&0!==r.version.indexOf("v1.8.")?e.exports={nextTick:function(t,e,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return r.nextTick(t);case 2:return r.nextTick((function(){t.call(null,e)}));case 3:return r.nextTick((function(){t.call(null,e,n)}));case 4:return r.nextTick((function(){t.call(null,e,n,i)}));default:for(o=new Array(a-1),s=0;s0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e=r.allocUnsafe(t>>>0),n=this.head,i=0;n;)o(n.data,e,i),i+=n.data.length,n=n.next;return e},t}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":"Nqn4",util:"rDCW"}],lCUh:[function(t,e,n){"use strict";var r=t("process-nextick-args");function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var n=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(r.nextTick(i,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":"Yj0v"}],jPmE:[function(t,e,n){t("process"),t("process");var r=arguments[3],i=t("process-nextick-args");function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){N(e,t)}}e.exports=b;var s,a=i.nextTick;b.WritableState=y;var l=Object.create(t("core-util-is"));l.inherits=t("inherits");var c={deprecate:t("util-deprecate")},u=t("./internal/streams/stream"),h=t("safe-buffer").Buffer,f=r.Uint8Array||function(){};function d(t){return h.from(t)}function p(t){return h.isBuffer(t)||t instanceof f}var m,g=t("./internal/streams/destroy");function v(){}function y(e,n){s=s||t("./_stream_duplex"),e=e||{};var r=n instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,a=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===e.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){C(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(e){if(s=s||t("./_stream_duplex"),!(m.call(b,this)||this instanceof s))return new b(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function _(t,e){var n=new Error("write after end");t.emit("error",n),i.nextTick(e,n)}function x(t,e,n,r){var o=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),i.nextTick(r,s),o=!1),o}function w(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,n)),e}function M(t,e,n,r,i,o){if(!n){var s=w(e,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=e.objectMode?1:r.length;e.length+=a;var l=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||D(this,r,n)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),b.prototype.destroy=g.destroy,b.prototype._undestroy=g.undestroy,b.prototype._destroy=function(t,e){this.end(),e(t)}},{"process-nextick-args":"Yj0v","core-util-is":"Q14w",inherits:"Bm0n","util-deprecate":"yM1o","./internal/streams/stream":"ExO1","safe-buffer":"Nqn4","./internal/streams/destroy":"lCUh","./_stream_duplex":"Jcj8",process:"pBGv"}],Jcj8:[function(t,e,n){"use strict";var r=t("process-nextick-args"),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};e.exports=h;var o=Object.create(t("core-util-is"));o.inherits=t("inherits");var s=t("./_stream_readable"),a=t("./_stream_writable");o.inherits(h,s);for(var l=i(a.prototype),c=0;c>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}n.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(t.lastNeed=i-1),i):--r=0?(i>0&&(t.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":"Nqn4"}],YrHu:[function(t,e,n){t("process");var r=arguments[3],i=t("process"),o=t("process-nextick-args");e.exports=M;var s,a=t("isarray");M.ReadableState=w,t("events").EventEmitter;var l=function(t,e){return t.listeners(e).length},c=t("./internal/streams/stream"),u=t("safe-buffer").Buffer,h=r.Uint8Array||function(){};function f(t){return u.from(t)}function d(t){return u.isBuffer(t)||t instanceof h}var p=Object.create(t("core-util-is"));p.inherits=t("inherits");var m=t("util"),g=void 0;g=m&&m.debuglog?m.debuglog("stream"):function(){};var v,y=t("./internal/streams/BufferList"),b=t("./internal/streams/destroy");p.inherits(M,c);var _=["error","close","destroy","pause","resume"];function x(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}function w(e,n){e=e||{};var r=n instanceof(s=s||t("./_stream_duplex"));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,o=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(o||0===o)?o:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(v||(v=t("string_decoder/").StringDecoder),this.decoder=new v(e.encoding),this.encoding=e.encoding)}function M(e){if(s=s||t("./_stream_duplex"),!(this instanceof M))return new M(e);this._readableState=new w(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function S(t,e,n,r,i){var o,s=t._readableState;return null===e?(s.reading=!1,R(t,s)):(i||(o=T(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=f(e)),r?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):E(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?E(t,s,e,!1):I(t,s)):E(t,s,e,!1))):r||(s.reading=!1)),C(s)}function E(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&O(t)),I(t,e)}function T(t,e){var n;return d(e)||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function C(t){return!t.ended&&(t.needReadable||t.length=A?t=A:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function L(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=P(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function R(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,O(t)}}function O(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(g("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?o.nextTick(k,t):k(t))}function k(t){g("emit readable"),t.emit("readable"),z(t)}function I(t,e){e.readingMore||(e.readingMore=!0,o.nextTick(D,t,e))}function D(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=H(t,e.buffer,e.decoder),n);var n}function H(t,e,n){var r;return to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0==(t-=s)){s===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++r}return e.length-=r,i}function W(t,e){var n=u.allocUnsafe(t),r=e.head,i=1;for(r.data.copy(n),t-=r.data.length;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0==(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}function V(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,o.nextTick(q,e,t))}function q(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function X(t,e){for(var n=0,r=t.length;n=e.highWaterMark||e.ended))return g("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?V(this):O(this),null;if(0===(t=L(t,e))&&e.ended)return 0===e.length&&V(this),null;var r,i=e.needReadable;return g("need readable",i),(0===e.length||e.length-t0?U(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&V(this)),null!==r&&this.emit("data",r),r},M.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},M.prototype.pipe=function(t,e){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,g("pipe count=%d opts=%j",r.pipesCount,e);var s=e&&!1===e.end||t===i.stdout||t===i.stderr?v:a;function a(){g("onend"),t.end()}r.endEmitted?o.nextTick(s):n.once("end",s),t.on("unpipe",(function e(i,o){g("onunpipe"),i===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,g("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",c),t.removeListener("error",d),t.removeListener("unpipe",e),n.removeListener("end",a),n.removeListener("end",v),n.removeListener("data",f),u=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=N(n);t.on("drain",c);var u=!1,h=!1;function f(e){g("ondata"),h=!1,!1!==t.write(e)||h||((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==X(r.pipes,t))&&!u&&(g("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function d(e){g("onerror",e),v(),t.removeListener("error",d),0===l(t,"error")&&t.emit("error",e)}function p(){t.removeListener("finish",m),v()}function m(){g("onfinish"),t.removeListener("close",p),v()}function v(){g("unpipe"),n.unpipe(t)}return n.on("data",f),x(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",n),r.flowing||(g("pipe resume"),n.resume()),t},M.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;ot._pos){var r=n.substr(t._pos);if("x-user-defined"===t._charset){for(var s=new i(r.length),a=0;at._pos&&(t.push(new i(new Uint8Array(l.result.slice(t._pos)))),t._pos=l.result.byteLength)},l.onload=function(){t.push(null)},l.readAsArrayBuffer(n)}t._xhr.readyState===c.DONE&&"ms-stream"!==t._mode&&t.push(null)}},{"./capability":"p5a1",inherits:"Bm0n","readable-stream":"JaqQ",process:"pBGv",buffer:"dskh"}],AH4k:[function(t,e,n){var r=t("buffer").Buffer;e.exports=function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if("function"==typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(r.isBuffer(t)){for(var e=new Uint8Array(t.length),n=t.length,i=0;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=Math.floor,v=String.fromCharCode;function y(t){throw new RangeError(m[t])}function b(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function _(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+b((t=t.replace(p,".")).split("."),e).join(".")}function x(t){for(var e,n,r=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=v((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+v(t)})).join("")}function M(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function S(t,e,n){var r=0;for(t=n?g(t/700):t>>1,t+=g(t/e);t>455;r+=h)t=g(t/35);return g(r+36*t/(t+38))}function E(t){var e,n,r,i,o,s,a,l,c,f,d,p=[],m=t.length,v=0,b=128,_=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&y("not-basic"),p.push(t.charCodeAt(r));for(i=n>0?n+1:0;i=m&&y("invalid-input"),((l=(d=t.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:h)>=h||l>g((u-v)/s))&&y("overflow"),v+=l*s,!(l<(c=a<=_?1:a>=_+26?26:a-_));a+=h)s>g(u/(f=h-c))&&y("overflow"),s*=f;_=S(v-o,e=p.length+1,0==o),g(v/e)>u-b&&y("overflow"),b+=g(v/e),v%=e,p.splice(v++,0,b)}return w(p)}function T(t){var e,n,r,i,o,s,a,l,c,f,d,p,m,b,_,w=[];for(p=(t=x(t)).length,e=128,n=0,o=72,s=0;s=e&&dg((u-n)/(m=r+1))&&y("overflow"),n+=(a-e)*m,e=a,s=0;su&&y("overflow"),d==e){for(l=n,c=h;!(l<(f=c<=o?1:c>=o+26?26:c-o));c+=h)_=l-f,b=h-f,w.push(v(M(f+_%b,0))),l=g(_/b);w.push(v(M(l,0))),o=S(n,m,r==i),n=0,++r}++n,++e}return w.join("")}if(l={version:"1.4.1",ucs2:{decode:x,encode:w},decode:E,encode:T,toASCII:function(t){return _(t,(function(t){return d.test(t)?"xn--"+T(t):t}))},toUnicode:function(t){return _(t,(function(t){return f.test(t)?E(t.slice(4).toLowerCase()):t}))}},"function"==typeof r&&"object"==typeof r.amd&&r.amd)r("punycode",(function(){return l}));else if(o&&s)if(e.exports==o)s.exports=l;else for(c in l)l.hasOwnProperty(c)&&(o[c]=l[c]);else t.punycode=l}(this)},{}],YsIc:[function(t,e,n){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],J6GP:[function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,n,o){e=e||"&",n=n||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var c=t.length;l>0&&c>l&&(c=l);for(var u=0;u=0?(h=m.substr(0,g),f=m.substr(g+1)):(h=m,f=""),d=decodeURIComponent(h),p=decodeURIComponent(f),r(s,d)?i(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],bvhO:[function(t,e,n){"use strict";var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,n,a){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),(function(s){var a=encodeURIComponent(r(s))+n;return i(t[s])?o(t[s],(function(t){return a+encodeURIComponent(r(t))})).join(e):a+encodeURIComponent(r(t[s]))})).join(e):a?encodeURIComponent(r(a))+n+encodeURIComponent(r(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),h=["%","/","?",";","#"].concat(u),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=t("querystring");function b(t,e,n){if(t&&i.isObject(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,n),r}o.prototype.parse=function(t,e,n){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?k+="x":k+=O[I];if(!k.match(d)){var N=L.slice(0,C),j=L.slice(C+1),F=O.match(p);F&&(N.push(F[1]),j.unshift(F[2])),j.length&&(b="/"+j.join(".")+b),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=r.toASCII(this.hostname));var B=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+B,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[w])for(C=0,R=u.length;C0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift())),n.search=t.search,n.query=t.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!M.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=M.slice(-1)[0],T=(n.host||t.host||M.length>1)&&("."===E||".."===E)||""===E,C=0,A=M.length;A>=0;A--)"."===(E=M[A])?M.splice(A,1):".."===E?(M.splice(A,1),C++):C&&(M.splice(A,1),C--);if(!x&&!w)for(;C--;C)M.unshift("..");!x||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),T&&"/"!==M.join("/").substr(-1)&&M.push("");var P,L=""===M[0]||M[0]&&"/"===M[0].charAt(0);return S&&(n.hostname=n.host=L?"":M.length?M.shift():"",(P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift())),(x=x||n.host&&M.length)&&!L&&M.unshift(""),M.length?n.pathname=M.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:"oWqx","./util":"YsIc",querystring:"fk5h"}],KKrj:[function(t,e,n){var r=arguments[3],i=t("./lib/request"),o=t("./lib/response"),s=t("xtend"),a=t("builtin-status-codes"),l=t("url"),c=n;c.request=function(t,e){t="string"==typeof t?l.parse(t):s(t);var n=-1===r.location.protocol.search(/^https?:$/)?"http:":"",o=t.protocol||n,a=t.hostname||t.host,c=t.port,u=t.path||"/";a&&-1!==a.indexOf(":")&&(a="["+a+"]"),t.url=(a?o+"//"+a:"")+(c?":"+c:"")+u,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var h=new i(t);return e&&h.on("response",e),h},c.get=function(t,e){var n=c.request(t,e);return n.end(),n},c.ClientRequest=i,c.IncomingMessage=o.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=a,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},{"./lib/request":"yL7F","./lib/response":"UxIR",xtend:"K5Tb","builtin-status-codes":"OpTI",url:"Mej7"}],wVMl:[function(t,e,n){var r=t("http"),i=t("url"),o=e.exports;for(var s in r)r.hasOwnProperty(s)&&(o[s]=r[s]);function a(t){if("string"==typeof t&&(t=i.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}o.request=function(t,e){return t=a(t),r.request.call(this,t,e)},o.get=function(t,e){return t=a(t),r.get.call(this,t,e)}},{http:"KKrj",url:"Mej7"}],SHlS:[function(t,e,n){t("buffer").Buffer;var r=t("buffer").Buffer;Object.defineProperty(n,"__esModule",{value:!0}),n.HttpClient=void 0;var i=v(t("@babel/runtime/helpers/defineProperty")),o=v(t("@babel/runtime/regenerator")),s=v(t("@babel/runtime/helpers/asyncToGenerator")),a=v(t("@babel/runtime/helpers/classCallCheck")),l=v(t("@babel/runtime/helpers/createClass")),c=v(t("@babel/runtime/helpers/inherits")),u=v(t("@babel/runtime/helpers/possibleConstructorReturn")),h=v(t("@babel/runtime/helpers/getPrototypeOf")),f=v(t("http")),d=v(t("https")),p=v(t("url")),m=t("./base"),g=t("../../utils");function v(t){return t&&t.__esModule?t:{default:t}}function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e0&&void 0!==s[0]?s[0]:{},n=e.headers,r=e.signal,t.next=3,this.constructRequest(n,r);case 3:return i=t.sent,t.abrupt("return",i);case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),n}(m.BaseClient);n.HttpClient=w},{"@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0",http:"KKrj",https:"wVMl",url:"Mej7","./base":"uL1U","../../utils":"FOZT",buffer:"dskh"}],itmA:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeFetchSource=M,n.makeXHRSource=S,n.makeHttpSource=E,n.makeRemoteSource=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.forceXHR,i=void 0!==n&&n,o=(0,r.default)(e,["forceXHR"]);return"function"!=typeof fetch||i?"undefined"!=typeof XMLHttpRequest?S(t,o):E(t,o):M(t,o)};var r=y(t("@babel/runtime/helpers/objectWithoutProperties")),i=y(t("@babel/runtime/helpers/defineProperty")),o=y(t("@babel/runtime/regenerator")),s=y(t("@babel/runtime/helpers/asyncToGenerator")),a=y(t("@babel/runtime/helpers/classCallCheck")),l=y(t("@babel/runtime/helpers/createClass")),c=y(t("@babel/runtime/helpers/inherits")),u=y(t("@babel/runtime/helpers/possibleConstructorReturn")),h=y(t("@babel/runtime/helpers/getPrototypeOf")),f=t("./httputils"),d=t("./basesource"),p=t("./blockedsource"),m=t("./client/fetch"),g=t("./client/xhr"),v=t("./client/http");function y(t){return t&&t.__esModule?t:{default:t}}function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e=e.length)){t.next=4;break}return t.abrupt("return",this.fetchSlices(e,n));case 4:this.maxRanges>0&&e.length;case 5:return t.next=7,Promise.all(e.map((function(t){return r.fetchSlice(t,n)})));case 7:return t.abrupt("return",t.sent);case 8:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"fetchSlices",value:function(){var t=(0,s.default)(o.default.mark((function t(e,n){var r,i,s,a,l,c,u,h,d,p,m,g,v,y=this;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.client.request({headers:_(_({},this.headers),{},{Range:"bytes=".concat(e.map((function(t){var e=t.offset,n=t.length;return"".concat(e,"-").concat(e+n)})).join(","))}),signal:n});case 2:if((r=t.sent).ok){t.next=7;break}throw new Error("Error fetching data.");case 7:if(206!==r.status){t.next=32;break}if(i=(0,f.parseContentType)(r.getHeader("content-type")),s=i.type,a=i.params,"multipart/byteranges"!==s){t.next=18;break}return t.t0=f.parseByteRanges,t.next=13,r.getData();case 13:return t.t1=t.sent,t.t2=a.boundary,l=(0,t.t0)(t.t1,t.t2),this._fileSize=l[0].fileSize||null,t.abrupt("return",l);case 18:return t.next=20,r.getData();case 20:if(c=t.sent,u=(0,f.parseContentRange)(r.getHeader("content-range")),h=u.start,d=u.end,p=u.total,this._fileSize=p||null,m=[{data:c,offset:h,length:d-h}],!(e.length>1)){t.next=29;break}return t.next=27,Promise.all(e.slice(1).map((function(t){return y.fetchSlice(t,n)})));case 27:return g=t.sent,t.abrupt("return",m.concat(g));case 29:return t.abrupt("return",m);case 32:if(this.allowFullFile){t.next=34;break}throw new Error("Server responded with full file");case 34:return t.next=36,r.getData();case 36:return v=t.sent,this._fileSize=v.byteLength,t.abrupt("return",[{data:v,offset:0,length:v.byteLength}]);case 39:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"fetchSlice",value:function(){var t=(0,s.default)(o.default.mark((function t(e,n){var r,i,s,a,l,c,u;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.offset,i=e.length,t.next=3,this.client.request({headers:_(_({},this.headers),{},{Range:"bytes=".concat(r,"-").concat(r+i)}),signal:n});case 3:if((s=t.sent).ok){t.next=8;break}throw new Error("Error fetching data.");case 8:if(206!==s.status){t.next=17;break}return t.next=11,s.getData();case 11:return a=t.sent,l=(0,f.parseContentRange)(s.getHeader("content-range")),c=l.total,this._fileSize=c||null,t.abrupt("return",{data:a,offset:r,length:i});case 17:if(this.allowFullFile){t.next=19;break}throw new Error("Server responded with full file");case 19:return t.next=21,s.getData();case 21:return u=t.sent,this._fileSize=u.byteLength,t.abrupt("return",{data:u,offset:0,length:u.byteLength});case 24:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"fileSize",get:function(){return this._fileSize}}]),n}(d.BaseSource);function w(t,e){var n=e.blockSize,r=e.cacheSize;return null===n?t:new p.BlockedSource(t,n,r)}function M(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.headers,i=void 0===n?{}:n,o=e.credentials,s=e.maxRanges,a=void 0===s?0:s,l=e.allowFullFile,c=void 0!==l&&l,u=(0,r.default)(e,["headers","credentials","maxRanges","allowFullFile"]),h=new m.FetchClient(t,o);return w(new x(h,i,a,c),u)}function S(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.headers,i=void 0===n?{}:n,o=e.maxRanges,s=void 0===o?0:o,a=e.allowFullFile,l=void 0!==a&&a,c=(0,r.default)(e,["headers","maxRanges","allowFullFile"]),u=new g.XHRClient(t);return w(new x(u,i,s,l),c)}function E(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.headers,i=void 0===n?{}:n,o=e.maxRanges,s=void 0===o?0:o,a=e.allowFullFile,l=void 0!==a&&a,c=(0,r.default)(e,["headers","maxRanges","allowFullFile"]),u=new v.HttpClient(t);return w(new x(u,i,s,l),c)}},{"@babel/runtime/helpers/objectWithoutProperties":"U8F3","@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./httputils":"ZJpj","./basesource":"LzCD","./blockedsource":"xD7g","./client/fetch":"Un5s","./client/xhr":"hvgd","./client/http":"SHlS"}],wM9h:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeBufferSource=function(t){return new h(t)};var r=u(t("@babel/runtime/helpers/classCallCheck")),i=u(t("@babel/runtime/helpers/createClass")),o=u(t("@babel/runtime/helpers/inherits")),s=u(t("@babel/runtime/helpers/possibleConstructorReturn")),a=u(t("@babel/runtime/helpers/getPrototypeOf")),l=t("./basesource"),c=t("../utils");function u(t){return t&&t.__esModule?t:{default:t}}var h=function(t){(0,o.default)(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,a.default)(t);if(e){var i=(0,a.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}(n);function n(t){var i;return(0,r.default)(this,n),(i=e.call(this)).arrayBuffer=t,i}return(0,i.default)(n,[{key:"fetchSlice",value:function(t,e){if(e&&e.aborted)throw new c.AbortError("Request aborted");return this.arrayBuffer.slice(t.offset,t.offset+t.length)}}]),n}(l.BaseSource)},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./basesource":"LzCD","../utils":"FOZT"}],GiEG:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeFileReaderSource=function(t){return new h(t)};var r=u(t("@babel/runtime/regenerator")),i=u(t("@babel/runtime/helpers/asyncToGenerator")),o=u(t("@babel/runtime/helpers/classCallCheck")),s=u(t("@babel/runtime/helpers/createClass")),a=u(t("@babel/runtime/helpers/inherits")),l=u(t("@babel/runtime/helpers/possibleConstructorReturn")),c=u(t("@babel/runtime/helpers/getPrototypeOf"));function u(t){return t&&t.__esModule?t:{default:t}}var h=function(t){(0,a.default)(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,c.default)(t);if(e){var i=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}(n);function n(t){var r;return(0,o.default)(this,n),(r=e.call(this)).file=t,r}return(0,s.default)(n,[{key:"fetchSlice",value:function(){var t=(0,i.default)(r.default.mark((function t(e,n){var i=this;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,r){var o=i.file.slice(e.offset,e.offset+e.length),s=new FileReader;s.onload=function(e){return t(e.target.result)},s.onerror=r,s.onabort=r,s.readAsArrayBuffer(o),n&&n.addEventListener("abort",(function(){return s.abort()}))})));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()}]),n}(t("./basesource").BaseSource)},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./basesource":"LzCD"}],G7Cz:[function(t,e,n){t("buffer").Buffer;var r=t("buffer").Buffer;Object.defineProperty(n,"__esModule",{value:!0}),n.makeFileSource=function(t){return new m(t)};var i=f(t("@babel/runtime/regenerator")),o=f(t("@babel/runtime/helpers/asyncToGenerator")),s=f(t("@babel/runtime/helpers/classCallCheck")),a=f(t("@babel/runtime/helpers/createClass")),l=f(t("@babel/runtime/helpers/inherits")),c=f(t("@babel/runtime/helpers/possibleConstructorReturn")),u=f(t("@babel/runtime/helpers/getPrototypeOf")),h=t("fs");function f(t){return t&&t.__esModule?t:{default:t}}function d(t){return new Promise((function(e,n){(0,h.close)(t,(function(t){t?n(t):e()}))}))}function p(){for(var t=arguments.length,e=new Array(t),n=0;n2&&void 0!==arguments[2]?arguments[2]:void 0;return new Promise((function(r,i){(0,h.open)(t,e,n,(function(t,e){t?i(t):r(e)}))}))}(t,"r"),r}return(0,a.default)(n,[{key:"fetchSlice",value:function(){var t=(0,o.default)(i.default.mark((function t(e){var n,o,s;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.openRequest;case 2:return n=t.sent,t.next=5,p(n,r.alloc(e.length),0,e.length,e.offset);case 5:return o=t.sent,s=o.buffer,t.abrupt("return",s.buffer);case 8:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"close",value:function(){var t=(0,o.default)(i.default.mark((function t(){var e;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.openRequest;case 2:return e=t.sent,t.next=5,d(e);case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),n}(t("./basesource").BaseSource)},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0",fs:"rDCW","./basesource":"LzCD",buffer:"dskh"}],BGyE:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.writeGeotiff=function(t,e){var n,o,s,a;"number"==typeof t[0]?(n=e.height||e.ImageLength,s=e.width||e.ImageWidth,o=t.length/(n*s),a=t):(o=t.length,n=t[0].length,s=t[0][0].length,a=[],(0,i.times)(n,(function(e){(0,i.times)(s,(function(n){(0,i.times)(o,(function(r){a.push(t[r][e][n])}))}))}))),e.ImageLength=n,delete e.height,e.ImageWidth=s,delete e.width,e.BitsPerSample||(e.BitsPerSample=(0,i.times)(o,(function(){return 8}))),g.forEach((function(t){var n=t[0];if(!e[n]){var r=t[1];e[n]=r}})),e.PhotometricInterpretation||(e.PhotometricInterpretation=3===e.BitsPerSample.length?2:1),e.SamplesPerPixel||(e.SamplesPerPixel=[o]),e.StripByteCounts||(e.StripByteCounts=[o*n*s]),e.ModelPixelScale||(e.ModelPixelScale=[360/s,180/n,0]),e.SampleFormat||(e.SampleFormat=(0,i.times)(o,(function(){return 1})));var l=Object.keys(e).filter((function(t){return(0,i.endsWith)(t,"GeoKey")})).sort((function(t,e){return u[t]-u[e]}));if(!e.GeoKeyDirectory){var c=[1,1,0,l.length];l.forEach((function(t){var n,i,o,s=Number(u[t]);c.push(s),"SHORT"===r.fieldTagTypes[s]?(n=1,i=0,o=e[t]):"GeogCitationGeoKey"===t?(n=e.GeoAsciiParams.length,i=Number(u.GeoAsciiParams),o=0):console.log("[geotiff.js] couldn't get TIFFTagLocation for ".concat(t)),c.push(i),c.push(n),c.push(o)})),e.GeoKeyDirectory=c}for(var h in l)l.hasOwnProperty(h)&&delete e[h];["Compression","ExtraSamples","GeographicTypeGeoKey","GTModelTypeGeoKey","GTRasterTypeGeoKey","ImageLength","ImageWidth","PhotometricInterpretation","PlanarConfiguration","ResolutionUnit","SamplesPerPixel","XPosition","YPosition"].forEach((function(t){e[t]&&(e[t]=function(t){return Array.isArray(t)?t:[t]}(e[t]))}));var f=function(t){var e={};for(var n in t)"StripOffsets"!==n&&(u[n]||console.error(n,"not in name2code:",Object.keys(u)),e[u[n]]=t[n]);return e}(e);return m(a,s,n,f)};var r=t("./globals"),i=t("./utils");function o(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=s(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function s(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n>8&255,t[e+1]=255&n},writeUint:function(t,e,n){t[e]=n>>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=n>>0&255},writeASCII:function(t,e,n){(0,i.times)(n.length,(function(r){t[e+r]=n.charCodeAt(r)}))},ui8:new Uint8Array(8)};d.fl64=new Float64Array(d.ui8.buffer),d.writeDouble=function(t,e,n){d.fl64[0]=n,(0,i.times)(8,(function(n){t[e+n]=d.ui8[7-n]}))};var p=function(t,e,n,s){var a=n,l=Object.keys(s).filter((function(t){return null!=t&&"undefined"!==t}));t.writeUshort(e,a,l.length);var c,u=(a+=2)+12*l.length+4,f=o(l);try{var d=function(){var n=c.value,o=null;"number"==typeof n?o=n:"string"==typeof n&&(o=parseInt(n,10));var l=r.fieldTagTypes[o],f=h[l];if(null==l||void 0===l||void 0===l)throw new Error("unknown type of tag: ".concat(o));var d=s[n];if(void 0===d)throw new Error("failed to get value for key ".concat(n));"ASCII"===l&&"string"==typeof d&&!1===(0,i.endsWith)(d,"\0")&&(d+="\0");var p=d.length;t.writeUshort(e,a,o),a+=2,t.writeUshort(e,a,f),a+=2,t.writeUint(e,a,p);var m=[-1,1,1,2,4,8,0,0,0,0,0,0,8][f]*p,g=a+=4;m>4&&(t.writeUint(e,a,u),g=u),"ASCII"===l?t.writeASCII(e,g,d):"SHORT"===l?(0,i.times)(p,(function(n){t.writeUshort(e,g+2*n,d[n])})):"LONG"===l?(0,i.times)(p,(function(n){t.writeUint(e,g+4*n,d[n])})):"RATIONAL"===l?(0,i.times)(p,(function(n){t.writeUint(e,g+8*n,Math.round(1e4*d[n])),t.writeUint(e,g+8*n+4,1e4)})):"DOUBLE"===l&&(0,i.times)(p,(function(n){t.writeDouble(e,g+8*n,d[n])})),m>4&&(u+=m+=1&m),a+=4};for(f.s();!(c=f.n()).done;)d()}catch(t){f.e(t)}finally{f.f()}return[a,u]},m=function(t,e,n,r){if(null==n)throw new Error("you passed into encodeImage a width of type ".concat(n));if(null==e)throw new Error("you passed into encodeImage a width of type ".concat(e));var o={256:[e],257:[n],273:[f],278:[n],305:"geotiff.js"};if(r)for(var s in r)r.hasOwnProperty(s)&&(o[s]=r[s]);var a=new Uint8Array(function(t){var e=new Uint8Array(f),n=4,r=d;e[0]=77,e[1]=77,e[3]=42;var i=8;if(r.writeUint(e,n,i),n+=4,t.forEach((function(n,o){var s=p(r,e,i,n);i=s[1],o0&&void 0!==arguments[0]?arguments[0]:new s;a=t},n.debug=function(){var t;return(t=a).debug.apply(t,arguments)},n.log=function(){var t;return(t=a).log.apply(t,arguments)},n.info=function(){var t;return(t=a).info.apply(t,arguments)},n.warn=function(){var t;return(t=a).warn.apply(t,arguments)},n.error=function(){var t;return(t=a).error.apply(t,arguments)},n.time=function(){var t;return(t=a).time.apply(t,arguments)},n.timeEnd=function(){var t;return(t=a).timeEnd.apply(t,arguments)};var r=o(t("@babel/runtime/helpers/classCallCheck")),i=o(t("@babel/runtime/helpers/createClass"));function o(t){return t&&t.__esModule?t:{default:t}}var s=function(){function t(){(0,r.default)(this,t)}return(0,i.default)(t,[{key:"log",value:function(){}},{key:"debug",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}},{key:"time",value:function(){}},{key:"timeEnd",value:function(){}}]),t}(),a=new s},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW"}],bsJs:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.fromUrl=function(t){return U.apply(this,arguments)},n.fromArrayBuffer=function(t,e){return H.apply(this,arguments)},n.fromFile=function(t,e){return G.apply(this,arguments)},n.fromBlob=function(t,e){return W.apply(this,arguments)},n.fromUrls=function(t){return V.apply(this,arguments)},n.writeArrayBuffer=function(t,e){return q.apply(this,arguments)},Object.defineProperty(n,"Pool",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(n,"getDecoder",{enumerable:!0,get:function(){return S.getDecoder}}),Object.defineProperty(n,"setLogger",{enumerable:!0,get:function(){return E.setLogger}}),n.rgb=n.globals=n.MultiGeoTIFF=n.default=n.GeoTIFF=void 0;var r=A(t("@babel/runtime/regenerator")),i=A(t("@babel/runtime/helpers/defineProperty")),o=A(t("@babel/runtime/helpers/slicedToArray")),s=A(t("@babel/runtime/helpers/asyncToGenerator")),a=A(t("@babel/runtime/helpers/createClass")),l=A(t("@babel/runtime/helpers/inherits")),c=A(t("@babel/runtime/helpers/possibleConstructorReturn")),u=A(t("@babel/runtime/helpers/getPrototypeOf")),h=A(t("@babel/runtime/helpers/wrapNativeSuper")),f=A(t("@babel/runtime/helpers/classCallCheck")),d=A(t("./geotiffimage")),p=A(t("./dataview64")),m=A(t("./dataslice")),g=A(t("./pool")),v=t("./source/remote"),y=t("./source/arraybuffer"),b=t("./source/filereader"),_=t("./source/file"),x=C(t("./globals"));n.globals=x;var w=t("./geotiffwriter"),M=C(t("./rgb"));n.rgb=M;var S=t("./compression"),E=t("./logging");function T(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return T=function(){return t},t}function C(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=T();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}function A(t){return t&&t.__esModule?t:{default:t}}function P(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function L(t){for(var e=1;e0&&void 0!==G[0]?G[0]:{},n=e.window,i=e.width,s=e.height,a=e.resX,l=e.resY,c=e.bbox,t.next=5,this.getImage();case 5:return u=t.sent,h=u,t.next=9,this.getImageCount();case 9:if(f=t.sent,d=u.getBoundingBox(),!n||!c){t.next=13;break}throw new Error('Both "bbox" and "window" passed.');case 13:if(!i&&!s){t.next=24;break}if(n&&(p=u.getOrigin(),m=(0,o.default)(p,2),g=m[0],v=m[1],y=u.getResolution(),b=(0,o.default)(y,2),_=b[0],x=b[1],c=[g+n[0]*_,v+n[1]*x,g+n[2]*_,v+n[3]*x]),w=c||d,!i){t.next=20;break}if(!a){t.next=19;break}throw new Error("Both width and resX passed");case 19:a=(w[2]-w[0])/i;case 20:if(!s){t.next=24;break}if(!l){t.next=23;break}throw new Error("Both width and resY passed");case 23:l=(w[3]-w[1])/s;case 24:if(!a&&!l){t.next=48;break}M=[],S=0;case 27:if(!(SO||l&&l>k)){t.next=45;break}return t.abrupt("break",48);case 45:++P,t.next=38;break;case 48:return I=n,c&&(D=u.getOrigin(),N=(0,o.default)(D,2),j=N[0],F=N[1],B=h.getResolution(u),z=(0,o.default)(B,2),U=z[0],H=z[1],I=[Math.round((c[0]-j)/U),Math.round((c[1]-F)/H),Math.round((c[2]-j)/U),Math.round((c[3]-F)/H)],I=[Math.min(I[0],I[2]),Math.min(I[1],I[3]),Math.max(I[0],I[2]),Math.max(I[1],I[3])]),t.abrupt("return",h.readRasters(L(L({},e),{},{window:I})));case 51:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),t}(),F=function(t){(0,l.default)(n,t);var e=R(n);function n(t,r,i,o){var s,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(0,f.default)(this,n),(s=e.call(this)).source=t,s.littleEndian=r,s.bigTiff=i,s.firstIFDOffset=o,s.cache=a.cache||!1,s.ifdRequests=[],s.ghostValues=null,s}return(0,a.default)(n,[{key:"getSlice",value:function(){var t=(0,s.default)(r.default.mark((function t(e,n){var i;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.bigTiff?4048:1024,t.t0=m.default,t.next=4,this.source.fetch([{offset:e,length:void 0!==n?n:i}]);case 4:return t.t1=t.sent[0],t.t2=e,t.t3=this.littleEndian,t.t4=this.bigTiff,t.abrupt("return",new t.t0(t.t1,t.t2,t.t3,t.t4));case 9:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"parseFileDirectoryAt",value:function(){var t=(0,s.default)(r.default.mark((function t(e){var n,i,o,s,a,l,c,u,h,f,d,p,m,g,v,y,b,_,w,M;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.bigTiff?20:12,i=this.bigTiff?8:2,t.next=4,this.getSlice(e);case 4:if(o=t.sent,s=this.bigTiff?o.readUint64(e):o.readUint16(e),a=s*n+(this.bigTiff?16:6),o.covers(e,a)){t.next=11;break}return t.next=10,this.getSlice(e,a);case 10:o=t.sent;case 11:l={},c=e+(this.bigTiff?8:2),u=0;case 14:if(!(u0&&void 0!==i[0]?i[0]:0,t.next=3,this.requestIFD(e);case 3:return n=t.sent,t.abrupt("return",new d.default(n.fileDirectory,n.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"getImageCount",value:function(){var t=(0,s.default)(r.default.mark((function t(){var e,n;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0,n=!0;case 2:if(!n){t.next=18;break}return t.prev=3,t.next=6,this.requestIFD(e);case 6:++e,t.next=16;break;case 9:if(t.prev=9,t.t0=t.catch(3),!(t.t0 instanceof N)){t.next=15;break}n=!1,t.next=16;break;case 15:throw t.t0;case 16:t.next=2;break;case 18:return t.abrupt("return",e);case 19:case"end":return t.stop()}}),t,this,[[3,9]])})));return function(){return t.apply(this,arguments)}}()},{key:"getGhostValues",value:function(){var t=(0,s.default)(r.default.mark((function t(){var e,n,i,s,a,l,c,u,h=this;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.bigTiff?16:8,!this.ghostValues){t.next=3;break}return t.abrupt("return",this.ghostValues);case 3:return i=(n="GDAL_STRUCTURAL_METADATA_SIZE=").length+100,t.next=7,this.getSlice(e,i);case 7:if(s=t.sent,n!==I(s,x.fieldTypes.ASCII,n.length,e)){t.next=19;break}if(a=I(s,x.fieldTypes.ASCII,i,e),l=a.split("\n")[0],!((c=Number(l.split("=")[1].split(" ")[0])+l.length)>i)){t.next=16;break}return t.next=15,this.getSlice(e,c);case 15:s=t.sent;case 16:u=I(s,x.fieldTypes.ASCII,c,e),this.ghostValues={},u.split("\n").filter((function(t){return t.length>0})).map((function(t){return t.split("=")})).forEach((function(t){var e=(0,o.default)(t,2),n=e[0],r=e[1];h.ghostValues[n]=r}));case 19:return t.abrupt("return",this.ghostValues);case 20:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"close",value:function(){return"function"==typeof this.source.close&&this.source.close()}}],[{key:"fromSource",value:function(){var t=(0,s.default)(r.default.mark((function t(e,i,o){var s,a,l,c,u,h,f;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.fetch([{offset:0,length:1024}],o);case 2:if(s=t.sent[0],a=new p.default(s),18761!==(l=a.getUint16(0,0))){t.next=9;break}c=!0,t.next=14;break;case 9:if(19789!==l){t.next=13;break}c=!1,t.next=14;break;case 13:throw new TypeError("Invalid byte order value.");case 14:if(42!==(u=a.getUint16(2,c))){t.next=19;break}h=!1,t.next=27;break;case 19:if(43!==u){t.next=26;break}if(h=!0,8===a.getUint16(4,c)){t.next=24;break}throw new Error("Unsupported offset byte-size.");case 24:t.next=27;break;case 26:throw new TypeError("Invalid magic number.");case 27:return f=h?a.getUint64(8,c):a.getUint32(4,c),t.abrupt("return",new n(e,c,h,f,i));case 29:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()}]),n}(j);n.GeoTIFF=F;var B=F;n.default=B;var z=function(t){(0,l.default)(n,t);var e=R(n);function n(t,r){var i;return(0,f.default)(this,n),(i=e.call(this)).mainFile=t,i.overviewFiles=r,i.imageFiles=[t].concat(r),i.fileDirectoriesPerFile=null,i.fileDirectoriesPerFileParsing=null,i.imageCount=null,i}return(0,a.default)(n,[{key:"parseFileDirectoriesPerFile",value:function(){var t=(0,s.default)(r.default.mark((function t(){var e;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map((function(t){return t.parseFileDirectoryAt(t.firstIFDOffset)}))),t.next=3,Promise.all(e);case 3:return this.fileDirectoriesPerFile=t.sent,t.abrupt("return",this.fileDirectoriesPerFile);case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"getImage",value:function(){var t=(0,s.default)(r.default.mark((function t(){var e,n,i,o,s,a,l,c=arguments;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=c.length>0&&void 0!==c[0]?c[0]:0,t.next=3,this.getImageCount();case 3:return t.next=5,this.parseFileDirectoriesPerFile();case 5:n=0,i=0,o=0;case 8:if(!(o1&&void 0!==o[1]?o[1]:{},i=o.length>2?o[2]:void 0,t.abrupt("return",F.fromSource((0,v.makeRemoteSource)(e,n),i));case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function H(){return(H=(0,s.default)(r.default.mark((function t(e,n){return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",F.fromSource((0,y.makeBufferSource)(e),n));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function G(){return(G=(0,s.default)(r.default.mark((function t(e,n){return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",F.fromSource((0,_.makeFileSource)(e),n));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function W(){return(W=(0,s.default)(r.default.mark((function t(e,n){return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",F.fromSource((0,b.makeFileReaderSource)(e),n));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function V(){return(V=(0,s.default)(r.default.mark((function t(e){var n,i,o,s,a,l=arguments;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=l.length>1&&void 0!==l[1]?l[1]:[],i=l.length>2&&void 0!==l[2]?l[2]:{},o=l.length>3?l[3]:void 0,t.next=5,F.fromSource((0,v.makeRemoteSource)(e,i),o);case 5:return s=t.sent,t.next=8,Promise.all(n.map((function(t){return F.fromSource((0,v.makeRemoteSource)(t,i))})));case 8:return a=t.sent,t.abrupt("return",new z(s,a));case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function q(){return(q=(0,s.default)(r.default.mark((function t(e,n){return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,w.writeGeotiff)(e,n));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}n.MultiGeoTIFF=z},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/helpers/slicedToArray":"HETk","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","@babel/runtime/helpers/wrapNativeSuper":"ozpi","@babel/runtime/helpers/classCallCheck":"fcMS","./geotiffimage":"eOWo","./dataview64":"dqpX","./dataslice":"dGLV","./pool":"dHPO","./source/remote":"itmA","./source/arraybuffer":"wM9h","./source/filereader":"GiEG","./source/file":"G7Cz","./globals":"j27V","./geotiffwriter":"BGyE","./rgb":"fpBl","./compression":"FGCZ","./logging":"dy4f"}]},{},["bsJs"])},function(t,e,n){var r=n(7),i=n(0),o=n(1),s=n(9).default,a=o.featureEach,l=(o.coordEach,i.polygon,i.featureCollection);function c(t){var e=r(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:s(t),r.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:s(t),e.push(t)})):a(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:s(t),e.push(t)})),r.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:s(t),r.prototype.remove.call(this,t,e)},e.clear=function(){return r.prototype.clear.call(this)},e.search=function(t){var e=r.prototype.search.call(this,this.toBBox(t));return l(e)},e.collides=function(t){return r.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=r.prototype.all.call(this);return l(t)},e.toJSON=function(){return r.prototype.toJSON.call(this)},e.fromJSON=function(t){return r.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=s(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=s(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}t.exports=c,t.exports.default=c},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,n,i,o){for(var s,a=[e,n];a.length;)(n=a.pop())-(e=a.pop())<=i||(s=e+Math.ceil((n-e)/i/2)*i,r(t,s,e,n,o),a.push(e,s,s,n))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!p(t,e))return n;for(var i,o,s,a,l=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),a=m(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,s(n,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,l,c,u,f,d,p,m,g,v,y;for(c=u=1/0,r=e;r<=n-e;r++)i=a(t,0,r,this.toBBox),o=a(t,r,n,this.toBBox),d=i,p=o,m=void 0,g=void 0,v=void 0,y=void 0,m=Math.max(d.minX,p.minX),g=Math.max(d.minY,p.minY),v=Math.min(d.maxX,p.maxX),y=Math.min(d.maxY,p.maxY),s=Math.max(0,v-m)*Math.max(0,y-g),l=h(i)+h(o),s=e;i--)o=t.children[i],l(u,t.leaf?s(o):o),h+=f(u);return h},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)l(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():s(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},function(t,e,n){t.exports=function(){"use strict";function t(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function e(t,e){return te?1:0}return function(n,r,i,o,s){!function e(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1),f=Math.max(i,Math.floor(r-l*u/a+h)),d=Math.min(o,Math.floor(r+(a-l)*u/a+h));e(n,r,f,d,s)}var p=n[r],m=i,g=o;for(t(n,i,r),s(n[o],p)>0&&t(n,i,o);m0;)g--}0===s(n[i],p)?t(n,i,g):(g++,t(n,g,o)),g<=r&&(i=g+1),r<=g&&(o=g-1)}}(n,r,i||0,o||n.length-1,s||e)}}()},function(t,e,n){"use strict";n.r(e);var r=n(1);function i(t){var e=[1/0,1/0,-1/0,-1/0];return Object(r.coordEach)(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]1)for(var n=1;ndiv{width:60px;height:60px;background:rgba(255,255,255,0);position:absolute;left:50%;margin-left:-30px;top:50%;margin-top:-5px;border-radius:2px;border:2px solid rgba(255,255,255,0.7)}@-webkit-keyframes translateIn{30%{transform:rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);opacity:0.7;background:rgba(255,255,255,0.3)}100%{transform:rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);opacity:0;background:rgba(255,255,255,0)}}@keyframes translateIn{30%{transform:rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);opacity:0.7;background:rgba(255,255,255,0.3)}100%{transform:rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);opacity:0;background:rgba(255,255,255,0)}}._lithosphere_loadingscreen_loading>div{opacity:0}._lithosphere_loadingscreen_loading>div:nth-of-type(1){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(30px);-webkit-animation:translateIn 1.9s ease-in infinite 500ms;animation:translateIn 1.9s ease-in infinite 500ms}._lithosphere_loadingscreen_loading>div:nth-of-type(2){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(60px);-webkit-animation:translateIn 1.9s ease-in infinite 700ms;animation:translateIn 1.9s ease-in infinite 700ms}._lithosphere_loadingscreen_loading>div:nth-of-type(3){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(85px);-webkit-animation:translateIn 1.9s ease-in infinite 800ms;animation:translateIn 1.9s ease-in infinite 800ms}._lithosphere_loadingscreen_loading>div:nth-of-type(4){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(105px);-webkit-animation:translateIn 1.9s ease-in infinite 1000ms;animation:translateIn 1.9s ease-in infinite 1000ms}._lithosphere_loadingscreen_loading>div:nth-of-type(5){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(120px);-webkit-animation:translateIn 1.9s ease-in infinite 1200ms;animation:translateIn 1.9s ease-in infinite 1200ms}._lithosphere_loadingscreen_loading>div:nth-of-type(6){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(130px);-webkit-animation:translateIn 1.9s ease-in infinite 1400ms;animation:translateIn 1.9s ease-in infinite 1400ms}\n",""]),e.default=i},function(t,e,n){"use strict";n.r(e);const r=0,i=1,o=2;function s(){}Object.assign(s.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}},dispatchEvent:function(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,r=n.length;e>8&255]+a[t>>16&255]+a[t>>24&255]+"-"+a[255&e]+a[e>>8&255]+"-"+a[e>>16&15|64]+a[e>>24&255]+"-"+a[63&n|128]+a[n>>8&255]+"-"+a[n>>16&255]+a[n>>24&255]+a[255&r]+a[r>>8&255]+a[r>>16&255]+a[r>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},damp:function(t,e,n,r){return c.lerp(t,e,1-Math.exp(-n*r))},pingpong:function(t,e=1){return e-Math.abs(c.euclideanModulo(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){return void 0!==t&&(l=t%2147483647),l=16807*l%2147483647,(l-1)/2147483646},degToRad:function(t){return t*c.DEG2RAD},radToDeg:function(t){return t*c.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,r,i){const o=Math.cos,s=Math.sin,a=o(n/2),l=s(n/2),c=o((e+r)/2),u=s((e+r)/2),h=o((e-r)/2),f=s((e-r)/2),d=o((r-e)/2),p=s((r-e)/2);switch(i){case"XYX":t.set(a*u,l*h,l*f,a*c);break;case"YZY":t.set(l*f,a*u,l*h,a*c);break;case"ZXZ":t.set(l*h,l*f,a*u,a*c);break;case"XZX":t.set(a*u,l*p,l*d,a*c);break;case"YXY":t.set(l*d,a*u,l*p,a*c);break;case"ZYZ":t.set(l*p,l*d,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};class u{constructor(t=0,e=0){Object.defineProperty(this,"isVector2",{value:!0}),this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*n-o*r+t.x,this.y=i*r+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class h{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,r,i,o,s,a,l){const c=this.elements;return c[0]=t,c[1]=r,c[2]=s,c[3]=e,c[4]=i,c[5]=a,c[6]=n,c[7]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,o=n[0],s=n[3],a=n[6],l=n[1],c=n[4],u=n[7],h=n[2],f=n[5],d=n[8],p=r[0],m=r[3],g=r[6],v=r[1],y=r[4],b=r[7],_=r[2],x=r[5],w=r[8];return i[0]=o*p+s*v+a*_,i[3]=o*m+s*y+a*x,i[6]=o*g+s*b+a*w,i[1]=l*p+c*v+u*_,i[4]=l*m+c*y+u*x,i[7]=l*g+c*b+u*w,i[2]=h*p+f*v+d*_,i[5]=h*m+f*y+d*x,i[8]=h*g+f*b+d*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*o*c-e*s*l-n*i*c+n*s*a+r*i*l-r*o*a}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=c*o-s*l,h=s*a-c*i,f=l*i-o*a,d=e*u+n*h+r*f;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const p=1/d;return t[0]=u*p,t[1]=(r*l-c*n)*p,t[2]=(s*n-r*o)*p,t[3]=h*p,t[4]=(c*e-r*a)*p,t[5]=(r*i-s*e)*p,t[6]=f*p,t[7]=(n*a-l*e)*p,t[8]=(o*e-n*i)*p,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).copy(this).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,i,o,s){const a=Math.cos(i),l=Math.sin(i);return this.set(n*a,n*l,-n*(a*o+l*s)+o+t,-r*l,r*a,-r*(-l*o+a*s)+s+e,0,0,1),this}scale(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){const e=Math.cos(t),n=Math.sin(t),r=this.elements,i=r[0],o=r[3],s=r[6],a=r[1],l=r[4],c=r[7];return r[0]=e*i+n*a,r[3]=e*o+n*l,r[6]=e*s+n*c,r[1]=-n*i+e*a,r[4]=-n*o+e*l,r[7]=-n*s+e*c,this}translate(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}}let f;const d={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===f&&(f=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),f.width=t.width,f.height=t.height;const n=f.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=f}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}};let p=0;function m(t=m.DEFAULT_IMAGE,e=m.DEFAULT_MAPPING,n=1001,r=1001,i=1006,o=1008,s=1023,a=1009,l=1,f=3e3){Object.defineProperty(this,"id",{value:p++}),this.uuid=c.generateUUID(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=a,this.offset=new u(0,0),this.repeat=new u(1,1),this.center=new u(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new h,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=f,this.version=0,this.onUpdate=null}function g(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?d.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}m.DEFAULT_IMAGE=void 0,m.DEFAULT_MAPPING=300,m.prototype=Object.assign(Object.create(s.prototype),{constructor:m,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const r=this.image;if(void 0===r.uuid&&(r.uuid=c.generateUUID()),!e&&void 0===t.images[r.uuid]){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(m.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});class v{constructor(t=0,e=0,n=0,r=1){Object.defineProperty(this,"isVector4",{value:!0}),this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*i,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,i;const o=t.elements,s=o[0],a=o[4],l=o[8],c=o[1],u=o[5],h=o[9],f=o[2],d=o[6],p=o[10];if(Math.abs(a-c)<.01&&Math.abs(l-f)<.01&&Math.abs(h-d)<.01){if(Math.abs(a+c)<.1&&Math.abs(l+f)<.1&&Math.abs(h+d)<.1&&Math.abs(s+u+p-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const t=(s+1)/2,o=(u+1)/2,m=(p+1)/2,g=(a+c)/4,v=(l+f)/4,y=(h+d)/4;return t>o&&t>m?t<.01?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(t),r=g/n,i=v/n):o>m?o<.01?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(o),n=g/r,i=y/r):m<.01?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(m),n=v/i,r=y/i),this.set(n,r,i,e),this}let m=Math.sqrt((d-h)*(d-h)+(l-f)*(l-f)+(c-a)*(c-a));return Math.abs(m)<.001&&(m=1),this.x=(d-h)/m,this.y=(l-f)/m,this.z=(c-a)/m,this.w=Math.acos((s+u+p-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}class y extends s{constructor(t,e,n){super(),Object.defineProperty(this,"isWebGLRenderTarget",{value:!0}),this.width=t,this.height=e,this.scissor=new v(0,0,t,e),this.scissorTest=!1,this.viewport=new v(0,0,t,e),n=n||{},this.texture=new m(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}setSize(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class b{constructor(t=0,e=0,n=0,r=1){Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=t,this._y=e,this._z=n,this._w=r}static slerp(t,e,n,r){return n.copy(t).slerp(e,r)}static slerpFlat(t,e,n,r,i,o,s){let a=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3];const h=i[o+0],f=i[o+1],d=i[o+2],p=i[o+3];if(u!==p||a!==h||l!==f||c!==d){let t=1-s;const e=a*h+l*f+c*d+u*p,n=e>=0?1:-1,r=1-e*e;if(r>Number.EPSILON){const i=Math.sqrt(r),o=Math.atan2(i,e*n);t=Math.sin(t*o)/i,s=Math.sin(s*o)/i}const i=s*n;if(a=a*t+h*i,l=l*t+f*i,c=c*t+d*i,u=u*t+p*i,t===1-s){const t=1/Math.sqrt(a*a+l*l+c*c+u*u);a*=t,l*=t,c*=t,u*=t}}t[e]=a,t[e+1]=l,t[e+2]=c,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,r,i,o){const s=n[r],a=n[r+1],l=n[r+2],c=n[r+3],u=i[o],h=i[o+1],f=i[o+2],d=i[o+3];return t[e]=s*d+c*u+a*f-l*h,t[e+1]=a*d+c*h+l*u-s*f,t[e+2]=l*d+c*f+s*h-a*u,t[e+3]=c*d-s*u-a*h-l*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=t._x,r=t._y,i=t._z,o=t._order,s=Math.cos,a=Math.sin,l=s(n/2),c=s(r/2),u=s(i/2),h=a(n/2),f=a(r/2),d=a(i/2);switch(o){case"XYZ":this._x=h*c*u+l*f*d,this._y=l*f*u-h*c*d,this._z=l*c*d+h*f*u,this._w=l*c*u-h*f*d;break;case"YXZ":this._x=h*c*u+l*f*d,this._y=l*f*u-h*c*d,this._z=l*c*d-h*f*u,this._w=l*c*u+h*f*d;break;case"ZXY":this._x=h*c*u-l*f*d,this._y=l*f*u+h*c*d,this._z=l*c*d+h*f*u,this._w=l*c*u-h*f*d;break;case"ZYX":this._x=h*c*u-l*f*d,this._y=l*f*u+h*c*d,this._z=l*c*d-h*f*u,this._w=l*c*u+h*f*d;break;case"YZX":this._x=h*c*u+l*f*d,this._y=l*f*u+h*c*d,this._z=l*c*d-h*f*u,this._w=l*c*u-h*f*d;break;case"XZY":this._x=h*c*u-l*f*d,this._y=l*f*u-h*c*d,this._z=l*c*d+h*f*u,this._w=l*c*u+h*f*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],i=e[8],o=e[1],s=e[5],a=e[9],l=e[2],c=e[6],u=e[10],h=n+s+u;if(h>0){const t=.5/Math.sqrt(h+1);this._w=.25/t,this._x=(c-a)*t,this._y=(i-l)*t,this._z=(o-r)*t}else if(n>s&&n>u){const t=2*Math.sqrt(1+n-s-u);this._w=(c-a)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(i+l)/t}else if(s>u){const t=2*Math.sqrt(1+s-n-u);this._w=(i-l)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+u-n-s);this._w=(o-r)/t,this._x=(i+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(c.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,i=t._z,o=t._w,s=e._x,a=e._y,l=e._z,c=e._w;return this._x=n*c+o*s+r*l-i*a,this._y=r*c+o*a+i*s-n*l,this._z=i*c+o*l+n*a-r*s,this._w=o*c-n*s-r*a-i*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,r=this._y,i=this._z,o=this._w;let s=o*t._w+n*t._x+r*t._y+i*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;const a=1-s*s;if(a<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*n+e*this._x,this._y=t*r+e*this._y,this._z=t*i+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,s),u=Math.sin((1-e)*c)/l,h=Math.sin(e*c)/l;return this._w=o*u+this._w*h,this._x=n*u+this._x*h,this._y=r*u+this._y*h,this._z=i*u+this._z*h,this._onChangeCallback(),this}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}class _{constructor(t=0,e=0,n=0){Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(w.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(w.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=t.elements,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,s=t.z,a=t.w,l=a*e+o*r-s*n,c=a*n+s*e-i*r,u=a*r+i*n-o*e,h=-i*e-o*n-s*r;return this.x=l*a+h*-i+c*-s-u*-o,this.y=c*a+h*-o+u*-i-l*-s,this.z=u*a+h*-s+l*-o-c*-i,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,i=t.z,o=e.x,s=e.y,a=e.z;return this.x=r*a-i*s,this.y=i*o-n*a,this.z=n*s-r*o,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return x.copy(this).projectOnVector(t),this.sub(x)}reflect(t){return this.sub(x.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(c.clamp(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const x=new _,w=new b;class M{constructor(t,e){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==t?t:new _(1/0,1/0,1/0),this.max=void 0!==e?e:new _(-1/0,-1/0,-1/0)}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,s=-1/0;for(let a=0,l=t.length;ai&&(i=l),c>o&&(o=c),u>s&&(s=u)}return this.min.set(e,n,r),this.max.set(i,o,s),this}setFromBufferAttribute(t){let e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,s=-1/0;for(let a=0,l=t.count;ai&&(i=l),c>o&&(o=c),u>s&&(s=u)}return this.min.set(e,n,r),this.max.set(i,o,s),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new _),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,T),T.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(I),D.subVectors(this.max,I),A.subVectors(t.a,I),P.subVectors(t.b,I),L.subVectors(t.c,I),R.subVectors(P,A),O.subVectors(L,P),k.subVectors(A,L);let e=[0,-R.z,R.y,0,-O.z,O.y,0,-k.z,k.y,R.z,0,-R.x,O.z,0,-O.x,k.z,0,-k.x,-R.y,R.x,0,-O.y,O.x,0,-k.y,k.x,0];return!!S(e,A,P,L,D)&&(e=[1,0,0,0,1,0,0,0,1],!!S(e,A,P,L,D)&&(N.crossVectors(R,O),e=[N.x,N.y,N.z],S(e,A,P,L,D)))}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new _),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return T.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(T).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(E[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),E[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),E[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),E[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),E[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),E[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),E[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),E[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(E)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}function S(t,e,n,r,i){for(let o=0,s=t.length-3;o<=s;o+=3){j.fromArray(t,o);const s=i.x*Math.abs(j.x)+i.y*Math.abs(j.y)+i.z*Math.abs(j.z),a=e.dot(j),l=n.dot(j),c=r.dot(j);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>s)return!1}return!0}const E=[new _,new _,new _,new _,new _,new _,new _,new _],T=new _,C=new M,A=new _,P=new _,L=new _,R=new _,O=new _,k=new _,I=new _,D=new _,N=new _,j=new _,F=new M;class B{constructor(t,e){this.center=void 0!==t?t:new _,this.radius=void 0!==e?e:-1}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):F.setFromPoints(t).getCenter(n);let r=0;for(let e=0,i=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new M),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}}const z=new _,U=new _,H=new _,G=new _,W=new _,V=new _,q=new _;class X{constructor(t,e){this.origin=void 0!==t?t:new _,this.direction=void 0!==e?e:new _(0,0,-1)}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new _),e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,z)),this}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new _),e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=z.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(z.copy(this.direction).multiplyScalar(e).add(this.origin),z.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){U.copy(t).add(e).multiplyScalar(.5),H.copy(e).sub(t).normalize(),G.copy(this.origin).sub(U);const i=.5*t.distanceTo(e),o=-this.direction.dot(H),s=G.dot(this.direction),a=-G.dot(H),l=G.lengthSq(),c=Math.abs(1-o*o);let u,h,f,d;if(c>0)if(u=o*a-s,h=o*s-a,d=i*c,u>=0)if(h>=-d)if(h<=d){const t=1/c;u*=t,h*=t,f=u*(u+o*h+2*s)+h*(o*u+h+2*a)+l}else h=i,u=Math.max(0,-(o*h+s)),f=-u*u+h*(h+2*a)+l;else h=-i,u=Math.max(0,-(o*h+s)),f=-u*u+h*(h+2*a)+l;else h<=-d?(u=Math.max(0,-(-o*i+s)),h=u>0?-i:Math.min(Math.max(-i,-a),i),f=-u*u+h*(h+2*a)+l):h<=d?(u=0,h=Math.min(Math.max(-i,-a),i),f=h*(h+2*a)+l):(u=Math.max(0,-(o*i+s)),h=u>0?i:Math.min(Math.max(-i,-a),i),f=-u*u+h*(h+2*a)+l);else h=o>0?-i:i,u=Math.max(0,-(o*h+s)),f=-u*u+h*(h+2*a)+l;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(H).multiplyScalar(h).add(U),f}intersectSphere(t,e){z.subVectors(t.center,this.origin);const n=z.dot(this.direction),r=z.dot(z)-n*n,i=t.radius*t.radius;if(r>i)return null;const o=Math.sqrt(i-r),s=n-o,a=n+o;return s<0&&a<0?null:s<0?this.at(a,e):this.at(s,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,i,o,s,a;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(t.min.x-h.x)*l,r=(t.max.x-h.x)*l):(n=(t.max.x-h.x)*l,r=(t.min.x-h.x)*l),c>=0?(i=(t.min.y-h.y)*c,o=(t.max.y-h.y)*c):(i=(t.max.y-h.y)*c,o=(t.min.y-h.y)*c),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o=0?(s=(t.min.z-h.z)*u,a=(t.max.z-h.z)*u):(s=(t.max.z-h.z)*u,a=(t.min.z-h.z)*u),n>a||s>r?null:((s>n||n!=n)&&(n=s),(a=0?n:r,e)))}intersectsBox(t){return null!==this.intersectBox(t,z)}intersectTriangle(t,e,n,r,i){W.subVectors(e,t),V.subVectors(n,t),q.crossVectors(W,V);let o,s=this.direction.dot(q);if(s>0){if(r)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}G.subVectors(this.origin,t);const a=o*this.direction.dot(V.crossVectors(G,V));if(a<0)return null;const l=o*this.direction.dot(W.cross(G));if(l<0)return null;if(a+l>s)return null;const c=-o*G.dot(q);return c<0?null:this.at(c/s,i)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}class Y{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,r,i,o,s,a,l,c,u,h,f,d,p,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=f,g[7]=d,g[11]=p,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Y).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/Z.setFromMatrixColumn(t,0).length(),i=1/Z.setFromMatrixColumn(t,1).length(),o=1/Z.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,n=t.x,r=t.y,i=t.z,o=Math.cos(n),s=Math.sin(n),a=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===t.order){const t=o*c,n=o*u,r=s*c,i=s*u;e[0]=a*c,e[4]=-a*u,e[8]=l,e[1]=n+r*l,e[5]=t-i*l,e[9]=-s*a,e[2]=i-t*l,e[6]=r+n*l,e[10]=o*a}else if("YXZ"===t.order){const t=a*c,n=a*u,r=l*c,i=l*u;e[0]=t+i*s,e[4]=r*s-n,e[8]=o*l,e[1]=o*u,e[5]=o*c,e[9]=-s,e[2]=n*s-r,e[6]=i+t*s,e[10]=o*a}else if("ZXY"===t.order){const t=a*c,n=a*u,r=l*c,i=l*u;e[0]=t-i*s,e[4]=-o*u,e[8]=r+n*s,e[1]=n+r*s,e[5]=o*c,e[9]=i-t*s,e[2]=-o*l,e[6]=s,e[10]=o*a}else if("ZYX"===t.order){const t=o*c,n=o*u,r=s*c,i=s*u;e[0]=a*c,e[4]=r*l-n,e[8]=t*l+i,e[1]=a*u,e[5]=i*l+t,e[9]=n*l-r,e[2]=-l,e[6]=s*a,e[10]=o*a}else if("YZX"===t.order){const t=o*a,n=o*l,r=s*a,i=s*l;e[0]=a*c,e[4]=i-t*u,e[8]=r*u+n,e[1]=u,e[5]=o*c,e[9]=-s*c,e[2]=-l*c,e[6]=n*u+r,e[10]=t-i*u}else if("XZY"===t.order){const t=o*a,n=o*l,r=s*a,i=s*l;e[0]=a*c,e[4]=-u,e[8]=l*c,e[1]=t*u+i,e[5]=o*c,e[9]=n*u-r,e[2]=r*u-n,e[6]=s*c,e[10]=i*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(K,t,Q)}lookAt(t,e,n){const r=this.elements;return et.subVectors(t,e),0===et.lengthSq()&&(et.z=1),et.normalize(),$.crossVectors(n,et),0===$.lengthSq()&&(1===Math.abs(n.z)?et.x+=1e-4:et.z+=1e-4,et.normalize(),$.crossVectors(n,et)),$.normalize(),tt.crossVectors(et,$),r[0]=$.x,r[4]=tt.x,r[8]=et.x,r[1]=$.y,r[5]=tt.y,r[9]=et.y,r[2]=$.z,r[6]=tt.z,r[10]=et.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,o=n[0],s=n[4],a=n[8],l=n[12],c=n[1],u=n[5],h=n[9],f=n[13],d=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],b=n[11],_=n[15],x=r[0],w=r[4],M=r[8],S=r[12],E=r[1],T=r[5],C=r[9],A=r[13],P=r[2],L=r[6],R=r[10],O=r[14],k=r[3],I=r[7],D=r[11],N=r[15];return i[0]=o*x+s*E+a*P+l*k,i[4]=o*w+s*T+a*L+l*I,i[8]=o*M+s*C+a*R+l*D,i[12]=o*S+s*A+a*O+l*N,i[1]=c*x+u*E+h*P+f*k,i[5]=c*w+u*T+h*L+f*I,i[9]=c*M+u*C+h*R+f*D,i[13]=c*S+u*A+h*O+f*N,i[2]=d*x+p*E+m*P+g*k,i[6]=d*w+p*T+m*L+g*I,i[10]=d*M+p*C+m*R+g*D,i[14]=d*S+p*A+m*O+g*N,i[3]=v*x+y*E+b*P+_*k,i[7]=v*w+y*T+b*L+_*I,i[11]=v*M+y*C+b*R+_*D,i[15]=v*S+y*A+b*O+_*N,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],o=t[1],s=t[5],a=t[9],l=t[13],c=t[2],u=t[6],h=t[10],f=t[14];return t[3]*(+i*a*u-r*l*u-i*s*h+n*l*h+r*s*f-n*a*f)+t[7]*(+e*a*f-e*l*h+i*o*h-r*o*f+r*l*c-i*a*c)+t[11]*(+e*l*u-e*s*f-i*o*u+n*o*f+i*s*c-n*l*c)+t[15]*(-r*s*c-e*a*u+e*s*h+r*o*u-n*o*h+n*a*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15],v=u*m*l-p*h*l+p*a*f-s*m*f-u*a*g+s*h*g,y=d*h*l-c*m*l-d*a*f+o*m*f+c*a*g-o*h*g,b=c*p*l-d*u*l+d*s*f-o*p*f-c*s*g+o*u*g,_=d*u*a-c*p*a-d*s*h+o*p*h+c*s*m-o*u*m,x=e*v+n*y+r*b+i*_;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/x;return t[0]=v*w,t[1]=(p*h*i-u*m*i-p*r*f+n*m*f+u*r*g-n*h*g)*w,t[2]=(s*m*i-p*a*i+p*r*l-n*m*l-s*r*g+n*a*g)*w,t[3]=(u*a*i-s*h*i-u*r*l+n*h*l+s*r*f-n*a*f)*w,t[4]=y*w,t[5]=(c*m*i-d*h*i+d*r*f-e*m*f-c*r*g+e*h*g)*w,t[6]=(d*a*i-o*m*i-d*r*l+e*m*l+o*r*g-e*a*g)*w,t[7]=(o*h*i-c*a*i+c*r*l-e*h*l-o*r*f+e*a*f)*w,t[8]=b*w,t[9]=(d*u*i-c*p*i-d*n*f+e*p*f+c*n*g-e*u*g)*w,t[10]=(o*p*i-d*s*i+d*n*l-e*p*l-o*n*g+e*s*g)*w,t[11]=(c*s*i-o*u*i-c*n*l+e*u*l+o*n*f-e*s*f)*w,t[12]=_*w,t[13]=(c*p*r-d*u*r+d*n*h-e*p*h-c*n*m+e*u*m)*w,t[14]=(d*s*r-o*p*r-d*n*a+e*p*a+o*n*m-e*s*m)*w,t[15]=(o*u*r-c*s*r+c*n*a-e*u*a-o*n*h+e*s*h)*w,this}scale(t){const e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),i=1-n,o=t.x,s=t.y,a=t.z,l=i*o,c=i*s;return this.set(l*o+n,l*s-r*a,l*a+r*s,0,l*s+r*a,c*s+n,c*a-r*o,0,l*a-r*s,c*a+r*o,i*a*a+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,i=e._x,o=e._y,s=e._z,a=e._w,l=i+i,c=o+o,u=s+s,h=i*l,f=i*c,d=i*u,p=o*c,m=o*u,g=s*u,v=a*l,y=a*c,b=a*u,_=n.x,x=n.y,w=n.z;return r[0]=(1-(p+g))*_,r[1]=(f+b)*_,r[2]=(d-y)*_,r[3]=0,r[4]=(f-b)*x,r[5]=(1-(h+g))*x,r[6]=(m+v)*x,r[7]=0,r[8]=(d+y)*w,r[9]=(m-v)*w,r[10]=(1-(h+p))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let i=Z.set(r[0],r[1],r[2]).length();const o=Z.set(r[4],r[5],r[6]).length(),s=Z.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],J.copy(this);const a=1/i,l=1/o,c=1/s;return J.elements[0]*=a,J.elements[1]*=a,J.elements[2]*=a,J.elements[4]*=l,J.elements[5]*=l,J.elements[6]*=l,J.elements[8]*=c,J.elements[9]*=c,J.elements[10]*=c,e.setFromRotationMatrix(J),n.x=i,n.y=o,n.z=s,this}makePerspective(t,e,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const s=this.elements,a=2*i/(e-t),l=2*i/(n-r),c=(e+t)/(e-t),u=(n+r)/(n-r),h=-(o+i)/(o-i),f=-2*o*i/(o-i);return s[0]=a,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=u,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=f,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(t,e,n,r,i,o){const s=this.elements,a=1/(e-t),l=1/(n-r),c=1/(o-i),u=(e+t)*a,h=(n+r)*l,f=(o+i)*c;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-u,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-f,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const Z=new _,J=new Y,K=new _(0,0,0),Q=new _(1,1,1),$=new _,tt=new _,et=new _;class nt{constructor(t=0,e=0,n=0,r=nt.DefaultOrder){Object.defineProperty(this,"isEuler",{value:!0}),this._x=t,this._y=e,this._z=n,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e,n){const r=c.clamp,i=t.elements,o=i[0],s=i[4],a=i[8],l=i[1],u=i[5],h=i[9],f=i[2],d=i[6],p=i[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(d,u),this._z=0);break;case"YXZ":this._x=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,p),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-r(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,u),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return rt.makeRotationFromQuaternion(t),this.setFromRotationMatrix(rt,e,n)}setFromVector3(t,e){return this.set(t.x,t.y,t.z,e||this._order)}reorder(t){return it.setFromEuler(this),this.setFromQuaternion(it,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new _(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}nt.DefaultOrder="XYZ",nt.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const rt=new Y,it=new b;class ot{constructor(){this.mask=1}set(t){this.mask=1<1){for(let t=0;t1){for(let t=0;t0){r.children=[];for(let e=0;e0){r.animations=[];for(let e=0;e0&&(n.geometries=e),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),s.length>0&&(n.images=s),a.length>0&&(n.shapes=a),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c)}return n.object=r,n;function o(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e1?void 0:e.copy(n).multiplyScalar(i).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new _),t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||wt.getNormalMatrix(t),r=this.coplanarPoint(_t).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}const St=new _,Et=new _,Tt=new _,Ct=new _,At=new _,Pt=new _,Lt=new _,Rt=new _,Ot=new _,kt=new _;class It{constructor(t,e,n){this.a=void 0!==t?t:new _,this.b=void 0!==e?e:new _,this.c=void 0!==n?n:new _}static getNormal(t,e,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new _),r.subVectors(n,e),St.subVectors(t,e),r.cross(St);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(t,e,n,r,i){St.subVectors(r,e),Et.subVectors(n,e),Tt.subVectors(t,e);const o=St.dot(St),s=St.dot(Et),a=St.dot(Tt),l=Et.dot(Et),c=Et.dot(Tt),u=o*l-s*s;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new _),0===u)return i.set(-2,-1,-1);const h=1/u,f=(l*a-s*c)*h,d=(o*c-s*a)*h;return i.set(1-f-d,d,f)}static containsPoint(t,e,n,r){return this.getBarycoord(t,e,n,r,Ct),Ct.x>=0&&Ct.y>=0&&Ct.x+Ct.y<=1}static getUV(t,e,n,r,i,o,s,a){return this.getBarycoord(t,e,n,r,Ct),a.set(0,0),a.addScaledVector(i,Ct.x),a.addScaledVector(o,Ct.y),a.addScaledVector(s,Ct.z),a}static isFrontFacing(t,e,n,r){return St.subVectors(n,e),Et.subVectors(t,e),St.cross(Et).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return St.subVectors(this.c,this.b),Et.subVectors(this.a,this.b),.5*St.cross(Et).length()}getMidpoint(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new _),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return It.getNormal(this.a,this.b,this.c,t)}getPlane(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Mt),t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return It.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,r,i){return It.getUV(t,this.a,this.b,this.c,e,n,r,i)}containsPoint(t){return It.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return It.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new _);const n=this.a,r=this.b,i=this.c;let o,s;At.subVectors(r,n),Pt.subVectors(i,n),Rt.subVectors(t,n);const a=At.dot(Rt),l=Pt.dot(Rt);if(a<=0&&l<=0)return e.copy(n);Ot.subVectors(t,r);const c=At.dot(Ot),u=Pt.dot(Ot);if(c>=0&&u<=c)return e.copy(r);const h=a*u-c*l;if(h<=0&&a>=0&&c<=0)return o=a/(a-c),e.copy(n).addScaledVector(At,o);kt.subVectors(t,i);const f=At.dot(kt),d=Pt.dot(kt);if(d>=0&&f<=d)return e.copy(i);const p=f*l-a*d;if(p<=0&&l>=0&&d<=0)return s=l/(l-d),e.copy(n).addScaledVector(Pt,s);const m=c*d-f*u;if(m<=0&&u-c>=0&&f-d>=0)return Lt.subVectors(i,r),s=(u-c)/(u-c+(f-d)),e.copy(r).addScaledVector(Lt,s);const g=1/(m+p+h);return o=p*g,s=h*g,e.copy(n).addScaledVector(At,o).addScaledVector(Pt,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Dt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Nt={h:0,s:0,l:0},jt={h:0,s:0,l:0};function Ft(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function Bt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function zt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class Ut{constructor(t,e,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,n){return this.r=t,this.g=e,this.b=n,this}setHSL(t,e,n){if(t=c.euclideanModulo(t,1),e=c.clamp(e,0,1),n=c.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=Ft(i,r,t+1/3),this.g=Ft(i,r,t),this.b=Ft(i,r,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const r=n[1],i=n[2];switch(r){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){const n=parseFloat(t[1])/360,r=parseInt(t[2],10)/100,i=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(n,r,i)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=Dt[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=Bt(t.r),this.g=Bt(t.g),this.b=Bt(t.b),this}copyLinearToSRGB(t){return this.r=zt(t.r),this.g=zt(t.g),this.b=zt(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});const e=this.r,n=this.g,r=this.b,i=Math.max(e,n,r),o=Math.min(e,n,r);let s,a;const l=(o+i)/2;if(o===i)s=0,a=0;else{const t=i-o;switch(a=l<=.5?t/(i+o):t/(2-i-o),i){case e:s=(n-r)/t+(n0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){const e=r(t.textures),i=r(t.images);e.length>0&&(n.textures=e),i.length>0&&(n.images=i)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let r=0;r!==t;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Wt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Vt.prototype=Object.create(Wt.prototype),Vt.prototype.constructor=Vt,Vt.prototype.isMeshBasicMaterial=!0,Vt.prototype.copy=function(t){return Wt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};const qt=new _,Xt=new u;function Yt(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function Zt(t,e,n){Yt.call(this,new Int8Array(t),e,n)}function Jt(t,e,n){Yt.call(this,new Uint8Array(t),e,n)}function Kt(t,e,n){Yt.call(this,new Uint8ClampedArray(t),e,n)}function Qt(t,e,n){Yt.call(this,new Int16Array(t),e,n)}function $t(t,e,n){Yt.call(this,new Uint16Array(t),e,n)}function te(t,e,n){Yt.call(this,new Int32Array(t),e,n)}function ee(t,e,n){Yt.call(this,new Uint32Array(t),e,n)}function ne(t,e,n){Yt.call(this,new Uint16Array(t),e,n)}function re(t,e,n){Yt.call(this,new Float32Array(t),e,n)}function ie(t,e,n){Yt.call(this,new Float64Array(t),e,n)}function oe(t){if(0===t.length)return-1/0;let e=t[0];for(let n=1,r=t.length;ne&&(e=t[n]);return e}Object.defineProperty(Yt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Yt.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,i=this.itemSize;r65535?ee:$t)(t,1):this.index=t,this},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},hasAttribute:function(t){return void 0!==this.attributes[t]},addGroup:function(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new h).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return ce.makeRotationX(t),this.applyMatrix4(ce),this},rotateY:function(t){return ce.makeRotationY(t),this.applyMatrix4(ce),this},rotateZ:function(t){return ce.makeRotationZ(t),this.applyMatrix4(ce),this},translate:function(t,e,n){return ce.makeTranslation(t,e,n),this.applyMatrix4(ce),this},scale:function(t,e,n){return ce.makeScale(t,e,n),this.applyMatrix4(ce),this},lookAt:function(t){return ue.lookAt(t),ue.updateMatrix(),this.applyMatrix4(ue.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(he).negate(),this.translate(he.x,he.y,he.z),this},setFromPoints:function(t){const e=[];for(let n=0,r=t.length;n0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const r=n[e],i=r.toJSON(t.data);""!==r.name&&(i.name=r.name),t.data.attributes[e]=i}const r={};let i=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],o=[];for(let e=0,r=n.length;e0&&(r[e]=o,i=!0)}i&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t},clone:function(){return(new me).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const r=t.attributes;for(const t in r){const n=r[t];this.setAttribute(t,n.clone(e))}const i=t.morphAttributes;for(const t in i){const n=[],r=i[t];for(let t=0,i=r.length;tn.far?null:{distance:c,point:Oe.clone(),object:t}}(t,e,n,r,be,_e,xe,Re);if(p){a&&(Ae.fromBufferAttribute(a,c),Pe.fromBufferAttribute(a,h),Le.fromBufferAttribute(a,f),p.uv=It.getUV(Re,be,_e,xe,Ae,Pe,Le,new u)),l&&(Ae.fromBufferAttribute(l,c),Pe.fromBufferAttribute(l,h),Le.fromBufferAttribute(l,f),p.uv2=It.getUV(Re,be,_e,xe,Ae,Pe,Le,new u));const t=new Ht(c,h,f);It.getNormal(be,_e,xe,t.normal),p.face=t}return p}ke.prototype=Object.assign(Object.create(bt.prototype),{constructor:ke,isMesh:!0,copy:function(t){return bt.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),ye.copy(n.boundingSphere),ye.applyMatrix4(i),!1===t.ray.intersectsSphere(ye))return;if(ge.copy(i).invert(),ve.copy(t.ray).applyMatrix4(ge),null!==n.boundingBox&&!1===ve.intersectsBox(n.boundingBox))return;let o;if(n.isBufferGeometry){const i=n.index,s=n.attributes.position,a=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,u=n.attributes.uv2,h=n.groups,f=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,d=h.length;n0?1:-1,c.push(A.x,A.y,A.z),u.push(a/m),u.push(1-o/g),T+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e},ze.prototype=Object.assign(Object.create(bt.prototype),{constructor:ze,isCamera:!0,copy:function(t,e){return bt.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new _),this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){bt.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(t,e){bt.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),Ue.prototype=Object.assign(Object.create(ze.prototype),{constructor:Ue,isPerspectiveCamera:!0,copy:function(t,e){return ze.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){const e=.5*this.getFilmHeight()/t;this.fov=2*c.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){const t=Math.tan(.5*c.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*c.RAD2DEG*Math.atan(Math.tan(.5*c.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,r,i,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const t=this.near;let e=t*Math.tan(.5*c.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r;const o=this.view;if(null!==this.view&&this.view.enabled){const t=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/t,e-=o.offsetY*n/s,r*=o.width/t,n*=o.height/s}const s=this.filmOffset;0!==s&&(i+=t*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(t){const e=bt.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});function He(t,e,n){if(bt.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new Ue(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new _(1,0,0)),this.add(r);const i=new Ue(90,1,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new _(-1,0,0)),this.add(i);const o=new Ue(90,1,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new _(0,1,0)),this.add(o);const s=new Ue(90,1,t,e);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new _(0,-1,0)),this.add(s);const a=new Ue(90,1,t,e);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new _(0,0,1)),this.add(a);const l=new Ue(90,1,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new _(0,0,-1)),this.add(l),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();const c=t.xr.enabled,u=t.getRenderTarget();t.xr.enabled=!1;const h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,r),t.setRenderTarget(n,1),t.render(e,i),t.setRenderTarget(n,2),t.render(e,o),t.setRenderTarget(n,3),t.render(e,s),t.setRenderTarget(n,4),t.render(e,a),n.texture.generateMipmaps=h,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(u),t.xr.enabled=c}}function Ge(t,e,n,r,i,o,s,a,l,c){t=void 0!==t?t:[],e=void 0!==e?e:301,s=void 0!==s?s:1022,m.call(this,t,e,n,r,i,o,s,a,l,c),this.flipY=!1,this._needsFlipEnvMap=!0}He.prototype=Object.create(bt.prototype),He.prototype.constructor=He,Ge.prototype=Object.create(m.prototype),Ge.prototype.constructor=Ge,Ge.prototype.isCubeTexture=!0,Object.defineProperty(Ge.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});class We extends y{constructor(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),super(t,t,e),Object.defineProperty(this,"isWebGLCubeRenderTarget",{value:!0}),e=e||{},this.texture=new Ge(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=1023,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new De(5,5,5),i=new Be({name:"CubemapFromEquirect",uniforms:Ne(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=e;const o=new ke(r,i),s=e.minFilter;1008===e.minFilter&&(e.minFilter=1006);return new He(1,10,this).update(t,o),e.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,r){const i=t.getRenderTarget();for(let i=0;i<6;i++)t.setRenderTarget(this,i),t.clear(e,n,r);t.setRenderTarget(i)}}function Ve(t,e,n,r,i,o,s,a,l,c,u,h){m.call(this,null,o,s,a,l,c,r,i,u,h),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==l?l:1003,this.minFilter=void 0!==c?c:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Ve.prototype=Object.create(m.prototype),Ve.prototype.constructor=Ve,Ve.prototype.isDataTexture=!0;const qe=new B,Xe=new _;class Ye{constructor(t,e,n,r,i,o){this.planes=[void 0!==t?t:new Mt,void 0!==e?e:new Mt,void 0!==n?n:new Mt,void 0!==r?r:new Mt,void 0!==i?i:new Mt,void 0!==o?o:new Mt]}set(t,e,n,r,i,o){const s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(n),s[3].copy(r),s[4].copy(i),s[5].copy(o),this}clone(){return(new this.constructor).copy(this)}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t){const e=this.planes,n=t.elements,r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6],u=n[7],h=n[8],f=n[9],d=n[10],p=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(s-r,u-a,p-h,y-m).normalize(),e[1].setComponents(s+r,u+a,p+h,y+m).normalize(),e[2].setComponents(s+i,u+l,p+f,y+g).normalize(),e[3].setComponents(s-i,u-l,p-f,y-g).normalize(),e[4].setComponents(s-o,u-c,p-d,y-v).normalize(),e[5].setComponents(s+o,u+c,p+d,y+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),qe.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(qe)}intersectsSprite(t){return qe.center.set(0,0,0),qe.radius=.7071067811865476,qe.applyMatrix4(t.matrixWorld),this.intersectsSphere(qe)}intersectsSphere(t){const e=this.planes,n=t.center,r=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)0?t.max.x:t.min.x,Xe.y=r.normal.y>0?t.max.y:t.min.y,Xe.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Xe)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}}function Ze(){let t=null,e=!1,n=null,r=null;function i(e,o){n(e,o),r=t.requestAnimationFrame(i)}return{start:function(){!0!==e&&null!==n&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Je(t,e){const n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){if(e.isGLBufferAttribute){const t=r.get(e);return void((!t||t.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},$e={common:{diffuse:{value:new Ut(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new h},uv2Transform:{value:new h},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new u(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ut(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ut(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new h}},sprite:{diffuse:{value:new Ut(15658734)},opacity:{value:1},center:{value:new u(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new h}}},tn={basic:{uniforms:je([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.fog]),vertexShader:Qe.meshbasic_vert,fragmentShader:Qe.meshbasic_frag},lambert:{uniforms:je([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.fog,$e.lights,{emissive:{value:new Ut(0)}}]),vertexShader:Qe.meshlambert_vert,fragmentShader:Qe.meshlambert_frag},phong:{uniforms:je([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new Ut(0)},specular:{value:new Ut(1118481)},shininess:{value:30}}]),vertexShader:Qe.meshphong_vert,fragmentShader:Qe.meshphong_frag},standard:{uniforms:je([$e.common,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.roughnessmap,$e.metalnessmap,$e.fog,$e.lights,{emissive:{value:new Ut(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Qe.meshphysical_vert,fragmentShader:Qe.meshphysical_frag},toon:{uniforms:je([$e.common,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.gradientmap,$e.fog,$e.lights,{emissive:{value:new Ut(0)}}]),vertexShader:Qe.meshtoon_vert,fragmentShader:Qe.meshtoon_frag},matcap:{uniforms:je([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,{matcap:{value:null}}]),vertexShader:Qe.meshmatcap_vert,fragmentShader:Qe.meshmatcap_frag},points:{uniforms:je([$e.points,$e.fog]),vertexShader:Qe.points_vert,fragmentShader:Qe.points_frag},dashed:{uniforms:je([$e.common,$e.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qe.linedashed_vert,fragmentShader:Qe.linedashed_frag},depth:{uniforms:je([$e.common,$e.displacementmap]),vertexShader:Qe.depth_vert,fragmentShader:Qe.depth_frag},normal:{uniforms:je([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,{opacity:{value:1}}]),vertexShader:Qe.normal_vert,fragmentShader:Qe.normal_frag},sprite:{uniforms:je([$e.sprite,$e.fog]),vertexShader:Qe.sprite_vert,fragmentShader:Qe.sprite_frag},background:{uniforms:{uvTransform:{value:new h},t2D:{value:null}},vertexShader:Qe.background_vert,fragmentShader:Qe.background_frag},cube:{uniforms:je([$e.envmap,{opacity:{value:1}}]),vertexShader:Qe.cube_vert,fragmentShader:Qe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qe.equirect_vert,fragmentShader:Qe.equirect_frag},distanceRGBA:{uniforms:je([$e.common,$e.displacementmap,{referencePosition:{value:new _},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qe.distanceRGBA_vert,fragmentShader:Qe.distanceRGBA_frag},shadow:{uniforms:je([$e.lights,$e.fog,{color:{value:new Ut(0)},opacity:{value:1}}]),vertexShader:Qe.shadow_vert,fragmentShader:Qe.shadow_frag}};function en(t,e,n,r,i){const o=new Ut(0);let s,a,l=0,c=null,u=0,h=null;function f(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,i)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),l=e,f(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(t){l=t,f(o,l)},render:function(n,i,d,p){let m=!0===i.isScene?i.background:null;m&&m.isTexture&&(m=e.get(m));const g=t.xr,v=g.getSession&&g.getSession();v&&"additive"===v.environmentBlendMode&&(m=null),null===m?f(o,l):m&&m.isColor&&(f(m,1),p=!0),(t.autoClear||p)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||306===m.mapping)?(void 0===a&&(a=new ke(new De(1,1,1),new Be({name:"BackgroundCubeMaterial",uniforms:Ne(tn.cube.uniforms),vertexShader:tn.cube.vertexShader,fragmentShader:tn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(a)),m.isWebGLCubeRenderTarget&&(m=m.texture),a.material.uniforms.envMap.value=m,a.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m._needsFlipEnvMap?-1:1,c===m&&u===m.version&&h===t.toneMapping||(a.material.needsUpdate=!0,c=m,u=m.version,h=t.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null)):m&&m.isTexture&&(void 0===s&&(s=new ke(new Ke(2,2),new Be({name:"BackgroundMaterial",uniforms:Ne(tn.background.uniforms),vertexShader:tn.background.vertexShader,fragmentShader:tn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(s)),s.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),s.material.uniforms.uvTransform.value.copy(m.matrix),c===m&&u===m.version&&h===t.toneMapping||(s.material.needsUpdate=!0,c=m,u=m.version,h=t.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null))}}}function nn(t,e,n,r){const i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),s=r.isWebGL2||null!==o,a={},l=f(null);let c=l;function u(e){return r.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function h(e){return r.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function f(t){const e=[],n=[],r=[];for(let t=0;t=0){const o=l[e];if(void 0!==o){const e=o.normalized,i=o.itemSize,s=n.get(o);if(void 0===s)continue;const l=s.buffer,c=s.type,u=s.bytesPerElement;if(o.isInterleavedBufferAttribute){const n=o.data,s=n.stride,h=o.offset;n&&n.isInstancedInterleavedBuffer?(m(r,n.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=n.meshPerAttribute*n.count)):p(r),t.bindBuffer(34962,l),v(r,i,c,e,s*u,h*u)}else o.isInstancedBufferAttribute?(m(r,o.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)):p(r),t.bindBuffer(34962,l),v(r,i,c,e,0,0)}else if("instanceMatrix"===e){const e=n.get(i.instanceMatrix);if(void 0===e)continue;const o=e.buffer,s=e.type;m(r+0,1),m(r+1,1),m(r+2,1),m(r+3,1),t.bindBuffer(34962,o),t.vertexAttribPointer(r+0,4,s,!1,64,0),t.vertexAttribPointer(r+1,4,s,!1,64,16),t.vertexAttribPointer(r+2,4,s,!1,64,32),t.vertexAttribPointer(r+3,4,s,!1,64,48)}else if("instanceColor"===e){const e=n.get(i.instanceColor);if(void 0===e)continue;const o=e.buffer,s=e.type;m(r,1),t.bindBuffer(34962,o),t.vertexAttribPointer(r,3,s,!1,12,0)}else if(void 0!==u){const n=u[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(r,n);break;case 3:t.vertexAttrib3fv(r,n);break;case 4:t.vertexAttrib4fv(r,n);break;default:t.vertexAttrib1fv(r,n)}}}}g()}(i,l,h,y),null!==b&&t.bindBuffer(34963,n.get(b).buffer))},reset:y,resetDefaultState:b,dispose:function(){y();for(const t in a){const e=a[t];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete a[t]}},releaseStatesOfGeometry:function(t){if(void 0===a[t.id])return;const e=a[t.id];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete a[t.id]},releaseStatesOfProgram:function(t){for(const e in a){const n=a[e];if(void 0===n[t.id])continue;const r=n[t.id];for(const t in r)h(r[t].object),delete r[t];delete n[t.id]}},initAttributes:d,enableAttribute:p,disableUnusedAttributes:g}}function rn(t,e,n,r){const i=r.isWebGL2;let o;this.setMode=function(t){o=t},this.render=function(e,r){t.drawArrays(o,e,r),n.update(r,o,1)},this.renderInstances=function(r,s,a){if(0===a)return;let l,c;if(i)l=t,c="drawArraysInstanced";else if(l=e.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](o,r,s,a),n.update(s,o,a)}}function on(t,e,n){let r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let s=void 0!==n.precision?n.precision:"highp";const a=i(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);const l=!0===n.logarithmicDepthBuffer,c=t.getParameter(34930),u=t.getParameter(35660),h=t.getParameter(3379),f=t.getParameter(34076),d=t.getParameter(34921),p=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=u>0,y=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;const n=e.get("EXT_texture_filter_anisotropic");return r=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,r},getMaxPrecision:i,precision:s,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:f,maxAttributes:d,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:o?t.getParameter(36183):0}}function sn(t){const e=this;let n=null,r=0,i=!1,o=!1;const s=new Mt,a=new h,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(t,n,r,i){const o=null!==t?t.length:0;let c=null;if(0!==o){if(c=l.value,!0!==i||null===c){const e=r+4*o,i=n.matrixWorldInverse;a.getNormalMatrix(i),(null===c||c.length0){const s=t.getRenderList(),a=t.getRenderTarget(),l=new We(o.height/2);return l.fromEquirectangularTexture(t,i),e.set(i,l),t.setRenderTarget(a),t.setRenderList(s),i.addEventListener("dispose",r),n(l.texture,i.mapping)}return null}}}return i},dispose:function(){e=new WeakMap}}}function ln(t){const e={};function n(n){if(void 0!==e[n])return e[n];let r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return e[n]=r,r}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function cn(t,e,n,r){const i={},o=new WeakMap;function s(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);a.removeEventListener("dispose",s),delete i[a.id];const l=o.get(a);l&&(e.remove(l),o.delete(a)),r.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,n.memory.geometries--}function a(t){const n=[],r=t.index,i=t.attributes.position;let s=0;if(null!==r){const t=r.array;s=r.version;for(let e=0,r=t.length;e65535?ee:$t)(n,1);a.version=s;const l=o.get(t);l&&e.remove(l),o.set(t,a)}return{get:function(t,e){return!0===i[e.id]||(e.addEventListener("dispose",s),i[e.id]=!0,n.memory.geometries++),e},update:function(t){const n=t.attributes;for(const t in n)e.update(n[t],34962);const r=t.morphAttributes;for(const t in r){const n=r[t];for(let t=0,r=n.length;t0)return t;const i=e*n;let o=wn[i];if(void 0===o&&(o=new Float32Array(i),wn[i]=o),0!==e){r.toArray(o,0);for(let r=1,i=0;r!==e;++r)i+=n,t[r].toArray(o,i)}return o}function An(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n/gm;function Sr(t){return t.replace(Mr,Er)}function Er(t,e){const n=Qe[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Sr(n)}const Tr=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Cr=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Ar(t){return t.replace(Cr,Lr).replace(Tr,Pr)}function Pr(t,e,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Lr(t,e,n,r)}function Lr(t,e,n,r){let i="";for(let t=parseInt(e);t0?t.gammaFactor:1,d=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(_r).join("\n")}(n),p=function(t){const e=[];for(const n in t){const r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(o),m=i.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[p].filter(_r).join("\n"),g.length>0&&(g+="\n"),v=[d,p].filter(_r).join("\n"),v.length>0&&(v+="\n")):(g=[Rr(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+f,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(_r).join("\n"),v=[d,Rr(n),"#define SHADER_NAME "+n.shaderName,p,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+f,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Qe.tonemapping_pars_fragment:"",0!==n.toneMapping?br("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Qe.encodings_pars_fragment,n.map?vr("mapTexelToLinear",n.mapEncoding):"",n.matcap?vr("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?vr("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?vr("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?vr("lightMapTexelToLinear",n.lightMapEncoding):"",yr("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(_r).join("\n")),s=Sr(s),s=xr(s,n),s=wr(s,n),a=Sr(a),a=xr(a,n),a=wr(a,n),s=Ar(s),a=Ar(a),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in","300 es"===n.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===n.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+v);const b=y+v+a,_=dr(i,35633,y+g+s),x=dr(i,35632,b);if(i.attachShader(m,_),i.attachShader(m,x),void 0!==n.index0AttributeName?i.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),t.debug.checkShaderErrors){const t=i.getProgramInfoLog(m).trim(),e=i.getShaderInfoLog(_).trim(),n=i.getShaderInfoLog(x).trim();let r=!0,o=!0;if(!1===i.getProgramParameter(m,35714)){r=!1;const e=gr(i,_,"vertex"),n=gr(i,x,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",t,e,n)}else""!==t?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",t):""!==e&&""!==n||(o=!1);o&&(this.diagnostics={runnable:r,programLog:t,vertexShader:{log:e,prefix:g},fragmentShader:{log:n,prefix:v}})}let w,M;return i.deleteShader(_),i.deleteShader(x),this.getUniforms=function(){return void 0===w&&(w=new fr(i,m)),w},this.getAttributes=function(){return void 0===M&&(M=function(t,e){const n={},r=t.getProgramParameter(e,35721);for(let i=0;i0,maxBones:w,useVertexTexture:c,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:t.shadowMap.enabled&&p.length>0,shadowMapType:t.shadowMap.type,toneMapping:i.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:a||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:a||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:a||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);if(!1===e.isRawShaderMaterial){for(let t=0;t1&&r.sort(t||Dr),i.length>1&&i.sort(e||Nr)}}}function Fr(t){let e=new WeakMap;return{get:function(n,r){const i=e.get(n);let o;return void 0===i?(o=new jr(t),e.set(n,new WeakMap),e.get(n).set(r,o)):(o=i.get(r),void 0===o&&(o=new jr(t),i.set(r,o))),o},dispose:function(){e=new WeakMap}}}function Br(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new _,color:new Ut};break;case"SpotLight":n={position:new _,direction:new _,color:new Ut,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new _,color:new Ut,distance:0,decay:0};break;case"HemisphereLight":n={direction:new _,skyColor:new Ut,groundColor:new Ut};break;case"RectAreaLight":n={color:new Ut,position:new _,halfWidth:new _,halfHeight:new _}}return t[e.id]=n,n}}}let zr=0;function Ur(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Hr(t,e){const n=new Br,r=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new u};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new u,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)i.probe.push(new _);const o=new _,s=new Y,a=new Y;return{setup:function(o){let s=0,a=0,l=0;for(let t=0;t<9;t++)i.probe[t].set(0,0,0);let c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0;o.sort(Ur);for(let t=0,e=o.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=$e.LTC_FLOAT_1,i.rectAreaLTC2=$e.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=$e.LTC_HALF_1,i.rectAreaLTC2=$e.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=s,i.ambient[1]=a,i.ambient[2]=l;const v=i.hash;v.directionalLength===c&&v.pointLength===u&&v.spotLength===h&&v.rectAreaLength===f&&v.hemiLength===d&&v.numDirectionalShadows===p&&v.numPointShadows===m&&v.numSpotShadows===g||(i.directional.length=c,i.spot.length=h,i.rectArea.length=f,i.point.length=u,i.hemi.length=d,i.directionalShadow.length=p,i.directionalShadowMap.length=p,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=p,i.pointShadowMatrix.length=m,i.spotShadowMatrix.length=g,v.directionalLength=c,v.pointLength=u,v.spotLength=h,v.rectAreaLength=f,v.hemiLength=d,v.numDirectionalShadows=p,v.numPointShadows=m,v.numSpotShadows=g,i.version=zr++)},setupView:function(t,e){let n=0,r=0,l=0,c=0,u=0;const h=e.matrixWorldInverse;for(let e=0,f=t.length;e=n.get(r).length?(o=new Gr(t,e),n.get(r).push(o)):o=n.get(r)[i],o},dispose:function(){n=new WeakMap}}}function Vr(t){Wt.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function qr(t){Wt.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new _,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}Vr.prototype=Object.create(Wt.prototype),Vr.prototype.constructor=Vr,Vr.prototype.isMeshDepthMaterial=!0,Vr.prototype.copy=function(t){return Wt.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},qr.prototype=Object.create(Wt.prototype),qr.prototype.constructor=qr,qr.prototype.isMeshDistanceMaterial=!0,qr.prototype.copy=function(t){return Wt.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};function Xr(t,e,n){let r=new Ye;const i=new u,o=new u,s=new v,a=[],l=[],c={},h={0:1,1:0,2:2},f=new Be({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new u},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=f.clone();d.defines.HORIZONTAL_PASS=1;const p=new me;p.setAttribute("position",new Yt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new ke(p,f),g=this;function b(n,r){const i=e.update(m);f.uniforms.shadow_pass.value=n.map.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,i,f,m,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,i,d,m,null)}function _(t,e,n){const r=t<<0|e<<1|n<<2;let i=a[r];return void 0===i&&(i=new Vr({depthPacking:3201,morphTargets:t,skinning:e}),a[r]=i),i}function x(t,e,n){const r=t<<0|e<<1|n<<2;let i=l[r];return void 0===i&&(i=new qr({morphTargets:t,skinning:e}),l[r]=i),i}function w(e,n,r,i,o,s,a){let l=null,u=_,f=e.customDepthMaterial;if(!0===i.isPointLight&&(u=x,f=e.customDistanceMaterial),void 0===f){let t=!1;!0===r.morphTargets&&(t=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let i=!1;!0===e.isSkinnedMesh&&(!0===r.skinning?i=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e));l=u(t,i,!0===e.isInstancedMesh)}else l=f;if(t.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){const t=l.uuid,e=r.uuid;let n=c[t];void 0===n&&(n={},c[t]=n);let i=n[e];void 0===i&&(i=l.clone(),n[e]=i),l=i}return l.visible=r.visible,l.wireframe=r.wireframe,l.side=3===a?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:h[r.side],l.clipShadows=r.clipShadows,l.clippingPlanes=r.clippingPlanes,l.clipIntersection=r.clipIntersection,l.wireframeLinewidth=r.wireframeLinewidth,l.linewidth=r.linewidth,!0===i.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(i.matrixWorld),l.nearDistance=o,l.farDistance=s),l}function M(n,i,o,s,a){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===a)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const r=e.update(n),i=n.material;if(Array.isArray(i)){const e=r.groups;for(let l=0,c=e.length;ln||i.y>n)&&(i.x>n&&(o.x=Math.floor(n/d.x),i.x=o.x*d.x,h.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/d.y),i.y=o.y*d.y,h.mapSize.y=o.y)),null===h.map&&!h.isPointLightShadow&&3===this.type){const t={minFilter:1006,magFilter:1006,format:1023};h.map=new y(i.x,i.y,t),h.map.texture.name=u.name+".shadowMap",h.mapPass=new y(i.x,i.y,t),h.camera.updateProjectionMatrix()}if(null===h.map){const t={minFilter:1003,magFilter:1003,format:1023};h.map=new y(i.x,i.y,t),h.map.texture.name=u.name+".shadowMap",h.camera.updateProjectionMatrix()}t.setRenderTarget(h.map),t.clear();const p=h.getViewportCount();for(let t=0;t=1):-1!==C.indexOf("OpenGL ES")&&(T=parseFloat(/^OpenGL ES (\d)/.exec(C)[1]),E=T>=2);let A=null,P={};const L=new v,R=new v;function O(e,n,r){const i=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;er||t.height>r)&&(i=r/Math.max(t.width,t.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const r=e?c.floorPowerOfTwo:Math.floor,o=r(i*t.width),s=r(i*t.height);void 0===p&&(p=g(o,s));const a=n?g(o,s):p;a.width=o,a.height=s;return a.getContext("2d").drawImage(t,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+s+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function y(t){return c.isPowerOfTwo(t.width)&&c.isPowerOfTwo(t.height)}function b(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function _(e,n,i,o){t.generateMipmap(e);r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function x(n,r,i){if(!1===a)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function w(t){return 1003===t||1004===t||1005===t?9728:9729}function M(e){const n=e.target;n.removeEventListener("dispose",M),function(e){const n=r.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),r.remove(e)}(n),n.isVideoTexture&&d.delete(n),s.memory.textures--}function S(e){const n=e.target;n.removeEventListener("dispose",S),function(e){const n=r.get(e),i=r.get(e.texture);if(!e)return;void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(n.__webglFramebuffer[e]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[e]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&t.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(e.texture),r.remove(e)}(n),s.memory.textures--}let E=0;function T(t,e){const i=r.get(t);if(t.isVideoTexture&&function(t){const e=s.render.frame;d.get(t)!==e&&(d.set(t,e),t.update())}(t),t.version>0&&i.__version!==t.version){const n=t.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void O(i,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,i.__webglTexture)}function C(e,i){const s=r.get(e);e.version>0&&s.__version!==e.version?function(e,r,i){if(6!==r.image.length)return;R(e,r),n.activeTexture(33984+i),n.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment);const s=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),l=r.image[0]&&r.image[0].isDataTexture,c=[];for(let t=0;t<6;t++)c[t]=s||l?l?r.image[t].image:r.image[t]:v(r.image[t],!1,!0,u);const h=c[0],f=y(h)||a,d=o.convert(r.format),p=o.convert(r.type),m=x(r.internalFormat,d,p);let g;if(L(34067,r,f),s){for(let t=0;t<6;t++){g=c[t].mipmaps;for(let e=0;e1||r.get(o).__currentAnisotropy)&&(t.texParameterf(n,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function R(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",M),e.__webglTexture=t.createTexture(),s.memory.textures++)}function O(e,r,i){let s=3553;r.isDataTexture2DArray&&(s=35866),r.isDataTexture3D&&(s=32879),R(e,r),n.activeTexture(33984+i),n.bindTexture(s,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment);const l=function(t){return!a&&(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)}(r)&&!1===y(r.image),c=v(r.image,l,!1,h),u=y(c)||a,f=o.convert(r.format);let d,p=o.convert(r.type),m=x(r.internalFormat,f,p);L(s,r,u);const g=r.mipmaps;if(r.isDepthTexture)m=6402,a?m=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===m&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,p=o.convert(r.type)),1027===r.format&&6402===m&&(m=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,p=o.convert(r.type))),n.texImage2D(3553,0,m,c.width,c.height,0,f,p,null);else if(r.isDataTexture)if(g.length>0&&u){for(let t=0,e=g.length;t0&&u){for(let t=0,e=g.length;t=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),E+=1,t},this.resetTextureUnits=function(){E=0},this.setTexture2D=T,this.setTexture2DArray=function(t,e){const i=r.get(t);t.version>0&&i.__version!==t.version?O(i,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(t,e){const i=r.get(t);t.version>0&&i.__version!==t.version?O(i,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=C,this.setupRenderTarget=function(e){const i=r.get(e),l=r.get(e.texture);e.addEventListener("dispose",S),l.__webglTexture=t.createTexture(),s.memory.textures++;const c=!0===e.isWebGLCubeRenderTarget,u=!0===e.isWebGLMultisampleRenderTarget,h=y(e)||a;if(!a||1022!==e.texture.format||1015!==e.texture.type&&1016!==e.texture.type||(e.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){i.__webglFramebuffer=[];for(let e=0;e<6;e++)i.__webglFramebuffer[e]=t.createFramebuffer()}else if(i.__webglFramebuffer=t.createFramebuffer(),u)if(a){i.__webglMultisampledFramebuffer=t.createFramebuffer(),i.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,i.__webglColorRenderbuffer);const n=o.convert(e.texture.format),r=o.convert(e.texture.type),s=x(e.texture.internalFormat,n,r),a=N(e);t.renderbufferStorageMultisample(36161,a,s,e.width,e.height),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(i.__webglDepthRenderbuffer=t.createRenderbuffer(),I(i.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){n.bindTexture(34067,l.__webglTexture),L(34067,e.texture,h);for(let t=0;t<6;t++)k(i.__webglFramebuffer[t],e,36064,34069+t);b(e.texture,h)&&_(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,l.__webglTexture),L(3553,e.texture,h),k(i.__webglFramebuffer,e,36064,3553),b(e.texture,h)&&_(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&D(e)},this.updateRenderTargetMipmap=function(t){const e=t.texture;if(b(e,y(t)||a)){const i=t.isWebGLCubeRenderTarget?34067:3553,o=r.get(e).__webglTexture;n.bindTexture(i,o),_(i,e,t.width,t.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(a){const n=r.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);const i=e.width,o=e.height;let s=16384;e.depthBuffer&&(s|=256),e.stencilBuffer&&(s|=1024),t.blitFramebuffer(0,0,i,o,0,0,i,o,s,9728),t.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===j&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),j=!0),t=t.texture),T(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),F=!0),t=t.texture),C(t,e)}}function Jr(t,e,n){const r=n.isWebGL2;return{convert:function(t){let n;if(1009===t)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(1012===t)return 5123;if(1013===t)return 5124;if(1014===t)return 5125;if(1015===t)return 5126;if(1016===t)return r?5131:(n=e.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(1021===t)return 6406;if(1022===t)return 6407;if(1023===t)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(1026===t)return 6402;if(1027===t)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(33776===t||33777===t||33778===t||33779===t){if(n=e.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(33776===t)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(n=e.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(35840===t)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return n=e.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===t||37496===t)&&(n=e.get("WEBGL_compressed_texture_etc"),null!==n)){if(37492===t)return n.COMPRESSED_RGB8_ETC2;if(37496===t)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?(n=e.get("WEBGL_compressed_texture_astc"),null!==n?t:null):36492===t?(n=e.get("EXT_texture_compression_bptc"),null!==n?t:null):1020===t?r?34042:(n=e.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function Kr(t=[]){Ue.call(this),this.cameras=t}function Qr(){bt.call(this),this.type="Group"}function $r(){this._targetRay=null,this._grip=null,this._hand=null}function ti(t,e){const n=this;let r=null,i=1,o=null,s="local-floor",a=null;const l=[],c=new Map,u=new Ue;u.layers.enable(1),u.viewport=new v;const h=new Ue;h.layers.enable(2),h.viewport=new v;const f=[u,h],d=new Kr;d.layers.enable(1),d.layers.enable(2);let p=null,m=null;function g(t){const e=c.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function y(){c.forEach((function(t,e){t.disconnect(e)})),c.clear(),p=null,m=null,t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),E.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function b(t){const e=r.inputSources;for(let t=0;t0&&Et(o,t,e),s.length>0&&Et(s,t,e),!0===t.isScene&&t.onAfterRender(g,t,e),null!==M&&(K.updateRenderTargetMipmap(M),K.updateMultisampleRenderTarget(M)),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),m.pop(),p=m.length>0?m[m.length-1]:null,d=null},this.setFramebuffer=function(t){b!==t&&null===M&&dt.bindFramebuffer(36160,t),b=t},this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return w},this.getRenderList=function(){return d},this.setRenderList=function(t){d=t},this.getRenderTarget=function(){return M},this.setRenderTarget=function(t,e=0,n=0){M=t,x=e,w=n,t&&void 0===J.get(t).__webglFramebuffer&&K.setupRenderTarget(t);let r=b,i=!1;if(t){const n=J.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=n[e],i=!0):r=t.isWebGLMultisampleRenderTarget?J.get(t).__webglMultisampledFramebuffer:n,C.copy(t.viewport),A.copy(t.scissor),P=t.scissorTest}else C.copy(D).multiplyScalar(O).floor(),A.copy(N).multiplyScalar(O).floor(),P=j;if(S!==r&&(dt.bindFramebuffer(36160,r),S=r),X.viewport(C),X.scissor(A),X.setScissorTest(P),i){const r=J.get(t.texture);dt.framebufferTexture2D(36160,36064,34069+e,r.__webglTexture,n)}},this.readRenderTargetPixels=function(t,e,n,r,i,o,s){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=J.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==s&&(a=a[s]),a){let s=!1;a!==S&&(dt.bindFramebuffer(36160,a),s=!0);try{const a=t.texture,l=a.format,c=a.type;if(1023!==l&&ht.convert(l)!==dt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const u=1016===c&&(V.has("EXT_color_buffer_half_float")||q.isWebGL2&&V.has("EXT_color_buffer_float"));if(!(1009===c||ht.convert(c)===dt.getParameter(35738)||1015===c&&(q.isWebGL2||V.has("OES_texture_float")||V.has("WEBGL_color_buffer_float"))||u))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===dt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&dt.readPixels(e,n,r,i,ht.convert(l),ht.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&dt.bindFramebuffer(36160,S)}}},this.copyFramebufferToTexture=function(t,e,n=0){const r=Math.pow(2,-n),i=Math.floor(e.image.width*r),o=Math.floor(e.image.height*r),s=ht.convert(e.format);K.setTexture2D(e,0),dt.copyTexImage2D(3553,n,s,t.x,t.y,i,o,0),X.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r=0){const i=e.image.width,o=e.image.height,s=ht.convert(n.format),a=ht.convert(n.type);K.setTexture2D(n,0),dt.pixelStorei(37440,n.flipY),dt.pixelStorei(37441,n.premultiplyAlpha),dt.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?dt.texSubImage2D(3553,r,t.x,t.y,i,o,s,a,e.image.data):e.isCompressedTexture?dt.compressedTexSubImage2D(3553,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,s,e.mipmaps[0].data):dt.texSubImage2D(3553,r,t.x,t.y,s,a,e.image),0===r&&n.generateMipmaps&&dt.generateMipmap(3553),X.unbindTexture()},this.initTexture=function(t){K.setTexture2D(t,0),X.unbindTexture()},this.resetState=function(){X.reset(),ft.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function ri(t){ni.call(this,t)}Kr.prototype=Object.assign(Object.create(Ue.prototype),{constructor:Kr,isArrayCamera:!0}),Qr.prototype=Object.assign(Object.create(bt.prototype),{constructor:Qr,isGroup:!0}),Object.assign($r.prototype,{constructor:$r,getHandSpace:function(){return null===this._hand&&(this._hand=new Qr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Qr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Qr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(t,e,n){let r=null,i=null,o=null;const s=this._targetRay,a=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(l&&t.hand){o=!0;for(const r of t.hand.values()){const t=e.getJointPose(r,n);if(void 0===l.joints[r.jointName]){const t=new Qr;t.matrixAutoUpdate=!1,t.visible=!1,l.joints[r.jointName]=t,l.add(t)}const i=l.joints[r.jointName];null!==t&&(i.matrix.fromArray(t.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=t.radius),i.visible=null!==t}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],s=r.position.distanceTo(i.position),a=.02,c=.005;l.inputState.pinching&&s>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&s<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==s&&(r=e.getPose(t.targetRaySpace,n),null!==r&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale))),null!==a&&t.gripSpace&&(i=e.getPose(t.gripSpace,n),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale)));return null!==s&&(s.visible=null!==r),null!==a&&(a.visible=null!==i),null!==l&&(l.visible=null!==o),this}}),Object.assign(ti.prototype,s.prototype),ri.prototype=Object.assign(Object.create(ni.prototype),{constructor:ri,isWebGL1Renderer:!0});class ii extends bt{constructor(){super(),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}function oi(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=c.generateUUID()}Object.defineProperty(oi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(oi.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(let r=0,i=this.stride;rt.far||e.push({distance:a,point:ui.clone(),uv:It.getUV(ui,gi,vi,yi,bi,_i,xi,new u),face:null,object:this})},copy:function(t){return bt.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}});const Si=new _,Ei=new _;function Ti(){bt.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}Ti.prototype=Object.assign(Object.create(bt.prototype),{constructor:Ti,isLOD:!0,copy:function(t){bt.prototype.copy.call(this,t,!1);const e=t.levels;for(let t=0,n=e.length;t0){let n,r;for(n=1,r=e.length;n0){Si.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(Si);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){const e=this.levels;if(e.length>1){Si.setFromMatrixPosition(t.matrixWorld),Ei.setFromMatrixPosition(this.matrixWorld);const n=Si.distanceTo(Ei)/t.zoom;let r,i;for(e[0].object.visible=!0,r=1,i=e.length;r=e[r].distance;r++)e[r-1].object.visible=!1,e[r].object.visible=!0;for(this._currentLevel=r-1;rs)continue;u.applyMatrix4(this.matrixWorld);const f=t.ray.origin.distanceTo(u);ft.far||e.push({distance:f,point:c.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else for(let n=0,r=i.count-1;ns)continue;u.applyMatrix4(this.matrixWorld);const r=t.ray.origin.distanceTo(u);rt.far||e.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const Zi=new _,Ji=new _;function Ki(t,e){Yi.call(this,t,e),this.type="LineSegments"}function Qi(t,e){Yi.call(this,t,e),this.type="LineLoop"}function $i(t){Wt.call(this),this.type="PointsMaterial",this.color=new Ut(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}Ki.prototype=Object.assign(Object.create(Yi.prototype),{constructor:Ki,isLineSegments:!0,computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,r=e.count;ti.far)return;o.push({distance:l,distanceToRay:Math.sqrt(a),point:n,index:e,face:null,object:s})}}function so(t,e,n,r,i,o,s,a,l){m.call(this,t,e,n,r,i,o,s,a,l),this.format=void 0!==s?s:1022,this.minFilter=void 0!==o?o:1006,this.magFilter=void 0!==i?i:1006,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}function ao(t,e,n,r,i,o,s,a,l,c,u,h){m.call(this,null,o,s,a,l,c,r,i,u,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function lo(t,e,n,r,i,o,s,a,l){m.call(this,t,e,n,r,i,o,s,a,l),this.needsUpdate=!0}function co(t,e,n,r,i,o,s,a,l,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===c&&(n=1012),void 0===n&&1027===c&&(n=1020),m.call(this,null,r,i,o,s,a,c,n,l),this.image={width:t,height:e},this.magFilter=void 0!==s?s:1003,this.minFilter=void 0!==a?a:1003,this.flipY=!1,this.generateMipmaps=!1}io.prototype=Object.assign(Object.create(bt.prototype),{constructor:io,isPoints:!0,copy:function(t){return bt.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},raycast:function(t,e){const n=this.geometry,r=this.matrixWorld,i=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),no.copy(n.boundingSphere),no.applyMatrix4(r),no.radius+=i,!1===t.ray.intersectsSphere(no))return;to.copy(r).invert(),eo.copy(t.ray).applyMatrix4(to);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o;if(n.isBufferGeometry){const i=n.index,o=n.attributes.position;if(null!==i){const n=i.array;for(let i=0,a=n.length;i0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),so.prototype=Object.assign(Object.create(m.prototype),{constructor:so,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),ao.prototype=Object.create(m.prototype),ao.prototype.constructor=ao,ao.prototype.isCompressedTexture=!0,lo.prototype=Object.create(m.prototype),lo.prototype.constructor=lo,lo.prototype.isCanvasTexture=!0,co.prototype=Object.create(m.prototype),co.prototype.constructor=co,co.prototype.isDepthTexture=!0;new _,new _,new _,new It;const uo=function(t,e,n){n=n||2;const r=e&&e.length,i=r?e[0]*n:t.length;let o=ho(t,0,i,n,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,c,u,h,f,d;if(r&&(o=function(t,e,n,r){const i=[];let o,s,a,l,c;for(o=0,s=e.length;o80*n){a=c=t[0],l=u=t[1];for(let e=n;ec&&(c=h),f>u&&(u=f);d=Math.max(c-a,u-l),d=0!==d?1/d:0}return po(o,s,n,a,l,d),s};function ho(t,e,n,r,i){let o,s;if(i===function(t,e,n,r){let i=0;for(let o=e,s=n-r;o0)for(o=e;o=e;o-=r)s=ko(o,t[o],t[o+1],s);return s&&Co(s,s.next)&&(Io(s),s=s.next),s}function fo(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!Co(r,r.next)&&0!==To(r.prev,r,r.next))r=r.next;else{if(Io(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function po(t,e,n,r,i,o,s){if(!t)return;!s&&o&&function(t,e,n,r){let i=t;do{null===i.z&&(i.z=wo(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,n,r,i,o,s,a,l,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e0||l>0&&r;)0!==a&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(s>1)}(i)}(t,r,i,o);let a,l,c=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,o?go(t,r,i,o):mo(t))e.push(a.i/n),e.push(t.i/n),e.push(l.i/n),Io(t),t=l.next,c=l.next;else if((t=l)===c){s?1===s?po(t=vo(fo(t),e,n),e,n,r,i,o,2):2===s&&yo(t,e,n,r,i,o):po(fo(t),e,n,r,i,o,1);break}}function mo(t){const e=t.prev,n=t,r=t.next;if(To(e,n,r)>=0)return!1;let i=t.next.next;for(;i!==t.prev;){if(So(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&To(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function go(t,e,n,r){const i=t.prev,o=t,s=t.next;if(To(i,o,s)>=0)return!1;const a=i.xo.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,u=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,h=wo(a,l,e,n,r),f=wo(c,u,e,n,r);let d=t.prevZ,p=t.nextZ;for(;d&&d.z>=h&&p&&p.z<=f;){if(d!==t.prev&&d!==t.next&&So(i.x,i.y,o.x,o.y,s.x,s.y,d.x,d.y)&&To(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==t.prev&&p!==t.next&&So(i.x,i.y,o.x,o.y,s.x,s.y,p.x,p.y)&&To(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&So(i.x,i.y,o.x,o.y,s.x,s.y,d.x,d.y)&&To(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=f;){if(p!==t.prev&&p!==t.next&&So(i.x,i.y,o.x,o.y,s.x,s.y,p.x,p.y)&&To(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function vo(t,e,n){let r=t;do{const i=r.prev,o=r.next.next;!Co(i,o)&&Ao(i,r,r.next,o)&&Ro(i,o)&&Ro(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Io(r),Io(r.next),r=t=o),r=r.next}while(r!==t);return fo(r)}function yo(t,e,n,r,i,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&Eo(s,t)){let a=Oo(s,t);return s=fo(s,s.next),a=fo(a,a.next),po(s,e,n,r,i,o),void po(a,e,n,r,i,o)}t=t.next}s=s.next}while(s!==t)}function bo(t,e){return t.x-e.x}function _o(t,e){if(e=function(t,e){let n=e;const r=t.x,i=t.y;let o,s=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const t=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>s){if(s=t,t===r){if(i===n.y)return n;if(i===n.next.y)return n.next}o=n.x=n.x&&n.x>=l&&r!==n.x&&So(io.x||n.x===o.x&&xo(o,n)))&&(o=n,h=u)),n=n.next}while(n!==a);return o}(t,e)){const n=Oo(e,t);fo(e,e.next),fo(n,n.next)}}function xo(t,e){return To(t.prev,t,e.prev)<0&&To(e.next,t,t.next)<0}function wo(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Mo(t){let e=t,n=t;do{(e.x=0&&(t-s)*(r-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(i-s)*(r-a)>=0}function Eo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Ao(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ro(t,e)&&Ro(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(To(t.prev,t,e.prev)||To(t,e.prev,e))||Co(t,e)&&To(t.prev,t,t.next)>0&&To(e.prev,e,e.next)>0)}function To(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Co(t,e){return t.x===e.x&&t.y===e.y}function Ao(t,e,n,r){const i=Lo(To(t,e,n)),o=Lo(To(t,e,r)),s=Lo(To(n,r,t)),a=Lo(To(n,r,e));return i!==o&&s!==a||(!(0!==i||!Po(t,n,e))||(!(0!==o||!Po(t,r,e))||(!(0!==s||!Po(n,t,r))||!(0!==a||!Po(n,e,r)))))}function Po(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Lo(t){return t>0?1:t<0?-1:0}function Ro(t,e){return To(t.prev,t,t.next)<0?To(t,e,t.next)>=0&&To(t,t.prev,e)>=0:To(t,e,t.prev)<0||To(t,t.next,e)<0}function Oo(t,e){const n=new Do(t.i,t.x,t.y),r=new Do(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function ko(t,e,n,r){const i=new Do(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Io(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Do(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}const No={area:function(t){const e=t.length;let n=0;for(let r=e-1,i=0;i2&&t[e-1].equals(t[0])&&t.pop()}function Fo(t,e){for(let n=0;nNumber.EPSILON){const f=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-a/f,m=e.y+s/f,g=((n.x-c/d-p)*c-(n.y+l/d-m)*l)/(s*c-a*l);r=p+s*g-t.x,i=m+a*g-t.y;const v=r*r+i*i;if(v<=2)return new u(r,i);o=Math.sqrt(v/2)}else{let t=!1;s>Number.EPSILON?l>Number.EPSILON&&(t=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(c)&&(t=!0),t?(r=-a,i=s,o=Math.sqrt(h)):(r=s,i=a,o=Math.sqrt(h/2))}return new u(r/o,i/o)}const k=[];for(let t=0,e=A.length,n=e-1,r=t+1;t=0;t--){const e=t/p,n=h*Math.cos(e*Math.PI/2),r=f*Math.sin(e*Math.PI/2)+d;for(let t=0,e=A.length;t=0;){const r=n;let i=n-1;i<0&&(i=t.length-1);for(let t=0,n=a+2*p;t=0?(t(r-a,d,u),h.subVectors(c,u)):(t(r+a,d,u),h.subVectors(u,c)),d-a>=0?(t(r,d-a,u),f.subVectors(c,u)):(t(r,d+a,u),f.subVectors(u,c)),l.crossVectors(h,f).normalize(),o.push(l.x,l.y,l.z),s.push(r,d)}}for(let t=0;t0)&&f.push(e,i,l),(t!==n-1||a=r)){l.push(e.times[t]);for(let n=0;no.tracks[t].times[0]&&(a=o.tracks[t].times[0]);for(let t=0;t=r.times[h]){const t=h*l+a,e=t+l-a;f=ns.arraySlice(r.values,t,e)}else{const t=r.createInterpolant(),e=a,n=l-a;t.evaluate(o),f=ns.arraySlice(t.resultBuffer,e,n)}if("quaternion"===i){(new b).fromArray(f).normalize().conjugate().toArray(f)}const d=s.times.length;for(let t=0;t=i)break t;{const s=e[1];t=i)break e}o=n,n=0}}for(;n>>1;te;)--o;if(++o,0!==i||o!==r){i>=o&&(o=Math.max(o,1),i=o-1);const t=this.getValueSize();this.times=ns.arraySlice(n,i,o),this.values=ns.arraySlice(this.values,i*t,o*t)}return this},validate:function(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let e=0;e!==i;e++){const r=n[e];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,r),t=!1;break}if(null!==o&&o>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,r,o),t=!1;break}o=r}if(void 0!==r&&ns.isTypedArray(r))for(let e=0,n=r.length;e!==n;++e){const n=r[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t},optimize:function(){const t=ns.arraySlice(this.times),e=ns.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=t.length-1;let o=1;for(let s=1;s0){t[o]=t[i];for(let t=i*n,r=o*n,s=0;s!==n;++s)e[r+s]=e[t+s];++o}return o!==t.length?(this.times=ns.arraySlice(t,0,o),this.values=ns.arraySlice(e,0,o*n)):(this.times=t,this.values=e),this},clone:function(){const t=ns.arraySlice(this.times,0),e=ns.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),ls.prototype=Object.assign(Object.create(as.prototype),{constructor:ls,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),cs.prototype=Object.assign(Object.create(as.prototype),{constructor:cs,ValueTypeName:"color"}),us.prototype=Object.assign(Object.create(as.prototype),{constructor:us,ValueTypeName:"number"}),hs.prototype=Object.assign(Object.create(rs.prototype),{constructor:hs,interpolate_:function(t,e,n,r){const i=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(n-e)/(r-e);let l=t*s;for(let t=l+s;l!==t;l+=4)b.slerpFlat(i,0,o,l-s,o,l,a);return i}}),fs.prototype=Object.assign(Object.create(as.prototype),{constructor:fs,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new hs(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),ds.prototype=Object.assign(Object.create(as.prototype),{constructor:ds,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ps.prototype=Object.assign(Object.create(as.prototype),{constructor:ps,ValueTypeName:"vector"}),Object.assign(ms,{parse:function(t){const e=[],n=t.tracks,r=1/(t.fps||1);for(let t=0,i=n.length;t!==i;++t)e.push(gs(n[t]).scale(r));const i=new ms(t.name,t.duration,e,t.blendMode);return i.uuid=t.uuid,i},toJSON:function(t){const e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,r=n.length;t!==r;++t)e.push(as.toJSON(n[t]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){const i=e.length,o=[];for(let t=0;t1){const t=o[1];let e=r[t];e||(r[t]=e=[]),e.push(n)}}const o=[];for(const t in r)o.push(ms.CreateFromMorphTargetSequence(t,r[t],e,n));return o},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,r,i){if(0!==n.length){const o=[],s=[];ns.flattenJSON(n,o,s,r),0!==o.length&&i.push(new t(e,o,s))}},r=[],i=t.name||"default",o=t.fps||30,s=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t0||0===t.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==e&&e(i)}),n,r),i}}),Object.assign(Ps.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){const t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),i=0;e.push(0);for(let o=1;o<=t;o++)n=this.getPoint(o/t),i+=n.distanceTo(r),e.push(i),r=n;return this.cacheArcLengths=e,e},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){const n=this.getLengths();let r=0;const i=n.length;let o;o=e||t*n[i-1];let s,a=0,l=i-1;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),s=n[r]-o,s<0)a=r+1;else{if(!(s>0)){l=r;break}l=r-1}if(r=l,n[r]===o)return r/(i-1);const c=n[r];return(r+(o-c)/(n[r+1]-c))/(i-1)},getTangent:function(t,e){let n=t-1e-4,r=t+1e-4;n<0&&(n=0),r>1&&(r=1);const i=this.getPoint(n),o=this.getPoint(r),s=e||(i.isVector2?new u:new _);return s.copy(o).sub(i).normalize(),s},getTangentAt:function(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)},computeFrenetFrames:function(t,e){const n=new _,r=[],i=[],o=[],s=new _,a=new Y;for(let e=0;e<=t;e++){const n=e/t;r[e]=this.getTangentAt(n,new _),r[e].normalize()}i[0]=new _,o[0]=new _;let l=Number.MAX_VALUE;const u=Math.abs(r[0].x),h=Math.abs(r[0].y),f=Math.abs(r[0].z);u<=l&&(l=u,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),f<=l&&n.set(0,0,1),s.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],s),o[0].crossVectors(r[0],i[0]);for(let e=1;e<=t;e++){if(i[e]=i[e-1].clone(),o[e]=o[e-1].clone(),s.crossVectors(r[e-1],r[e]),s.length()>Number.EPSILON){s.normalize();const t=Math.acos(c.clamp(r[e-1].dot(r[e]),-1,1));i[e].applyMatrix4(a.makeRotationAxis(s,t))}o[e].crossVectors(r[e],i[e])}if(!0===e){let e=Math.acos(c.clamp(i[0].dot(i[t]),-1,1));e/=t,r[0].dot(s.crossVectors(i[0],i[t]))>0&&(e=-e);for(let n=1;n<=t;n++)i[n].applyMatrix4(a.makeRotationAxis(r[n],e*n)),o[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),Ls.prototype=Object.create(Ps.prototype),Ls.prototype.constructor=Ls,Ls.prototype.isEllipseCurve=!0,Ls.prototype.getPoint=function(t,e){const n=e||new u,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const o=Math.abs(i)r;)i-=r;i0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?s=r[(l-1)%i]:(ks.subVectors(r[0],r[1]).add(r[0]),s=ks);const u=r[l%i],h=r[(l+1)%i];if(this.closed||l+2r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return n.set(Fs(s,a.x,l.x,c.x,h.x),Fs(s,a.y,l.y,c.y,h.y)),n},Xs.prototype.copy=function(t){Ps.prototype.copy.call(this,t),this.points=[];for(let e=0,n=t.points.length;e=e){const t=n[r]-e,i=this.curves[r],o=i.getLength(),s=0===o?0:1-t/o;return i.getPointAt(s)}r++}return null},getLength:function(){const t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,r=this.curves.length;n1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){Ps.prototype.copy.call(this,t),this.curves=[];for(let e=0,n=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(t){return Zs.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){const t=Zs.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Zs.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Ks.prototype=Object.assign(Object.create(Js.prototype),{constructor:Ks,getPointsHoles:function(t){const e=[];for(let n=0,r=this.holes.length;n0:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const i=t.uniforms[e];switch(r.uniforms[e]={},i.type){case"t":r.uniforms[e].value=n(i.value);break;case"c":r.uniforms[e].value=(new Ut).setHex(i.value);break;case"v2":r.uniforms[e].value=(new u).fromArray(i.value);break;case"v3":r.uniforms[e].value=(new _).fromArray(i.value);break;case"v4":r.uniforms[e].value=(new v).fromArray(i.value);break;case"m3":r.uniforms[e].value=(new h).fromArray(i.value);break;case"m4":r.uniforms[e].value=(new Y).fromArray(i.value);break;default:r.uniforms[e].value=i.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const e in t.extensions)r.extensions[e]=t.extensions[e];if(void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=n(t.map)),void 0!==t.matcap&&(r.matcap=n(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(r.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),r.normalScale=(new u).fromArray(e)}return void 0!==t.displacementMap&&(r.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=n(t.specularMap)),void 0!==t.envMap&&(r.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(r.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(r.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(r.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=(new u).fromArray(t.clearcoatNormalScale)),void 0!==t.transmission&&(r.transmission=t.transmission),void 0!==t.transmissionMap&&(r.transmissionMap=n(t.transmissionMap)),r},setTextures:function(t){return this.textures=t,this}});const da=function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,r=t.length;nNumber.EPSILON){if(l<0&&(n=e[o],a=-a,s=e[i],l=-l),t.ys.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-a*(t.y-n.y);if(0===e)return!0;if(e<0)continue;r=!r}}else{if(t.y!==n.y)continue;if(s.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=s.x)return!0}}return r}const i=No.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);let s,a,l;const c=[];if(1===o.length)return a=o[0],l=new Ks,l.curves=a.curves,c.push(l),c;let u=!i(o[0].getPoints());u=t?!u:u;const h=[],f=[];let d,p,m=[],g=0;f[g]=void 0,m[g]=[];for(let e=0,n=o.length;e1){let t=!1;const e=[];for(let t=0,e=f.length;t0&&(t||(m=h))}for(let t=0,e=f.length;t0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(let t=e,i=e+e;t!==i;++t)if(n[t]!==n[t+e]){s.setValue(n,r);break}},saveOriginalState:function(){const t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(let t=n,i=r;t!==i;++t)e[t]=e[r+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n=.5)for(let r=0;r!==i;++r)t[e+r]=t[n+r]},_slerp:function(t,e,n,r){b.slerpFlat(t,e,t,e,t,n,r)},_slerpAdditive:function(t,e,n,r,i){const o=this._workIndex*i;b.multiplyQuaternionsFlat(t,o,t,e,t,n),b.slerpFlat(t,e,t,e,t,o,r)},_lerp:function(t,e,n,r,i){const o=1-r;for(let s=0;s!==i;++s){const i=e+s;t[i]=t[i]*o+t[n+s]*r}},_lerpAdditive:function(t,e,n,r,i){for(let o=0;o!==i;++o){const i=e+o;t[i]=t[i]+t[n+o]*r}}});const Oa=new RegExp("[\\[\\]\\.:\\/]","g"),ka="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Ia=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Da=/(WCOD+)?/.source.replace("WCOD",ka),Na=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),ja=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Fa=new RegExp("^"+Ia+Da+Na+ja+"$"),Ba=["material","materials","bones"];function za(t,e,n){const r=n||Ua.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function Ua(t,e,n){this.path=e,this.parsedPath=n||Ua.parseTrackName(e),this.node=Ua.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}Object.assign(za.prototype,{getValue:function(t,e){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},bind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Ua,{Composite:za,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Ua.Composite(t,e,n):new Ua(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Oa,"")},parseTrackName:function(t){const e=Fa.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const t=n.nodeName.substring(r+1);-1!==Ba.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let r=0;r=i){const o=i++,c=t[o];e[c.uuid]=l,t[l]=c,e[a]=o,t[o]=s;for(let t=0,e=r;t!==e;++t){const e=n[t],r=e[o],i=e[l];e[l]=r,e[o]=i}}}this.nCachedObjects_=i},uncache:function(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,o=t.length;for(let s=0,a=arguments.length;s!==a;++s){const a=arguments[s].uuid,l=e[a];if(void 0!==l)if(delete e[a],l0&&(e[s.uuid]=l),t[l]=s,t.pop();for(let t=0,e=r;t!==e;++t){const e=n[t];e[l]=e[i],e.pop()}}}this.nCachedObjects_=i},subscribe_:function(t,e){const n=this._bindingsIndicesByPath;let r=n[t];const i=this._bindings;if(void 0!==r)return i[r];const o=this._paths,s=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[t]=r,o.push(t),s.push(e),i.push(u);for(let n=c,r=a.length;n!==r;++n){const r=a[n];u[n]=new Ua(r,t,e)}return u},unsubscribe_:function(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const r=this._paths,i=this._parsedPaths,o=this._bindings,s=o.length-1,a=o[s];e[t[s]]=n,o[n]=a,o.pop(),i[n]=i[s],i.pop(),r[n]=r[s],r.pop()}}});class Ha{constructor(t,e,n=null,r=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=r;const i=e.tracks,o=i.length,s=new Array(o),a={endingStart:2400,endingEnd:2400};for(let t=0;t!==o;++t){const e=i[t].createInterpolant(null);s[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=s,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const n=this._clip.duration,r=t._clip.duration,i=r/n,o=n/r;t.warp(1,i,e),this.warp(o,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const r=this._mixer,i=r.time,o=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=r._lendControlInterpolant(),this._timeScaleInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=i,a[1]=i+n,l[0]=t/o,l[1]=e/o,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,r){if(!this.enabled)return void this._updateWeight(t);const i=this._startTime;if(null!==i){const r=(t-i)*n;if(r<0||0===n)return;this._startTime=null,e=n*r}e*=this._updateTimeScale(t);const o=this._updateTime(e),s=this._updateWeight(t);if(s>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case 2501:for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(o),e[n].accumulateAdditive(s);break;case 2500:default:for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(o),e[n].accumulate(r,s)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let r=this.time+t,i=this._loopCount;const o=2202===n;if(0===t)return-1===i?r:o&&1==(1&i)?e-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else{if(!(r<0)){this.time=r;break t}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=e||r<0){const n=Math.floor(r/e);r-=e*n,i+=Math.abs(n);const s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){const e=t<0;this._setEndings(e,!e,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(o&&1==(1&i))return e-r}return r}_setEndings(t,e,n){const r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,n){const r=this._mixer,i=r.time;let o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const s=o.parameterPositions,a=o.sampleValues;return s[0]=i,a[0]=e,s[1]=i+t,a[1]=n,this}}function Ga(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}Ga.prototype=Object.assign(Object.create(s.prototype),{constructor:Ga,_bindAction:function(t,e){const n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,o=t._propertyBindings,s=t._interpolants,a=n.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let t=0;t!==i;++t){const i=r[t],l=i.name;let u=c[l];if(void 0!==u)o[t]=u;else{if(u=o[t],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,a,l));continue}const r=e&&e._propertyBindings[t].binding.parsedPath;u=new Ra(Ua.create(n,l,r),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,a,l),o[t]=u}s[t].resultBuffer=u.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){const e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),o=this._accuIndex^=1;for(let s=0;s!==n;++s){e[s]._update(r,t,i,o)}const s=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)s[t].apply(o);return this},setTime:function(t){this.time=0;for(let t=0;t4?s=sl[i-8+4-1]:0==i&&(s=0),n.push(s);const a=1/(o-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,f=6,d=3,p=2,m=1,g=new Float32Array(d*f*h),v=new Float32Array(p*f*h),y=new Float32Array(m*f*h);for(let t=0;t2?0:-1,r=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];g.set(r,d*f*t),v.set(u,p*f*t);const i=[t,t,t,t,t,t];y.set(i,m*f*t)}const b=new me;b.setAttribute("position",new Yt(g,d)),b.setAttribute("uv",new Yt(v,p)),b.setAttribute("faceIndex",new Yt(y,m)),t.push(b),r>4&&r--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}function dl(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),js.call(this,t),this.type="catmullrom"}Ps.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Ps.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Js.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Object.create(js.prototype),Object.create(js.prototype),dl.prototype=Object.create(js.prototype),Object.assign(dl.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),class extends Ki{constructor(t=10,e=10,n=4473924,r=8947848){n=new Ut(n),r=new Ut(r);const i=e/2,o=t/e,s=t/2,a=[],l=[];for(let t=0,c=0,u=-s;t<=e;t++,u+=o){a.push(-s,0,u,s,0,u),a.push(u,0,-s,u,0,s);const e=t===i?n:r;e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3}const c=new me;c.setAttribute("position",new re(a,3)),c.setAttribute("color",new re(l,3));super(c,new Hi({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends Ki{constructor(t){const e=function t(e){const n=[];e&&e.isBone&&n.push(e);for(let r=0;rthis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new u),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new u),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Ka.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(M.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(B.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Ye.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},tl.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(c,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),c.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),c.ceilPowerOfTwo(t)}}),Object.assign(h.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(t){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),Object.assign(Y.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new _).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,o)},getInverse:function(t){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),Mt.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Object.assign(b.prototype,{multiplyVector3:function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(X.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(It.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(It,{barycoordFromPoint:function(t,e,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),It.getBarycoord(t,e,n,r,i)},normal:function(t,e,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),It.getNormal(t,e,n,r)}}),Object.assign(Ks.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Bo(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Ho(this,t)}}),Object.assign(u.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(_.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(v.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(bt.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(bt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(ke.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(ke.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Ti.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Ni.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Oi.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Ps.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Ue.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Qs.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Yt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(Yt.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(me.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new Yt(arguments[1],arguments[2])))},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(me.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(ma.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(Xa.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(oi.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(oi.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Bo.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(ii.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(Wa.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Wt.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Ut}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(Zo.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Yo.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(t){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=t}}}),Object.defineProperties(Be.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(ni.prototype,{clearTarget:function(t,e,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,r)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(ni.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(Xr.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(y.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(La.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return(new Ea).load(t,(function(t){e.setBuffer(t)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let n=0;nSeems like WebGL isn't supported for you.
Find out how to get it here.
",this.container.style.textAlign="center",this.container.style.fontSize="18px",console.warn("WebGL Not Supported"),this.renderer=null)},t.prototype.remove=function(){window.removeEventListener("resize",this.updateSize,!1)},t}();function ml(t,e){var n,s,a,l,c;this.object=t,this.domElement=void 0!==e?e:document,this.enabled=!0,this.target=new _,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=.275,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:r,ZOOM:i,PAN:o},this.enableTwoFingerZoomPan=!1,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.flipPanUp=!1,this.getPolarAngle=function(){return y.phi},this.getAzimuthalAngle=function(){return y.theta},this.reset=function(){h.target.copy(h.target0),h.object.position.copy(h.position0),h.object.zoom=h.zoom0,h.object.updateProjectionMatrix(),h.dispatchEvent(f),h.update(),g=m.NONE},this.resetPosition=function(){var t=h.object.position.y;h.object.position.copy(h.position0),h.object.position.y=t,h.object.updateProjectionMatrix(),h.dispatchEvent(f),h.update(),g=m.NONE},this.update=(n=new _,s=(new b).setFromUnitVectors(t.up,new _(0,1,0)),a=s.clone().invert(),l=new _,c=new b,function(){var t=h.object.position;return n.copy(t).sub(h.target),n.applyQuaternion(s),y.setFromVector3(n),h.autoRotate&&g===m.NONE&&N(2*Math.PI/60/60*h.autoRotateSpeed),y.theta+=x.theta,y.phi+=x.phi,y.theta=Math.max(h.minAzimuthAngle,Math.min(h.maxAzimuthAngle,y.theta)),y.phi=Math.max(h.minPolarAngle,Math.min(h.maxPolarAngle,y.phi)),y.makeSafe(),y.radius*=w,y.radius=Math.max(h.minDistance,Math.min(h.maxDistance,y.radius)),h.target.add(M),n.setFromSpherical(y),n.applyQuaternion(a),t.copy(h.target).add(n),h.object.lookAt(h.target),!0===h.enableDamping?(x.theta*=1-h.dampingFactor,x.phi*=1-h.dampingFactor):x.set(0,0,0),w=1,M.set(0,0,0),!!(S||l.distanceToSquared(h.object.position)>v||8*(1-c.dot(h.object.quaternion))>v)&&(h.dispatchEvent(f),l.copy(h.object.position),c.copy(h.object.quaternion),S=!1,!0)}),this.dispose=function(){h.domElement.removeEventListener("contextmenu",et,!1),h.domElement.removeEventListener("mousedown",X,!1),h.domElement.removeEventListener("wheel",J,!1),h.domElement.removeEventListener("touchstart",Q,!1),h.domElement.removeEventListener("touchend",tt,!1),h.domElement.removeEventListener("touchmove",$,!1),document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",Z,!1),window.removeEventListener("keydown",K,!1)};var h=this,f={type:"change"},d={type:"start"},p={type:"end"},m={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5,TOUCH_DOLLY_PAN:6},g=m.NONE,v=1e-6,y=new Ja,x=new Ja,w=1,M=new _,S=!1,E=new u,T=new u,C=new u,A=new u,P=new u,L=new u,R=new u,O=new u,k=new u;function I(){return h.domElement===document?h.domElement.body:h.domElement}function D(t){return t=t||1,Math.pow(.95,h.zoomSpeed*t)}function N(t){x.theta-=t}function j(t){x.phi-=t}this.rotateLeft=N,this.rotateUp=j;var F,B=(F=new _,function(t,e){var n=e.elements;h.flipPanUp?F.set(n[0],0,n[2]).normalize():F.set(n[0],n[1],0).normalize(),F.multiplyScalar(-t),M.add(F)}),z=function(){var t=new _;return function(e,n){var r=n.elements;h.flipPanUp?t.set(r[4],0,r[6]).normalize():t.set(r[4],r[5],0).normalize(),t.multiplyScalar(e),M.add(t)}}(),U=function(){var t=new _;return function(e,n){var r=I();if(h.object instanceof Ue){var i=h.object.position;t.copy(i).sub(h.target);var o=t.length();o*=Math.tan(h.object.fov/2*Math.PI/180),B(2*e*o/r.clientHeight,h.object.matrix),z(2*n*o/r.clientHeight,h.object.matrix)}else h.object instanceof oa?(B(e*(h.object.right-h.object.left)/h.object.zoom/r.clientWidth,h.object.matrix),z(n*(h.object.top-h.object.bottom)/h.object.zoom/r.clientHeight,h.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),h.enablePan=!1)}}();function H(t){h.object instanceof Ue?w/=t:h.object instanceof oa?(h.object.zoom=Math.max(h.minZoom,Math.min(h.maxZoom,h.object.zoom*t)),h.object.updateProjectionMatrix(),S=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),h.enableZoom=!1)}function G(t){h.object instanceof Ue?w*=t:h.object instanceof oa?(h.object.zoom=Math.max(h.minZoom,Math.min(h.maxZoom,h.object.zoom/t)),h.object.updateProjectionMatrix(),S=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),h.enableZoom=!1)}function W(t){t.deltaY<0?G(D()):t.deltaY>0&&H(D()),h.update()}function V(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);R.set(0,r)}function q(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);O.set(0,r),k.subVectors(O,R);var i=I(),o=Math.abs(k.y)/(.01*i.clientHeight);k.y>0?G(D(o)):k.y<0&&H(D(o)),R.copy(O),h.update()}function X(t){if(!1!==h.enabled){if(t.preventDefault(),t.button===h.mouseButtons.ORBIT){if(!1===h.enableRotate)return;!function(t){E.set(t.clientX,t.clientY)}(t),g=m.ROTATE}else if(t.button===h.mouseButtons.ZOOM){if(!1===h.enableZoom)return;!function(t){R.set(t.clientX,t.clientY)}(t),g=m.DOLLY}else if(t.button===h.mouseButtons.PAN){if(!1===h.enablePan)return;!function(t){A.set(t.clientX,t.clientY)}(t),g=m.PAN}g!==m.NONE&&(document.addEventListener("mousemove",Y,!1),document.addEventListener("mouseup",Z,!1),h.dispatchEvent(d))}}function Y(t){if(!1!==h.enabled)if(t.preventDefault(),g===m.ROTATE){if(!1===h.enableRotate)return;!function(t){T.set(t.clientX,t.clientY),C.subVectors(T,E);var e=I();N(2*Math.PI*C.x/e.clientWidth*h.rotateSpeed),j(2*Math.PI*C.y/e.clientHeight*h.rotateSpeed),E.copy(T),h.update()}(t)}else if(g===m.DOLLY){if(!1===h.enableZoom)return;!function(t){O.set(t.clientX,t.clientY),k.subVectors(O,R);var e=I(),n=Math.abs(k.y)/(.01*e.clientHeight);k.y>0?H(D(n)):k.y<0&&G(D(n)),R.copy(O),h.update()}(t)}else if(g===m.PAN){if(!1===h.enablePan)return;!function(t){P.set(t.clientX,t.clientY),L.subVectors(P,A),U(L.x,L.y),A.copy(P),h.update()}(t)}}function Z(t){!1!==h.enabled&&(document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",Z,!1),h.dispatchEvent(p),g=m.NONE)}function J(t){!1===h.enabled||!1===h.enableZoom||g!==m.NONE&&g!==m.ROTATE||(t.preventDefault(),W(t),h.dispatchEvent(d),h.dispatchEvent(p))}function K(t){!1!==h.enabled&&!1!==h.enableKeys&&!1!==h.enablePan&&function(t){switch(t.keyCode){case h.keys.UP:U(0,h.keyPanSpeed),h.update();break;case h.keys.BOTTOM:U(0,-h.keyPanSpeed),h.update();break;case h.keys.LEFT:U(h.keyPanSpeed,0),h.update();break;case h.keys.RIGHT:U(-h.keyPanSpeed,0),h.update()}}(t)}function Q(t){if(!1!==h.enabled){switch(t.touches.length){case 1:if(!1===h.enableRotate)return;!function(t){E.set(t.touches[0].pageX,t.touches[0].pageY)}(t),g=m.TOUCH_ROTATE;break;case 2:if(!1===h.enableZoom&&!1===h.enablePan)return;if(!0===h.enableTwoFingerZoomPan)!function(t){if(!0===h.enableZoom&&V(t),!0===h.enablePan){var e=(t.touches[0].pageX+t.touches[1].pageX)/2,n=(t.touches[0].pageY+t.touches[1].pageY)/2;A.set(e,n)}}(t),g=!0===h.enableZoom&&!0===h.enablePan?m.TOUCH_DOLLY_PAN:!0===h.enableZoom&&!1===h.eanblePan?m.TOUCH_DOLLY:m.TOUCH_PAN;else{if(!1===h.enableZoom)return;V(t),g=m.TOUCH_DOLLY}break;case 3:if(!1===h.enablePan)return;if(!0===h.enableTwoFingerZoomPan)return;!function(t){A.set(t.touches[0].pageX,t.touches[0].pageY)}(t),g=m.TOUCH_PAN;break;default:g=m.NONE}g!==m.NONE&&h.dispatchEvent(d)}}function $(t){if(!1!==h.enabled)switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case 1:if(!1===h.enableRotate)return;if(g!==m.TOUCH_ROTATE)return;!function(t){T.set(t.touches[0].pageX,t.touches[0].pageY),C.subVectors(T,E);var e=I();N(2*Math.PI*C.x/e.clientWidth*h.rotateSpeed),j(2*Math.PI*C.y/e.clientHeight*h.rotateSpeed),E.copy(T),h.update()}(t);break;case 2:if(!1===h.enableZoom&&!1===h.enablePan)return;if(g!==m.TOUCH_DOLLY&&g!==m.TOUCH_PAN&&g!==m.TOUCH_DOLLY_PAN)return;if(!0===h.enableTwoFingerZoomPan)!function(t){if(!0===h.enablePan){var e=(t.touches[0].pageX+t.touches[1].pageX)/2,n=(t.touches[0].pageY+t.touches[1].pageY)/2;P.set(e,n),L.subVectors(P,A),U(L.x,L.y),A.copy(P),!1===h.enableZoom&&h.update()}!0===h.enableZoom&&q(t)}(t);else{if(!1===h.enableZoom)return;q(t)}break;case 3:if(!1===h.enablePan)return;if(g!==m.TOUCH_PAN)return;!function(t){P.set(t.touches[0].pageX,t.touches[0].pageY),L.subVectors(P,A),U(L.x,L.y),A.copy(P),h.update()}(t);break;default:g=m.NONE}}function tt(t){!1!==h.enabled&&(h.dispatchEvent(p),g=m.NONE)}function et(t){t.preventDefault()}this.handleMouseWheel=W,h.domElement.addEventListener("contextmenu",et,!1),h.domElement.addEventListener("mousedown",X,!1),h.domElement.addEventListener("wheel",J,!1),h.domElement.addEventListener("touchstart",Q,!1),h.domElement.addEventListener("touchend",tt,!1),h.domElement.addEventListener("touchmove",$,!1),window.addEventListener("keydown",K,!1),this.update()}function gl(t){var e=this;t.rotation.set(0,0,0);var n=new bt;n.add(t);var r=new bt;r.position.y=10,r.add(n);var i,o,s=Math.PI/2,a=function(t){if(!1!==e.enabled){var i=t.movementX||t.mozMovementX||t.webkitMovementX||0,o=t.movementY||t.mozMovementY||t.webkitMovementY||0;r.rotation.y-=.002*i,n.rotation.x-=.002*o,n.rotation.x=Math.max(-s,Math.min(s,n.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",a,!1)},document.addEventListener("mousemove",a,!1),this.enabled=!1,this.getObject=function(){return r},this.getPitchObject=function(){return n},this.getDirection=(i=new _(0,0,-1),o=new nt(0,0,0,"YXZ"),function(t){return o.set(n.rotation.x,r.rotation.y,0),t.copy(i).applyEuler(o),t})}ml.prototype=Object.create(s.prototype),ml.prototype.constructor=ml,Object.defineProperties(ml.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(t){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!t}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(t){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!t}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(t){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!t}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(t){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!t}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(t){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!t}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(t){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=t}}});var vl={getIn:function(t,e,n){if(null==t)return null!=n?n:null;if("string"==typeof e&&(e=e.split(".")),null==e)return null!=n?n:null;for(var r=Object.assign({},t),i=0;i=0?n:n+e)},findHighestMaxZoom:function(t){var e=0;for(var n in t)"Vectors As Tiles"!=t[n].name&&t[n].maxZoom>e&&(e=t[n].maxZoom);return e},findLowestMinZoom:function(t){var e=1/0;for(var n in t)"_vectorsastile_"!==t[n].path&&t[n].minZoome[1]&&le[0],i=t.x+1,o=t.y+0,a=(s=n.tileXYZ2LatLng(i,o,t.z)).lat,l=s.lng,r=r||ae[1]&&le[0],i=t.x+1,o=t.y+1,a=(s=n.tileXYZ2LatLng(i,o,t.z)).lat,l=s.lng,r=r||ae[1]&&le[0],i=t.x+0,o=t.y+1,a=(s=n.tileXYZ2LatLng(i,o,t.z)).lat,l=s.lng,r=r||ae[1]&&le[0]}return r},clone:function(t){var e;if(null==t||"object"!=typeof t)return t;if(t instanceof Date)return(e=new Date).setTime(t.getTime()),e;if(t instanceof Array){e=[];for(var n=0,r=t.length;n3&&vl.lastTileContains.pop(),o},tileIsContained:function(t,e,n){for(var r=this.tileContains(t,e[2],n),i=0;i=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},Fl.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(Nl.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},Fl.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Fl.prototype.number=function(t){if(!jl.test(t)){if(Nl.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},Fl.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},Fl.prototype.keyword=function(t){if(Dl.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!Nl.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},Fl.prototype.neutral=function(t){if(Il.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(jl.test(t))return this.word=t,void(this.state=3);if(!Nl.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},Fl.prototype.output=function(){for(;this.place0?90:-90),t.lat_ts=t.lat1)}(i),i};function Gl(t){var e=this;if(2===arguments.length){var n=arguments[1];"string"==typeof n?"+"===n.charAt(0)?Gl[t]=Rl(arguments[1]):Gl[t]=Hl(arguments[1]):Gl[t]=n}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?Gl.apply(e,t):Gl(t)}));if("string"==typeof t){if(t in Gl)return Gl[t]}else"EPSG"in t?Gl["EPSG:"+t.EPSG]=t:"ESRI"in t?Gl["ESRI:"+t.ESRI]=t:"IAU2000"in t?Gl["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(Gl);var Wl=Gl;var Vl=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var ql=["3857","900913","3785","102113"];var Xl=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in Wl}(t))return Wl[t];if(function(t){return Vl.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=Hl(t);if(function(t){var e=Ll(t,"authority");if(e){var n=Ll(e,"epsg");return n&&ql.indexOf(n)>-1}}(e))return Wl["EPSG:3857"];var n=function(t){var e=Ll(t,"extension");if(e)return Ll(e,"proj4")}(e);return n?Rl(n):e}return function(t){return"+"===t[0]}(t)?Rl(t):void 0},Yl=function(t,e){var n,r;if(t=t||{},!e)return t;for(r in e)void 0!==(n=e[r])&&(t[r]=n);return t},Zl=function(t,e,n){var r=t*e;return n/Math.sqrt(1-r*r)},Jl=function(t){return t<0?-1:1},Kl=function(t){return Math.abs(t)<=Tl?t:t-Jl(t)*El},Ql=function(t,e,n){var r=t*n,i=.5*t;return r=Math.pow((1-r)/(1+r),i),Math.tan(.5*(xl-e))/r},$l=function(t,e){for(var n,r,i=.5*t,o=xl-2*Math.atan(e),s=0;s<=15;s++)if(n=t*Math.sin(o),o+=r=xl-2*Math.atan(e*Math.pow((1-n)/(1+n),i))-o,Math.abs(r)<=1e-10)return o;return-9999};function tc(t){return t}var ec=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Zl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,n,r=t.x,i=t.y;if(i*Ml>90&&i*Ml<-90&&r*Ml>180&&r*Ml<-180)return null;if(Math.abs(Math.abs(i)-xl)<=1e-10)return null;if(this.sphere)e=this.x0+this.a*this.k0*Kl(r-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(Sl+.5*i));else{var o=Math.sin(i),s=Ql(this.e,i,o);e=this.x0+this.a*this.k0*Kl(r-this.long0),n=this.y0-this.a*this.k0*Math.log(s)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,r=t.x-this.x0,i=t.y-this.y0;if(this.sphere)n=xl-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var o=Math.exp(-i/(this.a*this.k0));if(-9999===(n=$l(this.e,o)))return null}return e=Kl(this.long0+r/(this.a*this.k0)),t.x=e,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:tc,inverse:tc,names:["longlat","identity"]}],nc={},rc=[];function ic(t,e){var n=rc.length;return t.names?(rc[n]=t,t.names.forEach((function(t){nc[t.toLowerCase()]=n})),this):(console.log(e),!0)}var oc={start:function(){ec.forEach(ic)},add:ic,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==nc[e]&&rc[nc[e]]?rc[nc[e]]:void 0}},sc={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},ac=sc.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};sc.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var lc={};lc.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},lc.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},lc.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},lc.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},lc.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},lc.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},lc.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},lc.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},lc.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},lc.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},lc.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},lc.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},lc.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},lc.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},lc.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},lc.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},lc.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var cc=function(t,e,n,r,i,o,s){var a={};return a.datum_type=void 0===t||"none"===t?5:4,e&&(a.datum_params=e.map(parseFloat),0===a.datum_params[0]&&0===a.datum_params[1]&&0===a.datum_params[2]||(a.datum_type=1),a.datum_params.length>3&&(0===a.datum_params[3]&&0===a.datum_params[4]&&0===a.datum_params[5]&&0===a.datum_params[6]||(a.datum_type=2,a.datum_params[3]*=_l,a.datum_params[4]*=_l,a.datum_params[5]*=_l,a.datum_params[6]=a.datum_params[6]/1e6+1))),s&&(a.datum_type=3,a.grids=s),a.a=n,a.b=r,a.es=i,a.ep2=o,a},uc={};function hc(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:uc[t]||null,isNull:!1}}function fc(t){return t/3600*Math.PI/180}function dc(t,e,n){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,n)))}function pc(t){return t.map((function(t){return[fc(t.longitudeShift),fc(t.latitudeShift)]}))}function mc(t,e,n){return{name:dc(t,e+8,e+16).trim(),parent:dc(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,n),upperLatitude:t.getFloat64(e+88,n),lowerLongitude:t.getFloat64(e+104,n),upperLongitude:t.getFloat64(e+120,n),latitudeInterval:t.getFloat64(e+136,n),longitudeInterval:t.getFloat64(e+152,n),gridNodeCount:t.getInt32(e+168,n)}}function gc(t,e,n,r){for(var i=e+176,o=[],s=0;s-1.001*xl)l=-xl;else if(l>xl&&l<1.001*xl)l=xl;else{if(l<-xl)return{x:-1/0,y:-1/0,z:t.z};if(l>xl)return{x:1/0,y:1/0,z:t.z}}return a>Math.PI&&(a-=2*Math.PI),i=Math.sin(l),s=Math.cos(l),o=i*i,{x:((r=n/Math.sqrt(1-e*o))+c)*s*Math.cos(a),y:(r+c)*s*Math.sin(a),z:(r*(1-e)+c)*i}}function _c(t,e,n,r){var i,o,s,a,l,c,u,h,f,d,p,m,g,v,y,b=t.x,_=t.y,x=t.z?t.z:0;if(i=Math.sqrt(b*b+_*_),o=Math.sqrt(b*b+_*_+x*x),i/n<1e-12){if(v=0,o/n<1e-12)return xl,y=-r,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(_,b);s=x/o,h=(a=i/o)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*a*a)),f=s*l,g=0;do{g++,c=e*(u=n/Math.sqrt(1-e*f*f))/(u+(y=i*h+x*f-u*(1-e*f*f))),m=(p=s*(l=1/Math.sqrt(1-c*(2-c)*a*a)))*h-(d=a*(1-c)*l)*f,h=d,f=p}while(m*m>1e-24&&g<30);return{x:v,y:Math.atan(p/Math.abs(d)),z:y}}function xc(t){return 1===t||2===t}var wc=function(t,e,n){if(function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))}(t,e))return n;if(5===t.datum_type||5===e.datum_type)return n;var r=t.a,i=t.es;if(3===t.datum_type){if(0!==Mc(t,!1,n))return;r=6378137,i=.0066943799901413165}var o=e.a,s=e.b,a=e.es;if(3===e.datum_type&&(o=6378137,s=6356752.314,a=.0066943799901413165),i===a&&r===o&&!xc(t.datum_type)&&!xc(e.datum_type))return n;if((n=bc(n,i,r),xc(t.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6];return{x:c*(t.x-l*t.y+a*t.z)+r,y:c*(l*t.x+t.y-s*t.z)+i,z:c*(-a*t.x+s*t.y+t.z)+o}}}(n,t.datum_type,t.datum_params)),xc(e.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6],u=(t.x-r)/c,h=(t.y-i)/c,f=(t.z-o)/c;return{x:u+l*h-a*f,y:-l*u+h+s*f,z:a*u-s*h+f}}}(n,e.datum_type,e.datum_params)),n=_c(n,a,o,s),3===e.datum_type)&&0!==Mc(e,!0,n))return;return n};function Mc(t,e,n){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var r={x:-n.x,y:n.y},i={x:Number.NaN,y:Number.NaN},o=[],s=0;sr.y||u>r.x||d1e-12&&Math.abs(s.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=Kl(o.x+n.ll[0]),r.y=o.y+n.ll[1]}else isNaN(o.x)||(r.x=t.x+o.x,r.y=t.y+o.y);return r}function Ec(t,e){var n,r={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(r.x),o=Math.floor(r.y),s=r.x-1*i,a=r.y-1*o,l={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return l;if(o<0||o>=e.lim[1])return l;n=o*e.lim[0]+i;var c=e.cvs[n][0],u=e.cvs[n][1];n++;var h=e.cvs[n][0],f=e.cvs[n][1];n+=e.lim[0];var d=e.cvs[n][0],p=e.cvs[n][1];n--;var m=e.cvs[n][0],g=e.cvs[n][1],v=s*a,y=s*(1-a),b=(1-s)*(1-a),_=(1-s)*a;return l.x=b*c+y*h+_*m+v*d,l.y=b*u+y*f+_*g+v*p,l}var Tc=function(t,e,n){var r,i,o,s=n.x,a=n.y,l=n.z||0,c={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(r=s,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(r=a,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(r=l,i="z"),t.axis[o]){case"e":c[i]=r;break;case"w":c[i]=-r;break;case"n":c[i]=r;break;case"s":c[i]=-r;break;case"u":void 0!==n[i]&&(c.z=r);break;case"d":void 0!==n[i]&&(c.z=-r);break;default:return null}return c},Cc=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e};function Ac(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Pc(t,e,n){var r;if(Array.isArray(n)&&(n=Cc(n)),function(t){Ac(t.x),Ac(t.y)}(n),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(n=Pc(t,r=new yc("WGS84"),n),t=r),"enu"!==t.axis&&(n=Tc(t,!1,n)),"longlat"===t.projName)n={x:n.x*wl,y:n.y*wl,z:n.z||0};else if(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter,z:n.z||0}),!(n=t.inverse(n)))return;if(t.from_greenwich&&(n.x+=t.from_greenwich),n=wc(t.datum,e.datum,n))return e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),"longlat"===e.projName?n={x:n.x*Ml,y:n.y*Ml,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),"enu"!==e.axis?Tc(e,!0,n):n}var Lc=yc("WGS84");function Rc(t,e,n){var r,i,o;return Array.isArray(n)?(r=Pc(t,e,n)||{x:NaN,y:NaN},n.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(n.splice(3)):[r.x,r.y,n[2]].concat(n.splice(3)):[r.x,r.y].concat(n.splice(2)):[r.x,r.y]):(i=Pc(t,e,n),2===(o=Object.keys(n)).length||o.forEach((function(r){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;i[r]=n[r]})),i)}function Oc(t){return t instanceof yc?t:t.oProj?t.oProj:yc(t)}var kc=function(t,e,n){t=Oc(t);var r,i=!1;return void 0===e?(e=t,t=Lc,i=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=Lc,i=!0),e=Oc(e),n?Rc(t,e,n):(r={forward:function(n){return Rc(t,e,n)},inverse:function(n){return Rc(e,t,n)}},i&&(r.oProj=e),r)},Ic=73,Dc=79,Nc={forward:jc,inverse:function(t){var e=Uc(Wc(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:Fc};function jc(t,e){return e=e||5,function(t,e){var n="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(d=t.easting,p=t.northing,m=t.zoneNumber,g=Gc(m),v=Math.floor(d/1e5),y=Math.floor(p/1e5)%20,i=v,o=y,s=g,a=s-1,l="AJSAJS".charCodeAt(a),c="AFAFAF".charCodeAt(a),u=l+i-1,h=c+o,f=!1,u>90&&(u=u-90+65-1,f=!0),(u===Ic||lIc||(u>Ic||lDc||(u>Dc||l90&&(u=u-90+65-1),h>86?(h=h-86+65-1,f=!0):f=!1,(h===Ic||cIc||(h>Ic||cDc||(h>Dc||c86&&(h=h-86+65-1),String.fromCharCode(u)+String.fromCharCode(h))+n.substr(n.length-5,e)+r.substr(r.length-5,e);var i,o,s,a,l,c,u,h,f;var d,p,m,g,v,y}(function(t){var e,n,r,i,o,s,a,l=t.lat,c=t.lon,u=6378137,h=Bc(l),f=Bc(c);a=Math.floor((c+180)/6)+1,180===c&&(a=60);l>=56&&l<64&&c>=3&&c<12&&(a=32);l>=72&&l<84&&(c>=0&&c<9?a=31:c>=9&&c<21?a=33:c>=21&&c<33?a=35:c>=33&&c<42&&(a=37));s=Bc(6*(a-1)-180+3),.006739496752268451,e=u/Math.sqrt(1-.00669438*Math.sin(h)*Math.sin(h)),n=Math.tan(h)*Math.tan(h),r=.006739496752268451*Math.cos(h)*Math.cos(h),i=Math.cos(h)*(f-s),o=u*(.9983242984503243*h-.002514607064228144*Math.sin(2*h)+2639046602129982e-21*Math.sin(4*h)-3.418046101696858e-9*Math.sin(6*h));var d=.9996*e*(i+(1-n+r)*i*i*i/6+(5-18*n+n*n+72*r-.39089081163157013)*i*i*i*i*i/120)+5e5,p=.9996*(o+e*Math.tan(h)*(i*i/2+(5-n+9*r+4*r*r)*i*i*i*i/24+(61-58*n+n*n+600*r-2.2240339282485886)*i*i*i*i*i*i/720));l<0&&(p+=1e7);return{northing:Math.round(p),easting:Math.round(d),zoneNumber:a,zoneLetter:Hc(l)}}({lat:t[1],lon:t[0]}),e)}function Fc(t){var e=Uc(Wc(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Bc(t){return t*(Math.PI/180)}function zc(t){return t/Math.PI*180}function Uc(t){var e=t.northing,n=t.easting,r=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,s,a,l,c,u,h,f,d=6378137,p=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=n-5e5,g=e;r<"N"&&(g-=1e7),u=6*(i-1)-180+3,f=(h=g/.9996/6367449.145945056)+(3*p/2-27*p*p*p/32)*Math.sin(2*h)+(21*p*p/16-55*p*p*p*p/32)*Math.sin(4*h)+151*p*p*p/96*Math.sin(6*h),o=d/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),s=Math.tan(f)*Math.tan(f),a=.006739496752268451*Math.cos(f)*Math.cos(f),l=.99330562*d/Math.pow(1-.00669438*Math.sin(f)*Math.sin(f),1.5),c=m/(.9996*o);var v=f-o*Math.tan(f)/l*(c*c/2-(5+3*s+10*a-4*a*a-.06065547077041606)*c*c*c*c/24+(61+90*s+298*a+45*s*s-1.6983531815716497-3*a*a)*c*c*c*c*c*c/720);v=zc(v);var y,b=(c-(1+2*s+a)*c*c*c/6+(5-2*a+28*s-3*a*a+.05391597401814761+24*s*s)*c*c*c*c*c/120)/Math.cos(f);if(b=u+zc(b),t.accuracy){var _=Uc({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});y={top:_.lat,right:_.lon,bottom:v,left:b}}else y={lat:v,lon:b};return y}function Hc(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function Gc(t){var e=t%6;return 0===e&&(e=6),e}function Wc(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,n=t.length,r=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var s=parseInt(i,10);if(0===o||o+3>n)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(o++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;r=t.substring(o,o+=2);for(var l=Gc(s),c=function(t,e){var n="AJSAJS".charCodeAt(e-1),r=1e5,i=!1;for(;n!==t.charCodeAt(0);){if(++n===Ic&&n++,n===Dc&&n++,n>90){if(i)throw"Bad character: "+t;n=65,i=!0}r+=1e5}return r}(r.charAt(0),l),u=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var n="AFAFAF".charCodeAt(e-1),r=0,i=!1;for(;n!==t.charCodeAt(0);){if(++n===Ic&&n++,n===Dc&&n++,n>86){if(i)throw"Bad character: "+t;n=65,i=!0}r+=1e5}return r}(r.charAt(1),l);u0&&(f=1e5/Math.pow(10,m),d=t.substring(o,o+m),g=parseFloat(d)*f,p=t.substring(o+m),v=parseFloat(p)*f),{easting:g+c,northing:v+u,zoneLetter:a,zoneNumber:s,accuracy:f}}function Vc(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function qc(t,e,n){if(!(this instanceof qc))return new qc(t,e,n);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var r=t.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=t,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}qc.fromMGRS=function(t){return new qc(Fc(t))},qc.prototype.toMGRS=function(t){return jc([this.x,this.y],t)};var Xc=qc,Yc=.01068115234375,Zc=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*Yc))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*Yc)));var n=t*t;return e[2]=n*(.46875-t*(.013020833333333334+.007120768229166667*t)),n*=t,e[3]=n*(.3645833333333333-.005696614583333333*t),e[4]=n*t*.3076171875,e},Jc=function(t,e,n,r){return n*=e,e*=e,r[0]*t-n*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))},Kc=function(t,e,n){for(var r=1/(1-e),i=t,o=20;o;--o){var s=Math.sin(i),a=1-e*s*s;if(i-=a=(Jc(i,s,Math.cos(i),n)-t)*(a*Math.sqrt(a))*r,Math.abs(a)<1e-10)return i}return i};var Qc={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Zc(this.es),this.ml0=Jc(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,n,r,i=t.x,o=t.y,s=Kl(i-this.long0),a=Math.sin(o),l=Math.cos(o);if(this.es){var c=l*s,u=Math.pow(c,2),h=this.ep2*Math.pow(l,2),f=Math.pow(h,2),d=Math.abs(l)>1e-10?Math.tan(o):0,p=Math.pow(d,2),m=Math.pow(p,2);e=1-this.es*Math.pow(a,2),c/=Math.sqrt(e);var g=Jc(o,a,l,this.en);n=this.a*(this.k0*c*(1+u/6*(1-p+h+u/20*(5-18*p+m+14*h-58*p*h+u/42*(61+179*m-m*p-479*p)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+a*s*c/2*(1+u/12*(5-p+9*h+4*f+u/30*(61+m-58*p+270*h-330*p*h+u/56*(1385+543*m-m*p-3111*p))))))+this.y0}else{var v=l*Math.sin(s);if(Math.abs(Math.abs(v)-1)<1e-10)return 93;if(n=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=l*Math.cos(s)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>1e-10)return 93;r=0}else r=Math.acos(r);o<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return t.x=n,t.y=r,t},inverse:function(t){var e,n,r,i,o=(t.x-this.x0)*(1/this.a),s=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+s/this.k0,n=Kc(e,this.es,this.en),Math.abs(n)1e-10?Math.tan(n):0,u=this.ep2*Math.pow(l,2),h=Math.pow(u,2),f=Math.pow(c,2),d=Math.pow(f,2);e=1-this.es*Math.pow(a,2);var p=o*Math.sqrt(e)/this.k0,m=Math.pow(p,2);r=n-(e*=c)*m/(1-this.es)*.5*(1-m/12*(5+3*f-9*u*f+u-4*h-m/30*(61+90*f-252*u*f+45*d+46*u-m/56*(1385+3633*f+4095*d+1574*d*f)))),i=Kl(this.long0+p*(1-m/6*(1+2*f+u-m/20*(5+28*f+24*d+8*u*f+6*u-m/42*(61+662*f+1320*d+720*d*f))))/l)}else r=xl*Jl(s),i=0;else{var g=Math.exp(o/this.k0),v=.5*(g-1/g),y=this.lat0+s/this.k0,b=Math.cos(y);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(v,2))),r=Math.asin(e),s<0&&(r=-r),i=0===v&&0===b?0:Kl(Math.atan2(v,b)+this.long0)}return t.x=i,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},$c=function(t){var e=Math.exp(t);return e=(e-1/e)/2},tu=function(t,e){t=Math.abs(t),e=Math.abs(e);var n=Math.max(t,e),r=Math.min(t,e)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))},eu=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n}(e*(1+e/(tu(1,e)+1))),t<0?-e:e},nu=function(t,e){for(var n,r=2*Math.cos(2*e),i=t.length-1,o=t[i],s=0;--i>=0;)n=r*o-s+t[i],s=o,o=n;return e+n*Math.sin(2*e)},ru=function(t,e,n){for(var r,i,o=Math.sin(e),s=Math.cos(e),a=$c(n),l=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(n),c=2*s*l,u=-2*o*a,h=t.length-1,f=t[h],d=0,p=0,m=0;--h>=0;)r=p,i=d,f=c*(p=f)-r-u*(d=m)+t[h],m=u*p-i+c*d;return[(c=o*l)*f-(u=s*a)*m,c*m+u*f]};var iu={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Qc.init.apply(this),this.forward=Qc.forward,this.inverse=Qc.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),n=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var r=nu(this.cbg,this.lat0);this.Zb=-this.Qn*(r+function(t,e){for(var n,r=2*Math.cos(e),i=t.length-1,o=t[i],s=0;--i>=0;)n=r*o-s+t[i],s=o,o=n;return Math.sin(e)*n}(this.gtu,2*r))},forward:function(t){var e=Kl(t.x-this.long0),n=t.y;n=nu(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),o=Math.sin(e),s=Math.cos(e);n=Math.atan2(r,s*i),e=Math.atan2(o*i,tu(r,i*s)),e=eu(Math.tan(e));var a,l,c=ru(this.gtu,2*n,2*e);return n+=c[0],e+=c[1],Math.abs(e)<=2.623395162778?(a=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(a=1/0,l=1/0),t.x=a,t.y=l,t},inverse:function(t){var e,n,r=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var o=ru(this.utg,2*i,2*r);i+=o[0],r+=o[1],r=Math.atan($c(r));var s=Math.sin(i),a=Math.cos(i),l=Math.sin(r),c=Math.cos(r);i=Math.atan2(s*c,tu(l,c*a)),r=Math.atan2(l,c*a),e=Kl(r+this.long0),n=nu(this.cgb,i)}else e=1/0,n=1/0;return t.x=e,t.y=n,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]};var ou={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(Kl(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*wl,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,iu.init.apply(this),this.forward=iu.forward,this.inverse=iu.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},su=function(t,e){return Math.pow((1-t)/(1+t),e)};var au={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Sl)/(Math.pow(Math.tan(.5*this.lat0+Sl),this.C)*su(this.e*t,this.ratexp))},forward:function(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+Sl),this.C)*su(this.e*Math.sin(n),this.ratexp))-xl,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,n=t.y,r=Math.pow(Math.tan(.5*n+Sl)/this.K,1/this.C),i=20;i>0&&(n=2*Math.atan(r*su(this.e*Math.sin(t.y),-.5*this.e))-xl,!(Math.abs(n-t.y)<1e-14));--i)t.y=n;return i?(t.x=e,t.y=n,t):null},names:["gauss"]};var lu={init:function(){au.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,n,r,i;return t.x=Kl(t.x-this.long0),au.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),r=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*r),t.x=i*n*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*n*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,n,r,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=Math.sqrt(t.x*t.x+t.y*t.y)){var s=2*Math.atan2(o,this.R2);e=Math.sin(s),n=Math.cos(s),i=Math.asin(n*this.sinc0+t.y*e*this.cosc0/o),r=Math.atan2(t.x*e,o*this.cosc0*n-t.y*this.sinc0*e)}else i=this.phic0,r=0;return t.x=r,t.y=i,au.inverse.apply(this,[t]),t.x=Kl(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var cu={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+Jl(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*this.cons*Zl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ql(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Zl(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-xl,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,n,r,i,o,s,a=t.x,l=t.y,c=Math.sin(l),u=Math.cos(l),h=Kl(a-this.long0);return Math.abs(Math.abs(a-this.long0)-Math.PI)<=1e-10&&Math.abs(l+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*c+this.coslat0*u*Math.cos(h)),t.x=this.a*e*u*Math.sin(h)+this.x0,t.y=this.a*e*(this.coslat0*c-this.sinlat0*u*Math.cos(h))+this.y0,t):(n=2*Math.atan(this.ssfn_(l,c,this.e))-xl,i=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=1e-10?(o=Ql(this.e,l*this.con,this.con*c),s=2*this.a*this.k0*o/this.cons,t.x=this.x0+s*Math.sin(a-this.long0),t.y=this.y0-this.con*s*Math.cos(a-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(e=2*this.a*this.k0/(1+i*Math.cos(h)),t.y=e*r):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*i*Math.cos(h))),t.y=e*(this.cosX0*r-this.sinX0*i*Math.cos(h))+this.y0),t.x=e*i*Math.sin(h)+this.x0,t))},inverse:function(t){var e,n,r,i,o;t.x-=this.x0,t.y-=this.y0;var s=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var a=2*Math.atan(s/(2*this.a*this.k0));return e=this.long0,n=this.lat0,s<=1e-10?(t.x=e,t.y=n,t):(n=Math.asin(Math.cos(a)*this.sinlat0+t.y*Math.sin(a)*this.coslat0/s),e=Math.abs(this.coslat0)<1e-10?this.lat0>0?Kl(this.long0+Math.atan2(t.x,-1*t.y)):Kl(this.long0+Math.atan2(t.x,t.y)):Kl(this.long0+Math.atan2(t.x*Math.sin(a),s*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=1e-10){if(s<=1e-10)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,r=s*this.cons/(2*this.a*this.k0),n=this.con*$l(this.e,r),e=this.con*Kl(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(s*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,s<=1e-10?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/s),e=Kl(this.long0+Math.atan2(t.x*Math.sin(i),s*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),n=-1*$l(this.e,Math.tan(.5*(xl+o)));return t.x=e,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,n){return e*=n,Math.tan(.5*(xl+t))*Math.pow((1-e)/(1+e),.5*n)}};var uu={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),n=this.a,r=1/this.rf,i=2*r-Math.pow(r,2),o=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var s=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+o*e)/(1-o*e));this.K=s-this.alpha*a+this.alpha*o/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),s=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),a=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*s+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,n=t.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),s=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+s/this.alpha,l=0,c=o,u=-1e3,h=0;Math.abs(c-u)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),u=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=c,t},names:["somerc"]};var hu={init:function(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),e=Math.cos(this.lat0),n=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(e,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-n*n);var r,i,o=Ql(this.e,this.lat0,t),s=this.bl/e*Math.sqrt((1-this.es)/(1-n*n));if(s*s<1&&(s=1),isNaN(this.longc)){var a=Ql(this.e,this.lat1,Math.sin(this.lat1)),l=Ql(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(s+Math.sqrt(s*s-1))*Math.pow(o,this.bl):this.el=(s-Math.sqrt(s*s-1))*Math.pow(o,this.bl);var c=Math.pow(a,this.bl),u=Math.pow(l,this.bl);i=.5*((r=this.el/c)-1/r);var h=(this.el*this.el-u*c)/(this.el*this.el+u*c),f=(u-c)/(u+c),d=Kl(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(h*Math.tan(.5*this.bl*d)/f)/this.bl,this.long0=Kl(this.long0);var p=Kl(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*p)/i),this.alpha=Math.asin(s*Math.sin(this.gamma0))}else r=this.lat0>=0?s+Math.sqrt(s*s-1):s-Math.sqrt(s*s-1),this.el=r*Math.pow(o,this.bl),i=.5*(r-1/r),this.gamma0=Math.asin(Math.sin(this.alpha)/s),this.long0=this.longc-Math.asin(i*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(s*s-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(s*s-1),Math.cos(this.alpha))},forward:function(t){var e,n,r,i=t.x,o=t.y,s=Kl(i-this.long0);if(Math.abs(Math.abs(o)-xl)<=1e-10)r=o>0?-1:1,n=this.al/this.bl*Math.log(Math.tan(Sl+r*this.gamma0*.5)),e=-1*r*xl*this.al/this.bl;else{var a=Ql(this.e,o,Math.sin(o)),l=this.el/Math.pow(a,this.bl),c=.5*(l-1/l),u=.5*(l+1/l),h=Math.sin(this.bl*s),f=(c*Math.sin(this.gamma0)-h*Math.cos(this.gamma0))/u;n=Math.abs(Math.abs(f)-1)<=1e-10?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-f)/(1+f))/this.bl,e=Math.abs(Math.cos(this.bl*s))<=1e-10?this.al*this.bl*s:this.al*Math.atan2(c*Math.cos(this.gamma0)+h*Math.sin(this.gamma0),Math.cos(this.bl*s))/this.bl}return this.no_rot?(t.x=this.x0+e,t.y=this.y0+n):(e-=this.uc,t.x=this.x0+n*Math.cos(this.alpha)+e*Math.sin(this.alpha),t.y=this.y0+e*Math.cos(this.alpha)-n*Math.sin(this.alpha)),t},inverse:function(t){var e,n;this.no_rot?(n=t.y-this.y0,e=t.x-this.x0):(n=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),e=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),e+=this.uc);var r=Math.exp(-1*this.bl*n/this.al),i=.5*(r-1/r),o=.5*(r+1/r),s=Math.sin(this.bl*e/this.al),a=(s*Math.cos(this.gamma0)+i*Math.sin(this.gamma0))/o,l=Math.pow(this.el/Math.sqrt((1+a)/(1-a)),1/this.bl);return Math.abs(a-1)<1e-10?(t.x=this.long0,t.y=xl):Math.abs(a+1)<1e-10?(t.x=this.long0,t.y=-1*xl):(t.y=$l(this.e,l),t.x=Kl(this.long0-Math.atan2(i*Math.cos(this.gamma0)-s*Math.sin(this.gamma0),Math.cos(this.bl*e/this.al))/this.bl)),t},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"]};var fu={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),n=Math.cos(this.lat1),r=Zl(this.e,e,n),i=Ql(this.e,this.lat1,e),o=Math.sin(this.lat2),s=Math.cos(this.lat2),a=Zl(this.e,o,s),l=Ql(this.e,this.lat2,o),c=Ql(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(r/a)/Math.log(i/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=Jl(n)*(xl-2e-10));var r,i,o=Math.abs(Math.abs(n)-xl);if(o>1e-10)r=Ql(this.e,n,Math.sin(n)),i=this.a*this.f0*Math.pow(r,this.ns);else{if((o=n*this.ns)<=0)return null;i=0}var s=this.ns*Kl(e-this.long0);return t.x=this.k0*(i*Math.sin(s))+this.x0,t.y=this.k0*(this.rh-i*Math.cos(s))+this.y0,t},inverse:function(t){var e,n,r,i,o,s=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+a*a),n=1):(e=-Math.sqrt(s*s+a*a),n=-1);var l=0;if(0!==e&&(l=Math.atan2(n*s,n*a)),0!==e||this.ns>0){if(n=1/this.ns,r=Math.pow(e/(this.a*this.f0),n),-9999===(i=$l(this.e,r)))return null}else i=-xl;return o=Kl(l/this.ns+this.long0),t.x=o,t.y=i,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]};var du={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,n,r,i,o,s,a,l=t.x,c=t.y,u=Kl(l-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),r=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),s=this.n*o,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=a*Math.cos(s)/1,t.x=a*Math.sin(s)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,n,r,i,o,s,a,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),t.x=this.long0-n/this.alfa,s=e,a=0;var c=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)),this.e/2))-this.s45),Math.abs(s-t.y)<1e-10&&(a=1),s=t.y,c+=1}while(0===a&&c<15);return c>=15?null:t},names:["Krovak","krovak"]},pu=function(t,e,n,r,i){return t*i-e*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)},mu=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},gu=function(t){return.375*t*(1+.25*t*(1+.46875*t))},vu=function(t){return.05859375*t*t*(1+.75*t)},yu=function(t){return t*t*t*(35/3072)},bu=function(t,e,n){var r=e*n;return t/Math.sqrt(1-r*r)},_u=function(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(n=t*e)*n)-.5/t*Math.log((1-n)/(1+n))):2*e};var Su={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-xl)<1e-10?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<1e-10?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Mu(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,n=[];return n[0]=.3333333333333333*t,e=t*t,n[0]+=.17222222222222222*e,n[1]=.06388888888888888*e,e*=t,n[0]+=.10257936507936508*e,n[1]+=.0664021164021164*e,n[2]=.016415012942191543*e,n}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Mu(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,n,r,i,o,s,a,l,c,u,h=t.x,f=t.y;if(h=Kl(h-this.long0),this.sphere){if(o=Math.sin(f),u=Math.cos(f),r=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+u*r:1+this.sinph0*o+this.cosph0*u*r)<=1e-10)return null;e=(n=Math.sqrt(2/n))*u*Math.sin(h),n*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*u*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.lat0)<1e-10)return null;n=Sl-.5*f,e=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(h),n*=r}}else{switch(a=0,l=0,c=0,r=Math.cos(h),i=Math.sin(h),o=Math.sin(f),s=Mu(this.e,o),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(a=s/this.qp,l=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:c=1+this.sinb1*a+this.cosb1*l*r;break;case this.EQUIT:c=1+l*r;break;case this.N_POLE:c=xl+f,s=this.qp-s;break;case this.S_POLE:c=f-xl,s=this.qp+s}if(Math.abs(c)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),n=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*a-this.sinb1*l*r):(c=Math.sqrt(2/(1+l*r)))*a*this.ymf,e=this.xmf*c*l*i;break;case this.N_POLE:case this.S_POLE:s>=0?(e=(c=Math.sqrt(s))*i,n=r*(this.mode===this.S_POLE?c:-c)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,r,i,o,s,a,l,c,u,h=t.x/this.a,f=t.y/this.a;if(this.sphere){var d,p=0,m=0;if((n=.5*(d=Math.sqrt(h*h+f*f)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(n),p=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(d)<=1e-10?0:Math.asin(f*m/d),h*=m,f=p*d;break;case this.OBLIQ:n=Math.abs(d)<=1e-10?this.lat0:Math.asin(p*this.sinph0+f*m*this.cosph0/d),h*=m*this.cosph0,f=(p-Math.sin(n)*this.sinph0)*d;break;case this.N_POLE:f=-f,n=xl-n;break;case this.S_POLE:n-=xl}e=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(h,f):0}else{if(a=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(h/=this.dd,f*=this.dd,(s=Math.sqrt(h*h+f*f))<1e-10)return t.x=this.long0,t.y=this.lat0,t;i=2*Math.asin(.5*s/this.rq),r=Math.cos(i),h*=i=Math.sin(i),this.mode===this.OBLIQ?(a=r*this.sinb1+f*i*this.cosb1/s,o=this.qp*a,f=s*this.cosb1*r-f*this.sinb1*i):(a=f*i/s,o=this.qp*a,f=s*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(f=-f),!(o=h*h+f*f))return t.x=this.long0,t.y=this.lat0,t;a=1-o/this.qp,this.mode===this.S_POLE&&(a=-a)}e=Math.atan2(h,f),l=Math.asin(a),c=this.apa,u=l+l,n=l+c[0]*Math.sin(u)+c[1]*Math.sin(u+u)+c[2]*Math.sin(u+u+u)}return t.x=Kl(this.long0+e),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Eu=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)};var Tu={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Zl(this.e3,this.sin_po,this.cos_po),this.qs1=Mu(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Zl(this.e3,this.sin_po,this.cos_po),this.qs2=Mu(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Mu(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=Mu(this.e3,this.sin_phi,this.cos_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,o=this.ns0*Kl(e-this.long0),s=i*Math.sin(o)+this.x0,a=this.rh-i*Math.cos(o)+this.y0;return t.x=s,t.y=a,t},inverse:function(t){var e,n,r,i,o,s;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),i=0,0!==e&&(i=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?s=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,s=this.phi1z(this.e3,n)),o=Kl(i/this.ns0+this.long0),t.x=o,t.y=s,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var n,r,i,o,s=Eu(.5*e);if(t<1e-10)return s;for(var a=t*t,l=1;l<=25;l++)if(s+=o=.5*(i=1-(r=t*(n=Math.sin(s)))*r)*i/Math.cos(s)*(e/(1-a)-n/i+.5/t*Math.log((1-r)/(1+r))),Math.abs(o)<=1e-7)return s;return null}};var Cu={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,n,r,i,o,s,a,l=t.x,c=t.y;return r=Kl(l-this.long0),e=Math.sin(c),n=Math.cos(c),i=Math.cos(r),1,(o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=1e-10?(s=this.x0+1*this.a*n*Math.sin(r)/o,a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)/o):(s=this.x0+this.infinity_dist*n*Math.sin(r),a=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*i)),t.x=s,t.y=a,t},inverse:function(t){var e,n,r,i,o,s;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),n=Math.sin(i),r=Math.cos(i),s=Eu(r*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.atan2(t.x*n,e*this.cos_p14*r-t.y*this.sin_p14*n),o=Kl(this.long0+o)):(s=this.phic0,o=0),t.x=o,t.y=s,t},names:["gnom"]};var Au={init:function(){this.sphere||(this.k0=Zl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,n,r=t.x,i=t.y,o=Kl(r-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var s=Mu(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,n=this.y0+this.a*s*.5/this.k0}return t.x=e,t.y=n,t},inverse:function(t){var e,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=Kl(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*xl:xl;for(var r,i,o,s,a=Math.asin(.5*e),l=0;l<30;l++)if(i=Math.sin(a),o=Math.cos(a),s=t*i,a+=r=Math.pow(1-s*s,2)/(2*o)*(e/(1-t*t)-i/(1-s*s)+.5/t*Math.log((1-s)/(1+s))),Math.abs(r)<=1e-10)return a;return NaN}(this.e,2*t.y*this.k0/this.a),e=Kl(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t},names:["cea"]};var Pu={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,n=t.y,r=Kl(e-this.long0),i=_u(n-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,n=t.y;return t.x=Kl(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=_u(this.lat0+(n-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var Lu={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=mu(this.es),this.e1=gu(this.es),this.e2=vu(this.es),this.e3=yu(this.es),this.ml0=this.a*pu(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,n,r,i=t.x,o=t.y,s=Kl(i-this.long0);if(r=s*Math.sin(o),this.sphere)Math.abs(o)<=1e-10?(e=this.a*s,n=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(o),n=this.a*(_u(o-this.lat0)+(1-Math.cos(r))/Math.tan(o)));else if(Math.abs(o)<=1e-10)e=this.a*s,n=-1*this.ml0;else{var a=bu(this.a,this.e,Math.sin(o))/Math.tan(o);e=a*Math.sin(r),n=this.a*pu(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+a*(1-Math.cos(r))}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){var e,n,r,i,o,s,a,l,c;if(r=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=1e-10)e=Kl(r/this.a+this.long0),n=0;else{var u;for(s=this.lat0+i/this.a,a=r*r/this.a/this.a+s*s,l=s,o=20;o;--o)if(l+=c=-1*(s*(l*(u=Math.tan(l))+1)-l-.5*(l*l+a)*u)/((l-s)/u-1),Math.abs(c)<=1e-10){n=l;break}e=Kl(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(n))}else if(Math.abs(i+this.ml0)<=1e-10)n=0,e=Kl(this.long0+r/this.a);else{var h,f,d,p,m;for(s=(this.ml0+i)/this.a,a=r*r/this.a/this.a+s*s,l=s,o=20;o;--o)if(m=this.e*Math.sin(l),h=Math.sqrt(1-m*m)*Math.tan(l),f=this.a*pu(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(s*(h*(p=f/this.a)+1)-p-.5*h*(p*p+a))/(this.es*Math.sin(2*l)*(p*p+a-2*s*p)/(4*h)+(s-p)*(h*d-2/Math.sin(2*l))-d),Math.abs(c)<=1e-10){n=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=Kl(this.long0+Math.asin(r*h/this.a)/Math.sin(n))}return t.x=e,t.y=n,t},names:["Polyconic","poly"]};var Ru={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,n=t.x,r=t.y-this.lat0,i=n-this.long0,o=r/_l*1e-5,s=i,a=1,l=0;for(e=1;e<=10;e++)a*=o,l+=this.A[e]*a;var c,u=l,h=s,f=1,d=0,p=0,m=0;for(e=1;e<=6;e++)c=d*u+f*h,f=f*u-d*h,d=c,p=p+this.B_re[e]*f-this.B_im[e]*d,m=m+this.B_im[e]*f+this.B_re[e]*d;return t.x=m*this.a+this.x0,t.y=p*this.a+this.y0,t},inverse:function(t){var e,n,r=t.x,i=t.y,o=r-this.x0,s=(i-this.y0)/this.a,a=o/this.a,l=1,c=0,u=0,h=0;for(e=1;e<=6;e++)n=c*s+l*a,l=l*s-c*a,c=n,u=u+this.C_re[e]*l-this.C_im[e]*c,h=h+this.C_im[e]*l+this.C_re[e]*c;for(var f=0;f.999999999999&&(n=.999999999999),e=Math.asin(n);var r=Kl(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return t.x=r,t.y=i,t},names:["Mollweide","moll"]};var Du={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=mu(this.es),this.e1=gu(this.es),this.e2=vu(this.es),this.e3=yu(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Zl(this.e,this.sinphi,this.cosphi),this.ml1=pu(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Zl(this.e,this.sinphi,this.cosphi),this.ml2=pu(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=pu(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,n=t.x,r=t.y;if(this.sphere)e=this.a*(this.g-r);else{var i=pu(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-i)}var o=this.ns*Kl(n-this.long0),s=this.x0+e*Math.sin(o),a=this.y0+this.rh-e*Math.cos(o);return t.x=s,t.y=a,t},inverse:function(t){var e,n,r,i;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;if(0!==n&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere)return i=Kl(this.long0+o/this.ns),r=_u(this.g-n/this.a),t.x=i,t.y=r,t;var s=this.g-n/this.a;return r=xu(s,this.e0,this.e1,this.e2,this.e3),i=Kl(this.long0+o/this.ns),t.x=i,t.y=r,t},names:["Equidistant_Conic","eqdc"]};var Nu={init:function(){this.R=this.a},forward:function(t){var e,n,r=t.x,i=t.y,o=Kl(r-this.long0);Math.abs(i)<=1e-10&&(e=this.x0+this.R*o,n=this.y0);var s=Eu(2*Math.abs(i/Math.PI));(Math.abs(o)<=1e-10||Math.abs(Math.abs(i)-xl)<=1e-10)&&(e=this.x0,n=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*s):this.y0+Math.PI*this.R*-Math.tan(.5*s));var a=.5*Math.abs(Math.PI/o-o/Math.PI),l=a*a,c=Math.sin(s),u=Math.cos(s),h=u/(c+u-1),f=h*h,d=h*(2/c-1),p=d*d,m=Math.PI*this.R*(a*(h-p)+Math.sqrt(l*(h-p)*(h-p)-(p+l)*(f-p)))/(p+l);o<0&&(m=-m),e=this.x0+m;var g=l+h;return m=Math.PI*this.R*(d*g-a*Math.sqrt((p+l)*(l+1)-g*g))/(p+l),n=i>=0?this.y0+m:this.y0-m,t.x=e,t.y=n,t},inverse:function(t){var e,n,r,i,o,s,a,l,c,u,h,f;return t.x-=this.x0,t.y-=this.y0,h=Math.PI*this.R,o=(r=t.x/h)*r+(i=t.y/h)*i,h=3*(i*i/(l=-2*(s=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(a=s-2*i*i+r*r)*a*a/l/l/l-9*s*a/l/l)/27)/(c=(s-a*a/3/l)/l)/(u=2*Math.sqrt(-c/3)),Math.abs(h)>1&&(h=h>=0?1:-1),f=Math.acos(h)/3,n=t.y>=0?(-u*Math.cos(f+Math.PI/3)-a/3/l)*Math.PI:-(-u*Math.cos(f+Math.PI/3)-a/3/l)*Math.PI,e=Math.abs(r)<1e-10?this.long0:Kl(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(r*r-i*i)+o*o))/2/r),t.x=e,t.y=n,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var ju={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,n,r,i,o,s,a,l,c,u,h,f,d,p,m,g,v,y,b,_,x,w,M=t.x,S=t.y,E=Math.sin(t.y),T=Math.cos(t.y),C=Kl(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(xl-S)*Math.sin(C),t.y=this.y0-this.a*(xl-S)*Math.cos(C),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(xl+S)*Math.sin(C),t.y=this.y0+this.a*(xl+S)*Math.cos(C),t):(y=this.sin_p12*E+this.cos_p12*T*Math.cos(C),v=(g=Math.acos(y))?g/Math.sin(g):1,t.x=this.x0+this.a*v*T*Math.sin(C),t.y=this.y0+this.a*v*(this.cos_p12*E-this.sin_p12*T*Math.cos(C)),t):(e=mu(this.es),n=gu(this.es),r=vu(this.es),i=yu(this.es),Math.abs(this.sin_p12-1)<=1e-10?(o=this.a*pu(e,n,r,i,xl),s=this.a*pu(e,n,r,i,S),t.x=this.x0+(o-s)*Math.sin(C),t.y=this.y0-(o-s)*Math.cos(C),t):Math.abs(this.sin_p12+1)<=1e-10?(o=this.a*pu(e,n,r,i,xl),s=this.a*pu(e,n,r,i,S),t.x=this.x0+(o+s)*Math.sin(C),t.y=this.y0+(o+s)*Math.cos(C),t):(a=E/T,l=bu(this.a,this.e,this.sin_p12),c=bu(this.a,this.e,E),u=Math.atan((1-this.es)*a+this.es*l*this.sin_p12/(c*T)),b=0===(h=Math.atan2(Math.sin(C),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(C)))?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(h)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(C)*Math.cos(u)/Math.sin(h)),f=this.e*this.sin_p12/Math.sqrt(1-this.es),g=l*b*(1-(_=b*b)*(m=(d=this.e*this.cos_p12*Math.cos(h)/Math.sqrt(1-this.es))*d)*(1-m)/6+(x=_*b)/8*(p=f*d)*(1-2*m)+(w=x*b)/120*(m*(4-7*m)-3*f*f*(1-7*m))-w*b/48*p),t.x=this.x0+g*Math.sin(h),t.y=this.y0+g*Math.cos(h),t))},inverse:function(t){var e,n,r,i,o,s,a,l,c,u,h,f,d,p,m,g,v,y,b,_,x,w,M;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*xl*this.a)return;return n=e/this.a,r=Math.sin(n),i=Math.cos(n),o=this.long0,Math.abs(e)<=1e-10?s=this.lat0:(s=Eu(i*this.sin_p12+t.y*r*this.cos_p12/e),a=Math.abs(this.lat0)-xl,o=Math.abs(a)<=1e-10?this.lat0>=0?Kl(this.long0+Math.atan2(t.x,-t.y)):Kl(this.long0-Math.atan2(-t.x,t.y)):Kl(this.long0+Math.atan2(t.x*r,e*this.cos_p12*i-t.y*this.sin_p12*r))),t.x=o,t.y=s,t}return l=mu(this.es),c=gu(this.es),u=vu(this.es),h=yu(this.es),Math.abs(this.sin_p12-1)<=1e-10?(f=this.a*pu(l,c,u,h,xl),e=Math.sqrt(t.x*t.x+t.y*t.y),s=xu((f-e)/this.a,l,c,u,h),o=Kl(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=s,t):Math.abs(this.sin_p12+1)<=1e-10?(f=this.a*pu(l,c,u,h,xl),e=Math.sqrt(t.x*t.x+t.y*t.y),s=xu((e-f)/this.a,l,c,u,h),o=Kl(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=s,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),m=Math.atan2(t.x,t.y),d=bu(this.a,this.e,this.sin_p12),g=Math.cos(m),y=-(v=this.e*this.cos_p12*g)*v/(1-this.es),b=3*this.es*(1-y)*this.sin_p12*this.cos_p12*g/(1-this.es),w=1-y*(x=(_=e/d)-y*(1+y)*Math.pow(_,3)/6-b*(1+3*y)*Math.pow(_,4)/24)*x/2-_*x*x*x/6,p=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*g),o=Kl(this.long0+Math.asin(Math.sin(m)*Math.sin(x)/Math.cos(p))),M=Math.sin(p),s=Math.atan2((M-this.es*w*this.sin_p12)*Math.tan(p),M*(1-this.es)),t.x=o,t.y=s,t)},names:["Azimuthal_Equidistant","aeqd"]};var Fu={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,n,r,i,o,s,a,l=t.x,c=t.y;return r=Kl(l-this.long0),e=Math.sin(c),n=Math.cos(c),i=Math.cos(r),1,((o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=1e-10)&&(s=1*this.a*n*Math.sin(r),a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)),t.x=s,t.y=a,t},inverse:function(t){var e,n,r,i,o,s,a;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),n=Eu(e/this.a),r=Math.sin(n),i=Math.cos(n),s=this.long0,Math.abs(e)<=1e-10?(a=this.lat0,t.x=s,t.y=a,t):(a=Eu(i*this.sin_p14+t.y*r*this.cos_p14/e),o=Math.abs(this.lat0)-xl,Math.abs(o)<=1e-10?(s=this.lat0>=0?Kl(this.long0+Math.atan2(t.x,-t.y)):Kl(this.long0-Math.atan2(-t.x,t.y)),t.x=s,t.y=a,t):(s=Kl(this.long0+Math.atan2(t.x*r,e*this.cos_p14*i-t.y*this.sin_p14*r)),t.x=s,t.y=a,t))},names:["ortho"]},Bu=1,zu=2,Uu=3,Hu=4,Gu=5,Wu=6,Vu=1,qu=2,Xu=3,Yu=4;function Zu(t,e,n,r){var i;return t<1e-10?(r.value=Vu,i=0):(i=Math.atan2(e,n),Math.abs(i)<=Sl?r.value=Vu:i>Sl&&i<=xl+Sl?(r.value=qu,i-=xl):i>xl+Sl||i<=-(xl+Sl)?(r.value=Xu,i=i>=0?i-Tl:i+Tl):(r.value=Yu,i+=xl)),i}function Ju(t,e){var n=t+e;return n<-Tl?n+=El:n>+Tl&&(n-=El),n}var Ku={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=xl-Sl/2?this.face=Gu:this.lat0<=-(xl-Sl/2)?this.face=Wu:Math.abs(this.long0)<=Sl?this.face=Bu:Math.abs(this.long0)<=xl+Sl?this.face=this.long0>0?zu:Hu:this.face=Uu,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,n,r,i,o,s,a={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===Gu)i=xl-e,n>=Sl&&n<=xl+Sl?(l.value=Vu,r=n-xl):n>xl+Sl||n<=-(xl+Sl)?(l.value=qu,r=n>0?n-Tl:n+Tl):n>-(xl+Sl)&&n<=-Sl?(l.value=Xu,r=n+xl):(l.value=Yu,r=n);else if(this.face===Wu)i=xl+e,n>=Sl&&n<=xl+Sl?(l.value=Vu,r=-n+xl):n=-Sl?(l.value=qu,r=-n):n<-Sl&&n>=-(xl+Sl)?(l.value=Xu,r=-n-xl):(l.value=Yu,r=n>0?-n+Tl:-n-Tl);else{var c,u,h,f,d,p;this.face===zu?n=Ju(n,+xl):this.face===Uu?n=Ju(n,+Tl):this.face===Hu&&(n=Ju(n,-xl)),f=Math.sin(e),d=Math.cos(e),p=Math.sin(n),c=d*Math.cos(n),u=d*p,h=f,this.face===Bu?r=Zu(i=Math.acos(c),h,u,l):this.face===zu?r=Zu(i=Math.acos(u),h,-c,l):this.face===Uu?r=Zu(i=Math.acos(-c),h,-u,l):this.face===Hu?r=Zu(i=Math.acos(-u),h,c,l):(i=r=0,l.value=Vu)}return s=Math.atan(12/Tl*(r+Math.acos(Math.sin(r)*Math.cos(Sl))-xl)),o=Math.sqrt((1-Math.cos(i))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===qu?s+=xl:l.value===Xu?s+=Tl:l.value===Yu&&(s+=1.5*Tl),a.x=o*Math.cos(s),a.y=o*Math.sin(s),a.x=a.x*this.a+this.x0,a.y=a.y*this.a+this.y0,t.x=a.x,t.y=a.y,t},inverse:function(t){var e,n,r,i,o,s,a,l,c,u,h,f,d={lam:0,phi:0},p={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?p.value=Vu:t.y>=0&&t.y>=Math.abs(t.x)?(p.value=qu,e-=xl):t.x<0&&-t.x>=Math.abs(t.y)?(p.value=Xu,e=e<0?e+Tl:e-Tl):(p.value=Yu,e+=xl),c=Tl/12*Math.tan(e),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),s=Math.atan(o),(a=1-(r=Math.cos(e))*r*(i=Math.tan(n))*i*(1-Math.cos(Math.atan(1/Math.cos(s)))))<-1?a=-1:a>1&&(a=1),this.face===Gu)l=Math.acos(a),d.phi=xl-l,p.value===Vu?d.lam=s+xl:p.value===qu?d.lam=s<0?s+Tl:s-Tl:p.value===Xu?d.lam=s-xl:d.lam=s;else if(this.face===Wu)l=Math.acos(a),d.phi=l-xl,p.value===Vu?d.lam=-s+xl:p.value===qu?d.lam=-s:p.value===Xu?d.lam=-s-xl:d.lam=s<0?-s-Tl:-s+Tl;else{var m,g,v;c=(m=a)*m,g=(c+=(v=c>=1?0:Math.sqrt(1-c)*Math.sin(s))*v)>=1?0:Math.sqrt(1-c),p.value===qu?(c=g,g=-v,v=c):p.value===Xu?(g=-g,v=-v):p.value===Yu&&(c=g,g=v,v=-c),this.face===zu?(c=m,m=-g,g=c):this.face===Uu?(m=-m,g=-g):this.face===Hu&&(c=m,m=g,g=-c),d.phi=Math.acos(-v)-xl,d.lam=Math.atan2(g,m),this.face===zu?d.lam=Ju(d.lam,-xl):this.face===Uu?d.lam=Ju(d.lam,-Tl):this.face===Hu&&(d.lam=Ju(d.lam,+xl))}return 0!==this.es&&(u=d.phi<0?1:0,h=Math.tan(d.phi),f=this.b/Math.sqrt(h*h+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),u&&(d.phi=-d.phi)),d.lam+=this.long0,t.x=d.lam,t.y=d.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Qu=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],$u=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],th=Ml/5,eh=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};var nh={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=Kl(t.x-this.long0),n=Math.abs(t.y),r=Math.floor(n*th);r<0?r=0:r>=18&&(r=17);var i={x:eh(Qu[r],n=Ml*(n-.08726646259971647*r))*e,y:eh($u[r],n)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*.8487+this.x0,i.y=i.y*this.a*1.3523+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(e.y>=1)e.x/=Qu[18][0],e.y=t.y<0?-xl:xl;else{var n=Math.floor(18*e.y);for(n<0?n=0:n>=18&&(n=17);;)if($u[n][0]>e.y)--n;else{if(!($u[n+1][0]<=e.y))break;++n}var r=$u[n],i=5*(e.y-r[0])/($u[n+1][0]-r[0]);i=function(t,e,n,r){for(var i=e;r;--r){var o=t(i);if(i-=o,Math.abs(o)1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var o={header:i,subgrids:function(t,e,n){for(var r=[],i=0;i=0;s--)this.options.resolutions[s]&&(this._scales[s]=1/this.options.resolutions[s])}}return t.prototype.project=function(t,e,n){return this.projection.project(t)},t.prototype.unproject=function(t,e,n){return this.projection.unproject(t)},t.prototype.latLngToPoint=function(t,e){var n=this.projection.project(t),r=this.scale(e);return this.transformation._transform(n,r)},t.prototype.pointToLatLng=function(t,e){var n=this.scale(e),r=this.transformation.untransform(t,n);return this.projection.unproject(r)},t.prototype.scale=function(t){var e,n=Math.floor(t);return t===n?this._scales[t]:(e=this._scales[n])+(this._scales[n+1]-e)*(t-n)},t}(),ph=function(){function t(t,e,n){var r,i=void 0!==(r=t).inverse&&void 0!==r.forward;this._proj=i?t:this._projFromCodeDef(t,e),this.bounds=i?e:n}return t.prototype.project=function(t){var e=this._proj.forward([t.lng,t.lat]);return{x:e[0],y:e[1]}},t.prototype.unproject=function(t){var e=this._proj.inverse([t.x,t.y]);return{lat:e[1],lng:e[0]}},t.prototype._projFromCodeDef=function(t,e){if(e)fh.defs(t,e);else if(void 0===fh.defs[t]){var n=t.split(":");if(n.length>3&&(t=n[n.length-3]+":"+n[n.length-1]),void 0===fh.defs[t])throw"No projection definition for code "+t}return fh(t)},t}(),mh=function(){function t(t,e,n,r){if(yl.isArray(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=n,this._d=r}return t.prototype.transform=function(t,e){return this._transform({x:t.x,y:t.y},e)},t.prototype._transform=function(t,e){return e=null!=e?e:1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},t.prototype.untransform=function(t,e){return e=null!=e?e:1,{x:(t.x/e-this._b)/this._a,y:(t.y/e-this._d)/this._c}},t}();!function(t){t.Major="major",t.Minor="minor"}(hh||(hh={}));var gh=function(){function t(t,e,n,r){var i=this;if(this.setRadius=function(t,e){void 0===e&&(e=hh.Major),"major"==e.toLowerCase()?i.radii.major=t||i.baseRadius:"minor"==e.toLowerCase()&&(i.radii.minor=t||i.radii.major||i.baseRadius)},this.invertY=function(t,e){return Math.pow(2,e)-1-t},this.toBounds=function(t,e){var n={min:{x:null,y:null},max:{x:null,y:null}};return n.min.x=Math.min(t.x,e.x),n.max.x=Math.max(t.x,e.x),n.min.y=Math.min(t.y,e.y),n.max.y=Math.max(t.y,e.y),n},this.tileXYZ2NwSe=function(t,e,n,r){if(null==i.tileMapResource.proj)return null;var o=((r=Math.max(r||1,1))-1)*e,s={x:t.x*e-o,y:t.y*e-o},a={x:s.x+e+2*o,y:s.y+e+2*o},l=i.crs.pointToLatLng(s,t.z),c=i.crs.pointToLatLng(a,t.z);return n?i.toBounds(i.crs.project(l),i.crs.project(c)):{nw:l,se:c}},this.tileXYZ2LatLng=function(t,e,n,r){if(null==i.tileMapResource.proj){var o=t/Math.pow(2,n)*360-180,s=Math.PI-2*Math.PI*e/Math.pow(2,n);return{lat:180/Math.PI*Math.atan(.5*(Math.exp(s)-Math.exp(-s))),lng:o}}e=-e;var a=i.trueTileResolution*t*i.res[n]+i.tileMapResource.origin[0],l=i.trueTileResolution*e*i.res[n]+i.tileMapResource.origin[1];return i.crs.unproject({x:a,y:l})},this.latLngZ2TileXYZ=function(t,e,n,r){if(null==i.tileMapResource.proj){var o=(e+180)/360*Math.pow(2,n),s=(1-Math.log(Math.tan(t*(Math.PI/180))+1/Math.cos(t*(Math.PI/180)))/Math.PI)/2*Math.pow(2,n);return null==r&&(o=Math.floor(o),s=Math.floor(s)),{x:o,y:s,z:n}}var a=i.crs.project({lng:e,lat:t}),l=a.x,c=a.y;return{x:o=(l-i.tileMapResource.origin[0])/(i.trueTileResolution*i.res[n]),y:s=-(s=(c-i.tileMapResource.origin[1])/(i.trueTileResolution*i.res[n])),z:n}},this.vector3ToLatLng=function(t){var e=t.y,n=t.z;t.y=-n,t.z=-e;var r=i.radii.major/i.radiusScale,o=i.radii.minor/i.radiusScale,s=Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2)),a=Math.pow(r,2)-Math.pow(o,2),l=54*Math.pow(r,2)*Math.pow(t.z,2),c=Math.pow(s,2)+(1-Math.pow(i.e,2))*Math.pow(t.z,2)-Math.pow(i.e,2)*a,u=Math.pow(i.e,4)*l*Math.pow(s,2)/Math.pow(c,3),h=Math.cbrt(1+u+Math.sqrt(Math.pow(u,2)+2*u)),f=l/(3*Math.pow(h+1/h+1,2)*Math.pow(c,2)),d=Math.sqrt(1+2*Math.pow(i.e,4)*f),p=-f*Math.pow(i.e,2)*s/(1+d)+Math.sqrt(.5*Math.pow(r,2)*(1+1/d)-f*(1-Math.pow(i.e,2))*Math.pow(t.z,2)/(d*(1+d))-.5*f*Math.pow(s,2)),m=Math.sqrt(s-Math.pow(i.e,2)*p+Math.pow(t.z,2)),g=Math.sqrt(Math.pow(s-Math.pow(i.e,2)*p,2)+(1-Math.pow(i.e,2))*Math.pow(t.z,2)),v=Math.pow(o,2)*t.z/(r*g),y=m*(1-Math.pow(o,2)/(r*g)),b=Math.atan((t.z+Math.pow(i.ep,2)*v)/s)*(180/Math.PI),_=-Math.atan2(t.y,t.x)*(180/Math.PI)-90;return _<-180&&(_+=360),{lat:b,lng:_,height:y}},this.lonLatToVector3=function(t,e,n){var r=e*(Math.PI/180),o=(t-180)*(Math.PI/180);return{x:(i.radii.major+n)/i.radiusScale*Math.cos(r)*Math.sin(o),y:-(i.radii.major+n)/i.radiusScale*Math.sin(r),z:-(i.radii.major+n)/i.radiusScale*Math.cos(r)*Math.cos(o)}},this.rotatePoint3D=function(t,e,n){null==n&&(n={x:0,y:0,z:0});var r=t.x-n.x,i=t.y-n.y,o=t.z-n.z,s=Math.sin(e.x),a=Math.cos(e.x),l=Math.sin(e.y),c=Math.cos(e.y),u=Math.sin(e.z),h=Math.cos(e.z);return{x:n.x+r*(c*h)+i*(-c*u)+o*l,y:n.y+r*(a*u+s*l*h)+i*(a*h-s*l*u)+o*(-s*c),z:n.z+r*(s*u-a*l*h)+i*(s*h+a*l*u)+o*(a*c)}},this.lon2tileUnfloored=function(t,e){return(t+180)/360*Math.pow(2,e)},this.lat2tileUnfloored=function(t,e){return(1-Math.log(Math.tan(t*Math.PI/180)+1/Math.cos(t*Math.PI/180))/Math.PI)/2*Math.pow(2,e)},this.lngLatDistBetween=function(t,e,n,r){var o=i.radii.major/i.radiusScale,s=e*(Math.PI/180),a=r*(Math.PI/180),l=(r-e)*(Math.PI/180),c=(n-t)*(Math.PI/180),u=Math.sin(l/2)*Math.sin(l/2)+Math.cos(s)*Math.cos(a)*Math.sin(c/2)*Math.sin(c/2);return o*(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)))},this._reset(),this.setRadius(t,hh.Major),this.setRadius(e,hh.Minor),this.tileMapResource=n||{bounds:null,origin:null,crsCode:null,epsg:null,proj:null,resunitsperpixel:null,reszoomlevel:null},this.tileMapResource.crsCode=this.tileMapResource.crsCode||"EPSG:4326",this.trueTileResolution=r||256,null!=this.tileMapResource.resunitsperpixel&&null!=this.tileMapResource.reszoomlevel){var o=this.tileMapResource.reszoomlevel;o+=Math.round(4*Math.PI*Math.pow(3396190,2)/(4*Math.PI*Math.pow(this.radii.major,2)));for(var s=this.tileMapResource.resunitsperpixel*Math.pow(2,o),a=[],l=0;l<32;l++)a.push(s/Math.pow(2,l));this.res=a}var c=this.tileMapResource;this.crs=new dh(Number.isFinite(parseInt(c.crsCode[0]))?"EPSG:"+c.epsg:c.crsCode,c.proj,{origin:[parseFloat(c.origin[0]),parseFloat(c.origin[1])],resolutions:this.res,bounds:[[parseFloat(c.bounds[0]),parseFloat(c.bounds[1])],[parseFloat(c.bounds[2]),parseFloat(c.bounds[3])]]},parseFloat(this.radii.major))}return t.prototype._reset=function(){this.baseRadius=6371e3,this.radiusScale=1,this.radii={major:this.baseRadius,minor:this.baseRadius},this.tileMapResource={bounds:null,origin:null,crsCode:"EPSG:4326",proj:null,resunitsperpixel:null,reszoomlevel:null},this.e=0,this.ep=0,this.flatteningFactor=0},t}(),vh={simplePoint:function(){return new Be({uniforms:{},vertexShader:"#ifdef GL_ES\nprecision highp float;\n#endif\nvoid main() {\ngl_PointSize = 50.\ngl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.)\n}",fragmentShader:"void main() {\ngl_FragColor = vec4(0.0, 1.0, 1.0, 0.0)\n}",transparent:!0})},multiTexture:function(t,e){for(var n=t.length,r="#ifdef GL_ES\nprecision highp float;\n#endif\n",i=0;i highestA ){ highestA = tA"+i+"; }\nvec4 C"+i+" = texture2D(t"+i+", vUv);\nC = vec4( C"+i+".rgb * (C"+i+".a * tA"+i+") + C.rgb * C.a * (1.0 - (C"+i+".a * tA"+i+")), 1);\n";r+="if (";for(i=0;i 0.4) { gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); }","}"].join("\n");return new Be({uniforms:{coefficient:{value:.1},power:{value:6},opacity:{value:.5},glowColor:{value:new Ut(t||"#FFFFFF")}},vertexShader:e,fragmentShader:n,blending:2,transparent:!0,depthWrite:!1})}},yh=n(3);function bh(t,e,n,r,i){return new Promise((function(n,i){fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){Object(yh.fromArrayBuffer)(t).then((function(t){t.readRasters().then((function(t){var i=t[0];if(e&&e.demFormatOptions&&!0===e.demFormatOptions.correctSeams){for(var o=--r+2,s=[],a=0;ar&&(n=r)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}return this.pos=n,this.buffer.subarray(e,n)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,e,n){for(var r=t+e;this.bufferLength<=r&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,e,n)},skip:function(t){t||(t=1),this.pos+=t},reset:function(){this.pos=0}},t}(),xh=function(){var t=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),e=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),n=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),r=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],i=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function o(t){throw new Error(t)}function s(t){var e=0,n=t[e++],r=t[e++];-1!=n&&-1!=r||o("Invalid header in flate stream"),8!=(15&n)&&o("Unknown compression method in flate stream"),((n<<8)+r)%31!=0&&o("Bad FCHECK in flate stream"),32&r&&o("FDICT bit set in flate stream"),this.bytes=t,this.bytesPos=2,this.codeSize=0,this.codeBuf=0,_h.call(this)}return s.prototype=Object.create(_h.prototype),s.prototype.getBits=function(t){for(var e,n=this.codeSize,r=this.codeBuf,i=this.bytes,s=this.bytesPos;n>t,this.codeSize=n-=t,this.bytesPos=s,e},s.prototype.getCode=function(t){for(var e=t[0],n=t[1],r=this.codeSize,i=this.codeBuf,s=this.bytes,a=this.bytesPos;r>16,h=65535&c;return(0==r||r>u,this.codeSize=r-u,this.bytesPos=a,h},s.prototype.generateHuffmanTable=function(t){for(var e=t.length,n=0,r=0;rn&&(n=t[r]);for(var i=1<>=1;for(r=u;r0;)e[p++]=i}var a=this.getBits(3);if(1&a&&(this.eof=!0),0!=(a>>=1)){var l,c;if(1==a)l=r,c=i;else if(2==a){for(var u=this.getBits(5)+257,h=this.getBits(5)+1,f=this.getBits(4)+4,d=Array(t.length),p=0;p=_&&(_=(O=this.ensureBuffer(x+1)).length),O[x++]=w;else{if(256==w)return void(this.bufferLength=x);var M=(w=e[w-=257])>>16;M>0&&(M=this.getBits(M));g=(65535&w)+M;w=this.getCode(c),(M=(w=n[w])>>16)>0&&(M=this.getBits(M));var S=(65535&w)+M;x+g>=_&&(_=(O=this.ensureBuffer(x+g)).length);for(var E=0;E0)for(e=0;ethis.data.length)throw new Error("Incomplete or corrupt PNG file")}}return t.load=function(e,n,r,i){var o=new XMLHttpRequest;return o.open("GET",e,!0),o.responseType="arraybuffer",o.withCredentials=n.withCredentials,o.onload=function(){var e=new Uint8Array(o.response||o.mozResponseArrayBuffer);if(404!==o.status){var n=new t(e);return"function"==typeof r?r(n):void 0}"function"==typeof i&&i(o.status)},o.send()},t.prototype.read=function(t){for(var e=new Array(t),n=0;n1&&n/i0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=1.3?"CRS":"SRS"]=l;var c=n.tileXYZ2NwSe(e,i,!0,!0===o.correctSeams?(r+1)/r:null),u=(parseFloat(s.VERSION)>=1.3&&"EPSG:4326"===l?[c.min.y,c.min.x,c.max.y,c.max.x]:[c.min.x,c.min.y,c.max.x,c.max.y]).join(",");return t+yl.getParamString(s,t,Oh.wmsExtension.extensionOptions.uppercase)+(Oh.wmsExtension.extensionOptions.uppercase?"&BBOX=":"&bbox=")+u}}},kh=Oh,Ih=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},Dh=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0){var i=function(){t.tilesToBeDrawn.length>0&&t.addTile(t.tilesToBeDrawn.pop(),i).catch((function(){i()}))};this.addTile(this.tilesToBeDrawn.pop(),i).catch((function(){i()}))}if(0==this.tilesToBeDrawn.length&&0==this.tilesBeingDrawn.length){for(e=0;e=0;s--)if(t.isLODTile==d.tilesDrawn[s].isLODTile&&t.LODLevel==d.tilesDrawn[s].LODLevel){var a=[d.tilesDrawn[s].x,d.tilesDrawn[s].y,d.tilesDrawn[s].z],l=[t.x,t.y,t.z];t.zd.tilesDrawn[s].z&&yl.tileIsContained(a,l)&&(d.tilesDrawn[s].contents.push(l),d.tilesDrawn[s].contents.length>=yl.tileContains(a,t.z).length&&o.push(s))}for(s=d.tilesBeingDrawn.length-1;s>=0;s--)if(d.tilesBeingDrawn[s].x==t.x&&d.tilesBeingDrawn[s].y==t.y&&d.tilesBeingDrawn[s].z==t.z&&d.tilesBeingDrawn[s].isLODTile==t.isLODTile&&d.tilesBeingDrawn[s].LODLevel==t.LODLevel){if(d.tilesBeingDrawn[s].make)t.isLODTile?d.p.planetsLOD[t.LODLevel].add(r):d.p.planet.add(r),d.updateRastersForTile(t),o.forEach((function(t){d.removeTile(t,!0)}));else{r.geometry.dispose(),r.material.dispose();for(var c=d.tilesDrawn.length-1;c>=0;c--)d.tilesDrawn[c].x==t.x&&d.tilesDrawn[c].y==t.y&&d.tilesDrawn[c].z==t.z&&d.tilesDrawn[s].isLODTile==t.isLODTile&&d.tilesDrawn[s].LODLevel==t.LODLevel&&d.tilesDrawn.splice(c,1)}return void d.tilesBeingDrawn.splice(s,1)}}},o=function(e){var o=0,s=Math.pow(d.p.options.tileResolution,2),a=new Float32Array(3*s);null==e&&(e=new Array(s).fill(0));for(var l=0,c=Math.floor(e.length/2),u=0;(null==l||l>d.p.projection.radiusOfPlanetMajor||l<-d.p.projection.radiusOfPlanetMajor)&&u75&&T<-88?T=90:y<-75&&T>88&&(T=-90)),x=d.p.projection.lonLatToVector3(C,T,_*d.p.options.exaggeration),r.geometry.attributes.position.array[w]=x.x-b.x,r.geometry.attributes.position.array[w+1]=x.y-b.y,r.geometry.attributes.position.array[w+2]=x.z-b.z,o+=1}r.geometry.attributes.position.needsUpdate=!0,r.geometry.computeVertexNormals(),r.geometry.computeBoundingSphere(),r.geometry.setAttribute("customColor",new Yt(a,3)),n.data=!0,i()}},s=!1,a=null,l=this.p.layers.tile.length-1;l>=0;l--)if(this.p.layers.tile[l].on&&(t.z>=this.p.layers.tile[l].minZoom&&t.z<=this.p.layers.tile[l].maxZoom&&yl.isInExtent(t,this.p.layers.tile[l].boundingBox,this.p.projection)||"_vectorsastile_"==this.p.layers.tile[l].path)&&(a=l,null!=this.p.layers.tile[l].demPath)){s=!0;break}return c=null,s&&null!=a?(u=kh.buildPath(this.p.layers.tile[a].format,this.p.layers.tile[a].demPath,t,this.p.projection,this.p.options.tileResolution,this.p.options.trueTileResolution,this.p.layers.tile[a].demFormatOptions,!0))?(h=!1,[4,Lh(this.p.options.customParsers,u.path,this.p.layers.tile[a],u.xyz,this.p.options.tileResolution,Math.pow(this.p.options.tileResolution,2)).catch((function(){h=!0}))]):[3,3]:[3,4];case 1:return c=p.sent(),h&&null!=this.p.options.demFallback?(f=kh.buildPath(this.p.options.demFallback.format,this.p.options.demFallback.demPath,t,this.p.projection,this.p.options.tileResolution,this.p.options.trueTileResolution,this.p.layers.tile[a].demFormatOptions,!0))?[4,Lh(this.p.options.customParsers,f.path,this.p.layers.tile[a],f.xyz,this.p.options.tileResolution,Math.pow(this.p.options.tileResolution,2),this.p.options.demFallback.parserType).catch((function(){}))]:[3,3]:[3,3];case 2:c=p.sent(),p.label=3;case 3:return o(c||null),[3,7];case 4:return null==this.p.options.demFallback?[3,6]:(f=kh.buildPath(this.p.options.demFallback.format,this.p.options.demFallback.demPath,t,this.p.projection,this.p.options.tileResolution,this.p.options.trueTileResolution,this.p.layers.tile[a].demFormatOptions,!0))?[4,Lh(this.p.options.customParsers,f.path,this.p.layers.tile[a],f.xyz,this.p.options.tileResolution,Math.pow(this.p.options.tileResolution,2),this.p.options.demFallback.parserType).catch((function(){}))]:[3,6];case 5:c=p.sent(),p.label=6;case 6:o(),p.label=7;case 7:return[2]}}))}))},t.prototype.findTileDrawnBasedOnUUID=function(t){var e=null;return this.tilesDrawn.forEach((function(n){n.t.uuid!==t||(e=n)})),e},t.prototype.findTileDrawnBasedOnXYZLOD=function(t){var e=null;return this.tilesDrawn.forEach((function(n){n.x!==t.x||n.y!==t.y||n.z!==t.z||n.isLODTile!==t.isLODTile||n.LODLevel!=t.LODLevel||(e=n)})),e},t.prototype.updateRastersForTile=function(t){var e=this,n=this.findTileDrawnBasedOnXYZLOD(t);if(null!=n){for(var r=[],i=new Array(this.p.layers.tile.length).fill(!1),o=new Array(this.p.layers.clamped.length).fill(!1),s=function(){if(i.every(Boolean)&&(t.isLODTile||o.every(Boolean))){if(0==r.length)return void(n.t.visible=!1);r.sort((function(t,e){return t.i-e.i})),n.from.rasters=[];for(var s=0,a=0;a=l.p.layers.tile[t].minZoom&&n.z<=l.p.layers.tile[t].maxZoom&&yl.isInExtent({x:n.x,y:n.y,z:n.z},l.p.layers.tile[t].boundingBox,l.p.projection)){var o=kh.buildPath(l.p.layers.tile[t].format,l.p.layers.tile[t].path,n,l.p.projection,l.p.options.trueTileResolution,l.p.options.trueTileResolution,l.p.layers.tile[t].formatOptions);o?function(t){e._.loader.load(o,(function(n){n.magFilter=1003,n.minFilter=1003,e.p.layers.tile[t]&&r.push({name:e.p.layers.tile[t].name,type:"tile",texture:n,opacity:e.p.layers.tile[t].opacity,i:t}),i[t]=!0,s()}),(function(){console.log("")}),(function(){i[t]=!0,s()}))}(t):(i[t]=!0,s())}else i[t]=!0,s()},l=this,c=0;c=this.p.layers.clamped[c].minZoom)&&(null==this.p.layers.clamped[c].maxZoom||n.z<=this.p.layers.clamped[c].maxZoom)&&(null==this.p.layers.clamped[c].boundingBox||yl.isInExtent({x:n.x,y:n.y,z:n.z},this.p.layers.clamped[c].boundingBox,this.p.projection))){var u=this.p.layers._.layerers.clamped.getClampedTexture(c,{x:n.x,y:n.y,z:n.z});n.contains=n.contains||{},n.contains[this.p.layers.clamped[c].name]=u.features;var h=new lo(u.canvas);h.magFilter=1003,h.minFilter=1003,this.p.layers.clamped[c]&&r.push({name:this.p.layers.clamped[c].name,type:"clamped",texture:h,opacity:this.p.layers.clamped[c].opacity,i:c}),o[c]=!0,s()}else o[c]=!0,s()}},t.prototype.updateClampedRasterForTile=function(t,e){if(!this.p.options.wireframeMode&&!t.isLODTile){for(var n=null,r=0;r=i.minZoom)&&(null==i.maxZoom||t.z<=i.maxZoom)&&(null==i.boundingBox||yl.isInExtent({x:t.x,y:t.y,z:t.z},i.boundingBox,this.p.projection))){var o=this.p.layers._.layerers.clamped.getClampedTexture(n,{x:t.x,y:t.y,z:t.z});t.contains=t.contains||{},t.contains[this.p.layers.clamped[n].name]=o.features;var s=new lo(o.canvas);s.magFilter=1003,s.minFilter=1003;for(r=0;ri?Math.min(this.tilesDrawn[t].t.material.uniforms["tA"+e].value+.1,r):Math.max(this.tilesDrawn[t].t.material.uniforms["tA"+e].value-.1,r)}}},t.prototype.fadeOutTiles=function(){for(var t=this.tilesDrawn.length-1;t>=0;t--)if(this.tilesDrawn[t].fadeOutAndRemove)for(var e=0;this.tilesDrawn[t]&&e=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Bh(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function zh(t){return"Feature"===t.type?t.geometry:t}function Uh(t,e,n,r){void 0===r&&(r={});var i=Fh(t),o=Object(jh.degreesToRadians)(i[0]),s=Object(jh.degreesToRadians)(i[1]),a=Object(jh.degreesToRadians)(n),l=Object(jh.lengthToRadians)(e,r.units),c=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a)),u=o+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(c)),h=Object(jh.radiansToDegrees)(u),f=Object(jh.radiansToDegrees)(c);return Object(jh.point)([h,f],r.properties)}var Hh=function(t,e,n){void 0===n&&(n={});for(var r=n.steps||64,i=n.properties?n.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},o=[],s=0;s=t[0]&&e[3]>=t[1]}(r,s))return!1;"Polygon"===o&&(a=[a]);for(var l=!1,c=0;ct[1]!=c>t[1]&&t[0]<(l-s)*(t[1]-a)/(c-a)+s&&(r=!r)}return r}var Vh=n(1);var qh=function(t){if(!t)throw new Error("geojson is required");var e=[];return Object(Vh.flattenEach)(t,(function(t){!function(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":n=Bh(r);break;case"LineString":n=[Bh(r)]}n.forEach((function(n){(function(t,e){var n=[];return t.reduce((function(t,r){var i,o,s,a,l,c,u=Object(jh.lineString)([t,r],e);return u.bbox=(o=r,s=(i=t)[0],a=i[1],l=o[0],c=o[1],[sl?s:l,a>c?a:c]),n.push(u),r})),n})(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),Object(jh.featureCollection)(e)},Xh=n(4),Yh=n.n(Xh);function Zh(t,e){var n=Bh(t),r=Bh(e);if(2!==n.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==r.length)throw new Error(" line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],l=r[0][0],c=r[0][1],u=r[1][0],h=r[1][1],f=(h-c)*(s-i)-(u-l)*(a-o),d=(u-l)*(o-c)-(h-c)*(i-l),p=(s-i)*(o-c)-(a-o)*(i-l);if(0===f)return null;var m=d/f,g=p/f;if(m>=0&&m<=1&&g>=0&&g<=1){var v=i+m*(s-i),y=o+m*(a-o);return Object(jh.point)([v,y])}return null}var Jh=function(t,e){var n={},r=[];if("LineString"===t.type&&(t=Object(jh.feature)(t)),"LineString"===e.type&&(e=Object(jh.feature)(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var i=Zh(t,e);return i&&r.push(i),Object(jh.featureCollection)(r)}var o=Yh()();return o.load(qh(e)),Object(Vh.featureEach)(qh(t),(function(t){Object(Vh.featureEach)(o.search(t),(function(e){var i=Zh(t,e);if(i){var o=Bh(i).join(",");n[o]||(n[o]=!0,r.push(i))}}))})),Object(jh.featureCollection)(r)},Kh=function(t,e){void 0===e&&(e={});var n=zh(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return function(t,e){void 0===e&&(e={});var n=zh(t).coordinates,r=e.properties?e.properties:"Feature"===t.type?t.properties:{};return Qh(n,r)}(n,e);case"MultiPolygon":return function(t,e){void 0===e&&(e={});var n=zh(t).coordinates,r=e.properties?e.properties:"Feature"===t.type?t.properties:{},i=[];return n.forEach((function(t){i.push(Qh(t,r))})),Object(jh.featureCollection)(i)}(n,e);default:throw new Error("invalid poly")}};function Qh(t,e){return t.length>1?Object(jh.multiLineString)(t,e):Object(jh.lineString)(t[0],e)}function $h(t,e){for(var n=0;n0}function ef(t,e,n){var r=n[0]-t[0],i=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return 0==r*s-i*o&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}var nf=function(t,e){var n=!0;return Object(Vh.flattenEach)(t,(function(t){Object(Vh.flattenEach)(e,(function(e){if(!1===n)return!1;n=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return n=t.coordinates,r=e.coordinates,!(n[0]===r[0]&&n[1]===r[1]);case"LineString":return!$h(e,t);case"Polygon":return!Gh(t,e)}break;case"LineString":switch(e.type){case"Point":return!$h(t,e);case"LineString":return!function(t,e){if(Jh(t,e).features.length>0)return!0;return!1}(t,e);case"Polygon":return!tf(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Gh(e,t);case"LineString":return!tf(t,e);case"Polygon":return!function(t,e){for(var n=0,r=t.coordinates[0];n0)return!0;return!1}(e,t)}}var n,r;return!1}(t.geometry,e.geometry)}))})),n};function rf(t,e){var n=!1;return Object(Vh.flattenEach)(t,(function(t){Object(Vh.flattenEach)(e,(function(e){if(!0===n)return!0;n=!nf(t.geometry,e.geometry)}))})),n}var of=function(){function t(t){var e=this;this._rotateGlobe=function(t,n){if(n&&(e._.prevMouseXY.x=n.x,e._.prevMouseXY.y=n.y),t){!t.pageX&&t.touches&&(t.pageX=yl.arrayAverage(t.touches,"pageX")),!t.pageY&&t.touches&&(t.pageY=yl.arrayAverage(t.touches,"pageY")),t.hasOwnProperty("x")&&t.hasOwnProperty("y")&&e.p._.cameras.isFirstPerson&&(e._.prevMouseXY.x=0,e._.prevMouseXY.y=0,t.pageX=t.x,t.pageY=t.y);var r=.5*yl.getRadiansPerPixel(e.p.trueZoom)*(e.p._.marsRadius/e.p.projection.radii.major),i=0,o=new _(e.p._.cameras.orbit.camera.position.x,0,e.p._.cameras.orbit.camera.position.z);o.applyAxisAngle(new _(0,1,0),Math.PI/2);var s=new _(e.p._.cameras.orbit.camera.position.x,0,e.p._.cameras.orbit.camera.position.z);if(t.pageYe._.prevMouseXY.y&&(i=Math.abs(t.pageY-e._.prevMouseXY.y),e._rotateAroundArbAxis(o,-r*i)),t.pageX>e._.prevMouseXY.x?(i=Math.abs(t.pageX-e._.prevMouseXY.x),e._rotateAroundArbAxis(s,-r*i)):t.pageX2&&(e._.prevMouseXY.x=yl.arrayAverage(t.touches,"pageX"),e._.prevMouseXY.y=yl.arrayAverage(t.touches,"pageY"),e.p._.sceneContainer.addEventListener("touchmove",e._rotateGlobe,!1),e.p._.sceneContainer.addEventListener("touchend",e._rotateGlobe_MouseUp,!1))},this._rotateGlobe_MouseUp=function(t){e.p._.sceneContainer.removeEventListener("mousemove",e._rotateGlobe),e.p._.sceneContainer.removeEventListener("mouseup",e._rotateGlobe_MouseUp),e.p._.sceneContainer.removeEventListener("mouseleave",e._rotateGlobe_MouseUp),e.p._.sceneContainer.removeEventListener("touchmove",e._rotateGlobe),e.p._.sceneContainer.removeEventListener("touchend",e._rotateGlobe_MouseUp)},this._onZoom=function(t){e._.zoomedSince=0;var n=e.p._.cameras.orbit.camera.position.distanceTo(e.p._.cameras.orbit.controls.target),r=8-(e.p.projection.radiusScale.toString().length-1),i=Math.ceil((r*Math.log(2)-Math.log(n/Math.pow(5,r-1)))/Math.log(2))+1;e._.desiredZoom=i,e._attenuate()},this._onTouchZoom=function(t){t.touches&&1==t.touches.length&&e._onZoom(t)},this._onClick=function(t){if(e.hoveredFeature&&e.hoverInfo){var n=e.p.layers.getLayerByName(e.hoveredFeature.layerName);n&&(e.setActiveFeature({layerName:e.hoveredFeature.layerName,type:e.hoveredFeature.type,obj:e.hoveredFeature.obj,feature:e.hoveredFeature.feature||e.hoveredFeature.obj.feature,lnglat:{lng:e.hoveredFeature.lnglat.lng,lat:e.hoveredFeature.lnglat.lat}}),"function"==typeof n.onClick&&n.onClick(JSON.parse(JSON.stringify(e.hoveredFeature.feature)),JSON.parse(JSON.stringify(e.hoveredFeature.lnglat)),n))}},this._onMouseMove=function(t){e.p._.mouseIsInScene=!0,e.p._.cameras.isFirstPerson?(e._.mouseXY.x=0,e._.mouseXY.y=0):(e._.mouseXY.x=(t.clientX-e.p._.renderer.domElement.getBoundingClientRect().left)/e.p._.renderer.domElement.clientWidth*2-1,e._.mouseXY.y=-(t.clientY-e.p._.renderer.domElement.getBoundingClientRect().top)/e.p._.renderer.domElement.clientHeight*2+1),e._.containerXY={x:t?t.offsetX:null,y:t?t.offsetY:null},e.updateHoverInfoPosition(),e.p._.raycaster.setFromCamera(e._.mouseXY,e.p._.cameras.camera);for(var n=[],r=0;r0){var s=o[0].object.type,a=null;switch(s){case"Sprite":case"Line2":a=o[0].object;break;case"Mesh":if(null==(a=e.p._.tiledWorld.findTileDrawnBasedOnUUID(o[0].object.uuid)))return;break;default:return}var l=o[0].point;o[0].point.y+=e.p.planetCenter.y,o[0].point=e.p.projection.rotatePoint3D(o[0].point,{x:-e.p.planet.rotation.x,y:0,z:0}),o[0].point=e.p.projection.rotatePoint3D(o[0].point,{x:0,y:-e.p.planet.rotation.y,z:0}),o[0].point=e.p.projection.rotatePoint3D(o[0].point,{x:0,y:0,z:-e.p.planet.rotation.z});var c=e.p.projection.vector3ToLatLng(o[0].point);c.height=l.length()*e.p.projection.radiusScale-e.p.projection.radii.major,e._updateMouseCoords(c.lng,c.lat,c.height),clearTimeout(e._.highlightTimeout),e._.highlightTimeout=setTimeout((function(){e._highlightFeature(c.lng,c.lat,s,a)}),10),e.p.controls._onMouseMove(c.lng,c.lat,c.height,t)}else e._updateMouseCoords(null,null,null),e._unhighlightHoveredFeature(),e.p.controls._onMouseMove(null,null,null,t)},this.p=t,this.activeFeature=null,this.hoveredFeature=null,this.hoverInfo=null,this._={mouseXY:{x:null,y:null},prevMouseXY:{x:null,y:null},containerXY:{x:null,y:null},lastZoomDelta:1,desiredZoom:null,zoomedSince:0,zoomWait:30,highlightTimeout:null},this._init()}return t.prototype._init=function(){var t=this;this._matchPlanetsLODToPlanet(),this.p._.sceneContainer.addEventListener("mousewheel",this._onZoom,!1),this.p._.sceneContainer.addEventListener("DOMMouseScroll",this._onZoom,!1),this.p._.sceneContainer.addEventListener("wheel",this._onZoom,!1),this.p._.sceneContainer.addEventListener("mouseleave",this.p.controls._onMouseOut,!1),this.p._.sceneContainer.addEventListener("touchend",this._onTouchZoom),this.p._.sceneContainer.addEventListener("mousedown",this._rotateGlobe_MouseDown,!1),this.p._.sceneContainer.addEventListener("mousemove",this._onMouseMove,!1),this.p._.sceneContainer.addEventListener("click",this._onClick,!1),this.p._.sceneContainer.addEventListener("mouseenter",(function(){t.p._.mouseIsInScene=!0}),!1),this.p._.sceneContainer.addEventListener("mouseleave",(function(){t.p._.mouseIsInScene=!1}),!1)},t.prototype._rotateAroundArbAxis=function(t,e,n){var r=new Y;r.makeRotationAxis(t.normalize(),e),!0!==n&&r.multiply(this.p.planet.matrix),this.p.planet.matrix=r,this.p.planet.rotation.setFromRotationMatrix(this.p.planet.matrix),this._matchPlanetsLODToPlanet(),this._refreshFrontGroupRotation()},t.prototype._checkDesiredZoom=function(){this._.zoomedSince++,null!=this._.desiredZoom&&(this.p._.cameras.setNearFarPlane(this._.desiredZoom<14),this._.zoomedSince>this._.zoomWait&&(this._.desiredZoom>=this.p._.minNativeZoom&&this._setZoom(this._.desiredZoom),this._.desiredZoom=null))},t.prototype._setZoom=function(t){var e=this.p.zoom;this.p.zoom=t,this.p.trueZoom=Math.max(0,t),this.p.zoom<0&&(this.p.zoom=0),this.p.zoomthis.p._.maxZoom&&(this.p.zoom=this.p._.maxZoom),this._.lastZoomDelta=Math.abs(this.p.zoom-e)},t.prototype._matchPlanetsLODToPlanet=function(){for(var t=0;t0?e.children.forEach((function(e){e instanceof wi&&e.scale.set(t*e.style.radius,t*e.style.radius,t*e.style.radius)})):e instanceof wi&&e.scale.set(t*mesh.style.radius,t*mesh.style.radius,t*mesh.style.radius)}))},t}(),sf=n(2),af=n.n(sf);class lf{constructor(){this.maxSize=800,this.minSize=600,this.unloadPercent=.05,this.itemSet=new Map,this.itemList=[],this.usedSet=new Set,this.callbacks=new Map,this.unloadPriorityCallback=null;const t=this.itemSet;this.defaultPriorityCallback=e=>t.get(e)}isFull(){return this.itemSet.size>=this.maxSize}add(t,e){const n=this.itemSet;if(n.has(t))return!1;if(this.isFull())return!1;const r=this.usedSet,i=this.itemList,o=this.callbacks;return i.push(t),r.add(t),n.set(t,Date.now()),o.set(t,e),!0}remove(t){const e=this.usedSet,n=this.itemSet,r=this.itemList,i=this.callbacks;if(n.has(t)){i.get(t)(t);const o=r.indexOf(t);return r.splice(o,1),e.delete(t),n.delete(t),i.delete(t),!0}return!1}markUsed(t){const e=this.itemSet,n=this.usedSet;e.has(t)&&!n.has(t)&&(e.set(t,Date.now()),n.add(t))}markAllUnused(){this.usedSet.clear()}unloadUnusedContent(){const t=this.unloadPercent,e=this.minSize,n=this.itemList,r=this.itemSet,i=this.usedSet,o=this.callbacks,s=n.length-i.size,a=n.length-e,l=this.unloadPriorityCallback||this.defaultPriorityCallback;if(a>0&&s>0){n.sort((t,e)=>{const n=i.has(t),r=i.has(e);return n&&r?0:n||r?n?1:-1:l(e)-l(t)});const c=Math.min(a,s),u=Math.max(e*t,c*t);let h=Math.min(u,s);h=Math.ceil(h);const f=n.splice(0,h);for(let t=0,e=f.length;t{this.scheduled=!1,this.unloadUnusedContent(),t&&this.markAllUnused()},Promise.resolve().then(e))}}class cf{constructor(){this.maxJobs=6,this.items=[],this.callbacks=new Map,this.currJobs=0,this.scheduled=!1,this.autoUpdate=!0,this.priorityCallback=()=>{throw new Error("PriorityQueue: PriorityCallback function not defined.")}}sort(){const t=this.priorityCallback;this.items.sort((e,n)=>t(e)-t(n))}add(t,e){return new Promise((n,r)=>{const i=this.items,o=this.callbacks;i.push(t),o.set(t,(...t)=>e(...t).then(n).catch(r)),this.autoUpdate&&this.scheduleJobRun()})}remove(t){const e=this.items,n=this.callbacks,r=e.indexOf(t);-1!==r&&(e.splice(r,1),n.delete(t))}tryRunJobs(){this.sort();const t=this.items,e=this.callbacks,n=this.maxJobs;let r=this.currJobs;for(;n>r&&t.length>0;){r++;const n=t.pop(),i=e.get(n);e.delete(n),i(n).then(()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()}).catch(()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()})}this.currJobs=r}scheduleJobRun(){this.scheduled||(requestAnimationFrame(()=>{this.tryRunJobs(),this.scheduled=!1}),this.scheduled=!0)}}function uf(t){return 3===t||4===t}function hf(t,e){return t.__lastFrameVisited===e&&t.__used}function ff(t,e){t.__lastFrameVisited!==e&&(t.__lastFrameVisited=e,t.__used=!1,t.__inFrustum=!1,t.__isLeaf=!1,t.__visible=!1,t.__active=!1,t.__error=0,t.__childrenWereVisible=!1,t.__allChildrenLoaded=!1)}function df(t,e,n){if(ff(t,e),t.__used=!0,n.markUsed(t),t.__contentEmpty){const r=t.children;for(let t=0,i=r.length;t1/(t.__depthFromRenderedParent+1);function vf(t){let e="";for(let n=0,r=t.length;ns+a)throw new Error("FeatureTable: Feature data read outside binary body length.");return f}}return o}}class bf extends yf{constructor(t,e,n,r,i){super(t,n,r,i),this.batchSize=e}getData(t,e=null,n=null){return super.getData(t,this.batchSize,n,e)}}var _f=function(){function t(t){_s.call(this,t),this.dracoLoader=null,this.ddsLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(t){return new s(t)})),this.register((function(t){return new l(t)})),this.register((function(t){return new h(t)})),this.register((function(t){return new a(t)})),this.register((function(t){return new i(t)})),this.register((function(t){return new f(t)}))}function e(){var t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}t.prototype=Object.assign(Object.create(_s.prototype),{constructor:t,load:function(t,e,n,r){var i,o=this;i=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:pa(t),this.manager.itemStart(t);var s=function(e){r?r(e):console.error(e),o.manager.itemError(t),o.manager.itemEnd(t)},a=new ws(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,(function(n){try{o.parse(n,i,(function(n){e(n),o.manager.itemEnd(t)}),s)}catch(t){s(t)}}),n,s)},setDRACOLoader:function(t){return this.dracoLoader=t,this},setDDSLoader:function(t){return this.ddsLoader=t,this},setKTX2Loader:function(t){return this.ktx2Loader=t,this},setMeshoptDecoder:function(t){return this.meshoptDecoder=t,this},register:function(t){return-1===this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.push(t),this},unregister:function(t){return-1!==this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this},parse:function(t,e,i,s){var a,l={},c={};if("string"==typeof t)a=t;else if(da(new Uint8Array(t,0,4))===d){try{l[n.KHR_BINARY_GLTF]=new g(t)}catch(t){return void(s&&s(t))}a=l[n.KHR_BINARY_GLTF].content}else a=da(new Uint8Array(t));var u=JSON.parse(a);if(void 0===u.asset||u.asset.version[0]<2)s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var h=new Z(u,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(var f=0;f=0&&void 0===c[m]&&console.warn('THREE.GLTFLoader: Unknown extension "'+m+'".')}}h.setExtensions(l),h.setPlugins(c),h.parse(i,s)}}});var n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function r(t){if(!t)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=t}function i(t){this.parser=t,this.name=n.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}function o(){this.name=n.KHR_MATERIALS_UNLIT}function s(t){this.parser=t,this.name=n.KHR_MATERIALS_CLEARCOAT}function a(t){this.parser=t,this.name=n.KHR_MATERIALS_TRANSMISSION}function l(t){this.parser=t,this.name=n.KHR_TEXTURE_BASISU}function h(t){this.parser=t,this.name=n.EXT_TEXTURE_WEBP,this.isSupported=null}function f(t){this.name=n.EXT_MESHOPT_COMPRESSION,this.parser=t}i.prototype._markDefs=function(){for(var t=this.parser,e=this.parser.json.nodes||[],n=0,r=e.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,o,s)},h.prototype.loadTexture=function(t){var e=this.name,n=this.parser,r=n.json,i=r.textures[t];if(!i.extensions||!i.extensions[e])return null;var o=i.extensions[e],s=r.images[o.source],a=s.uri?n.options.manager.getHandler(s.uri):n.textureLoader;return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(t,s,a);if(r.extensionsRequired&&r.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(t)}))},h.prototype.detectSupport=function(){return this.isSupported||(this.isSupported=new Promise((function(t){var e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported},f.prototype.loadBufferView=function(t){var e=this.parser.json,n=e.bufferViews[t];if(n.extensions&&n.extensions[this.name]){var r=n.extensions[this.name],i=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([i,o.ready]).then((function(t){var e=r.byteOffset||0,n=r.byteLength||0,i=r.count,s=r.byteStride,a=new ArrayBuffer(i*s),l=new Uint8Array(t[0],e,n);return o.decodeGltfBuffer(new Uint8Array(a),i,s,l,r.mode,r.filter),a}))}return null};var d="glTF",p=1313821514,m=5130562;function g(t){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var e=new DataView(t,0,12);if(this.header={magic:da(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==d)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var r=this.header.length-12,i=new DataView(t,12),o=0;o",e).replace("#include ",n).replace("#include ",r).replace("#include ",i).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(t){s.specular.value=t}},specularMap:{get:function(){return s.specularMap.value},set:function(t){s.specularMap.value=t,t?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return s.glossiness.value},set:function(t){s.glossiness.value=t}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(t){s.glossinessMap.value=t,t?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function x(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return b},extendParams:function(t,e,n){var r=e.extensions[this.name];t.color=new Ut(1,1,1),t.opacity=1;var i=[];if(Array.isArray(r.diffuseFactor)){var o=r.diffuseFactor;t.color.fromArray(o),t.opacity=o[3]}if(void 0!==r.diffuseTexture&&i.push(n.assignTexture(t,"map",r.diffuseTexture)),t.emissive=new Ut(0,0,0),t.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,t.specular=new Ut(1,1,1),Array.isArray(r.specularFactor)&&t.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){var s=r.specularGlossinessTexture;i.push(n.assignTexture(t,"glossinessMap",s)),i.push(n.assignTexture(t,"specularMap",s))}return Promise.all(i)},createMaterial:function(t){var e=new b(t);return e.fog=!0,e.color=t.color,e.map=void 0===t.map?null:t.map,e.lightMap=null,e.lightMapIntensity=1,e.aoMap=void 0===t.aoMap?null:t.aoMap,e.aoMapIntensity=1,e.emissive=t.emissive,e.emissiveIntensity=1,e.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,e.bumpMap=void 0===t.bumpMap?null:t.bumpMap,e.bumpScale=1,e.normalMap=void 0===t.normalMap?null:t.normalMap,e.normalMapType=0,t.normalScale&&(e.normalScale=t.normalScale),e.displacementMap=null,e.displacementScale=1,e.displacementBias=0,e.specularMap=void 0===t.specularMap?null:t.specularMap,e.specular=t.specular,e.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,e.glossiness=t.glossiness,e.alphaMap=null,e.envMap=void 0===t.envMap?null:t.envMap,e.envMapIntensity=1,e.refractionRatio=.98,e}}}function w(){this.name=n.KHR_MESH_QUANTIZATION}function S(t,e,n,r){rs.call(this,t,e,n,r)}v.prototype.decodePrimitive=function(t,e){var n=this.json,r=this.dracoLoader,i=t.extensions[this.name].bufferView,o=t.extensions[this.name].attributes,s={},a={},l={};for(var c in o){var u=N[c]||c.toLowerCase();s[u]=o[c]}for(c in t.attributes){u=N[c]||c.toLowerCase();if(void 0!==o[c]){var h=n.accessors[t.attributes[c]],f=O[h.componentType];l[u]=f,a[u]=!0===h.normalized}}return e.getDependency("bufferView",i).then((function(t){return new Promise((function(e){r.decodeDracoFile(t,(function(t){for(var n in t.attributes){var r=t.attributes[n],i=a[n];void 0!==i&&(r.normalized=i)}e(t)}),s,l)}))}))},y.prototype.extendTexture=function(t,e){return t=t.clone(),void 0!==e.offset&&t.offset.fromArray(e.offset),void 0!==e.rotation&&(t.rotation=e.rotation),void 0!==e.scale&&t.repeat.fromArray(e.scale),void 0!==e.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),t.needsUpdate=!0,t},b.prototype=Object.create(Xo.prototype),b.prototype.constructor=b,b.prototype.copy=function(t){return Xo.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},S.prototype=Object.create(rs.prototype),S.prototype.constructor=S,S.prototype.copySampleValue_=function(t){for(var e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=t*r*3+r,o=0;o!==r;o++)e[o]=n[i+o];return e},S.prototype.beforeStart_=S.prototype.copySampleValue_,S.prototype.afterEnd_=S.prototype.copySampleValue_,S.prototype.interpolate_=function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=2*s,l=3*s,c=r-e,u=(n-e)/c,h=u*u,f=h*u,d=t*l,p=d-l,m=-2*f+3*h,g=f-h,v=1-m,y=g-h+u,b=0;b!==s;b++){var _=o[p+b+s],x=o[p+b+a]*c,w=o[d+b+s],M=o[d+b]*c;i[b]=v*_+y*x+m*w+g*M}return i};var E=0,T=1,C=2,A=3,P=4,L=5,R=6,O={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},k={9728:1003,9729:1006,9984:1004,9985:1007,9986:1005,9987:1008},I={33071:1001,33648:1002,10497:1e3},D={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},N={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},j={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},F={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300},z="OPAQUE",U="MASK",H="BLEND";function G(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}function W(t,e,n){for(var r in n.extensions)void 0===t[r]&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=n.extensions[r])}function V(t,e){void 0!==e.extras&&("object"==typeof e.extras?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function q(t,e){if(t.updateMorphTargets(),void 0!==e.weights)for(var n=0,r=e.weights.length;n=2&&i.setY(S,x[w*s+1]),s>=3&&i.setZ(S,x[w*s+2]),s>=4&&i.setW(S,x[w*s+3]),s>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i}))},Z.prototype.loadTexture=function(t){var e,r,i=this.json,o=this.options,s=i.textures[t],a=s.extensions||{};return(e=a[n.MSFT_TEXTURE_DDS]?i.images[a[n.MSFT_TEXTURE_DDS].source]:i.images[s.source]).uri&&(r=o.manager.getHandler(e.uri)),r||(r=a[n.MSFT_TEXTURE_DDS]?this.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:this.textureLoader),this.loadTextureImage(t,e,r)},Z.prototype.loadTextureImage=function(t,e,n){var r=this,i=this.json,o=this.options,s=i.textures[t],a=self.URL||self.webkitURL,l=e.uri,c=!1,u=!0;return"image/jpeg"===e.mimeType&&(u=!1),void 0!==e.bufferView&&(l=r.getDependency("bufferView",e.bufferView).then((function(t){if("image/png"===e.mimeType){var n=new DataView(t,25,1).getUint8(0,!1);u=6===n||4===n||3===n}c=!0;var r=new Blob([t],{type:e.mimeType});return l=a.createObjectURL(r)}))),Promise.resolve(l).then((function(t){return new Promise((function(e,r){var i=e;!0===n.isImageBitmapLoader&&(i=function(t){e(new lo(t))}),n.load(G(t,o.path),i,void 0,r)}))})).then((function(e){!0===c&&a.revokeObjectURL(l),e.flipY=!1,s.name&&(e.name=s.name),u||(e.format=1022);var n=(i.samplers||{})[s.sampler]||{};return e.magFilter=k[n.magFilter]||1006,e.minFilter=k[n.minFilter]||1008,e.wrapS=I[n.wrapS]||1e3,e.wrapT=I[n.wrapT]||1e3,r.associations.set(e,{type:"textures",index:t}),e}))},Z.prototype.assignTexture=function(t,e,r){var i=this;return this.getDependency("texture",r.index).then((function(o){if(void 0===r.texCoord||0==r.texCoord||"aoMap"===e&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+e+" not yet supported."),i.extensions[n.KHR_TEXTURE_TRANSFORM]){var s=void 0!==r.extensions?r.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;if(s){var a=i.associations.get(o);o=i.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(o,s),i.associations.set(o,a)}}t[e]=o}))},Z.prototype.assignFinalMaterial=function(t){var e=t.geometry,n=t.material,r=void 0!==e.attributes.tangent,i=void 0!==e.attributes.color,o=void 0===e.attributes.normal,s=!0===t.isSkinnedMesh,a=Object.keys(e.morphAttributes).length>0,l=a&&void 0!==e.morphAttributes.normal;if(t.isPoints){var c="PointsMaterial:"+n.uuid,u=this.cache.get(c);u||(u=new $i,Wt.prototype.copy.call(u,n),u.color.copy(n.color),u.map=n.map,u.sizeAttenuation=!1,this.cache.add(c,u)),n=u}else if(t.isLine){c="LineBasicMaterial:"+n.uuid;var h=this.cache.get(c);h||(h=new Hi,Wt.prototype.copy.call(h,n),h.color.copy(n.color),this.cache.add(c,h)),n=h}if(r||i||o||s||a){c="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),s&&(c+="skinning:"),r&&(c+="vertex-tangents:"),i&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),a&&(c+="morph-targets:"),l&&(c+="morph-normals:");var f=this.cache.get(c);f||(f=n.clone(),s&&(f.skinning=!0),i&&(f.vertexColors=!0),o&&(f.flatShading=!0),a&&(f.morphTargets=!0),l&&(f.morphNormals=!0),r&&(f.vertexTangents=!0,f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(c,f),this.associations.set(f,this.associations.get(n))),n=f}n.aoMap&&void 0===e.attributes.uv2&&void 0!==e.attributes.uv&&e.setAttribute("uv2",e.attributes.uv),t.material=n},Z.prototype.getMaterialType=function(){return Xo},Z.prototype.loadMaterial=function(t){var e,r=this,i=this.json,o=this.extensions,s=i.materials[t],a={},l=s.extensions||{},c=[];if(l[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var h=o[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];e=h.getMaterialType(),c.push(h.extendParams(a,s,r))}else if(l[n.KHR_MATERIALS_UNLIT]){var f=o[n.KHR_MATERIALS_UNLIT];e=f.getMaterialType(),c.push(f.extendParams(a,s,r))}else{var d=s.pbrMetallicRoughness||{};if(a.color=new Ut(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){var p=d.baseColorFactor;a.color.fromArray(p),a.opacity=p[3]}void 0!==d.baseColorTexture&&c.push(r.assignTexture(a,"map",d.baseColorTexture)),a.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,a.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture&&(c.push(r.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),c.push(r.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),e=this._invokeOne((function(e){return e.getMaterialType&&e.getMaterialType(t)})),c.push(Promise.all(this._invokeAll((function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,a)}))))}!0===s.doubleSided&&(a.side=2);var m=s.alphaMode||z;return m===H?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,m===U&&(a.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&e!==Vt&&(c.push(r.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new u(1,-1),void 0!==s.normalTexture.scale&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),void 0!==s.occlusionTexture&&e!==Vt&&(c.push(r.assignTexture(a,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(a.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&e!==Vt&&(a.emissive=(new Ut).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&e!==Vt&&c.push(r.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then((function(){var i;return i=e===b?o[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):new e(a),s.name&&(i.name=s.name),i.map&&(i.map.encoding=3001),i.emissiveMap&&(i.emissiveMap.encoding=3001),V(i,s),r.associations.set(i,{type:"materials",index:t}),s.extensions&&W(o,i,s),i}))},Z.prototype.createUniqueName=function(t){for(var e=Ua.sanitizeNodeName(t||""),n=e,r=1;this.nodeNamesUsed[n];++r)n=e+"_"+r;return this.nodeNamesUsed[n]=!0,n},Z.prototype.loadGeometries=function(t){var e=this,r=this.extensions,i=this.primitiveCache;function o(t){return r[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(n){return J(n,t,e)}))}for(var s,a,l=[],c=0,u=t.length;c0&&q(h,o),h.name=n.createUniqueName(o.name||"mesh_"+t),V(h,o),d.extensions&&W(i,h,d),n.assignFinalMaterial(h),l.push(h)}if(1===l.length)return l[0];var m=new Qr;for(c=0,u=l.length;c1?new Qr:1===e.length?e[0]:new bt)!==e[0])for(var a=0,l=e.length;a{if(!e.ok)throw new Error(`Failed to load file "${t}" with status ${e.status} : ${e.statusText}`);return e.arrayBuffer()}).then(t=>this.parse(t))}parse(t){const e=new DataView(t),n=String.fromCharCode(e.getUint8(0))+String.fromCharCode(e.getUint8(1))+String.fromCharCode(e.getUint8(2))+String.fromCharCode(e.getUint8(3));console.assert("b3dm"===n);const r=e.getUint32(4,!0);console.assert(1===r);const i=e.getUint32(8,!0);console.assert(i===t.byteLength);const o=e.getUint32(12,!0),s=e.getUint32(16,!0),a=e.getUint32(20,!0),l=e.getUint32(24,!0),c=t.slice(28,28+o+s),u=new yf(c,0,o,s),h=28+o+s,f=t.slice(h,h+a+l),d=new bf(f,u.getData("BATCH_LENGTH"),0,a,l),p=h+a+l;return{version:r,featureTable:u,batchTable:d,glbBytes:new Uint8Array(t,p,i-p)}}}{constructor(t=bs){super(),this.manager=t}parse(t){const e=super.parse(t),n=e.glbBytes.slice().buffer;return new Promise((t,r)=>{const i=this.manager;(i.getHandler("path.gltf")||new _f(i)).parse(n,null,n=>{const{batchTable:r,featureTable:i}=e,{scene:o}=n,s=i.getData("RTC_CENTER");s&&(o.position.x+=s[0],o.position.y+=s[1],o.position.z+=s[2]),n.batchTable=r,n.featureTable=i,o.batchTable=r,o.featureTable=i,t(n)},r)})}}class wf extends class{constructor(){this.fetchOptions={}}load(t){return fetch(t,this.fetchOptions).then(e=>{if(!e.ok)throw new Error(`Failed to load file "${t}" with status ${e.status} : ${e.statusText}`);return e.arrayBuffer()}).then(t=>this.parse(t))}parse(t){const e=new DataView(t),n=String.fromCharCode(e.getUint8(0))+String.fromCharCode(e.getUint8(1))+String.fromCharCode(e.getUint8(2))+String.fromCharCode(e.getUint8(3));console.assert("pnts"===n);const r=e.getUint32(4,!0);console.assert(1===r);const i=e.getUint32(8,!0);console.assert(i===t.byteLength);const o=e.getUint32(12,!0),s=e.getUint32(16,!0),a=e.getUint32(20,!0),l=e.getUint32(24,!0),c=t.slice(28,28+o+s),u=new yf(c,0,o,s),h=28+o+s,f=t.slice(h,h+a+l),d=new bf(f,u.getData("BATCH_LENGTH")||u.getData("POINTS_LENGTH"),0,a,l);return{version:r,featureTable:u,batchTable:d}}}{constructor(t=bs){super(),this.manager=t}parse(t){const e=super.parse(t),{featureTable:n}=e,r=n.getData("POINTS_LENGTH"),i=n.getData("POSITION",r,"FLOAT","VEC3"),o=n.getData("RGB",r,"UNSIGNED_BYTE","VEC3");if(null===i)throw new Error("PNTSLoader : POSITION_QUANTIZED feature type is not supported.");const s=new me;s.setAttribute("position",new Yt(i,3,!1));const a=new $i;a.size=2,a.sizeAttenuation=!1,null!==o&&(s.setAttribute("color",new Yt(o,3,!0)),a.vertexColors=!0);const l=new io(s,a);return e.scene=l,e.scene.featureTable=n,e}}const Mf=new _,Sf=new b,Ef=new _,Tf=new Y;class Cf extends class{constructor(){this.fetchOptions={},this.workingPath=""}resolveExternalURL(t){return this.workingPath+"/"+t}load(t){return fetch(t,this.fetchOptions).then(e=>{if(!e.ok)throw new Error(`Failed to load file "${t}" with status ${e.status} : ${e.statusText}`);return e.arrayBuffer()}).then(e=>{if(""===this.workingPath){const e=t.split(/\\\//g);e.pop(),this.workingPath=e.join("/")}return this.parse(e)})}parse(t){const e=new DataView(t),n=String.fromCharCode(e.getUint8(0))+String.fromCharCode(e.getUint8(1))+String.fromCharCode(e.getUint8(2))+String.fromCharCode(e.getUint8(3));console.assert("i3dm"===n);const r=e.getUint32(4,!0);console.assert(1===r);const i=e.getUint32(8,!0);console.assert(i===t.byteLength);const o=e.getUint32(12,!0),s=e.getUint32(16,!0),a=e.getUint32(20,!0),l=e.getUint32(24,!0),c=e.getUint32(28,!0),u=t.slice(32,32+o+s),h=new yf(u,0,o,s),f=32+o+s,d=t.slice(f,f+a+l),p=new bf(d,h.getData("INSTANCES_LENGTH"),0,a,l),m=f+a+l,g=new Uint8Array(t,m,i-m);let v=null,y=null;if(c)v=g,y=Promise.resolve();else{const t=this.resolveExternalURL(vf(g));y=fetch(t,this.fetchOptions).then(e=>{if(!e.ok)throw new Error(`I3DMLoaderBase : Failed to load file "${t}" with status ${e.status} : ${e.statusText}`);return e.arrayBuffer()}).then(t=>{v=new Uint8Array(t)})}return y.then(()=>({version:r,featureTable:h,batchTable:p,glbBytes:v}))}}{constructor(t=bs){super(),this.manager=t}resolveExternalURL(t){return this.manager.resolveURL(super.resolveExternalURL(t))}parse(t){return super.parse(t).then(t=>{const{featureTable:e,batchTable:n}=t,r=t.glbBytes.slice().buffer;return new Promise((t,i)=>{const o=this.manager;(o.getHandler("path.gltf")||new _f(o)).parse(r,null,r=>{const i=e.getData("INSTANCES_LENGTH"),o=e.getData("POSITION",i,"FLOAT","VEC3"),s=new Map,a=[];r.scene.traverse(t=>{if(t.isMesh){const{geometry:e,material:n}=t,r=new Ui(e,n,i);a.push(r),s.set(t,r)}});const l=new _;for(let t=0;t{const n=e.parent;n&&(n.remove(e),n.add(t),t.position.copy(l))});for(let t=0;t{if(!e.ok)throw new Error(`Failed to load file "${t}" with status ${e.status} : ${e.statusText}`);return e.arrayBuffer()}).then(e=>{if(""===this.workingPath){const e=t.split(/\\\//g);e.pop(),this.workingPath=e.join("/")}return this.parse(e)})}parse(t){const e=new DataView(t),n=String.fromCharCode(e.getUint8(0))+String.fromCharCode(e.getUint8(1))+String.fromCharCode(e.getUint8(2))+String.fromCharCode(e.getUint8(3));console.assert("cmpt"===n);const r=e.getUint32(4,!0);console.assert(1===r);const i=e.getUint32(8,!0);console.assert(i===t.byteLength);const o=e.getUint32(12,!0),s=[];let a=16;for(let e=0;e{i.push(t),r.add(t.scene)});o.push(e);break}case"pnts":{const t=a.slice(),e=new wf(n).parse(t.buffer);i.push(e),r.add(e.scene);break}case"i3dm":{const t=a.slice(),e=new Cf(n);e.workingPath=this.workingPath,e.fetchOptions=this.fetchOptions;const s=e.parse(t.buffer).then(t=>{i.push(t),r.add(t.scene)});o.push(s);break}}}return Promise.all(o).then(()=>({tiles:i,scene:r}))}}const Pf=new Y;class Lf extends Qr{constructor(t){super(),this.tilesRenderer=t}raycast(t,e){this.tilesRenderer.raycast(t,e)}updateMatrixWorld(t){if(this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldNeedsUpdate||t){null===this.parent?Pf.copy(this.matrix):Pf.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1;const t=Pf.elements,e=this.matrixWorld.elements;let n=!1;for(let r=0;r<16;r++){const i=t[r],o=e[r];if(Math.abs(i-o)>Number.EPSILON){n=!0;break}}if(n){this.matrixWorld.copy(Pf);const t=this.children;for(let e=0,n=t.length;e{Object.getPrototypeOf(t).raycast.call(t,e,n)})}const Bf=Symbol("INITIAL_FRUSTUM_CULLED"),zf=c.DEG2RAD,Uf=new Y,Hf=new Y,Gf=new _,Wf=new _,Vf=new _,qf=new _,Xf=new _(1,0,0),Yf=new _(0,1,0);function Zf(){}function Jf(t,e){t.traverse(t=>{t.frustumCulled=t[Bf]&&e})}class Kf extends class{get rootTileSet(){const t=this.tileSets[this.rootURL];return!t||t instanceof Promise?null:t}get root(){const t=this.rootTileSet;return t?t.root:null}constructor(t){this.tileSets={},this.rootURL=t,this.fetchOptions={},this.preprocessURL=null;const e=new lf;e.unloadPriorityCallback=gf;const n=new cf;n.maxJobs=4,n.priorityCallback=gf;const r=new cf;r.maxJobs=1,r.priorityCallback=gf,this.lruCache=e,this.downloadQueue=n,this.parseQueue=r,this.stats={parsing:0,downloading:0,failed:0,inFrustum:0,used:0,active:0,visible:0},this.frameCount=0,this.errorTarget=6,this.errorThreshold=1/0,this.loadSiblings=!0,this.displayActiveTiles=!1,this.maxDepth=1/0,this.stopAtEmptyTiles=!0}traverse(t,e){const n=this.tileSets[this.rootURL];n&&n.root&&mf(n.root,t,e)}update(){const t=this.stats,e=this.lruCache,n=this.tileSets,r=n[this.rootURL];if(!(this.rootURL in n))return void this.loadRootTileSet(this.rootURL);if(!r||!r.root)return;const i=r.root;t.inFrustum=0,t.used=0,t.active=0,t.visible=0,this.frameCount++,function t(e,n){const r=n.stats,i=n.frameCount,o=n.errorTarget,s=n.maxDepth,a=n.loadSiblings,l=n.lruCache,c=n.stopAtEmptyTiles;if(ff(e,i),!1===n.tileInView(e))return!1;if(e.__used=!0,l.markUsed(e),e.__inFrustum=!0,r.inFrustum++,(c||!e.__contentEmpty)&&!e.__externalTileSet){const t=n.calculateError(e);if(e.__error=t,t<=o)return!0;if(n.maxDepth>0&&e.__depth+1>=s)return!0}let u=!1;const h=e.children;for(let e=0,r=h.length;e{if(e.ok)return e.json();throw new Error(`TilesRenderer: Failed to load tileset "${t}" with status ${e.status} : ${e.statusText}`)}).then(e=>{const r=e.asset.version;console.assert("1.0"===r||"0.0"===r,'asset.version is expected to be a string of "1.0" or "0.0"');const i=af.a.dirname(t);return mf(e.root,(t,e)=>this.preprocessNode(t,e,i),null,n,n?n.__depth:0),e})}loadRootTileSet(t){const e=this.tileSets;if(t in e)return e[t]instanceof Error?Promise.reject(e[t]):Promise.resolve(e[t]);{const n=this.fetchTileSet(t,this.fetchOptions).then(n=>{e[t]=n});return n.catch(n=>{console.error(n),e[t]=n}),e[t]=n,n}}requestTileContents(t){if(0!==t.__loadingState)return;const e=this.stats,n=this.lruCache,r=this.downloadQueue,i=this.parseQueue,o=t.__externalTileSet;n.add(t,t=>{1===t.__loadingState?(t.__loadAbort.abort(),t.__loadAbort=null):o?t.children.length=0:this.disposeTile(t),1===t.__loadingState?e.downloading--:2===t.__loadingState&&e.parsing--,t.__loadingState=0,t.__loadIndex++,i.remove(t),r.remove(t)}),t.__loadIndex++;const s=t.__loadIndex,a=new AbortController,l=a.signal;e.downloading++,t.__loadAbort=a,t.__loadingState=1;const c=o=>{t.__loadIndex===s&&("AbortError"!==o.name?(i.remove(t),r.remove(t),2===t.__loadingState?e.parsing--:1===t.__loadingState&&e.downloading--,e.failed++,console.error(`TilesRenderer : Failed to load tile at url "${t.content.uri}".`),console.error(o),t.__loadingState=4):n.remove(t))};o?r.add(t,t=>{if(t.__loadIndex!==s)return Promise.resolve();const e=this.preprocessURL?this.preprocessURL(t.content.uri):t.content.uri;return this.fetchTileSet(e,Object.assign({signal:l},this.fetchOptions),t)}).then(n=>{t.__loadIndex===s&&(e.downloading--,t.__loadAbort=null,t.__loadingState=3,t.children.push(n.root))}).catch(c):r.add(t,t=>{if(t.__loadIndex!==s)return Promise.resolve();const e=this.preprocessURL?this.preprocessURL(t.content.uri):t.content.uri;return fetch(e,Object.assign({signal:l},this.fetchOptions))}).then(e=>{if(t.__loadIndex===s){if(e.ok)return e.arrayBuffer();throw new Error("Failed to load model with error code "+e.status)}}).then(n=>{if(t.__loadIndex===s)return e.downloading--,e.parsing++,t.__loadAbort=null,t.__loadingState=2,i.add(t,t=>{if(t.__loadIndex!==s)return Promise.resolve();const e=t.content.uri.split(/\./g).pop();return this.parseTile(n,t,e)})}).then(()=>{t.__loadIndex===s&&(e.parsing--,t.__loadingState=3,t.__wasSetVisible&&this.setTileVisible(t,!0),t.__wasSetActive&&this.setTileActive(t,!0))}).catch(c)}dispose(){const t=this.lruCache;this.traverse(e=>{t.remove(e)})}}{get autoDisableRendererCulling(){return this._autoDisableRendererCulling}set autoDisableRendererCulling(t){this._autoDisableRendererCulling!==t&&(super._autoDisableRendererCulling=t,this.traverse(e=>{e.scene&&Jf(e.scene,t)}))}constructor(...t){super(...t),this.group=new Lf(this),this.cameras=[],this.cameraMap=new Map,this.cameraInfo=[],this.activeTiles=new Set,this.visibleTiles=new Set,this._autoDisableRendererCulling=!0,this.onLoadTileSet=null,this.onLoadModel=null,this.onDisposeModel=null;const e=new ys;e.setURLModifier(t=>this.preprocessURL?this.preprocessURL(t):t),this.manager=e}getBounds(t){if(!this.root)return!1;const e=this.root.cached,n=e.box,r=e.boxTransform;return!!n&&(t.copy(n),t.applyMatrix4(r),!0)}getOrientedBounds(t,e){if(!this.root)return!1;const n=this.root.cached,r=n.box,i=n.boxTransform;return!!t&&(t.copy(r),e.copy(i),!0)}forEachLoadedModel(t){this.traverse(e=>{const n=e.cached.scene;n&&t(n,e)})}raycast(t,e){if(this.root)if(t.firstHitOnly){const n=function t(e,n,r,i){if(r.has(e)){if(Ff(e.cached.scene,i,Nf),Nf.length>0){Nf.length>1&&Nf.sort(jf);const t=Nf[0];return Nf.length=0,t}return null}const o=[],s=e.children;for(let t=0,e=s.length;t1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when raycasting.");let n={distance:1/0,tile:null};o.push(n),n.distance=kf.distanceToSquared(Df.origin)*t*t,n.tile=e}}}o.sort(jf);let a=1/0,l=null;for(let e=0,s=o.length;ea)break;{const e=s.tile,o=e.cached.scene;let c=null;if(r.has(e)?(Ff(o,i,Nf),Nf.length>0&&(Nf.length>1&&Nf.sort(jf),c=Nf[0])):c=t(e,n,r,i),c){const t=c.distance*c.distance;t{this.onLoadTileSet&&Promise.resolve().then(()=>{this.onLoadTileSet(e,t)})}),n}update(){const t=this.group,e=this.cameras,n=this.cameraMap,r=this.cameraInfo;if(0===e.length)return void console.warn("TilesRenderer: no cameras defined. Cannot update 3d tiles.");for(;r.length>e.length;)r.pop();for(;r.length1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when calculating screen space error.");for(let o=0,s=r.length;ot.scene);break;case"pnts":l=Promise.resolve(new wf(s).parse(t).scene);break;case"i3dm":{const e=new Cf(s);e.workingPath=i,e.fetchOptions=o,l=e.parse(t).then(t=>t.scene);break}case"cmpt":{const e=new Af(s);e.workingPath=i,e.fetchOptions=o,l=e.parse(t).then(t=>t.scene);break}default:console.warn(`TilesRenderer: Content type "${n}" not supported.`),l=Promise.resolve(null)}return l.then(t=>{if(e._loadIndex!==a)return;const n=this.rootTileSet.asset&&this.rootTileSet.asset.gltfUpAxis||"y",r=e.cached,i=r.transform;switch(n.toLowerCase()){case"x":t.matrix.makeRotationAxis(Yf,-Math.PI/2);break;case"y":t.matrix.makeRotationAxis(Xf,Math.PI/2)}t.matrix.premultiply(i),t.matrix.decompose(t.position,t.quaternion,t.scale),t.traverse(t=>{t[Bf]=t.frustumCulled}),Jf(t,this.autoDisableRendererCulling),r.scene=t,t.traverse(t=>{t.raycast=Zf});const o=[],s=[],l=[];t.traverse(t=>{if(t.geometry&&s.push(t.geometry),t.material){const e=t.material;o.push(t.material);for(const t in e){const n=e[t];n&&n.isTexture&&l.push(n)}}}),r.materials=o,r.geometry=s,r.textures=l,this.onLoadModel&&this.onLoadModel(t,e)})}disposeTile(t){const e=t.cached;if(e.scene){const n=e.materials,r=e.geometry,i=e.textures;for(let t=0,e=r.length;t=t.minZoom&&e.p.p.zoom<=t.maxZoom&&e.p.p._.tiledWorld.removeAllTiles(),e.p.p._.maxZoom=e.p.findHighestMaxZoom(),e.p.p._.minNativeZoom=e.p.findLowestMinZoom()}else console.warn("Attempted to add an invalid tile layer.")}},this.toggle=function(t,n){if(!e.p.p._.wasInitialized)return!1;var r=!1;return e.p.tile.forEach((function(e){t===e.name&&(e.on=null!=n?n:!e.on,r=!0)})),!!r&&(e.p.p._.tiledWorld.outdateAllTiles(),e.p.p._.maxZoom=e.p.findHighestMaxZoom(),e.p.p._.minNativeZoom=e.p.findLowestMinZoom(),!0)},this.setOpacity=function(t,n){if(!e.p.p._.wasInitialized)return!1;for(var r=0;r=e.p.tile[n].minZoom&&e.p.p.zoom<=e.p.tile[n].maxZoom)for(var r=e.p.p._.tiledWorld.tilesDrawn.length,i=0;i=t.minZoom&&e.p.p.zoom<=t.maxZoom&&e.p.p._.tiledWorld.updateAllRasters(),"function"==typeof n&&n()};if(e.p.p._.tiledWorld.killDrawingTiles(),t.hasOwnProperty("name")&&t.hasOwnProperty("on")&&(!0===t.preDrawn&&t.hasOwnProperty("data")||(t.hasOwnProperty("geojsonPath")||t.hasOwnProperty("geojson"))&&t.hasOwnProperty("minZoom")&&t.hasOwnProperty("maxZoom")))if(t.hasOwnProperty("geojsonPath")&&!t.hasOwnProperty("geojson")){t.hasOwnProperty("opacity")||(t.opacity=1);var o=new XMLHttpRequest;o.open("GET",t.geojsonPath,!0),o.responseType="json",o.withCredentials=!0===t.withCredentials||!1,o.onload=function(){404!==o.status&&o.response?(t.geojson=o.response,i()):console.warn("Failed to fetch geojson data for clamped layer: "+t.name)},o.send()}else i();else console.warn("Attempted to add an invalid clamped layer: "+t.name)}},this.toggle=function(t,n){if(!e.p.p._.wasInitialized)return!1;var r=!1;return e.p.clamped.forEach((function(e){t===e.name&&(e.on=null!=n?n:!e.on,r=!0)})),!!r&&(e.p.p._.tiledWorld.updateAllRasters(),!0)},this.setOpacity=function(t,n){if(!e.p.p._.wasInitialized)return!1;for(var r=function(r){var i=e.p.clamped[r];if(t===i.name)return clearTimeout(nd),nd=setTimeout((function(){i.opacity=Math.max(Math.min(n,1),0),e.p.p.zoom>=i.minZoom&&e.p.p.zoom<=i.maxZoom&&(e.p.p._.tiledWorld.killDrawingTiles(),e.p.p._.tiledWorld.updateAllRasters())}),250),{value:!0}},i=0;i=r&&e.p.p.zoom<=i&&(e.p.p._.tiledWorld.killDrawingTiles(),e.p.p._.tiledWorld.updateAllRasters()),!0}return!1},this.getClampedTexture=function(t,n){var r=.5,i=e.p.clamped[t],o=document.createElement("canvas");o.id="vectorsastile",o.width=256/r,r*=Math.pow(2,e.p.p.zoom-n.z),o.height=o.width;var s,a,l=o.getContext("2d"),c=[];if(r<128)if(i.preDrawn)l.imageSmoothingEnabled=!1,i.data&&i.data[n.z]&&i.data[n.z][n.x]&&null!=i.data[n.z][n.x][n.y]&&l.drawImage(i.data[n.z][n.x][n.y],0,0,o.width,o.height);else for(var u=0,h=i.geojson.features;u=0&&w=0&&M=0&&w=0&&M=0&&w=0&&M=0&&w=0&&M=0&&w=0&&M\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include \n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include \n\t\t\t#include \n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t"};var sd=function(t){Be.call(this,{type:"LineMaterial",uniforms:Fe.clone(tn.line.uniforms),vertexShader:tn.line.vertexShader,fragmentShader:tn.line.fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),this.setValues(t)};(sd.prototype=Object.create(Be.prototype)).constructor=sd,sd.prototype.isLineMaterial=!0;var ad,ld,cd=function(t,e){void 0===t&&(t=new id),void 0===e&&(e=new sd({color:16777215*Math.random()})),ke.call(this,t,e),this.type="LineSegments2"};cd.prototype=Object.assign(Object.create(ke.prototype),{constructor:cd,isLineSegments2:!0,computeLineDistances:(ad=new _,ld=new _,function(){for(var t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,r=new Float32Array(2*e.data.count),i=0,o=0,s=e.data.count;ix&&e.z>x)){if(t.z>x){const n=t.z-e.z,r=(t.z-x)/n;t.lerp(e,r)}else if(e.z>x){const n=e.z-t.z,r=(e.z-x)/n;e.lerp(t,r)}t.applyMatrix4(d),e.applyMatrix4(d),t.multiplyScalar(1/t.w),e.multiplyScalar(1/e.w),t.x*=g.x/2,t.y*=g.y/2,e.x*=g.x/2,e.y*=g.y/2,o.start.copy(t),o.start.z=0,o.end.copy(e),o.end.z=0;var E=o.closestPointToPointParameter(r,!0);o.at(E,s);var T=c.lerp(t.z,e.z,E),C=T>=-1&&T<=1,A=r.distanceTo(s)<.5*v;if(C&&A){o.start.fromBufferAttribute(y,M),o.end.fromBufferAttribute(b,M),o.start.applyMatrix4(w),o.end.applyMatrix4(w);var P=new _,L=new _;h.distanceSqToSegment(o.start,o.end,L,P),l.push({point:L,pointOnLine:P,distance:h.origin.distanceTo(L),object:this,face:null,faceIndex:M,uv:null,uv2:null})}}}}}()});var ud=function(t,e){void 0===t&&(t=new od),void 0===e&&(e=new sd({color:16777215*Math.random()})),cd.call(this,t,e),this.type="Line2"};ud.prototype=Object.assign(Object.create(cd.prototype),{constructor:ud,isLine2:!0});var hd={spriteMaterials:{},makeMarkerSprite:function(t,e,n){var r=new wi(hd.makeMarkerMaterial(t,e,n));return r.style=r.style||{},r.style.radius=t.hasOwnProperty("radius")?t.radius:32,r},makeMarkerMaterial:function(t,e,n){if(e&&this.spriteMaterials.hasOwnProperty(e)&&!0!==n)return this.spriteMaterials[e];void 0===t&&(t={});var r=t.hasOwnProperty("radius")?t.radius:64;r=Math.max(r,64);var i=t.hasOwnProperty("fillColor")?t.fillColor:{r:255,g:255,b:255,a:null!=t.fillOpacity?t.fillOpacity:1},o=t.hasOwnProperty("weight")?t.weight:4,s=t.hasOwnProperty("color")?t.color:{r:0,g:0,b:0,a:1},a=document.createElement("canvas"),l=a.getContext("2d"),c=2*r,u=2*r;a.width=c,a.height=u,l.beginPath(),l.arc(a.width/2,a.height/2,r-o*(r/12),0,2*Math.PI,!1),l.fillStyle="object"==typeof i?"rgba("+i.r+","+i.g+","+i.b+","+i.a+")":i,l.fill(),l.lineWidth=o*(r/8),l.strokeStyle="object"==typeof s?"rgba("+s.r+","+s.g+","+s.b+","+s.a+")":s,l.stroke();var h=new m(a);h.needsUpdate=!0;var f=new li({map:h,transparent:!0,alphaTest:.01});return e&&!0!==n&&(this.spriteMaterials[e]=f),f},makeTextSprite:function(t,e){void 0===e&&(e={});var n=e.hasOwnProperty("fontface")?e.fontface:"Arial",r=e.hasOwnProperty("fontsize")?e.fontsize:18,i=e.hasOwnProperty("strokeWeight")?e.strokeWeight:4,o=e.hasOwnProperty("strokeColor")?e.strokeColor:{r:0,g:0,b:0,a:1},s=e.hasOwnProperty("fontColor")?e.fontColor:{r:255,g:255,b:255,a:1},a=document.createElement("canvas"),l=a.getContext("2d");a.width=1024,a.height=64,l.font="Bold "+r+"px "+n,l.strokeStyle="rgba("+o.r+","+o.g+","+o.b+","+o.a+")",l.lineWidth=i,l.fillStyle="rgba("+s.r+","+s.g+","+s.b+","+s.a+")",l.textAlign="left",l.strokeText(t,512+r,64-r/1.8),l.fillText(t,512+r,64-r/1.8);var c=new m(a);c.needsUpdate=!0;var u=new wi(new li({map:c}));return u.scale.set(64,4,1),u}},fd=hd,dd=function(t){var e=this;this.add=function(t,n){if(e.p.p._.wasInitialized){var r=!1,i=function(){for(var i=0;it&&(t=e.tile[n].maxZoom);return t},this.findLowestMinZoom=function(){var t=1/0;for(var n in e.tile)e.tile[n].on&&e.tile[n].minZoom","
N
","","","","","","","","","
",""].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_compass_azimuth").addEventListener("mouseenter",(function(t){t.target.style.opacity="1"})),document.getElementById("_lithosphere_control_compass_azimuth").addEventListener("mouseleave",(function(t){t.target.style.opacity="0"}))},this.onUpdate=function(){n.setDirection()},this.setDirection=function(){var t,e,r,i=n.p._.cameras.isFirstPerson?n.p._.cameras.firstPerson:n.p._.cameras.orbit;if(null!=i){if(n.p._.cameras.isFirstPerson)e=-(i.controls.getObject().rotation.y%(2*Math.PI)+Math.PI)*(180/Math.PI);else{var o=i.camera.position.x,s=i.camera.position.z;e=Math.atan2(o,s)*(180/Math.PI)}r=i.camera.fov}t=function(t,e,n,r,i){var o=gd(t,e,n,i),s=gd(t,e,n,r),a=i-r<=180?"0":"1";return["M",o.x,o.y,"A",n,n,0,a,0,s.x,s.y,"L",t,e].join(" ")}(20,20,20,e-r/2,e+r/2),document.getElementById("_lithosphere_control_compass_arc").setAttribute("d",t),e<0&&(e+=360),document.getElementById("_lithosphere_control_compass_azimuth").innerHTML=parseInt(e)+" °"},this.p=t,this.name=e,this._={},this.corner="BottomLeft"};function gd(t,e,n,r){var i=(r-90)*Math.PI/180;return{x:t+n*Math.cos(i),y:e+n*Math.sin(i)}}var vd=function(t,e,n){var r=this;this.getControl=function(){var t=(null!=r.params.existingDivId?"display: none; ":"")+"background: black; padding: 5px; font-size: 14px;";return["
","
"].join("")},this.attachEvents=function(){},this.onUpdate=function(){(r.p._.mouseIsInScene||r.p._.cameras.isFirstPerson)&&r.updateMouseCoords()},this.updateMouseCoords=function(){var t="Outer Space";null!=r.p.mouse.lat&&null!=r.p.mouse.lng&&(t=r.p.mouse.lng.toFixed(8)+"°, "+r.p.mouse.lat.toFixed(8)+"°, "+r.p.mouse.elev.toFixed(3)+"m");var e=document.getElementById("_lithosphere_control_coordinate_root");if(e&&e.innerHTML!=t&&(e.innerHTML=t),null!=r.params.existingDivId){var n=document.getElementById(r.params.existingDivId);n&&n.innerHTML!=t&&(n.innerHTML=t)}},this.p=t,this.name=e,this.params=n||{},this._={},this.corner="BottomRight"},yd=function(t,e){var n=this;this.getControl=function(){return["
",'','',"","
"].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_home_root").addEventListener("click",(function(){n.p.setCenter(n.p.options.initialView,null,!0)}))},this.p=t,this.name=e,this._={},this.corner="TopLeft"},bd=function(t,e){var n=this;this.getControl=function(){return["
",'
',n.getInactiveContent(),"
","",n.getActiveContent(),"","
"].join("")},this.attachEvents=function(){document.getElementById(n.id).addEventListener("mouseenter",(function(){document.getElementById(n.id+"_active").innerHTML=n.getActiveContent(),n.attachEventsInternal(),document.getElementById(n.id+"_active").style.pointerEvents="all",document.getElementById(n.id+"_active").style.opacity="1"})),document.getElementById(n.id+"_active").addEventListener("mouseleave",(function(){document.getElementById(n.id+"_active").style.pointerEvents="none",document.getElementById(n.id+"_active").style.opacity="0"}))},this.getInactiveContent=function(){return['','',""].join("")},this.getActiveContent=function(){var t=[];for(var e in n.p.layers.all)if(n.p.layers.all[e].length>0){for(var r=[],i=0,o=n.p.layers.all[e];i','
','',''+s.name+"","
",'
','',"
",""].join(""))}t.push(['
','
'+e+"
",'
    ',r.join(""),"
","
"].join(""))}return['
',t.join(""),"
"].join("")},this.attachEventsInternal=function(){for(var t=function(t){t.addEventListener("click",(function(e){n.p.toggleLayer(t.getAttribute("layer-name"))}))},e=0,r=document.getElementsByClassName(n.id+"_toggle");e",n.getInactiveContent(),"",n.getActiveContent(),"",""].join("")},this.attachEvents=function(){document.getElementById(n.id).addEventListener("mouseenter",(function(){document.getElementById(n.id+"_active").style.pointerEvents="all",document.getElementById(n.id+"_active").style.opacity="1"})),document.getElementById(n.id+"_active").addEventListener("mouseleave",(function(){document.getElementById(n.id+"_active").style.pointerEvents="none",document.getElementById(n.id+"_active").style.opacity="0"}));for(var t=document.getElementsByClassName(n.id+"_option"),e=function(e){t[e].addEventListener("click",(function(){for(var r=parseFloat(t[e].getAttribute("value")),i=0;i','','',"",""].join("")},this.getActiveContent=function(){return['
',n.getInactiveContent(),'
','
1x
','
2x
','
5x
',"
","
"].join("")},this.setExaggeration=function(t){n.p.options.exaggeration=t,n.p._.tiledWorld.removeAllTiles()},this.id="_lithosphere_control_exaggerate_root",this.p=t,this.name=e,this._={},this.corner="TopLeft",this.exaggeration=1},xd=function(t,e){var n=this;this.getControl=function(){return["
",n.getInactiveContent(),"",n.getActiveContent(),"","
"].join("")},this.getInactiveContent=function(){return["
",'','',"","
"].join("")},this.getActiveContent=function(){var t=n.p.getCenter();return['
',n.getInactiveContent(),'
',"
","
    ","
  • ","
    Field of View
    ","","
    °
    ","","
  • ","
  • ","
    Vertical FOV
    ","","
    °
    ","
  • ","
  • ","
    Focal Length
    ","","
    m
    m
    ","
  • ","
  • ","
    Azimuth
    ","","
    °
    ","
  • ","
  • ","
    Elevation
    ","","
    °
    ","
  • ","
  • ","
    Height
    ","","
    m
    ","
  • ","
  • ","
    Latitude
    ","","
    °
    ","
  • ","
  • ","
    Longitude
    ","","
    °
    ","
  • ","
","
","","
Observe
","
","
","
","
"].join("")},this.attachEvents=function(){document.getElementById(n.id).addEventListener("mouseenter",(function(){document.getElementById(n.id+"_active").style.pointerEvents="all",document.getElementById(n.id+"_active").style.opacity="1"})),document.getElementById(n.id+"_active").addEventListener("mouseleave",(function(){document.getElementById(n.id+"_active").style.pointerEvents="none",document.getElementById(n.id+"_active").style.opacity="0"})),document.getElementById("_lithosphere_WalkStand").addEventListener("click",(function(){n.setCamera(!0),n.toggleFOVOverlay(!0);var t=n.getObserverValues();n.updateFOVOverlayBounds(t.vfieldofview,t.elevation,t.fieldofview,t.azimuth),document.addEventListener("keydown",n.keydownObserverSettings);try{n.p.controls.controlContainer.removeChild(n.helpDiv)}catch(t){}var e=["
W
Up
","
A
Left
","
S
Down
","
D
Right
","
R
Higher
","
F
Lower
","
T
FOV +
","
G
FOV -
","
Y
vFOV +
","
H
vFOV -
","
SHIFT+
Fast
","
ESC
Quit
"].join("\n");n.helpDiv=document.createElement("div"),n.helpDiv.id="_lithosphere_control_walk_help",n.helpDiv.style="position: absolute; bottom: 47px; right: 15px; background: black; font-size: 13px;",n.helpDiv.innerHTML=e,n.p.controls.controlContainer.appendChild(n.helpDiv)}))},this.setCamera=function(t,e){var r=n.getObserverValues();n.p.setCenter({lat:r.latitude,lng:r.longitude,zoom:n.p.zoom},!0),n.p._.cameras.setFirstPersonHeight(r.height),n.p._.cameras.setCameraAzimuthElevation(r.azimuth,r.elevation,!0),n.p._.cameras.setFirstPersonFocalLength(r.focallength),n.p._.cameras.setFirstPersonFOV(Math.max(r.vfieldofview,60)),n.p._.cameras.swap(t,e),"onpointerlockchange"in document?document.addEventListener("pointerlockchange",n.leaveObserver,!1):"onmozpointerlockchange"in document&&document.addEventListener("mozpointerlockchange",n.leaveObserver,!1)},this.leaveObserver=function(){if(document.pointerLockElement===document.body||document.mozPointerLockElement===document.body);else try{n.p.controls.controlContainer.removeChild(n.helpDiv),n.toggleFOVOverlay(!1),document.removeEventListener("keydown",n.keydownObserverSettings)}catch(t){}},this.getObserverValues=function(){return{fieldofview:parseFloat(document.getElementById("_lithosphere_WalkSettingsFovValue").value)||60,fieldofviewRaw:parseFloat(document.getElementById("_lithosphere_WalkSettingsFovValueRaw").value)||60,vfieldofview:parseFloat(document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value)||60,focallength:parseFloat(document.getElementById("_lithosphere_WalkSettingsFocalLengthValue").value)||35,azimuth:parseFloat(document.getElementById("_lithosphere_WalkSettingsAzimuthValue").value)||0,elevation:parseFloat(document.getElementById("_lithosphere_WalkSettingsElevationValue").value)||0,height:parseFloat(document.getElementById("_lithosphere_WalkSettingsHeightValue").value)||3,latitude:parseFloat(document.getElementById("_lithosphere_WalkSettingsLatitudeValue").value)||n.p.getCenter().lat||0,longitude:parseFloat(document.getElementById("_lithosphere_WalkSettingsLongitudeValue").value)||n.p.getCenter().lon||0}},this.keydownObserverSettings=function(t){var e=n.getObserverValues();84===t.which?document.getElementById("_lithosphere_WalkSettingsFovValue").value=+(e.fieldofview+(t.shiftKey?1:.2)).toFixed(4):71===t.which?document.getElementById("_lithosphere_WalkSettingsFovValue").value=+(e.fieldofview-(t.shiftKey?1:.2)).toFixed(4):89===t.which?document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value=+(e.vfieldofview+(t.shiftKey?1:.2)).toFixed(4):72===t.which?document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value=+(e.vfieldofview-(t.shiftKey?1:.2)).toFixed(4):68===t.which?document.getElementById("_lithosphere_WalkSettingsAzimuthValue").value=+(e.azimuth+(t.shiftKey?1:.2)).toFixed(4):65===t.which?document.getElementById("_lithosphere_WalkSettingsAzimuthValue").value=+(e.azimuth-(t.shiftKey?1:.2)).toFixed(4):87===t.which?document.getElementById("_lithosphere_WalkSettingsElevationValue").value=+(e.elevation+(t.shiftKey?1:.2)).toFixed(4):83===t.which?document.getElementById("_lithosphere_WalkSettingsElevationValue").value=+(e.elevation-(t.shiftKey?1:.2)).toFixed(4):82===t.which?document.getElementById("_lithosphere_WalkSettingsHeightValue").value=+(e.height+(t.shiftKey?1:.2)).toFixed(4):70===t.which&&(document.getElementById("_lithosphere_WalkSettingsHeightValue").value=+(e.height-(t.shiftKey?1:.2)).toFixed(4));var r=n.getObserverValues();n.p._.cameras.setFirstPersonHeight(r.height),n.p._.cameras.setCameraAzimuthElevation(r.azimuth,r.elevation,!0),r.vfieldofview!==e.vfieldofview?(n.p._.cameras.setFirstPersonFOV(Math.max(r.vfieldofview,60)),document.getElementById("_lithosphere_WalkSettingsFocalLengthValue").value=+n.p._.cameras.getFirstPersonFocalLength().toFixed(4)):r.focallength!==e.focallength&&(n.p._.cameras.setFirstPersonFocalLength(r.focallength),document.getElementById("_lithosphere_WalkSettingsFovValue").value=+n.p._.cameras.getFirstPersonFOV().toFixed(4)),n.updateFOVOverlayBounds(r.vfieldofview,r.elevation,r.fieldofview,r.azimuth)},this.toggleFOVOverlay=function(t){var e=document.getElementById("_lithosphere_WalkFOVOverlay");if(t){if(null==e){var r=document.createElement("div");r.id="_lithosphere_WalkFOVOverlay",r.style=["position: absolute","left: 0","top: 0","width: 100%","height: 100%","pointer-events: none"].join(";"),r.innerHTML=["
","
","
","
","
","
","
","
"].join("\n"),n.p.getContainer().appendChild(r)}}else null!=e&&n.p.getContainer().removeChild(e)},this.updateFOVOverlayBounds=function(t,e,r,i){t=document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value;var o=n.p._.cameras.getFirstPersonFOV(),s=n.p.getContainer().getBoundingClientRect(),a=s.height*(t/o),l=(s.height/2-a/2)/s.height*100,c=(s.height/2+a/2)/s.height*100,u=s.height/o*r,h=(s.width/2-u/2)/s.width*100,f=(s.width/2+u/2)/s.width*100,d=document.getElementById("_lithosphere_Walk_NW");d.style.top="0%",d.style.height=l+"%",d.style.left="0%",d.style.width=h+"%";var p=document.getElementById("_lithosphere_Walk_N");p.style.top="0%",p.style.height=l+"%",p.style.left=h+"%",p.style.width=f-h+"%";var m=document.getElementById("_lithosphere_Walk_NE");m.style.top="0%",m.style.height=l+"%",m.style.left=f+"%",m.style.width=100-f+"%";var g=document.getElementById("_lithosphere_Walk_E");g.style.top=l+"%",g.style.height=c-l+"%",g.style.left=f+"%",g.style.width=100-f+"%";var v=document.getElementById("_lithosphere_Walk_SE");v.style.top=c+"%",v.style.height=100-c+"%",v.style.left=f+"%",v.style.width=100-f+"%";var y=document.getElementById("_lithosphere_Walk_S");y.style.top=c+"%",y.style.height=100-c+"%",y.style.left=h+"%",y.style.width=f-h+"%";var b=document.getElementById("_lithosphere_Walk_SW");b.style.top=c+"%",b.style.height=100-c+"%",b.style.left="0%",b.style.width=h+"%";var _=document.getElementById("_lithosphere_Walk_W");_.style.top=l+"%",_.style.height=c-l+"%",_.style.left="0%",_.style.width=h+"%"},this.p=t,this.name=e,this.id="_lithosphere_control_observe_root",this._={},this.corner="TopLeft"},wd=function(t,e){var n=this;this.getControl=function(){return["
",'','',"","
"].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_walk_root").addEventListener("click",(function(){n.setCamera(!1);try{n.p.controls.controlContainer.removeChild(n.helpDiv)}catch(t){}var t=["
W
Forward
","
A
Left
","
S
Back
","
D
Right
","
SHIFT+
Fast
","
ESC
Quit
"].join("\n");n.helpDiv=document.createElement("div"),n.helpDiv.id="_lithosphere_control_walk_help",n.helpDiv.style="position: absolute; bottom: 47px; right: 15px; background: black; font-size: 13px;",n.helpDiv.innerHTML=t,n.p.controls.controlContainer.appendChild(n.helpDiv)}))},this.setCamera=function(t,e){n.p._.cameras.swap(t,e),"onpointerlockchange"in document?document.addEventListener("pointerlockchange",n.leaveWalking,!1):"onmozpointerlockchange"in document&&document.addEventListener("mozpointerlockchange",n.leaveWalking,!1)},this.leaveWalking=function(){if(document.pointerLockElement===document.body||document.mozPointerLockElement===document.body);else try{n.p.controls.controlContainer.removeChild(n.helpDiv)}catch(t){}},this.p=t,this.name=e,this.helpDiv=null,this._={},this.corner="TopLeft"},Md=function(t,e,n){var r=this;this.getControl=function(){return[""].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_link_root").addEventListener("click",(function(){r.return.isLinked=!r.return.isLinked;var t=document.getElementById("_lithosphere_control_link_root");r.return.isLinked?(t.style.background="#FBC02D",t.style.color="black"):(t.style.background="black",t.style.color="white"),"function"==typeof r.params.onToggle&&r.params.onToggle(r.return.isLinked)}))},this.getReturn=function(){return r.return},this.onMove=function(t,e,n){r.return.isLinked&&"function"==typeof r.params.onMove&&(r._.linkPanned=!0,r.params.onMove(t,e,n),clearTimeout(r._.linkPannedTimeout),r._.linkPannedTimeout=setTimeout((function(){r._.linkPanned=!1}),500))},this.onMouseMove=function(t,e,n){r.return.isLinked&&"function"==typeof r.params.onMouseMove&&r.params.onMouseMove(t,e,n)},this.onMouseOut=function(){r.return.isLinked&&"function"==typeof r.params.onMouseOut&&r.params.onMouseOut()},this.onFirstPersonUpdate=function(){"function"==typeof r.params.onFirstPersonUpdate&&r.params.onFirstPersonUpdate()},this.onOrbitalUpdate=function(){"function"==typeof r.params.onOrbitalUpdate&&r.params.onOrbitalUpdate()},this.setLink=function(t,e,n){if(r.p._.wasInitialized&&(null!=r._.targetPoint&&r.p.frontGroup.remove(r._.targetPoint),null!=t)){var i=new me,o=new Vt({color:65280});r._.targetPoint=new ke(i,o);var s=r.p.getElevationAtLngLat(t.lng,t.lat);if(0!=s){var a=r.p.projection.lonLatToVector3(t.lng,t.lat,(s+.4)*r.p.options.exaggeration);e=e||{radius:8,fillColor:{r:0,g:255,b:0,a:.7},weight:2,color:"rgb(0,255,0)"},null==n&&(n="linkTargetPoint");var l=fd.makeMarkerSprite(e,n);l.style=e,r._.targetPoint.attenuate=!0,r._.targetPoint.position.set(a.x,a.y,a.z),r._.targetPoint.add(l),r.p.frontGroup.add(r._.targetPoint),r.p._.events._attenuate(),r.p._.events._refreshFrontGroupRotation()}}},this.linkMove=function(t,e){r.return.isLinked&&!r._.linkPanned&&r.p.setCenter({lat:e,lng:t,z:0},!0)},this.linkMouseMove=function(t,e){r.return.isLinked&&r.setLink({lat:e,lng:t})},this.linkMouseOut=function(){r.setLink()},this.p=t,this.name=e,this.params=n||{},this._={linkPanned:!1,linkPannedTimeout:null},this.corner="TopLeft",this.return={isLinked:this.params.initiallyLinked||!1,linkMove:this.linkMove,linkMouseMove:this.linkMouseMove,linkMouseOut:this.linkMouseOut}},Sd=function(t){var e=this;this.addControl=function(t,n,r,i){if(null==e.activeControls[t]){try{e.activeControls[t]=new n(e.p,t,r)}catch(n){return null!=e.activeControls[t]&&delete e.activeControls[t],void console.warn("Error adding UI Element with name '"+t+"' -",n)}i=i||e.activeControls[t].corner||"TopLeft";var o=document.createElement("div");return o.setAttribute("id","_lithosphere_control_"+t),o.innerHTML=e.activeControls[t].getControl(),o.style.marginRight="5px","TopLeft"!==i&&"TopRight"!==i||(o.style.marginBottom="5px"),e.corners[i].appendChild(o),e.activeControls[t].attachEvents(),e.activeControls[t].getReturn?e.activeControls[t].getReturn():void 0}console.warn("UI Control control with identifying name '"+t+"' already exists. Remove the existing one or pick a different name to add this control.")},this.removeControl=function(t){delete e.activeControls[t],document.getElementById("_lithosphere_control_"+t).remove()},this._onUpdateEvent=function(){Object.values(e.activeControls).forEach((function(t){"function"==typeof t.onUpdate&&t.onUpdate()}))},this._onMove=function(t,n,r){Object.values(e.activeControls).forEach((function(e){"function"==typeof e.onMove&&e.onMove(t,n,r)}))},this._onMouseMove=function(t,n,r){Object.values(e.activeControls).forEach((function(e){"function"==typeof e.onMouseMove&&e.onMouseMove(t,n,r)}))},this._onMouseOut=function(t){Object.values(e.activeControls).forEach((function(e){"function"==typeof e.onMouseOut&&e.onMouseOut(t)}))},this._onFirstPersonUpdate=function(){Object.values(e.activeControls).forEach((function(t){"function"==typeof t.onFirstPersonUpdate&&t.onFirstPersonUpdate()}))},this._onOrbitalUpdate=function(t){Object.values(e.activeControls).forEach((function(e){"function"==typeof e.onOrbitalUpdate&&e.onOrbitalUpdate(t)}))},this.p=t,this.activeControls={},this.controlContainer=document.createElement("div"),this.controlContainer.setAttribute("id","_lithosphere_controls"),this.controlContainer.style.position="absolute",this.controlContainer.style.top="0",this.controlContainer.style.left="0",this.controlContainer.style.width="100%",this.controlContainer.style.height="100%",this.controlContainer.style.pointerEvents="none",this.controlContainer.style.color="white",this.controlContainer.style.fontFamily="sans-serif",this.controlContainer.style.zIndex="1000",this.p._.container.appendChild(this.controlContainer),this.corners={TopLeft:null,TopRight:null,BottomLeft:null,BottomRight:null},this.corners.TopLeft=document.createElement("div"),this.corners.TopLeft.setAttribute("id","_lithosphere_controls_topleft"),this.corners.TopLeft.style.position="absolute",this.corners.TopLeft.style.top="10px",this.corners.TopLeft.style.left="10px",this.corners.TopLeft.style.pointerEvents="all",this.corners.TopLeft.style.display="flex",this.corners.TopLeft.style.flexFlow="column",this.controlContainer.appendChild(this.corners.TopLeft),this.corners.TopRight=document.createElement("div"),this.corners.TopRight.setAttribute("id","_lithosphere_controls_topright"),this.corners.TopRight.style.position="absolute",this.corners.TopRight.style.top="10px",this.corners.TopRight.style.right="10px",this.corners.TopRight.style.pointerEvents="all",this.corners.TopRight.style.display="flex",this.controlContainer.appendChild(this.corners.TopRight),this.corners.BottomLeft=document.createElement("div"),this.corners.BottomLeft.setAttribute("id","_lithosphere_controls_bottomleft"),this.corners.BottomLeft.style.position="absolute",this.corners.BottomLeft.style.bottom="10px",this.corners.BottomLeft.style.left="10px",this.corners.BottomLeft.style.pointerEvents="all",this.corners.BottomLeft.style.display="flex",this.controlContainer.appendChild(this.corners.BottomLeft),this.corners.BottomRight=document.createElement("div"),this.corners.BottomRight.setAttribute("id","_lithosphere_controls_bottomright"),this.corners.BottomRight.style.position="absolute",this.corners.BottomRight.style.bottom="10px",this.corners.BottomRight.style.right="10px",this.corners.BottomRight.style.pointerEvents="all",this.corners.BottomRight.style.display="flex",this.controlContainer.appendChild(this.corners.BottomRight),this.compass=md,this.coordinates=vd,this.home=yd,this.layers=bd,this.exaggerate=_d,this.observe=xd,this.walk=wd,this.link=Md},Ed=(n(11),function(t){var e=this;this.end=function(t){!1!==e.p.options.loadingScreen&&e.loadingContainer&&(e.loadingContainer.style.opacity="0",e.p._.sceneContainer.style.filter="blur(0px) brightness(1)",setTimeout((function(){e.loadingContainer.remove(),e.loadingContainer=null,e.p._.sceneContainer.style.filter=null,e.p._.sceneContainer.style.transition=null}),500))},this.p=t,!1!==this.p.options.loadingScreen&&(this.loadingContainer=document.createElement("div"),this.loadingContainer.setAttribute("id","_lithosphere_loadingscreen"),this.loadingContainer.style.position="absolute",this.loadingContainer.style.top="0",this.loadingContainer.style.left="0",this.loadingContainer.style.width="100%",this.loadingContainer.style.height="100%",this.loadingContainer.style.background="black",this.loadingContainer.style.color="white",this.loadingContainer.style.fontFamily="sans-serif",this.loadingContainer.style.zIndex="9001",this.loadingContainer.style.opacity="1",this.loadingContainer.style.transition="opacity 0.5s ease-in",this.loadingContainer.innerHTML=["
","
","
","
","
","
","
","
"].join("\n"),this.p._.container.appendChild(this.loadingContainer),this.p._.sceneContainer.style.filter="blur(10px) brightness(0.5)",this.p._.sceneContainer.style.transition="filter 0.5s ease-in-out")}),Td=function(){return(Td=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0?(i[0].point.y+=n.planetCenter.y,i[0].point):new _(0,0,0)}var o={x:n.planetCenter.x,y:n.planetCenter.y,z:n.planetCenter.z};return o=n.projection.rotatePoint3D(o,{x:-n.planet.rotation.x,y:0,z:0}),o=n.projection.rotatePoint3D(o,{x:0,y:-n.planet.rotation.y,z:0}),o=n.projection.rotatePoint3D(o,{x:0,y:0,z:-n.planet.rotation.z}),new _(o.x,o.y,o.z)},this.getCenter=function(t){var e=n.getCenterXYZ(t);if(t){var r=JSON.parse(JSON.stringify(e));return r=n.projection.rotatePoint3D(r,{x:-n.planet.rotation.x,y:0,z:0}),r=n.projection.rotatePoint3D(r,{x:0,y:-n.planet.rotation.y,z:0}),r=n.projection.rotatePoint3D(r,{x:0,y:0,z:-n.planet.rotation.z}),(r=n.projection.vector3ToLatLng(r)).height=e.length()*n.projection.radiusScale-n.projection.radii.major,r}return n.projection.vector3ToLatLng(e)},this.getCenterElevation=function(){return n.getCenterXYZ(!0).length()*n.projection.radiusScale-n.projection.radii.major},this.getCenterElevationRaw=function(){var t=n.getCenterXYZ(!0).length();if(!(t<=.1&&t>=-.1))return t},this.getElevationAtLngLat=function(t,e){var r=n.projection.lonLatToVector3(t,e,1e5*n.options.exaggeration),i=new bt;i.position.set(0,-n.planetCenter.y,0),i.rotation.set(n.planet.rotation.x,n.planet.rotation.y,n.planet.rotation.z);var o=new ke(new Go(200,32,32),new Vt({color:16776960}));o.position.set(r.x,r.y,r.z),i.add(o),i.updateMatrixWorld();var s=new _;s.setFromMatrixPosition(o.matrixWorld),n._.raycaster.set(s,new _(0,-n.planetCenter.y,0).normalize());for(var a=[],l=0;l0?(c[c.length-1].point.y+=n.planetCenter.y,c[c.length-1].point.length()*n.projection.radiusScale-n.projection.radii.major):0},this.getCenterTile=function(){var t=n.getCenter();return n.projection.latLngZ2TileXYZ(t.lat,t.lng,n.zoom)},this.getCameras=function(){return{camera:n._.cameras.camera,isFirstPerson:n._.cameras.isFirstPerson,firstPerson:n._.cameras.firstPerson,orbit:n._.cameras.orbit}},this.getContainer=function(){return n._.container},this.invalidateSize=function(){n._.wasInitialized&&(n._.renderer.setSize(n._.sceneContainer.offsetWidth,n._.sceneContainer.offsetHeight),n._.cameras.updateSize())};var r=document.getElementById(t).appendChild(document.createElement("div"));r.id="_lithosphere_scene",r.style.width="100%",r.style.height="100%",this._={containerId:t,container:document.getElementById(t),sceneContainer:r,wasInitialized:!1,renderer:null,cameras:null,cameraPositionTarget:null,tiledWorld:null,events:null,maxZoom:0,minNativeZoom:0,loader:new As,raycaster:new Xa,updateEveryNthRender:2,counters:{update:0,frame:0},lastCameraWasFirst:!1,firstUpdate:!0,firstLoad:!1,loadingScreen:null,renderOnlyWhenOpen:!0,zCutOff:3,firstViewOverride:null,mouseIsInScene:!1,marsRadius:3396190},this._.container.style.position="relative",this.scene=new ii,this.scenesLOD=[new ii,new ii,new ii],this.sceneBack=new ii,this.sceneFront=new ii,this.planet=new bt,this.planetsLOD=[new bt,new bt,new bt],this.frontGroup=new bt;e=e||{},this.options=Td(Td({},{loadingScreen:!0,tileMapResource:null,customParsers:{},radiusOfTiles:4,useLOD:!0,LOD:[{radiusOfTiles:4,zoomsUp:3},{radiusOfTiles:2,zoomsUp:7},{radiusOfTiles:2,zoomsUp:11}],tileResolution:32,trueTileResolution:256,showAxes:!1,wireframeMode:!1,exaggeration:1,renderOnlyWhenOpen:!0,targetYOffset:0,highlightColor:"yellow",activeColor:"red"}),e),this._init()}return t.prototype._init=function(){if(this._.renderer=new pl(this._.sceneContainer).renderer,!this._.renderer)return!1;if(this._.wasInitialized=!0,this.projection=new gh(this.options.majorRadius,this.options.minorRadius,this.options.tileMapResource,this.options.trueTileResolution),this._.cameras=new bl(this._.container,this._.sceneContainer,this.scene,this.projection),this.layers=new pd(this),this.addLayer=this.layers.addLayer,this.removeLayer=this.layers.removeLayer,this.toggleLayer=this.layers.toggleLayer,this.setLayerOpacity=this.layers.setLayerOpacity,this._.tiledWorld=new Nh(this),this.zoom=10,this.trueZoom=this.zoom,this.mouse={lat:null,lng:null,elev:null},this.planetCenter=new _(0,-this.projection.radii.major/this.projection.radiusScale,0),this.planet.position.set(this.planetCenter.x,-this.planetCenter.y,this.planetCenter.z),this.scene.add(this.planet),this.scenesLOD[0].add(this.planetsLOD[0]),this.scenesLOD[1].add(this.planetsLOD[1]),this.scenesLOD[2].add(this.planetsLOD[2]),this.frontGroup.position.set(this.planetCenter.x,-this.planetCenter.y,this.planetCenter.z),this.sceneFront.add(this.frontGroup),this.scene.add(new la(16711422)),this.options.starsphere){var t=new Go(1e3*this.planetCenter.y,64,64),e=new Vt({color:this.options.starsphere.color||11184810});this.options.starsphere.url&&(e.map=this._.loader.load(this.options.starsphere.url)),e.opacity=1,this.starsphere=new ke(t,e),this.sceneBack.add(this.starsphere)}if(this.options.atmosphere&&(this.atmosphere=new ke(new Go(1.5*this.planetCenter.y,128,128),vh.atmosphere(this.options.atmosphere.color)),this.sceneBack.add(this.atmosphere)),!0===this.options.showAxes){var n=new Hi({color:16711680}),r=new Yi((new me).setFromPoints([new _(0,0,0),new _(2*this.planetCenter.y,0,0)]),n);this.scene.add(r);var i=new Hi({color:65280}),o=new Yi((new me).setFromPoints([new _(0,0,0),new _(0,2*this.planetCenter.y,0)]),i);this.scene.add(o);var s=new Hi({color:255}),a=new Yi((new me).setFromPoints([new _(0,0,0),new _(0,0,2*this.planetCenter.y)]),s);this.scene.add(a)}return this.controls=new Sd(this),this.addControl=this.controls.addControl,this.removeControl=this.controls.removeControl,!1===this.options.renderOnlyWhenOpen&&(this._.renderOnlyWhenOpen=!1),this._.loadingScreen=new Ed(this),this._.events=new of(this),this.setCenter(this.options.initialView),this._animate(),!0},t.prototype._render=function(){if(this._.renderer.clear(),this._.renderOnlyWhenOpen){var t=this._.container.getBoundingClientRect();if(t.width<=0||t.height<=0)return}this._.counters.update=(this._.counters.update+1)%this._.updateEveryNthRender,0===this._.counters.update?this._update():this._.cameras.isFirstPerson||this._.cameras.orbit.controls.update(),this.layers.tile3d.forEach((function(t){t.renderer.update()})),this._.renderer.render(this.sceneBack,this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scenesLOD[2],this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scenesLOD[1],this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scenesLOD[0],this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scene,this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.sceneFront,this._.cameras.camera)},t.prototype._update=function(){if(this._.wasInitialized){if(this._.renderOnlyWhenOpen){var t=this._.container.getBoundingClientRect();if(t.width<=0||t.height<=0)return}if(this._.counters.frame=(this._.counters.frame+1)%4,this.scene.rotation.x=0,this.scene.position.y=0,this._.firstUpdate||this._.tiledWorld.refreshTiles(),this._.events._checkDesiredZoom(),this.controls._onUpdateEvent(),this._.cameras.isFirstPerson){this._.lastCameraWasFirst=!0,this._.cameras.firstPerson.controls.getObject().position.y=this._.cameras.orbit.controls.target.y-this._.cameras.firstPerson.height/this.projection.radiusScale;var e=this._.cameras.update();this._.events._rotateGlobe(e),this._.events._onMouseMove(),this.controls._onFirstPersonUpdate()}else this._.lastCameraWasFirst&&(this._.lastCameraWasFirst=!1,this.controls._onOrbitalUpdate());if(this._.firstUpdate){null!=this._.firstViewOverride?this.setCenter(this._.firstViewOverride):this.setCenter(this.options.initialView,!0);var n=this._.cameras.orbit,r=n.camera,i=n.controls,o=r.position,s=i.target;this._.cameraPositionTarget=[o.x,o.y,o.z,s.x,s.y,s.z],this._.firstUpdate=!1}}},t}();e.default=Cd}])})); \ No newline at end of file +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define("LithoSphere", [], factory); + else if(typeof exports === 'object') + exports["LithoSphere"] = factory(); + else + root["LithoSphere"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "C:\\Users\\tsoliman\\Documents\\Projects\\LithoSphere\\dist/"; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./src/lithosphere.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js": +/*!*******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js ***! + \*******************************************************************/ +/*! exports provided: B3DMLoaderBase */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoaderBase\", function() { return B3DMLoaderBase; });\n/* harmony import */ var _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/FeatureTable.js */ \"./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js\");\n// B3DM File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Batched3DModel/README.md\r\n\r\n\r\n\r\nclass B3DMLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => this.parse( buffer ) );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\t// TODO: this should be able to take a uint8array with an offset and length\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 28-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'b3dm' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableJSONByteLength = dataView.getUint32( 12, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableBinaryByteLength = dataView.getUint32( 16, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableJSONByteLength = dataView.getUint32( 20, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableBinaryByteLength = dataView.getUint32( 24, true );\r\n\r\n\t\t// Feature Table\r\n\t\tconst featureTableStart = 28;\r\n\t\tconst featureTableBuffer = buffer.slice(\r\n\t\t\tfeatureTableStart,\r\n\t\t\tfeatureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst featureTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"FeatureTable\"](\r\n\t\t\tfeatureTableBuffer,\r\n\t\t\t0,\r\n\t\t\tfeatureTableJSONByteLength,\r\n\t\t\tfeatureTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\t// Batch Table\r\n\t\tconst batchTableStart = featureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength;\r\n\t\tconst batchTableBuffer = buffer.slice(\r\n\t\t\tbatchTableStart,\r\n\t\t\tbatchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst batchTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"BatchTable\"](\r\n\t\t\tbatchTableBuffer,\r\n\t\t\tfeatureTable.getData( 'BATCH_LENGTH' ),\r\n\t\t\t0,\r\n\t\t\tbatchTableJSONByteLength,\r\n\t\t\tbatchTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\tconst glbStart = batchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength;\r\n\t\tconst glbBytes = new Uint8Array( buffer, glbStart, byteLength - glbStart );\r\n\r\n\t\treturn {\r\n\t\t\tversion,\r\n\t\t\tfeatureTable,\r\n\t\t\tbatchTable,\r\n\t\t\tglbBytes,\r\n\t\t};\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js": +/*!*******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js ***! + \*******************************************************************/ +/*! exports provided: CMPTLoaderBase */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoaderBase\", function() { return CMPTLoaderBase; });\n// CMPT File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Composite/README.md\r\n\r\nclass CMPTLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\t\tthis.workingPath = '';\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => {\r\n\r\n\t\t\t\tif ( this.workingPath === '' ) {\r\n\r\n\t\t\t\t\tconst splits = url.split( /\\\\\\//g );\r\n\t\t\t\t\tsplits.pop();\r\n\t\t\t\t\tthis.workingPath = splits.join( '/' );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.parse( buffer );\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 16-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'cmpt' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst tilesLength = dataView.getUint32( 12, true );\r\n\r\n\t\tconst tiles = [];\r\n\t\tlet offset = 16;\r\n\t\tfor ( let i = 0; i < tilesLength; i ++ ) {\r\n\r\n\t\t\tconst tileView = new DataView( buffer, offset, 12 );\r\n\t\t\tconst tileMagic =\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 0 ) ) +\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 1 ) ) +\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 2 ) ) +\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 3 ) );\r\n\t\t\tconst tileVersion = tileView.getUint32( 4, true );\r\n\t\t\tconst byteLength = tileView.getUint32( 8, true );\r\n\r\n\t\t\tconst tileBuffer = new Uint8Array( buffer, offset, byteLength );\r\n\t\t\ttiles.push( {\r\n\r\n\t\t\t\ttype: tileMagic,\r\n\t\t\t\tbuffer: tileBuffer,\r\n\t\t\t\tversion: tileVersion,\r\n\r\n\t\t\t} );\r\n\t\t\toffset += byteLength;\r\n\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tversion,\r\n\t\t\ttiles,\r\n\t\t};\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js": +/*!*******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js ***! + \*******************************************************************/ +/*! exports provided: I3DMLoaderBase */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoaderBase\", function() { return I3DMLoaderBase; });\n/* harmony import */ var _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/FeatureTable.js */ \"./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js\");\n/* harmony import */ var _utilities_arrayToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/arrayToString.js */ \"./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js\");\n// I3DM File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Instanced3DModel/README.md\r\n\r\n\r\n\r\n\r\nclass I3DMLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\t\tthis.workingPath = '';\r\n\r\n\t}\r\n\r\n\tresolveExternalURL( url ) {\r\n\r\n\t\tif ( /^[^\\\\/]/ ) {\r\n\r\n\t\t\treturn this.workingPath + '/' + url;\r\n\r\n\t\t} else {}\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => {\r\n\r\n\t\t\t\tif ( this.workingPath === '' ) {\r\n\r\n\t\t\t\t\tconst splits = url.split( /\\\\\\//g );\r\n\t\t\t\t\tsplits.pop();\r\n\t\t\t\t\tthis.workingPath = splits.join( '/' );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.parse( buffer );\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 32-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'i3dm' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableJSONByteLength = dataView.getUint32( 12, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableBinaryByteLength = dataView.getUint32( 16, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableJSONByteLength = dataView.getUint32( 20, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableBinaryByteLength = dataView.getUint32( 24, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst gltfFormat = dataView.getUint32( 28, true );\r\n\r\n\t\t// Feature Table\r\n\t\tconst featureTableStart = 32;\r\n\t\tconst featureTableBuffer = buffer.slice(\r\n\t\t\tfeatureTableStart,\r\n\t\t\tfeatureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst featureTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"FeatureTable\"](\r\n\t\t\tfeatureTableBuffer,\r\n\t\t\t0,\r\n\t\t\tfeatureTableJSONByteLength,\r\n\t\t\tfeatureTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\t// Batch Table\r\n\t\tconst batchTableStart = featureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength;\r\n\t\tconst batchTableBuffer = buffer.slice(\r\n\t\t\tbatchTableStart,\r\n\t\t\tbatchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst batchTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"BatchTable\"](\r\n\t\t\tbatchTableBuffer,\r\n\t\t\tfeatureTable.getData( 'INSTANCES_LENGTH' ),\r\n\t\t\t0,\r\n\t\t\tbatchTableJSONByteLength,\r\n\t\t\tbatchTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\tconst glbStart = batchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength;\r\n\t\tconst bodyBytes = new Uint8Array( buffer, glbStart, byteLength - glbStart );\r\n\r\n\t\tlet glbBytes = null;\r\n\t\tlet promise = null;\r\n\t\tif ( gltfFormat ) {\r\n\r\n\t\t\tglbBytes = bodyBytes;\r\n\t\t\tpromise = Promise.resolve();\r\n\r\n\t\t} else {\r\n\r\n\t\t\tconst externalUri = this.resolveExternalURL( Object(_utilities_arrayToString_js__WEBPACK_IMPORTED_MODULE_1__[\"arrayToString\"])( bodyBytes ) );\r\n\t\t\tpromise = fetch( externalUri, this.fetchOptions )\r\n\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\t\tthrow new Error( `I3DMLoaderBase : Failed to load file \"${ externalUri }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.then( buffer => {\r\n\r\n\t\t\t\t\tglbBytes = new Uint8Array( buffer );\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t\treturn promise.then( () => {\r\n\r\n\t\t\treturn {\r\n\t\t\t\tversion,\r\n\t\t\t\tfeatureTable,\r\n\t\t\t\tbatchTable,\r\n\t\t\t\tglbBytes,\r\n\t\t\t};\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js": +/*!*******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js ***! + \*******************************************************************/ +/*! exports provided: PNTSLoaderBase */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoaderBase\", function() { return PNTSLoaderBase; });\n/* harmony import */ var _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/FeatureTable.js */ \"./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js\");\n// PNTS File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/PointCloud/README.md\r\n\r\n\r\n\r\nclass PNTSLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => this.parse( buffer ) );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 28-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'pnts' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableJSONByteLength = dataView.getUint32( 12, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableBinaryByteLength = dataView.getUint32( 16, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableJSONByteLength = dataView.getUint32( 20, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableBinaryByteLength = dataView.getUint32( 24, true );\r\n\r\n\t\t// Feature Table\r\n\t\tconst featureTableStart = 28;\r\n\t\tconst featureTableBuffer = buffer.slice(\r\n\t\t\tfeatureTableStart,\r\n\t\t\tfeatureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst featureTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"FeatureTable\"](\r\n\t\t\tfeatureTableBuffer,\r\n\t\t\t0,\r\n\t\t\tfeatureTableJSONByteLength,\r\n\t\t\tfeatureTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\t// Batch Table\r\n\t\tconst batchTableStart = featureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength;\r\n\t\tconst batchTableBuffer = buffer.slice(\r\n\t\t\tbatchTableStart,\r\n\t\t\tbatchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst batchTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"BatchTable\"](\r\n\t\t\tbatchTableBuffer,\r\n\t\t\tfeatureTable.getData( 'BATCH_LENGTH' ) || featureTable.getData( 'POINTS_LENGTH' ),\r\n\t\t\t0,\r\n\t\t\tbatchTableJSONByteLength,\r\n\t\t\tbatchTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\treturn {\r\n\t\t\tversion,\r\n\t\t\tfeatureTable,\r\n\t\t\tbatchTable,\r\n\t\t};\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js": +/*!**********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js ***! + \**********************************************************************/ +/*! exports provided: TilesRendererBase */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TilesRendererBase\", function() { return TilesRendererBase; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utilities_urlJoin_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/urlJoin.js */ \"./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js\");\n/* harmony import */ var _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utilities/LRUCache.js */ \"./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js\");\n/* harmony import */ var _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utilities/PriorityQueue.js */ \"./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js\");\n/* harmony import */ var _traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./traverseFunctions.js */ \"./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js\");\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/3d-tiles-renderer/src/base/constants.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n// Function for sorting the evicted LRU items. We should evict the shallowest depth first.\r\nconst priorityCallback = tile => 1 / ( tile.__depthFromRenderedParent + 1 );\r\n\r\nclass TilesRendererBase {\r\n\r\n\tget rootTileSet() {\r\n\r\n\t\tconst tileSet = this.tileSets[ this.rootURL ];\r\n\t\tif ( ! tileSet || tileSet instanceof Promise ) {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn tileSet;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tget root() {\r\n\r\n\t\tconst tileSet = this.rootTileSet;\r\n\t\treturn tileSet ? tileSet.root : null;\r\n\r\n\t}\r\n\r\n\tconstructor( url ) {\r\n\r\n\t\t// state\r\n\t\tthis.tileSets = {};\r\n\t\tthis.rootURL = url;\r\n\t\tthis.fetchOptions = {};\r\n\r\n\t\tthis.preprocessURL = null;\r\n\r\n\t\tconst lruCache = new _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_2__[\"LRUCache\"]();\r\n\t\tlruCache.unloadPriorityCallback = priorityCallback;\r\n\r\n\t\tconst downloadQueue = new _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_3__[\"PriorityQueue\"]();\r\n\t\tdownloadQueue.maxJobs = 4;\r\n\t\tdownloadQueue.priorityCallback = priorityCallback;\r\n\r\n\t\tconst parseQueue = new _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_3__[\"PriorityQueue\"]();\r\n\t\tparseQueue.maxJobs = 1;\r\n\t\tparseQueue.priorityCallback = priorityCallback;\r\n\r\n\t\tthis.lruCache = lruCache;\r\n\t\tthis.downloadQueue = downloadQueue;\r\n\t\tthis.parseQueue = parseQueue;\r\n\t\tthis.stats = {\r\n\t\t\tparsing: 0,\r\n\t\t\tdownloading: 0,\r\n\t\t\tfailed: 0,\r\n\t\t\tinFrustum: 0,\r\n\t\t\tused: 0,\r\n\t\t\tactive: 0,\r\n\t\t\tvisible: 0,\r\n\t\t};\r\n\t\tthis.frameCount = 0;\r\n\r\n\t\t// options\r\n\t\tthis.errorTarget = 6.0;\r\n\t\tthis.errorThreshold = Infinity;\r\n\t\tthis.loadSiblings = true;\r\n\t\tthis.displayActiveTiles = false;\r\n\t\tthis.maxDepth = Infinity;\r\n\t\tthis.stopAtEmptyTiles = true;\r\n\r\n\t}\r\n\r\n\ttraverse( beforecb, aftercb ) {\r\n\r\n\t\tconst tileSets = this.tileSets;\r\n\t\tconst rootTileSet = tileSets[ this.rootURL ];\r\n\t\tif ( ! rootTileSet || ! rootTileSet.root ) return;\r\n\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"traverseSet\"])( rootTileSet.root, beforecb, aftercb );\r\n\r\n\t}\r\n\r\n\t// Public API\r\n\tupdate() {\r\n\r\n\t\tconst stats = this.stats;\r\n\t\tconst lruCache = this.lruCache;\r\n\t\tconst tileSets = this.tileSets;\r\n\t\tconst rootTileSet = tileSets[ this.rootURL ];\r\n\t\tif ( ! ( this.rootURL in tileSets ) ) {\r\n\r\n\t\t\tthis.loadRootTileSet( this.rootURL );\r\n\t\t\treturn;\r\n\r\n\t\t} else if ( ! rootTileSet || ! rootTileSet.root ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\tconst root = rootTileSet.root;\r\n\r\n\t\tstats.inFrustum = 0,\r\n\t\tstats.used = 0,\r\n\t\tstats.active = 0,\r\n\t\tstats.visible = 0,\r\n\t\tthis.frameCount ++;\r\n\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"determineFrustumSet\"])( root, this );\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"markUsedSetLeaves\"])( root, this );\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"skipTraversal\"])( root, this );\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"toggleTiles\"])( root, this );\r\n\r\n\t\tlruCache.scheduleUnload();\r\n\r\n\t}\r\n\r\n\t// Overrideable\r\n\tparseTile( buffer, tile, extension ) {\r\n\r\n\t\treturn null;\r\n\r\n\t}\r\n\r\n\tdisposeTile( tile ) {\r\n\r\n\t}\r\n\r\n\tpreprocessNode( tile, parentTile, tileSetDir ) {\r\n\r\n\t\tif ( tile.content ) {\r\n\r\n\t\t\t// Fix old file formats\r\n\t\t\tif ( ! ( 'uri' in tile.content ) && 'url' in tile.content ) {\r\n\r\n\t\t\t\ttile.content.uri = tile.content.url;\r\n\t\t\t\tdelete tile.content.url;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( tile.content.uri ) {\r\n\r\n\t\t\t\ttile.content.uri = Object(_utilities_urlJoin_js__WEBPACK_IMPORTED_MODULE_1__[\"urlJoin\"])( tileSetDir, tile.content.uri );\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// NOTE: fix for some cases where tilesets provide the bounding volume\r\n\t\t\t// but volumes are not present.\r\n\t\t\tif (\r\n\t\t\t\ttile.content.boundingVolume &&\r\n\t\t\t\t! (\r\n\t\t\t\t\t'box' in tile.content.boundingVolume ||\r\n\t\t\t\t\t'sphere' in tile.content.boundingVolume ||\r\n\t\t\t\t\t'region' in tile.content.boundingVolume\r\n\t\t\t\t)\r\n\t\t\t) {\r\n\r\n\t\t\t\tdelete tile.content.boundingVolume;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\ttile.parent = parentTile;\r\n\t\ttile.children = tile.children || [];\r\n\r\n\t\tconst uri = tile.content && tile.content.uri;\r\n\t\tif ( uri ) {\r\n\r\n\t\t\t// \"content\" should only indicate loadable meshes, not external tile sets\r\n\t\t\tconst isExternalTileSet = /\\.json$/i.test( tile.content.uri );\r\n\t\t\ttile.__externalTileSet = isExternalTileSet;\r\n\t\t\ttile.__contentEmpty = isExternalTileSet;\r\n\r\n\t\t} else {\r\n\r\n\t\t\ttile.__externalTileSet = false;\r\n\t\t\ttile.__contentEmpty = true;\r\n\r\n\t\t}\r\n\r\n\t\ttile.__error = 0.0;\r\n\t\ttile.__inFrustum = false;\r\n\t\ttile.__isLeaf = false;\r\n\r\n\t\ttile.__usedLastFrame = false;\r\n\t\ttile.__used = false;\r\n\r\n\t\ttile.__wasSetVisible = false;\r\n\t\ttile.__visible = false;\r\n\t\ttile.__childrenWereVisible = false;\r\n\t\ttile.__allChildrenLoaded = false;\r\n\r\n\t\ttile.__wasSetActive = false;\r\n\t\ttile.__active = false;\r\n\r\n\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"UNLOADED\"];\r\n\t\ttile.__loadIndex = 0;\r\n\r\n\t\ttile.__loadAbort = null;\r\n\r\n\t\ttile.__depthFromRenderedParent = - 1;\r\n\t\tif ( parentTile === null ) {\r\n\r\n\t\t\ttile.__depth = 0;\r\n\t\t\ttile.refine = tile.refine || 'REPLACE';\r\n\r\n\t\t} else {\r\n\r\n\t\t\ttile.__depth = parentTile.__depth + 1;\r\n\t\t\ttile.refine = tile.refine || parentTile.refine;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tsetTileActive( tile, state ) {\r\n\r\n\t}\r\n\r\n\tsetTileVisible( tile, state ) {\r\n\r\n\t}\r\n\r\n\tcalculateError( tile ) {\r\n\r\n\t\treturn 0;\r\n\r\n\t}\r\n\r\n\ttileInView( tile ) {\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\t// Private Functions\r\n\tfetchTileSet( url, fetchOptions, parent = null ) {\r\n\r\n\t\treturn fetch( url, fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( res.ok ) {\r\n\r\n\t\t\t\t\treturn res.json();\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tthrow new Error( `TilesRenderer: Failed to load tileset \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} )\r\n\t\t\t.then( json => {\r\n\r\n\t\t\t\tconst version = json.asset.version;\r\n\t\t\t\tconsole.assert(\r\n\t\t\t\t\tversion === '1.0' || version === '0.0',\r\n\t\t\t\t\t'asset.version is expected to be a string of \"1.0\" or \"0.0\"'\r\n\t\t\t\t);\r\n\r\n\t\t\t\tconst basePath = path__WEBPACK_IMPORTED_MODULE_0___default.a.dirname( url );\r\n\r\n\t\t\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"traverseSet\"])(\r\n\t\t\t\t\tjson.root,\r\n\t\t\t\t\t( node, parent ) => this.preprocessNode( node, parent, basePath ),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tparent,\r\n\t\t\t\t\tparent ? parent.__depth : 0,\r\n\t\t\t\t);\r\n\r\n\t\t\t\treturn json;\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tloadRootTileSet( url ) {\r\n\r\n\t\tconst tileSets = this.tileSets;\r\n\t\tif ( ! ( url in tileSets ) ) {\r\n\r\n\t\t\tconst pr = this\r\n\t\t\t\t.fetchTileSet( url, this.fetchOptions )\r\n\t\t\t\t.then( json => {\r\n\r\n\t\t\t\t\ttileSets[ url ] = json;\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\tpr.catch( err => {\r\n\r\n\t\t\t\tconsole.error( err );\r\n\t\t\t\ttileSets[ url ] = err;\r\n\r\n\t\t\t} );\r\n\r\n\t\t\ttileSets[ url ] = pr;\r\n\r\n\t\t\treturn pr;\r\n\r\n\t\t} else if ( tileSets[ url ] instanceof Error ) {\r\n\r\n\t\t\treturn Promise.reject( tileSets[ url ] );\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn Promise.resolve( tileSets[ url ] );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\trequestTileContents( tile ) {\r\n\r\n\t\t// If the tile is already being loaded then don't\r\n\t\t// start it again.\r\n\t\tif ( tile.__loadingState !== _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"UNLOADED\"] ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\tconst stats = this.stats;\r\n\t\tconst lruCache = this.lruCache;\r\n\t\tconst downloadQueue = this.downloadQueue;\r\n\t\tconst parseQueue = this.parseQueue;\r\n\t\tconst isExternalTileSet = tile.__externalTileSet;\r\n\t\tlruCache.add( tile, t => {\r\n\r\n\t\t\t// Stop the load if it's started\r\n\t\t\tif ( t.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"] ) {\r\n\r\n\t\t\t\tt.__loadAbort.abort();\r\n\t\t\t\tt.__loadAbort = null;\r\n\r\n\t\t\t} else if ( isExternalTileSet ) {\r\n\r\n\t\t\t\tt.children.length = 0;\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tthis.disposeTile( t );\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Decrement stats\r\n\t\t\tif ( t.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"] ) {\r\n\r\n\t\t\t\tstats.downloading --;\r\n\r\n\t\t\t} else if ( t.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"PARSING\"] ) {\r\n\r\n\t\t\t\tstats.parsing --;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tt.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"UNLOADED\"];\r\n\t\t\tt.__loadIndex ++;\r\n\r\n\t\t\tparseQueue.remove( t );\r\n\t\t\tdownloadQueue.remove( t );\r\n\r\n\t\t} );\r\n\r\n\t\t// Track a new load index so we avoid the condition where this load is stopped and\r\n\t\t// another begins soon after so we don't parse twice.\r\n\t\ttile.__loadIndex ++;\r\n\t\tconst loadIndex = tile.__loadIndex;\r\n\t\tconst controller = new AbortController();\r\n\t\tconst signal = controller.signal;\r\n\r\n\t\tstats.downloading ++;\r\n\t\ttile.__loadAbort = controller;\r\n\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"];\r\n\r\n\t\tconst errorCallback = e => {\r\n\r\n\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\treturn;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( e.name !== 'AbortError' ) {\r\n\r\n\t\t\t\tparseQueue.remove( tile );\r\n\t\t\t\tdownloadQueue.remove( tile );\r\n\r\n\t\t\t\tif ( tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"PARSING\"] ) {\r\n\r\n\t\t\t\t\tstats.parsing --;\r\n\r\n\t\t\t\t} else if ( tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"] ) {\r\n\r\n\t\t\t\t\tstats.downloading --;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstats.failed ++;\r\n\r\n\t\t\t\tconsole.error( `TilesRenderer : Failed to load tile at url \"${ tile.content.uri }\".` );\r\n\t\t\t\tconsole.error( e );\r\n\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"FAILED\"];\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tlruCache.remove( tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t};\r\n\r\n\t\tif ( isExternalTileSet ) {\r\n\r\n\t\t\tdownloadQueue.add( tile, tile => {\r\n\r\n\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\treturn Promise.resolve();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst uri = this.preprocessURL ? this.preprocessURL( tile.content.uri ) : tile.content.uri;\r\n\t\t\t\treturn this.fetchTileSet( uri, Object.assign( { signal }, this.fetchOptions ), tile );\r\n\r\n\t\t\t} )\r\n\t\t\t\t.then( json => {\r\n\r\n\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstats.downloading --;\r\n\t\t\t\t\ttile.__loadAbort = null;\r\n\t\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADED\"];\r\n\r\n\t\t\t\t\ttile.children.push( json.root );\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.catch( errorCallback );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tdownloadQueue.add( tile, tile => {\r\n\r\n\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\treturn Promise.resolve();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst uri = this.preprocessURL ? this.preprocessURL( tile.content.uri ) : tile.content.uri;\r\n\t\t\t\treturn fetch( uri, Object.assign( { signal }, this.fetchOptions ) );\r\n\r\n\t\t\t} )\r\n\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( res.ok ) {\r\n\r\n\t\t\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\tthrow new Error( `Failed to load model with error code ${res.status}` );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.then( buffer => {\r\n\r\n\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstats.downloading --;\r\n\t\t\t\t\tstats.parsing ++;\r\n\t\t\t\t\ttile.__loadAbort = null;\r\n\t\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"PARSING\"];\r\n\r\n\t\t\t\t\treturn parseQueue.add( tile, tile => {\r\n\r\n\t\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\t\treturn Promise.resolve();\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst uri = tile.content.uri;\r\n\t\t\t\t\t\tconst extension = uri.split( /\\./g ).pop();\r\n\r\n\t\t\t\t\t\treturn this.parseTile( buffer, tile, extension );\r\n\r\n\t\t\t\t\t} );\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.then( () => {\r\n\r\n\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstats.parsing --;\r\n\t\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADED\"];\r\n\r\n\t\t\t\t\tif ( tile.__wasSetVisible ) {\r\n\r\n\t\t\t\t\t\tthis.setTileVisible( tile, true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( tile.__wasSetActive ) {\r\n\r\n\t\t\t\t\t\tthis.setTileActive( tile, true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.catch( errorCallback );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tdispose() {\r\n\r\n\t\tconst lruCache = this.lruCache;\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tlruCache.remove( tile );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/constants.js": +/*!**************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/constants.js ***! + \**************************************************************/ +/*! exports provided: UNLOADED, LOADING, PARSING, LOADED, FAILED */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UNLOADED\", function() { return UNLOADED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LOADING\", function() { return LOADING; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PARSING\", function() { return PARSING; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LOADED\", function() { return LOADED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FAILED\", function() { return FAILED; });\nconst UNLOADED = 0;\nconst LOADING = 1;\nconst PARSING = 2;\nconst LOADED = 3;\nconst FAILED = 4;\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/constants.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js": +/*!**********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js ***! + \**********************************************************************/ +/*! exports provided: traverseSet, determineFrustumSet, markUsedSetLeaves, skipTraversal, toggleTiles */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"traverseSet\", function() { return traverseSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determineFrustumSet\", function() { return determineFrustumSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"markUsedSetLeaves\", function() { return markUsedSetLeaves; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"skipTraversal\", function() { return skipTraversal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toggleTiles\", function() { return toggleTiles; });\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/3d-tiles-renderer/src/base/constants.js\");\n\r\n\r\nfunction isDownloadFinished( value ) {\r\n\r\n\treturn value === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"LOADED\"] || value === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"FAILED\"];\r\n\r\n}\r\n\r\n// Checks whether this tile was last used on the given frame.\r\nfunction isUsedThisFrame( tile, frameCount ) {\r\n\r\n\treturn tile.__lastFrameVisited === frameCount && tile.__used;\r\n\r\n}\r\n\r\n// Resets the frame frame information for the given tile\r\nfunction resetFrameState( tile, frameCount ) {\r\n\r\n\tif ( tile.__lastFrameVisited !== frameCount ) {\r\n\r\n\t\ttile.__lastFrameVisited = frameCount;\r\n\t\ttile.__used = false;\r\n\t\ttile.__inFrustum = false;\r\n\t\ttile.__isLeaf = false;\r\n\t\ttile.__visible = false;\r\n\t\ttile.__active = false;\r\n\t\ttile.__error = 0;\r\n\t\ttile.__childrenWereVisible = false;\r\n\t\ttile.__allChildrenLoaded = false;\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Recursively mark tiles used down to the next tile with content\r\nfunction recursivelyMarkUsed( tile, frameCount, lruCache ) {\r\n\r\n\tresetFrameState( tile, frameCount );\r\n\r\n\ttile.__used = true;\r\n\tlruCache.markUsed( tile );\r\n\tif ( tile.__contentEmpty ) {\r\n\r\n\t\tconst children = tile.children;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\trecursivelyMarkUsed( children[ i ], frameCount, lruCache );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\nfunction recursivelyLoadTiles( tile, depthFromRenderedParent, renderer ) {\r\n\r\n\t// Try to load any external tile set children if the external tile set has loaded.\r\n\tconst doTraverse =\r\n\t\ttile.__contentEmpty && (\r\n\t\t\t! tile.__externalTileSet ||\r\n\t\t\tisDownloadFinished( tile.__loadingState )\r\n\t\t);\r\n\tif ( doTraverse ) {\r\n\r\n\t\tconst children = tile.children;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\t// don't increment depth to rendered parent here because we should treat\r\n\t\t\t// the next layer of rendered children as just a single depth away for the\r\n\t\t\t// sake of sorting.\r\n\t\t\tconst child = children[ i ];\r\n\t\t\tchild.__depthFromRenderedParent = depthFromRenderedParent;\r\n\t\t\trecursivelyLoadTiles( child, depthFromRenderedParent, renderer );\r\n\r\n\t\t}\r\n\r\n\t} else {\r\n\r\n\t\trenderer.requestTileContents( tile );\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Helper function for recursively traversing a tile set. If `beforeCb` returns `true` then the\r\n// traversal will end early.\r\nfunction traverseSet( tile, beforeCb = null, afterCb = null, parent = null, depth = 0 ) {\r\n\r\n\tif ( beforeCb && beforeCb( tile, parent, depth ) ) {\r\n\r\n\t\tif ( afterCb ) {\r\n\r\n\t\t\tafterCb( tile, parent, depth );\r\n\r\n\t\t}\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst children = tile.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\ttraverseSet( children[ i ], beforeCb, afterCb, tile, depth + 1 );\r\n\r\n\t}\r\n\r\n\tif ( afterCb ) {\r\n\r\n\t\tafterCb( tile, parent, depth );\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Determine which tiles are within the camera frustum.\r\n// TODO: this is marking items as used in the lrucache, which means some data is\r\n// being kept around that isn't being used -- is that okay?\r\nfunction determineFrustumSet( tile, renderer ) {\r\n\r\n\tconst stats = renderer.stats;\r\n\tconst frameCount = renderer.frameCount;\r\n\tconst errorTarget = renderer.errorTarget;\r\n\tconst maxDepth = renderer.maxDepth;\r\n\tconst loadSiblings = renderer.loadSiblings;\r\n\tconst lruCache = renderer.lruCache;\r\n\tconst stopAtEmptyTiles = renderer.stopAtEmptyTiles;\r\n\tresetFrameState( tile, frameCount );\r\n\r\n\t// Early out if this tile is not within view.\r\n\tconst inFrustum = renderer.tileInView( tile );\r\n\tif ( inFrustum === false ) {\r\n\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\ttile.__used = true;\r\n\tlruCache.markUsed( tile );\r\n\r\n\ttile.__inFrustum = true;\r\n\tstats.inFrustum ++;\r\n\r\n\t// Early out if this tile has less error than we're targeting but don't stop\r\n\t// at an external tile set.\r\n\tif ( ( stopAtEmptyTiles || ! tile.__contentEmpty ) && ! tile.__externalTileSet ) {\r\n\r\n\t\tconst error = renderer.calculateError( tile );\r\n\t\ttile.__error = error;\r\n\t\tif ( error <= errorTarget ) {\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\r\n\t\t// Early out if we've reached the maximum allowed depth.\r\n\t\tif ( renderer.maxDepth > 0 && tile.__depth + 1 >= maxDepth ) {\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// Traverse children and see if any children are in view.\r\n\tlet anyChildrenUsed = false;\r\n\tconst children = tile.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\tconst c = children[ i ];\r\n\t\tconst r = determineFrustumSet( c, renderer );\r\n\t\tanyChildrenUsed = anyChildrenUsed || r;\r\n\r\n\t}\r\n\r\n\t// If there are children within view and we are loading siblings then mark\r\n\t// all sibling tiles as used, as well.\r\n\tif ( anyChildrenUsed && loadSiblings ) {\r\n\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\trecursivelyMarkUsed( c, frameCount, lruCache );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn true;\r\n\r\n}\r\n\r\n// Traverse and mark the tiles that are at the leaf nodes of the \"used\" tree.\r\nfunction markUsedSetLeaves( tile, renderer ) {\r\n\r\n\tconst stats = renderer.stats;\r\n\tconst frameCount = renderer.frameCount;\r\n\tif ( ! isUsedThisFrame( tile, frameCount ) ) {\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tstats.used ++;\r\n\r\n\t// This tile is a leaf if none of the children had been used.\r\n\tconst children = tile.children;\r\n\tlet anyChildrenUsed = false;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\tconst c = children[ i ];\r\n\t\tanyChildrenUsed = anyChildrenUsed || isUsedThisFrame( c, frameCount );\r\n\r\n\t}\r\n\r\n\r\n\tif ( ! anyChildrenUsed ) {\r\n\r\n\t\t// TODO: This isn't necessarily right because it's possible that a parent tile is considered in the\r\n\t\t// frustum while the child tiles are not, making them unused. If all children have loaded and were properly\r\n\t\t// considered to be in the used set then we shouldn't set ourselves to a leaf here.\r\n\t\ttile.__isLeaf = true;\r\n\r\n\t} else {\r\n\r\n\t\tlet childrenWereVisible = false;\r\n\t\tlet allChildrenLoaded = true;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\tmarkUsedSetLeaves( c, renderer );\r\n\t\t\tchildrenWereVisible = childrenWereVisible || c.__wasSetVisible || c.__childrenWereVisible;\r\n\r\n\t\t\tif ( isUsedThisFrame( c, frameCount ) ) {\r\n\r\n\t\t\t\tconst childLoaded =\r\n\t\t\t\t\tc.__allChildrenLoaded ||\r\n\t\t\t\t\t( ! c.__contentEmpty && isDownloadFinished( c.__loadingState ) ) ||\r\n\t\t\t\t\t( c.__externalTileSet && c.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"FAILED\"] );\r\n\t\t\t\tallChildrenLoaded = allChildrenLoaded && childLoaded;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\ttile.__childrenWereVisible = childrenWereVisible;\r\n\t\ttile.__allChildrenLoaded = allChildrenLoaded;\r\n\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Skip past tiles we consider unrenderable because they are outside the error threshold.\r\nfunction skipTraversal( tile, renderer ) {\r\n\r\n\tconst stats = renderer.stats;\r\n\tconst frameCount = renderer.frameCount;\r\n\tif ( ! isUsedThisFrame( tile, frameCount ) ) {\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst parent = tile.parent;\r\n\tconst parentDepthToParent = parent ? parent.__depthFromRenderedParent : - 1;\r\n\ttile.__depthFromRenderedParent = parentDepthToParent;\r\n\r\n\t// Request the tile contents or mark it as visible if we've found a leaf.\r\n\tconst lruCache = renderer.lruCache;\r\n\tif ( tile.__isLeaf ) {\r\n\r\n\t\ttile.__depthFromRenderedParent ++;\r\n\r\n\t\tif ( tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"LOADED\"] ) {\r\n\r\n\t\t\tif ( tile.__inFrustum ) {\r\n\r\n\t\t\t\ttile.__visible = true;\r\n\t\t\t\tstats.visible ++;\r\n\r\n\t\t\t}\r\n\t\t\ttile.__active = true;\r\n\t\t\tstats.active ++;\r\n\r\n\t\t} else if ( ! lruCache.isFull() && ( ! tile.__contentEmpty || tile.__externalTileSet ) ) {\r\n\r\n\t\t\trenderer.requestTileContents( tile );\r\n\r\n\t\t}\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst errorRequirement = ( renderer.errorTarget + 1 ) * renderer.errorThreshold;\r\n\tconst meetsSSE = tile.__error <= errorRequirement;\r\n\tconst includeTile = meetsSSE || tile.refine === 'ADD';\r\n\tconst hasModel = ! tile.__contentEmpty;\r\n\tconst hasContent = hasModel || tile.__externalTileSet;\r\n\tconst loadedContent = isDownloadFinished( tile.__loadingState ) && hasContent;\r\n\tconst childrenWereVisible = tile.__childrenWereVisible;\r\n\tconst children = tile.children;\r\n\tlet allChildrenHaveContent = tile.__allChildrenLoaded;\r\n\r\n\t// Increment the relative depth of the node to the nearest rendered parent if it has content\r\n\t// and is being rendered.\r\n\tif ( includeTile && hasModel ) {\r\n\r\n\t\ttile.__depthFromRenderedParent ++;\r\n\r\n\t}\r\n\r\n\t// If we've met the SSE requirements and we can load content then fire a fetch.\r\n\tif ( includeTile && ! loadedContent && ! lruCache.isFull() && hasContent ) {\r\n\r\n\t\trenderer.requestTileContents( tile );\r\n\r\n\t}\r\n\r\n\t// Only mark this tile as visible if it meets the screen space error requirements, has loaded content, not\r\n\t// all children have loaded yet, and if no children were visible last frame. We want to keep children visible\r\n\t// that _were_ visible to avoid a pop in level of detail as the camera moves around and parent / sibling tiles\r\n\t// load in.\r\n\r\n\t// Skip the tile entirely if there's no content to load\r\n\tif (\r\n\t\t( meetsSSE && ! allChildrenHaveContent && ! childrenWereVisible && loadedContent )\r\n\t\t\t|| ( tile.refine === 'ADD' && loadedContent )\r\n\t) {\r\n\r\n\t\tif ( tile.__inFrustum ) {\r\n\r\n\t\t\ttile.__visible = true;\r\n\t\t\tstats.visible ++;\r\n\r\n\t\t}\r\n\t\ttile.__active = true;\r\n\t\tstats.active ++;\r\n\r\n\t}\r\n\r\n\t// If we're additive then don't stop the traversal here because it doesn't matter whether the children load in\r\n\t// at the same rate.\r\n\tif ( tile.refine !== 'ADD' && meetsSSE && ! allChildrenHaveContent && loadedContent ) {\r\n\r\n\t\t// load the child content if we've found that we've been loaded so we can move down to the next tile\r\n\t\t// layer when the data has loaded.\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\tif ( isUsedThisFrame( c, frameCount ) && ! lruCache.isFull() ) {\r\n\r\n\t\t\t\tc.__depthFromRenderedParent = tile.__depthFromRenderedParent + 1;\r\n\t\t\t\trecursivelyLoadTiles( c, c.__depthFromRenderedParent, renderer );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t} else {\r\n\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\tif ( isUsedThisFrame( c, frameCount ) ) {\r\n\r\n\t\t\t\tskipTraversal( c, renderer );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Final traverse to toggle tile visibility.\r\nfunction toggleTiles( tile, renderer ) {\r\n\r\n\tconst frameCount = renderer.frameCount;\r\n\tconst isUsed = isUsedThisFrame( tile, frameCount );\r\n\tif ( isUsed || tile.__usedLastFrame ) {\r\n\r\n\t\tlet setActive = false;\r\n\t\tlet setVisible = false;\r\n\t\tif ( isUsed ) {\r\n\r\n\t\t\t// enable visibility if active due to shadows\r\n\t\t\tsetActive = tile.__active;\r\n\t\t\tif ( renderer.displayActiveTiles ) {\r\n\r\n\t\t\t\tsetVisible = tile.__active || tile.__visible;\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tsetVisible = tile.__visible;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// If the active or visible state changed then call the functions.\r\n\t\tif ( ! tile.__contentEmpty && tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"LOADED\"] ) {\r\n\r\n\t\t\tif ( tile.__wasSetActive !== setActive ) {\r\n\r\n\t\t\t\trenderer.setTileActive( tile, setActive );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( tile.__wasSetVisible !== setVisible ) {\r\n\r\n\t\t\t\trenderer.setTileVisible( tile, setVisible );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\ttile.__wasSetActive = setActive;\r\n\t\ttile.__wasSetVisible = setVisible;\r\n\t\ttile.__usedLastFrame = isUsed;\r\n\r\n\t\tconst children = tile.children;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\ttoggleTiles( c, renderer );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/index.js ***! + \*****************************************************/ +/*! exports provided: DebugTilesRenderer, TilesRenderer, B3DMLoader, PNTSLoader, I3DMLoader, CMPTLoader, TilesRendererBase, B3DMLoaderBase, I3DMLoaderBase, PNTSLoaderBase, CMPTLoaderBase, LRUCache, PriorityQueue, NONE, SCREEN_ERROR, GEOMETRIC_ERROR, DISTANCE, DEPTH, RELATIVE_DEPTH, IS_LEAF, RANDOM_COLOR */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./three/DebugTilesRenderer.js */ \"./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DebugTilesRenderer\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"DebugTilesRenderer\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NONE\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"NONE\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SCREEN_ERROR\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"SCREEN_ERROR\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"GEOMETRIC_ERROR\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"GEOMETRIC_ERROR\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DISTANCE\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"DISTANCE\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DEPTH\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"DEPTH\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"RELATIVE_DEPTH\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"RELATIVE_DEPTH\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"IS_LEAF\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"IS_LEAF\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"RANDOM_COLOR\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM_COLOR\"]; });\n\n/* harmony import */ var _three_TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./three/TilesRenderer.js */ \"./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TilesRenderer\", function() { return _three_TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__[\"TilesRenderer\"]; });\n\n/* harmony import */ var _three_B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./three/B3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoader\", function() { return _three_B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"B3DMLoader\"]; });\n\n/* harmony import */ var _three_PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./three/PNTSLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoader\", function() { return _three_PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__[\"PNTSLoader\"]; });\n\n/* harmony import */ var _three_I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./three/I3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoader\", function() { return _three_I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__[\"I3DMLoader\"]; });\n\n/* harmony import */ var _three_CMPTLoader_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./three/CMPTLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoader\", function() { return _three_CMPTLoader_js__WEBPACK_IMPORTED_MODULE_5__[\"CMPTLoader\"]; });\n\n/* harmony import */ var _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./base/TilesRendererBase.js */ \"./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TilesRendererBase\", function() { return _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_6__[\"TilesRendererBase\"]; });\n\n/* harmony import */ var _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./base/B3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoaderBase\", function() { return _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_7__[\"B3DMLoaderBase\"]; });\n\n/* harmony import */ var _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./base/I3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoaderBase\", function() { return _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_8__[\"I3DMLoaderBase\"]; });\n\n/* harmony import */ var _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./base/PNTSLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoaderBase\", function() { return _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_9__[\"PNTSLoaderBase\"]; });\n\n/* harmony import */ var _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./base/CMPTLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoaderBase\", function() { return _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_10__[\"CMPTLoaderBase\"]; });\n\n/* harmony import */ var _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utilities/LRUCache.js */ \"./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LRUCache\", function() { return _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_11__[\"LRUCache\"]; });\n\n/* harmony import */ var _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utilities/PriorityQueue.js */ \"./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PriorityQueue\", function() { return _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_12__[\"PriorityQueue\"]; });\n\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/index.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js": +/*!****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js ***! + \****************************************************************/ +/*! exports provided: B3DMLoader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoader\", function() { return B3DMLoader; });\n/* harmony import */ var _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/B3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/loaders/GLTFLoader.js */ \"./node_modules/three/examples/jsm/loaders/GLTFLoader.js\");\n\r\n\r\n\r\n\r\nclass B3DMLoader extends _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__[\"B3DMLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_1__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst b3dm = super.parse( buffer );\r\n\t\tconst gltfBuffer = b3dm.glbBytes.slice().buffer;\r\n\t\treturn new Promise( ( resolve, reject ) => {\r\n\r\n\t\t\tconst manager = this.manager;\r\n\t\t\tconst loader = manager.getHandler( 'path.gltf' ) || new three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"GLTFLoader\"]( manager );\r\n\t\t\tloader.parse( gltfBuffer, null, model => {\r\n\r\n\t\t\t\tconst { batchTable, featureTable } = b3dm;\r\n\t\t\t\tconst { scene } = model;\r\n\r\n\t\t\t\tconst rtcCenter = featureTable.getData( 'RTC_CENTER' );\r\n\t\t\t\tif ( rtcCenter ) {\r\n\r\n\t\t\t\t\tscene.position.x += rtcCenter[ 0 ];\r\n\t\t\t\t\tscene.position.y += rtcCenter[ 1 ];\r\n\t\t\t\t\tscene.position.z += rtcCenter[ 2 ];\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmodel.batchTable = batchTable;\r\n\t\t\t\tmodel.featureTable = featureTable;\r\n\r\n\t\t\t\tscene.batchTable = batchTable;\r\n\t\t\t\tscene.featureTable = featureTable;\r\n\r\n\t\t\t\tresolve( model );\r\n\r\n\t\t\t}, reject );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js": +/*!****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js ***! + \****************************************************************/ +/*! exports provided: CMPTLoader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoader\", function() { return CMPTLoader; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/CMPTLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js\");\n/* harmony import */ var _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./B3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js\");\n/* harmony import */ var _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PNTSLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js\");\n/* harmony import */ var _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./I3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js\");\n\r\n\r\n\r\n\r\n\r\n\r\nclass CMPTLoader extends _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_1__[\"CMPTLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_0__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst result = super.parse( buffer );\r\n\t\tconst manager = this.manager;\r\n\t\tconst group = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\tconst results = [];\r\n\t\tconst promises = [];\r\n\r\n\t\tfor ( const i in result.tiles ) {\r\n\r\n\t\t\tconst { type, buffer } = result.tiles[ i ];\r\n\t\t\tswitch ( type ) {\r\n\r\n\t\t\t\tcase 'b3dm': {\r\n\r\n\t\t\t\t\tconst slicedBuffer = buffer.slice();\r\n\t\t\t\t\tconst promise = new _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"B3DMLoader\"]( manager )\r\n\t\t\t\t\t\t.parse( slicedBuffer.buffer )\r\n\t\t\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\t\t\tresults.push( res );\r\n\t\t\t\t\t\t\tgroup.add( res.scene );\r\n\r\n\t\t\t\t\t\t} );\r\n\r\n\t\t\t\t\tpromises.push( promise );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcase 'pnts': {\r\n\r\n\t\t\t\t\tconst slicedBuffer = buffer.slice();\r\n\t\t\t\t\tconst pointsResult = new _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__[\"PNTSLoader\"]( manager ).parse( slicedBuffer.buffer );\r\n\t\t\t\t\tresults.push( pointsResult );\r\n\t\t\t\t\tgroup.add( pointsResult.scene );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcase 'i3dm': {\r\n\r\n\t\t\t\t\tconst slicedBuffer = buffer.slice();\r\n\t\t\t\t\tconst loader = new _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__[\"I3DMLoader\"]( manager );\r\n\t\t\t\t\tloader.workingPath = this.workingPath;\r\n\t\t\t\t\tloader.fetchOptions = this.fetchOptions;\r\n\r\n\t\t\t\t\tconst promise = loader\r\n\t\t\t\t\t\t.parse( slicedBuffer.buffer )\r\n\t\t\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\t\t\tresults.push( res );\r\n\t\t\t\t\t\t\tgroup.add( res.scene );\r\n\r\n\t\t\t\t\t\t} );\r\n\t\t\t\t\tpromises.push( promise );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn Promise.all( promises ).then( () => {\r\n\r\n\t\t\treturn {\r\n\r\n\t\t\t\ttiles: results,\r\n\t\t\t\tscene: group,\r\n\r\n\t\t\t};\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js": +/*!************************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js ***! + \************************************************************************/ +/*! exports provided: NONE, SCREEN_ERROR, GEOMETRIC_ERROR, DISTANCE, DEPTH, RELATIVE_DEPTH, IS_LEAF, RANDOM_COLOR, DebugTilesRenderer */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NONE\", function() { return NONE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SCREEN_ERROR\", function() { return SCREEN_ERROR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GEOMETRIC_ERROR\", function() { return GEOMETRIC_ERROR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DISTANCE\", function() { return DISTANCE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEPTH\", function() { return DEPTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RELATIVE_DEPTH\", function() { return RELATIVE_DEPTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IS_LEAF\", function() { return IS_LEAF; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RANDOM_COLOR\", function() { return RANDOM_COLOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DebugTilesRenderer\", function() { return DebugTilesRenderer; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TilesRenderer.js */ \"./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js\");\n/* harmony import */ var _SphereHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SphereHelper.js */ \"./node_modules/3d-tiles-renderer/src/three/SphereHelper.js\");\n\r\n\r\n\r\n\r\nconst ORIGINAL_MATERIAL = Symbol( 'ORIGINAL_MATERIAL' );\r\nconst HAS_RANDOM_COLOR = Symbol( 'HAS_RANDOM_COLOR' );\r\n\r\nfunction emptyRaycast() {}\r\n\r\nconst NONE = 0;\r\nconst SCREEN_ERROR = 1;\r\nconst GEOMETRIC_ERROR = 2;\r\nconst DISTANCE = 3;\r\nconst DEPTH = 4;\r\nconst RELATIVE_DEPTH = 5;\r\nconst IS_LEAF = 6;\r\nconst RANDOM_COLOR = 7;\r\n\r\nclass DebugTilesRenderer extends _TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__[\"TilesRenderer\"] {\r\n\r\n\tconstructor( ...args ) {\r\n\r\n\t\tsuper( ...args );\r\n\r\n\t\tconst tilesGroup = this.group;\r\n\t\tconst boxGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\ttilesGroup.add( boxGroup );\r\n\r\n\t\tconst sphereGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\ttilesGroup.add( sphereGroup );\r\n\r\n\t\tthis.displayBoxBounds = false;\r\n\t\tthis.displaySphereBounds = false;\r\n\t\tthis.colorMode = NONE;\r\n\t\tthis.boxGroup = boxGroup;\r\n\t\tthis.sphereGroup = sphereGroup;\r\n\t\tthis.maxDebugDepth = - 1;\r\n\t\tthis.maxDebugDistance = - 1;\r\n\t\tthis.maxDebugError = - 1;\r\n\r\n\t\tthis.extremeDebugDepth = - 1;\r\n\t\tthis.extremeDebugError = - 1;\r\n\r\n\t}\r\n\r\n\tinitExtremes() {\r\n\r\n\t\t// initialize the extreme values of the hierarchy\r\n\t\tlet maxDepth = - 1;\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tmaxDepth = Math.max( maxDepth, tile.__depth );\r\n\r\n\t\t} );\r\n\r\n\t\tlet maxError = - 1;\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tmaxError = Math.max( maxError, tile.geometricError );\r\n\r\n\t\t} );\r\n\r\n\t\tthis.extremeDebugDepth = maxDepth;\r\n\t\tthis.extremeDebugError = maxError;\r\n\r\n\t}\r\n\r\n\tloadTileSet( ...args ) {\r\n\r\n\t\tconst pr = super.loadTileSet( ...args );\r\n\t\tpr\r\n\t\t\t.then( () => this.initExtremes() )\r\n\t\t\t.catch( () => {\r\n\r\n\t\t\t\t// error is logged internally\r\n\r\n\t\t\t} );\r\n\r\n\t\treturn pr;\r\n\r\n\t}\r\n\r\n\tgetTileInformationFromActiveObject( object ) {\r\n\r\n\t\t// Find which tile this scene is associated with. This is slow and\r\n\t\t// intended for debug purposes only.\r\n\t\tlet targetTile = null;\r\n\t\tconst activeTiles = this.activeTiles;\r\n\t\tactiveTiles.forEach( tile => {\r\n\r\n\t\t\tif ( targetTile ) {\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst scene = tile.cached.scene;\r\n\t\t\tif ( scene ) {\r\n\r\n\t\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\t\tif ( c === object ) {\r\n\r\n\t\t\t\t\t\ttargetTile = tile;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t\tif ( targetTile ) {\r\n\r\n\t\t\treturn {\r\n\r\n\t\t\t\tdistanceToCamera: targetTile.cached.distance,\r\n\t\t\t\tgeometricError: targetTile.geometricError,\r\n\t\t\t\tscreenSpaceError: targetTile.__error,\r\n\t\t\t\tdepth: targetTile.__depth,\r\n\t\t\t\tisLeaf: targetTile.__isLeaf\r\n\r\n\t\t\t};\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tupdate() {\r\n\r\n\t\tsuper.update();\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\t// set box or sphere visibility\r\n\t\tthis.boxGroup.visible = this.displayBoxBounds;\r\n\t\tthis.sphereGroup.visible = this.displaySphereBounds;\r\n\r\n\t\t// get max values to use for materials\r\n\t\tlet maxDepth = - 1;\r\n\t\tif ( this.maxDebugDepth === - 1 ) {\r\n\r\n\t\t\tmaxDepth = this.extremeDebugDepth;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tmaxDepth = this.maxDebugDepth;\r\n\r\n\t\t}\r\n\r\n\t\tlet maxError = - 1;\r\n\t\tif ( this.maxDebugError === - 1 ) {\r\n\r\n\t\t\tmaxError = this.extremeDebugError;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tmaxError = this.maxDebugError;\r\n\r\n\t\t}\r\n\r\n\t\tlet maxDistance = - 1;\r\n\t\tif ( this.maxDebugDistance === - 1 ) {\r\n\r\n\t\t\tmaxDistance = this.root.cached.sphere.radius;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tmaxDistance = this.maxDebugDistance;\r\n\r\n\t\t}\r\n\r\n\t\tconst errorTarget = this.errorTarget;\r\n\t\tconst colorMode = this.colorMode;\r\n\t\tconst visibleTiles = this.visibleTiles;\r\n\t\tvisibleTiles.forEach( tile => {\r\n\r\n\t\t\tconst scene = tile.cached.scene;\r\n\r\n\t\t\t// create a random color per-tile\r\n\t\t\tlet h, s, l;\r\n\t\t\tif ( colorMode === RANDOM_COLOR ) {\r\n\r\n\t\t\t\th = Math.random();\r\n\t\t\t\ts = 0.5 + Math.random() * 0.5;\r\n\t\t\t\tl = 0.375 + Math.random() * 0.25;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tconst currMaterial = c.material;\r\n\t\t\t\tif ( currMaterial ) {\r\n\r\n\t\t\t\t\t// Reset the material if needed\r\n\t\t\t\t\tconst originalMaterial = c[ ORIGINAL_MATERIAL ];\r\n\t\t\t\t\tif ( colorMode === NONE && currMaterial !== originalMaterial ) {\r\n\r\n\t\t\t\t\t\tc.material.dispose();\r\n\t\t\t\t\t\tc.material = c[ ORIGINAL_MATERIAL ];\r\n\r\n\t\t\t\t\t} else if ( colorMode !== NONE && currMaterial === originalMaterial ) {\r\n\r\n\t\t\t\t\t\tif ( c.isPoints ) {\r\n\r\n\t\t\t\t\t\t\tconst pointsMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"PointsMaterial\"]();\r\n\t\t\t\t\t\t\tpointsMaterial.size = originalMaterial.size;\r\n\t\t\t\t\t\t\tpointsMaterial.sizeAttenuation = originalMaterial.sizeAttenuation;\r\n\t\t\t\t\t\t\tc.material = pointsMaterial;\r\n\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\tc.material = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]();\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( colorMode !== RANDOM_COLOR ) {\r\n\r\n\t\t\t\t\t\tdelete c.material[ HAS_RANDOM_COLOR ];\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Set the color on the basic material\r\n\t\t\t\t\tswitch ( colorMode ) {\r\n\r\n\t\t\t\t\t\tcase DEPTH: {\r\n\r\n\t\t\t\t\t\t\tconst val = tile.__depth / maxDepth;\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase RELATIVE_DEPTH: {\r\n\r\n\t\t\t\t\t\t\tconst val = tile.__depthFromRenderedParent / maxDepth;\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase SCREEN_ERROR: {\r\n\r\n\t\t\t\t\t\t\tconst val = tile.__error / errorTarget;\r\n\t\t\t\t\t\t\tif ( val > 1.0 ) {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.setRGB( 1.0, 0.0, 0.0 );\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase GEOMETRIC_ERROR: {\r\n\r\n\t\t\t\t\t\t\tconst val = Math.min( tile.geometricError / maxError, 1 );\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase DISTANCE: {\r\n\r\n\t\t\t\t\t\t\t// We don't update the distance if the geometric error is 0.0 so\r\n\t\t\t\t\t\t\t// it will always be black.\r\n\t\t\t\t\t\t\tconst val = Math.min( tile.cached.distance / maxDistance, 1 );\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase IS_LEAF: {\r\n\r\n\t\t\t\t\t\t\tif ( ! tile.children || tile.children.length === 0 ) {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.set( 0xffffff );\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.set( 0 );\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase RANDOM_COLOR: {\r\n\r\n\t\t\t\t\t\t\tif ( ! c.material[ HAS_RANDOM_COLOR ] ) {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.setHSL( h, s, l );\r\n\t\t\t\t\t\t\t\tc.material[ HAS_RANDOM_COLOR ] = true;\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tsetTileVisible( tile, visible ) {\r\n\r\n\t\tsuper.setTileVisible( tile, visible );\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tconst sphereGroup = this.sphereGroup;\r\n\t\tconst boxGroup = this.boxGroup;\r\n\t\tconst boxHelperGroup = cached.boxHelperGroup;\r\n\t\tconst sphereHelper = cached.sphereHelper;\r\n\r\n\t\tif ( ! visible ) {\r\n\r\n\t\t\tboxGroup.remove( boxHelperGroup );\r\n\t\t\tsphereGroup.remove( sphereHelper );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tboxGroup.add( boxHelperGroup );\r\n\t\t\tboxHelperGroup.updateMatrixWorld( true );\r\n\r\n\t\t\tsphereGroup.add( sphereHelper );\r\n\t\t\tsphereHelper.updateMatrixWorld( true );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tparseTile( buffer, tile, extension ) {\r\n\r\n\t\treturn super\r\n\t\t\t.parseTile( buffer, tile, extension )\r\n\t\t\t.then( () => {\r\n\r\n\t\t\t\tconst cached = tile.cached;\r\n\t\t\t\tconst scene = cached.scene;\r\n\t\t\t\tif ( scene ) {\r\n\r\n\t\t\t\t\tconst cachedBox = cached.box;\r\n\t\t\t\t\tconst cachedBoxMat = cached.boxTransform;\r\n\r\n\t\t\t\t\t// Create debug bounding box\r\n\t\t\t\t\tconst boxHelperGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\t\t\t\tboxHelperGroup.matrix.copy( cachedBoxMat );\r\n\t\t\t\t\tboxHelperGroup.matrix.decompose( boxHelperGroup.position, boxHelperGroup.quaternion, boxHelperGroup.scale );\r\n\r\n\t\t\t\t\tconst boxHelper = new three__WEBPACK_IMPORTED_MODULE_0__[\"Box3Helper\"]( cachedBox );\r\n\t\t\t\t\tboxHelper.raycast = emptyRaycast;\r\n\t\t\t\t\tboxHelperGroup.add( boxHelper );\r\n\r\n\t\t\t\t\tcached.boxHelperGroup = boxHelperGroup;\r\n\r\n\t\t\t\t\tif ( this.visibleTiles.has( tile ) && this.displayBoxBounds ) {\r\n\r\n\t\t\t\t\t\tthis.boxGroup.add( boxHelperGroup );\r\n\t\t\t\t\t\tboxHelperGroup.updateMatrixWorld( true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Create debugbounding sphere\r\n\t\t\t\t\tconst cachedSphere = cached.sphere;\r\n\t\t\t\t\tconst sphereHelper = new _SphereHelper_js__WEBPACK_IMPORTED_MODULE_2__[\"SphereHelper\"]( cachedSphere );\r\n\t\t\t\t\tsphereHelper.raycast = emptyRaycast;\r\n\t\t\t\t\tcached.sphereHelper = sphereHelper;\r\n\r\n\t\t\t\t\tif ( this.visibleTiles.has( tile ) && this.displaySphereBounds ) {\r\n\r\n\t\t\t\t\t\tthis.sphereGroup.add( sphereHelper );\r\n\t\t\t\t\t\tsphereHelper.updateMatrixWorld( true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Cache the original materials\r\n\t\t\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\t\t\tconst material = c.material;\r\n\t\t\t\t\t\tif ( material ) {\r\n\r\n\t\t\t\t\t\t\tc[ ORIGINAL_MATERIAL ] = material;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tdisposeTile( tile ) {\r\n\r\n\t\tsuper.disposeTile( tile );\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tif ( cached.boxHelperGroup ) {\r\n\r\n\t\t\tcached.boxHelperGroup.children[ 0 ].geometry.dispose();\r\n\t\t\tcached.sphereHelper.geometry.dispose();\r\n\r\n\t\t\tdelete cached.boxHelperGroup;\r\n\t\t\tdelete cached.sphereHelper;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js": +/*!****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js ***! + \****************************************************************/ +/*! exports provided: I3DMLoader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoader\", function() { return I3DMLoader; });\n/* harmony import */ var _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/I3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/loaders/GLTFLoader.js */ \"./node_modules/three/examples/jsm/loaders/GLTFLoader.js\");\n\r\n\r\n\r\n\r\nconst tempPos = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\r\nconst tempQuat = new three__WEBPACK_IMPORTED_MODULE_1__[\"Quaternion\"]();\r\nconst tempSca = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\r\nconst tempMat = new three__WEBPACK_IMPORTED_MODULE_1__[\"Matrix4\"]();\r\nclass I3DMLoader extends _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__[\"I3DMLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_1__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tresolveExternalURL( url ) {\r\n\r\n\t\treturn this.manager.resolveURL( super.resolveExternalURL( url ) );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\treturn super\r\n\t\t\t.parse( buffer )\r\n\t\t\t.then( i3dm => {\r\n\r\n\t\t\t\tconst { featureTable, batchTable } = i3dm;\r\n\t\t\t\tconst gltfBuffer = i3dm.glbBytes.slice().buffer;\r\n\t\t\t\treturn new Promise( ( resolve, reject ) => {\r\n\r\n\t\t\t\t\tconst manager = this.manager;\r\n\t\t\t\t\tconst loader = manager.getHandler( 'path.gltf' ) || new three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"GLTFLoader\"]( manager );\r\n\t\t\t\t\tloader.parse( gltfBuffer, null, model => {\r\n\r\n\t\t\t\t\t\tconst INSTANCES_LENGTH = featureTable.getData( 'INSTANCES_LENGTH' );\r\n\r\n\t\t\t\t\t\t// RTC_CENTER\r\n\t\t\t\t\t\t// QUANTIZED_VOLUME_OFFSET\r\n\t\t\t\t\t\t// QUANTIZED_VOLUME_SCALE\r\n\t\t\t\t\t\t// EAST_NORTH_UP\r\n\r\n\t\t\t\t\t\tconst POSITION = featureTable.getData( 'POSITION', INSTANCES_LENGTH, 'FLOAT', 'VEC3' );\r\n\r\n\t\t\t\t\t\t// POSITION_QUANTIZED\r\n\t\t\t\t\t\t// NORMAL_UP\r\n\t\t\t\t\t\t// NORMAL_RIGHT\r\n\t\t\t\t\t\t// NORMAL_UP_OCT32P\r\n\t\t\t\t\t\t// NORMAL_RIGHT_OCT32P\r\n\t\t\t\t\t\t// SCALE\r\n\t\t\t\t\t\t// SCALE_NON_UNIFORM\r\n\t\t\t\t\t\t// BATCH_ID\r\n\r\n\t\t\t\t\t\tconst instanceMap = new Map();\r\n\t\t\t\t\t\tconst instances = [];\r\n\t\t\t\t\t\tmodel.scene.traverse( child => {\r\n\r\n\t\t\t\t\t\t\tif ( child.isMesh ) {\r\n\r\n\t\t\t\t\t\t\t\tconst { geometry, material } = child;\r\n\t\t\t\t\t\t\t\tconst instancedMesh = new three__WEBPACK_IMPORTED_MODULE_1__[\"InstancedMesh\"]( geometry, material, INSTANCES_LENGTH );\r\n\t\t\t\t\t\t\t\tinstances.push( instancedMesh );\r\n\t\t\t\t\t\t\t\tinstanceMap.set( child, instancedMesh );\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} );\r\n\r\n\t\t\t\t\t\tconst averageVector = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\r\n\t\t\t\t\t\tfor ( let i = 0; i < INSTANCES_LENGTH; i ++ ) {\r\n\r\n\t\t\t\t\t\t\t// TODO: handle quantized position\r\n\t\t\t\t\t\t\taverageVector.x += POSITION[ i * 3 + 0 ] / INSTANCES_LENGTH;\r\n\t\t\t\t\t\t\taverageVector.y += POSITION[ i * 3 + 1 ] / INSTANCES_LENGTH;\r\n\t\t\t\t\t\t\taverageVector.z += POSITION[ i * 3 + 2 ] / INSTANCES_LENGTH;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// replace the meshes with instanced meshes\r\n\t\t\t\t\t\tinstanceMap.forEach( ( instancedMesh, mesh ) => {\r\n\r\n\t\t\t\t\t\t\tconst parent = mesh.parent;\r\n\t\t\t\t\t\t\tif ( parent ) {\r\n\r\n\t\t\t\t\t\t\t\t// Mesh have no children\r\n\t\t\t\t\t\t\t\tparent.remove( mesh );\r\n\t\t\t\t\t\t\t\tparent.add( instancedMesh );\r\n\r\n\t\t\t\t\t\t\t\t// Center the instance around an average point to avoid jitter at large scales.\r\n\t\t\t\t\t\t\t\tinstancedMesh\r\n\t\t\t\t\t\t\t\t\t.position\r\n\t\t\t\t\t\t\t\t\t.copy( averageVector );\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} );\r\n\r\n\t\t\t\t\t\tfor ( let i = 0; i < INSTANCES_LENGTH; i ++ ) {\r\n\r\n\t\t\t\t\t\t\t// TODO: handle quantized position\r\n\t\t\t\t\t\t\ttempPos.set(\r\n\t\t\t\t\t\t\t\tPOSITION[ i * 3 + 0 ] - averageVector.x,\r\n\t\t\t\t\t\t\t\tPOSITION[ i * 3 + 1 ] - averageVector.y,\r\n\t\t\t\t\t\t\t\tPOSITION[ i * 3 + 2 ] - averageVector.z,\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t// TODO: handle normal orientation features\r\n\t\t\t\t\t\t\ttempQuat.set( 0, 0, 0, 1 );\r\n\r\n\t\t\t\t\t\t\t// TODO: handle scale features\r\n\t\t\t\t\t\t\ttempSca.set( 1, 1, 1 );\r\n\r\n\t\t\t\t\t\t\ttempMat.compose( tempPos, tempQuat, tempSca );\r\n\r\n\t\t\t\t\t\t\tfor ( let j = 0, l = instances.length; j < l; j ++ ) {\r\n\r\n\t\t\t\t\t\t\t\tconst instance = instances[ j ];\r\n\t\t\t\t\t\t\t\tinstance.setMatrixAt( i, tempMat );\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmodel.batchTable = batchTable;\r\n\t\t\t\t\t\tmodel.featureTable = featureTable;\r\n\r\n\t\t\t\t\t\tmodel.scene.batchTable = batchTable;\r\n\t\t\t\t\t\tmodel.scene.featureTable = featureTable;\r\n\r\n\t\t\t\t\t\tresolve( model );\r\n\r\n\t\t\t\t\t}, reject );\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js": +/*!****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js ***! + \****************************************************************/ +/*! exports provided: PNTSLoader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoader\", function() { return PNTSLoader; });\n/* harmony import */ var _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/PNTSLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\n\r\n\r\nclass PNTSLoader extends _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__[\"PNTSLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_1__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst result = super.parse( buffer );\r\n\t\tconst { featureTable } = result;\r\n\r\n\t\t// global semantics\r\n\t\tconst POINTS_LENGTH = featureTable.getData( 'POINTS_LENGTH' );\r\n\r\n\t\t// RTC_CENTER\r\n\t\t// QUANTIZED_VOLUME_OFFSET\r\n\t\t// QUANTIZED_VOLUME_SCALE\r\n\t\t// CONSTANT_RGBA\r\n\t\t// BATCH_LENGTH\r\n\r\n\t\tconst POSITION = featureTable.getData( 'POSITION', POINTS_LENGTH, 'FLOAT', 'VEC3' );\r\n\t\tconst RGB = featureTable.getData( 'RGB', POINTS_LENGTH, 'UNSIGNED_BYTE', 'VEC3' );\r\n\r\n\t\t// POSITION_QUANTIZED\r\n\t\t// RGBA\r\n\t\t// RGB565\r\n\t\t// NORMAL\r\n\t\t// NORMAL_OCT16P\r\n\t\t// BATCH_ID\r\n\r\n\t\tif ( POSITION === null ) {\r\n\r\n\t\t\tthrow new Error( 'PNTSLoader : POSITION_QUANTIZED feature type is not supported.' );\r\n\r\n\t\t}\r\n\r\n\t\tconst geometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]();\r\n\t\tgeometry.setAttribute( 'position', new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferAttribute\"]( POSITION, 3, false ) );\r\n\r\n\t\tconst material = new three__WEBPACK_IMPORTED_MODULE_1__[\"PointsMaterial\"]();\r\n\t\tmaterial.size = 2;\r\n\t\tmaterial.sizeAttenuation = false;\r\n\r\n\t\tif ( RGB !== null ) {\r\n\r\n\t\t\tgeometry.setAttribute( 'color', new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferAttribute\"]( RGB, 3, true ) );\r\n\t\t\tmaterial.vertexColors = true;\r\n\r\n\t\t}\r\n\r\n\t\tconst object = new three__WEBPACK_IMPORTED_MODULE_1__[\"Points\"]( geometry, material );\r\n\t\tresult.scene = object;\r\n\t\tresult.scene.featureTable = featureTable;\r\n\r\n\t\treturn result;\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/SphereHelper.js": +/*!******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/SphereHelper.js ***! + \******************************************************************/ +/*! exports provided: SphereHelper */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SphereHelper\", function() { return SphereHelper; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\n\r\nconst _vector = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\nconst axes = [ 'x', 'y', 'z' ];\r\nclass SphereHelper extends three__WEBPACK_IMPORTED_MODULE_0__[\"LineSegments\"] {\r\n\r\n\tconstructor( sphere, color = 0xffff00, angleSteps = 40 ) {\r\n\r\n\t\tconst geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferGeometry\"]();\r\n\t\tconst positions = [];\r\n\t\tfor ( let i = 0; i < 3; i ++ ) {\r\n\r\n\t\t\tconst axis1 = axes[ i ];\r\n\t\t\tconst axis2 = axes[ ( i + 1 ) % 3 ];\r\n\t\t\t_vector.set( 0, 0, 0 );\r\n\r\n\t\t\tfor ( let a = 0; a < angleSteps; a ++ ) {\r\n\r\n\t\t\t\tlet angle;\r\n\t\t\t\tangle = 2 * Math.PI * a / ( angleSteps - 1 );\r\n\t\t\t\t_vector[ axis1 ] = Math.sin( angle );\r\n\t\t\t\t_vector[ axis2 ] = Math.cos( angle );\r\n\r\n\t\t\t\tpositions.push( _vector.x, _vector.y, _vector.z );\r\n\r\n\t\t\t\tangle = 2 * Math.PI * ( a + 1 ) / ( angleSteps - 1 );\r\n\t\t\t\t_vector[ axis1 ] = Math.sin( angle );\r\n\t\t\t\t_vector[ axis2 ] = Math.cos( angle );\r\n\r\n\t\t\t\tpositions.push( _vector.x, _vector.y, _vector.z );\r\n\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t\tgeometry.setAttribute( 'position', new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferAttribute\"]( new Float32Array( positions ), 3 ) );\r\n\t\tgeometry.computeBoundingSphere();\r\n\r\n\t\tsuper( geometry, new three__WEBPACK_IMPORTED_MODULE_0__[\"LineBasicMaterial\"]( { color: color, toneMapped: false } ) );\r\n\t\tthis.sphere = sphere;\r\n\t\tthis.type = 'SphereHelper';\r\n\r\n\t}\r\n\r\n\tupdateMatrixWorld( force ) {\r\n\r\n\t\tconst sphere = this.sphere;\r\n\t\tthis.position.copy( sphere.center );\r\n\t\tthis.scale.setScalar( sphere.radius );\r\n\t\tsuper.updateMatrixWorld( force );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/SphereHelper.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/TilesGroup.js": +/*!****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/TilesGroup.js ***! + \****************************************************************/ +/*! exports provided: TilesGroup */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TilesGroup\", function() { return TilesGroup; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\n\r\n// Specialization of \"Group\" that only updates world matrices of children if\r\n// the transform has changed since the last update and ignores the \"force\"\r\n// parameter under the assumption that the children tiles will not move.\r\nconst tempMat = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\r\nclass TilesGroup extends three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"] {\r\n\r\n\tconstructor( tilesRenderer ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.tilesRenderer = tilesRenderer;\r\n\r\n\t}\r\n\r\n\traycast( raycaster, intersects ) {\r\n\r\n\t\tthis.tilesRenderer.raycast( raycaster, intersects );\r\n\r\n\t}\r\n\r\n\tupdateMatrixWorld( force ) {\r\n\r\n\t\tif ( this.matrixAutoUpdate ) {\r\n\r\n\t\t\tthis.updateMatrix();\r\n\r\n\t\t}\r\n\r\n\t\tif ( this.matrixWorldNeedsUpdate || force ) {\r\n\r\n\t\t\tif ( this.parent === null ) {\r\n\r\n\t\t\t\ttempMat.copy( this.matrix );\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\ttempMat.multiplyMatrices( this.parent.matrixWorld, this.matrix );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tthis.matrixWorldNeedsUpdate = false;\r\n\r\n\t\t\t// check if the matrix changed relative to what it was.\r\n\t\t\tconst elA = tempMat.elements;\r\n\t\t\tconst elB = this.matrixWorld.elements;\r\n\t\t\tlet isDifferent = false;\r\n\t\t\tfor ( let i = 0; i < 16; i ++ ) {\r\n\r\n\t\t\t\tconst itemA = elA[ i ];\r\n\t\t\t\tconst itemB = elB[ i ];\r\n\t\t\t\tconst diff = Math.abs( itemA - itemB );\r\n\r\n\t\t\t\tif ( diff > Number.EPSILON ) {\r\n\r\n\t\t\t\t\tisDifferent = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( isDifferent ) {\r\n\r\n\t\t\t\tthis.matrixWorld.copy( tempMat );\r\n\r\n\t\t\t\t// update children\r\n\t\t\t\t// the children will not have to change unless the parent group has updated\r\n\t\t\t\tconst children = this.children;\r\n\t\t\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\t\t\tchildren[ i ].updateMatrixWorld();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/TilesGroup.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js": +/*!*******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js ***! + \*******************************************************************/ +/*! exports provided: TilesRenderer */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TilesRenderer\", function() { return TilesRenderer; });\n/* harmony import */ var _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/TilesRendererBase.js */ \"./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js\");\n/* harmony import */ var _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./B3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js\");\n/* harmony import */ var _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PNTSLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js\");\n/* harmony import */ var _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./I3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js\");\n/* harmony import */ var _CMPTLoader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CMPTLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js\");\n/* harmony import */ var _TilesGroup_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TilesGroup.js */ \"./node_modules/3d-tiles-renderer/src/three/TilesGroup.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _raycastTraverse_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./raycastTraverse.js */ \"./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst INITIAL_FRUSTUM_CULLED = Symbol( 'INITIAL_FRUSTUM_CULLED' );\r\nconst DEG2RAD = three__WEBPACK_IMPORTED_MODULE_6__[\"Math\"].DEG2RAD;\r\nconst tempMat = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\nconst tempMat2 = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\nconst tempVector = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\nconst vecX = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\nconst vecY = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\nconst vecZ = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\n\r\nconst X_AXIS = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]( 1, 0, 0 );\r\nconst Y_AXIS = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]( 0, 1, 0 );\r\n\r\nfunction emptyRaycast() {}\r\n\r\nfunction updateFrustumCulled( object, toInitialValue ) {\r\n\r\n\tobject.traverse( c => {\r\n\r\n\t\tc.frustumCulled = c[ INITIAL_FRUSTUM_CULLED ] && toInitialValue;\r\n\r\n\t} );\r\n\r\n}\r\n\r\nclass TilesRenderer extends _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_0__[\"TilesRendererBase\"] {\r\n\r\n\tget autoDisableRendererCulling() {\r\n\r\n\t\treturn this._autoDisableRendererCulling;\r\n\r\n\t}\r\n\r\n\tset autoDisableRendererCulling( value ) {\r\n\r\n\t\tif ( this._autoDisableRendererCulling !== value ) {\r\n\r\n\t\t\tsuper._autoDisableRendererCulling = value;\r\n\t\t\tthis.traverse( tile => {\r\n\r\n\t\t\t\tif ( tile.scene ) {\r\n\r\n\t\t\t\t\tupdateFrustumCulled( tile.scene, value );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tconstructor( ...args ) {\r\n\r\n\t\tsuper( ...args );\r\n\t\tthis.group = new _TilesGroup_js__WEBPACK_IMPORTED_MODULE_5__[\"TilesGroup\"]( this );\r\n\t\tthis.cameras = [];\r\n\t\tthis.cameraMap = new Map();\r\n\t\tthis.cameraInfo = [];\r\n\t\tthis.activeTiles = new Set();\r\n\t\tthis.visibleTiles = new Set();\r\n\t\tthis._autoDisableRendererCulling = true;\r\n\r\n\t\tthis.onLoadTileSet = null;\r\n\t\tthis.onLoadModel = null;\r\n\t\tthis.onDisposeModel = null;\r\n\r\n\t\tconst manager = new three__WEBPACK_IMPORTED_MODULE_6__[\"LoadingManager\"]();\r\n\t\tmanager.setURLModifier( url => {\r\n\r\n\t\t\tif ( this.preprocessURL ) {\r\n\r\n\t\t\t\treturn this.preprocessURL( url );\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\treturn url;\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\t/* Public API */\r\n\tgetBounds( box ) {\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst cached = this.root.cached;\r\n\t\tconst boundingBox = cached.box;\r\n\t\tconst obbMat = cached.boxTransform;\r\n\r\n\t\tif ( boundingBox ) {\r\n\r\n\t\t\tbox.copy( boundingBox );\r\n\t\t\tbox.applyMatrix4( obbMat );\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tgetOrientedBounds( box, matrix ) {\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst cached = this.root.cached;\r\n\t\tconst boundingBox = cached.box;\r\n\t\tconst obbMat = cached.boxTransform;\r\n\r\n\t\tif ( box ) {\r\n\r\n\t\t\tbox.copy( boundingBox );\r\n\t\t\tmatrix.copy( obbMat );\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tforEachLoadedModel( callback ) {\r\n\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tconst scene = tile.cached.scene;\r\n\t\t\tif ( scene ) {\r\n\r\n\t\t\t\tcallback( scene, tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\traycast( raycaster, intersects ) {\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\tif ( raycaster.firstHitOnly ) {\r\n\r\n\t\t\tconst hit = Object(_raycastTraverse_js__WEBPACK_IMPORTED_MODULE_7__[\"raycastTraverseFirstHit\"])( this.root, this.group, this.activeTiles, raycaster );\r\n\t\t\tif ( hit ) {\r\n\r\n\t\t\t\tintersects.push( hit );\r\n\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t\tObject(_raycastTraverse_js__WEBPACK_IMPORTED_MODULE_7__[\"raycastTraverse\"])( this.root, this.group, this.activeTiles, raycaster, intersects );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\thasCamera( camera ) {\r\n\r\n\t\treturn this.cameraMap.has( camera );\r\n\r\n\t}\r\n\r\n\tsetCamera( camera ) {\r\n\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( ! cameraMap.has( camera ) ) {\r\n\r\n\t\t\tcameraMap.set( camera, new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector2\"]() );\r\n\t\t\tcameras.push( camera );\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\tsetResolution( camera, xOrVec, y ) {\r\n\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( ! cameraMap.has( camera ) ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tif ( xOrVec instanceof three__WEBPACK_IMPORTED_MODULE_6__[\"Vector2\"] ) {\r\n\r\n\t\t\tcameraMap.get( camera ).copy( xOrVec );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tcameraMap.get( camera ).set( xOrVec, y );\r\n\r\n\t\t}\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\tsetResolutionFromRenderer( camera, renderer ) {\r\n\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( ! cameraMap.has( camera ) ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst resolution = cameraMap.get( camera );\r\n\t\trenderer.getSize( resolution );\r\n\t\tresolution.multiplyScalar( renderer.getPixelRatio() );\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\tdeleteCamera( camera ) {\r\n\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( cameraMap.has( camera ) ) {\r\n\r\n\t\t\tconst index = cameras.indexOf( camera );\r\n\t\t\tcameras.splice( index, 1 );\r\n\t\t\tcameraMap.delete( camera );\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\t/* Overriden */\r\n\tfetchTileSet( url, ...rest ) {\r\n\r\n\t\tconst pr = super.fetchTileSet( url, ...rest );\r\n\t\tpr.then( json => {\r\n\r\n\t\t\tif ( this.onLoadTileSet ) {\r\n\r\n\t\t\t\t// Push this onto the end of the event stack to ensure this runs\r\n\t\t\t\t// after the base renderer has placed the provided json where it\r\n\t\t\t\t// needs to be placed and is ready for an update.\r\n\t\t\t\tPromise.resolve().then( () => {\r\n\r\n\t\t\t\t\tthis.onLoadTileSet( json, url );\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\t\treturn pr;\r\n\r\n\t}\r\n\r\n\tupdate() {\r\n\r\n\t\tconst group = this.group;\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tconst cameraInfo = this.cameraInfo;\r\n\r\n\t\tif ( cameras.length === 0 ) {\r\n\r\n\t\t\tconsole.warn( 'TilesRenderer: no cameras defined. Cannot update 3d tiles.' );\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\t// automatically scale the array of cameraInfo to match the cameras\r\n\t\twhile ( cameraInfo.length > cameras.length ) {\r\n\r\n\t\t\tcameraInfo.pop();\r\n\r\n\t\t}\r\n\r\n\t\twhile ( cameraInfo.length < cameras.length ) {\r\n\r\n\t\t\tcameraInfo.push( {\r\n\r\n\t\t\t\tfrustum: new three__WEBPACK_IMPORTED_MODULE_6__[\"Frustum\"](),\r\n\t\t\t\tsseDenominator: - 1,\r\n\t\t\t\tposition: new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"](),\r\n\t\t\t\tinvScale: - 1,\r\n\t\t\t\tpixelSize: 0,\r\n\r\n\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t\t// extract scale of group container\r\n\t\ttempMat2.copy( group.matrixWorld ).invert();\r\n\r\n\t\tlet invScale;\r\n\t\ttempVector.setFromMatrixScale( tempMat2 );\r\n\t\tinvScale = tempVector.x;\r\n\r\n\t\tif ( Math.abs( Math.max( tempVector.x - tempVector.y, tempVector.x - tempVector.z ) ) > 1e-6 ) {\r\n\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when calculating screen space error.' );\r\n\r\n\t\t}\r\n\r\n\t\t// store the camera cameraInfo in the 3d tiles root frame\r\n\t\tfor ( let i = 0, l = cameraInfo.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst camera = cameras[ i ];\r\n\t\t\tconst info = cameraInfo[ i ];\r\n\t\t\tconst frustum = info.frustum;\r\n\t\t\tconst position = info.position;\r\n\t\t\tconst resolution = cameraMap.get( camera );\r\n\r\n\t\t\tif ( resolution.width === 0 || resolution.height === 0 ) {\r\n\r\n\t\t\t\tconsole.warn( 'TilesRenderer: resolution for camera error calculation is not set.' );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( camera.isPerspectiveCamera ) {\r\n\r\n\t\t\t\tinfo.sseDenominator = 2 * Math.tan( 0.5 * camera.fov * DEG2RAD ) / resolution.height;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( camera.isOrthographicCamera ) {\r\n\r\n\t\t\t\tconst w = camera.right - camera.left;\r\n\t\t\t\tconst h = camera.top - camera.bottom;\r\n\t\t\t\tinfo.pixelSize = Math.max( h / resolution.height, w / resolution.width );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tinfo.invScale = invScale;\r\n\r\n\t\t\t// get frustum in group root frame\r\n\t\t\ttempMat.copy( group.matrixWorld );\r\n\t\t\ttempMat.premultiply( camera.matrixWorldInverse );\r\n\t\t\ttempMat.premultiply( camera.projectionMatrix );\r\n\r\n\t\t\tfrustum.setFromProjectionMatrix( tempMat );\r\n\r\n\t\t\t// get transform position in group root frame\r\n\t\t\tposition.set( 0, 0, 0 );\r\n\t\t\tposition.applyMatrix4( camera.matrixWorld );\r\n\t\t\tposition.applyMatrix4( tempMat2 );\r\n\r\n\t\t}\r\n\r\n\t\tsuper.update();\r\n\r\n\t}\r\n\r\n\tpreprocessNode( tile, parentTile, tileSetDir ) {\r\n\r\n\t\tsuper.preprocessNode( tile, parentTile, tileSetDir );\r\n\r\n\t\tconst transform = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\n\t\tif ( tile.transform ) {\r\n\r\n\t\t\tconst transformArr = tile.transform;\r\n\t\t\tfor ( let i = 0; i < 16; i ++ ) {\r\n\r\n\t\t\t\ttransform.elements[ i ] = transformArr[ i ];\r\n\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t\ttransform.identity();\r\n\r\n\t\t}\r\n\r\n\t\tif ( parentTile ) {\r\n\r\n\t\t\ttransform.premultiply( parentTile.cached.transform );\r\n\r\n\t\t}\r\n\r\n\t\tlet box = null;\r\n\t\tlet boxTransform = null;\r\n\t\tlet boxTransformInverse = null;\r\n\t\tif ( 'box' in tile.boundingVolume ) {\r\n\r\n\t\t\tconst data = tile.boundingVolume.box;\r\n\t\t\tbox = new three__WEBPACK_IMPORTED_MODULE_6__[\"Box3\"]();\r\n\t\t\tboxTransform = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\n\t\t\tboxTransformInverse = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\n\r\n\t\t\t// get the extents of the bounds in each axis\r\n\t\t\tvecX.set( data[ 3 ], data[ 4 ], data[ 5 ] );\r\n\t\t\tvecY.set( data[ 6 ], data[ 7 ], data[ 8 ] );\r\n\t\t\tvecZ.set( data[ 9 ], data[ 10 ], data[ 11 ] );\r\n\r\n\t\t\tconst scaleX = vecX.length();\r\n\t\t\tconst scaleY = vecY.length();\r\n\t\t\tconst scaleZ = vecZ.length();\r\n\r\n\t\t\tvecX.normalize();\r\n\t\t\tvecY.normalize();\r\n\t\t\tvecZ.normalize();\r\n\r\n\t\t\t// create the oriented frame that the box exists in\r\n\t\t\tboxTransform.set(\r\n\t\t\t\tvecX.x, vecY.x, vecZ.x, data[ 0 ],\r\n\t\t\t\tvecX.y, vecY.y, vecZ.y, data[ 1 ],\r\n\t\t\t\tvecX.z, vecY.z, vecZ.z, data[ 2 ],\r\n\t\t\t\t0, 0, 0, 1\r\n\t\t\t);\r\n\t\t\tboxTransform.premultiply( transform );\r\n\t\t\tboxTransformInverse.copy( boxTransform ).invert();\r\n\r\n\t\t\t// scale the box by the extents\r\n\t\t\tbox.min.set( - scaleX, - scaleY, - scaleZ );\r\n\t\t\tbox.max.set( scaleX, scaleY, scaleZ );\r\n\r\n\t\t}\r\n\r\n\t\tlet sphere = null;\r\n\t\tif ( 'sphere' in tile.boundingVolume ) {\r\n\r\n\t\t\tconst data = tile.boundingVolume.sphere;\r\n\t\t\tsphere = new three__WEBPACK_IMPORTED_MODULE_6__[\"Sphere\"]();\r\n\t\t\tsphere.center.set( data[ 0 ], data[ 1 ], data[ 2 ] );\r\n\t\t\tsphere.radius = data[ 3 ];\r\n\t\t\tsphere.applyMatrix4( transform );\r\n\r\n\t\t} else if ( 'box' in tile.boundingVolume ) {\r\n\r\n\t\t\tconst data = tile.boundingVolume.box;\r\n\t\t\tsphere = new three__WEBPACK_IMPORTED_MODULE_6__[\"Sphere\"]();\r\n\t\t\tbox.getBoundingSphere( sphere );\r\n\t\t\tsphere.center.set( data[ 0 ], data[ 1 ], data[ 2 ] );\r\n\t\t\tsphere.applyMatrix4( transform );\r\n\r\n\t\t}\r\n\r\n\t\tlet region = null;\r\n\t\tif ( 'region' in tile.boundingVolume ) {\r\n\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer: region bounding volume not supported.' );\r\n\r\n\t\t}\r\n\r\n\t\ttile.cached = {\r\n\r\n\t\t\tloadIndex: 0,\r\n\t\t\ttransform,\r\n\t\t\tactive: false,\r\n\t\t\tinFrustum: [],\r\n\r\n\t\t\tbox,\r\n\t\t\tboxTransform,\r\n\t\t\tboxTransformInverse,\r\n\t\t\tsphere,\r\n\t\t\tregion,\r\n\r\n\t\t\tscene: null,\r\n\t\t\tgeometry: null,\r\n\t\t\tmaterial: null,\r\n\t\t\tdistance: Infinity\r\n\r\n\t\t};\r\n\r\n\t}\r\n\r\n\tparseTile( buffer, tile, extension ) {\r\n\r\n\t\ttile._loadIndex = tile._loadIndex || 0;\r\n\t\ttile._loadIndex ++;\r\n\r\n\t\tconst uri = tile.content.uri;\r\n\t\tconst uriSplits = uri.split( /[\\\\\\/]/g );\r\n\t\turiSplits.pop();\r\n\t\tconst workingPath = uriSplits.join( '/' );\r\n\t\tconst fetchOptions = this.fetchOptions;\r\n\r\n\t\tconst manager = this.manager;\r\n\t\tconst loadIndex = tile._loadIndex;\r\n\t\tlet promise = null;\r\n\r\n\t\tswitch ( extension ) {\r\n\r\n\t\t\tcase 'b3dm':\r\n\t\t\t\tpromise = new _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_1__[\"B3DMLoader\"]( manager )\r\n\t\t\t\t\t.parse( buffer )\r\n\t\t\t\t\t.then( res => res.scene );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'pnts':\r\n\t\t\t\tpromise = Promise.resolve( new _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"PNTSLoader\"]( manager ).parse( buffer ).scene );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'i3dm': {\r\n\r\n\t\t\t\tconst loader = new _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_3__[\"I3DMLoader\"]( manager );\r\n\t\t\t\tloader.workingPath = workingPath;\r\n\t\t\t\tloader.fetchOptions = fetchOptions;\r\n\t\t\t\tpromise = loader\r\n\t\t\t\t\t.parse( buffer )\r\n\t\t\t\t\t.then( res => res.scene );\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tcase 'cmpt': {\r\n\r\n\t\t\t\tconst loader = new _CMPTLoader_js__WEBPACK_IMPORTED_MODULE_4__[\"CMPTLoader\"]( manager );\r\n\t\t\t\tloader.workingPath = workingPath;\r\n\t\t\t\tloader.fetchOptions = fetchOptions;\r\n\t\t\t\tpromise = loader\r\n\t\t\t\t\t.parse( buffer )\r\n\t\t\t\t\t.then( res => res.scene\t);\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.warn( `TilesRenderer: Content type \"${ extension }\" not supported.` );\r\n\t\t\t\tpromise = Promise.resolve( null );\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\r\n\t\treturn promise.then( scene => {\r\n\r\n\t\t\tif ( tile._loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\treturn;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst upAxis = this.rootTileSet.asset && this.rootTileSet.asset.gltfUpAxis || 'y';\r\n\t\t\tconst cached = tile.cached;\r\n\t\t\tconst cachedTransform = cached.transform;\r\n\r\n\t\t\tswitch ( upAxis.toLowerCase() ) {\r\n\r\n\t\t\t\tcase 'x':\r\n\t\t\t\t\tscene.matrix.makeRotationAxis( Y_AXIS, - Math.PI / 2 );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'y':\r\n\t\t\t\t\tscene.matrix.makeRotationAxis( X_AXIS, Math.PI / 2 );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'z':\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tscene.matrix.premultiply( cachedTransform );\r\n\t\t\tscene.matrix.decompose( scene.position, scene.quaternion, scene.scale );\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tc[ INITIAL_FRUSTUM_CULLED ] = c.frustumCulled;\r\n\r\n\t\t\t} );\r\n\t\t\tupdateFrustumCulled( scene, this.autoDisableRendererCulling );\r\n\r\n\t\t\tcached.scene = scene;\r\n\r\n\t\t\t// We handle raycasting in a custom way so remove it from here\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tc.raycast = emptyRaycast;\r\n\r\n\t\t\t} );\r\n\r\n\t\t\tconst materials = [];\r\n\t\t\tconst geometry = [];\r\n\t\t\tconst textures = [];\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tif ( c.geometry ) {\r\n\r\n\t\t\t\t\tgeometry.push( c.geometry );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( c.material ) {\r\n\r\n\t\t\t\t\tconst material = c.material;\r\n\t\t\t\t\tmaterials.push( c.material );\r\n\r\n\t\t\t\t\tfor ( const key in material ) {\r\n\r\n\t\t\t\t\t\tconst value = material[ key ];\r\n\t\t\t\t\t\tif ( value && value.isTexture ) {\r\n\r\n\t\t\t\t\t\t\ttextures.push( value );\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t\tcached.materials = materials;\r\n\t\t\tcached.geometry = geometry;\r\n\t\t\tcached.textures = textures;\r\n\r\n\t\t\tif ( this.onLoadModel ) {\r\n\r\n\t\t\t\tthis.onLoadModel( scene, tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tdisposeTile( tile ) {\r\n\r\n\t\t// This could get called before the tile has finished downloading\r\n\t\tconst cached = tile.cached;\r\n\t\tif ( cached.scene ) {\r\n\r\n\t\t\tconst materials = cached.materials;\r\n\t\t\tconst geometry = cached.geometry;\r\n\t\t\tconst textures = cached.textures;\r\n\r\n\t\t\tfor ( let i = 0, l = geometry.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tgeometry[ i ].dispose();\r\n\r\n\t\t\t}\r\n\r\n\t\t\tfor ( let i = 0, l = materials.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tmaterials[ i ].dispose();\r\n\r\n\t\t\t}\r\n\r\n\t\t\tfor ( let i = 0, l = textures.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tconst texture = textures[ i ];\r\n\t\t\t\ttexture.dispose();\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( this.onDisposeModel ) {\r\n\r\n\t\t\t\tthis.onDisposeModel( cached.scene, tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tcached.scene = null;\r\n\t\t\tcached.materials = null;\r\n\t\t\tcached.textures = null;\r\n\t\t\tcached.geometry = null;\r\n\r\n\t\t}\r\n\r\n\t\ttile._loadIndex ++;\r\n\r\n\t}\r\n\r\n\tsetTileVisible( tile, visible ) {\r\n\r\n\t\tconst scene = tile.cached.scene;\r\n\t\tconst visibleTiles = this.visibleTiles;\r\n\t\tconst group = this.group;\r\n\t\tif ( visible ) {\r\n\r\n\t\t\tgroup.add( scene );\r\n\t\t\tvisibleTiles.add( tile );\r\n\t\t\tscene.updateMatrixWorld( true );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tgroup.remove( scene );\r\n\t\t\tvisibleTiles.delete( tile );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tsetTileActive( tile, active ) {\r\n\r\n\t\tconst activeTiles = this.activeTiles;\r\n\t\tif ( active ) {\r\n\r\n\t\t\tactiveTiles.add( tile );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tactiveTiles.delete( tile );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tcalculateError( tile ) {\r\n\r\n\t\tif ( tile.geometricError === 0.0 ) {\r\n\r\n\t\t\treturn 0.0;\r\n\r\n\t\t}\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tconst inFrustum = cached.inFrustum;\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraInfo = this.cameraInfo;\r\n\r\n\t\t// TODO: Use the content bounding volume here?\r\n\t\tconst boundingVolume = tile.boundingVolume;\r\n\t\tif ( 'box' in boundingVolume ) {\r\n\r\n\t\t\tconst boundingBox = cached.box;\r\n\t\t\tconst boxTransformInverse = cached.boxTransformInverse;\r\n\r\n\t\t\tlet maxError = - Infinity;\r\n\t\t\tlet minDistance = Infinity;\r\n\t\t\tfor ( let i = 0, l = cameras.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tif ( ! inFrustum[ i ] ) {\r\n\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// transform camera position into local frame of the tile bounding box\r\n\t\t\t\tconst camera = cameras[ i ];\r\n\t\t\t\tconst info = cameraInfo[ i ];\r\n\t\t\t\tconst invScale = info.invScale;\r\n\t\t\t\ttempVector.copy( info.position );\r\n\t\t\t\ttempVector.applyMatrix4( boxTransformInverse );\r\n\r\n\t\t\t\tlet error;\r\n\t\t\t\tif ( camera.isOrthographicCamera ) {\r\n\r\n\t\t\t\t\tconst pixelSize = info.pixelSize;\r\n\t\t\t\t\terror = tile.geometricError / ( pixelSize * invScale );\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tconst distance = boundingBox.distanceToPoint( tempVector );\r\n\t\t\t\t\tconst scaledDistance = distance * invScale;\r\n\t\t\t\t\tconst sseDenominator = info.sseDenominator;\r\n\t\t\t\t\terror = tile.geometricError / ( scaledDistance * sseDenominator );\r\n\r\n\t\t\t\t\tminDistance = Math.min( minDistance, scaledDistance );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmaxError = Math.max( maxError, error );\r\n\r\n\t\t\t}\r\n\r\n\t\t\ttile.cached.distance = minDistance;\r\n\r\n\t\t\treturn maxError;\r\n\r\n\t\t} else if ( 'sphere' in boundingVolume ) {\r\n\r\n\t\t\t// const sphere = cached.sphere;\r\n\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer : Sphere bounds not supported.' );\r\n\r\n\t\t} else if ( 'region' in boundingVolume ) {\r\n\r\n\t\t\t// unsupported\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer : Region bounds not supported.' );\r\n\r\n\t\t}\r\n\r\n\t\treturn Infinity;\r\n\r\n\t}\r\n\r\n\ttileInView( tile ) {\r\n\r\n\t\t// TODO: we should use the more precise bounding volumes here if possible\r\n\t\t// cache the root-space planes\r\n\t\t// Use separating axis theorem for frustum and obb\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tconst sphere = cached.sphere;\r\n\t\tconst inFrustum = cached.inFrustum;\r\n\t\tif ( sphere ) {\r\n\r\n\t\t\tconst cameraInfo = this.cameraInfo;\r\n\t\t\tlet inView = false;\r\n\t\t\tfor ( let i = 0, l = cameraInfo.length; i < l; i ++ ) {\r\n\r\n\t\t\t\t// Track which camera frustums this tile is in so we can use it\r\n\t\t\t\t// to ignore the error calculations for cameras that can't see it\r\n\t\t\t\tconst frustum = cameraInfo[ i ].frustum;\r\n\t\t\t\tif ( frustum.intersectsSphere( sphere ) ) {\r\n\r\n\t\t\t\t\tinView = true;\r\n\t\t\t\t\tinFrustum[ i ] = true;\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tinFrustum[ i ] = false;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn inView;\r\n\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js": +/*!*********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js ***! + \*********************************************************************/ +/*! exports provided: raycastTraverseFirstHit, raycastTraverse */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"raycastTraverseFirstHit\", function() { return raycastTraverseFirstHit; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"raycastTraverse\", function() { return raycastTraverse; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\nconst _sphere = new three__WEBPACK_IMPORTED_MODULE_0__[\"Sphere\"]();\r\nconst _mat = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\r\nconst _vec = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\nconst _vec2 = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\nconst _ray = new three__WEBPACK_IMPORTED_MODULE_0__[\"Ray\"]();\r\n\r\nconst _hitArray = [];\r\n\r\nfunction distanceSort( a, b ) {\r\n\r\n\treturn a.distance - b.distance;\r\n\r\n}\r\n\r\nfunction intersectTileScene( scene, raycaster, intersects ) {\r\n\r\n\t// Don't intersect the box3 helpers because those are used for debugging\r\n\tscene.traverse( c => {\r\n\r\n\t\t// We set the default raycast function to empty so three.js doesn't automatically cast against it\r\n\t\tObject.getPrototypeOf( c ).raycast.call( c, raycaster, intersects );\r\n\r\n\t} );\r\n\r\n}\r\n\r\n// Returns the closest hit when traversing the tree\r\nfunction raycastTraverseFirstHit( root, group, activeTiles, raycaster ) {\r\n\r\n\t// If the root is active make sure we've checked it\r\n\tif ( activeTiles.has( root ) ) {\r\n\r\n\t\tintersectTileScene( root.cached.scene, raycaster, _hitArray );\r\n\r\n\t\tif ( _hitArray.length > 0 ) {\r\n\r\n\t\t\tif ( _hitArray.length > 1 ) {\r\n\r\n\t\t\t\t_hitArray.sort( distanceSort );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst res = _hitArray[ 0 ];\r\n\t\t\t_hitArray.length = 0;\r\n\t\t\treturn res;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// TODO: can we avoid creating a new array here every time to save on memory?\r\n\tconst array = [];\r\n\tconst children = root.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\tconst tile = children[ i ];\r\n\t\tconst cached = tile.cached;\r\n\t\tconst groupMatrixWorld = group.matrixWorld;\r\n\r\n\t\t_mat.copy( groupMatrixWorld );\r\n\r\n\t\t// if we don't hit the sphere then early out\r\n\t\tconst sphere = cached.sphere;\r\n\t\tif ( sphere ) {\r\n\r\n\t\t\t_sphere.copy( sphere );\r\n\t\t\t_sphere.applyMatrix4( _mat );\r\n\t\t\tif ( ! raycaster.ray.intersectsSphere( _sphere ) ) {\r\n\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// TODO: check region?\r\n\r\n\t\tconst boundingBox = cached.box;\r\n\t\tconst obbMat = cached.boxTransform;\r\n\t\tif ( boundingBox ) {\r\n\r\n\t\t\t_mat.multiply( obbMat ).invert();\r\n\t\t\t_ray.copy( raycaster.ray );\r\n\t\t\t_ray.applyMatrix4( _mat );\r\n\t\t\tif ( _ray.intersectBox( boundingBox, _vec ) ) {\r\n\r\n\t\t\t\t// account for tile scale\r\n\t\t\t\tlet invScale;\r\n\t\t\t\t_vec2.setFromMatrixScale( _mat );\r\n\t\t\t\tinvScale = _vec2.x;\r\n\r\n\t\t\t\tif ( Math.abs( Math.max( _vec2.x - _vec2.y, _vec2.x - _vec2.z ) ) > 1e-6 ) {\r\n\r\n\t\t\t\t\tconsole.warn( 'ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when raycasting.' );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// if we intersect the box save the distance to the tile bounds\r\n\t\t\t\tlet data = {\r\n\t\t\t\t\tdistance: Infinity,\r\n\t\t\t\t\ttile: null\r\n\t\t\t\t};\r\n\t\t\t\tarray.push( data );\r\n\r\n\t\t\t\tdata.distance = _vec.distanceToSquared( _ray.origin ) * invScale * invScale;\r\n\t\t\t\tdata.tile = tile;\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// sort them by ascending distance\r\n\tarray.sort( distanceSort );\r\n\r\n\t// traverse until we find the best hit and early out if a tile bounds\r\n\t// couldn't possible include a best hit\r\n\tlet bestDistanceSquared = Infinity;\r\n\tlet bestHit = null;\r\n\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\r\n\r\n\t\tconst data = array[ i ];\r\n\t\tconst distanceSquared = data.distance;\r\n\t\tif ( distanceSquared > bestDistanceSquared ) {\r\n\r\n\t\t\tbreak;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tconst tile = data.tile;\r\n\t\t\tconst scene = tile.cached.scene;\r\n\r\n\t\t\tlet hit = null;\r\n\t\t\tif ( activeTiles.has( tile ) ) {\r\n\r\n\t\t\t\t// save the hit if it's closer\r\n\t\t\t\tintersectTileScene( scene, raycaster, _hitArray );\r\n\t\t\t\tif ( _hitArray.length > 0 ) {\r\n\r\n\t\t\t\t\tif ( _hitArray.length > 1 ) {\r\n\r\n\t\t\t\t\t\t_hitArray.sort( distanceSort );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\thit = _hitArray[ 0 ];\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\thit = raycastTraverseFirstHit( tile, group, activeTiles, raycaster );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( hit ) {\r\n\r\n\t\t\t\tconst hitDistanceSquared = hit.distance * hit.distance;\r\n\t\t\t\tif ( hitDistanceSquared < bestDistanceSquared ) {\r\n\r\n\t\t\t\t\tbestDistanceSquared = hitDistanceSquared;\r\n\t\t\t\t\tbestHit = hit;\r\n\r\n\t\t\t\t}\r\n\t\t\t\t_hitArray.length = 0;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn bestHit;\r\n\r\n}\r\n\r\nfunction raycastTraverse( tile, group, activeTiles, raycaster, intersects ) {\r\n\r\n\tconst cached = tile.cached;\r\n\tconst groupMatrixWorld = group.matrixWorld;\r\n\r\n\t_mat.copy( groupMatrixWorld );\r\n\r\n\t// Early out if we don't hit this tile sphere\r\n\tconst sphere = cached.sphere;\r\n\tif ( sphere ) {\r\n\r\n\t\t_sphere.copy( sphere );\r\n\t\t_sphere.applyMatrix4( _mat );\r\n\t\tif ( ! raycaster.ray.intersectsSphere( _sphere ) ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// Early out if we don't this this tile box\r\n\tconst boundingBox = cached.box;\r\n\tconst obbMat = cached.boxTransform;\r\n\tif ( boundingBox ) {\r\n\r\n\t\t_mat.multiply( obbMat ).invert();\r\n\t\t_ray.copy( raycaster.ray ).applyMatrix4( _mat );\r\n\t\tif ( ! _ray.intersectsBox( boundingBox ) ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// TODO: check region\r\n\r\n\tconst scene = cached.scene;\r\n\tif ( activeTiles.has( tile ) ) {\r\n\r\n\t\tintersectTileScene( scene, raycaster, intersects );\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst children = tile.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\traycastTraverse( children[ i ], group, activeTiles, raycaster, intersects );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js": +/*!**********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js ***! + \**********************************************************************/ +/*! exports provided: FeatureTable, BatchTable */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FeatureTable\", function() { return FeatureTable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BatchTable\", function() { return BatchTable; });\n/* harmony import */ var _arrayToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayToString.js */ \"./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js\");\n\r\n\r\nclass FeatureTable {\r\n\r\n\tconstructor( buffer, start, headerLength, binLength ) {\r\n\r\n\t\tthis.buffer = buffer;\r\n\t\tthis.binOffset = start + headerLength;\r\n\t\tthis.binLength = binLength;\r\n\r\n\t\tlet header = null;\r\n\t\tif ( headerLength !== 0 ) {\r\n\r\n\t\t\tconst headerData = new Uint8Array( buffer, start, headerLength );\r\n\t\t\theader = JSON.parse( Object(_arrayToString_js__WEBPACK_IMPORTED_MODULE_0__[\"arrayToString\"])( headerData ) );\r\n\r\n\t\t} else {\r\n\r\n\t\t\theader = {};\r\n\r\n\t\t}\r\n\t\tthis.header = header;\r\n\r\n\t}\r\n\r\n\tgetKeys() {\r\n\r\n\t\treturn Object.keys( this.header );\r\n\r\n\t}\r\n\r\n\tgetData( key, count, defaultComponentType = null, defaultType = null ) {\r\n\r\n\t\tconst header = this.header;\r\n\r\n\t\tif ( ! ( key in header ) ) {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t}\r\n\r\n\t\tconst feature = header[ key ];\r\n\t\tif ( ! ( feature instanceof Object ) ) {\r\n\r\n\t\t\treturn feature;\r\n\r\n\t\t} else if ( Array.isArray( feature ) ) {\r\n\r\n\t\t\treturn feature;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tconst { buffer, binOffset, binLength } = this;\r\n\t\t\tconst byteOffset = feature.byteOffset || 0;\r\n\t\t\tconst featureType = feature.type || defaultType;\r\n\t\t\tconst featureComponentType = feature.componentType || defaultComponentType;\r\n\r\n\t\t\tif ( 'type' in feature && defaultType && feature.type !== defaultType ) {\r\n\r\n\t\t\t\tthrow new Error( 'FeatureTable: Specified type does not match expected type.' );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tlet stride;\r\n\t\t\tswitch ( featureType ) {\r\n\r\n\t\t\t\tcase 'SCALAR':\r\n\t\t\t\t\tstride = 1;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'VEC2':\r\n\t\t\t\t\tstride = 2;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'VEC3':\r\n\t\t\t\t\tstride = 3;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'VEC4':\r\n\t\t\t\t\tstride = 4;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error( `FeatureTable : Feature type not provided for \"${ key }\".` );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tlet data;\r\n\t\t\tconst arrayStart = binOffset + byteOffset;\r\n\t\t\tconst arrayLength = count * stride;\r\n\r\n\t\t\tswitch ( featureComponentType ) {\r\n\r\n\t\t\t\tcase 'BYTE':\r\n\t\t\t\t\tdata = new Int8Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'UNSIGNED_BYTE':\r\n\t\t\t\t\tdata = new Uint8Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'SHORT':\r\n\t\t\t\t\tdata = new Int16Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'UNSIGNED_SHORT':\r\n\t\t\t\t\tdata = new Uint16Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'INT':\r\n\t\t\t\t\tdata = new Int32Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'UNSIGNED_INT':\r\n\t\t\t\t\tdata = new Uint32Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'FLOAT':\r\n\t\t\t\t\tdata = new Float32Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'DOUBLE':\r\n\t\t\t\t\tdata = new Float64Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error( `FeatureTable : Feature component type not provided for \"${ key }\".` );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst dataEnd = arrayStart + arrayLength * data.BYTES_PER_ELEMENT;\r\n\t\t\tif ( dataEnd > binOffset + binLength ) {\r\n\r\n\t\t\t\tthrow new Error( 'FeatureTable: Feature data read outside binary body length.' );\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\nclass BatchTable extends FeatureTable {\r\n\r\n\tconstructor( buffer, batchSize, start, headerLength, binLength ) {\r\n\r\n\t\tsuper( buffer, start, headerLength, binLength );\r\n\t\tthis.batchSize = batchSize;\r\n\r\n\t}\r\n\r\n\tgetData( key, componentType = null, type = null ) {\r\n\r\n\t\treturn super.getData( key, this.batchSize, type, componentType );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js": +/*!******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js ***! + \******************************************************************/ +/*! exports provided: LRUCache */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LRUCache\", function() { return LRUCache; });\n// Fires at the end of the frame and before the next one\r\nfunction enqueueMicrotask( callback ) {\r\n\r\n\tPromise.resolve().then( callback );\r\n\r\n}\r\n\r\nclass LRUCache {\r\n\r\n\tconstructor() {\r\n\r\n\t\t// options\r\n\t\tthis.maxSize = 800;\r\n\t\tthis.minSize = 600;\r\n\t\tthis.unloadPercent = 0.05;\r\n\r\n\t\t// \"itemSet\" doubles as both the list of the full set of items currently\r\n\t\t// stored in the cache (keys) as well as a map to the time the item was last\r\n\t\t// used so it can be sorted appropriately.\r\n\t\tthis.itemSet = new Map();\r\n\t\tthis.itemList = [];\r\n\t\tthis.usedSet = new Set();\r\n\t\tthis.callbacks = new Map();\r\n\r\n\t\tthis.unloadPriorityCallback = null;\r\n\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tthis.defaultPriorityCallback = item => itemSet.get( item );\r\n\r\n\t}\r\n\r\n\t// Returns whether or not the cache has reached the maximum size\r\n\tisFull() {\r\n\r\n\t\treturn this.itemSet.size >= this.maxSize;\r\n\r\n\t}\r\n\r\n\tadd( item, removeCb ) {\r\n\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tif ( itemSet.has( item ) ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tif ( this.isFull() ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tconst itemList = this.itemList;\r\n\t\tconst callbacks = this.callbacks;\r\n\t\titemList.push( item );\r\n\t\tusedSet.add( item );\r\n\t\titemSet.set( item, Date.now() );\r\n\t\tcallbacks.set( item, removeCb );\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\tremove( item ) {\r\n\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tconst itemList = this.itemList;\r\n\t\tconst callbacks = this.callbacks;\r\n\r\n\t\tif ( itemSet.has( item ) ) {\r\n\r\n\t\t\tcallbacks.get( item )( item );\r\n\r\n\t\t\tconst index = itemList.indexOf( item );\r\n\t\t\titemList.splice( index, 1 );\r\n\t\t\tusedSet.delete( item );\r\n\t\t\titemSet.delete( item );\r\n\t\t\tcallbacks.delete( item );\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\tmarkUsed( item ) {\r\n\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tif ( itemSet.has( item ) && ! usedSet.has( item ) ) {\r\n\r\n\t\t\titemSet.set( item, Date.now() );\r\n\t\t\tusedSet.add( item );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tmarkAllUnused() {\r\n\r\n\t\tthis.usedSet.clear();\r\n\r\n\t}\r\n\r\n\t// TODO: this should be renamed because it's not necessarily unloading all unused content\r\n\t// Maybe call it \"cleanup\" or \"unloadToMinSize\"\r\n\tunloadUnusedContent() {\r\n\r\n\t\tconst unloadPercent = this.unloadPercent;\r\n\t\tconst targetSize = this.minSize;\r\n\t\tconst itemList = this.itemList;\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tconst callbacks = this.callbacks;\r\n\t\tconst unused = itemList.length - usedSet.size;\r\n\t\tconst excess = itemList.length - targetSize;\r\n\t\tconst unloadPriorityCallback = this.unloadPriorityCallback || this.defaultPriorityCallback;\r\n\r\n\t\tif ( excess > 0 && unused > 0 ) {\r\n\r\n\t\t\t// used items should be at the end of the array\r\n\t\t\titemList.sort( ( a, b ) => {\r\n\r\n\t\t\t\tconst usedA = usedSet.has( a );\r\n\t\t\t\tconst usedB = usedSet.has( b );\r\n\t\t\t\tif ( usedA && usedB ) {\r\n\r\n\t\t\t\t\t// If they're both used then don't bother moving them\r\n\t\t\t\t\treturn 0;\r\n\r\n\t\t\t\t} else if ( ! usedA && ! usedB ) {\r\n\r\n\t\t\t\t\t// Use the sort function otherwise\r\n\t\t\t\t\t// higher priority should be further to the left\r\n\t\t\t\t\treturn unloadPriorityCallback( b ) - unloadPriorityCallback( a );\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t// If one is used and the other is not move the used one towards the end of the array\r\n\t\t\t\t\treturn usedA ? 1 : - 1;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t\t// address corner cases where the minSize might be zero or smaller than maxSize - minSize,\r\n\t\t\t// which would result in a very small or no items being unloaded.\r\n\t\t\tconst unusedExcess = Math.min( excess, unused );\r\n\t\t\tconst maxUnload = Math.max( targetSize * unloadPercent, unusedExcess * unloadPercent );\r\n\t\t\tlet nodesToUnload = Math.min( maxUnload, unused );\r\n\t\t\tnodesToUnload = Math.ceil( nodesToUnload );\r\n\r\n\t\t\tconst removedItems = itemList.splice( 0, nodesToUnload );\r\n\t\t\tfor ( let i = 0, l = removedItems.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tconst item = removedItems[ i ];\r\n\t\t\t\tcallbacks.get( item )( item );\r\n\t\t\t\titemSet.delete( item );\r\n\t\t\t\tcallbacks.delete( item );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tscheduleUnload( markAllUnused = true ) {\r\n\r\n\t\tif ( ! this.scheduled ) {\r\n\r\n\t\t\tthis.scheduled = true;\r\n\t\t\tenqueueMicrotask( () => {\r\n\r\n\t\t\t\tthis.scheduled = false;\r\n\t\t\t\tthis.unloadUnusedContent();\r\n\t\t\t\tif ( markAllUnused ) {\r\n\r\n\t\t\t\t\tthis.markAllUnused();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js": +/*!***********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js ***! + \***********************************************************************/ +/*! exports provided: PriorityQueue */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PriorityQueue\", function() { return PriorityQueue; });\nclass PriorityQueue {\r\n\r\n\tconstructor() {\r\n\r\n\t\t// options\r\n\t\tthis.maxJobs = 6;\r\n\r\n\t\tthis.items = [];\r\n\t\tthis.callbacks = new Map();\r\n\t\tthis.currJobs = 0;\r\n\t\tthis.scheduled = false;\r\n\t\tthis.autoUpdate = true;\r\n\r\n\t\tthis.priorityCallback = () => {\r\n\r\n\t\t\tthrow new Error( 'PriorityQueue: PriorityCallback function not defined.' );\r\n\r\n\t\t};\r\n\r\n\t}\r\n\r\n\tsort() {\r\n\r\n\t\tconst priorityCallback = this.priorityCallback;\r\n\t\tconst items = this.items;\r\n\t\titems.sort( ( a, b ) => {\r\n\r\n\t\t\treturn priorityCallback( a ) - priorityCallback( b );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tadd( item, callback ) {\r\n\r\n\t\treturn new Promise( ( resolve, reject ) => {\r\n\r\n\t\t\tconst prCallback = ( ...args ) => callback( ...args ).then( resolve ).catch( reject );\r\n\t\t\tconst items = this.items;\r\n\t\t\tconst callbacks = this.callbacks;\r\n\r\n\t\t\titems.push( item );\r\n\t\t\tcallbacks.set( item, prCallback );\r\n\r\n\t\t\tif ( this.autoUpdate ) {\r\n\r\n\t\t\t\tthis.scheduleJobRun();\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tremove( item ) {\r\n\r\n\t\tconst items = this.items;\r\n\t\tconst callbacks = this.callbacks;\r\n\r\n\t\tconst index = items.indexOf( item );\r\n\t\tif ( index !== - 1 ) {\r\n\r\n\t\t\titems.splice( index, 1 );\r\n\t\t\tcallbacks.delete( item );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\ttryRunJobs() {\r\n\r\n\t\tthis.sort();\r\n\r\n\t\tconst items = this.items;\r\n\t\tconst callbacks = this.callbacks;\r\n\t\tconst maxJobs = this.maxJobs;\r\n\t\tlet currJobs = this.currJobs;\r\n\t\twhile ( maxJobs > currJobs && items.length > 0 ) {\r\n\r\n\t\t\tcurrJobs ++;\r\n\t\t\tconst item = items.pop();\r\n\t\t\tconst callback = callbacks.get( item );\r\n\t\t\tcallbacks.delete( item );\r\n\t\t\tcallback( item )\r\n\t\t\t\t.then( () => {\r\n\r\n\t\t\t\t\tthis.currJobs --;\r\n\r\n\t\t\t\t\tif ( this.autoUpdate ) {\r\n\r\n\t\t\t\t\t\tthis.scheduleJobRun();\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.catch( () => {\r\n\r\n\t\t\t\t\tthis.currJobs --;\r\n\r\n\t\t\t\t\tif ( this.autoUpdate ) {\r\n\r\n\t\t\t\t\t\tthis.scheduleJobRun();\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t}\r\n\t\tthis.currJobs = currJobs;\r\n\r\n\t}\r\n\r\n\tscheduleJobRun() {\r\n\r\n\t\tif ( ! this.scheduled ) {\r\n\r\n\t\t\trequestAnimationFrame( () => {\r\n\r\n\t\t\t\tthis.tryRunJobs();\r\n\t\t\t\tthis.scheduled = false;\r\n\r\n\t\t\t} );\r\n\t\t\tthis.scheduled = true;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js": +/*!***********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js ***! + \***********************************************************************/ +/*! exports provided: arrayToString */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayToString\", function() { return arrayToString; });\nfunction arrayToString( array ) {\r\n\r\n\tlet str = '';\r\n\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\r\n\r\n\t\tstr += String.fromCharCode( array[ i ] );\r\n\r\n\t}\r\n\r\n\treturn str;\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js": +/*!*****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js ***! + \*****************************************************************/ +/*! exports provided: urlJoin */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"urlJoin\", function() { return urlJoin; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n\r\n\r\n// Function that properly handles path resolution for parts that have\r\n// a protocol component like \"http://\".\r\nfunction urlJoin( ...args ) {\r\n\r\n\tconst protocolRegex = /^[a-zA-Z]+:\\/\\//;\r\n\tlet lastRoot = - 1;\r\n\tfor ( let i = 0, l = args.length; i < l; i ++ ) {\r\n\r\n\t\tif ( protocolRegex.test( args[ i ] ) ) {\r\n\r\n\t\t\tlastRoot = i;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tif ( lastRoot === - 1 ) {\r\n\r\n\t\treturn path__WEBPACK_IMPORTED_MODULE_0___default.a.join( ...args ).replace( /\\\\/g, '/' );\r\n\r\n\t} else {\r\n\r\n\t\tconst parts = lastRoot <= 0 ? args : args.slice( lastRoot );\r\n\t\tconst protocol = parts[ 0 ].match( protocolRegex )[ 0 ];\r\n\t\tparts[ 0 ] = parts[ 0 ].substring( protocol.length );\r\n\r\n\t\treturn ( protocol + path__WEBPACK_IMPORTED_MODULE_0___default.a.join( ...parts ) ).replace( /\\\\/g, '/' );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/bbox/dist/es/index.js": +/*!**************************************************!*\ + !*** ./node_modules/@turf/bbox/dist/es/index.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n\n/**\n * Takes a set of features, calculates the bbox of all input features, and returns a bounding box.\n *\n * @name bbox\n * @param {GeoJSON} geojson any GeoJSON object\n * @returns {BBox} bbox extent in [minX, minY, maxX, maxY] order\n * @example\n * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]);\n * var bbox = turf.bbox(line);\n * var bboxPolygon = turf.bboxPolygon(bbox);\n *\n * //addToMap\n * var addToMap = [line, bboxPolygon]\n */\nfunction bbox(geojson) {\n var result = [Infinity, Infinity, -Infinity, -Infinity];\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_0__[\"coordEach\"])(geojson, function (coord) {\n if (result[0] > coord[0]) {\n result[0] = coord[0];\n }\n if (result[1] > coord[1]) {\n result[1] = coord[1];\n }\n if (result[2] < coord[0]) {\n result[2] = coord[0];\n }\n if (result[3] < coord[1]) {\n result[3] = coord[1];\n }\n });\n return result;\n}\nbbox[\"default\"] = bbox;\n/* harmony default export */ __webpack_exports__[\"default\"] = (bbox);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/bbox/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/boolean-disjoint/dist/es/index.js": +/*!**************************************************************!*\ + !*** ./node_modules/@turf/boolean-disjoint/dist/es/index.js ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/boolean-point-in-polygon */ \"./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js\");\n/* harmony import */ var _turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/line-intersect */ \"./node_modules/@turf/line-intersect/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n/* harmony import */ var _turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @turf/polygon-to-line */ \"./node_modules/@turf/polygon-to-line/dist/es/index.js\");\n\n\n\n\n/**\n * Boolean-disjoint returns (TRUE) if the intersection of the two geometries is an empty set.\n *\n * @name booleanDisjoint\n * @param {Geometry|Feature} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var point = turf.point([2, 2]);\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n *\n * turf.booleanDisjoint(line, point);\n * //=true\n */\nfunction booleanDisjoint(feature1, feature2) {\n var bool = true;\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_2__[\"flattenEach\"])(feature1, function (flatten1) {\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_2__[\"flattenEach\"])(feature2, function (flatten2) {\n if (bool === false) {\n return false;\n }\n bool = disjoint(flatten1.geometry, flatten2.geometry);\n });\n });\n return bool;\n}\n/**\n * Disjoint operation for simple Geometries (Point/LineString/Polygon)\n *\n * @private\n * @param {Geometry} geom1 GeoJSON Geometry\n * @param {Geometry} geom2 GeoJSON Geometry\n * @returns {boolean} true/false\n */\nfunction disjoint(geom1, geom2) {\n switch (geom1.type) {\n case \"Point\":\n switch (geom2.type) {\n case \"Point\":\n return !compareCoords(geom1.coordinates, geom2.coordinates);\n case \"LineString\":\n return !isPointOnLine(geom2, geom1);\n case \"Polygon\":\n return !Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(geom1, geom2);\n }\n /* istanbul ignore next */\n break;\n case \"LineString\":\n switch (geom2.type) {\n case \"Point\":\n return !isPointOnLine(geom1, geom2);\n case \"LineString\":\n return !isLineOnLine(geom1, geom2);\n case \"Polygon\":\n return !isLineInPoly(geom2, geom1);\n }\n /* istanbul ignore next */\n break;\n case \"Polygon\":\n switch (geom2.type) {\n case \"Point\":\n return !Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(geom2, geom1);\n case \"LineString\":\n return !isLineInPoly(geom1, geom2);\n case \"Polygon\":\n return !isPolyInPoly(geom2, geom1);\n }\n }\n return false;\n}\n// http://stackoverflow.com/a/11908158/1979085\nfunction isPointOnLine(lineString, pt) {\n for (var i = 0; i < lineString.coordinates.length - 1; i++) {\n if (isPointOnLineSegment(lineString.coordinates[i], lineString.coordinates[i + 1], pt.coordinates)) {\n return true;\n }\n }\n return false;\n}\nfunction isLineOnLine(lineString1, lineString2) {\n var doLinesIntersect = Object(_turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lineString1, lineString2);\n if (doLinesIntersect.features.length > 0) {\n return true;\n }\n return false;\n}\nfunction isLineInPoly(polygon, lineString) {\n for (var _i = 0, _a = lineString.coordinates; _i < _a.length; _i++) {\n var coord = _a[_i];\n if (Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(coord, polygon)) {\n return true;\n }\n }\n var doLinesIntersect = Object(_turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lineString, Object(_turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(polygon));\n if (doLinesIntersect.features.length > 0) {\n return true;\n }\n return false;\n}\n/**\n * Is Polygon (geom1) in Polygon (geom2)\n * Only takes into account outer rings\n * See http://stackoverflow.com/a/4833823/1979085\n *\n * @private\n * @param {Geometry|Feature} feature1 Polygon1\n * @param {Geometry|Feature} feature2 Polygon2\n * @returns {boolean} true/false\n */\nfunction isPolyInPoly(feature1, feature2) {\n for (var _i = 0, _a = feature1.coordinates[0]; _i < _a.length; _i++) {\n var coord1 = _a[_i];\n if (Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(coord1, feature2)) {\n return true;\n }\n }\n for (var _b = 0, _c = feature2.coordinates[0]; _b < _c.length; _b++) {\n var coord2 = _c[_b];\n if (Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(coord2, feature1)) {\n return true;\n }\n }\n var doLinesIntersect = Object(_turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Object(_turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(feature1), Object(_turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(feature2));\n if (doLinesIntersect.features.length > 0) {\n return true;\n }\n return false;\n}\nfunction isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt) {\n var dxc = pt[0] - lineSegmentStart[0];\n var dyc = pt[1] - lineSegmentStart[1];\n var dxl = lineSegmentEnd[0] - lineSegmentStart[0];\n var dyl = lineSegmentEnd[1] - lineSegmentStart[1];\n var cross = dxc * dyl - dyc * dxl;\n if (cross !== 0) {\n return false;\n }\n if (Math.abs(dxl) >= Math.abs(dyl)) {\n if (dxl > 0) {\n return lineSegmentStart[0] <= pt[0] && pt[0] <= lineSegmentEnd[0];\n }\n else {\n return lineSegmentEnd[0] <= pt[0] && pt[0] <= lineSegmentStart[0];\n }\n }\n else if (dyl > 0) {\n return lineSegmentStart[1] <= pt[1] && pt[1] <= lineSegmentEnd[1];\n }\n else {\n return lineSegmentEnd[1] <= pt[1] && pt[1] <= lineSegmentStart[1];\n }\n}\n/**\n * compareCoords\n *\n * @private\n * @param {Position} pair1 point [x,y]\n * @param {Position} pair2 point [x,y]\n * @returns {boolean} true/false if coord pairs match\n */\nfunction compareCoords(pair1, pair2) {\n return pair1[0] === pair2[0] && pair1[1] === pair2[1];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (booleanDisjoint);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/boolean-disjoint/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/boolean-intersects/dist/es/index.js": +/*!****************************************************************!*\ + !*** ./node_modules/@turf/boolean-intersects/dist/es/index.js ***! + \****************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return booleanIntersects; });\n/* harmony import */ var _turf_boolean_disjoint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/boolean-disjoint */ \"./node_modules/@turf/boolean-disjoint/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n\n\n/**\n * Boolean-intersects returns (TRUE) two geometries intersect.\n *\n * @name booleanIntersects\n * @param {Geometry|Feature} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var point = turf.point([2, 2]);\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n *\n * turf.booleanIntersects(line, point);\n * //=true\n */\nfunction booleanIntersects(feature1, feature2) {\n var bool = false;\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_1__[\"flattenEach\"])(feature1, function (flatten1) {\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_1__[\"flattenEach\"])(feature2, function (flatten2) {\n if (bool === true) {\n return true;\n }\n bool = !Object(_turf_boolean_disjoint__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(flatten1.geometry, flatten2.geometry);\n });\n });\n return bool;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/boolean-intersects/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js ***! + \**********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return booleanPointInPolygon; });\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n\n// http://en.wikipedia.org/wiki/Even%E2%80%93odd_rule\n// modified from: https://github.com/substack/point-in-polygon/blob/master/index.js\n// which was modified from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html\n/**\n * Takes a {@link Point} and a {@link Polygon} or {@link MultiPolygon} and determines if the point\n * resides inside the polygon. The polygon can be convex or concave. The function accounts for holes.\n *\n * @name booleanPointInPolygon\n * @param {Coord} point input point\n * @param {Feature} polygon input polygon or multipolygon\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.ignoreBoundary=false] True if polygon boundary should be ignored when determining if\n * the point is inside the polygon otherwise false.\n * @returns {boolean} `true` if the Point is inside the Polygon; `false` if the Point is not inside the Polygon\n * @example\n * var pt = turf.point([-77, 44]);\n * var poly = turf.polygon([[\n * [-81, 41],\n * [-81, 47],\n * [-72, 47],\n * [-72, 41],\n * [-81, 41]\n * ]]);\n *\n * turf.booleanPointInPolygon(pt, poly);\n * //= true\n */\nfunction booleanPointInPolygon(point, polygon, options) {\n if (options === void 0) { options = {}; }\n // validation\n if (!point) {\n throw new Error(\"point is required\");\n }\n if (!polygon) {\n throw new Error(\"polygon is required\");\n }\n var pt = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_0__[\"getCoord\"])(point);\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_0__[\"getGeom\"])(polygon);\n var type = geom.type;\n var bbox = polygon.bbox;\n var polys = geom.coordinates;\n // Quick elimination if point is not inside bbox\n if (bbox && inBBox(pt, bbox) === false) {\n return false;\n }\n // normalize to multipolygon\n if (type === \"Polygon\") {\n polys = [polys];\n }\n var insidePoly = false;\n for (var i = 0; i < polys.length && !insidePoly; i++) {\n // check if it is in the outer ring first\n if (inRing(pt, polys[i][0], options.ignoreBoundary)) {\n var inHole = false;\n var k = 1;\n // check for the point in any of the holes\n while (k < polys[i].length && !inHole) {\n if (inRing(pt, polys[i][k], !options.ignoreBoundary)) {\n inHole = true;\n }\n k++;\n }\n if (!inHole) {\n insidePoly = true;\n }\n }\n }\n return insidePoly;\n}\n/**\n * inRing\n *\n * @private\n * @param {Array} pt [x,y]\n * @param {Array>} ring [[x,y], [x,y],..]\n * @param {boolean} ignoreBoundary ignoreBoundary\n * @returns {boolean} inRing\n */\nfunction inRing(pt, ring, ignoreBoundary) {\n var isInside = false;\n if (ring[0][0] === ring[ring.length - 1][0] &&\n ring[0][1] === ring[ring.length - 1][1]) {\n ring = ring.slice(0, ring.length - 1);\n }\n for (var i = 0, j = ring.length - 1; i < ring.length; j = i++) {\n var xi = ring[i][0];\n var yi = ring[i][1];\n var xj = ring[j][0];\n var yj = ring[j][1];\n var onBoundary = pt[1] * (xi - xj) + yi * (xj - pt[0]) + yj * (pt[0] - xi) === 0 &&\n (xi - pt[0]) * (xj - pt[0]) <= 0 &&\n (yi - pt[1]) * (yj - pt[1]) <= 0;\n if (onBoundary) {\n return !ignoreBoundary;\n }\n var intersect = yi > pt[1] !== yj > pt[1] &&\n pt[0] < ((xj - xi) * (pt[1] - yi)) / (yj - yi) + xi;\n if (intersect) {\n isInside = !isInside;\n }\n }\n return isInside;\n}\n/**\n * inBBox\n *\n * @private\n * @param {Position} pt point [x,y]\n * @param {BBox} bbox BBox [west, south, east, north]\n * @returns {boolean} true/false if point is inside BBox\n */\nfunction inBBox(pt, bbox) {\n return (bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1]);\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/circle/dist/es/index.js": +/*!****************************************************!*\ + !*** ./node_modules/@turf/circle/dist/es/index.js ***! + \****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_destination__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/destination */ \"./node_modules/@turf/destination/dist/es/index.js\");\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n\n\n/**\n * Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.\n *\n * @name circle\n * @param {Feature|number[]} center center point\n * @param {number} radius radius of the circle\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.steps=64] number of steps\n * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians\n * @param {Object} [options.properties={}] properties\n * @returns {Feature} circle polygon\n * @example\n * var center = [-75.343, 39.984];\n * var radius = 5;\n * var options = {steps: 10, units: 'kilometers', properties: {foo: 'bar'}};\n * var circle = turf.circle(center, radius, options);\n *\n * //addToMap\n * var addToMap = [turf.point(center), circle]\n */\nfunction circle(center, radius, options) {\n if (options === void 0) { options = {}; }\n // default params\n var steps = options.steps || 64;\n var properties = options.properties\n ? options.properties\n : !Array.isArray(center) && center.type === \"Feature\" && center.properties\n ? center.properties\n : {};\n // main\n var coordinates = [];\n for (var i = 0; i < steps; i++) {\n coordinates.push(Object(_turf_destination__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(center, radius, (i * -360) / steps, options).geometry\n .coordinates);\n }\n coordinates.push(coordinates[0]);\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_1__[\"polygon\"])([coordinates], properties);\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (circle);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/circle/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/destination/dist/es/index.js": +/*!*********************************************************!*\ + !*** ./node_modules/@turf/destination/dist/es/index.js ***! + \*********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return destination; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n// http://en.wikipedia.org/wiki/Haversine_formula\n// http://www.movable-type.co.uk/scripts/latlong.html\n\n\n/**\n * Takes a {@link Point} and calculates the location of a destination point given a distance in\n * degrees, radians, miles, or kilometers; and bearing in degrees.\n * This uses the [Haversine formula](http://en.wikipedia.org/wiki/Haversine_formula) to account for global curvature.\n *\n * @name destination\n * @param {Coord} origin starting point\n * @param {number} distance distance from the origin point\n * @param {number} bearing ranging from -180 to 180\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians\n * @param {Object} [options.properties={}] Translate properties to Point\n * @returns {Feature} destination point\n * @example\n * var point = turf.point([-75.343, 39.984]);\n * var distance = 50;\n * var bearing = 90;\n * var options = {units: 'miles'};\n *\n * var destination = turf.destination(point, distance, bearing, options);\n *\n * //addToMap\n * var addToMap = [point, destination]\n * destination.properties['marker-color'] = '#f00';\n * point.properties['marker-color'] = '#0f0';\n */\nfunction destination(origin, distance, bearing, options) {\n if (options === void 0) { options = {}; }\n // Handle input\n var coordinates1 = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoord\"])(origin);\n var longitude1 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"degreesToRadians\"])(coordinates1[0]);\n var latitude1 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"degreesToRadians\"])(coordinates1[1]);\n var bearingRad = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"degreesToRadians\"])(bearing);\n var radians = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lengthToRadians\"])(distance, options.units);\n // Main\n var latitude2 = Math.asin(Math.sin(latitude1) * Math.cos(radians) +\n Math.cos(latitude1) * Math.sin(radians) * Math.cos(bearingRad));\n var longitude2 = longitude1 +\n Math.atan2(Math.sin(bearingRad) * Math.sin(radians) * Math.cos(latitude1), Math.cos(radians) - Math.sin(latitude1) * Math.sin(latitude2));\n var lng = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"radiansToDegrees\"])(longitude2);\n var lat = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"radiansToDegrees\"])(latitude2);\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])([lng, lat], options.properties);\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/destination/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/helpers/dist/es/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/@turf/helpers/dist/es/index.js ***! + \*****************************************************/ +/*! exports provided: earthRadius, factors, unitsFactors, areaFactors, feature, geometry, point, points, polygon, polygons, lineString, lineStrings, featureCollection, multiLineString, multiPoint, multiPolygon, geometryCollection, round, radiansToLength, lengthToRadians, lengthToDegrees, bearingToAzimuth, radiansToDegrees, degreesToRadians, convertLength, convertArea, isNumber, isObject, validateBBox, validateId */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"earthRadius\", function() { return earthRadius; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"factors\", function() { return factors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"unitsFactors\", function() { return unitsFactors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"areaFactors\", function() { return areaFactors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"feature\", function() { return feature; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geometry\", function() { return geometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"point\", function() { return point; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"points\", function() { return points; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polygon\", function() { return polygon; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polygons\", function() { return polygons; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineString\", function() { return lineString; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineStrings\", function() { return lineStrings; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureCollection\", function() { return featureCollection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiLineString\", function() { return multiLineString; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiPoint\", function() { return multiPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiPolygon\", function() { return multiPolygon; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geometryCollection\", function() { return geometryCollection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"radiansToLength\", function() { return radiansToLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lengthToRadians\", function() { return lengthToRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lengthToDegrees\", function() { return lengthToDegrees; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bearingToAzimuth\", function() { return bearingToAzimuth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"radiansToDegrees\", function() { return radiansToDegrees; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"degreesToRadians\", function() { return degreesToRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"convertLength\", function() { return convertLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"convertArea\", function() { return convertArea; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return isNumber; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObject\", function() { return isObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"validateBBox\", function() { return validateBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"validateId\", function() { return validateId; });\n/**\n * @module helpers\n */\n/**\n * Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth.\n *\n * @memberof helpers\n * @type {number}\n */\nvar earthRadius = 6371008.8;\n/**\n * Unit of measurement factors using a spherical (non-ellipsoid) earth radius.\n *\n * @memberof helpers\n * @type {Object}\n */\nvar factors = {\n centimeters: earthRadius * 100,\n centimetres: earthRadius * 100,\n degrees: earthRadius / 111325,\n feet: earthRadius * 3.28084,\n inches: earthRadius * 39.37,\n kilometers: earthRadius / 1000,\n kilometres: earthRadius / 1000,\n meters: earthRadius,\n metres: earthRadius,\n miles: earthRadius / 1609.344,\n millimeters: earthRadius * 1000,\n millimetres: earthRadius * 1000,\n nauticalmiles: earthRadius / 1852,\n radians: 1,\n yards: earthRadius / 1.0936,\n};\n/**\n * Units of measurement factors based on 1 meter.\n *\n * @memberof helpers\n * @type {Object}\n */\nvar unitsFactors = {\n centimeters: 100,\n centimetres: 100,\n degrees: 1 / 111325,\n feet: 3.28084,\n inches: 39.37,\n kilometers: 1 / 1000,\n kilometres: 1 / 1000,\n meters: 1,\n metres: 1,\n miles: 1 / 1609.344,\n millimeters: 1000,\n millimetres: 1000,\n nauticalmiles: 1 / 1852,\n radians: 1 / earthRadius,\n yards: 1 / 1.0936,\n};\n/**\n * Area of measurement factors based on 1 square meter.\n *\n * @memberof helpers\n * @type {Object}\n */\nvar areaFactors = {\n acres: 0.000247105,\n centimeters: 10000,\n centimetres: 10000,\n feet: 10.763910417,\n hectares: 0.0001,\n inches: 1550.003100006,\n kilometers: 0.000001,\n kilometres: 0.000001,\n meters: 1,\n metres: 1,\n miles: 3.86e-7,\n millimeters: 1000000,\n millimetres: 1000000,\n yards: 1.195990046,\n};\n/**\n * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}.\n *\n * @name feature\n * @param {Geometry} geometry input geometry\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a GeoJSON Feature\n * @example\n * var geometry = {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 50]\n * };\n *\n * var feature = turf.feature(geometry);\n *\n * //=feature\n */\nfunction feature(geom, properties, options) {\n if (options === void 0) { options = {}; }\n var feat = { type: \"Feature\" };\n if (options.id === 0 || options.id) {\n feat.id = options.id;\n }\n if (options.bbox) {\n feat.bbox = options.bbox;\n }\n feat.properties = properties || {};\n feat.geometry = geom;\n return feat;\n}\n/**\n * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates.\n * For GeometryCollection type use `helpers.geometryCollection`\n *\n * @name geometry\n * @param {string} type Geometry Type\n * @param {Array} coordinates Coordinates\n * @param {Object} [options={}] Optional Parameters\n * @returns {Geometry} a GeoJSON Geometry\n * @example\n * var type = \"Point\";\n * var coordinates = [110, 50];\n * var geometry = turf.geometry(type, coordinates);\n * // => geometry\n */\nfunction geometry(type, coordinates, _options) {\n if (_options === void 0) { _options = {}; }\n switch (type) {\n case \"Point\":\n return point(coordinates).geometry;\n case \"LineString\":\n return lineString(coordinates).geometry;\n case \"Polygon\":\n return polygon(coordinates).geometry;\n case \"MultiPoint\":\n return multiPoint(coordinates).geometry;\n case \"MultiLineString\":\n return multiLineString(coordinates).geometry;\n case \"MultiPolygon\":\n return multiPolygon(coordinates).geometry;\n default:\n throw new Error(type + \" is invalid\");\n }\n}\n/**\n * Creates a {@link Point} {@link Feature} from a Position.\n *\n * @name point\n * @param {Array} coordinates longitude, latitude position (each in decimal degrees)\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a Point feature\n * @example\n * var point = turf.point([-75.343, 39.984]);\n *\n * //=point\n */\nfunction point(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n if (!coordinates) {\n throw new Error(\"coordinates is required\");\n }\n if (!Array.isArray(coordinates)) {\n throw new Error(\"coordinates must be an Array\");\n }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be at least 2 numbers long\");\n }\n if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {\n throw new Error(\"coordinates must contain numbers\");\n }\n var geom = {\n type: \"Point\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Point} {@link FeatureCollection} from an Array of Point coordinates.\n *\n * @name points\n * @param {Array>} coordinates an array of Points\n * @param {Object} [properties={}] Translate these properties to each Feature\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north]\n * associated with the FeatureCollection\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection} Point Feature\n * @example\n * var points = turf.points([\n * [-75, 39],\n * [-80, 45],\n * [-78, 50]\n * ]);\n *\n * //=points\n */\nfunction points(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return point(coords, properties);\n }), options);\n}\n/**\n * Creates a {@link Polygon} {@link Feature} from an Array of LinearRings.\n *\n * @name polygon\n * @param {Array>>} coordinates an array of LinearRings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} Polygon Feature\n * @example\n * var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], { name: 'poly1' });\n *\n * //=polygon\n */\nfunction polygon(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n for (var _i = 0, coordinates_1 = coordinates; _i < coordinates_1.length; _i++) {\n var ring = coordinates_1[_i];\n if (ring.length < 4) {\n throw new Error(\"Each LinearRing of a Polygon must have 4 or more Positions.\");\n }\n for (var j = 0; j < ring[ring.length - 1].length; j++) {\n // Check if first point of Polygon contains two numbers\n if (ring[ring.length - 1][j] !== ring[0][j]) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n }\n }\n var geom = {\n type: \"Polygon\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Polygon} {@link FeatureCollection} from an Array of Polygon coordinates.\n *\n * @name polygons\n * @param {Array>>>} coordinates an array of Polygon coordinates\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection} Polygon FeatureCollection\n * @example\n * var polygons = turf.polygons([\n * [[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]],\n * [[[-15, 42], [-14, 46], [-12, 41], [-17, 44], [-15, 42]]],\n * ]);\n *\n * //=polygons\n */\nfunction polygons(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return polygon(coords, properties);\n }), options);\n}\n/**\n * Creates a {@link LineString} {@link Feature} from an Array of Positions.\n *\n * @name lineString\n * @param {Array>} coordinates an array of Positions\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} LineString Feature\n * @example\n * var linestring1 = turf.lineString([[-24, 63], [-23, 60], [-25, 65], [-20, 69]], {name: 'line 1'});\n * var linestring2 = turf.lineString([[-14, 43], [-13, 40], [-15, 45], [-10, 49]], {name: 'line 2'});\n *\n * //=linestring1\n * //=linestring2\n */\nfunction lineString(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be an array of two or more positions\");\n }\n var geom = {\n type: \"LineString\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link LineString} {@link FeatureCollection} from an Array of LineString coordinates.\n *\n * @name lineStrings\n * @param {Array>>} coordinates an array of LinearRings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north]\n * associated with the FeatureCollection\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection} LineString FeatureCollection\n * @example\n * var linestrings = turf.lineStrings([\n * [[-24, 63], [-23, 60], [-25, 65], [-20, 69]],\n * [[-14, 43], [-13, 40], [-15, 45], [-10, 49]]\n * ]);\n *\n * //=linestrings\n */\nfunction lineStrings(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return lineString(coords, properties);\n }), options);\n}\n/**\n * Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}.\n *\n * @name featureCollection\n * @param {Feature[]} features input features\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {FeatureCollection} FeatureCollection of Features\n * @example\n * var locationA = turf.point([-75.343, 39.984], {name: 'Location A'});\n * var locationB = turf.point([-75.833, 39.284], {name: 'Location B'});\n * var locationC = turf.point([-75.534, 39.123], {name: 'Location C'});\n *\n * var collection = turf.featureCollection([\n * locationA,\n * locationB,\n * locationC\n * ]);\n *\n * //=collection\n */\nfunction featureCollection(features, options) {\n if (options === void 0) { options = {}; }\n var fc = { type: \"FeatureCollection\" };\n if (options.id) {\n fc.id = options.id;\n }\n if (options.bbox) {\n fc.bbox = options.bbox;\n }\n fc.features = features;\n return fc;\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiLineString\n * @param {Array>>} coordinates an array of LineStrings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a MultiLineString feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiLine = turf.multiLineString([[[0,0],[10,10]]]);\n *\n * //=multiLine\n */\nfunction multiLineString(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiLineString\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiPoint\n * @param {Array>} coordinates an array of Positions\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a MultiPoint feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiPt = turf.multiPoint([[0,0],[10,10]]);\n *\n * //=multiPt\n */\nfunction multiPoint(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiPoint\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiPolygon\n * @param {Array>>>} coordinates an array of Polygons\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a multipolygon feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiPoly = turf.multiPolygon([[[[0,0],[0,10],[10,10],[10,0],[0,0]]]]);\n *\n * //=multiPoly\n *\n */\nfunction multiPolygon(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiPolygon\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name geometryCollection\n * @param {Array} geometries an array of GeoJSON Geometries\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a GeoJSON GeometryCollection Feature\n * @example\n * var pt = turf.geometry(\"Point\", [100, 0]);\n * var line = turf.geometry(\"LineString\", [[101, 0], [102, 1]]);\n * var collection = turf.geometryCollection([pt, line]);\n *\n * // => collection\n */\nfunction geometryCollection(geometries, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"GeometryCollection\",\n geometries: geometries,\n };\n return feature(geom, properties, options);\n}\n/**\n * Round number to precision\n *\n * @param {number} num Number\n * @param {number} [precision=0] Precision\n * @returns {number} rounded number\n * @example\n * turf.round(120.4321)\n * //=120\n *\n * turf.round(120.4321, 2)\n * //=120.43\n */\nfunction round(num, precision) {\n if (precision === void 0) { precision = 0; }\n if (precision && !(precision >= 0)) {\n throw new Error(\"precision must be a positive number\");\n }\n var multiplier = Math.pow(10, precision || 0);\n return Math.round(num * multiplier) / multiplier;\n}\n/**\n * Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name radiansToLength\n * @param {number} radians in radians across the sphere\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} distance\n */\nfunction radiansToLength(radians, units) {\n if (units === void 0) { units = \"kilometers\"; }\n var factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return radians * factor;\n}\n/**\n * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name lengthToRadians\n * @param {number} distance in real units\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} radians\n */\nfunction lengthToRadians(distance, units) {\n if (units === void 0) { units = \"kilometers\"; }\n var factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return distance / factor;\n}\n/**\n * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet\n *\n * @name lengthToDegrees\n * @param {number} distance in real units\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} degrees\n */\nfunction lengthToDegrees(distance, units) {\n return radiansToDegrees(lengthToRadians(distance, units));\n}\n/**\n * Converts any bearing angle from the north line direction (positive clockwise)\n * and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line\n *\n * @name bearingToAzimuth\n * @param {number} bearing angle, between -180 and +180 degrees\n * @returns {number} angle between 0 and 360 degrees\n */\nfunction bearingToAzimuth(bearing) {\n var angle = bearing % 360;\n if (angle < 0) {\n angle += 360;\n }\n return angle;\n}\n/**\n * Converts an angle in radians to degrees\n *\n * @name radiansToDegrees\n * @param {number} radians angle in radians\n * @returns {number} degrees between 0 and 360 degrees\n */\nfunction radiansToDegrees(radians) {\n var degrees = radians % (2 * Math.PI);\n return (degrees * 180) / Math.PI;\n}\n/**\n * Converts an angle in degrees to radians\n *\n * @name degreesToRadians\n * @param {number} degrees angle between 0 and 360 degrees\n * @returns {number} angle in radians\n */\nfunction degreesToRadians(degrees) {\n var radians = degrees % 360;\n return (radians * Math.PI) / 180;\n}\n/**\n * Converts a length to the requested unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @param {number} length to be converted\n * @param {Units} [originalUnit=\"kilometers\"] of the length\n * @param {Units} [finalUnit=\"kilometers\"] returned unit\n * @returns {number} the converted length\n */\nfunction convertLength(length, originalUnit, finalUnit) {\n if (originalUnit === void 0) { originalUnit = \"kilometers\"; }\n if (finalUnit === void 0) { finalUnit = \"kilometers\"; }\n if (!(length >= 0)) {\n throw new Error(\"length must be a positive number\");\n }\n return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);\n}\n/**\n * Converts a area to the requested unit.\n * Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches, hectares\n * @param {number} area to be converted\n * @param {Units} [originalUnit=\"meters\"] of the distance\n * @param {Units} [finalUnit=\"kilometers\"] returned unit\n * @returns {number} the converted area\n */\nfunction convertArea(area, originalUnit, finalUnit) {\n if (originalUnit === void 0) { originalUnit = \"meters\"; }\n if (finalUnit === void 0) { finalUnit = \"kilometers\"; }\n if (!(area >= 0)) {\n throw new Error(\"area must be a positive number\");\n }\n var startFactor = areaFactors[originalUnit];\n if (!startFactor) {\n throw new Error(\"invalid original units\");\n }\n var finalFactor = areaFactors[finalUnit];\n if (!finalFactor) {\n throw new Error(\"invalid final units\");\n }\n return (area / startFactor) * finalFactor;\n}\n/**\n * isNumber\n *\n * @param {*} num Number to validate\n * @returns {boolean} true/false\n * @example\n * turf.isNumber(123)\n * //=true\n * turf.isNumber('foo')\n * //=false\n */\nfunction isNumber(num) {\n return !isNaN(num) && num !== null && !Array.isArray(num);\n}\n/**\n * isObject\n *\n * @param {*} input variable to validate\n * @returns {boolean} true/false\n * @example\n * turf.isObject({elevation: 10})\n * //=true\n * turf.isObject('foo')\n * //=false\n */\nfunction isObject(input) {\n return !!input && input.constructor === Object;\n}\n/**\n * Validate BBox\n *\n * @private\n * @param {Array} bbox BBox to validate\n * @returns {void}\n * @throws Error if BBox is not valid\n * @example\n * validateBBox([-180, -40, 110, 50])\n * //=OK\n * validateBBox([-180, -40])\n * //=Error\n * validateBBox('Foo')\n * //=Error\n * validateBBox(5)\n * //=Error\n * validateBBox(null)\n * //=Error\n * validateBBox(undefined)\n * //=Error\n */\nfunction validateBBox(bbox) {\n if (!bbox) {\n throw new Error(\"bbox is required\");\n }\n if (!Array.isArray(bbox)) {\n throw new Error(\"bbox must be an Array\");\n }\n if (bbox.length !== 4 && bbox.length !== 6) {\n throw new Error(\"bbox must be an Array of 4 or 6 numbers\");\n }\n bbox.forEach(function (num) {\n if (!isNumber(num)) {\n throw new Error(\"bbox must only contain numbers\");\n }\n });\n}\n/**\n * Validate Id\n *\n * @private\n * @param {string|number} id Id to validate\n * @returns {void}\n * @throws Error if Id is not valid\n * @example\n * validateId([-180, -40, 110, 50])\n * //=Error\n * validateId([-180, -40])\n * //=Error\n * validateId('Foo')\n * //=OK\n * validateId(5)\n * //=OK\n * validateId(null)\n * //=Error\n * validateId(undefined)\n * //=Error\n */\nfunction validateId(id) {\n if (!id) {\n throw new Error(\"id is required\");\n }\n if ([\"string\", \"number\"].indexOf(typeof id) === -1) {\n throw new Error(\"id must be a number or a string\");\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/helpers/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/invariant/dist/es/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/@turf/invariant/dist/es/index.js ***! + \*******************************************************/ +/*! exports provided: getCoord, getCoords, containsNumber, geojsonType, featureOf, collectionOf, getGeom, getType */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCoord\", function() { return getCoord; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCoords\", function() { return getCoords; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containsNumber\", function() { return containsNumber; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geojsonType\", function() { return geojsonType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureOf\", function() { return featureOf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"collectionOf\", function() { return collectionOf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getGeom\", function() { return getGeom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getType\", function() { return getType; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n\n/**\n * Unwrap a coordinate from a Point Feature, Geometry or a single coordinate.\n *\n * @name getCoord\n * @param {Array|Geometry|Feature} coord GeoJSON Point or an Array of numbers\n * @returns {Array} coordinates\n * @example\n * var pt = turf.point([10, 10]);\n *\n * var coord = turf.getCoord(pt);\n * //= [10, 10]\n */\nfunction getCoord(coord) {\n if (!coord) {\n throw new Error(\"coord is required\");\n }\n if (!Array.isArray(coord)) {\n if (coord.type === \"Feature\" &&\n coord.geometry !== null &&\n coord.geometry.type === \"Point\") {\n return coord.geometry.coordinates;\n }\n if (coord.type === \"Point\") {\n return coord.coordinates;\n }\n }\n if (Array.isArray(coord) &&\n coord.length >= 2 &&\n !Array.isArray(coord[0]) &&\n !Array.isArray(coord[1])) {\n return coord;\n }\n throw new Error(\"coord must be GeoJSON Point or an Array of numbers\");\n}\n/**\n * Unwrap coordinates from a Feature, Geometry Object or an Array\n *\n * @name getCoords\n * @param {Array|Geometry|Feature} coords Feature, Geometry Object or an Array\n * @returns {Array} coordinates\n * @example\n * var poly = turf.polygon([[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]]);\n *\n * var coords = turf.getCoords(poly);\n * //= [[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]]\n */\nfunction getCoords(coords) {\n if (Array.isArray(coords)) {\n return coords;\n }\n // Feature\n if (coords.type === \"Feature\") {\n if (coords.geometry !== null) {\n return coords.geometry.coordinates;\n }\n }\n else {\n // Geometry\n if (coords.coordinates) {\n return coords.coordinates;\n }\n }\n throw new Error(\"coords must be GeoJSON Feature, Geometry Object or an Array\");\n}\n/**\n * Checks if coordinates contains a number\n *\n * @name containsNumber\n * @param {Array} coordinates GeoJSON Coordinates\n * @returns {boolean} true if Array contains a number\n */\nfunction containsNumber(coordinates) {\n if (coordinates.length > 1 &&\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(coordinates[0]) &&\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(coordinates[1])) {\n return true;\n }\n if (Array.isArray(coordinates[0]) && coordinates[0].length) {\n return containsNumber(coordinates[0]);\n }\n throw new Error(\"coordinates must only contain numbers\");\n}\n/**\n * Enforce expectations about types of GeoJSON objects for Turf.\n *\n * @name geojsonType\n * @param {GeoJSON} value any GeoJSON object\n * @param {string} type expected GeoJSON type\n * @param {string} name name of calling function\n * @throws {Error} if value is not the expected type.\n */\nfunction geojsonType(value, type, name) {\n if (!type || !name) {\n throw new Error(\"type and name required\");\n }\n if (!value || value.type !== type) {\n throw new Error(\"Invalid input to \" +\n name +\n \": must be a \" +\n type +\n \", given \" +\n value.type);\n }\n}\n/**\n * Enforce expectations about types of {@link Feature} inputs for Turf.\n * Internally this uses {@link geojsonType} to judge geometry types.\n *\n * @name featureOf\n * @param {Feature} feature a feature with an expected geometry type\n * @param {string} type expected GeoJSON type\n * @param {string} name name of calling function\n * @throws {Error} error if value is not the expected type.\n */\nfunction featureOf(feature, type, name) {\n if (!feature) {\n throw new Error(\"No feature passed\");\n }\n if (!name) {\n throw new Error(\".featureOf() requires a name\");\n }\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\"Invalid input to \" + name + \", Feature with geometry required\");\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\"Invalid input to \" +\n name +\n \": must be a \" +\n type +\n \", given \" +\n feature.geometry.type);\n }\n}\n/**\n * Enforce expectations about types of {@link FeatureCollection} inputs for Turf.\n * Internally this uses {@link geojsonType} to judge geometry types.\n *\n * @name collectionOf\n * @param {FeatureCollection} featureCollection a FeatureCollection for which features will be judged\n * @param {string} type expected GeoJSON type\n * @param {string} name name of calling function\n * @throws {Error} if value is not the expected type.\n */\nfunction collectionOf(featureCollection, type, name) {\n if (!featureCollection) {\n throw new Error(\"No featureCollection passed\");\n }\n if (!name) {\n throw new Error(\".collectionOf() requires a name\");\n }\n if (!featureCollection || featureCollection.type !== \"FeatureCollection\") {\n throw new Error(\"Invalid input to \" + name + \", FeatureCollection required\");\n }\n for (var _i = 0, _a = featureCollection.features; _i < _a.length; _i++) {\n var feature = _a[_i];\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\"Invalid input to \" + name + \", Feature with geometry required\");\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\"Invalid input to \" +\n name +\n \": must be a \" +\n type +\n \", given \" +\n feature.geometry.type);\n }\n }\n}\n/**\n * Get Geometry from Feature or Geometry Object\n *\n * @param {Feature|Geometry} geojson GeoJSON Feature or Geometry Object\n * @returns {Geometry|null} GeoJSON Geometry Object\n * @throws {Error} if geojson is not a Feature or Geometry Object\n * @example\n * var point = {\n * \"type\": \"Feature\",\n * \"properties\": {},\n * \"geometry\": {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 40]\n * }\n * }\n * var geom = turf.getGeom(point)\n * //={\"type\": \"Point\", \"coordinates\": [110, 40]}\n */\nfunction getGeom(geojson) {\n if (geojson.type === \"Feature\") {\n return geojson.geometry;\n }\n return geojson;\n}\n/**\n * Get GeoJSON object's type, Geometry type is prioritize.\n *\n * @param {GeoJSON} geojson GeoJSON object\n * @param {string} [name=\"geojson\"] name of the variable to display in error message (unused)\n * @returns {string} GeoJSON type\n * @example\n * var point = {\n * \"type\": \"Feature\",\n * \"properties\": {},\n * \"geometry\": {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 40]\n * }\n * }\n * var geom = turf.getType(point)\n * //=\"Point\"\n */\nfunction getType(geojson, _name) {\n if (geojson.type === \"FeatureCollection\") {\n return \"FeatureCollection\";\n }\n if (geojson.type === \"GeometryCollection\") {\n return \"GeometryCollection\";\n }\n if (geojson.type === \"Feature\" && geojson.geometry !== null) {\n return geojson.geometry.type;\n }\n return geojson.type;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/invariant/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/line-intersect/dist/es/index.js": +/*!************************************************************!*\ + !*** ./node_modules/@turf/line-intersect/dist/es/index.js ***! + \************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n/* harmony import */ var _turf_line_segment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/line-segment */ \"./node_modules/@turf/line-segment/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n/* harmony import */ var geojson_rbush__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! geojson-rbush */ \"./node_modules/geojson-rbush/index.js\");\n/* harmony import */ var geojson_rbush__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(geojson_rbush__WEBPACK_IMPORTED_MODULE_4__);\n\n\n\n\n\n/**\n * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).\n *\n * @name lineIntersect\n * @param {GeoJSON} line1 any LineString or Polygon\n * @param {GeoJSON} line2 any LineString or Polygon\n * @returns {FeatureCollection} point(s) that intersect both\n * @example\n * var line1 = turf.lineString([[126, -11], [129, -21]]);\n * var line2 = turf.lineString([[123, -18], [131, -14]]);\n * var intersects = turf.lineIntersect(line1, line2);\n *\n * //addToMap\n * var addToMap = [line1, line2, intersects]\n */\nfunction lineIntersect(line1, line2) {\n var unique = {};\n var results = [];\n // First, normalize geometries to features\n // Then, handle simple 2-vertex segments\n if (line1.type === \"LineString\") {\n line1 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(line1);\n }\n if (line2.type === \"LineString\") {\n line2 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(line2);\n }\n if (line1.type === \"Feature\" &&\n line2.type === \"Feature\" &&\n line1.geometry !== null &&\n line2.geometry !== null &&\n line1.geometry.type === \"LineString\" &&\n line2.geometry.type === \"LineString\" &&\n line1.geometry.coordinates.length === 2 &&\n line2.geometry.coordinates.length === 2) {\n var intersect = intersects(line1, line2);\n if (intersect) {\n results.push(intersect);\n }\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(results);\n }\n // Handles complex GeoJSON Geometries\n var tree = geojson_rbush__WEBPACK_IMPORTED_MODULE_4___default()();\n tree.load(Object(_turf_line_segment__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(line2));\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_3__[\"featureEach\"])(Object(_turf_line_segment__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(line1), function (segment) {\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_3__[\"featureEach\"])(tree.search(segment), function (match) {\n var intersect = intersects(segment, match);\n if (intersect) {\n // prevent duplicate points https://github.com/Turfjs/turf/issues/688\n var key = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(intersect).join(\",\");\n if (!unique[key]) {\n unique[key] = true;\n results.push(intersect);\n }\n }\n });\n });\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(results);\n}\n/**\n * Find a point that intersects LineStrings with two coordinates each\n *\n * @private\n * @param {Feature} line1 GeoJSON LineString (Must only contain 2 coordinates)\n * @param {Feature} line2 GeoJSON LineString (Must only contain 2 coordinates)\n * @returns {Feature} intersecting GeoJSON Point\n */\nfunction intersects(line1, line2) {\n var coords1 = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(line1);\n var coords2 = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(line2);\n if (coords1.length !== 2) {\n throw new Error(\" line1 must only contain 2 coordinates\");\n }\n if (coords2.length !== 2) {\n throw new Error(\" line2 must only contain 2 coordinates\");\n }\n var x1 = coords1[0][0];\n var y1 = coords1[0][1];\n var x2 = coords1[1][0];\n var y2 = coords1[1][1];\n var x3 = coords2[0][0];\n var y3 = coords2[0][1];\n var x4 = coords2[1][0];\n var y4 = coords2[1][1];\n var denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n var numeA = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);\n var numeB = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3);\n if (denom === 0) {\n if (numeA === 0 && numeB === 0) {\n return null;\n }\n return null;\n }\n var uA = numeA / denom;\n var uB = numeB / denom;\n if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) {\n var x = x1 + uA * (x2 - x1);\n var y = y1 + uA * (y2 - y1);\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])([x, y]);\n }\n return null;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (lineIntersect);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/line-intersect/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/line-segment/dist/es/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/@turf/line-segment/dist/es/index.js ***! + \**********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n\n\n\n/**\n * Creates a {@link FeatureCollection} of 2-vertex {@link LineString} segments from a\n * {@link LineString|(Multi)LineString} or {@link Polygon|(Multi)Polygon}.\n *\n * @name lineSegment\n * @param {GeoJSON} geojson GeoJSON Polygon or LineString\n * @returns {FeatureCollection} 2-vertex line segments\n * @example\n * var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]);\n * var segments = turf.lineSegment(polygon);\n *\n * //addToMap\n * var addToMap = [polygon, segments]\n */\nfunction lineSegment(geojson) {\n if (!geojson) {\n throw new Error(\"geojson is required\");\n }\n var results = [];\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_2__[\"flattenEach\"])(geojson, function (feature) {\n lineSegmentFeature(feature, results);\n });\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(results);\n}\n/**\n * Line Segment\n *\n * @private\n * @param {Feature} geojson Line or polygon feature\n * @param {Array} results push to results\n * @returns {void}\n */\nfunction lineSegmentFeature(geojson, results) {\n var coords = [];\n var geometry = geojson.geometry;\n if (geometry !== null) {\n switch (geometry.type) {\n case \"Polygon\":\n coords = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(geometry);\n break;\n case \"LineString\":\n coords = [Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(geometry)];\n }\n coords.forEach(function (coord) {\n var segments = createSegments(coord, geojson.properties);\n segments.forEach(function (segment) {\n segment.id = results.length;\n results.push(segment);\n });\n });\n }\n}\n/**\n * Create Segments from LineString coordinates\n *\n * @private\n * @param {Array>} coords LineString coordinates\n * @param {*} properties GeoJSON properties\n * @returns {Array>} line segments\n */\nfunction createSegments(coords, properties) {\n var segments = [];\n coords.reduce(function (previousCoords, currentCoords) {\n var segment = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])([previousCoords, currentCoords], properties);\n segment.bbox = bbox(previousCoords, currentCoords);\n segments.push(segment);\n return currentCoords;\n });\n return segments;\n}\n/**\n * Create BBox between two coordinates (faster than @turf/bbox)\n *\n * @private\n * @param {Array} coords1 Point coordinate\n * @param {Array} coords2 Point coordinate\n * @returns {BBox} [west, south, east, north]\n */\nfunction bbox(coords1, coords2) {\n var x1 = coords1[0];\n var y1 = coords1[1];\n var x2 = coords2[0];\n var y2 = coords2[1];\n var west = x1 < x2 ? x1 : x2;\n var south = y1 < y2 ? y1 : y2;\n var east = x1 > x2 ? x1 : x2;\n var north = y1 > y2 ? y1 : y2;\n return [west, south, east, north];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (lineSegment);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/line-segment/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/meta/dist/es/index.js": +/*!**************************************************!*\ + !*** ./node_modules/@turf/meta/dist/es/index.js ***! + \**************************************************/ +/*! exports provided: coordEach, coordReduce, propEach, propReduce, featureEach, featureReduce, coordAll, geomEach, geomReduce, flattenEach, flattenReduce, segmentEach, segmentReduce, lineEach, lineReduce, findSegment, findPoint */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordEach\", function() { return coordEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordReduce\", function() { return coordReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"propEach\", function() { return propEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"propReduce\", function() { return propReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureEach\", function() { return featureEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureReduce\", function() { return featureReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordAll\", function() { return coordAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geomEach\", function() { return geomEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geomReduce\", function() { return geomReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flattenEach\", function() { return flattenEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flattenReduce\", function() { return flattenReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentEach\", function() { return segmentEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentReduce\", function() { return segmentReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineEach\", function() { return lineEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineReduce\", function() { return lineReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findSegment\", function() { return findSegment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findPoint\", function() { return findPoint; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n\n\n/**\n * Callback for coordEach\n *\n * @callback coordEachCallback\n * @param {Array} currentCoord The current coordinate being processed.\n * @param {number} coordIndex The current index of the coordinate being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n */\n\n/**\n * Iterate over coordinates in any GeoJSON object, similar to Array.forEach()\n *\n * @name coordEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex)\n * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration.\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {\"foo\": \"bar\"}),\n * turf.point([36, 53], {\"hello\": \"world\"})\n * ]);\n *\n * turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=currentCoord\n * //=coordIndex\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * });\n */\nfunction coordEach(geojson, callback, excludeWrapCoord) {\n // Handles null Geometry -- Skips this GeoJSON\n if (geojson === null) return;\n var j,\n k,\n l,\n geometry,\n stopG,\n coords,\n geometryMaybeCollection,\n wrapShrink = 0,\n coordIndex = 0,\n isGeometryCollection,\n type = geojson.type,\n isFeatureCollection = type === \"FeatureCollection\",\n isFeature = type === \"Feature\",\n stop = isFeatureCollection ? geojson.features.length : 1;\n\n // This logic may look a little weird. The reason why it is that way\n // is because it's trying to be fast. GeoJSON supports multiple kinds\n // of objects at its root: FeatureCollection, Features, Geometries.\n // This function has the responsibility of handling all of them, and that\n // means that some of the `for` loops you see below actually just don't apply\n // to certain inputs. For instance, if you give this just a\n // Point geometry, then both loops are short-circuited and all we do\n // is gradually rename the input until it's called 'geometry'.\n //\n // This also aims to allocate as few resources as possible: just a\n // few numbers and booleans, rather than any temporary arrays as would\n // be required with the normalization approach.\n for (var featureIndex = 0; featureIndex < stop; featureIndex++) {\n geometryMaybeCollection = isFeatureCollection\n ? geojson.features[featureIndex].geometry\n : isFeature\n ? geojson.geometry\n : geojson;\n isGeometryCollection = geometryMaybeCollection\n ? geometryMaybeCollection.type === \"GeometryCollection\"\n : false;\n stopG = isGeometryCollection\n ? geometryMaybeCollection.geometries.length\n : 1;\n\n for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {\n var multiFeatureIndex = 0;\n var geometryIndex = 0;\n geometry = isGeometryCollection\n ? geometryMaybeCollection.geometries[geomIndex]\n : geometryMaybeCollection;\n\n // Handles null Geometry -- Skips this geometry\n if (geometry === null) continue;\n coords = geometry.coordinates;\n var geomType = geometry.type;\n\n wrapShrink =\n excludeWrapCoord &&\n (geomType === \"Polygon\" || geomType === \"MultiPolygon\")\n ? 1\n : 0;\n\n switch (geomType) {\n case null:\n break;\n case \"Point\":\n if (\n callback(\n coords,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n multiFeatureIndex++;\n break;\n case \"LineString\":\n case \"MultiPoint\":\n for (j = 0; j < coords.length; j++) {\n if (\n callback(\n coords[j],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n if (geomType === \"MultiPoint\") multiFeatureIndex++;\n }\n if (geomType === \"LineString\") multiFeatureIndex++;\n break;\n case \"Polygon\":\n case \"MultiLineString\":\n for (j = 0; j < coords.length; j++) {\n for (k = 0; k < coords[j].length - wrapShrink; k++) {\n if (\n callback(\n coords[j][k],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n }\n if (geomType === \"MultiLineString\") multiFeatureIndex++;\n if (geomType === \"Polygon\") geometryIndex++;\n }\n if (geomType === \"Polygon\") multiFeatureIndex++;\n break;\n case \"MultiPolygon\":\n for (j = 0; j < coords.length; j++) {\n geometryIndex = 0;\n for (k = 0; k < coords[j].length; k++) {\n for (l = 0; l < coords[j][k].length - wrapShrink; l++) {\n if (\n callback(\n coords[j][k][l],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n }\n geometryIndex++;\n }\n multiFeatureIndex++;\n }\n break;\n case \"GeometryCollection\":\n for (j = 0; j < geometry.geometries.length; j++)\n if (\n coordEach(geometry.geometries[j], callback, excludeWrapCoord) ===\n false\n )\n return false;\n break;\n default:\n throw new Error(\"Unknown Geometry Type\");\n }\n }\n }\n}\n\n/**\n * Callback for coordReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback coordReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Array} currentCoord The current coordinate being processed.\n * @param {number} coordIndex The current index of the coordinate being processed.\n * Starts at index 0, if an initialValue is provided, and at index 1 otherwise.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n */\n\n/**\n * Reduce coordinates in any GeoJSON object, similar to Array.reduce()\n *\n * @name coordReduce\n * @param {FeatureCollection|Geometry|Feature} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentCoord, coordIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {\"foo\": \"bar\"}),\n * turf.point([36, 53], {\"hello\": \"world\"})\n * ]);\n *\n * turf.coordReduce(features, function (previousValue, currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=previousValue\n * //=currentCoord\n * //=coordIndex\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * return currentCoord;\n * });\n */\nfunction coordReduce(geojson, callback, initialValue, excludeWrapCoord) {\n var previousValue = initialValue;\n coordEach(\n geojson,\n function (\n currentCoord,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) {\n if (coordIndex === 0 && initialValue === undefined)\n previousValue = currentCoord;\n else\n previousValue = callback(\n previousValue,\n currentCoord,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n );\n },\n excludeWrapCoord\n );\n return previousValue;\n}\n\n/**\n * Callback for propEach\n *\n * @callback propEachCallback\n * @param {Object} currentProperties The current Properties being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Iterate over properties in any GeoJSON object, similar to Array.forEach()\n *\n * @name propEach\n * @param {FeatureCollection|Feature} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentProperties, featureIndex)\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.propEach(features, function (currentProperties, featureIndex) {\n * //=currentProperties\n * //=featureIndex\n * });\n */\nfunction propEach(geojson, callback) {\n var i;\n switch (geojson.type) {\n case \"FeatureCollection\":\n for (i = 0; i < geojson.features.length; i++) {\n if (callback(geojson.features[i].properties, i) === false) break;\n }\n break;\n case \"Feature\":\n callback(geojson.properties, 0);\n break;\n }\n}\n\n/**\n * Callback for propReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback propReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {*} currentProperties The current Properties being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Reduce properties in any GeoJSON object into a single value,\n * similar to how Array.reduce works. However, in this case we lazily run\n * the reduction, so an array of all properties is unnecessary.\n *\n * @name propReduce\n * @param {FeatureCollection|Feature} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentProperties, featureIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.propReduce(features, function (previousValue, currentProperties, featureIndex) {\n * //=previousValue\n * //=currentProperties\n * //=featureIndex\n * return currentProperties\n * });\n */\nfunction propReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n propEach(geojson, function (currentProperties, featureIndex) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentProperties;\n else\n previousValue = callback(previousValue, currentProperties, featureIndex);\n });\n return previousValue;\n}\n\n/**\n * Callback for featureEach\n *\n * @callback featureEachCallback\n * @param {Feature} currentFeature The current Feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Iterate over features in any GeoJSON object, similar to\n * Array.forEach.\n *\n * @name featureEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentFeature, featureIndex)\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.featureEach(features, function (currentFeature, featureIndex) {\n * //=currentFeature\n * //=featureIndex\n * });\n */\nfunction featureEach(geojson, callback) {\n if (geojson.type === \"Feature\") {\n callback(geojson, 0);\n } else if (geojson.type === \"FeatureCollection\") {\n for (var i = 0; i < geojson.features.length; i++) {\n if (callback(geojson.features[i], i) === false) break;\n }\n }\n}\n\n/**\n * Callback for featureReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback featureReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentFeature The current Feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Reduce features in any GeoJSON object, similar to Array.reduce().\n *\n * @name featureReduce\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentFeature, featureIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {\"foo\": \"bar\"}),\n * turf.point([36, 53], {\"hello\": \"world\"})\n * ]);\n *\n * turf.featureReduce(features, function (previousValue, currentFeature, featureIndex) {\n * //=previousValue\n * //=currentFeature\n * //=featureIndex\n * return currentFeature\n * });\n */\nfunction featureReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n featureEach(geojson, function (currentFeature, featureIndex) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentFeature;\n else previousValue = callback(previousValue, currentFeature, featureIndex);\n });\n return previousValue;\n}\n\n/**\n * Get all coordinates from any GeoJSON object.\n *\n * @name coordAll\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @returns {Array>} coordinate position array\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * var coords = turf.coordAll(features);\n * //= [[26, 37], [36, 53]]\n */\nfunction coordAll(geojson) {\n var coords = [];\n coordEach(geojson, function (coord) {\n coords.push(coord);\n });\n return coords;\n}\n\n/**\n * Callback for geomEach\n *\n * @callback geomEachCallback\n * @param {Geometry} currentGeometry The current Geometry being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {Object} featureProperties The current Feature Properties being processed.\n * @param {Array} featureBBox The current Feature BBox being processed.\n * @param {number|string} featureId The current Feature Id being processed.\n */\n\n/**\n * Iterate over each geometry in any GeoJSON object, similar to Array.forEach()\n *\n * @name geomEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentGeometry, featureIndex, featureProperties, featureBBox, featureId)\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.geomEach(features, function (currentGeometry, featureIndex, featureProperties, featureBBox, featureId) {\n * //=currentGeometry\n * //=featureIndex\n * //=featureProperties\n * //=featureBBox\n * //=featureId\n * });\n */\nfunction geomEach(geojson, callback) {\n var i,\n j,\n g,\n geometry,\n stopG,\n geometryMaybeCollection,\n isGeometryCollection,\n featureProperties,\n featureBBox,\n featureId,\n featureIndex = 0,\n isFeatureCollection = geojson.type === \"FeatureCollection\",\n isFeature = geojson.type === \"Feature\",\n stop = isFeatureCollection ? geojson.features.length : 1;\n\n // This logic may look a little weird. The reason why it is that way\n // is because it's trying to be fast. GeoJSON supports multiple kinds\n // of objects at its root: FeatureCollection, Features, Geometries.\n // This function has the responsibility of handling all of them, and that\n // means that some of the `for` loops you see below actually just don't apply\n // to certain inputs. For instance, if you give this just a\n // Point geometry, then both loops are short-circuited and all we do\n // is gradually rename the input until it's called 'geometry'.\n //\n // This also aims to allocate as few resources as possible: just a\n // few numbers and booleans, rather than any temporary arrays as would\n // be required with the normalization approach.\n for (i = 0; i < stop; i++) {\n geometryMaybeCollection = isFeatureCollection\n ? geojson.features[i].geometry\n : isFeature\n ? geojson.geometry\n : geojson;\n featureProperties = isFeatureCollection\n ? geojson.features[i].properties\n : isFeature\n ? geojson.properties\n : {};\n featureBBox = isFeatureCollection\n ? geojson.features[i].bbox\n : isFeature\n ? geojson.bbox\n : undefined;\n featureId = isFeatureCollection\n ? geojson.features[i].id\n : isFeature\n ? geojson.id\n : undefined;\n isGeometryCollection = geometryMaybeCollection\n ? geometryMaybeCollection.type === \"GeometryCollection\"\n : false;\n stopG = isGeometryCollection\n ? geometryMaybeCollection.geometries.length\n : 1;\n\n for (g = 0; g < stopG; g++) {\n geometry = isGeometryCollection\n ? geometryMaybeCollection.geometries[g]\n : geometryMaybeCollection;\n\n // Handle null Geometry\n if (geometry === null) {\n if (\n callback(\n null,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false\n )\n return false;\n continue;\n }\n switch (geometry.type) {\n case \"Point\":\n case \"LineString\":\n case \"MultiPoint\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\": {\n if (\n callback(\n geometry,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false\n )\n return false;\n break;\n }\n case \"GeometryCollection\": {\n for (j = 0; j < geometry.geometries.length; j++) {\n if (\n callback(\n geometry.geometries[j],\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false\n )\n return false;\n }\n break;\n }\n default:\n throw new Error(\"Unknown Geometry Type\");\n }\n }\n // Only increase `featureIndex` per each feature\n featureIndex++;\n }\n}\n\n/**\n * Callback for geomReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback geomReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Geometry} currentGeometry The current Geometry being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {Object} featureProperties The current Feature Properties being processed.\n * @param {Array} featureBBox The current Feature BBox being processed.\n * @param {number|string} featureId The current Feature Id being processed.\n */\n\n/**\n * Reduce geometry in any GeoJSON object, similar to Array.reduce().\n *\n * @name geomReduce\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentGeometry, featureIndex, featureProperties, featureBBox, featureId)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.geomReduce(features, function (previousValue, currentGeometry, featureIndex, featureProperties, featureBBox, featureId) {\n * //=previousValue\n * //=currentGeometry\n * //=featureIndex\n * //=featureProperties\n * //=featureBBox\n * //=featureId\n * return currentGeometry\n * });\n */\nfunction geomReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n geomEach(\n geojson,\n function (\n currentGeometry,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentGeometry;\n else\n previousValue = callback(\n previousValue,\n currentGeometry,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Callback for flattenEach\n *\n * @callback flattenEachCallback\n * @param {Feature} currentFeature The current flattened feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n */\n\n/**\n * Iterate over flattened features in any GeoJSON object, similar to\n * Array.forEach.\n *\n * @name flattenEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentFeature, featureIndex, multiFeatureIndex)\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.multiPoint([[40, 30], [36, 53]], {hello: 'world'})\n * ]);\n *\n * turf.flattenEach(features, function (currentFeature, featureIndex, multiFeatureIndex) {\n * //=currentFeature\n * //=featureIndex\n * //=multiFeatureIndex\n * });\n */\nfunction flattenEach(geojson, callback) {\n geomEach(geojson, function (geometry, featureIndex, properties, bbox, id) {\n // Callback for single geometry\n var type = geometry === null ? null : geometry.type;\n switch (type) {\n case null:\n case \"Point\":\n case \"LineString\":\n case \"Polygon\":\n if (\n callback(\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(geometry, properties, { bbox: bbox, id: id }),\n featureIndex,\n 0\n ) === false\n )\n return false;\n return;\n }\n\n var geomType;\n\n // Callback for multi-geometry\n switch (type) {\n case \"MultiPoint\":\n geomType = \"Point\";\n break;\n case \"MultiLineString\":\n geomType = \"LineString\";\n break;\n case \"MultiPolygon\":\n geomType = \"Polygon\";\n break;\n }\n\n for (\n var multiFeatureIndex = 0;\n multiFeatureIndex < geometry.coordinates.length;\n multiFeatureIndex++\n ) {\n var coordinate = geometry.coordinates[multiFeatureIndex];\n var geom = {\n type: geomType,\n coordinates: coordinate,\n };\n if (\n callback(Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(geom, properties), featureIndex, multiFeatureIndex) ===\n false\n )\n return false;\n }\n });\n}\n\n/**\n * Callback for flattenReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback flattenReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentFeature The current Feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n */\n\n/**\n * Reduce flattened features in any GeoJSON object, similar to Array.reduce().\n *\n * @name flattenReduce\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentFeature, featureIndex, multiFeatureIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.multiPoint([[40, 30], [36, 53]], {hello: 'world'})\n * ]);\n *\n * turf.flattenReduce(features, function (previousValue, currentFeature, featureIndex, multiFeatureIndex) {\n * //=previousValue\n * //=currentFeature\n * //=featureIndex\n * //=multiFeatureIndex\n * return currentFeature\n * });\n */\nfunction flattenReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n flattenEach(\n geojson,\n function (currentFeature, featureIndex, multiFeatureIndex) {\n if (\n featureIndex === 0 &&\n multiFeatureIndex === 0 &&\n initialValue === undefined\n )\n previousValue = currentFeature;\n else\n previousValue = callback(\n previousValue,\n currentFeature,\n featureIndex,\n multiFeatureIndex\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Callback for segmentEach\n *\n * @callback segmentEachCallback\n * @param {Feature} currentSegment The current Segment being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n * @param {number} segmentIndex The current index of the Segment being processed.\n * @returns {void}\n */\n\n/**\n * Iterate over 2-vertex line segment in any GeoJSON object, similar to Array.forEach()\n * (Multi)Point geometries do not contain segments therefore they are ignored during this operation.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON\n * @param {Function} callback a method that takes (currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex)\n * @returns {void}\n * @example\n * var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]);\n *\n * // Iterate over GeoJSON by 2-vertex segments\n * turf.segmentEach(polygon, function (currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {\n * //=currentSegment\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * //=segmentIndex\n * });\n *\n * // Calculate the total number of segments\n * var total = 0;\n * turf.segmentEach(polygon, function () {\n * total++;\n * });\n */\nfunction segmentEach(geojson, callback) {\n flattenEach(geojson, function (feature$$1, featureIndex, multiFeatureIndex) {\n var segmentIndex = 0;\n\n // Exclude null Geometries\n if (!feature$$1.geometry) return;\n // (Multi)Point geometries do not contain segments therefore they are ignored during this operation.\n var type = feature$$1.geometry.type;\n if (type === \"Point\" || type === \"MultiPoint\") return;\n\n // Generate 2-vertex line segments\n var previousCoords;\n var previousFeatureIndex = 0;\n var previousMultiIndex = 0;\n var prevGeomIndex = 0;\n if (\n coordEach(\n feature$$1,\n function (\n currentCoord,\n coordIndex,\n featureIndexCoord,\n multiPartIndexCoord,\n geometryIndex\n ) {\n // Simulating a meta.coordReduce() since `reduce` operations cannot be stopped by returning `false`\n if (\n previousCoords === undefined ||\n featureIndex > previousFeatureIndex ||\n multiPartIndexCoord > previousMultiIndex ||\n geometryIndex > prevGeomIndex\n ) {\n previousCoords = currentCoord;\n previousFeatureIndex = featureIndex;\n previousMultiIndex = multiPartIndexCoord;\n prevGeomIndex = geometryIndex;\n segmentIndex = 0;\n return;\n }\n var currentSegment = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [previousCoords, currentCoord],\n feature$$1.properties\n );\n if (\n callback(\n currentSegment,\n featureIndex,\n multiFeatureIndex,\n geometryIndex,\n segmentIndex\n ) === false\n )\n return false;\n segmentIndex++;\n previousCoords = currentCoord;\n }\n ) === false\n )\n return false;\n });\n}\n\n/**\n * Callback for segmentReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback segmentReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentSegment The current Segment being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n * @param {number} segmentIndex The current index of the Segment being processed.\n */\n\n/**\n * Reduce 2-vertex line segment in any GeoJSON object, similar to Array.reduce()\n * (Multi)Point geometries do not contain segments therefore they are ignored during this operation.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON\n * @param {Function} callback a method that takes (previousValue, currentSegment, currentIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {void}\n * @example\n * var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]);\n *\n * // Iterate over GeoJSON by 2-vertex segments\n * turf.segmentReduce(polygon, function (previousSegment, currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {\n * //= previousSegment\n * //= currentSegment\n * //= featureIndex\n * //= multiFeatureIndex\n * //= geometryIndex\n * //= segmentIndex\n * return currentSegment\n * });\n *\n * // Calculate the total number of segments\n * var initialValue = 0\n * var total = turf.segmentReduce(polygon, function (previousValue) {\n * previousValue++;\n * return previousValue;\n * }, initialValue);\n */\nfunction segmentReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n var started = false;\n segmentEach(\n geojson,\n function (\n currentSegment,\n featureIndex,\n multiFeatureIndex,\n geometryIndex,\n segmentIndex\n ) {\n if (started === false && initialValue === undefined)\n previousValue = currentSegment;\n else\n previousValue = callback(\n previousValue,\n currentSegment,\n featureIndex,\n multiFeatureIndex,\n geometryIndex,\n segmentIndex\n );\n started = true;\n }\n );\n return previousValue;\n}\n\n/**\n * Callback for lineEach\n *\n * @callback lineEachCallback\n * @param {Feature} currentLine The current LineString|LinearRing being processed\n * @param {number} featureIndex The current index of the Feature being processed\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed\n * @param {number} geometryIndex The current index of the Geometry being processed\n */\n\n/**\n * Iterate over line or ring coordinates in LineString, Polygon, MultiLineString, MultiPolygon Features or Geometries,\n * similar to Array.forEach.\n *\n * @name lineEach\n * @param {Geometry|Feature} geojson object\n * @param {Function} callback a method that takes (currentLine, featureIndex, multiFeatureIndex, geometryIndex)\n * @example\n * var multiLine = turf.multiLineString([\n * [[26, 37], [35, 45]],\n * [[36, 53], [38, 50], [41, 55]]\n * ]);\n *\n * turf.lineEach(multiLine, function (currentLine, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=currentLine\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * });\n */\nfunction lineEach(geojson, callback) {\n // validation\n if (!geojson) throw new Error(\"geojson is required\");\n\n flattenEach(geojson, function (feature$$1, featureIndex, multiFeatureIndex) {\n if (feature$$1.geometry === null) return;\n var type = feature$$1.geometry.type;\n var coords = feature$$1.geometry.coordinates;\n switch (type) {\n case \"LineString\":\n if (callback(feature$$1, featureIndex, multiFeatureIndex, 0, 0) === false)\n return false;\n break;\n case \"Polygon\":\n for (\n var geometryIndex = 0;\n geometryIndex < coords.length;\n geometryIndex++\n ) {\n if (\n callback(\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(coords[geometryIndex], feature$$1.properties),\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n }\n break;\n }\n });\n}\n\n/**\n * Callback for lineReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback lineReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentLine The current LineString|LinearRing being processed.\n * @param {number} featureIndex The current index of the Feature being processed\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed\n * @param {number} geometryIndex The current index of the Geometry being processed\n */\n\n/**\n * Reduce features in any GeoJSON object, similar to Array.reduce().\n *\n * @name lineReduce\n * @param {Geometry|Feature} geojson object\n * @param {Function} callback a method that takes (previousValue, currentLine, featureIndex, multiFeatureIndex, geometryIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var multiPoly = turf.multiPolygon([\n * turf.polygon([[[12,48],[2,41],[24,38],[12,48]], [[9,44],[13,41],[13,45],[9,44]]]),\n * turf.polygon([[[5, 5], [0, 0], [2, 2], [4, 4], [5, 5]]])\n * ]);\n *\n * turf.lineReduce(multiPoly, function (previousValue, currentLine, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=previousValue\n * //=currentLine\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * return currentLine\n * });\n */\nfunction lineReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n lineEach(\n geojson,\n function (currentLine, featureIndex, multiFeatureIndex, geometryIndex) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentLine;\n else\n previousValue = callback(\n previousValue,\n currentLine,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Finds a particular 2-vertex LineString Segment from a GeoJSON using `@turf/meta` indexes.\n *\n * Negative indexes are permitted.\n * Point & MultiPoint will always return null.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson Any GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.featureIndex=0] Feature Index\n * @param {number} [options.multiFeatureIndex=0] Multi-Feature Index\n * @param {number} [options.geometryIndex=0] Geometry Index\n * @param {number} [options.segmentIndex=0] Segment Index\n * @param {Object} [options.properties={}] Translate Properties to output LineString\n * @param {BBox} [options.bbox={}] Translate BBox to output LineString\n * @param {number|string} [options.id={}] Translate Id to output LineString\n * @returns {Feature} 2-vertex GeoJSON Feature LineString\n * @example\n * var multiLine = turf.multiLineString([\n * [[10, 10], [50, 30], [30, 40]],\n * [[-10, -10], [-50, -30], [-30, -40]]\n * ]);\n *\n * // First Segment (defaults are 0)\n * turf.findSegment(multiLine);\n * // => Feature>\n *\n * // First Segment of 2nd Multi Feature\n * turf.findSegment(multiLine, {multiFeatureIndex: 1});\n * // => Feature>\n *\n * // Last Segment of Last Multi Feature\n * turf.findSegment(multiLine, {multiFeatureIndex: -1, segmentIndex: -1});\n * // => Feature>\n */\nfunction findSegment(geojson, options) {\n // Optional Parameters\n options = options || {};\n if (!Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(options)) throw new Error(\"options is invalid\");\n var featureIndex = options.featureIndex || 0;\n var multiFeatureIndex = options.multiFeatureIndex || 0;\n var geometryIndex = options.geometryIndex || 0;\n var segmentIndex = options.segmentIndex || 0;\n\n // Find FeatureIndex\n var properties = options.properties;\n var geometry;\n\n switch (geojson.type) {\n case \"FeatureCollection\":\n if (featureIndex < 0)\n featureIndex = geojson.features.length + featureIndex;\n properties = properties || geojson.features[featureIndex].properties;\n geometry = geojson.features[featureIndex].geometry;\n break;\n case \"Feature\":\n properties = properties || geojson.properties;\n geometry = geojson.geometry;\n break;\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n geometry = geojson;\n break;\n default:\n throw new Error(\"geojson is invalid\");\n }\n\n // Find SegmentIndex\n if (geometry === null) return null;\n var coords = geometry.coordinates;\n switch (geometry.type) {\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n if (segmentIndex < 0) segmentIndex = coords.length + segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [coords[segmentIndex], coords[segmentIndex + 1]],\n properties,\n options\n );\n case \"Polygon\":\n if (geometryIndex < 0) geometryIndex = coords.length + geometryIndex;\n if (segmentIndex < 0)\n segmentIndex = coords[geometryIndex].length + segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [\n coords[geometryIndex][segmentIndex],\n coords[geometryIndex][segmentIndex + 1],\n ],\n properties,\n options\n );\n case \"MultiLineString\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (segmentIndex < 0)\n segmentIndex = coords[multiFeatureIndex].length + segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [\n coords[multiFeatureIndex][segmentIndex],\n coords[multiFeatureIndex][segmentIndex + 1],\n ],\n properties,\n options\n );\n case \"MultiPolygon\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (geometryIndex < 0)\n geometryIndex = coords[multiFeatureIndex].length + geometryIndex;\n if (segmentIndex < 0)\n segmentIndex =\n coords[multiFeatureIndex][geometryIndex].length - segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [\n coords[multiFeatureIndex][geometryIndex][segmentIndex],\n coords[multiFeatureIndex][geometryIndex][segmentIndex + 1],\n ],\n properties,\n options\n );\n }\n throw new Error(\"geojson is invalid\");\n}\n\n/**\n * Finds a particular Point from a GeoJSON using `@turf/meta` indexes.\n *\n * Negative indexes are permitted.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson Any GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.featureIndex=0] Feature Index\n * @param {number} [options.multiFeatureIndex=0] Multi-Feature Index\n * @param {number} [options.geometryIndex=0] Geometry Index\n * @param {number} [options.coordIndex=0] Coord Index\n * @param {Object} [options.properties={}] Translate Properties to output Point\n * @param {BBox} [options.bbox={}] Translate BBox to output Point\n * @param {number|string} [options.id={}] Translate Id to output Point\n * @returns {Feature} 2-vertex GeoJSON Feature Point\n * @example\n * var multiLine = turf.multiLineString([\n * [[10, 10], [50, 30], [30, 40]],\n * [[-10, -10], [-50, -30], [-30, -40]]\n * ]);\n *\n * // First Segment (defaults are 0)\n * turf.findPoint(multiLine);\n * // => Feature>\n *\n * // First Segment of the 2nd Multi-Feature\n * turf.findPoint(multiLine, {multiFeatureIndex: 1});\n * // => Feature>\n *\n * // Last Segment of last Multi-Feature\n * turf.findPoint(multiLine, {multiFeatureIndex: -1, coordIndex: -1});\n * // => Feature>\n */\nfunction findPoint(geojson, options) {\n // Optional Parameters\n options = options || {};\n if (!Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(options)) throw new Error(\"options is invalid\");\n var featureIndex = options.featureIndex || 0;\n var multiFeatureIndex = options.multiFeatureIndex || 0;\n var geometryIndex = options.geometryIndex || 0;\n var coordIndex = options.coordIndex || 0;\n\n // Find FeatureIndex\n var properties = options.properties;\n var geometry;\n\n switch (geojson.type) {\n case \"FeatureCollection\":\n if (featureIndex < 0)\n featureIndex = geojson.features.length + featureIndex;\n properties = properties || geojson.features[featureIndex].properties;\n geometry = geojson.features[featureIndex].geometry;\n break;\n case \"Feature\":\n properties = properties || geojson.properties;\n geometry = geojson.geometry;\n break;\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n geometry = geojson;\n break;\n default:\n throw new Error(\"geojson is invalid\");\n }\n\n // Find Coord Index\n if (geometry === null) return null;\n var coords = geometry.coordinates;\n switch (geometry.type) {\n case \"Point\":\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords, properties, options);\n case \"MultiPoint\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[multiFeatureIndex], properties, options);\n case \"LineString\":\n if (coordIndex < 0) coordIndex = coords.length + coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[coordIndex], properties, options);\n case \"Polygon\":\n if (geometryIndex < 0) geometryIndex = coords.length + geometryIndex;\n if (coordIndex < 0)\n coordIndex = coords[geometryIndex].length + coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[geometryIndex][coordIndex], properties, options);\n case \"MultiLineString\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (coordIndex < 0)\n coordIndex = coords[multiFeatureIndex].length + coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[multiFeatureIndex][coordIndex], properties, options);\n case \"MultiPolygon\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (geometryIndex < 0)\n geometryIndex = coords[multiFeatureIndex].length + geometryIndex;\n if (coordIndex < 0)\n coordIndex =\n coords[multiFeatureIndex][geometryIndex].length - coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(\n coords[multiFeatureIndex][geometryIndex][coordIndex],\n properties,\n options\n );\n }\n throw new Error(\"geojson is invalid\");\n}\n\n\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/meta/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/polygon-to-line/dist/es/index.js": +/*!*************************************************************!*\ + !*** ./node_modules/@turf/polygon-to-line/dist/es/index.js ***! + \*************************************************************/ +/*! exports provided: default, polygonToLine, multiPolygonToLine, coordsToLine */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polygonToLine\", function() { return polygonToLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiPolygonToLine\", function() { return multiPolygonToLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordsToLine\", function() { return coordsToLine; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n\n\n/**\n * Converts a {@link Polygon} to {@link LineString|(Multi)LineString} or {@link MultiPolygon} to a\n * {@link FeatureCollection} of {@link LineString|(Multi)LineString}.\n *\n * @name polygonToLine\n * @param {Feature} poly Feature to convert\n * @param {Object} [options={}] Optional parameters\n * @param {Object} [options.properties={}] translates GeoJSON properties to Feature\n * @returns {FeatureCollection|Feature} converted (Multi)Polygon to (Multi)LineString\n * @example\n * var poly = turf.polygon([[[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]]);\n *\n * var line = turf.polygonToLine(poly);\n *\n * //addToMap\n * var addToMap = [line];\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (poly, options) {\n if (options === void 0) { options = {}; }\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getGeom\"])(poly);\n if (!options.properties && poly.type === \"Feature\") {\n options.properties = poly.properties;\n }\n switch (geom.type) {\n case \"Polygon\":\n return polygonToLine(geom, options);\n case \"MultiPolygon\":\n return multiPolygonToLine(geom, options);\n default:\n throw new Error(\"invalid poly\");\n }\n});\n/**\n * @private\n */\nfunction polygonToLine(poly, options) {\n if (options === void 0) { options = {}; }\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getGeom\"])(poly);\n var coords = geom.coordinates;\n var properties = options.properties\n ? options.properties\n : poly.type === \"Feature\"\n ? poly.properties\n : {};\n return coordsToLine(coords, properties);\n}\n/**\n * @private\n */\nfunction multiPolygonToLine(multiPoly, options) {\n if (options === void 0) { options = {}; }\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getGeom\"])(multiPoly);\n var coords = geom.coordinates;\n var properties = options.properties\n ? options.properties\n : multiPoly.type === \"Feature\"\n ? multiPoly.properties\n : {};\n var lines = [];\n coords.forEach(function (coord) {\n lines.push(coordsToLine(coord, properties));\n });\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(lines);\n}\n/**\n * @private\n */\nfunction coordsToLine(coords, properties) {\n if (coords.length > 1) {\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"multiLineString\"])(coords, properties);\n }\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(coords[0], properties);\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/polygon-to-line/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/sass-loader/dist/cjs.js!./src/secondary/loadingScreen.scss": +/*!***************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/sass-loader/dist/cjs.js!./src/secondary/loadingScreen.scss ***! + \***************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);\n// Imports\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});\n// Module\n___CSS_LOADER_EXPORT___.push([module.i, \"._lithosphere_loadingscreen_loading {\\n position: absolute;\\n width: 100%;\\n height: 100%;\\n perspective: 160px;\\n top: 0;\\n left: 0; }\\n\\n._lithosphere_loadingscreen_loading > div {\\n width: 60px;\\n height: 60px;\\n background: rgba(255, 255, 255, 0);\\n position: absolute;\\n left: 50%;\\n margin-left: -30px;\\n top: 50%;\\n margin-top: -5px;\\n border-radius: 2px;\\n border: 2px solid rgba(255, 255, 255, 0.7); }\\n\\n@-webkit-keyframes translateIn {\\n 30% {\\n transform: rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);\\n opacity: 0.7;\\n background: rgba(255, 255, 255, 0.3); }\\n 100% {\\n transform: rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);\\n opacity: 0;\\n background: rgba(255, 255, 255, 0); } }\\n\\n@keyframes translateIn {\\n 30% {\\n transform: rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);\\n opacity: 0.7;\\n background: rgba(255, 255, 255, 0.3); }\\n 100% {\\n transform: rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);\\n opacity: 0;\\n background: rgba(255, 255, 255, 0); } }\\n\\n._lithosphere_loadingscreen_loading > div {\\n opacity: 0; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(1) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(30px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 500ms;\\n animation: translateIn 1.9s ease-in infinite 500ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(2) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(60px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 700ms;\\n animation: translateIn 1.9s ease-in infinite 700ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(3) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(85px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 800ms;\\n animation: translateIn 1.9s ease-in infinite 800ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(4) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(105px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 1000ms;\\n animation: translateIn 1.9s ease-in infinite 1000ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(5) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(120px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 1200ms;\\n animation: translateIn 1.9s ease-in infinite 1200ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(6) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(130px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 1400ms;\\n animation: translateIn 1.9s ease-in infinite 1400ms; }\\n\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/loadingScreen.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/sass-loader/dist/cjs.js"); + +/***/ }), + +/***/ "./node_modules/css-loader/dist/runtime/api.js": +/*!*****************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/api.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\n//# sourceURL=webpack://LithoSphere/./node_modules/css-loader/dist/runtime/api.js?"); + +/***/ }), + +/***/ "./node_modules/geojson-rbush/index.js": +/*!*********************************************!*\ + !*** ./node_modules/geojson-rbush/index.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var rbush = __webpack_require__(/*! rbush */ \"./node_modules/rbush/index.js\");\nvar helpers = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\nvar meta = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\nvar turfBBox = __webpack_require__(/*! @turf/bbox */ \"./node_modules/@turf/bbox/dist/es/index.js\").default;\nvar featureEach = meta.featureEach;\nvar coordEach = meta.coordEach;\nvar polygon = helpers.polygon;\nvar featureCollection = helpers.featureCollection;\n\n/**\n * GeoJSON implementation of [RBush](https://github.com/mourner/rbush#rbush) spatial index.\n *\n * @name rbush\n * @param {number} [maxEntries=9] defines the maximum number of entries in a tree node. 9 (used by default) is a\n * reasonable choice for most applications. Higher value means faster insertion and slower search, and vice versa.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var geojsonRbush = require('geojson-rbush').default;\n * var tree = geojsonRbush();\n */\nfunction geojsonRbush(maxEntries) {\n var tree = rbush(maxEntries);\n /**\n * [insert](https://github.com/mourner/rbush#data-format)\n *\n * @param {Feature} feature insert single GeoJSON Feature\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n * tree.insert(poly)\n */\n tree.insert = function (feature) {\n if (feature.type !== 'Feature') throw new Error('invalid feature');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.insert.call(this, feature);\n };\n\n /**\n * [load](https://github.com/mourner/rbush#bulk-inserting-data)\n *\n * @param {FeatureCollection|Array} features load entire GeoJSON FeatureCollection\n * @returns {RBush} GeoJSON RBush\n * @example\n * var polys = turf.polygons([\n * [[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]],\n * [[[-93, 32], [-83, 32], [-83, 39], [-93, 39], [-93, 32]]]\n * ]);\n * tree.load(polys);\n */\n tree.load = function (features) {\n var load = [];\n // Load an Array of Features\n if (Array.isArray(features)) {\n features.forEach(function (feature) {\n if (feature.type !== 'Feature') throw new Error('invalid features');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n } else {\n // Load a FeatureCollection\n featureEach(features, function (feature) {\n if (feature.type !== 'Feature') throw new Error('invalid features');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n }\n return rbush.prototype.load.call(this, load);\n };\n\n /**\n * [remove](https://github.com/mourner/rbush#removing-data)\n *\n * @param {Feature} feature remove single GeoJSON Feature\n * @param {Function} equals Pass a custom equals function to compare by value for removal.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.remove(poly);\n */\n tree.remove = function (feature, equals) {\n if (feature.type !== 'Feature') throw new Error('invalid feature');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.remove.call(this, feature, equals);\n };\n\n /**\n * [clear](https://github.com/mourner/rbush#removing-data)\n *\n * @returns {RBush} GeoJSON Rbush\n * @example\n * tree.clear()\n */\n tree.clear = function () {\n return rbush.prototype.clear.call(this);\n };\n\n /**\n * [search](https://github.com/mourner/rbush#search)\n *\n * @param {BBox|FeatureCollection|Feature} geojson search with GeoJSON\n * @returns {FeatureCollection} all features that intersects with the given GeoJSON.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.search(poly);\n */\n tree.search = function (geojson) {\n var features = rbush.prototype.search.call(this, this.toBBox(geojson));\n return featureCollection(features);\n };\n\n /**\n * [collides](https://github.com/mourner/rbush#collisions)\n *\n * @param {BBox|FeatureCollection|Feature} geojson collides with GeoJSON\n * @returns {boolean} true if there are any items intersecting the given GeoJSON, otherwise false.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.collides(poly);\n */\n tree.collides = function (geojson) {\n return rbush.prototype.collides.call(this, this.toBBox(geojson));\n };\n\n /**\n * [all](https://github.com/mourner/rbush#search)\n *\n * @returns {FeatureCollection} all the features in RBush\n * @example\n * tree.all()\n */\n tree.all = function () {\n var features = rbush.prototype.all.call(this);\n return featureCollection(features);\n };\n\n /**\n * [toJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @returns {any} export data as JSON object\n * @example\n * var exported = tree.toJSON()\n */\n tree.toJSON = function () {\n return rbush.prototype.toJSON.call(this);\n };\n\n /**\n * [fromJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @param {any} json import previously exported data\n * @returns {RBush} GeoJSON RBush\n * @example\n * var exported = {\n * \"children\": [\n * {\n * \"type\": \"Feature\",\n * \"geometry\": {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 50]\n * },\n * \"properties\": {},\n * \"bbox\": [110, 50, 110, 50]\n * }\n * ],\n * \"height\": 1,\n * \"leaf\": true,\n * \"minX\": 110,\n * \"minY\": 50,\n * \"maxX\": 110,\n * \"maxY\": 50\n * }\n * tree.fromJSON(exported)\n */\n tree.fromJSON = function (json) {\n return rbush.prototype.fromJSON.call(this, json);\n };\n\n /**\n * Converts GeoJSON to {minX, minY, maxX, maxY} schema\n *\n * @private\n * @param {BBox|FeatureCollection|Feature} geojson feature(s) to retrieve BBox from\n * @returns {Object} converted to {minX, minY, maxX, maxY}\n */\n tree.toBBox = function (geojson) {\n var bbox;\n if (geojson.bbox) bbox = geojson.bbox;\n else if (Array.isArray(geojson) && geojson.length === 4) bbox = geojson;\n else if (Array.isArray(geojson) && geojson.length === 6) bbox = [geojson[0], geojson[1], geojson[3], geojson[4]];\n else if (geojson.type === 'Feature') bbox = turfBBox(geojson);\n else if (geojson.type === 'FeatureCollection') bbox = turfBBox(geojson);\n else throw new Error('invalid geojson')\n\n return {\n minX: bbox[0],\n minY: bbox[1],\n maxX: bbox[2],\n maxY: bbox[3]\n };\n };\n return tree;\n}\n\nmodule.exports = geojsonRbush;\nmodule.exports.default = geojsonRbush;\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/geojson-rbush/index.js?"); + +/***/ }), + +/***/ "./node_modules/mgrs/mgrs.js": +/*!***********************************!*\ + !*** ./node_modules/mgrs/mgrs.js ***! + \***********************************/ +/*! exports provided: default, forward, inverse, toPoint */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toPoint\", function() { return toPoint; });\n\n\n\n/**\n * UTM zones are grouped, and assigned to one of a group of 6\n * sets.\n *\n * {int} @private\n */\nvar NUM_100K_SETS = 6;\n\n/**\n * The column letters (for easting) of the lower left value, per\n * set.\n *\n * {string} @private\n */\nvar SET_ORIGIN_COLUMN_LETTERS = 'AJSAJS';\n\n/**\n * The row letters (for northing) of the lower left value, per\n * set.\n *\n * {string} @private\n */\nvar SET_ORIGIN_ROW_LETTERS = 'AFAFAF';\n\nvar A = 65; // A\nvar I = 73; // I\nvar O = 79; // O\nvar V = 86; // V\nvar Z = 90; // Z\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n forward: forward,\n inverse: inverse,\n toPoint: toPoint\n});\n/**\n * Conversion of lat/lon to MGRS.\n *\n * @param {object} ll Object literal with lat and lon properties on a\n * WGS84 ellipsoid.\n * @param {int} accuracy Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for\n * 100 m, 2 for 1000 m or 1 for 10000 m). Optional, default is 5.\n * @return {string} the MGRS string for the given location and accuracy.\n */\nfunction forward(ll, accuracy) {\n accuracy = accuracy || 5; // default accuracy 1m\n return encode(LLtoUTM({\n lat: ll[1],\n lon: ll[0]\n }), accuracy);\n};\n\n/**\n * Conversion of MGRS to lat/lon.\n *\n * @param {string} mgrs MGRS string.\n * @return {array} An array with left (longitude), bottom (latitude), right\n * (longitude) and top (latitude) values in WGS84, representing the\n * bounding box for the provided MGRS reference.\n */\nfunction inverse(mgrs) {\n var bbox = UTMtoLL(decode(mgrs.toUpperCase()));\n if (bbox.lat && bbox.lon) {\n return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];\n }\n return [bbox.left, bbox.bottom, bbox.right, bbox.top];\n};\n\nfunction toPoint(mgrs) {\n var bbox = UTMtoLL(decode(mgrs.toUpperCase()));\n if (bbox.lat && bbox.lon) {\n return [bbox.lon, bbox.lat];\n }\n return [(bbox.left + bbox.right) / 2, (bbox.top + bbox.bottom) / 2];\n};\n/**\n * Conversion from degrees to radians.\n *\n * @private\n * @param {number} deg the angle in degrees.\n * @return {number} the angle in radians.\n */\nfunction degToRad(deg) {\n return (deg * (Math.PI / 180.0));\n}\n\n/**\n * Conversion from radians to degrees.\n *\n * @private\n * @param {number} rad the angle in radians.\n * @return {number} the angle in degrees.\n */\nfunction radToDeg(rad) {\n return (180.0 * (rad / Math.PI));\n}\n\n/**\n * Converts a set of Longitude and Latitude co-ordinates to UTM\n * using the WGS84 ellipsoid.\n *\n * @private\n * @param {object} ll Object literal with lat and lon properties\n * representing the WGS84 coordinate to be converted.\n * @return {object} Object literal containing the UTM value with easting,\n * northing, zoneNumber and zoneLetter properties, and an optional\n * accuracy property in digits. Returns null if the conversion failed.\n */\nfunction LLtoUTM(ll) {\n var Lat = ll.lat;\n var Long = ll.lon;\n var a = 6378137.0; //ellip.radius;\n var eccSquared = 0.00669438; //ellip.eccsq;\n var k0 = 0.9996;\n var LongOrigin;\n var eccPrimeSquared;\n var N, T, C, A, M;\n var LatRad = degToRad(Lat);\n var LongRad = degToRad(Long);\n var LongOriginRad;\n var ZoneNumber;\n // (int)\n ZoneNumber = Math.floor((Long + 180) / 6) + 1;\n\n //Make sure the longitude 180.00 is in Zone 60\n if (Long === 180) {\n ZoneNumber = 60;\n }\n\n // Special zone for Norway\n if (Lat >= 56.0 && Lat < 64.0 && Long >= 3.0 && Long < 12.0) {\n ZoneNumber = 32;\n }\n\n // Special zones for Svalbard\n if (Lat >= 72.0 && Lat < 84.0) {\n if (Long >= 0.0 && Long < 9.0) {\n ZoneNumber = 31;\n }\n else if (Long >= 9.0 && Long < 21.0) {\n ZoneNumber = 33;\n }\n else if (Long >= 21.0 && Long < 33.0) {\n ZoneNumber = 35;\n }\n else if (Long >= 33.0 && Long < 42.0) {\n ZoneNumber = 37;\n }\n }\n\n LongOrigin = (ZoneNumber - 1) * 6 - 180 + 3; //+3 puts origin\n // in middle of\n // zone\n LongOriginRad = degToRad(LongOrigin);\n\n eccPrimeSquared = (eccSquared) / (1 - eccSquared);\n\n N = a / Math.sqrt(1 - eccSquared * Math.sin(LatRad) * Math.sin(LatRad));\n T = Math.tan(LatRad) * Math.tan(LatRad);\n C = eccPrimeSquared * Math.cos(LatRad) * Math.cos(LatRad);\n A = Math.cos(LatRad) * (LongRad - LongOriginRad);\n\n M = a * ((1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256) * LatRad - (3 * eccSquared / 8 + 3 * eccSquared * eccSquared / 32 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(2 * LatRad) + (15 * eccSquared * eccSquared / 256 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(4 * LatRad) - (35 * eccSquared * eccSquared * eccSquared / 3072) * Math.sin(6 * LatRad));\n\n var UTMEasting = (k0 * N * (A + (1 - T + C) * A * A * A / 6.0 + (5 - 18 * T + T * T + 72 * C - 58 * eccPrimeSquared) * A * A * A * A * A / 120.0) + 500000.0);\n\n var UTMNorthing = (k0 * (M + N * Math.tan(LatRad) * (A * A / 2 + (5 - T + 9 * C + 4 * C * C) * A * A * A * A / 24.0 + (61 - 58 * T + T * T + 600 * C - 330 * eccPrimeSquared) * A * A * A * A * A * A / 720.0)));\n if (Lat < 0.0) {\n UTMNorthing += 10000000.0; //10000000 meter offset for\n // southern hemisphere\n }\n\n return {\n northing: Math.round(UTMNorthing),\n easting: Math.round(UTMEasting),\n zoneNumber: ZoneNumber,\n zoneLetter: getLetterDesignator(Lat)\n };\n}\n\n/**\n * Converts UTM coords to lat/long, using the WGS84 ellipsoid. This is a convenience\n * class where the Zone can be specified as a single string eg.\"60N\" which\n * is then broken down into the ZoneNumber and ZoneLetter.\n *\n * @private\n * @param {object} utm An object literal with northing, easting, zoneNumber\n * and zoneLetter properties. If an optional accuracy property is\n * provided (in meters), a bounding box will be returned instead of\n * latitude and longitude.\n * @return {object} An object literal containing either lat and lon values\n * (if no accuracy was provided), or top, right, bottom and left values\n * for the bounding box calculated according to the provided accuracy.\n * Returns null if the conversion failed.\n */\nfunction UTMtoLL(utm) {\n\n var UTMNorthing = utm.northing;\n var UTMEasting = utm.easting;\n var zoneLetter = utm.zoneLetter;\n var zoneNumber = utm.zoneNumber;\n // check the ZoneNummber is valid\n if (zoneNumber < 0 || zoneNumber > 60) {\n return null;\n }\n\n var k0 = 0.9996;\n var a = 6378137.0; //ellip.radius;\n var eccSquared = 0.00669438; //ellip.eccsq;\n var eccPrimeSquared;\n var e1 = (1 - Math.sqrt(1 - eccSquared)) / (1 + Math.sqrt(1 - eccSquared));\n var N1, T1, C1, R1, D, M;\n var LongOrigin;\n var mu, phi1Rad;\n\n // remove 500,000 meter offset for longitude\n var x = UTMEasting - 500000.0;\n var y = UTMNorthing;\n\n // We must know somehow if we are in the Northern or Southern\n // hemisphere, this is the only time we use the letter So even\n // if the Zone letter isn't exactly correct it should indicate\n // the hemisphere correctly\n if (zoneLetter < 'N') {\n y -= 10000000.0; // remove 10,000,000 meter offset used\n // for southern hemisphere\n }\n\n // There are 60 zones with zone 1 being at West -180 to -174\n LongOrigin = (zoneNumber - 1) * 6 - 180 + 3; // +3 puts origin\n // in middle of\n // zone\n\n eccPrimeSquared = (eccSquared) / (1 - eccSquared);\n\n M = y / k0;\n mu = M / (a * (1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256));\n\n phi1Rad = mu + (3 * e1 / 2 - 27 * e1 * e1 * e1 / 32) * Math.sin(2 * mu) + (21 * e1 * e1 / 16 - 55 * e1 * e1 * e1 * e1 / 32) * Math.sin(4 * mu) + (151 * e1 * e1 * e1 / 96) * Math.sin(6 * mu);\n // double phi1 = ProjMath.radToDeg(phi1Rad);\n\n N1 = a / Math.sqrt(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad));\n T1 = Math.tan(phi1Rad) * Math.tan(phi1Rad);\n C1 = eccPrimeSquared * Math.cos(phi1Rad) * Math.cos(phi1Rad);\n R1 = a * (1 - eccSquared) / Math.pow(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad), 1.5);\n D = x / (N1 * k0);\n\n var lat = phi1Rad - (N1 * Math.tan(phi1Rad) / R1) * (D * D / 2 - (5 + 3 * T1 + 10 * C1 - 4 * C1 * C1 - 9 * eccPrimeSquared) * D * D * D * D / 24 + (61 + 90 * T1 + 298 * C1 + 45 * T1 * T1 - 252 * eccPrimeSquared - 3 * C1 * C1) * D * D * D * D * D * D / 720);\n lat = radToDeg(lat);\n\n var lon = (D - (1 + 2 * T1 + C1) * D * D * D / 6 + (5 - 2 * C1 + 28 * T1 - 3 * C1 * C1 + 8 * eccPrimeSquared + 24 * T1 * T1) * D * D * D * D * D / 120) / Math.cos(phi1Rad);\n lon = LongOrigin + radToDeg(lon);\n\n var result;\n if (utm.accuracy) {\n var topRight = UTMtoLL({\n northing: utm.northing + utm.accuracy,\n easting: utm.easting + utm.accuracy,\n zoneLetter: utm.zoneLetter,\n zoneNumber: utm.zoneNumber\n });\n result = {\n top: topRight.lat,\n right: topRight.lon,\n bottom: lat,\n left: lon\n };\n }\n else {\n result = {\n lat: lat,\n lon: lon\n };\n }\n return result;\n}\n\n/**\n * Calculates the MGRS letter designator for the given latitude.\n *\n * @private\n * @param {number} lat The latitude in WGS84 to get the letter designator\n * for.\n * @return {char} The letter designator.\n */\nfunction getLetterDesignator(lat) {\n //This is here as an error flag to show that the Latitude is\n //outside MGRS limits\n var LetterDesignator = 'Z';\n\n if ((84 >= lat) && (lat >= 72)) {\n LetterDesignator = 'X';\n }\n else if ((72 > lat) && (lat >= 64)) {\n LetterDesignator = 'W';\n }\n else if ((64 > lat) && (lat >= 56)) {\n LetterDesignator = 'V';\n }\n else if ((56 > lat) && (lat >= 48)) {\n LetterDesignator = 'U';\n }\n else if ((48 > lat) && (lat >= 40)) {\n LetterDesignator = 'T';\n }\n else if ((40 > lat) && (lat >= 32)) {\n LetterDesignator = 'S';\n }\n else if ((32 > lat) && (lat >= 24)) {\n LetterDesignator = 'R';\n }\n else if ((24 > lat) && (lat >= 16)) {\n LetterDesignator = 'Q';\n }\n else if ((16 > lat) && (lat >= 8)) {\n LetterDesignator = 'P';\n }\n else if ((8 > lat) && (lat >= 0)) {\n LetterDesignator = 'N';\n }\n else if ((0 > lat) && (lat >= -8)) {\n LetterDesignator = 'M';\n }\n else if ((-8 > lat) && (lat >= -16)) {\n LetterDesignator = 'L';\n }\n else if ((-16 > lat) && (lat >= -24)) {\n LetterDesignator = 'K';\n }\n else if ((-24 > lat) && (lat >= -32)) {\n LetterDesignator = 'J';\n }\n else if ((-32 > lat) && (lat >= -40)) {\n LetterDesignator = 'H';\n }\n else if ((-40 > lat) && (lat >= -48)) {\n LetterDesignator = 'G';\n }\n else if ((-48 > lat) && (lat >= -56)) {\n LetterDesignator = 'F';\n }\n else if ((-56 > lat) && (lat >= -64)) {\n LetterDesignator = 'E';\n }\n else if ((-64 > lat) && (lat >= -72)) {\n LetterDesignator = 'D';\n }\n else if ((-72 > lat) && (lat >= -80)) {\n LetterDesignator = 'C';\n }\n return LetterDesignator;\n}\n\n/**\n * Encodes a UTM location as MGRS string.\n *\n * @private\n * @param {object} utm An object literal with easting, northing,\n * zoneLetter, zoneNumber\n * @param {number} accuracy Accuracy in digits (1-5).\n * @return {string} MGRS string for the given UTM location.\n */\nfunction encode(utm, accuracy) {\n // prepend with leading zeroes\n var seasting = \"00000\" + utm.easting,\n snorthing = \"00000\" + utm.northing;\n\n return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy);\n}\n\n/**\n * Get the two letter 100k designator for a given UTM easting,\n * northing and zone number value.\n *\n * @private\n * @param {number} easting\n * @param {number} northing\n * @param {number} zoneNumber\n * @return the two letter 100k designator for the given UTM location.\n */\nfunction get100kID(easting, northing, zoneNumber) {\n var setParm = get100kSetForZone(zoneNumber);\n var setColumn = Math.floor(easting / 100000);\n var setRow = Math.floor(northing / 100000) % 20;\n return getLetter100kID(setColumn, setRow, setParm);\n}\n\n/**\n * Given a UTM zone number, figure out the MGRS 100K set it is in.\n *\n * @private\n * @param {number} i An UTM zone number.\n * @return {number} the 100k set the UTM zone is in.\n */\nfunction get100kSetForZone(i) {\n var setParm = i % NUM_100K_SETS;\n if (setParm === 0) {\n setParm = NUM_100K_SETS;\n }\n\n return setParm;\n}\n\n/**\n * Get the two-letter MGRS 100k designator given information\n * translated from the UTM northing, easting and zone number.\n *\n * @private\n * @param {number} column the column index as it relates to the MGRS\n * 100k set spreadsheet, created from the UTM easting.\n * Values are 1-8.\n * @param {number} row the row index as it relates to the MGRS 100k set\n * spreadsheet, created from the UTM northing value. Values\n * are from 0-19.\n * @param {number} parm the set block, as it relates to the MGRS 100k set\n * spreadsheet, created from the UTM zone. Values are from\n * 1-60.\n * @return two letter MGRS 100k code.\n */\nfunction getLetter100kID(column, row, parm) {\n // colOrigin and rowOrigin are the letters at the origin of the set\n var index = parm - 1;\n var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index);\n var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index);\n\n // colInt and rowInt are the letters to build to return\n var colInt = colOrigin + column - 1;\n var rowInt = rowOrigin + row;\n var rollover = false;\n\n if (colInt > Z) {\n colInt = colInt - Z + A - 1;\n rollover = true;\n }\n\n if (colInt === I || (colOrigin < I && colInt > I) || ((colInt > I || colOrigin < I) && rollover)) {\n colInt++;\n }\n\n if (colInt === O || (colOrigin < O && colInt > O) || ((colInt > O || colOrigin < O) && rollover)) {\n colInt++;\n\n if (colInt === I) {\n colInt++;\n }\n }\n\n if (colInt > Z) {\n colInt = colInt - Z + A - 1;\n }\n\n if (rowInt > V) {\n rowInt = rowInt - V + A - 1;\n rollover = true;\n }\n else {\n rollover = false;\n }\n\n if (((rowInt === I) || ((rowOrigin < I) && (rowInt > I))) || (((rowInt > I) || (rowOrigin < I)) && rollover)) {\n rowInt++;\n }\n\n if (((rowInt === O) || ((rowOrigin < O) && (rowInt > O))) || (((rowInt > O) || (rowOrigin < O)) && rollover)) {\n rowInt++;\n\n if (rowInt === I) {\n rowInt++;\n }\n }\n\n if (rowInt > V) {\n rowInt = rowInt - V + A - 1;\n }\n\n var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt);\n return twoLetter;\n}\n\n/**\n * Decode the UTM parameters from a MGRS string.\n *\n * @private\n * @param {string} mgrsString an UPPERCASE coordinate string is expected.\n * @return {object} An object literal with easting, northing, zoneLetter,\n * zoneNumber and accuracy (in meters) properties.\n */\nfunction decode(mgrsString) {\n\n if (mgrsString && mgrsString.length === 0) {\n throw (\"MGRSPoint coverting from nothing\");\n }\n\n var length = mgrsString.length;\n\n var hunK = null;\n var sb = \"\";\n var testChar;\n var i = 0;\n\n // get Zone number\n while (!(/[A-Z]/).test(testChar = mgrsString.charAt(i))) {\n if (i >= 2) {\n throw (\"MGRSPoint bad conversion from: \" + mgrsString);\n }\n sb += testChar;\n i++;\n }\n\n var zoneNumber = parseInt(sb, 10);\n\n if (i === 0 || i + 3 > length) {\n // A good MGRS string has to be 4-5 digits long,\n // ##AAA/#AAA at least.\n throw (\"MGRSPoint bad conversion from: \" + mgrsString);\n }\n\n var zoneLetter = mgrsString.charAt(i++);\n\n // Should we check the zone letter here? Why not.\n if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') {\n throw (\"MGRSPoint zone letter \" + zoneLetter + \" not handled: \" + mgrsString);\n }\n\n hunK = mgrsString.substring(i, i += 2);\n\n var set = get100kSetForZone(zoneNumber);\n\n var east100k = getEastingFromChar(hunK.charAt(0), set);\n var north100k = getNorthingFromChar(hunK.charAt(1), set);\n\n // We have a bug where the northing may be 2000000 too low.\n // How\n // do we know when to roll over?\n\n while (north100k < getMinNorthing(zoneLetter)) {\n north100k += 2000000;\n }\n\n // calculate the char index for easting/northing separator\n var remainder = length - i;\n\n if (remainder % 2 !== 0) {\n throw (\"MGRSPoint has to have an even number \\nof digits after the zone letter and two 100km letters - front \\nhalf for easting meters, second half for \\nnorthing meters\" + mgrsString);\n }\n\n var sep = remainder / 2;\n\n var sepEasting = 0.0;\n var sepNorthing = 0.0;\n var accuracyBonus, sepEastingString, sepNorthingString, easting, northing;\n if (sep > 0) {\n accuracyBonus = 100000.0 / Math.pow(10, sep);\n sepEastingString = mgrsString.substring(i, i + sep);\n sepEasting = parseFloat(sepEastingString) * accuracyBonus;\n sepNorthingString = mgrsString.substring(i + sep);\n sepNorthing = parseFloat(sepNorthingString) * accuracyBonus;\n }\n\n easting = sepEasting + east100k;\n northing = sepNorthing + north100k;\n\n return {\n easting: easting,\n northing: northing,\n zoneLetter: zoneLetter,\n zoneNumber: zoneNumber,\n accuracy: accuracyBonus\n };\n}\n\n/**\n * Given the first letter from a two-letter MGRS 100k zone, and given the\n * MGRS table set for the zone number, figure out the easting value that\n * should be added to the other, secondary easting value.\n *\n * @private\n * @param {char} e The first letter from a two-letter MGRS 100´k zone.\n * @param {number} set The MGRS table set for the zone number.\n * @return {number} The easting value for the given letter and set.\n */\nfunction getEastingFromChar(e, set) {\n // colOrigin is the letter at the origin of the set for the\n // column\n var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1);\n var eastingValue = 100000.0;\n var rewindMarker = false;\n\n while (curCol !== e.charCodeAt(0)) {\n curCol++;\n if (curCol === I) {\n curCol++;\n }\n if (curCol === O) {\n curCol++;\n }\n if (curCol > Z) {\n if (rewindMarker) {\n throw (\"Bad character: \" + e);\n }\n curCol = A;\n rewindMarker = true;\n }\n eastingValue += 100000.0;\n }\n\n return eastingValue;\n}\n\n/**\n * Given the second letter from a two-letter MGRS 100k zone, and given the\n * MGRS table set for the zone number, figure out the northing value that\n * should be added to the other, secondary northing value. You have to\n * remember that Northings are determined from the equator, and the vertical\n * cycle of letters mean a 2000000 additional northing meters. This happens\n * approx. every 18 degrees of latitude. This method does *NOT* count any\n * additional northings. You have to figure out how many 2000000 meters need\n * to be added for the zone letter of the MGRS coordinate.\n *\n * @private\n * @param {char} n Second letter of the MGRS 100k zone\n * @param {number} set The MGRS table set number, which is dependent on the\n * UTM zone number.\n * @return {number} The northing value for the given letter and set.\n */\nfunction getNorthingFromChar(n, set) {\n\n if (n > 'V') {\n throw (\"MGRSPoint given invalid Northing \" + n);\n }\n\n // rowOrigin is the letter at the origin of the set for the\n // column\n var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set - 1);\n var northingValue = 0.0;\n var rewindMarker = false;\n\n while (curRow !== n.charCodeAt(0)) {\n curRow++;\n if (curRow === I) {\n curRow++;\n }\n if (curRow === O) {\n curRow++;\n }\n // fixing a bug making whole application hang in this loop\n // when 'n' is a wrong character\n if (curRow > V) {\n if (rewindMarker) { // making sure that this loop ends\n throw (\"Bad character: \" + n);\n }\n curRow = A;\n rewindMarker = true;\n }\n northingValue += 100000.0;\n }\n\n return northingValue;\n}\n\n/**\n * The function getMinNorthing returns the minimum northing value of a MGRS\n * zone.\n *\n * Ported from Geotrans' c Lattitude_Band_Value structure table.\n *\n * @private\n * @param {char} zoneLetter The MGRS zone to get the min northing for.\n * @return {number}\n */\nfunction getMinNorthing(zoneLetter) {\n var northing;\n switch (zoneLetter) {\n case 'C':\n northing = 1100000.0;\n break;\n case 'D':\n northing = 2000000.0;\n break;\n case 'E':\n northing = 2800000.0;\n break;\n case 'F':\n northing = 3700000.0;\n break;\n case 'G':\n northing = 4600000.0;\n break;\n case 'H':\n northing = 5500000.0;\n break;\n case 'J':\n northing = 6400000.0;\n break;\n case 'K':\n northing = 7300000.0;\n break;\n case 'L':\n northing = 8200000.0;\n break;\n case 'M':\n northing = 9100000.0;\n break;\n case 'N':\n northing = 0.0;\n break;\n case 'P':\n northing = 800000.0;\n break;\n case 'Q':\n northing = 1700000.0;\n break;\n case 'R':\n northing = 2600000.0;\n break;\n case 'S':\n northing = 3500000.0;\n break;\n case 'T':\n northing = 4400000.0;\n break;\n case 'U':\n northing = 5300000.0;\n break;\n case 'V':\n northing = 6200000.0;\n break;\n case 'W':\n northing = 7000000.0;\n break;\n case 'X':\n northing = 7900000.0;\n break;\n default:\n northing = -1.0;\n }\n if (northing >= 0.0) {\n return northing;\n }\n else {\n throw (\"Invalid zone letter: \" + zoneLetter);\n }\n\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/mgrs/mgrs.js?"); + +/***/ }), + +/***/ "./node_modules/path-browserify/index.js": +/*!***********************************************!*\ + !*** ./node_modules/path-browserify/index.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\n// backported and transplited with Babel, with backwards-compat fixes\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function (path) {\n if (typeof path !== 'string') path = path + '';\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) {\n // return '//';\n // Backwards-compat fix:\n return '/';\n }\n return path.slice(0, end);\n};\n\nfunction basename(path) {\n if (typeof path !== 'string') path = path + '';\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n}\n\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\n// in new Node.js versions, so only basename() above is backported here\nexports.basename = function (path, ext) {\n var f = basename(path);\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\nexports.extname = function (path) {\n if (typeof path !== 'string') path = path + '';\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://LithoSphere/./node_modules/path-browserify/index.js?"); + +/***/ }), + +/***/ "./node_modules/process/browser.js": +/*!*****************************************!*\ + !*** ./node_modules/process/browser.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/process/browser.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/Point.js": +/*!*****************************************!*\ + !*** ./node_modules/proj4/lib/Point.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var mgrs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mgrs */ \"./node_modules/mgrs/mgrs.js\");\n\n\nfunction Point(x, y, z) {\n if (!(this instanceof Point)) {\n return new Point(x, y, z);\n }\n if (Array.isArray(x)) {\n this.x = x[0];\n this.y = x[1];\n this.z = x[2] || 0.0;\n } else if(typeof x === 'object') {\n this.x = x.x;\n this.y = x.y;\n this.z = x.z || 0.0;\n } else if (typeof x === 'string' && typeof y === 'undefined') {\n var coords = x.split(',');\n this.x = parseFloat(coords[0], 10);\n this.y = parseFloat(coords[1], 10);\n this.z = parseFloat(coords[2], 10) || 0.0;\n } else {\n this.x = x;\n this.y = y;\n this.z = z || 0.0;\n }\n console.warn('proj4.Point will be removed in version 3, use proj4.toPoint');\n}\n\nPoint.fromMGRS = function(mgrsStr) {\n return new Point(Object(mgrs__WEBPACK_IMPORTED_MODULE_0__[\"toPoint\"])(mgrsStr));\n};\nPoint.prototype.toMGRS = function(accuracy) {\n return Object(mgrs__WEBPACK_IMPORTED_MODULE_0__[\"forward\"])([this.x, this.y], accuracy);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Point);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/Point.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/Proj.js": +/*!****************************************!*\ + !*** ./node_modules/proj4/lib/Proj.js ***! + \****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _parseCode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parseCode */ \"./node_modules/proj4/lib/parseCode.js\");\n/* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extend */ \"./node_modules/proj4/lib/extend.js\");\n/* harmony import */ var _projections__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./projections */ \"./node_modules/proj4/lib/projections.js\");\n/* harmony import */ var _deriveConstants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./deriveConstants */ \"./node_modules/proj4/lib/deriveConstants.js\");\n/* harmony import */ var _constants_Datum__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants/Datum */ \"./node_modules/proj4/lib/constants/Datum.js\");\n/* harmony import */ var _datum__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./datum */ \"./node_modules/proj4/lib/datum.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n/* harmony import */ var _nadgrid__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./nadgrid */ \"./node_modules/proj4/lib/nadgrid.js\");\n\n\n\n\n\n\n\n\n\nfunction Projection(srsCode,callback) {\n if (!(this instanceof Projection)) {\n return new Projection(srsCode);\n }\n callback = callback || function(error){\n if(error){\n throw error;\n }\n };\n var json = Object(_parseCode__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(srsCode);\n if(typeof json !== 'object'){\n callback(srsCode);\n return;\n }\n var ourProj = Projection.projections.get(json.projName);\n if(!ourProj){\n callback(srsCode);\n return;\n }\n if (json.datumCode && json.datumCode !== 'none') {\n var datumDef = Object(_match__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(_constants_Datum__WEBPACK_IMPORTED_MODULE_4__[\"default\"], json.datumCode);\n if (datumDef) {\n json.datum_params = datumDef.towgs84 ? datumDef.towgs84.split(',') : null;\n json.ellps = datumDef.ellipse;\n json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode;\n }\n }\n json.k0 = json.k0 || 1.0;\n json.axis = json.axis || 'enu';\n json.ellps = json.ellps || 'wgs84';\n var sphere_ = Object(_deriveConstants__WEBPACK_IMPORTED_MODULE_3__[\"sphere\"])(json.a, json.b, json.rf, json.ellps, json.sphere);\n var ecc = Object(_deriveConstants__WEBPACK_IMPORTED_MODULE_3__[\"eccentricity\"])(sphere_.a, sphere_.b, sphere_.rf, json.R_A);\n var nadgrids = Object(_nadgrid__WEBPACK_IMPORTED_MODULE_7__[\"getNadgrids\"])(json.nadgrids);\n var datumObj = json.datum || Object(_datum__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2,\n nadgrids);\n\n Object(_extend__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this, json); // transfer everything over from the projection because we don't know what we'll need\n Object(_extend__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this, ourProj); // transfer all the methods from the projection\n\n // copy the 4 things over we calulated in deriveConstants.sphere\n this.a = sphere_.a;\n this.b = sphere_.b;\n this.rf = sphere_.rf;\n this.sphere = sphere_.sphere;\n\n // copy the 3 things we calculated in deriveConstants.eccentricity\n this.es = ecc.es;\n this.e = ecc.e;\n this.ep2 = ecc.ep2;\n\n // add in the datum object\n this.datum = datumObj;\n\n // init the projection\n this.init();\n\n // legecy callback from back in the day when it went to spatialreference.org\n callback(null, this);\n\n}\nProjection.projections = _projections__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\nProjection.projections.start();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Projection);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/Proj.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/adjust_axis.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/adjust_axis.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(crs, denorm, point) {\n var xin = point.x,\n yin = point.y,\n zin = point.z || 0.0;\n var v, t, i;\n var out = {};\n for (i = 0; i < 3; i++) {\n if (denorm && i === 2 && point.z === undefined) {\n continue;\n }\n if (i === 0) {\n v = xin;\n if (\"ew\".indexOf(crs.axis[i]) !== -1) {\n t = 'x';\n } else {\n t = 'y';\n }\n\n }\n else if (i === 1) {\n v = yin;\n if (\"ns\".indexOf(crs.axis[i]) !== -1) {\n t = 'y';\n } else {\n t = 'x';\n }\n }\n else {\n v = zin;\n t = 'z';\n }\n switch (crs.axis[i]) {\n case 'e':\n out[t] = v;\n break;\n case 'w':\n out[t] = -v;\n break;\n case 'n':\n out[t] = v;\n break;\n case 's':\n out[t] = -v;\n break;\n case 'u':\n if (point[t] !== undefined) {\n out.z = v;\n }\n break;\n case 'd':\n if (point[t] !== undefined) {\n out.z = -v;\n }\n break;\n default:\n //console.log(\"ERROR: unknow axis (\"+crs.axis[i]+\") - check definition of \"+crs.projName);\n return null;\n }\n }\n return out;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/adjust_axis.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/checkSanity.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/checkSanity.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (point) {\n checkCoord(point.x);\n checkCoord(point.y);\n});\nfunction checkCoord(num) {\n if (typeof Number.isFinite === 'function') {\n if (Number.isFinite(num)) {\n return;\n }\n throw new TypeError('coordinates must be finite numbers');\n }\n if (typeof num !== 'number' || num !== num || !isFinite(num)) {\n throw new TypeError('coordinates must be finite numbers');\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/checkSanity.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/adjust_lat.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/common/adjust_lat.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _sign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sign */ \"./node_modules/proj4/lib/common/sign.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (Math.abs(x) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) ? x : (x - (Object(_sign__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(x) * Math.PI));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/adjust_lat.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/adjust_lon.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/common/adjust_lon.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _sign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sign */ \"./node_modules/proj4/lib/common/sign.js\");\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (Math.abs(x) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) ? x : (x - (Object(_sign__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(x) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"TWO_PI\"]));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/adjust_lon.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/adjust_zone.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/common/adjust_zone.js ***! + \******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(zone, lon) {\n if (zone === undefined) {\n zone = Math.floor((Object(_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon) + Math.PI) * 30 / Math.PI) + 1;\n\n if (zone < 0) {\n return 0;\n } else if (zone > 60) {\n return 60;\n }\n }\n return zone;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/adjust_zone.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/asinhy.js": +/*!*************************************************!*\ + !*** ./node_modules/proj4/lib/common/asinhy.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _hypot__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hypot */ \"./node_modules/proj4/lib/common/hypot.js\");\n/* harmony import */ var _log1py__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./log1py */ \"./node_modules/proj4/lib/common/log1py.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var y = Math.abs(x);\n y = Object(_log1py__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(y * (1 + y / (Object(_hypot__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(1, y) + 1)));\n\n return x < 0 ? -y : y;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/asinhy.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/asinz.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/asinz.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n if (Math.abs(x) > 1) {\n x = (x > 1) ? 1 : -1;\n }\n return Math.asin(x);\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/asinz.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/clens.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/clens.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(pp, arg_r) {\n var r = 2 * Math.cos(arg_r);\n var i = pp.length - 1;\n var hr1 = pp[i];\n var hr2 = 0;\n var hr;\n\n while (--i >= 0) {\n hr = -hr2 + r * hr1 + pp[i];\n hr2 = hr1;\n hr1 = hr;\n }\n\n return Math.sin(arg_r) * hr;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/clens.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/clens_cmplx.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/common/clens_cmplx.js ***! + \******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _sinh__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sinh */ \"./node_modules/proj4/lib/common/sinh.js\");\n/* harmony import */ var _cosh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cosh */ \"./node_modules/proj4/lib/common/cosh.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(pp, arg_r, arg_i) {\n var sin_arg_r = Math.sin(arg_r);\n var cos_arg_r = Math.cos(arg_r);\n var sinh_arg_i = Object(_sinh__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arg_i);\n var cosh_arg_i = Object(_cosh__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arg_i);\n var r = 2 * cos_arg_r * cosh_arg_i;\n var i = -2 * sin_arg_r * sinh_arg_i;\n var j = pp.length - 1;\n var hr = pp[j];\n var hi1 = 0;\n var hr1 = 0;\n var hi = 0;\n var hr2;\n var hi2;\n\n while (--j >= 0) {\n hr2 = hr1;\n hi2 = hi1;\n hr1 = hr;\n hi1 = hi;\n hr = -hr2 + r * hr1 - i * hi1 + pp[j];\n hi = -hi2 + i * hr1 + r * hi1;\n }\n\n r = sin_arg_r * cosh_arg_i;\n i = cos_arg_r * sinh_arg_i;\n\n return [r * hr - i * hi, r * hi + i * hr];\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/clens_cmplx.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/cosh.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/cosh.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var r = Math.exp(x);\n r = (r + 1 / r) / 2;\n return r;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/cosh.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/e0fn.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/e0fn.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x)));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e0fn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/e1fn.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/e1fn.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x)));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e1fn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/e2fn.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/e2fn.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (0.05859375 * x * x * (1 + 0.75 * x));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e2fn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/e3fn.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/e3fn.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (x * x * x * (35 / 3072));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e3fn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/gN.js": +/*!*********************************************!*\ + !*** ./node_modules/proj4/lib/common/gN.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, e, sinphi) {\n var temp = e * sinphi;\n return a / Math.sqrt(1 - temp * temp);\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/gN.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/gatg.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/gatg.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(pp, B) {\n var cos_2B = 2 * Math.cos(2 * B);\n var i = pp.length - 1;\n var h1 = pp[i];\n var h2 = 0;\n var h;\n\n while (--i >= 0) {\n h = -h2 + cos_2B * h1 + pp[i];\n h2 = h1;\n h1 = h;\n }\n\n return (B + h * Math.sin(2 * B));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/gatg.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/hypot.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/hypot.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x, y) {\n x = Math.abs(x);\n y = Math.abs(y);\n var a = Math.max(x, y);\n var b = Math.min(x, y) / (a ? a : 1);\n\n return a * Math.sqrt(1 + Math.pow(b, 2));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/hypot.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/imlfn.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/imlfn.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(ml, e0, e1, e2, e3) {\n var phi;\n var dphi;\n\n phi = ml / e0;\n for (var i = 0; i < 15; i++) {\n dphi = (ml - (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi))) / (e0 - 2 * e1 * Math.cos(2 * phi) + 4 * e2 * Math.cos(4 * phi) - 6 * e3 * Math.cos(6 * phi));\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n\n //..reportError(\"IMLFN-CONV:Latitude failed to converge after 15 iterations\");\n return NaN;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/imlfn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/iqsfnz.js": +/*!*************************************************!*\ + !*** ./node_modules/proj4/lib/common/iqsfnz.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, q) {\n var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent));\n if (Math.abs(Math.abs(q) - temp) < 1.0E-6) {\n if (q < 0) {\n return (-1 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n }\n else {\n return _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n }\n }\n //var phi = 0.5* q/(1-eccent*eccent);\n var phi = Math.asin(0.5 * q);\n var dphi;\n var sin_phi;\n var cos_phi;\n var con;\n for (var i = 0; i < 30; i++) {\n sin_phi = Math.sin(phi);\n cos_phi = Math.cos(phi);\n con = eccent * sin_phi;\n dphi = Math.pow(1 - con * con, 2) / (2 * cos_phi) * (q / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math.log((1 - con) / (1 + con)));\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n\n //console.log(\"IQSFN-CONV:Latitude failed to converge after 30 iterations\");\n return NaN;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/iqsfnz.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/log1py.js": +/*!*************************************************!*\ + !*** ./node_modules/proj4/lib/common/log1py.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var y = 1 + x;\n var z = y - 1;\n\n return z === 0 ? x : x * Math.log(y) / z;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/log1py.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/mlfn.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/mlfn.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(e0, e1, e2, e3, phi) {\n return (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/mlfn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/msfnz.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/msfnz.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, sinphi, cosphi) {\n var con = eccent * sinphi;\n return cosphi / (Math.sqrt(1 - con * con));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/msfnz.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/phi2z.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/phi2z.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, ts) {\n var eccnth = 0.5 * eccent;\n var con, dphi;\n var phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - 2 * Math.atan(ts);\n for (var i = 0; i <= 15; i++) {\n con = eccent * Math.sin(phi);\n dphi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - 2 * Math.atan(ts * (Math.pow(((1 - con) / (1 + con)), eccnth))) - phi;\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n //console.log(\"phi2z has NoConvergence\");\n return -9999;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/phi2z.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/pj_enfn.js": +/*!**************************************************!*\ + !*** ./node_modules/proj4/lib/common/pj_enfn.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar C00 = 1;\nvar C02 = 0.25;\nvar C04 = 0.046875;\nvar C06 = 0.01953125;\nvar C08 = 0.01068115234375;\nvar C22 = 0.75;\nvar C44 = 0.46875;\nvar C46 = 0.01302083333333333333;\nvar C48 = 0.00712076822916666666;\nvar C66 = 0.36458333333333333333;\nvar C68 = 0.00569661458333333333;\nvar C88 = 0.3076171875;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(es) {\n var en = [];\n en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));\n en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));\n var t = es * es;\n en[2] = t * (C44 - es * (C46 + es * C48));\n t *= es;\n en[3] = t * (C66 - es * C68);\n en[4] = t * es * C88;\n return en;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/pj_enfn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/pj_inv_mlfn.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/common/pj_inv_mlfn.js ***! + \******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _pj_mlfn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pj_mlfn */ \"./node_modules/proj4/lib/common/pj_mlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\nvar MAX_ITER = 20;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(arg, es, en) {\n var k = 1 / (1 - es);\n var phi = arg;\n for (var i = MAX_ITER; i; --i) { /* rarely goes over 2 iterations */\n var s = Math.sin(phi);\n var t = 1 - es * s * s;\n //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg;\n //phi -= t * (t * Math.sqrt(t)) * k;\n t = (Object(_pj_mlfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k;\n phi -= t;\n if (Math.abs(t) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n return phi;\n }\n }\n //..reportError(\"cass:pj_inv_mlfn: Convergence error\");\n return phi;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/pj_inv_mlfn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/pj_mlfn.js": +/*!**************************************************!*\ + !*** ./node_modules/proj4/lib/common/pj_mlfn.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(phi, sphi, cphi, en) {\n cphi *= sphi;\n sphi *= sphi;\n return (en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4]))));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/pj_mlfn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/qsfnz.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/qsfnz.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, sinphi) {\n var con;\n if (eccent > 1.0e-7) {\n con = eccent * sinphi;\n return ((1 - eccent * eccent) * (sinphi / (1 - con * con) - (0.5 / eccent) * Math.log((1 - con) / (1 + con))));\n }\n else {\n return (2 * sinphi);\n }\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/qsfnz.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/sign.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/sign.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return x<0 ? -1 : 1;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/sign.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/sinh.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/sinh.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var r = Math.exp(x);\n r = (r - 1 / r) / 2;\n return r;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/sinh.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/srat.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/srat.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(esinp, exp) {\n return (Math.pow((1 - esinp) / (1 + esinp), exp));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/srat.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/toPoint.js": +/*!**************************************************!*\ + !*** ./node_modules/proj4/lib/common/toPoint.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (array){\n var out = {\n x: array[0],\n y: array[1]\n };\n if (array.length>2) {\n out.z = array[2];\n }\n if (array.length>3) {\n out.m = array[3];\n }\n return out;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/toPoint.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/tsfnz.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/tsfnz.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, phi, sinphi) {\n var con = eccent * sinphi;\n var com = 0.5 * eccent;\n con = Math.pow(((1 - con) / (1 + con)), com);\n return (Math.tan(0.5 * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - phi)) / con);\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/tsfnz.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/constants/Datum.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/constants/Datum.js ***! + \***************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return exports; });\nvar exports = {};\n\nexports.wgs84 = {\n towgs84: \"0,0,0\",\n ellipse: \"WGS84\",\n datumName: \"WGS84\"\n};\n\nexports.ch1903 = {\n towgs84: \"674.374,15.056,405.346\",\n ellipse: \"bessel\",\n datumName: \"swiss\"\n};\n\nexports.ggrs87 = {\n towgs84: \"-199.87,74.79,246.62\",\n ellipse: \"GRS80\",\n datumName: \"Greek_Geodetic_Reference_System_1987\"\n};\n\nexports.nad83 = {\n towgs84: \"0,0,0\",\n ellipse: \"GRS80\",\n datumName: \"North_American_Datum_1983\"\n};\n\nexports.nad27 = {\n nadgrids: \"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat\",\n ellipse: \"clrk66\",\n datumName: \"North_American_Datum_1927\"\n};\n\nexports.potsdam = {\n towgs84: \"606.0,23.0,413.0\",\n ellipse: \"bessel\",\n datumName: \"Potsdam Rauenberg 1950 DHDN\"\n};\n\nexports.carthage = {\n towgs84: \"-263.0,6.0,431.0\",\n ellipse: \"clark80\",\n datumName: \"Carthage 1934 Tunisia\"\n};\n\nexports.hermannskogel = {\n towgs84: \"653.0,-212.0,449.0\",\n ellipse: \"bessel\",\n datumName: \"Hermannskogel\"\n};\n\nexports.osni52 = {\n towgs84: \"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",\n ellipse: \"airy\",\n datumName: \"Irish National\"\n};\n\nexports.ire65 = {\n towgs84: \"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",\n ellipse: \"mod_airy\",\n datumName: \"Ireland 1965\"\n};\n\nexports.rassadiran = {\n towgs84: \"-133.63,-157.5,-158.62\",\n ellipse: \"intl\",\n datumName: \"Rassadiran\"\n};\n\nexports.nzgd49 = {\n towgs84: \"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\",\n ellipse: \"intl\",\n datumName: \"New Zealand Geodetic Datum 1949\"\n};\n\nexports.osgb36 = {\n towgs84: \"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894\",\n ellipse: \"airy\",\n datumName: \"Airy 1830\"\n};\n\nexports.s_jtsk = {\n towgs84: \"589,76,480\",\n ellipse: 'bessel',\n datumName: 'S-JTSK (Ferro)'\n};\n\nexports.beduaram = {\n towgs84: '-106,-87,188',\n ellipse: 'clrk80',\n datumName: 'Beduaram'\n};\n\nexports.gunung_segara = {\n towgs84: '-403,684,41',\n ellipse: 'bessel',\n datumName: 'Gunung Segara Jakarta'\n};\n\nexports.rnb72 = {\n towgs84: \"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1\",\n ellipse: \"intl\",\n datumName: \"Reseau National Belge 1972\"\n};\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/Datum.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/constants/Ellipsoid.js": +/*!*******************************************************!*\ + !*** ./node_modules/proj4/lib/constants/Ellipsoid.js ***! + \*******************************************************/ +/*! exports provided: default, WGS84 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return exports; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WGS84\", function() { return WGS84; });\nvar exports = {};\n\nexports.MERIT = {\n a: 6378137.0,\n rf: 298.257,\n ellipseName: \"MERIT 1983\"\n};\n\nexports.SGS85 = {\n a: 6378136.0,\n rf: 298.257,\n ellipseName: \"Soviet Geodetic System 85\"\n};\n\nexports.GRS80 = {\n a: 6378137.0,\n rf: 298.257222101,\n ellipseName: \"GRS 1980(IUGG, 1980)\"\n};\n\nexports.IAU76 = {\n a: 6378140.0,\n rf: 298.257,\n ellipseName: \"IAU 1976\"\n};\n\nexports.airy = {\n a: 6377563.396,\n b: 6356256.910,\n ellipseName: \"Airy 1830\"\n};\n\nexports.APL4 = {\n a: 6378137,\n rf: 298.25,\n ellipseName: \"Appl. Physics. 1965\"\n};\n\nexports.NWL9D = {\n a: 6378145.0,\n rf: 298.25,\n ellipseName: \"Naval Weapons Lab., 1965\"\n};\n\nexports.mod_airy = {\n a: 6377340.189,\n b: 6356034.446,\n ellipseName: \"Modified Airy\"\n};\n\nexports.andrae = {\n a: 6377104.43,\n rf: 300.0,\n ellipseName: \"Andrae 1876 (Den., Iclnd.)\"\n};\n\nexports.aust_SA = {\n a: 6378160.0,\n rf: 298.25,\n ellipseName: \"Australian Natl & S. Amer. 1969\"\n};\n\nexports.GRS67 = {\n a: 6378160.0,\n rf: 298.2471674270,\n ellipseName: \"GRS 67(IUGG 1967)\"\n};\n\nexports.bessel = {\n a: 6377397.155,\n rf: 299.1528128,\n ellipseName: \"Bessel 1841\"\n};\n\nexports.bess_nam = {\n a: 6377483.865,\n rf: 299.1528128,\n ellipseName: \"Bessel 1841 (Namibia)\"\n};\n\nexports.clrk66 = {\n a: 6378206.4,\n b: 6356583.8,\n ellipseName: \"Clarke 1866\"\n};\n\nexports.clrk80 = {\n a: 6378249.145,\n rf: 293.4663,\n ellipseName: \"Clarke 1880 mod.\"\n};\n\nexports.clrk58 = {\n a: 6378293.645208759,\n rf: 294.2606763692654,\n ellipseName: \"Clarke 1858\"\n};\n\nexports.CPM = {\n a: 6375738.7,\n rf: 334.29,\n ellipseName: \"Comm. des Poids et Mesures 1799\"\n};\n\nexports.delmbr = {\n a: 6376428.0,\n rf: 311.5,\n ellipseName: \"Delambre 1810 (Belgium)\"\n};\n\nexports.engelis = {\n a: 6378136.05,\n rf: 298.2566,\n ellipseName: \"Engelis 1985\"\n};\n\nexports.evrst30 = {\n a: 6377276.345,\n rf: 300.8017,\n ellipseName: \"Everest 1830\"\n};\n\nexports.evrst48 = {\n a: 6377304.063,\n rf: 300.8017,\n ellipseName: \"Everest 1948\"\n};\n\nexports.evrst56 = {\n a: 6377301.243,\n rf: 300.8017,\n ellipseName: \"Everest 1956\"\n};\n\nexports.evrst69 = {\n a: 6377295.664,\n rf: 300.8017,\n ellipseName: \"Everest 1969\"\n};\n\nexports.evrstSS = {\n a: 6377298.556,\n rf: 300.8017,\n ellipseName: \"Everest (Sabah & Sarawak)\"\n};\n\nexports.fschr60 = {\n a: 6378166.0,\n rf: 298.3,\n ellipseName: \"Fischer (Mercury Datum) 1960\"\n};\n\nexports.fschr60m = {\n a: 6378155.0,\n rf: 298.3,\n ellipseName: \"Fischer 1960\"\n};\n\nexports.fschr68 = {\n a: 6378150.0,\n rf: 298.3,\n ellipseName: \"Fischer 1968\"\n};\n\nexports.helmert = {\n a: 6378200.0,\n rf: 298.3,\n ellipseName: \"Helmert 1906\"\n};\n\nexports.hough = {\n a: 6378270.0,\n rf: 297.0,\n ellipseName: \"Hough\"\n};\n\nexports.intl = {\n a: 6378388.0,\n rf: 297.0,\n ellipseName: \"International 1909 (Hayford)\"\n};\n\nexports.kaula = {\n a: 6378163.0,\n rf: 298.24,\n ellipseName: \"Kaula 1961\"\n};\n\nexports.lerch = {\n a: 6378139.0,\n rf: 298.257,\n ellipseName: \"Lerch 1979\"\n};\n\nexports.mprts = {\n a: 6397300.0,\n rf: 191.0,\n ellipseName: \"Maupertius 1738\"\n};\n\nexports.new_intl = {\n a: 6378157.5,\n b: 6356772.2,\n ellipseName: \"New International 1967\"\n};\n\nexports.plessis = {\n a: 6376523.0,\n rf: 6355863.0,\n ellipseName: \"Plessis 1817 (France)\"\n};\n\nexports.krass = {\n a: 6378245.0,\n rf: 298.3,\n ellipseName: \"Krassovsky, 1942\"\n};\n\nexports.SEasia = {\n a: 6378155.0,\n b: 6356773.3205,\n ellipseName: \"Southeast Asia\"\n};\n\nexports.walbeck = {\n a: 6376896.0,\n b: 6355834.8467,\n ellipseName: \"Walbeck\"\n};\n\nexports.WGS60 = {\n a: 6378165.0,\n rf: 298.3,\n ellipseName: \"WGS 60\"\n};\n\nexports.WGS66 = {\n a: 6378145.0,\n rf: 298.25,\n ellipseName: \"WGS 66\"\n};\n\nexports.WGS7 = {\n a: 6378135.0,\n rf: 298.26,\n ellipseName: \"WGS 72\"\n};\n\nvar WGS84 = exports.WGS84 = {\n a: 6378137.0,\n rf: 298.257223563,\n ellipseName: \"WGS 84\"\n};\n\nexports.sphere = {\n a: 6370997.0,\n b: 6370997.0,\n ellipseName: \"Normal Sphere (r=6370997)\"\n};\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/Ellipsoid.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/constants/PrimeMeridian.js": +/*!***********************************************************!*\ + !*** ./node_modules/proj4/lib/constants/PrimeMeridian.js ***! + \***********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return exports; });\nvar exports = {};\n\n\nexports.greenwich = 0.0; //\"0dE\",\nexports.lisbon = -9.131906111111; //\"9d07'54.862\\\"W\",\nexports.paris = 2.337229166667; //\"2d20'14.025\\\"E\",\nexports.bogota = -74.080916666667; //\"74d04'51.3\\\"W\",\nexports.madrid = -3.687938888889; //\"3d41'16.58\\\"W\",\nexports.rome = 12.452333333333; //\"12d27'8.4\\\"E\",\nexports.bern = 7.439583333333; //\"7d26'22.5\\\"E\",\nexports.jakarta = 106.807719444444; //\"106d48'27.79\\\"E\",\nexports.ferro = -17.666666666667; //\"17d40'W\",\nexports.brussels = 4.367975; //\"4d22'4.71\\\"E\",\nexports.stockholm = 18.058277777778; //\"18d3'29.8\\\"E\",\nexports.athens = 23.7163375; //\"23d42'58.815\\\"E\",\nexports.oslo = 10.722916666667; //\"10d43'22.5\\\"E\"\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/PrimeMeridian.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/constants/units.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/constants/units.js ***! + \***************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ft: {to_meter: 0.3048},\n 'us-ft': {to_meter: 1200 / 3937}\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/units.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/constants/values.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/constants/values.js ***! + \****************************************************/ +/*! exports provided: PJD_3PARAM, PJD_7PARAM, PJD_GRIDSHIFT, PJD_WGS84, PJD_NODATUM, SRS_WGS84_SEMIMAJOR, SRS_WGS84_SEMIMINOR, SRS_WGS84_ESQUARED, SEC_TO_RAD, HALF_PI, SIXTH, RA4, RA6, EPSLN, D2R, R2D, FORTPI, TWO_PI, SPI */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_3PARAM\", function() { return PJD_3PARAM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_7PARAM\", function() { return PJD_7PARAM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_GRIDSHIFT\", function() { return PJD_GRIDSHIFT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_WGS84\", function() { return PJD_WGS84; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_NODATUM\", function() { return PJD_NODATUM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SRS_WGS84_SEMIMAJOR\", function() { return SRS_WGS84_SEMIMAJOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SRS_WGS84_SEMIMINOR\", function() { return SRS_WGS84_SEMIMINOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SRS_WGS84_ESQUARED\", function() { return SRS_WGS84_ESQUARED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SEC_TO_RAD\", function() { return SEC_TO_RAD; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HALF_PI\", function() { return HALF_PI; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SIXTH\", function() { return SIXTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RA4\", function() { return RA4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RA6\", function() { return RA6; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EPSLN\", function() { return EPSLN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"D2R\", function() { return D2R; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"R2D\", function() { return R2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FORTPI\", function() { return FORTPI; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TWO_PI\", function() { return TWO_PI; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SPI\", function() { return SPI; });\nvar PJD_3PARAM = 1;\nvar PJD_7PARAM = 2;\nvar PJD_GRIDSHIFT = 3;\nvar PJD_WGS84 = 4; // WGS84 or equivalent\nvar PJD_NODATUM = 5; // WGS84 or equivalent\nvar SRS_WGS84_SEMIMAJOR = 6378137.0; // only used in grid shift transforms\nvar SRS_WGS84_SEMIMINOR = 6356752.314; // only used in grid shift transforms\nvar SRS_WGS84_ESQUARED = 0.0066943799901413165; // only used in grid shift transforms\nvar SEC_TO_RAD = 4.84813681109535993589914102357e-6;\nvar HALF_PI = Math.PI/2;\n// ellipoid pj_set_ell.c\nvar SIXTH = 0.1666666666666666667;\n/* 1/6 */\nvar RA4 = 0.04722222222222222222;\n/* 17/360 */\nvar RA6 = 0.02215608465608465608;\nvar EPSLN = 1.0e-10;\n// you'd think you could use Number.EPSILON above but that makes\n// Mollweide get into an infinate loop.\n\nvar D2R = 0.01745329251994329577;\nvar R2D = 57.29577951308232088;\nvar FORTPI = Math.PI/4;\nvar TWO_PI = Math.PI * 2;\n// SPI is slightly greater than Math.PI, so values that exceed the -180..180\n// degree range by a tiny amount don't get wrapped. This prevents points that\n// have drifted from their original location along the 180th meridian (due to\n// floating point error) from changing their sign.\nvar SPI = 3.14159265359;\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/values.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/core.js": +/*!****************************************!*\ + !*** ./node_modules/proj4/lib/core.js ***! + \****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Proj__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Proj */ \"./node_modules/proj4/lib/Proj.js\");\n/* harmony import */ var _transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transform */ \"./node_modules/proj4/lib/transform.js\");\n\n\nvar wgs84 = Object(_Proj__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('WGS84');\n\nfunction transformer(from, to, coords) {\n var transformedArray, out, keys;\n if (Array.isArray(coords)) {\n transformedArray = Object(_transform__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(from, to, coords) || {x: NaN, y: NaN};\n if (coords.length > 2) {\n if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) {\n if (typeof transformedArray.z === 'number') {\n return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.splice(3));\n } else {\n return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.splice(3));\n }\n } else {\n return [transformedArray.x, transformedArray.y].concat(coords.splice(2));\n }\n } else {\n return [transformedArray.x, transformedArray.y];\n }\n } else {\n out = Object(_transform__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(from, to, coords);\n keys = Object.keys(coords);\n if (keys.length === 2) {\n return out;\n }\n keys.forEach(function (key) {\n if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) {\n if (key === 'x' || key === 'y' || key === 'z') {\n return;\n }\n } else {\n if (key === 'x' || key === 'y') {\n return;\n }\n }\n out[key] = coords[key];\n });\n return out;\n }\n}\n\nfunction checkProj(item) {\n if (item instanceof _Proj__WEBPACK_IMPORTED_MODULE_0__[\"default\"]) {\n return item;\n }\n if (item.oProj) {\n return item.oProj;\n }\n return Object(_Proj__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(item);\n}\n\nfunction proj4(fromProj, toProj, coord) {\n fromProj = checkProj(fromProj);\n var single = false;\n var obj;\n if (typeof toProj === 'undefined') {\n toProj = fromProj;\n fromProj = wgs84;\n single = true;\n } else if (typeof toProj.x !== 'undefined' || Array.isArray(toProj)) {\n coord = toProj;\n toProj = fromProj;\n fromProj = wgs84;\n single = true;\n }\n toProj = checkProj(toProj);\n if (coord) {\n return transformer(fromProj, toProj, coord);\n } else {\n obj = {\n forward: function (coords) {\n return transformer(fromProj, toProj, coords);\n },\n inverse: function (coords) {\n return transformer(toProj, fromProj, coords);\n }\n };\n if (single) {\n obj.oProj = toProj;\n }\n return obj;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (proj4);\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/core.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/datum.js": +/*!*****************************************!*\ + !*** ./node_modules/proj4/lib/datum.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\nfunction datum(datumCode, datum_params, a, b, es, ep2, nadgrids) {\n var out = {};\n\n if (datumCode === undefined || datumCode === 'none') {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_NODATUM\"];\n } else {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_WGS84\"];\n }\n\n if (datum_params) {\n out.datum_params = datum_params.map(parseFloat);\n if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"];\n }\n if (out.datum_params.length > 3) {\n if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"];\n out.datum_params[3] *= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"];\n out.datum_params[4] *= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"];\n out.datum_params[5] *= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"];\n out.datum_params[6] = (out.datum_params[6] / 1000000.0) + 1.0;\n }\n }\n }\n\n if (nadgrids) {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"];\n out.grids = nadgrids;\n }\n out.a = a; //datum object also uses these values\n out.b = b;\n out.es = es;\n out.ep2 = ep2;\n return out;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (datum);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/datum.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/datumUtils.js": +/*!**********************************************!*\ + !*** ./node_modules/proj4/lib/datumUtils.js ***! + \**********************************************/ +/*! exports provided: compareDatums, geodeticToGeocentric, geocentricToGeodetic, geocentricToWgs84, geocentricFromWgs84 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"compareDatums\", function() { return compareDatums; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geodeticToGeocentric\", function() { return geodeticToGeocentric; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geocentricToGeodetic\", function() { return geocentricToGeodetic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geocentricToWgs84\", function() { return geocentricToWgs84; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geocentricFromWgs84\", function() { return geocentricFromWgs84; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\nfunction compareDatums(source, dest) {\n if (source.datum_type !== dest.datum_type) {\n return false; // false, datums are not equal\n } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 0.000000000050) {\n // the tolerance for es is to ensure that GRS80 and WGS84\n // are considered identical\n return false;\n } else if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"]) {\n return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2]);\n } else if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) {\n return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2] && source.datum_params[3] === dest.datum_params[3] && source.datum_params[4] === dest.datum_params[4] && source.datum_params[5] === dest.datum_params[5] && source.datum_params[6] === dest.datum_params[6]);\n } else {\n return true; // datums are equal\n }\n} // cs_compare_datums()\n\n/*\n * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates\n * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),\n * according to the current ellipsoid parameters.\n *\n * Latitude : Geodetic latitude in radians (input)\n * Longitude : Geodetic longitude in radians (input)\n * Height : Geodetic height, in meters (input)\n * X : Calculated Geocentric X coordinate, in meters (output)\n * Y : Calculated Geocentric Y coordinate, in meters (output)\n * Z : Calculated Geocentric Z coordinate, in meters (output)\n *\n */\nfunction geodeticToGeocentric(p, es, a) {\n var Longitude = p.x;\n var Latitude = p.y;\n var Height = p.z ? p.z : 0; //Z value not always supplied\n\n var Rn; /* Earth radius at location */\n var Sin_Lat; /* Math.sin(Latitude) */\n var Sin2_Lat; /* Square of Math.sin(Latitude) */\n var Cos_Lat; /* Math.cos(Latitude) */\n\n /*\n ** Don't blow up if Latitude is just a little out of the value\n ** range as it may just be a rounding issue. Also removed longitude\n ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.\n */\n if (Latitude < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] && Latitude > -1.001 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n Latitude = -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (Latitude > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] && Latitude < 1.001 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n Latitude = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (Latitude < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n /* Latitude out of range */\n //..reportError('geocent:lat out of range:' + Latitude);\n return { x: -Infinity, y: -Infinity, z: p.z };\n } else if (Latitude > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n /* Latitude out of range */\n return { x: Infinity, y: Infinity, z: p.z };\n }\n\n if (Longitude > Math.PI) {\n Longitude -= (2 * Math.PI);\n }\n Sin_Lat = Math.sin(Latitude);\n Cos_Lat = Math.cos(Latitude);\n Sin2_Lat = Sin_Lat * Sin_Lat;\n Rn = a / (Math.sqrt(1.0e0 - es * Sin2_Lat));\n return {\n x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),\n y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),\n z: ((Rn * (1 - es)) + Height) * Sin_Lat\n };\n} // cs_geodetic_to_geocentric()\n\nfunction geocentricToGeodetic(p, es, a, b) {\n /* local defintions and variables */\n /* end-criterium of loop, accuracy of sin(Latitude) */\n var genau = 1e-12;\n var genau2 = (genau * genau);\n var maxiter = 30;\n\n var P; /* distance between semi-minor axis and location */\n var RR; /* distance between center and location */\n var CT; /* sin of geocentric latitude */\n var ST; /* cos of geocentric latitude */\n var RX;\n var RK;\n var RN; /* Earth radius at location */\n var CPHI0; /* cos of start or old geodetic latitude in iterations */\n var SPHI0; /* sin of start or old geodetic latitude in iterations */\n var CPHI; /* cos of searched geodetic latitude */\n var SPHI; /* sin of searched geodetic latitude */\n var SDPHI; /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */\n var iter; /* # of continous iteration, max. 30 is always enough (s.a.) */\n\n var X = p.x;\n var Y = p.y;\n var Z = p.z ? p.z : 0.0; //Z value not always supplied\n var Longitude;\n var Latitude;\n var Height;\n\n P = Math.sqrt(X * X + Y * Y);\n RR = Math.sqrt(X * X + Y * Y + Z * Z);\n\n /* special cases for latitude and longitude */\n if (P / a < genau) {\n\n /* special case, if P=0. (X=0., Y=0.) */\n Longitude = 0.0;\n\n /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis\n * of ellipsoid (=center of mass), Latitude becomes PI/2 */\n if (RR / a < genau) {\n Latitude = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n Height = -b;\n return {\n x: p.x,\n y: p.y,\n z: p.z\n };\n }\n } else {\n /* ellipsoidal (geodetic) longitude\n * interval: -PI < Longitude <= +PI */\n Longitude = Math.atan2(Y, X);\n }\n\n /* --------------------------------------------------------------\n * Following iterative algorithm was developped by\n * \"Institut for Erdmessung\", University of Hannover, July 1988.\n * Internet: www.ife.uni-hannover.de\n * Iterative computation of CPHI,SPHI and Height.\n * Iteration of CPHI and SPHI to 10**-12 radian resp.\n * 2*10**-7 arcsec.\n * --------------------------------------------------------------\n */\n CT = Z / RR;\n ST = P / RR;\n RX = 1.0 / Math.sqrt(1.0 - es * (2.0 - es) * ST * ST);\n CPHI0 = ST * (1.0 - es) * RX;\n SPHI0 = CT * RX;\n iter = 0;\n\n /* loop to find sin(Latitude) resp. Latitude\n * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */\n do {\n iter++;\n RN = a / Math.sqrt(1.0 - es * SPHI0 * SPHI0);\n\n /* ellipsoidal (geodetic) height */\n Height = P * CPHI0 + Z * SPHI0 - RN * (1.0 - es * SPHI0 * SPHI0);\n\n RK = es * RN / (RN + Height);\n RX = 1.0 / Math.sqrt(1.0 - RK * (2.0 - RK) * ST * ST);\n CPHI = ST * (1.0 - RK) * RX;\n SPHI = CT * RX;\n SDPHI = SPHI * CPHI0 - CPHI * SPHI0;\n CPHI0 = CPHI;\n SPHI0 = SPHI;\n }\n while (SDPHI * SDPHI > genau2 && iter < maxiter);\n\n /* ellipsoidal (geodetic) latitude */\n Latitude = Math.atan(SPHI / Math.abs(CPHI));\n return {\n x: Longitude,\n y: Latitude,\n z: Height\n };\n} // cs_geocentric_to_geodetic()\n\n/****************************************************************/\n// pj_geocentic_to_wgs84( p )\n// p = point to transform in geocentric coordinates (x,y,z)\n\n\n/** point object, nothing fancy, just allows values to be\n passed back and forth by reference rather than by value.\n Other point classes may be used as long as they have\n x and y properties, which will get modified in the transform method.\n*/\nfunction geocentricToWgs84(p, datum_type, datum_params) {\n\n if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"]) {\n // if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: p.x + datum_params[0],\n y: p.y + datum_params[1],\n z: p.z + datum_params[2],\n };\n } else if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) {\n var Dx_BF = datum_params[0];\n var Dy_BF = datum_params[1];\n var Dz_BF = datum_params[2];\n var Rx_BF = datum_params[3];\n var Ry_BF = datum_params[4];\n var Rz_BF = datum_params[5];\n var M_BF = datum_params[6];\n // if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: M_BF * (p.x - Rz_BF * p.y + Ry_BF * p.z) + Dx_BF,\n y: M_BF * (Rz_BF * p.x + p.y - Rx_BF * p.z) + Dy_BF,\n z: M_BF * (-Ry_BF * p.x + Rx_BF * p.y + p.z) + Dz_BF\n };\n }\n} // cs_geocentric_to_wgs84\n\n/****************************************************************/\n// pj_geocentic_from_wgs84()\n// coordinate system definition,\n// point to transform in geocentric coordinates (x,y,z)\nfunction geocentricFromWgs84(p, datum_type, datum_params) {\n\n if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"]) {\n //if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: p.x - datum_params[0],\n y: p.y - datum_params[1],\n z: p.z - datum_params[2],\n };\n\n } else if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) {\n var Dx_BF = datum_params[0];\n var Dy_BF = datum_params[1];\n var Dz_BF = datum_params[2];\n var Rx_BF = datum_params[3];\n var Ry_BF = datum_params[4];\n var Rz_BF = datum_params[5];\n var M_BF = datum_params[6];\n var x_tmp = (p.x - Dx_BF) / M_BF;\n var y_tmp = (p.y - Dy_BF) / M_BF;\n var z_tmp = (p.z - Dz_BF) / M_BF;\n //if( x[io] === HUGE_VAL )\n // continue;\n\n return {\n x: x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp,\n y: -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp,\n z: Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp\n };\n } //cs_geocentric_from_wgs84()\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/datumUtils.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/datum_transform.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/datum_transform.js ***! + \***************************************************/ +/*! exports provided: default, applyGridShift */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyGridShift\", function() { return applyGridShift; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _datumUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./datumUtils */ \"./node_modules/proj4/lib/datumUtils.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\n\nfunction checkParams(type) {\n return (type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"] || type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(source, dest, point) {\n // Short cut if the datums are identical.\n if (Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"compareDatums\"])(source, dest)) {\n return point; // in this case, zero is sucess,\n // whereas cs_compare_datums returns 1 to indicate TRUE\n // confusing, should fix this\n }\n\n // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest\n if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_NODATUM\"] || dest.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_NODATUM\"]) {\n return point;\n }\n\n // If this datum requires grid shifts, then apply it to geodetic coordinates.\n var source_a = source.a;\n var source_es = source.es;\n if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"]) {\n var gridShiftCode = applyGridShift(source, false, point);\n if (gridShiftCode !== 0) {\n return undefined;\n }\n source_a = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_SEMIMAJOR\"];\n source_es = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_ESQUARED\"];\n }\n\n var dest_a = dest.a;\n var dest_b = dest.b;\n var dest_es = dest.es;\n if (dest.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"]) {\n dest_a = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_SEMIMAJOR\"];\n dest_b = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_SEMIMINOR\"];\n dest_es = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_ESQUARED\"];\n }\n\n // Do we need to go through geocentric coordinates?\n if (source_es === dest_es && source_a === dest_a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) {\n return point;\n }\n\n // Convert to geocentric coordinates.\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geodeticToGeocentric\"])(point, source_es, source_a);\n // Convert between datums\n if (checkParams(source.datum_type)) {\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geocentricToWgs84\"])(point, source.datum_type, source.datum_params);\n }\n if (checkParams(dest.datum_type)) {\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geocentricFromWgs84\"])(point, dest.datum_type, dest.datum_params);\n }\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geocentricToGeodetic\"])(point, dest_es, dest_a, dest_b);\n\n if (dest.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"]) {\n var destGridShiftResult = applyGridShift(dest, true, point);\n if (destGridShiftResult !== 0) {\n return undefined;\n }\n }\n\n return point;\n});\n\nfunction applyGridShift(source, inverse, point) {\n if (source.grids === null || source.grids.length === 0) {\n console.log('Grid shift grids not found');\n return -1;\n }\n var input = {x: -point.x, y: point.y};\n var output = {x: Number.NaN, y: Number.NaN};\n var onlyMandatoryGrids = false;\n var attemptedGrids = [];\n for (var i = 0; i < source.grids.length; i++) {\n var grid = source.grids[i];\n attemptedGrids.push(grid.name);\n if (grid.isNull) {\n output = input;\n break;\n }\n onlyMandatoryGrids = grid.mandatory;\n if (grid.grid === null) {\n if (grid.mandatory) {\n console.log(\"Unable to find mandatory grid '\" + grid.name + \"'\");\n return -1;\n }\n continue;\n }\n var subgrid = grid.grid.subgrids[0];\n // skip tables that don't match our point at all\n var epsilon = (Math.abs(subgrid.del[1]) + Math.abs(subgrid.del[0])) / 10000.0;\n var minX = subgrid.ll[0] - epsilon;\n var minY = subgrid.ll[1] - epsilon;\n var maxX = subgrid.ll[0] + (subgrid.lim[0] - 1) * subgrid.del[0] + epsilon;\n var maxY = subgrid.ll[1] + (subgrid.lim[1] - 1) * subgrid.del[1] + epsilon;\n if (minY > input.y || minX > input.x || maxY < input.y || maxX < input.x ) {\n continue;\n }\n output = applySubgridShift(input, inverse, subgrid);\n if (!isNaN(output.x)) {\n break;\n }\n }\n if (isNaN(output.x)) {\n console.log(\"Failed to find a grid shift table for location '\"+\n -input.x * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"] + \" \" + input.y * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"] + \" tried: '\" + attemptedGrids + \"'\");\n return -1;\n }\n point.x = -output.x;\n point.y = output.y;\n return 0;\n}\n\nfunction applySubgridShift(pin, inverse, ct) {\n var val = {x: Number.NaN, y: Number.NaN};\n if (isNaN(pin.x)) { return val; }\n var tb = {x: pin.x, y: pin.y};\n tb.x -= ct.ll[0];\n tb.y -= ct.ll[1];\n tb.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(tb.x - Math.PI) + Math.PI;\n var t = nadInterpolate(tb, ct);\n if (inverse) {\n if (isNaN(t.x)) {\n return val;\n }\n t.x = tb.x - t.x;\n t.y = tb.y - t.y;\n var i = 9, tol = 1e-12;\n var dif, del;\n do {\n del = nadInterpolate(t, ct);\n if (isNaN(del.x)) {\n console.log(\"Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.\");\n break;\n }\n dif = {x: tb.x - (del.x + t.x), y: tb.y - (del.y + t.y)};\n t.x += dif.x;\n t.y += dif.y;\n } while (i-- && Math.abs(dif.x) > tol && Math.abs(dif.y) > tol);\n if (i < 0) {\n console.log(\"Inverse grid shift iterator failed to converge.\");\n return val;\n }\n val.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(t.x + ct.ll[0]);\n val.y = t.y + ct.ll[1];\n } else {\n if (!isNaN(t.x)) {\n val.x = pin.x + t.x;\n val.y = pin.y + t.y;\n }\n }\n return val;\n}\n\nfunction nadInterpolate(pin, ct) {\n var t = {x: pin.x / ct.del[0], y: pin.y / ct.del[1]};\n var indx = {x: Math.floor(t.x), y: Math.floor(t.y)};\n var frct = {x: t.x - 1.0 * indx.x, y: t.y - 1.0 * indx.y};\n var val= {x: Number.NaN, y: Number.NaN};\n var inx;\n if (indx.x < 0 || indx.x >= ct.lim[0]) {\n return val;\n }\n if (indx.y < 0 || indx.y >= ct.lim[1]) {\n return val;\n }\n inx = (indx.y * ct.lim[0]) + indx.x;\n var f00 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx++;\n var f10= {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx += ct.lim[0];\n var f11 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx--;\n var f01 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n var m11 = frct.x * frct.y, m10 = frct.x * (1.0 - frct.y),\n m00 = (1.0 - frct.x) * (1.0 - frct.y), m01 = (1.0 - frct.x) * frct.y;\n val.x = (m00 * f00.x + m10 * f10.x + m01 * f01.x + m11 * f11.x);\n val.y = (m00 * f00.y + m10 * f10.y + m01 * f01.y + m11 * f11.y);\n return val;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/datum_transform.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/defs.js": +/*!****************************************!*\ + !*** ./node_modules/proj4/lib/defs.js ***! + \****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global */ \"./node_modules/proj4/lib/global.js\");\n/* harmony import */ var _projString__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./projString */ \"./node_modules/proj4/lib/projString.js\");\n/* harmony import */ var wkt_parser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! wkt-parser */ \"./node_modules/wkt-parser/index.js\");\n\n\n\n\nfunction defs(name) {\n /*global console*/\n var that = this;\n if (arguments.length === 2) {\n var def = arguments[1];\n if (typeof def === 'string') {\n if (def.charAt(0) === '+') {\n defs[name] = Object(_projString__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arguments[1]);\n }\n else {\n defs[name] = Object(wkt_parser__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(arguments[1]);\n }\n } else {\n defs[name] = def;\n }\n }\n else if (arguments.length === 1) {\n if (Array.isArray(name)) {\n return name.map(function(v) {\n if (Array.isArray(v)) {\n defs.apply(that, v);\n }\n else {\n defs(v);\n }\n });\n }\n else if (typeof name === 'string') {\n if (name in defs) {\n return defs[name];\n }\n }\n else if ('EPSG' in name) {\n defs['EPSG:' + name.EPSG] = name;\n }\n else if ('ESRI' in name) {\n defs['ESRI:' + name.ESRI] = name;\n }\n else if ('IAU2000' in name) {\n defs['IAU2000:' + name.IAU2000] = name;\n }\n else {\n console.log(name);\n }\n return;\n }\n\n\n}\nObject(_global__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(defs);\n/* harmony default export */ __webpack_exports__[\"default\"] = (defs);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/defs.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/deriveConstants.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/deriveConstants.js ***! + \***************************************************/ +/*! exports provided: eccentricity, sphere */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"eccentricity\", function() { return eccentricity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sphere\", function() { return sphere; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _constants_Ellipsoid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants/Ellipsoid */ \"./node_modules/proj4/lib/constants/Ellipsoid.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n\n\n\n\nfunction eccentricity(a, b, rf, R_A) {\n var a2 = a * a; // used in geocentric\n var b2 = b * b; // used in geocentric\n var es = (a2 - b2) / a2; // e ^ 2\n var e = 0;\n if (R_A) {\n a *= 1 - es * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SIXTH\"] + es * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"RA4\"] + es * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"RA6\"]));\n a2 = a * a;\n es = 0;\n } else {\n e = Math.sqrt(es); // eccentricity\n }\n var ep2 = (a2 - b2) / b2; // used in geocentric\n return {\n es: es,\n e: e,\n ep2: ep2\n };\n}\nfunction sphere(a, b, rf, ellps, sphere) {\n if (!a) { // do we have an ellipsoid?\n var ellipse = Object(_match__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_constants_Ellipsoid__WEBPACK_IMPORTED_MODULE_1__[\"default\"], ellps);\n if (!ellipse) {\n ellipse = _constants_Ellipsoid__WEBPACK_IMPORTED_MODULE_1__[\"WGS84\"];\n }\n a = ellipse.a;\n b = ellipse.b;\n rf = ellipse.rf;\n }\n\n if (rf && !b) {\n b = (1.0 - 1.0 / rf) * a;\n }\n if (rf === 0 || Math.abs(a - b) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n sphere = true;\n b = a;\n }\n return {\n a: a,\n b: b,\n rf: rf,\n sphere: sphere\n };\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/deriveConstants.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/extend.js": +/*!******************************************!*\ + !*** ./node_modules/proj4/lib/extend.js ***! + \******************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(destination, source) {\n destination = destination || {};\n var value, property;\n if (!source) {\n return destination;\n }\n for (property in source) {\n value = source[property];\n if (value !== undefined) {\n destination[property] = value;\n }\n }\n return destination;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/extend.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/global.js": +/*!******************************************!*\ + !*** ./node_modules/proj4/lib/global.js ***! + \******************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(defs) {\n defs('EPSG:4326', \"+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees\");\n defs('EPSG:4269', \"+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees\");\n defs('EPSG:3857', \"+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs\");\n\n defs.WGS84 = defs['EPSG:4326'];\n defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857\n defs.GOOGLE = defs['EPSG:3857'];\n defs['EPSG:900913'] = defs['EPSG:3857'];\n defs['EPSG:102113'] = defs['EPSG:3857'];\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/global.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/index.js": +/*!*****************************************!*\ + !*** ./node_modules/proj4/lib/index.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core */ \"./node_modules/proj4/lib/core.js\");\n/* harmony import */ var _Proj__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Proj */ \"./node_modules/proj4/lib/Proj.js\");\n/* harmony import */ var _Point__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Point */ \"./node_modules/proj4/lib/Point.js\");\n/* harmony import */ var _common_toPoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./common/toPoint */ \"./node_modules/proj4/lib/common/toPoint.js\");\n/* harmony import */ var _defs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defs */ \"./node_modules/proj4/lib/defs.js\");\n/* harmony import */ var _nadgrid__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./nadgrid */ \"./node_modules/proj4/lib/nadgrid.js\");\n/* harmony import */ var _transform__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./transform */ \"./node_modules/proj4/lib/transform.js\");\n/* harmony import */ var mgrs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! mgrs */ \"./node_modules/mgrs/mgrs.js\");\n/* harmony import */ var _projs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../projs */ \"./node_modules/proj4/projs.js\");\n\n\n\n\n\n\n\n\n\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].defaultDatum = 'WGS84'; //default datum\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Proj = _Proj__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].WGS84 = new _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Proj('WGS84');\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Point = _Point__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toPoint = _common_toPoint__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].defs = _defs__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].nadgrid = _nadgrid__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].transform = _transform__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].mgrs = mgrs__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].version = '__VERSION__';\nObject(_projs__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/index.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/match.js": +/*!*****************************************!*\ + !*** ./node_modules/proj4/lib/match.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return match; });\nvar ignoredChar = /[\\s_\\-\\/\\(\\)]/g;\nfunction match(obj, key) {\n if (obj[key]) {\n return obj[key];\n }\n var keys = Object.keys(obj);\n var lkey = key.toLowerCase().replace(ignoredChar, '');\n var i = -1;\n var testkey, processedKey;\n while (++i < keys.length) {\n testkey = keys[i];\n processedKey = testkey.toLowerCase().replace(ignoredChar, '');\n if (processedKey === lkey) {\n return obj[testkey];\n }\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/match.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/nadgrid.js": +/*!*******************************************!*\ + !*** ./node_modules/proj4/lib/nadgrid.js ***! + \*******************************************/ +/*! exports provided: default, getNadgrids */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return nadgrid; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNadgrids\", function() { return getNadgrids; });\n/**\n * Resources for details of NTv2 file formats:\n * - https://web.archive.org/web/20140127204822if_/http://www.mgs.gov.on.ca:80/stdprodconsume/groups/content/@mgs/@iandit/documents/resourcelist/stel02_047447.pdf\n * - http://mimaka.com/help/gs/html/004_NTV2%20Data%20Format.htm\n */\n\nvar loadedNadgrids = {};\n\n/**\n * Load a binary NTv2 file (.gsb) to a key that can be used in a proj string like +nadgrids=. Pass the NTv2 file\n * as an ArrayBuffer.\n */\nfunction nadgrid(key, data) {\n var view = new DataView(data);\n var isLittleEndian = detectLittleEndian(view);\n var header = readHeader(view, isLittleEndian);\n if (header.nSubgrids > 1) {\n console.log('Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored');\n }\n var subgrids = readSubgrids(view, header, isLittleEndian);\n var nadgrid = {header: header, subgrids: subgrids};\n loadedNadgrids[key] = nadgrid;\n return nadgrid;\n}\n\n/**\n * Given a proj4 value for nadgrids, return an array of loaded grids\n */\nfunction getNadgrids(nadgrids) {\n // Format details: http://proj.maptools.org/gen_parms.html\n if (nadgrids === undefined) { return null; }\n var grids = nadgrids.split(',');\n return grids.map(parseNadgridString);\n}\n\nfunction parseNadgridString(value) {\n if (value.length === 0) {\n return null;\n }\n var optional = value[0] === '@';\n if (optional) {\n value = value.slice(1);\n }\n if (value === 'null') {\n return {name: 'null', mandatory: !optional, grid: null, isNull: true};\n }\n return {\n name: value,\n mandatory: !optional,\n grid: loadedNadgrids[value] || null,\n isNull: false\n };\n}\n\nfunction secondsToRadians(seconds) {\n return (seconds / 3600) * Math.PI / 180;\n}\n\nfunction detectLittleEndian(view) {\n var nFields = view.getInt32(8, false);\n if (nFields === 11) {\n return false;\n }\n nFields = view.getInt32(8, true);\n if (nFields !== 11) {\n console.warn('Failed to detect nadgrid endian-ness, defaulting to little-endian');\n }\n return true;\n}\n\nfunction readHeader(view, isLittleEndian) {\n return {\n nFields: view.getInt32(8, isLittleEndian),\n nSubgridFields: view.getInt32(24, isLittleEndian),\n nSubgrids: view.getInt32(40, isLittleEndian),\n shiftType: decodeString(view, 56, 56 + 8).trim(),\n fromSemiMajorAxis: view.getFloat64(120, isLittleEndian),\n fromSemiMinorAxis: view.getFloat64(136, isLittleEndian),\n toSemiMajorAxis: view.getFloat64(152, isLittleEndian),\n toSemiMinorAxis: view.getFloat64(168, isLittleEndian),\n };\n}\n\nfunction decodeString(view, start, end) {\n return String.fromCharCode.apply(null, new Uint8Array(view.buffer.slice(start, end)));\n}\n\nfunction readSubgrids(view, header, isLittleEndian) {\n var gridOffset = 176;\n var grids = [];\n for (var i = 0; i < header.nSubgrids; i++) {\n var subHeader = readGridHeader(view, gridOffset, isLittleEndian);\n var nodes = readGridNodes(view, gridOffset, subHeader, isLittleEndian);\n var lngColumnCount = Math.round(\n 1 + (subHeader.upperLongitude - subHeader.lowerLongitude) / subHeader.longitudeInterval);\n var latColumnCount = Math.round(\n 1 + (subHeader.upperLatitude - subHeader.lowerLatitude) / subHeader.latitudeInterval);\n // Proj4 operates on radians whereas the coordinates are in seconds in the grid\n grids.push({\n ll: [secondsToRadians(subHeader.lowerLongitude), secondsToRadians(subHeader.lowerLatitude)],\n del: [secondsToRadians(subHeader.longitudeInterval), secondsToRadians(subHeader.latitudeInterval)],\n lim: [lngColumnCount, latColumnCount],\n count: subHeader.gridNodeCount,\n cvs: mapNodes(nodes)\n });\n }\n return grids;\n}\n\nfunction mapNodes(nodes) {\n return nodes.map(function (r) {return [secondsToRadians(r.longitudeShift), secondsToRadians(r.latitudeShift)];});\n}\n\nfunction readGridHeader(view, offset, isLittleEndian) {\n return {\n name: decodeString(view, offset + 8, offset + 16).trim(),\n parent: decodeString(view, offset + 24, offset + 24 + 8).trim(),\n lowerLatitude: view.getFloat64(offset + 72, isLittleEndian),\n upperLatitude: view.getFloat64(offset + 88, isLittleEndian),\n lowerLongitude: view.getFloat64(offset + 104, isLittleEndian),\n upperLongitude: view.getFloat64(offset + 120, isLittleEndian),\n latitudeInterval: view.getFloat64(offset + 136, isLittleEndian),\n longitudeInterval: view.getFloat64(offset + 152, isLittleEndian),\n gridNodeCount: view.getInt32(offset + 168, isLittleEndian)\n };\n}\n\nfunction readGridNodes(view, offset, gridHeader, isLittleEndian) {\n var nodesOffset = offset + 176;\n var gridRecordLength = 16;\n var gridShiftRecords = [];\n for (var i = 0; i < gridHeader.gridNodeCount; i++) {\n var record = {\n latitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength, isLittleEndian),\n longitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength + 4, isLittleEndian),\n latitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 8, isLittleEndian),\n longitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 12, isLittleEndian),\n };\n gridShiftRecords.push(record);\n }\n return gridShiftRecords;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/nadgrid.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/parseCode.js": +/*!*********************************************!*\ + !*** ./node_modules/proj4/lib/parseCode.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _defs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defs */ \"./node_modules/proj4/lib/defs.js\");\n/* harmony import */ var wkt_parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! wkt-parser */ \"./node_modules/wkt-parser/index.js\");\n/* harmony import */ var _projString__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./projString */ \"./node_modules/proj4/lib/projString.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n\n\n\n\nfunction testObj(code){\n return typeof code === 'string';\n}\nfunction testDef(code){\n return code in _defs__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n}\nvar codeWords = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS','GEOCCS','PROJCS','LOCAL_CS', 'GEODCRS', 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS'];\nfunction testWKT(code){\n return codeWords.some(function (word) {\n return code.indexOf(word) > -1;\n });\n}\nvar codes = ['3857', '900913', '3785', '102113'];\nfunction checkMercator(item) {\n var auth = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(item, 'authority');\n if (!auth) {\n return;\n }\n var code = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(auth, 'epsg');\n return code && codes.indexOf(code) > -1;\n}\nfunction checkProjStr(item) {\n var ext = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(item, 'extension');\n if (!ext) {\n return;\n }\n return Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(ext, 'proj4');\n}\nfunction testProj(code){\n return code[0] === '+';\n}\nfunction parse(code){\n if (testObj(code)) {\n //check to see if this is a WKT string\n if (testDef(code)) {\n return _defs__WEBPACK_IMPORTED_MODULE_0__[\"default\"][code];\n }\n if (testWKT(code)) {\n var out = Object(wkt_parser__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(code);\n // test of spetial case, due to this being a very common and often malformed\n if (checkMercator(out)) {\n return _defs__WEBPACK_IMPORTED_MODULE_0__[\"default\"]['EPSG:3857'];\n }\n var maybeProjStr = checkProjStr(out);\n if (maybeProjStr) {\n return Object(_projString__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(maybeProjStr);\n }\n return out;\n }\n if (testProj(code)) {\n return Object(_projString__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(code);\n }\n }else{\n return code;\n }\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (parse);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/parseCode.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projString.js": +/*!**********************************************!*\ + !*** ./node_modules/proj4/lib/projString.js ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _constants_PrimeMeridian__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants/PrimeMeridian */ \"./node_modules/proj4/lib/constants/PrimeMeridian.js\");\n/* harmony import */ var _constants_units__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants/units */ \"./node_modules/proj4/lib/constants/units.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(defData) {\n var self = {};\n var paramObj = defData.split('+').map(function(v) {\n return v.trim();\n }).filter(function(a) {\n return a;\n }).reduce(function(p, a) {\n var split = a.split('=');\n split.push(true);\n p[split[0].toLowerCase()] = split[1];\n return p;\n }, {});\n var paramName, paramVal, paramOutname;\n var params = {\n proj: 'projName',\n datum: 'datumCode',\n rf: function(v) {\n self.rf = parseFloat(v);\n },\n lat_0: function(v) {\n self.lat0 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lat_1: function(v) {\n self.lat1 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lat_2: function(v) {\n self.lat2 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lat_ts: function(v) {\n self.lat_ts = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lon_0: function(v) {\n self.long0 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lon_1: function(v) {\n self.long1 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lon_2: function(v) {\n self.long2 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n alpha: function(v) {\n self.alpha = parseFloat(v) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lonc: function(v) {\n self.longc = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n x_0: function(v) {\n self.x0 = parseFloat(v);\n },\n y_0: function(v) {\n self.y0 = parseFloat(v);\n },\n k_0: function(v) {\n self.k0 = parseFloat(v);\n },\n k: function(v) {\n self.k0 = parseFloat(v);\n },\n a: function(v) {\n self.a = parseFloat(v);\n },\n b: function(v) {\n self.b = parseFloat(v);\n },\n r_a: function() {\n self.R_A = true;\n },\n zone: function(v) {\n self.zone = parseInt(v, 10);\n },\n south: function() {\n self.utmSouth = true;\n },\n towgs84: function(v) {\n self.datum_params = v.split(\",\").map(function(a) {\n return parseFloat(a);\n });\n },\n to_meter: function(v) {\n self.to_meter = parseFloat(v);\n },\n units: function(v) {\n self.units = v;\n var unit = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_constants_units__WEBPACK_IMPORTED_MODULE_2__[\"default\"], v);\n if (unit) {\n self.to_meter = unit.to_meter;\n }\n },\n from_greenwich: function(v) {\n self.from_greenwich = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n pm: function(v) {\n var pm = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_constants_PrimeMeridian__WEBPACK_IMPORTED_MODULE_1__[\"default\"], v);\n self.from_greenwich = (pm ? pm : parseFloat(v)) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n nadgrids: function(v) {\n if (v === '@null') {\n self.datumCode = 'none';\n }\n else {\n self.nadgrids = v;\n }\n },\n axis: function(v) {\n var legalAxis = \"ewnsud\";\n if (v.length === 3 && legalAxis.indexOf(v.substr(0, 1)) !== -1 && legalAxis.indexOf(v.substr(1, 1)) !== -1 && legalAxis.indexOf(v.substr(2, 1)) !== -1) {\n self.axis = v;\n }\n },\n approx: function() {\n self.approx = true;\n }\n };\n for (paramName in paramObj) {\n paramVal = paramObj[paramName];\n if (paramName in params) {\n paramOutname = params[paramName];\n if (typeof paramOutname === 'function') {\n paramOutname(paramVal);\n }\n else {\n self[paramOutname] = paramVal;\n }\n }\n else {\n self[paramName] = paramVal;\n }\n }\n if(typeof self.datumCode === 'string' && self.datumCode !== \"WGS84\"){\n self.datumCode = self.datumCode.toLowerCase();\n }\n return self;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projString.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/projections.js ***! + \***********************************************/ +/*! exports provided: add, get, start, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"start\", function() { return start; });\n/* harmony import */ var _projections_merc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./projections/merc */ \"./node_modules/proj4/lib/projections/merc.js\");\n/* harmony import */ var _projections_longlat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./projections/longlat */ \"./node_modules/proj4/lib/projections/longlat.js\");\n\n\nvar projs = [_projections_merc__WEBPACK_IMPORTED_MODULE_0__[\"default\"], _projections_longlat__WEBPACK_IMPORTED_MODULE_1__[\"default\"]];\nvar names = {};\nvar projStore = [];\n\nfunction add(proj, i) {\n var len = projStore.length;\n if (!proj.names) {\n console.log(i);\n return true;\n }\n projStore[len] = proj;\n proj.names.forEach(function(n) {\n names[n.toLowerCase()] = len;\n });\n return this;\n}\n\n\n\nfunction get(name) {\n if (!name) {\n return false;\n }\n var n = name.toLowerCase();\n if (typeof names[n] !== 'undefined' && projStore[names[n]]) {\n return projStore[names[n]];\n }\n}\n\nfunction start() {\n projs.forEach(add);\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n start: start,\n add: add,\n get: get\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/aea.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/aea.js ***! + \***************************************************/ +/*! exports provided: init, forward, inverse, phi1z, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"phi1z\", function() { return phi1z; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_qsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/qsfnz */ \"./node_modules/proj4/lib/common/qsfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\nfunction init() {\n\n if (Math.abs(this.lat1 + this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return;\n }\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e3 = Math.sqrt(this.es);\n\n this.sin_po = Math.sin(this.lat1);\n this.cos_po = Math.cos(this.lat1);\n this.t1 = this.sin_po;\n this.con = this.sin_po;\n this.ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n this.qs1 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat2);\n this.cos_po = Math.cos(this.lat2);\n this.t2 = this.sin_po;\n this.ms2 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n this.qs2 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat0);\n this.cos_po = Math.cos(this.lat0);\n this.t3 = this.sin_po;\n this.qs0 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n\n if (Math.abs(this.lat1 - this.lat2) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);\n }\n else {\n this.ns0 = this.con;\n }\n this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;\n this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;\n}\n\n/* Albers Conical Equal Area forward equations--mapping lat,long to x,y\n -------------------------------------------------------------------*/\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n this.sin_phi = Math.sin(lat);\n this.cos_phi = Math.cos(lat);\n\n var qs = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_phi, this.cos_phi);\n var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;\n var theta = this.ns0 * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(lon - this.long0);\n var x = rh1 * Math.sin(theta) + this.x0;\n var y = this.rh - rh1 * Math.cos(theta) + this.y0;\n\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var rh1, qs, con, theta, lon, lat;\n\n p.x -= this.x0;\n p.y = this.rh - p.y + this.y0;\n if (this.ns0 >= 0) {\n rh1 = Math.sqrt(p.x * p.x + p.y * p.y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);\n con = -1;\n }\n theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2(con * p.x, con * p.y);\n }\n con = rh1 * this.ns0 / this.a;\n if (this.sphere) {\n lat = Math.asin((this.c - con * con) / (2 * this.ns0));\n }\n else {\n qs = (this.c - con * con) / this.ns0;\n lat = this.phi1z(this.e3, qs);\n }\n\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(theta / this.ns0 + this.long0);\n p.x = lon;\n p.y = lat;\n return p;\n}\n\n/* Function to compute phi1, the latitude for the inverse of the\n Albers Conical Equal-Area projection.\n-------------------------------------------*/\nfunction phi1z(eccent, qs) {\n var sinphi, cosphi, con, com, dphi;\n var phi = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0.5 * qs);\n if (eccent < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return phi;\n }\n\n var eccnts = eccent * eccent;\n for (var i = 1; i <= 25; i++) {\n sinphi = Math.sin(phi);\n cosphi = Math.cos(phi);\n con = eccent * sinphi;\n com = 1 - con * con;\n dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con)));\n phi = phi + dphi;\n if (Math.abs(dphi) <= 1e-7) {\n return phi;\n }\n }\n return null;\n}\n\nvar names = [\"Albers_Conic_Equal_Area\", \"Albers\", \"aea\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names,\n phi1z: phi1z\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/aea.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/aeqd.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/aeqd.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_gN__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/gN */ \"./node_modules/proj4/lib/common/gN.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _common_imlfn__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/imlfn */ \"./node_modules/proj4/lib/common/imlfn.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n this.sin_p12 = Math.sin(this.lat0);\n this.cos_p12 = Math.cos(this.lat0);\n}\n\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var sinphi = Math.sin(p.y);\n var cosphi = Math.cos(p.y);\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var e0, e1, e2, e3, Mlp, Ml, tanphi, Nl1, Nl, psi, Az, G, H, GH, Hs, c, kp, cos_c, s, s2, s3, s4, s5;\n if (this.sphere) {\n if (Math.abs(this.sin_p12 - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //North Pole case\n p.x = this.x0 + this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] - lat) * Math.sin(dlon);\n p.y = this.y0 - this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] - lat) * Math.cos(dlon);\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //South Pole case\n p.x = this.x0 + this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] + lat) * Math.sin(dlon);\n p.y = this.y0 + this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] + lat) * Math.cos(dlon);\n return p;\n }\n else {\n //default case\n cos_c = this.sin_p12 * sinphi + this.cos_p12 * cosphi * Math.cos(dlon);\n c = Math.acos(cos_c);\n kp = c ? c / Math.sin(c) : 1;\n p.x = this.x0 + this.a * kp * cosphi * Math.sin(dlon);\n p.y = this.y0 + this.a * kp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * Math.cos(dlon));\n return p;\n }\n }\n else {\n e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.es);\n e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.es);\n e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.es);\n if (Math.abs(this.sin_p12 - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //North Pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n Ml = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, lat);\n p.x = this.x0 + (Mlp - Ml) * Math.sin(dlon);\n p.y = this.y0 - (Mlp - Ml) * Math.cos(dlon);\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //South Pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n Ml = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, lat);\n p.x = this.x0 + (Mlp + Ml) * Math.sin(dlon);\n p.y = this.y0 + (Mlp + Ml) * Math.cos(dlon);\n return p;\n }\n else {\n //Default case\n tanphi = sinphi / cosphi;\n Nl1 = Object(_common_gN__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.a, this.e, this.sin_p12);\n Nl = Object(_common_gN__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.a, this.e, sinphi);\n psi = Math.atan((1 - this.es) * tanphi + this.es * Nl1 * this.sin_p12 / (Nl * cosphi));\n Az = Math.atan2(Math.sin(dlon), this.cos_p12 * Math.tan(psi) - this.sin_p12 * Math.cos(dlon));\n if (Az === 0) {\n s = Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));\n }\n else if (Math.abs(Math.abs(Az) - Math.PI) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n s = -Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));\n }\n else {\n s = Math.asin(Math.sin(dlon) * Math.cos(psi) / Math.sin(Az));\n }\n G = this.e * this.sin_p12 / Math.sqrt(1 - this.es);\n H = this.e * this.cos_p12 * Math.cos(Az) / Math.sqrt(1 - this.es);\n GH = G * H;\n Hs = H * H;\n s2 = s * s;\n s3 = s2 * s;\n s4 = s3 * s;\n s5 = s4 * s;\n c = Nl1 * s * (1 - s2 * Hs * (1 - Hs) / 6 + s3 / 8 * GH * (1 - 2 * Hs) + s4 / 120 * (Hs * (4 - 7 * Hs) - 3 * G * G * (1 - 7 * Hs)) - s5 / 48 * GH);\n p.x = this.x0 + c * Math.sin(Az);\n p.y = this.y0 + c * Math.cos(Az);\n return p;\n }\n }\n\n\n}\n\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var rh, z, sinz, cosz, lon, lat, con, e0, e1, e2, e3, Mlp, M, N1, psi, Az, cosAz, tmp, A, B, D, Ee, F, sinpsi;\n if (this.sphere) {\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (rh > (2 * _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] * this.a)) {\n return;\n }\n z = rh / this.a;\n\n sinz = Math.sin(z);\n cosz = Math.cos(z);\n\n lon = this.long0;\n if (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n lat = this.lat0;\n }\n else {\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(cosz * this.sin_p12 + (p.y * sinz * this.cos_p12) / rh);\n con = Math.abs(this.lat0) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"];\n if (Math.abs(con) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n if (this.lat0 >= 0) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, - p.y));\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 - Math.atan2(-p.x, p.y));\n }\n }\n else {\n /*con = cosz - this.sin_p12 * Math.sin(lat);\n if ((Math.abs(con) < EPSLN) && (Math.abs(p.x) < EPSLN)) {\n //no-op, just keep the lon value as is\n } else {\n var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh));\n lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh)));\n }*/\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));\n }\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.es);\n e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.es);\n e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.es);\n if (Math.abs(this.sin_p12 - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //North pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n M = Mlp - rh;\n lat = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(M / this.a, e0, e1, e2, e3);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, - 1 * p.y));\n p.x = lon;\n p.y = lat;\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //South pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n M = rh - Mlp;\n\n lat = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(M / this.a, e0, e1, e2, e3);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, p.y));\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n //default case\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n Az = Math.atan2(p.x, p.y);\n N1 = Object(_common_gN__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.a, this.e, this.sin_p12);\n cosAz = Math.cos(Az);\n tmp = this.e * this.cos_p12 * cosAz;\n A = -tmp * tmp / (1 - this.es);\n B = 3 * this.es * (1 - A) * this.sin_p12 * this.cos_p12 * cosAz / (1 - this.es);\n D = rh / N1;\n Ee = D - A * (1 + A) * Math.pow(D, 3) / 6 - B * (1 + 3 * A) * Math.pow(D, 4) / 24;\n F = 1 - A * Ee * Ee / 2 - D * Ee * Ee * Ee / 6;\n psi = Math.asin(this.sin_p12 * Math.cos(Ee) + this.cos_p12 * Math.sin(Ee) * cosAz);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.asin(Math.sin(Az) * Math.sin(Ee) / Math.cos(psi)));\n sinpsi = Math.sin(psi);\n lat = Math.atan2((sinpsi - this.es * F * this.sin_p12) * Math.tan(psi), sinpsi * (1 - this.es));\n p.x = lon;\n p.y = lat;\n return p;\n }\n }\n\n}\n\nvar names = [\"Azimuthal_Equidistant\", \"aeqd\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/aeqd.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/cass.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/cass.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_gN__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/gN */ \"./node_modules/proj4/lib/common/gN.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_imlfn__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/imlfn */ \"./node_modules/proj4/lib/common/imlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n if (!this.sphere) {\n this.e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.es);\n this.e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n this.e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n this.e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.es);\n this.ml0 = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat0);\n }\n}\n\n/* Cassini forward equations--mapping lat,long to x,y\n -----------------------------------------------------------------------*/\nfunction forward(p) {\n\n /* Forward equations\n -----------------*/\n var x, y;\n var lam = p.x;\n var phi = p.y;\n lam = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(lam - this.long0);\n\n if (this.sphere) {\n x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));\n y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0);\n }\n else {\n //ellipsoid\n var sinphi = Math.sin(phi);\n var cosphi = Math.cos(phi);\n var nl = Object(_common_gN__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.a, this.e, sinphi);\n var tl = Math.tan(phi) * Math.tan(phi);\n var al = lam * Math.cos(phi);\n var asq = al * al;\n var cl = this.es * cosphi * cosphi / (1 - this.es);\n var ml = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e0, this.e1, this.e2, this.e3, phi);\n\n x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120));\n y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24);\n\n\n }\n\n p.x = x + this.x0;\n p.y = y + this.y0;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var x = p.x / this.a;\n var y = p.y / this.a;\n var phi, lam;\n\n if (this.sphere) {\n var dd = y + this.lat0;\n phi = Math.asin(Math.sin(dd) * Math.cos(x));\n lam = Math.atan2(Math.tan(x), Math.cos(dd));\n }\n else {\n /* ellipsoid */\n var ml1 = this.ml0 / this.a + y;\n var phi1 = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(ml1, this.e0, this.e1, this.e2, this.e3);\n if (Math.abs(Math.abs(phi1) - _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"HALF_PI\"];\n if (y < 0) {\n p.y *= -1;\n }\n return p;\n }\n var nl1 = Object(_common_gN__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.a, this.e, Math.sin(phi1));\n\n var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es);\n var tl1 = Math.pow(Math.tan(phi1), 2);\n var dl = x * this.a / nl1;\n var dsq = dl * dl;\n phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24);\n lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);\n\n }\n\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(lam + this.long0);\n p.y = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(phi);\n return p;\n\n}\n\nvar names = [\"Cassini\", \"Cassini_Soldner\", \"cass\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/cass.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/cea.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/cea.js ***! + \***************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_qsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/qsfnz */ \"./node_modules/proj4/lib/common/qsfnz.js\");\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_iqsfnz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/iqsfnz */ \"./node_modules/proj4/lib/common/iqsfnz.js\");\n\n\n\n\n\n/*\n reference:\n \"Cartographic Projection Procedures for the UNIX Environment-\n A User's Manual\" by Gerald I. Evenden,\n USGS Open File Report 90-284and Release 4 Interim Reports (2003)\n*/\nfunction init() {\n //no-op\n if (!this.sphere) {\n this.k0 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n}\n\n/* Cylindrical Equal Area forward equations--mapping lat,long to x,y\n ------------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var x, y;\n /* Forward equations\n -----------------*/\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n if (this.sphere) {\n x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);\n y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);\n }\n else {\n var qs = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, Math.sin(lat));\n x = this.x0 + this.a * this.k0 * dlon;\n y = this.y0 + this.a * qs * 0.5 / this.k0;\n }\n\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Cylindrical Equal Area inverse equations--mapping x,y to lat/long\n ------------------------------------------------------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));\n lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));\n }\n else {\n lat = Object(_common_iqsfnz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, 2 * p.y * this.k0 / this.a);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + p.x / (this.a * this.k0));\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"cea\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/cea.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/eqc.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/eqc.js ***! + \***************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n\n\n\nfunction init() {\n\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.lat0 = this.lat0 || 0;\n this.long0 = this.long0 || 0;\n this.lat_ts = this.lat_ts || 0;\n this.title = this.title || \"Equidistant Cylindrical (Plate Carre)\";\n\n this.rc = Math.cos(this.lat_ts);\n}\n\n// forward equations--mapping lat,long to x,y\n// -----------------------------------------------------------------\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var dlat = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat - this.lat0);\n p.x = this.x0 + (this.a * dlon * this.rc);\n p.y = this.y0 + (this.a * dlat);\n return p;\n}\n\n// inverse equations--mapping x,y to lat/long\n// -----------------------------------------------------------------\nfunction inverse(p) {\n\n var x = p.x;\n var y = p.y;\n\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + ((x - this.x0) / (this.a * this.rc)));\n p.y = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0 + ((y - this.y0) / (this.a)));\n return p;\n}\n\nvar names = [\"Equirectangular\", \"Equidistant_Cylindrical\", \"eqc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/eqc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/eqdc.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/eqdc.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_imlfn__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/imlfn */ \"./node_modules/proj4/lib/common/imlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"EPSLN\"]) {\n return;\n }\n this.lat2 = this.lat2 || this.lat1;\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e = Math.sqrt(this.es);\n this.e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.es);\n this.e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.es);\n this.e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n this.e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n\n this.sinphi = Math.sin(this.lat1);\n this.cosphi = Math.cos(this.lat1);\n\n this.ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, this.sinphi, this.cosphi);\n this.ml1 = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat1);\n\n if (Math.abs(this.lat1 - this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"EPSLN\"]) {\n this.ns = this.sinphi;\n }\n else {\n this.sinphi = Math.sin(this.lat2);\n this.cosphi = Math.cos(this.lat2);\n this.ms2 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, this.sinphi, this.cosphi);\n this.ml2 = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat2);\n this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);\n }\n this.g = this.ml1 + this.ms1 / this.ns;\n this.ml0 = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat0);\n this.rh = this.a * (this.g - this.ml0);\n}\n\n/* Equidistant Conic forward equations--mapping lat,long to x,y\n -----------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var rh1;\n\n /* Forward equations\n -----------------*/\n if (this.sphere) {\n rh1 = this.a * (this.g - lat);\n }\n else {\n var ml = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, lat);\n rh1 = this.a * (this.g - ml);\n }\n var theta = this.ns * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(lon - this.long0);\n var x = this.x0 + rh1 * Math.sin(theta);\n var y = this.y0 + this.rh - rh1 * Math.cos(theta);\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y = this.rh - p.y + this.y0;\n var con, rh1, lat, lon;\n if (this.ns >= 0) {\n rh1 = Math.sqrt(p.x * p.x + p.y * p.y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2(con * p.x, con * p.y);\n }\n\n if (this.sphere) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.long0 + theta / this.ns);\n lat = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.g - rh1 / this.a);\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n var ml = this.g - rh1 / this.a;\n lat = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(ml, this.e0, this.e1, this.e2, this.e3);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.long0 + theta / this.ns);\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n}\n\nvar names = [\"Equidistant_Conic\", \"eqdc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/eqdc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/etmerc.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/etmerc.js ***! + \******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../projections/tmerc */ \"./node_modules/proj4/lib/projections/tmerc.js\");\n/* harmony import */ var _common_sinh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/sinh */ \"./node_modules/proj4/lib/common/sinh.js\");\n/* harmony import */ var _common_hypot__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/hypot */ \"./node_modules/proj4/lib/common/hypot.js\");\n/* harmony import */ var _common_asinhy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/asinhy */ \"./node_modules/proj4/lib/common/asinhy.js\");\n/* harmony import */ var _common_gatg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/gatg */ \"./node_modules/proj4/lib/common/gatg.js\");\n/* harmony import */ var _common_clens__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/clens */ \"./node_modules/proj4/lib/common/clens.js\");\n/* harmony import */ var _common_clens_cmplx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/clens_cmplx */ \"./node_modules/proj4/lib/common/clens_cmplx.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n// Heavily based on this etmerc projection implementation\n// https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/etmerc.js\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n if (!this.approx && (isNaN(this.es) || this.es <= 0)) {\n throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION[\"Fast_Transverse_Mercator\"] in the WKT.');\n }\n if (this.approx) {\n // When '+approx' is set, use tmerc instead\n _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"].init.apply(this);\n this.forward = _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forward;\n this.inverse = _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"].inverse;\n }\n\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n this.cgb = [];\n this.cbg = [];\n this.utg = [];\n this.gtu = [];\n\n var f = this.es / (1 + Math.sqrt(1 - this.es));\n var n = f / (2 - f);\n var np = n;\n\n this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675 ))))));\n this.cbg[0] = n * (-2 + n * ( 2 / 3 + n * ( 4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));\n\n np = np * n;\n this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));\n this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * ( -13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));\n\n np = np * n;\n this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));\n this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));\n\n np = np * n;\n this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));\n this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * ( -24832 / 14175)));\n\n np = np * n;\n this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));\n this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));\n\n np = np * n;\n this.cgb[5] = np * (601676 / 22275);\n this.cbg[5] = np * (444337 / 155925);\n\n np = Math.pow(n, 2);\n this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));\n\n this.utg[0] = n * (-0.5 + n * ( 2 / 3 + n * (-37 / 96 + n * ( 1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));\n this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));\n\n this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));\n this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));\n\n np = np * n;\n this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720 ))));\n this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));\n\n np = np * n;\n this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));\n this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));\n\n np = np * n;\n this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));\n this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));\n\n np = np * n;\n this.utg[5] = np * (-20648693 / 638668800);\n this.gtu[5] = np * (212378941 / 319334400);\n\n var Z = Object(_common_gatg__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.cbg, this.lat0);\n this.Zb = -this.Qn * (Z + Object(_common_clens__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.gtu, 2 * Z));\n}\n\nfunction forward(p) {\n var Ce = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(p.x - this.long0);\n var Cn = p.y;\n\n Cn = Object(_common_gatg__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.cbg, Cn);\n var sin_Cn = Math.sin(Cn);\n var cos_Cn = Math.cos(Cn);\n var sin_Ce = Math.sin(Ce);\n var cos_Ce = Math.cos(Ce);\n\n Cn = Math.atan2(sin_Cn, cos_Ce * cos_Cn);\n Ce = Math.atan2(sin_Ce * cos_Cn, Object(_common_hypot__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(sin_Cn, cos_Cn * cos_Ce));\n Ce = Object(_common_asinhy__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(Math.tan(Ce));\n\n var tmp = Object(_common_clens_cmplx__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.gtu, 2 * Cn, 2 * Ce);\n\n Cn = Cn + tmp[0];\n Ce = Ce + tmp[1];\n\n var x;\n var y;\n\n if (Math.abs(Ce) <= 2.623395162778) {\n x = this.a * (this.Qn * Ce) + this.x0;\n y = this.a * (this.Qn * Cn + this.Zb) + this.y0;\n }\n else {\n x = Infinity;\n y = Infinity;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n}\n\nfunction inverse(p) {\n var Ce = (p.x - this.x0) * (1 / this.a);\n var Cn = (p.y - this.y0) * (1 / this.a);\n\n Cn = (Cn - this.Zb) / this.Qn;\n Ce = Ce / this.Qn;\n\n var lon;\n var lat;\n\n if (Math.abs(Ce) <= 2.623395162778) {\n var tmp = Object(_common_clens_cmplx__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.utg, 2 * Cn, 2 * Ce);\n\n Cn = Cn + tmp[0];\n Ce = Ce + tmp[1];\n Ce = Math.atan(Object(_common_sinh__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Ce));\n\n var sin_Cn = Math.sin(Cn);\n var cos_Cn = Math.cos(Cn);\n var sin_Ce = Math.sin(Ce);\n var cos_Ce = Math.cos(Ce);\n\n Cn = Math.atan2(sin_Cn * cos_Ce, Object(_common_hypot__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(sin_Ce, cos_Ce * cos_Cn));\n Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);\n\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(Ce + this.long0);\n lat = Object(_common_gatg__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.cgb, Cn);\n }\n else {\n lon = Infinity;\n lat = Infinity;\n }\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}\n\nvar names = [\"Extended_Transverse_Mercator\", \"Extended Transverse Mercator\", \"etmerc\", \"Transverse_Mercator\", \"Transverse Mercator\", \"tmerc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/etmerc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/gauss.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/gauss.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_srat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/srat */ \"./node_modules/proj4/lib/common/srat.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\nvar MAX_ITER = 20;\n\n\nfunction init() {\n var sphi = Math.sin(this.lat0);\n var cphi = Math.cos(this.lat0);\n cphi *= cphi;\n this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi);\n this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es));\n this.phic0 = Math.asin(sphi / this.C);\n this.ratexp = 0.5 * this.C * this.e;\n this.K = Math.tan(0.5 * this.phic0 + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]) / (Math.pow(Math.tan(0.5 * this.lat0 + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]), this.C) * Object(_common_srat__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e * sphi, this.ratexp));\n}\n\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n\n p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]), this.C) * Object(_common_srat__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e * Math.sin(lat), this.ratexp)) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"];\n p.x = this.C * lon;\n return p;\n}\n\nfunction inverse(p) {\n var DEL_TOL = 1e-14;\n var lon = p.x / this.C;\n var lat = p.y;\n var num = Math.pow(Math.tan(0.5 * lat + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]) / this.K, 1 / this.C);\n for (var i = MAX_ITER; i > 0; --i) {\n lat = 2 * Math.atan(num * Object(_common_srat__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e * Math.sin(p.y), - 0.5 * this.e)) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"];\n if (Math.abs(lat - p.y) < DEL_TOL) {\n break;\n }\n p.y = lat;\n }\n /* convergence failed */\n if (!i) {\n return null;\n }\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"gauss\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/gauss.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/geocent.js": +/*!*******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/geocent.js ***! + \*******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _datumUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../datumUtils */ \"./node_modules/proj4/lib/datumUtils.js\");\n\n\nfunction init() {\n this.name = 'geocent';\n\n}\n\nfunction forward(p) {\n var point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_0__[\"geodeticToGeocentric\"])(p, this.es, this.a);\n return point;\n}\n\nfunction inverse(p) {\n var point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_0__[\"geocentricToGeodetic\"])(p, this.es, this.a, this.b);\n return point;\n}\n\nvar names = [\"Geocentric\", 'geocentric', \"geocent\", \"Geocent\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/geocent.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/gnom.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/gnom.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n/*\n reference:\n Wolfram Mathworld \"Gnomonic Projection\"\n http://mathworld.wolfram.com/GnomonicProjection.html\n Accessed: 12th November 2009\n */\nfunction init() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n // Approximation for projecting points to the horizon (infinity)\n this.infinity_dist = 1000 * this.a;\n this.rc = 1;\n}\n\n/* Gnomonic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\nfunction forward(p) {\n var sinphi, cosphi; /* sin and cos value */\n var dlon; /* delta longitude value */\n var coslon; /* cos of longitude */\n var ksp; /* scale factor */\n var g;\n var x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n\n sinphi = Math.sin(lat);\n cosphi = Math.cos(lat);\n\n coslon = Math.cos(dlon);\n g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;\n ksp = 1;\n if ((g > 0) || (Math.abs(g) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"])) {\n x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g;\n y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g;\n }\n else {\n\n // Point is in the opposing hemisphere and is unprojectable\n // We still need to return a reasonable point, so we project\n // to infinity, on a bearing\n // equivalent to the northern hemisphere equivalent\n // This is a reasonable approximation for short shapes and lines that\n // straddle the horizon.\n\n x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon);\n y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);\n\n }\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var rh; /* Rho */\n var sinc, cosc;\n var c;\n var lon, lat;\n\n /* Inverse equations\n -----------------*/\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n p.x /= this.k0;\n p.y /= this.k0;\n\n if ((rh = Math.sqrt(p.x * p.x + p.y * p.y))) {\n c = Math.atan2(rh, this.rc);\n sinc = Math.sin(c);\n cosc = Math.cos(c);\n\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(cosc * this.sin_p14 + (p.y * sinc * this.cos_p14) / rh);\n lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + lon);\n }\n else {\n lat = this.phic0;\n lon = 0;\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"gnom\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/gnom.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/krovak.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/krovak.js ***! + \******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\nfunction init() {\n this.a = 6377397.155;\n this.es = 0.006674372230614;\n this.e = Math.sqrt(this.es);\n if (!this.lat0) {\n this.lat0 = 0.863937979737193;\n }\n if (!this.long0) {\n this.long0 = 0.7417649320975901 - 0.308341501185665;\n }\n /* if scale not set default to 0.9999 */\n if (!this.k0) {\n this.k0 = 0.9999;\n }\n this.s45 = 0.785398163397448; /* 45 */\n this.s90 = 2 * this.s45;\n this.fi0 = this.lat0;\n this.e2 = this.es;\n this.e = Math.sqrt(this.e2);\n this.alfa = Math.sqrt(1 + (this.e2 * Math.pow(Math.cos(this.fi0), 4)) / (1 - this.e2));\n this.uq = 1.04216856380474;\n this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa);\n this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2);\n this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g;\n this.k1 = this.k0;\n this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2));\n this.s0 = 1.37008346281555;\n this.n = Math.sin(this.s0);\n this.ro0 = this.k1 * this.n0 / Math.tan(this.s0);\n this.ad = this.s90 - this.uq;\n}\n\n/* ellipsoid */\n/* calculate xy from lat/lon */\n/* Constants, identical to inverse transform function */\nfunction forward(p) {\n var gfi, u, deltav, s, d, eps, ro;\n var lon = p.x;\n var lat = p.y;\n var delta_lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n /* Transformation */\n gfi = Math.pow(((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat))), (this.alfa * this.e / 2));\n u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);\n deltav = -delta_lon * this.alfa;\n s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav));\n d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s));\n eps = this.n * d;\n ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n);\n p.y = ro * Math.cos(eps) / 1;\n p.x = ro * Math.sin(eps) / 1;\n\n if (!this.czech) {\n p.y *= -1;\n p.x *= -1;\n }\n return (p);\n}\n\n/* calculate lat/lon from xy */\nfunction inverse(p) {\n var u, deltav, s, d, eps, ro, fi1;\n var ok;\n\n /* Transformation */\n /* revert y, x*/\n var tmp = p.x;\n p.x = p.y;\n p.y = tmp;\n if (!this.czech) {\n p.y *= -1;\n p.x *= -1;\n }\n ro = Math.sqrt(p.x * p.x + p.y * p.y);\n eps = Math.atan2(p.y, p.x);\n d = eps / Math.sin(this.s0);\n s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45);\n u = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d));\n deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u));\n p.x = this.long0 - deltav / this.alfa;\n fi1 = u;\n ok = 0;\n var iter = 0;\n do {\n p.y = 2 * (Math.atan(Math.pow(this.k, - 1 / this.alfa) * Math.pow(Math.tan(u / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(fi1)) / (1 - this.e * Math.sin(fi1)), this.e / 2)) - this.s45);\n if (Math.abs(fi1 - p.y) < 0.0000000001) {\n ok = 1;\n }\n fi1 = p.y;\n iter += 1;\n } while (ok === 0 && iter < 15);\n if (iter >= 15) {\n return null;\n }\n\n return (p);\n}\n\nvar names = [\"Krovak\", \"krovak\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/krovak.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/laea.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/laea.js ***! + \****************************************************/ +/*! exports provided: S_POLE, N_POLE, EQUIT, OBLIQ, init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"S_POLE\", function() { return S_POLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"N_POLE\", function() { return N_POLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EQUIT\", function() { return EQUIT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OBLIQ\", function() { return OBLIQ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_qsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/qsfnz */ \"./node_modules/proj4/lib/common/qsfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\n\n\n\n/*\n reference\n \"New Equal-Area Map Projections for Noncircular Regions\", John P. Snyder,\n The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.\n */\n\nvar S_POLE = 1;\n\nvar N_POLE = 2;\nvar EQUIT = 3;\nvar OBLIQ = 4;\n\n/* Initialize the Lambert Azimuthal Equal Area projection\n ------------------------------------------------------*/\nfunction init() {\n var t = Math.abs(this.lat0);\n if (Math.abs(t - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;\n }\n else if (Math.abs(t) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.EQUIT;\n }\n else {\n this.mode = this.OBLIQ;\n }\n if (this.es > 0) {\n var sinphi;\n\n this.qp = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, 1);\n this.mmf = 0.5 / (1 - this.es);\n this.apa = authset(this.es);\n switch (this.mode) {\n case this.N_POLE:\n this.dd = 1;\n break;\n case this.S_POLE:\n this.dd = 1;\n break;\n case this.EQUIT:\n this.rq = Math.sqrt(0.5 * this.qp);\n this.dd = 1 / this.rq;\n this.xmf = 1;\n this.ymf = 0.5 * this.qp;\n break;\n case this.OBLIQ:\n this.rq = Math.sqrt(0.5 * this.qp);\n sinphi = Math.sin(this.lat0);\n this.sinb1 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, sinphi) / this.qp;\n this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);\n this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);\n this.ymf = (this.xmf = this.rq) / this.dd;\n this.xmf *= this.dd;\n break;\n }\n }\n else {\n if (this.mode === this.OBLIQ) {\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n }\n}\n\n/* Lambert Azimuthal Equal Area forward equations--mapping lat,long to x,y\n -----------------------------------------------------------------------*/\nfunction forward(p) {\n\n /* Forward equations\n -----------------*/\n var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;\n var lam = p.x;\n var phi = p.y;\n\n lam = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(lam - this.long0);\n if (this.sphere) {\n sinphi = Math.sin(phi);\n cosphi = Math.cos(phi);\n coslam = Math.cos(lam);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n y = (this.mode === this.EQUIT) ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;\n if (y <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n return null;\n }\n y = Math.sqrt(2 / y);\n x = y * cosphi * Math.sin(lam);\n y *= (this.mode === this.EQUIT) ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;\n }\n else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {\n if (this.mode === this.N_POLE) {\n coslam = -coslam;\n }\n if (Math.abs(phi + this.lat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n return null;\n }\n y = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] - phi * 0.5;\n y = 2 * ((this.mode === this.S_POLE) ? Math.cos(y) : Math.sin(y));\n x = y * Math.sin(lam);\n y *= coslam;\n }\n }\n else {\n sinb = 0;\n cosb = 0;\n b = 0;\n coslam = Math.cos(lam);\n sinlam = Math.sin(lam);\n sinphi = Math.sin(phi);\n q = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, sinphi);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n sinb = q / this.qp;\n cosb = Math.sqrt(1 - sinb * sinb);\n }\n switch (this.mode) {\n case this.OBLIQ:\n b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam;\n break;\n case this.EQUIT:\n b = 1 + cosb * coslam;\n break;\n case this.N_POLE:\n b = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + phi;\n q = this.qp - q;\n break;\n case this.S_POLE:\n b = phi - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n q = this.qp + q;\n break;\n }\n if (Math.abs(b) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n return null;\n }\n switch (this.mode) {\n case this.OBLIQ:\n case this.EQUIT:\n b = Math.sqrt(2 / b);\n if (this.mode === this.OBLIQ) {\n y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam);\n }\n else {\n y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf;\n }\n x = this.xmf * b * cosb * sinlam;\n break;\n case this.N_POLE:\n case this.S_POLE:\n if (q >= 0) {\n x = (b = Math.sqrt(q)) * sinlam;\n y = coslam * ((this.mode === this.S_POLE) ? b : -b);\n }\n else {\n x = y = 0;\n }\n break;\n }\n }\n\n p.x = this.a * x + this.x0;\n p.y = this.a * y + this.y0;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var x = p.x / this.a;\n var y = p.y / this.a;\n var lam, phi, cCe, sCe, q, rho, ab;\n if (this.sphere) {\n var cosz = 0,\n rh, sinz = 0;\n\n rh = Math.sqrt(x * x + y * y);\n phi = rh * 0.5;\n if (phi > 1) {\n return null;\n }\n phi = 2 * Math.asin(phi);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n sinz = Math.sin(phi);\n cosz = Math.cos(phi);\n }\n switch (this.mode) {\n case this.EQUIT:\n phi = (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) ? 0 : Math.asin(y * sinz / rh);\n x *= sinz;\n y = cosz * rh;\n break;\n case this.OBLIQ:\n phi = (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) ? this.lat0 : Math.asin(cosz * this.sinph0 + y * sinz * this.cosph0 / rh);\n x *= sinz * this.cosph0;\n y = (cosz - Math.sin(phi) * this.sinph0) * rh;\n break;\n case this.N_POLE:\n y = -y;\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - phi;\n break;\n case this.S_POLE:\n phi -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n break;\n }\n lam = (y === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ)) ? 0 : Math.atan2(x, y);\n }\n else {\n ab = 0;\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n x /= this.dd;\n y *= this.dd;\n rho = Math.sqrt(x * x + y * y);\n if (rho < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = this.lat0;\n return p;\n }\n sCe = 2 * Math.asin(0.5 * rho / this.rq);\n cCe = Math.cos(sCe);\n x *= (sCe = Math.sin(sCe));\n if (this.mode === this.OBLIQ) {\n ab = cCe * this.sinb1 + y * sCe * this.cosb1 / rho;\n q = this.qp * ab;\n y = rho * this.cosb1 * cCe - y * this.sinb1 * sCe;\n }\n else {\n ab = y * sCe / rho;\n q = this.qp * ab;\n y = rho * cCe;\n }\n }\n else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {\n if (this.mode === this.N_POLE) {\n y = -y;\n }\n q = (x * x + y * y);\n if (!q) {\n p.x = this.long0;\n p.y = this.lat0;\n return p;\n }\n ab = 1 - q / this.qp;\n if (this.mode === this.S_POLE) {\n ab = -ab;\n }\n }\n lam = Math.atan2(x, y);\n phi = authlat(Math.asin(ab), this.apa);\n }\n\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.long0 + lam);\n p.y = phi;\n return p;\n}\n\n/* determine latitude from authalic latitude */\nvar P00 = 0.33333333333333333333;\n\nvar P01 = 0.17222222222222222222;\nvar P02 = 0.10257936507936507936;\nvar P10 = 0.06388888888888888888;\nvar P11 = 0.06640211640211640211;\nvar P20 = 0.01641501294219154443;\n\nfunction authset(es) {\n var t;\n var APA = [];\n APA[0] = es * P00;\n t = es * es;\n APA[0] += t * P01;\n APA[1] = t * P10;\n t *= es;\n APA[0] += t * P02;\n APA[1] += t * P11;\n APA[2] = t * P20;\n return APA;\n}\n\nfunction authlat(beta, APA) {\n var t = beta + beta;\n return (beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t));\n}\n\nvar names = [\"Lambert Azimuthal Equal Area\", \"Lambert_Azimuthal_Equal_Area\", \"laea\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names,\n S_POLE: S_POLE,\n N_POLE: N_POLE,\n EQUIT: EQUIT,\n OBLIQ: OBLIQ\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/laea.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/lcc.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/lcc.js ***! + \***************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_sign__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/sign */ \"./node_modules/proj4/lib/common/sign.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\nfunction init() {\n\n // array of: r_maj,r_min,lat1,lat2,c_lon,c_lat,false_east,false_north\n //double c_lat; /* center latitude */\n //double c_lon; /* center longitude */\n //double lat1; /* first standard parallel */\n //double lat2; /* second standard parallel */\n //double r_maj; /* major axis */\n //double r_min; /* minor axis */\n //double false_east; /* x offset in meters */\n //double false_north; /* y offset in meters */\n\n if (!this.lat2) {\n this.lat2 = this.lat1;\n } //if lat2 is not defined\n if (!this.k0) {\n this.k0 = 1;\n }\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n return;\n }\n\n var temp = this.b / this.a;\n this.e = Math.sqrt(1 - temp * temp);\n\n var sin1 = Math.sin(this.lat1);\n var cos1 = Math.cos(this.lat1);\n var ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, sin1, cos1);\n var ts1 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, this.lat1, sin1);\n\n var sin2 = Math.sin(this.lat2);\n var cos2 = Math.cos(this.lat2);\n var ms2 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, sin2, cos2);\n var ts2 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, this.lat2, sin2);\n\n var ts0 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, this.lat0, Math.sin(this.lat0));\n\n if (Math.abs(this.lat1 - this.lat2) > _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);\n }\n else {\n this.ns = sin1;\n }\n if (isNaN(this.ns)) {\n this.ns = sin1;\n }\n this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));\n this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);\n if (!this.title) {\n this.title = \"Lambert Conformal Conic\";\n }\n}\n\n// Lambert Conformal conic forward equations--mapping lat,long to x,y\n// -----------------------------------------------------------------\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n // singular cases :\n if (Math.abs(2 * Math.abs(lat) - Math.PI) <= _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n lat = Object(_common_sign__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(lat) * (_constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"] - 2 * _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]);\n }\n\n var con = Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"]);\n var ts, rh1;\n if (con > _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n ts = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, lat, Math.sin(lat));\n rh1 = this.a * this.f0 * Math.pow(ts, this.ns);\n }\n else {\n con = lat * this.ns;\n if (con <= 0) {\n return null;\n }\n rh1 = 0;\n }\n var theta = this.ns * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(lon - this.long0);\n p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;\n p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;\n\n return p;\n}\n\n// Lambert Conformal Conic inverse equations--mapping x,y to lat/long\n// -----------------------------------------------------------------\nfunction inverse(p) {\n\n var rh1, con, ts;\n var lat, lon;\n var x = (p.x - this.x0) / this.k0;\n var y = (this.rh - (p.y - this.y0) / this.k0);\n if (this.ns > 0) {\n rh1 = Math.sqrt(x * x + y * y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(x * x + y * y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2((con * x), (con * y));\n }\n if ((rh1 !== 0) || (this.ns > 0)) {\n con = 1 / this.ns;\n ts = Math.pow((rh1 / (this.a * this.f0)), con);\n lat = Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n else {\n lat = -_constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"];\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(theta / this.ns + this.long0);\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Lambert Tangential Conformal Conic Projection\", \"Lambert_Conformal_Conic\", \"Lambert_Conformal_Conic_2SP\", \"lcc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/lcc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/longlat.js": +/*!*******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/longlat.js ***! + \*******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\nfunction init() {\n //no-op for longlat\n}\n\nfunction identity(pt) {\n return pt;\n}\n\n\nvar names = [\"longlat\", \"identity\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: identity,\n inverse: identity,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/longlat.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/merc.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/merc.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\nfunction init() {\n var con = this.b / this.a;\n this.es = 1 - con * con;\n if(!('x0' in this)){\n this.x0 = 0;\n }\n if(!('y0' in this)){\n this.y0 = 0;\n }\n this.e = Math.sqrt(this.es);\n if (this.lat_ts) {\n if (this.sphere) {\n this.k0 = Math.cos(this.lat_ts);\n }\n else {\n this.k0 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n }\n else {\n if (!this.k0) {\n if (this.k) {\n this.k0 = this.k;\n }\n else {\n this.k0 = 1;\n }\n }\n }\n}\n\n/* Mercator forward equations--mapping lat,long to x,y\n --------------------------------------------------*/\n\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n // convert to radians\n if (lat * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] > 90 && lat * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] < -90 && lon * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] > 180 && lon * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] < -180) {\n return null;\n }\n\n var x, y;\n if (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return null;\n }\n else {\n if (this.sphere) {\n x = this.x0 + this.a * this.k0 * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n y = this.y0 + this.a * this.k0 * Math.log(Math.tan(_constants_values__WEBPACK_IMPORTED_MODULE_4__[\"FORTPI\"] + 0.5 * lat));\n }\n else {\n var sinphi = Math.sin(lat);\n var ts = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, lat, sinphi);\n x = this.x0 + this.a * this.k0 * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n y = this.y0 - this.a * this.k0 * Math.log(ts);\n }\n p.x = x;\n p.y = y;\n return p;\n }\n}\n\n/* Mercator inverse equations--mapping x,y to lat/long\n --------------------------------------------------*/\nfunction inverse(p) {\n\n var x = p.x - this.x0;\n var y = p.y - this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lat = _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"] - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));\n }\n else {\n var ts = Math.exp(-y / (this.a * this.k0));\n lat = Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long0 + x / (this.a * this.k0));\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Mercator\", \"Popular Visualisation Pseudo Mercator\", \"Mercator_1SP\", \"Mercator_Auxiliary_Sphere\", \"merc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/merc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/mill.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/mill.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n/*\n reference\n \"New Equal-Area Map Projections for Noncircular Regions\", John P. Snyder,\n The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.\n */\n\n\n/* Initialize the Miller Cylindrical projection\n -------------------------------------------*/\nfunction init() {\n //no-op\n}\n\n/* Miller Cylindrical forward equations--mapping lat,long to x,y\n ------------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var x = this.x0 + this.a * dlon;\n var y = this.y0 + this.a * Math.log(Math.tan((Math.PI / 4) + (lat / 2.5))) * 1.25;\n\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Miller Cylindrical inverse equations--mapping x,y to lat/long\n ------------------------------------------------------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Miller_Cylindrical\", \"mill\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/mill.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/moll.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/moll.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\nfunction init() {}\n\n/* Mollweide forward equations--mapping lat,long to x,y\n ----------------------------------------------------*/\nfunction forward(p) {\n\n /* Forward equations\n -----------------*/\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var theta = lat;\n var con = Math.PI * Math.sin(lat);\n\n /* Iterate using the Newton-Raphson method to find theta\n -----------------------------------------------------*/\n while (true) {\n var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta));\n theta += delta_theta;\n if (Math.abs(delta_theta) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n break;\n }\n }\n theta /= 2;\n\n /* If the latitude is 90 deg, force the x coordinate to be \"0 + false easting\"\n this is done here because of precision problems with \"cos(theta)\"\n --------------------------------------------------------------------------*/\n if (Math.PI / 2 - Math.abs(lat) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n delta_lon = 0;\n }\n var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;\n var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;\n\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var theta;\n var arg;\n\n /* Inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n arg = p.y / (1.4142135623731 * this.a);\n\n /* Because of division by zero problems, 'arg' can not be 1. Therefore\n a number very close to one is used instead.\n -------------------------------------------------------------------*/\n if (Math.abs(arg) > 0.999999999999) {\n arg = 0.999999999999;\n }\n theta = Math.asin(arg);\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta))));\n if (lon < (-Math.PI)) {\n lon = -Math.PI;\n }\n if (lon > Math.PI) {\n lon = Math.PI;\n }\n arg = (2 * theta + Math.sin(2 * theta)) / Math.PI;\n if (Math.abs(arg) > 1) {\n arg = 1;\n }\n var lat = Math.asin(arg);\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Mollweide\", \"moll\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/moll.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/nzmg.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/nzmg.js ***! + \****************************************************/ +/*! exports provided: iterations, init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"iterations\", function() { return iterations; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/*\n reference\n Department of Land and Survey Technical Circular 1973/32\n http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf\n OSG Technical Report 4.1\n http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf\n */\n\n/**\n * iterations: Number of iterations to refine inverse transform.\n * 0 -> km accuracy\n * 1 -> m accuracy -- suitable for most mapping applications\n * 2 -> mm accuracy\n */\nvar iterations = 1;\n\nfunction init() {\n this.A = [];\n this.A[1] = 0.6399175073;\n this.A[2] = -0.1358797613;\n this.A[3] = 0.063294409;\n this.A[4] = -0.02526853;\n this.A[5] = 0.0117879;\n this.A[6] = -0.0055161;\n this.A[7] = 0.0026906;\n this.A[8] = -0.001333;\n this.A[9] = 0.00067;\n this.A[10] = -0.00034;\n\n this.B_re = [];\n this.B_im = [];\n this.B_re[1] = 0.7557853228;\n this.B_im[1] = 0;\n this.B_re[2] = 0.249204646;\n this.B_im[2] = 0.003371507;\n this.B_re[3] = -0.001541739;\n this.B_im[3] = 0.041058560;\n this.B_re[4] = -0.10162907;\n this.B_im[4] = 0.01727609;\n this.B_re[5] = -0.26623489;\n this.B_im[5] = -0.36249218;\n this.B_re[6] = -0.6870983;\n this.B_im[6] = -1.1651967;\n\n this.C_re = [];\n this.C_im = [];\n this.C_re[1] = 1.3231270439;\n this.C_im[1] = 0;\n this.C_re[2] = -0.577245789;\n this.C_im[2] = -0.007809598;\n this.C_re[3] = 0.508307513;\n this.C_im[3] = -0.112208952;\n this.C_re[4] = -0.15094762;\n this.C_im[4] = 0.18200602;\n this.C_re[5] = 1.01418179;\n this.C_im[5] = 1.64497696;\n this.C_re[6] = 1.9660549;\n this.C_im[6] = 2.5127645;\n\n this.D = [];\n this.D[1] = 1.5627014243;\n this.D[2] = 0.5185406398;\n this.D[3] = -0.03333098;\n this.D[4] = -0.1052906;\n this.D[5] = -0.0368594;\n this.D[6] = 0.007317;\n this.D[7] = 0.01220;\n this.D[8] = 0.00394;\n this.D[9] = -0.0013;\n}\n\n/**\n New Zealand Map Grid Forward - long/lat to x/y\n long/lat in radians\n */\nfunction forward(p) {\n var n;\n var lon = p.x;\n var lat = p.y;\n\n var delta_lat = lat - this.lat0;\n var delta_lon = lon - this.long0;\n\n // 1. Calculate d_phi and d_psi ... // and d_lambda\n // For this algorithm, delta_latitude is in seconds of arc x 10-5, so we need to scale to those units. Longitude is radians.\n var d_phi = delta_lat / _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"] * 1E-5;\n var d_lambda = delta_lon;\n var d_phi_n = 1; // d_phi^0\n\n var d_psi = 0;\n for (n = 1; n <= 10; n++) {\n d_phi_n = d_phi_n * d_phi;\n d_psi = d_psi + this.A[n] * d_phi_n;\n }\n\n // 2. Calculate theta\n var th_re = d_psi;\n var th_im = d_lambda;\n\n // 3. Calculate z\n var th_n_re = 1;\n var th_n_im = 0; // theta^0\n var th_n_re1;\n var th_n_im1;\n\n var z_re = 0;\n var z_im = 0;\n for (n = 1; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im;\n z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im;\n }\n\n // 4. Calculate easting and northing\n p.x = (z_im * this.a) + this.x0;\n p.y = (z_re * this.a) + this.y0;\n\n return p;\n}\n\n/**\n New Zealand Map Grid Inverse - x/y to long/lat\n */\nfunction inverse(p) {\n var n;\n var x = p.x;\n var y = p.y;\n\n var delta_x = x - this.x0;\n var delta_y = y - this.y0;\n\n // 1. Calculate z\n var z_re = delta_y / this.a;\n var z_im = delta_x / this.a;\n\n // 2a. Calculate theta - first approximation gives km accuracy\n var z_n_re = 1;\n var z_n_im = 0; // z^0\n var z_n_re1;\n var z_n_im1;\n\n var th_re = 0;\n var th_im = 0;\n for (n = 1; n <= 6; n++) {\n z_n_re1 = z_n_re * z_re - z_n_im * z_im;\n z_n_im1 = z_n_im * z_re + z_n_re * z_im;\n z_n_re = z_n_re1;\n z_n_im = z_n_im1;\n th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;\n th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;\n }\n\n // 2b. Iterate to refine the accuracy of the calculation\n // 0 iterations gives km accuracy\n // 1 iteration gives m accuracy -- good enough for most mapping applications\n // 2 iterations bives mm accuracy\n for (var i = 0; i < this.iterations; i++) {\n var th_n_re = th_re;\n var th_n_im = th_im;\n var th_n_re1;\n var th_n_im1;\n\n var num_re = z_re;\n var num_im = z_im;\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n th_n_re = 1;\n th_n_im = 0;\n var den_re = this.B_re[1];\n var den_im = this.B_im[1];\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n // Complex division\n var den2 = den_re * den_re + den_im * den_im;\n th_re = (num_re * den_re + num_im * den_im) / den2;\n th_im = (num_im * den_re - num_re * den_im) / den2;\n }\n\n // 3. Calculate d_phi ... // and d_lambda\n var d_psi = th_re;\n var d_lambda = th_im;\n var d_psi_n = 1; // d_psi^0\n\n var d_phi = 0;\n for (n = 1; n <= 9; n++) {\n d_psi_n = d_psi_n * d_psi;\n d_phi = d_phi + this.D[n] * d_psi_n;\n }\n\n // 4. Calculate latitude and longitude\n // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.\n var lat = this.lat0 + (d_phi * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"] * 1E5);\n var lon = this.long0 + d_lambda;\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}\n\nvar names = [\"New_Zealand_Map_Grid\", \"nzmg\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/nzmg.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/omerc.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/omerc.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n/* Initialize the Oblique Mercator projection\n ------------------------------------------*/\nfunction init() {\n this.no_off = this.no_off || false;\n this.no_rot = this.no_rot || false;\n\n if (isNaN(this.k0)) {\n this.k0 = 1;\n }\n var sinlat = Math.sin(this.lat0);\n var coslat = Math.cos(this.lat0);\n var con = this.e * sinlat;\n\n this.bl = Math.sqrt(1 + this.es / (1 - this.es) * Math.pow(coslat, 4));\n this.al = this.a * this.bl * this.k0 * Math.sqrt(1 - this.es) / (1 - con * con);\n var t0 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat0, sinlat);\n var dl = this.bl / coslat * Math.sqrt((1 - this.es) / (1 - con * con));\n if (dl * dl < 1) {\n dl = 1;\n }\n var fl;\n var gl;\n if (!isNaN(this.longc)) {\n //Central point and azimuth method\n\n if (this.lat0 >= 0) {\n fl = dl + Math.sqrt(dl * dl - 1);\n }\n else {\n fl = dl - Math.sqrt(dl * dl - 1);\n }\n this.el = fl * Math.pow(t0, this.bl);\n gl = 0.5 * (fl - 1 / fl);\n this.gamma0 = Math.asin(Math.sin(this.alpha) / dl);\n this.long0 = this.longc - Math.asin(gl * Math.tan(this.gamma0)) / this.bl;\n\n }\n else {\n //2 points method\n var t1 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat1, Math.sin(this.lat1));\n var t2 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat2, Math.sin(this.lat2));\n if (this.lat0 >= 0) {\n this.el = (dl + Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n else {\n this.el = (dl - Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n var hl = Math.pow(t1, this.bl);\n var ll = Math.pow(t2, this.bl);\n fl = this.el / hl;\n gl = 0.5 * (fl - 1 / fl);\n var jl = (this.el * this.el - ll * hl) / (this.el * this.el + ll * hl);\n var pl = (ll - hl) / (ll + hl);\n var dlon12 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long1 - this.long2);\n this.long0 = 0.5 * (this.long1 + this.long2) - Math.atan(jl * Math.tan(0.5 * this.bl * (dlon12)) / pl) / this.bl;\n this.long0 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long0);\n var dlon10 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long1 - this.long0);\n this.gamma0 = Math.atan(Math.sin(this.bl * (dlon10)) / gl);\n this.alpha = Math.asin(dl * Math.sin(this.gamma0));\n }\n\n if (this.no_off) {\n this.uc = 0;\n }\n else {\n if (this.lat0 >= 0) {\n this.uc = this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n else {\n this.uc = -1 * this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n }\n\n}\n\n/* Oblique Mercator forward equations--mapping lat,long to x,y\n ----------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n var us, vs;\n var con;\n if (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n if (lat > 0) {\n con = -1;\n }\n else {\n con = 1;\n }\n vs = this.al / this.bl * Math.log(Math.tan(_constants_values__WEBPACK_IMPORTED_MODULE_3__[\"FORTPI\"] + con * this.gamma0 * 0.5));\n us = -1 * con * _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"] * this.al / this.bl;\n }\n else {\n var t = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, lat, Math.sin(lat));\n var ql = this.el / Math.pow(t, this.bl);\n var sl = 0.5 * (ql - 1 / ql);\n var tl = 0.5 * (ql + 1 / ql);\n var vl = Math.sin(this.bl * (dlon));\n var ul = (sl * Math.sin(this.gamma0) - vl * Math.cos(this.gamma0)) / tl;\n if (Math.abs(Math.abs(ul) - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n vs = Number.POSITIVE_INFINITY;\n }\n else {\n vs = 0.5 * this.al * Math.log((1 - ul) / (1 + ul)) / this.bl;\n }\n if (Math.abs(Math.cos(this.bl * (dlon))) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n us = this.al * this.bl * (dlon);\n }\n else {\n us = this.al * Math.atan2(sl * Math.cos(this.gamma0) + vl * Math.sin(this.gamma0), Math.cos(this.bl * dlon)) / this.bl;\n }\n }\n\n if (this.no_rot) {\n p.x = this.x0 + us;\n p.y = this.y0 + vs;\n }\n else {\n\n us -= this.uc;\n p.x = this.x0 + vs * Math.cos(this.alpha) + us * Math.sin(this.alpha);\n p.y = this.y0 + us * Math.cos(this.alpha) - vs * Math.sin(this.alpha);\n }\n return p;\n}\n\nfunction inverse(p) {\n var us, vs;\n if (this.no_rot) {\n vs = p.y - this.y0;\n us = p.x - this.x0;\n }\n else {\n vs = (p.x - this.x0) * Math.cos(this.alpha) - (p.y - this.y0) * Math.sin(this.alpha);\n us = (p.y - this.y0) * Math.cos(this.alpha) + (p.x - this.x0) * Math.sin(this.alpha);\n us += this.uc;\n }\n var qp = Math.exp(-1 * this.bl * vs / this.al);\n var sp = 0.5 * (qp - 1 / qp);\n var tp = 0.5 * (qp + 1 / qp);\n var vp = Math.sin(this.bl * us / this.al);\n var up = (vp * Math.cos(this.gamma0) + sp * Math.sin(this.gamma0)) / tp;\n var ts = Math.pow(this.el / Math.sqrt((1 + up) / (1 - up)), 1 / this.bl);\n if (Math.abs(up - 1) < _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"];\n }\n else if (Math.abs(up + 1) < _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = -1 * _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"];\n }\n else {\n p.y = Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, ts);\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long0 - Math.atan2(sp * Math.cos(this.gamma0) - vp * Math.sin(this.gamma0), Math.cos(this.bl * us / this.al)) / this.bl);\n }\n return p;\n}\n\nvar names = [\"Hotine_Oblique_Mercator\", \"Hotine Oblique Mercator\", \"Hotine_Oblique_Mercator_Azimuth_Natural_Origin\", \"Hotine_Oblique_Mercator_Azimuth_Center\", \"omerc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/omerc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/ortho.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/ortho.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\nfunction init() {\n //double temp; /* temporary variable */\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n}\n\n/* Orthographic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\nfunction forward(p) {\n var sinphi, cosphi; /* sin and cos value */\n var dlon; /* delta longitude value */\n var coslon; /* cos of longitude */\n var ksp; /* scale factor */\n var g, x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n\n sinphi = Math.sin(lat);\n cosphi = Math.cos(lat);\n\n coslon = Math.cos(dlon);\n g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;\n ksp = 1;\n if ((g > 0) || (Math.abs(g) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"])) {\n x = this.a * ksp * cosphi * Math.sin(dlon);\n y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);\n }\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var rh; /* height above ellipsoid */\n var z; /* angle */\n var sinz, cosz; /* sin of z and cos of z */\n var con;\n var lon, lat;\n /* Inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n z = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(rh / this.a);\n\n sinz = Math.sin(z);\n cosz = Math.cos(z);\n\n lon = this.long0;\n if (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"]) {\n lat = this.lat0;\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(cosz * this.sin_p14 + (p.y * sinz * this.cos_p14) / rh);\n con = Math.abs(this.lat0) - _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"HALF_PI\"];\n if (Math.abs(con) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"]) {\n if (this.lat0 >= 0) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, - p.y));\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 - Math.atan2(-p.x, p.y));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"ortho\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/ortho.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/poly.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/poly.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_gN__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/gN */ \"./node_modules/proj4/lib/common/gN.js\");\n\n\n\n\n\n\n\n\n\n\nvar MAX_ITER = 20;\n\nfunction init() {\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2); // devait etre dans tmerc.js mais n y est pas donc je commente sinon retour de valeurs nulles\n this.e = Math.sqrt(this.es);\n this.e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.es);\n this.e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.es);\n this.e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n this.e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n this.ml0 = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat0); //si que des zeros le calcul ne se fait pas\n}\n\n/* Polyconic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var x, y, el;\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(lon - this.long0);\n el = dlon * Math.sin(lat);\n if (this.sphere) {\n if (Math.abs(lat) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n x = this.a * dlon;\n y = -1 * this.a * this.lat0;\n }\n else {\n x = this.a * Math.sin(el) / Math.tan(lat);\n y = this.a * (Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat));\n }\n }\n else {\n if (Math.abs(lat) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n x = this.a * dlon;\n y = -1 * this.ml0;\n }\n else {\n var nl = Object(_common_gN__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(this.a, this.e, Math.sin(lat)) / Math.tan(lat);\n x = nl * Math.sin(el);\n y = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el));\n }\n\n }\n p.x = x + this.x0;\n p.y = y + this.y0;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n var lon, lat, x, y, i;\n var al, bl;\n var phi, dphi;\n x = p.x - this.x0;\n y = p.y - this.y0;\n\n if (this.sphere) {\n if (Math.abs(y + this.a * this.lat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(x / this.a + this.long0);\n lat = 0;\n }\n else {\n al = this.lat0 + y / this.a;\n bl = x * x / this.a / this.a + al * al;\n phi = al;\n var tanphi;\n for (i = MAX_ITER; i; --i) {\n tanphi = Math.tan(phi);\n dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1);\n phi += dphi;\n if (Math.abs(dphi) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lat = phi;\n break;\n }\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.long0 + (Math.asin(x * Math.tan(phi) / this.a)) / Math.sin(lat));\n }\n }\n else {\n if (Math.abs(y + this.ml0) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lat = 0;\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.long0 + x / this.a);\n }\n else {\n\n al = (this.ml0 + y) / this.a;\n bl = x * x / this.a / this.a + al * al;\n phi = al;\n var cl, mln, mlnp, ma;\n var con;\n for (i = MAX_ITER; i; --i) {\n con = this.e * Math.sin(phi);\n cl = Math.sqrt(1 - con * con) * Math.tan(phi);\n mln = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.e0, this.e1, this.e2, this.e3, phi);\n mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi);\n ma = mln / this.a;\n dphi = (al * (cl * ma + 1) - ma - 0.5 * cl * (ma * ma + bl)) / (this.es * Math.sin(2 * phi) * (ma * ma + bl - 2 * al * ma) / (4 * cl) + (al - ma) * (cl * mlnp - 2 / Math.sin(2 * phi)) - mlnp);\n phi -= dphi;\n if (Math.abs(dphi) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lat = phi;\n break;\n }\n }\n\n //lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0);\n cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));\n }\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Polyconic\", \"poly\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/poly.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/qsc.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/qsc.js ***! + \***************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n// QSC projection rewritten from the original PROJ4\n// https://github.com/OSGeo/proj.4/blob/master/src/PJ_qsc.c\n\n\n\n/* constants */\nvar FACE_ENUM = {\n FRONT: 1,\n RIGHT: 2,\n BACK: 3,\n LEFT: 4,\n TOP: 5,\n BOTTOM: 6\n};\n\nvar AREA_ENUM = {\n AREA_0: 1,\n AREA_1: 2,\n AREA_2: 3,\n AREA_3: 4\n};\n\nfunction init() {\n\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.lat0 = this.lat0 || 0;\n this.long0 = this.long0 || 0;\n this.lat_ts = this.lat_ts || 0;\n this.title = this.title || \"Quadrilateralized Spherical Cube\";\n\n /* Determine the cube face from the center of projection. */\n if (this.lat0 >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] / 2.0) {\n this.face = FACE_ENUM.TOP;\n } else if (this.lat0 <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] / 2.0)) {\n this.face = FACE_ENUM.BOTTOM;\n } else if (Math.abs(this.long0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n this.face = FACE_ENUM.FRONT;\n } else if (Math.abs(this.long0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n this.face = this.long0 > 0.0 ? FACE_ENUM.RIGHT : FACE_ENUM.LEFT;\n } else {\n this.face = FACE_ENUM.BACK;\n }\n\n /* Fill in useful values for the ellipsoid <-> sphere shift\n * described in [LK12]. */\n if (this.es !== 0) {\n this.one_minus_f = 1 - (this.a - this.b) / this.a;\n this.one_minus_f_squared = this.one_minus_f * this.one_minus_f;\n }\n}\n\n// QSC forward equations--mapping lat,long to x,y\n// -----------------------------------------------------------------\nfunction forward(p) {\n var xy = {x: 0, y: 0};\n var lat, lon;\n var theta, phi;\n var t, mu;\n /* nu; */\n var area = {value: 0};\n\n // move lon according to projection's lon\n p.x -= this.long0;\n\n /* Convert the geodetic latitude to a geocentric latitude.\n * This corresponds to the shift from the ellipsoid to the sphere\n * described in [LK12]. */\n if (this.es !== 0) {//if (P->es != 0) {\n lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));\n } else {\n lat = p.y;\n }\n\n /* Convert the input lat, lon into theta, phi as used by QSC.\n * This depends on the cube face and the area on it.\n * For the top and bottom face, we can compute theta and phi\n * directly from phi, lam. For the other faces, we must use\n * unit sphere cartesian coordinates as an intermediate step. */\n lon = p.x; //lon = lp.lam;\n if (this.face === FACE_ENUM.TOP) {\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - lat;\n if (lon >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (lon > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] || lon <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_1;\n theta = (lon > 0.0 ? lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (lon > -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) && lon <= -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_2;\n theta = lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = lon;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + lat;\n if (lon >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = -lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (lon < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon >= -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_1;\n theta = -lon;\n } else if (lon < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon >= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_2;\n theta = -lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = (lon > 0.0 ? -lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : -lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n }\n } else {\n var q, r, s;\n var sinlat, coslat;\n var sinlon, coslon;\n\n if (this.face === FACE_ENUM.RIGHT) {\n lon = qsc_shift_lon_origin(lon, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n } else if (this.face === FACE_ENUM.BACK) {\n lon = qsc_shift_lon_origin(lon, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (this.face === FACE_ENUM.LEFT) {\n lon = qsc_shift_lon_origin(lon, -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n }\n sinlat = Math.sin(lat);\n coslat = Math.cos(lat);\n sinlon = Math.sin(lon);\n coslon = Math.cos(lon);\n q = coslat * coslon;\n r = coslat * sinlon;\n s = sinlat;\n\n if (this.face === FACE_ENUM.FRONT) {\n phi = Math.acos(q);\n theta = qsc_fwd_equat_face_theta(phi, s, r, area);\n } else if (this.face === FACE_ENUM.RIGHT) {\n phi = Math.acos(r);\n theta = qsc_fwd_equat_face_theta(phi, s, -q, area);\n } else if (this.face === FACE_ENUM.BACK) {\n phi = Math.acos(-q);\n theta = qsc_fwd_equat_face_theta(phi, s, -r, area);\n } else if (this.face === FACE_ENUM.LEFT) {\n phi = Math.acos(-r);\n theta = qsc_fwd_equat_face_theta(phi, s, q, area);\n } else {\n /* Impossible */\n phi = theta = 0;\n area.value = AREA_ENUM.AREA_0;\n }\n }\n\n /* Compute mu and nu for the area of definition.\n * For mu, see Eq. (3-21) in [OL76], but note the typos:\n * compare with Eq. (3-14). For nu, see Eq. (3-38). */\n mu = Math.atan((12 / _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) * (theta + Math.acos(Math.sin(theta) * Math.cos(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]));\n t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));\n\n /* Apply the result to the real area. */\n if (area.value === AREA_ENUM.AREA_1) {\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (area.value === AREA_ENUM.AREA_2) {\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"];\n } else if (area.value === AREA_ENUM.AREA_3) {\n mu += 1.5 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"];\n }\n\n /* Now compute x, y from mu and nu */\n xy.x = t * Math.cos(mu);\n xy.y = t * Math.sin(mu);\n xy.x = xy.x * this.a + this.x0;\n xy.y = xy.y * this.a + this.y0;\n\n p.x = xy.x;\n p.y = xy.y;\n return p;\n}\n\n// QSC inverse equations--mapping x,y to lat/long\n// -----------------------------------------------------------------\nfunction inverse(p) {\n var lp = {lam: 0, phi: 0};\n var mu, nu, cosmu, tannu;\n var tantheta, theta, cosphi, phi;\n var t;\n var area = {value: 0};\n\n /* de-offset */\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n /* Convert the input x, y to the mu and nu angles as used by QSC.\n * This depends on the area of the cube face. */\n nu = Math.atan(Math.sqrt(p.x * p.x + p.y * p.y));\n mu = Math.atan2(p.y, p.x);\n if (p.x >= 0.0 && p.x >= Math.abs(p.y)) {\n area.value = AREA_ENUM.AREA_0;\n } else if (p.y >= 0.0 && p.y >= Math.abs(p.x)) {\n area.value = AREA_ENUM.AREA_1;\n mu -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (p.x < 0.0 && -p.x >= Math.abs(p.y)) {\n area.value = AREA_ENUM.AREA_2;\n mu = (mu < 0.0 ? mu + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : mu - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else {\n area.value = AREA_ENUM.AREA_3;\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n }\n\n /* Compute phi and theta for the area of definition.\n * The inverse projection is not described in the original paper, but some\n * good hints can be found here (as of 2011-12-14):\n * http://fits.gsfc.nasa.gov/fitsbits/saf.93/saf.9302\n * (search for \"Message-Id: <9302181759.AA25477 at fits.cv.nrao.edu>\") */\n t = (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] / 12) * Math.tan(mu);\n tantheta = Math.sin(t) / (Math.cos(t) - (1 / Math.sqrt(2)));\n theta = Math.atan(tantheta);\n cosmu = Math.cos(mu);\n tannu = Math.tan(nu);\n cosphi = 1 - cosmu * cosmu * tannu * tannu * (1 - Math.cos(Math.atan(1 / Math.cos(theta))));\n if (cosphi < -1) {\n cosphi = -1;\n } else if (cosphi > +1) {\n cosphi = +1;\n }\n\n /* Apply the result to the real area on the cube face.\n * For the top and bottom face, we can compute phi and lam directly.\n * For the other faces, we must use unit sphere cartesian coordinates\n * as an intermediate step. */\n if (this.face === FACE_ENUM.TOP) {\n phi = Math.acos(cosphi);\n lp.phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - phi;\n if (area.value === AREA_ENUM.AREA_0) {\n lp.lam = theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (area.value === AREA_ENUM.AREA_1) {\n lp.lam = (theta < 0.0 ? theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (area.value === AREA_ENUM.AREA_2) {\n lp.lam = theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else /* area.value == AREA_ENUM.AREA_3 */ {\n lp.lam = theta;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = Math.acos(cosphi);\n lp.phi = phi - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n if (area.value === AREA_ENUM.AREA_0) {\n lp.lam = -theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (area.value === AREA_ENUM.AREA_1) {\n lp.lam = -theta;\n } else if (area.value === AREA_ENUM.AREA_2) {\n lp.lam = -theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else /* area.value == AREA_ENUM.AREA_3 */ {\n lp.lam = (theta < 0.0 ? -theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : -theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n }\n } else {\n /* Compute phi and lam via cartesian unit sphere coordinates. */\n var q, r, s;\n q = cosphi;\n t = q * q;\n if (t >= 1) {\n s = 0;\n } else {\n s = Math.sqrt(1 - t) * Math.sin(theta);\n }\n t += s * s;\n if (t >= 1) {\n r = 0;\n } else {\n r = Math.sqrt(1 - t);\n }\n /* Rotate q,r,s into the correct area. */\n if (area.value === AREA_ENUM.AREA_1) {\n t = r;\n r = -s;\n s = t;\n } else if (area.value === AREA_ENUM.AREA_2) {\n r = -r;\n s = -s;\n } else if (area.value === AREA_ENUM.AREA_3) {\n t = r;\n r = s;\n s = -t;\n }\n /* Rotate q,r,s into the correct cube face. */\n if (this.face === FACE_ENUM.RIGHT) {\n t = q;\n q = -r;\n r = t;\n } else if (this.face === FACE_ENUM.BACK) {\n q = -q;\n r = -r;\n } else if (this.face === FACE_ENUM.LEFT) {\n t = q;\n q = r;\n r = -t;\n }\n /* Now compute phi and lam from the unit sphere coordinates. */\n lp.phi = Math.acos(-s) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n lp.lam = Math.atan2(r, q);\n if (this.face === FACE_ENUM.RIGHT) {\n lp.lam = qsc_shift_lon_origin(lp.lam, -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n } else if (this.face === FACE_ENUM.BACK) {\n lp.lam = qsc_shift_lon_origin(lp.lam, -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (this.face === FACE_ENUM.LEFT) {\n lp.lam = qsc_shift_lon_origin(lp.lam, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n }\n }\n\n /* Apply the shift from the sphere to the ellipsoid as described\n * in [LK12]. */\n if (this.es !== 0) {\n var invert_sign;\n var tanphi, xa;\n invert_sign = (lp.phi < 0 ? 1 : 0);\n tanphi = Math.tan(lp.phi);\n xa = this.b / Math.sqrt(tanphi * tanphi + this.one_minus_f_squared);\n lp.phi = Math.atan(Math.sqrt(this.a * this.a - xa * xa) / (this.one_minus_f * xa));\n if (invert_sign) {\n lp.phi = -lp.phi;\n }\n }\n\n lp.lam += this.long0;\n p.x = lp.lam;\n p.y = lp.phi;\n return p;\n}\n\n/* Helper function for forward projection: compute the theta angle\n * and determine the area number. */\nfunction qsc_fwd_equat_face_theta(phi, y, x, area) {\n var theta;\n if (phi < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = 0.0;\n } else {\n theta = Math.atan2(y, x);\n if (Math.abs(theta) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n } else if (theta > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && theta <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_1;\n theta -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (theta > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] || theta <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_2;\n theta = (theta >= 0.0 ? theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n }\n }\n return theta;\n}\n\n/* Helper function: shift the longitude. */\nfunction qsc_shift_lon_origin(lon, offset) {\n var slon = lon + offset;\n if (slon < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) {\n slon += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"TWO_PI\"];\n } else if (slon > +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) {\n slon -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"TWO_PI\"];\n }\n return slon;\n}\n\nvar names = [\"Quadrilateralized Spherical Cube\", \"Quadrilateralized_Spherical_Cube\", \"qsc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/qsc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/robin.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/robin.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n// Robinson projection\n// Based on https://github.com/OSGeo/proj.4/blob/master/src/PJ_robin.c\n// Polynomial coeficients from http://article.gmane.org/gmane.comp.gis.proj-4.devel/6039\n\n\n\n\nvar COEFS_X = [\n [1.0000, 2.2199e-17, -7.15515e-05, 3.1103e-06],\n [0.9986, -0.000482243, -2.4897e-05, -1.3309e-06],\n [0.9954, -0.00083103, -4.48605e-05, -9.86701e-07],\n [0.9900, -0.00135364, -5.9661e-05, 3.6777e-06],\n [0.9822, -0.00167442, -4.49547e-06, -5.72411e-06],\n [0.9730, -0.00214868, -9.03571e-05, 1.8736e-08],\n [0.9600, -0.00305085, -9.00761e-05, 1.64917e-06],\n [0.9427, -0.00382792, -6.53386e-05, -2.6154e-06],\n [0.9216, -0.00467746, -0.00010457, 4.81243e-06],\n [0.8962, -0.00536223, -3.23831e-05, -5.43432e-06],\n [0.8679, -0.00609363, -0.000113898, 3.32484e-06],\n [0.8350, -0.00698325, -6.40253e-05, 9.34959e-07],\n [0.7986, -0.00755338, -5.00009e-05, 9.35324e-07],\n [0.7597, -0.00798324, -3.5971e-05, -2.27626e-06],\n [0.7186, -0.00851367, -7.01149e-05, -8.6303e-06],\n [0.6732, -0.00986209, -0.000199569, 1.91974e-05],\n [0.6213, -0.010418, 8.83923e-05, 6.24051e-06],\n [0.5722, -0.00906601, 0.000182, 6.24051e-06],\n [0.5322, -0.00677797, 0.000275608, 6.24051e-06]\n];\n\nvar COEFS_Y = [\n [-5.20417e-18, 0.0124, 1.21431e-18, -8.45284e-11],\n [0.0620, 0.0124, -1.26793e-09, 4.22642e-10],\n [0.1240, 0.0124, 5.07171e-09, -1.60604e-09],\n [0.1860, 0.0123999, -1.90189e-08, 6.00152e-09],\n [0.2480, 0.0124002, 7.10039e-08, -2.24e-08],\n [0.3100, 0.0123992, -2.64997e-07, 8.35986e-08],\n [0.3720, 0.0124029, 9.88983e-07, -3.11994e-07],\n [0.4340, 0.0123893, -3.69093e-06, -4.35621e-07],\n [0.4958, 0.0123198, -1.02252e-05, -3.45523e-07],\n [0.5571, 0.0121916, -1.54081e-05, -5.82288e-07],\n [0.6176, 0.0119938, -2.41424e-05, -5.25327e-07],\n [0.6769, 0.011713, -3.20223e-05, -5.16405e-07],\n [0.7346, 0.0113541, -3.97684e-05, -6.09052e-07],\n [0.7903, 0.0109107, -4.89042e-05, -1.04739e-06],\n [0.8435, 0.0103431, -6.4615e-05, -1.40374e-09],\n [0.8936, 0.00969686, -6.4636e-05, -8.547e-06],\n [0.9394, 0.00840947, -0.000192841, -4.2106e-06],\n [0.9761, 0.00616527, -0.000256, -4.2106e-06],\n [1.0000, 0.00328947, -0.000319159, -4.2106e-06]\n];\n\nvar FXC = 0.8487;\nvar FYC = 1.3523;\nvar C1 = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"]/5; // rad to 5-degree interval\nvar RC1 = 1/C1;\nvar NODES = 18;\n\nvar poly3_val = function(coefs, x) {\n return coefs[0] + x * (coefs[1] + x * (coefs[2] + x * coefs[3]));\n};\n\nvar poly3_der = function(coefs, x) {\n return coefs[1] + x * (2 * coefs[2] + x * 3 * coefs[3]);\n};\n\nfunction newton_rapshon(f_df, start, max_err, iters) {\n var x = start;\n for (; iters; --iters) {\n var upd = f_df(x);\n x -= upd;\n if (Math.abs(upd) < max_err) {\n break;\n }\n }\n return x;\n}\n\nfunction init() {\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.long0 = this.long0 || 0;\n this.es = 0;\n this.title = this.title || \"Robinson\";\n}\n\nfunction forward(ll) {\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(ll.x - this.long0);\n\n var dphi = Math.abs(ll.y);\n var i = Math.floor(dphi * C1);\n if (i < 0) {\n i = 0;\n } else if (i >= NODES) {\n i = NODES - 1;\n }\n dphi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"] * (dphi - RC1 * i);\n var xy = {\n x: poly3_val(COEFS_X[i], dphi) * lon,\n y: poly3_val(COEFS_Y[i], dphi)\n };\n if (ll.y < 0) {\n xy.y = -xy.y;\n }\n\n xy.x = xy.x * this.a * FXC + this.x0;\n xy.y = xy.y * this.a * FYC + this.y0;\n return xy;\n}\n\nfunction inverse(xy) {\n var ll = {\n x: (xy.x - this.x0) / (this.a * FXC),\n y: Math.abs(xy.y - this.y0) / (this.a * FYC)\n };\n\n if (ll.y >= 1) { // pathologic case\n ll.x /= COEFS_X[NODES][0];\n ll.y = xy.y < 0 ? -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] : _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n // find table interval\n var i = Math.floor(ll.y * NODES);\n if (i < 0) {\n i = 0;\n } else if (i >= NODES) {\n i = NODES - 1;\n }\n for (;;) {\n if (COEFS_Y[i][0] > ll.y) {\n --i;\n } else if (COEFS_Y[i+1][0] <= ll.y) {\n ++i;\n } else {\n break;\n }\n }\n // linear interpolation in 5 degree interval\n var coefs = COEFS_Y[i];\n var t = 5 * (ll.y - coefs[0]) / (COEFS_Y[i+1][0] - coefs[0]);\n // find t so that poly3_val(coefs, t) = ll.y\n t = newton_rapshon(function(x) {\n return (poly3_val(coefs, x) - ll.y) / poly3_der(coefs, x);\n }, t, _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"], 100);\n\n ll.x /= poly3_val(COEFS_X[i], t);\n ll.y = (5 * i + t) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n if (xy.y < 0) {\n ll.y = -ll.y;\n }\n }\n\n ll.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(ll.x + this.long0);\n return ll;\n}\n\nvar names = [\"Robinson\", \"robin\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/robin.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/sinu.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/sinu.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_pj_enfn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pj_enfn */ \"./node_modules/proj4/lib/common/pj_enfn.js\");\n/* harmony import */ var _common_pj_mlfn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/pj_mlfn */ \"./node_modules/proj4/lib/common/pj_mlfn.js\");\n/* harmony import */ var _common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/pj_inv_mlfn */ \"./node_modules/proj4/lib/common/pj_inv_mlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n\n\n\nvar MAX_ITER = 20;\n\n\n\n\n\n\n\nfunction init() {\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n\n\n if (!this.sphere) {\n this.en = Object(_common_pj_enfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n }\n else {\n this.n = 1;\n this.m = 0;\n this.es = 0;\n this.C_y = Math.sqrt((this.m + 1) / this.n);\n this.C_x = this.C_y / (this.m + 1);\n }\n\n}\n\n/* Sinusoidal forward equations--mapping lat,long to x,y\n -----------------------------------------------------*/\nfunction forward(p) {\n var x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n\n if (this.sphere) {\n if (!this.m) {\n lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat;\n }\n else {\n var k = this.n * Math.sin(lat);\n for (var i = MAX_ITER; i; --i) {\n var V = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat));\n lat -= V;\n if (Math.abs(V) < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n break;\n }\n }\n }\n x = this.a * this.C_x * lon * (this.m + Math.cos(lat));\n y = this.a * this.C_y * lat;\n\n }\n else {\n\n var s = Math.sin(lat);\n var c = Math.cos(lat);\n y = this.a * Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(lat, s, c, this.en);\n x = this.a * lon * c / Math.sqrt(1 - this.es * s * s);\n }\n\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var lat, temp, lon, s;\n\n p.x -= this.x0;\n lon = p.x / this.a;\n p.y -= this.y0;\n lat = p.y / this.a;\n\n if (this.sphere) {\n lat /= this.C_y;\n lon = lon / (this.C_x * (this.m + Math.cos(lat)));\n if (this.m) {\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_6__[\"default\"])((this.m * lat + Math.sin(lat)) / this.n);\n }\n else if (this.n !== 1) {\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(Math.sin(lat) / this.n);\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon + this.long0);\n lat = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat);\n }\n else {\n lat = Object(_common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(p.y / this.a, this.es, this.en);\n s = Math.abs(lat);\n if (s < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"]) {\n s = Math.sin(lat);\n temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat));\n //temp = this.long0 + p.x / (this.a * Math.cos(lat));\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(temp);\n }\n else if ((s - _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"]) {\n lon = this.long0;\n }\n }\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Sinusoidal\", \"sinu\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/sinu.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/somerc.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/somerc.js ***! + \******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/*\n references:\n Formules et constantes pour le Calcul pour la\n projection cylindrique conforme à axe oblique et pour la transformation entre\n des systèmes de référence.\n http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf\n */\n\nfunction init() {\n var phy0 = this.lat0;\n this.lambda0 = this.long0;\n var sinPhy0 = Math.sin(phy0);\n var semiMajorAxis = this.a;\n var invF = this.rf;\n var flattening = 1 / invF;\n var e2 = 2 * flattening - Math.pow(flattening, 2);\n var e = this.e = Math.sqrt(e2);\n this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2));\n this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4));\n this.b0 = Math.asin(sinPhy0 / this.alpha);\n var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2));\n var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2));\n var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0));\n this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3;\n}\n\nfunction forward(p) {\n var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2));\n var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y)));\n var S = -this.alpha * (Sa1 + Sa2) + this.K;\n\n // spheric latitude\n var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4);\n\n // spheric longitude\n var I = this.alpha * (p.x - this.lambda0);\n\n // psoeudo equatorial rotation\n var rotI = Math.atan(Math.sin(I) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I)));\n\n var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I));\n\n p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0;\n p.x = this.R * rotI + this.x0;\n return p;\n}\n\nfunction inverse(p) {\n var Y = p.x - this.x0;\n var X = p.y - this.y0;\n\n var rotI = Y / this.R;\n var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4);\n\n var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI));\n var I = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB)));\n\n var lambda = this.lambda0 + I / this.alpha;\n\n var S = 0;\n var phy = b;\n var prevPhy = -1000;\n var iteration = 0;\n while (Math.abs(phy - prevPhy) > 0.0000001) {\n if (++iteration > 20) {\n //...reportError(\"omercFwdInfinity\");\n return;\n }\n //S = Math.log(Math.tan(Math.PI / 4 + phy / 2));\n S = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + b / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(phy)) / 2));\n prevPhy = phy;\n phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2;\n }\n\n p.x = lambda;\n p.y = phy;\n return p;\n}\n\nvar names = [\"somerc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/somerc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/stere.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/stere.js ***! + \*****************************************************/ +/*! exports provided: ssfn_, init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ssfn_\", function() { return ssfn_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_sign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/sign */ \"./node_modules/proj4/lib/common/sign.js\");\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\n\n\n\n\n\nfunction ssfn_(phit, sinphi, eccen) {\n sinphi *= eccen;\n return (Math.tan(0.5 * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + phit)) * Math.pow((1 - sinphi) / (1 + sinphi), 0.5 * eccen));\n}\n\nfunction init() {\n this.coslat0 = Math.cos(this.lat0);\n this.sinlat0 = Math.sin(this.lat0);\n if (this.sphere) {\n if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.k0 = 0.5 * (1 + Object(_common_sign__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0) * Math.sin(this.lat_ts));\n }\n }\n else {\n if (Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n if (this.lat0 > 0) {\n //North pole\n //trace('stere:north pole');\n this.con = 1;\n }\n else {\n //South pole\n //trace('stere:south pole');\n this.con = -1;\n }\n }\n this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e));\n if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.k0 = 0.5 * this.cons * Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts));\n }\n this.ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, this.sinlat0, this.coslat0);\n this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n this.cosX0 = Math.cos(this.X0);\n this.sinX0 = Math.sin(this.X0);\n }\n}\n\n// Stereographic forward equations--mapping lat,long to x,y\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var sinlat = Math.sin(lat);\n var coslat = Math.cos(lat);\n var A, X, sinX, cosX, ts, rh;\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(lon - this.long0);\n\n if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"] && Math.abs(lat + this.lat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n //case of the origine point\n //trace('stere:this is the origin point');\n p.x = NaN;\n p.y = NaN;\n return p;\n }\n if (this.sphere) {\n //trace('stere:sphere case');\n A = 2 * this.k0 / (1 + this.sinlat0 * sinlat + this.coslat0 * coslat * Math.cos(dlon));\n p.x = this.a * A * coslat * Math.sin(dlon) + this.x0;\n p.y = this.a * A * (this.coslat0 * sinlat - this.sinlat0 * coslat * Math.cos(dlon)) + this.y0;\n return p;\n }\n else {\n X = 2 * Math.atan(this.ssfn_(lat, sinlat, this.e)) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n cosX = Math.cos(X);\n sinX = Math.sin(X);\n if (Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n ts = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, lat * this.con, this.con * sinlat);\n rh = 2 * this.a * this.k0 * ts / this.cons;\n p.x = this.x0 + rh * Math.sin(lon - this.long0);\n p.y = this.y0 - this.con * rh * Math.cos(lon - this.long0);\n //trace(p.toString());\n return p;\n }\n else if (Math.abs(this.sinlat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n //Eq\n //trace('stere:equateur');\n A = 2 * this.a * this.k0 / (1 + cosX * Math.cos(dlon));\n p.y = A * sinX;\n }\n else {\n //other case\n //trace('stere:normal case');\n A = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * sinX + this.cosX0 * cosX * Math.cos(dlon)));\n p.y = A * (this.cosX0 * sinX - this.sinX0 * cosX * Math.cos(dlon)) + this.y0;\n }\n p.x = A * cosX * Math.sin(dlon) + this.x0;\n }\n //trace(p.toString());\n return p;\n}\n\n//* Stereographic inverse equations--mapping x,y to lat/long\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat, ts, ce, Chi;\n var rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (this.sphere) {\n var c = 2 * Math.atan(rh / (2 * this.a * this.k0));\n lon = this.long0;\n lat = this.lat0;\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);\n if (Math.abs(this.coslat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n if (this.lat0 > 0) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x, p.y));\n }\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n if (Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n lat = this.lat0;\n lon = this.long0;\n p.x = lon;\n p.y = lat;\n //trace(p.toString());\n return p;\n }\n p.x *= this.con;\n p.y *= this.con;\n ts = rh * this.cons / (2 * this.a * this.k0);\n lat = this.con * Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, ts);\n lon = this.con * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.con * this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));\n lon = this.long0;\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n Chi = this.X0;\n }\n else {\n Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));\n }\n lat = -1 * Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, Math.tan(0.5 * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + Chi)));\n }\n }\n p.x = lon;\n p.y = lat;\n\n //trace(p.toString());\n return p;\n\n}\n\nvar names = [\"stere\", \"Stereographic_South_Pole\", \"Polar Stereographic (variant B)\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names,\n ssfn_: ssfn_\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/stere.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/sterea.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/sterea.js ***! + \******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _gauss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./gauss */ \"./node_modules/proj4/lib/projections/gauss.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\nfunction init() {\n _gauss__WEBPACK_IMPORTED_MODULE_0__[\"default\"].init.apply(this);\n if (!this.rc) {\n return;\n }\n this.sinc0 = Math.sin(this.phic0);\n this.cosc0 = Math.cos(this.phic0);\n this.R2 = 2 * this.rc;\n if (!this.title) {\n this.title = \"Oblique Stereographic Alternative\";\n }\n}\n\nfunction forward(p) {\n var sinc, cosc, cosl, k;\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(p.x - this.long0);\n _gauss__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forward.apply(this, [p]);\n sinc = Math.sin(p.y);\n cosc = Math.cos(p.y);\n cosl = Math.cos(p.x);\n k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl);\n p.x = k * cosc * Math.sin(p.x);\n p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl);\n p.x = this.a * p.x + this.x0;\n p.y = this.a * p.y + this.y0;\n return p;\n}\n\nfunction inverse(p) {\n var sinc, cosc, lon, lat, rho;\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n p.x /= this.k0;\n p.y /= this.k0;\n if ((rho = Math.sqrt(p.x * p.x + p.y * p.y))) {\n var c = 2 * Math.atan2(rho, this.R2);\n sinc = Math.sin(c);\n cosc = Math.cos(c);\n lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho);\n lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc);\n }\n else {\n lat = this.phic0;\n lon = 0;\n }\n\n p.x = lon;\n p.y = lat;\n _gauss__WEBPACK_IMPORTED_MODULE_0__[\"default\"].inverse.apply(this, [p]);\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(p.x + this.long0);\n return p;\n}\n\nvar names = [\"Stereographic_North_Pole\", \"Oblique_Stereographic\", \"Polar_Stereographic\", \"sterea\",\"Oblique Stereographic Alternative\",\"Double_Stereographic\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/sterea.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/tmerc.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/tmerc.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_pj_enfn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/pj_enfn */ \"./node_modules/proj4/lib/common/pj_enfn.js\");\n/* harmony import */ var _common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pj_mlfn */ \"./node_modules/proj4/lib/common/pj_mlfn.js\");\n/* harmony import */ var _common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pj_inv_mlfn */ \"./node_modules/proj4/lib/common/pj_inv_mlfn.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_sign__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/sign */ \"./node_modules/proj4/lib/common/sign.js\");\n// Heavily based on this tmerc projection implementation\n// https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/tmerc.js\n\n\n\n\n\n\n\n\n\nfunction init() {\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n if (this.es) {\n this.en = Object(_common_pj_enfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.es);\n this.ml0 = Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);\n }\n}\n\n/**\n Transverse Mercator Forward - long/lat to x/y\n long/lat in radians\n */\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(lon - this.long0);\n var con;\n var x, y;\n var sin_phi = Math.sin(lat);\n var cos_phi = Math.cos(lat);\n\n if (!this.es) {\n var b = cos_phi * Math.sin(delta_lon);\n\n if ((Math.abs(Math.abs(b) - 1)) < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return (93);\n }\n else {\n x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;\n y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));\n b = Math.abs(y);\n\n if (b >= 1) {\n if ((b - 1) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return (93);\n }\n else {\n y = 0;\n }\n }\n else {\n y = Math.acos(y);\n }\n\n if (lat < 0) {\n y = -y;\n }\n\n y = this.a * this.k0 * (y - this.lat0) + this.y0;\n }\n }\n else {\n var al = cos_phi * delta_lon;\n var als = Math.pow(al, 2);\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var tq = Math.abs(cos_phi) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"] ? Math.tan(lat) : 0;\n var t = Math.pow(tq, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n al = al / Math.sqrt(con);\n var ml = Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat, sin_phi, cos_phi, this.en);\n\n x = this.a * (this.k0 * al * (1 +\n als / 6 * (1 - t + c +\n als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c +\n als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) +\n this.x0;\n\n y = this.a * (this.k0 * (ml - this.ml0 +\n sin_phi * delta_lon * al / 2 * (1 +\n als / 12 * (5 - t + 9 * c + 4 * cs +\n als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c +\n als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) +\n this.y0;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n}\n\n/**\n Transverse Mercator Inverse - x/y to long/lat\n */\nfunction inverse(p) {\n var con, phi;\n var lat, lon;\n var x = (p.x - this.x0) * (1 / this.a);\n var y = (p.y - this.y0) * (1 / this.a);\n\n if (!this.es) {\n var f = Math.exp(x / this.k0);\n var g = 0.5 * (f - 1 / f);\n var temp = this.lat0 + y / this.k0;\n var h = Math.cos(temp);\n con = Math.sqrt((1 - Math.pow(h, 2)) / (1 + Math.pow(g, 2)));\n lat = Math.asin(con);\n\n if (y < 0) {\n lat = -lat;\n }\n\n if ((g === 0) && (h === 0)) {\n lon = 0;\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(Math.atan2(g, h) + this.long0);\n }\n }\n else { // ellipsoidal form\n con = this.ml0 + y / this.k0;\n phi = Object(_common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(con, this.es, this.en);\n\n if (Math.abs(phi) < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"]) {\n var sin_phi = Math.sin(phi);\n var cos_phi = Math.cos(phi);\n var tan_phi = Math.abs(cos_phi) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"] ? Math.tan(phi) : 0;\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var t = Math.pow(tan_phi, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n var d = x * Math.sqrt(con) / this.k0;\n var ds = Math.pow(d, 2);\n con = con * tan_phi;\n\n lat = phi - (con * ds / (1 - this.es)) * 0.5 * (1 -\n ds / 12 * (5 + 3 * t - 9 * c * t + c - 4 * cs -\n ds / 30 * (61 + 90 * t - 252 * c * t + 45 * ts + 46 * c -\n ds / 56 * (1385 + 3633 * t + 4095 * ts + 1574 * ts * t))));\n\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.long0 + (d * (1 -\n ds / 6 * (1 + 2 * t + c -\n ds / 20 * (5 + 28 * t + 24 * ts + 8 * c * t + 6 * c -\n ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi));\n }\n else {\n lat = _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"] * Object(_common_sign__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(y);\n lon = 0;\n }\n }\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}\n\nvar names = [\"Fast_Transverse_Mercator\", \"Fast Transverse Mercator\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/tmerc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/tpers.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/tpers.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_hypot__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hypot */ \"./node_modules/proj4/lib/common/hypot.js\");\n\nvar mode = {\n N_POLE: 0,\n S_POLE: 1,\n EQUIT: 2,\n OBLIQ: 3\n};\n\n\n\n\nvar params = {\n h: { def: 100000, num: true }, // default is Karman line, no default in PROJ.7\n azi: { def: 0, num: true, degrees: true }, // default is North\n tilt: { def: 0, num: true, degrees: true }, // default is Nadir\n long0: { def: 0, num: true }, // default is Greenwich, conversion to rad is automatic\n lat0: { def: 0, num: true } // default is Equator, conversion to rad is automatic\n};\n\nfunction init() {\n Object.keys(params).forEach(function (p) {\n if (typeof this[p] === \"undefined\") {\n this[p] = params[p].def;\n } else if (params[p].num && isNaN(this[p])) {\n throw new Error(\"Invalid parameter value, must be numeric \" + p + \" = \" + this[p]);\n } else if (params[p].num) {\n this[p] = parseFloat(this[p]);\n }\n if (params[p].degrees) {\n this[p] = this[p] * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n }\n }.bind(this));\n\n if (Math.abs((Math.abs(this.lat0) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"])) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.lat0 < 0 ? mode.S_POLE : mode.N_POLE;\n } else if (Math.abs(this.lat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = mode.EQUIT;\n } else {\n this.mode = mode.OBLIQ;\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n\n this.pn1 = this.h / this.a; // Normalize relative to the Earth's radius\n\n if (this.pn1 <= 0 || this.pn1 > 1e10) {\n throw new Error(\"Invalid height\");\n }\n \n this.p = 1 + this.pn1;\n this.rp = 1 / this.p;\n this.h1 = 1 / this.pn1;\n this.pfact = (this.p + 1) * this.h1;\n this.es = 0;\n\n var omega = this.tilt;\n var gamma = this.azi;\n this.cg = Math.cos(gamma);\n this.sg = Math.sin(gamma);\n this.cw = Math.cos(omega);\n this.sw = Math.sin(omega);\n}\n\nfunction forward(p) {\n p.x -= this.long0;\n var sinphi = Math.sin(p.y);\n var cosphi = Math.cos(p.y);\n var coslam = Math.cos(p.x);\n var x, y;\n switch (this.mode) {\n case mode.OBLIQ:\n y = this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;\n break;\n case mode.EQUIT:\n y = cosphi * coslam;\n break;\n case mode.S_POLE:\n y = -sinphi;\n break;\n case mode.N_POLE:\n y = sinphi;\n break;\n }\n y = this.pn1 / (this.p - y);\n x = y * cosphi * Math.sin(p.x);\n\n switch (this.mode) {\n case mode.OBLIQ:\n y *= this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;\n break;\n case mode.EQUIT:\n y *= sinphi;\n break;\n case mode.N_POLE:\n y *= -(cosphi * coslam);\n break;\n case mode.S_POLE:\n y *= cosphi * coslam;\n break;\n }\n\n // Tilt \n var yt, ba;\n yt = y * this.cg + x * this.sg;\n ba = 1 / (yt * this.sw * this.h1 + this.cw);\n x = (x * this.cg - y * this.sg) * this.cw * ba;\n y = yt * ba;\n\n p.x = x * this.a;\n p.y = y * this.a;\n return p;\n}\n\nfunction inverse(p) {\n p.x /= this.a;\n p.y /= this.a;\n var r = { x: p.x, y: p.y };\n\n // Un-Tilt\n var bm, bq, yt;\n yt = 1 / (this.pn1 - p.y * this.sw);\n bm = this.pn1 * p.x * yt;\n bq = this.pn1 * p.y * this.cw * yt;\n p.x = bm * this.cg + bq * this.sg;\n p.y = bq * this.cg - bm * this.sg;\n\n var rh = Object(_common_hypot__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(p.x, p.y);\n if (Math.abs(rh) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n r.x = 0;\n r.y = p.y;\n } else {\n var cosz, sinz;\n sinz = 1 - rh * rh * this.pfact;\n sinz = (this.p - Math.sqrt(sinz)) / (this.pn1 / rh + rh / this.pn1);\n cosz = Math.sqrt(1 - sinz * sinz);\n switch (this.mode) {\n case mode.OBLIQ:\n r.y = Math.asin(cosz * this.sinph0 + p.y * sinz * this.cosph0 / rh);\n p.y = (cosz - this.sinph0 * Math.sin(r.y)) * rh;\n p.x *= sinz * this.cosph0;\n break;\n case mode.EQUIT:\n r.y = Math.asin(p.y * sinz / rh);\n p.y = cosz * rh;\n p.x *= sinz;\n break;\n case mode.N_POLE:\n r.y = Math.asin(cosz);\n p.y = -p.y;\n break;\n case mode.S_POLE:\n r.y = -Math.asin(cosz);\n break;\n }\n r.x = Math.atan2(p.x, p.y);\n }\n\n p.x = r.x + this.long0;\n p.y = r.y;\n return p;\n}\n\nvar names = [\"Tilted_Perspective\", \"tpers\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/tpers.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/utm.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/utm.js ***! + \***************************************************/ +/*! exports provided: dependsOn, init, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dependsOn\", function() { return dependsOn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_zone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_zone */ \"./node_modules/proj4/lib/common/adjust_zone.js\");\n/* harmony import */ var _etmerc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./etmerc */ \"./node_modules/proj4/lib/projections/etmerc.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\nvar dependsOn = 'etmerc';\n\n\n\nfunction init() {\n var zone = Object(_common_adjust_zone__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.zone, this.long0);\n if (zone === undefined) {\n throw new Error('unknown utm zone');\n }\n this.lat0 = 0;\n this.long0 = ((6 * Math.abs(zone)) - 183) * _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"D2R\"];\n this.x0 = 500000;\n this.y0 = this.utmSouth ? 10000000 : 0;\n this.k0 = 0.9996;\n\n _etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"].init.apply(this);\n this.forward = _etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"].forward;\n this.inverse = _etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"].inverse;\n}\n\nvar names = [\"Universal Transverse Mercator System\", \"utm\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n names: names,\n dependsOn: dependsOn\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/utm.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/vandg.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/vandg.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n\n\n\n\n\n\n/* Initialize the Van Der Grinten projection\n ----------------------------------------*/\nfunction init() {\n //this.R = 6370997; //Radius of earth\n this.R = this.a;\n}\n\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n /* Forward equations\n -----------------*/\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var x, y;\n\n if (Math.abs(lat) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n x = this.x0 + this.R * dlon;\n y = this.y0;\n }\n var theta = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(2 * Math.abs(lat / Math.PI));\n if ((Math.abs(dlon) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) || (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"])) {\n x = this.x0;\n if (lat >= 0) {\n y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta);\n }\n else {\n y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta);\n }\n // return(OK);\n }\n var al = 0.5 * Math.abs((Math.PI / dlon) - (dlon / Math.PI));\n var asq = al * al;\n var sinth = Math.sin(theta);\n var costh = Math.cos(theta);\n\n var g = costh / (sinth + costh - 1);\n var gsq = g * g;\n var m = g * (2 / sinth - 1);\n var msq = m * m;\n var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq);\n if (dlon < 0) {\n con = -con;\n }\n x = this.x0 + con;\n //con = Math.abs(con / (Math.PI * this.R));\n var q = asq + g;\n con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq);\n if (lat >= 0) {\n //y = this.y0 + Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);\n y = this.y0 + con;\n }\n else {\n //y = this.y0 - Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);\n y = this.y0 - con;\n }\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Van Der Grinten inverse equations--mapping x,y to lat/long\n ---------------------------------------------------------*/\nfunction inverse(p) {\n var lon, lat;\n var xx, yy, xys, c1, c2, c3;\n var a1;\n var m1;\n var con;\n var th1;\n var d;\n\n /* inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n con = Math.PI * this.R;\n xx = p.x / con;\n yy = p.y / con;\n xys = xx * xx + yy * yy;\n c1 = -Math.abs(yy) * (1 + xys);\n c2 = c1 - 2 * yy * yy + xx * xx;\n c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;\n d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;\n a1 = (c1 - c2 * c2 / 3 / c3) / c3;\n m1 = 2 * Math.sqrt(-a1 / 3);\n con = ((3 * d) / a1) / m1;\n if (Math.abs(con) > 1) {\n if (con >= 0) {\n con = 1;\n }\n else {\n con = -1;\n }\n }\n th1 = Math.acos(con) / 3;\n if (p.y >= 0) {\n lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n else {\n lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n\n if (Math.abs(xx) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n lon = this.long0;\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Van_der_Grinten_I\", \"VanDerGrinten\", \"vandg\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/vandg.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/transform.js": +/*!*********************************************!*\ + !*** ./node_modules/proj4/lib/transform.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return transform; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _datum_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./datum_transform */ \"./node_modules/proj4/lib/datum_transform.js\");\n/* harmony import */ var _adjust_axis__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./adjust_axis */ \"./node_modules/proj4/lib/adjust_axis.js\");\n/* harmony import */ var _Proj__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Proj */ \"./node_modules/proj4/lib/Proj.js\");\n/* harmony import */ var _common_toPoint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./common/toPoint */ \"./node_modules/proj4/lib/common/toPoint.js\");\n/* harmony import */ var _checkSanity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./checkSanity */ \"./node_modules/proj4/lib/checkSanity.js\");\n\n\n\n\n\n\n\nfunction checkNotWGS(source, dest) {\n return ((source.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"] || source.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) && dest.datumCode !== 'WGS84') || ((dest.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"] || dest.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) && source.datumCode !== 'WGS84');\n}\n\nfunction transform(source, dest, point) {\n var wgs84;\n if (Array.isArray(point)) {\n point = Object(_common_toPoint__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(point);\n }\n Object(_checkSanity__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(point);\n // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84\n if (source.datum && dest.datum && checkNotWGS(source, dest)) {\n wgs84 = new _Proj__WEBPACK_IMPORTED_MODULE_3__[\"default\"]('WGS84');\n point = transform(source, wgs84, point);\n source = wgs84;\n }\n // DGR, 2010/11/12\n if (source.axis !== 'enu') {\n point = Object(_adjust_axis__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(source, false, point);\n }\n // Transform source points to long/lat, if they aren't already.\n if (source.projName === 'longlat') {\n point = {\n x: point.x * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"],\n y: point.y * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"],\n z: point.z || 0\n };\n } else {\n if (source.to_meter) {\n point = {\n x: point.x * source.to_meter,\n y: point.y * source.to_meter,\n z: point.z || 0\n };\n }\n point = source.inverse(point); // Convert Cartesian to longlat\n if (!point) {\n return;\n }\n }\n // Adjust for the prime meridian if necessary\n if (source.from_greenwich) {\n point.x += source.from_greenwich;\n }\n\n // Convert datums if needed, and if possible.\n point = Object(_datum_transform__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(source.datum, dest.datum, point);\n if (!point) {\n return;\n }\n\n // Adjust for the prime meridian if necessary\n if (dest.from_greenwich) {\n point = {\n x: point.x - dest.from_greenwich,\n y: point.y,\n z: point.z || 0\n };\n }\n\n if (dest.projName === 'longlat') {\n // convert radians to decimal degrees\n point = {\n x: point.x * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"],\n y: point.y * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"],\n z: point.z || 0\n };\n } else { // else project\n point = dest.forward(point);\n if (dest.to_meter) {\n point = {\n x: point.x / dest.to_meter,\n y: point.y / dest.to_meter,\n z: point.z || 0\n };\n }\n }\n\n // DGR, 2010/11/12\n if (dest.axis !== 'enu') {\n return Object(_adjust_axis__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(dest, true, point);\n }\n\n return point;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/transform.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/projs.js": +/*!*************************************!*\ + !*** ./node_modules/proj4/projs.js ***! + \*************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _lib_projections_tmerc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/projections/tmerc */ \"./node_modules/proj4/lib/projections/tmerc.js\");\n/* harmony import */ var _lib_projections_etmerc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/projections/etmerc */ \"./node_modules/proj4/lib/projections/etmerc.js\");\n/* harmony import */ var _lib_projections_utm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/projections/utm */ \"./node_modules/proj4/lib/projections/utm.js\");\n/* harmony import */ var _lib_projections_sterea__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/projections/sterea */ \"./node_modules/proj4/lib/projections/sterea.js\");\n/* harmony import */ var _lib_projections_stere__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/projections/stere */ \"./node_modules/proj4/lib/projections/stere.js\");\n/* harmony import */ var _lib_projections_somerc__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/projections/somerc */ \"./node_modules/proj4/lib/projections/somerc.js\");\n/* harmony import */ var _lib_projections_omerc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/projections/omerc */ \"./node_modules/proj4/lib/projections/omerc.js\");\n/* harmony import */ var _lib_projections_lcc__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lib/projections/lcc */ \"./node_modules/proj4/lib/projections/lcc.js\");\n/* harmony import */ var _lib_projections_krovak__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lib/projections/krovak */ \"./node_modules/proj4/lib/projections/krovak.js\");\n/* harmony import */ var _lib_projections_cass__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./lib/projections/cass */ \"./node_modules/proj4/lib/projections/cass.js\");\n/* harmony import */ var _lib_projections_laea__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./lib/projections/laea */ \"./node_modules/proj4/lib/projections/laea.js\");\n/* harmony import */ var _lib_projections_aea__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./lib/projections/aea */ \"./node_modules/proj4/lib/projections/aea.js\");\n/* harmony import */ var _lib_projections_gnom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./lib/projections/gnom */ \"./node_modules/proj4/lib/projections/gnom.js\");\n/* harmony import */ var _lib_projections_cea__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./lib/projections/cea */ \"./node_modules/proj4/lib/projections/cea.js\");\n/* harmony import */ var _lib_projections_eqc__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./lib/projections/eqc */ \"./node_modules/proj4/lib/projections/eqc.js\");\n/* harmony import */ var _lib_projections_poly__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./lib/projections/poly */ \"./node_modules/proj4/lib/projections/poly.js\");\n/* harmony import */ var _lib_projections_nzmg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./lib/projections/nzmg */ \"./node_modules/proj4/lib/projections/nzmg.js\");\n/* harmony import */ var _lib_projections_mill__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./lib/projections/mill */ \"./node_modules/proj4/lib/projections/mill.js\");\n/* harmony import */ var _lib_projections_sinu__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./lib/projections/sinu */ \"./node_modules/proj4/lib/projections/sinu.js\");\n/* harmony import */ var _lib_projections_moll__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./lib/projections/moll */ \"./node_modules/proj4/lib/projections/moll.js\");\n/* harmony import */ var _lib_projections_eqdc__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./lib/projections/eqdc */ \"./node_modules/proj4/lib/projections/eqdc.js\");\n/* harmony import */ var _lib_projections_vandg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./lib/projections/vandg */ \"./node_modules/proj4/lib/projections/vandg.js\");\n/* harmony import */ var _lib_projections_aeqd__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./lib/projections/aeqd */ \"./node_modules/proj4/lib/projections/aeqd.js\");\n/* harmony import */ var _lib_projections_ortho__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./lib/projections/ortho */ \"./node_modules/proj4/lib/projections/ortho.js\");\n/* harmony import */ var _lib_projections_qsc__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./lib/projections/qsc */ \"./node_modules/proj4/lib/projections/qsc.js\");\n/* harmony import */ var _lib_projections_robin__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./lib/projections/robin */ \"./node_modules/proj4/lib/projections/robin.js\");\n/* harmony import */ var _lib_projections_geocent__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lib/projections/geocent */ \"./node_modules/proj4/lib/projections/geocent.js\");\n/* harmony import */ var _lib_projections_tpers__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./lib/projections/tpers */ \"./node_modules/proj4/lib/projections/tpers.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(proj4){\n proj4.Proj.projections.add(_lib_projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_utm__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_sterea__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_stere__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_somerc__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_omerc__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_lcc__WEBPACK_IMPORTED_MODULE_7__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_krovak__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_cass__WEBPACK_IMPORTED_MODULE_9__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_laea__WEBPACK_IMPORTED_MODULE_10__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_aea__WEBPACK_IMPORTED_MODULE_11__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_gnom__WEBPACK_IMPORTED_MODULE_12__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_cea__WEBPACK_IMPORTED_MODULE_13__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_eqc__WEBPACK_IMPORTED_MODULE_14__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_poly__WEBPACK_IMPORTED_MODULE_15__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_nzmg__WEBPACK_IMPORTED_MODULE_16__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_mill__WEBPACK_IMPORTED_MODULE_17__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_sinu__WEBPACK_IMPORTED_MODULE_18__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_moll__WEBPACK_IMPORTED_MODULE_19__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_eqdc__WEBPACK_IMPORTED_MODULE_20__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_vandg__WEBPACK_IMPORTED_MODULE_21__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_aeqd__WEBPACK_IMPORTED_MODULE_22__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_ortho__WEBPACK_IMPORTED_MODULE_23__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_qsc__WEBPACK_IMPORTED_MODULE_24__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_robin__WEBPACK_IMPORTED_MODULE_25__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_geocent__WEBPACK_IMPORTED_MODULE_26__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_tpers__WEBPACK_IMPORTED_MODULE_27__[\"default\"]);\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/projs.js?"); + +/***/ }), + +/***/ "./node_modules/quickselect/quickselect.js": +/*!*************************************************!*\ + !*** ./node_modules/quickselect/quickselect.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("(function (global, factory) {\n\t true ? module.exports = factory() :\n\tundefined;\n}(this, (function () { 'use strict';\n\nfunction quickselect(arr, k, left, right, compare) {\n quickselectStep(arr, k, left || 0, right || (arr.length - 1), compare || defaultCompare);\n}\n\nfunction quickselectStep(arr, k, left, right, compare) {\n\n while (right > left) {\n if (right - left > 600) {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselectStep(arr, k, newLeft, newRight, compare);\n }\n\n var t = arr[k];\n var i = left;\n var j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) i++;\n while (compare(arr[j], t) > 0) j--;\n }\n\n if (compare(arr[left], t) === 0) swap(arr, left, j);\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}\n\nfunction swap(arr, i, j) {\n var tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nreturn quickselect;\n\n})));\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/quickselect/quickselect.js?"); + +/***/ }), + +/***/ "./node_modules/rbush/index.js": +/*!*************************************!*\ + !*** ./node_modules/rbush/index.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nmodule.exports = rbush;\nmodule.exports.default = rbush;\n\nvar quickselect = __webpack_require__(/*! quickselect */ \"./node_modules/quickselect/quickselect.js\");\n\nfunction rbush(maxEntries, format) {\n if (!(this instanceof rbush)) return new rbush(maxEntries, format);\n\n // max entries in a node is 9 by default; min node fill is 40% for best performance\n this._maxEntries = Math.max(4, maxEntries || 9);\n this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\n\n if (format) {\n this._initFormat(format);\n }\n\n this.clear();\n}\n\nrbush.prototype = {\n\n all: function () {\n return this._all(this.data, []);\n },\n\n search: function (bbox) {\n\n var node = this.data,\n result = [],\n toBBox = this.toBBox;\n\n if (!intersects(bbox, node)) return result;\n\n var nodesToSearch = [],\n i, len, child, childBBox;\n\n while (node) {\n for (i = 0, len = node.children.length; i < len; i++) {\n\n child = node.children[i];\n childBBox = node.leaf ? toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf) result.push(child);\n else if (contains(bbox, childBBox)) this._all(child, result);\n else nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return result;\n },\n\n collides: function (bbox) {\n\n var node = this.data,\n toBBox = this.toBBox;\n\n if (!intersects(bbox, node)) return false;\n\n var nodesToSearch = [],\n i, len, child, childBBox;\n\n while (node) {\n for (i = 0, len = node.children.length; i < len; i++) {\n\n child = node.children[i];\n childBBox = node.leaf ? toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf || contains(bbox, childBBox)) return true;\n nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return false;\n },\n\n load: function (data) {\n if (!(data && data.length)) return this;\n\n if (data.length < this._minEntries) {\n for (var i = 0, len = data.length; i < len; i++) {\n this.insert(data[i]);\n }\n return this;\n }\n\n // recursively build the tree with the given data from scratch using OMT algorithm\n var node = this._build(data.slice(), 0, data.length - 1, 0);\n\n if (!this.data.children.length) {\n // save as is if tree is empty\n this.data = node;\n\n } else if (this.data.height === node.height) {\n // split root if trees have the same height\n this._splitRoot(this.data, node);\n\n } else {\n if (this.data.height < node.height) {\n // swap trees if inserted one is bigger\n var tmpNode = this.data;\n this.data = node;\n node = tmpNode;\n }\n\n // insert the small tree into the large tree at appropriate level\n this._insert(node, this.data.height - node.height - 1, true);\n }\n\n return this;\n },\n\n insert: function (item) {\n if (item) this._insert(item, this.data.height - 1);\n return this;\n },\n\n clear: function () {\n this.data = createNode([]);\n return this;\n },\n\n remove: function (item, equalsFn) {\n if (!item) return this;\n\n var node = this.data,\n bbox = this.toBBox(item),\n path = [],\n indexes = [],\n i, parent, index, goingUp;\n\n // depth-first iterative tree traversal\n while (node || path.length) {\n\n if (!node) { // go up\n node = path.pop();\n parent = path[path.length - 1];\n i = indexes.pop();\n goingUp = true;\n }\n\n if (node.leaf) { // check current node\n index = findItem(item, node.children, equalsFn);\n\n if (index !== -1) {\n // item found, remove the item and condense tree upwards\n node.children.splice(index, 1);\n path.push(node);\n this._condense(path);\n return this;\n }\n }\n\n if (!goingUp && !node.leaf && contains(node, bbox)) { // go down\n path.push(node);\n indexes.push(i);\n i = 0;\n parent = node;\n node = node.children[0];\n\n } else if (parent) { // go right\n i++;\n node = parent.children[i];\n goingUp = false;\n\n } else node = null; // nothing found\n }\n\n return this;\n },\n\n toBBox: function (item) { return item; },\n\n compareMinX: compareNodeMinX,\n compareMinY: compareNodeMinY,\n\n toJSON: function () { return this.data; },\n\n fromJSON: function (data) {\n this.data = data;\n return this;\n },\n\n _all: function (node, result) {\n var nodesToSearch = [];\n while (node) {\n if (node.leaf) result.push.apply(result, node.children);\n else nodesToSearch.push.apply(nodesToSearch, node.children);\n\n node = nodesToSearch.pop();\n }\n return result;\n },\n\n _build: function (items, left, right, height) {\n\n var N = right - left + 1,\n M = this._maxEntries,\n node;\n\n if (N <= M) {\n // reached leaf level; return leaf\n node = createNode(items.slice(left, right + 1));\n calcBBox(node, this.toBBox);\n return node;\n }\n\n if (!height) {\n // target height of the bulk-loaded tree\n height = Math.ceil(Math.log(N) / Math.log(M));\n\n // target number of root entries to maximize storage utilization\n M = Math.ceil(N / Math.pow(M, height - 1));\n }\n\n node = createNode([]);\n node.leaf = false;\n node.height = height;\n\n // split the items into M mostly square tiles\n\n var N2 = Math.ceil(N / M),\n N1 = N2 * Math.ceil(Math.sqrt(M)),\n i, j, right2, right3;\n\n multiSelect(items, left, right, N1, this.compareMinX);\n\n for (i = left; i <= right; i += N1) {\n\n right2 = Math.min(i + N1 - 1, right);\n\n multiSelect(items, i, right2, N2, this.compareMinY);\n\n for (j = i; j <= right2; j += N2) {\n\n right3 = Math.min(j + N2 - 1, right2);\n\n // pack each entry recursively\n node.children.push(this._build(items, j, right3, height - 1));\n }\n }\n\n calcBBox(node, this.toBBox);\n\n return node;\n },\n\n _chooseSubtree: function (bbox, node, level, path) {\n\n var i, len, child, targetNode, area, enlargement, minArea, minEnlargement;\n\n while (true) {\n path.push(node);\n\n if (node.leaf || path.length - 1 === level) break;\n\n minArea = minEnlargement = Infinity;\n\n for (i = 0, len = node.children.length; i < len; i++) {\n child = node.children[i];\n area = bboxArea(child);\n enlargement = enlargedArea(bbox, child) - area;\n\n // choose entry with the least area enlargement\n if (enlargement < minEnlargement) {\n minEnlargement = enlargement;\n minArea = area < minArea ? area : minArea;\n targetNode = child;\n\n } else if (enlargement === minEnlargement) {\n // otherwise choose one with the smallest area\n if (area < minArea) {\n minArea = area;\n targetNode = child;\n }\n }\n }\n\n node = targetNode || node.children[0];\n }\n\n return node;\n },\n\n _insert: function (item, level, isNode) {\n\n var toBBox = this.toBBox,\n bbox = isNode ? item : toBBox(item),\n insertPath = [];\n\n // find the best node for accommodating the item, saving all nodes along the path too\n var node = this._chooseSubtree(bbox, this.data, level, insertPath);\n\n // put the item into the node\n node.children.push(item);\n extend(node, bbox);\n\n // split on node overflow; propagate upwards if necessary\n while (level >= 0) {\n if (insertPath[level].children.length > this._maxEntries) {\n this._split(insertPath, level);\n level--;\n } else break;\n }\n\n // adjust bboxes along the insertion path\n this._adjustParentBBoxes(bbox, insertPath, level);\n },\n\n // split overflowed node into two\n _split: function (insertPath, level) {\n\n var node = insertPath[level],\n M = node.children.length,\n m = this._minEntries;\n\n this._chooseSplitAxis(node, m, M);\n\n var splitIndex = this._chooseSplitIndex(node, m, M);\n\n var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\n newNode.height = node.height;\n newNode.leaf = node.leaf;\n\n calcBBox(node, this.toBBox);\n calcBBox(newNode, this.toBBox);\n\n if (level) insertPath[level - 1].children.push(newNode);\n else this._splitRoot(node, newNode);\n },\n\n _splitRoot: function (node, newNode) {\n // split root node\n this.data = createNode([node, newNode]);\n this.data.height = node.height + 1;\n this.data.leaf = false;\n calcBBox(this.data, this.toBBox);\n },\n\n _chooseSplitIndex: function (node, m, M) {\n\n var i, bbox1, bbox2, overlap, area, minOverlap, minArea, index;\n\n minOverlap = minArea = Infinity;\n\n for (i = m; i <= M - m; i++) {\n bbox1 = distBBox(node, 0, i, this.toBBox);\n bbox2 = distBBox(node, i, M, this.toBBox);\n\n overlap = intersectionArea(bbox1, bbox2);\n area = bboxArea(bbox1) + bboxArea(bbox2);\n\n // choose distribution with minimum overlap\n if (overlap < minOverlap) {\n minOverlap = overlap;\n index = i;\n\n minArea = area < minArea ? area : minArea;\n\n } else if (overlap === minOverlap) {\n // otherwise choose distribution with minimum area\n if (area < minArea) {\n minArea = area;\n index = i;\n }\n }\n }\n\n return index;\n },\n\n // sorts node children by the best axis for split\n _chooseSplitAxis: function (node, m, M) {\n\n var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX,\n compareMinY = node.leaf ? this.compareMinY : compareNodeMinY,\n xMargin = this._allDistMargin(node, m, M, compareMinX),\n yMargin = this._allDistMargin(node, m, M, compareMinY);\n\n // if total distributions margin value is minimal for x, sort by minX,\n // otherwise it's already sorted by minY\n if (xMargin < yMargin) node.children.sort(compareMinX);\n },\n\n // total margin of all possible split distributions where each node is at least m full\n _allDistMargin: function (node, m, M, compare) {\n\n node.children.sort(compare);\n\n var toBBox = this.toBBox,\n leftBBox = distBBox(node, 0, m, toBBox),\n rightBBox = distBBox(node, M - m, M, toBBox),\n margin = bboxMargin(leftBBox) + bboxMargin(rightBBox),\n i, child;\n\n for (i = m; i < M - m; i++) {\n child = node.children[i];\n extend(leftBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(leftBBox);\n }\n\n for (i = M - m - 1; i >= m; i--) {\n child = node.children[i];\n extend(rightBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(rightBBox);\n }\n\n return margin;\n },\n\n _adjustParentBBoxes: function (bbox, path, level) {\n // adjust bboxes along the given tree path\n for (var i = level; i >= 0; i--) {\n extend(path[i], bbox);\n }\n },\n\n _condense: function (path) {\n // go through the path, removing empty nodes and updating bboxes\n for (var i = path.length - 1, siblings; i >= 0; i--) {\n if (path[i].children.length === 0) {\n if (i > 0) {\n siblings = path[i - 1].children;\n siblings.splice(siblings.indexOf(path[i]), 1);\n\n } else this.clear();\n\n } else calcBBox(path[i], this.toBBox);\n }\n },\n\n _initFormat: function (format) {\n // data format (minX, minY, maxX, maxY accessors)\n\n // uses eval-type function compilation instead of just accepting a toBBox function\n // because the algorithms are very sensitive to sorting functions performance,\n // so they should be dead simple and without inner calls\n\n var compareArr = ['return a', ' - b', ';'];\n\n this.compareMinX = new Function('a', 'b', compareArr.join(format[0]));\n this.compareMinY = new Function('a', 'b', compareArr.join(format[1]));\n\n this.toBBox = new Function('a',\n 'return {minX: a' + format[0] +\n ', minY: a' + format[1] +\n ', maxX: a' + format[2] +\n ', maxY: a' + format[3] + '};');\n }\n};\n\nfunction findItem(item, items, equalsFn) {\n if (!equalsFn) return items.indexOf(item);\n\n for (var i = 0; i < items.length; i++) {\n if (equalsFn(item, items[i])) return i;\n }\n return -1;\n}\n\n// calculate node's bbox from bboxes of its children\nfunction calcBBox(node, toBBox) {\n distBBox(node, 0, node.children.length, toBBox, node);\n}\n\n// min bounding rectangle of node children from k to p-1\nfunction distBBox(node, k, p, toBBox, destNode) {\n if (!destNode) destNode = createNode(null);\n destNode.minX = Infinity;\n destNode.minY = Infinity;\n destNode.maxX = -Infinity;\n destNode.maxY = -Infinity;\n\n for (var i = k, child; i < p; i++) {\n child = node.children[i];\n extend(destNode, node.leaf ? toBBox(child) : child);\n }\n\n return destNode;\n}\n\nfunction extend(a, b) {\n a.minX = Math.min(a.minX, b.minX);\n a.minY = Math.min(a.minY, b.minY);\n a.maxX = Math.max(a.maxX, b.maxX);\n a.maxY = Math.max(a.maxY, b.maxY);\n return a;\n}\n\nfunction compareNodeMinX(a, b) { return a.minX - b.minX; }\nfunction compareNodeMinY(a, b) { return a.minY - b.minY; }\n\nfunction bboxArea(a) { return (a.maxX - a.minX) * (a.maxY - a.minY); }\nfunction bboxMargin(a) { return (a.maxX - a.minX) + (a.maxY - a.minY); }\n\nfunction enlargedArea(a, b) {\n return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *\n (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));\n}\n\nfunction intersectionArea(a, b) {\n var minX = Math.max(a.minX, b.minX),\n minY = Math.max(a.minY, b.minY),\n maxX = Math.min(a.maxX, b.maxX),\n maxY = Math.min(a.maxY, b.maxY);\n\n return Math.max(0, maxX - minX) *\n Math.max(0, maxY - minY);\n}\n\nfunction contains(a, b) {\n return a.minX <= b.minX &&\n a.minY <= b.minY &&\n b.maxX <= a.maxX &&\n b.maxY <= a.maxY;\n}\n\nfunction intersects(a, b) {\n return b.minX <= a.maxX &&\n b.minY <= a.maxY &&\n b.maxX >= a.minX &&\n b.maxY >= a.minY;\n}\n\nfunction createNode(children) {\n return {\n children: children,\n height: 1,\n leaf: true,\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity\n };\n}\n\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\n// combines selection algorithm with binary divide & conquer approach\n\nfunction multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/rbush/index.js?"); + +/***/ }), + +/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js": +/*!****************************************************************************!*\ + !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = true ? __webpack_require__.nc : undefined;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of \",r),i=[e.slice(v,r-1)],r+=8):-1==p.indexOf(t)&&(r++,i=c());else r++;return{tagName:t,attributes:n,children:i}}function y(){var t=e[r],n=++r;return r=e.indexOf(t,n),e.slice(n,r)}var v,g=null;if(void 0!==t.attrValue)for(t.attrName=t.attrName||\"id\",g=[];-1!==(void 0,v=new RegExp(\"\\\\s\"+t.attrName+\"\\\\s*=['\\\"]\"+t.attrValue+\"['\\\"]\").exec(e),r=v?v.index:-1);)-1!==(r=e.lastIndexOf(\"<\",r))&&g.push(b()),e=e.substr(r),r=0;else g=t.parseNode?b():c();return t.filter&&(g=n.filter(g,t.filter)),t.setPos&&(g.pos=r),g}n.simplify=function(e){var t={};if(!e.length)return\"\";if(1===e.length&&\"string\"==typeof e[0])return e[0];for(var r in e.forEach((function(e){if(\"object\"==typeof e){t[e.tagName]||(t[e.tagName]=[]);var r=n.simplify(e.children||[]);t[e.tagName].push(r),e.attributes&&(r._attributes=e.attributes)}})),t)1==t[r].length&&(t[r]=t[r][0]);return t},n.filter=function(e,t){var r=[];return e.forEach((function(e){if(\"object\"==typeof e&&t(e)&&r.push(e),e.children){var i=n.filter(e.children,t);r=r.concat(i)}})),r},n.stringify=function(e){var t=\"\";function r(e){if(e)for(var r=0;r\",r(e.children),t+=\"\"}return r(e),t},n.toContentString=function(e){if(Array.isArray(e)){var t=\"\";return e.forEach((function(e){t=(t+=\" \"+n.toContentString(e)).trim()})),t}return\"object\"==typeof e?n.toContentString(e.children):\" \"+e},n.getElementById=function(e,t,r){var i=n(e,{attrValue:t});return r?n.simplify(i):i[0]},n.getElementsByClassName=function(e,t,r){const i=n(e,{attrName:\"class\",attrValue:\"[a-zA-Z0-9-s ]*\"+t+\"[a-zA-Z0-9-s ]*\"});return r?n.simplify(i):i},n.parseStream=function(t,r){if(\"string\"==typeof r&&(r=r.length+2),\"string\"==typeof t){var i=e(\"fs\");t=i.createReadStream(t,{start:r}),r=0}var o=r,a=\"\";return t.on(\"data\",(function(e){a+=e;for(var r=0;;){if(!(o=a.indexOf(\"<\",o)+1))return void(o=r);if(\"/\"!==a[o+1]){var i=n(a,{pos:o-1,parseNode:!0,setPos:!0});if((o=i.pos)>a.length-1||oo.length-1||i>24)/500+a,u=a-(e[i+2]<<24>>24)/200,l=void 0,f=void 0,c=void 0;f=-.9689*(s=.95047*(s*s*s>.008856?s*s*s:(s-16/116)/7.787))+1.8758*(a=1*(a*a*a>.008856?a*a*a:(a-16/116)/7.787))+.0415*(u=1.08883*(u*u*u>.008856?u*u*u:(u-16/116)/7.787)),c=.0557*s+-.204*a+1.057*u,l=(l=3.2406*s+-1.5372*a+-.4986*u)>.0031308?1.055*Math.pow(l,1/2.4)-.055:12.92*l,f=f>.0031308?1.055*Math.pow(f,1/2.4)-.055:12.92*f,c=c>.0031308?1.055*Math.pow(c,1/2.4)-.055:12.92*c,n[o]=255*Math.max(0,Math.min(1,l)),n[o+1]=255*Math.max(0,Math.min(1,f)),n[o+2]=255*Math.max(0,Math.min(1,c))}return n}},{}],IKSA:[function(e,t,r){\"use strict\";function n(e,t){var r=e.length-t,n=0;do{for(var i=t;i>0;i--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function i(e,t,r){for(var n=0,i=e.length,o=i/r;i>t;){for(var a=t;a>0;--a)e[n+t]+=e[n],++n;i-=t}for(var s=e.slice(),u=0;u=e.byteLength);++c){var h=void 0;if(2===t){switch(a[0]){case 8:h=new Uint8Array(e,c*f*r*l,f*r*l);break;case 16:h=new Uint16Array(e,c*f*r*l,f*r*l/2);break;case 32:h=new Uint32Array(e,c*f*r*l,f*r*l/4);break;default:throw new Error(\"Predictor 2 not allowed with \".concat(a[0],\" bits per sample.\"))}n(h,f)}else 3===t&&i(h=new Uint8Array(e,c*f*r*l,f*r*l),f,l)}return e}},{}],FJDe:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"@babel/runtime/regenerator\")),i=u(e(\"@babel/runtime/helpers/asyncToGenerator\")),o=u(e(\"@babel/runtime/helpers/classCallCheck\")),a=u(e(\"@babel/runtime/helpers/createClass\")),s=e(\"../predictor\");function u(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(){(0,o.default)(this,e)}return(0,a.default)(e,[{key:\"decode\",value:function(){var e=(0,i.default)(n.default.mark((function e(t,r){var i,o,a,u,l;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decodeBlock(r);case 2:if(i=e.sent,1===(o=t.Predictor||1)){e.next=9;break}return a=!t.StripOffsets,u=a?t.TileWidth:t.ImageWidth,l=a?t.TileLength:t.RowsPerStrip||t.ImageLength,e.abrupt(\"return\",(0,s.applyPredictor)(i,o,u,l,t.BitsPerSample,t.PlanarConfiguration));case 9:return e.abrupt(\"return\",i);case 10:case\"end\":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()}]),e}();r.default=l},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"../predictor\":\"IKSA\"}],V9bQ:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"@babel/runtime/helpers/classCallCheck\")),i=u(e(\"@babel/runtime/helpers/createClass\")),o=u(e(\"@babel/runtime/helpers/inherits\")),a=u(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),s=u(e(\"@babel/runtime/helpers/getPrototypeOf\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=function(e){(0,o.default)(r,e);var t=l(r);function r(){return(0,n.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:\"decodeBlock\",value:function(e){return e}}]),r}(u(e(\"./basedecoder\")).default);r.default=f},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./basedecoder\":\"FJDe\"}],tcId:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=l(e(\"@babel/runtime/helpers/classCallCheck\")),i=l(e(\"@babel/runtime/helpers/createClass\")),o=l(e(\"@babel/runtime/helpers/inherits\")),a=l(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),s=l(e(\"@babel/runtime/helpers/getPrototypeOf\")),u=l(e(\"./basedecoder\"));function l(e){return e&&e.__esModule?e:{default:e}}function f(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}function c(e,t){for(var r=t.length-1;r>=0;r--)e.push(t[r]);return e}function h(e){for(var t=new Uint16Array(4093),r=new Uint8Array(4093),n=0;n<=257;n++)t[n]=4096,r[n]=n;var i=258,o=9,a=0;function s(){i=258,o=9}function u(e){var t=function(e,t,r){var n=t%8,i=Math.floor(t/8),o=8-n,a=t+r-8*(i+1),s=8*(i+2)-(t+r),u=8*(i+2)-t;if(s=Math.max(0,s),i>=e.length)return console.warn(\"ran off the end of the buffer before finding EOI_CODE (end on input code)\"),257;var l=e[i]&Math.pow(2,8-n)-1,f=l<<=r-o;if(i+1>>s;f+=c<<=Math.max(0,r-u)}if(a>8&&i+2>>h}return f}(e,a,o);return a+=o,t}function l(e,n){return r[i]=n,t[i]=e,++i-1}function f(e){for(var n=[],i=e;4096!==i;i=t[i])n.push(r[i]);return n}var h=[];s();for(var d,p=new Uint8Array(e),b=u(p);257!==b;){if(256===b){for(s(),b=u(p);256===b;)b=u(p);if(257===b)break;if(b>256)throw new Error(\"corrupted code at scanline \".concat(b));c(h,f(b)),d=b}else if(b=Math.pow(2,o)&&(12===o?d=void 0:o++),b=u(p)}return new Uint8Array(h)}var d=function(e){(0,o.default)(r,e);var t=f(r);function r(){return(0,n.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:\"decodeBlock\",value:function(e){return h(e).buffer}}]),r}(u.default);r.default=d},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./basedecoder\":\"FJDe\"}],J7kk:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=f(e(\"@babel/runtime/helpers/inherits\")),i=f(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),o=f(e(\"@babel/runtime/helpers/getPrototypeOf\")),a=f(e(\"@babel/runtime/helpers/classCallCheck\")),s=f(e(\"@babel/runtime/helpers/createClass\")),u=f(e(\"@babel/runtime/helpers/typeof\")),l=f(e(\"./basedecoder\"));function f(e){return e&&e.__esModule?e:{default:e}}function c(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,o.default)(e);if(t){var a=(0,o.default)(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return(0,i.default)(this,r)}}var h=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),d=4017,p=799,b=3406,y=2276,v=1567,g=3784,m=5793,w=2896;function _(e,t){for(var r=0,n=[],i=16;i>0&&!e[i-1];)--i;n.push({children:[],index:0});for(var o,a=n[0],s=0;s0;)a=n.pop();for(a.index++,n.push(a);n.length<=s;)n.push(o={children:[],index:0}),a.children[a.index]=o.children,a=o;r++}s+10)return b>>--y&1;if(255===(b=e[p++])){var t=e[p++];if(t)throw new Error(\"unexpected marker: \".concat((b<<8|t).toString(16)))}return y=7,b>>>7}function g(e){for(var t,r=e;null!==(t=v());){if(\"number\"==typeof(r=r[t]))return r;if(\"object\"!==(0,u.default)(r))throw new Error(\"invalid huffman sequence\")}return null}function m(e){for(var t=e,r=0;t>0;){var n=v();if(null===n)return;r=r<<1|n,--t}return r}function w(e){var t=m(e);return t>=1<0)k--;else for(var r=o,n=a;r<=n;){var i=g(e.huffmanTableAC),s=15&i,u=i>>4;if(0===s){if(u<15){k=m(u)+(1<>4,0===c)i<15?(k=m(i)+(1<>4;if(0===a){if(s<15)break;i+=16}else t[h[i+=s]]=w(a),i++}};var A,I,D=0;I=1===M?n[0].blocksPerLine*n[0].blocksPerColumn:f*r.mcusPerColumn;for(var L=i||I;D=65488&&A<=65495))break;p+=2}return p-d}function x(e,t){var r=[],n=t.blocksPerLine,i=t.blocksPerColumn,o=n<<3,a=new Int32Array(64),s=new Uint8Array(64);function u(e,r,n){var i,o,a,s,u,l,f,c,h,_,k=t.quantizationTable,x=n;for(_=0;_<64;_++)x[_]=e[_]*k[_];for(_=0;_<8;++_){var S=8*_;0!==x[1+S]||0!==x[2+S]||0!==x[3+S]||0!==x[4+S]||0!==x[5+S]||0!==x[6+S]||0!==x[7+S]?(i=m*x[0+S]+128>>8,o=m*x[4+S]+128>>8,a=x[2+S],s=x[6+S],u=w*(x[1+S]-x[7+S])+128>>8,c=w*(x[1+S]+x[7+S])+128>>8,l=x[3+S]<<4,f=x[5+S]<<4,h=i-o+1>>1,i=i+o+1>>1,o=h,h=a*g+s*v+128>>8,a=a*v-s*g+128>>8,s=h,h=u-f+1>>1,u=u+f+1>>1,f=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=o-a+1>>1,o=o+a+1>>1,a=h,h=u*y+c*b+2048>>12,u=u*b-c*y+2048>>12,c=h,h=l*p+f*d+2048>>12,l=l*d-f*p+2048>>12,f=h,x[0+S]=i+c,x[7+S]=i-c,x[1+S]=o+f,x[6+S]=o-f,x[2+S]=a+l,x[5+S]=a-l,x[3+S]=s+u,x[4+S]=s-u):(h=m*x[0+S]+512>>10,x[0+S]=h,x[1+S]=h,x[2+S]=h,x[3+S]=h,x[4+S]=h,x[5+S]=h,x[6+S]=h,x[7+S]=h)}for(_=0;_<8;++_){var O=_;0!==x[8+O]||0!==x[16+O]||0!==x[24+O]||0!==x[32+O]||0!==x[40+O]||0!==x[48+O]||0!==x[56+O]?(i=m*x[0+O]+2048>>12,o=m*x[32+O]+2048>>12,a=x[16+O],s=x[48+O],u=w*(x[8+O]-x[56+O])+2048>>12,c=w*(x[8+O]+x[56+O])+2048>>12,l=x[24+O],f=x[40+O],h=i-o+1>>1,i=i+o+1>>1,o=h,h=a*g+s*v+2048>>12,a=a*v-s*g+2048>>12,s=h,h=u-f+1>>1,u=u+f+1>>1,f=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=o-a+1>>1,o=o+a+1>>1,a=h,h=u*y+c*b+2048>>12,u=u*b-c*y+2048>>12,c=h,h=l*p+f*d+2048>>12,l=l*d-f*p+2048>>12,f=h,x[0+O]=i+c,x[56+O]=i-c,x[8+O]=o+f,x[48+O]=o-f,x[16+O]=a+l,x[40+O]=a-l,x[24+O]=s+u,x[32+O]=s-u):(h=m*n[_+0]+8192>>14,x[0+O]=h,x[8+O]=h,x[16+O]=h,x[24+O]=h,x[32+O]=h,x[40+O]=h,x[48+O]=h,x[56+O]=h)}for(_=0;_<64;++_){var T=128+(x[_]+8>>4);r[_]=T<0?0:T>255?255:T}}for(var l=0;l>4==0)for(var c=0;c<64;c++)f[h[c]]=e[t++];else{if(l>>4!=1)throw new Error(\"DQT: invalid table spec\");for(var d=0;d<64;d++)f[h[d]]=r()}this.quantizationTables[15&l]=f}break;case 65472:case 65473:case 65474:r();for(var p={extended:65473===a,progressive:65474===a,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},b=e[t++],y=void 0,v=0;v>4,m=15&e[t+1],w=e[t+2];p.componentsOrder.push(y),p.components[y]={h:g,v:m,quantizationIdx:w},t+=3}n(p),this.frames.push(p);break;case 65476:for(var x=r(),S=2;S>4==0?this.huffmanTablesDC[15&O]=_(T,P):this.huffmanTablesAC[15&O]=_(T,P)}break;case 65501:r(),this.resetInterval=r();break;case 65498:r();for(var R=e[t++],M=[],A=this.frames[0],I=0;I>4],D.huffmanTableAC=this.huffmanTablesAC[15&L],M.push(D)}var N=e[t++],F=e[t++],U=e[t++],B=k(e,t,A,M,this.resetInterval,N,F,U>>4,15&U);t+=B;break;case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error(\"unknown JPEG marker \".concat(a.toString(16)))}a=r()}}},{key:\"getResult\",value:function(){var e=this.frames;if(0===this.frames.length)throw new Error(\"no frames were decoded\");this.frames.length>1&&console.warn(\"more than one frame is not supported\");for(var t=0;t>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},{}],X4kj:[function(e,t,r){\"use strict\";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s>>8^o[255&(e^t[s])];return-1^e}},{}],LP5M:[function(e,t,r){\"use strict\";t.exports=function(e,t){var r,n,i,o,a,s,u,l,f,c,h,d,p,b,y,v,g,m,w,_,k,x,S,O,T;r=e.state,n=e.next_in,O=e.input,i=n+(e.avail_in-5),o=e.next_out,T=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=r.dmax,l=r.wsize,f=r.whave,c=r.wnext,h=r.window,d=r.hold,p=r.bits,b=r.lencode,y=r.distcode,v=(1<>>=w=m>>>24,p-=w,0==(w=m>>>16&255))T[o++]=65535&m;else{if(!(16&w)){if(0==(64&w)){m=b[(65535&m)+(d&(1<>>=w,p-=w),p<15&&(d+=O[n++]<>>=w=m>>>24,p-=w,!(16&(w=m>>>16&255))){if(0==(64&w)){m=y[(65535&m)+(d&(1<u){e.msg=\"invalid distance too far back\",r.mode=30;break e}if(d>>>=w,p-=w,k>(w=o-a)){if((w=k-w)>f&&r.sane){e.msg=\"invalid distance too far back\",r.mode=30;break e}if(x=0,S=h,0===c){if(x+=l-w,w<_){_-=w;do{T[o++]=h[x++]}while(--w);x=o-k,S=T}}else if(c2;)T[o++]=S[x++],T[o++]=S[x++],T[o++]=S[x++],_-=3;_&&(T[o++]=S[x++],_>1&&(T[o++]=S[x++]))}else{x=o-k;do{T[o++]=T[x++],T[o++]=T[x++],T[o++]=T[x++],_-=3}while(_>2);_&&(T[o++]=T[x++],_>1&&(T[o++]=T[x++]))}break}}break}}while(n>3,d&=(1<<(p-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n=1&&0===L[E];E--);if(C>E&&(C=E),0===E)return f[c++]=20971520,f[c++]=20971520,d.bits=1,0;for(T=1;T0&&(0===e||1!==E))return-1;for(N[1]=0,S=1;S852||2===e&&M>592)return 1;for(;;){w=S-j,h[O]m?(_=F[U+h[O]],k=I[D+h[O]]):(_=96,k=0),p=1<>j)+(b-=p)]=w<<24|_<<16|k|0}while(0!==b);for(p=1<>=1;if(0!==p?(A&=p-1,A+=p):A=0,O++,0==--L[S]){if(S===E)break;S=t[r+h[O]]}if(S>C&&(A&v)!==y){for(0===j&&(j=C),g+=T,R=1<<(P=S-j);P+j852||2===e&&M>592)return 1;f[y=A&v]=C<<24|P<<16|g-c|0}}return 0!==A&&(f[g+A]=S-j<<24|64<<16|0),d.bits=C,0}},{\"../utils/common\":\"tbG5\"}],GIDK:[function(e,t,r){\"use strict\";var n=e(\"../utils/common\"),i=e(\"./adler32\"),o=e(\"./crc32\"),a=e(\"./inffast\"),s=e(\"./inftrees\"),u=-2,l=12,f=30;function c(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):u}function p(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,d(e)):u}function b(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?u:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,p(e))):u}function y(e,t){var r,n;return e?(n=new h,e.state=n,n.window=null,0!==(r=b(e,t))&&(e.state=null),r):u}var v,g,m=!0;function w(e){if(m){var t;for(v=new n.Buf32(512),g=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,v,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,g,0,e.work,{bits:5}),m=!1}e.lencode=v,e.lenbits=9,e.distcode=g,e.distbits=5}function _(e,t,r,i){var o,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=o(r.check,F,2,0),g=0,m=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg=\"incorrect header check\",r.mode=f;break}if(8!=(15&g)){e.msg=\"unknown compression method\",r.mode=f;break}if(m-=4,A=8+(15&(g>>>=4)),0===r.wbits)r.wbits=A;else if(A>r.wbits){e.msg=\"invalid window size\",r.mode=f;break}r.dmax=1<>8&1),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0)),g=0,m=0,r.mode=3;case 3:for(;m<32;){if(0===y)break e;y--,g+=h[p++]<>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,r.check=o(r.check,F,4,0)),g=0,m=0,r.mode=4;case 4:for(;m<16;){if(0===y)break e;y--,g+=h[p++]<>8),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0)),g=0,m=0,r.mode=5;case 5:if(1024&r.flags){for(;m<16;){if(0===y)break e;y--,g+=h[p++]<>>8&255,r.check=o(r.check,F,2,0)),g=0,m=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((S=r.length)>y&&(S=y),S&&(r.head&&(A=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,p,S,A)),512&r.flags&&(r.check=o(r.check,h,S,p)),y-=S,p+=S,r.length-=S),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===y)break e;S=0;do{A=h[p+S++],r.head&&A&&r.length<65536&&(r.head.name+=String.fromCharCode(A))}while(A&&S>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=l;break;case 10:for(;m<32;){if(0===y)break e;y--,g+=h[p++]<>>=7&m,m-=7&m,r.mode=27;break}for(;m<3;){if(0===y)break e;y--,g+=h[p++]<>>=1)){case 0:r.mode=14;break;case 1:if(w(r),r.mode=20,6===t){g>>>=2,m-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg=\"invalid block type\",r.mode=f}g>>>=2,m-=2;break;case 14:for(g>>>=7&m,m-=7&m;m<32;){if(0===y)break e;y--,g+=h[p++]<>>16^65535)){e.msg=\"invalid stored block lengths\",r.mode=f;break}if(r.length=65535&g,g=0,m=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(S=r.length){if(S>y&&(S=y),S>v&&(S=v),0===S)break e;n.arraySet(d,h,p,S,b),y-=S,p+=S,v-=S,b+=S,r.length-=S;break}r.mode=l;break;case 17:for(;m<14;){if(0===y)break e;y--,g+=h[p++]<>>=5,m-=5,r.ndist=1+(31&g),g>>>=5,m-=5,r.ncode=4+(15&g),g>>>=4,m-=4,r.nlen>286||r.ndist>30){e.msg=\"too many length or distance symbols\",r.mode=f;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,m-=3}for(;r.have<19;)r.lens[U[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,D={bits:r.lenbits},I=s(0,r.lens,0,19,r.lencode,0,r.work,D),r.lenbits=D.bits,I){e.msg=\"invalid code lengths set\",r.mode=f;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,P=65535&N,!((E=N>>>24)<=m);){if(0===y)break e;y--,g+=h[p++]<>>=E,m-=E,r.lens[r.have++]=P;else{if(16===P){for(L=E+2;m>>=E,m-=E,0===r.have){e.msg=\"invalid bit length repeat\",r.mode=f;break}A=r.lens[r.have-1],S=3+(3&g),g>>>=2,m-=2}else if(17===P){for(L=E+3;m>>=E)),g>>>=3,m-=3}else{for(L=E+7;m>>=E)),g>>>=7,m-=7}if(r.have+S>r.nlen+r.ndist){e.msg=\"invalid bit length repeat\",r.mode=f;break}for(;S--;)r.lens[r.have++]=A}}if(r.mode===f)break;if(0===r.lens[256]){e.msg=\"invalid code -- missing end-of-block\",r.mode=f;break}if(r.lenbits=9,D={bits:r.lenbits},I=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,D),r.lenbits=D.bits,I){e.msg=\"invalid literal/lengths set\",r.mode=f;break}if(r.distbits=6,r.distcode=r.distdyn,D={bits:r.distbits},I=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,D),r.distbits=D.bits,I){e.msg=\"invalid distances set\",r.mode=f;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(y>=6&&v>=258){e.next_out=b,e.avail_out=v,e.next_in=p,e.avail_in=y,r.hold=g,r.bits=m,a(e,x),b=e.next_out,d=e.output,v=e.avail_out,p=e.next_in,h=e.input,y=e.avail_in,g=r.hold,m=r.bits,r.mode===l&&(r.back=-1);break}for(r.back=0;C=(N=r.lencode[g&(1<>>16&255,P=65535&N,!((E=N>>>24)<=m);){if(0===y)break e;y--,g+=h[p++]<>j)])>>>16&255,P=65535&N,!(j+(E=N>>>24)<=m);){if(0===y)break e;y--,g+=h[p++]<>>=j,m-=j,r.back+=j}if(g>>>=E,m-=E,r.back+=E,r.length=P,0===C){r.mode=26;break}if(32&C){r.back=-1,r.mode=l;break}if(64&C){e.msg=\"invalid literal/length code\",r.mode=f;break}r.extra=15&C,r.mode=22;case 22:if(r.extra){for(L=r.extra;m>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;C=(N=r.distcode[g&(1<>>16&255,P=65535&N,!((E=N>>>24)<=m);){if(0===y)break e;y--,g+=h[p++]<>j)])>>>16&255,P=65535&N,!(j+(E=N>>>24)<=m);){if(0===y)break e;y--,g+=h[p++]<>>=j,m-=j,r.back+=j}if(g>>>=E,m-=E,r.back+=E,64&C){e.msg=\"invalid distance code\",r.mode=f;break}r.offset=P,r.extra=15&C,r.mode=24;case 24:if(r.extra){for(L=r.extra;m>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg=\"invalid distance too far back\",r.mode=f;break}r.mode=25;case 25:if(0===v)break e;if(S=x-v,r.offset>S){if((S=r.offset-S)>r.whave&&r.sane){e.msg=\"invalid distance too far back\",r.mode=f;break}S>r.wnext?(S-=r.wnext,O=r.wsize-S):O=r.wnext-S,S>r.length&&(S=r.length),T=r.window}else T=d,O=b-r.offset,S=r.length;S>v&&(S=v),v-=S,r.length-=S;do{d[b++]=T[O++]}while(--S);0===r.length&&(r.mode=21);break;case 26:if(0===v)break e;d[b++]=r.length,v--,r.mode=21;break;case 27:if(r.wrap){for(;m<32;){if(0===y)break e;y--,g|=h[p++]<=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r=\"\",a=0;a>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},r.buf2binstring=function(e){return u(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r4)l[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r1?l[n++]=65533:i<65536?l[n++]=i:(i-=65536,l[n++]=55296|i>>10&1023,l[n++]=56320|1023&i)}return u(l,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}},{\"./common\":\"tbG5\"}],xUUw:[function(e,t,r){\"use strict\";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],gMAY:[function(e,t,r){\"use strict\";t.exports={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"}},{}],bdtv:[function(e,t,r){\"use strict\";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},{}],WIli:[function(e,t,r){\"use strict\";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1}},{}],faQk:[function(e,t,r){\"use strict\";var n=e(\"./zlib/inflate\"),i=e(\"./utils/common\"),o=e(\"./utils/strings\"),a=e(\"./zlib/constants\"),s=e(\"./zlib/messages\"),u=e(\"./zlib/zstream\"),l=e(\"./zlib/gzheader\"),f=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:\"\"},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);if(this.header=new l,n.inflateGetHeader(this.strm,this.header),t.dictionary&&(\"string\"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):\"[object ArrayBuffer]\"===f.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw new Error(s[r])}function h(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}c.prototype.push=function(e,t){var r,s,u,l,c,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,b=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,\"string\"==typeof e?h.input=o.binstring2buf(e):\"[object ArrayBuffer]\"===f.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===b&&(r=a.Z_OK,b=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==a.Z_STREAM_END&&(0!==h.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||(\"string\"===this.options.to?(u=o.utf8border(h.output,h.next_out),l=h.next_out-u,c=o.buf2string(h.output,u),h.next_out=l,h.avail_out=d-l,l&&i.arraySet(h.output,h.output,u,l,0),this.onData(c)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(b=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),h.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){e===a.Z_OK&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=c,r.inflate=h,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},r.ungzip=h},{\"./zlib/inflate\":\"GIDK\",\"./utils/common\":\"tbG5\",\"./utils/strings\":\"Q3ZD\",\"./zlib/constants\":\"xUUw\",\"./zlib/messages\":\"gMAY\",\"./zlib/zstream\":\"bdtv\",\"./zlib/gzheader\":\"WIli\"}],JAiC:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=l(e(\"@babel/runtime/helpers/classCallCheck\")),i=l(e(\"@babel/runtime/helpers/createClass\")),o=l(e(\"@babel/runtime/helpers/inherits\")),a=l(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),s=l(e(\"@babel/runtime/helpers/getPrototypeOf\")),u=e(\"pako/lib/inflate\");function l(e){return e&&e.__esModule?e:{default:e}}function f(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var c=function(e){(0,o.default)(r,e);var t=f(r);function r(){return(0,n.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:\"decodeBlock\",value:function(e){return(0,u.inflate)(new Uint8Array(e)).buffer}}]),r}(l(e(\"./basedecoder\")).default);r.default=c},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"pako/lib/inflate\":\"faQk\",\"./basedecoder\":\"FJDe\"}],OcPz:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"@babel/runtime/helpers/classCallCheck\")),i=u(e(\"@babel/runtime/helpers/createClass\")),o=u(e(\"@babel/runtime/helpers/inherits\")),a=u(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),s=u(e(\"@babel/runtime/helpers/getPrototypeOf\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=function(e){(0,o.default)(r,e);var t=l(r);function r(){return(0,n.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:\"decodeBlock\",value:function(e){for(var t=new DataView(e),r=[],n=0;n3&&void 0!==arguments[3]?arguments[3]:1;return new(Object.getPrototypeOf(e).constructor)(t*r*n)}function i(e,t,r,i,o){var a=t/i,s=r/o;return e.map((function(e){for(var u=n(e,i,o),l=0;l5&&void 0!==arguments[5]?arguments[5]:\"nearest\";switch(s.toLowerCase()){case\"nearest\":return i(e,t,r,n,o);case\"bilinear\":case\"linear\":return a(e,t,r,n,o);default:throw new Error(\"Unsupported resampling method: '\".concat(s,\"'\"))}},r.resampleNearestInterleaved=s,r.resampleBilinearInterleaved=u,r.resampleInterleaved=function(e,t,r,n,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:\"nearest\";switch(a.toLowerCase()){case\"nearest\":return s(e,t,r,n,i,o);case\"bilinear\":case\"linear\":return u(e,t,r,n,i,o);default:throw new Error(\"Unsupported resampling method: '\".concat(a,\"'\"))}}},{}],eOWo:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=p(e(\"@babel/runtime/helpers/slicedToArray\")),i=p(e(\"@babel/runtime/regenerator\")),o=p(e(\"@babel/runtime/helpers/asyncToGenerator\")),a=p(e(\"@babel/runtime/helpers/classCallCheck\")),s=p(e(\"@babel/runtime/helpers/createClass\")),u=e(\"@petamoriken/float16\"),l=p(e(\"txml\")),f=e(\"./globals\"),c=e(\"./rgb\"),h=e(\"./compression\"),d=e(\"./resample\");function p(e){return e&&e.__esModule?e:{default:e}}function b(e,t,r){for(var n=0,i=t;i>8-i-_&f;else if(_+i<=16)l[m]=s.getUint16(w)>>16-i-_&f;else if(_+i<=24){var k=s.getUint16(w)<<8|s.getUint8(w+2);l[m]=k>>24-i-_&f}else l[m]=s.getUint32(w)>>32-i-_&f}}return l.buffer}var m=function(){function e(t,r,n,i,o,s){(0,a.default)(this,e),this.fileDirectory=t,this.geoKeys=r,this.dataView=n,this.littleEndian=i,this.tiles=o?{}:null,this.isTiled=!t.StripOffsets;var u=t.PlanarConfiguration;if(this.planarConfiguration=void 0===u?1:u,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error(\"Invalid planar configuration.\");this.source=s}return(0,s.default)(e,[{key:\"getFileDirectory\",value:function(){return this.fileDirectory}},{key:\"getGeoKeys\",value:function(){return this.geoKeys}},{key:\"getWidth\",value:function(){return this.fileDirectory.ImageWidth}},{key:\"getHeight\",value:function(){return this.fileDirectory.ImageLength}},{key:\"getSamplesPerPixel\",value:function(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}},{key:\"getTileWidth\",value:function(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}},{key:\"getTileHeight\",value:function(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}},{key:\"getBlockWidth\",value:function(){return this.getTileWidth()}},{key:\"getBlockHeight\",value:function(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}},{key:\"getBytesPerPixel\",value:function(){for(var e=0,t=0;t=this.fileDirectory.BitsPerSample.length)throw new RangeError(\"Sample index \".concat(e,\" is out of range.\"));return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}},{key:\"getReaderForSample\",value:function(e){var t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,r=this.fileDirectory.BitsPerSample[e];switch(t){case 1:if(r<=8)return DataView.prototype.getUint8;if(r<=16)return DataView.prototype.getUint16;if(r<=32)return DataView.prototype.getUint32;break;case 2:if(r<=8)return DataView.prototype.getInt8;if(r<=16)return DataView.prototype.getInt16;if(r<=32)return DataView.prototype.getInt32;break;case 3:switch(r){case 16:return function(e,t){return(0,u.getFloat16)(this,e,t)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error(\"Unsupported data format/bitsPerSample\")}},{key:\"getSampleFormat\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}},{key:\"getBitsPerSample\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.BitsPerSample[e]}},{key:\"getArrayForSample\",value:function(e,t){return y(this.getSampleFormat(e),this.getBitsPerSample(e),t)}},{key:\"getTileOrStrip\",value:function(){var e=(0,o.default)(i.default.mark((function e(t,r,n,a,s){var u,l,f,c,h,d,p,b,y=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=Math.ceil(this.getWidth()/this.getTileWidth()),l=Math.ceil(this.getHeight()/this.getTileHeight()),c=this.tiles,1===this.planarConfiguration?f=r*u+t:2===this.planarConfiguration&&(f=n*u*l+r*u+t),this.isTiled?(h=this.fileDirectory.TileOffsets[f],d=this.fileDirectory.TileByteCounts[f]):(h=this.fileDirectory.StripOffsets[f],d=this.fileDirectory.StripByteCounts[f]),e.next=7,this.source.fetch([{offset:h,length:d}],s);case 7:return p=e.sent[0],null!==c&&c[f]?b=c[f]:(b=(0,o.default)(i.default.mark((function e(){var t,n,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.decode(y.fileDirectory,p);case 2:return t=e.sent,n=y.getSampleFormat(),o=y.getBitsPerSample(),v(n,o)&&(t=g(t,n,y.planarConfiguration,y.getSamplesPerPixel(),o,y.getTileWidth(),y.getBlockHeight(r))),e.abrupt(\"return\",t);case 7:case\"end\":return e.stop()}}),e)})))(),null!==c&&(c[f]=b)),e.t0=t,e.t1=r,e.t2=n,e.next=14,b;case 14:return e.t3=e.sent,e.abrupt(\"return\",{x:e.t0,y:e.t1,sample:e.t2,data:e.t3});case 16:case\"end\":return e.stop()}}),e,this)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}()},{key:\"_readRaster\",value:function(){var e=(0,o.default)(i.default.mark((function e(t,r,n,o,a,s,u,l,f){var c,h,p,y,v,g,m,w,_,k,x,S,O,T,E,C,P,j,R=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(c=this.getTileWidth(),h=this.getTileHeight(),p=Math.max(Math.floor(t[0]/c),0),y=Math.min(Math.ceil(t[2]/c),Math.ceil(this.getWidth()/this.getTileWidth())),v=Math.max(Math.floor(t[1]/h),0),g=Math.min(Math.ceil(t[3]/h),Math.ceil(this.getHeight()/this.getTileHeight())),m=t[2]-t[0],w=this.getBytesPerPixel(),_=[],k=[],x=0;x0&&void 0!==j[0]?j[0]:{},r=t.window,n=t.samples,o=void 0===n?[]:n,a=t.interleave,s=t.pool,u=void 0===s?null:s,l=t.width,f=t.height,c=t.resampleMethod,d=t.fillValue,p=t.signal,!((b=r||[0,0,this.getWidth(),this.getHeight()])[0]>b[2]||b[1]>b[3])){e.next=4;break}throw new Error(\"Invalid subsets\");case 4:if(v=b[2]-b[0],g=b[3]-b[1],m=v*g,w=this.getSamplesPerPixel(),o&&o.length){e.next=12;break}for(_=0;_=w)){e.next=16;break}return e.abrupt(\"return\",Promise.reject(new RangeError(\"Invalid sample index '\".concat(o[k],\"'.\"))));case 16:++k,e.next=13;break;case 19:if(a)S=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,O=Math.max.apply(null,this.fileDirectory.BitsPerSample),x=y(S,O,m*o.length),d&&x.fill(d);else for(x=[],T=0;T0&&void 0!==S[0]?S[0]:{},r=t.window,n=t.pool,o=void 0===n?null:n,a=t.width,s=t.height,u=t.resampleMethod,l=t.enableAlpha,h=void 0!==l&&l,d=t.signal,!((p=r||[0,0,this.getWidth(),this.getHeight()])[0]>p[2]||p[1]>p[3])){e.next=4;break}throw new Error(\"Invalid subsets\");case 4:if((b=this.fileDirectory.PhotometricInterpretation)!==f.photometricInterpretations.RGB){e.next=9;break}if(y=[0,1,2],this.fileDirectory.ExtraSamples!==f.ExtraSamplesValues.Unspecified&&h)for(y=[],v=0;v0&&void 0!==arguments[0]?arguments[0]:null,t={};if(!this.fileDirectory.GDAL_METADATA)return null;var r=this.fileDirectory.GDAL_METADATA,n=(0,l.default)(r.substring(0,r.length-1));if(!n[0].tagName)throw new Error(\"Failed to parse GDAL metadata XML.\");var i=n[0];if(\"GDALMetadata\"!==i.tagName)throw new Error(\"Unexpected GDAL metadata XML tag.\");var o=i.children.filter((function(e){return\"Item\"===e.tagName}));null!==e&&(o=o.filter((function(t){return Number(t.attributes.sample)===e})));for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:null,t=this.fileDirectory.ModelPixelScale,r=this.fileDirectory.ModelTransformation;if(t)return[t[0],-t[1],t[2]];if(r)return[r[0],r[5],r[10]];if(e){var i=e.getResolution(),o=(0,n.default)(i,3),a=o[0],s=o[1],u=o[2];return[a*e.getWidth()/this.getWidth(),s*e.getHeight()/this.getHeight(),u*e.getWidth()/this.getWidth()]}throw new Error(\"The image does not have an affine transformation.\")}},{key:\"pixelIsArea\",value:function(){return 1===this.geoKeys.GTRasterTypeGeoKey}},{key:\"getBoundingBox\",value:function(){var e=this.getOrigin(),t=this.getResolution(),r=e[0],n=e[1],i=r+t[0]*this.getWidth(),o=n+t[1]*this.getHeight();return[Math.min(r,i),Math.min(n,o),Math.max(r,i),Math.max(n,o)]}}]),e}();r.default=m},{\"@babel/runtime/helpers/slicedToArray\":\"HETk\",\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@petamoriken/float16\":\"Stm8\",txml:\"JO74\",\"./globals\":\"j27V\",\"./rgb\":\"fpBl\",\"./compression\":\"FGCZ\",\"./resample\":\"OQju\"}],dqpX:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"@babel/runtime/helpers/classCallCheck\")),i=a(e(\"@babel/runtime/helpers/createClass\")),o=e(\"@petamoriken/float16\");function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){(0,n.default)(this,e),this._dataView=new DataView(t)}return(0,i.default)(e,[{key:\"getUint64\",value:function(e,t){var r,n=this.getUint32(e,t),i=this.getUint32(e+4,t);if(t){if(r=n+Math.pow(2,32)*i,!Number.isSafeInteger(r))throw new Error(\"\".concat(r,\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\"));return r}if(r=Math.pow(2,32)*n+i,!Number.isSafeInteger(r))throw new Error(\"\".concat(r,\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\"));return r}},{key:\"getInt64\",value:function(e,t){for(var r=0,n=(128&this._dataView.getUint8(e+(t?7:0)))>0,i=!0,o=0;o<8;o++){var a=this._dataView.getUint8(e+(t?o:7-o));n&&(i?0!==a&&(a=255&~(a-1),i=!1):a=255&~a),r+=a*Math.pow(256,o)}return n&&(r=-r),r}},{key:\"getUint8\",value:function(e,t){return this._dataView.getUint8(e,t)}},{key:\"getInt8\",value:function(e,t){return this._dataView.getInt8(e,t)}},{key:\"getUint16\",value:function(e,t){return this._dataView.getUint16(e,t)}},{key:\"getInt16\",value:function(e,t){return this._dataView.getInt16(e,t)}},{key:\"getUint32\",value:function(e,t){return this._dataView.getUint32(e,t)}},{key:\"getInt32\",value:function(e,t){return this._dataView.getInt32(e,t)}},{key:\"getFloat16\",value:function(e,t){return(0,o.getFloat16)(this._dataView,t)}},{key:\"getFloat32\",value:function(e,t){return this._dataView.getFloat32(e,t)}},{key:\"getFloat64\",value:function(e,t){return this._dataView.getFloat64(e,t)}},{key:\"buffer\",get:function(){return this._dataView.buffer}}]),e}();r.default=s},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@petamoriken/float16\":\"Stm8\"}],dGLV:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"@babel/runtime/helpers/classCallCheck\")),i=o(e(\"@babel/runtime/helpers/createClass\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(){function e(t,r,i,o){(0,n.default)(this,e),this._dataView=new DataView(t),this._sliceOffset=r,this._littleEndian=i,this._bigTiff=o}return(0,i.default)(e,[{key:\"covers\",value:function(e,t){return this.sliceOffset<=e&&this.sliceTop>=e+t}},{key:\"readUint8\",value:function(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}},{key:\"readInt8\",value:function(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}},{key:\"readUint16\",value:function(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}},{key:\"readInt16\",value:function(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}},{key:\"readUint32\",value:function(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}},{key:\"readInt32\",value:function(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}},{key:\"readFloat32\",value:function(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}},{key:\"readFloat64\",value:function(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}},{key:\"readUint64\",value:function(e){var t,r=this.readUint32(e),n=this.readUint32(e+4);if(this._littleEndian){if(t=r+Math.pow(2,32)*n,!Number.isSafeInteger(t))throw new Error(\"\".concat(t,\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\"));return t}if(t=Math.pow(2,32)*r+n,!Number.isSafeInteger(t))throw new Error(\"\".concat(t,\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\"));return t}},{key:\"readInt64\",value:function(e){for(var t=0,r=(128&this._dataView.getUint8(e+(this._littleEndian?7:0)))>0,n=!0,i=0;i<8;i++){var o=this._dataView.getUint8(e+(this._littleEndian?i:7-i));r&&(n?0!==o&&(o=255&~(o-1),n=!1):o=255&~o),t+=o*Math.pow(256,i)}return r&&(t=-t),t}},{key:\"readOffset\",value:function(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}},{key:\"sliceOffset\",get:function(){return this._sliceOffset}},{key:\"sliceTop\",get:function(){return this._sliceOffset+this.buffer.byteLength}},{key:\"littleEndian\",get:function(){return this._littleEndian}},{key:\"bigTiff\",get:function(){return this._bigTiff}},{key:\"buffer\",get:function(){return this._dataView.buffer}}]),e}();r.default=a},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\"}],z2GM:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.extendSerializer=function(e,t){const r=e.deserialize.bind(e),n=e.serialize.bind(e);return{deserialize:e=>t.deserialize(e,r),serialize:e=>t.serialize(e,n)}},r.DefaultSerializer=void 0;const n=e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),i=e=>({__error_marker:\"$$error\",message:e.message,name:e.name,stack:e.stack}),o={deserialize:e=>(e=>e&&\"object\"==typeof e&&\"__error_marker\"in e&&\"$$error\"===e.__error_marker)(e)?n(e):e,serialize:e=>e instanceof Error?i(e):e};r.DefaultSerializer=o},{}],kdjL:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.registerSerializer=function(e){i=(0,n.extendSerializer)(i,e)},r.deserialize=function(e){return i.deserialize(e)},r.serialize=function(e){return i.serialize(e)};var n=e(\"./serializers\");let i=n.DefaultSerializer},{\"./serializers\":\"z2GM\"}],LQHy:[function(e,t,r){\"use strict\";let n;function i(e){return(\"\"+e).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\\/\\/.+)?\\/[^/]+(?:\\?.*)?$/,\"$1\")+\"/\"}Object.defineProperty(r,\"__esModule\",{value:!0}),r.getBaseURL=i,r.getBundleURL=function(){return n||(n=function(){try{throw new Error}catch(e){const t=(\"\"+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\\/\\/[^)\\n]+/g);if(t)return i(t[0])}return\"/\"}()),n}},{}],XK2w:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.selectWorkerImplementation=function(){return\"undefined\"==typeof Worker?class{constructor(){throw Error(\"No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.\")}}:class extends Worker{constructor(e,t){\"string\"==typeof e&&t&&t._baseURL?e=new URL(e,t._baseURL):\"string\"==typeof e&&!o(e)&&(0,n.getBundleURL)().match(/^file:\\/\\//i)&&(e=new URL(e,(0,n.getBundleURL)().replace(/\\/[^\\/]+$/,\"/\")),e=a(`importScripts(${JSON.stringify(e)});`)),\"string\"==typeof e&&o(e)&&(e=a(`importScripts(${JSON.stringify(e)});`)),super(e,t)}}},r.defaultPoolSize=void 0;var n=e(\"./get-bundle-url.browser\");const i=\"undefined\"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;r.defaultPoolSize=i;const o=e=>/^(file|https?:)?\\/\\//i.test(e);function a(e){const t=new Blob([e],{type:\"application/javascript\"});return URL.createObjectURL(t)}},{\"./get-bundle-url.browser\":\"LQHy\"}],IAgR:[function(e,t,r){var n=1e3,i=60*n,o=60*i,a=24*o;function s(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||\"ms\").toLowerCase()){case\"years\":case\"year\":case\"yrs\":case\"yr\":case\"y\":return 315576e5*r;case\"weeks\":case\"week\":case\"w\":return 6048e5*r;case\"days\":case\"day\":case\"d\":return r*a;case\"hours\":case\"hour\":case\"hrs\":case\"hr\":case\"h\":return r*o;case\"minutes\":case\"minute\":case\"mins\":case\"min\":case\"m\":return r*i;case\"seconds\":case\"second\":case\"secs\":case\"sec\":case\"s\":return r*n;case\"milliseconds\":case\"millisecond\":case\"msecs\":case\"msec\":case\"ms\":return r;default:return}}}}function u(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+\"d\":t>=o?Math.round(e/o)+\"h\":t>=i?Math.round(e/i)+\"m\":t>=n?Math.round(e/n)+\"s\":e+\"ms\"}function l(e){var t=Math.abs(e);return t>=a?f(e,t,a,\"day\"):t>=o?f(e,t,o,\"hour\"):t>=i?f(e,t,i,\"minute\"):t>=n?f(e,t,n,\"second\"):e+\" ms\"}function f(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+\" \"+n+(i?\"s\":\"\")}t.exports=function(e,t){t=t||{};var r=typeof e;if(\"string\"===r&&e.length>0)return s(e);if(\"number\"===r&&isFinite(e))return t.long?l(e):u(e);throw new Error(\"val is not a non-empty string or a valid number. val=\"+JSON.stringify(e))}},{}],Kest:[function(e,t,r){t.exports=function(t){function r(e){let t=0;for(let r=0;r{if(\"%%\"===t)return t;s++;const o=n.formatters[i];if(\"function\"==typeof o){const n=e[s];t=o.call(r,n),e.splice(s,1),s--}return t})),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return a.namespace=e,a.enabled=n.enabled(e),a.useColors=n.useColors(),a.color=r(e),a.destroy=i,a.extend=o,\"function\"==typeof n.init&&n.init(a),n.instances.push(a),a}function i(){const e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function o(e,t){const r=n(this.namespace+(void 0===t?\":\":t)+e);return r.log=this.log,r}function a(e){return e.toString().substring(2,e.toString().length-2).replace(/\\.\\*\\?$/,\"*\")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){const e=[...n.names.map(a),...n.skips.map(a).map((e=>\"-\"+e))].join(\",\");return n.enable(\"\"),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=(\"string\"==typeof e?e:\"\").split(/[\\s,]+/),i=r.length;for(t=0;t{n[e]=t[e]})),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=r,n.enable(n.load()),n}},{ms:\"IAgR\"}],jcLW:[function(e,t,r){e(\"process\");var n=e(\"process\");r.log=function(...e){return\"object\"==typeof console&&console.log&&console.log(...e)},r.formatArgs=function(e){if(e[0]=(this.useColors?\"%c\":\"\")+this.namespace+(this.useColors?\" %c\":\" \")+e[0]+(this.useColors?\"%c \":\" \")+\"+\"+t.exports.humanize(this.diff),!this.useColors)return;const r=\"color: \"+this.color;e.splice(1,0,r,\"color: inherit\");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{\"%%\"!==e&&(n++,\"%c\"===e&&(i=n))})),e.splice(i,0,r)},r.save=function(e){try{e?r.storage.setItem(\"debug\",e):r.storage.removeItem(\"debug\")}catch(e){}},r.load=function(){let e;try{e=r.storage.getItem(\"debug\")}catch(e){}return!e&&void 0!==n&&\"env\"in n&&(e=void 0),e},r.useColors=function(){return!(\"undefined\"==typeof window||!window.process||\"renderer\"!==window.process.type&&!window.process.__nwjs)||(\"undefined\"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))&&(\"undefined\"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||\"undefined\"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/))},r.storage=function(){try{return localStorage}catch(e){}}(),r.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"],t.exports=e(\"./common\")(r);const{formatters:i}=t.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return\"[UnexpectedJSONParseError]: \"+e.message}}},{\"./common\":\"Kest\",process:\"pBGv\"}],sfrJ:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.AsyncSerialScheduler=void 0;r.AsyncSerialScheduler=class{constructor(e){this._baseObserver=e,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then((()=>this._baseObserver.complete())).catch((e=>this._baseObserver.error(e)))}error(e){this._baseObserver.error(e)}schedule(e){const t=Promise.all(this._pendingPromises),r=[],n=e=>r.push(e),i=Promise.resolve().then((()=>function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){yield t,yield e(n),this._pendingPromises.delete(i);for(const e of r)this._baseObserver.next(e)})))).catch((e=>{this._pendingPromises.delete(i),this._baseObserver.error(e)}));this._pendingPromises.add(i)}}},{}],lj3f:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.registerObservableSymbol=function(){n()&&!i(\"observable\")&&(Symbol.observable=Symbol(\"observable\"))},r.getSymbol=r.hasSymbol=r.hasSymbols=void 0;const n=()=>\"function\"==typeof Symbol;r.hasSymbols=n;const i=e=>n()&&Boolean(Symbol[e]);r.hasSymbol=i;r.getSymbol=e=>i(e)?Symbol[e]:\"@@\"+e,i(\"asyncIterator\")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for(\"Symbol.asyncIterator\"))},{}],B9l3:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=r.Observable=r.SubscriptionObserver=r.Subscription=void 0;var n=e(\"./_symbols\");const i=(0,n.getSymbol)(\"iterator\"),o=(0,n.getSymbol)(\"observable\"),a=(0,n.getSymbol)(\"species\");function s(e,t){const r=e[t];if(null!=r){if(\"function\"!=typeof r)throw new TypeError(r+\" is not a function\");return r}}function u(e){let t=e.constructor;return void 0!==t&&null===(t=t[a])&&(t=void 0),void 0!==t?t:v}function l(e){l.log?l.log(e):setTimeout((()=>{throw e}),0)}function f(e){Promise.resolve().then((()=>{try{e()}catch(e){l(e)}}))}function c(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if(\"function\"==typeof t)t();else{const e=s(t,\"unsubscribe\");e&&e.call(t)}}catch(e){l(e)}}function h(e){e._observer=void 0,e._queue=void 0,e._state=\"closed\"}function d(e,t,r){e._state=\"running\";const n=e._observer;try{const i=n?s(n,t):void 0;switch(t){case\"next\":i&&i.call(n,r);break;case\"error\":if(h(e),!i)throw r;i.call(n,r);break;case\"complete\":h(e),i&&i.call(n)}}catch(e){l(e)}\"closed\"===e._state?c(e):\"running\"===e._state&&(e._state=\"ready\")}function p(e,t,r){if(\"closed\"!==e._state)return\"buffering\"===e._state?(e._queue=e._queue||[],void e._queue.push({type:t,value:r})):\"ready\"!==e._state?(e._state=\"buffering\",e._queue=[{type:t,value:r}],void f((()=>function(e){const t=e._queue;if(t){e._queue=void 0,e._state=\"ready\";for(const r of t)if(d(e,r.type,r.value),\"closed\"===e._state)break}}(e)))):void d(e,t,r)}class b{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state=\"initializing\";const r=new y(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}\"initializing\"===this._state&&(this._state=\"ready\")}get closed(){return\"closed\"===this._state}unsubscribe(){\"closed\"!==this._state&&(h(this),c(this))}}r.Subscription=b;class y{constructor(e){this._subscription=e}get closed(){return\"closed\"===this._subscription._state}next(e){p(this._subscription,\"next\",e)}error(e){p(this._subscription,\"error\",e)}complete(){p(this._subscription,\"complete\")}}r.SubscriptionObserver=y;class v{constructor(e){if(!(this instanceof v))throw new TypeError(\"Observable cannot be called as a function\");if(\"function\"!=typeof e)throw new TypeError(\"Observable initializer must be a function\");this._subscriber=e}subscribe(e,t,r){return\"object\"==typeof e&&null!==e||(e={next:e,error:t,complete:r}),new b(e,this._subscriber)}pipe(e,...t){let r=this;for(const n of[e,...t])r=n(r);return r}tap(e,t,r){const n=\"object\"!=typeof e||null===e?{next:e,error:t,complete:r}:e;return new v((e=>this.subscribe({next(t){n.next&&n.next(t),e.next(t)},error(t){n.error&&n.error(t),e.error(t)},complete(){n.complete&&n.complete(),e.complete()},start(e){n.start&&n.start(e)}})))}forEach(e){return new Promise(((t,r)=>{if(\"function\"!=typeof e)return void r(new TypeError(e+\" is not a function\"));function n(){i.unsubscribe(),t()}const i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t})}))}map(e){if(\"function\"!=typeof e)throw new TypeError(e+\" is not a function\");return new(u(this))((t=>this.subscribe({next(r){let n=r;try{n=e(r)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}})))}filter(e){if(\"function\"!=typeof e)throw new TypeError(e+\" is not a function\");return new(u(this))((t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}})))}reduce(e,t){if(\"function\"!=typeof e)throw new TypeError(e+\" is not a function\");const r=u(this),n=arguments.length>1;let i=!1,o=t;return new r((t=>this.subscribe({next(r){const a=!i;if(i=!0,!a||n)try{o=e(o,r)}catch(e){return t.error(e)}else o=r},error(e){t.error(e)},complete(){if(!i&&!n)return t.error(new TypeError(\"Cannot reduce an empty sequence\"));t.next(o),t.complete()}})))}concat(...e){const t=u(this);return new t((r=>{let n,i=0;return function o(a){n=a.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):o(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}}))}flatMap(e){if(\"function\"!=typeof e)throw new TypeError(e+\" is not a function\");const t=u(this);return new t((r=>{const n=[],i=this.subscribe({next(i){let a;if(e)try{a=e(i)}catch(e){return r.error(e)}else a=i;const s=t.from(a).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){const e=n.indexOf(s);e>=0&&n.splice(e,1),o()}});n.push(s)},error(e){r.error(e)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach((e=>e.unsubscribe())),i.unsubscribe()}}))}[o](){return this}static from(e){const t=\"function\"==typeof this?this:v;if(null==e)throw new TypeError(e+\" is not an object\");const r=s(e,o);if(r){const n=r.call(e);if(Object(n)!==n)throw new TypeError(n+\" is not an object\");return function(e){return e instanceof v}(n)&&n.constructor===t?n:new t((e=>n.subscribe(e)))}if((0,n.hasSymbol)(\"iterator\")){const r=s(e,i);if(r)return new t((t=>{f((()=>{if(!t.closed){for(const n of r.call(e))if(t.next(n),t.closed)return;t.complete()}}))}))}if(Array.isArray(e))return new t((t=>{f((()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}}))}));throw new TypeError(e+\" is not observable\")}static of(...e){return new(\"function\"==typeof this?this:v)((t=>{f((()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}}))}))}static get[a](){return this}}r.Observable=v,(0,n.hasSymbols)()&&Object.defineProperty(v,Symbol(\"extensions\"),{value:{symbol:o,hostReportError:l},configurable:!0});var g=v;r.default=g},{\"./_symbols\":\"lj3f\"}],QC75:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){\"function\"==typeof e?e():e&&\"function\"==typeof e.unsubscribe&&e.unsubscribe()};r.default=n},{}],apmd:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=e(\"./_scheduler\"),i=a(e(\"./observable\")),o=a(e(\"./unsubscribe\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){return t=>new i.default((r=>{const i=new n.AsyncSerialScheduler(r),a=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule((r=>function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){(yield e(t))&&r(t)}))))}});return()=>(0,o.default)(a)}))};r.default=s},{\"./_scheduler\":\"sfrJ\",\"./observable\":\"B9l3\",\"./unsubscribe\":\"QC75\"}],FgiE:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.isAsyncIterator=function(e){return e&&(0,n.hasSymbol)(\"asyncIterator\")&&e[Symbol.asyncIterator]},r.isIterator=function(e){return e&&(0,n.hasSymbol)(\"iterator\")&&e[Symbol.iterator]};var n=e(\"./_symbols\")},{\"./_symbols\":\"lj3f\"}],ltny:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=e(\"./_scheduler\"),i=e(\"./_util\"),o=s(e(\"./observable\")),a=s(e(\"./unsubscribe\"));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){return t=>new o.default((r=>{const o=new n.AsyncSerialScheduler(r),s=t.subscribe({complete(){o.complete()},error(e){o.error(e)},next(t){o.schedule((r=>function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){var n,o;const a=yield e(t);if((0,i.isIterator)(a)||(0,i.isAsyncIterator)(a))try{for(var s,u=function(e){if(!Symbol.asyncIterator)throw new TypeError(\"Symbol.asyncIterator is not defined.\");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=\"function\"==typeof __values?__values(e):e[Symbol.iterator](),t={},n(\"next\"),n(\"throw\"),n(\"return\"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}(a);!(s=yield u.next()).done;){const e=s.value;r(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=u.return)&&(yield o.call(u))}finally{if(n)throw n.error}}else a.map((e=>r(e)))}))))}});return()=>(0,a.default)(s)}))};r.default=u},{\"./_scheduler\":\"sfrJ\",\"./_util\":\"FgiE\",\"./observable\":\"B9l3\",\"./unsubscribe\":\"QC75\"}],jAhG:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=function(e){return new n.Observable((t=>{let r=0;const n=setInterval((()=>{t.next(r++)}),e);return()=>clearInterval(n)}))};var n=e(\"./observable\")},{\"./observable\":\"B9l3\"}],aP59:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=e(\"./_scheduler\"),i=a(e(\"./observable\")),o=a(e(\"./unsubscribe\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){return t=>new i.default((r=>{const i=new n.AsyncSerialScheduler(r),a=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule((r=>function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const n=yield e(t);r(n)}))))}});return()=>(0,o.default)(a)}))};r.default=s},{\"./_scheduler\":\"sfrJ\",\"./observable\":\"B9l3\",\"./unsubscribe\":\"QC75\"}],Rg1v:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=e(\"./observable\"),i=function(e){return e&&e.__esModule?e:{default:e}}(e(\"./unsubscribe\"));var o=function(...e){return 0===e.length?n.Observable.from([]):new n.Observable((t=>{let r=0;const n=e.map((n=>n.subscribe({error(e){t.error(e),o()},next(e){t.next(e)},complete(){++r===e.length&&(t.complete(),o())}}))),o=()=>{n.forEach((e=>(0,i.default)(e)))};return o}))};r.default=o},{\"./observable\":\"B9l3\",\"./unsubscribe\":\"QC75\"}],wtHd:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e(\"./observable\"));class i extends n.default{constructor(){super((e=>(this._observers.add(e),()=>this._observers.delete(e)))),this._observers=new Set}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){for(const e of this._observers)e.complete()}}var o=i;r.default=o},{\"./observable\":\"B9l3\"}],NgdC:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./observable\")),i=a(e(\"./subject\")),o=a(e(\"./unsubscribe\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){const t=new i.default;let r,a=0;return new n.default((n=>{r||(r=e.subscribe(t));const i=t.subscribe(n);return a++,()=>{a--,i.unsubscribe(),0===a&&((0,o.default)(r),r=void 0)}}))};r.default=s},{\"./observable\":\"B9l3\",\"./subject\":\"wtHd\",\"./unsubscribe\":\"QC75\"}],b7o0:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=e(\"./_scheduler\"),i=a(e(\"./observable\")),o=a(e(\"./unsubscribe\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){return r=>new i.default((i=>{let a,s=0;const u=new n.AsyncSerialScheduler(i),l=r.subscribe({complete(){u.complete()},error(e){u.error(e)},next(r){u.schedule((n=>function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const i=0===s?void 0===t?r:t:a;a=yield e(i,r,s++),n(a)}))))}});return()=>(0,o.default)(l)}))};r.default=s},{\"./_scheduler\":\"sfrJ\",\"./observable\":\"B9l3\",\"./unsubscribe\":\"QC75\"}],cyO3:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),Object.defineProperty(r,\"filter\",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,\"flatMap\",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,\"interval\",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,\"map\",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,\"merge\",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,\"multicast\",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(r,\"Observable\",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,\"scan\",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(r,\"Subject\",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(r,\"unsubscribe\",{enumerable:!0,get:function(){return h.default}});var n=d(e(\"./filter\")),i=d(e(\"./flatMap\")),o=d(e(\"./interval\")),a=d(e(\"./map\")),s=d(e(\"./merge\")),u=d(e(\"./multicast\")),l=d(e(\"./observable\")),f=d(e(\"./scan\")),c=d(e(\"./subject\")),h=d(e(\"./unsubscribe\"));function d(e){return e&&e.__esModule?e:{default:e}}},{\"./filter\":\"apmd\",\"./flatMap\":\"ltny\",\"./interval\":\"jAhG\",\"./map\":\"aP59\",\"./merge\":\"Rg1v\",\"./multicast\":\"NgdC\",\"./observable\":\"B9l3\",\"./scan\":\"b7o0\",\"./subject\":\"wtHd\",\"./unsubscribe\":\"QC75\"}],vpgy:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.allSettled=function(e){return Promise.all(e.map((e=>{const t=e=>({status:\"fulfilled\",value:e}),r=e=>({status:\"rejected\",reason:e}),n=Promise.resolve(e);try{return n.then(t,r)}catch(e){return Promise.reject(e)}})))}},{}],UYCO:[function(e,t,r){\"use strict\";var n;Object.defineProperty(r,\"__esModule\",{value:!0}),r.PoolEventType=void 0,r.PoolEventType=n,function(e){e.initialized=\"initialized\",e.taskCanceled=\"taskCanceled\",e.taskCompleted=\"taskCompleted\",e.taskFailed=\"taskFailed\",e.taskQueued=\"taskQueued\",e.taskQueueDrained=\"taskQueueDrained\",e.taskStart=\"taskStart\",e.terminated=\"terminated\"}(n||(r.PoolEventType=n={}))},{}],fmdM:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.$worker=r.$transferable=r.$terminate=r.$events=r.$errors=void 0;const n=Symbol(\"thread.errors\");r.$errors=n;const i=Symbol(\"thread.events\");r.$events=i;const o=Symbol(\"thread.terminate\");r.$terminate=o;const a=Symbol(\"thread.transferable\");r.$transferable=a;const s=Symbol(\"thread.worker\");r.$worker=s},{}],LBuu:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.Thread=void 0;var n=e(\"../symbols\");function i(e){throw Error(e)}const o={errors:e=>e[n.$errors]||i(\"Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.\"),events:e=>e[n.$events]||i(\"Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.\"),terminate:e=>e[n.$terminate]()};r.Thread=o},{\"../symbols\":\"fmdM\"}],EB3M:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),Object.defineProperty(r,\"PoolEventType\",{enumerable:!0,get:function(){return s.PoolEventType}}),Object.defineProperty(r,\"Thread\",{enumerable:!0,get:function(){return u.Thread}}),r.Pool=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e(\"debug\")),i=e(\"observable-fns\"),o=e(\"../ponyfills\"),a=e(\"./implementation\"),s=e(\"./pool-types\"),u=e(\"./thread\");var l=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};let f=1;class c{constructor(e,t){this.eventSubject=new i.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const r=\"number\"==typeof t?{size:t}:t||{},{size:o=a.defaultPoolSize}=r;this.debug=(0,n.default)(\"threads:pool:\"+function(e){return e.replace(/\\W/g,\" \").trim().replace(/\\s+/g,\"-\")}(r.name||String(f++))),this.options=r,this.workers=function(e,t){return function(e){const t=[];for(let r=0;r({init:e(),runningTasks:[]})))}(e,o),this.eventObservable=(0,i.multicast)(i.Observable.from(this.eventSubject)),Promise.all(this.workers.map((e=>e.init))).then((()=>this.eventSubject.next({type:s.PoolEventType.initialized,size:this.workers.length})),(e=>{this.debug(\"Error while initializing pool worker:\",e),this.eventSubject.error(e),this.initErrors.push(e)}))}findIdlingWorker(){const{concurrency:e=1}=this.options;return this.workers.find((t=>t.runningTasks.lengthl(this,void 0,void 0,(function*(){yield function(e){return new Promise((t=>setTimeout(t,e)))}(0);try{yield this.runPoolTask(e,t)}finally{e.runningTasks=e.runningTasks.filter((e=>e!==r)),this.isClosing||this.scheduleWork()}})))();e.runningTasks.push(r)}))}scheduleWork(){this.debug(\"Attempt de-queueing a task in order to run it...\");const e=this.findIdlingWorker();if(!e)return;const t=this.taskQueue.shift();if(!t)return this.debug(\"Task queue is empty\"),void this.eventSubject.next({type:s.PoolEventType.taskQueueDrained});this.run(e,t)}taskCompletion(e){return new Promise(((t,r)=>{const n=this.events().subscribe((i=>{i.type===s.PoolEventType.taskCompleted&&i.taskID===e?(n.unsubscribe(),t(i.returnValue)):i.type===s.PoolEventType.taskFailed&&i.taskID===e?(n.unsubscribe(),r(i.error)):i.type===s.PoolEventType.terminated&&(n.unsubscribe(),r(Error(\"Pool has been terminated before task was run.\")))}))}))}settled(e=!1){return l(this,void 0,void 0,(function*(){const t=()=>function(e,t){return e.reduce(((e,r)=>[...e,...t(r)]),[])}(this.workers,(e=>e.runningTasks)),r=[],n=this.eventObservable.subscribe((e=>{e.type===s.PoolEventType.taskFailed&&r.push(e.error)}));return this.initErrors.length>0?Promise.reject(this.initErrors[0]):e&&0===this.taskQueue.length?(yield(0,o.allSettled)(t()),r):(yield new Promise(((e,t)=>{const r=this.eventObservable.subscribe({next(t){t.type===s.PoolEventType.taskQueueDrained&&(r.unsubscribe(),e())},error:t})})),yield(0,o.allSettled)(t()),n.unsubscribe(),r)}))}completed(e=!1){return l(this,void 0,void 0,(function*(){const t=this.settled(e),r=new Promise(((e,r)=>{const n=this.eventObservable.subscribe({next(i){i.type===s.PoolEventType.taskQueueDrained?(n.unsubscribe(),e(t)):i.type===s.PoolEventType.taskFailed&&(n.unsubscribe(),r(i.error))},error:r})})),n=yield Promise.race([t,r]);if(n.length>0)throw n[0]}))}events(){return this.eventObservable}queue(e){const{maxQueuedJobs:t=1/0}=this.options;if(this.isClosing)throw Error(\"Cannot schedule pool tasks after terminate() has been called.\");if(this.initErrors.length>0)throw this.initErrors[0];const r=()=>this.taskCompletion(i.id);let n;const i={id:this.nextTaskID++,run:e,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter((e=>e!==i)),this.eventSubject.next({type:s.PoolEventType.taskCanceled,taskID:i.id}))},get then(){if(!n){const e=r();n=e.then.bind(e)}return n}};if(this.taskQueue.length>=t)throw Error(\"Maximum number of pool tasks queued. Refusing to queue another one.\\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.\");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:s.PoolEventType.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(e){return l(this,void 0,void 0,(function*(){this.isClosing=!0,e||(yield this.completed(!0)),this.eventSubject.next({type:s.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map((e=>l(this,void 0,void 0,(function*(){return u.Thread.terminate(yield e.init)})))))}))}}function h(e,t){return new c(e,t)}c.EventType=s.PoolEventType,h.EventType=s.PoolEventType;const d=h;r.Pool=d},{debug:\"jcLW\",\"observable-fns\":\"cyO3\",\"../ponyfills\":\"vpgy\",\"./implementation\":\"XK2w\",\"./pool-types\":\"UYCO\",\"./thread\":\"LBuu\"}],PRGP:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.createPromiseWithResolver=function(){let e,t=!1,r=n;return[new Promise((n=>{t?n(e):r=n})),n=>{t=!0,e=n,r()}]};const n=()=>{}},{}],ZLGT:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.WorkerEventType=void 0;var n;e(\"../symbols\");r.WorkerEventType=n,function(e){e.internalError=\"internalError\",e.message=\"message\",e.termination=\"termination\"}(n||(r.WorkerEventType=n={}))},{\"../symbols\":\"fmdM\"}],zXl4:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.ObservablePromise=void 0;var n=e(\"observable-fns\");const i=()=>{},o=e=>e,a=e=>Promise.resolve().then(e);function s(e){throw e}class u extends n.Observable{constructor(e){super((t=>{const r=this,n=Object.assign(Object.assign({},t),{complete(){t.complete(),r.onCompletion()},error(e){t.error(e),r.onError(e)},next(e){t.next(e),r.onNext(e)}});try{return this.initHasRun=!0,e(n)}catch(e){n.error(e)}})),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state=\"pending\"}onNext(e){this.firstValueSet||(this.firstValue=e,this.firstValueSet=!0)}onError(e){this.state=\"rejected\",this.rejection=e;for(const t of this.rejectionCallbacks)a((()=>t(e)))}onCompletion(){this.state=\"fulfilled\";for(const e of this.fulfillmentCallbacks)a((()=>e(this.firstValue)))}then(e,t){const r=e||o,n=t||s;let i=!1;return new Promise(((e,t)=>{const o=r=>{if(!i){i=!0;try{e(n(r))}catch(e){t(e)}}};return this.initHasRun||this.subscribe({error:o}),\"fulfilled\"===this.state?e(r(this.firstValue)):\"rejected\"===this.state?(i=!0,e(n(this.rejection))):(this.fulfillmentCallbacks.push((t=>{try{e(r(t))}catch(e){o(e)}})),void this.rejectionCallbacks.push(o))}))}catch(e){return this.then(void 0,e)}finally(e){const t=e||i;return this.then((e=>(t(),e)),(()=>t()))}static from(e){return function(e){return e&&\"function\"==typeof e.then}(e)?new u((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>{t.error(e)}))})):super.from(e)}}r.ObservablePromise=u},{\"observable-fns\":\"cyO3\"}],qW1u:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.isTransferDescriptor=function(e){return e&&\"object\"==typeof e&&e[n.$transferable]},r.Transfer=function(e,t){if(!t){if(!function(e){return!(!e||\"object\"!=typeof e)}(e))throw Error();t=[e]}return{[n.$transferable]:!0,send:e,transferables:t}};var n=e(\"./symbols\")},{\"./symbols\":\"fmdM\"}],fUdt:[function(e,t,r){\"use strict\";var n,i;Object.defineProperty(r,\"__esModule\",{value:!0}),r.WorkerMessageType=r.MasterMessageType=void 0,r.MasterMessageType=n,function(e){e.run=\"run\"}(n||(r.MasterMessageType=n={})),r.WorkerMessageType=i,function(e){e.error=\"error\",e.init=\"init\",e.result=\"result\",e.running=\"running\",e.uncaughtError=\"uncaughtError\"}(i||(r.WorkerMessageType=i={}))},{}],iMbm:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.createProxyFunction=v,r.createProxyModule=function(e,t){const r={};for(const n of t)r[n]=v(e,n);return r};var n=function(e){return e&&e.__esModule?e:{default:e}}(e(\"debug\")),i=e(\"observable-fns\"),o=e(\"../common\"),a=e(\"../observable-promise\"),s=e(\"../transferable\"),u=e(\"../types/messages\");const l=(0,n.default)(\"threads:master:messages\");let f=1;const c=e=>Array.from(new Set(e)),h=e=>e&&e.type===u.WorkerMessageType.error,d=e=>e&&e.type===u.WorkerMessageType.result,p=e=>e&&e.type===u.WorkerMessageType.running;function b(e,t){return new i.Observable((r=>{let n;const i=a=>{if(l(\"Message from worker:\",a.data),a.data&&a.data.uid===t)if(p(a.data))n=a.data.resultType;else if(d(a.data))\"promise\"===n?(void 0!==a.data.payload&&r.next((0,o.deserialize)(a.data.payload)),r.complete(),e.removeEventListener(\"message\",i)):(a.data.payload&&r.next((0,o.deserialize)(a.data.payload)),a.data.complete&&(r.complete(),e.removeEventListener(\"message\",i)));else if(h(a.data)){const t=(0,o.deserialize)(a.data.error);r.error(t),e.removeEventListener(\"message\",i)}};return e.addEventListener(\"message\",i),()=>e.removeEventListener(\"message\",i)}))}function y(e){if(0===e.length)return{args:[],transferables:[]};const t=[],r=[];for(const n of e)(0,s.isTransferDescriptor)(n)?(t.push((0,o.serialize)(n.send)),r.push(...n.transferables)):t.push((0,o.serialize)(n));return{args:t,transferables:0===r.length?r:c(r)}}function v(e,t){return(...r)=>{const n=f++,{args:o,transferables:s}=y(r),c={type:u.MasterMessageType.run,uid:n,method:t,args:o};l(\"Sending command to run function to worker:\",c);try{e.postMessage(c,s)}catch(e){return a.ObservablePromise.from(Promise.reject(e))}return a.ObservablePromise.from((0,i.multicast)(b(e,n)))}}},{debug:\"jcLW\",\"observable-fns\":\"cyO3\",\"../common\":\"kdjL\",\"../observable-promise\":\"zXl4\",\"../transferable\":\"qW1u\",\"../types/messages\":\"fUdt\"}],a83E:[function(e,t,r){e(\"process\"),e(\"process\");Object.defineProperty(r,\"__esModule\",{value:!0}),r.spawn=function(e,t){return f(this,void 0,void 0,(function*(){h(\"Initializing new thread\");const r=(yield function(e,t,r){return f(this,void 0,void 0,(function*(){let n;const i=new Promise(((e,i)=>{n=setTimeout((()=>i(Error(r))),t)})),o=yield Promise.race([e,i]);return clearTimeout(n),o}))}(p(e),t&&t.timeout?t.timeout:1e4,\"Timeout: Did not receive an init message from worker after 10000ms. Make sure the worker calls expose().\")).exposed,{termination:n,terminate:i}=y(e),o=b(e,n);if(\"function\"===r.type)return v((0,l.createProxyFunction)(e),e,o,i);if(\"module\"===r.type)return v((0,l.createProxyModule)(e,r.methods),e,o,i);{const e=r.type;throw Error(\"Worker init message states unexpected type of expose(): \"+e)}}))};var n=function(e){return e&&e.__esModule?e:{default:e}}(e(\"debug\")),i=e(\"observable-fns\"),o=e(\"../common\"),a=e(\"../promise\"),s=e(\"../symbols\"),u=e(\"../types/master\"),l=e(\"./invocation-proxy\");var f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const c=(0,n.default)(\"threads:master:messages\"),h=(0,n.default)(\"threads:master:spawn\"),d=(0,n.default)(\"threads:master:thread-utils\");function p(e){return new Promise(((t,r)=>{const n=i=>{c(\"Message from worker before finishing initialization:\",i.data),(e=>e&&\"init\"===e.type)(i.data)?(e.removeEventListener(\"message\",n),t(i.data)):(e=>e&&\"uncaughtError\"===e.type)(i.data)&&(e.removeEventListener(\"message\",n),r((0,o.deserialize)(i.data.error)))};e.addEventListener(\"message\",n)}))}function b(e,t){return new i.Observable((r=>{const n=e=>{const t={type:u.WorkerEventType.message,data:e.data};r.next(t)},i=e=>{d(\"Unhandled promise rejection event in thread:\",e);const t={type:u.WorkerEventType.internalError,error:Error(e.reason)};r.next(t)};e.addEventListener(\"message\",n),e.addEventListener(\"unhandledrejection\",i),t.then((()=>{const t={type:u.WorkerEventType.termination};e.removeEventListener(\"message\",n),e.removeEventListener(\"unhandledrejection\",i),r.next(t),r.complete()}))}))}function y(e){const[t,r]=(0,a.createPromiseWithResolver)();return{terminate:()=>f(this,void 0,void 0,(function*(){d(\"Terminating worker\"),yield e.terminate(),r()})),termination:t}}function v(e,t,r,n){const i=r.filter((e=>e.type===u.WorkerEventType.internalError)).map((e=>e.error));return Object.assign(e,{[s.$errors]:i,[s.$events]:r,[s.$terminate]:n,[s.$worker]:t})}},{debug:\"jcLW\",\"observable-fns\":\"cyO3\",\"../common\":\"kdjL\",\"../promise\":\"PRGP\",\"../symbols\":\"fmdM\",\"../types/master\":\"ZLGT\",\"./invocation-proxy\":\"iMbm\",process:\"pBGv\"}],HfK0:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),Object.defineProperty(r,\"Pool\",{enumerable:!0,get:function(){return i.Pool}}),Object.defineProperty(r,\"spawn\",{enumerable:!0,get:function(){return o.spawn}}),Object.defineProperty(r,\"Thread\",{enumerable:!0,get:function(){return a.Thread}}),r.Worker=void 0;var n=e(\"./implementation\"),i=e(\"./pool\"),o=e(\"./spawn\"),a=e(\"./thread\");const s=(0,n.selectWorkerImplementation)();r.Worker=s},{\"./implementation\":\"XK2w\",\"./pool\":\"EB3M\",\"./spawn\":\"a83E\",\"./thread\":\"LBuu\"}],JZ8d:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=function(e){var t,r=e.Symbol;return\"function\"==typeof r?r.observable?t=r.observable:(t=r(\"observable\"),r.observable=t):t=\"@@observable\",t}},{}],LkZ7:[function(e,t,r){var n=arguments[3];Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var i,o=a(e(\"./ponyfill.js\"));function a(e){return e&&e.__esModule?e:{default:e}}i=\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:void 0!==n?n:void 0!==t?t:Function(\"return this\")();var s=(0,o.default)(i),u=s;r.default=u},{\"./ponyfill.js\":\"JZ8d\"}],UALh:[function(e,t,r){\"use strict\";const n=e(\"symbol-observable\").default;t.exports=e=>Boolean(e&&e[n]&&e===e[n]())},{\"symbol-observable\":\"LkZ7\"}],AZa4:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n={isWorkerRuntime:function(){return!(\"undefined\"==typeof self||!self.postMessage)},postMessageToMaster:function(e,t){self.postMessage(e,t)},subscribeToMasterMessages:function(e){const t=t=>{e(t.data)};return self.addEventListener(\"message\",t),()=>{self.removeEventListener(\"message\",t)}}};r.default=n},{}],l5pR:[function(e,t,r){e(\"process\");var n=e(\"process\");Object.defineProperty(r,\"__esModule\",{value:!0}),r.expose=function(e){if(!u.default.isWorkerRuntime())throw Error(\"expose() called in the master thread.\");if(f)throw Error(\"expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.\");if(f=!0,\"function\"==typeof e)u.default.subscribeToMasterMessages((t=>{c(t)&&!t.method&&g(t.uid,e,t.args.map(o.deserialize))})),function(){const e={type:s.WorkerMessageType.init,exposed:{type:\"function\"}};u.default.postMessageToMaster(e)}();else{if(\"object\"!=typeof e||!e)throw Error(\"Invalid argument passed to expose(). Expected a function or an object, got: \"+e);u.default.subscribeToMasterMessages((t=>{c(t)&&t.method&&g(t.uid,e[t.method],t.args.map(o.deserialize))})),function(e){const t={type:s.WorkerMessageType.init,exposed:{type:\"module\",methods:e}};u.default.postMessageToMaster(t)}(Object.keys(e).filter((t=>\"function\"==typeof e[t])))}},Object.defineProperty(r,\"registerSerializer\",{enumerable:!0,get:function(){return o.registerSerializer}}),Object.defineProperty(r,\"Transfer\",{enumerable:!0,get:function(){return a.Transfer}});var i=l(e(\"is-observable\")),o=e(\"../common\"),a=e(\"../transferable\"),s=e(\"../types/messages\"),u=l(e(\"./implementation\"));function l(e){return e&&e.__esModule?e:{default:e}}let f=!1;const c=e=>e&&e.type===s.MasterMessageType.run,h=e=>(0,i.default)(e)||function(e){return e&&\"object\"==typeof e&&\"function\"==typeof e.subscribe}(e);function d(e){return(0,a.isTransferDescriptor)(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function p(e,t){const{payload:r,transferables:n}=d(t),i={type:s.WorkerMessageType.error,uid:e,error:(0,o.serialize)(r)};u.default.postMessageToMaster(i,n)}function b(e,t,r){const{payload:n,transferables:i}=d(r),o={type:s.WorkerMessageType.result,uid:e,complete:!!t||void 0,payload:n};u.default.postMessageToMaster(o,i)}function y(e,t){const r={type:s.WorkerMessageType.running,uid:e,resultType:t};u.default.postMessageToMaster(r)}function v(e){try{const t={type:s.WorkerMessageType.uncaughtError,error:(0,o.serialize)(e)};u.default.postMessageToMaster(t)}catch(t){console.error(\"Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\\nLatest error:\",t,\"\\nOriginal error:\",e)}}function g(e,t,r){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){let n;try{n=t(...r)}catch(t){return p(e,t)}const i=h(n)?\"observable\":\"promise\";if(y(e,i),h(n))n.subscribe((t=>b(e,!1,(0,o.serialize)(t))),(t=>p(e,(0,o.serialize)(t))),(()=>b(e,!0)));else try{const t=yield n;b(e,!0,(0,o.serialize)(t))}catch(t){p(e,(0,o.serialize)(t))}}))}\"undefined\"!=typeof self&&\"function\"==typeof self.addEventListener&&u.default.isWorkerRuntime()&&(self.addEventListener(\"error\",(e=>{setTimeout((()=>v(e.error||e)),250)})),self.addEventListener(\"unhandledrejection\",(e=>{const t=e.reason;t&&\"string\"==typeof t.message&&setTimeout((()=>v(t)),250)}))),void 0!==n&&\"function\"==typeof n.on&&u.default.isWorkerRuntime()&&(n.on(\"uncaughtException\",(e=>{setTimeout((()=>v(e)),250)})),n.on(\"unhandledRejection\",(e=>{e&&\"string\"==typeof e.message&&setTimeout((()=>v(e)),250)})))},{\"is-observable\":\"UALh\",\"../common\":\"kdjL\",\"../transferable\":\"qW1u\",\"../types/messages\":\"fUdt\",\"./implementation\":\"AZa4\",process:\"pBGv\"}],CqwR:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0});var n={registerSerializer:!0,expose:!0,DefaultSerializer:!0,Transfer:!0};Object.defineProperty(r,\"registerSerializer\",{enumerable:!0,get:function(){return i.registerSerializer}}),Object.defineProperty(r,\"expose\",{enumerable:!0,get:function(){return a.expose}}),Object.defineProperty(r,\"DefaultSerializer\",{enumerable:!0,get:function(){return s.DefaultSerializer}}),Object.defineProperty(r,\"Transfer\",{enumerable:!0,get:function(){return u.Transfer}});var i=e(\"./common\"),o=e(\"./master/index\");Object.keys(o).forEach((function(e){\"default\"!==e&&\"__esModule\"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}}))}));var a=e(\"./worker/index\"),s=e(\"./serializers\"),u=e(\"./transferable\")},{\"./common\":\"kdjL\",\"./master/index\":\"HfK0\",\"./worker/index\":\"l5pR\",\"./serializers\":\"z2GM\",\"./transferable\":\"qW1u\"}],dHPO:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"@babel/runtime/regenerator\")),i=u(e(\"@babel/runtime/helpers/asyncToGenerator\")),o=u(e(\"@babel/runtime/helpers/classCallCheck\")),a=u(e(\"@babel/runtime/helpers/createClass\")),s=e(\"threads\");function u(e){return e&&e.__esModule?e:{default:e}}var l=\"undefined\"!=typeof navigator?navigator.hardwareConcurrency:null,f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new s.Worker(\"decoder.worker.1936c0d9.js\");(0,o.default)(this,e),this.pool=(0,s.Pool)((function(){return(0,s.spawn)(r)}),t)}return(0,a.default)(e,[{key:\"decode\",value:function(){var e=(0,i.default)(n.default.mark((function e(t,r){var o=this;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",new Promise((function(e,a){o.pool.queue(function(){var o=(0,i.default)(n.default.mark((function i(o){var u;return n.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,o(t,(0,s.Transfer)(r));case 3:u=n.sent,e(u),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),a(n.t0);case 10:case\"end\":return n.stop()}}),i,null,[[0,7]])})));return function(e){return o.apply(this,arguments)}}())})));case 1:case\"end\":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"destroy\",value:function(){this.pool.terminate(!0)}}]),e}();r.default=f},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",threads:\"CqwR\",\"./decoder.worker.js\":[[\"decoder.worker.1936c0d9.js\",\"LHx9\"],\"decoder.worker.1936c0d9.js.map\",\"LHx9\"]}],t2zx:[function(e,t,r){t.exports=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}},{}],U8F3:[function(e,t,r){var n=e(\"./objectWithoutPropertiesLoose\");t.exports=function(e,t){if(null==e)return{};var r,i,o=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}},{\"./objectWithoutPropertiesLoose\":\"t2zx\"}],OMTj:[function(e,t,r){t.exports=function(e){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},{}],kQhN:[function(e,t,r){var n=e(\"./arrayWithHoles\"),i=e(\"./iterableToArray\"),o=e(\"./unsupportedIterableToArray\"),a=e(\"./nonIterableRest\");t.exports=function(e){return n(e)||i(e)||o(e)||a()}},{\"./arrayWithHoles\":\"OUZ9\",\"./iterableToArray\":\"OMTj\",\"./unsupportedIterableToArray\":\"UyFj\",\"./nonIterableRest\":\"Rom6\"}],ZJpj:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.parseContentType=function(e){var t=e.split(\";\").map((function(e){return e.trim()})),r=(0,n.default)(t);return{type:r[0],params:f(r.slice(1).map((function(e){return e.split(\"=\")})))}},r.parseContentRange=h,r.parseByteRanges=function(e,t){for(var r=null,n=new TextDecoder(\"ascii\"),i=[],o=\"--\".concat(t),a=\"\".concat(o,\"--\"),s=0;s<10;++s)n.decode(new Uint8Array(e,s,o.length))===o&&(r=s);if(null===r)throw new Error(\"Could not find initial boundary\");for(;r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var o,a=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}function s(e,t){if(e){if(\"string\"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return\"Object\"===r&&e.constructor&&(r=e.constructor.name),\"Map\"===r||\"Set\"===r?Array.from(e):\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==o[1]?o[1]:void 0,e.next=3,Promise.all(t.map((function(e){return i.fetchSlice(e,r)})));case 3:return e.abrupt(\"return\",e.sent);case 4:case\"end\":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:\"fetchSlice\",value:function(){var e=(0,i.default)(n.default.mark((function e(t){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error(\"fetching of slice \".concat(t,\" not possible, not implemented\"));case 1:case\"end\":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:\"close\",value:function(){var e=(0,i.default)(n.default.mark((function e(){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case\"end\":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:\"fileSize\",get:function(){return null}}]),e}();r.BaseSource=u},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\"}],eMzk:[function(e,t,r){\"use strict\";t.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},{}],sfWH:[function(e,t,r){\"use strict\";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&\"function\"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=t;else{if(!this.head)throw new TypeError(\"Reduce of empty list with no initial value\");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError(\"Reduce of empty list with no initial value\");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&nthis[s])return k(this,this[b].get(e)),!1;var o=this[b].get(e).value;return this[h]&&(this[d]||this[h](e,o.value)),o.now=n,o.maxAge=r,o.value=t,this[u]+=i-o.length,o.length=i,this.get(e),_(this),!0}var a=new x(e,t,i,n,r);return a.length>this[s]?(this[h]&&this[h](e,t),!1):(this[u]+=a.length,this[p].unshift(a),this[b].set(e,this[p].head),_(this),!0)}},{key:\"has\",value:function(e){if(!this[b].has(e))return!1;var t=this[b].get(e).value;return!w(this,t)}},{key:\"get\",value:function(e){return m(this,e,!0)}},{key:\"peek\",value:function(e){return m(this,e,!1)}},{key:\"pop\",value:function(){var e=this[p].tail;return e?(k(this,e),e.value):null}},{key:\"del\",value:function(e){k(this,this[b].get(e))}},{key:\"load\",value:function(e){this.reset();for(var t=Date.now(),r=e.length-1;r>=0;r--){var n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{var o=i-t;o>0&&this.set(n.k,n.v,o)}}}},{key:\"prune\",value:function(){var e=this;this[b].forEach((function(t,r){return m(e,r,!1)}))}},{key:\"max\",set:function(e){if(\"number\"!=typeof e||e<0)throw new TypeError(\"max must be a non-negative number\");this[s]=e||1/0,_(this)},get:function(){return this[s]}},{key:\"allowStale\",set:function(e){this[f]=!!e},get:function(){return this[f]}},{key:\"maxAge\",set:function(e){if(\"number\"!=typeof e)throw new TypeError(\"maxAge must be a non-negative number\");this[c]=e,_(this)},get:function(){return this[c]}},{key:\"lengthCalculator\",set:function(e){var t=this;\"function\"!=typeof e&&(e=v),e!==this[l]&&(this[l]=e,this[u]=0,this[p].forEach((function(e){e.length=t[l](e.value,e.key),t[u]+=e.length}))),_(this)},get:function(){return this[l]}},{key:\"length\",get:function(){return this[u]}},{key:\"itemCount\",get:function(){return this[p].length}}]),e}(),m=function(e,t,r){var n=e[b].get(t);if(n){var i=n.value;if(w(e,i)){if(k(e,n),!e[f])return}else r&&(e[y]&&(n.value.now=Date.now()),e[p].unshiftNode(n));return i.value}},w=function(e,t){if(!t||!t.maxAge&&!e[c])return!1;var r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},_=function(e){if(e[u]>e[s])for(var t=e[p].tail;e[u]>e[s]&&null!==t;){var r=t.prev;k(e,t),t=r}},k=function(e,t){if(t){var r=t.value;e[h]&&e[h](r.key,r.value),e[u]-=r.length,e[b].delete(r.key),e[p].removeNode(t)}},x=function e(t,r,i,o,a){n(this,e),this.key=t,this.value=r,this.length=i,this.now=o,this.maxAge=a||0},S=function(e,t,r,n){var i=r.value;w(e,i)&&(k(e,r),e[f]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};t.exports=g},{yallist:\"sfWH\"}],FOZT:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.assign=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},r.chunk=function(e,t){for(var r=[],n=e.length,i=0;i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var o,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:null;(0,l.default)(this,e),this.offset=t,this.length=r,this.data=n}return(0,f.default)(e,[{key:\"top\",get:function(){return this.offset+this.length}}]),e}(),m=function e(t,r,n){(0,l.default)(this,e),this.offset=t,this.length=r,this.blockIds=n},w=function(e){(0,a.default)(r,e);var t=v(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.blockSize,a=void 0===o?65536:o,s=i.cacheSize,u=void 0===s?100:s;return(0,l.default)(this,r),(n=t.call(this)).source=e,n.blockSize=a,n.blockCache=new c.default({max:u}),n.blockRequests=new Map,n.blockIdsToFetch=new Set,n}return(0,f.default)(r,[{key:\"fetch\",value:function(){var e=(0,o.default)(n.default.mark((function e(t,r){var o,a,s,u,l,f,c,h,p,y,v,g,m,w,_,k,x,S,O,T,E,C,P,j,R,M,A,I,D,L,N,F,U,B,G,z,H,W;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=new Map,a=new Map,s=new Set,u=b(t);try{for(u.s();!(l=u.n()).done;)for(f=l.value,c=f.offset,h=f.length,p=c+h,null!==(y=this.fileSize)&&(p=Math.min(p,y)),v=Math.floor(c/this.blockSize)*this.blockSize,g=v;g0)){e.next=65;break}this.fetchBlocks(r),I=b(T),e.prev=44,I.s();case 46:if((D=I.n()).done){e.next=54;break}if(L=D.value,N=this.blockRequests.get(L)){e.next=51;break}throw new Error(\"Block \".concat(L,\" is not in the block requests\"));case 51:a.set(L,N);case 52:e.next=46;break;case 54:e.next=59;break;case 56:e.prev=56,e.t1=e.catch(44),I.e(e.t1);case 59:return e.prev=59,I.f(),e.finish(59);case 62:return e.next=64,Promise.allSettled(Array.from(a.values()));case 64:O=e.sent;case 65:if(!O.some((function(e){return\"rejected\"===e.status}))){e.next=69;break}if(!r||!r.aborted){e.next=68;break}throw new d.AbortError(\"Request was aborted\");case 68:throw new d.AggregateError(O.filter((function(e){return\"rejected\"===e.status})).map((function(e){return e.reason})),\"Request failed\");case 69:F=O.map((function(e){return e.value})),U=new Map((0,d.zip)(Array.from(a.keys()),F)),B=b(o);try{for(B.s();!(G=B.n()).done;)z=(0,i.default)(G.value,2),H=z[0],W=z[1],U.set(H,W)}catch(e){B.e(e)}finally{B.f()}return e.abrupt(\"return\",this.readSliceData(t,U));case 74:case\"end\":return e.stop()}}),e,this,[[9,28,31,34],[44,56,59,62]])})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"fetchBlocks\",value:function(e){var t=this;this.blockIdsToFetch.size>0&&function(){for(var r=t.groupBlocks(t.blockIdsToFetch),i=t.source.fetch(r,e),a=function(a){var s,u=b(r[a].blockIds);try{var l=function(){var r=s.value,u=(0,o.default)(n.default.mark((function o(){var s,u,l,f,c,h;return n.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i;case 3:return n.t0=a,s=n.sent[n.t0],u=r*t.blockSize,l=u-s.offset,f=Math.min(l+t.blockSize,s.data.byteLength),c=s.data.slice(l,f),h=new g(u,c.byteLength,c),t.blockCache.set(r,h),n.abrupt(\"return\",h);case 14:throw n.prev=14,n.t1=n.catch(0),\"AbortError\"===n.t1.name&&(n.t1.signal=e),n.t1;case 18:return n.prev=18,t.blockRequests.delete(r),n.finish(18);case 21:case\"end\":return n.stop()}}),o,null,[[0,14,18,21]])})))();t.blockRequests.set(r,u)};for(u.s();!(s=u.n()).done;)l()}catch(e){u.e(e)}finally{u.f()}},s=0;s0&&(d=c),l=f.top-n<0?f.length-h:n-f.offset-h;var p=new Uint8Array(f.data,h,l);s.set(p,d)}return a}))}},{key:\"fileSize\",get:function(){return this.source.fileSize}}]),r}(h.BaseSource);r.BlockedSource=w},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/slicedToArray\":\"HETk\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"lru-cache\":\"tpff\",\"./basesource\":\"LzCD\",\"../utils\":\"FOZT\"}],uL1U:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.BaseClient=r.BaseResponse=void 0;var n=s(e(\"@babel/runtime/regenerator\")),i=s(e(\"@babel/runtime/helpers/asyncToGenerator\")),o=s(e(\"@babel/runtime/helpers/classCallCheck\")),a=s(e(\"@babel/runtime/helpers/createClass\"));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){(0,o.default)(this,e)}return(0,a.default)(e,[{key:\"getHeader\",value:function(e){throw new Error(\"not implemented\")}},{key:\"getData\",value:function(){var e=(0,i.default)(n.default.mark((function e(){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error(\"not implemented\");case 1:case\"end\":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:\"ok\",get:function(){return this.status>=200&&this.status<=299}},{key:\"status\",get:function(){throw new Error(\"not implemented\")}}]),e}();r.BaseResponse=u;var l=function(){function e(t){(0,o.default)(this,e),this.url=t}return(0,a.default)(e,[{key:\"request\",value:function(){var e=(0,i.default)(n.default.mark((function e(){var t,r=arguments;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw(t=r.length>0&&void 0!==r[0]?r[0]:{}).headers,t.credentials,t.signal,new Error(\"request is not implemented\");case 2:case\"end\":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}]),e}();r.BaseClient=l},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\"}],Un5s:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.FetchClient=void 0;var n=c(e(\"@babel/runtime/regenerator\")),i=c(e(\"@babel/runtime/helpers/asyncToGenerator\")),o=c(e(\"@babel/runtime/helpers/classCallCheck\")),a=c(e(\"@babel/runtime/helpers/createClass\")),s=c(e(\"@babel/runtime/helpers/inherits\")),u=c(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),l=c(e(\"@babel/runtime/helpers/getPrototypeOf\")),f=e(\"./base\");function c(e){return e&&e.__esModule?e:{default:e}}function h(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var d=function(e){(0,s.default)(r,e);var t=h(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this)).response=e,n}return(0,a.default)(r,[{key:\"getHeader\",value:function(e){return this.response.headers.get(e)}},{key:\"getData\",value:function(){var e=(0,i.default)(n.default.mark((function e(){var t;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.response.arrayBuffer){e.next=6;break}return e.next=3,this.response.arrayBuffer();case 3:e.t0=e.sent,e.next=9;break;case 6:return e.next=8,this.response.buffer();case 8:e.t0=e.sent.buffer;case 9:return t=e.t0,e.abrupt(\"return\",t);case 11:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:\"status\",get:function(){return this.response.status}}]),r}(f.BaseResponse),p=function(e){(0,s.default)(r,e);var t=h(r);function r(e,n){var i;return(0,o.default)(this,r),(i=t.call(this,e)).credentials=n,i}return(0,a.default)(r,[{key:\"request\",value:function(){var e=(0,i.default)(n.default.mark((function e(){var t,r,i,o,a,s=arguments;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=t.headers,i=t.credentials,o=t.signal,e.next=3,fetch(this.url,{headers:r,credentials:i,signal:o});case 3:return a=e.sent,e.abrupt(\"return\",new d(a));case 5:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),r}(f.BaseClient);r.FetchClient=p},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./base\":\"uL1U\"}],hvgd:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.XHRClient=void 0;var n=d(e(\"@babel/runtime/helpers/slicedToArray\")),i=d(e(\"@babel/runtime/regenerator\")),o=d(e(\"@babel/runtime/helpers/asyncToGenerator\")),a=d(e(\"@babel/runtime/helpers/classCallCheck\")),s=d(e(\"@babel/runtime/helpers/createClass\")),u=d(e(\"@babel/runtime/helpers/inherits\")),l=d(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),f=d(e(\"@babel/runtime/helpers/getPrototypeOf\")),c=e(\"./base\"),h=e(\"../../utils\");function d(e){return e&&e.__esModule?e:{default:e}}function p(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,f.default)(e);if(t){var i=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}var b=function(e){(0,u.default)(r,e);var t=p(r);function r(e,n){var i;return(0,a.default)(this,r),(i=t.call(this)).xhr=e,i.data=n,i}return(0,s.default)(r,[{key:\"getHeader\",value:function(e){return this.xhr.getResponseHeader(e)}},{key:\"getData\",value:function(){var e=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",this.data);case 1:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:\"status\",get:function(){return this.xhr.status}}]),r}(c.BaseResponse),y=function(e){(0,u.default)(r,e);var t=p(r);function r(){return(0,a.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:\"constructRequest\",value:function(e,t){var r=this;return new Promise((function(i,o){var a=new XMLHttpRequest;a.open(\"GET\",r.url),a.responseType=\"arraybuffer\";for(var s=0,u=Object.entries(e);s0&&void 0!==a[0]?a[0]:{},r=t.headers,n=t.signal,e.next=3,this.constructRequest(r,n);case 3:return o=e.sent,e.abrupt(\"return\",o);case 5:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),r}(c.BaseClient);r.XHRClient=y},{\"@babel/runtime/helpers/slicedToArray\":\"HETk\",\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./base\":\"uL1U\",\"../../utils\":\"FOZT\"}],p5a1:[function(e,t,r){var n,i=arguments[3];r.fetch=l(i.fetch)&&l(i.ReadableStream),r.writableStream=l(i.WritableStream),r.abortController=l(i.AbortController),r.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),r.blobConstructor=!0}catch(e){}function o(){if(void 0!==n)return n;if(i.XMLHttpRequest){n=new i.XMLHttpRequest;try{n.open(\"GET\",i.XDomainRequest?\"/\":\"https://example.com\")}catch(e){n=null}}else n=null;return n}function a(e){var t=o();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var s=void 0!==i.ArrayBuffer,u=s&&l(i.ArrayBuffer.prototype.slice);function l(e){return\"function\"==typeof e}r.arraybuffer=r.fetch||s&&a(\"arraybuffer\"),r.msstream=!r.fetch&&u&&a(\"ms-stream\"),r.mozchunkedarraybuffer=!r.fetch&&s&&a(\"moz-chunked-arraybuffer\"),r.overrideMimeType=r.fetch||!!o()&&l(o().overrideMimeType),r.vbArray=l(i.VBArray),n=null},{}],Yj0v:[function(e,t,r){e(\"process\");var n=e(\"process\");void 0===n||!n.version||0===n.version.indexOf(\"v0.\")||0===n.version.indexOf(\"v1.\")&&0!==n.version.indexOf(\"v1.8.\")?t.exports={nextTick:function(e,t,r,i){if(\"function\"!=typeof e)throw new TypeError('\"callback\" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return n.nextTick(e);case 2:return n.nextTick((function(){e.call(null,t)}));case 3:return n.nextTick((function(){e.call(null,t,r)}));case 4:return n.nextTick((function(){e.call(null,t,r,i)}));default:for(o=new Array(s-1),a=0;a0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return\"\";for(var t=this.head,r=\"\"+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)o(r.data,t,i),i+=r.data.length,r=r.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+\" \"+e})},{\"safe-buffer\":\"Nqn4\",util:\"rDCW\"}],lCUh:[function(e,t,r){\"use strict\";var n=e(\"process-nextick-args\");function i(e,t){e.emit(\"error\",t)}t.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{\"process-nextick-args\":\"Yj0v\"}],jPmE:[function(e,t,r){e(\"process\"),e(\"process\");var n=arguments[3],i=e(\"process-nextick-args\");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){L(t,e)}}t.exports=m;var a,s=i.nextTick;m.WritableState=g;var u=Object.create(e(\"core-util-is\"));u.inherits=e(\"inherits\");var l={deprecate:e(\"util-deprecate\")},f=e(\"./internal/streams/stream\"),c=e(\"safe-buffer\").Buffer,h=n.Uint8Array||function(){};function d(e){return c.from(e)}function p(e){return c.isBuffer(e)||e instanceof h}var b,y=e(\"./internal/streams/destroy\");function v(){}function g(t,r){a=a||e(\"./_stream_duplex\"),t=t||{};var n=r instanceof a;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,s=t.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){E(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function m(t){if(a=a||e(\"./_stream_duplex\"),!(b.call(m,this)||this instanceof a))return new m(t);this._writableState=new g(t,this),this.writable=!0,t&&(\"function\"==typeof t.write&&(this._write=t.write),\"function\"==typeof t.writev&&(this._writev=t.writev),\"function\"==typeof t.destroy&&(this._destroy=t.destroy),\"function\"==typeof t.final&&(this._final=t.final)),f.call(this)}function w(e,t){var r=new Error(\"write after end\");e.emit(\"error\",r),i.nextTick(t,r)}function _(e,t,r,n){var o=!0,a=!1;return null===r?a=new TypeError(\"May not write null values to stream\"):\"string\"==typeof r||void 0===r||t.objectMode||(a=new TypeError(\"Invalid non-string/buffer chunk\")),a&&(e.emit(\"error\",a),i.nextTick(n,a),o=!1),o}function k(e,t,r){return e.objectMode||!1===e.decodeStrings||\"string\"!=typeof t||(t=c.from(t,r)),t}function x(e,t,r,n,i,o){if(!r){var a=k(t,n,i);n!==a&&(r=!0,i=\"buffer\",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length-1))throw new TypeError(\"Unknown encoding: \"+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(m.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(e,t,r){r(new Error(\"_write() is not implemented\"))},m.prototype._writev=null,m.prototype.end=function(e,t,r){var n=this._writableState;\"function\"==typeof e?(r=e,e=null,t=null):\"function\"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||D(this,n,r)},Object.defineProperty(m.prototype,\"destroyed\",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),m.prototype.destroy=y.destroy,m.prototype._undestroy=y.undestroy,m.prototype._destroy=function(e,t){this.end(),t(e)}},{\"process-nextick-args\":\"Yj0v\",\"core-util-is\":\"Q14w\",inherits:\"Bm0n\",\"util-deprecate\":\"yM1o\",\"./internal/streams/stream\":\"ExO1\",\"safe-buffer\":\"Nqn4\",\"./internal/streams/destroy\":\"lCUh\",\"./_stream_duplex\":\"Jcj8\",process:\"pBGv\"}],Jcj8:[function(e,t,r){\"use strict\";var n=e(\"process-nextick-args\"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var o=Object.create(e(\"core-util-is\"));o.inherits=e(\"inherits\");var a=e(\"./_stream_readable\"),s=e(\"./_stream_writable\");o.inherits(c,a);for(var u=i(s.prototype),l=0;l>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,\"�\";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,\"�\";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,\"�\"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString(\"utf16le\",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(\"utf16le\",t,e.length-1)}function f(e){var t=e&&e.length?this.write(e):\"\";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(\"utf16le\",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString(\"base64\",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(\"base64\",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+this.lastChar.toString(\"base64\",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):\"\"}r.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return\"\";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return\"\";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString(\"utf8\",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString(\"utf8\",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{\"safe-buffer\":\"Nqn4\"}],YrHu:[function(e,t,r){e(\"process\");var n=arguments[3],i=e(\"process\"),o=e(\"process-nextick-args\");t.exports=x;var a,s=e(\"isarray\");x.ReadableState=k;e(\"events\").EventEmitter;var u=function(e,t){return e.listeners(t).length},l=e(\"./internal/streams/stream\"),f=e(\"safe-buffer\").Buffer,c=n.Uint8Array||function(){};function h(e){return f.from(e)}function d(e){return f.isBuffer(e)||e instanceof c}var p=Object.create(e(\"core-util-is\"));p.inherits=e(\"inherits\");var b=e(\"util\"),y=void 0;y=b&&b.debuglog?b.debuglog(\"stream\"):function(){};var v,g=e(\"./internal/streams/BufferList\"),m=e(\"./internal/streams/destroy\");p.inherits(x,l);var w=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function _(e,t,r){if(\"function\"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function k(t,r){t=t||{};var n=r instanceof(a=a||e(\"./_stream_duplex\"));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(v||(v=e(\"string_decoder/\").StringDecoder),this.decoder=new v(t.encoding),this.encoding=t.encoding)}function x(t){if(a=a||e(\"./_stream_duplex\"),!(this instanceof x))return new x(t);this._readableState=new k(t,this),this.readable=!0,t&&(\"function\"==typeof t.read&&(this._read=t.read),\"function\"==typeof t.destroy&&(this._destroy=t.destroy)),l.call(this)}function S(e,t,r,n,i){var o,a=e._readableState;return null===t?(a.reading=!1,R(e,a)):(i||(o=T(a,t)),o?e.emit(\"error\",o):a.objectMode||t&&t.length>0?(\"string\"==typeof t||a.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=h(t)),n?a.endEmitted?e.emit(\"error\",new Error(\"stream.unshift() after end event\")):O(e,a,t,!0):a.ended?e.emit(\"error\",new Error(\"stream.push() after EOF\")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?O(e,a,t,!1):I(e,a)):O(e,a,t,!1))):n||(a.reading=!1)),E(a)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit(\"data\",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&M(e)),I(e,t)}function T(e,t){var r;return d(t)||\"string\"==typeof t||void 0===t||e.objectMode||(r=new TypeError(\"Invalid non-string/buffer chunk\")),r}function E(e){return!e.ended&&(e.needReadable||e.length=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function j(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=P(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,M(e)}}function M(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(y(\"emitReadable\",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(A,e):A(e))}function A(e){y(\"emit readable\"),e.emit(\"readable\"),B(e)}function I(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(D,e,t))}function D(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=z(e,t.buffer,t.decoder),r);var r}function z(e,t,r){var n;return eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0==(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}function W(e,t){var r=f.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0==(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}function q(e){var t=e._readableState;if(t.length>0)throw new Error('\"endReadable()\" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(K,t,e))}function K(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"))}function V(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return y(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?q(this):M(this),null;if(0===(e=j(e,t))&&t.ended)return 0===t.length&&q(this),null;var n,i=t.needReadable;return y(\"need readable\",i),(0===t.length||t.length-e0?G(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&q(this)),null!==n&&this.emit(\"data\",n),n},x.prototype._read=function(e){this.emit(\"error\",new Error(\"_read() is not implemented\"))},x.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,y(\"pipe count=%d opts=%j\",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?v:s;function s(){y(\"onend\"),e.end()}n.endEmitted?o.nextTick(a):r.once(\"end\",a),e.on(\"unpipe\",(function t(i,o){y(\"onunpipe\"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,y(\"cleanup\"),e.removeListener(\"close\",p),e.removeListener(\"finish\",b),e.removeListener(\"drain\",l),e.removeListener(\"error\",d),e.removeListener(\"unpipe\",t),r.removeListener(\"end\",s),r.removeListener(\"end\",v),r.removeListener(\"data\",h),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=L(r);e.on(\"drain\",l);var f=!1,c=!1;function h(t){y(\"ondata\"),c=!1,!1!==e.write(t)||c||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!f&&(y(\"false write response, pause\",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function d(t){y(\"onerror\",t),v(),e.removeListener(\"error\",d),0===u(e,\"error\")&&e.emit(\"error\",t)}function p(){e.removeListener(\"finish\",b),v()}function b(){y(\"onfinish\"),e.removeListener(\"close\",p),v()}function v(){y(\"unpipe\"),r.unpipe(e)}return r.on(\"data\",h),_(e,\"error\",d),e.once(\"close\",p),e.once(\"finish\",b),e.emit(\"pipe\",r),n.flowing||(y(\"pipe resume\"),r.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(\"unpipe\",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;oe._pos){var n=r.substr(e._pos);if(\"x-user-defined\"===e._charset){for(var a=new i(n.length),s=0;se._pos&&(e.push(new i(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(r)}e._xhr.readyState===l.DONE&&\"ms-stream\"!==e._mode&&e.push(null)}},{\"./capability\":\"p5a1\",inherits:\"Bm0n\",\"readable-stream\":\"JaqQ\",process:\"pBGv\",buffer:\"dskh\"}],AH4k:[function(e,t,r){var n=e(\"buffer\").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if(\"function\"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(n.isBuffer(e)){for(var t=new Uint8Array(e.length),r=e.length,i=0;i= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},y=Math.floor,v=String.fromCharCode;function g(e){throw new RangeError(b[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function w(e,t){var r=e.split(\"@\"),n=\"\";return r.length>1&&(n=r[0]+\"@\",e=r[1]),n+m((e=e.replace(p,\".\")).split(\".\"),t).join(\".\")}function _(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join(\"\")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,r){var n=0;for(e=r?y(e/700):e>>1,e+=y(e/t);e>455;n+=c)e=y(e/35);return y(n+36*e/(e+38))}function O(e){var t,r,n,i,o,a,s,u,l,h,d,p=[],b=e.length,v=0,m=128,w=72;for((r=e.lastIndexOf(\"-\"))<0&&(r=0),n=0;n=128&&g(\"not-basic\"),p.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=b&&g(\"invalid-input\"),((u=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:c)>=c||u>y((f-v)/a))&&g(\"overflow\"),v+=u*a,!(u<(l=s<=w?1:s>=w+26?26:s-w));s+=c)a>y(f/(h=c-l))&&g(\"overflow\"),a*=h;w=S(v-o,t=p.length+1,0==o),y(v/t)>f-m&&g(\"overflow\"),m+=y(v/t),v%=t,p.splice(v++,0,m)}return k(p)}function T(e){var t,r,n,i,o,a,s,u,l,h,d,p,b,m,w,k=[];for(p=(e=_(e)).length,t=128,r=0,o=72,a=0;a=t&&dy((f-r)/(b=n+1))&&g(\"overflow\"),r+=(s-t)*b,t=s,a=0;af&&g(\"overflow\"),d==t){for(u=r,l=c;!(u<(h=l<=o?1:l>=o+26?26:l-o));l+=c)w=u-h,m=c-h,k.push(v(x(h+w%m,0))),u=y(w/m);k.push(v(x(u,0))),o=S(r,b,n==i),r=0,++n}++r,++t}return k.join(\"\")}if(u={version:\"1.4.1\",ucs2:{decode:_,encode:k},decode:O,encode:T,toASCII:function(e){return w(e,(function(e){return d.test(e)?\"xn--\"+T(e):e}))},toUnicode:function(e){return w(e,(function(e){return h.test(e)?O(e.slice(4).toLowerCase()):e}))}},\"function\"==typeof n&&\"object\"==typeof n.amd&&n.amd)n(\"punycode\",(function(){return u}));else if(o&&a)if(t.exports==o)a.exports=u;else for(l in u)u.hasOwnProperty(l)&&(o[l]=u[l]);else e.punycode=u}(this)},{}],YsIc:[function(e,t,r){\"use strict\";t.exports={isString:function(e){return\"string\"==typeof e},isObject:function(e){return\"object\"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],J6GP:[function(e,t,r){\"use strict\";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,o){t=t||\"&\",r=r||\"=\";var a={};if(\"string\"!=typeof e||0===e.length)return a;var s=/\\+/g;e=e.split(t);var u=1e3;o&&\"number\"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var f=0;f=0?(c=b.substr(0,y),h=b.substr(y+1)):(c=b,h=\"\"),d=decodeURIComponent(c),p=decodeURIComponent(h),n(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(e){return\"[object Array]\"===Object.prototype.toString.call(e)}},{}],bvhO:[function(e,t,r){\"use strict\";var n=function(e){switch(typeof e){case\"string\":return e;case\"boolean\":return e?\"true\":\"false\";case\"number\":return isFinite(e)?e:\"\";default:return\"\"}};t.exports=function(e,t,r,s){return t=t||\"&\",r=r||\"=\",null===e&&(e=void 0),\"object\"==typeof e?o(a(e),(function(a){var s=encodeURIComponent(n(a))+r;return i(e[a])?o(e[a],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[a]))})).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):\"\"};var i=Array.isArray||function(e){return\"[object Array]\"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n\",'\"',\"`\",\" \",\"\\r\",\"\\n\",\"\\t\"]),f=[\"'\"].concat(l),c=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(f),h=[\"/\",\"?\",\"#\"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,\"javascript:\":!0},y={javascript:!0,\"javascript:\":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0},g=e(\"querystring\");function m(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError(\"Parameter 'url' must be a string, not \"+typeof e);var o=e.indexOf(\"?\"),s=-1!==o&&o127?A+=\"x\":A+=M[I];if(!A.match(d)){var L=j.slice(0,E),N=j.slice(E+1),F=M.match(p);F&&(L.push(F[1]),N.unshift(F[2])),N.length&&(m=\"/\"+N.join(\".\")+m),this.hostname=L.join(\".\");break}}}this.hostname.length>255?this.hostname=\"\":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=n.toASCII(this.hostname));var U=this.port?\":\"+this.port:\"\",B=this.hostname||\"\";this.host=B+U,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),\"/\"!==m[0]&&(m=\"/\"+m))}if(!b[k])for(E=0,R=f.length;E0)&&r.host.split(\"@\"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift())),r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.href=r.format(),r;if(!x.length)return r.pathname=null,r.search?r.path=\"/\"+r.search:r.path=null,r.href=r.format(),r;for(var O=x.slice(-1)[0],T=(r.host||e.host||x.length>1)&&(\".\"===O||\"..\"===O)||\"\"===O,E=0,C=x.length;C>=0;C--)\".\"===(O=x[C])?x.splice(C,1):\"..\"===O?(x.splice(C,1),E++):E&&(x.splice(C,1),E--);if(!_&&!k)for(;E--;E)x.unshift(\"..\");!_||\"\"===x[0]||x[0]&&\"/\"===x[0].charAt(0)||x.unshift(\"\"),T&&\"/\"!==x.join(\"/\").substr(-1)&&x.push(\"\");var P,j=\"\"===x[0]||x[0]&&\"/\"===x[0].charAt(0);return S&&(r.hostname=r.host=j?\"\":x.length?x.shift():\"\",(P=!!(r.host&&r.host.indexOf(\"@\")>0)&&r.host.split(\"@\"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift())),(_=_||r.host&&x.length)&&!j&&x.unshift(\"\"),x.length?r.pathname=x.join(\"/\"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(\":\"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:\"oWqx\",\"./util\":\"YsIc\",querystring:\"fk5h\"}],KKrj:[function(e,t,r){var n=arguments[3],i=e(\"./lib/request\"),o=e(\"./lib/response\"),a=e(\"xtend\"),s=e(\"builtin-status-codes\"),u=e(\"url\"),l=r;l.request=function(e,t){e=\"string\"==typeof e?u.parse(e):a(e);var r=-1===n.location.protocol.search(/^https?:$/)?\"http:\":\"\",o=e.protocol||r,s=e.hostname||e.host,l=e.port,f=e.path||\"/\";s&&-1!==s.indexOf(\":\")&&(s=\"[\"+s+\"]\"),e.url=(s?o+\"//\"+s:\"\")+(l?\":\"+l:\"\")+f,e.method=(e.method||\"GET\").toUpperCase(),e.headers=e.headers||{};var c=new i(e);return t&&c.on(\"response\",t),c},l.get=function(e,t){var r=l.request(e,t);return r.end(),r},l.ClientRequest=i,l.IncomingMessage=o.IncomingMessage,l.Agent=function(){},l.Agent.defaultMaxSockets=4,l.globalAgent=new l.Agent,l.STATUS_CODES=s,l.METHODS=[\"CHECKOUT\",\"CONNECT\",\"COPY\",\"DELETE\",\"GET\",\"HEAD\",\"LOCK\",\"M-SEARCH\",\"MERGE\",\"MKACTIVITY\",\"MKCOL\",\"MOVE\",\"NOTIFY\",\"OPTIONS\",\"PATCH\",\"POST\",\"PROPFIND\",\"PROPPATCH\",\"PURGE\",\"PUT\",\"REPORT\",\"SEARCH\",\"SUBSCRIBE\",\"TRACE\",\"UNLOCK\",\"UNSUBSCRIBE\"]},{\"./lib/request\":\"yL7F\",\"./lib/response\":\"UxIR\",xtend:\"K5Tb\",\"builtin-status-codes\":\"OpTI\",url:\"Mej7\"}],wVMl:[function(e,t,r){var n=e(\"http\"),i=e(\"url\"),o=t.exports;for(var a in n)n.hasOwnProperty(a)&&(o[a]=n[a]);function s(e){if(\"string\"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol=\"https:\"),\"https:\"!==e.protocol)throw new Error('Protocol \"'+e.protocol+'\" not supported. Expected \"https:\"');return e}o.request=function(e,t){return e=s(e),n.request.call(this,e,t)},o.get=function(e,t){return e=s(e),n.get.call(this,e,t)}},{http:\"KKrj\",url:\"Mej7\"}],SHlS:[function(e,t,r){e(\"buffer\").Buffer;var n=e(\"buffer\").Buffer;Object.defineProperty(r,\"__esModule\",{value:!0}),r.HttpClient=void 0;var i=v(e(\"@babel/runtime/helpers/defineProperty\")),o=v(e(\"@babel/runtime/regenerator\")),a=v(e(\"@babel/runtime/helpers/asyncToGenerator\")),s=v(e(\"@babel/runtime/helpers/classCallCheck\")),u=v(e(\"@babel/runtime/helpers/createClass\")),l=v(e(\"@babel/runtime/helpers/inherits\")),f=v(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),c=v(e(\"@babel/runtime/helpers/getPrototypeOf\")),h=v(e(\"http\")),d=v(e(\"https\")),p=v(e(\"url\")),b=e(\"./base\"),y=e(\"../../utils\");function v(e){return e&&e.__esModule?e:{default:e}}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t0&&void 0!==a[0]?a[0]:{},r=t.headers,n=t.signal,e.next=3,this.constructRequest(r,n);case 3:return i=e.sent,e.abrupt(\"return\",i);case 5:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),r}(b.BaseClient);r.HttpClient=k},{\"@babel/runtime/helpers/defineProperty\":\"IxO8\",\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",http:\"KKrj\",https:\"wVMl\",url:\"Mej7\",\"./base\":\"uL1U\",\"../../utils\":\"FOZT\",buffer:\"dskh\"}],itmA:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.makeFetchSource=S,r.makeXHRSource=O,r.makeHttpSource=T,r.makeRemoteSource=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.forceXHR,i=void 0!==r&&r,o=(0,n.default)(t,[\"forceXHR\"]);return\"function\"!=typeof fetch||i?\"undefined\"!=typeof XMLHttpRequest?O(e,o):T(e,o):S(e,o)};var n=g(e(\"@babel/runtime/helpers/objectWithoutProperties\")),i=g(e(\"@babel/runtime/helpers/defineProperty\")),o=g(e(\"@babel/runtime/regenerator\")),a=g(e(\"@babel/runtime/helpers/asyncToGenerator\")),s=g(e(\"@babel/runtime/helpers/classCallCheck\")),u=g(e(\"@babel/runtime/helpers/createClass\")),l=g(e(\"@babel/runtime/helpers/inherits\")),f=g(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),c=g(e(\"@babel/runtime/helpers/getPrototypeOf\")),h=e(\"./httputils\"),d=e(\"./basesource\"),p=e(\"./blockedsource\"),b=e(\"./client/fetch\"),y=e(\"./client/xhr\"),v=e(\"./client/http\");function g(e){return e&&e.__esModule?e:{default:e}}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t=t.length)){e.next=4;break}return e.abrupt(\"return\",this.fetchSlices(t,r));case 4:this.maxRanges>0&&t.length;case 5:return e.next=7,Promise.all(t.map((function(e){return n.fetchSlice(e,r)})));case 7:return e.abrupt(\"return\",e.sent);case 8:case\"end\":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"fetchSlices\",value:function(){var e=(0,a.default)(o.default.mark((function e(t,r){var n,i,a,s,u,l,f,c,d,p,b,y,v,g=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.request({headers:w(w({},this.headers),{},{Range:\"bytes=\".concat(t.map((function(e){var t=e.offset,r=e.length;return\"\".concat(t,\"-\").concat(t+r)})).join(\",\"))}),signal:r});case 2:if((n=e.sent).ok){e.next=7;break}throw new Error(\"Error fetching data.\");case 7:if(206!==n.status){e.next=32;break}if(i=(0,h.parseContentType)(n.getHeader(\"content-type\")),a=i.type,s=i.params,\"multipart/byteranges\"!==a){e.next=18;break}return e.t0=h.parseByteRanges,e.next=13,n.getData();case 13:return e.t1=e.sent,e.t2=s.boundary,u=(0,e.t0)(e.t1,e.t2),this._fileSize=u[0].fileSize||null,e.abrupt(\"return\",u);case 18:return e.next=20,n.getData();case 20:if(l=e.sent,f=(0,h.parseContentRange)(n.getHeader(\"content-range\")),c=f.start,d=f.end,p=f.total,this._fileSize=p||null,b=[{data:l,offset:c,length:d-c}],!(t.length>1)){e.next=29;break}return e.next=27,Promise.all(t.slice(1).map((function(e){return g.fetchSlice(e,r)})));case 27:return y=e.sent,e.abrupt(\"return\",b.concat(y));case 29:return e.abrupt(\"return\",b);case 32:if(this.allowFullFile){e.next=34;break}throw new Error(\"Server responded with full file\");case 34:return e.next=36,n.getData();case 36:return v=e.sent,this._fileSize=v.byteLength,e.abrupt(\"return\",[{data:v,offset:0,length:v.byteLength}]);case 39:case\"end\":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"fetchSlice\",value:function(){var e=(0,a.default)(o.default.mark((function e(t,r){var n,i,a,s,u,l,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.offset,i=t.length,e.next=3,this.client.request({headers:w(w({},this.headers),{},{Range:\"bytes=\".concat(n,\"-\").concat(n+i)}),signal:r});case 3:if((a=e.sent).ok){e.next=8;break}throw new Error(\"Error fetching data.\");case 8:if(206!==a.status){e.next=17;break}return e.next=11,a.getData();case 11:return s=e.sent,u=(0,h.parseContentRange)(a.getHeader(\"content-range\")),l=u.total,this._fileSize=l||null,e.abrupt(\"return\",{data:s,offset:n,length:i});case 17:if(this.allowFullFile){e.next=19;break}throw new Error(\"Server responded with full file\");case 19:return e.next=21,a.getData();case 21:return f=e.sent,this._fileSize=f.byteLength,e.abrupt(\"return\",{data:f,offset:0,length:f.byteLength});case 24:case\"end\":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"fileSize\",get:function(){return this._fileSize}}]),r}(d.BaseSource);function x(e,t){var r=t.blockSize,n=t.cacheSize;return null===r?e:new p.BlockedSource(e,r,n)}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.headers,i=void 0===r?{}:r,o=t.credentials,a=t.maxRanges,s=void 0===a?0:a,u=t.allowFullFile,l=void 0!==u&&u,f=(0,n.default)(t,[\"headers\",\"credentials\",\"maxRanges\",\"allowFullFile\"]),c=new b.FetchClient(e,o);return x(new k(c,i,s,l),f)}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.headers,i=void 0===r?{}:r,o=t.maxRanges,a=void 0===o?0:o,s=t.allowFullFile,u=void 0!==s&&s,l=(0,n.default)(t,[\"headers\",\"maxRanges\",\"allowFullFile\"]),f=new y.XHRClient(e);return x(new k(f,i,a,u),l)}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.headers,i=void 0===r?{}:r,o=t.maxRanges,a=void 0===o?0:o,s=t.allowFullFile,u=void 0!==s&&s,l=(0,n.default)(t,[\"headers\",\"maxRanges\",\"allowFullFile\"]),f=new v.HttpClient(e);return x(new k(f,i,a,u),l)}},{\"@babel/runtime/helpers/objectWithoutProperties\":\"U8F3\",\"@babel/runtime/helpers/defineProperty\":\"IxO8\",\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./httputils\":\"ZJpj\",\"./basesource\":\"LzCD\",\"./blockedsource\":\"xD7g\",\"./client/fetch\":\"Un5s\",\"./client/xhr\":\"hvgd\",\"./client/http\":\"SHlS\"}],wM9h:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.makeBufferSource=function(e){return new h(e)};var n=f(e(\"@babel/runtime/helpers/classCallCheck\")),i=f(e(\"@babel/runtime/helpers/createClass\")),o=f(e(\"@babel/runtime/helpers/inherits\")),a=f(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),s=f(e(\"@babel/runtime/helpers/getPrototypeOf\")),u=e(\"./basesource\"),l=e(\"../utils\");function f(e){return e&&e.__esModule?e:{default:e}}function c(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var h=function(e){(0,o.default)(r,e);var t=c(r);function r(e){var i;return(0,n.default)(this,r),(i=t.call(this)).arrayBuffer=e,i}return(0,i.default)(r,[{key:\"fetchSlice\",value:function(e,t){if(t&&t.aborted)throw new l.AbortError(\"Request aborted\");return this.arrayBuffer.slice(e.offset,e.offset+e.length)}}]),r}(u.BaseSource)},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./basesource\":\"LzCD\",\"../utils\":\"FOZT\"}],GiEG:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.makeFileReaderSource=function(e){return new h(e)};var n=f(e(\"@babel/runtime/regenerator\")),i=f(e(\"@babel/runtime/helpers/asyncToGenerator\")),o=f(e(\"@babel/runtime/helpers/classCallCheck\")),a=f(e(\"@babel/runtime/helpers/createClass\")),s=f(e(\"@babel/runtime/helpers/inherits\")),u=f(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),l=f(e(\"@babel/runtime/helpers/getPrototypeOf\"));function f(e){return e&&e.__esModule?e:{default:e}}function c(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var h=function(e){(0,s.default)(r,e);var t=c(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this)).file=e,n}return(0,a.default)(r,[{key:\"fetchSlice\",value:function(){var e=(0,i.default)(n.default.mark((function e(t,r){var i=this;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",new Promise((function(e,n){var o=i.file.slice(t.offset,t.offset+t.length),a=new FileReader;a.onload=function(t){return e(t.target.result)},a.onerror=n,a.onabort=n,a.readAsArrayBuffer(o),r&&r.addEventListener(\"abort\",(function(){return a.abort()}))})));case 1:case\"end\":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()}]),r}(e(\"./basesource\").BaseSource)},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./basesource\":\"LzCD\"}],G7Cz:[function(e,t,r){e(\"buffer\").Buffer;var n=e(\"buffer\").Buffer;Object.defineProperty(r,\"__esModule\",{value:!0}),r.makeFileSource=function(e){return new v(e)};var i=h(e(\"@babel/runtime/regenerator\")),o=h(e(\"@babel/runtime/helpers/asyncToGenerator\")),a=h(e(\"@babel/runtime/helpers/classCallCheck\")),s=h(e(\"@babel/runtime/helpers/createClass\")),u=h(e(\"@babel/runtime/helpers/inherits\")),l=h(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),f=h(e(\"@babel/runtime/helpers/getPrototypeOf\")),c=e(\"fs\");function h(e){return e&&e.__esModule?e:{default:e}}function d(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,f.default)(e);if(t){var i=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}function p(e){return new Promise((function(t,r){(0,c.close)(e,(function(e){e?r(e):t()}))}))}function b(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return new Promise((function(n,i){(0,c.open)(e,t,r,(function(e,t){e?i(e):n(t)}))}))}function y(){for(var e=arguments.length,t=new Array(e),r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var o,s=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw o}}}}function a(e,t){if(e){if(\"string\"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return\"Object\"===r&&e.constructor&&(r=e.constructor.name),\"Map\"===r||\"Set\"===r?Array.from(e):\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>8&255,e[t+1]=255&r},writeUint:function(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=r>>0&255},writeASCII:function(e,t,r){(0,i.times)(r.length,(function(n){e[t+n]=r.charCodeAt(n)}))},ui8:new Uint8Array(8)};d.fl64=new Float64Array(d.ui8.buffer),d.writeDouble=function(e,t,r){d.fl64[0]=r,(0,i.times)(8,(function(r){e[t+r]=d.ui8[7-r]}))};var p=function(e,t,r,a){var s=r,u=Object.keys(a).filter((function(e){return null!=e&&\"undefined\"!==e}));e.writeUshort(t,s,u.length);var l,f=(s+=2)+12*u.length+4,h=o(u);try{var d=function(){var r=l.value,o=null;\"number\"==typeof r?o=r:\"string\"==typeof r&&(o=parseInt(r,10));var u=n.fieldTagTypes[o],h=c[u];if(null==u||void 0===u||void 0===u)throw new Error(\"unknown type of tag: \".concat(o));var d=a[r];if(void 0===d)throw new Error(\"failed to get value for key \".concat(r));\"ASCII\"===u&&\"string\"==typeof d&&!1===(0,i.endsWith)(d,\"\\0\")&&(d+=\"\\0\");var p=d.length;e.writeUshort(t,s,o),s+=2,e.writeUshort(t,s,h),s+=2,e.writeUint(t,s,p);var b=[-1,1,1,2,4,8,0,0,0,0,0,0,8][h]*p,y=s+=4;b>4&&(e.writeUint(t,s,f),y=f),\"ASCII\"===u?e.writeASCII(t,y,d):\"SHORT\"===u?(0,i.times)(p,(function(r){e.writeUshort(t,y+2*r,d[r])})):\"LONG\"===u?(0,i.times)(p,(function(r){e.writeUint(t,y+4*r,d[r])})):\"RATIONAL\"===u?(0,i.times)(p,(function(r){e.writeUint(t,y+8*r,Math.round(1e4*d[r])),e.writeUint(t,y+8*r+4,1e4)})):\"DOUBLE\"===u&&(0,i.times)(p,(function(r){e.writeDouble(t,y+8*r,d[r])})),b>4&&(f+=b+=1&b),s+=4};for(h.s();!(l=h.n()).done;)d()}catch(e){h.e(e)}finally{h.f()}return[s,f]},b=function(e){var t=new Uint8Array(h),r=4,n=d;t[0]=77,t[1]=77,t[3]=42;var i=8;if(n.writeUint(t,r,i),r+=4,e.forEach((function(r,o){var a=p(n,t,i,r);i=a[1],o0&&void 0!==arguments[0]?arguments[0]:new a;s=e},r.debug=function(){var e;return(e=s).debug.apply(e,arguments)},r.log=function(){var e;return(e=s).log.apply(e,arguments)},r.info=function(){var e;return(e=s).info.apply(e,arguments)},r.warn=function(){var e;return(e=s).warn.apply(e,arguments)},r.error=function(){var e;return(e=s).error.apply(e,arguments)},r.time=function(){var e;return(e=s).time.apply(e,arguments)},r.timeEnd=function(){var e;return(e=s).timeEnd.apply(e,arguments)};var n=o(e(\"@babel/runtime/helpers/classCallCheck\")),i=o(e(\"@babel/runtime/helpers/createClass\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(){function e(){(0,n.default)(this,e)}return(0,i.default)(e,[{key:\"log\",value:function(){}},{key:\"debug\",value:function(){}},{key:\"info\",value:function(){}},{key:\"warn\",value:function(){}},{key:\"error\",value:function(){}},{key:\"time\",value:function(){}},{key:\"timeEnd\",value:function(){}}]),e}(),s=new a},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\"}],bsJs:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.fromUrl=function(e){return G.apply(this,arguments)},r.fromArrayBuffer=function(e,t){return z.apply(this,arguments)},r.fromFile=function(e,t){return H.apply(this,arguments)},r.fromBlob=function(e,t){return W.apply(this,arguments)},r.fromUrls=function(e){return q.apply(this,arguments)},r.writeArrayBuffer=function(e,t){return K.apply(this,arguments)},Object.defineProperty(r,\"Pool\",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(r,\"getDecoder\",{enumerable:!0,get:function(){return S.getDecoder}}),Object.defineProperty(r,\"setLogger\",{enumerable:!0,get:function(){return O.setLogger}}),r.rgb=r.globals=r.MultiGeoTIFF=r.default=r.GeoTIFF=void 0;var n=C(e(\"@babel/runtime/regenerator\")),i=C(e(\"@babel/runtime/helpers/defineProperty\")),o=C(e(\"@babel/runtime/helpers/slicedToArray\")),a=C(e(\"@babel/runtime/helpers/asyncToGenerator\")),s=C(e(\"@babel/runtime/helpers/createClass\")),u=C(e(\"@babel/runtime/helpers/inherits\")),l=C(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),f=C(e(\"@babel/runtime/helpers/getPrototypeOf\")),c=C(e(\"@babel/runtime/helpers/wrapNativeSuper\")),h=C(e(\"@babel/runtime/helpers/classCallCheck\")),d=C(e(\"./geotiffimage\")),p=C(e(\"./dataview64\")),b=C(e(\"./dataslice\")),y=C(e(\"./pool\")),v=e(\"./source/remote\"),g=e(\"./source/arraybuffer\"),m=e(\"./source/filereader\"),w=e(\"./source/file\"),_=E(e(\"./globals\"));r.globals=_;var k=e(\"./geotiffwriter\"),x=E(e(\"./rgb\"));r.rgb=x;var S=e(\"./compression\"),O=e(\"./logging\");function T(){if(\"function\"!=typeof WeakMap)return null;var e=new WeakMap;return T=function(){return e},e}function E(e){if(e&&e.__esModule)return e;if(null===e||\"object\"!=typeof e&&\"function\"!=typeof e)return{default:e};var t=T();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=n?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function C(e){return e&&e.__esModule?e:{default:e}}function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t0&&void 0!==H[0]?H[0]:{},r=t.window,i=t.width,a=t.height,s=t.resX,u=t.resY,l=t.bbox,e.next=5,this.getImage();case 5:return f=e.sent,c=f,e.next=9,this.getImageCount();case 9:if(h=e.sent,d=f.getBoundingBox(),!r||!l){e.next=13;break}throw new Error('Both \"bbox\" and \"window\" passed.');case 13:if(!i&&!a){e.next=24;break}if(r&&(p=f.getOrigin(),b=(0,o.default)(p,2),y=b[0],v=b[1],g=f.getResolution(),m=(0,o.default)(g,2),w=m[0],_=m[1],l=[y+r[0]*w,v+r[1]*_,y+r[2]*w,v+r[3]*_]),k=l||d,!i){e.next=20;break}if(!s){e.next=19;break}throw new Error(\"Both width and resX passed\");case 19:s=(k[2]-k[0])/i;case 20:if(!a){e.next=24;break}if(!u){e.next=23;break}throw new Error(\"Both width and resY passed\");case 23:u=(k[3]-k[1])/a;case 24:if(!s&&!u){e.next=48;break}x=[],S=0;case 27:if(!(SM||u&&u>A)){e.next=45;break}return e.abrupt(\"break\",48);case 45:++P,e.next=38;break;case 48:return I=r,l&&(D=f.getOrigin(),L=(0,o.default)(D,2),N=L[0],F=L[1],U=c.getResolution(f),B=(0,o.default)(U,2),G=B[0],z=B[1],I=[Math.round((l[0]-N)/G),Math.round((l[1]-F)/z),Math.round((l[2]-N)/G),Math.round((l[3]-F)/z)],I=[Math.min(I[0],I[2]),Math.min(I[1],I[3]),Math.max(I[0],I[2]),Math.max(I[1],I[3])]),e.abrupt(\"return\",c.readRasters(j(j({},t),{},{window:I})));case 51:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),F=function(e){(0,u.default)(r,e);var t=R(r);function r(e,n,i,o){var a,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(0,h.default)(this,r),(a=t.call(this)).source=e,a.littleEndian=n,a.bigTiff=i,a.firstIFDOffset=o,a.cache=s.cache||!1,a.ifdRequests=[],a.ghostValues=null,a}return(0,s.default)(r,[{key:\"getSlice\",value:function(){var e=(0,a.default)(n.default.mark((function e(t,r){var i;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.bigTiff?4048:1024,e.t0=b.default,e.next=4,this.source.fetch([{offset:t,length:void 0!==r?r:i}]);case 4:return e.t1=e.sent[0],e.t2=t,e.t3=this.littleEndian,e.t4=this.bigTiff,e.abrupt(\"return\",new e.t0(e.t1,e.t2,e.t3,e.t4));case 9:case\"end\":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"parseFileDirectoryAt\",value:function(){var e=(0,a.default)(n.default.mark((function e(t){var r,i,o,a,s,u,l,f,c,h,d,p,b,y,v,g,m,w,k,x;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.bigTiff?20:12,i=this.bigTiff?8:2,e.next=4,this.getSlice(t);case 4:if(o=e.sent,a=this.bigTiff?o.readUint64(t):o.readUint16(t),s=a*r+(this.bigTiff?16:6),o.covers(t,s)){e.next=11;break}return e.next=10,this.getSlice(t,s);case 10:o=e.sent;case 11:u={},l=t+(this.bigTiff?8:2),f=0;case 14:if(!(f0&&void 0!==i[0]?i[0]:0,e.next=3,this.requestIFD(t);case 3:return r=e.sent,e.abrupt(\"return\",new d.default(r.fileDirectory,r.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source));case 5:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:\"getImageCount\",value:function(){var e=(0,a.default)(n.default.mark((function e(){var t,r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0,r=!0;case 2:if(!r){e.next=18;break}return e.prev=3,e.next=6,this.requestIFD(t);case 6:++t,e.next=16;break;case 9:if(e.prev=9,e.t0=e.catch(3),!(e.t0 instanceof L)){e.next=15;break}r=!1,e.next=16;break;case 15:throw e.t0;case 16:e.next=2;break;case 18:return e.abrupt(\"return\",t);case 19:case\"end\":return e.stop()}}),e,this,[[3,9]])})));return function(){return e.apply(this,arguments)}}()},{key:\"getGhostValues\",value:function(){var e=(0,a.default)(n.default.mark((function e(){var t,r,i,a,s,u,l,f,c=this;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.bigTiff?16:8,!this.ghostValues){e.next=3;break}return e.abrupt(\"return\",this.ghostValues);case 3:return i=(r=\"GDAL_STRUCTURAL_METADATA_SIZE=\").length+100,e.next=7,this.getSlice(t,i);case 7:if(a=e.sent,r!==I(a,_.fieldTypes.ASCII,r.length,t)){e.next=19;break}if(s=I(a,_.fieldTypes.ASCII,i,t),u=s.split(\"\\n\")[0],!((l=Number(u.split(\"=\")[1].split(\" \")[0])+u.length)>i)){e.next=16;break}return e.next=15,this.getSlice(t,l);case 15:a=e.sent;case 16:f=I(a,_.fieldTypes.ASCII,l,t),this.ghostValues={},f.split(\"\\n\").filter((function(e){return e.length>0})).map((function(e){return e.split(\"=\")})).forEach((function(e){var t=(0,o.default)(e,2),r=t[0],n=t[1];c.ghostValues[r]=n}));case 19:return e.abrupt(\"return\",this.ghostValues);case 20:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:\"close\",value:function(){return\"function\"==typeof this.source.close&&this.source.close()}}],[{key:\"fromSource\",value:function(){var e=(0,a.default)(n.default.mark((function e(t,i,o){var a,s,u,l,f,c,h;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.fetch([{offset:0,length:1024}],o);case 2:if(a=e.sent[0],s=new p.default(a),18761!==(u=s.getUint16(0,0))){e.next=9;break}l=!0,e.next=14;break;case 9:if(19789!==u){e.next=13;break}l=!1,e.next=14;break;case 13:throw new TypeError(\"Invalid byte order value.\");case 14:if(42!==(f=s.getUint16(2,l))){e.next=19;break}c=!1,e.next=27;break;case 19:if(43!==f){e.next=26;break}if(c=!0,8===s.getUint16(4,l)){e.next=24;break}throw new Error(\"Unsupported offset byte-size.\");case 24:e.next=27;break;case 26:throw new TypeError(\"Invalid magic number.\");case 27:return h=c?s.getUint64(8,l):s.getUint32(4,l),e.abrupt(\"return\",new r(t,l,c,h,i));case 29:case\"end\":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}()}]),r}(N);r.GeoTIFF=F;var U=F;r.default=U;var B=function(e){(0,u.default)(r,e);var t=R(r);function r(e,n){var i;return(0,h.default)(this,r),(i=t.call(this)).mainFile=e,i.overviewFiles=n,i.imageFiles=[e].concat(n),i.fileDirectoriesPerFile=null,i.fileDirectoriesPerFileParsing=null,i.imageCount=null,i}return(0,s.default)(r,[{key:\"parseFileDirectoriesPerFile\",value:function(){var e=(0,a.default)(n.default.mark((function e(){var t;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map((function(e){return e.parseFileDirectoryAt(e.firstIFDOffset)}))),e.next=3,Promise.all(t);case 3:return this.fileDirectoriesPerFile=e.sent,e.abrupt(\"return\",this.fileDirectoriesPerFile);case 5:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:\"getImage\",value:function(){var e=(0,a.default)(n.default.mark((function e(){var t,r,i,o,a,s,u,l=arguments;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:0,e.next=3,this.getImageCount();case 3:return e.next=5,this.parseFileDirectoriesPerFile();case 5:r=0,i=0,o=0;case 8:if(!(o1&&void 0!==o[1]?o[1]:{},i=o.length>2?o[2]:void 0,e.abrupt(\"return\",F.fromSource((0,v.makeRemoteSource)(t,r),i));case 3:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}function z(){return(z=(0,a.default)(n.default.mark((function e(t,r){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",F.fromSource((0,g.makeBufferSource)(t),r));case 1:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}function H(){return(H=(0,a.default)(n.default.mark((function e(t,r){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",F.fromSource((0,w.makeFileSource)(t),r));case 1:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}function W(){return(W=(0,a.default)(n.default.mark((function e(t,r){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",F.fromSource((0,m.makeFileReaderSource)(t),r));case 1:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}function q(){return(q=(0,a.default)(n.default.mark((function e(t){var r,i,o,a,s,u=arguments;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:[],i=u.length>2&&void 0!==u[2]?u[2]:{},o=u.length>3?u[3]:void 0,e.next=5,F.fromSource((0,v.makeRemoteSource)(t,i),o);case 5:return a=e.sent,e.next=8,Promise.all(r.map((function(e){return F.fromSource((0,v.makeRemoteSource)(e,i))})));case 8:return s=e.sent,e.abrupt(\"return\",new B(a,s));case 10:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}function K(){return(K=(0,a.default)(n.default.mark((function e(t,r){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",(0,k.writeGeotiff)(t,r));case 1:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}r.MultiGeoTIFF=B},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/defineProperty\":\"IxO8\",\"@babel/runtime/helpers/slicedToArray\":\"HETk\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"@babel/runtime/helpers/wrapNativeSuper\":\"ozpi\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"./geotiffimage\":\"eOWo\",\"./dataview64\":\"dqpX\",\"./dataslice\":\"dGLV\",\"./pool\":\"dHPO\",\"./source/remote\":\"itmA\",\"./source/arraybuffer\":\"wM9h\",\"./source/filereader\":\"GiEG\",\"./source/file\":\"G7Cz\",\"./globals\":\"j27V\",\"./geotiffwriter\":\"BGyE\",\"./rgb\":\"fpBl\",\"./compression\":\"FGCZ\",\"./logging\":\"dy4f\"}]},{},[\"bsJs\"],\"GeoTIFF\");\n//# sourceMappingURL=/sm/6b05ec3e6aee27214397dcd933f0a1a0def04511045c0ced378787b04765ef87.map\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/geotiff/geotiff.js?"); + +/***/ }), + +/***/ "./src/secondary/loadingScreen.scss": +/*!******************************************!*\ + !*** ./src/secondary/loadingScreen.scss ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var api = __webpack_require__(/*! ../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ \"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/dist/cjs.js??ref--5-2!../../node_modules/sass-loader/dist/cjs.js!./loadingScreen.scss */ \"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/sass-loader/dist/cjs.js!./src/secondary/loadingScreen.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.i, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/loadingScreen.scss?"); + +/***/ }), + +/***/ "./src/secondary/loadingScreen.ts": +/*!****************************************!*\ + !*** ./src/secondary/loadingScreen.ts ***! + \****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _loadingScreen_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loadingScreen.scss */ \"./src/secondary/loadingScreen.scss\");\n/* harmony import */ var _loadingScreen_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_loadingScreen_scss__WEBPACK_IMPORTED_MODULE_0__);\n\n\nvar Controls = function () {\n function Controls(parent) {\n var _this = this;\n\n this.end = function (name) {\n if (_this.p.options.loadingScreen === false) return;\n\n if (_this.loadingContainer) {\n _this.loadingContainer.style.opacity = '0';\n _this.p._.sceneContainer.style.filter = 'blur(0px) brightness(1)';\n setTimeout(function () {\n _this.loadingContainer.remove();\n\n _this.loadingContainer = null;\n _this.p._.sceneContainer.style.filter = null;\n _this.p._.sceneContainer.style.transition = null;\n }, 500);\n }\n };\n\n this.p = parent;\n if (this.p.options.loadingScreen === false) return;\n this.loadingContainer = document.createElement('div');\n this.loadingContainer.setAttribute('id', '_lithosphere_loadingscreen');\n this.loadingContainer.style.position = 'absolute';\n this.loadingContainer.style.top = '0';\n this.loadingContainer.style.left = '0';\n this.loadingContainer.style.width = '100%';\n this.loadingContainer.style.height = '100%';\n this.loadingContainer.style.background = 'black';\n this.loadingContainer.style.color = 'white';\n this.loadingContainer.style.fontFamily = 'sans-serif';\n this.loadingContainer.style.zIndex = '9001';\n this.loadingContainer.style.opacity = '1';\n this.loadingContainer.style.transition = 'opacity 0.5s ease-in';\n this.loadingContainer.innerHTML = [\"
\", \"
\", \"
\", \"
\", \"
\", \"
\", \"
\", '
'].join('\\n');\n\n this.p._.container.appendChild(this.loadingContainer);\n\n this.p._.sceneContainer.style.filter = 'blur(10px) brightness(0.5)';\n this.p._.sceneContainer.style.transition = 'filter 0.5s ease-in-out';\n }\n\n return Controls;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Controls);\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/loadingScreen.ts?"); + +/***/ }), + +/***/ "./src/secondary/sprites.ts": +/*!**********************************!*\ + !*** ./src/secondary/sprites.ts ***! + \**********************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\nvar Sprites = {\n spriteMaterials: {},\n makeMarkerSprite: function (parameters, id, forceNewMaterial) {\n var sprite = new three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"](Sprites.makeMarkerMaterial(parameters, id, forceNewMaterial));\n sprite.style = sprite.style || {};\n sprite.style.radius = parameters.hasOwnProperty('radius') ? parameters['radius'] : 32;\n return sprite;\n },\n makeMarkerMaterial: function (parameters, id, forceNewMaterial) {\n if (id && this.spriteMaterials.hasOwnProperty(id) && forceNewMaterial !== true) {\n return this.spriteMaterials[id];\n } else {\n if (parameters === undefined) parameters = {};\n var radius = parameters.hasOwnProperty('radius') ? parameters['radius'] : 64;\n radius = Math.max(radius, 64);\n var fillColor = parameters.hasOwnProperty('fillColor') ? parameters['fillColor'] : {\n r: 255,\n g: 255,\n b: 255,\n a: parameters['fillOpacity'] != null ? parameters['fillOpacity'] : 1.0\n };\n var strokeWeight = parameters.hasOwnProperty('weight') ? parameters['weight'] : 4;\n var strokeColor = parameters.hasOwnProperty('color') ? parameters['color'] : {\n r: 0,\n g: 0,\n b: 0,\n a: 1.0\n };\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n var width = radius * 2;\n var height = radius * 2;\n canvas.width = width;\n canvas.height = height;\n context.beginPath();\n context.arc(canvas.width / 2, canvas.height / 2, radius - strokeWeight * (radius / 12), 0, 2 * Math.PI, false);\n\n if (typeof fillColor === 'object') {\n context.fillStyle = 'rgba(' + fillColor.r + ',' + fillColor.g + ',' + fillColor.b + ',' + fillColor.a + ')';\n } else {\n context.fillStyle = fillColor;\n }\n\n context.fill();\n context.lineWidth = strokeWeight * (radius / 8);\n\n if (typeof strokeColor === 'object') {\n context.strokeStyle = 'rgba(' + strokeColor.r + ',' + strokeColor.g + ',' + strokeColor.b + ',' + strokeColor.a + ')';\n } else {\n context.strokeStyle = strokeColor;\n }\n\n context.stroke();\n var texture = new three__WEBPACK_IMPORTED_MODULE_0__[\"Texture\"](canvas);\n texture.needsUpdate = true;\n var spriteMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"SpriteMaterial\"]({\n map: texture,\n transparent: true,\n alphaTest: 0.01\n });\n\n if (id && forceNewMaterial !== true) {\n this.spriteMaterials[id] = spriteMaterial;\n }\n\n return spriteMaterial;\n }\n },\n makeTextSprite: function (message, parameters) {\n if (parameters === undefined) parameters = {};\n var fontface = parameters.hasOwnProperty('fontface') ? parameters['fontface'] : 'Arial';\n var fontsize = parameters.hasOwnProperty('fontsize') ? parameters['fontsize'] : 18;\n var strokeWeight = parameters.hasOwnProperty('strokeWeight') ? parameters['strokeWeight'] : 4;\n var strokeColor = parameters.hasOwnProperty('strokeColor') ? parameters['strokeColor'] : {\n r: 0,\n g: 0,\n b: 0,\n a: 1.0\n };\n var fontColor = parameters.hasOwnProperty('fontColor') ? parameters['fontColor'] : {\n r: 255,\n g: 255,\n b: 255,\n a: 1.0\n };\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n var width = 1024;\n var height = 64;\n canvas.width = width;\n canvas.height = height;\n context.font = 'Bold ' + fontsize + 'px ' + fontface;\n context.strokeStyle = 'rgba(' + strokeColor.r + ',' + strokeColor.g + ',' + strokeColor.b + ',' + strokeColor.a + ')';\n context.lineWidth = strokeWeight;\n context.fillStyle = 'rgba(' + fontColor.r + ',' + fontColor.g + ',' + fontColor.b + ',' + fontColor.a + ')';\n context.textAlign = 'left';\n context.strokeText(message, width / 2 + fontsize, height - fontsize / 1.8);\n context.fillText(message, width / 2 + fontsize, height - fontsize / 1.8);\n var texture = new three__WEBPACK_IMPORTED_MODULE_0__[\"Texture\"](canvas);\n texture.needsUpdate = true;\n var spriteMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"SpriteMaterial\"]({\n map: texture\n });\n var sprite = new three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"](spriteMaterial);\n sprite.scale.set(64, 4, 1);\n return sprite;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Sprites);\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/sprites.ts?"); + +/***/ }), + +/***/ "./src/utils/index.ts": +/*!****************************!*\ + !*** ./src/utils/index.ts ***! + \****************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\nvar Utils = {\n getIn: function (obj, keyArray, notSetValue) {\n if (obj == null) return notSetValue != null ? notSetValue : null;\n if (typeof keyArray === 'string') keyArray = keyArray.split('.');\n if (keyArray == null) return notSetValue != null ? notSetValue : null;\n var object = Object.assign({}, obj);\n\n for (var i = 0; i < keyArray.length; i++) {\n if (object.hasOwnProperty(keyArray[i])) object = object[keyArray[i]];else return notSetValue != null ? notSetValue : null;\n }\n\n return object;\n },\n mod: function (n, m) {\n var remain = n % m;\n return Math.floor(remain >= 0 ? remain : remain + m);\n },\n findHighestMaxZoom: function (tileLayers) {\n var highest = 0;\n\n for (var l in tileLayers) {\n if (tileLayers[l].name != 'Vectors As Tiles') if (tileLayers[l].maxZoom > highest) {\n highest = tileLayers[l].maxZoom;\n }\n }\n\n return highest;\n },\n findLowestMinZoom: function (tileLayers) {\n var lowest = Infinity;\n\n for (var l in tileLayers) {\n if (tileLayers[l].path !== '_vectorsastile_') {\n if (tileLayers[l].minZoom < lowest) {\n lowest = tileLayers[l].minZoom;\n }\n }\n }\n\n return lowest;\n },\n isInExtent: function (xyz, bb, projection) {\n var inExtent = true;\n\n if (bb) {\n var tx_ext = xyz.x + 0;\n var ty_ext = xyz.y + 0;\n var projectedLL = projection.tileXYZ2LatLng(tx_ext, ty_ext, xyz.z);\n var tlat_ext = projectedLL.lat;\n var tlon_ext = projectedLL.lng;\n inExtent = tlat_ext < bb[3] && tlat_ext > bb[1] && tlon_ext < bb[2] && tlon_ext > bb[0];\n tx_ext = xyz.x + 1;\n ty_ext = xyz.y + 0;\n projectedLL = projection.tileXYZ2LatLng(tx_ext, ty_ext, xyz.z);\n tlat_ext = projectedLL.lat;\n tlon_ext = projectedLL.lng;\n inExtent = inExtent || tlat_ext < bb[3] && tlat_ext > bb[1] && tlon_ext < bb[2] && tlon_ext > bb[0];\n tx_ext = xyz.x + 1;\n ty_ext = xyz.y + 1;\n projectedLL = projection.tileXYZ2LatLng(tx_ext, ty_ext, xyz.z);\n tlat_ext = projectedLL.lat;\n tlon_ext = projectedLL.lng;\n inExtent = inExtent || tlat_ext < bb[3] && tlat_ext > bb[1] && tlon_ext < bb[2] && tlon_ext > bb[0];\n tx_ext = xyz.x + 0;\n ty_ext = xyz.y + 1;\n projectedLL = projection.tileXYZ2LatLng(tx_ext, ty_ext, xyz.z);\n tlat_ext = projectedLL.lat;\n tlon_ext = projectedLL.lng;\n inExtent = inExtent || tlat_ext < bb[3] && tlat_ext > bb[1] && tlon_ext < bb[2] && tlon_ext > bb[0];\n }\n\n return inExtent;\n },\n clone: function (obj) {\n var copy;\n if (null == obj || 'object' != typeof obj) return obj;\n\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n if (obj instanceof Array) {\n copy = [];\n\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = Utils.clone(obj[i]);\n }\n\n return copy;\n }\n\n if (obj instanceof Object) {\n copy = {};\n\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = Utils.clone(obj[attr]);\n }\n\n return copy;\n }\n\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n },\n capitalizeFirstLetter: function (string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n },\n getExtension: function (string) {\n return /(?:\\.([^.]+))?$/.exec(string)[1] || '';\n },\n getRadiansPerPixel: function (zoom) {\n return 360 / Math.pow(2, zoom) * (Math.PI / 180) / 256;\n },\n lastTileContains: [],\n tileContains: function (xyz, z, useLast) {\n if (useLast) {\n for (var i = 0; i < Utils.lastTileContains.length; i++) {\n var lastxyz = Utils.lastTileContains[i].call.xyz;\n\n if (lastxyz[0] == xyz[0] && lastxyz[1] == xyz[1] && lastxyz[2] == xyz[2] && Utils.lastTileContains[i].call.z == z) {\n return Utils.lastTileContains[i].result;\n }\n }\n }\n\n var contained = [];\n var zoomRatio = Math.pow(2, z) / Math.pow(2, xyz[2]);\n var max = [(xyz[0] + 1) * zoomRatio - 1, (xyz[1] + 1) * zoomRatio - 1];\n var min = [max[0] - zoomRatio + 1, max[1] - zoomRatio + 1];\n\n for (var x = min[0]; x <= max[0]; x++) {\n for (var y = min[1]; y <= max[1]; y++) {\n contained.push([x, y, z]);\n }\n }\n\n Utils.lastTileContains.unshift({\n call: {\n xyz: xyz,\n z: z\n },\n result: contained\n });\n if (Utils.lastTileContains.length > 3) Utils.lastTileContains.pop();\n return contained;\n },\n tileIsContained: function (xyzContainer, xyzContained, useLast) {\n var contains = this.tileContains(xyzContainer, xyzContained[2], useLast);\n\n for (var i = 0; i < contains.length; i++) {\n if (contains[i][0] == xyzContained[0] && contains[i][1] == xyzContained[1]) return true;\n }\n\n return false;\n },\n arrayAverage: function (array, key) {\n var total = 0;\n\n for (var i = 0; i < array.length; i++) {\n if (key != null) total += array[i][key];else total += array[i];\n }\n\n return total / array.length;\n },\n hexToRGB: function (hex) {\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function (m, r, g, b) {\n return r + r + g + g + b + b;\n });\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n },\n rotatePoint: function (pt, center, angle) {\n var cosAngle = Math.cos(angle);\n var sinAngle = Math.sin(angle);\n var dx = pt.x - center[0];\n var dy = pt.y - center[1];\n return {\n x: center[0] + dx * cosAngle - dy * sinAngle,\n y: center[1] + dx * sinAngle + dy * cosAngle\n };\n },\n rotateAroundArbAxis: function (object, axis, radians, noPremultiply) {\n object.updateWorldMatrix(true);\n var invWorldRot = object.getWorldQuaternion(new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]()).invert();\n axis.applyQuaternion(invWorldRot);\n var deltaLocalRot = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\n deltaLocalRot.setFromAxisAngle(axis, radians);\n object.quaternion.multiply(deltaLocalRot);\n },\n getParamString: function (params, baseUrl, isUppercase) {\n var str = [];\n var urlParams = new URLSearchParams(baseUrl.toUpperCase());\n\n for (var o in params) {\n if (!urlParams.has(o.toUpperCase())) str.push(encodeURIComponent(isUppercase ? o.toUpperCase() : o) + '=' + encodeURIComponent(params[o]));\n }\n\n return (baseUrl && baseUrl.indexOf('?') !== -1 ? '&' : '?') + str.join('&');\n },\n isArray: function (object) {\n return Object.prototype.toString.call(object) === '[object Array]';\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Utils);\n\n//# sourceURL=webpack://LithoSphere/./src/utils/index.ts?"); + +/***/ }), + +/***/ "./src/utils/paths.ts": +/*!****************************!*\ + !*** ./src/utils/paths.ts ***! + \****************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ */ \"./src/utils/index.ts\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\n\nvar Paths = {\n buildPath: function (format, basePath, tD, projection, tileResolution, trueTileResolution, options, asObject) {\n format = format || 'tms';\n var path;\n var xyz = {\n x: tD.x,\n y: tD.y,\n z: tD.z\n };\n\n switch (format) {\n case 'wmts':\n path = basePath;\n path = path.replace('{z}', xyz.z);\n path = path.replace('{x}', xyz.x);\n path = path.replace('{y}', xyz.y);\n break;\n\n case 'wms':\n path = Paths.wmsExtension.buildPath(basePath, xyz, projection, tileResolution, trueTileResolution, options);\n break;\n\n default:\n path = basePath;\n path = path.replace('{z}', xyz.z);\n path = path.replace('{x}', xyz.x);\n xyz.y = projection.invertY(xyz.y, xyz.z);\n path = path.replace('{y}', xyz.y);\n }\n\n if (asObject) return {\n path: path,\n xyz: xyz\n };\n return path;\n },\n wmsExtension: {\n defaultWmsParams: {\n SERVICE: 'WMS',\n REQUEST: 'GetMap',\n FORMAT: 'image/png',\n TRANSPARENT: true,\n VERSION: '1.1.1',\n WIDTH: null,\n HEIGHT: null\n },\n extensionOptions: {\n crsCode: 'EPSG:4326',\n uppercase: true\n },\n buildPath: function (basePath, xyz, projection, tileResolution, trueTileResolution, options) {\n var wmsParams = __assign({}, Paths.wmsExtension.defaultWmsParams);\n\n options = options || {};\n if (options.wmsParams) for (var i in options.wmsParams) {\n if (!(i in Paths.wmsExtension.extensionOptions)) {\n wmsParams[i] = options.wmsParams[i];\n }\n }\n wmsParams.VERSION = options.wmsVersion || wmsParams.VERSION;\n\n if (options.correctSeams === true) {\n tileResolution--;\n wmsParams.WIDTH = wmsParams.HEIGHT = tileResolution + 2;\n } else wmsParams.WIDTH = wmsParams.HEIGHT = tileResolution;\n\n var crsCode = projection.tileMapResource.crsCode || Paths.wmsExtension.extensionOptions.crsCode;\n wmsParams[parseFloat(wmsParams.VERSION) >= 1.3 ? 'CRS' : 'SRS'] = crsCode;\n var bounds = projection.tileXYZ2NwSe(xyz, trueTileResolution, true, options.correctSeams === true ? (tileResolution + 1) / tileResolution : null);\n var bbox = (parseFloat(wmsParams.VERSION) >= 1.3 && crsCode === 'EPSG:4326' ? [bounds.min.y, bounds.min.x, bounds.max.y, bounds.max.x] : [bounds.min.x, bounds.min.y, bounds.max.x, bounds.max.y]).join(',');\n return basePath + ___WEBPACK_IMPORTED_MODULE_0__[\"default\"].getParamString(wmsParams, basePath, Paths.wmsExtension.extensionOptions.uppercase) + (Paths.wmsExtension.extensionOptions.uppercase ? '&BBOX=' : '&bbox=') + bbox;\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Paths);\n\n//# sourceURL=webpack://LithoSphere/./src/utils/paths.ts?"); + +/***/ }) + +/******/ }); +}); \ No newline at end of file diff --git a/dist/src/layers/index.d.ts b/dist/src/layers/index.d.ts index 3bc8652..ad61710 100644 --- a/dist/src/layers/index.d.ts +++ b/dist/src/layers/index.d.ts @@ -2,12 +2,14 @@ import Tile3dLayerer from './tile3d'; import TileLayerer from './tile'; import ClampedLayerer from './clamped'; import VectorLayerer from './vector'; +import ModelLayerer from './model'; interface Private { layerers: { tile3d: Tile3dLayerer; tile: TileLayerer; clamped: ClampedLayerer; vector: VectorLayerer; + model: ModelLayerer; }; } export default class Layers { @@ -18,6 +20,7 @@ export default class Layers { tile: any; clamped: any; vector: any; + model: any; all: any; constructor(parent: any); _reset(): void; diff --git a/dist/src/layers/model.d.ts b/dist/src/layers/model.d.ts index e69de29..fdd70db 100644 --- a/dist/src/layers/model.d.ts +++ b/dist/src/layers/model.d.ts @@ -0,0 +1,13 @@ +export default class ModelLayerer { + p: any; + constructor(parent: any); + add: (layerObj: any, callback?: Function) => void; + toggle: (name: string, on?: boolean) => boolean; + setOpacity: (name: string, opacity: number) => boolean; + remove: (name: string) => boolean; + private generateModel; + private objToModel; + private daeToModel; + private gltfToModel; + private localizeModel; +} diff --git a/examples/example.html b/examples/example.html index 0cc9861..8eab788 100644 --- a/examples/example.html +++ b/examples/example.html @@ -36,8 +36,8 @@