gl-draw 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/effect/index.js +13 -13
- package/dist/effect/index.module.js +3 -3
- package/dist/index.js +4 -4
- package/dist/index.module.js +4 -4
- package/dist/objects/extrudePolygon/index.d.ts +2 -1
- package/dist/objects/index.js +3 -3
- package/dist/objects/index.module.js +3 -3
- package/dist/objects/line/index.d.ts +2 -1
- package/dist/plugins/Worker.d.ts +19 -0
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.module.js +1 -1
- package/dist/workers/extrudePolygon.js +8 -8
- package/dist/workers/line.js +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as F from"three";import*as Y from"idb-keyval";var Q={666:function(m){var f=function(n){"use strict";var s=Object.prototype,u=s.hasOwnProperty,a,r=typeof Symbol=="function"?Symbol:{},i=r.iterator||"@@iterator",c=r.asyncIterator||"@@asyncIterator",v=r.toStringTag||"@@toStringTag";function g(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{g({},"")}catch(e){g=function(t,o,h){return t[o]=h}}function _(e,t,o,h){var l=t&&t.prototype instanceof Z?t:Z,C=Object.create(l.prototype),R=new d(h||[]);return C._invoke=p(e,o,R),C}n.wrap=_;function P(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(h){return{type:"throw",arg:h}}}var O="suspendedStart",A="suspendedYield",V="executing",j="completed",T={};function Z(){}function x(){}function G(){}var U={};g(U,i,function(){return this});var I=Object.getPrototypeOf,K=I&&I(I(k([])));K&&K!==s&&u.call(K,i)&&(U=K);var E=G.prototype=Z.prototype=Object.create(U);x.prototype=G,g(E,"constructor",G),g(G,"constructor",x),x.displayName=g(G,v,"GeneratorFunction");function b(e){["next","throw","return"].forEach(function(t){g(e,t,function(o){return this._invoke(t,o)})})}n.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===x||(t.displayName||t.name)==="GeneratorFunction":!1},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,G):(e.__proto__=G,g(e,v,"GeneratorFunction")),e.prototype=Object.create(E),e},n.awrap=function(e){return{__await:e}};function y(e,t){function o(C,R,z,W){var B=P(e[C],e,R);if(B.type==="throw")W(B.arg);else{var J=B.arg,$=J.value;return $&&typeof $=="object"&&u.call($,"__await")?t.resolve($.__await).then(function(N){o("next",N,z,W)},function(N){o("throw",N,z,W)}):t.resolve($).then(function(N){J.value=N,z(J)},function(N){return o("throw",N,z,W)})}}var h;function l(C,R){function z(){return new t(function(W,B){o(C,R,W,B)})}return h=h?h.then(z,z):z()}this._invoke=l}b(y.prototype),g(y.prototype,c,function(){return this}),n.AsyncIterator=y,n.async=function(e,t,o,h,l){l===void 0&&(l=Promise);var C=new y(_(e,t,o,h),l);return n.isGeneratorFunction(t)?C:C.next().then(function(R){return R.done?R.value:C.next()})};function p(e,t,o){var h=O;return function(C,R){if(h===V)throw new Error("Generator is already running");if(h===j){if(C==="throw")throw R;return X()}for(o.method=C,o.arg=R;;){var z=o.delegate;if(z){var W=w(z,o);if(W){if(W===T)continue;return W}}if(o.method==="next")o.sent=o._sent=o.arg;else if(o.method==="throw"){if(h===O)throw h=j,o.arg;o.dispatchException(o.arg)}else o.method==="return"&&o.abrupt("return",o.arg);h=V;var B=P(e,t,o);if(B.type==="normal"){if(h=o.done?j:A,B.arg===T)continue;return{value:B.arg,done:o.done}}else B.type==="throw"&&(h=j,o.method="throw",o.arg=B.arg)}}}function w(e,t){var o=e.iterator[t.method];if(o===a){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=a,w(e,t),t.method==="throw"))return T;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var h=P(o,e.iterator,t.arg);if(h.type==="throw")return t.method="throw",t.arg=h.arg,t.delegate=null,T;var l=h.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,T;if(l.done)t[e.resultName]=l.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=a);else return l;return t.delegate=null,T}b(E),g(E,v,"Generator"),g(E,i,function(){return this}),g(E,"toString",function(){return"[object Generator]"});function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}n.keys=function(e){var t=[];for(var o in e)t.push(o);return t.reverse(),function h(){for(;t.length;){var l=t.pop();if(l in e)return h.value=l,h.done=!1,h}return h.done=!0,h}};function k(e){if(e){var t=e[i];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var o=-1,h=function l(){for(;++o<e.length;)if(u.call(e,o))return l.value=e[o],l.done=!1,l;return l.value=a,l.done=!0,l};return h.next=h}}return{next:X}}n.values=k;function X(){return{value:a,done:!0}}return d.prototype={constructor:d,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(D),!e)for(var t in this)t.charAt(0)==="t"&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=a)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function o(W,B){return C.type="throw",C.arg=e,t.next=W,B&&(t.method="next",t.arg=a),!!B}for(var h=this.tryEntries.length-1;h>=0;--h){var l=this.tryEntries[h],C=l.completion;if(l.tryLoc==="root")return o("end");if(l.tryLoc<=this.prev){var R=u.call(l,"catchLoc"),z=u.call(l,"finallyLoc");if(R&&z){if(this.prev<l.catchLoc)return o(l.catchLoc,!0);if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else if(R){if(this.prev<l.catchLoc)return o(l.catchLoc,!0)}else if(z){if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var o=this.tryEntries.length-1;o>=0;--o){var h=this.tryEntries[o];if(h.tryLoc<=this.prev&&u.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var l=h;break}}l&&(e==="break"||e==="continue")&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var C=l?l.completion:{};return C.type=e,C.arg=t,l?(this.method="next",this.next=l.finallyLoc,T):this.complete(C)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),T},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),D(o),T}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var h=o.completion;if(h.type==="throw"){var l=h.arg;D(o)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:k(e),resultName:t,nextLoc:o},this.method==="next"&&(this.arg=a),T}},n}(m.exports);try{regeneratorRuntime=f}catch(n){typeof globalThis=="object"?globalThis.regeneratorRuntime=f:Function("r","regeneratorRuntime = r")(f)}},44:function(m,f,n){n.d(f,{Z:function(){return s}});function s(u){if(u.geometry&&u.geometry.dispose(),u.material){var a=Array.isArray(u.material)?u.material:[u.material];a.forEach(function(r){var i,c,v,g,_,P,O,A,V,j,T,Z,x;(i=r.map)===null||i===void 0||i.dispose(),(c=r.lightMap)===null||c===void 0||c.dispose(),(v=r.bumpMap)===null||v===void 0||v.dispose(),(g=r.normalMap)===null||g===void 0||g.dispose(),(_=r.specularMap)===null||_===void 0||_.dispose(),(P=r.envMap)===null||P===void 0||P.dispose(),(O=r.alphaMap)===null||O===void 0||O.dispose(),(A=r.aoMap)===null||A===void 0||A.dispose(),(V=r.displacementMap)===null||V===void 0||V.dispose(),(j=r.emissiveMap)===null||j===void 0||j.dispose(),(T=r.gradientMap)===null||T===void 0||T.dispose(),(Z=r.metalnessMap)===null||Z===void 0||Z.dispose(),(x=r.roughnessMap)===null||x===void 0||x.dispose(),r.dispose()})}}},841:function(m,f,n){n.d(f,{U:function(){return u},v:function(){return s}});var s=function(r){for(var i=r.offsetLeft,c=r.offsetParent;c!==null;)i+=c.offsetLeft,c=c.offsetParent;var v;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?v=document.body.scrollLeft:v=document.documentElement.scrollLeft,i-v},u=function(r){for(var i=r.offsetTop,c=r.offsetParent;c!==null;)i+=c.offsetTop,c=c.offsetParent;var v;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?v=document.body.scrollTop:v=document.documentElement.scrollTop,i-v}},417:function(m,f,n){n.d(f,{Z:function(){return u}});function s(a){return Object.prototype.toString.call(a)==="[object Object]"}function u(a){if(s(a)===!1)return!1;var r=a.constructor;if(r===void 0)return!0;var i=r.prototype;return!(s(i)===!1||i.hasOwnProperty("isPrototypeOf")===!1)}},340:function(m,f,n){n.d(f,{Z:function(){return u}});var s=n(485);function u(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(c,v){i.resolve=c,i.reject=v}),a&&(i.promise=(0,s.Z)(i.promise,r)),i}},109:function(m,f,n){n.d(f,{Z:function(){return s}});function s(u,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-a)*Math.PI/180,c=(90-u)*Math.PI/180;return[r*Math.sin(i)*Math.cos(c),r*Math.cos(i),r*Math.sin(i)*Math.sin(c)]}},900:function(m,f,n){n.d(f,{Z:function(){return a}});var s=n(438),u=function(){"use strict";function r(c){(0,s.Z)(this,r),this.onTick_=c,this.cancelPending_=null}var i=r.prototype;return i.tickAfter=function(v){var g=this;this.stop();var _=!0,P;this.cancelPending_=function(){clearTimeout(P),_=!1};var O=function(){_&&g.onTick_()};return P=window.setTimeout(O,v),this},i.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},r}(),a=function(){"use strict";function r(c){(0,s.Z)(this,r),this.onTick_=c,this.ticker_=null}var i=r.prototype;return i.tickNow=function(){return this.stop(),this.onTick_(),this},i.tickAfter=function(v){var g=this;return this.stop(),this.ticker_=new u(function(){g.onTick_()}).tickAfter(v),this},i.tickEvery=function(v){var g=this;return this.stop(),this.ticker_=new u(function(){var _;(_=g.ticker_)===null||_===void 0||_.tickAfter(v),g.onTick_()}).tickAfter(v),this},i.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},r}()},485:function(m,f,n){n.d(f,{Z:function(){return u}});var s=n(42);function u(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.then(function(i){return(0,s.Z)({err:null,res:i},r)}).catch(function(i){return(0,s.Z)({err:i,res:void 0},r)})}},818:function(m,f,n){n.d(f,{C:function(){return r},y:function(){return a}});var s=n(949),u=new Map,a=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(g,_,P,O,A){var V=_[P*3],j=_[P*3+1],T=_[O*3],Z=_[O*3+1],x=_[A*3],G=_[A*3+1],U;if(u.has(g))U=u.get(g);else{var I=c.box3||new s.Box3;if(!c.box3){var K=g.parameters.shapes.getPoints();I.setFromArray(K.map(function(w){return[w.x,w.y,0]}).flat())}var E=I.getSize(new s.Vector3);c.split&&(E.y/=c.split),U={box:I,size:E},u.set(g,U)}var b=U.box,y=U.size,p=c.split?1-c.split:0;return[new s.Vector2((V-b.min.x)/y.x,(j-b.min.y)/y.y+p),new s.Vector2((T-b.min.x)/y.x,(Z-b.min.y)/y.y+p),new s.Vector2((x-b.min.x)/y.x,(G-b.min.y)/y.y+p)]},generateSideWallUV:function(g,_,P,O,A,V){var j=_[P*3],T=_[P*3+1],Z=_[P*3+2],x=_[O*3],G=_[O*3+1],U=_[O*3+2],I=_[A*3],K=_[A*3+1],E=_[A*3+2],b=_[V*3],y=_[V*3+1],p=_[V*3+2],w;if(u.has(_))w=u.get(_);else{var M=new s.Box3;M.setFromArray(_);var D=M.getSize(new s.Vector3);c.split&&(D.z/=1-c.split),w={box:M,size:D},u.set(_,w)}var d=w.box,k=w.size;return Math.abs(T-G)<Math.abs(j-x)?[new s.Vector2((j-d.min.x)/k.x,(Z-d.min.z)/k.z),new s.Vector2((x-d.min.x)/k.x,(U-d.min.z)/k.z),new s.Vector2((I-d.min.x)/k.x,(E-d.min.z)/k.z),new s.Vector2((b-d.min.x)/k.x,(p-d.min.z)/k.z)]:[new s.Vector2((T-d.min.y)/k.x,(Z-d.min.z)/k.z),new s.Vector2((G-d.min.y)/k.x,(U-d.min.z)/k.z),new s.Vector2((K-d.min.y)/k.x,(E-d.min.z)/k.z),new s.Vector2((y-d.min.y)/k.x,(p-d.min.z)/k.z)]}}},r=function(){u.clear()}},949:function(m,f,n){var s=a=>{var r={};return n.d(r,a),r},u=a=>()=>a;m.exports=s({Box3:()=>F.Box3,Vector2:()=>F.Vector2,Vector3:()=>F.Vector3,sRGBEncoding:()=>F.sRGBEncoding})},943:function(m,f,n){n.d(f,{Z:function(){return s}});function s(u,a){(a==null||a>u.length)&&(a=u.length);for(var r=0,i=new Array(a);r<a;r++)i[r]=u[r];return i}},982:function(m,f,n){n.d(f,{Z:function(){return u}});var s=n(943);function u(a){if(Array.isArray(a))return(0,s.Z)(a)}},568:function(m,f,n){n.d(f,{Z:function(){return u}});function s(a,r,i,c,v,g,_){try{var P=a[g](_),O=P.value}catch(A){i(A);return}P.done?r(O):Promise.resolve(O).then(c,v)}function u(a){return function(){var r=this,i=arguments;return new Promise(function(c,v){var g=a.apply(r,i);function _(O){s(g,c,v,_,P,"next",O)}function P(O){s(g,c,v,_,P,"throw",O)}_(void 0)})}}},438:function(m,f,n){n.d(f,{Z:function(){return s}});function s(u,a){if(!(u instanceof a))throw new TypeError("Cannot call a class as a function")}},924:function(m,f,n){n.d(f,{Z:function(){return s}});function s(u,a,r){return a in u?Object.defineProperty(u,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):u[a]=r,u}},375:function(m,f,n){n.d(f,{Z:function(){return s}});function s(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}},270:function(m,f,n){n.d(f,{Z:function(){return s}});function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(m,f,n){n.d(f,{Z:function(){return u}});var s=n(924);function u(a){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{},c=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(c=c.concat(Object.getOwnPropertySymbols(i).filter(function(v){return Object.getOwnPropertyDescriptor(i,v).enumerable}))),c.forEach(function(v){(0,s.Z)(a,v,i[v])})}return a}},342:function(m,f,n){n.d(f,{Z:function(){return i}});var s=n(982),u=n(375),a=n(270),r=n(566);function i(c){return(0,s.Z)(c)||(0,u.Z)(c)||(0,r.Z)(c)||(0,a.Z)()}},566:function(m,f,n){n.d(f,{Z:function(){return u}});var s=n(943);function u(a,r){if(!!a){if(typeof a=="string")return(0,s.Z)(a,r);var i=Object.prototype.toString.call(a).slice(8,-1);if(i==="Object"&&a.constructor&&(i=a.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return(0,s.Z)(a,r)}}}},H={};function L(m){var f=H[m];if(f!==void 0)return f.exports;var n=H[m]={exports:{}};return Q[m](n,n.exports,L),n.exports}(function(){L.n=function(m){var f=m&&m.__esModule?function(){return m.default}:function(){return m};return L.d(f,{a:f}),f}})(),function(){L.d=function(m,f){for(var n in f)L.o(f,n)&&!L.o(m,n)&&Object.defineProperty(m,n,{enumerable:!0,get:f[n]})}}(),function(){L.o=function(m,f){return Object.prototype.hasOwnProperty.call(m,f)}}();var S={};(function(){L.d(S,{qo:function(){return v},B7:function(){return n.Z},CL:function(){return K.C},eK:function(){return G},LK:function(){return x},ZL:function(){return O},wf:function(){return _.Z},lJ:function(){return U},vP:function(){return I.v},Up:function(){return I.U},y_:function(){return K.y},PO:function(){return A.Z},Mf:function(){return m.Z},Rl:function(){return g.Z},to:function(){return f.Z}});var m=L(340),f=L(485),n=L(900),s=L(568),u=L(438),a=L(42),r=L(342),i=L(666),c=L.n(i),v=function(){"use strict";function E(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,u.Z)(this,E),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,a.Z)({},{isdev:!1},y)}var b=E.prototype;return b.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},b.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},b.stop=function(){return this.traverse(function(p){return p.stop1()}),this},b.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},b.play=function(){var p=this;return(0,s.Z)(c().mark(function w(){var M;return c().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(M=p.chainedList[p.index],!(M&&p.isPlaying)){d.next=9;break}return d.next=4,Promise.all(M.map(function(k){return typeof k=="function"?k(p.repeatCount):k.start()}));case 4:return p.index+=1,d.next=7,p.play();case 7:d.next=17;break;case 9:if(!(!M&&p.isPlaying&&p.repeatCount<p.repeatNum)){d.next=16;break}return p.repeatCount+=1,p.index=0,d.next=14,p.play();case 14:d.next=17;break;case 16:!M&&p.isPlaying&&p.repeatCount===p.repeatNum&&p.stop();case 17:case"end":return d.stop()}},w)}))()},b.chain=function(){for(var p=arguments.length,w=new Array(p),M=0;M<p;M++)w[M]=arguments[M];var D=this;return(0,r.Z)(w).forEach(function(d){d instanceof E&&D.children.push(d)}),this.chainedList.push((0,r.Z)(w)),this},b.repeat=function(p){return this.repeatNum=p,this},b.timeout=function(p){return this.chain(function(){return new Promise(function(w){return setTimeout(w,p)})}),this},b.traverse=function(p){p(this),this.children.forEach(function(w){w.traverse(p)})},E}(),g=L(109),_=L(44),P=L(949);function O(E){if(E.material){var b=Array.isArray(E.material)?E.material:[E.material];b.forEach(function(y){var p,w;(p=y.color)===null||p===void 0||p.convertSRGBToLinear(),(w=y.emissive)===null||w===void 0||w.convertSRGBToLinear(),y.map&&(y.map.encoding=P.sRGBEncoding),y.emissiveMap&&(y.emissiveMap.encoding=P.sRGBEncoding)})}}var A=L(417),V=L(924),j=E=>{var b={};return L.d(b,E),b},T=E=>()=>E,Z=j({clear:()=>Y.clear,del:()=>Y.del,get:()=>Y.get,set:()=>Y.set}),x=Z.del,G=Z.clear,U=function(){var E=(0,s.Z)(c().mark(function b(y,p){var w,M,D,d,k,X;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return w=p.version,t.next=4,(0,Z.get)(y);case 4:if(D=t.sent,!(D&&D[w])){t.next=9;break}M=D[w],t.next=15;break;case 9:return t.next=11,(0,f.Z)(fetch(y).then(function(o){if(o.ok)return o.blob();throw new Error}));case 11:d=t.sent,k=d.res,X=d.err,X||(M=k,(0,Z.set)(y,(0,V.Z)({},w,k)));case 15:return t.abrupt("return",M?{url:URL.createObjectURL(M)}:{url:y});case 16:case"end":return t.stop()}},b)}));return function(y,p){return E.apply(this,arguments)}}(),I=L(841),K=L(818)})();var q=S.qo,tt=S.B7,et=S.CL,rt=S.eK,nt=S.LK,ot=S.ZL,at=S.wf,it=S.lJ,ut=S.vP,st=S.Up,ct=S.y_,ft=S.PO,lt=S.Mf,_t=S.Rl,pt=S.to;export{q as Chain,tt as Timer,et as claerUVGenerator,rt as clearAllCache,nt as clearCache,ot as colorCorrection,at as disposeMesh,it as getCache,ut as getElementViewLeft,st as getElementViewTop,ct as getUVGenerator,ft as isPlainObject,lt as makePromiseCreator,_t as polar2Cartesian,pt as to};
|
|
1
|
+
import*as F from"three";import*as Y from"idb-keyval";var Q={666:function(v){var c=function(o){"use strict";var s=Object.prototype,u=s.hasOwnProperty,a,n=typeof Symbol=="function"?Symbol:{},e=n.iterator||"@@iterator",f=n.asyncIterator||"@@asyncIterator",_=n.toStringTag||"@@toStringTag";function d(r,t,i){return Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{d({},"")}catch(r){d=function(t,i,p){return t[i]=p}}function g(r,t,i,p){var l=t&&t.prototype instanceof Z?t:Z,C=Object.create(l.prototype),U=new T(p||[]);return C._invoke=h(r,i,U),C}o.wrap=g;function E(r,t,i){try{return{type:"normal",arg:r.call(t,i)}}catch(p){return{type:"throw",arg:p}}}var O="suspendedStart",V="suspendedYield",z="executing",S="completed",M={};function Z(){}function A(){}function G(){}var K={};d(K,e,function(){return this});var B=Object.getPrototypeOf,j=B&&B(B(W([])));j&&j!==s&&u.call(j,e)&&(K=j);var w=G.prototype=Z.prototype=Object.create(K);A.prototype=G,d(w,"constructor",G),d(G,"constructor",A),A.displayName=d(G,_,"GeneratorFunction");function k(r){["next","throw","return"].forEach(function(t){d(r,t,function(i){return this._invoke(t,i)})})}o.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===A||(t.displayName||t.name)==="GeneratorFunction":!1},o.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,G):(r.__proto__=G,d(r,_,"GeneratorFunction")),r.prototype=Object.create(w),r},o.awrap=function(r){return{__await:r}};function m(r,t){function i(C,U,D,I){var R=E(r[C],r,U);if(R.type==="throw")I(R.arg);else{var J=R.arg,$=J.value;return $&&typeof $=="object"&&u.call($,"__await")?t.resolve($.__await).then(function(N){i("next",N,D,I)},function(N){i("throw",N,D,I)}):t.resolve($).then(function(N){J.value=N,D(J)},function(N){return i("throw",N,D,I)})}}var p;function l(C,U){function D(){return new t(function(I,R){i(C,U,I,R)})}return p=p?p.then(D,D):D()}this._invoke=l}k(m.prototype),d(m.prototype,f,function(){return this}),o.AsyncIterator=m,o.async=function(r,t,i,p,l){l===void 0&&(l=Promise);var C=new m(g(r,t,i,p),l);return o.isGeneratorFunction(t)?C:C.next().then(function(U){return U.done?U.value:C.next()})};function h(r,t,i){var p=O;return function(C,U){if(p===z)throw new Error("Generator is already running");if(p===S){if(C==="throw")throw U;return X()}for(i.method=C,i.arg=U;;){var D=i.delegate;if(D){var I=L(D,i);if(I){if(I===M)continue;return I}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(p===O)throw p=S,i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);p=z;var R=E(r,t,i);if(R.type==="normal"){if(p=i.done?S:V,R.arg===M)continue;return{value:R.arg,done:i.done}}else R.type==="throw"&&(p=S,i.method="throw",i.arg=R.arg)}}}function L(r,t){var i=r.iterator[t.method];if(i===a){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=a,L(r,t),t.method==="throw"))return M;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return M}var p=E(i,r.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,M;var l=p.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,M;if(l.done)t[r.resultName]=l.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=a);else return l;return t.delegate=null,M}k(w),d(w,_,"Generator"),d(w,e,function(){return this}),d(w,"toString",function(){return"[object Generator]"});function y(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function b(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function T(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(y,this),this.reset(!0)}o.keys=function(r){var t=[];for(var i in r)t.push(i);return t.reverse(),function p(){for(;t.length;){var l=t.pop();if(l in r)return p.value=l,p.done=!1,p}return p.done=!0,p}};function W(r){if(r){var t=r[e];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var i=-1,p=function l(){for(;++i<r.length;)if(u.call(r,i))return l.value=r[i],l.done=!1,l;return l.value=a,l.done=!0,l};return p.next=p}}return{next:X}}o.values=W;function X(){return{value:a,done:!0}}return T.prototype={constructor:T,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(b),!r)for(var t in this)t.charAt(0)==="t"&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=a)},stop:function(){this.done=!0;var r=this.tryEntries[0],t=r.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function i(I,R){return C.type="throw",C.arg=r,t.next=I,R&&(t.method="next",t.arg=a),!!R}for(var p=this.tryEntries.length-1;p>=0;--p){var l=this.tryEntries[p],C=l.completion;if(l.tryLoc==="root")return i("end");if(l.tryLoc<=this.prev){var U=u.call(l,"catchLoc"),D=u.call(l,"finallyLoc");if(U&&D){if(this.prev<l.catchLoc)return i(l.catchLoc,!0);if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else if(U){if(this.prev<l.catchLoc)return i(l.catchLoc,!0)}else if(D){if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var i=this.tryEntries.length-1;i>=0;--i){var p=this.tryEntries[i];if(p.tryLoc<=this.prev&&u.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var l=p;break}}l&&(r==="break"||r==="continue")&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var C=l?l.completion:{};return C.type=r,C.arg=t,l?(this.method="next",this.next=l.finallyLoc,M):this.complete(C)},complete:function(r,t){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&t&&(this.next=t),M},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===r)return this.complete(i.completion,i.afterLoc),b(i),M}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===r){var p=i.completion;if(p.type==="throw"){var l=p.arg;b(i)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,i){return this.delegate={iterator:W(r),resultName:t,nextLoc:i},this.method==="next"&&(this.arg=a),M}},o}(v.exports);try{regeneratorRuntime=c}catch(o){typeof globalThis=="object"?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},695:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(u.geometry&&u.geometry.dispose(),u.material){var a=Array.isArray(u.material)?u.material:[u.material];a.forEach(function(n){var e,f,_,d,g,E,O,V,z,S,M,Z,A;(e=n.map)===null||e===void 0||e.dispose(),(f=n.lightMap)===null||f===void 0||f.dispose(),(_=n.bumpMap)===null||_===void 0||_.dispose(),(d=n.normalMap)===null||d===void 0||d.dispose(),(g=n.specularMap)===null||g===void 0||g.dispose(),(E=n.envMap)===null||E===void 0||E.dispose(),(O=n.alphaMap)===null||O===void 0||O.dispose(),(V=n.aoMap)===null||V===void 0||V.dispose(),(z=n.displacementMap)===null||z===void 0||z.dispose(),(S=n.emissiveMap)===null||S===void 0||S.dispose(),(M=n.gradientMap)===null||M===void 0||M.dispose(),(Z=n.metalnessMap)===null||Z===void 0||Z.dispose(),(A=n.roughnessMap)===null||A===void 0||A.dispose(),n.dispose()})}}},490:function(v,c,o){o.d(c,{U:function(){return u},v:function(){return s}});var s=function(a){for(var n=a.offsetLeft,e=a.offsetParent;e!==null;)n+=e.offsetLeft,e=e.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollLeft:f=document.documentElement.scrollLeft,n-f},u=function(a){for(var n=a.offsetTop,e=a.offsetParent;e!==null;)n+=e.offsetTop,e=e.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollTop:f=document.documentElement.scrollTop,n-f}},738:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a){return Object.prototype.toString.call(a)==="[object Object]"}function u(a){if(s(a)===!1)return!1;var n=a.constructor;if(n===void 0)return!0;var e=n.prototype;return!(s(e)===!1||e.hasOwnProperty("isPrototypeOf")===!1)}},282:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(484);function u(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e={};return e.promise=new Promise(function(f,_){e.resolve=f,e.reject=_}),a&&(e.promise=(0,s.Z)(e.promise,n)),e}},713:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,e=(90-a)*Math.PI/180,f=(90-u)*Math.PI/180;return[n*Math.sin(e)*Math.cos(f),n*Math.cos(e),n*Math.sin(e)*Math.sin(f)]}},618:function(v,c,o){o.d(c,{Z:function(){return a}});var s=o(438),u=function(){"use strict";function n(f){(0,s.Z)(this,n),this.onTick_=f,this.cancelPending_=null}var e=n.prototype;return e.tickAfter=function(_){var d=this;this.stop();var g=!0,E;this.cancelPending_=function(){clearTimeout(E),g=!1};var O=function(){g&&d.onTick_()};return E=window.setTimeout(O,_),this},e.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},n}(),a=function(){"use strict";function n(f){(0,s.Z)(this,n),this.onTick_=f,this.ticker_=null}var e=n.prototype;return e.tickNow=function(){return this.stop(),this.onTick_(),this},e.tickAfter=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){d.onTick_()}).tickAfter(_),this},e.tickEvery=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){var g;(g=d.ticker_)===null||g===void 0||g.tickAfter(_),d.onTick_()}).tickAfter(_),this},e.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},n}()},484:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(42);function u(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.then(function(e){return(0,s.Z)({err:null,res:e},n)}).catch(function(e){return(0,s.Z)({err:e,res:void 0},n)})}},705:function(v,c,o){o.d(c,{C:function(){return n},y:function(){return a}});var s=o(949),u=new Map,a=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(f,_,d,g,E){var O=_[d*3],V=_[d*3+1],z=_[g*3],S=_[g*3+1],M=_[E*3],Z=_[E*3+1],A;if(u.has(f))A=u.get(f);else{var G=e.box3||new s.Box3;if(!e.box3){var K=f.parameters.shapes.getPoints();G.setFromArray(K.map(function(m){return[m.x,m.y,0]}).flat())}var B=G.getSize(new s.Vector3);e.split&&(B.y/=e.split),A={box:G,size:B},u.set(f,A)}var j=A.box,w=A.size,k=e.split?1-e.split:0;return[new s.Vector2((O-j.min.x)/w.x,(V-j.min.y)/w.y+k),new s.Vector2((z-j.min.x)/w.x,(S-j.min.y)/w.y+k),new s.Vector2((M-j.min.x)/w.x,(Z-j.min.y)/w.y+k)]},generateSideWallUV:function(f,_,d,g,E,O){var V=_[d*3],z=_[d*3+1],S=_[d*3+2],M=_[g*3],Z=_[g*3+1],A=_[g*3+2],G=_[E*3],K=_[E*3+1],B=_[E*3+2],j=_[O*3],w=_[O*3+1],k=_[O*3+2],m;if(u.has(_))m=u.get(_);else{var h=new s.Box3;h.setFromArray(_);var L=h.getSize(new s.Vector3);e.split&&(L.z/=1-e.split),m={box:h,size:L},u.set(_,m)}var y=m.box,b=m.size;return Math.abs(z-Z)<Math.abs(V-M)?[new s.Vector2((V-y.min.x)/b.x,(S-y.min.z)/b.z),new s.Vector2((M-y.min.x)/b.x,(A-y.min.z)/b.z),new s.Vector2((G-y.min.x)/b.x,(B-y.min.z)/b.z),new s.Vector2((j-y.min.x)/b.x,(k-y.min.z)/b.z)]:[new s.Vector2((z-y.min.y)/b.x,(S-y.min.z)/b.z),new s.Vector2((Z-y.min.y)/b.x,(A-y.min.z)/b.z),new s.Vector2((K-y.min.y)/b.x,(B-y.min.z)/b.z),new s.Vector2((w-y.min.y)/b.x,(k-y.min.z)/b.z)]}}},n=function(){u.clear()}},949:function(v,c,o){var s=a=>{var n={};return o.d(n,a),n},u=a=>()=>a;v.exports=s({Box3:()=>F.Box3,Vector2:()=>F.Vector2,Vector3:()=>F.Vector3,sRGBEncoding:()=>F.sRGBEncoding})},943:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){(a==null||a>u.length)&&(a=u.length);for(var n=0,e=new Array(a);n<a;n++)e[n]=u[n];return e}},982:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a){if(Array.isArray(a))return(0,s.Z)(a)}},568:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a,n,e,f,_,d,g){try{var E=a[d](g),O=E.value}catch(V){e(V);return}E.done?n(O):Promise.resolve(O).then(f,_)}function u(a){return function(){var n=this,e=arguments;return new Promise(function(f,_){var d=a.apply(n,e);function g(O){s(d,f,_,g,E,"next",O)}function E(O){s(d,f,_,g,E,"throw",O)}g(void 0)})}}},438:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){if(!(u instanceof a))throw new TypeError("Cannot call a class as a function")}},924:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a,n){return a in u?Object.defineProperty(u,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):u[a]=n,u}},375:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}},270:function(v,c,o){o.d(c,{Z:function(){return s}});function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(924);function u(a){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{},f=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(f=f.concat(Object.getOwnPropertySymbols(e).filter(function(_){return Object.getOwnPropertyDescriptor(e,_).enumerable}))),f.forEach(function(_){(0,s.Z)(a,_,e[_])})}return a}},342:function(v,c,o){o.d(c,{Z:function(){return e}});var s=o(982),u=o(375),a=o(270),n=o(566);function e(f){return(0,s.Z)(f)||(0,u.Z)(f)||(0,n.Z)(f)||(0,a.Z)()}},566:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a,n){if(!!a){if(typeof a=="string")return(0,s.Z)(a,n);var e=Object.prototype.toString.call(a).slice(8,-1);if(e==="Object"&&a.constructor&&(e=a.constructor.name),e==="Map"||e==="Set")return Array.from(e);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return(0,s.Z)(a,n)}}}},H={};function P(v){var c=H[v];if(c!==void 0)return c.exports;var o=H[v]={exports:{}};return Q[v](o,o.exports,P),o.exports}(function(){P.n=function(v){var c=v&&v.__esModule?function(){return v.default}:function(){return v};return P.d(c,{a:c}),c}})(),function(){P.d=function(v,c){for(var o in c)P.o(c,o)&&!P.o(v,o)&&Object.defineProperty(v,o,{enumerable:!0,get:c[o]})}}(),function(){P.o=function(v,c){return Object.prototype.hasOwnProperty.call(v,c)}}();var x={};(function(){P.d(x,{qo:function(){return _},B7:function(){return o.Z},CL:function(){return j.C},eK:function(){return G},LK:function(){return A},ZL:function(){return O},wf:function(){return g.Z},lJ:function(){return K},vP:function(){return B.v},Up:function(){return B.U},y_:function(){return j.y},PO:function(){return V.Z},Mf:function(){return v.Z},Rl:function(){return d.Z},to:function(){return c.Z}});var v=P(282),c=P(484),o=P(618),s=P(568),u=P(438),a=P(42),n=P(342),e=P(666),f=P.n(e),_=function(){"use strict";function w(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,u.Z)(this,w),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,a.Z)({},{isdev:!1},m)}var k=w.prototype;return k.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},k.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},k.stop=function(){return this.traverse(function(h){return h.stop1()}),this},k.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},k.play=function(){var h=this;return(0,s.Z)(f().mark(function L(){var y;return f().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(y=h.chainedList[h.index],!(y&&h.isPlaying)){T.next=9;break}return T.next=4,Promise.all(y.map(function(W){return typeof W=="function"?W(h.repeatCount):W.start()}));case 4:return h.index+=1,T.next=7,h.play();case 7:T.next=17;break;case 9:if(!(!y&&h.isPlaying&&h.repeatCount<h.repeatNum)){T.next=16;break}return h.repeatCount+=1,h.index=0,T.next=14,h.play();case 14:T.next=17;break;case 16:!y&&h.isPlaying&&h.repeatCount===h.repeatNum&&h.stop();case 17:case"end":return T.stop()}},L)}))()},k.chain=function(){for(var h=arguments.length,L=new Array(h),y=0;y<h;y++)L[y]=arguments[y];var b=this;return(0,n.Z)(L).forEach(function(T){T instanceof w&&b.children.push(T)}),this.chainedList.push((0,n.Z)(L)),this},k.repeat=function(h){return this.repeatNum=h,this},k.timeout=function(h){return this.chain(function(){return new Promise(function(L){return setTimeout(L,h)})}),this},k.traverse=function(h){h(this),this.children.forEach(function(L){L.traverse(h)})},w}(),d=P(713),g=P(695),E=P(949);function O(w){if(w.material){var k=Array.isArray(w.material)?w.material:[w.material];k.forEach(function(m){var h,L;(h=m.color)===null||h===void 0||h.convertSRGBToLinear(),(L=m.emissive)===null||L===void 0||L.convertSRGBToLinear(),m.map&&(m.map.encoding=E.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=E.sRGBEncoding)})}}var V=P(738),z=P(924),S=w=>{var k={};return P.d(k,w),k},M=w=>()=>w,Z=S({clear:()=>Y.clear,del:()=>Y.del,get:()=>Y.get,set:()=>Y.set}),A=Z.del,G=Z.clear,K=function(){var w=(0,s.Z)(f().mark(function k(m,h){var L,y,b,T,W,X;return f().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return L=h.version,t.next=4,(0,Z.get)(m);case 4:if(b=t.sent,!(b&&b[L])){t.next=9;break}y=b[L],t.next=15;break;case 9:return t.next=11,(0,c.Z)(fetch(m).then(function(i){if(i.ok)return i.blob();throw new Error}));case 11:T=t.sent,W=T.res,X=T.err,X||(y=W,(0,Z.set)(m,(0,z.Z)({},L,W)));case 15:return t.abrupt("return",y?{url:URL.createObjectURL(y)}:{url:m});case 16:case"end":return t.stop()}},k)}));return function(m,h){return w.apply(this,arguments)}}(),B=P(490),j=P(705)})();var q=x.qo,tt=x.B7,rt=x.CL,et=x.eK,nt=x.LK,ot=x.ZL,at=x.wf,it=x.lJ,ut=x.vP,st=x.Up,ct=x.y_,ft=x.PO,_t=x.Mf,lt=x.Rl,pt=x.to;export{q as Chain,tt as Timer,rt as claerUVGenerator,et as clearAllCache,nt as clearCache,ot as colorCorrection,at as disposeMesh,it as getCache,ut as getElementViewLeft,st as getElementViewTop,ct as getUVGenerator,ft as isPlainObject,_t as makePromiseCreator,lt as polar2Cartesian,pt as to};
|