gl-draw 0.3.13 → 0.4.1

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.
@@ -1 +1 @@
1
- (function(){var X={666:function(y){var b=function(f){"use strict";var A=Object.prototype,T=A.hasOwnProperty,d,O=typeof Symbol=="function"?Symbol:{},E=O.iterator||"@@iterator",L=O.asyncIterator||"@@asyncIterator",j=O.toStringTag||"@@toStringTag";function p(r,t,a){return Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{p({},"")}catch(r){p=function(t,a,c){return t[a]=c}}function S(r,t,a,c){var l=t&&t.prototype instanceof R?t:R,x=Object.create(l.prototype),D=new m(c||[]);return x._invoke=h(r,a,D),x}f.wrap=S;function M(r,t,a){try{return{type:"normal",arg:r.call(t,a)}}catch(c){return{type:"throw",arg:c}}}var C="suspendedStart",N="suspendedYield",W="executing",U="completed",k={};function R(){}function _(){}function w(){}var n={};p(n,E,function(){return this});var s=Object.getPrototypeOf,o=s&&s(s(Z([])));o&&o!==A&&T.call(o,E)&&(n=o);var e=w.prototype=R.prototype=Object.create(n);_.prototype=w,p(e,"constructor",w),p(w,"constructor",_),_.displayName=p(w,j,"GeneratorFunction");function i(r){["next","throw","return"].forEach(function(t){p(r,t,function(a){return this._invoke(t,a)})})}f.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===_||(t.displayName||t.name)==="GeneratorFunction":!1},f.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,w):(r.__proto__=w,p(r,j,"GeneratorFunction")),r.prototype=Object.create(e),r},f.awrap=function(r){return{__await:r}};function u(r,t){function a(x,D,I,V){var H=M(r[x],r,D);if(H.type==="throw")V(H.arg);else{var K=H.arg,B=K.value;return B&&typeof B=="object"&&T.call(B,"__await")?t.resolve(B.__await).then(function(F){a("next",F,I,V)},function(F){a("throw",F,I,V)}):t.resolve(B).then(function(F){K.value=F,I(K)},function(F){return a("throw",F,I,V)})}}var c;function l(x,D){function I(){return new t(function(V,H){a(x,D,V,H)})}return c=c?c.then(I,I):I()}this._invoke=l}i(u.prototype),p(u.prototype,L,function(){return this}),f.AsyncIterator=u,f.async=function(r,t,a,c,l){l===void 0&&(l=Promise);var x=new u(S(r,t,a,c),l);return f.isGeneratorFunction(t)?x:x.next().then(function(D){return D.done?D.value:x.next()})};function h(r,t,a){var c=C;return function(x,D){if(c===W)throw new Error("Generator is already running");if(c===U){if(x==="throw")throw D;return G()}for(a.method=x,a.arg=D;;){var I=a.delegate;if(I){var V=v(I,a);if(V){if(V===k)continue;return V}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(c===C)throw c=U,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);c=W;var H=M(r,t,a);if(H.type==="normal"){if(c=a.done?U:N,H.arg===k)continue;return{value:H.arg,done:a.done}}else H.type==="throw"&&(c=U,a.method="throw",a.arg=H.arg)}}}function v(r,t){var a=r.iterator[t.method];if(a===d){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=d,v(r,t),t.method==="throw"))return k;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var c=M(a,r.iterator,t.arg);if(c.type==="throw")return t.method="throw",t.arg=c.arg,t.delegate=null,k;var l=c.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,k;if(l.done)t[r.resultName]=l.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=d);else return l;return t.delegate=null,k}i(e),p(e,j,"Generator"),p(e,E,function(){return this}),p(e,"toString",function(){return"[object Generator]"});function P(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 g(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function m(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(P,this),this.reset(!0)}f.keys=function(r){var t=[];for(var a in r)t.push(a);return t.reverse(),function c(){for(;t.length;){var l=t.pop();if(l in r)return c.value=l,c.done=!1,c}return c.done=!0,c}};function Z(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 a=-1,c=function l(){for(;++a<r.length;)if(T.call(r,a))return l.value=r[a],l.done=!1,l;return l.value=d,l.done=!0,l};return c.next=c}}return{next:G}}f.values=Z;function G(){return{value:d,done:!0}}return m.prototype={constructor:m,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(g),!r)for(var t in this)t.charAt(0)==="t"&&T.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},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 a(V,H){return x.type="throw",x.arg=r,t.next=V,H&&(t.method="next",t.arg=d),!!H}for(var c=this.tryEntries.length-1;c>=0;--c){var l=this.tryEntries[c],x=l.completion;if(l.tryLoc==="root")return a("end");if(l.tryLoc<=this.prev){var D=T.call(l,"catchLoc"),I=T.call(l,"finallyLoc");if(D&&I){if(this.prev<l.catchLoc)return a(l.catchLoc,!0);if(this.prev<l.finallyLoc)return a(l.finallyLoc)}else if(D){if(this.prev<l.catchLoc)return a(l.catchLoc,!0)}else if(I){if(this.prev<l.finallyLoc)return a(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var a=this.tryEntries.length-1;a>=0;--a){var c=this.tryEntries[a];if(c.tryLoc<=this.prev&&T.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var l=c;break}}l&&(r==="break"||r==="continue")&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var x=l?l.completion:{};return x.type=r,x.arg=t,l?(this.method="next",this.next=l.finallyLoc,k):this.complete(x)},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),k},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===r)return this.complete(a.completion,a.afterLoc),g(a),k}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===r){var c=a.completion;if(c.type==="throw"){var l=c.arg;g(a)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,a){return this.delegate={iterator:Z(r),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=d),k}},f}(y.exports);try{regeneratorRuntime=b}catch(f){typeof globalThis=="object"?globalThis.regeneratorRuntime=b:Function("r","regeneratorRuntime = r")(b)}},519:function(y,b,f){"use strict";f.d(b,{makePromiseCreator:function(){return A.Z}});var A=f(282),T=f(666),d=f.n(T),O=null,E=f(644);function L(k){if(k.material){var R=Array.isArray(k.material)?k.material:[k.material];R.forEach(function(_){var w,n;(w=_.color)===null||w===void 0||w.convertSRGBToLinear(),(n=_.emissive)===null||n===void 0||n.convertSRGBToLinear(),_.map&&(_.map.encoding=THREE.sRGBEncoding),_.emissiveMap&&(_.emissiveMap.encoding=THREE.sRGBEncoding)})}}var j=f(568),p=f(924),S=require("idb-keyval"),M=f(484),C=null,N=null,W=function(){var k=(0,j.Z)(d().mark(function R(_,w){var n,s,o,e,i,u;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return n=w.version,v.next=4,(0,S.get)(_);case 4:if(o=v.sent,!(o&&o[n])){v.next=9;break}s=o[n],v.next=15;break;case 9:return v.next=11,(0,M.Z)(fetch(_).then(function(P){if(P.ok)return P.blob();throw new Error}));case 11:e=v.sent,i=e.res,u=e.err,u||(s=i,(0,S.set)(_,(0,p.Z)({},n,i)));case 15:return v.abrupt("return",s?{url:URL.createObjectURL(s)}:{url:_});case 16:case"end":return v.stop()}},R)}));return function(_,w){return k.apply(this,arguments)}}(),U=f(705)},282:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});var A=f(484);function T(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E={};return E.promise=new Promise(function(L,j){E.resolve=L,E.reject=j}),d&&(E.promise=(0,A.Z)(E.promise,O)),E}},484:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});var A=f(42);function T(d){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return d.then(function(E){return(0,A.Z)({err:null,res:E},O)}).catch(function(E){return(0,A.Z)({err:E,res:void 0},O)})}},705:function(y,b,f){"use strict";var A=f(644),T=f.n(A),d=new Map,O=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(j,p,S,M,C){var N=p[S*3],W=p[S*3+1],U=p[M*3],k=p[M*3+1],R=p[C*3],_=p[C*3+1],w;if(d.has(j))w=d.get(j);else{var n=L.box3||new THREE.Box3;if(!L.box3){var s=j.parameters.shapes.getPoints();n.setFromArray(s.map(function(h){return[h.x,h.y,0]}).flat())}var o=n.getSize(new THREE.Vector3);L.split&&(o.y/=L.split),w={box:n,size:o},d.set(j,w)}var e=w.box,i=w.size,u=L.split?1-L.split:0;return[new THREE.Vector2((N-e.min.x)/i.x,(W-e.min.y)/i.y+u),new THREE.Vector2((U-e.min.x)/i.x,(k-e.min.y)/i.y+u),new THREE.Vector2((R-e.min.x)/i.x,(_-e.min.y)/i.y+u)]},generateSideWallUV:function(j,p,S,M,C,N){var W=p[S*3],U=p[S*3+1],k=p[S*3+2],R=p[M*3],_=p[M*3+1],w=p[M*3+2],n=p[C*3],s=p[C*3+1],o=p[C*3+2],e=p[N*3],i=p[N*3+1],u=p[N*3+2],h;if(d.has(p))h=d.get(p);else{var v=new THREE.Box3;v.setFromArray(p);var P=v.getSize(new THREE.Vector3);L.split&&(P.z/=1-L.split),h={box:v,size:P},d.set(p,h)}var g=h.box,m=h.size;return Math.abs(U-_)<Math.abs(W-R)?[new THREE.Vector2((W-g.min.x)/m.x,(k-g.min.z)/m.z),new THREE.Vector2((R-g.min.x)/m.x,(w-g.min.z)/m.z),new THREE.Vector2((n-g.min.x)/m.x,(o-g.min.z)/m.z),new THREE.Vector2((e-g.min.x)/m.x,(u-g.min.z)/m.z)]:[new THREE.Vector2((U-g.min.y)/m.x,(k-g.min.z)/m.z),new THREE.Vector2((_-g.min.y)/m.x,(w-g.min.z)/m.z),new THREE.Vector2((s-g.min.y)/m.x,(o-g.min.z)/m.z),new THREE.Vector2((i-g.min.y)/m.x,(u-g.min.z)/m.z)]}}},E=function(){d.clear()}},644:function(y){"use strict";y.exports=require("three")},568:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});function A(d,O,E,L,j,p,S){try{var M=d[p](S),C=M.value}catch(N){E(N);return}M.done?O(C):Promise.resolve(C).then(L,j)}function T(d){return function(){var O=this,E=arguments;return new Promise(function(L,j){var p=d.apply(O,E);function S(C){A(p,L,j,S,M,"next",C)}function M(C){A(p,L,j,S,M,"throw",C)}S(void 0)})}}},924:function(y,b,f){"use strict";f.d(b,{Z:function(){return A}});function A(T,d,O){return d in T?Object.defineProperty(T,d,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[d]=O,T}},42:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});var A=f(924);function T(d){for(var O=1;O<arguments.length;O++){var E=arguments[O]!=null?arguments[O]:{},L=Object.keys(E);typeof Object.getOwnPropertySymbols=="function"&&(L=L.concat(Object.getOwnPropertySymbols(E).filter(function(j){return Object.getOwnPropertyDescriptor(E,j).enumerable}))),L.forEach(function(j){(0,A.Z)(d,j,E[j])})}return d}}},Y={};function z(y){var b=Y[y];if(b!==void 0)return b.exports;var f=Y[y]={exports:{}};return X[y](f,f.exports,z),f.exports}(function(){z.n=function(y){var b=y&&y.__esModule?function(){return y.default}:function(){return y};return z.d(b,{a:b}),b}})(),function(){z.d=function(y,b){for(var f in b)z.o(b,f)&&!z.o(y,f)&&Object.defineProperty(y,f,{enumerable:!0,get:b[f]})}}(),function(){z.o=function(y,b){return Object.prototype.hasOwnProperty.call(y,b)}}(),function(){z.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})}}();var $={};(function(){"use strict";z.r($),z.d($,{Cache:function(){return f},Data:function(){return _},Draw:function(){return R},Wk:function(){return w}});function y(n,s){if(!(n instanceof s))throw new TypeError("Cannot call a class as a function")}var b=z(519),f=function(){"use strict";function n(){y(this,n),this.cache=new Map}var s=n.prototype;return s.install=function(){},s.init=function(e){var i=(0,b.makePromiseCreator)();this.cache.set(e,i)},s.get=function(e){var i;return(i=this.cache.get(e))===null||i===void 0?void 0:i.promise},s.set=function(e,i){var u=this.cache.get(e);u?u.resolve(i):console.warn("init cache first")},s.dispose=function(){this.cache.forEach(function(e,i){e.reject("stop set cache:".concat(i))}),this.cache.clear()},n}(),A=z(568);function T(n,s){for(var o=0;o<s.length;o++){var e=s[o];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function d(n,s,o){return s&&T(n.prototype,s),o&&T(n,o),n}function O(n){if(Array.isArray(n))return n}function E(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function L(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(n,s){(s==null||s>n.length)&&(s=n.length);for(var o=0,e=new Array(s);o<s;o++)e[o]=n[o];return e}function p(n,s){if(!!n){if(typeof n=="string")return j(n,s);var o=Object.prototype.toString.call(n).slice(8,-1);if(o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return j(n,s)}}function S(n,s){return O(n)||E(n,s)||p(n,s)||L()}function M(n){if(Array.isArray(n))return j(n)}function C(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(n){return M(n)||E(n)||p(n)||C()}var W=z(666),U=z.n(W),k=z(644),R=function(){"use strict";function n(o){y(this,n),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=o}var s=n.prototype;return s.install=function(e){this.pencil=e,this.initObjectFactories()},s.initObjectFactories=function(){var e=this,i=this.objects_;Object.keys(i).forEach(function(u){var h=function(){function v(){y(this,v)}var P=v.prototype;return P.create=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new i[u](m)},v}();e.objectNamesToFactories.set(u,h)})},s.getObject=function(e,i){e.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",e);var u=(i||{}).key,h="".concat(e).concat(u?"#".concat(u):""),v=this.objects.get(h);return v},s.getAllObject=function(e,i){e.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",e);var u=(i||{}).key,h="".concat(e).concat(u?"#".concat(u):""),v=[];return this.objects.forEach(function(P,g){(g.startsWith("".concat(h,"#"))||g===h)&&v.push(P)}),v},s.draw=function(e,i,u){var h=this;return(0,A.Z)(U().mark(function v(){var P,g,m,Z,G,r,t;return U().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(P=h.objectNamesToFactories.get(e),!P){c.next=15;break}return g=(i||{}).key,m="".concat(e).concat(g?"#".concat(g):""),h.objects.has(m)&&(Z=k.MathUtils.generateUUID(),m+="#".concat(Z)),G=(i==null?void 0:i.target)||u,typeof G=="string"?r=h.objects.get(G):(G==null?void 0:G.objecttype__)==="BaseObject"?r=G:r=h.pencil.scene,t=new P().create(i),t.pencil=h.pencil,t.key=m,h.objects.set(m,t),c.next=14,h.addMesh(t,r);case 14:return c.abrupt("return",t);case 15:throw new Error("Unrecognized:".concat(e));case 16:case"end":return c.stop()}},v)}))()},s.addMesh=function(e,i){return(0,A.Z)(U().mark(function u(){return U().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,e.create();case 2:e.object3d&&(e.object3d.userData.BaseObject_=e,i.add(e.object3d)),e.visible=!0,e.render(),e.pm.resolve();case 6:case"end":return v.stop()}},u)}))()},s.erase=function(){for(var e=arguments.length,i=new Array(e),u=0;u<e;u++)i[u]=arguments[u];var h=this;N(i).forEach(function(v){var P=[];if(typeof v=="string"){var g,m=S(v.split("#"),2),Z=m[0],G=m[1];(g=P).push.apply(g,N(h.getAllObject(Z,{key:G})))}else P.push(v);P.forEach(function(r){h.removeMesh(r)})})},s.removeMesh=function(e){var i=this,u=e.parent;e.object3d&&u.remove(e.object3d),e.traverse(function(h){h.visible=!1,h.dispose(),i.objects.delete(h.key)})},s.update=function(e,i){this.objects.forEach(function(u){u.update(e,i)})},s.setSize=function(e,i){this.objects.forEach(function(u){u.resize(e,i)})},s.dispose=function(){this.objects.forEach(function(e,i){e.dispose(),e.pm.reject("stop draw:".concat(i))}),this.objects.clear(),this.objectNamesToFactories.clear()},d(n,[{key:"objectsPromise",get:function(){var e=[];return this.objects.forEach(function(i){e.push(i.pm.promise)}),e}}]),n}(),_=function(){"use strict";function n(){y(this,n),this.data={}}var s=n.prototype;return s.install=function(){},s.setData=function(e,i){var u,h;this.data[e]=i,(h=(u=this).cb)===null||h===void 0||h.call(u,e)},s.runAll=function(){var e=this;Object.keys(this.data).forEach(function(i){var u,h;(h=(u=e).cb)===null||h===void 0||h.call(u,i)})},s.dispose=function(){this.data={},this.cb=void 0},n}(),w=function(){"use strict";function n(){y(this,n),this.messageList=[]}var s=n.prototype;return s.install=function(){},s.init=function(e,i){var u=this;this.workerList=Array.from({length:i},function(h,v){var P=typeof e=="string"?new Worker(e):e();return P.onmessage=function(g){var m=g.data,Z=m.res,G=m.uuid,r=u.messageList.find(function(t){var a=t.uuid;return G===a});r==null||r.cb(Z),u.workerList[v].inUse=!1,u.checkMessage()},{worker:P,inUse:!1}})},s.postMessage=function(e,i){this.messageList.push({req:e,cb:i,uuid:k.MathUtils.generateUUID(),inUse:!1}),this.checkMessage()},s.checkMessage=function(){var e=this.workerList.find(function(u){var h=u.inUse;return!h});if(e){var i=this.messageList.find(function(u){var h=u.inUse;return!h});i&&(i.inUse=!0,e.inUse=!0,e.worker.postMessage({req:i.req,uuid:i.uuid}))}},s.dispose=function(){this.workerList.forEach(function(e){var i=e.worker;i.terminate()}),this.workerList=[],this.messageList=[]},n}()})(),module.exports=$})();
1
+ (function(){var X={666:function(y){var b=function(f){"use strict";var A=Object.prototype,T=A.hasOwnProperty,d,O=typeof Symbol=="function"?Symbol:{},E=O.iterator||"@@iterator",L=O.asyncIterator||"@@asyncIterator",j=O.toStringTag||"@@toStringTag";function p(r,t,a){return Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{p({},"")}catch(r){p=function(t,a,c){return t[a]=c}}function S(r,t,a,c){var l=t&&t.prototype instanceof z?t:z,C=Object.create(l.prototype),D=new m(c||[]);return C._invoke=h(r,a,D),C}f.wrap=S;function M(r,t,a){try{return{type:"normal",arg:r.call(t,a)}}catch(c){return{type:"throw",arg:c}}}var R="suspendedStart",N="suspendedYield",W="executing",U="completed",k={};function z(){}function _(){}function w(){}var n={};p(n,E,function(){return this});var s=Object.getPrototypeOf,o=s&&s(s(Z([])));o&&o!==A&&T.call(o,E)&&(n=o);var e=w.prototype=z.prototype=Object.create(n);_.prototype=w,p(e,"constructor",w),p(w,"constructor",_),_.displayName=p(w,j,"GeneratorFunction");function i(r){["next","throw","return"].forEach(function(t){p(r,t,function(a){return this._invoke(t,a)})})}f.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===_||(t.displayName||t.name)==="GeneratorFunction":!1},f.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,w):(r.__proto__=w,p(r,j,"GeneratorFunction")),r.prototype=Object.create(e),r},f.awrap=function(r){return{__await:r}};function u(r,t){function a(C,D,I,V){var H=M(r[C],r,D);if(H.type==="throw")V(H.arg);else{var K=H.arg,B=K.value;return B&&typeof B=="object"&&T.call(B,"__await")?t.resolve(B.__await).then(function(F){a("next",F,I,V)},function(F){a("throw",F,I,V)}):t.resolve(B).then(function(F){K.value=F,I(K)},function(F){return a("throw",F,I,V)})}}var c;function l(C,D){function I(){return new t(function(V,H){a(C,D,V,H)})}return c=c?c.then(I,I):I()}this._invoke=l}i(u.prototype),p(u.prototype,L,function(){return this}),f.AsyncIterator=u,f.async=function(r,t,a,c,l){l===void 0&&(l=Promise);var C=new u(S(r,t,a,c),l);return f.isGeneratorFunction(t)?C:C.next().then(function(D){return D.done?D.value:C.next()})};function h(r,t,a){var c=R;return function(C,D){if(c===W)throw new Error("Generator is already running");if(c===U){if(C==="throw")throw D;return G()}for(a.method=C,a.arg=D;;){var I=a.delegate;if(I){var V=v(I,a);if(V){if(V===k)continue;return V}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(c===R)throw c=U,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);c=W;var H=M(r,t,a);if(H.type==="normal"){if(c=a.done?U:N,H.arg===k)continue;return{value:H.arg,done:a.done}}else H.type==="throw"&&(c=U,a.method="throw",a.arg=H.arg)}}}function v(r,t){var a=r.iterator[t.method];if(a===d){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=d,v(r,t),t.method==="throw"))return k;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var c=M(a,r.iterator,t.arg);if(c.type==="throw")return t.method="throw",t.arg=c.arg,t.delegate=null,k;var l=c.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,k;if(l.done)t[r.resultName]=l.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=d);else return l;return t.delegate=null,k}i(e),p(e,j,"Generator"),p(e,E,function(){return this}),p(e,"toString",function(){return"[object Generator]"});function P(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 g(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function m(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(P,this),this.reset(!0)}f.keys=function(r){var t=[];for(var a in r)t.push(a);return t.reverse(),function c(){for(;t.length;){var l=t.pop();if(l in r)return c.value=l,c.done=!1,c}return c.done=!0,c}};function Z(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 a=-1,c=function l(){for(;++a<r.length;)if(T.call(r,a))return l.value=r[a],l.done=!1,l;return l.value=d,l.done=!0,l};return c.next=c}}return{next:G}}f.values=Z;function G(){return{value:d,done:!0}}return m.prototype={constructor:m,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(g),!r)for(var t in this)t.charAt(0)==="t"&&T.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},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 a(V,H){return C.type="throw",C.arg=r,t.next=V,H&&(t.method="next",t.arg=d),!!H}for(var c=this.tryEntries.length-1;c>=0;--c){var l=this.tryEntries[c],C=l.completion;if(l.tryLoc==="root")return a("end");if(l.tryLoc<=this.prev){var D=T.call(l,"catchLoc"),I=T.call(l,"finallyLoc");if(D&&I){if(this.prev<l.catchLoc)return a(l.catchLoc,!0);if(this.prev<l.finallyLoc)return a(l.finallyLoc)}else if(D){if(this.prev<l.catchLoc)return a(l.catchLoc,!0)}else if(I){if(this.prev<l.finallyLoc)return a(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var a=this.tryEntries.length-1;a>=0;--a){var c=this.tryEntries[a];if(c.tryLoc<=this.prev&&T.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var l=c;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,k):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),k},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===r)return this.complete(a.completion,a.afterLoc),g(a),k}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===r){var c=a.completion;if(c.type==="throw"){var l=c.arg;g(a)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,a){return this.delegate={iterator:Z(r),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=d),k}},f}(y.exports);try{regeneratorRuntime=b}catch(f){typeof globalThis=="object"?globalThis.regeneratorRuntime=b:Function("r","regeneratorRuntime = r")(b)}},519:function(y,b,f){"use strict";f.d(b,{makePromiseCreator:function(){return A.Z}});var A=f(282),T=f(666),d=f.n(T),O=null,E=f(644);function L(k){if(k.material){var z=Array.isArray(k.material)?k.material:[k.material];z.forEach(function(_){var w,n;(w=_.color)===null||w===void 0||w.convertSRGBToLinear(),(n=_.emissive)===null||n===void 0||n.convertSRGBToLinear(),_.map&&(_.map.encoding=THREE.sRGBEncoding),_.emissiveMap&&(_.emissiveMap.encoding=THREE.sRGBEncoding)})}}var j=f(568),p=f(924),S=require("idb-keyval"),M=f(484),R=null,N=null,W=function(){var k=(0,j.Z)(d().mark(function z(_,w){var n,s,o,e,i,u;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return n=w.version,v.next=4,(0,S.get)(_);case 4:if(o=v.sent,!(o&&o[n])){v.next=9;break}s=o[n],v.next=15;break;case 9:return v.next=11,(0,M.Z)(fetch(_).then(function(P){if(P.ok)return P.blob();throw new Error}));case 11:e=v.sent,i=e.res,u=e.err,u||(s=i,(0,S.set)(_,(0,p.Z)({},n,i)));case 15:return v.abrupt("return",s?{url:URL.createObjectURL(s)}:{url:_});case 16:case"end":return v.stop()}},z)}));return function(_,w){return k.apply(this,arguments)}}(),U=f(705)},282:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});var A=f(484);function T(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E={};return E.promise=new Promise(function(L,j){E.resolve=L,E.reject=j}),d&&(E.promise=(0,A.Z)(E.promise,O)),E}},484:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});var A=f(42);function T(d){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return d.then(function(E){return(0,A.Z)({err:null,res:E},O)}).catch(function(E){return(0,A.Z)({err:E,res:void 0},O)})}},705:function(y,b,f){"use strict";var A=f(644),T=f.n(A),d=new Map,O=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(j,p,S,M,R){var N=p[S*3],W=p[S*3+1],U=p[M*3],k=p[M*3+1],z=p[R*3],_=p[R*3+1],w;if(d.has(j))w=d.get(j);else{var n=L.box3||new THREE.Box3;if(!L.box3){var s=j.parameters.shapes.getPoints();n.setFromArray(s.map(function(h){return[h.x,h.y,0]}).flat())}var o=n.getSize(new THREE.Vector3);L.split&&(o.y/=L.split),w={box:n,size:o},d.set(j,w)}var e=w.box,i=w.size,u=L.split?1-L.split:0;return[new THREE.Vector2((N-e.min.x)/i.x,(W-e.min.y)/i.y+u),new THREE.Vector2((U-e.min.x)/i.x,(k-e.min.y)/i.y+u),new THREE.Vector2((z-e.min.x)/i.x,(_-e.min.y)/i.y+u)]},generateSideWallUV:function(j,p,S,M,R,N){var W=p[S*3],U=p[S*3+1],k=p[S*3+2],z=p[M*3],_=p[M*3+1],w=p[M*3+2],n=p[R*3],s=p[R*3+1],o=p[R*3+2],e=p[N*3],i=p[N*3+1],u=p[N*3+2],h;if(d.has(p))h=d.get(p);else{var v=new THREE.Box3;v.setFromArray(p);var P=v.getSize(new THREE.Vector3);L.split&&(P.z/=1-L.split),h={box:v,size:P},d.set(p,h)}var g=h.box,m=h.size;return Math.abs(U-_)<Math.abs(W-z)?[new THREE.Vector2((W-g.min.x)/m.x,(k-g.min.z)/m.z),new THREE.Vector2((z-g.min.x)/m.x,(w-g.min.z)/m.z),new THREE.Vector2((n-g.min.x)/m.x,(o-g.min.z)/m.z),new THREE.Vector2((e-g.min.x)/m.x,(u-g.min.z)/m.z)]:[new THREE.Vector2((U-g.min.y)/m.y,(k-g.min.z)/m.z),new THREE.Vector2((_-g.min.y)/m.y,(w-g.min.z)/m.z),new THREE.Vector2((s-g.min.y)/m.y,(o-g.min.z)/m.z),new THREE.Vector2((i-g.min.y)/m.y,(u-g.min.z)/m.z)]}}},E=function(){d.clear()}},644:function(y){"use strict";y.exports=require("three")},568:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});function A(d,O,E,L,j,p,S){try{var M=d[p](S),R=M.value}catch(N){E(N);return}M.done?O(R):Promise.resolve(R).then(L,j)}function T(d){return function(){var O=this,E=arguments;return new Promise(function(L,j){var p=d.apply(O,E);function S(R){A(p,L,j,S,M,"next",R)}function M(R){A(p,L,j,S,M,"throw",R)}S(void 0)})}}},924:function(y,b,f){"use strict";f.d(b,{Z:function(){return A}});function A(T,d,O){return d in T?Object.defineProperty(T,d,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[d]=O,T}},42:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});var A=f(924);function T(d){for(var O=1;O<arguments.length;O++){var E=arguments[O]!=null?arguments[O]:{},L=Object.keys(E);typeof Object.getOwnPropertySymbols=="function"&&(L=L.concat(Object.getOwnPropertySymbols(E).filter(function(j){return Object.getOwnPropertyDescriptor(E,j).enumerable}))),L.forEach(function(j){(0,A.Z)(d,j,E[j])})}return d}}},Y={};function x(y){var b=Y[y];if(b!==void 0)return b.exports;var f=Y[y]={exports:{}};return X[y](f,f.exports,x),f.exports}(function(){x.n=function(y){var b=y&&y.__esModule?function(){return y.default}:function(){return y};return x.d(b,{a:b}),b}})(),function(){x.d=function(y,b){for(var f in b)x.o(b,f)&&!x.o(y,f)&&Object.defineProperty(y,f,{enumerable:!0,get:b[f]})}}(),function(){x.o=function(y,b){return Object.prototype.hasOwnProperty.call(y,b)}}(),function(){x.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})}}();var $={};(function(){"use strict";x.r($),x.d($,{Cache:function(){return f},Data:function(){return _},Draw:function(){return z},Wk:function(){return w}});function y(n,s){if(!(n instanceof s))throw new TypeError("Cannot call a class as a function")}var b=x(519),f=function(){"use strict";function n(){y(this,n),this.cache=new Map}var s=n.prototype;return s.install=function(){},s.init=function(e){var i=(0,b.makePromiseCreator)();this.cache.set(e,i)},s.get=function(e){var i;return(i=this.cache.get(e))===null||i===void 0?void 0:i.promise},s.set=function(e,i){var u=this.cache.get(e);u?u.resolve(i):console.warn("init cache first")},s.dispose=function(){this.cache.forEach(function(e,i){e.reject("stop set cache:".concat(i))}),this.cache.clear()},n}(),A=x(568);function T(n,s){for(var o=0;o<s.length;o++){var e=s[o];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function d(n,s,o){return s&&T(n.prototype,s),o&&T(n,o),n}function O(n){if(Array.isArray(n))return n}function E(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function L(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(n,s){(s==null||s>n.length)&&(s=n.length);for(var o=0,e=new Array(s);o<s;o++)e[o]=n[o];return e}function p(n,s){if(!!n){if(typeof n=="string")return j(n,s);var o=Object.prototype.toString.call(n).slice(8,-1);if(o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return j(n,s)}}function S(n,s){return O(n)||E(n,s)||p(n,s)||L()}function M(n){if(Array.isArray(n))return j(n)}function R(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(n){return M(n)||E(n)||p(n)||R()}var W=x(666),U=x.n(W),k=x(644),z=function(){"use strict";function n(o){y(this,n),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=o}var s=n.prototype;return s.install=function(e){this.pencil=e,this.initObjectFactories()},s.initObjectFactories=function(){var e=this,i=this.objects_;Object.keys(i).forEach(function(u){var h=function(){function v(){y(this,v)}var P=v.prototype;return P.create=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new i[u](m)},v}();e.objectNamesToFactories.set(u,h)})},s.getObject=function(e,i){e.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",e);var u=(i||{}).key,h="".concat(e).concat(u?"#".concat(u):""),v=this.objects.get(h);return v},s.getAllObject=function(e,i){e.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",e);var u=(i||{}).key,h="".concat(e).concat(u?"#".concat(u):""),v=[];return this.objects.forEach(function(P,g){(g.startsWith("".concat(h,"#"))||g===h)&&v.push(P)}),v},s.draw=function(e,i,u){var h=this;return(0,A.Z)(U().mark(function v(){var P,g,m,Z,G,r,t;return U().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(P=h.objectNamesToFactories.get(e),!P){c.next=15;break}return g=(i||{}).key,m="".concat(e).concat(g?"#".concat(g):""),h.objects.has(m)&&(Z=k.MathUtils.generateUUID(),m+="#".concat(Z)),G=(i==null?void 0:i.target)||u,typeof G=="string"?r=h.objects.get(G):(G==null?void 0:G.objecttype__)==="BaseObject"?r=G:r=h.pencil.scene,t=new P().create(i),t.pencil=h.pencil,t.key=m,h.objects.set(m,t),c.next=14,h.addMesh(t,r);case 14:return c.abrupt("return",t);case 15:throw new Error("Unrecognized:".concat(e));case 16:case"end":return c.stop()}},v)}))()},s.addMesh=function(e,i){return(0,A.Z)(U().mark(function u(){return U().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,e.create();case 2:e.object3d&&(e.object3d.userData.BaseObject_=e,i.add(e.object3d)),e.visible=!0,e.render(),e.pm.resolve();case 6:case"end":return v.stop()}},u)}))()},s.erase=function(){for(var e=arguments.length,i=new Array(e),u=0;u<e;u++)i[u]=arguments[u];var h=this;N(i).forEach(function(v){var P=[];if(typeof v=="string"){var g,m=S(v.split("#"),2),Z=m[0],G=m[1];(g=P).push.apply(g,N(h.getAllObject(Z,{key:G})))}else P.push(v);P.forEach(function(r){h.removeMesh(r)})})},s.removeMesh=function(e){var i=this,u=e.parent;e.object3d&&u.remove(e.object3d),e.traverse(function(h){h.visible=!1,h.dispose(),i.objects.delete(h.key)})},s.update=function(e,i){this.objects.forEach(function(u){u.update(e,i)})},s.setSize=function(e,i){this.objects.forEach(function(u){u.resize(e,i)})},s.dispose=function(){this.objects.forEach(function(e,i){e.dispose(),e.pm.reject("stop draw:".concat(i))}),this.objects.clear(),this.objectNamesToFactories.clear()},d(n,[{key:"objectsPromise",get:function(){var e=[];return this.objects.forEach(function(i){e.push(i.pm.promise)}),e}}]),n}(),_=function(){"use strict";function n(){y(this,n),this.data={}}var s=n.prototype;return s.install=function(){},s.setData=function(e,i){var u,h;this.data[e]=i,(h=(u=this).cb)===null||h===void 0||h.call(u,e)},s.runAll=function(){var e=this;Object.keys(this.data).forEach(function(i){var u,h;(h=(u=e).cb)===null||h===void 0||h.call(u,i)})},s.dispose=function(){this.data={},this.cb=void 0},n}(),w=function(){"use strict";function n(){y(this,n),this.messageList=[]}var s=n.prototype;return s.install=function(){},s.init=function(e,i){var u=this;this.workerList=Array.from({length:i},function(h,v){var P=typeof e=="string"?new Worker(e):e();return P.onmessage=function(g){var m=g.data,Z=m.res,G=m.uuid,r=u.messageList.find(function(t){var a=t.uuid;return G===a});r==null||r.cb(Z),u.workerList[v].inUse=!1,u.checkMessage()},{worker:P,inUse:!1}})},s.postMessage=function(e,i){this.messageList.push({req:e,cb:i,uuid:k.MathUtils.generateUUID(),inUse:!1}),this.checkMessage()},s.checkMessage=function(){var e=this.workerList.find(function(u){var h=u.inUse;return!h});if(e){var i=this.messageList.find(function(u){var h=u.inUse;return!h});i&&(i.inUse=!0,e.inUse=!0,e.worker.postMessage({req:i.req,uuid:i.uuid}))}},s.dispose=function(){this.workerList.forEach(function(e){var i=e.worker;i.terminate()}),this.workerList=[],this.messageList=[]},n}()})(),module.exports=$})();
@@ -1 +1 @@
1
- import*as X from"idb-keyval";import*as J from"three";var Q={666:function(b){var g=function(f){"use strict";var T=Object.prototype,m=T.hasOwnProperty,d,j=typeof Symbol=="function"?Symbol:{},_=j.iterator||"@@iterator",O=j.asyncIterator||"@@asyncIterator",p=j.toStringTag||"@@toStringTag";function E(r,t,o){return Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{E({},"")}catch(r){E=function(t,o,c){return t[o]=c}}function S(r,t,o,c){var h=t&&t.prototype instanceof V?t:V,P=Object.create(h.prototype),U=new M(c||[]);return P._invoke=l(r,o,U),P}f.wrap=S;function C(r,t,o){try{return{type:"normal",arg:r.call(t,o)}}catch(c){return{type:"throw",arg:c}}}var A="suspendedStart",H="suspendedYield",W="executing",R="completed",x={};function V(){}function k(){}function L(){}var n={};E(n,_,function(){return this});var i=Object.getPrototypeOf,a=i&&i(i(Z([])));a&&a!==T&&m.call(a,_)&&(n=a);var e=L.prototype=V.prototype=Object.create(n);k.prototype=L,E(e,"constructor",L),E(L,"constructor",k),k.displayName=E(L,p,"GeneratorFunction");function s(r){["next","throw","return"].forEach(function(t){E(r,t,function(o){return this._invoke(t,o)})})}f.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===k||(t.displayName||t.name)==="GeneratorFunction":!1},f.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,L):(r.__proto__=L,E(r,p,"GeneratorFunction")),r.prototype=Object.create(e),r},f.awrap=function(r){return{__await:r}};function u(r,t){function o(P,U,G,N){var D=C(r[P],r,U);if(D.type==="throw")N(D.arg);else{var $=D.arg,F=$.value;return F&&typeof F=="object"&&m.call(F,"__await")?t.resolve(F.__await).then(function(B){o("next",B,G,N)},function(B){o("throw",B,G,N)}):t.resolve(F).then(function(B){$.value=B,G($)},function(B){return o("throw",B,G,N)})}}var c;function h(P,U){function G(){return new t(function(N,D){o(P,U,N,D)})}return c=c?c.then(G,G):G()}this._invoke=h}s(u.prototype),E(u.prototype,O,function(){return this}),f.AsyncIterator=u,f.async=function(r,t,o,c,h){h===void 0&&(h=Promise);var P=new u(S(r,t,o,c),h);return f.isGeneratorFunction(t)?P:P.next().then(function(U){return U.done?U.value:P.next()})};function l(r,t,o){var c=A;return function(P,U){if(c===W)throw new Error("Generator is already running");if(c===R){if(P==="throw")throw U;return z()}for(o.method=P,o.arg=U;;){var G=o.delegate;if(G){var N=w(G,o);if(N){if(N===x)continue;return N}}if(o.method==="next")o.sent=o._sent=o.arg;else if(o.method==="throw"){if(c===A)throw c=R,o.arg;o.dispatchException(o.arg)}else o.method==="return"&&o.abrupt("return",o.arg);c=W;var D=C(r,t,o);if(D.type==="normal"){if(c=o.done?R:H,D.arg===x)continue;return{value:D.arg,done:o.done}}else D.type==="throw"&&(c=R,o.method="throw",o.arg=D.arg)}}}function w(r,t){var o=r.iterator[t.method];if(o===d){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=d,w(r,t),t.method==="throw"))return x;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return x}var c=C(o,r.iterator,t.arg);if(c.type==="throw")return t.method="throw",t.arg=c.arg,t.delegate=null,x;var h=c.arg;if(!h)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,x;if(h.done)t[r.resultName]=h.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=d);else return h;return t.delegate=null,x}s(e),E(e,p,"Generator"),E(e,_,function(){return this}),E(e,"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 v(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function M(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(y,this),this.reset(!0)}f.keys=function(r){var t=[];for(var o in r)t.push(o);return t.reverse(),function c(){for(;t.length;){var h=t.pop();if(h in r)return c.value=h,c.done=!1,c}return c.done=!0,c}};function Z(r){if(r){var t=r[_];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var o=-1,c=function h(){for(;++o<r.length;)if(m.call(r,o))return h.value=r[o],h.done=!1,h;return h.value=d,h.done=!0,h};return c.next=c}}return{next:z}}f.values=Z;function z(){return{value:d,done:!0}}return M.prototype={constructor:M,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(v),!r)for(var t in this)t.charAt(0)==="t"&&m.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},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 o(N,D){return P.type="throw",P.arg=r,t.next=N,D&&(t.method="next",t.arg=d),!!D}for(var c=this.tryEntries.length-1;c>=0;--c){var h=this.tryEntries[c],P=h.completion;if(h.tryLoc==="root")return o("end");if(h.tryLoc<=this.prev){var U=m.call(h,"catchLoc"),G=m.call(h,"finallyLoc");if(U&&G){if(this.prev<h.catchLoc)return o(h.catchLoc,!0);if(this.prev<h.finallyLoc)return o(h.finallyLoc)}else if(U){if(this.prev<h.catchLoc)return o(h.catchLoc,!0)}else if(G){if(this.prev<h.finallyLoc)return o(h.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var o=this.tryEntries.length-1;o>=0;--o){var c=this.tryEntries[o];if(c.tryLoc<=this.prev&&m.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var h=c;break}}h&&(r==="break"||r==="continue")&&h.tryLoc<=t&&t<=h.finallyLoc&&(h=null);var P=h?h.completion:{};return P.type=r,P.arg=t,h?(this.method="next",this.next=h.finallyLoc,x):this.complete(P)},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),x},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===r)return this.complete(o.completion,o.afterLoc),v(o),x}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===r){var c=o.completion;if(c.type==="throw"){var h=c.arg;v(o)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,o){return this.delegate={iterator:Z(r),resultName:t,nextLoc:o},this.method==="next"&&(this.arg=d),x}},f}(b.exports);try{regeneratorRuntime=g}catch(f){typeof globalThis=="object"?globalThis.regeneratorRuntime=g:Function("r","regeneratorRuntime = r")(g)}},521:function(b,g,f){f.d(g,{Mf:function(){return T.Z}});var T=f(282),m=f(666),d=f.n(m),j=null,_=f(949);function O(k){if(k.material){var L=Array.isArray(k.material)?k.material:[k.material];L.forEach(function(n){var i,a;(i=n.color)===null||i===void 0||i.convertSRGBToLinear(),(a=n.emissive)===null||a===void 0||a.convertSRGBToLinear(),n.map&&(n.map.encoding=THREE.sRGBEncoding),n.emissiveMap&&(n.emissiveMap.encoding=THREE.sRGBEncoding)})}}var p=f(568),E=f(924),S=k=>{var L={};return f.d(L,k),L},C=k=>()=>k,A=S({get:()=>X.get,set:()=>X.set}),H=f(484),W=null,R=null,x=function(){var k=(0,p.Z)(d().mark(function L(n,i){var a,e,s,u,l,w;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return a=i.version,v.next=4,(0,A.get)(n);case 4:if(s=v.sent,!(s&&s[a])){v.next=9;break}e=s[a],v.next=15;break;case 9:return v.next=11,(0,H.Z)(fetch(n).then(function(M){if(M.ok)return M.blob();throw new Error}));case 11:u=v.sent,l=u.res,w=u.err,w||(e=l,(0,A.set)(n,(0,E.Z)({},a,l)));case 15:return v.abrupt("return",e?{url:URL.createObjectURL(e)}:{url:n});case 16:case"end":return v.stop()}},L)}));return function(n,i){return k.apply(this,arguments)}}(),V=f(705)},282:function(b,g,f){f.d(g,{Z:function(){return m}});var T=f(484);function m(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_={};return _.promise=new Promise(function(O,p){_.resolve=O,_.reject=p}),d&&(_.promise=(0,T.Z)(_.promise,j)),_}},484:function(b,g,f){f.d(g,{Z:function(){return m}});var T=f(42);function m(d){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return d.then(function(_){return(0,T.Z)({err:null,res:_},j)}).catch(function(_){return(0,T.Z)({err:_,res:void 0},j)})}},705:function(b,g,f){var T=f(949),m=new Map,d=function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(O,p,E,S,C){var A=p[E*3],H=p[E*3+1],W=p[S*3],R=p[S*3+1],x=p[C*3],V=p[C*3+1],k;if(m.has(O))k=m.get(O);else{var L=_.box3||new THREE.Box3;if(!_.box3){var n=O.parameters.shapes.getPoints();L.setFromArray(n.map(function(u){return[u.x,u.y,0]}).flat())}var i=L.getSize(new THREE.Vector3);_.split&&(i.y/=_.split),k={box:L,size:i},m.set(O,k)}var a=k.box,e=k.size,s=_.split?1-_.split:0;return[new THREE.Vector2((A-a.min.x)/e.x,(H-a.min.y)/e.y+s),new THREE.Vector2((W-a.min.x)/e.x,(R-a.min.y)/e.y+s),new THREE.Vector2((x-a.min.x)/e.x,(V-a.min.y)/e.y+s)]},generateSideWallUV:function(O,p,E,S,C,A){var H=p[E*3],W=p[E*3+1],R=p[E*3+2],x=p[S*3],V=p[S*3+1],k=p[S*3+2],L=p[C*3],n=p[C*3+1],i=p[C*3+2],a=p[A*3],e=p[A*3+1],s=p[A*3+2],u;if(m.has(p))u=m.get(p);else{var l=new THREE.Box3;l.setFromArray(p);var w=l.getSize(new THREE.Vector3);_.split&&(w.z/=1-_.split),u={box:l,size:w},m.set(p,u)}var y=u.box,v=u.size;return Math.abs(W-V)<Math.abs(H-x)?[new THREE.Vector2((H-y.min.x)/v.x,(R-y.min.z)/v.z),new THREE.Vector2((x-y.min.x)/v.x,(k-y.min.z)/v.z),new THREE.Vector2((L-y.min.x)/v.x,(i-y.min.z)/v.z),new THREE.Vector2((a-y.min.x)/v.x,(s-y.min.z)/v.z)]:[new THREE.Vector2((W-y.min.y)/v.x,(R-y.min.z)/v.z),new THREE.Vector2((V-y.min.y)/v.x,(k-y.min.z)/v.z),new THREE.Vector2((n-y.min.y)/v.x,(i-y.min.z)/v.z),new THREE.Vector2((e-y.min.y)/v.x,(s-y.min.z)/v.z)]}}},j=function(){m.clear()}},949:function(b,g,f){var T=d=>{var j={};return f.d(j,d),j},m=d=>()=>d;b.exports=T({MathUtils:()=>J.MathUtils})},568:function(b,g,f){f.d(g,{Z:function(){return m}});function T(d,j,_,O,p,E,S){try{var C=d[E](S),A=C.value}catch(H){_(H);return}C.done?j(A):Promise.resolve(A).then(O,p)}function m(d){return function(){var j=this,_=arguments;return new Promise(function(O,p){var E=d.apply(j,_);function S(A){T(E,O,p,S,C,"next",A)}function C(A){T(E,O,p,S,C,"throw",A)}S(void 0)})}}},924:function(b,g,f){f.d(g,{Z:function(){return T}});function T(m,d,j){return d in m?Object.defineProperty(m,d,{value:j,enumerable:!0,configurable:!0,writable:!0}):m[d]=j,m}},42:function(b,g,f){f.d(g,{Z:function(){return m}});var T=f(924);function m(d){for(var j=1;j<arguments.length;j++){var _=arguments[j]!=null?arguments[j]:{},O=Object.keys(_);typeof Object.getOwnPropertySymbols=="function"&&(O=O.concat(Object.getOwnPropertySymbols(_).filter(function(p){return Object.getOwnPropertyDescriptor(_,p).enumerable}))),O.forEach(function(p){(0,T.Z)(d,p,_[p])})}return d}}},Y={};function I(b){var g=Y[b];if(g!==void 0)return g.exports;var f=Y[b]={exports:{}};return Q[b](f,f.exports,I),f.exports}(function(){I.n=function(b){var g=b&&b.__esModule?function(){return b.default}:function(){return b};return I.d(g,{a:g}),g}})(),function(){I.d=function(b,g){for(var f in g)I.o(g,f)&&!I.o(b,f)&&Object.defineProperty(b,f,{enumerable:!0,get:g[f]})}}(),function(){I.o=function(b,g){return Object.prototype.hasOwnProperty.call(b,g)}}();var K={};(function(){I.d(K,{Ct:function(){return f},Vw:function(){return k},hG:function(){return V},Wk:function(){return L}});function b(n,i){if(!(n instanceof i))throw new TypeError("Cannot call a class as a function")}var g=I(521),f=function(){"use strict";function n(){b(this,n),this.cache=new Map}var i=n.prototype;return i.install=function(){},i.init=function(e){var s=(0,g.Mf)();this.cache.set(e,s)},i.get=function(e){var s;return(s=this.cache.get(e))===null||s===void 0?void 0:s.promise},i.set=function(e,s){var u=this.cache.get(e);u?u.resolve(s):console.warn("init cache first")},i.dispose=function(){this.cache.forEach(function(e,s){e.reject("stop set cache:".concat(s))}),this.cache.clear()},n}(),T=I(568);function m(n,i){for(var a=0;a<i.length;a++){var e=i[a];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function d(n,i,a){return i&&m(n.prototype,i),a&&m(n,a),n}function j(n){if(Array.isArray(n))return n}function _(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(n,i){(i==null||i>n.length)&&(i=n.length);for(var a=0,e=new Array(i);a<i;a++)e[a]=n[a];return e}function E(n,i){if(!!n){if(typeof n=="string")return p(n,i);var a=Object.prototype.toString.call(n).slice(8,-1);if(a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return p(n,i)}}function S(n,i){return j(n)||_(n,i)||E(n,i)||O()}function C(n){if(Array.isArray(n))return p(n)}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(n){return C(n)||_(n)||E(n)||A()}var W=I(666),R=I.n(W),x=I(949),V=function(){"use strict";function n(a){b(this,n),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=a}var i=n.prototype;return i.install=function(e){this.pencil=e,this.initObjectFactories()},i.initObjectFactories=function(){var e=this,s=this.objects_;Object.keys(s).forEach(function(u){var l=function(){function w(){b(this,w)}var y=w.prototype;return y.create=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new s[u](M)},w}();e.objectNamesToFactories.set(u,l)})},i.getObject=function(e,s){e.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",e);var u=(s||{}).key,l="".concat(e).concat(u?"#".concat(u):""),w=this.objects.get(l);return w},i.getAllObject=function(e,s){e.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",e);var u=(s||{}).key,l="".concat(e).concat(u?"#".concat(u):""),w=[];return this.objects.forEach(function(y,v){(v.startsWith("".concat(l,"#"))||v===l)&&w.push(y)}),w},i.draw=function(e,s,u){var l=this;return(0,T.Z)(R().mark(function w(){var y,v,M,Z,z,r,t;return R().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(y=l.objectNamesToFactories.get(e),!y){c.next=15;break}return v=(s||{}).key,M="".concat(e).concat(v?"#".concat(v):""),l.objects.has(M)&&(Z=x.MathUtils.generateUUID(),M+="#".concat(Z)),z=(s==null?void 0:s.target)||u,typeof z=="string"?r=l.objects.get(z):(z==null?void 0:z.objecttype__)==="BaseObject"?r=z:r=l.pencil.scene,t=new y().create(s),t.pencil=l.pencil,t.key=M,l.objects.set(M,t),c.next=14,l.addMesh(t,r);case 14:return c.abrupt("return",t);case 15:throw new Error("Unrecognized:".concat(e));case 16:case"end":return c.stop()}},w)}))()},i.addMesh=function(e,s){return(0,T.Z)(R().mark(function u(){return R().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,e.create();case 2:e.object3d&&(e.object3d.userData.BaseObject_=e,s.add(e.object3d)),e.visible=!0,e.render(),e.pm.resolve();case 6:case"end":return w.stop()}},u)}))()},i.erase=function(){for(var e=arguments.length,s=new Array(e),u=0;u<e;u++)s[u]=arguments[u];var l=this;H(s).forEach(function(w){var y=[];if(typeof w=="string"){var v,M=S(w.split("#"),2),Z=M[0],z=M[1];(v=y).push.apply(v,H(l.getAllObject(Z,{key:z})))}else y.push(w);y.forEach(function(r){l.removeMesh(r)})})},i.removeMesh=function(e){var s=this,u=e.parent;e.object3d&&u.remove(e.object3d),e.traverse(function(l){l.visible=!1,l.dispose(),s.objects.delete(l.key)})},i.update=function(e,s){this.objects.forEach(function(u){u.update(e,s)})},i.setSize=function(e,s){this.objects.forEach(function(u){u.resize(e,s)})},i.dispose=function(){this.objects.forEach(function(e,s){e.dispose(),e.pm.reject("stop draw:".concat(s))}),this.objects.clear(),this.objectNamesToFactories.clear()},d(n,[{key:"objectsPromise",get:function(){var e=[];return this.objects.forEach(function(s){e.push(s.pm.promise)}),e}}]),n}(),k=function(){"use strict";function n(){b(this,n),this.data={}}var i=n.prototype;return i.install=function(){},i.setData=function(e,s){var u,l;this.data[e]=s,(l=(u=this).cb)===null||l===void 0||l.call(u,e)},i.runAll=function(){var e=this;Object.keys(this.data).forEach(function(s){var u,l;(l=(u=e).cb)===null||l===void 0||l.call(u,s)})},i.dispose=function(){this.data={},this.cb=void 0},n}(),L=function(){"use strict";function n(){b(this,n),this.messageList=[]}var i=n.prototype;return i.install=function(){},i.init=function(e,s){var u=this;this.workerList=Array.from({length:s},function(l,w){var y=typeof e=="string"?new Worker(e):e();return y.onmessage=function(v){var M=v.data,Z=M.res,z=M.uuid,r=u.messageList.find(function(t){var o=t.uuid;return z===o});r==null||r.cb(Z),u.workerList[w].inUse=!1,u.checkMessage()},{worker:y,inUse:!1}})},i.postMessage=function(e,s){this.messageList.push({req:e,cb:s,uuid:x.MathUtils.generateUUID(),inUse:!1}),this.checkMessage()},i.checkMessage=function(){var e=this.workerList.find(function(u){var l=u.inUse;return!l});if(e){var s=this.messageList.find(function(u){var l=u.inUse;return!l});s&&(s.inUse=!0,e.inUse=!0,e.worker.postMessage({req:s.req,uuid:s.uuid}))}},i.dispose=function(){this.workerList.forEach(function(e){var s=e.worker;s.terminate()}),this.workerList=[],this.messageList=[]},n}()})();var q=K.Ct,tt=K.Vw,et=K.hG,rt=K.Wk;export{q as Cache,tt as Data,et as Draw,rt as Wk};
1
+ import*as X from"idb-keyval";import*as J from"three";var Q={666:function(b){var g=function(f){"use strict";var T=Object.prototype,m=T.hasOwnProperty,d,j=typeof Symbol=="function"?Symbol:{},_=j.iterator||"@@iterator",O=j.asyncIterator||"@@asyncIterator",p=j.toStringTag||"@@toStringTag";function E(r,t,o){return Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{E({},"")}catch(r){E=function(t,o,c){return t[o]=c}}function S(r,t,o,c){var h=t&&t.prototype instanceof V?t:V,x=Object.create(h.prototype),U=new P(c||[]);return x._invoke=l(r,o,U),x}f.wrap=S;function C(r,t,o){try{return{type:"normal",arg:r.call(t,o)}}catch(c){return{type:"throw",arg:c}}}var A="suspendedStart",H="suspendedYield",W="executing",R="completed",M={};function V(){}function k(){}function L(){}var n={};E(n,_,function(){return this});var i=Object.getPrototypeOf,a=i&&i(i(Z([])));a&&a!==T&&m.call(a,_)&&(n=a);var e=L.prototype=V.prototype=Object.create(n);k.prototype=L,E(e,"constructor",L),E(L,"constructor",k),k.displayName=E(L,p,"GeneratorFunction");function s(r){["next","throw","return"].forEach(function(t){E(r,t,function(o){return this._invoke(t,o)})})}f.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===k||(t.displayName||t.name)==="GeneratorFunction":!1},f.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,L):(r.__proto__=L,E(r,p,"GeneratorFunction")),r.prototype=Object.create(e),r},f.awrap=function(r){return{__await:r}};function u(r,t){function o(x,U,G,N){var D=C(r[x],r,U);if(D.type==="throw")N(D.arg);else{var $=D.arg,F=$.value;return F&&typeof F=="object"&&m.call(F,"__await")?t.resolve(F.__await).then(function(B){o("next",B,G,N)},function(B){o("throw",B,G,N)}):t.resolve(F).then(function(B){$.value=B,G($)},function(B){return o("throw",B,G,N)})}}var c;function h(x,U){function G(){return new t(function(N,D){o(x,U,N,D)})}return c=c?c.then(G,G):G()}this._invoke=h}s(u.prototype),E(u.prototype,O,function(){return this}),f.AsyncIterator=u,f.async=function(r,t,o,c,h){h===void 0&&(h=Promise);var x=new u(S(r,t,o,c),h);return f.isGeneratorFunction(t)?x:x.next().then(function(U){return U.done?U.value:x.next()})};function l(r,t,o){var c=A;return function(x,U){if(c===W)throw new Error("Generator is already running");if(c===R){if(x==="throw")throw U;return z()}for(o.method=x,o.arg=U;;){var G=o.delegate;if(G){var N=w(G,o);if(N){if(N===M)continue;return N}}if(o.method==="next")o.sent=o._sent=o.arg;else if(o.method==="throw"){if(c===A)throw c=R,o.arg;o.dispatchException(o.arg)}else o.method==="return"&&o.abrupt("return",o.arg);c=W;var D=C(r,t,o);if(D.type==="normal"){if(c=o.done?R:H,D.arg===M)continue;return{value:D.arg,done:o.done}}else D.type==="throw"&&(c=R,o.method="throw",o.arg=D.arg)}}}function w(r,t){var o=r.iterator[t.method];if(o===d){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=d,w(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 c=C(o,r.iterator,t.arg);if(c.type==="throw")return t.method="throw",t.arg=c.arg,t.delegate=null,M;var h=c.arg;if(!h)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,M;if(h.done)t[r.resultName]=h.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=d);else return h;return t.delegate=null,M}s(e),E(e,p,"Generator"),E(e,_,function(){return this}),E(e,"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 v(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function P(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(y,this),this.reset(!0)}f.keys=function(r){var t=[];for(var o in r)t.push(o);return t.reverse(),function c(){for(;t.length;){var h=t.pop();if(h in r)return c.value=h,c.done=!1,c}return c.done=!0,c}};function Z(r){if(r){var t=r[_];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var o=-1,c=function h(){for(;++o<r.length;)if(m.call(r,o))return h.value=r[o],h.done=!1,h;return h.value=d,h.done=!0,h};return c.next=c}}return{next:z}}f.values=Z;function z(){return{value:d,done:!0}}return P.prototype={constructor:P,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(v),!r)for(var t in this)t.charAt(0)==="t"&&m.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},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 o(N,D){return x.type="throw",x.arg=r,t.next=N,D&&(t.method="next",t.arg=d),!!D}for(var c=this.tryEntries.length-1;c>=0;--c){var h=this.tryEntries[c],x=h.completion;if(h.tryLoc==="root")return o("end");if(h.tryLoc<=this.prev){var U=m.call(h,"catchLoc"),G=m.call(h,"finallyLoc");if(U&&G){if(this.prev<h.catchLoc)return o(h.catchLoc,!0);if(this.prev<h.finallyLoc)return o(h.finallyLoc)}else if(U){if(this.prev<h.catchLoc)return o(h.catchLoc,!0)}else if(G){if(this.prev<h.finallyLoc)return o(h.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var o=this.tryEntries.length-1;o>=0;--o){var c=this.tryEntries[o];if(c.tryLoc<=this.prev&&m.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var h=c;break}}h&&(r==="break"||r==="continue")&&h.tryLoc<=t&&t<=h.finallyLoc&&(h=null);var x=h?h.completion:{};return x.type=r,x.arg=t,h?(this.method="next",this.next=h.finallyLoc,M):this.complete(x)},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 o=this.tryEntries[t];if(o.finallyLoc===r)return this.complete(o.completion,o.afterLoc),v(o),M}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===r){var c=o.completion;if(c.type==="throw"){var h=c.arg;v(o)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,o){return this.delegate={iterator:Z(r),resultName:t,nextLoc:o},this.method==="next"&&(this.arg=d),M}},f}(b.exports);try{regeneratorRuntime=g}catch(f){typeof globalThis=="object"?globalThis.regeneratorRuntime=g:Function("r","regeneratorRuntime = r")(g)}},521:function(b,g,f){f.d(g,{Mf:function(){return T.Z}});var T=f(282),m=f(666),d=f.n(m),j=null,_=f(949);function O(k){if(k.material){var L=Array.isArray(k.material)?k.material:[k.material];L.forEach(function(n){var i,a;(i=n.color)===null||i===void 0||i.convertSRGBToLinear(),(a=n.emissive)===null||a===void 0||a.convertSRGBToLinear(),n.map&&(n.map.encoding=THREE.sRGBEncoding),n.emissiveMap&&(n.emissiveMap.encoding=THREE.sRGBEncoding)})}}var p=f(568),E=f(924),S=k=>{var L={};return f.d(L,k),L},C=k=>()=>k,A=S({get:()=>X.get,set:()=>X.set}),H=f(484),W=null,R=null,M=function(){var k=(0,p.Z)(d().mark(function L(n,i){var a,e,s,u,l,w;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return a=i.version,v.next=4,(0,A.get)(n);case 4:if(s=v.sent,!(s&&s[a])){v.next=9;break}e=s[a],v.next=15;break;case 9:return v.next=11,(0,H.Z)(fetch(n).then(function(P){if(P.ok)return P.blob();throw new Error}));case 11:u=v.sent,l=u.res,w=u.err,w||(e=l,(0,A.set)(n,(0,E.Z)({},a,l)));case 15:return v.abrupt("return",e?{url:URL.createObjectURL(e)}:{url:n});case 16:case"end":return v.stop()}},L)}));return function(n,i){return k.apply(this,arguments)}}(),V=f(705)},282:function(b,g,f){f.d(g,{Z:function(){return m}});var T=f(484);function m(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_={};return _.promise=new Promise(function(O,p){_.resolve=O,_.reject=p}),d&&(_.promise=(0,T.Z)(_.promise,j)),_}},484:function(b,g,f){f.d(g,{Z:function(){return m}});var T=f(42);function m(d){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return d.then(function(_){return(0,T.Z)({err:null,res:_},j)}).catch(function(_){return(0,T.Z)({err:_,res:void 0},j)})}},705:function(b,g,f){var T=f(949),m=new Map,d=function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(O,p,E,S,C){var A=p[E*3],H=p[E*3+1],W=p[S*3],R=p[S*3+1],M=p[C*3],V=p[C*3+1],k;if(m.has(O))k=m.get(O);else{var L=_.box3||new THREE.Box3;if(!_.box3){var n=O.parameters.shapes.getPoints();L.setFromArray(n.map(function(u){return[u.x,u.y,0]}).flat())}var i=L.getSize(new THREE.Vector3);_.split&&(i.y/=_.split),k={box:L,size:i},m.set(O,k)}var a=k.box,e=k.size,s=_.split?1-_.split:0;return[new THREE.Vector2((A-a.min.x)/e.x,(H-a.min.y)/e.y+s),new THREE.Vector2((W-a.min.x)/e.x,(R-a.min.y)/e.y+s),new THREE.Vector2((M-a.min.x)/e.x,(V-a.min.y)/e.y+s)]},generateSideWallUV:function(O,p,E,S,C,A){var H=p[E*3],W=p[E*3+1],R=p[E*3+2],M=p[S*3],V=p[S*3+1],k=p[S*3+2],L=p[C*3],n=p[C*3+1],i=p[C*3+2],a=p[A*3],e=p[A*3+1],s=p[A*3+2],u;if(m.has(p))u=m.get(p);else{var l=new THREE.Box3;l.setFromArray(p);var w=l.getSize(new THREE.Vector3);_.split&&(w.z/=1-_.split),u={box:l,size:w},m.set(p,u)}var y=u.box,v=u.size;return Math.abs(W-V)<Math.abs(H-M)?[new THREE.Vector2((H-y.min.x)/v.x,(R-y.min.z)/v.z),new THREE.Vector2((M-y.min.x)/v.x,(k-y.min.z)/v.z),new THREE.Vector2((L-y.min.x)/v.x,(i-y.min.z)/v.z),new THREE.Vector2((a-y.min.x)/v.x,(s-y.min.z)/v.z)]:[new THREE.Vector2((W-y.min.y)/v.y,(R-y.min.z)/v.z),new THREE.Vector2((V-y.min.y)/v.y,(k-y.min.z)/v.z),new THREE.Vector2((n-y.min.y)/v.y,(i-y.min.z)/v.z),new THREE.Vector2((e-y.min.y)/v.y,(s-y.min.z)/v.z)]}}},j=function(){m.clear()}},949:function(b,g,f){var T=d=>{var j={};return f.d(j,d),j},m=d=>()=>d;b.exports=T({MathUtils:()=>J.MathUtils})},568:function(b,g,f){f.d(g,{Z:function(){return m}});function T(d,j,_,O,p,E,S){try{var C=d[E](S),A=C.value}catch(H){_(H);return}C.done?j(A):Promise.resolve(A).then(O,p)}function m(d){return function(){var j=this,_=arguments;return new Promise(function(O,p){var E=d.apply(j,_);function S(A){T(E,O,p,S,C,"next",A)}function C(A){T(E,O,p,S,C,"throw",A)}S(void 0)})}}},924:function(b,g,f){f.d(g,{Z:function(){return T}});function T(m,d,j){return d in m?Object.defineProperty(m,d,{value:j,enumerable:!0,configurable:!0,writable:!0}):m[d]=j,m}},42:function(b,g,f){f.d(g,{Z:function(){return m}});var T=f(924);function m(d){for(var j=1;j<arguments.length;j++){var _=arguments[j]!=null?arguments[j]:{},O=Object.keys(_);typeof Object.getOwnPropertySymbols=="function"&&(O=O.concat(Object.getOwnPropertySymbols(_).filter(function(p){return Object.getOwnPropertyDescriptor(_,p).enumerable}))),O.forEach(function(p){(0,T.Z)(d,p,_[p])})}return d}}},Y={};function I(b){var g=Y[b];if(g!==void 0)return g.exports;var f=Y[b]={exports:{}};return Q[b](f,f.exports,I),f.exports}(function(){I.n=function(b){var g=b&&b.__esModule?function(){return b.default}:function(){return b};return I.d(g,{a:g}),g}})(),function(){I.d=function(b,g){for(var f in g)I.o(g,f)&&!I.o(b,f)&&Object.defineProperty(b,f,{enumerable:!0,get:g[f]})}}(),function(){I.o=function(b,g){return Object.prototype.hasOwnProperty.call(b,g)}}();var K={};(function(){I.d(K,{Ct:function(){return f},Vw:function(){return k},hG:function(){return V},Wk:function(){return L}});function b(n,i){if(!(n instanceof i))throw new TypeError("Cannot call a class as a function")}var g=I(521),f=function(){"use strict";function n(){b(this,n),this.cache=new Map}var i=n.prototype;return i.install=function(){},i.init=function(e){var s=(0,g.Mf)();this.cache.set(e,s)},i.get=function(e){var s;return(s=this.cache.get(e))===null||s===void 0?void 0:s.promise},i.set=function(e,s){var u=this.cache.get(e);u?u.resolve(s):console.warn("init cache first")},i.dispose=function(){this.cache.forEach(function(e,s){e.reject("stop set cache:".concat(s))}),this.cache.clear()},n}(),T=I(568);function m(n,i){for(var a=0;a<i.length;a++){var e=i[a];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function d(n,i,a){return i&&m(n.prototype,i),a&&m(n,a),n}function j(n){if(Array.isArray(n))return n}function _(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(n,i){(i==null||i>n.length)&&(i=n.length);for(var a=0,e=new Array(i);a<i;a++)e[a]=n[a];return e}function E(n,i){if(!!n){if(typeof n=="string")return p(n,i);var a=Object.prototype.toString.call(n).slice(8,-1);if(a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return p(n,i)}}function S(n,i){return j(n)||_(n,i)||E(n,i)||O()}function C(n){if(Array.isArray(n))return p(n)}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(n){return C(n)||_(n)||E(n)||A()}var W=I(666),R=I.n(W),M=I(949),V=function(){"use strict";function n(a){b(this,n),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=a}var i=n.prototype;return i.install=function(e){this.pencil=e,this.initObjectFactories()},i.initObjectFactories=function(){var e=this,s=this.objects_;Object.keys(s).forEach(function(u){var l=function(){function w(){b(this,w)}var y=w.prototype;return y.create=function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new s[u](P)},w}();e.objectNamesToFactories.set(u,l)})},i.getObject=function(e,s){e.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",e);var u=(s||{}).key,l="".concat(e).concat(u?"#".concat(u):""),w=this.objects.get(l);return w},i.getAllObject=function(e,s){e.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",e);var u=(s||{}).key,l="".concat(e).concat(u?"#".concat(u):""),w=[];return this.objects.forEach(function(y,v){(v.startsWith("".concat(l,"#"))||v===l)&&w.push(y)}),w},i.draw=function(e,s,u){var l=this;return(0,T.Z)(R().mark(function w(){var y,v,P,Z,z,r,t;return R().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(y=l.objectNamesToFactories.get(e),!y){c.next=15;break}return v=(s||{}).key,P="".concat(e).concat(v?"#".concat(v):""),l.objects.has(P)&&(Z=M.MathUtils.generateUUID(),P+="#".concat(Z)),z=(s==null?void 0:s.target)||u,typeof z=="string"?r=l.objects.get(z):(z==null?void 0:z.objecttype__)==="BaseObject"?r=z:r=l.pencil.scene,t=new y().create(s),t.pencil=l.pencil,t.key=P,l.objects.set(P,t),c.next=14,l.addMesh(t,r);case 14:return c.abrupt("return",t);case 15:throw new Error("Unrecognized:".concat(e));case 16:case"end":return c.stop()}},w)}))()},i.addMesh=function(e,s){return(0,T.Z)(R().mark(function u(){return R().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,e.create();case 2:e.object3d&&(e.object3d.userData.BaseObject_=e,s.add(e.object3d)),e.visible=!0,e.render(),e.pm.resolve();case 6:case"end":return w.stop()}},u)}))()},i.erase=function(){for(var e=arguments.length,s=new Array(e),u=0;u<e;u++)s[u]=arguments[u];var l=this;H(s).forEach(function(w){var y=[];if(typeof w=="string"){var v,P=S(w.split("#"),2),Z=P[0],z=P[1];(v=y).push.apply(v,H(l.getAllObject(Z,{key:z})))}else y.push(w);y.forEach(function(r){l.removeMesh(r)})})},i.removeMesh=function(e){var s=this,u=e.parent;e.object3d&&u.remove(e.object3d),e.traverse(function(l){l.visible=!1,l.dispose(),s.objects.delete(l.key)})},i.update=function(e,s){this.objects.forEach(function(u){u.update(e,s)})},i.setSize=function(e,s){this.objects.forEach(function(u){u.resize(e,s)})},i.dispose=function(){this.objects.forEach(function(e,s){e.dispose(),e.pm.reject("stop draw:".concat(s))}),this.objects.clear(),this.objectNamesToFactories.clear()},d(n,[{key:"objectsPromise",get:function(){var e=[];return this.objects.forEach(function(s){e.push(s.pm.promise)}),e}}]),n}(),k=function(){"use strict";function n(){b(this,n),this.data={}}var i=n.prototype;return i.install=function(){},i.setData=function(e,s){var u,l;this.data[e]=s,(l=(u=this).cb)===null||l===void 0||l.call(u,e)},i.runAll=function(){var e=this;Object.keys(this.data).forEach(function(s){var u,l;(l=(u=e).cb)===null||l===void 0||l.call(u,s)})},i.dispose=function(){this.data={},this.cb=void 0},n}(),L=function(){"use strict";function n(){b(this,n),this.messageList=[]}var i=n.prototype;return i.install=function(){},i.init=function(e,s){var u=this;this.workerList=Array.from({length:s},function(l,w){var y=typeof e=="string"?new Worker(e):e();return y.onmessage=function(v){var P=v.data,Z=P.res,z=P.uuid,r=u.messageList.find(function(t){var o=t.uuid;return z===o});r==null||r.cb(Z),u.workerList[w].inUse=!1,u.checkMessage()},{worker:y,inUse:!1}})},i.postMessage=function(e,s){this.messageList.push({req:e,cb:s,uuid:M.MathUtils.generateUUID(),inUse:!1}),this.checkMessage()},i.checkMessage=function(){var e=this.workerList.find(function(u){var l=u.inUse;return!l});if(e){var s=this.messageList.find(function(u){var l=u.inUse;return!l});s&&(s.inUse=!0,e.inUse=!0,e.worker.postMessage({req:s.req,uuid:s.uuid}))}},i.dispose=function(){this.workerList.forEach(function(e){var s=e.worker;s.terminate()}),this.workerList=[],this.messageList=[]},n}()})();var q=K.Ct,tt=K.Vw,et=K.hG,rt=K.Wk;export{q as Cache,tt as Data,et as Draw,rt as Wk};
@@ -1 +1 @@
1
- (function(){var H={666:function(v){var c=function(i){"use strict";var u=Object.prototype,f=u.hasOwnProperty,e,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",s=n.asyncIterator||"@@asyncIterator",m=n.toStringTag||"@@toStringTag";function l(r,t,a){return Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{l({},"")}catch(r){l=function(t,a,_){return t[a]=_}}function g(r,t,a,_){var h=t&&t.prototype instanceof G?t:G,A=Object.create(h.prototype),I=new M(_||[]);return A._invoke=P(r,a,I),A}i.wrap=g;function E(r,t,a){try{return{type:"normal",arg:r.call(t,a)}}catch(_){return{type:"throw",arg:_}}}var O="suspendedStart",j="suspendedYield",R="executing",Z="completed",T={};function G(){}function D(){}function C(){}var W={};l(W,o,function(){return this});var S=Object.getPrototypeOf,k=S&&S(S($([])));k&&k!==u&&f.call(k,o)&&(W=k);var d=C.prototype=G.prototype=Object.create(W);D.prototype=C,l(d,"constructor",C),l(C,"constructor",D),D.displayName=l(C,m,"GeneratorFunction");function p(r){["next","throw","return"].forEach(function(t){l(r,t,function(a){return this._invoke(t,a)})})}i.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===D||(t.displayName||t.name)==="GeneratorFunction":!1},i.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,C):(r.__proto__=C,l(r,m,"GeneratorFunction")),r.prototype=Object.create(d),r},i.awrap=function(r){return{__await:r}};function y(r,t){function a(A,I,U,x){var V=E(r[A],r,I);if(V.type==="throw")x(V.arg);else{var Y=V.arg,K=Y.value;return K&&typeof K=="object"&&f.call(K,"__await")?t.resolve(K.__await).then(function(N){a("next",N,U,x)},function(N){a("throw",N,U,x)}):t.resolve(K).then(function(N){Y.value=N,U(Y)},function(N){return a("throw",N,U,x)})}}var _;function h(A,I){function U(){return new t(function(x,V){a(A,I,x,V)})}return _=_?_.then(U,U):U()}this._invoke=h}p(y.prototype),l(y.prototype,s,function(){return this}),i.AsyncIterator=y,i.async=function(r,t,a,_,h){h===void 0&&(h=Promise);var A=new y(g(r,t,a,_),h);return i.isGeneratorFunction(t)?A:A.next().then(function(I){return I.done?I.value:A.next()})};function P(r,t,a){var _=O;return function(A,I){if(_===R)throw new Error("Generator is already running");if(_===Z){if(A==="throw")throw I;return B()}for(a.method=A,a.arg=I;;){var U=a.delegate;if(U){var x=z(U,a);if(x){if(x===T)continue;return x}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(_===O)throw _=Z,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);_=R;var V=E(r,t,a);if(V.type==="normal"){if(_=a.done?Z:j,V.arg===T)continue;return{value:V.arg,done:a.done}}else V.type==="throw"&&(_=Z,a.method="throw",a.arg=V.arg)}}}function z(r,t){var a=r.iterator[t.method];if(a===e){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=e,z(r,t),t.method==="throw"))return T;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var _=E(a,r.iterator,t.arg);if(_.type==="throw")return t.method="throw",t.arg=_.arg,t.delegate=null,T;var h=_.arg;if(!h)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,T;if(h.done)t[r.resultName]=h.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=e);else return h;return t.delegate=null,T}p(d),l(d,m,"Generator"),l(d,o,function(){return this}),l(d,"toString",function(){return"[object Generator]"});function L(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 w(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function M(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(L,this),this.reset(!0)}i.keys=function(r){var t=[];for(var a in r)t.push(a);return t.reverse(),function _(){for(;t.length;){var h=t.pop();if(h in r)return _.value=h,_.done=!1,_}return _.done=!0,_}};function $(r){if(r){var t=r[o];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var a=-1,_=function h(){for(;++a<r.length;)if(f.call(r,a))return h.value=r[a],h.done=!1,h;return h.value=e,h.done=!0,h};return _.next=_}}return{next:B}}i.values=$;function B(){return{value:e,done:!0}}return M.prototype={constructor:M,reset:function(r){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(w),!r)for(var t in this)t.charAt(0)==="t"&&f.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},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 a(x,V){return A.type="throw",A.arg=r,t.next=x,V&&(t.method="next",t.arg=e),!!V}for(var _=this.tryEntries.length-1;_>=0;--_){var h=this.tryEntries[_],A=h.completion;if(h.tryLoc==="root")return a("end");if(h.tryLoc<=this.prev){var I=f.call(h,"catchLoc"),U=f.call(h,"finallyLoc");if(I&&U){if(this.prev<h.catchLoc)return a(h.catchLoc,!0);if(this.prev<h.finallyLoc)return a(h.finallyLoc)}else if(I){if(this.prev<h.catchLoc)return a(h.catchLoc,!0)}else if(U){if(this.prev<h.finallyLoc)return a(h.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var a=this.tryEntries.length-1;a>=0;--a){var _=this.tryEntries[a];if(_.tryLoc<=this.prev&&f.call(_,"finallyLoc")&&this.prev<_.finallyLoc){var h=_;break}}h&&(r==="break"||r==="continue")&&h.tryLoc<=t&&t<=h.finallyLoc&&(h=null);var A=h?h.completion:{};return A.type=r,A.arg=t,h?(this.method="next",this.next=h.finallyLoc,T):this.complete(A)},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),T},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===r)return this.complete(a.completion,a.afterLoc),w(a),T}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===r){var _=a.completion;if(_.type==="throw"){var h=_.arg;w(a)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,a){return this.delegate={iterator:$(r),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=e),T}},i}(v.exports);try{regeneratorRuntime=c}catch(i){typeof globalThis=="object"?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},695:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f){if(f.geometry&&f.geometry.dispose(),f.material){var e=Array.isArray(f.material)?f.material:[f.material];e.forEach(function(n){var o,s,m,l,g,E,O,j,R,Z,T,G,D;(o=n.map)===null||o===void 0||o.dispose(),(s=n.lightMap)===null||s===void 0||s.dispose(),(m=n.bumpMap)===null||m===void 0||m.dispose(),(l=n.normalMap)===null||l===void 0||l.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(),(j=n.aoMap)===null||j===void 0||j.dispose(),(R=n.displacementMap)===null||R===void 0||R.dispose(),(Z=n.emissiveMap)===null||Z===void 0||Z.dispose(),(T=n.gradientMap)===null||T===void 0||T.dispose(),(G=n.metalnessMap)===null||G===void 0||G.dispose(),(D=n.roughnessMap)===null||D===void 0||D.dispose(),n.dispose()})}}},490:function(v,c,i){"use strict";i.d(c,{U:function(){return f},v:function(){return u}});var u=function(e){for(var n=e.offsetLeft,o=e.offsetParent;o!==null;)n+=o.offsetLeft,o=o.offsetParent;var s;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?s=document.body.scrollLeft:s=document.documentElement.scrollLeft,n-s},f=function(e){for(var n=e.offsetTop,o=e.offsetParent;o!==null;)n+=o.offsetTop,o=o.offsetParent;var s;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?s=document.body.scrollTop:s=document.documentElement.scrollTop,n-s}},738:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});function u(e){return Object.prototype.toString.call(e)==="[object Object]"}function f(e){if(u(e)===!1)return!1;var n=e.constructor;if(n===void 0)return!0;var o=n.prototype;return!(u(o)===!1||o.hasOwnProperty("isPrototypeOf")===!1)}},282:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(484);function f(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o={};return o.promise=new Promise(function(s,m){o.resolve=s,o.reject=m}),e&&(o.promise=(0,u.Z)(o.promise,n)),o}},713:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=(90-e)*Math.PI/180,s=(90-f)*Math.PI/180;return[n*Math.sin(o)*Math.cos(s),n*Math.cos(o),n*Math.sin(o)*Math.sin(s)]}},618:function(v,c,i){"use strict";i.d(c,{Z:function(){return e}});var u=i(438),f=function(){"use strict";function n(s){(0,u.Z)(this,n),this.onTick_=s,this.cancelPending_=null}var o=n.prototype;return o.tickAfter=function(m){var l=this;this.stop();var g=!0,E;this.cancelPending_=function(){clearTimeout(E),g=!1};var O=function(){g&&l.onTick_()};return E=window.setTimeout(O,m),this},o.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},n}(),e=function(){"use strict";function n(s){(0,u.Z)(this,n),this.onTick_=s,this.ticker_=null}var o=n.prototype;return o.tickNow=function(){return this.stop(),this.onTick_(),this},o.tickAfter=function(m){var l=this;return this.stop(),this.ticker_=new f(function(){l.onTick_()}).tickAfter(m),this},o.tickEvery=function(m){var l=this;return this.stop(),this.ticker_=new f(function(){var g;(g=l.ticker_)===null||g===void 0||g.tickAfter(m),l.onTick_()}).tickAfter(m),this},o.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},n}()},484:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(42);function f(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.then(function(o){return(0,u.Z)({err:null,res:o},n)}).catch(function(o){return(0,u.Z)({err:o,res:void 0},n)})}},705:function(v,c,i){"use strict";i.d(c,{C:function(){return o},y:function(){return n}});var u=i(644),f=i.n(u),e=new Map,n=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(m,l,g,E,O){var j=l[g*3],R=l[g*3+1],Z=l[E*3],T=l[E*3+1],G=l[O*3],D=l[O*3+1],C;if(e.has(m))C=e.get(m);else{var W=s.box3||new u.Box3;if(!s.box3){var S=m.parameters.shapes.getPoints();W.setFromArray(S.map(function(P){return[P.x,P.y,0]}).flat())}var k=W.getSize(new u.Vector3);s.split&&(k.y/=s.split),C={box:W,size:k},e.set(m,C)}var d=C.box,p=C.size,y=s.split?1-s.split:0;return[new u.Vector2((j-d.min.x)/p.x,(R-d.min.y)/p.y+y),new u.Vector2((Z-d.min.x)/p.x,(T-d.min.y)/p.y+y),new u.Vector2((G-d.min.x)/p.x,(D-d.min.y)/p.y+y)]},generateSideWallUV:function(m,l,g,E,O,j){var R=l[g*3],Z=l[g*3+1],T=l[g*3+2],G=l[E*3],D=l[E*3+1],C=l[E*3+2],W=l[O*3],S=l[O*3+1],k=l[O*3+2],d=l[j*3],p=l[j*3+1],y=l[j*3+2],P;if(e.has(l))P=e.get(l);else{var z=new u.Box3;z.setFromArray(l);var L=z.getSize(new u.Vector3);s.split&&(L.z/=1-s.split),P={box:z,size:L},e.set(l,P)}var w=P.box,M=P.size;return Math.abs(Z-D)<Math.abs(R-G)?[new u.Vector2((R-w.min.x)/M.x,(T-w.min.z)/M.z),new u.Vector2((G-w.min.x)/M.x,(C-w.min.z)/M.z),new u.Vector2((W-w.min.x)/M.x,(k-w.min.z)/M.z),new u.Vector2((d-w.min.x)/M.x,(y-w.min.z)/M.z)]:[new u.Vector2((Z-w.min.y)/M.x,(T-w.min.z)/M.z),new u.Vector2((D-w.min.y)/M.x,(C-w.min.z)/M.z),new u.Vector2((S-w.min.y)/M.x,(k-w.min.z)/M.z),new u.Vector2((p-w.min.y)/M.x,(y-w.min.z)/M.z)]}}},o=function(){e.clear()}},644:function(v){"use strict";v.exports=require("three")},943:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e){(e==null||e>f.length)&&(e=f.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=f[n];return o}},982:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(943);function f(e){if(Array.isArray(e))return(0,u.Z)(e)}},568:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});function u(e,n,o,s,m,l,g){try{var E=e[l](g),O=E.value}catch(j){o(j);return}E.done?n(O):Promise.resolve(O).then(s,m)}function f(e){return function(){var n=this,o=arguments;return new Promise(function(s,m){var l=e.apply(n,o);function g(O){u(l,s,m,g,E,"next",O)}function E(O){u(l,s,m,g,E,"throw",O)}g(void 0)})}}},438:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e){if(!(f instanceof e))throw new TypeError("Cannot call a class as a function")}},924:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e,n){return e in f?Object.defineProperty(f,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):f[e]=n,f}},375:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f){if(typeof Symbol!="undefined"&&f[Symbol.iterator]!=null||f["@@iterator"]!=null)return Array.from(f)}},270:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(){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,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(924);function f(e){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{},s=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(o).filter(function(m){return Object.getOwnPropertyDescriptor(o,m).enumerable}))),s.forEach(function(m){(0,u.Z)(e,m,o[m])})}return e}},342:function(v,c,i){"use strict";i.d(c,{Z:function(){return o}});var u=i(982),f=i(375),e=i(270),n=i(566);function o(s){return(0,u.Z)(s)||(0,f.Z)(s)||(0,n.Z)(s)||(0,e.Z)()}},566:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(943);function f(e,n){if(!!e){if(typeof e=="string")return(0,u.Z)(e,n);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return(0,u.Z)(e,n)}}}},X={};function b(v){var c=X[v];if(c!==void 0)return c.exports;var i=X[v]={exports:{}};return H[v](i,i.exports,b),i.exports}(function(){b.n=function(v){var c=v&&v.__esModule?function(){return v.default}:function(){return v};return b.d(c,{a:c}),c}})(),function(){b.d=function(v,c){for(var i in c)b.o(c,i)&&!b.o(v,i)&&Object.defineProperty(v,i,{enumerable:!0,get:c[i]})}}(),function(){b.o=function(v,c){return Object.prototype.hasOwnProperty.call(v,c)}}(),function(){b.r=function(v){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(v,"__esModule",{value:!0})}}();var F={};(function(){"use strict";b.r(F),b.d(F,{Chain:function(){return m},Timer:function(){return i.Z},claerUVGenerator:function(){return W.C},clearAllCache:function(){return G},clearCache:function(){return T},colorCorrection:function(){return O},disposeMesh:function(){return g.Z},getCache:function(){return D},getElementViewLeft:function(){return C.v},getElementViewTop:function(){return C.U},getUVGenerator:function(){return W.y},isPlainObject:function(){return j.Z},makePromiseCreator:function(){return v.Z},polar2Cartesian:function(){return l.Z},to:function(){return c.Z}});var v=b(282),c=b(484),i=b(618),u=b(568),f=b(438),e=b(42),n=b(342),o=b(666),s=b.n(o),m=function(){"use strict";function S(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,f.Z)(this,S),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,e.Z)({},{isdev:!1},d)}var k=S.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(p){return p.stop1()}),this},k.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},k.play=function(){var p=this;return(0,u.Z)(s().mark(function y(){var P;return s().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(P=p.chainedList[p.index],!(P&&p.isPlaying)){L.next=9;break}return L.next=4,Promise.all(P.map(function(w){return typeof w=="function"?w(p.repeatCount):w.start()}));case 4:return p.index+=1,L.next=7,p.play();case 7:L.next=17;break;case 9:if(!(!P&&p.isPlaying&&p.repeatCount<p.repeatNum)){L.next=16;break}return p.repeatCount+=1,p.index=0,L.next=14,p.play();case 14:L.next=17;break;case 16:!P&&p.isPlaying&&p.repeatCount===p.repeatNum&&p.stop();case 17:case"end":return L.stop()}},y)}))()},k.chain=function(){for(var p=arguments.length,y=new Array(p),P=0;P<p;P++)y[P]=arguments[P];var z=this;return(0,n.Z)(y).forEach(function(L){L instanceof S&&z.children.push(L)}),this.chainedList.push((0,n.Z)(y)),this},k.repeat=function(p){return this.repeatNum=p,this},k.timeout=function(p){return this.chain(function(){return new Promise(function(y){return setTimeout(y,p)})}),this},k.traverse=function(p){p(this),this.children.forEach(function(y){y.traverse(p)})},S}(),l=b(713),g=b(695),E=b(644);function O(S){if(S.material){var k=Array.isArray(S.material)?S.material:[S.material];k.forEach(function(d){var p,y;(p=d.color)===null||p===void 0||p.convertSRGBToLinear(),(y=d.emissive)===null||y===void 0||y.convertSRGBToLinear(),d.map&&(d.map.encoding=E.sRGBEncoding),d.emissiveMap&&(d.emissiveMap.encoding=E.sRGBEncoding)})}}var j=b(738),R=b(924),Z=require("idb-keyval"),T=Z.del,G=Z.clear,D=function(){var S=(0,u.Z)(s().mark(function k(d,p){var y,P,z,L,w,M;return s().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return y=p.version,B.next=4,(0,Z.get)(d);case 4:if(z=B.sent,!(z&&z[y])){B.next=9;break}P=z[y],B.next=15;break;case 9:return B.next=11,(0,c.Z)(fetch(d).then(function(r){if(r.ok)return r.blob();throw new Error}));case 11:L=B.sent,w=L.res,M=L.err,M||(P=w,(0,Z.set)(d,(0,R.Z)({},y,w)));case 15:return B.abrupt("return",P?{url:URL.createObjectURL(P)}:{url:d});case 16:case"end":return B.stop()}},k)}));return function(d,p){return S.apply(this,arguments)}}(),C=b(490),W=b(705)})(),module.exports=F})();
1
+ (function(){var H={666:function(v){var c=function(i){"use strict";var u=Object.prototype,f=u.hasOwnProperty,e,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",s=n.asyncIterator||"@@asyncIterator",m=n.toStringTag||"@@toStringTag";function l(r,t,a){return Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{l({},"")}catch(r){l=function(t,a,_){return t[a]=_}}function g(r,t,a,_){var h=t&&t.prototype instanceof G?t:G,A=Object.create(h.prototype),I=new M(_||[]);return A._invoke=P(r,a,I),A}i.wrap=g;function E(r,t,a){try{return{type:"normal",arg:r.call(t,a)}}catch(_){return{type:"throw",arg:_}}}var O="suspendedStart",j="suspendedYield",R="executing",Z="completed",T={};function G(){}function D(){}function C(){}var W={};l(W,o,function(){return this});var S=Object.getPrototypeOf,k=S&&S(S($([])));k&&k!==u&&f.call(k,o)&&(W=k);var d=C.prototype=G.prototype=Object.create(W);D.prototype=C,l(d,"constructor",C),l(C,"constructor",D),D.displayName=l(C,m,"GeneratorFunction");function p(r){["next","throw","return"].forEach(function(t){l(r,t,function(a){return this._invoke(t,a)})})}i.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===D||(t.displayName||t.name)==="GeneratorFunction":!1},i.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,C):(r.__proto__=C,l(r,m,"GeneratorFunction")),r.prototype=Object.create(d),r},i.awrap=function(r){return{__await:r}};function y(r,t){function a(A,I,U,N){var V=E(r[A],r,I);if(V.type==="throw")N(V.arg);else{var Y=V.arg,x=Y.value;return x&&typeof x=="object"&&f.call(x,"__await")?t.resolve(x.__await).then(function(K){a("next",K,U,N)},function(K){a("throw",K,U,N)}):t.resolve(x).then(function(K){Y.value=K,U(Y)},function(K){return a("throw",K,U,N)})}}var _;function h(A,I){function U(){return new t(function(N,V){a(A,I,N,V)})}return _=_?_.then(U,U):U()}this._invoke=h}p(y.prototype),l(y.prototype,s,function(){return this}),i.AsyncIterator=y,i.async=function(r,t,a,_,h){h===void 0&&(h=Promise);var A=new y(g(r,t,a,_),h);return i.isGeneratorFunction(t)?A:A.next().then(function(I){return I.done?I.value:A.next()})};function P(r,t,a){var _=O;return function(A,I){if(_===R)throw new Error("Generator is already running");if(_===Z){if(A==="throw")throw I;return B()}for(a.method=A,a.arg=I;;){var U=a.delegate;if(U){var N=z(U,a);if(N){if(N===T)continue;return N}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(_===O)throw _=Z,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);_=R;var V=E(r,t,a);if(V.type==="normal"){if(_=a.done?Z:j,V.arg===T)continue;return{value:V.arg,done:a.done}}else V.type==="throw"&&(_=Z,a.method="throw",a.arg=V.arg)}}}function z(r,t){var a=r.iterator[t.method];if(a===e){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=e,z(r,t),t.method==="throw"))return T;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var _=E(a,r.iterator,t.arg);if(_.type==="throw")return t.method="throw",t.arg=_.arg,t.delegate=null,T;var h=_.arg;if(!h)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,T;if(h.done)t[r.resultName]=h.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=e);else return h;return t.delegate=null,T}p(d),l(d,m,"Generator"),l(d,o,function(){return this}),l(d,"toString",function(){return"[object Generator]"});function L(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 w(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function M(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(L,this),this.reset(!0)}i.keys=function(r){var t=[];for(var a in r)t.push(a);return t.reverse(),function _(){for(;t.length;){var h=t.pop();if(h in r)return _.value=h,_.done=!1,_}return _.done=!0,_}};function $(r){if(r){var t=r[o];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var a=-1,_=function h(){for(;++a<r.length;)if(f.call(r,a))return h.value=r[a],h.done=!1,h;return h.value=e,h.done=!0,h};return _.next=_}}return{next:B}}i.values=$;function B(){return{value:e,done:!0}}return M.prototype={constructor:M,reset:function(r){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(w),!r)for(var t in this)t.charAt(0)==="t"&&f.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},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 a(N,V){return A.type="throw",A.arg=r,t.next=N,V&&(t.method="next",t.arg=e),!!V}for(var _=this.tryEntries.length-1;_>=0;--_){var h=this.tryEntries[_],A=h.completion;if(h.tryLoc==="root")return a("end");if(h.tryLoc<=this.prev){var I=f.call(h,"catchLoc"),U=f.call(h,"finallyLoc");if(I&&U){if(this.prev<h.catchLoc)return a(h.catchLoc,!0);if(this.prev<h.finallyLoc)return a(h.finallyLoc)}else if(I){if(this.prev<h.catchLoc)return a(h.catchLoc,!0)}else if(U){if(this.prev<h.finallyLoc)return a(h.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var a=this.tryEntries.length-1;a>=0;--a){var _=this.tryEntries[a];if(_.tryLoc<=this.prev&&f.call(_,"finallyLoc")&&this.prev<_.finallyLoc){var h=_;break}}h&&(r==="break"||r==="continue")&&h.tryLoc<=t&&t<=h.finallyLoc&&(h=null);var A=h?h.completion:{};return A.type=r,A.arg=t,h?(this.method="next",this.next=h.finallyLoc,T):this.complete(A)},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),T},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===r)return this.complete(a.completion,a.afterLoc),w(a),T}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===r){var _=a.completion;if(_.type==="throw"){var h=_.arg;w(a)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,a){return this.delegate={iterator:$(r),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=e),T}},i}(v.exports);try{regeneratorRuntime=c}catch(i){typeof globalThis=="object"?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},695:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f){if(f.geometry&&f.geometry.dispose(),f.material){var e=Array.isArray(f.material)?f.material:[f.material];e.forEach(function(n){var o,s,m,l,g,E,O,j,R,Z,T,G,D;(o=n.map)===null||o===void 0||o.dispose(),(s=n.lightMap)===null||s===void 0||s.dispose(),(m=n.bumpMap)===null||m===void 0||m.dispose(),(l=n.normalMap)===null||l===void 0||l.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(),(j=n.aoMap)===null||j===void 0||j.dispose(),(R=n.displacementMap)===null||R===void 0||R.dispose(),(Z=n.emissiveMap)===null||Z===void 0||Z.dispose(),(T=n.gradientMap)===null||T===void 0||T.dispose(),(G=n.metalnessMap)===null||G===void 0||G.dispose(),(D=n.roughnessMap)===null||D===void 0||D.dispose(),n.dispose()})}}},490:function(v,c,i){"use strict";i.d(c,{U:function(){return f},v:function(){return u}});var u=function(e){for(var n=e.offsetLeft,o=e.offsetParent;o!==null;)n+=o.offsetLeft,o=o.offsetParent;var s;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?s=document.body.scrollLeft:s=document.documentElement.scrollLeft,n-s},f=function(e){for(var n=e.offsetTop,o=e.offsetParent;o!==null;)n+=o.offsetTop,o=o.offsetParent;var s;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?s=document.body.scrollTop:s=document.documentElement.scrollTop,n-s}},738:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});function u(e){return Object.prototype.toString.call(e)==="[object Object]"}function f(e){if(u(e)===!1)return!1;var n=e.constructor;if(n===void 0)return!0;var o=n.prototype;return!(u(o)===!1||o.hasOwnProperty("isPrototypeOf")===!1)}},282:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(484);function f(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o={};return o.promise=new Promise(function(s,m){o.resolve=s,o.reject=m}),e&&(o.promise=(0,u.Z)(o.promise,n)),o}},713:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=(90-e)*Math.PI/180,s=(90-f)*Math.PI/180;return[n*Math.sin(o)*Math.cos(s),n*Math.cos(o),n*Math.sin(o)*Math.sin(s)]}},618:function(v,c,i){"use strict";i.d(c,{Z:function(){return e}});var u=i(438),f=function(){"use strict";function n(s){(0,u.Z)(this,n),this.onTick_=s,this.cancelPending_=null}var o=n.prototype;return o.tickAfter=function(m){var l=this;this.stop();var g=!0,E;this.cancelPending_=function(){clearTimeout(E),g=!1};var O=function(){g&&l.onTick_()};return E=window.setTimeout(O,m),this},o.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},n}(),e=function(){"use strict";function n(s){(0,u.Z)(this,n),this.onTick_=s,this.ticker_=null}var o=n.prototype;return o.tickNow=function(){return this.stop(),this.onTick_(),this},o.tickAfter=function(m){var l=this;return this.stop(),this.ticker_=new f(function(){l.onTick_()}).tickAfter(m),this},o.tickEvery=function(m){var l=this;return this.stop(),this.ticker_=new f(function(){var g;(g=l.ticker_)===null||g===void 0||g.tickAfter(m),l.onTick_()}).tickAfter(m),this},o.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},n}()},484:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(42);function f(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.then(function(o){return(0,u.Z)({err:null,res:o},n)}).catch(function(o){return(0,u.Z)({err:o,res:void 0},n)})}},705:function(v,c,i){"use strict";i.d(c,{C:function(){return o},y:function(){return n}});var u=i(644),f=i.n(u),e=new Map,n=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(m,l,g,E,O){var j=l[g*3],R=l[g*3+1],Z=l[E*3],T=l[E*3+1],G=l[O*3],D=l[O*3+1],C;if(e.has(m))C=e.get(m);else{var W=s.box3||new u.Box3;if(!s.box3){var S=m.parameters.shapes.getPoints();W.setFromArray(S.map(function(P){return[P.x,P.y,0]}).flat())}var k=W.getSize(new u.Vector3);s.split&&(k.y/=s.split),C={box:W,size:k},e.set(m,C)}var d=C.box,p=C.size,y=s.split?1-s.split:0;return[new u.Vector2((j-d.min.x)/p.x,(R-d.min.y)/p.y+y),new u.Vector2((Z-d.min.x)/p.x,(T-d.min.y)/p.y+y),new u.Vector2((G-d.min.x)/p.x,(D-d.min.y)/p.y+y)]},generateSideWallUV:function(m,l,g,E,O,j){var R=l[g*3],Z=l[g*3+1],T=l[g*3+2],G=l[E*3],D=l[E*3+1],C=l[E*3+2],W=l[O*3],S=l[O*3+1],k=l[O*3+2],d=l[j*3],p=l[j*3+1],y=l[j*3+2],P;if(e.has(l))P=e.get(l);else{var z=new u.Box3;z.setFromArray(l);var L=z.getSize(new u.Vector3);s.split&&(L.z/=1-s.split),P={box:z,size:L},e.set(l,P)}var w=P.box,M=P.size;return Math.abs(Z-D)<Math.abs(R-G)?[new u.Vector2((R-w.min.x)/M.x,(T-w.min.z)/M.z),new u.Vector2((G-w.min.x)/M.x,(C-w.min.z)/M.z),new u.Vector2((W-w.min.x)/M.x,(k-w.min.z)/M.z),new u.Vector2((d-w.min.x)/M.x,(y-w.min.z)/M.z)]:[new u.Vector2((Z-w.min.y)/M.y,(T-w.min.z)/M.z),new u.Vector2((D-w.min.y)/M.y,(C-w.min.z)/M.z),new u.Vector2((S-w.min.y)/M.y,(k-w.min.z)/M.z),new u.Vector2((p-w.min.y)/M.y,(y-w.min.z)/M.z)]}}},o=function(){e.clear()}},644:function(v){"use strict";v.exports=require("three")},943:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e){(e==null||e>f.length)&&(e=f.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=f[n];return o}},982:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(943);function f(e){if(Array.isArray(e))return(0,u.Z)(e)}},568:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});function u(e,n,o,s,m,l,g){try{var E=e[l](g),O=E.value}catch(j){o(j);return}E.done?n(O):Promise.resolve(O).then(s,m)}function f(e){return function(){var n=this,o=arguments;return new Promise(function(s,m){var l=e.apply(n,o);function g(O){u(l,s,m,g,E,"next",O)}function E(O){u(l,s,m,g,E,"throw",O)}g(void 0)})}}},438:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e){if(!(f instanceof e))throw new TypeError("Cannot call a class as a function")}},924:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e,n){return e in f?Object.defineProperty(f,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):f[e]=n,f}},375:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f){if(typeof Symbol!="undefined"&&f[Symbol.iterator]!=null||f["@@iterator"]!=null)return Array.from(f)}},270:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(){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,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(924);function f(e){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{},s=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(o).filter(function(m){return Object.getOwnPropertyDescriptor(o,m).enumerable}))),s.forEach(function(m){(0,u.Z)(e,m,o[m])})}return e}},342:function(v,c,i){"use strict";i.d(c,{Z:function(){return o}});var u=i(982),f=i(375),e=i(270),n=i(566);function o(s){return(0,u.Z)(s)||(0,f.Z)(s)||(0,n.Z)(s)||(0,e.Z)()}},566:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(943);function f(e,n){if(!!e){if(typeof e=="string")return(0,u.Z)(e,n);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return(0,u.Z)(e,n)}}}},X={};function b(v){var c=X[v];if(c!==void 0)return c.exports;var i=X[v]={exports:{}};return H[v](i,i.exports,b),i.exports}(function(){b.n=function(v){var c=v&&v.__esModule?function(){return v.default}:function(){return v};return b.d(c,{a:c}),c}})(),function(){b.d=function(v,c){for(var i in c)b.o(c,i)&&!b.o(v,i)&&Object.defineProperty(v,i,{enumerable:!0,get:c[i]})}}(),function(){b.o=function(v,c){return Object.prototype.hasOwnProperty.call(v,c)}}(),function(){b.r=function(v){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(v,"__esModule",{value:!0})}}();var F={};(function(){"use strict";b.r(F),b.d(F,{Chain:function(){return m},Timer:function(){return i.Z},claerUVGenerator:function(){return W.C},clearAllCache:function(){return G},clearCache:function(){return T},colorCorrection:function(){return O},disposeMesh:function(){return g.Z},getCache:function(){return D},getElementViewLeft:function(){return C.v},getElementViewTop:function(){return C.U},getUVGenerator:function(){return W.y},isPlainObject:function(){return j.Z},makePromiseCreator:function(){return v.Z},polar2Cartesian:function(){return l.Z},to:function(){return c.Z}});var v=b(282),c=b(484),i=b(618),u=b(568),f=b(438),e=b(42),n=b(342),o=b(666),s=b.n(o),m=function(){"use strict";function S(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,f.Z)(this,S),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,e.Z)({},{isdev:!1},d)}var k=S.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(p){return p.stop1()}),this},k.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},k.play=function(){var p=this;return(0,u.Z)(s().mark(function y(){var P;return s().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(P=p.chainedList[p.index],!(P&&p.isPlaying)){L.next=9;break}return L.next=4,Promise.all(P.map(function(w){return typeof w=="function"?w(p.repeatCount):w.start()}));case 4:return p.index+=1,L.next=7,p.play();case 7:L.next=17;break;case 9:if(!(!P&&p.isPlaying&&p.repeatCount<p.repeatNum)){L.next=16;break}return p.repeatCount+=1,p.index=0,L.next=14,p.play();case 14:L.next=17;break;case 16:!P&&p.isPlaying&&p.repeatCount===p.repeatNum&&p.stop();case 17:case"end":return L.stop()}},y)}))()},k.chain=function(){for(var p=arguments.length,y=new Array(p),P=0;P<p;P++)y[P]=arguments[P];var z=this;return(0,n.Z)(y).forEach(function(L){L instanceof S&&z.children.push(L)}),this.chainedList.push((0,n.Z)(y)),this},k.repeat=function(p){return this.repeatNum=p,this},k.timeout=function(p){return this.chain(function(){return new Promise(function(y){return setTimeout(y,p)})}),this},k.traverse=function(p){p(this),this.children.forEach(function(y){y.traverse(p)})},S}(),l=b(713),g=b(695),E=b(644);function O(S){if(S.material){var k=Array.isArray(S.material)?S.material:[S.material];k.forEach(function(d){var p,y;(p=d.color)===null||p===void 0||p.convertSRGBToLinear(),(y=d.emissive)===null||y===void 0||y.convertSRGBToLinear(),d.map&&(d.map.encoding=E.sRGBEncoding),d.emissiveMap&&(d.emissiveMap.encoding=E.sRGBEncoding)})}}var j=b(738),R=b(924),Z=require("idb-keyval"),T=Z.del,G=Z.clear,D=function(){var S=(0,u.Z)(s().mark(function k(d,p){var y,P,z,L,w,M;return s().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return y=p.version,B.next=4,(0,Z.get)(d);case 4:if(z=B.sent,!(z&&z[y])){B.next=9;break}P=z[y],B.next=15;break;case 9:return B.next=11,(0,c.Z)(fetch(d).then(function(r){if(r.ok)return r.blob();throw new Error}));case 11:L=B.sent,w=L.res,M=L.err,M||(P=w,(0,Z.set)(d,(0,R.Z)({},y,w)));case 15:return B.abrupt("return",P?{url:URL.createObjectURL(P)}:{url:d});case 16:case"end":return B.stop()}},k)}));return function(d,p){return S.apply(this,arguments)}}(),C=b(490),W=b(705)})(),module.exports=F})();
@@ -1 +1 @@
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};
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",x="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===x){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=x,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?x:V,R.arg===M)continue;return{value:R.arg,done:i.done}}else R.type==="throw"&&(p=x,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,x,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(),(x=n.emissiveMap)===null||x===void 0||x.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],x=_[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,(x-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],x=_[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,(x-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.y,(x-y.min.z)/b.z),new s.Vector2((Z-y.min.y)/b.y,(A-y.min.z)/b.z),new s.Vector2((K-y.min.y)/b.y,(B-y.min.z)/b.z),new s.Vector2((w-y.min.y)/b.y,(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 S={};(function(){P.d(S,{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),x=w=>{var k={};return P.d(k,w),k},M=w=>()=>w,Z=x({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=S.qo,tt=S.B7,rt=S.CL,et=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,_t=S.Mf,lt=S.Rl,pt=S.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};