New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@loaders.gl/draco

Package Overview
Dependencies
Maintainers
9
Versions
339
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/draco - npm Package Compare versions

Comparing version 2.0.0-alpha.3 to 2.0.0-alpha.4

2

dist/dist.min.js

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

!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=3)}([function(t,e,r){"use strict";(function(t,n){r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return s}));const o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},i=o.global||o.self||o.window,a="object"!=typeof n||"[object process]"!==String(n)||n.browser,s="function"==typeof importScripts,c=void 0!==n&&n.version&&n.version.match(/v([0-9]*)/);c&&parseFloat(c[1])}).call(this,r(2),r(4))},function(t,e){},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(e){const n=r(5),o="undefined"==typeof window?e:window;o.loaders=o.loaders||{},t.exports=Object.assign(o.loaders,n)}).call(this,r(2))},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var c,d=[],u=!1,l=-1;function h(){u&&c&&(u=!1,c.length?d=c.concat(d):l=-1,d.length&&f())}function f(){if(!u){var t=s(h);u=!0;for(var e=d.length;e;){for(c=d,d=[];++l<e;)c&&c[l].run();l=-1,e=d.length}c=null,u=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function b(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];d.push(new y(t,e)),1!==d.length||u||s(f)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=b,o.addListener=b,o.once=b,o.off=b,o.removeListener=b,o.removeAllListeners=b,o.emit=b,o.prependListener=b,o.prependOnceListener=b,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r(1);const i="2.0.0-alpha.3",a={};async function s(t,e=null,r={}){return e&&(t=function(t,e,r){const o=r.modules||{};if(o[t])return o[t];if(r.CDN)return function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(r.CDN.startsWith("http")),`${r.CDN}/${e}@${i}/dist/libs/${t}`;if(n.c)return`../src/libs/${t}`;return`modules/${e}/src/libs/${t}`}(t,e,r)),a[t]=a[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!n.b)return Object(o.requireFromFile)(t);if(n.c)return importScripts(t);const e=await fetch(t);return function(t,e){if(!n.b)return Object(o.requireFromString)(t,e);if(n.c)return eval.call(n.a,t),null;const r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch(e){r.text=t}return document.body.appendChild(r),null}(await e.text(),t)}(t),await a[t]}let c,d;async function u(t){const e=t.modules||{};return e.draco3d?e.draco3d:(c=c||async function(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await s("draco_decoder.js","draco",t);break;case"wasm":default:[e,r]=await Promise.all([await s("draco_wasm_wrapper.js","draco",t),await s("draco_decoder.wasm","draco",t)])}return e=e||n.a.DracoDecoderModule,await function(t,e){const r={};e&&(r.wasmBinary=e);return new Promise(e=>{t({...r,onModuleLoaded:t=>e({draco:t})})})}(e,r)}(t),await c)}async function l(t){const e=t.modules||{};return e.draco3d?e.draco3d:(d=d||async function(t){let e=await s("draco_encoder.js","draco",t);return e=e||n.a.DracoEncoderModule,new Promise(t=>{e({onModuleLoaded:e=>t({draco:e})})})}(t),await d)}const h={TRIANGULAR_MESH:0,POINT_CLOUD:1},f={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},y={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class b{constructor(t){this.draco=t}destroy(){}destroyGeometry(t){t&&this.draco.destroy(t.dracoGeometry)}parseSync(t){const e=new this.draco.DecoderBuffer;e.Init(new Int8Array(t),t.byteLength);const r=new this.draco.Decoder,n={};let o,i,a;try{const t=r.GetEncodedGeometryType(e);switch(t){case this.draco.TRIANGULAR_MESH:i=new this.draco.Mesh,o=r.DecodeBufferToMesh(e,i),a={type:h.TRIANGULAR_MESH,faceCount:i.num_faces(),attributeCount:i.num_attributes(),vertexCount:i.num_points()};break;case this.draco.POINT_CLOUD:i=new this.draco.PointCloud,o=r.DecodeBufferToPointCloud(e,i),a={type:h.POINT_CLOUD,attributeCount:i.num_attributes(),vertexCount:i.num_points()};break;default:throw new Error("Unknown DRACO geometry type.")}if(!o.ok()||!i.ptr){const t=`DRACO decompression failed: ${o.error_msg()}`;throw i&&this.draco.destroy(i),new Error(t)}n.header={vertexCount:a.vertexCount},n.loaderData={header:a},this.extractDRACOGeometry(r,i,t,n)}finally{this.draco.destroy(r),this.draco.destroy(e)}return n}extractDRACOGeometry(t,e,r,n){const o=this.getAttributes(t,e),i=o.POSITION;if(!i)throw new Error("DRACO decompressor: No position attribute found.");return this.getPositionAttributeMetadata(i),r===this.draco.TRIANGULAR_MESH?(o.indices="TRIANGLE_STRIP"===this.drawMode?this.getMeshStripIndices(t,e):this.getMeshFaceIndices(t,e),n.mode="TRIANGLE_STRIP"===this.drawMode?5:4):n.mode=0,o.indices&&(n.indices={value:o.indices,size:1},delete o.indices),n.attributes=o,n}getPositionAttributeMetadata(t){this.metadata=this.metadata||{},this.metadata.attributes=this.metadata.attributes||{};const e=new this.draco.AttributeQuantizationTransform;if(e.InitFromAttribute(t)){this.metadata.attributes.position.isQuantized=!0,this.metadata.attributes.position.maxRange=e.range(),this.metadata.attributes.position.numQuantizationBits=e.quantization_bits(),this.metadata.attributes.position.minValues=new Float32Array(3);for(let t=0;t<3;++t)this.metadata.attributes.position.minValues[t]=e.min_value(t)}this.draco.destroy(e)}getAttributes(t,e){const r={},n=e.num_points();for(const o in f){const i=this.draco[o],a=t.GetAttributeId(e,i);if(-1!==a){const i=t.GetAttribute(e,a),{typedArray:s}=this.getAttributeTypedArray(t,e,i,o);r[f[o]]={value:s,size:s.length/n}}}return r}getMeshFaceIndices(t,e){const r=e.num_faces(),n=new Uint32Array(3*r),o=new this.draco.DracoInt32Array;for(let i=0;i<r;++i){t.GetFaceFromMesh(e,i,o);const r=3*i;n[r]=o.GetValue(0),n[r+1]=o.GetValue(1),n[r+2]=o.GetValue(2)}return this.draco.destroy(o),n}getMeshStripIndices(t,e){const r=new this.draco.DracoInt32Array;t.GetTriangleStripsFromMesh(e,r);const n=new Uint32Array(r.size());for(let t=0;t<r.size();++t)n[t]=r.GetValue(t);return this.draco.destroy(r),n}getAttributeTypedArray(t,e,r,n){if(0===r.ptr){throw new Error(`DRACO decode bad attribute ${n}`)}const o=y[r.data_type()],i=r.num_components(),a=e.num_points()*i;let s,c;switch(o){case Float32Array:s=new this.draco.DracoFloat32Array,t.GetAttributeFloatForAllPoints(e,r,s),c=new Float32Array(a);break;case Int8Array:s=new this.draco.DracoInt8Array,t.GetAttributeInt8ForAllPoints(e,r,s),c=new Int8Array(a);break;case Int16Array:s=new this.draco.DracoInt16Array,t.GetAttributeInt16ForAllPoints(e,r,s),c=new Int16Array(a);break;case Int32Array:s=new this.draco.DracoInt32Array,t.GetAttributeInt32ForAllPoints(e,r,s),c=new Int32Array(a);break;case Uint8Array:s=new this.draco.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(e,r,s),c=new Uint8Array(a);break;case Uint16Array:s=new this.draco.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(e,r,s),c=new Uint16Array(a);break;case Uint32Array:s=new this.draco.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(e,r,s),c=new Uint32Array(a);break;default:throw new Error("DRACO decoder: unexpected attribute type.")}for(let t=0;t<a;t++)c[t]=s.GetValue(t);return this.draco.destroy(s),{typedArray:c,components:i}}decode(t,e){return this.parseSync(t,e)}}const A={id:"draco",name:"Draco",version:"2.0.0-alpha.3",extensions:["drc"],mimeType:"application/octet-stream",binary:!0,test:"DRACO"},p={...A,parse:async function(t,e,r,n){const{draco:o}=await u(e),i=new b(o);try{return i.parseSync(t,e)}finally{i.destroy()}},options:{draco:{decoderType:"object"==typeof WebAssembly?"wasm":"js",libraryPath:"libs/"}}},w={...A,options:{draco:{workerUrl:"https://unpkg.com/@loaders.gl/draco@2.0.0-alpha.3/dist/draco-loader.worker.js",libraryPath:"libs/"}}};const m={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"};function O(){}function I(t){const e=t.size(),r=new ArrayBuffer(e),n=new Int8Array(r);for(let r=0;r<e;++r)n[r]=t.GetValue(r);return r}class _{constructor(t,e={}){this.draco=t,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.log=e.log||O}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.dracoMeshBuilder=null,this.dracoEncoder=null,this.draco=null}destroyEncodedObject(t){t&&this.draco.destroy(t)}encodeSync(t,e){return this._setOptions(e),e.pointcloud?this._encodePointCloud(t):this._encodeMesh(t)}_getAttributesFromMesh(t){const e={...t,...t.attributes};return t.indices&&(e.indices=t.indices),e}_encodePointCloud(t){const e=this._getAttributesFromMesh(t),r=this._createDracoPointCloud(e),n=new this.draco.DracoInt8Array;try{const t=this.dracoEncoder.EncodePointCloudToDracoBuffer(r,!1,n);if(!(t>0))throw new Error("Draco encoding failed.");return this.log(`DRACO encoded ${r.num_points()} points\n with ${r.num_attributes()} attributes into ${t} bytes`),I(n)}finally{this.destroyEncodedObject(n),this.destroyEncodedObject(r)}}_encodeMesh(t){const e=this._getAttributesFromMesh(t),r=this._createDracoMesh(e),n=new this.draco.DracoInt8Array;try{const t=this.dracoEncoder.EncodeMeshToDracoBuffer(r,n);if(t<=0)throw new Error("Draco encoding failed.");return this.log(`DRACO encoded ${r.num_points()} points\n with ${r.num_attributes()} attributes into ${t} bytes`),I(n)}finally{this.destroyEncodedObject(n),this.destroyEncodedObject(r)}}_setOptions(t={}){if("speed"in t&&this.dracoEncoder.SetSpeedOptions(...t.speed),"method"in t){const e=this.draco[t.method];this.dracoEncoder.SetEncodingMethod(e)}if("quantization"in t)for(const e in t.quantization){const r=t.quantization[e],n=this.draco[e];this.dracoEncoder.SetAttributeQuantization(n,r)}}_createDracoMesh(t){const e=new this.draco.Mesh;try{const r=this._getPositionAttribute(t);if(!r)throw new Error("positions");const n=r.length/3;for(let r in t){const o=t[r];r=m[r]||r,this._addAttributeToMesh(e,r,o,n)}}catch(t){throw this.destroyEncodedObject(e),t}return e}_createDracoPointCloud(t){const e=new this.draco.PointCloud;try{const r=this._getPositionAttribute(t);if(!r)throw new Error("positions");const n=r.length/3;for(let r in t){const o=t[r];r=m[r]||r,this._addAttributeToMesh(e,r,o,n)}}catch(t){throw this.destroyEncodedObject(e),t}return e}_addAttributeToMesh(t,e,r,n){if(!ArrayBuffer.isView(r))return;const o=this._getDracoAttributeType(e,r),i=r.length/n;if("indices"===o){const n=r.length/3;return this.log(`Adding attribute ${e}, size ${n}`),void this.dracoMeshBuilder.AddFacesToMesh(t,n,r)}switch(this.log(`Adding attribute ${e}, size ${i}`),r.constructor.name){case"Int8Array":this.dracoMeshBuilder.AddInt8Attribute(t,o,n,i,r);break;case"Int16Array":this.dracoMeshBuilder.AddInt16Attribute(t,o,n,i,r);break;case"Int32Array":this.dracoMeshBuilder.AddInt32Attribute(t,o,n,i,r);break;case"Uint8Array":case"Uint8ClampedArray":this.dracoMeshBuilder.AddUInt8Attribute(t,o,n,i,r);break;case"Uint16Array":this.dracoMeshBuilder.AddUInt16Attribute(t,o,n,i,r);break;case"Uint32Array":this.dracoMeshBuilder.AddUInt32Attribute(t,o,n,i,r);break;case"Float32Array":default:this.dracoMeshBuilder.AddFloatAttribute(t,o,n,i,r)}}_getDracoAttributeType(t,e){switch(t.toLowerCase()){case"indices":return"indices";case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texCoord":case"texCoords":return this.draco.TEX_COORD;default:return this.draco.GENERIC}}_getPositionAttribute(t){for(const e in t){const r=t[e];if(this._getDracoAttributeType(e,r)===this.draco.POSITION)return r}return null}}var g={name:"DRACO",extensions:["drc"],encode:async function(t,e){const{draco:r}=await l(e),n=new _(r);try{return n.encodeSync(t,e)}finally{n.destroy()}},options:{pointcloud:!1}};r.d(e,"DracoLoader",(function(){return p})),r.d(e,"DracoWorkerLoader",(function(){return w})),r.d(e,"DracoWriter",(function(){return g}))}])}));
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=3)}([function(t,e,r){"use strict";(function(t,n){r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return s}));const o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},i=o.global||o.self||o.window,a="object"!=typeof n||"[object process]"!==String(n)||n.browser,s="function"==typeof importScripts,c=void 0!==n&&n.version&&n.version.match(/v([0-9]*)/);c&&parseFloat(c[1])}).call(this,r(2),r(4))},function(t,e){},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(e){const n=r(5),o="undefined"==typeof window?e:window;o.loaders=o.loaders||{},t.exports=Object.assign(o.loaders,n)}).call(this,r(2))},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var c,d=[],u=!1,l=-1;function h(){u&&c&&(u=!1,c.length?d=c.concat(d):l=-1,d.length&&f())}function f(){if(!u){var t=s(h);u=!0;for(var e=d.length;e;){for(c=d,d=[];++l<e;)c&&c[l].run();l=-1,e=d.length}c=null,u=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function A(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];d.push(new y(t,e)),1!==d.length||u||s(f)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=A,o.addListener=A,o.once=A,o.off=A,o.removeListener=A,o.removeAllListeners=A,o.emit=A,o.prependListener=A,o.prependOnceListener=A,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r(1);const i="2.0.0-alpha.4",a={};async function s(t,e=null,r={}){return e&&(t=function(t,e,r){const o=r.modules||{};if(o[t])return o[t];if(r.CDN)return function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(r.CDN.startsWith("http")),`${r.CDN}/${e}@${i}/dist/libs/${t}`;if(n.c)return`../src/libs/${t}`;return`modules/${e}/src/libs/${t}`}(t,e,r)),a[t]=a[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!n.b)return Object(o.requireFromFile)(t);if(n.c)return importScripts(t);const e=await fetch(t);return function(t,e){if(!n.b)return Object(o.requireFromString)(t,e);if(n.c)return eval.call(n.a,t),null;const r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch(e){r.text=t}return document.body.appendChild(r),null}(await e.text(),t)}(t),await a[t]}let c,d;async function u(t){const e=t.modules||{};return e.draco3d?e.draco3d:(c=c||async function(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await s("draco_decoder.js","draco",t);break;case"wasm":default:[e,r]=await Promise.all([await s("draco_wasm_wrapper.js","draco",t),await s("draco_decoder.wasm","draco",t)])}return e=e||n.a.DracoDecoderModule,await function(t,e){const r={};e&&(r.wasmBinary=e);return new Promise(e=>{t({...r,onModuleLoaded:t=>e({draco:t})})})}(e,r)}(t),await c)}async function l(t){const e=t.modules||{};return e.draco3d?e.draco3d:(d=d||async function(t){let e=await s("draco_encoder.js","draco",t);return e=e||n.a.DracoEncoderModule,new Promise(t=>{e({onModuleLoaded:e=>t({draco:e})})})}(t),await d)}const h={TRIANGULAR_MESH:0,POINT_CLOUD:1},f={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},y={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class A{constructor(t){this.draco=t}destroy(){}destroyGeometry(t){t&&this.draco.destroy(t.dracoGeometry)}parseSync(t){const e=new this.draco.DecoderBuffer;e.Init(new Int8Array(t),t.byteLength);const r=new this.draco.Decoder,n={};let o,i,a;try{const t=r.GetEncodedGeometryType(e);switch(t){case this.draco.TRIANGULAR_MESH:i=new this.draco.Mesh,o=r.DecodeBufferToMesh(e,i),a={type:h.TRIANGULAR_MESH,faceCount:i.num_faces(),attributeCount:i.num_attributes(),vertexCount:i.num_points()};break;case this.draco.POINT_CLOUD:i=new this.draco.PointCloud,o=r.DecodeBufferToPointCloud(e,i),a={type:h.POINT_CLOUD,attributeCount:i.num_attributes(),vertexCount:i.num_points()};break;default:throw new Error("Unknown DRACO geometry type.")}if(!o.ok()||!i.ptr){const t=`DRACO decompression failed: ${o.error_msg()}`;throw i&&this.draco.destroy(i),new Error(t)}n.header={vertexCount:a.vertexCount},n.loaderData={header:a},this.extractDRACOGeometry(r,i,t,n)}finally{this.draco.destroy(r),this.draco.destroy(e)}return n}extractDRACOGeometry(t,e,r,n){const o=this.getAttributes(t,e),i=o.POSITION;if(!i)throw new Error("DRACO decompressor: No position attribute found.");return this.getPositionAttributeMetadata(i),r===this.draco.TRIANGULAR_MESH?(o.indices="TRIANGLE_STRIP"===this.drawMode?this.getMeshStripIndices(t,e):this.getMeshFaceIndices(t,e),n.mode="TRIANGLE_STRIP"===this.drawMode?5:4):n.mode=0,o.indices&&(n.indices={value:o.indices,size:1},delete o.indices),n.attributes=o,n}getPositionAttributeMetadata(t){this.metadata=this.metadata||{},this.metadata.attributes=this.metadata.attributes||{};const e=new this.draco.AttributeQuantizationTransform;if(e.InitFromAttribute(t)){this.metadata.attributes.position.isQuantized=!0,this.metadata.attributes.position.maxRange=e.range(),this.metadata.attributes.position.numQuantizationBits=e.quantization_bits(),this.metadata.attributes.position.minValues=new Float32Array(3);for(let t=0;t<3;++t)this.metadata.attributes.position.minValues[t]=e.min_value(t)}this.draco.destroy(e)}getAttributes(t,e){const r={},n=e.num_points();for(const o in f){const i=this.draco[o],a=t.GetAttributeId(e,i);if(-1!==a){const i=t.GetAttribute(e,a),{typedArray:s}=this.getAttributeTypedArray(t,e,i,o);r[f[o]]={value:s,size:s.length/n}}}return r}getMeshFaceIndices(t,e){const r=e.num_faces(),n=new Uint32Array(3*r),o=new this.draco.DracoInt32Array;for(let i=0;i<r;++i){t.GetFaceFromMesh(e,i,o);const r=3*i;n[r]=o.GetValue(0),n[r+1]=o.GetValue(1),n[r+2]=o.GetValue(2)}return this.draco.destroy(o),n}getMeshStripIndices(t,e){const r=new this.draco.DracoInt32Array;t.GetTriangleStripsFromMesh(e,r);const n=new Uint32Array(r.size());for(let t=0;t<r.size();++t)n[t]=r.GetValue(t);return this.draco.destroy(r),n}getAttributeTypedArray(t,e,r,n){if(0===r.ptr){throw new Error(`DRACO decode bad attribute ${n}`)}const o=y[r.data_type()],i=r.num_components(),a=e.num_points()*i;let s,c;switch(o){case Float32Array:s=new this.draco.DracoFloat32Array,t.GetAttributeFloatForAllPoints(e,r,s),c=new Float32Array(a);break;case Int8Array:s=new this.draco.DracoInt8Array,t.GetAttributeInt8ForAllPoints(e,r,s),c=new Int8Array(a);break;case Int16Array:s=new this.draco.DracoInt16Array,t.GetAttributeInt16ForAllPoints(e,r,s),c=new Int16Array(a);break;case Int32Array:s=new this.draco.DracoInt32Array,t.GetAttributeInt32ForAllPoints(e,r,s),c=new Int32Array(a);break;case Uint8Array:s=new this.draco.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(e,r,s),c=new Uint8Array(a);break;case Uint16Array:s=new this.draco.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(e,r,s),c=new Uint16Array(a);break;case Uint32Array:s=new this.draco.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(e,r,s),c=new Uint32Array(a);break;default:throw new Error("DRACO decoder: unexpected attribute type.")}for(let t=0;t<a;t++)c[t]=s.GetValue(t);return this.draco.destroy(s),{typedArray:c,components:i}}decode(t,e){return this.parseSync(t,e)}}const b={id:"draco",name:"Draco",version:"2.0.0-alpha.4",extensions:["drc"],mimeType:"application/octet-stream",binary:!0,test:"DRACO",options:{draco:{decoderType:"object"==typeof WebAssembly?"wasm":"js",libraryPath:"libs/",workerUrl:"https://unpkg.com/@loaders.gl/draco@2.0.0-alpha.4/dist/draco-loader.worker.js"}}},p={...b,parse:async function(t,e,r,n){const{draco:o}=await u(e),i=new A(o);try{return i.parseSync(t,e)}finally{i.destroy()}}};const w={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"};function m(){}function O(t){const e=t.size(),r=new ArrayBuffer(e),n=new Int8Array(r);for(let r=0;r<e;++r)n[r]=t.GetValue(r);return r}class I{constructor(t,e={}){this.draco=t,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.log=e.log||m}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.dracoMeshBuilder=null,this.dracoEncoder=null,this.draco=null}destroyEncodedObject(t){t&&this.draco.destroy(t)}encodeSync(t,e){return this._setOptions(e),e.pointcloud?this._encodePointCloud(t):this._encodeMesh(t)}_getAttributesFromMesh(t){const e={...t,...t.attributes};return t.indices&&(e.indices=t.indices),e}_encodePointCloud(t){const e=this._getAttributesFromMesh(t),r=this._createDracoPointCloud(e),n=new this.draco.DracoInt8Array;try{const t=this.dracoEncoder.EncodePointCloudToDracoBuffer(r,!1,n);if(!(t>0))throw new Error("Draco encoding failed.");return this.log(`DRACO encoded ${r.num_points()} points\n with ${r.num_attributes()} attributes into ${t} bytes`),O(n)}finally{this.destroyEncodedObject(n),this.destroyEncodedObject(r)}}_encodeMesh(t){const e=this._getAttributesFromMesh(t),r=this._createDracoMesh(e),n=new this.draco.DracoInt8Array;try{const t=this.dracoEncoder.EncodeMeshToDracoBuffer(r,n);if(t<=0)throw new Error("Draco encoding failed.");return this.log(`DRACO encoded ${r.num_points()} points\n with ${r.num_attributes()} attributes into ${t} bytes`),O(n)}finally{this.destroyEncodedObject(n),this.destroyEncodedObject(r)}}_setOptions(t={}){if("speed"in t&&this.dracoEncoder.SetSpeedOptions(...t.speed),"method"in t){const e=this.draco[t.method];this.dracoEncoder.SetEncodingMethod(e)}if("quantization"in t)for(const e in t.quantization){const r=t.quantization[e],n=this.draco[e];this.dracoEncoder.SetAttributeQuantization(n,r)}}_createDracoMesh(t){const e=new this.draco.Mesh;try{const r=this._getPositionAttribute(t);if(!r)throw new Error("positions");const n=r.length/3;for(let r in t){const o=t[r];r=w[r]||r,this._addAttributeToMesh(e,r,o,n)}}catch(t){throw this.destroyEncodedObject(e),t}return e}_createDracoPointCloud(t){const e=new this.draco.PointCloud;try{const r=this._getPositionAttribute(t);if(!r)throw new Error("positions");const n=r.length/3;for(let r in t){const o=t[r];r=w[r]||r,this._addAttributeToMesh(e,r,o,n)}}catch(t){throw this.destroyEncodedObject(e),t}return e}_addAttributeToMesh(t,e,r,n){if(!ArrayBuffer.isView(r))return;const o=this._getDracoAttributeType(e,r),i=r.length/n;if("indices"===o){const n=r.length/3;return this.log(`Adding attribute ${e}, size ${n}`),void this.dracoMeshBuilder.AddFacesToMesh(t,n,r)}switch(this.log(`Adding attribute ${e}, size ${i}`),r.constructor.name){case"Int8Array":this.dracoMeshBuilder.AddInt8Attribute(t,o,n,i,r);break;case"Int16Array":this.dracoMeshBuilder.AddInt16Attribute(t,o,n,i,r);break;case"Int32Array":this.dracoMeshBuilder.AddInt32Attribute(t,o,n,i,r);break;case"Uint8Array":case"Uint8ClampedArray":this.dracoMeshBuilder.AddUInt8Attribute(t,o,n,i,r);break;case"Uint16Array":this.dracoMeshBuilder.AddUInt16Attribute(t,o,n,i,r);break;case"Uint32Array":this.dracoMeshBuilder.AddUInt32Attribute(t,o,n,i,r);break;case"Float32Array":default:this.dracoMeshBuilder.AddFloatAttribute(t,o,n,i,r)}}_getDracoAttributeType(t,e){switch(t.toLowerCase()){case"indices":return"indices";case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texCoord":case"texCoords":return this.draco.TEX_COORD;default:return this.draco.GENERIC}}_getPositionAttribute(t){for(const e in t){const r=t[e];if(this._getDracoAttributeType(e,r)===this.draco.POSITION)return r}return null}}var _={name:"DRACO",extensions:["drc"],encode:async function(t,e){const{draco:r}=await l(e),n=new I(r);try{return n.encodeSync(t,e)}finally{n.destroy()}},options:{pointcloud:!1}};r.d(e,"DracoLoader",(function(){return p})),r.d(e,"DracoWorkerLoader",(function(){return b})),r.d(e,"DracoWriter",(function(){return _}))}])}));

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

