@loaders.gl/draco
Advanced tools
Comparing version 2.0.0-alpha.4 to 2.0.0-alpha.5
@@ -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 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 _}))}])})); | ||
!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 o in r)("object"==typeof exports?exports:t)[o]=r[o]}}(window,(function(){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},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,o){r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return s}));const n={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},i=n.global||n.self||n.window,a="object"!=typeof o||"[object process]"!==String(o)||o.browser,s="function"==typeof importScripts,c=void 0!==o&&o.version&&o.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 o=r(5),n="undefined"==typeof window?e:window;n.loaders=n.loaders||{},t.exports=Object.assign(n.loaders,o)}).call(this,r(2))},function(t,e){var r,o,n=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{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=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(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function A(){}n.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)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=A,n.addListener=A,n.once=A,n.off=A,n.removeListener=A,n.removeAllListeners=A,n.emit=A,n.prependListener=A,n.prependOnceListener=A,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t,e,r){"use strict";r.r(e);var o=r(0),n=r(1);const i="2.0.0-alpha.5",a={};async function s(t,e=null,r={}){return e&&(t=function(t,e,r){const n=r.modules||{};if(n[t])return n[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(o.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(!o.b)return Object(n.requireFromFile)(t);if(o.c)return importScripts(t);const e=await fetch(t);return function(t,e){if(!o.b)return Object(n.requireFromString)(t,e);if(o.c)return eval.call(o.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||o.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||o.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,o={};let n,i,a;try{const t=r.GetEncodedGeometryType(e);switch(t){case this.draco.TRIANGULAR_MESH:i=new this.draco.Mesh,n=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,n=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(!n.ok()||!i.ptr){const t=`DRACO decompression failed: ${n.error_msg()}`;throw i&&this.draco.destroy(i),new Error(t)}o.header={vertexCount:a.vertexCount},o.loaderData={header:a},this.extractDRACOGeometry(r,i,t,o)}finally{this.draco.destroy(r),this.draco.destroy(e)}return o}extractDRACOGeometry(t,e,r,o){const n=this.getAttributes(t,e),i=n.POSITION;if(!i)throw new Error("DRACO decompressor: No position attribute found.");return this.getPositionAttributeMetadata(i),r===this.draco.TRIANGULAR_MESH?(n.indices="TRIANGLE_STRIP"===this.drawMode?this.getMeshStripIndices(t,e):this.getMeshFaceIndices(t,e),o.mode="TRIANGLE_STRIP"===this.drawMode?5:4):o.mode=0,n.indices&&(o.indices={value:n.indices,size:1},delete n.indices),o.attributes=n,o}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={},o=e.num_points();for(const n in f){const i=this.draco[n],a=t.GetAttributeId(e,i);if(-1!==a){const i=t.GetAttribute(e,a),{typedArray:s}=this.getAttributeTypedArray(t,e,i,n);r[f[n]]={value:s,size:s.length/o}}}return r}getMeshFaceIndices(t,e){const r=e.num_faces(),o=new Uint32Array(3*r),n=new this.draco.DracoInt32Array;for(let i=0;i<r;++i){t.GetFaceFromMesh(e,i,n);const r=3*i;o[r]=n.GetValue(0),o[r+1]=n.GetValue(1),o[r+2]=n.GetValue(2)}return this.draco.destroy(n),o}getMeshStripIndices(t,e){const r=new this.draco.DracoInt32Array;t.GetTriangleStripsFromMesh(e,r);const o=new Uint32Array(r.size());for(let t=0;t<r.size();++t)o[t]=r.GetValue(t);return this.draco.destroy(r),o}getAttributeTypedArray(t,e,r,o){if(0===r.ptr){throw new Error(`DRACO decode bad attribute ${o}`)}const n=y[r.data_type()],i=r.num_components(),a=e.num_points()*i;let s,c;switch(n){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.5",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.5/dist/draco-loader.worker.js",localWorkerUrl:"modules/draco/dist/draco-loader.worker.js"}}},p={...b,parse:async function(t,e,r,o){const{draco:n}=await u(e),i=new A(n);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),o=new Int8Array(r);for(let r=0;r<e;++r)o[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),o=new this.draco.DracoInt8Array;try{const t=this.dracoEncoder.EncodePointCloudToDracoBuffer(r,!1,o);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(o)}finally{this.destroyEncodedObject(o),this.destroyEncodedObject(r)}}_encodeMesh(t){const e=this._getAttributesFromMesh(t),r=this._createDracoMesh(e),o=new this.draco.DracoInt8Array;try{const t=this.dracoEncoder.EncodeMeshToDracoBuffer(r,o);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(o)}finally{this.destroyEncodedObject(o),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],o=this.draco[e];this.dracoEncoder.SetAttributeQuantization(o,r)}}_createDracoMesh(t){const e=new this.draco.Mesh;try{const r=this._getPositionAttribute(t);if(!r)throw new Error("positions");const o=r.length/3;for(let r in t){const n=t[r];r=w[r]||r,this._addAttributeToMesh(e,r,n,o)}}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 o=r.length/3;for(let r in t){const n=t[r];r=w[r]||r,this._addAttributeToMesh(e,r,n,o)}}catch(t){throw this.destroyEncodedObject(e),t}return e}_addAttributeToMesh(t,e,r,o){if(!ArrayBuffer.isView(r))return;const n=this._getDracoAttributeType(e,r),i=r.length/o;if("indices"===n){const o=r.length/3;return this.log(`Adding attribute ${e}, size ${o}`),void this.dracoMeshBuilder.AddFacesToMesh(t,o,r)}switch(this.log(`Adding attribute ${e}, size ${i}`),r.constructor.name){case"Int8Array":this.dracoMeshBuilder.AddInt8Attribute(t,n,o,i,r);break;case"Int16Array":this.dracoMeshBuilder.AddInt16Attribute(t,n,o,i,r);break;case"Int32Array":this.dracoMeshBuilder.AddInt32Attribute(t,n,o,i,r);break;case"Uint8Array":case"Uint8ClampedArray":this.dracoMeshBuilder.AddUInt8Attribute(t,n,o,i,r);break;case"Uint16Array":this.dracoMeshBuilder.AddUInt16Attribute(t,n,o,i,r);break;case"Uint32Array":this.dracoMeshBuilder.AddUInt32Attribute(t,n,o,i,r);break;case"Float32Array":default:this.dracoMeshBuilder.AddFloatAttribute(t,n,o,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),o=new I(r);try{return o.encodeSync(t,e)}finally{o.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(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)}]); | ||
!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 b(){}var m={};m[a]=function(){return this};var w=Object.getPrototypeOf,g=w&&w(w(S([])));g&&g!==r&&n.call(g,a)&&(m=g);var O=b.prototype=h.prototype=Object.create(m);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=b,b.constructor=v,b[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,b):(t.__proto__=b,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,b="2.0.0-alpha.5",m={};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)),m[e]=m[e]||x(e),t.next=6,m[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(b,"/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.5",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.5","/dist/draco-loader.worker.js"),localWorkerUrl:"modules/draco/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.5";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))}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)}]); |
@@ -26,3 +26,3 @@ "use strict"; | ||
var VERSION = typeof "2.0.0-alpha.4" !== 'undefined' ? "2.0.0-alpha.4" : 'latest'; | ||
var VERSION = typeof "2.0.0-alpha.5" !== 'undefined' ? "2.0.0-alpha.5" : 'latest'; | ||
var DracoWorkerLoader = { | ||
@@ -40,3 +40,4 @@ id: 'draco', | ||
libraryPath: "libs/", | ||
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js") | ||
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js"), | ||
localWorkerUrl: "modules/draco/dist/draco-loader.worker.js" | ||
} | ||
@@ -43,0 +44,0 @@ } |
@@ -9,3 +9,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import DracoParser from './lib/draco-parser'; | ||
const VERSION = typeof "2.0.0-alpha.4" !== 'undefined' ? "2.0.0-alpha.4" : 'latest'; | ||
const VERSION = typeof "2.0.0-alpha.5" !== 'undefined' ? "2.0.0-alpha.5" : 'latest'; | ||
export const DracoWorkerLoader = { | ||
@@ -23,3 +23,4 @@ id: 'draco', | ||
libraryPath: "libs/", | ||
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js") | ||
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js"), | ||
localWorkerUrl: "modules/draco/dist/draco-loader.worker.js" | ||
} | ||
@@ -26,0 +27,0 @@ } |
@@ -12,3 +12,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
import DracoParser from './lib/draco-parser'; | ||
var VERSION = typeof "2.0.0-alpha.4" !== 'undefined' ? "2.0.0-alpha.4" : 'latest'; | ||
var VERSION = typeof "2.0.0-alpha.5" !== 'undefined' ? "2.0.0-alpha.5" : 'latest'; | ||
export var DracoWorkerLoader = { | ||
@@ -26,3 +26,4 @@ id: 'draco', | ||
libraryPath: "libs/", | ||
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js") | ||
workerUrl: "https://unpkg.com/@loaders.gl/draco@".concat(VERSION, "/dist/draco-loader.worker.js"), | ||
localWorkerUrl: "modules/draco/dist/draco-loader.worker.js" | ||
} | ||
@@ -29,0 +30,0 @@ } |
{ | ||
"name": "@loaders.gl/draco", | ||
"version": "2.0.0-alpha.4", | ||
"version": "2.0.0-alpha.5", | ||
"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.4", | ||
"@loaders.gl/loader-utils": "2.0.0-alpha.5", | ||
"draco3d": "^1.3.4" | ||
}, | ||
"gitHead": "f74055a4561540783663a4cbd59c2bb50bdf043d" | ||
"gitHead": "5caa17e70139028b87362bdab8debf337bced509" | ||
} |
@@ -20,3 +20,4 @@ // __VERSION__ is injected by babel-plugin-version-inline | ||
libraryPath: `libs/`, | ||
workerUrl: `https://unpkg.com/@loaders.gl/draco@${VERSION}/dist/draco-loader.worker.js` | ||
workerUrl: `https://unpkg.com/@loaders.gl/draco@${VERSION}/dist/draco-loader.worker.js`, | ||
localWorkerUrl: `modules/draco/dist/draco-loader.worker.js` | ||
} | ||
@@ -23,0 +24,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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45349427
479523
+ Added@loaders.gl/loader-utils@2.0.0-alpha.5(transitive)
- Removed@loaders.gl/loader-utils@2.0.0-alpha.4(transitive)