!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=16)}([function(t,e,r){t.exports=r(10)},function(t,e){function r(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,a){var i=t.apply(e,n);function c(t){r(i,o,a,c,u,"next",t)}function u(t){r(i,o,a,c,u,"throw",t)}c(void 0)}))}}},function(t,e,r){"use strict";(function(t,n){r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return c})),r.d(e,"c",(function(){return u}));var o=r(3),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},i=a.global||a.self||a.window,c="object"!==(void 0===n?"undefined":r.n(o)()(n))||"[object process]"!==String(n)||n.browser,u="function"==typeof importScripts,s=void 0!==n&&n.version&&n.version.match(/v([0-9]*)/);s&&parseFloat(s[1])}).call(this,r(14),r(15))},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},n(e)}t.exports=n},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e){},function(t,e,r){var n=r(11),o=r(12),a=r(13);t.exports=function(t,e){return n(t)||o(t,e)||a()}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},,function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),i=new T(n||[]);return a._invoke=function(t,e,r){var n=f;return function(o,a){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw a;return I()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=k(i,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=s(t,e,r);if("normal"===u.type){if(n=r.done?d:l,u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(t,r,i),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f="suspendedStart",l="suspendedYield",p="executing",d="completed",h={};function y(){}function v(){}function m(){}var b={};b[a]=function(){return this};var w=Object.getPrototypeOf,g=w&&w(w(E([])));g&&g!==r&&n.call(g,a)&&(b=g);var x=m.prototype=y.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function O(t){var e;this._invoke=function(r,o){function a(){return new Promise((function(e,a){!function e(r,o,a,i){var c=s(t[r],t,o);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?Promise.resolve(f.__await).then((function(t){e("next",t,a,i)}),(function(t){e("throw",t,a,i)})):Promise.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return e("throw",t,a,i)}))}i(c.arg)}(r,o,e,a)}))}return e=e?e.then(a,a):a()}}function k(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=s(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,h;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function E(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:I}}function I(){return{value:e,done:!0}}return v.prototype=x.constructor=m,m.constructor=v,m[c]=v.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},A(O.prototype),O.prototype[i]=function(){return this},t.AsyncIterator=O,t.async=function(e,r,n,o){var a=new O(u(e,r,n,o));return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(x),x[c]="Generator",x[a]=function(){return this},x.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=E,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:E(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return r}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,n,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(t){n=i}}();var u,s=[],f=!1,l=-1;function p(){f&&u&&(f=!1,u.length?s=u.concat(s):l=-1,s.length&&d())}function d(){if(!f){var t=c(p);f=!0;for(var e=s.length;e;){for(u=s,s=[];++l<e;)u&&u[l].run();l=-1,e=s.length}u=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];s.push(new h(t,e)),1!==s.length||f||c(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),a=r(1),i=r.n(a),c=r(3),u=r.n(c),s=r(4),f=r.n(s),l=r(6),p=r.n(l),d=r(2),h=r(5);function y(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var v,m="2.0.0-alpha.3",b={};function w(t){return g.apply(this,arguments)}function g(){return(g=i()(o.a.mark((function t(e){var r,n,a=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:null,n=a.length>2&&void 0!==a[2]?a[2]:{},r&&(e=x(e,r,n)),b[e]=b[e]||A(e),t.next=6,b[e];case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t,e,r){var n=r.modules||{};return n[t]?n[t]:r.CDN?(y(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(e,"@").concat(m,"/dist/libs/").concat(t)):d.c?"../src/libs/".concat(t):"modules/".concat(e,"/src/libs/").concat(t)}function A(t){return O.apply(this,arguments)}function O(){return(O=i()(o.a.mark((function t(e){var r,n,a;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.endsWith("wasm")){t.next=7;break}return t.next=3,fetch(e);case 3:return r=t.sent,t.next=6,r.arrayBuffer();case 6:return t.abrupt("return",t.sent);case 7:if(d.b){t.next=9;break}return t.abrupt("return",Object(h.requireFromFile)(e));case 9:if(!d.c){t.next=11;break}return t.abrupt("return",importScripts(e));case 11:return t.next=13,fetch(e);case 13:return n=t.sent,t.next=16,n.text();case 16:return a=t.sent,t.abrupt("return",k(a,e));case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function k(t,e){if(!d.b)return Object(h.requireFromString)(t,e);if(d.c)return eval.call(d.a,t),null;var r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch(e){r.text=t}return document.body.appendChild(r),null}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){return T.apply(this,arguments)}function T(){return(T=i()(o.a.mark((function t(e){var r;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.modules||{}).draco3d){t.next=3;break}return t.abrupt("return",r.draco3d);case 3:return v=v||E(e),t.next=6,v;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function E(t){return I.apply(this,arguments)}function I(){return(I=i()(o.a.mark((function t(e){var r,n,a,i;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.draco&&e.draco.decoderType,t.next="js"===t.t0?3:(t.t0,7);break;case 3:return t.next=5,w("draco_decoder.js","draco",e);case 5:return r=t.sent,t.abrupt("break",21);case 7:return t.t1=Promise,t.next=10,w("draco_wasm_wrapper.js","draco",e);case 10:return t.t2=t.sent,t.next=13,w("draco_decoder.wasm","draco",e);case 13:return t.t3=t.sent,t.t4=[t.t2,t.t3],t.next=17,t.t1.all.call(t.t1,t.t4);case 17:a=t.sent,i=p()(a,2),r=i[0],n=i[1];case 21:return r=r||d.a.DracoDecoderModule,t.next=24,L(r,n);case 24:return t.abrupt("return",t.sent);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function L(t,e){var r={};return e&&(r.wasmBinary=e),new Promise((function(e){t(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(r,!0).forEach((function(e){f()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},r,{onModuleLoaded:function(t){return e({draco:t})}}))}))}var S=r(7),_=r.n(S),D=r(8),G=r.n(D),C=0,F=1,M={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},R={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},N=function(){function t(e){_()(this,t),this.draco=e}return G()(t,[{key:"destroy",value:function(){}},{key:"destroyGeometry",value:function(t){t&&this.draco.destroy(t.dracoGeometry)}},{key:"parseSync",value:function(t){var e=new this.draco.DecoderBuffer;e.Init(new Int8Array(t),t.byteLength);var r,n,o,a=new this.draco.Decoder,i={};try{var c=a.GetEncodedGeometryType(e);switch(c){case this.draco.TRIANGULAR_MESH:n=new this.draco.Mesh,r=a.DecodeBufferToMesh(e,n),o={type:C,faceCount:n.num_faces(),attributeCount:n.num_attributes(),vertexCount:n.num_points()};break;case this.draco.POINT_CLOUD:n=new this.draco.PointCloud,r=a.DecodeBufferToPointCloud(e,n),o={type:F,attributeCount:n.num_attributes(),vertexCount:n.num_points()};break;default:throw new Error("Unknown DRACO geometry type.")}if(!r.ok()||!n.ptr){var u="DRACO decompression failed: ".concat(r.error_msg());throw n&&this.draco.destroy(n),new Error(u)}i.header={vertexCount:o.vertexCount},i.loaderData={header:o},this.extractDRACOGeometry(a,n,c,i)}finally{this.draco.destroy(a),this.draco.destroy(e)}return i}},{key:"extractDRACOGeometry",value:function(t,e,r,n){var o=this.getAttributes(t,e),a=o.POSITION;if(!a)throw new Error("DRACO decompressor: No position attribute found.");return this.getPositionAttributeMetadata(a),r===this.draco.TRIANGULAR_MESH?(o.indices="TRIANGLE_STRIP"===this.drawMode?this.getMeshStripIndices(t,e):this.getMeshFaceIndices(t,e),n.mode="TRIANGLE_STRIP"===this.drawMode?5:4):n.mode=0,o.indices&&(n.indices={value:o.indices,size:1},delete o.indices),n.attributes=o,n}},{key:"getPositionAttributeMetadata",value:function(t){this.metadata=this.metadata||{},this.metadata.attributes=this.metadata.attributes||{};var e=new this.draco.AttributeQuantizationTransform;if(e.InitFromAttribute(t)){this.metadata.attributes.position.isQuantized=!0,this.metadata.attributes.position.maxRange=e.range(),this.metadata.attributes.position.numQuantizationBits=e.quantization_bits(),this.metadata.attributes.position.minValues=new Float32Array(3);for(var r=0;r<3;++r)this.metadata.attributes.position.minValues[r]=e.min_value(r)}this.draco.destroy(e)}},{key:"getAttributes",value:function(t,e){var r={},n=e.num_points();for(var o in M){var a=this.draco[o],i=t.GetAttributeId(e,a);if(-1!==i){var c=t.GetAttribute(e,i),u=this.getAttributeTypedArray(t,e,c,o).typedArray;r[M[o]]={value:u,size:u.length/n}}}return r}},{key:"getMeshFaceIndices",value:function(t,e){for(var r=e.num_faces(),n=new Uint32Array(3*r),o=new this.draco.DracoInt32Array,a=0;a<r;++a){t.GetFaceFromMesh(e,a,o);var i=3*a;n[i]=o.GetValue(0),n[i+1]=o.GetValue(1),n[i+2]=o.GetValue(2)}return this.draco.destroy(o),n}},{key:"getMeshStripIndices",value:function(t,e){var r=new this.draco.DracoInt32Array;t.GetTriangleStripsFromMesh(e,r);for(var n=new Uint32Array(r.size()),o=0;o<r.size();++o)n[o]=r.GetValue(o);return this.draco.destroy(r),n}},{key:"getAttributeTypedArray",value:function(t,e,r,n){if(0===r.ptr){var o="DRACO decode bad attribute ".concat(n);throw new Error(o)}var a,i,c=R[r.data_type()],u=r.num_components(),s=e.num_points()*u;switch(c){case Float32Array:a=new this.draco.DracoFloat32Array,t.GetAttributeFloatForAllPoints(e,r,a),i=new Float32Array(s);break;case Int8Array:a=new this.draco.DracoInt8Array,t.GetAttributeInt8ForAllPoints(e,r,a),i=new Int8Array(s);break;case Int16Array:a=new this.draco.DracoInt16Array,t.GetAttributeInt16ForAllPoints(e,r,a),i=new Int16Array(s);break;case Int32Array:a=new this.draco.DracoInt32Array,t.GetAttributeInt32ForAllPoints(e,r,a),i=new Int32Array(s);break;case Uint8Array:a=new this.draco.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(e,r,a),i=new Uint8Array(s);break;case Uint16Array:a=new this.draco.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(e,r,a),i=new Uint16Array(s);break;case Uint32Array:a=new this.draco.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(e,r,a),i=new Uint32Array(s);break;default:throw new Error("DRACO decoder: unexpected attribute type.")}for(var f=0;f<s;f++)i[f]=a.GetValue(f);return this.draco.destroy(a),{typedArray:i,components:u}}},{key:"decode",value:function(t,e){return this.parseSync(t,e)}}]),t}();function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?U(r,!0).forEach((function(e){f()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var z={id:"draco",name:"Draco",version:"2.0.0-alpha.3",extensions:["drc"],mimeType:"application/octet-stream",binary:!0,test:"DRACO"},V=B({},z,{parse:function(t,e,r,n){return W.apply(this,arguments)},options:{draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":u()(WebAssembly))?"wasm":"js",libraryPath:"libs/"}}});B({},z,{options:{draco:{workerUrl:"https://unpkg.com/@loaders.gl/draco@".concat("2.0.0-alpha.3","/dist/draco-loader.worker.js"),libraryPath:"libs/"}}});function W(){return(W=i()(o.a.mark((function t(e,r,n,a){var i,c,u;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,P(r);case 2:return i=t.sent,c=i.draco,u=new N(c),t.prev=5,t.abrupt("return",u.parseSync(e,r));case 7:return t.prev=7,u.destroy(),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[5,,7,10]])})))).apply(this,arguments)}function q(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(Q(t))r.add(t);else if(Q(t.buffer))r.add(t.buffer);else if(e&&"object"===u()(t))for(var o in t)q(t[o],e,n)}else;return void 0===r?Array.from(n):null}function Q(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var H="2.0.0-alpha.3";function X(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H;y(t,"no loader provided");var r=t.version;e&&r&&(e=Y(e),r=Y(r),y(e.major===r.major&&e.minor<=r.minor,"loader: ".concat(t.name," is not compatible. ").concat(e.major,".").concat(e.minor,"+ is required.")))}function Y(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}function J(t){return K.apply(this,arguments)}function K(){return(K=i()(o.a.mark((function t(e){var r,n,a,i,c,u,s;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arraybuffer,e.byteOffset,e.byteLength,a=e.options,i=e.context,!r.parseSync&&!r.parse){t.next=6;break}c=n,u=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}s=new TextDecoder,c=s.decode(n),u=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return t.next=15,u(c,a,i,r);case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Z(t,e){return t&&"parse"===t.type&&t.source&&t.source.startsWith("loaders.gl")}!function(t){if("undefined"!=typeof self){var e=0,r=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(o,a){var i=e++;self.addEventListener("message",(function t(e){var r=e.data;if(r&&r.id===i)switch(r.type){case"parse-done":self.removeEventListener("message",t),o(r.result);break;case"parse-error":self.removeEventListener("message",t),a(r.message)}})),self.postMessage({type:"parse",id:i,arraybuffer:t,options:r,url:n},[t])}))};self.onmessage=function(){var e=i()(o.a.mark((function e(n){var a,i,c,u,s,f,l,p,d,h;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.data,e.prev=1,Z(a,t.name)){e.next=4;break}return e.abrupt("return");case 4:return X(t,a.source.split("@")[1]),i=a.arraybuffer,c=a.byteOffset,u=void 0===c?0:c,s=a.byteLength,f=void 0===s?0:s,l=a.options,p=void 0===l?{}:l,e.next=8,J({loader:t,arraybuffer:i,byteOffset:u,byteLength:f,options:p,context:{parse:r}});case 8:d=e.sent,h=q(d),self.postMessage({type:"done",result:d},h),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()}}(V)}]);
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=16)}([function(t,e,r){t.exports=r(10)},function(t,e){function r(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,a){var i=t.apply(e,n);function c(t){r(i,o,a,c,u,"next",t)}function u(t){r(i,o,a,c,u,"throw",t)}c(void 0)}))}}},function(t,e,r){"use strict";(function(t,n){r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return c})),r.d(e,"c",(function(){return u}));var o=r(4),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},i=a.global||a.self||a.window,c="object"!==(void 0===n?"undefined":r.n(o)()(n))||"[object process]"!==String(n)||n.browser,u="function"==typeof importScripts,s=void 0!==n&&n.version&&n.version.match(/v([0-9]*)/);s&&parseFloat(s[1])}).call(this,r(14),r(15))},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},n(e)}t.exports=n},function(t,e){},function(t,e,r){var n=r(11),o=r(12),a=r(13);t.exports=function(t,e){return n(t)||o(t,e)||a()}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},,function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),i=new E(n||[]);return a._invoke=function(t,e,r){var n=f;return function(o,a){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw a;return T()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=j(i,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=s(t,e,r);if("normal"===u.type){if(n=r.done?d:l,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(t,r,i),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f="suspendedStart",l="suspendedYield",p="executing",d="completed",y={};function h(){}function v(){}function m(){}var b={};b[a]=function(){return this};var w=Object.getPrototypeOf,g=w&&w(w(S([])));g&&g!==r&&n.call(g,a)&&(b=g);var O=m.prototype=h.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function A(t){var e;this._invoke=function(r,o){function a(){return new Promise((function(e,a){!function e(r,o,a,i){var c=s(t[r],t,o);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?Promise.resolve(f.__await).then((function(t){e("next",t,a,i)}),(function(t){e("throw",t,a,i)})):Promise.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return e("throw",t,a,i)}))}i(c.arg)}(r,o,e,a)}))}return e=e?e.then(a,a):a()}}function j(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,j(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=s(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function S(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:T}}function T(){return{value:e,done:!0}}return v.prototype=O.constructor=m,m.constructor=v,m[c]=v.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(O),t},t.awrap=function(t){return{__await:t}},x(A.prototype),A.prototype[i]=function(){return this},t.AsyncIterator=A,t.async=function(e,r,n,o){var a=new A(u(e,r,n,o));return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(O),O[c]="Generator",O[a]=function(){return this},O.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:S(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return r}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,n,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(t){n=i}}();var u,s=[],f=!1,l=-1;function p(){f&&u&&(f=!1,u.length?s=u.concat(s):l=-1,s.length&&d())}function d(){if(!f){var t=c(p);f=!0;for(var e=s.length;e;){for(u=s,s=[];++l<e;)u&&u[l].run();l=-1,e=s.length}u=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function h(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];s.push(new y(t,e)),1!==s.length||f||c(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),a=r(1),i=r.n(a),c=r(3),u=r.n(c),s=r(4),f=r.n(s),l=r(6),p=r.n(l),d=r(2),y=r(5);function h(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var v,m="2.0.0-alpha.4",b={};function w(t){return g.apply(this,arguments)}function g(){return(g=i()(o.a.mark((function t(e){var r,n,a=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:null,n=a.length>2&&void 0!==a[2]?a[2]:{},r&&(e=O(e,r,n)),b[e]=b[e]||x(e),t.next=6,b[e];case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function O(t,e,r){var n=r.modules||{};return n[t]?n[t]:r.CDN?(h(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(e,"@").concat(m,"/dist/libs/").concat(t)):d.c?"../src/libs/".concat(t):"modules/".concat(e,"/src/libs/").concat(t)}function x(t){return A.apply(this,arguments)}function A(){return(A=i()(o.a.mark((function t(e){var r,n,a;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.endsWith("wasm")){t.next=7;break}return t.next=3,fetch(e);case 3:return r=t.sent,t.next=6,r.arrayBuffer();case 6:return t.abrupt("return",t.sent);case 7:if(d.b){t.next=9;break}return t.abrupt("return",Object(y.requireFromFile)(e));case 9:if(!d.c){t.next=11;break}return t.abrupt("return",importScripts(e));case 11:return t.next=13,fetch(e);case 13:return n=t.sent,t.next=16,n.text();case 16:return a=t.sent,t.abrupt("return",j(a,e));case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function j(t,e){if(!d.b)return Object(y.requireFromString)(t,e);if(d.c)return eval.call(d.a,t),null;var r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch(e){r.text=t}return document.body.appendChild(r),null}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function k(t){return E.apply(this,arguments)}function E(){return(E=i()(o.a.mark((function t(e){var r;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.modules||{}).draco3d){t.next=3;break}return t.abrupt("return",r.draco3d);case 3:return v=v||S(e),t.next=6,v;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function S(t){return T.apply(this,arguments)}function T(){return(T=i()(o.a.mark((function t(e){var r,n,a,i;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.draco&&e.draco.decoderType,t.next="js"===t.t0?3:(t.t0,7);break;case 3:return t.next=5,w("draco_decoder.js","draco",e);case 5:return r=t.sent,t.abrupt("break",21);case 7:return t.t1=Promise,t.next=10,w("draco_wasm_wrapper.js","draco",e);case 10:return t.t2=t.sent,t.next=13,w("draco_decoder.wasm","draco",e);case 13:return t.t3=t.sent,t.t4=[t.t2,t.t3],t.next=17,t.t1.all.call(t.t1,t.t4);case 17:a=t.sent,i=p()(a,2),r=i[0],n=i[1];case 21:return r=r||d.a.DracoDecoderModule,t.next=24,I(r,n);case 24:return t.abrupt("return",t.sent);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function I(t,e){var r={};return e&&(r.wasmBinary=e),new Promise((function(e){t(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(r,!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},r,{onModuleLoaded:function(t){return e({draco:t})}}))}))}var L=r(7),_=r.n(L),D=r(8),G=r.n(D),C=0,F=1,M={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},R={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},N=function(){function t(e){_()(this,t),this.draco=e}return G()(t,[{key:"destroy",value:function(){}},{key:"destroyGeometry",value:function(t){t&&this.draco.destroy(t.dracoGeometry)}},{key:"parseSync",value:function(t){var e=new this.draco.DecoderBuffer;e.Init(new Int8Array(t),t.byteLength);var r,n,o,a=new this.draco.Decoder,i={};try{var c=a.GetEncodedGeometryType(e);switch(c){case this.draco.TRIANGULAR_MESH:n=new this.draco.Mesh,r=a.DecodeBufferToMesh(e,n),o={type:C,faceCount:n.num_faces(),attributeCount:n.num_attributes(),vertexCount:n.num_points()};break;case this.draco.POINT_CLOUD:n=new this.draco.PointCloud,r=a.DecodeBufferToPointCloud(e,n),o={type:F,attributeCount:n.num_attributes(),vertexCount:n.num_points()};break;default:throw new Error("Unknown DRACO geometry type.")}if(!r.ok()||!n.ptr){var u="DRACO decompression failed: ".concat(r.error_msg());throw n&&this.draco.destroy(n),new Error(u)}i.header={vertexCount:o.vertexCount},i.loaderData={header:o},this.extractDRACOGeometry(a,n,c,i)}finally{this.draco.destroy(a),this.draco.destroy(e)}return i}},{key:"extractDRACOGeometry",value:function(t,e,r,n){var o=this.getAttributes(t,e),a=o.POSITION;if(!a)throw new Error("DRACO decompressor: No position attribute found.");return this.getPositionAttributeMetadata(a),r===this.draco.TRIANGULAR_MESH?(o.indices="TRIANGLE_STRIP"===this.drawMode?this.getMeshStripIndices(t,e):this.getMeshFaceIndices(t,e),n.mode="TRIANGLE_STRIP"===this.drawMode?5:4):n.mode=0,o.indices&&(n.indices={value:o.indices,size:1},delete o.indices),n.attributes=o,n}},{key:"getPositionAttributeMetadata",value:function(t){this.metadata=this.metadata||{},this.metadata.attributes=this.metadata.attributes||{};var e=new this.draco.AttributeQuantizationTransform;if(e.InitFromAttribute(t)){this.metadata.attributes.position.isQuantized=!0,this.metadata.attributes.position.maxRange=e.range(),this.metadata.attributes.position.numQuantizationBits=e.quantization_bits(),this.metadata.attributes.position.minValues=new Float32Array(3);for(var r=0;r<3;++r)this.metadata.attributes.position.minValues[r]=e.min_value(r)}this.draco.destroy(e)}},{key:"getAttributes",value:function(t,e){var r={},n=e.num_points();for(var o in M){var a=this.draco[o],i=t.GetAttributeId(e,a);if(-1!==i){var c=t.GetAttribute(e,i),u=this.getAttributeTypedArray(t,e,c,o).typedArray;r[M[o]]={value:u,size:u.length/n}}}return r}},{key:"getMeshFaceIndices",value:function(t,e){for(var r=e.num_faces(),n=new Uint32Array(3*r),o=new this.draco.DracoInt32Array,a=0;a<r;++a){t.GetFaceFromMesh(e,a,o);var i=3*a;n[i]=o.GetValue(0),n[i+1]=o.GetValue(1),n[i+2]=o.GetValue(2)}return this.draco.destroy(o),n}},{key:"getMeshStripIndices",value:function(t,e){var r=new this.draco.DracoInt32Array;t.GetTriangleStripsFromMesh(e,r);for(var n=new Uint32Array(r.size()),o=0;o<r.size();++o)n[o]=r.GetValue(o);return this.draco.destroy(r),n}},{key:"getAttributeTypedArray",value:function(t,e,r,n){if(0===r.ptr){var o="DRACO decode bad attribute ".concat(n);throw new Error(o)}var a,i,c=R[r.data_type()],u=r.num_components(),s=e.num_points()*u;switch(c){case Float32Array:a=new this.draco.DracoFloat32Array,t.GetAttributeFloatForAllPoints(e,r,a),i=new Float32Array(s);break;case Int8Array:a=new this.draco.DracoInt8Array,t.GetAttributeInt8ForAllPoints(e,r,a),i=new Int8Array(s);break;case Int16Array:a=new this.draco.DracoInt16Array,t.GetAttributeInt16ForAllPoints(e,r,a),i=new Int16Array(s);break;case Int32Array:a=new this.draco.DracoInt32Array,t.GetAttributeInt32ForAllPoints(e,r,a),i=new Int32Array(s);break;case Uint8Array:a=new this.draco.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(e,r,a),i=new Uint8Array(s);break;case Uint16Array:a=new this.draco.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(e,r,a),i=new Uint16Array(s);break;case Uint32Array:a=new this.draco.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(e,r,a),i=new Uint32Array(s);break;default:throw new Error("DRACO decoder: unexpected attribute type.")}for(var f=0;f<s;f++)i[f]=a.GetValue(f);return this.draco.destroy(a),{typedArray:i,components:u}}},{key:"decode",value:function(t,e){return this.parseSync(t,e)}}]),t}();function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var B=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?U(r,!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},{id:"draco",name:"Draco",version:"2.0.0-alpha.4",extensions:["drc"],mimeType:"application/octet-stream",binary:!0,test:"DRACO",options:{draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":f()(WebAssembly))?"wasm":"js",libraryPath:"libs/",workerUrl:"https://unpkg.com/@loaders.gl/draco@".concat("2.0.0-alpha.4","/dist/draco-loader.worker.js")}}},{parse:function(t,e,r,n){return z.apply(this,arguments)}});function z(){return(z=i()(o.a.mark((function t(e,r,n,a){var i,c,u;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,k(r);case 2:return i=t.sent,c=i.draco,u=new N(c),t.prev=5,t.abrupt("return",u.parseSync(e,r));case 7:return t.prev=7,u.destroy(),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[5,,7,10]])})))).apply(this,arguments)}function V(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(W(t))r.add(t);else if(W(t.buffer))r.add(t.buffer);else if(e&&"object"===f()(t))for(var o in t)V(t[o],e,n)}else;return void 0===r?Array.from(n):null}function W(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var q="2.0.0-alpha.4";function Q(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:q;h(t,"no loader provided");var r=t.version;e&&r&&(e=H(e),r=H(r),h(e.major===r.major&&e.minor<=r.minor,"loader: ".concat(t.name," is not compatible. ").concat(e.major,".").concat(e.minor,"+ is required.")))}function H(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}function X(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?X(r,!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):X(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function J(t){return K.apply(this,arguments)}function K(){return(K=i()(o.a.mark((function t(e){var r,n,a,i,c,u,s;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arraybuffer,e.byteOffset,e.byteLength,a=e.options,i=e.context,!r.parseSync&&!r.parse){t.next=6;break}c=n,u=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}s=new TextDecoder,c=s.decode(n),u=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return t.next=15,u(c,Y({},a,{worker:!1}),i,r);case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Z(t,e){return t&&"parse"===t.type&&t.source&&t.source.startsWith("loaders.gl")}!function(t){if("undefined"!=typeof self){var e=0,r=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(o,a){var i=e++;self.addEventListener("message",(function t(e){var r=e.data;if(r&&r.id===i)switch(r.type){case"parse-done":self.removeEventListener("message",t),o(r.result);break;case"parse-error":self.removeEventListener("message",t),a(r.message)}})),self.postMessage({type:"parse",id:i,arraybuffer:t,options:r,url:n},[t])}))};self.onmessage=function(){var e=i()(o.a.mark((function e(n){var a,i,c,u,s,f,l,p,d,y;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.data,e.prev=1,Z(a,t.name)){e.next=4;break}return e.abrupt("return");case 4:return Q(t,a.source.split("@")[1]),i=a.arraybuffer,c=a.byteOffset,u=void 0===c?0:c,s=a.byteLength,f=void 0===s?0:s,l=a.options,p=void 0===l?{}:l,e.next=8,J({loader:t,arraybuffer:i,byteOffset:u,byteLength:f,options:p,context:{parse:r}});case 8:d=e.sent,y=V(d),self.postMessage({type:"done",result:d},y),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()}}(B)}]);

@@ -8,3 +8,3 @@ "use strict";

});
exports.DracoWorkerLoader = exports.DracoLoader = void 0;
exports.DracoLoader = exports.DracoWorkerLoader = void 0;

@@ -15,6 +15,6 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _dracoModuleLoader = require("./lib/draco-module-loader");

@@ -28,4 +28,4 @@

var VERSION = typeof "2.0.0-alpha.3" !== 'undefined' ? "2.0.0-alpha.3" : 'latest';
var DRACO = {
var VERSION = typeof "2.0.0-alpha.4" !== 'undefined' ? "2.0.0-alpha.4" : 'latest';
var DracoWorkerLoader = {
id: 'draco',

@@ -37,13 +37,15 @@ name: 'Draco',

binary: true,
test: 'DRACO'
};
var DracoLoader = _objectSpread({}, DRACO, {
parse: parse,
test: 'DRACO',
options: {
draco: {
decoderType: (typeof WebAssembly === "undefined" ? "undefined" : (0, _typeof2["default"])(WebAssembly)) === 'object' ? 'wasm' : 'js',
libraryPath: "libs/"
libraryPath: "libs/",
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js")
}
}
};
exports.DracoWorkerLoader = DracoWorkerLoader;
var DracoLoader = _objectSpread({}, DracoWorkerLoader, {
parse: parse
});

@@ -53,13 +55,2 @@

var DracoWorkerLoader = _objectSpread({}, DRACO, {
options: {
draco: {
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js"),
libraryPath: "libs/"
}
}
});
exports.DracoWorkerLoader = DracoWorkerLoader;
function parse(_x, _x2, _x3, _x4) {

@@ -66,0 +57,0 @@ return _parse.apply(this, arguments);

@@ -9,4 +9,4 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

import DracoParser from './lib/draco-parser';
const VERSION = typeof "2.0.0-alpha.3" !== 'undefined' ? "2.0.0-alpha.3" : 'latest';
const DRACO = {
const VERSION = typeof "2.0.0-alpha.4" !== 'undefined' ? "2.0.0-alpha.4" : 'latest';
export const DracoWorkerLoader = {
id: 'draco',

@@ -18,21 +18,14 @@ name: 'Draco',

binary: true,
test: 'DRACO'
};
export const DracoLoader = _objectSpread({}, DRACO, {
parse,
test: 'DRACO',
options: {
draco: {
decoderType: typeof WebAssembly === 'object' ? 'wasm' : 'js',
libraryPath: "libs/"
libraryPath: "libs/",
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js")
}
}
};
export const DracoLoader = _objectSpread({}, DracoWorkerLoader, {
parse
});
export const DracoWorkerLoader = _objectSpread({}, DRACO, {
options: {
draco: {
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js"),
libraryPath: "libs/"
}
}
});

@@ -39,0 +32,0 @@ async function parse(arrayBuffer, options, context, loader) {

import _regeneratorRuntime from "@babel/runtime/regenerator";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _typeof from "@babel/runtime/helpers/esm/typeof";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

@@ -12,4 +12,4 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

import DracoParser from './lib/draco-parser';
var VERSION = typeof "2.0.0-alpha.3" !== 'undefined' ? "2.0.0-alpha.3" : 'latest';
var DRACO = {
var VERSION = typeof "2.0.0-alpha.4" !== 'undefined' ? "2.0.0-alpha.4" : 'latest';
export var DracoWorkerLoader = {
id: 'draco',

@@ -21,21 +21,14 @@ name: 'Draco',

binary: true,
test: 'DRACO'
};
export var DracoLoader = _objectSpread({}, DRACO, {
parse: parse,
test: 'DRACO',
options: {
draco: {
decoderType: (typeof WebAssembly === "undefined" ? "undefined" : _typeof(WebAssembly)) === 'object' ? 'wasm' : 'js',
libraryPath: "libs/"
libraryPath: "libs/",
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js")
}
}
};
export var DracoLoader = _objectSpread({}, DracoWorkerLoader, {
parse: parse
});
export var DracoWorkerLoader = _objectSpread({}, DRACO, {
options: {
draco: {
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js"),
libraryPath: "libs/"
}
}
});

@@ -42,0 +35,0 @@ function parse(_x, _x2, _x3, _x4) {

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

# Draco 3D Data Compression
# Draco 3D Data Compression Libraries

@@ -15,14 +15,3 @@ Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.

Either variation may be used with `DRACOLoader`:
```js
import {load} from '@loaders.gl/core';
import {DracoLoader} from '@loaders.gl/draco';
load(DracoLoader, {
libraryPath: 'path/to/decoders/',
decoderType: 'js' // (Optional) Override detection of WASM support.
});
```
Further [documentation on GitHub](https://github.com/google/draco/tree/master/javascript/example#static-loading-javascript-decoder).

@@ -29,0 +18,0 @@

{
"name": "@loaders.gl/draco",
"version": "2.0.0-alpha.3",
"version": "2.0.0-alpha.4",
"description": "Framework-independent loader and writer for Draco compressed meshes and point clouds",

@@ -42,6 +42,6 @@ "license": "MIT",

"@babel/runtime": "^7.3.1",
"@loaders.gl/loader-utils": "2.0.0-alpha.3",
"@loaders.gl/loader-utils": "2.0.0-alpha.4",
"draco3d": "^1.3.4"
},
"gitHead": "fc28707733ea13de169330a6acd003956e9dbcfa"
"gitHead": "f74055a4561540783663a4cbd59c2bb50bdf043d"
}

@@ -8,3 +8,3 @@ // __VERSION__ is injected by babel-plugin-version-inline

const DRACO = {
export const DracoWorkerLoader = {
id: 'draco',

@@ -16,12 +16,8 @@ name: 'Draco',

binary: true,
test: 'DRACO'
};
export const DracoLoader = {
...DRACO,
parse,
test: 'DRACO',
options: {
draco: {
decoderType: typeof WebAssembly === 'object' ? 'wasm' : 'js', // 'js' for IE11
libraryPath: `libs/`
libraryPath: `libs/`,
workerUrl: `https://unpkg.com/@loaders.gl/draco@${VERSION}/dist/draco-loader.worker.js`
}

@@ -31,10 +27,5 @@ }

export const DracoWorkerLoader = {
...DRACO,
options: {
draco: {
workerUrl: `https://unpkg.com/@loaders.gl/draco@${VERSION}/dist/draco-loader.worker.js`,
libraryPath: `libs/`
}
}
export const DracoLoader = {
...DracoWorkerLoader,
parse
};

@@ -41,0 +32,0 @@

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

# Draco 3D Data Compression
# Draco 3D Data Compression Libraries

@@ -15,14 +15,3 @@ Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.

Either variation may be used with `DRACOLoader`:
```js
import {load} from '@loaders.gl/core';
import {DracoLoader} from '@loaders.gl/draco';
load(DracoLoader, {
libraryPath: 'path/to/decoders/',
decoderType: 'js' // (Optional) Override detection of WASM support.
});
```
Further [documentation on GitHub](https://github.com/google/draco/tree/master/javascript/example#static-loading-javascript-decoder).

@@ -29,0 +18,0 @@

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc